blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
2
625
content_id
stringlengths
40
40
detected_licenses
sequencelengths
0
47
license_type
stringclasses
2 values
repo_name
stringlengths
5
116
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
643 values
visit_date
timestamp[ns]
revision_date
timestamp[ns]
committer_date
timestamp[ns]
github_id
int64
80.4k
689M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
16 values
gha_event_created_at
timestamp[ns]
gha_created_at
timestamp[ns]
gha_language
stringclasses
85 values
src_encoding
stringclasses
7 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
1 class
length_bytes
int64
4
6.44M
extension
stringclasses
17 values
content
stringlengths
4
6.44M
duplicates
sequencelengths
1
9.02k
9c0164d25ddd74bbe6685cf3becb544ac324211d
0e854a4d0a1486efc678c8c99f15c8ed74e6ddd8
/Examples/TabBarTransitionsExample/TabBarTransitionsExample/TransitionStyle.swift
cd187f13be18982981af4084850ca0a91165f4c9
[ "MIT" ]
permissive
chrisiKern/Transition
f668fddb4e54ee16a471fa57fd1ae4c0e6ac7f32
24ac29d41331c4c886d1f8a7f3b110e0f1c71cd6
refs/heads/master
2021-07-25T23:25:52.396728
2017-11-08T14:27:18
2017-11-08T14:27:18
109,984,056
1
0
null
null
null
null
UTF-8
Swift
false
false
2,130
swift
// // MIT License // // Copyright (c) 2017 Touchwonders Commerce B.V. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. import UIKit enum Shape: Int { case circle case triangle case square static var all: [Shape] { return [.circle, .triangle, .square] } var image: UIImage? { switch self { case .circle: return UIImage(named: "cicrle_tabbar")?.withRenderingMode(.alwaysOriginal) case .triangle: return UIImage(named: "triangle_tabbar")?.withRenderingMode(.alwaysOriginal) case .square: return UIImage(named: "square_tabbar")?.withRenderingMode(.alwaysOriginal) } } var selectedImage: UIImage? { switch self { case .circle: return UIImage(named: "cicrle_tabbar_selected")?.withRenderingMode(.alwaysOriginal) case .triangle: return UIImage(named: "triangle_tabbar_selected")?.withRenderingMode(.alwaysOriginal) case .square: return UIImage(named: "square_tabbar_selected")?.withRenderingMode(.alwaysOriginal) } } }
[ 194560, 395267, 196612, 196615, 395271, 395274, 108279, 395277, 395278, 395279, 395280, 395281, 395282, 395283, 407569, 108281, 395286, 395287, 395289, 395290, 196638, 395295, 395296, 196641, 98341, 61478, 98344, 98345, 98349, 329778, 174135, 354359, 124987, 174139, 354364, 229438, 124988, 229440, 229441, 395328, 229443, 174148, 229444, 395332, 327751, 174152, 395333, 395334, 229449, 378951, 174159, 229456, 112721, 174161, 106580, 106582, 106584, 106585, 106586, 106587, 112730, 174171, 284783, 125048, 229504, 125057, 125062, 125064, 125065, 235658, 319626, 125066, 229524, 229526, 303255, 303256, 229532, 125087, 215205, 129190, 215206, 215208, 215211, 215212, 215215, 241846, 241852, 241859, 241862, 317638, 241864, 317640, 241866, 241868, 241870, 241873, 262353, 241877, 241878, 262359, 97329, 241879, 106713, 106714, 262366, 224, 106720, 106725, 241894, 241897, 241901, 241903, 241904, 176370, 241907, 241908, 176373, 241910, 260342, 106742, 437415, 176378, 241916, 141565, 141566, 141569, 241923, 141572, 241928, 141577, 141578, 241930, 141576, 241931, 241934, 141583, 241936, 241937, 141586, 141588, 12565, 227604, 227607, 227608, 141593, 141594, 227610, 141595, 141597, 241944, 12569, 241952, 141596, 141602, 241954, 141598, 141599, 289062, 141600, 141603, 241957, 141606, 141608, 141612, 241962, 289067, 289068, 12592, 141609, 289074, 241963, 97347, 289078, 141622, 141627, 215356, 141629, 141632, 141634, 241989, 227609, 213319, 141640, 141641, 141642, 141643, 213320, 241992, 241996, 241998, 241999, 141646, 242002, 141651, 262475, 227612, 242006, 282967, 215384, 141655, 141654, 227613, 141660, 168285, 282969, 141663, 141664, 227614, 141670, 172391, 141674, 141677, 141679, 141681, 287090, 375154, 190836, 334196, 190840, 190841, 430456, 190843, 190844, 430458, 190842, 375165, 375168, 141696, 141700, 141701, 141702, 375172, 430471, 141707, 430476, 430475, 141708, 141711, 430483, 217492, 217494, 197016, 197018, 197019, 197021, 295330, 295331, 197029, 430502, 168359, 303550, 160205, 160208, 381398, 319972, 305638, 272872, 223741, 192234, 61971, 191006, 191007, 272931, 57893, 272934, 57896, 328232, 420394, 57899, 57900, 295467, 57903, 57904, 57905, 57906, 272944, 158257, 336445, 336446, 336450, 336451, 336454, 336455, 336457, 336460, 336464, 336465, 336466, 336467, 55890, 336469, 336470, 336471, 336472, 336473, 336474, 437297, 336478, 336479, 336480, 336481, 111202, 336482, 336483, 272994, 111206, 336488, 336489, 273003, 273021, 273023, 437305, 297615, 297620, 437310, 297625, 297636, 135854, 135861, 242361, 244419, 244421, 66247, 244427, 248524, 127693, 244430, 66257, 66261, 127702, 127703, 62174, 334562, 334563, 127716, 334564, 62183, 127727, 127729, 244469, 244470, 318199, 318200, 142073, 164601, 316155, 142076, 228510, 334590, 318207, 244480, 334591, 142078, 318211, 334596, 142083, 142087, 334600, 318218, 334603, 334604, 334602, 334606, 318220, 318223, 334607, 142095, 318228, 318231, 318233, 318234, 318236, 318237, 318239, 318241, 187173, 318246, 187174, 187176, 187175, 187177, 187179, 187180, 187178, 141601, 314167, 316216, 396088, 396089, 396091, 396092, 241955, 396094, 396095, 148287, 316224, 396098, 314179, 396101, 279366, 279367, 396104, 279369, 396110, 396112, 396114, 396115, 396117, 396118, 396119, 396120, 396121, 396122, 396123, 241961, 396125, 396126, 396127, 396128, 396129, 396133, 299880, 396137, 162668, 299884, 187248, 396147, 396151, 248696, 396153, 187258, 187259, 187260, 322430, 437356, 60304, 201619, 60308, 60318, 60319, 60322, 60323, 60324, 60327, 60328, 312481, 185258, 185259, 60331, 23469, 23470, 185262, 23472, 23473, 60337, 23475, 23474, 23476, 185267, 23479, 213935, 287674, 23483, 23487, 185280, 242796, 23490, 281539, 23492, 281538, 23494, 185286, 23502, 228306, 23508, 23515, 259036, 23517, 40089, 23523, 23531, 203755, 23533, 341058, 152560, 242675, 23552, 171008, 40096, 23559, 23560, 23561, 437258, 437256, 437262, 40098, 23572, 437269, 23574, 23575, 437273, 23580, 23581, 437277, 40101, 23585, 437281, 23590, 23591, 23594, 23596, 23599, 189488, 97327, 187442, 144435, 187444, 189490, 189492, 189493, 144440, 144441, 187447, 189491, 341052, 23607, 341054, 341055, 97339, 23612, 437314, 144442, 341060, 144444, 222278, 23616, 341057, 341062, 341063, 341066, 341068, 189508, 437326, 40109, 40110, 185428, 285781, 203862, 285782, 189502, 285785, 312407, 437340, 115805, 115806, 115807, 293982, 115809, 115810, 437345, 312413, 437349, 185446, 293990, 312423, 115817, 242794, 115819, 185452, 115820, 185454, 115823, 185455, 115825, 312427, 115827, 242803, 115829, 185457, 242807, 142450, 437364, 437369, 437371, 294012, 142463, 294016, 205959, 437384, 437390, 437392, 437394, 437396, 189590, 40088, 312473, 312474, 189594, 208026, 40092, 312478, 40095, 312479, 208027, 189598, 208029, 208033, 27810, 228512, 228513, 437416, 189607, 189609, 189610, 189612, 312493, 312489, 189608, 208041, 189617, 437426, 312497, 437428, 312501, 189619, 437431, 312498, 437433, 189621, 189623, 189626, 312502, 312504, 322751, 437440, 437436, 38081, 437443, 437445, 437446, 292041, 292042, 437451, 38092, 437453, 128874, 181455, 437456, 437457, 292049, 437458, 128875, 152789, 203990, 437424, 203991, 152795, 204000, 204003, 339176, 339177, 152821, 208117, 152825, 294137, 294138, 279818, 206094, 279823, 206097, 206098, 294162, 206102, 206104, 206108, 181533, 206109, 425247, 294181, 27943, 181544, 294183, 27944, 40105, 27948, 312476, 181553, 181559, 173368, 206138, 151285, 245058, 173379, 312480, 152906, 152907, 152908, 152909, 152910, 290123, 312482, 290125, 290126, 290127, 290130, 312483, 3119, 290135, 290136, 245081, 290137, 290139, 378206, 378208, 64865, 222562, 222563, 222566, 228717, 222573, 228721, 171377, 222577, 222579, 222581, 222582, 222587, 222590, 222591, 54655, 173441, 222596, 222597, 177543, 222599, 222601, 222600, 222603, 222604, 54669, 222605, 222606, 222607, 54673, 363913, 54666, 54678, 54680, 279961, 279969, 54692, 152998, 54698, 54700, 54701, 155377, 54703, 153009, 298431, 212420, 370118, 153037, 279944, 153049, 153051, 189496, 157151, 222689, 222692, 157157, 222693, 157159, 157158, 112111, 112115, 112117, 112120, 65016, 40451, 280068, 40453, 40454, 112131, 40455, 40458, 40460, 40463, 112144, 112145, 40466, 40469, 40471, 40475, 40477, 40479, 40480, 40481, 40482, 362020, 362022, 116267, 282156, 189595, 34359, 34362, 316993, 173634, 173635, 316995, 316997, 263751, 173639, 173646, 106085, 319081, 314987, 319085, 319088, 319089, 300660, 300661, 300662, 300663, 319094, 319098, 319101, 319103, 52882, 394899, 394900, 52886, 52887, 394905, 394908, 394910, 394912, 52897, 52896, 52899, 52900, 339622, 144437, 147115, 394925, 144438, 151218, 394935, 292536, 321210, 292544, 108230, 144443, 108234, 296682, 108240, 144445, 296660, 108245, 212694, 34516, 296685, 34522, 144447, 34531, 192230, 192231, 192232, 296681, 34538, 296679, 34540, 34541, 216812, 216814, 216815, 216816, 216818, 216819, 296684, 296687, 216822, 296688, 296691, 296692, 216826, 296698, 216828, 216829, 296699, 296700, 216832, 216833, 216834, 296703, 216836, 216837, 216838, 296707, 296708, 296710, 296712, 296713, 313099, 141607, 313101, 296694, 313104, 276232, 276236, 313102, 313108, 313111, 313112, 149274, 149275, 159518, 149280, 159523, 296701, 227116, 227119, 296704, 321342, 210755, 210756, 210757, 210758, 296706, 321353, 218959, 218960, 120655, 120656, 218963, 218964, 120657, 218962, 223064, 223065, 180058, 180059, 229209, 223069, 223070, 229213, 169824, 229217, 169826, 292705, 223076, 237413, 169830, 292709, 223075, 128873, 180070, 169835, 227180, 128876, 169837, 128878, 223086, 223087, 128881, 128882, 227188, 128883, 128884, 169843, 227183, 141181, 327550, 169856, 108419, 141189, 141198, 108431, 108432, 116622, 141202, 108436, 141208, 219033, 108448, 219040, 141219, 219043, 219044, 219045, 141223, 141220, 141225, 141228, 141229, 108460, 108462, 229294, 229295, 437402, 141235, 141246, 319426, 173394, 141253, 319432, 141264, 59348, 59349, 23601, 141272, 141273, 437404, 40931, 40932, 141284, 40934, 141650, 141290, 40940, 40941, 141293, 395247, 141295, 174063, 231406, 174067, 174066, 141292, 141297, 237559, 174074, 395259, 194558, 194559 ]
5e5cd459bb1e26cdffc86a052a3f1c36ebdbece3
d02094deaba4279f35935ff904be314c39ec5fdf
/Protobarendt/glazenUitlegViewController.swift
6c4c0606393c00aa361825c56820dbc03bff72f0
[]
no_license
TravelAdventureGames/RemoteBarend
a1a9c0591ba3d886c7730eb4c151337cfb62fa3b
03331c2e02bc7f523220b7b3503ad3ca1cb569d9
refs/heads/master
2021-03-22T00:29:02.009649
2017-08-27T22:07:48
2017-08-27T22:07:48
101,583,294
0
0
null
null
null
null
UTF-8
Swift
false
false
4,388
swift
// // glazenUitlegViewController.swift // Protobarendt // // Created by Martijn van Gogh on 13-10-15. // Copyright © 2015 Martijn van Gogh. All rights reserved. // import UIKit import AVFoundation class glazenUitlegViewController: UIViewController { //var textArr = ["Al in 1657 was de slingerklok door deze krullebol, Christaan Huygens uitgevonden. Zijn klok was alleen niet bruikbaar aan boord van een schip, omdat het schommelen de slinger van de klok zou ontregelen. Om toch te weten hoe laat het was, draaide men daarom ‘glazen’ aan boord.", "Deze glazen waren zandlopers die er precies een half uur over deden om door te lopen. Vervolgens keerde de roerganger het glas om en luidde de scheepsklok. Ook draaide luie roergangers stiekem de zandloper wel eens eerder om, zodat ze snel naar hun nest konden (LOL).", "Daarom werd het systeem dagelijks opnieuw ingesteld. Met behulp van een speciaal instrument, een sextant, werd bepaald wanneer de zon die dag op zijn hoogste stand stond. Het was dan 12:00 uur, de zandloper werd gekeerd en het systeem begon weer van voor af aan."] var textArr = ["Om te weten hoe laat het is, draait men in de VOC-tijd ‘glazen’ aan boord van een schip. Deze glazen zijn zandlopers die er precies een half uur over doen om door te lopen. Dan keert de roerganger het glas om en luidt de scheepsklok. Soms draait een luie zeeman de zandloper stiekem wel eens eerder om, zodat hij lekker naar bed kan (LOL).", "Daarom wordt het systeem dagelijks opnieuw ingesteld. Met behulp van een speciaal instrument, een sextant, wordt bepaald wanneer de zon die dag op zijn hoogste stand staat. Het is dan 12:00 uur, de zandloper wordt omgekeerd en het systeem begint weer van voor af aan."] var counter = 1 @IBOutlet var buttLabel: UIButton! @IBOutlet var labelText: UILabel! @IBOutlet var imageSchreiers: UIImageView! @IBAction func swipeLeft(sender: AnyObject) { buttonPressed(self) } @IBAction func buttonPressed(sender: AnyObject) { counter++ if counter < 3 { //maakt een crossfade (crossdisolve) op basis van div images in 1 imageview! let toImage = UIImage(named:"glazen\(counter + 1).jpg") UIView.transitionWithView(self.imageSchreiers, duration:1.5, options: UIViewAnimationOptions.TransitionCrossDissolve, animations: { self.imageSchreiers.image = toImage }, completion: nil) labelText.text = textArr[counter - 1] } else if counter == 3 { self.performSegueWithIdentifier("naarGlas", sender: nil) } } override func viewDidLoad() { super.viewDidLoad() imageSchreiers.image = UIImage(named: "glazen2.jpg") labelText.text = textArr[counter - 1] buttLabel.layer.cornerRadius = 3 buttLabel.layer.shadowColor = UIColor.grayColor().CGColor buttLabel.layer.shadowOpacity = 0.8 buttLabel.layer.shadowOffset = CGSizeMake(1.0, 1.0) } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } /*override func viewDidAppear(animated: Bool) { let alert1 = UIAlertController(title: "Allrighty!", message: "Je bent in de buurt van het Scheepvaartmuseum, een gebouw uit 1556 dat oorspronkelijk een pakhuis was. Loop door de ingang naar de binnenplaats voor de volgende opdracht!", preferredStyle: UIAlertControllerStyle.Alert) alert1.addAction(UIAlertAction(title: "OK", style: .Default, handler: { (action) -> Void in })) self.presentViewController(alert1, animated: true, completion:nil) let bgMusicURL:NSURL = NSBundle.mainBundle().URLForResource("ting", withExtension: "wav")! do { bgMusic = try AVAudioPlayer(contentsOfURL: bgMusicURL, fileTypeHint: nil) } catch _ { return //if it doesn't exist, don't play it } bgMusic.numberOfLoops = 1 bgMusic.prepareToPlay() bgMusic.play() }*/ }
[ -1 ]
c3900a8daf7301c990e9294c4fb43b97a61a52de
2c409f36add82efd7b52399c0abe349a5251ce77
/SSS/Helpers/LocationManager.swift
415a0545d4e8410fcc31617413a85d1e75700c00
[]
no_license
AditiSrivastava20/STATESAFESTOP
d2b273e034cef6c637245680afb25d0c2ebaa8b1
74a332411d542d8cfe5fc6058d4a6a45152a80cf
refs/heads/master
2021-08-31T08:51:29.513749
2017-05-12T13:29:18
2017-05-12T13:29:18
114,928,395
0
0
null
null
null
null
UTF-8
Swift
false
false
4,035
swift
// // LocationManager.swift // Glam360 // // Created by cbl16 on 6/28/16. // Copyright © 2016 Gagan. All rights reserved. // import UIKit import Foundation import UIKit import CoreLocation struct Location : CustomStringConvertible { var current_lat : String? var current_lng : String? var current_formattedAddr : String? var current_city : String? var description: String{ return self.appendOptionalStrings(withArray: [current_formattedAddr]) } func appendOptionalStrings(withArray array : [String?]) -> String { return array.flatMap{$0}.joined(separator: " ") } } typealias LocationCompletionHandler = ((_ latitude:Double, _ longitude:Double, _ location:String)->())? class LocationManager: NSObject { static let sharedInstance : LocationManager = { let instance = LocationManager() return instance }() override init() { } /* Private variables */ fileprivate var completionHandler:LocationCompletionHandler var currentLocation : Location? = Location() let locationManager = CLLocationManager() func startTrackingUser(_ completionHandler:((_ latitude:Double, _ longitude:Double, _ location:String)->())? = nil){ // For use in foreground self.completionHandler = completionHandler self.locationManager.delegate = self self.locationManager.desiredAccuracy = kCLLocationAccuracyBest self.locationManager.startUpdatingLocation() } func setupLocationManger() { locationManager.requestWhenInUseAuthorization() } } extension LocationManager : CLLocationManagerDelegate { private func locationManager(manager: CLLocationManager, didChangeAuthorizationStatus status: CLAuthorizationStatus) { if status == CLAuthorizationStatus.authorizedWhenInUse || status == CLAuthorizationStatus.authorizedAlways { locationManager.startUpdatingLocation() } } func locationManager(_ manager: CLLocationManager, didFailWithError error: Error) { print(error.localizedDescription) } func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) { guard let firstLocation = locations.first else{return} self.locationManager.stopUpdatingLocation() self.locationManager.delegate = nil CLGeocoder().reverseGeocodeLocation(firstLocation) {[unowned self] (placemarks, error) in if error != nil { print("eror") Loader.shared.stop() Alerts.shared.show(alert: .alert, message: "Check your internet connection", type: .error) } self.currentLocation?.current_lat = "\(firstLocation.coordinate.latitude)" self.currentLocation?.current_lng = "\(firstLocation.coordinate.longitude)" guard let bestPlacemark = placemarks?.first else{return} self.currentLocation?.current_city = bestPlacemark.locality self.currentLocation?.current_formattedAddr = self.appendOptionalStrings(withArray: [bestPlacemark.subThoroughfare , bestPlacemark.thoroughfare , bestPlacemark.locality , bestPlacemark.country]) print(self.currentLocation?.current_formattedAddr ?? "") print(self.currentLocation?.current_city ?? "") if(self.completionHandler != nil){ self.completionHandler?(firstLocation.coordinate.latitude, firstLocation.coordinate.longitude, (self.currentLocation?.current_formattedAddr)!) } } } func appendOptionalStrings(withArray array : [String?]) -> String { return array.flatMap{$0}.joined(separator: " ") } }
[ -1 ]
3f5fa8450e29f6ac3688dca92998bac3114b05fd
0fc669ddadbd746f356888286a22b02edcff9426
/Exemplo11/Exemplo11/ViewControllerDetail.swift
f590c909e924899c0c2f4f10549445a9e99bb60d
[]
no_license
netfanely/examplesUFGiOS
8529301b1538227b0af93fcbf7aadf5d94e298cb
bc12315e2eca75c9d44dd7e030bb16343adb5e8f
refs/heads/master
2020-05-15T12:20:34.788728
2019-04-19T17:09:01
2019-04-19T17:09:01
182,260,607
0
0
null
null
null
null
UTF-8
Swift
false
false
1,269
swift
/************************************************************* Nome: Exemplo11 Descricao: exemplo demonstra a troca de telas (Aplicativo MyPhome) Autor: Silvano Malfatti Data: 23/07/2018 Local: TCE **************************************************************/ import UIKit class ViewControllerDetail: UIViewController { @IBOutlet weak var vrImageView: UIImageView! @IBOutlet weak var vrLabel: UILabel! public var name:String? public var image: UIImage? override func viewDidLoad() { super.viewDidLoad() } override func viewWillAppear(_ animated: Bool) { vrLabel.text = name vrImageView.image = image super.viewWillAppear(animated) } 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 ]
a0b00eebccde69c7b0cb304ba0d37a785c0874c3
2e5a570818780d8fc1cb1480e080cecfa891a0e9
/box/Metal/Spatial/MetalSpatialDirectionNegative.swift
6de90af1353c6d69ae3cf8c52d84e08beb648a65
[ "MIT" ]
permissive
sysidos/box
1919fb3555db0392de78184fedafbd734884eb8b
72c9848017e2fed2b8358e2f52edbc8d21f1a4f0
refs/heads/master
2021-06-18T11:15:03.186536
2017-07-07T09:45:30
2017-07-07T09:45:30
null
0
0
null
null
null
null
UTF-8
Swift
false
false
359
swift
import Foundation class MetalSpatialDirectionNegative:MetalSpatialDirection { private let kTop:Float = 0 private let kBottom:Float = 1 private let kLeft:Float = 1 private let kRight:Float = 0 init() { super.init( top:kTop, bottom:kBottom, left:kLeft, right:kRight) } }
[ -1 ]
a6237d153a908c6be3d65788b80e33e6fda39ec5
35dd342d42e8e2483aede30d7bee51db39234400
/Calculator/Calculator/CalculatorButton.swift
acef3941da8589b170453e5f97ff2dd5e4e855a6
[ "Apache-2.0" ]
permissive
anatta-feng/SwiftUILearn
66431a3e471f96ad936735a654b5b1121c17592f
9fdb54501f98aa12e9088554bc16662ff7beaa9e
refs/heads/master
2023-09-03T21:07:36.561392
2020-05-04T16:09:59
2020-05-04T16:09:59
null
0
0
null
null
null
null
UTF-8
Swift
false
false
688
swift
// // CalculatorButton.swift // HelloWorld // // Created by 冯旭超 on 2020/3/19. // Copyright © 2020 冯旭超. All rights reserved. // import SwiftUI struct CalculatorButton: View { let fontSize: CGFloat = 38 let title: String let size: CGSize let backgroundColorName: String let action: () -> Void var body: some View { Button(action: action) { Text(title) .font(.system(size: fontSize)) .foregroundColor(.white) .frame(width: size.width, height: size.width) .background(Color(backgroundColorName)) .cornerRadius(size.width / 2) } } }
[ -1 ]
dc0d5764584a1c3de29c37c614c9990467b4d21f
361f9d62e613756c60e37f984cf461b8aa7271a0
/FuelLog/AppDelegate.swift
81047e2047681cee5e39733810f623e9d7744dbb
[]
no_license
pecen/iFuelLog
2f2f1bf7700f66bb6e0f1417eb4bb7bf27192dce
d41ef184c5743b04bd1be692012ef3bdc6d2a2a5
refs/heads/master
2020-08-28T15:13:53.849842
2019-11-07T01:58:36
2019-11-07T01:58:36
217,736,262
0
0
null
null
null
null
UTF-8
Swift
false
false
576
swift
// // AppDelegate.swift // FuelLog // // Created by Peter Centellini on 2019-10-26. // Copyright © 2019 Redesajn Interactive Solutions. All rights reserved. // import UIKit import Firebase @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. FirebaseApp.configure() return true } }
[ 374117, 333708, 340718, 302448, 326801, 217140, 358175, 245023 ]
1de7eae68e78be5c94a3b03218db3d69e01709d5
ea85aea29ef72b34d20f704979cb47463b78914b
/Sources/PackageGraph/VersionSetSpecifier.swift
2bb1c20ab3a29e02499f4e0535931175402f792a
[ "Swift-exception", "Apache-2.0", "BSD-3-Clause", "LicenseRef-scancode-unknown-license-reference", "MIT" ]
permissive
krzyzanowskim/swift-package-manager
5fbc97f28e5b3ed71d80d7c8e3b868f548516881
a5f7859ef5d9b1ff97788e8fa0a71db65e011ce4
refs/heads/main
2021-11-28T14:01:19.399208
2021-04-24T05:15:25
2021-04-24T05:15:25
324,619,989
1
1
Apache-2.0
2020-12-26T19:17:19
2020-12-26T19:17:18
null
UTF-8
Swift
false
false
15,843
swift
/* This source file is part of the Swift.org open source project Copyright (c) 2019 Apple Inc. and the Swift project authors Licensed under Apache License v2.0 with Runtime Library Exception See http://swift.org/LICENSE.txt for license information See http://swift.org/CONTRIBUTORS.txt for Swift project authors */ import TSCUtility /// An abstract definition for a set of versions. public enum VersionSetSpecifier: Hashable { /// The universal set. case any /// The empty set. case empty /// A non-empty range of version. case range(Range<Version>) /// The exact version that is required. case exact(Version) /// A range of disjoint versions (sorted). case ranges([Range<Version>]) } extension VersionSetSpecifier { var isExact: Bool { switch self { case .any, .empty, .range, .ranges: return false case .exact: return true } } } extension VersionSetSpecifier { public static func union(from range: Swift.Range<Version>) -> VersionSetSpecifier { return .union(from: [range]) } public static func union(from ranges: [Swift.Range<Version>]) -> VersionSetSpecifier { switch ranges.count { case 0: return .empty case 1: let range = ranges[0] // FIXME: Can we avoid this? testConflict1 goes into a loop if we don't do this. if range.lowerBound.nextPatch() == range.upperBound { return .exact(range.lowerBound) } return .range(range) default: let ranges = ranges.sorted(by: { $0.lowerBound < $1.lowerBound }) var result: [Range<Version>] = [] for range in ranges { // We can merge if next range starts immediately after this one or if they overlap. if let last = result.last, last.upperBound == range.lowerBound || range.overlaps(last) || last.lowerBound.nextPatch() == range.lowerBound { let newResult: Range<Version> if range.lowerBound == range.upperBound { // 1.0.0..<1.0.1 U 1.0.1..<1.0.1 is 1.0.0..<1.0.2 let version = range.lowerBound if last.upperBound == version { newResult = last.lowerBound ..< version.nextPatch() } else { continue } } else { let lower = min(last.lowerBound, range.lowerBound) let upper = max(last.upperBound, range.upperBound) newResult = lower ..< upper } result[result.count - 1] = newResult } else { result.append(range) } } if result.count == 1 { return .range(result[0]) } return .ranges(result) } } public func union(_ rhs: VersionSetSpecifier) -> VersionSetSpecifier { switch (self, rhs) { case (_, .any), (.any, _): return .any case (.empty, _): return rhs case (_, .empty): return self case (.exact(let v1), .exact(let v2)): if v1 == v2 { return self } return VersionSetSpecifier.union(from: [v1..<v1, v2..<v2]) case (.range(let v2), .exact(let v1)), (.exact(let v1), .range(let v2)): return VersionSetSpecifier.union(from: [v1..<v1, v2]) case (.ranges(let ranges), .exact(let exact)), (.exact(let exact), .ranges(let ranges)): return VersionSetSpecifier.union(from: [exact..<exact] + ranges) case (.range(let lhs), .range(let rhs)): return VersionSetSpecifier.union(from: [lhs, rhs]) case (.ranges(let ranges), .range(let range)), (.range(let range), .ranges(let ranges)): return VersionSetSpecifier.union(from: [range] + ranges) case (.ranges(let r1), .ranges(let r2)): return VersionSetSpecifier.union(from: r1 + r2) } } } extension VersionSetSpecifier { /// Compute the intersection of two set specifiers. public func intersection(_ rhs: VersionSetSpecifier) -> VersionSetSpecifier { switch (self, rhs) { case (.any, _): return rhs case (_, .any): return self case (.empty, _): return .empty case (_, .empty): return .empty case (.range(let lhs), .range(let rhs)): if let result = VersionSetSpecifier.intersection(lhs, rhs) { return .range(result) } return .empty case (.exact(let v), _): if rhs.contains(v) { return self } return .empty case (_, .exact(let v)): if contains(v) { return rhs } return .empty case (.ranges(let ranges), .range(let range)), (.range(let range), .ranges(let ranges)): return .intersection(ranges, [range]) case (.ranges(let lhs), .ranges(let rhs)): return .intersection(lhs, rhs) } } fileprivate static func intersection(_ lhs: Range<Version>, _ rhs: Range<Version>) -> Range<Version>? { let start = Swift.max(lhs.lowerBound, rhs.lowerBound) let end = Swift.min(lhs.upperBound, rhs.upperBound) if start < end { return start..<end } return nil } fileprivate static func intersection(_ lhs: [Range<Version>], _ rhs: [Range<Version>]) -> VersionSetSpecifier { var lhsItr = lhs.makeIterator() var rhsItr = rhs.makeIterator() var currentLhs = lhsItr.next() var currentRhs = rhsItr.next() var result: [Range<Version>] = [] while let lhs = currentLhs, let rhs = currentRhs { if let current = VersionSetSpecifier.intersection(lhs, rhs) { result.append(current) } // Move the one with lower upper bound so large ranges have a chance to match multiple // small ranges they contain. if lhs.upperBound < rhs.upperBound { currentLhs = lhsItr.next() } else { currentRhs = rhsItr.next() } } return .union(from: result) } } extension VersionSetSpecifier { public func difference(_ rhs: VersionSetSpecifier) -> VersionSetSpecifier { switch (self, rhs) { case (_, .any): return .empty case (.any, _): fatalError() case (.empty, _): return .empty case (_, .empty): return self case (.exact(let v1), .exact(let v2)): if v1 == v2 { return .empty } return self case (.exact(let lhs), .range(let rhs)): if rhs.contains(version: lhs) { return .empty } return .exact(lhs) case (.range(let lhs), .exact(let rhs)): if !lhs.contains(version: rhs) { return .range(lhs) } if lhs.lowerBound == rhs { // Return empty if the range represents the exact version. if lhs.lowerBound == lhs.upperBound { return .empty } return .range(rhs.nextPatch()..<lhs.upperBound) } return .union(from: [lhs.lowerBound..<rhs, rhs.nextPatch()..<lhs.upperBound]) case (.ranges(let ranges), .exact(let exact)): var result = [Range<Version>]() for range in ranges { // FIXME: is this worth merging with the logic in (range, exact) case above? if !range.contains(version: exact) { result.append(range) } else if range.lowerBound == exact { if range.lowerBound == range.upperBound { continue } if exact.nextPatch() < range.upperBound { result.append(exact.nextPatch()..<range.upperBound) } } else { result += [range.lowerBound..<exact] if exact.nextPatch() < range.upperBound { result += [exact.nextPatch()..<range.upperBound] } } } return .union(from: result) case (.exact(let exact), .ranges(let ranges)): for range in ranges { if range.contains(version: exact) { return .empty } } return self case (.range(let lhs), .range(let rhs)): if lhs == rhs { return .empty } if !lhs.overlaps(rhs) { return .range(lhs) } var result = [Range<Version>]() if lhs.lowerBound < rhs.lowerBound { result.append(lhs.lowerBound..<rhs.lowerBound) } if rhs.upperBound < lhs.upperBound { result.append(rhs.upperBound..<lhs.upperBound) } return .union(from: result) case (.range(let inputRange), .ranges(let ranges)): var result = [Range<Version>]() var lhs = inputRange for range in ranges { // Skip the ranges that don't overlap with the current lhs range. // FIXME: We can exit the loop early when the range goes above lhs. if !range.overlaps(lhs) { continue } let diff = VersionSetSpecifier.range(lhs).difference(.range(range)) switch diff { case .empty: return .empty case .any: fatalError("unexpected any result") case .exact(let v): lhs = v..<v.nextPatch() case .range(let r): lhs = r case .ranges(let rs): // If the difference end up being a disjoint set, append the first one to // our result and continue reducing the second set. precondition(rs.count == 2, "expected 2 elements in ranges \(rs)") result.append(rs[0]) lhs = rs[1] } } return .union(from: result + [lhs]) case (.ranges(_), .range(let r)): return self.difference(.ranges([r])) case (.ranges(let lhs), .ranges(let rhs)): // Based on the difference method in https://github.com/dart-lang/pub_semver/blob/master/lib/src/version_union.dart var lhsItr = lhs.makeIterator() var rhsItr = rhs.makeIterator() var currentLHS = lhsItr.next()! var currentRHS = rhsItr.next()! var result: [Range<Version>] = [] func moveRHS() -> Bool { if let value = rhsItr.next() { currentRHS = value return true } // RHS is done so add remaining on LHS ranges to the final result. result.append(currentLHS) while let value = lhsItr.next() { result.append(value) } return false } func moveLHS(addCurrentLHS: Bool = true) -> Bool { if addCurrentLHS { result.append(currentLHS) } if let value = lhsItr.next() { currentLHS = value return true } return false } outer: while true { if currentRHS.isLowerThan(currentLHS) { if !moveRHS() { break outer } continue } if currentRHS.isHigherThan(currentLHS) { if !moveLHS() { break outer } continue } var diff = VersionSetSpecifier.range(currentLHS).difference(.range(currentRHS)) // Transform exact to a range so it is handled in the range case below. if case .exact(let v) = diff { diff = .range(v..<v.nextPatch()) } switch diff { case .empty: if !moveLHS(addCurrentLHS: false) { break outer } case .any, .exact: fatalError("Unexpected result \(diff)") case .range(let r): currentLHS = r // Move the one with lower upper bound so large ranges have a chance to match multiple // small ranges they contain. if currentLHS.upperBound < currentRHS.upperBound { if !moveRHS() { break outer } } else { if !moveLHS() { break outer } } case .ranges(let rs): // If the difference end up being a disjoint set, append the first one to // our result and continue reducing the second set. precondition(rs.count == 2, "expected 2 elements in ranges \(rs)") result.append(rs[0]) currentLHS = rs[1] if !moveRHS() { break outer } } } return .union(from: result) } } } extension VersionSetSpecifier { /// Check if the set contains a version. public func contains(_ version: Version) -> Bool { switch self { case .empty: return false case .range(let range): return range.contains(version: version) case .ranges(let ranges): return ranges.contains(where: { $0.contains(version: version) }) case .any: return true case .exact(let v): return v == version } } } extension VersionSetSpecifier: CustomStringConvertible { public var description: String { switch self { case .any: return "any" case .empty: return "empty" case .ranges(let ranges): return "{" + ranges.map{ if $0.lowerBound == $0.upperBound { return $0.lowerBound.description } return $0.lowerBound.description + "..<" + $0.upperBound.description }.joined(separator: ", ") + "}" case .range(let range): var upperBound = range.upperBound // Patch the version range representation. This shouldn't be // required once we have custom version range structure. if upperBound.minor == .max && upperBound.patch == .max { upperBound = Version(upperBound.major + 1, 0, 0) } if upperBound.minor != .max && upperBound.patch == .max { upperBound = Version(upperBound.major, upperBound.minor + 1, 0) } return range.lowerBound.description + "..<" + upperBound.description case .exact(let version): return version.description } } } fileprivate extension Range where Bound == Version { func isLowerThan(_ other: Range<Bound>) -> Bool { return self.lowerBound < other.lowerBound && self.upperBound < other.upperBound } func isHigherThan(_ other: Range<Bound>) -> Bool { return other.isLowerThan(self) } }
[ -1 ]
d302ca3a48e174098390c6f467d8cae6a2169b3b
ca79384c249931d35f28c95f95d339b71fcd8cfe
/UITableView/JSONParser/JSONParser/SceneDelegate.swift
42e6ae7bddd54fc6fb60fe65ce282036770073c5
[]
no_license
koshyari/Swift
f2b0fd380bf25137020f89bd0f295fa87b3e566b
3d1f5ea8f27e06d3c49e1a3e2955ec41c43bc0d1
refs/heads/main
2023-05-19T18:00:43.497408
2021-06-15T11:29:23
2021-06-15T11:29:23
376,911,288
0
0
null
2021-06-14T18:29:15
2021-06-14T17:54:05
null
UTF-8
Swift
false
false
2,302
swift
// // SceneDelegate.swift // JSONParser // // Created by Anshul Singh Koshyari on 08/06/21. // 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, 164107, 336140, 368913, 262417, 262423, 377118, 377121, 262437, 254253, 336181, 262455, 393539, 262473, 344404, 213333, 418135, 262497, 418145, 262501, 213354, 262508, 246124, 262512, 213374, 385420, 262551, 262553, 385441, 385444, 262567, 385452, 262574, 393649, 385460, 262587, 344512, 262593, 360917, 369119, 328178, 328180, 328183, 328190, 254463, 328193, 164362, 328204, 328207, 410129, 393748, 377372, 188959, 385571, 377384, 197160, 33322, 352822, 270905, 197178, 418364, 188990, 369224, 270922, 385610, 352844, 385617, 352865, 262761, 352875, 344694, 352888, 336513, 377473, 385671, 148106, 377485, 352919, 98969, 344745, 361130, 336556, 385714, 434868, 164535, 336568, 164539, 328379, 328387, 352969, 385743, 385749, 139998, 189154, 369382, 361196, 418555, 344832, 336644, 344837, 344843, 328462, 361231, 394002, 336660, 418581, 418586, 434971, 369436, 262943, 369439, 418591, 418594, 336676, 418600, 418606, 369464, 361274, 328516, 336709, 328520, 361289, 336712, 336715, 328523, 361300, 213848, 426842, 361307, 197469, 361310, 254813, 361318, 344936, 361323, 361335, 328574, 369544, 361361, 222129, 345036, 115661, 386004, 345046, 386012, 386019, 435188, 328703, 418822, 328710, 377867, 328715, 386070, 271382, 336922, 345119, 377888, 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, 222438, 386286, 328942, 386292, 206084, 345377, 353572, 345380, 345383, 263464, 337207, 345400, 378170, 369979, 337224, 337230, 337235, 353634, 337252, 402792, 271731, 378232, 337278, 271746, 181639, 181644, 361869, 181650, 181655, 230810, 181671, 181674, 181679, 181682, 181687, 370105, 181691, 181697, 361922, 337350, 181704, 337366, 271841, 329192, 361961, 329195, 116211, 337399, 402943, 337416, 329227, 419341, 419345, 329234, 419351, 345626, 419357, 345631, 370208, 419360, 394787, 419363, 370214, 419369, 394796, 419377, 419386, 206397, 214594, 353868, 419404, 419408, 214611, 419412, 403040, 345702, 222831, 370298, 353920, 403076, 345737, 198282, 403085, 403092, 345750, 419484, 345758, 345763, 419492, 419498, 419502, 370351, 419507, 337588, 419510, 419513, 419518, 337601, 403139, 337607, 419528, 419531, 419536, 272083, 394967, 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, 354143, 345965, 354157, 345968, 345971, 345975, 403321, 1914, 354173, 395148, 247692, 337809, 247701, 329625, 436127, 436133, 337834, 362414, 337845, 190393, 346059, 346064, 247760, 346069, 419810, 354275, 329699, 190440, 354314, 346140, 436290, 378956, 395340, 436307, 338005, 329816, 100454, 329833, 329853, 329857, 329868, 411806, 329886, 346273, 362661, 100525, 379067, 387261, 256193, 395467, 411862, 411865, 411869, 411874, 379108, 411877, 387303, 395496, 346344, 338154, 387307, 346350, 338161, 436474, 321787, 379135, 411905, 411917, 379154, 395539, 387350, 338201, 387353, 182559, 338212, 248112, 362823, 436556, 321880, 362844, 379234, 354674, 321911, 420237, 379279, 354728, 338353, 338382, 272849, 248279, 256474, 182755, 338404, 330225, 248309, 248332, 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, 256735, 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, 412765, 339037, 257121, 322660, 265321, 248952, 420985, 330886, 330890, 347288, 248986, 44199, 380071, 339118, 339133, 322763, 330959, 265433, 265438, 388320, 363757, 388348, 339199, 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, 175478, 249210, 175484, 175487, 249215, 249219, 175491, 249225, 249228, 249235, 175514, 175517, 396703, 175523, 355749, 396723, 388543, 380353, 216518, 380364, 339406, 372177, 339414, 413143, 249303, 339418, 339421, 249310, 249313, 339425, 339429, 339435, 249329, 69114, 372229, 208399, 380433, 175637, 134689, 339504, 265779, 421442, 413251, 265796, 265806, 224854, 224858, 339553, 257636, 224871, 372328, 257647, 372338, 224885, 224888, 224891, 224895, 372354, 421509, 126597, 224905, 11919, 224911, 224914, 126611, 224917, 224920, 126618, 208539, 224923, 224927, 224930, 224933, 257705, 224939, 224943, 257713, 257717, 224949, 257721, 224954, 257725, 224960, 257733, 224966, 224970, 257740, 224976, 257745, 339664, 257748, 224982, 257752, 224987, 257762, 224996, 225000, 225013, 257788, 225021, 257791, 225027, 257796, 257802, 339722, 257805, 225039, 257808, 249617, 225044, 167701, 372500, 257815, 225049, 257820, 225054, 184096, 257825, 225059, 339748, 225068, 257837, 413485, 225071, 225074, 257843, 225077, 257846, 225080, 397113, 225083, 397116, 257853, 225088, 225094, 225097, 257869, 257872, 225105, 397140, 225109, 257881, 225113, 257884, 257887, 225120, 257891, 413539, 225128, 257897, 339818, 225138, 339827, 257909, 372598, 225142, 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, 225439, 135328, 438434, 225442, 225445, 225448, 438441, 225451, 258223, 225456, 430257, 225459, 225462, 225468, 389309, 225472, 372931, 225476, 389322, 225485, 225488, 225491, 266454, 225494, 225497, 225500, 225503, 225506, 356580, 217319, 225511, 225515, 225519, 381177, 356638, 356641, 356644, 356647, 266537, 356650, 389417, 356656, 332081, 307507, 340276, 356662, 397623, 332091, 225599, 201030, 348489, 332107, 151884, 332118, 430422, 348503, 250203, 250211, 340328, 250217, 348523, 348528, 332153, 356734, 389503, 332158, 438657, 250239, 389507, 348548, 356741, 332175, 160152, 373146, 340380, 373149, 70048, 356783, 373169, 324032, 201158, 340452, 127473, 217590, 340473, 324095, 324100, 266757, 324103, 324112, 340501, 324118, 324122, 340512, 332325, 324134, 381483, 356908, 324141, 324143, 356917, 324150, 324156, 348734, 324161, 324165, 356935, 381513, 348745, 324171, 324174, 324177, 389724, 332381, 373344, 340580, 348777, 381546, 119432, 340628, 184983, 373399, 258723, 332460, 332464, 332473, 381626, 332484, 332487, 373450, 357070, 332494, 357074, 332512, 332521, 340724, 332534, 373499, 348926, 389927, 348979, 152371, 340792, 398141, 357202, 389971, 357208, 389979, 357212, 430940, 357215, 439138, 201580, 201583, 349041, 340850, 430967, 324473, 398202, 119675, 340859, 430973, 324476, 324479, 340863, 324482, 324485, 324488, 381834, 185226, 324493, 324496, 324499, 430996, 324502, 324511, 422817, 324514, 201638, 373672, 324525, 111539, 324534, 324539, 324542, 398280, 349129, 340940, 340942, 209874, 340958, 431073, 398307, 340964, 209896, 209904, 201712, 381947, 201724, 349181, 431100, 431107, 349203, 209944, 209948, 250915, 250917, 357419, 209966, 209969, 209973, 209976, 209980, 209988, 209991, 209996, 431180, 341072, 349268, 250968, 210011, 373853, 341094, 210026, 210028, 210032, 349296, 210037, 210042, 349309, 210045, 160896, 349313, 152704, 210053, 210056, 349320, 373905, 259217, 210068, 210072, 210078, 210081, 210085, 210089, 210096, 210100, 324792, 210108, 357571, 210116, 210128, 210132, 333016, 210139, 210144, 218355, 218361, 275709, 275713, 242947, 275717, 275723, 333075, 349460, 333079, 251161, 349486, 349492, 415034, 210261, 365912, 259423, 374113, 251236, 374118, 333164, 234867, 390518, 357756, 374161, 112021, 349591, 333222, 259516, 415168, 415187, 366035, 366039, 415192, 415194, 415197, 415200, 333285, 415208, 366057, 366064, 415217, 415225, 423424, 415258, 415264, 366118, 382503, 415271, 349739, 144940, 415279, 415282, 349748, 415286, 210488, 415291, 415295, 333396, 333400, 366173, 423529, 423533, 210547, 415354, 333440, 267910, 333512, 259789, 366301, 333535, 153311, 366308, 366312, 431852, 399086, 366319, 210673, 366322, 399092, 366326, 333566, 268042, 210700, 366349, 210707, 399129, 333595, 366384, 358192, 210740, 366388, 358201, 325441, 366403, 325447, 341831, 341835, 341839, 341844, 415574, 358235, 341852, 350046, 399200, 399208, 358256, 268144, 358260, 341877, 325494, 399222, 333690, 325505, 333699, 399244, 333709, 333725, 333737, 382891, 350153, 358348, 333777, 219094, 399318, 358372, 350190, 350194, 333819, 350204, 350207, 325633, 325637, 350214, 268299, 333838, 350225, 350232, 333851, 350238, 350241, 374819, 350245, 350249, 350252, 178221, 350257, 350260, 350272, 243782, 350281, 350286, 374865, 342113, 252021, 342134, 374904, 333998, 334012, 350411, 350417, 350423, 350426, 350449, 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, 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, 358973, 334397, 252483, 219719, 399957, 334425, 326240, 334466, 334469, 391813, 162446, 326291, 342680, 342685, 260767, 342711, 244410, 260798, 260802, 350918, 154318, 342737, 391895, 154329, 416476, 64231, 113389, 342769, 203508, 375541, 342777, 391938, 391949, 375569, 326417, 375572, 375575, 375580, 162592, 334633, 326444, 383794, 326452, 326455, 375613, 244542, 260925, 375616, 326463, 326468, 342857, 326474, 326479, 326486, 416599, 342875, 244572, 326494, 433001, 400238, 326511, 211826, 211832, 392061, 351102, 359296, 260993, 351105, 400260, 342931, 400279, 252823, 392092, 400286, 252838, 359335, 211885, 400307, 351169, 359362, 351172, 170950, 359367, 326599, 187335, 359383, 359389, 383968, 359411, 261109, 244728, 261112, 383999, 261130, 326669, 359452, 261148, 211999, 261155, 261160, 359471, 375868, 343132, 384099, 384102, 367724, 384108, 343155, 384115, 212095, 384136, 384140, 384144, 384152, 384158, 384161, 351399, 384169, 367795, 244917, 384182, 367801, 384189, 351424, 384192, 343232, 367817, 384202, 244938, 253132, 326858, 384209, 146644, 351450, 384225, 343272, 351467, 359660, 384247, 351480, 384250, 351483, 351492, 343307, 384270, 261391, 359695, 253202, 261395, 384276, 384284, 245021, 384290, 253218, 171304, 245032, 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, 155241, 245358, 155255, 155274, 368289, 425652, 425663, 155328, 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, 327542, 147319, 262006, 262009, 262012, 155517, 155523, 155526, 360327, 376715, 155532, 262028, 262031, 262034, 262037, 262040, 262043, 253854, 155550, 262046, 262049, 262052, 327590, 155560, 155563, 155566, 327613, 393152, 311244, 393170, 155604, 155620, 253924, 155622, 253927, 327655, 360432, 393204, 360439, 253944, 393209, 155647 ]
ef23f3cf91f9be0f09a0c805782efdda8c16b5db
ed190380bc9c4205906c0fcd0cf134d5b2ee53e3
/All2Sale/Page1MainMenu1Cell2TableViewCell.swift
6634988782a1bff90542caf1c3bcaadcb76655ed
[]
no_license
Jakkawad/LayoutsApp
844cf9937137ca4ebc263f0bff87504ace133904
13802aaf3fd0ccdea2ba3418a7702e3137ebfe08
refs/heads/master
2021-01-19T12:16:49.683330
2016-10-10T09:43:59
2016-10-10T09:43:59
69,944,863
0
0
null
null
null
null
UTF-8
Swift
false
false
517
swift
// // Page1MainMenu1Cell2TableViewCell.swift // All2Sale // // Created by admin on 10/5/2559 BE. // Copyright © 2559 All2Sale. All rights reserved. // import UIKit class Page1MainMenu1Cell2TableViewCell: 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 } }
[ 211843, 225159, 418826, 302475, 227219, 348949, 319775, 276390, 199212, 327344, 276406, 299965, 299968, 379078, 273105, 228188, 155614, 375532, 317933, 113524, 230522 ]
af6acb1abe89e3ae54c61771c5d8d7e4a5bb0884
bc2ebf73a790fd2a61d80ce613fa002754b5377f
/SwiftWooCommerce/Core/ThirdParty/SJSegmentedScrollView/Classes/SJSegmentTab.swift
6b3f996983e78d0bf3c7b0c3feac381c92e27b0b
[]
no_license
parapluiecreative/SwiftWooCommerce
456b173f0e15c4231bb2020b58f97dcce6896e33
04ecad736cd4403b1b4a1cfa61a0bb798109c6f0
refs/heads/main
2023-04-16T14:33:53.603220
2021-05-04T03:08:09
2021-05-04T03:08:09
385,799,733
2
0
null
2021-07-14T03:14:45
2021-07-14T03:14:45
null
UTF-8
Swift
false
false
3,726
swift
// // SJSegmentTab.swift // Pods // // Created by Subins on 22/11/16. // Copyright © 2016 Subins Jose. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and // associated documentation files (the "Software"), to deal in the Software without restriction, // including without limitation the rights to use, copy, modify, merge, publish, distribute, // sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all copies or // substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. import UIKit typealias DidSelectSegmentAtIndex = (_ segment: SJSegmentTab?,_ index: Int,_ animated: Bool) -> Void open class SJSegmentTab: UIView { let kSegmentViewTagOffset = 100 let button = UIButton(type: .custom) var didSelectSegmentAtIndex: DidSelectSegmentAtIndex? var isSelected = false { didSet { button.isSelected = isSelected } } convenience init(title: String) { self.init(frame: CGRect.zero) setTitle(title) } convenience init(view: UIView) { self.init(frame: CGRect.zero) insertSubview(view, at: 0) view.removeConstraints(view.constraints) addConstraintsToView(view) } required override public init(frame: CGRect) { super.init(frame: frame) translatesAutoresizingMaskIntoConstraints = false button.frame = bounds button.addTarget(self, action: #selector(SJSegmentTab.onSegmentButtonPress(_:)), for: .touchUpInside) addSubview(button) addConstraintsToView(button) } func addConstraintsToView(_ view: UIView) { view.translatesAutoresizingMaskIntoConstraints = false let verticalConstraints = NSLayoutConstraint.constraints(withVisualFormat: "V:|[view]|", options: [], metrics: nil, views: ["view": view]) let horizontalConstraints = NSLayoutConstraint.constraints(withVisualFormat: "H:|[view]|", options: [], metrics: nil, views: ["view": view]) addConstraints(verticalConstraints) addConstraints(horizontalConstraints) } required public init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } open func setTitle(_ title: String) { button.setTitle(title, for: .normal) } open func titleColor(_ color: UIColor) { button.setTitleColor(color, for: .normal) } open func titleFont(_ font: UIFont) { button.titleLabel?.font = font } @objc func onSegmentButtonPress(_ sender: AnyObject) { let index = tag - kSegmentViewTagOffset NotificationCenter.default.post(name: Notification.Name(rawValue: "DidChangeSegmentIndex"), object: index) if didSelectSegmentAtIndex != nil { didSelectSegmentAtIndex!(self, index, true) } } }
[ -1 ]
8593820b69b1e96e61025b1b34d63c00360bb1da
9fc988fd0fc453823b679819e5e05f5d7ee73e1a
/LottieDejanMilos/AppDelegate.swift
83f55dcc7365d2f7960fbd56bc1917a7317f044b
[]
no_license
Kide92/LottieDejanMilos
cdb02dd507aefe9072d5765a68b9b66a0af9d7a1
f6831189374cd9caff5f7bd400a402559252bc02
refs/heads/master
2020-04-21T12:07:30.477422
2019-02-07T10:18:52
2019-02-07T10:18:52
169,552,302
0
0
null
null
null
null
UTF-8
Swift
false
false
2,399
swift
// // AppDelegate.swift // LottieDejanMilos // // Created by Dejan Matovic on 2/7/19. // Copyright © 2019 Dejan Matovic. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { window = UIWindow(frame: UIScreen.main.bounds) let homeViewController = ViewController() homeViewController.view.backgroundColor = UIColor.red window!.rootViewController = homeViewController window!.makeKeyAndVisible() return true } func applicationWillResignActive(_ application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. } func applicationDidEnterBackground(_ application: UIApplication) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } func applicationWillEnterForeground(_ application: UIApplication) { // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. } func applicationDidBecomeActive(_ application: UIApplication) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } }
[ 229380, 229383, 229385, 294924, 229388, 229391, 327695, 229394, 229397, 229399, 229402, 229405, 229408, 294950, 229415, 229417, 327722, 237613, 229422, 360496, 229426, 237618, 229428, 286774, 286776, 319544, 286778, 204856, 229432, 286791, 237640, 286797, 237646, 311375, 163920, 196692, 319573, 311383, 319590, 311400, 303212, 131192, 237693, 303230, 327814, 303241, 131209, 303244, 311436, 319633, 286873, 286876, 311460, 311469, 32944, 327862, 286906, 327866, 180413, 286910, 131264, 286916, 286922, 286924, 286926, 319694, 131281, 278743, 278747, 295133, 155872, 319716, 237807, 303345, 286962, 303347, 131314, 229622, 327930, 278781, 278783, 278785, 237826, 319751, 278792, 286987, 319757, 311569, 286999, 319770, 287003, 287006, 287009, 287012, 287014, 287016, 287019, 311598, 287023, 262448, 311601, 287032, 155966, 319809, 319810, 278849, 319814, 311623, 319818, 311628, 229709, 319822, 287054, 278865, 229717, 196963, 196969, 139638, 213367, 106872, 319872, 311683, 311693, 65943, 319898, 311719, 278952, 139689, 278957, 311728, 278967, 180668, 311741, 278975, 319938, 98756, 278980, 319945, 278986, 319947, 278990, 278994, 188895, 172512, 287202, 279010, 279015, 172520, 319978, 172526, 311791, 279023, 172529, 279027, 319989, 172534, 180727, 164343, 311804, 287230, 279040, 303617, 287234, 172550, 303623, 172552, 320007, 287238, 279051, 172558, 303632, 279058, 303637, 279063, 279067, 172572, 279072, 172577, 295459, 172581, 295461, 279082, 311850, 279084, 172591, 172598, 279095, 172607, 172609, 172612, 377413, 172614, 213575, 172618, 303690, 33357, 287309, 303696, 279124, 172634, 262752, 172644, 311911, 295533, 172655, 172656, 352880, 295538, 172660, 287349, 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, 287400, 279208, 172714, 295595, 279212, 189102, 172721, 287409, 66227, 303797, 189114, 287419, 303804, 328381, 287423, 328384, 172737, 279231, 287427, 312006, 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, 312077, 295695, 230169, 369433, 295707, 328476, 295710, 295720, 303914, 279340, 205613, 279353, 230202, 312124, 328508, 222018, 295755, 377676, 287569, 303959, 230237, 230241, 279394, 312163, 303976, 336744, 303981, 303985, 303987, 328563, 279413, 303991, 303997, 295806, 295808, 295813, 304005, 320391, 304007, 304009, 213895, 304011, 230284, 304013, 295822, 279438, 189329, 295825, 304019, 189331, 58262, 304023, 304027, 279452, 410526, 279461, 304042, 213931, 230327, 304055, 287675, 197564, 230334, 304063, 304065, 295873, 189378, 156612, 213954, 213963, 197580, 312272, 304084, 304090, 320481, 304106, 320490, 312302, 328687, 320496, 304114, 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, 164973, 205934, 312432, 279669, 337018, 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, 214294, 296213, 320792, 230681, 296215, 230689, 320803, 173350, 312622, 296243, 312630, 222522, 296253, 230718, 296255, 312639, 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, 312711, 312712, 296331, 288140, 288144, 230800, 304533, 288154, 337306, 288160, 288162, 288164, 279975, 304555, 370092, 279983, 173488, 288176, 312755, 296373, 312759, 337335, 288185, 279991, 222652, 312766, 173507, 296389, 222665, 230860, 312783, 288208, 230865, 370130, 148946, 288210, 222676, 280021, 288212, 288214, 329177, 239064, 288217, 288218, 288220, 239070, 288224, 280034, 288226, 280036, 288229, 280038, 288230, 288232, 320998, 288234, 370146, 288238, 288240, 288242, 296435, 288244, 288250, 296446, 321022, 402942, 148990, 296450, 206336, 230916, 312837, 230919, 214535, 230923, 304651, 304653, 222752, 108066, 296486, 296488, 157229, 230961, 157236, 288320, 288325, 124489, 280140, 280145, 288338, 280149, 280152, 288344, 239194, 181854, 403039, 280158, 370272, 239202, 312938, 280183, 280185, 280188, 280191, 116354, 280194, 280208, 280211, 288408, 280218, 280222, 190118, 321195, 296622, 321200, 337585, 296634, 296637, 313027, 280260, 206536, 280264, 206539, 206541, 206543, 313044, 280276, 321239, 280283, 313052, 18140, 288478, 313055, 321252, 313066, 288494, 280302, 280304, 313073, 321266, 419570, 288499, 288502, 288510, 124671, 67330, 280324, 198405, 198416, 280337, 296723, 321304, 329498, 296731, 321311, 313121, 313123, 304932, 321316, 280363, 141101, 165678, 321336, 296767, 288576, 345921, 304968, 280393, 280402, 173907, 313171, 313176, 280419, 321381, 296812, 313201, 1920, 255873, 305028, 247688, 280464, 124817, 239510, 280473, 124827, 214940, 247709, 214944, 280487, 313258, 321458, 296883, 124853, 214966, 296890, 10170, 288700, 296894, 190403, 296900, 280515, 337862, 165831, 280521, 296921, 239586, 313320, 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, 313406, 288831, 288836, 67654, 280651, 354382, 288848, 215123, 354390, 288859, 280669, 149599, 280671, 149601, 321634, 149603, 223327, 329830, 280681, 313451, 280687, 149618, 215154, 313458, 280691, 313464, 329850, 321659, 280702, 288895, 321670, 215175, 141446, 288909, 141455, 141459, 280725, 313498, 275608, 100520, 288936, 280747, 288940, 288947, 321717, 280764, 280769, 280771, 280774, 313548, 321740, 280783, 280786, 313557, 280793, 280796, 338147, 280804, 280807, 157930, 280811, 280817, 125171, 157940, 280825, 280827, 280830, 280831, 125187, 280835, 125191, 125207, 125209, 321817, 125218, 321842, 223539, 125239, 280888, 280891, 289087, 280897, 305480, 239944, 239947, 305485, 305489, 379218, 280919, 354653, 313700, 313705, 280937, 280940, 190832, 280946, 223606, 313720, 280956, 280959, 313731, 199051, 240011, 289166, 240017, 190868, 240021, 297365, 297368, 297372, 141725, 297377, 289186, 297391, 289201, 240052, 289207, 289210, 305594, 281024, 289221, 289227, 281045, 281047, 166378, 305647, 281075, 174580, 240124, 281084, 305662, 305664, 240129, 305666, 305668, 223749, 240132, 281095, 223752, 150025, 338440, 223757, 281102, 223763, 223765, 281113, 322074, 281116, 281121, 182819, 281127, 150066, 158262, 158266, 289342, 281154, 322115, 281163, 281179, 338528, 338532, 281190, 199273, 281196, 19053, 158317, 313973, 297594, 281210, 158347, 133776, 314003, 117398, 314007, 289436, 174754, 330404, 133801, 174764, 314029, 314033, 240309, 133817, 314045, 314047, 314051, 199364, 297671, 158409, 289493, 363234, 289513, 289522, 289525, 289532, 322303, 289537, 322310, 264969, 322314, 322318, 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, 297883, 289694, 289696, 289700, 289712, 281529, 289724, 52163, 183260, 281567, 289762, 322534, 297961, 183277, 322550, 134142, 322563, 314372, 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, 289997, 249045, 363742, 363745, 298216, 330988, 126190, 216303, 322801, 388350, 257302, 363802, 199976, 199978, 298292, 298294, 257334, 216376, 380226, 298306, 224584, 224587, 224594, 216404, 306517, 150870, 314714, 224603, 314718, 265568, 314723, 281960, 150890, 306539, 314732, 314736, 290161, 216436, 306549, 298358, 314743, 306552, 290171, 314747, 306555, 298365, 290174, 224641, 281987, 298372, 314756, 265604, 224647, 281990, 298377, 314763, 298381, 142733, 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, 323090, 282130, 290325, 282133, 241175, 290328, 282137, 290332, 241181, 282144, 290344, 306731, 290349, 290351, 290356, 28219, 224849, 282195, 282199, 282201, 306778, 159330, 314979, 323176, 224875, 241260, 323181, 314994, 257658, 315016, 282249, 290445, 282261, 298651, 282269, 323229, 298655, 323231, 61092, 282277, 306856, 282295, 323260, 282300, 323266, 282310, 323273, 282319, 306897, 241362, 306904, 282328, 298714, 52959, 216801, 282337, 241380, 216806, 323304, 282345, 12011, 282356, 323318, 282364, 282367, 306945, 241412, 323333, 282376, 216842, 323345, 282388, 323349, 282392, 184090, 315167, 315169, 282402, 315174, 323367, 241448, 315176, 241450, 282410, 306988, 306991, 315184, 323376, 315190, 241464, 159545, 282425, 298811, 118593, 307009, 413506, 307012, 241475, 298822, 315211, 282446, 307027, 315221, 323414, 315223, 241496, 241498, 307035, 307040, 110433, 241509, 110438, 110445, 282478, 315249, 282481, 110450, 315251, 315253, 315255, 339838, 315267, 282499, 315269, 241544, 282505, 241546, 241548, 298896, 298898, 282514, 241556, 298901, 241560, 241563, 241565, 241567, 241569, 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, 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, 315557, 184486, 307370, 168107, 307372, 184492, 307374, 307376, 323763, 184503, 299191, 307385, 307386, 258235, 307388, 176311, 307390, 176316, 184512, 307394, 299204, 307396, 184518, 307399, 323784, 233679, 307409, 307411, 176343, 299225, 233701, 307432, 184572, 184579, 184586, 282893, 323854, 291089, 282906, 291104, 233766, 176435, 307508, 315701, 332086, 307510, 307512, 168245, 307515, 307518, 282942, 323917, 110926, 282957, 233808, 323921, 315733, 323926, 315739, 323932, 299357, 242018, 242024, 299373, 315757, 250231, 242043, 315771, 299388, 299391, 291202, 299398, 242057, 291212, 299405, 291222, 315801, 283033, 242075, 61855, 291231, 283042, 291238, 291241, 127403, 127405, 291247, 299440, 127407, 127413, 291254, 127417, 291260, 127421, 127424, 299457, 127429, 127434, 315856, 315860, 176597, 283095, 127447, 299481, 176605, 242143, 127455, 127457, 291299, 127463, 242152, 291305, 176620, 127469, 127474, 291314, 291317, 127480, 135672, 291323, 233979, 127485, 291330, 127494, 283142, 135689, 233994, 127497, 127500, 291341, 233998, 127506, 234003, 234006, 127511, 152087, 234010, 135707, 135710, 242206, 291361, 242220, 291378, 152118, 234038, 70213, 242250, 111193, 242275, 299620, 242279, 168562, 184952, 135805, 135808, 291456, 373383, 299655, 135820, 316051, 225941, 316054, 299672, 135834, 373404, 225948, 135839, 299680, 225954, 299684, 135844, 242343, 242345, 373421, 135870, 135873, 135876, 135879, 299720, 299723, 299726, 225998, 226002, 226005, 226008, 299740, 242396, 201444, 299750, 283368, 234219, 283372, 226037, 283382, 316151, 234231, 234236, 242431, 209665, 234242, 299778, 242436, 234246, 226056, 234248, 291593, 242443, 234252, 242445, 234254, 234258, 242450, 242452, 201496, 234264, 234266, 234269, 234272, 234274, 152355, 299814, 234278, 283432, 234281, 234284, 234287, 283440, 185138, 242483, 234292, 234296, 160572, 283452, 234302, 234307, 242499, 234309, 316233, 234313, 316235, 234316, 283468, 234319, 242511, 234321, 234324, 185173, 201557, 234329, 185180, 234333, 308063, 234336, 242530, 349027, 234338, 234341, 234344, 234347, 177004, 234350, 324464, 234353, 152435, 177011, 234356, 234358, 234362, 234364, 291711, 234368, 291714, 234370, 291716, 234373, 316294, 201603, 226182, 308105, 234375, 226185, 234384, 234388, 234390, 324504, 234393, 209818, 308123, 324508, 226200, 234396, 291742, 234401, 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, 316370, 275406, 234452, 234455, 234459, 234461, 234464, 234467, 234470, 168935, 5096, 324585, 234478, 316400, 234481, 316403, 234484, 234485, 234487, 324599, 234493, 316416, 234496, 234501, 308231, 234504, 234507, 234515, 300054, 316439, 234520, 234519, 234523, 234526, 234528, 300066, 234532, 300069, 234535, 234537, 234540, 144430, 234543, 234546, 275508, 300085, 234549, 300088, 234553, 234558, 316479, 234561, 316483, 160835, 234563, 308291, 234568, 234570, 316491, 234572, 300108, 234574, 300115, 234580, 234581, 242777, 234585, 275545, 234593, 234595, 234597, 300133, 300139, 234605, 160879, 234607, 275569, 234610, 234614, 398455, 144506, 234618, 234620, 275579, 234623, 226433, 234627, 275588, 234629, 234634, 275594, 234636, 177293, 234640, 275602, 234643, 308373, 324757, 234647, 226453, 275606, 234650, 308379, 234648, 300189, 324766, 119967, 234653, 324768, 283805, 234657, 242852, 300197, 234661, 275626, 234667, 316596, 308414, 234687, 300223, 300226, 308418, 234692, 300229, 308420, 308422, 283844, 300234, 283850, 300238, 283854, 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, 300292, 300294, 275719, 234760, 177419, 300299, 242957, 300301, 275725, 283917, 177424, 349464, 283939, 259367, 283951, 300344, 226617, 243003, 226628, 300357, 283973, 177482, 283983, 316758, 357722, 316766, 316768, 218464, 292197, 316774, 243046, 218473, 136562, 324978, 275834, 333178, 275836, 275840, 316803, 316806, 226696, 316811, 226699, 316814, 300433, 234899, 300436, 357783, 316824, 316826, 300448, 144807, 144810, 144812, 144814, 144820, 374196, 284084, 292279, 284087, 144826, 144828, 144830, 144832, 284099, 144835, 144837, 144839, 144841, 144844, 144847, 144852, 144855, 103899, 300507, 333280, 218597, 292329, 300523, 259565, 300527, 308720, 259567, 292338, 316917, 292343, 308727, 300537, 316933, 316947, 308757, 308762, 316959, 284194, 284196, 235045, 284199, 235047, 284204, 284206, 284209, 284211, 194101, 284213, 316983, 194103, 284215, 308790, 284218, 226877, 284223, 284226, 284228, 243268, 292421, 284231, 226886, 284234, 366155, 317004, 276043, 284238, 226895, 284241, 194130, 284243, 300628, 284245, 292433, 284247, 317015, 235097, 243290, 284249, 276053, 284253, 300638, 243293, 284255, 284258, 292452, 292454, 177766, 292458, 284267, 292461, 284272, 284274, 284278, 292470, 276086, 292473, 284283, 276093, 284286, 292479, 284288, 284290, 325250, 284292, 292485, 276098, 284297, 317066, 284299, 317068, 284301, 276109, 284303, 284306, 276114, 284308, 284312, 284314, 284316, 276127, 284320, 284322, 284327, 284329, 317098, 284331, 276137, 284333, 284335, 284337, 284339, 300726, 284343, 284346, 284350, 358080, 276160, 284354, 358083, 284358, 358089, 284362, 276170, 284365, 276175, 284368, 276177, 284370, 358098, 284372, 317138, 284377, 358114, 358116, 276197, 317158, 358119, 325353, 358122, 358126, 276206, 358128, 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, 186151, 358183, 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, 350106, 284572, 276386, 284579, 276388, 358312, 317353, 292776, 284585, 276395, 292784, 276402, 358326, 161718, 358330, 276411, 276425, 301009, 301011, 301013, 301015, 358360, 301017, 292828, 153568, 292839, 292843, 178161, 227314, 325624, 317435, 317446, 292876, 317456, 276496, 317458, 178195, 243733, 243740, 317468, 317472, 325666, 243751, 292904, 276528, 243762, 309298, 325685, 325689, 235579, 325692, 235581, 178238, 276539, 325700, 292934, 350293, 350295, 309337, 227418, 350299, 350302, 227423, 350304, 178273, 309346, 227426, 194660, 350308, 309350, 309348, 292968, 309352, 309354, 301163, 350313, 350316, 227430, 301167, 276586, 350321, 227440, 284786, 276595, 350325, 252022, 350328, 292985, 301178, 292989, 301185, 317570, 350339, 292993, 317573, 350342, 333957, 350345, 350349, 301199, 317584, 325777, 350354, 350357, 350359, 350362, 350366, 276638, 153765, 284837, 350375, 350379, 350381, 350383, 350385, 350387, 350389, 350395, 350397, 350399, 227520, 350402, 227522, 301252, 350406, 227529, 301258, 276685, 309455, 276689, 309462, 301272, 276699, 194780, 309468, 309471, 301283, 317672, 317674, 325867, 243948, 194801, 309491, 309494, 243960, 227583, 276735, 276739, 211204, 276742, 227596, 325910, 309530, 342298, 211232, 317729, 211241, 325937, 325943, 211260, 260421, 285002, 276811, 235853, 276816, 235858, 276829, 276833, 391523, 276836, 293227, 276843, 293232, 276848, 186744, 211324, 285061, 317833, 178572, 285070, 178583, 227738, 317853, 317858, 342434, 285093, 317864, 285098, 276907, 235955, 293304, 293314, 309707, 293325, 317910, 293336, 235996, 317917, 293343, 358880, 276961, 293346, 276964, 293352, 236013, 293364, 301562, 317951, 309764, 301575, 121352, 293387, 236043, 342541, 317963, 113167, 55822, 309779, 317971, 309781, 55837, 227879, 227882, 309804, 293421, 105007, 236082, 285236, 23094, 277054, 244288, 219714, 301636, 318020, 301639, 301643, 285265, 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, 137946, 113378, 203491, 228069, 277223, 342760, 56041, 285417, 56043, 277232, 228081, 56059, 310015, 310020, 310029, 228113, 285459, 277273, 293659, 326430, 285474, 228135, 318248, 277291, 318253, 285489, 301876, 293685, 285494, 301880, 285499, 301884, 310080, 277317, 293706, 277329, 162643, 310100, 301911, 277337, 301921, 400236, 236397, 162671, 326514, 310134, 236408, 15224, 277368, 416639, 416640, 113538, 310147, 416648, 39817, 187274, 277385, 301972, 424853, 277411, 310179, 293798, 293802, 236460, 276579, 293811, 293817, 293820, 203715, 326603, 293849, 293861, 228327, 228328, 318442, 228332, 326638, 277486, 318450, 293876, 293877, 285686, 302073, 121850, 293882, 302075, 293887, 277504, 277507, 277511, 293899, 277519, 293908, 293917, 293939, 318516, 277561, 277564, 310336, 236609, 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, 392326, 294026, 302218, 285835, 162964, 384148, 187542, 302231, 285849, 302233, 285852, 302237, 285854, 285856, 302241, 285862, 277671, 302248, 64682, 277678, 294063, 294065, 302258, 294072, 318651, 277695, 318657, 244930, 302275, 130244, 302277, 302282, 310476, 302285, 302288, 310481, 302290, 203987, 302292, 302294, 310486, 302296, 384222, 310498, 285927, 318698, 302315, 228592, 294132, 138485, 204026, 228606, 204031, 64768, 310531, 138505, 228617, 318742, 204067, 130345, 277801, 277804, 285997, 285999, 277807, 113969, 277811, 318773, 318776, 277816, 286010, 277819, 294204, 417086, 277822, 302403, 294211, 384328, 277832, 277836, 294221, 294223, 326991, 277839, 277842, 277847, 277850, 179547, 277853, 277857, 277860, 302436, 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, 277905, 351633, 277908, 277917, 310689, 277921, 130468, 277928, 277932, 310703, 277937, 310710, 130486, 310712, 277944, 310715, 277947, 302526, 228799, 277950, 277953, 302534, 310727, 245191, 163272, 64966, 277959, 277963, 302541, 277966, 302543, 310737, 277971, 228825, 277978, 310749, 277981, 277984, 310755, 277989, 277991, 277995, 310764, 286188, 278000, 228851, 310772, 278003, 278006, 40440, 212472, 278009, 40443, 286203, 310780, 40448, 228864, 286214, 302603, 302614, 302617, 286233, 302621, 286240, 146977, 187939, 40484, 294435, 40486, 286246, 294440, 40488, 294439, 294443, 40491, 294445, 286248, 310831, 40499, 40502, 212538, 40507, 40511, 40513, 40521, 286283, 40525, 40527, 212560, 400976, 228944, 40533, 40537, 40539, 40541, 278109, 40544, 40548, 40550, 40552, 286312, 40554, 286313, 310892, 40557, 40560, 188022, 122488, 294521, 343679, 294537, 310925, 286354, 278163, 302740, 278168, 179870, 327333, 229030, 212648, 302764, 278188, 319153, 278196, 302781, 319171, 302789, 294599, 278216, 294601, 302793, 343757, 212690, 319187, 286420, 229076, 286425, 319194, 229086, 286432, 294625, 294634, 302838, 319226, 286460, 171774, 302852, 278277, 302854, 294664, 311048, 319243, 311053, 302862, 319251, 294682, 278306, 188199, 294701, 319280, 278320, 319290, 229192, 302925, 188247, 188252, 237409, 360317, 294785, 327554, 40840, 40851, 294803, 188312, 294811, 237470, 319390, 40865, 319394, 294817, 294821, 311209, 163755, 180142, 343983, 188340, 40886, 319419, 294844, 294847, 237508, 393177, 294876, 294879, 294883, 294890, 311279, 278513, 237555, 311283, 278516, 237562 ]
4b5bb5c807759f16df5a37eea526942646f67ef2
c9d73b43a11bc119ab151ea81e2c74f534b23d47
/mahjongClacApp/ViewControllers/SelectPointViewController.swift
282aa95ec1c53d8132c73523c4fffbf6b6d337bc
[]
no_license
yuta966/mahjongClacApp
a3d8f337b6c11743e5d466ec48f39a474e0746de
91a2c38f90ecb59f8fd54daff0486ae8c06a06c7
refs/heads/main
2023-02-11T02:35:37.184481
2021-01-09T05:09:33
2021-01-09T05:09:33
328,079,287
0
0
null
null
null
null
UTF-8
Swift
false
false
7,469
swift
// // SelectPointViewController.swift // mahjongClacApp // // Created by Yuta on 2020/12/30. // import UIKit class SelectPointViewController: UIViewController { private let arrayHan:[String] = ["1翻","2翻","3翻","4翻","満貫","跳満","倍満","三倍満","役満"] private let arrayHu:[String] = ["25符(七対子)","20符","30符","40符","50符","60符","70符","80符","90符","100符","110符"] //値 private let cellId = "cellId" var type = "" var han = "" var hu = "" var ho_raPlayer = Player() var ho_juPlayer = Player() var gameCount = 1 var honba = 0 var kyotaku = 0 var gamePlayerName = [Player()] //紐付け @IBOutlet weak var selectPointTableView: UITableView! @IBOutlet weak var backButton: UIButton! @IBAction func tappedBuckButton(_ sender: Any) { self.dismiss(animated: true, completion: nil) } override func viewDidLoad() { super.viewDidLoad() selectPointTableView.delegate = self selectPointTableView.dataSource = self backButton.layer.cornerRadius = 5 } } extension SelectPointViewController:UITableViewDelegate, UITableViewDataSource { //セルの数 func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { switch type { case "1","2": return gamePlayerName.count case "3": return arrayHan.count case "4": return arrayHu.count default: return 0 } } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = selectPointTableView.dequeueReusableCell(withIdentifier: cellId, for: indexPath) switch type { case "1": cell.textLabel?.text = gamePlayerName[indexPath.row].name case "2": cell.textLabel?.text = gamePlayerName[indexPath.row].name if !ho_raPlayer.name.isEmpty && gamePlayerName[indexPath.row].name == ho_raPlayer.name{ cell.textLabel?.text = "自摸" } case "3": cell.textLabel?.text = arrayHan[indexPath.row] case "4": switch han { case "1翻": if indexPath.row == 1 { cell.textLabel?.text = "--" } else { cell.textLabel?.text = arrayHu[indexPath.row] } if ho_raPlayer == ho_juPlayer { if indexPath.row == 10 { cell.textLabel?.text = "--" } else { cell.textLabel?.text = arrayHu[indexPath.row] } } break case "2翻","3翻","4翻": if ho_raPlayer != ho_juPlayer { if indexPath.row == 1 { cell.textLabel?.text = "--" } else { cell.textLabel?.text = arrayHu[indexPath.row] } } else { cell.textLabel?.text = arrayHu[indexPath.row] } break default: break } default: return cell } return cell } //選択された時 func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { switch type { case "1": let preNC = self.presentingViewController as! UINavigationController let vc = preNC.viewControllers[preNC.viewControllers.count - 1] as! ClearGameViewController vc.han = self.han vc.hu = self.hu vc.ho_raPlayer = gamePlayerName[indexPath.row] vc.ho_juPlayer = self.ho_juPlayer vc.gameCount = self.gameCount vc.honba = self.honba vc.kyotaku = self.kyotaku vc.gamePlayerName = self.gamePlayerName self.dismiss(animated: true, completion: nil) case "2": let preNC = self.presentingViewController as! UINavigationController let vc = preNC.viewControllers[preNC.viewControllers.count - 1] as! ClearGameViewController vc.han = self.han vc.hu = self.hu vc.ho_raPlayer = self.ho_raPlayer vc.ho_juPlayer = gamePlayerName[indexPath.row] vc.gameCount = self.gameCount vc.honba = self.honba vc.kyotaku = self.kyotaku vc.gamePlayerName = self.gamePlayerName self.dismiss(animated: true, completion: nil) case "3": if indexPath.row <= 3 { let storyboard = UIStoryboard(name:"Game", bundle: nil) let selectPointViewController = storyboard.instantiateViewController(withIdentifier: "SelectPointViewController") as! SelectPointViewController //値渡し selectPointViewController.han = arrayHan[indexPath.row] selectPointViewController.hu = self.hu selectPointViewController.ho_raPlayer = self.ho_raPlayer selectPointViewController.ho_juPlayer = self.ho_juPlayer selectPointViewController.gameCount = self.gameCount selectPointViewController.honba = self.honba selectPointViewController.kyotaku = self.kyotaku selectPointViewController.gamePlayerName = self.gamePlayerName selectPointViewController.type = "4" let nav = UINavigationController(rootViewController: selectPointViewController) nav.modalPresentationStyle = .fullScreen // 画面遷移 self.present(nav, animated: true, completion: nil) } else { let preNC = self.presentingViewController as! UINavigationController let vc = preNC.viewControllers[preNC.viewControllers.count - 1] as! ClearGameViewController vc.han = arrayHan[indexPath.row] vc.hu = self.hu vc.ho_raPlayer = self.ho_raPlayer vc.ho_juPlayer = self.ho_juPlayer vc.gameCount = self.gameCount vc.honba = self.honba vc.kyotaku = self.kyotaku vc.gamePlayerName = self.gamePlayerName self.dismiss(animated: true, completion: nil) } case "4": let preNC = self.presentingViewController?.presentingViewController as! UINavigationController let vc = preNC.viewControllers[preNC.viewControllers.count - 1] as! ClearGameViewController if han == "1翻" && indexPath.row == 1 { return } if ho_raPlayer != ho_juPlayer && indexPath.row == 1 { return } vc.han = self.han vc.hu = arrayHu[indexPath.row] vc.ho_raPlayer = self.ho_raPlayer vc.ho_juPlayer = self.ho_juPlayer vc.gameCount = self.gameCount vc.honba = self.honba vc.kyotaku = self.kyotaku vc.gamePlayerName = self.gamePlayerName self.presentingViewController?.presentingViewController?.dismiss(animated: true, completion: nil) default: self.dismiss(animated: true, completion: nil) return } } } //1役の時、(25,20,110はない)
[ -1 ]
445a59f435c2a341759c4928c849ca1f141e85df
cf2c97029f61e5dac2d74df755c6edf6fbea7659
/CurrencyConverter/Converter/Entities/Currency.swift
336150a5c2ece721682a83f81fb04d69fb1ef633
[]
no_license
domagojk1/currency_converter
aacf4730ea934afedd46e28dc043acb34884d410
8a8e5f0f938433b890468eabd0fe2612ec39ce3c
refs/heads/master
2021-06-28T11:23:33.767238
2017-09-12T20:43:19
2017-09-12T20:43:19
103,318,609
0
0
null
null
null
null
UTF-8
Swift
false
false
1,313
swift
// // Currency.swift // CurrencyConverter // // Created by Domagoj Kopić on 12/09/2017. // Copyright © 2017 Domagoj Kopić. All rights reserved. // import Foundation import ObjectMapper class Currency: NSObject, NSCoding, Mappable { var medianRate: String? var currencyCode: String? var buyingRate: String? var sellingRate: String? override init() { super.init() } convenience required init?(map: Map) { self.init() } func mapping(map: Map) { medianRate <- map["median_rate"] currencyCode <- map["currency_code"] buyingRate <- map["buying_rate"] sellingRate <- map["selling_rate"] } required init?(coder aDecoder: NSCoder) { medianRate = aDecoder.decodeObject(forKey: "median") as? String currencyCode = aDecoder.decodeObject(forKey: "currency") as? String buyingRate = aDecoder.decodeObject(forKey: "buying") as? String sellingRate = aDecoder.decodeObject(forKey: "selling") as? String } func encode(with aCoder: NSCoder) { aCoder.encode(medianRate, forKey: "median") aCoder.encode(currencyCode, forKey: "currency") aCoder.encode(buyingRate, forKey: "buying") aCoder.encode(sellingRate, forKey: "selling") } }
[ -1 ]
d936f99cea3741ef7990e7230e440fbdc9256279
4fb413649d78c2cf55c32d32d04fa3e97f56c832
/ChalkTalks/ImagePicker/DKImagePickerController/Sources/VideoCapture/DKVideoCaptureRecordingView.swift
8f81faa5eb566031a9c175a59420e0f6996fd797
[ "MIT" ]
permissive
JQHxx/fenbishuo
e6e47ce879294c6d457f1e5863f115230f199b43
b1d18912c71467576c12e98d628193c12e924166
refs/heads/master
2022-04-21T13:20:20.099463
2020-04-11T05:30:14
2020-04-11T05:30:14
null
0
0
null
null
null
null
UTF-8
Swift
false
false
467
swift
// // DKVideoCaptureRecordingView.swift // DKImagePickerController // // Created by lizhuojie on 2020/1/7. // import Foundation /// 录制动画,由主工程实现 open class DKVideoCaptureRecordingView: UIView { open var isAnimationPlaying: Bool = false // 平滑停止动画 public var isStoping: Bool = false open func play() {} open func stop(completion: @escaping (Bool) -> Void) {} open func pause() {} }
[ -1 ]
0260a2361302eacf13bcff7dfd71611937253de9
c82c5a5bf1cb98d2c0eb76af6caa8da8f8719ce2
/UIDiscourseApp/DataManager/Remote/SessionAPI.swift
ad7731531610b1d1c5b12de22cae4e1ec7fe9521
[]
no_license
gustyAdolf/UI_Avanzada_IOS
6d3c1908cc617a8108fbe369f7d68dd865fa4dfd
854da7f7784d75205b97686a617029447f6db56d
refs/heads/main
2023-03-23T05:23:26.341415
2021-03-17T15:33:35
2021-03-17T15:33:35
348,751,188
0
0
null
null
null
null
UTF-8
Swift
false
false
2,252
swift
// // SessionAPI.swift // UIDiscourseApp // // Created by Gustavo A Ramírez Franco on 10/3/21. // import UIKit enum SessionAPIError: Error { case httpError(Int) case apiError(ApiError) } final class SessionAPI { lazy var session: URLSession = { let configuration = URLSessionConfiguration.default let session = URLSession(configuration: configuration) return session }() func send<T: APIRequest>(request: T, completion: @escaping(Result<T.Response?, Error>) -> ()) { let request = request.requestWithBaseUrl() let task = session.dataTask(with: request) { data, response, error in if let httpResponse = response as? HTTPURLResponse, httpResponse.statusCode >= 400 && httpResponse.statusCode < 500 { if let data = data { do { let model = try JSONDecoder().decode(ApiError.self, from: data) DispatchQueue.main.async { completion(.failure(SessionAPIError.apiError(model))) } } catch { DispatchQueue.main.async { completion(.failure(error)) } } } else { DispatchQueue.main.async { completion(.failure(SessionAPIError.httpError(httpResponse.statusCode))) } } return } if let data = data, data.count > 0 { do { let model = try JSONDecoder().decode(T.Response.self, from: data) DispatchQueue.main.async { completion(.success(model)) } } catch { DispatchQueue.main.async { completion(.failure(error)) } } } else { DispatchQueue.main.async { completion(.success(nil)) } } } task.resume() } } struct ApiError: Codable { let action: String? let errors: [String]? }
[ -1 ]
e569899f643f523a7889d42f6b4534595b129f0b
3ba04a1fc4fa80d0fc2600f169ee5396860176ba
/ios/Classes/ComKossoSwiftiModule.swift
c0599344f12bad9897bb1446a39e9a76656d36bf
[]
no_license
jasonkneen/SwifTi
0595396c0f894152933bde9e4f3cb0050a4535ee
d54dab2c0074beca1a275ee67f25abbc8ace3d4b
refs/heads/master
2020-06-11T23:26:39.950219
2019-06-17T10:15:21
2019-06-17T10:15:21
null
0
0
null
null
null
null
UTF-8
Swift
false
false
2,184
swift
// // ComKossoSwiftiModule.swift // swifti // // Created by Kosso // Copyright (c) 2019 . All rights reserved. // import UIKit import TitaniumKit import Foundation /** Titanium Swift Module Requirements --- 1. Use the @objc annotation to expose your class to Objective-C (used by the Titanium core) 2. Use the @objc annotation to expose your method to Objective-C as well. 3. Method arguments always have the "[Any]" type, specifying a various number of arguments. Unwrap them like you would do in Swift, e.g. "guard let arguments = arguments, let message = arguments.first" 4. You can use any public Titanium API like before, e.g. TiUtils. Remember the type safety of Swift, like Int vs Int32 and NSString vs. String. */ @objc(ComKossoSwiftiModule) class ComKossoSwiftiModule: TiModule { // settable 'var' public var testProperty: String = "initial test property" // read only 'let' constant public let anotherTestProperty: String = "this is another test property" public var myview : ComKossoSwiftiView = ComKossoSwiftiView() func moduleGUID() -> String { return "f1c42bef-1c8f-458d-8506-fec64a21a9bb" } override func moduleId() -> String! { return "com.kosso.swifti" } override func startup() { super.startup() NSLog("[INFO] module was loaded.. nslog.. ") } @objc(example:) func example(arguments: Array<Any>?) -> String { // do something interesting here... NSLog("[INFO] inside example func") // for now, just return this.. return anotherTestProperty } @objc public var exampleProp: String { get { // Example property getter return testProperty } set { NSLog("[INFO] setting new exampleProp value.. ") // Example property setter testProperty = newValue } } @objc(hellothere:) public func hellothere(args: Array<Any>?) -> Void { NSLog("[INFO] ComKossoSwiftiModule.swift hellothere ... ") // Call the hello function in the view class? myview.hello(args:nil) } }
[ -1 ]
9db3b99b670ac227da139cef13ea8674b75cf957
3b69492f4a1f110ab0e4d14f5087af597a74f9b4
/Project5/Project5/ViewController.swift
499ea33ef3fa20576b687dfd1afeb9081714da68
[]
no_license
Swaintek/HackingWithSwift
2d75bbdfffd9df7573caa0ddbed95bc0c5df3ad1
57e480834ba6643d5ea8170584e894358069d45c
refs/heads/master
2021-01-18T21:40:07.366556
2017-04-02T22:26:18
2017-04-02T22:26:18
87,018,987
0
0
null
null
null
null
UTF-8
Swift
false
false
1,421
swift
// // ViewController.swift // Project5 // // Created by David Swaintek on 4/2/17. // Copyright © 2017 David Swaintek. All rights reserved. // import UIKit import GameplayKit class ViewController: UITableViewController { var allWords = [String]() var usedWords = [String]() func startGame() { allWords = GKRandomSource.sharedRandom().arrayByShufflingObjects(in: allWords) as! [String] title = allWords[0] usedWords.removeAll(keepingCapacity: true) tableView.reloadData() } func promptForAnswer() { let ac = UIAlertController(title: "Enter", message: <#T##String?#>, preferredStyle: <#T##UIAlertControllerStyle#>) } override func viewDidLoad() { super.viewDidLoad() navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: .add, target: self, action: #selector(promptForAnswer)) if let startWordsPath = Bundle.main.path(forResource: "start", ofType: "txt") { if let startWords = try? String(contentsOfFile: startWordsPath) { allWords = startWords.components(separatedBy: "\n") } } else { allWords = ["silkworm"] } startGame() } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } }
[ -1 ]
b1d009f0f657ec7c4adbf634aea3d67ca9ae434e
b8e6c87cf466fde91c6ef012b3d10b3f4e28eb9c
/StreamableUITests/StreamableUITests.swift
5ac9689fda9455d77bf04b9a54ebe8630ec951b8
[]
no_license
nickshields/Streamable
e9d717f0d75b7cfd8252be7224ad2679d83d8162
1a267d5c38e583d976da46c9a8b90953f7a799a8
refs/heads/master
2021-05-21T08:31:12.351986
2020-04-03T03:17:45
2020-04-03T03:17:45
252,620,165
0
0
null
null
null
null
UTF-8
Swift
false
false
1,445
swift
// // StreamableUITests.swift // StreamableUITests // // Created by Nick Shields on 2020-04-02. // Copyright © 2020 Nick Shields. All rights reserved. // import XCTest class StreamableUITests: XCTestCase { override func setUp() { // Put setup code here. This method is called before the invocation of each test method in the class. // In UI tests it is usually best to stop immediately when a failure occurs. continueAfterFailure = false // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. } func testExample() { // UI tests must launch the application that they test. let app = XCUIApplication() app.launch() // Use recording to get started writing UI tests. // Use XCTAssert and related functions to verify your tests produce the correct results. } func testLaunchPerformance() { if #available(macOS 10.15, iOS 13.0, tvOS 13.0, *) { // This measures how long it takes to launch your application. measure(metrics: [XCTOSSignpostMetric.applicationLaunch]) { XCUIApplication().launch() } } } }
[ 360463, 155665, 376853, 237599, 229414, 278571, 253996, 229425, 385078, 229431, 180279, 352314, 213051, 32829, 286787, 352324, 237638, 385095, 352327, 163916, 311373, 368717, 196687, 278607, 311377, 254039, 426074, 368732, 180317, 32871, 352359, 278637, 319599, 385135, 131190, 385147, 131199, 426124, 278676, 196758, 327834, 278684, 278690, 311459, 49317, 278698, 377010, 278707, 278713, 180409, 295099, 139459, 131270, 377033, 164043, 417996, 368849, 368850, 139478, 229591, 385240, 254171, 147679, 311520, 147680, 205034, 286957, 254189, 254193, 336121, 147716, 368908, 180494, 262419, 319764, 278805, 254228, 377116, 311582, 278817, 311596, 418095, 336177, 98611, 368949, 287040, 155968, 319812, 311622, 270663, 368969, 254285, 377168, 344402, 229716, 287089, 139641, 311679, 385407, 385409, 311692, 106893, 270733, 385423, 385437, 156069, 254373, 385449, 311723, 115116, 385463, 311739, 319931, 278974, 336319, 311744, 278979, 336323, 188870, 278988, 278992, 279000, 377309, 377310, 369121, 279009, 369124, 279014, 319976, 279017, 311787, 360945, 319986, 279030, 139766, 311800, 279033, 254459, 410108, 410109, 279042, 377346, 287237, 377352, 279053, 410126, 393745, 303634, 303635, 279060, 279061, 385554, 254487, 279066, 188957, 385578, 197166, 33344, 385603, 377419, 303693, 426575, 369236, 385620, 115287, 189016, 270938, 295518, 287327, 279143, 279150, 287345, 352885, 352886, 344697, 189054, 287359, 303743, 369285, 164487, 311944, 344714, 311950, 377487, 311953, 287379, 336531, 180886, 295575, 352921, 205469, 221853, 344737, 279207, 295591, 352938, 295598, 279215, 418479, 279218, 164532, 287418, 303802, 377531, 377534, 66243, 385737, 287434, 287438, 279249, 303826, 385745, 369365, 369366, 385751, 230105, 361178, 352989, 352990, 295649, 418529, 385763, 295653, 369383, 230120, 361194, 312046, 230133, 279293, 205566, 344829, 197377, 312076, 434956, 295698, 418579, 197398, 426777, 221980, 344864, 197412, 336678, 262952, 279337, 262957, 164655, 328495, 303921, 197424, 197428, 336693, 230198, 377656, 197433, 295745, 222017, 197451, 279379, 385878, 385880, 295769, 197467, 230238, 230239, 435038, 279393, 303973, 279398, 197479, 385895, 385901, 197489, 295797, 295799, 279418, 164730, 336765, 254851, 369541, 279434, 320394, 377754, 189349, 140203, 172971, 304050, 377778, 189373, 377789, 345030, 213961, 279499, 304086, 418774, 386007, 386016, 304104, 123880, 418793, 320495, 222193, 287730, 271351, 214009, 312313, 435195, 312317, 328701, 328705, 386049, 418819, 410629, 377863, 230411, 320526, 361487, 238611, 386068, 140311, 238617, 197658, 336928, 336930, 410665, 345137, 361522, 312372, 238646, 238650, 320571, 386108, 336962, 238663, 377927, 205911, 296023, 156763, 214116, 230500, 214119, 279659, 279666, 312435, 230514, 238706, 377974, 66684, 279686, 222344, 402568, 140426, 337037, 386191, 296091, 222364, 418975, 124073, 238764, 402618, 148674, 312519, 402632, 148687, 189651, 419028, 279766, 189656, 279775, 304352, 304353, 279780, 222441, 279789, 386288, 66802, 271607, 369912, 369913, 386296, 279803, 386304, 320769, 312588, 320795, 115997, 222496, 320802, 304422, 369964, 353581, 312628, 345397, 345398, 222523, 386363, 279872, 279874, 337226, 230730, 337228, 296269, 345418, 222542, 238928, 296274, 378201, 230757, 296304, 312688, 337280, 296328, 263561, 296330, 9618, 279955, 370066, 411028, 370072, 148899, 361928, 370122, 337359, 329168, 312785, 222674, 329170, 280020, 280025, 239069, 329181, 320997, 280042, 280043, 271850, 271853, 329198, 337391, 411119, 116209, 296434, 386551, 288248, 288252, 312830, 271880, 230922, 304655, 329231, 230933, 370200, 222754, 157219, 157220, 394793, 312879, 230960, 288305, 288319, 288322, 280131, 288328, 353875, 312937, 312941, 206447, 288377, 337533, 280193, 370307, 239238, 288391, 419462, 149127, 149128, 419464, 239251, 280217, 198304, 255651, 337590, 370359, 280252, 280253, 321217, 321220, 239305, 296649, 403149, 9935, 313042, 345813, 370390, 272087, 18139, 321250, 337638, 181992, 345832, 345835, 288492, 67316, 313082, 288508, 288515, 173828, 280326, 395018, 116491, 395019, 280333, 395026, 116502, 435993, 345882, 321309, 255781, 378666, 403248, 378673, 345910, 321338, 436029, 345918, 337734, 280396, 272207, 272208, 337746, 345942, 18263, 370526, 345950, 362336, 255844, 296807, 214894, 362351, 313200, 214896, 313204, 182142, 182145, 280451, 67464, 305032, 337816, 239515, 329627, 214943, 354210, 436130, 436135, 313257, 10153, 362411, 370604, 362418, 288698, 214978, 280517, 362442, 346066, 231382, 403421, 436189, 329696, 190437, 436199, 313322, 247787, 329707, 174058, 296942, 337899, 247786, 436209, 239610, 313338, 182277, 354310, 354311, 43016, 354312, 403463, 436235, 313356, 305173, 436248, 223269, 354342, 354346, 313388, 272432, 403507, 378933, 378934, 436283, 288829, 288835, 403524, 436293, 313415, 239689, 436304, 354386, 329812, 223317, 411738, 272477, 280676, 313446, 215144, 395373, 288878, 288890, 215165, 436372, 329884, 362658, 215204, 280761, 280767, 395458, 338118, 280779, 436429, 346319, 321744, 280792, 379102, 387299, 18661, 379110, 338151, 149743, 379120, 411892, 395511, 436471, 313595, 272644, 338187, 338188, 395536, 338196, 272661, 379157, 338217, 321839, 362809, 379193, 280903, 289109, 272730, 436570, 215395, 239973, 280938, 321901, 354671, 354672, 362864, 272755, 199030, 223611, 248188, 436609, 436613, 158087, 313736, 264591, 420241, 240020, 190870, 190872, 289185, 289195, 272815, 436659, 338359, 436677, 289229, 281038, 281039, 256476, 420326, 281071, 166403, 322057, 420374, 322077, 289328, 330291, 338491, 322119, 281165, 281170, 191065, 436831, 420461, 346739, 346741, 420473, 297600, 166533, 363155, 264855, 289435, 248494, 166581, 314043, 355006, 363212, 363228, 322269, 436957, 436960, 264929, 338658, 289511, 330473, 346859, 330476, 289517, 215790, 125683, 199415, 322302, 289534, 35584, 133889, 322312, 346889, 264971, 322320, 166677, 207639, 363295, 281378, 289580, 355117, 191285, 273209, 355129, 273211, 281407, 289599, 355136, 355138, 355147, 355148, 355153, 281426, 363353, 281434, 363354, 322396, 420702, 363361, 363362, 281444, 355173, 207728, 420722, 314240, 158594, 330627, 240517, 355216, 224149, 256918, 256919, 256920, 289691, 240543, 289699, 289720, 273336, 289723, 273341, 330688, 281541, 19398, 379845, 363462, 273353, 191445, 183254, 207839, 347104, 314343, 183276, 412653, 248815, 347122, 240631, 437245, 257023, 125953, 330759, 330766, 347150, 330789, 248871, 281647, 322609, 412725, 404550, 207954, 339031, 314458, 281698, 257126, 322664, 265323, 363643, 248960, 363658, 224400, 347286, 265366, 339101, 429216, 339106, 265381, 380069, 249003, 208044, 322733, 3243, 421050, 339131, 265410, 290001, 339167, 298209, 290030, 421102, 52473, 208123, 52476, 412926, 437504, 322826, 380178, 429332, 126229, 412963, 257323, 273713, 298290, 208179, 159033, 347451, 216387, 372039, 257353, 257354, 224591, 437585, 331091, 314708, 150868, 314711, 372064, 314721, 429410, 437602, 281958, 265579, 306541, 314740, 421240, 224637, 306558, 314759, 388488, 298378, 306580, 224662, 282008, 314776, 396697, 282013, 290206, 314788, 396709, 298406, 314790, 241067, 314797, 380335, 355761, 380348, 380350, 306630, 200136, 273865, 306634, 339403, 429540, 3557, 3559, 191980, 282097, 306678, 191991, 216575, 290304, 323083, 208397, 323088, 413202, 388630, 175640, 372261, 396850, 200245, 290359, 134715, 323132, 421437, 396865, 282182, 265800, 273992, 421452, 224848, 265809, 224852, 396885, 290391, 306777, 396889, 396896, 388712, 388713, 314997, 290425, 339579, 396927, 282244, 282248, 224907, 405140, 274071, 323226, 282272, 208547, 208548, 282279, 298664, 364202, 224951, 224952, 306875, 282302, 323262, 241366, 224985, 282330, 159462, 397040, 12017, 323315, 274170, 200444, 175874, 249606, 323335, 282379, 216844, 118549, 421657, 339746, 315172, 216868, 241447, 167720, 282418, 274234, 339782, 315209, 159563, 323405, 307024, 241494, 339799, 307030, 307038, 282471, 274288, 372592, 274296, 339840, 315265, 282503, 315272, 315275, 372625, 282517, 298912, 118693, 438186, 126896, 200628, 380874, 282573, 323554, 380910, 380922, 380923, 274432, 372736, 241695, 315433, 102441, 102446, 282671, 430127, 405552, 241717, 249912, 225347, 307269, 315468, 233548, 176209, 315477, 381013, 53334, 200795, 323678, 356446, 315488, 315489, 45154, 438374, 176231, 233578, 438378, 422000, 249976, 266361, 422020, 168069, 381061, 168070, 381071, 241809, 323730, 430231, 422044, 299166, 192670, 192671, 299176, 323761, 184498, 258233, 299208, 266447, 282832, 372943, 356575, 307431, 438512, 372979, 381173, 184574, 217352, 266504, 61720, 381210, 282908, 282912, 233761, 282920, 438575, 315698, 332084, 438583, 282938, 127292, 438592, 332100, 323914, 201037, 348499, 250196, 348501, 168280, 389465, 323934, 332128, 381286, 242027, 242028, 160111, 250227, 315768, 315769, 291194, 291193, 291200, 266628, 340356, 242059, 225684, 373141, 291225, 389534, 397732, 373196, 283088, 283089, 242138, 176602, 184799, 291297, 283138, 233987, 324098, 340489, 397841, 283154, 258584, 291359, 397872, 283185, 234037, 340539, 266812, 348741, 381515, 348748, 430681, 332379, 111197, 242274, 184938, 373357, 184942, 176751, 389744, 356983, 356984, 209529, 291455, 373377, 422529, 152196, 201348, 356998, 356999, 348807, 316044, 316048, 316050, 275102, 340645, 176805, 176810, 299698, 160441, 422591, 291529, 225996, 135888, 242385, 234216, 373485, 373486, 234233, 275193, 242428, 299777, 430853, 430860, 62222, 283418, 430880, 234276, 283431, 234290, 430909, 201534, 160576, 348999, 283466, 234330, 275294, 127840, 349025, 357219, 439145, 177002, 308075, 381811, 201590, 177018, 398205, 291713, 340865, 299912, 349066, 316299, 349068, 234382, 308111, 381840, 308113, 390034, 430999, 209820, 398244, 422825, 177074, 127945, 373705, 340960, 398305, 340967, 324587, 234476, 127990, 349176, 201721, 349179, 234499, 357380, 398370, 357413, 357420, 300087, 21567, 308288, 160834, 349254, 218187, 250955, 300109, 234578, 250965, 439391, 250982, 398444, 62574, 357487, 300145, 300147, 119925, 349304, 234626, 349315, 349317, 234635, 373902, 177297, 324761, 234655, 300192, 234662, 373937, 324790, 300215, 283841, 283846, 259275, 316628, 259285, 357594, 414956, 251124, 316661, 283894, 292092, 439550, 242955, 177420, 439563, 414989, 259346, 292145, 382257, 382264, 333114, 333115, 193853, 193858, 300354, 300355, 251212, 234830, 406862, 259408, 283990, 357720, 300378, 300379, 374110, 234864, 243073, 357763, 112019, 398740, 234902, 333224, 374189, 284086, 259513, 54719, 415170, 292291, 300490, 144862, 300526, 259569, 251379, 300539, 398844, 210429, 366081, 316951, 374297, 431646, 431662, 210489, 235069, 349764, 292424, 292426, 333389, 128589, 333394, 349780, 128600, 235096, 300643, 300645, 366198, 325246, 210558, 235136, 210559, 415360, 210569, 415369, 431754, 415376, 259741, 153252, 399014, 210601, 300729, 415419, 333508, 259780, 267978, 333522, 325345, 153318, 333543, 325357, 431861, 284410, 284425, 300810, 300812, 284430, 284436, 366358, 169751, 325403, 431901, 341791, 325411, 186148, 186149, 333609, 284460, 399148, 202541, 431918, 153392, 300849, 431935, 325444, 153416, 325449, 341837, 415566, 431955, 317268, 325460, 341846, 284508, 300893, 259937, 284515, 276326, 415592, 292713, 292719, 325491, 333687, 276343, 350072, 317308, 112510, 325508, 333700, 243590, 325514, 350091, 350092, 350102, 350108, 333727, 219046, 284584, 292783, 300983, 128955, 153553, 219102, 292835, 6116, 292838, 317416, 432114, 325620, 415740, 268286, 415744, 243720, 399372, 358418, 178215, 325675, 243763, 358455, 399433, 333902, 104534, 194667, 432241, 284789, 284790, 374913, 374914, 194692, 415883, 333968, 153752, 284827, 333990, 284840, 284843, 104633, 227517, 260285, 268479, 301255, 374984, 301270, 301271, 334049, 325857, 268515, 383208, 317676, 260337, 260338, 309504, 375040, 260355, 375052, 194832, 227601, 325904, 178459, 334121, 317738, 325930, 358698, 260396, 358707, 268609, 227655, 383309, 383327, 391521, 366948, 285031, 416103, 383338, 227702, 211327, 227721, 227730, 285074, 293275, 285083, 317851, 293281, 285089, 301482, 375211, 334259, 342454, 293309, 317889, 326083, 416201, 129484, 326093, 154061, 285152, 432608, 195044, 432616, 334315, 236020, 293368, 317949, 334345, 309770, 342537, 342549, 342560, 416288, 350758, 350759, 358951, 358952, 293420, 236080, 244279, 301635, 309831, 55880, 375373, 301647, 309847, 244311, 260705, 416353, 375396, 268901, 301688, 244345, 301702, 334473, 375438, 326288, 227991, 285348, 318127, 293552, 342705, 285362, 383668, 154295, 342714, 39616, 383708, 342757, 285419, 269036, 170735, 432883, 342775, 203511, 383740, 432894, 375552, 228099, 285443, 285450, 383755, 326413, 285457, 285467, 326428, 318247, 293673, 318251, 342827, 301872, 285493, 301883, 342846, 416577, 293702, 244569, 252766, 301919, 293729, 351078, 342888, 228214, 269179, 260995, 392071, 416649, 236427, 252812, 400271, 392080, 293780, 310166, 359332, 293801, 326571, 326580, 261045, 261046, 326586, 359365, 211913, 56270, 252878, 342990, 433104, 359380, 433112, 433116, 187372, 343020, 203758, 383980, 383994, 433166, 384015, 433173, 293911, 326684, 384031, 375848, 113710, 318515, 203829, 375902, 375903, 392288, 285795, 253028, 228457, 351343, 187505, 187508, 302202, 285819, 285823, 384127, 392320, 285833, 318602, 285834, 228492, 162962, 187539, 326803, 359574, 285850, 351389, 302239, 302251, 367791, 367792, 367798, 64699, 294075, 228541, 343230, 253124, 113863, 310496, 302319, 253168, 351475, 228608, 318732, 367897, 245018, 367898, 130342, 130344, 130347, 286012, 294210, 359747, 359748, 114022, 253288, 327030, 163190, 310650, 384379, 253316, 294278, 384391, 318860, 253339, 318876, 253340, 343457, 245160, 359860, 359861, 310714, 228796, 302530, 228804, 425417, 302539, 310731, 327122, 425434, 310747, 286176, 187877, 310758, 40439, 253431, 359931, 343552, 245249, 228868, 302602, 294413, 359949, 253456, 302613, 253462, 302620, 146976, 245290, 245291, 343606, 147011, 310853, 147020, 196184, 179800, 212574, 204386, 155238, 204394, 138862, 310896, 294517, 188021, 286344, 286351, 188049, 229011, 425624, 229021, 245413, 212649, 286387, 384693, 286392, 302778, 286400, 425682, 286419, 294621, 245471, 294629, 212721, 286457, 286463, 319232, 360194, 409355, 278292, 278294, 286507, 294699, 319289, 384826, 409404, 237397, 376661, 188250, 237411, 368486, 384871, 409446, 40809, 368489, 425832, 417648, 360315, 327556, 188293, 253828, 311183, 425875, 294806, 294808, 376733, 319393, 294820, 294824, 253868, 343993, 188349, 98240, 294849, 212947, 212953, 294887, 253930, 327666, 385011 ]
2f5e16ecb6e8af1fa89b5e1e304661fb4271672a
2db346054e0711a350ec208d48c66388090e55e4
/Source/Extension/DispatchQueue.swift
3acab22c4a3261451450a1a4f81292e7f74d206d
[ "MIT" ]
permissive
MobileUpLLC/FrameOk
12fe6c9cd02f0bbf9a7bfa72ed734ac3a66f248d
22f6633585520e6755c24b0954b5e28cdbc83797
refs/heads/master
2023-03-12T17:11:50.850328
2020-12-29T14:56:46
2020-12-29T14:56:46
308,321,668
6
1
MIT
2021-03-01T08:07:00
2020-10-29T12:29:58
Swift
UTF-8
Swift
false
false
666
swift
// // DispatchQueue+Once.swift // MUSwiftFramework // // Created by Maxim Aliev on 2/22/19 // Copyright © 2019 MobileUp LLC. All rights reserved. // import Foundation public extension DispatchQueue { private static var _onceTracker = [String]() /** - parameter token: A unique reverse DNS style name such as com.vectorform.<name> or a GUID - parameter block: Block to execute once */ 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() } }
[ 336790 ]
c526e73b6e3b21f5f471a355a93c735351357c4e
ff5fee7836880813656eeee49911ea4401aaa134
/ContactsApp/SupportingFiles/SceneDelegate.swift
8863c407d4544f39342a578653df3d6a13972303
[]
no_license
Eugene-St/ContactsApp
e6d068ae772fd8f5b32ea79b73f73cae4d0138af
0e580d362ba3e1799fc232b71bb97c398ec07848
refs/heads/master
2021-04-13T08:25:37.136198
2020-03-22T18:15:31
2020-03-22T18:15:31
249,148,477
0
0
null
null
null
null
UTF-8
Swift
false
false
2,254
swift
// // SceneDelegate.swift // ContactsApp // // Created by Eugene St on 18.03.2020. // Copyright © 2020 Eugene St. All rights reserved. // import UIKit class SceneDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow? func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). guard let _ = (scene as? UIWindowScene) else { return } } func sceneDidDisconnect(_ scene: UIScene) { // Called as the scene is being released by the system. // This occurs shortly after the scene enters the background, or when its session is discarded. // Release any resources associated with this scene that can be re-created the next time the scene connects. // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). } func sceneDidBecomeActive(_ scene: UIScene) { // Called when the scene has moved from an inactive state to an active state. // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. } func sceneWillResignActive(_ scene: UIScene) { // Called when the scene will move from an active state to an inactive state. // This may occur due to temporary interruptions (ex. an incoming phone call). } func sceneWillEnterForeground(_ scene: UIScene) { // Called as the scene transitions from the background to the foreground. // Use this method to undo the changes made on entering the background. } func sceneDidEnterBackground(_ scene: UIScene) { // Called as the scene transitions from the foreground to the background. // Use this method to save data, release shared resources, and store enough scene-specific state information // to restore the scene back to its current state. } }
[ 393221, 163849, 393228, 393231, 393251, 344103, 393260, 393269, 213049, 376890, 385082, 16444, 393277, 376906, 327757, 254032, 286804, 368728, 254045, 368736, 180322, 376932, 286833, 286845, 286851, 417925, 262284, 360598, 286880, 286889, 377003, 377013, 164029, 327872, 180418, 377030, 377037, 180432, 377047, 418008, 385243, 418012, 377063, 327915, 205037, 393457, 393461, 393466, 418044, 336124, 385281, 336129, 262405, 180491, 164107, 336140, 262417, 368913, 262423, 377118, 377121, 262437, 254253, 336181, 262455, 393539, 262473, 344404, 213333, 418135, 270687, 262497, 418145, 262501, 213354, 246124, 262508, 262512, 213374, 385420, 262551, 262553, 385441, 385444, 262567, 385452, 262574, 393649, 385460, 262587, 344512, 262593, 336326, 360917, 369119, 328178, 328180, 328183, 328190, 254463, 328193, 98819, 164362, 328207, 410129, 393748, 377372, 188959, 385571, 377384, 197160, 33322, 352822, 270905, 197178, 418364, 188990, 369224, 385610, 270922, 352844, 385617, 352865, 262761, 352875, 344694, 352888, 377473, 336513, 336517, 344710, 385671, 148106, 377485, 352919, 98969, 336549, 344745, 361130, 336556, 434868, 164535, 336568, 164539, 328379, 328387, 352969, 385743, 385749, 189154, 369382, 361196, 418555, 344832, 336644, 344837, 344843, 328462, 361231, 394002, 336660, 418581, 418586, 434971, 369436, 369439, 418591, 262943, 418594, 336676, 418600, 418606, 271154, 328498, 369464, 361274, 328516, 336709, 328520, 336712, 361289, 328523, 336715, 361300, 213848, 426842, 361307, 197469, 361310, 254813, 361318, 344936, 361323, 361335, 328574, 369544, 361361, 222129, 345036, 115661, 386004, 345046, 386012, 386019, 328690, 435188, 328703, 328710, 418822, 328715, 377867, 361490, 386070, 271382, 336922, 345119, 377888, 328747, 345134, 345139, 361525, 361537, 377931, 197708, 189525, 156762, 402523, 361568, 148580, 345200, 361591, 386168, 410746, 361594, 214150, 345224, 386187, 337048, 345247, 361645, 337072, 345268, 337076, 402615, 361657, 402636, 328925, 165086, 165092, 222438, 386286, 328942, 386292, 206084, 115973, 328967, 345377, 353572, 345380, 345383, 263464, 337207, 345400, 378170, 369979, 337224, 337230, 337235, 263509, 353634, 337252, 402792, 345449, 99692, 271731, 378232, 337278, 271746, 181639, 353674, 181644, 361869, 181650, 181655, 230810, 181671, 181674, 181679, 181682, 337330, 181687, 370105, 181691, 181697, 337350, 181704, 337366, 271841, 329192, 361961, 329195, 116211, 337399, 402943, 337416, 329227, 419341, 419345, 329234, 419351, 345626, 419357, 345631, 370208, 419360, 394787, 419363, 370214, 419369, 394796, 419377, 419386, 206397, 214594, 419401, 419404, 353868, 419408, 214611, 419412, 403040, 345702, 222831, 370298, 353920, 403073, 403076, 345737, 198282, 403085, 403092, 345750, 419484, 345758, 345763, 419492, 419498, 419502, 370351, 419507, 337588, 419510, 419513, 419518, 403139, 337607, 419528, 419531, 419536, 272083, 394967, 419545, 345819, 419548, 181982, 419551, 345829, 419560, 337643, 419564, 337647, 370416, 141052, 337661, 337671, 362249, 362252, 395022, 362256, 321300, 345888, 116512, 362274, 378664, 354107, 354112, 247618, 370504, 329545, 345932, 354124, 370510, 337751, 247639, 370520, 313181, 182110, 354143, 354157, 345965, 345968, 345971, 345975, 182136, 403321, 1914, 354173, 395148, 247692, 337809, 247701, 329625, 436127, 436133, 247720, 337834, 362414, 337845, 190393, 346064, 247760, 346069, 329699, 354275, 190440, 247790, 354314, 346140, 337980, 436290, 378956, 395340, 436307, 338005, 329816, 100454, 329833, 329853, 329857, 329868, 329886, 411806, 346273, 362661, 100525, 379067, 387261, 256193, 395467, 411862, 411865, 411869, 411874, 379108, 411877, 387303, 346344, 395496, 338154, 387307, 346350, 338161, 436474, 321787, 379135, 411905, 411917, 43279, 379154, 395539, 387350, 387353, 338201, 182559, 338212, 248112, 362823, 436556, 321880, 362844, 379234, 354674, 182642, 321911, 420237, 379279, 354728, 338353, 338363, 338382, 272849, 248279, 256474, 182755, 338404, 338411, 330225, 248309, 199165, 248332, 330254, 199182, 199189, 420377, 330268, 191012, 330320, 199250, 191069, 346722, 248427, 191085, 338544, 191093, 346743, 330384, 346769, 150184, 174775, 248505, 174778, 363198, 223936, 355025, 355029, 273109, 264919, 256735, 338661, 338665, 264942, 330479, 363252, 338680, 207620, 264965, 191240, 338701, 256787, 199455, 396067, 346917, 396070, 215854, 355123, 355141, 355144, 338764, 330581, 330585, 387929, 355167, 265056, 265059, 355176, 355180, 330612, 330643, 412600, 207809, 379849, 347082, 396246, 330711, 248794, 248799, 347106, 437219, 257009, 265208, 330750, 199681, 338951, 330761, 330769, 330775, 248863, 158759, 396329, 347178, 404526, 396337, 330803, 396340, 339002, 388155, 339010, 248905, 330827, 330830, 248915, 183384, 339037, 412765, 257121, 322660, 265321, 330869, 248952, 420985, 330886, 347288, 248986, 44199, 380071, 339118, 249018, 339133, 126148, 322763, 330959, 330966, 265433, 265438, 388320, 363757, 339199, 396552, 175376, 175397, 208167, 273709, 372016, 437553, 347442, 199989, 175416, 396601, 208189, 437567, 175425, 437571, 437576, 437584, 331089, 396634, 175451, 437596, 429408, 175458, 208228, 175461, 175464, 265581, 331124, 175478, 249210, 175484, 249215, 175487, 249219, 175491, 249225, 249228, 249235, 175514, 175517, 396703, 175523, 355749, 396723, 388543, 380353, 216518, 339401, 380364, 339406, 372177, 339414, 413143, 249303, 339418, 339421, 249310, 339425, 249313, 339429, 339435, 249329, 69114, 372229, 339464, 249355, 208399, 380433, 175637, 134689, 339504, 265779, 421442, 413251, 265796, 265806, 224854, 224858, 339553, 257636, 224871, 372328, 257647, 372338, 339572, 224885, 224888, 224891, 224895, 372354, 421509, 126597, 224905, 11919, 224911, 224914, 126611, 224917, 224920, 126618, 208539, 224923, 224927, 224930, 224933, 257705, 224939, 224943, 257713, 224949, 257717, 257721, 224954, 257725, 224960, 257733, 224966, 224970, 257740, 224976, 257745, 257748, 224982, 257752, 224987, 257762, 224996, 225000, 339696, 225013, 257788, 225021, 339711, 257791, 225027, 257796, 339722, 257802, 257805, 225039, 257808, 249617, 225044, 167701, 372500, 257815, 225049, 257820, 225054, 184096, 257825, 225059, 339748, 225068, 257837, 413485, 225071, 225074, 257843, 225077, 257846, 225080, 397113, 225083, 397116, 257853, 225088, 225094, 225097, 323404, 257869, 257872, 225105, 339795, 397140, 225109, 225113, 257881, 257884, 257887, 225120, 257891, 413539, 225128, 257897, 225138, 339827, 257909, 225142, 372598, 257914, 257917, 225150, 257922, 380803, 225156, 339845, 257927, 225166, 397201, 225171, 380823, 225176, 225183, 184245, 372698, 372704, 372707, 356336, 380919, 372739, 405534, 266295, 266298, 217158, 421961, 200786, 356440, 217180, 430181, 266351, 356467, 266365, 192640, 266375, 381069, 225425, 250003, 225430, 250008, 356507, 250012, 225439, 135328, 225442, 192674, 438434, 225445, 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, 389381, 356631, 356638, 356641, 356644, 356647, 266537, 356650, 389417, 356656, 332081, 307507, 340276, 356662, 397623, 332091, 225599, 332098, 201030, 348489, 332107, 151884, 430422, 348503, 332118, 250201, 250203, 332130, 250211, 340328, 250217, 348523, 348528, 332153, 356734, 389503, 332158, 438657, 250239, 332162, 348548, 356741, 332175, 160152, 373146, 373149, 70048, 356783, 324032, 201158, 340452, 127473, 217590, 340473, 324095, 324100, 324103, 324112, 340501, 324118, 324122, 340512, 332325, 324134, 381483, 356908, 324141, 324143, 356917, 324150, 324156, 168509, 348734, 324161, 324165, 356935, 381513, 348745, 324171, 324174, 324177, 389724, 332381, 373344, 340580, 348777, 381546, 119432, 340628, 184983, 373399, 340639, 258723, 332460, 389806, 332464, 332473, 381626, 332484, 332487, 332494, 357070, 357074, 332512, 332521, 340724, 332534, 155647, 373499, 348926, 389927, 348979, 152371, 398141, 127815, 357202, 389971, 357208, 136024, 389979, 430940, 357212, 357215, 439138, 201580, 201583, 349041, 340850, 201589, 381815, 430967, 324473, 398202, 119675, 324476, 430973, 340859, 324479, 340863, 324482, 324485, 324488, 185226, 381834, 324493, 324496, 324499, 430996, 324502, 324511, 422817, 324514, 201638, 373672, 324525, 5040, 111539, 324534, 5047, 324539, 324542, 398280, 349129, 340940, 340942, 209874, 340958, 431073, 398307, 340964, 209896, 201712, 209904, 381947, 201724, 431100, 349181, 431107, 349203, 209944, 209948, 250915, 250917, 169002, 357419, 209966, 209969, 209973, 209976, 209980, 209988, 209991, 209996, 431180, 349268, 177238, 250968, 210011, 373853, 341094, 210026, 210028, 210032, 349296, 210037, 210042, 210045, 349309, 152704, 160896, 349313, 210053, 210056, 349320, 259217, 373905, 210068, 210072, 210078, 210081, 210085, 210089, 210096, 210100, 324792, 210108, 357571, 210116, 210128, 333010, 210132, 333016, 210139, 210144, 218355, 251123, 218361, 275709, 128254, 275713, 242947, 275717, 275723, 333075, 349460, 333079, 251161, 349486, 349492, 415034, 251211, 210261, 365912, 259423, 374113, 251236, 374118, 234867, 390518, 357756, 374161, 112021, 349591, 333222, 210357, 259516, 415168, 366035, 415187, 366039, 415192, 415194, 415197, 415200, 333285, 415208, 366057, 366064, 415217, 415225, 423424, 415258, 415264, 366118, 415271, 382503, 349739, 144940, 415279, 415282, 415286, 210488, 415291, 415295, 333387, 333396, 333400, 366173, 333415, 423529, 423533, 333423, 210547, 415354, 333440, 267910, 267929, 333472, 333512, 259789, 358100, 366301, 333535, 366308, 366312, 431852, 399086, 366319, 210673, 366322, 399092, 366326, 333566, 268042, 210700, 366349, 210707, 399129, 333593, 333595, 358192, 366384, 210740, 366388, 358201, 399166, 325441, 366403, 325447, 341831, 341835, 341839, 341844, 415574, 358235, 341852, 350046, 399200, 399208, 358256, 268144, 358260, 325494, 399222, 186233, 333690, 243584, 325505, 333699, 399244, 333709, 333725, 333737, 382891, 382898, 333767, 358348, 333777, 219094, 399318, 358372, 350190, 350194, 333819, 350204, 350207, 325633, 325637, 350214, 268299, 333838, 350225, 350232, 333851, 350238, 350241, 374819, 350245, 350249, 350252, 178221, 350257, 350260, 350272, 243782, 350281, 350286, 374865, 252021, 342134, 374904, 333989, 333998, 334012, 260299, 350411, 350417, 350423, 350426, 334047, 350449, 358645, 350454, 350459, 350462, 350465, 350469, 325895, 268553, 194829, 350477, 268560, 350481, 432406, 350487, 350491, 350494, 325920, 350500, 350505, 358701, 391469, 350510, 358705, 358714, 358717, 383307, 358738, 334162, 383331, 383334, 391531, 383342, 334204, 391564, 366991, 334224, 342431, 375209, 326059, 375220, 342453, 334263, 326087, 358857, 195041, 334306, 334312, 104940, 375279, 162289, 350724, 186898, 342546, 350740, 342551, 334359, 342555, 334364, 416294, 350762, 252463, 358962, 334386, 334397, 252483, 219719, 399957, 244309, 334425, 326240, 334466, 334469, 391813, 162446, 326291, 342680, 342685, 260767, 342711, 244410, 260798, 260802, 350918, 154318, 342737, 391895, 154329, 416476, 64231, 113389, 342769, 203508, 375541, 342777, 391938, 391949, 375569, 375572, 375575, 375580, 162592, 334633, 326444, 383794, 326452, 326455, 375613, 244542, 260925, 375616, 326468, 244552, 342857, 326474, 326479, 326486, 416599, 342875, 244572, 326494, 326503, 433001, 326508, 400238, 326511, 211826, 211832, 392061, 351102, 260993, 400260, 211846, 342921, 342931, 400279, 252823, 392092, 400286, 359335, 211885, 400307, 351169, 359362, 351172, 170950, 359367, 326599, 187335, 359383, 359389, 383968, 359411, 261109, 244728, 261112, 383999, 261130, 261148, 359452, 211999, 261155, 261160, 261166, 359471, 375868, 384099, 384102, 367724, 384108, 326764, 343155, 384115, 212095, 384136, 384140, 384144, 384152, 384158, 384161, 351399, 384169, 367795, 244917, 384182, 384189, 351424, 384192, 343232, 244934, 367817, 244938, 384202, 253132, 326858, 343246, 384209, 146644, 351450, 384225, 359650, 343272, 351467, 359660, 384247, 351480, 384250, 351483, 351492, 343307, 384270, 261391, 359695, 253202, 261395, 384276, 384284, 245021, 384290, 253218, 245032, 171304, 384299, 351535, 245042, 326970, 384324, 343366, 212296, 212304, 367966, 343394, 343399, 367981, 343410, 155000, 327035, 245121, 245128, 253321, 155021, 384398, 245137, 245143, 245146, 245149, 343453, 245152, 245155, 155045, 245158, 40358, 245163, 114093, 327090, 343478, 359867, 384444, 146878, 327108, 327112, 384457, 327118, 359887, 359891, 343509, 368093, 155103, 343535, 343540, 368120, 343545, 409092, 359948, 359951, 245295, 359984, 400977, 400982, 179803, 155241, 138865, 155255, 155274, 368289, 245410, 245415, 425652, 425663, 155328, 245463, 155352, 155356, 212700, 155364, 245477, 155372, 245487, 212723, 245495, 409336, 155394, 155404, 245528, 155423, 360224, 155439, 204592, 155444, 155448, 417596, 384829, 360262, 155463, 155477, 376665, 155484, 261982, 425823, 376672, 155488, 155492, 327532, 261997, 376686, 262000, 262003, 327542, 147319, 262006, 262009, 425846, 262012, 155517, 155523, 155526, 360327, 376715, 155532, 262028, 262031, 262034, 262037, 262040, 262043, 155550, 253854, 262046, 262049, 262052, 327590, 155560, 155563, 155566, 327613, 393152, 311244, 212945, 393170, 155604, 155620, 253924, 155622, 327655, 253927, 360432, 393204, 360439, 253944, 393209, 393215 ]
88d8835737c81ce595244cd3418695e832f225f1
adc6e195f8c480c4a0d8c281a9eb16e3b7ddd074
/PR_AlaMoya/PR_AlaMoyaTests/PR_AlaMoyaTests.swift
b1ba0864bcf1ba0ecf2ce55872e144b66530fd73
[]
no_license
onemoonStudio/Practice-iOS
52ea60235cd02483d6005f4aa29f720b356a95ce
528279e964bacfe61057e721baa9a370f4d8a43f
refs/heads/master
2020-04-07T19:02:09.574762
2019-12-29T12:29:59
2019-12-29T12:29:59
158,633,786
0
0
null
null
null
null
UTF-8
Swift
false
false
5,213
swift
// // PR_AlaMoyaTests.swift // PR_AlaMoyaTests // // Created by Hyeontae on 11/09/2019. // Copyright © 2019 onemoonStudio. All rights reserved. // import XCTest @testable import PR_AlaMoya import Moya import Alamofire class PR_AlaMoyaTests: XCTestCase { let provider = MoyaProvider<TestTarget>() 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 testGet() { let expectation = XCTestExpectation(description: "get TEST 1") let expectation2 = XCTestExpectation(description: "get TEST 2") provider.request(.getData) { result in print(expectation.description) switch result { case .success(let value): let json = try! JSONSerialization.jsonObject(with: value.data, options: []) as! [String: Any] print(json) case .failure(let error): print("error \(error.response)") } expectation.fulfill() } provider.request(.getPath) { result in print(expectation2.description) switch result { case .success(let value): print("@@@@") print(try! value.mapString()) print("@@@@") print(try! value.mapJSON()) print("@@@@") // let json = try! JSONSerialization.jsonObject(with: value.data, options: []) as! [String: Any] // print(json) case .failure(let error): print("error \(error.response)") } expectation2.fulfill() } wait(for: [expectation,expectation2], timeout: 2) } func testPost() { let exp2 = XCTestExpectation(description: "post Data") let testobj: [String: String] = ["hello": "world", "foo2": "bar2"] let testJSON = try! JSONSerialization.data(withJSONObject: testobj, options: []) provider.request(.postData(data: testJSON)) { result in print(exp2.description) switch result { case .success(let value): let json = try! JSONSerialization.jsonObject(with: value.data, options: []) as! [String: Any] print("@@@") print(json["data"]) print("@@@@") print(json) case .failure(let error): print("error \(error.response)") } exp2.fulfill() } wait(for: [exp2], timeout: 2) } // // func testMultipart() { // print("multipart TEST") // let ex = XCTestExpectation(description: "multi") // var formData: [MultipartFormData] = [] // // formData.append(MultipartFormData(provider: .data("bar1".data(using: .utf8)!), name: "foo1")) // formData.append(MultipartFormData(provider: .data("bar2".data(using: .utf8)!), name: "foo2")) // // provider.request(.multi(data: formData)) { result in // print("got response") // switch result { // case .success(let val): // print("success") // print(val.data) // print(try! val.mapJSON()) // // case .failure(let error): // print("fail") // print(error.errorCode) // print(error.errorDescription) // // } // // ex.fulfill() // } // wait(for: [ex], timeout: 3) // // } func testAlamof() { let ex = XCTestExpectation(description: "alamofire") print("START") Alamofire.upload(multipartFormData: { multipart in multipart.append("bar1".data(using: .utf8)!, withName: "foo1") multipart.append("bar2".data(using: .utf8)!, withName: "foo2") }, to: "https://postman-echo.com/post") { response in print("GOT RESPONSE") switch response { case .success(let req, _, _): print("SUCCESS") req.responseJSON(completionHandler: { dataResponse in print("SECONDE SUCCESS") print(dataResponse.data) print(dataResponse.response?.statusCode) ex.fulfill() }) case .failure(let error): print("FAIL") print(error.localizedDescription) } } wait(for: [ex], timeout: 3) } // 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. // } // } }
[ -1 ]
b19ff0d886cc5a0e8d30d66c70b791f5091e9104
681921516cdbb342f1fb610afbb76aaef16ca455
/rna-transcription/Tests/RnaTranscriptionTests/RnaTranscriptionTests.swift
861f16f0ee507407b0681fda3f1cd3a54568ce84
[]
no_license
cham-s/exercism-swift
1b1d41ea5c8a30307e68caa55ebb3c82f43b6a44
89c1fad4e26f82943c8992e3c8e5e058e2420bdf
refs/heads/master
2022-01-12T07:31:47.368003
2019-05-30T19:41:37
2019-05-30T19:41:37
105,578,988
0
0
null
null
null
null
UTF-8
Swift
false
false
2,789
swift
import XCTest @testable import RnaTranscription class RnaTranscriptionTests: XCTestCase { func testRnaComplementOfCytosineIsGuanine() { XCTAssertEqual("G", try Nucleotide("C").complementOfDNA()) } func testRnaComplementOfGuanineIsCytosine() { XCTAssertEqual("C", try Nucleotide("G").complementOfDNA()) } func testRnaComplementOfThymineIsAdenine() { XCTAssertEqual("A", try Nucleotide("T").complementOfDNA()) } func testRnaComplementOfAdenineIsUracil() { XCTAssertEqual("U", try Nucleotide("A").complementOfDNA()) } func testRnaComplement() { XCTAssertEqual("UGCACCAGAAUU", try Nucleotide("ACGTGGTCTTAA").complementOfDNA()) } func testInvalidRnaComplementOfUracil() { XCTAssertThrowsError(try Nucleotide("U").complementOfDNA()) //Uncomment to see more specific error handling XCTAssertThrowsError(try Nucleotide("U").complementOfDNA(), "This didn't work") { (error) in XCTAssertEqual(error as? RnaTranscription.TranscriptionError, RnaTranscription.TranscriptionError.invalidNucleotide) } } func testInvalidRnaComplementOfXXX() { XCTAssertThrowsError(try Nucleotide("XXX").complementOfDNA()) //Uncomment to see more specific error handling XCTAssertThrowsError(try Nucleotide("XXX").complementOfDNA(), "This didn't work") { (error) in XCTAssertEqual(error as? RnaTranscription.TranscriptionError, RnaTranscription.TranscriptionError.invalidNucleotide) } } func testInvalidRnaComplementOfACGTXXXCTTAA() { XCTAssertThrowsError(try Nucleotide("ACGTXXXCTTAA").complementOfDNA()) //Uncomment to see more specific error handling XCTAssertThrowsError(try Nucleotide("ACGTXXXCTTAA").complementOfDNA(), "This didn't work") { (error) in XCTAssertEqual(error as? RnaTranscription.TranscriptionError, RnaTranscription.TranscriptionError.invalidNucleotide) } } static var allTests: [(String, (RnaTranscriptionTests) -> () throws -> Void)] { return [ ("testRnaComplementOfCytosineIsGuanine", testRnaComplementOfCytosineIsGuanine), ("testRnaComplementOfGuanineIsCytosine", testRnaComplementOfGuanineIsCytosine), ("testRnaComplementOfThymineIsAdenine", testRnaComplementOfThymineIsAdenine), ("testRnaComplementOfAdenineIsUracil", testRnaComplementOfAdenineIsUracil), ("testRnaComplement", testRnaComplement), ("testInvalidRnaComplementOfUracil", testInvalidRnaComplementOfUracil), ("testInvalidRnaComplementOfXXX", testInvalidRnaComplementOfXXX), ("testInvalidRnaComplementOfACGTXXXCTTAA", testInvalidRnaComplementOfACGTXXXCTTAA) ] } }
[ -1 ]
6961b38f28b02e9158ed45cb8ad0f848d29086e9
065cb9203f0bb1652e8c1aa3614605264ea12a4b
/ToeicTest/Classes/ViewController/TestView/Part1ViewController/Part1ViewController.swift
58ee1d1dcbfe94f54418d31b538e64d9572593d7
[]
no_license
tao20122379/project012
ccd98740cc604e468ee1b9b855adc72d8bb9a0f9
e6b3ee6e22b9b0a396df12f80d2d13ab504e46b0
refs/heads/master
2021-01-22T08:27:43.815214
2017-09-06T14:48:26
2017-09-06T14:48:26
92,615,315
0
0
null
null
null
null
UTF-8
Swift
false
false
12,855
swift
// // Part1ViewController.swift // ToeicTest // // Created by khactao on 12/30/16. // // import UIKit import AVFoundation import MZFormSheetPresentationController class Part1ViewController: BaseViewController{ // MARK: - IBOutleft and variable static let shareTest = Part1ViewController() @IBOutlet weak var timerString: UILabel! @IBOutlet weak var questionTableView: UITableView! @IBOutlet weak var toolBar: UIView! @IBOutlet weak var botToolBar: UIView! var testToolBar : TestToolBarView? var bottomBarView: BottomBarView? var topPracticeBar: TopBarView? var botPracticeBar: BotBarView? var formSheetController: MZFormSheetPresentationViewController? var directionView: DirectionPart1View? var isNewTest: Bool = false // MARK: - Life cycle override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) Constants.part6Index = 0 self.navigationController?.setNavigationBarHidden(true, animated: true) if Constants.status == .test { self.testToolBar?.timerLabel.text = "00 : 45 : 00" } self.loadData() } override func viewDidLoad() { super.viewDidLoad() if Constants.status == .practice { addTopPracticeBar() addBotPracticeBar() } else { addToolBarTest() addBottomBarTest() } self.settingTableView() } override func viewWillDisappear(_ animated: Bool) { super.viewWillDisappear(animated) Constants.mp3Player?.stop() } override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) showTimeBar() } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() } // MARK: - function func loadData() { Constants.mp3Player = MP3Player() Constants.mp3Player?.initWithFileMp3(Constants.audioName!+"1") Constants.minute = 45 Constants.second = 0 if Constants.status != .review { Constants.mp3Player?.play() super.startTimer() } else { checkSelected() } self.questionTableView.reloadData() if isNewTest { self.questionTableView.scrollToRow(at: IndexPath(row: 0, section: 0), at: .top, animated: false) } isNewTest = false } override func showTimer() { if Constants.status == .test && Constants.second == 0 && Constants.minute == 0 && Constants.hours == 0 { super.showTimer() nextSelected() } self.testToolBar?.timerLabel.text = Constants.formatTimer(Constants.second, minute: Constants.minute, hours: Constants.hours) } override func endTest() { Constants.mp3Player?.stop() } func settingTableView() { self.questionTableView.sectionHeaderHeight = UITableViewAutomaticDimension self.questionTableView.estimatedSectionHeaderHeight = 530 self.questionTableView.tableHeaderView = UIView(frame: CGRect(x: 0, y: 0, width: 100, height: 35)) self.questionTableView.tableFooterView = UIView(frame: CGRect(x: 0, y: 0, width: 100, height: 35)) for i in 0..<Constants.questionPar1List.count { self.questionTableView.register(UINib.init(nibName:"Part1QuestionCell", bundle: nil), forCellReuseIdentifier: String(format: "part1Cell%i", i)) } questionTableView.delegate = self questionTableView.dataSource = self questionTableView.rowHeight = Constants.SCREEN_WIDTH*6/11 directionView = (Bundle.main.loadNibNamed("DirectionPart1View", owner: self, options: nil)?.first as! DirectionPart1View) directionView!.exampleLabel.text = Constants.bookData?.direction1 directionView!.exampleImage.image = UIImage(named: (Constants.bookData?.imageName)!+"0") } // MARK: - Tool Bar func addToolBarTest() { testToolBar = Bundle.main.loadNibNamed("TestToolBarView", owner: self, options: nil)?.first as? TestToolBarView testToolBar?.frame = CGRect(x: 0, y: 0, width: toolBar.frame.size.width, height: toolBar.frame.size.height) testToolBar?.canceTestButton.addTarget(self, action: #selector(canceTest), for: .touchUpInside) testToolBar?.partName.text = "PART 1" toolBar.addSubview(testToolBar!) if Constants.status == .review { testToolBar?.timerLabel.text = "00: 00: 00" } } func addBottomBarTest() { bottomBarView = Bundle.main.loadNibNamed("BottomBarView", owner: self, options: nil)?.first as? BottomBarView bottomBarView?.nextButton.addTarget(self, action: #selector(nextSelected), for: .touchUpInside) bottomBarView?.backButton.addTarget(self, action: #selector(backSelected), for: .touchUpInside) if Constants.status == .test { bottomBarView?.backButton.isHidden = true } else if Constants.status == .review { bottomBarView?.backButton.isHidden = false } bottomBarView?.frame = CGRect(x: 0, y: 0, width: botToolBar.frame.size.width, height: botToolBar.frame.size.height) botToolBar.addSubview(bottomBarView!) } func addTopPracticeBar() { topPracticeBar = Bundle.main.loadNibNamed("TopBarView", owner: self, options: nil)?.first as? TopBarView topPracticeBar?.canceButton.addTarget(self, action: #selector(backSelected), for: .touchUpInside) topPracticeBar?.partLabel.text = "Practice Part 1" topPracticeBar?.frame = CGRect(x: 0, y: 0, width: toolBar.frame.size.width, height: toolBar.frame.size.height) toolBar.addSubview(topPracticeBar!) } func addBotPracticeBar() { botPracticeBar = Bundle.main.loadNibNamed("BotBarView", owner: self, options: nil)?.first as? BotBarView botPracticeBar?.frame = CGRect(x: 0, y: 0, width: botToolBar.frame.size.width, height: botToolBar.frame.size.height) botPracticeBar?.checkButton.addTarget(self, action: #selector(checkSelected), for: .touchUpInside) botToolBar.addSubview(botPracticeBar!) } func showTimeBar() { UIView.animate(withDuration: 0.5, animations: { self.toolBar.transform = CGAffineTransform(translationX: 0, y: 0) self.botToolBar.transform = CGAffineTransform(translationX: 0, y: 0) }) } func higeTimeBar() { UIView.animate(withDuration: 0.5, animations: { self.toolBar.transform = CGAffineTransform(translationX: 0, y: -35) self.botToolBar.transform = CGAffineTransform(translationX: 0, y: -35) }) } // MARK: - Button Action func nextSelected() { Constants.mp3Player?.stop() super.stopTimer() if Constants.status == .test { bottomBarView?.numberTrueLabel.isHidden = true Constants.questionPar1List.forEach { (questionData) in if questionData.answerSelected == questionData.answer && questionData.answerSelected != 0 { Constants.numberListenngTrue = Constants.numberListenngTrue + 1 } } } let part2 = Part2ViewController(nibName: "Part2ViewController", bundle: nil) self.navigationController?.pushViewController(part2, animated: true) } func backSelected() { self.navigationController?.popViewController(animated: true) } func canceTest() { if Constants.status == .test { let alert = UIAlertController(title: "", message: Constants.LANGTEXT("TEST_NOTE_CANE"), preferredStyle: UIAlertControllerStyle.alert) alert.addAction(UIAlertAction(title: Constants.LANGTEXT("COMMON_OK"), style: .default, handler: { (action) in let resultView = ResultViewController(nibName: "ResultViewController", bundle: nil) self.navigationController?.pushViewController(resultView, animated: true) })) alert.addAction(UIAlertAction(title: Constants.LANGTEXT("COMMON_CANCE"), style: .default, handler: { (action) in })) self.present(alert, animated: true, completion: nil) } else { Constants.status = .test let resultView = ResultViewController(nibName: "ResultViewController", bundle: nil) self.navigationController?.pushViewController(resultView, animated: true) } } func cancePractice() { let alert = UIAlertController(title: "", message: Constants.LANGTEXT("TEST_NOTE_CANE"), preferredStyle: UIAlertControllerStyle.alert) alert.addAction(UIAlertAction(title: Constants.LANGTEXT("COMMON_OK"), style: .default, handler: { (action) in super.navigationController?.popViewController(animated: true) })) alert.addAction(UIAlertAction(title: Constants.LANGTEXT("COMMON_CANCE"), style: .default, handler: { (action) in })) self.present(alert, animated: true, completion: nil) } func checkSelected() { if Constants.status == .practice { Constants.status = .review Constants.mp3Player?.stop() questionTableView.reloadData() var i = 0 Constants.questionPar1List.forEach({ (part1Data) in if part1Data.answer == part1Data.answerSelected { i = i + 1 } }) topPracticeBar?.googleTranslateButton.isHidden = false botPracticeBar?.numberTrueLabel.text = String(format: "%@ %i/%i", Constants.LANGTEXT("PRACTICE_NUMBER_ANSWER"), i, Constants.questionPar1List.count) bottomBarView?.numberTrueLabel.isHidden = false botPracticeBar?.checkButton.setTitle(Constants.LANGTEXT("PRACTICE_END"), for: UIControlState()) botPracticeBar?.checkButton.addTarget(self, action: #selector(cancePractice), for: .touchUpInside) } else if Constants.status == .review{ var i = 0 Constants.questionPar1List.forEach({ (part1Data) in if part1Data.answer == part1Data.answerSelected { i = i + 1 } }) bottomBarView?.numberTrueLabel.text = String(format: "%@ %i/%i", Constants.LANGTEXT("PRACTICE_NUMBER_ANSWER"), i, Constants.questionPar1List.count) bottomBarView?.numberTrueLabel.isHidden = false } } } // MARK: - Tableview datasource extension Part1ViewController: UITableViewDataSource { func numberOfSections(in tableView: UITableView) -> Int { return 1 } func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return Constants.questionPar1List.count } } // MARK: - Tableview delegate extension Part1ViewController: UITableViewDelegate { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: String(format: "part1Cell%i", indexPath.row)) as! Part1QuestionCell let questionData = Constants.questionPar1List[indexPath.row] questionData.number = indexPath.row + 1 cell.delegate = self cell.questionNumber.text = String(format: "%i.", indexPath.row + 1) cell.pictureQuestion.image = UIImage(named: String(format: "%@%i", Constants.iamgeName!, indexPath.row + 1)) if questionData.answerSelected == 0 { cell.refresh() } cell.initWithData(questionData) cell.numberQuestion = indexPath.row return cell } func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat { return 0.001 } func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { return UITableViewAutomaticDimension } func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { return directionView } func scrollViewWillEndDragging(_ scrollView: UIScrollView, withVelocity velocity: CGPoint, targetContentOffset: UnsafeMutablePointer<CGPoint>) { if velocity.y<0 { showTimeBar() } else { higeTimeBar() } } } //MARK: - Part1question delegate extension Part1ViewController: Part1Question_Delegate { func selectAnswer(_ state: Bool) { } func explainQuestion(_ questionData: Part1Model) { let explainVC = ExplainPart1ViewController(nibName: "ExplainPart1ViewController", bundle: nil) explainVC.questionData = questionData self.navigationController?.pushViewController(explainVC, animated: true) } }
[ -1 ]
be0b66a36878a8e1c9cc49c9f1593c0d8e4313bb
9cb28c09c364c0d21755821c185950b8dcc4ce9a
/DSBKit/code/Alamosfire.swift
955eb6b912d1e6383dc1c0c2a3cbdce3c92a2c14
[]
no_license
DanielNaeh/DSB-masterResearchKit
bbbc7b7fe5df81217f07cdc249c7590849234f62
7bf777e3b4c1fef0ac6f2b0d091499d31960d222
refs/heads/master
2021-01-02T20:59:15.825053
2020-02-17T12:51:34
2020-02-17T12:51:34
239,798,123
0
0
null
null
null
null
UTF-8
Swift
false
false
8,881
swift
// // GetToken.swift // MSconsenter // // Created by Daniel Naeh on 16/10/2019. // Copyright © 2019 Eldergen. All rights reserved. // import UIKit import ResearchKit import Alamofire import Foundation import Alamofire import SwiftyJSON import RealmSwift public func getToken () { //let defaults = UserDefaults.standard //let token = defaults.string(forKey: "token") // let secretParameters: [String : String] = ["password" : "jun1per", "username" : "daniel", "grant_type" : "password"] let header: HTTPHeaders = [ "Content-Type" : "application/x-www-form-urlencoded" ] let url = "https://wcbsearch.swan.ac.uk/test/token" Alamofire.request(url ,method: .post , parameters : secretParameters ,headers : header) .responseJSON{ response in if response .result.isSuccess{ print ("Success! got token data") let tokenJSON : JSON = JSON(response.result.value!) let mytoken: String = tokenJSON["access_token"].stringValue let defaults = UserDefaults.standard defaults.set(mytoken, forKey: "token" ) print ("My tokenis ---------------------->") print(mytoken) print("Sent -----------------Token") } else{ print ("theres an err ") } } } public func getTokenPublic (complete: @escaping ()->()) { //let defaults = UserDefaults.standard //let token = defaults.string(forKey: "token") // let secretParameters: [String : String] = ["password" : "jun1per", "username" : "daniel", "grant_type" : "password"] let embededSecretParameters = ["password" : "jun1per", "username" : "daniel", "grant_type" :"password"] let header: HTTPHeaders = [ "Content-Type" : "application/x-www-form-urlencoded" ] let url = "https://wcbsearch.swan.ac.uk/test/token" Alamofire.request(url ,method: .post , parameters : embededSecretParameters ,headers : header) .responseJSON{ response in if response .result.isSuccess{ print ("Success! got token data") let tokenJSON : JSON = JSON(response.result.value!) let mytoken: String = tokenJSON["access_token"].stringValue let defaults = UserDefaults.standard defaults.set(mytoken, forKey: "token" ) print ("My Public Public Public Public token is ---------------------->") print(mytoken) print("Sent -----------------Token") complete() } else{ print ("theres an err ") complete() } } } func MySendCosnetsItems (dictObj: JSON,consent: ConsentBits,progressView: UIProgressView ) { let M_URL = "https://wcbsearch.swan.ac.uk/test/api/Consent/" let defaults = UserDefaults.standard let token = defaults.string(forKey: "token") // print( "Sent siggggggggnaturessssssssssssssssssssssssssssssssssss") // print(consent.sig1); // print ( "Sent siggggggggnaturessssssssssssssssssssssssssssssssssss") // print(consent.sig2); let header: HTTPHeaders = [ "Authorization" : "bearer " + token! ] let encoder = JSONEncoder() let jsonData = try! encoder.encode(dictObj) let url = URL(string: M_URL) var request = URLRequest(url: url! ) request.httpMethod = HTTPMethod.post.rawValue request.setValue("application/json; charset=UTF-8", forHTTPHeaderField: "Content-Type") request.httpBody = jsonData progressView.progress = 0.5 Alamofire.request(request).responseJSON { response in switch response.result { case .success(let value): let swiftyJson = JSON(value) print ("finish alamofire call " ) completionHandler(jasonValue: swiftyJson, erorr: nil, consent: consent,progressView: progressView) case .failure(let error): print("Failure") completionHandler(jasonValue: nil, erorr: error, consent: consent, progressView: progressView) } } } func completionHandler (jasonValue: JSON?, erorr: Error?, consent: ConsentBits,progressView: UIProgressView ) { // succes if ((erorr == nil) && (jasonValue != nil)) { let realm = try! Realm() try! realm.write { consent.transmitted = true } progressView.progress = 0.9 print ("Written transmitted") } else{ progressView.progress = 0.9 print(erorr.debugDescription) } } func TreadSafeMySendCosnetsItems (dictObj: JSON,consent: ConsentBits,realm: Realm) { let M_URL = "https://wcbsearch.swan.ac.uk/test/api/Consent/" let defaults = UserDefaults.standard let token = defaults.string(forKey: "token") let header: HTTPHeaders = [ "Authorization" : "bearer " + token! ] let encoder = JSONEncoder() let jsonData = try! encoder.encode(dictObj) let url = URL(string: M_URL) var request = URLRequest(url: url! ) request.httpMethod = HTTPMethod.post.rawValue request.setValue("application/json; charset=UTF-8", forHTTPHeaderField: "Content-Type") request.httpBody = jsonData Alamofire.request(request).responseJSON { response in switch response.result { case .success(let value): let swiftyJson = JSON(value) if ( swiftyJson != nil) { print ("finish alamofire call " ) //let realm = try! Realm() try! realm.write { consent.transmitted = true } print ("Written transmitted") } case .failure(let error): print("Failure") print(error) //TreadSafecompletionHandler(jasonValue: nil, erorr: error, consent: consent, realm: realm) } } } // check what this does func ProcessSendTable() -> Bool { print ("In Process table ========") var arrayJson: [JSON] = [] let realm = try! Realm() for consent in realm.objects(ConsentBits.self).filter("transmitted != YES") { print(" In begin synch !") print ("Realm consent name printed ========") print(consent.familyName) /// create array of consent items let prodArray:NSMutableArray = NSMutableArray() for x in consent.consentItems{ let para:NSMutableDictionary = NSMutableDictionary() para.setValue(x.value , forKey: "value") para.setValue(String(x.confirmItemId), forKey: "confirmItemId") para.setValue(String(x.allowNo) , forKey: "allowNo") prodArray.add(para) } let extraDetailsArray:NSMutableArray = NSMutableArray() for x in consent.PatientDetails{ let para:NSMutableDictionary = NSMutableDictionary() para.setValue(x.Value , forKey: "Value") para.setValue(String(x.DetailTypeId), forKey: "DetailTypeId") para.setValue(String(x.Name), forKey: "Name") extraDetailsArray.add(para) } let originalJSON:JSON = ["familyName": consent.familyName as! String , "givenName": consent.givenName as! String ,"Sig1": consent.sig1 ,"Sig2": consent.sig2 ,"trialId": consent.trialId , "staffId": consent.staffId , "date": consent.date as! String ,"consentItems": prodArray, "PatientDetails": extraDetailsArray, "personId": consent.personID , "deviceId": consent.deivceId , "consenterEmail": consent.consenterEmail] print(originalJSON) arrayJson.append(originalJSON) if arrayJson.count > 0 { TreadSafeMySendCosnetsItems(dictObj: arrayJson[0], consent: consent, realm: realm) return true } } return false }
[ -1 ]
683c7373becb0547897ca7e3a45ada0fe8832c73
9050fbe68849a1ccc4e4bcfbfeacd32f8ff4151c
/2. Swift/Resources Wiki/Swift Standard Library.playground/Pages/Indexing and Slicing Strings.xcplaygroundpage/Contents.swift
c370cbc484cbae053042030f83189d62e56327e5
[]
no_license
ramonfsk/hackatruck
396bed755bfbb40497281ff2155c1053a2ed5f1c
729c34ad3b1b84da698ddcdf60bd6d907e04577f
refs/heads/master
2020-03-22T09:28:27.870306
2018-07-11T15:05:49
2018-07-11T15:05:49
139,840,172
1
0
null
null
null
null
UTF-8
Swift
false
false
8,259
swift
/*: [Table of Contents](Table%20of%20Contents) | [Previous](@previous) | [Next](@next) **** # Indexing and Slicing Strings It's common to think of a string as a sequence of the characters you see on screen. However, what you perceive as a character may in some cases be represented by multiple, variable-length Unicode scalars in memory. For example, it requires more bits to encode a character like the top hat emoji (`🎩`) than a simple character like the letter `A`, and it requires multiple Unicode scalars to represent characters with combining marks, such as é⃝. For more information about Unicode support in Swift, see [Strings and Characters](https://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/StringsAndCharacters.html#//apple_ref/doc/uid/TP40014097-CH7-ID285) in _The Swift Programming Language_. In Swift, the `String` type handles these details for you. Each `Character` value in a string represents any user-perceived Unicode character, regardless of the character's length or representation in memory. However, because of this abstraction, it doesn't make sense to index into a string using integers. Instead, the standard library includes `String.Index`, a type that better represents a position in any string, regardless of its representation in memory. Take a look at the string below, which contains various Unicode characters of different sizes and complexity. */ var str = "Tiago Gomes Pereira" /*: Here's what it looks like when you plot the string's characters against their user-perceived indices. Notice that even though the flag (🇺🇸) is actually a grapheme cluster made up of two combining Unicode scalars, Swift counts the flag as just one user-perceived character. This makes tasks like form validation, cursor positioning, and text wrapping much simpler to implement. Counting, indexing, and slicing are all based on user-perceived character indices, rather than the layout of the string in memory. */ visualize(str) /*: - Experiment: Try changing the `str` variable and see how the string visualizations in the playground change. You can add special characters by placing your cursor inside the string and going to Edit > Emoji & Symbols in the menu bar. When you're done, you can copy and paste the original string back into the variable: `"Héllo, 🇺🇸laygr😮und!"` Take a look at the string counts in the code below. The `characters` property contains a collection of the Unicode characters in the string, while the `utf16` property contains a collection of the UTF-16 code points. If you compare the number of user-perceived characters with the number of UTF-16 code points in the string, you'll find that the number of UTF-16 code points is higher than the number of Unicode characters. */ str.characters.count str.utf16.count /*: Let's create a range that you can use to index and slice the string. At first glance, you might attempt to create a range from integers. If you option-click the `badRange` constant below, you'll notice that this line of code creates a value of type `CountableRange<Int>`. This isn't exactly right–you usually want to slice the string on user-perceived characters. If you uncomment the line of code after, you'll get a compiler error, because you can't subscript a `String` value with a range of integers. */ let badRange = 3..<10 //str[badRange] // uncomment this line to see error /*: Instead, you can use specialized `String.Index` objects to index and slice strings. Every string has a `startIndex` and an `endIndex`, and you can pass the indices to the string's `index(after:)` and `index(before:)` methods to increment or decrement them, respectively. You can also use the `index(_:offsetBy:)` method to offset an index–the integer you pass in is used to determine how many times to invoke `index(after:)` or `index(before:)`. The `String.Index` type is Unicode-aware, so the `index(_:offsetBy:)` method will always advance a string index correctly. The `index(_:offsetBy:)` method takes into account any large or complex Unicode characters to make sure your range starts, advances, and ends on a complete, user-perceived character. - Note: The `endIndex` of a string or a range is always one past the end. This makes it easier to check if it's empty: If the `startIndex` and the `endIndex` are equal, then there are no characters in the string. It also makes it easier to check where you are: If your current index is equal to the `endIndex`, then you have reached the end. Therefore, it is a runtime error to call `str[endIndex]` because you are asking for a character at an index past the end of the string. Try option-clicking the `range` constant. The `index(_:offsetBy:)` method returns a value with the same type as the original index you pass in, so the `..<` range operator produces a range of that type. */ let range = str.index(str.startIndex, offsetBy: 3)..<str.index(str.startIndex, offsetBy: 10) /*: Because the `index(_:offsetBy:)` method offsets any index by a specified integer amount, you can use the `index(_:offsetBy:)` method to retrieve a character at a certain index in a string. */ str[str.index(str.startIndex, offsetBy: 7)] visualize(str, index: str.index(str.startIndex, offsetBy: 7)) /*: Now that you have a range of `String.Index` values, you can use the indexing subscript operator with the lower or upper bound of a range as well. By using `String.Index` values as the start and endpoint of the range, you're guaranteed to retrieve a fully-formed character–whether it's a simple ASCII character at the `lowerBound` or an emoji character at the `upperBound`. */ str[range.lowerBound] visualize(str, index: range.lowerBound) str[range.upperBound] visualize(str, index: range.upperBound) /*: Putting it all together, you can use the `range` variable we created above to retrieve a slice of the string. Notice that the last character in the returned slice is not the same as the character returned when you retrieved the character at the `upperBound` above. The upper bound of a range is just like the `endIndex` of a collection—always one past the end. Algorithms that operate on indices take that information into account. - Experiment: Try changing the `range` variable to start and end on different offsets from the `startIndex` of the string. */ str[range] visualize(str, range: range) /*: ## Applying Concepts Using the patterns you learned on this page, let's build a group chat application that promotes quick messaging by limiting message length to 30 characters. The app needs to indicate when a user's message is over the character limit. In the code below, the closure passed to the `showChatView` function uses a special version of the method you saw used above to offset an index. The `index(_:offsetBy:limitedBy:)` method takes an end index limit in addition to the start index and offset that you've seen previously. This version of the method increments the `startIndex` up to the `endIndex` without overrunning the end. If the string is less than 30 characters long (the value of `messageLimit`), the `index(_:offsetBy:limitedBy:)` method returns `nil`, so you know you didn't reach the desired offset. If the string is over 30 characters, the closure returns a range starting at the message limit and extending to the end of the message. The app takes the range returned by the method and highlights that range in red. */ let messageCharacterLimit = 30 showChatView { (contents: String) -> Range<String.Index>? in if let i = contents.index(contents.startIndex, offsetBy: messageCharacterLimit, limitedBy: contents.endIndex) { return i < contents.endIndex ? i..<contents.endIndex : nil } return nil } /*: - Experiment: Try changing the `messageCharacterLimit` variable. Notice how messages that are less than the character limit are handled properly by the `index(_:offsetBy:limitedBy:)` method. - callout(Checkpoint): At this point, you've read about the `String` type's Unicode character handling and learned how to index into and slice strings. On the next page, you'll learn how to customize the way your types are printed and displayed. **** [Table of Contents](Table%20of%20Contents) | [Previous](@previous) | [Next](@next) */
[ 324087 ]
890fc82967578662075ce6ff9561c263a02f9b02
da161e7e62584bd3fe404a3a4c4b8693e521f080
/GifmeUITests/GifmeUITests.swift
ff1f1c9dcaa35e4f1b5c448bceedb9a941bbbaa8
[]
no_license
daneden/gifme-ios
2c31d82105961c06d6813e7847f47ec91fa18d19
17b95697022c578489388ad928320bbf1ebee73b
refs/heads/master
2023-07-20T23:38:02.235437
2017-01-16T17:33:44
2017-01-16T17:33:44
57,180,597
6
0
null
2020-07-10T09:51:29
2016-04-27T03:28:54
Swift
UTF-8
Swift
false
false
1,238
swift
// // GifmeUITests.swift // GifmeUITests // // Created by Daniel Eden on 4/24/16. // Copyright © 2016 Daniel Eden. All rights reserved. // import XCTest class GifmeUITests: XCTestCase { override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. // In UI tests it is usually best to stop immediately when a failure occurs. continueAfterFailure = false // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. XCUIApplication().launch() // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. super.tearDown() } func testExample() { // Use recording to get started writing UI tests. // Use XCTAssert and related functions to verify your tests produce the correct results. } }
[ 333827, 243720, 282634, 313356, 155665, 237599, 241695, 223269, 229414, 354342, 315431, 315433, 354346, 278571, 313388, 325675, 102446, 282671, 102441, 229425, 124974, 243763, 241717, 180279, 229431, 215095, 319543, 213051, 288829, 325695, 288835, 286787, 237638, 313415, 239689, 233548, 315468, 333902, 196687, 278607, 311377, 354386, 311373, 329812, 223317, 315477, 200795, 315488, 315489, 45154, 321632, 280676, 313446, 215144, 307306, 194667, 233578, 288878, 319599, 278642, 284789, 284790, 131190, 288890, 215165, 131199, 194692, 278669, 235661, 241809, 323730, 278676, 311447, 153752, 327834, 284827, 278684, 329884, 299166, 278690, 311459, 215204, 284840, 299176, 278698, 284843, 184489, 184498, 278707, 278713, 223418, 280761, 258233, 180409, 227517, 280767, 295099, 299197, 299202, 139459, 309443, 176325, 131270, 301255, 227525, 299208, 280779, 282832, 321744, 227536, 301270, 229591, 280792, 301271, 311520, 325857, 334049, 280803, 307431, 182503, 319719, 295147, 317676, 286957, 125166, 125170, 313595, 309504, 125184, 217352, 125192, 125197, 194832, 227601, 325904, 125200, 319764, 278805, 125204, 334104, 282908, 311582, 299294, 282912, 278817, 233761, 125215, 211239, 282920, 125225, 317738, 311596, 321839, 315698, 98611, 332084, 125236, 282938, 307514, 278843, 168251, 287040, 319812, 280903, 227655, 323914, 282959, 229716, 289109, 168280, 201562, 323934, 391521, 239973, 381286, 285031, 313703, 416103, 280938, 242027, 242028, 321901, 354671, 278895, 287089, 199030, 227702, 315768, 291193, 315769, 223611, 291194, 248188, 139641, 311679, 211327, 291200, 313726, 240003, 158087, 313736, 227721, 242059, 311692, 227730, 285074, 240020, 315798, 190872, 291225, 293275, 285083, 317851, 242079, 227743, 285089, 293281, 283039, 305572, 289185, 156069, 301482, 311723, 289195, 377265, 338359, 299449, 311739, 319931, 293309, 278974, 311744, 317889, 291266, 278979, 326083, 278988, 289229, 281038, 281039, 278992, 283089, 283088, 279000, 176602, 242138, 160224, 279009, 291297, 369121, 195044, 285152, 279014, 188899, 319976, 279017, 311787, 281071, 319986, 236020, 279030, 311800, 279033, 317949, 279042, 283138, 233987, 287237, 377352, 322057, 309770, 342537, 279053, 283154, 303634, 279060, 279061, 303635, 182802, 279066, 322077, 291359, 293420, 236080, 283185, 279092, 23093, 234037, 244279, 244280, 338491, 301635, 309831, 55880, 377419, 281165, 303693, 301647, 281170, 326229, 115287, 189016, 309847, 332379, 111197, 295518, 287327, 242274, 244326, 279143, 279150, 281200, 287345, 313970, 301688, 244345, 189054, 303743, 297600, 287359, 291455, 301702, 164487, 279176, 311944, 334473, 316044, 311948, 311950, 316048, 311953, 316050, 287379, 326288, 295575, 227991, 289435, 303772, 205469, 221853, 285348, 314020, 279207, 295591, 248494, 279215, 293552, 295598, 285362, 299698, 318127, 166581, 164532, 342705, 154295, 285360, 303802, 314043, 287418, 287412, 66243, 291529, 287434, 225996, 363212, 287438, 279249, 242385, 279253, 158424, 230105, 299737, 322269, 295653, 342757, 289511, 230120, 330473, 234216, 285419, 330476, 289517, 279278, 312046, 170735, 215790, 125683, 230133, 199415, 234233, 242428, 279293, 205566, 322302, 289534, 299777, 291584, 228099, 285443, 291591, 322312, 295688, 285450, 264971, 312076, 326413, 322320, 285457, 295698, 291605, 166677, 283418, 285467, 326428, 221980, 281378, 234276, 283431, 203560, 279337, 318247, 293673, 318251, 289580, 262952, 164655, 301872, 303921, 234290, 328495, 262957, 285493, 230198, 285496, 301883, 201534, 289599, 281407, 295745, 342846, 222017, 293702, 318279, 281426, 279379, 295769, 234330, 244569, 281434, 322396, 230238, 230239, 275294, 279393, 293729, 349025, 281444, 303973, 279398, 351078, 301919, 177002, 308075, 242540, 310132, 295797, 228214, 207735, 201590, 295799, 177018, 269179, 279418, 308093, 314240, 291713, 158594, 228232, 299912, 279434, 320394, 416649, 316299, 234382, 252812, 308111, 308113, 189327, 293780, 310166, 289691, 209820, 283551, 240543, 310177, 289699, 189349, 289704, 293801, 279465, 326571, 304050, 177074, 326580, 289720, 326586, 289723, 189373, 213956, 281541, 19398, 345030, 213961, 279499, 56270, 191445, 304086, 183254, 234469, 314343, 304104, 324587, 234476, 183276, 320492, 289773, 203758, 287730, 240631, 214009, 312313, 312315, 312317, 328701, 328705, 234499, 293894, 320520, 322571, 230411, 320526, 330766, 234513, 238611, 140311, 293911, 238617, 197658, 316441, 132140, 113710, 189487, 281647, 322609, 312372, 203829, 238646, 300087, 238650, 320571, 21567, 308288, 160834, 336962, 314437, 349254, 238663, 300109, 234578, 207954, 205911, 296023, 314458, 156763, 281698, 285795, 214116, 281699, 230500, 322664, 228457, 279659, 318571, 234606, 300145, 230514, 238706, 187508, 312435, 279666, 300147, 302202, 285819, 292901, 314493, 285823, 234626, 279686, 222344, 318602, 234635, 228492, 337037, 285834, 177297, 162962, 187539, 326803, 308375, 324761, 285850, 296091, 119965, 234655, 300192, 302239, 339106, 306339, 234662, 300200, 302251, 208044, 238764, 249003, 322733, 3243, 294069, 300215, 294075, 64699, 228541, 283841, 283846, 312519, 279752, 283849, 148687, 290001, 189651, 316628, 279766, 189656, 279775, 304352, 298209, 310496, 304353, 279780, 228587, 279789, 290030, 302319, 251124, 316661, 283894, 234741, 208123, 292092, 279803, 228608, 320769, 234756, 242955, 312588, 177420, 318732, 126229, 245018, 320795, 318746, 320802, 130342, 304422, 130344, 292145, 298290, 312628, 300342, 159033, 333114, 333115, 286012, 222523, 181568, 279872, 279874, 300355, 193858, 216387, 300354, 372039, 294210, 304457, 230730, 294220, 296269, 222542, 224591, 238928, 234830, 296274, 314708, 318804, 283990, 314711, 357720, 300378, 300379, 294236, 316764, 314721, 230757, 281958, 314727, 134504, 306541, 327023, 296304, 234864, 312688, 316786, 314740, 230772, 327030, 284015, 314742, 310650, 224637, 306558, 314752, 306561, 243073, 179586, 294278, 314759, 296328, 296330, 298378, 368012, 314765, 304523, 292242, 279955, 306580, 112019, 224662, 234902, 282008, 314776, 314771, 318876, 282013, 290206, 148899, 314788, 298406, 314790, 245160, 333224, 282023, 279979, 279980, 241067, 314797, 286128, 173492, 279988, 286133, 284086, 310714, 284090, 228796, 302523, 54719, 302530, 280003, 228804, 292291, 415170, 310725, 306630, 300488, 306634, 370122, 302539, 339403, 300490, 234957, 329168, 312785, 222674, 327122, 280020, 329170, 310735, 280025, 310747, 239069, 144862, 286176, 187877, 310758, 320997, 280042, 280043, 191980, 329198, 337391, 300526, 282097, 296434, 308722, 306678, 40439, 191991, 288248, 286201, 300539, 288252, 312830, 290304, 245249, 228868, 292359, 218632, 323079, 302602, 230922, 323083, 294413, 304655, 329231, 323088, 282132, 230933, 302613, 282135, 316951, 374297, 302620, 222754, 313338, 306730, 245291, 312879, 230960, 288305, 239159, 290359, 323132, 235069, 157246, 288319, 288322, 280131, 349764, 310853, 282182, 194118, 288328, 286281, 292426, 124486, 333389, 224848, 224852, 290391, 128600, 235096, 239192, 196184, 306777, 212574, 345697, 204386, 300643, 300645, 282214, 312937, 204394, 224874, 243306, 312941, 206447, 310896, 314997, 294517, 290425, 288377, 325246, 333438, 235136, 280193, 282244, 239238, 288391, 282248, 286344, 323208, 286351, 188049, 229011, 239251, 280217, 323226, 229021, 302751, 198304, 282272, 282279, 298664, 212649, 298666, 317102, 286387, 300725, 337590, 286392, 300729, 302778, 306875, 280252, 280253, 282302, 323262, 286400, 321217, 296636, 280259, 321220, 282309, 333508, 323265, 239305, 296649, 212684, 9935, 241360, 282321, 313042, 286419, 241366, 280279, 282330, 18139, 280285, 294621, 282336, 321250, 294629, 153318, 333543, 181992, 12009, 337638, 282347, 288492, 34547, 67316, 323315, 286457, 284410, 200444, 288508, 282366, 286463, 319232, 288515, 280326, 323335, 282375, 300810, 282379, 216844, 116491, 284430, 280333, 300812, 161553, 124691, 284436, 278292, 278294, 282390, 118549, 116502, 325403, 321308, 321309, 282399, 241440, 282401, 325411, 315172, 186149, 186148, 241447, 333609, 286507, 294699, 284460, 280367, 300849, 282418, 280373, 280377, 321338, 319289, 282428, 280381, 345918, 413500, 241471, 280386, 280391, 153416, 315209, 325449, 159563, 280396, 307024, 317268, 237397, 241494, 18263, 307030, 188250, 284508, 300893, 307038, 237411, 284515, 276326, 282471, 296807, 292713, 282476, 292719, 313200, 296815, 325491, 313204, 333687, 317305, 317308, 339840, 315265, 280451, 327556, 188293, 243590, 282503, 67464, 305032, 315272, 315275, 325514, 243592, 311183, 184207, 282517, 294806, 214936, 337816, 294808, 239515, 214943, 298912, 319393, 333727, 294820, 219046, 333734, 284584, 294824, 313257, 310731, 292783, 126896, 200628, 300983, 343993, 288698, 294849, 214978, 280517, 280518, 214983, 282572, 282573, 153553, 24531, 231382, 329696, 323554, 292835, 6116, 190437, 292838, 294887, 262953, 317416, 313322, 278507, 329707, 298987, 296942, 311277, 124912, 327666, 278515, 325620, 239610 ]
f8a068180cb1a171114345a38a1871742eecc892
c67f7e526a92caa177c75331263280562b5052fe
/FightPandemics/Views/Components/Buttons/Search.swift
a3891c549f07961daf456933d23968f84802d510
[ "MIT" ]
permissive
pyounes/FightPandemics-iOS-SwiftUI
d6ad81b723c6798f8fab9965a634d94693912195
aafe03832e0432e396bdbc9f4a31725f3e8c520a
refs/heads/master
2023-01-28T16:35:09.579480
2020-12-04T19:39:21
2020-12-04T19:39:21
null
0
0
null
null
null
null
UTF-8
Swift
false
false
898
swift
// // Search.swift // FightPandemics // // Created by Luko on 28/11/2020. // Copyright © 2020 Scott. All rights reserved. // import SwiftUI struct Search: View { @State private var searchText: String = "" func deleteText() { searchText.removeAll() } var body: some View { HStack { Image("magnifier-icon").padding() TextField("Search", text: $searchText) if !searchText.isEmpty { Button(action: deleteText) { Image("close-icon").padding() } } } .frame(minWidth: 0, maxWidth: .infinity) .frame(height: 48, alignment: .center) .background(FPColor.veryLightPinkTwo) .cornerRadius(29) } } struct SearchC_Previews: PreviewProvider { static var previews: some View { Search() } }
[ -1 ]
99830aea2d9dc17f4797cd84c474e5d2e6a212c9
820ff26b0ece290c71290807b347a0d40acadfd8
/Stuff-It/ViewControllers/ItemDetailsVC/ItemDetailsVC.swift
dc192be6ef0a87aaa1aa1f9f4cbc612cdf36cbc3
[]
no_license
panthro1/Stuff-It
e18f30a7a20c44206678daacd3c3e35c1ac4e634
e1bcfb02bdcb8671f0ee3b6f155b1fa26f9d1a68
refs/heads/master
2021-05-01T15:16:33.850903
2017-06-12T11:40:35
2017-06-12T11:40:35
null
0
0
null
null
null
null
UTF-8
Swift
false
false
36,303
swift
// // ItemDetailsVC.swift // Inventory17 // // Created by Michael King on 1/20/17. // Copyright © 2017 Microideas. All rights reserved. // import UIKit import Firebase import M13Checkbox import Kingfisher enum ItemType { case new //create empty item->create expanding buttons case existing // item object passed, updateTheView, pull box details from FB, updateBoxDetailsView case boxItem // box Object passed, updateBoxDetailsView, pull item details from FB, updateTheView case newFromBoxItems //coming from AddToBox and needs to match Category of box. } enum ImageStatus{ case noImage //keep placeholder case existingImage //don't change anything case newImage //upload new image and write URL to Firebase } enum BoxChangeType{ // when save button pressed - what actions need to be taken with the item and box models case none, add, update, remove mutating func next() { switch self { case .none: self = .add default: print("") } } } //MARK: hide tab bar - stackoverflow.com/questions/27008737/how-do-i-hide-show-tabbar-when-tapped-using-swift-in-ios8 class ItemDetailsVC: UITableViewController,UIImagePickerControllerDelegate , UINavigationControllerDelegate, UITextFieldDelegate, SegueHandlerType, UITabBarDelegate, UIPopoverPresentationControllerDelegate { enum SegueIdentifier: String { case ShowBoxList case ScanQR case ShowCategory case EditQR } /* @IBAction func testButton(_ sender: Any) { tabBarController?.selectedIndex = 0 navigationController?.popToRootViewController(animated: true) // goes to qr and pops this VC, so if you come back to this tab- its at feed, not details } */ @IBOutlet weak var gradientLayer: GradientView! func setTableViewBackgroundGradient(sender: UITableViewController) { //, _ topColor:UIColor,_ bottomColor:UIColor) { /* let bottomColor = UIColor.blue let topColor = UIColor.cyan let gradientBackgroundColors = [topColor.cgColor, bottomColor.cgColor] let gradientLocations = [0.0,1.0] let gradientLayer = CAGradientLayer() gradientLayer.colors = gradientBackgroundColors gradientLayer.locations = gradientLocations as [NSNumber] gradientLayer.frame = sender.tableView.bounds let backgroundView = UIView(frame: sender.tableView.bounds) backgroundView.layer.insertSublayer(gradientLayer, at: 0) sender.tableView.backgroundView = backgroundView */ // let backgroundView = UIView(frame: sender.tableView.bounds) // let backgroundView = UIView(frame: sender.tableView.bounds) // backgroundView.layer.insertSublayer(gradientLayer, at: 0) sender.tableView.backgroundView = gradientLayer } var imageChanged = ImageStatus.noImage var itemType = ItemType.new var boxChangeType = BoxChangeType.none var itemKeyPassed: String! var qrData = QR() var item: Item! var box: Box! var REF_BOX = DataService.ds.REF_INVENTORY.child("boxes") var REF_ITEMS = DataService.ds.REF_INVENTORY.child("items") var collectionId: String! @IBOutlet weak var checkedOut_CheckBox: M13Checkbox! @IBOutlet weak var boxDetailsTableCell: UITableViewCell! @IBOutlet weak var fragileSwitch: SevenSwitch! @IBOutlet weak var itemNameField: UITextField! @IBOutlet weak var itemCategory: UILabel! @IBOutlet weak var itemSubCategory: UILabel! @IBOutlet weak var itemQty: UITextField! @IBOutlet weak var boxNumberHeaderLabel: UILabel! @IBOutlet weak var boxLocationName: UILabel! @IBOutlet weak var boxLocationArea: UILabel! @IBOutlet weak var subcategoryHeading: UILabel! @IBOutlet weak var saveItemButton: UIBarButtonItem! @IBOutlet weak var cancelItemButton: UIBarButtonItem! let picker = UIImagePickerController() var url : URL! @IBOutlet weak var blurredImage: UIImageView! @IBOutlet weak var myImageView: ItemImageView! override func viewWillDisappear(_ animated: Bool) { super.viewWillDisappear(animated) // print("From: \(curPage) -> Remove All Observers ") // self.REF_ITEMS.removeAllObservers() // self.REF_BOX.removeAllObservers() } override func viewDidLoad() { super.viewDidLoad() // setTableViewBackgroundGradient(sender: self)//, UIColor(0xF47434), UIColor(0xEE3965)) print("From: \(self.curPage) -> Item Details - View Did Load ") setupViewController() } // END VIEW DID LOAD func setupViewController() { self.locationCellVisibility(on: false) itemChanged = false // KingfisherManager.shared.cache.clearMemoryCache() // KingfisherManager.shared.cache.clearDiskCache() createNumPadToolbar() tableView.tableFooterView = UIView() tableView.tableFooterView = UIView(frame: CGRect.zero) switch itemType { case .boxItem: self.item = Item(itemKey: itemKeyPassed, itemBoxed: true, itemCategory: nil) loadDataFromFirebase() boxChangeType = .update self.locationCellVisibility(on: true) case .existing: print("From: \(self.curPage) -> existing ") print("passed Key -> \(itemKeyPassed) ") self.item = Item(itemKey: itemKeyPassed, itemBoxed: nil, itemCategory: nil) loadDataFromFirebase() case .new: self.item = Item(itemKey: nil, itemBoxed: false, itemCategory: "Un-Categorized") self.title = "New Item" configureExpandingMenuButton() case .newFromBoxItems: print("from Boxitems with \(self.itemKeyPassed)") self.item = Item(itemKey: nil, itemBoxed: false, itemCategory: self.itemKeyPassed) self.title = "New \(self.itemKeyPassed) Item" configureExpandingMenuButton() } // Image Picker Setup picker.delegate = self // let blurEffect = UIBlurEffect(style: .light) // let blurEffectView = UIVisualEffectView(effect: blurEffect) // blurEffectView.frame = self.view.frame // // blurredImage.addSubview(blurEffectView) // blurredImage.clipsToBounds = true } func kingfisherGetImage() { if let itemUrl = self.item.itemImgUrl { url = URL(string: itemUrl) } myImageView.kf.indicatorType = .activity myImageView.kf.setImage(with: url, placeholder: UIImage(named: "qrBoxLogoV2_stroke"), options: [.transition(ImageTransition.fade(3))], progressBlock: { receivedSize, totalSize in }, completionHandler: { image, error, cacheType, imageURL in self.blurredImage.image = self.myImageView.image self.imageChanged = .existingImage }) } // MARK: Fragile var fragileStatus: Bool = false @IBAction func fragileSwitchTapped(_ sender: SevenSwitch) { self.itemChanged = true if fragileSwitch.isOn() { fragileStatus = true } else { fragileStatus = false } } var itemChanged: Bool! { didSet { if itemChanged == true { self.navigationItem.rightBarButtonItem?.setTitleTextAttributes([ NSFontAttributeName : UIFont.boldSystemFont(ofSize: 18.0)], for: UIControlState.normal) self.saveItemButton.title = "Save" self.cancelItemButton.title = "Cancel" self.navigationItem.rightBarButtonItem?.tintColor = UIColor.white self.navigationItem.rightBarButtonItem?.isEnabled = true } else { self.cancelItemButton.title = "Done" self.navigationItem.rightBarButtonItem?.tintColor = UIColor.clear self.navigationItem.rightBarButtonItem?.isEnabled = false } } } // MARK: TextField @IBAction func itemNameField_action(_ sender: Any) { self.itemChanged = true self.resignFirstResponder() } // MARK: Qty @IBOutlet weak var stepper: UIStepper! @IBAction func qty_textField_action(_ sender: AnyObject) { self.resignFirstResponder() } @IBAction func stepperAction(_ sender: AnyObject) { qtyValue = (Int(stepper.value)) itemQty.text = "\(qtyValue!)" } var qtyValue:Int! { didSet { if qtyValue != nil { self.stepper.value = Double(qtyValue!) self.itemChanged = true } else { self.stepper.value = 1 } } } @IBAction func textEditingEnded(_ sender: AnyObject) { self.qtyValue = Int(itemQty.text!) } // MARK: Image/Camera func pickImage() { //ActionSheet to ask user to scan or choose let alertController = UIAlertController(title: "Choose Image for item", message: "", preferredStyle: UIAlertControllerStyle.actionSheet) let camera = UIAlertAction(title: "Take Photo", style: UIAlertActionStyle.default, handler: {(alert :UIAlertAction) in print("Open the camera ") self.shootPhoto() }) alertController.addAction(camera) let photoAlbum = UIAlertAction(title: "Photo Library", style: UIAlertActionStyle.default, handler: {(alert :UIAlertAction) in print("pick from photos") self.photoFromLibrary() }) alertController.addAction(photoAlbum) let cancelAction = UIAlertAction(title: "Cancel", style: UIAlertActionStyle.cancel, handler: {(alert :UIAlertAction) in print("Cancel button tapped") }) alertController.addAction(cancelAction) present(alertController, animated: true, completion: nil) } func photoFromLibrary() { picker.allowsEditing = false picker.sourceType = .photoLibrary picker.mediaTypes = UIImagePickerController.availableMediaTypes(for: .photoLibrary)! picker.modalPresentationStyle = .popover present(picker, animated: true, completion: nil) // picker.popoverPresentationController?.barButtonItem = sender } func shootPhoto() { if UIImagePickerController.isSourceTypeAvailable(.camera) { picker.allowsEditing = false picker.sourceType = UIImagePickerControllerSourceType.camera picker.cameraCaptureMode = .photo picker.modalPresentationStyle = .fullScreen present(picker,animated: true,completion: nil) } else { noCamera() } } func noCamera(){ let alertVC = UIAlertController( title: "No Camera", message: "Sorry, this device has no camera", preferredStyle: .alert) let okAction = UIAlertAction( title: "OK", style:.default, handler: nil) alertVC.addAction(okAction) present( alertVC, animated: true, completion: nil) } //MARK: - Image Delegates func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : AnyObject]) { print("Did Finish Picking Media ") var chosenImage = UIImage() chosenImage = info[UIImagePickerControllerOriginalImage] as! UIImage //2 myImageView.contentMode = .scaleAspectFill //3 myImageView.image = chosenImage //4 blurredImage.image = chosenImage //4 imageChanged = .newImage dismiss(animated:true, completion: nil) //5 self.itemChanged = true } func imagePickerControllerDidCancel(_ picker: UIImagePickerController) { dismiss(animated: true, completion: nil) } // MARK: Keyboard Text Delegate func textFieldShouldReturn(_ textField: UITextField) -> Bool { self.view.endEditing(true) return true } func changeFontStyle(labelName: UILabel, isPlaceholder:Bool) { if isPlaceholder { labelName.textColor = UIColor.lightGray } else { labelName.textColor = UIColor.darkGray } } func createNumPadToolbar(){ //init toolbar let toolbar:UIToolbar = UIToolbar(frame: CGRect(x: 0, y: 0, width: self.view.frame.size.width, height: 30)) //create left side empty space so that done button set on right side let flexSpace = UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil) let doneBtn: UIBarButtonItem = UIBarButtonItem(barButtonSystemItem: .done, target: self, action: #selector(ItemDetailsVC.doneButtonAction)) //array of BarButtonItems var arr = [UIBarButtonItem]() arr.append(flexSpace) arr.append(doneBtn) toolbar.setItems(arr, animated: false) toolbar.sizeToFit() //setting toolbar as inputAccessoryView self.itemQty.inputAccessoryView = toolbar } func doneButtonAction(){ // QTY field keybaord dismiss self.view.endEditing(true) } // MARK: FIREBASE Functions func loadDataFromFirebase() { let ref = self.REF_ITEMS.child(self.item.itemKey) let spinnerActivity = MBProgressHUD.showAdded(to: self.view, animated: true); spinnerActivity.label.text = "Loading"; spinnerActivity.detailsLabel.text = "Please Wait!!"; spinnerActivity.isUserInteractionEnabled = false; UIApplication.shared.isNetworkActivityIndicatorVisible = true let fetchFbQueue = DispatchQueue(label: "fetchFB", qos: .userInitiated) // higher importance fetchFbQueue.async { print("itemDetails - inside ASYNC") ref.observe(.value, with: { snapshot in if let itemSnapshotDict = snapshot.value as? Dictionary<String, AnyObject> { let item = Item(itemKey: self.itemKeyPassed, dictionary: itemSnapshotDict) self.item = item self.kingfisherGetImage() if let itemBoxSnapshotDict = snapshot.childSnapshot(forPath: "/box").value as? Dictionary<String, AnyObject> { // FIRDataSnapshot{ if let itemBoxNumber = itemBoxSnapshotDict["itemBoxNumber"] { self.item.itemBoxNum = String(describing: itemBoxNumber) } if let itemBoxKey = itemBoxSnapshotDict["itemBoxKey"] { self.locationCellVisibility(on: true) self.item.itemBoxKey = itemBoxKey as? String self.REF_BOX = self.REF_BOX.child("\(String(describing: itemBoxKey))") self.boxChangeType = .update self.loadItemBoxDetailsFromFireBase() } else { self.boxChangeType = .none } if let itemIsBoxed = itemBoxSnapshotDict["itemIsBoxed"] { self.item.itemIsBoxed = itemIsBoxed as! Bool } } DispatchQueue.main.async(execute: { self.updateViewWithItem() }) UIApplication.shared.isNetworkActivityIndicatorVisible = false } }) DispatchQueue.main.async() { spinnerActivity.hide(animated: true); } } } func loadItemBoxDetailsFromFireBase() { self.REF_BOX.observe(.value, with: { (itemBoxDetailsSnap) in if let itemBoxDetailsDict = itemBoxDetailsSnap.value as? Dictionary<String, AnyObject> { let key = itemBoxDetailsSnap.key // Do Box and Item Objects agree on Box Key if let itemBoxKey = self.item.itemBoxKey, itemBoxKey == key { print("itemBoxKey: \(itemBoxKey) and BoxKey \(key) ") let boxFromFireBase = Box(boxKey: key, dictionary: itemBoxDetailsDict) self.box = boxFromFireBase self.updateBoxDetailsView() } else { print("ALERT: ITEM and BOX have BoxKey Mismatch ") self.boxNumberHeaderLabel.text = "BOX NUMBER DOES NOT MATCH" } } }) { (error) in print("Firebase error getting iTemDetails:BoxInfo") print(error.localizedDescription) } } func updateFirebaseData(imgUrl: String?) { print("From: \(curPage) -> updateFirebaseData ") var qtyStr: String if let qty = qtyValue { qtyStr = "\(qty)" } else { qtyStr = "1" } var itemKey: String let ref = DataService.ds.REF_BASE.child("/collections/\(COLLECTION_ID!)/inventory/items") // Generate a new push ID for the new post switch itemType { case .new, .newFromBoxItems: print("updateFBdata: itemType is New ") let newItemRef = ref.childByAutoId() itemKey = newItemRef.key case .existing: print("updateFBdata: itemType is existing \(self.item.itemKey)") itemKey = self.item.itemKey case .boxItem: print("updateFBdata: itemType is boxItem \(self.item.itemKey)") itemKey = self.item.itemKey } let itemDict: Dictionary<String, AnyObject> = [ "itemQR" : itemKey as AnyObject, "itemName" : itemNameField.text! as AnyObject, "imageUrl": imgUrl as AnyObject, "itemCategory" : self.item.itemCategory as AnyObject, "itemSubcategory" : self.item.itemSubcategory as AnyObject, "itemQty" : qtyStr as AnyObject, //"\(qtyValue)" as AnyObject , "itemFragile" : fragileStatus as AnyObject, "/box/itemIsBoxed" : self.item.itemIsBoxed as AnyObject, "/box/itemBoxKey" : self.item.itemBoxKey as AnyObject, "/box/itemBoxNumber" : self.item.itemBoxNum as AnyObject ] item.saveItemToFirebase(itemKey: itemKey, itemDict: itemDict, completion: { () -> Void in popViewController() }) } //end Firebase Data // MARK: Update Views func updateViewWithItem() { // print("In the UPATE VIEW ") configureExpandingMenuButton() if let item = self.item { self.title = item.itemName itemNameField.text = item.itemName if let category = item.itemCategory { itemCategory.text = category } else { self.itemCategory.text = "Set Category" // changeFontStyle(labelName: itemCategory, isPlaceholder: true) } if let subcat = item.itemSubcategory { itemSubCategory.text = subcat } else { self.itemSubCategory.text = nil subcategoryHeading.isHidden = true } if let qty = item.itemQty { itemQty.text = "\(qty)" self.stepper.value = Double(qty)! } else { itemQty.text = "0" } fragileStatus = item.itemFragile if fragileStatus == true { fragileSwitch.setOn(true, animated: true) } else { fragileSwitch.setOn(false, animated: true) } } } func updateBoxDetailsView() { print("update BoxDetails View ") if let boxNumer = self.item.itemBoxNum { boxNumberHeaderLabel.text = "BOX NUMBER \(boxNumer)" } if let location = self.box.boxLocationName { print("Box Location is: \(location) ") self.boxLocationName.text = location } else { self.boxLocationName.text = "Location Not Set" // changeFontStyle(labelName: boxLocationName, isPlaceholder: true) } if let locArea = self.box.boxLocationArea { print("Box Location locdetails are: \(locArea) ") self.boxLocationArea.text = locArea } else { self.boxLocationArea.text = nil } } @IBAction func saveItemTapped(_ sender: UIBarButtonItem) { UIApplication.shared.isNetworkActivityIndicatorVisible = true let _ = EZLoadingActivity.show("Saving", disableUI: true) checkForEmptyFields() } func checkForEmptyFields() { guard itemNameField.text != "" else { let errMsg = "Item name is Required " newItemErrorAlert("Ut oh...", message: errMsg) return } self.checkForImage() } func checkForImage() { print("MK:checkForImage") if let imgData = UIImageJPEGRepresentation(myImageView.image!, 0.2) { let imgUid = NSUUID().uuidString let metadata = FIRStorageMetadata() metadata.contentType = "image/jpeg" DataService.ds.REF_ITEM_IMAGES.child(imgUid).put(imgData, metadata: metadata) { (metadata, error) in if error != nil { print("MK: Unable to upload image to Firebasee storage") } else { var url: String! print("checkForImage - switch") switch self.imageChanged { case .existingImage: url = self.item.itemImgUrl print("checkForImage - existingImage") case .newImage: url = metadata?.downloadURL()?.absoluteString print("checkForImage - newImage") case .noImage: url = nil print(" noImage") } print("The URL we have to send is \(url) ") self.updateFirebaseData(imgUrl: url) } } } } func locationCellVisibility(on: Bool) { self.boxDetailsTableCell.isHidden = !on self.boxDetailsTableCell.isUserInteractionEnabled = on } // MARK: ExpandingMenuButton fileprivate func configureExpandingMenuButton() { var boxSymbol: String! var editBoxAlertTitle: String var editBoxAlertSub: String var editBoxColor : UInt if self.item.itemIsBoxed == true { boxSymbol = "boxRemoveBlue" editBoxAlertTitle = "Change Box" editBoxAlertSub = "Select An Option Below" editBoxColor = 0xFFD110 } else { boxSymbol = "boxAddBlue" editBoxAlertTitle = "Select Box" editBoxAlertSub = "How would you like to select a Box?" editBoxColor = 0x00A1FF } DispatchQueue.main.async { print("ItemDetails: ExpandingButtons main thread dispatch") let menuButtonSize: CGSize = CGSize(width: 34.0, height: 34.0) let menuButton = ExpandingMenuButton(frame: CGRect(origin: CGPoint.zero, size: menuButtonSize), centerImage: UIImage(named: "menuBlue")!, centerHighlightedImage: UIImage(named: "menuBlue")!) menuButton.center = CGPoint(x: 30.0, y: 180.0) self.view.addSubview(menuButton) func showAlert(_ title: String) { let alert = UIAlertController(title: title, message: nil, preferredStyle: .alert) alert.addAction(UIAlertAction(title: "OK", style: .cancel, handler: nil)) self.present(alert, animated: true, completion: nil) } // Edit Items QR String let item1 = ExpandingMenuItem(size: menuButtonSize, title: nil, image: UIImage(named: "qrBlue")!, highlightedImage: UIImage(named: "qrBlue")!, backgroundImage: UIImage(named: "qrBlue"), backgroundHighlightedImage: UIImage(named: "qrBlue")) { () -> Void in self.qrData.qrScanType = .ItemDetailsBoxSelect self.tabBarController?.selectedIndex = 2 // change TabViewController to index 2 // self.performSegueWithIdentifier(segueIdentifier: .editQR, sender: self) } // Add/Edit Photo let item2 = ExpandingMenuItem(size: menuButtonSize, title: nil, image: UIImage(named: "cameraBlue")!, highlightedImage: UIImage(named: "cameraBlue")!, backgroundImage: UIImage(named: "cameraBlue"), backgroundHighlightedImage: UIImage(named: "cameraBlue")) { () -> Void in // showAlert("image") self.pickImage() } // Add/Remove iTem to Box let item3 = ExpandingMenuItem(size: menuButtonSize, title: nil, image: UIImage(named: boxSymbol)!, highlightedImage: UIImage(named: boxSymbol)!, backgroundImage: UIImage(named: boxSymbol), backgroundHighlightedImage: UIImage(named: boxSymbol)) { () -> Void in // showAlert("box") self.showBoxChangeAlertView(title: editBoxAlertTitle, subtitle: editBoxAlertSub, color: editBoxColor) } menuButton.addMenuItems([item1, item2, item3]) // menuButton.willPresentMenuItems = { (menu) -> Void in // print("did willPresentMenuItems menu") } menuButton.didDismissMenuItems = { (menu) -> Void in // print("did dismiss menu") } } } // MARK: SCLAlertView for Expanding Buttons func showBoxChangeAlertView(title: String, subtitle: String, color: UInt) { let icon = UIImage(named:"boxSearch") let alert = SCLAlertView() _ = alert.addButton("Scan QR") { self.performSegueWithIdentifier(segueIdentifier: .ScanQR, sender: self) } _ = alert.addButton("View List") { self.performSegueWithIdentifier(segueIdentifier: .ShowBoxList, sender: self) } if self.item.itemIsBoxed == true { _ = alert.addButton("Remove Item From Box", backgroundColor: UIColor.red, textColor: UIColor.white) { self.boxChangeType = .remove self.changeBox() self.configureExpandingMenuButton() } } DispatchQueue.main.async { _ = alert.showItemAssignBox(title, subTitle: subtitle, closeButtonTitle: "Cancel", icon: icon!, colorStyle: color ) } } func popViewController(){ UIApplication.shared.isNetworkActivityIndicatorVisible = false // let _ = EZLoadingActivity.hide(success: true, animated: true) _ = navigationController?.popViewController(animated: true) let _ = EZLoadingActivity.hide(true, animated: true) } // MARK: ErrorAlert func newItemErrorAlert(_ title: String, message: String) { let alert = UIAlertController(title: title, message: message, preferredStyle: UIAlertControllerStyle.alert) let action = UIAlertAction(title: "Ok", style: .default, handler: nil) alert.addAction(action) present(alert, animated: true, completion: nil) } @IBAction func cancelBtnPressed(_ sender: UIBarButtonItem) { if itemType == .boxItem { popViewController() } else { tabBarController?.selectedIndex = 0 _ = navigationController?.popViewController(animated: true) } } // MARK: - UNWIND Navigation @IBAction func unwind_CancelToItemDetails(_ segue:UIStoryboardSegue) { } @IBAction func unwind_saveCategoryToItemDetails(_ segue:UIStoryboardSegue) { if let categoryDetails = segue.source as? CategoryDetailsVC { if let categorySelections = categoryDetails.category { if let category = categorySelections.category { // changeFontStyle(labelName: itemCategory, isPlaceholder: false) self.item.itemCategory = category self.itemCategory.text = category } if let subcat = categorySelections.subcategory { // changeFontStyle(labelName: itemSubCategory, isPlaceholder: false) subcategoryHeading.isHidden = false self.item.itemSubcategory = subcat self.itemSubCategory.text = subcat } else { self.itemSubCategory.text = "" self.subcategoryHeading.isHidden = true } } self.itemChanged = true } } @IBAction func unwindToItemDetailsFromQRsearch(_ segue:UIStoryboardSegue) { print(" unwindToItemDetailsFromQRsearch") } // MARK: Unwind Box Select @IBAction func unwindToItemDetailsFromListBoxSel(_ segue:UIStoryboardSegue) { if let boxFeedViewController = segue.source as? BoxFeedVC { if let selectedBox = boxFeedViewController.box { self.boxChangeType.next() self.box = selectedBox self.changeBox() self.configureExpandingMenuButton() } } } func changeBox(){ // MARK: Write Box Details to ITEM MODEL // MARK: get box details from Item Model and add to Dictionary // MARK: Create Dictionary for Box Model // func addTonewBoxDict() -> Dictionary<String, AnyObject> { // return ["itemBoxKey": self.box.boxKey as AnyObject , "itemName": self.item.itemName as AnyObject, "itemKey" : self.item.itemKey as AnyObject] // } // print("ItemDetails: switch boxChange type: \(boxChangeType)") switch boxChangeType { case .add: self.box.addItemDetailsToBox(itemKey: self.item.itemKey ) self.item.addBoxDetailsToItem(box: self.box) locationCellVisibility(on: true) case .remove: self.box.removeItemDetailsFromBox(itemKey: self.item.itemKey) self.item.removeBoxDetailsFromItem() locationCellVisibility(on: false) case .update: self.box.removeItemDetailsFromBox(itemKey: self.item.itemKey) self.box.addItemDetailsToBox(itemKey: self.item.itemKey ) self.item.addBoxDetailsToItem(box: self.box) //adds to itemModel and firebase locationCellVisibility(on: true) case .none: print("") } self.updateBoxDetailsView() } override func prepare(for segue: UIStoryboardSegue, sender: Any?) { switch segueIdentifierForSegue(segue: segue) { case .ShowBoxList: if itemType != .new { if let destination = segue.destination as? BoxFeedVC { destination.segueIdentifier = .ItemDetail destination.itemPassed = self.item destination.boxMode = .BoxAssignment } } else { newItemErrorAlert("Item Not Saved", message: "Save new item before adding to Box.") } case .ShowCategory: if let destination = segue.destination as? CategoryDetailsVC { destination.categorySelectionOption = .item } case .ScanQR, .EditQR: if let navVC = segue.destination as? UINavigationController{ if let qrScannerVC = navVC.viewControllers[0] as? qrScannerVC{ qrScannerVC.qrData.qrScanType = .ItemFeedBoxSelect qrScannerVC.delegate = self } } default: break } } func fadeViewInThenOut(view : UIView, delay: TimeInterval) { let animationDuration = 0.25 // Fade in the view UIView.animate(withDuration: animationDuration, animations: { () -> Void in view.alpha = 1 }) { (Bool) -> Void in // After the animation completes, fade out the view after a delay UIView.animate(withDuration: animationDuration, delay: delay, options: .curveEaseInOut, animations: { () -> Void in view.alpha = 0 }, completion: nil) } } var curPage = "ItemDetails" } extension ItemDetailsVC: QrDelegate{ func useReturnedFBKey<inventoryObject>(object: inventoryObject, completion: (Bool) -> ()) { } } extension UITextField { @IBInspectable var placeHolderColor: UIColor? { get { return self.placeHolderColor } set { self.attributedPlaceholder = NSAttributedString(string:self.placeholder != nil ? self.placeholder! : "", attributes:[NSForegroundColorAttributeName: newValue!]) } } }
[ -1 ]
f3ed3dfa1e56714549f1d19ee48713c0dcb61c46
685ff538fb262e570e0a09fc9db50fd9dc27eab5
/WeatherApp/WeatherServices.swift
86e77adbddbef84bddfe91b3d624ebbdb58e67c5
[]
no_license
buhzy/weather-app
3865d22c30737420ed5e6ac021c81704f6987f17
8c2785c48e29ee06989e3b27da3ebab173774334
refs/heads/master
2021-04-15T07:18:44.993169
2018-03-26T15:02:33
2018-03-26T15:02:33
126,844,958
0
0
null
null
null
null
UTF-8
Swift
false
false
3,482
swift
// // WeatherServices.swift // WeatherApp // // Created by Admin on 09/02/2018. // Copyright © 2018 Admin. All rights reserved. // import Foundation protocol weathersServicesDelegate { func setWeather(weather:Weather) func WeatherError(message : String) } class WeatherServices { static var delegate :weathersServicesDelegate? static func GetWeather(city:String){ let appid = "2e09baf41e66fb8af20f3b927facbbb2" let path = "http://api.openweathermap.org/data/2.5/weather?q=\(city)&appid=\(appid)" let url = URL(string: path) let request = URLRequest(url: url!) URLSession.shared.dataTask(with: url!) { (data, response, error) in print(">>> \(data)") let httpresponse = response as? HTTPURLResponse do{ if error == nil{ if let unrappedData = data{ let json = try JSON(data:unrappedData) var status = 0 if let cod = json["cod"].int{ status = cod }else if let cod2 = json["cod"].string{ status = Int(cod2)! } if status == 200 { let lat = json["coord"]["lat"].double let lon = json["coord"]["lon"].double let temp = json["main"]["temp"].double let Name = json["name"].string let hum = json["main"]["humidity"].double let wind = json["wind"]["speed"].double let description = json["weather"][0]["description"].string let icon = json["weather"][0]["icon"].string let weather = Weather(cityName: Name!, Temp: temp!, desc:description!,icon:icon!,hum:hum!,wind:wind!) if delegate != nil{ // to make our results fast DispatchQueue.main.async { self.delegate?.setWeather(weather: weather) } } print("lat: \(lat),temp: \(temp),lon: \(lon),desc: \(description)") }else if status == 404 { if self.delegate != nil { DispatchQueue.main.async { self.delegate?.WeatherError(message: "city not found") } } }else{ //401 error if self.delegate != nil{ DispatchQueue.main.async { self.delegate?.WeatherError(message: "something went wrong") } } } } } }catch{ print("error") } }.resume() } /* let weather = Weather(cityName: city, Temp: 2566, desc: "best city") print("your city is \(city)") self.delegate?.setWeather(weather: weather) } */ }
[ -1 ]
f8462ed33f3fe81216bf0c5a991800ca54c86c51
680212dc63cf74ddfe2e9d1132c72494ee94aee2
/evexityTests/evexityTests.swift
2cc197e2fa31d2706266a1e75aaabb1d4c71779a
[]
no_license
smisra/evexityapp
4d3e72b8ffbc2755ba76ce591af6b792dc823de7
99fc201a2228045031622268258098b0d14e34dc
refs/heads/master
2020-12-31T04:29:09.262181
2016-02-25T01:06:22
2016-02-25T01:06:22
50,302,830
0
0
null
null
null
null
UTF-8
Swift
false
false
1,057
swift
// // evexityTests.swift // evexityTests // // Created by sandeep misra on 24/01/2016. // Copyright © 2016 sandeep misra. All rights reserved. // import XCTest @testable import evexity class evexityTests: 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 testGetEnquiry() { let enq = EnquiryModel() enq.getAllEnquiries() // This is an example of a functional test case. // Use XCTAssert and related functions to verify your tests produce the correct results. } func testPerformanceExample() { // This is an example of a performance test case. self.measureBlock { // Put the code you want to measure the time of here. } } }
[ 145435, 317467, 241692, 239650, 329765, 292902, 354343, 223274, 315434, 325674, 282672, 241716, 288828, 288833, 288834, 315465, 311372, 311374, 354385, 196691, 329814, 354393, 200794, 309345, 280675, 280677, 43110, 321637, 329829, 131178, 319598, 288879, 204916, 223350, 131191, 233590, 288889, 280694, 131198, 319629, 235662, 311438, 325776, 239793, 180408, 227513, 295098, 258239, 280768, 301251, 227524, 309444, 321745, 280795, 194782, 356576, 346346, 125169, 327929, 194820, 321800, 278797, 338197, 227616, 278816, 305440, 211235, 151847, 282919, 332083, 332085, 332089, 282939, 287041, 139589, 182597, 280902, 282960, 325968, 366929, 289110, 168281, 332123, 334171, 106847, 323935, 332127, 354655, 321894, 242033, 313713, 291192, 315773, 211326, 291198, 332167, 242058, 311691, 227725, 108944, 291224, 285084, 317852, 242078, 141728, 315810, 315811, 381347, 289189, 108972, 299441, 283064, 311738, 293310, 291265, 278978, 291267, 127427, 127428, 283075, 311745, 278989, 281037, 317901, 281040, 278993, 289232, 369116, 285150, 279008, 160225, 279013, 127465, 279018, 311786, 330218, 109042, 319987, 279029, 233978, 301571, 342536, 279050, 279062, 289304, 279065, 291358, 293419, 244269, 234036, 338490, 115270, 55881, 377418, 244327, 295536, 287346, 301689, 244347, 279164, 291454, 330379, 311949, 316049, 330387, 330388, 111253, 295576, 111258, 279206, 295599, 342706, 299699, 299700, 164533, 289462, 109241, 248517, 363211, 154316, 242386, 279252, 289502, 299746, 295652, 299759, 199414, 221948, 279294, 299776, 295682, 291592, 322313, 326414, 312079, 322319, 295697, 291604, 207640, 291612, 293664, 281377, 326433, 279336, 295724, 152365, 312108, 285487, 301871, 318252, 230199, 293693, 295746, 318278, 201549, 281427, 353109, 230234, 322395, 109409, 177001, 201577, 242541, 400239, 330609, 174963, 109428, 207732, 310131, 209783, 113542, 109447, 416646, 228233, 316298, 236428, 56208, 308112, 209817, 289690, 127902, 310182, 240552, 353195, 236461, 293806, 316333, 316343, 289722, 230332, 353215, 279498, 52200, 203757, 289774, 287731, 277492, 316405, 240630, 312314, 314362, 328700, 328706, 293893, 134150, 330763, 320527, 238610, 308243, 316437, 197657, 281626, 175132, 326685, 300068, 322612, 238651, 302139, 21569, 214086, 296019, 339030, 353367, 281697, 230499, 314467, 228458, 207979, 281706, 318572, 316526, 15471, 312434, 353397, 300150, 300151, 337017, 285820, 300158, 150657, 302213, 228491, 228493, 177296, 326804, 119962, 283802, 285851, 296092, 300188, 300202, 306346, 228540, 230588, 228542, 353479, 353481, 189652, 189653, 148696, 333022, 304351, 304356, 290022, 234733, 279792, 353523, 298228, 216315, 208124, 292091, 228609, 320770, 292107, 251153, 177428, 245019, 126237, 115998, 333090, 279854, 298291, 171317, 318775, 286013, 333117, 300359, 312648, 294218, 296273, 331090, 120148, 314709, 314710, 357719, 134491, 316765, 222559, 163175, 333160, 306542, 296303, 327025, 249204, 249205, 181625, 111993, 290169, 224640, 306560, 294275, 298374, 368011, 304524, 296335, 112017, 112018, 234898, 224661, 318875, 310692, 241066, 316842, 314798, 286129, 279989, 228795, 292283, 280004, 300487, 306631, 284107, 302540, 310732, 312782, 64975, 310736, 327121, 286172, 144867, 103909, 316902, 245223, 191981, 282096, 321009, 329200, 191990, 280055, 300536, 290301, 286205, 300542, 230913, 292356, 323087, 323089, 282141, 187938, 245292, 230959, 288309, 290358, 194110, 288318, 56902, 282183, 288327, 292423, 243274, 333388, 224847, 228943, 118353, 280147, 290390, 128599, 235095, 44635, 333408, 157281, 286306, 312940, 204397, 224883, 333430, 175741, 337535, 294529, 312965, 282246, 229001, 290443, 188048, 282259, 302739, 229020, 257699, 40613, 40614, 40615, 298661, 61101, 321199, 337591, 280251, 327358, 282303, 323264, 321219, 333509, 9936, 9937, 302802, 229088, 298720, 321249, 153319, 12010, 280300, 325371, 194303, 194304, 216839, 284431, 243472, 321295, 161554, 323346, 116505, 313120, 241441, 315171, 284459, 294700, 200498, 319292, 315202, 307011, 325445, 282438, 153415, 280392, 325457, 413521, 317269, 18262, 284507, 300894, 245599, 237408, 302946, 276327, 325484, 296814, 282480, 292720, 325492, 241528, 194429, 325503, 315264, 188292, 241540, 327557, 67463, 243591, 315273, 315274, 243597, 329622, 294807, 311199, 292771, 300963, 313254, 294823, 292782, 317360, 294843, 214977, 280514, 214984, 284619, 344013, 231375, 294886, 317415, 296941, 278512, 311281, 223218, 311282, 333817, 292858 ]
6a6b38b4fe153c113ad7c18e27580138e585cb2c
43b4be65e6e5e78a94aeb37ffacdcf2a46d6918f
/RequestTest/SceneDelegate.swift
a98f5757000b0be6af8bc5e57a857f1ef8fca06c
[]
no_license
simon-o/RequestTest
5965e19ea81c94a082314d7f6f1e4123c422a620
d3bfc5125b6bae3bc33d1768bf924fd838aa2e96
refs/heads/master
2020-12-04T01:49:29.948806
2020-01-04T19:24:14
2020-01-04T19:24:14
231,559,272
0
0
null
null
null
null
UTF-8
Swift
false
false
2,787
swift
// // SceneDelegate.swift // RequestTest // // Created by Antoine Simon on 03/01/2020. // Copyright © 2020 antoine simon. All rights reserved. // import UIKit class SceneDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow? func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). if let windowScene = scene as? UIWindowScene { let window = UIWindow(windowScene: windowScene) let manager = InformationManager() let presenter = InformationPresenter(manager: manager) let viewController = InformationViewController(presenter: presenter) window.rootViewController = viewController window.makeKeyAndVisible() self.window = window } } func sceneDidDisconnect(_ scene: UIScene) { // Called as the scene is being released by the system. // This occurs shortly after the scene enters the background, or when its session is discarded. // Release any resources associated with this scene that can be re-created the next time the scene connects. // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). } func sceneDidBecomeActive(_ scene: UIScene) { // Called when the scene has moved from an inactive state to an active state. // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. } func sceneWillResignActive(_ scene: UIScene) { // Called when the scene will move from an active state to an inactive state. // This may occur due to temporary interruptions (ex. an incoming phone call). } func sceneWillEnterForeground(_ scene: UIScene) { // Called as the scene transitions from the background to the foreground. // Use this method to undo the changes made on entering the background. } func sceneDidEnterBackground(_ scene: UIScene) { // Called as the scene transitions from the foreground to the background. // Use this method to save data, release shared resources, and store enough scene-specific state information // to restore the scene back to its current state. } }
[ 325633, 393221, 350214, 325637, 163849, 268299, 393228, 333838, 393231, 350225, 350232, 333851, 346140, 350238, 350241, 393251, 374819, 350245, 352294, 350249, 350252, 393260, 350257, 350260, 393269, 16444, 393277, 337980, 254020, 217158, 243782, 350281, 378956, 395340, 350286, 327757, 200786, 286804, 329816, 217180, 368736, 342113, 180322, 430181, 329833, 286833, 368753, 252021, 342134, 286845, 192640, 286851, 329868, 268435, 250008, 329886, 286880, 135328, 192674, 333989, 438438, 286889, 430257, 387250, 334012, 327872, 256193, 180418, 430275, 260299, 350411, 346317, 180432, 350417, 368854, 350423, 350426, 385243, 334047, 379108, 356580, 217319, 346344, 327915, 338161, 387314, 375027, 350449, 350454, 321787, 336124, 350459, 350462, 336129, 350465, 389381, 350469, 325895, 194829, 350477, 43279, 368913, 350481, 350487, 356631, 338201, 387353, 350491, 381212, 258333, 377118, 325918, 182559, 350494, 325920, 350500, 350505, 350510, 395567, 248112, 332081, 307507, 340276, 336181, 356662, 332091, 332098, 201030, 332107, 190797, 334162, 332118, 418135, 321880, 250201, 362844, 332126, 332130, 250211, 340328, 250217, 348523, 246124, 348528, 182642, 321911, 332153, 334204, 268669, 194942, 332158, 250239, 332162, 389507, 348548, 393613, 383375, 332175, 160152, 340380, 268702, 416159, 326059, 356783, 373169, 342453, 334263, 338363, 324032, 262593, 266688, 336326, 272849, 338387, 248279, 369119, 338404, 334312, 338411, 104940, 375279, 162289, 328178, 328180, 248309, 328183, 340473, 199165, 328190, 324095, 328193, 98819, 324100, 266757, 324103, 164362, 328204, 248332, 199182, 328207, 324112, 330254, 186898, 342546, 340501, 324118, 334359, 342551, 324122, 334364, 330268, 340512, 191012, 332325, 324134, 197160, 381483, 324141, 324143, 334386, 324156, 334397, 324161, 324165, 219719, 324171, 324174, 324177, 399957, 244309, 334425, 326240, 375401, 248427, 191085, 346736, 338544, 346743, 268922, 334466, 336517, 344710, 119432, 148106, 377485, 162446, 330384, 346769, 326291, 340628, 184983, 373399, 342685, 340639, 336549, 332455, 271018, 332460, 336556, 389806, 332464, 385714, 164535, 336568, 174775, 248505, 350207, 174778, 244410, 328379, 332473, 223936, 328387, 332484, 332487, 373450, 418508, 154318, 332494, 342737, 355029, 154329, 183006, 139998, 189154, 338661, 332521, 338665, 418540, 330479, 342769, 340724, 332534, 338680, 342777, 418555, 344832, 207620, 344837, 191240, 328462, 361231, 326417, 336660, 338712, 199455, 336676, 334633, 326444, 215854, 271154, 348979, 152371, 326452, 328498, 326455, 348983, 375613, 244542, 326463, 326468, 328516, 336709, 127815, 244552, 328520, 326474, 328523, 336712, 342857, 326479, 330581, 326486, 213848, 136024, 330585, 326494, 439138, 326503, 344936, 375657, 326508, 201580, 400238, 326511, 201583, 355185, 211826, 340850, 330612, 201589, 381815, 340859, 324476, 328574, 340863, 359296, 252801, 351105, 373635, 324482, 324488, 342921, 236432, 361361, 324496, 342931, 330643, 324502, 400279, 252823, 324511, 324514, 252838, 201638, 211885, 324525, 5040, 5047, 324539, 324542, 187335, 398280, 347082, 340940, 340942, 345046, 359383, 330711, 248794, 340958, 248799, 383968, 347106, 398307, 340964, 386023, 343018, 328690, 359411, 244728, 330750, 265215, 328703, 199681, 418822, 328710, 330761, 328715, 326669, 330769, 361490, 349203, 209944, 336922, 209948, 248863, 345119, 250915, 357411, 250917, 158759, 347178, 328747, 214060, 261166, 209966, 209969, 330803, 209973, 386102, 209976, 339002, 339010, 209988, 209991, 347208, 248905, 330827, 197708, 330830, 341072, 248915, 345172, 183384, 156762, 402523, 343132, 412765, 339037, 322660, 326764, 210028, 187503, 326767, 345200, 330869, 361591, 386168, 210042, 210045, 212095, 160896, 361599, 152704, 330886, 384136, 330890, 384140, 351382, 347288, 337048, 210072, 248986, 384152, 210078, 384158, 210081, 384161, 251045, 210085, 210089, 339118, 337072, 337076, 210100, 324792, 367801, 339133, 384189, 343232, 384192, 210116, 244934, 326858, 322763, 384202, 343246, 330959, 384209, 333010, 146644, 330966, 351450, 210139, 328925, 66783, 384225, 359650, 328933, 343272, 351467, 328942, 251123, 384247, 384250, 388348, 242947, 206084, 115973, 343307, 384270, 333075, 384276, 333079, 251161, 384284, 245021, 384290, 353572, 345383, 171304, 208167, 263464, 245032, 245042, 199989, 345400, 378170, 208189, 386366, 343366, 126279, 337224, 251211, 357710, 337230, 331089, 337235, 437588, 331094, 396634, 175458, 343394, 208228, 175461, 374118, 337252, 343399, 345449, 175464, 99692, 333164, 343410, 234867, 331124, 390518, 175478, 378232, 155000, 249210, 175484, 337278, 249215, 245121, 249219, 245128, 249225, 353674, 181644, 361869, 249228, 136591, 245137, 181650, 249235, 112021, 181655, 245143, 175514, 245146, 343453, 245149, 245152, 263585, 396706, 245155, 355749, 40358, 181671, 245158, 333222, 181674, 245163, 114093, 181679, 337330, 327090, 210357, 181691, 146878, 415168, 181697, 380353, 361922, 327108, 181704, 327112, 339401, 384457, 327116, 327118, 208338, 366035, 343509, 337366, 249310, 249313, 333285, 366057, 329195, 343540, 343545, 402943, 423424, 253445, 339464, 337416, 249355, 329227, 175637, 405017, 345626, 370208, 366118, 339504, 349748, 206397, 214594, 333387, 400977, 214611, 333400, 366173, 403040, 339553, 333415, 245358, 333423, 222831, 138865, 339572, 155255, 333440, 372354, 403076, 126597, 198282, 403085, 159375, 126611, 333472, 245410, 345763, 345766, 425639, 245415, 337588, 155323, 333499, 337601, 337607, 210632, 333512, 259789, 339664, 272083, 358100, 245463, 419543, 345819, 212700, 366301, 181982, 153311, 333535, 366308, 366312, 225000, 337643, 399086, 337647, 366319, 370416, 366322, 339696, 399092, 245487, 366326, 245495, 257788, 337661, 141052, 339711, 225027, 257796, 337671, 257802, 339722, 257805, 366349, 257808, 249617, 321300, 245528, 399129, 333593, 210720, 257825, 362274, 116512, 184096, 339748, 257834, 358192, 257843, 372533, 257846, 397113, 345916, 257853, 399166, 384831, 325441, 247618, 360262, 325447, 370504, 341831, 329545, 341835, 345932, 257869, 370510, 341839, 257872, 337743, 354124, 323404, 397140, 354132, 339795, 341844, 247639, 257881, 337751, 358235, 257884, 341852, 313181, 257891, 413539, 399208, 257897, 339818, 327532, 257902, 339827, 358260, 341877, 372598, 399222, 325494, 182136, 257914, 186233, 1914, 257917, 333690, 243584, 325505, 257922, 333699, 339845, 257927, 399244, 247692, 333709, 247701, 329625, 253854, 436127, 436133, 327590, 333737, 382891, 382898, 337845, 372665, 190393, 327613, 333767, 350153, 346059, 311244, 358348, 247760, 212945, 333777, 346069, 399318, 219094, 372698, 329699, 358372, 327655, 350190, 247790, 204785, 350194, 393204, 360439, 393209, 333819, 393215 ]
65b64743e0f33f94530a8da6df3205e5c71024e6
ed432a009ea45f74b353a9a5d499fd7bb46445cd
/LostAndFound/LostItemDetailPage.swift
f79969a63e18c77b8c4e711012790e43865c45b9
[]
no_license
DJGajjar/LostAndFound
ac991b396d0951631f77e76757ed3fb2ca9fa3ad
10fcdbd2f008653b93693f316601ea819b5c5198
refs/heads/main
2023-04-06T15:01:11.619077
2021-04-01T07:47:53
2021-04-01T07:47:53
349,679,531
1
1
null
null
null
null
UTF-8
Swift
false
false
24,351
swift
// LostItemDetailPage.swift // LostAndFound // Created by Revamp on 04/11/19. // Copyright © 2019 Revamp. All rights reserved. import UIKit import PageControls import MapKit import MessageUI class LostItemDetailPage: UIViewController, UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout, MKMapViewDelegate, MFMailComposeViewControllerDelegate { @IBOutlet weak var btnBack : UIButton! @IBOutlet weak var MainScroll : UIScrollView! @IBOutlet weak var imgItemCollection : UICollectionView! @IBOutlet weak var myPageControl: ZPageControl! @IBOutlet weak var AllContentView : UIView! @IBOutlet weak var ItemView: UIView! @IBOutlet weak var ItemName: UILabel! @IBOutlet weak var ItemCategory: UILabel! @IBOutlet weak var ItemBrandTitle: UILabel! @IBOutlet weak var ItemBrand: UILabel! @IBOutlet weak var ItemColorTitle: UILabel! @IBOutlet weak var ItemColor: UILabel! @IBOutlet weak var btnShare: UIButton! @IBOutlet weak var btnViews: UIButton! @IBOutlet weak var imgRewardIcon: UIImageView! @IBOutlet weak var lblRewardAmount: UILabel! @IBOutlet weak var lblRewardAmountTitle: UILabel! @IBOutlet weak var DateLocationView: UIView! @IBOutlet weak var imgDateIcon: UIImageView! @IBOutlet weak var lblDateTime: UILabel! @IBOutlet weak var lblDateTimeTitle: UILabel! @IBOutlet weak var LocationMapView: MKMapView! @IBOutlet weak var imgPinIcon: UIImageView! @IBOutlet weak var lblAddressTitle: UILabel! @IBOutlet weak var txtAddressDesc: UITextView! @IBOutlet weak var OwnerView: UIView! @IBOutlet weak var OwnerImage: UIImageView! @IBOutlet weak var OwnerName: UILabel! @IBOutlet weak var OwnerLocation: UILabel! @IBOutlet weak var BtnOwnerCall: UIButton! @IBOutlet weak var BtnOwnerMail: UIButton! @IBOutlet weak var BtnOwnerChatMessage: UIButton! @IBOutlet weak var BtnOwnerPin: UIButton! @IBOutlet weak var DescriptionView: UIView! @IBOutlet weak var DescriptionText: UITextView! @IBOutlet weak var TagView: UIView! @IBOutlet weak var TagsDescription: UITextView! var ArrItemImages = NSMutableArray() var lostItemID = "" var SharableImage = UIImage(named: "place_holder") var ScreenshotImage = UIImage() var dictLostDetail = NSDictionary() //MARK:- UIViewcontroller Methods override func viewDidLoad() { super.viewDidLoad() if #available(iOS 13.0, *) { overrideUserInterfaceStyle = .light } self.doApplyLocalisation() // Set Frames self.doSetFrames() // Configure Page Control self.doConfigurePageControl() // Reachability Test if constants().APPDEL.isInternetOn(currentController: self) == false { return } // Fetch Detail Data self.doFetchData() // Increase View Counts apiClass().doNormalAPI(param: ["lost_id":self.lostItemID], APIName: apiClass().LostViewCountAPI, method: "POST") { (success, errMessage, mDict) in } } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) } override var prefersStatusBarHidden: Bool { return true } //MARK:- Fetch Data func doFetchData() { apiClass().doNormalAPI(param: ["user_id":constants().doGetUserId(), "lost_id":self.lostItemID], APIName: apiClass().LostItemDetailAPI, method: "POST") { (success, errMessage, mDict) in DispatchQueue.main.async { if success == true { self.dictLostDetail = mDict.value(forKey: "lost_item") as! NSDictionary self.ItemName.text = (self.dictLostDetail.value(forKey: "item_name") as! String) self.ItemCategory.text = (self.dictLostDetail.value(forKey: "category_item_name") as! String) self.ItemBrand.text = (self.dictLostDetail.value(forKey: "brand_name") as! String) if (self.ItemBrand.text?.count == 0) { self.ItemBrand.text = NSLocalizedString("no_info_short", comment: "") } self.ItemColor.backgroundColor = constants().hexStringToUIColor(hex: (self.dictLostDetail.value(forKey: "color_code") as! String)) if (self.dictLostDetail.value(forKey: "reward") as! String).isEmpty { self.lblRewardAmount.isHidden = true self.lblRewardAmountTitle.isHidden = true self.imgRewardIcon.isHidden = true } else { self.lblRewardAmount.isHidden = false self.lblRewardAmountTitle.isHidden = false self.lblRewardAmount.text = "$\(self.dictLostDetail.value(forKey: "reward") as! String)" } self.btnViews.setTitle("\(self.dictLostDetail.value(forKey: "no_of_view") as! String) Views", for: .normal) self.OwnerName.text = "\(self.dictLostDetail.value(forKey: "first_name") as! String) \(self.dictLostDetail.value(forKey: "last_name") as! String)" self.OwnerLocation.text = (self.dictLostDetail.value(forKey: "address1") as! String) if !(self.dictLostDetail.value(forKey: "address2") as! String).isEmpty { self.OwnerLocation.text?.append(", \(self.dictLostDetail.value(forKey: "address2") as! String)") } if !(self.dictLostDetail.value(forKey: "city") as! String).isEmpty { self.OwnerLocation.text?.append(", \(self.dictLostDetail.value(forKey: "city") as! String)") } if !(self.dictLostDetail.value(forKey: "country") as! String).isEmpty { self.OwnerLocation.text?.append(", \(self.dictLostDetail.value(forKey: "country") as! String)") } self.OwnerImage.contentMode = .scaleAspectFill self.OwnerImage.loadProfileImage(url: (self.dictLostDetail.value(forKey: "image") as! String)) self.ArrItemImages = (self.dictLostDetail.value(forKey: "lost_images") as! NSArray).mutableCopy() as! NSMutableArray self.myPageControl.numberOfPages = self.ArrItemImages.count self.imgItemCollection.reloadData() self.lblDateTime.text = (self.dictLostDetail.value(forKey: "lost_date") as! String) self.txtAddressDesc.text = (self.dictLostDetail.value(forKey: "location") as! String) self.DescriptionText.text = (self.dictLostDetail.value(forKey: "description") as! String) if (self.DescriptionText.text?.count == 0) { self.DescriptionText.text = NSLocalizedString("no_info_long", comment: "") } let newSize = self.DescriptionText.sizeThatFits(CGSize(width: self.DescriptionView.frame.size.width - 20, height: CGFloat.greatestFiniteMagnitude)) var frame = self.DescriptionText.frame frame.size = newSize self.DescriptionText.frame = frame frame = self.DescriptionView.frame frame.size.height = self.DescriptionText.frame.size.height + 55 self.DescriptionView.frame = frame var tagArray = (self.dictLostDetail.value(forKey: "tag") as! String).components(separatedBy: ",") if tagArray.count > 0 { tagArray = (((tagArray.map { "#\($0)" }) as NSArray).mutableCopy() as! NSMutableArray) as! [String] self.TagsDescription.text = tagArray.joined(separator: ",") } if (tagArray.count == 0 || self.TagsDescription.text.count < 2) { self.TagsDescription.text = NSLocalizedString("no_info_long", comment: "") } let newTagSize = self.TagsDescription.sizeThatFits(CGSize(width: self.TagsDescription.frame.size.width - 20, height: CGFloat.greatestFiniteMagnitude)) frame = self.TagsDescription.frame frame.size = newTagSize self.TagsDescription.frame = frame frame = self.TagView.frame frame.origin.y = self.DescriptionView.frame.origin.y + self.DescriptionView.frame.size.height + 15 frame.size.height = self.TagsDescription.frame.size.height + 55 self.TagView.frame = frame frame = self.AllContentView.frame frame.size.height = self.TagView.frame.origin.y + self.TagView.frame.size.height + 20 self.AllContentView.frame = frame self.MainScroll.contentSize = CGSize(width: constants().SCREENSIZE.width, height: self.AllContentView.frame.origin.y + self.AllContentView.frame.size.height) self.doSetupMapLocation() if (self.dictLostDetail.value(forKey: "text_chat_status") as! String) == "OFF" { self.BtnOwnerChatMessage.isEnabled = false self.BtnOwnerChatMessage.backgroundColor = UIColor.lightGray } else { self.BtnOwnerChatMessage.isEnabled = true self.BtnOwnerChatMessage.backgroundColor = constants().COLOR_LightBlue } if (self.dictLostDetail.value(forKey: "user_mobile") as! String).isEmpty { self.BtnOwnerCall.isEnabled = false self.BtnOwnerCall.backgroundColor = UIColor.lightGray } else { if (self.dictLostDetail.value(forKey: "display_mobile_status") as! String) == "OFF" { self.BtnOwnerCall.isEnabled = false self.BtnOwnerCall.backgroundColor = UIColor.lightGray } else { self.BtnOwnerCall.isEnabled = true self.BtnOwnerCall.backgroundColor = constants().COLOR_LightBlue } } if (self.dictLostDetail.value(forKey: "user_email") as! String).isEmpty { self.BtnOwnerMail.isEnabled = false self.BtnOwnerMail.backgroundColor = UIColor.lightGray } else { self.BtnOwnerMail.isEnabled = true self.BtnOwnerMail.backgroundColor = constants().COLOR_LightBlue } if constants().APPDEL.isMyItem == 0 { if constants().doGetUserId() == (self.dictLostDetail.value(forKey: "user_id") as! String) { self.doHideOwnerControls() } } else { self.doHideOwnerControls() } } else { let alertController = UIAlertController(title: NSLocalizedString("alert", comment: ""), message: errMessage, preferredStyle: .alert) let okAction = UIAlertAction(title: NSLocalizedString("ok", comment: ""), style: .default) { (action) in self.doBack() } alertController.addAction(okAction) self.present(alertController, animated: true, completion: nil) } } } } //MARK:- Other Methods func doConfigurePageControl() { self.myPageControl.numberOfPages = self.ArrItemImages.count self.myPageControl.currentPage = 0 self.myPageControl.dotSize = CGSize(width: 15.0, height: 4.0) self.myPageControl.dotRadius = 2.0 self.myPageControl.pageIndicatorTintColor = UIColor(red: 240.0/255.0, green: 240.0/255.0, blue: 240.0/255.0, alpha: 1.0) self.myPageControl.currentPageIndicatorTintColor = constants().COLOR_LightBlue } func doSetupMapLocation() { let geoCoder = CLGeocoder() geoCoder.geocodeAddressString(txtAddressDesc.text) { (placemarks, error) in guard let placemarks = placemarks, let location = placemarks.first?.location else { return } let span = MKCoordinateSpan(latitudeDelta: 0.05, longitudeDelta: 0.05) let region = MKCoordinateRegion(center: location.coordinate, span: span) self.LocationMapView.setRegion(region, animated: true) let annotation = MKPointAnnotation() annotation.coordinate = location.coordinate annotation.title = self.ItemName.text annotation.subtitle = self.txtAddressDesc.text self.LocationMapView.addAnnotation(annotation) } } func doSetFrames() { UIView.appearance().semanticContentAttribute = .forceLeftToRight self.MainScroll.semanticContentAttribute = .forceLeftToRight self.AllContentView.semanticContentAttribute = .forceLeftToRight self.ItemView.semanticContentAttribute = .forceLeftToRight self.btnBack.layer.cornerRadius = 20.0 self.btnBack.layer.masksToBounds = true self.ItemView.layer.cornerRadius = 10.0 self.ItemView.layer.masksToBounds = true self.OwnerView.layer.cornerRadius = 10.0 self.OwnerView.layer.masksToBounds = true self.DateLocationView.layer.cornerRadius = 10.0 self.DateLocationView.layer.masksToBounds = true self.DescriptionView.layer.cornerRadius = 10.0 self.DescriptionView.layer.masksToBounds = true self.TagView.layer.cornerRadius = 10.0 self.TagView.layer.masksToBounds = true self.btnShare.layer.cornerRadius = self.btnShare.frame.size.height / 2 self.btnShare.layer.masksToBounds = true self.btnViews.layer.cornerRadius = self.btnViews.frame.size.height / 2 self.btnViews.layer.masksToBounds = true self.ItemColor.layer.borderColor = UIColor.lightGray.cgColor self.ItemColor.layer.borderWidth = 1.0 self.ItemColor.layer.cornerRadius = self.ItemColor.frame.size.width / 2 self.ItemColor.layer.masksToBounds = true self.OwnerImage.layer.cornerRadius = self.OwnerImage.frame.size.width / 2 self.OwnerImage.layer.masksToBounds = true self.BtnOwnerCall.layer.cornerRadius = self.BtnOwnerCall.frame.size.width / 2 self.BtnOwnerCall.layer.masksToBounds = true self.BtnOwnerMail.layer.cornerRadius = self.BtnOwnerMail.frame.size.width / 2 self.BtnOwnerMail.layer.masksToBounds = true self.BtnOwnerChatMessage.layer.cornerRadius = self.BtnOwnerChatMessage.frame.size.width / 2 self.BtnOwnerChatMessage.layer.masksToBounds = true self.BtnOwnerPin.layer.cornerRadius = self.BtnOwnerPin.frame.size.width / 2 self.BtnOwnerPin.layer.masksToBounds = true if (constants().userinterface == .pad) { var frame = self.imgItemCollection.frame frame.size.height = constants().SCREENSIZE.height * 0.42 self.imgItemCollection.frame = frame frame = self.AllContentView.frame frame.origin.y = self.imgItemCollection.frame.size.height - 60 self.AllContentView.frame = frame frame = self.myPageControl.frame frame.origin.y = self.AllContentView.frame.origin.y - 30 self.myPageControl.frame = frame } else { if (constants().SCREENSIZE.height == 812 || constants().SCREENSIZE.height == 896) { var frame = self.btnBack.frame frame.origin.y = 35 self.btnBack.frame = frame } } var frame = self.AllContentView.frame frame.size.height = self.TagView.frame.origin.y + self.TagView.frame.size.height + 20 self.AllContentView.frame = frame self.MainScroll.contentSize = CGSize(width: constants().SCREENSIZE.width, height: self.AllContentView.frame.origin.y + self.AllContentView.frame.size.height) } func doApplyLocalisation() { self.ItemBrandTitle.text = NSLocalizedString("brand", comment: "") self.ItemColorTitle.text = NSLocalizedString("color", comment: "") } func doHideOwnerControls() { // self.BtnOwnerCall.isHidden = true // self.BtnOwnerMail.isHidden = true // self.BtnOwnerChatMessage.isHidden = true // self.BtnOwnerPin.isHidden = true } //MARK:- UIScrollView Delegate Method func scrollViewDidScroll(_ scrollView: UIScrollView) { var swipeValue:CGFloat = -70 if (constants().userinterface == .pad) { swipeValue = -120 } if scrollView.contentOffset.y < swipeValue { self.view.window!.layer.add(constants().pushFromBottomTransition(), forKey: kCATransition) self.doBack() } } func screenshot() { let savedContentOffset = self.MainScroll.contentOffset let savedFrame = self.MainScroll.frame UIGraphicsBeginImageContext(self.MainScroll.contentSize) self.MainScroll.contentOffset = .zero self.MainScroll.frame = CGRect(x: 0, y: 0, width: self.MainScroll.contentSize.width, height: self.MainScroll.contentSize.height) guard let context = UIGraphicsGetCurrentContext() else { return } self.MainScroll.layer.render(in: context) let image = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext(); self.MainScroll.contentOffset = savedContentOffset self.MainScroll.frame = savedFrame self.ScreenshotImage = image! } //MARK:- IBAction Methods @IBAction func pageControlSelectionAction(_ sender: UIPageControl) { } @IBAction func doBack() { if constants().APPDEL.isMyItem == 0 { let ivc = constants().storyboard.instantiateViewController(withIdentifier: "tabbar") as! UITabBarController ivc.selectedIndex = 0 constants().APPDEL.window?.rootViewController = ivc } else if constants().APPDEL.isMyItem == 1 { let ivc = constants().storyboard.instantiateViewController(withIdentifier: "myitems") as! MyItems constants().APPDEL.window?.rootViewController = ivc } } @IBAction func doShare() { let lostItemDesc = "Lost Item - \(self.ItemName.text!)" var shareItems : [Any] = [lostItemDesc] if self.SharableImage != nil { shareItems = [lostItemDesc, self.SharableImage!] } let activityViewController = UIActivityViewController(activityItems: shareItems , applicationActivities: nil) activityViewController.popoverPresentationController?.sourceView = self.view self.present(activityViewController, animated: true, completion: nil) } @IBAction func doOwnerCall() { constants().doCallNumber(phoneNumber: self.dictLostDetail.value(forKey: "user_mobile") as! String) } @IBAction func doOwnerMail() { self.screenshot() let mailComposeViewController = configureMailComposer() if MFMailComposeViewController.canSendMail() { self.present(mailComposeViewController, animated: true, completion: nil) } } @IBAction func doOwnerChat() { constants().APPDEL.doGetQuickBloxUser(nLogin: (self.dictLostDetail.value(forKey: "user_id") as! String)) } @IBAction func doOwnerPinview() { let ivc = constants().storyboard.instantiateViewController(withIdentifier: "maplocationview") as! MapLocationView ivc.myLocation = self.txtAddressDesc.text ivc.modalPresentationStyle = .fullScreen self.present(ivc, animated: true, completion: nil) } //MARK:- Mail Configure func configureMailComposer() -> MFMailComposeViewController { let mailComposeVC = MFMailComposeViewController() mailComposeVC.mailComposeDelegate = self mailComposeVC.setToRecipients([(self.dictLostDetail.value(forKey: "user_email") as! String)]) mailComposeVC.addAttachmentData(self.ScreenshotImage.jpegData(compressionQuality: 1.0)!, mimeType: "image/jpeg", fileName: "LostItem.jpeg") mailComposeVC.setSubject("Lost & Found - Lost Item") mailComposeVC.setMessageBody("Hi \(self.OwnerName.text!),\n\nI would like to inquire about this Lost Item.\n\n", isHTML: false) return mailComposeVC } //MARK:- MFMailComposeViewController Delegate Method func mailComposeController(_ controller: MFMailComposeViewController, didFinishWith result: MFMailComposeResult, error: Error?) { controller.dismiss(animated: true, completion: nil) } //MARK: - Custom Annotation func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView? { let reuseIdentifier = "pin" var annotationView = mapView.dequeueReusableAnnotationView(withIdentifier: reuseIdentifier) if annotationView == nil { annotationView = MKAnnotationView(annotation: annotation, reuseIdentifier: reuseIdentifier) annotationView?.canShowCallout = true } else { annotationView?.annotation = annotation } annotationView?.image = UIImage(named: "map_pin") return annotationView } //MARK:- UICollectionView Methods func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForHeaderInSection section: Int) -> CGSize { return CGSize(width: 0, height: 0) } public func numberOfSections(in collectionView: UICollectionView) -> Int { return 1 } public func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return self.ArrItemImages.count } public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "cell", for: indexPath) cell.backgroundColor = UIColor.clear let mDict = self.ArrItemImages.object(at: indexPath.row) as! NSDictionary let imgProductImage = cell.viewWithTag(101) as! UIImageView imgProductImage.backgroundColor = UIColor(red: 220.0/255.0, green: 220.0/255.0, blue: 220.0/255.0, alpha: 1.0) imgProductImage.sd_setImage(with: URL(string: mDict.value(forKey: "image") as! String), completed: nil) if indexPath.row == 0 { SharableImage = imgProductImage.image } imgProductImage.contentMode = .scaleAspectFit imgProductImage.backgroundColor = UIColor.clear return cell } func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { return CGSize(width: constants().SCREENSIZE.width, height: self.imgItemCollection.frame.size.height) } func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets { return UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0) } func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat { return 0 } func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat { return 0 } func collectionView(_ collectionView: UICollectionView, willDisplay cell: UICollectionViewCell, forItemAt indexPath: IndexPath) { self.myPageControl.currentPage = indexPath.row } public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { } }
[ -1 ]
190ae2e8923b200e761009877cf20d94fe4771af
c226b6d6d6428044948a9107637a7d805395f0f6
/Sources/App/Models/Entities/Todo/Todo+DataTransformers.swift
8faf1f09aadd6bdf01dc96e554ab45bd28e91bc9
[ "MIT" ]
permissive
vapor-community/repository-template
90dc6ace28f99a243692568e6e0b78c4d487679c
da66b812146a1fafec0be81bdbea75c2d9386677
refs/heads/master
2020-03-25T03:26:04.702630
2018-10-24T19:56:22
2018-10-24T19:56:22
143,341,638
8
4
MIT
2018-10-24T19:56:23
2018-08-02T20:24:44
Swift
UTF-8
Swift
false
false
62
swift
// Use this file to extend Todo for transformation purposes.`
[ -1 ]
181d6e78f5e8a0362087f525a342225d6e561907
6fc9ba566ce37081db83d185d7c2fcd11d69a876
/tmdb/Classes/Common/Rest/FuckingRequest.swift
8271150f9bede05074d0b86f141c13197f3f4486
[ "MIT" ]
permissive
dedeexe/tmdb_example
dcbd83957bc1fd8ec1e0aa1c0a2fe67f5301254c
00a6d33954b9f3e0e90673c7652767d0aa66865f
refs/heads/master
2021-01-21T11:23:14.759084
2017-03-03T13:45:58
2017-03-03T13:45:58
83,561,616
0
0
MIT
2019-09-03T12:07:14
2017-03-01T14:10:06
Swift
UTF-8
Swift
false
false
2,609
swift
// // FuckingRequest.swift // FuckTheRest // // Created by Fabrício Santos on 1/24/17. // Copyright © 2017 dede.exe. All rights reserved. // import Foundation open class FuckingRequest { let url:URL let method : String var parameters : [String:String] = [:] var headers : [String:String] = [:] fileprivate var request : URLRequest { var fieldParams:[String] = [] var urlRequest = URLRequest(url: self.url) urlRequest.httpMethod = method for (key,value) in headers { urlRequest.addValue(value, forHTTPHeaderField: key) } for (key,value) in parameters { let paramValue = "\(key)=\(value)" fieldParams.append(paramValue) } let paramsString = fieldParams.joined(separator: "&") if method == FuckingMethod.get.rawValue && fieldParams.count > 0 { let urlString = url.absoluteString + "?" + paramsString let getURL = URL(string: urlString) urlRequest.url = getURL return urlRequest } urlRequest.httpBody = paramsString.data(using:.utf8) return urlRequest } public init(url:String, methodName:String) { self.url = URL(string:url)! self.method = methodName } convenience public init(url:String, method:FuckingMethod) { self.init(url:url, methodName:method.rawValue) } open func header(_ fields:[String:String]) { self.headers = fields } open func addHeader(_ key:String, value:String) -> FuckingRequest { self.headers[key] = value return self } open func parameters(_ fields:[String:String]) { self.headers = fields } open func addParameter(_ key:String, value:String) -> FuckingRequest { self.parameters[key] = value return self } } extension FuckingRequest { open func response(completion:@escaping (FuckingResult<Data>) -> Void) { let requestEntity = self.request let responseEntity = FuckingResponse(request: requestEntity) responseEntity.getData(completion: completion) } open func responseString(completion:@escaping (FuckingResult<String>) -> Void) { let requestEntity = self.request let responseEntity = FuckingResponse(request: requestEntity) responseEntity.getData { (resultData) in let stringResult = resultData.map(extractStringFromData) completion(stringResult) } } }
[ -1 ]
18457abe1137511d0e51ae8b14a6e8625c2bf616
45d7c9d199aee3b28f66b475a64bd31b5be10891
/macOS/MLCompute/MLCInstanceNormalizationLayer.swift
7c048daa1058e485219403fdb66f82808adfb7df
[]
no_license
DougGregor/swift-concurrency-objc
f8ba0cfa2a4153d1cd129d7d61060d0a47067847
5ab47b4f70a675a4298dc00b1526505b964b4061
refs/heads/xcode-12-2-beta-3
2023-01-28T12:41:18.646533
2020-10-15T19:42:00
2020-10-15T19:42:00
304,435,605
40
8
null
2020-10-15T20:05:54
2020-10-15T20:02:53
Swift
UTF-8
Swift
false
false
577
swift
@available(macOS 11.0, *) class MLCInstanceNormalizationLayer : MLCLayer { var featureChannelCount: Int { get } var beta: MLCTensor? { get } var gamma: MLCTensor? { get } var betaParameter: MLCTensorParameter? { get } var gammaParameter: MLCTensorParameter? { get } var varianceEpsilon: Float { get } var momentum: Float { get } convenience init?(featureChannelCount: Int, beta: MLCTensor?, gamma: MLCTensor?, varianceEpsilon: Float) convenience init?(featureChannelCount: Int, beta: MLCTensor?, gamma: MLCTensor?, varianceEpsilon: Float, momentum: Float) }
[ -1 ]
12bd561644c7a60d4cdc15c58eee478f5c4523e4
56727b026896b923222138bbae4e9975ab23d8f4
/Conversion-Calculator-UI-master/Conversion Calculator UI/Conversion Calculator UI/AppDelegate.swift
d882d4aecf55847ba7390a5837ccb0004bfd6c77
[]
no_license
brinary001/iOS-App-Dev-I
c0254a9dfc2f4e28d7423447882bf9ffd8aabd2d
746e69cce81f55dd370acdd7c3e6eff3f5d57933
refs/heads/master
2020-03-28T00:37:22.721546
2018-09-05T00:02:29
2018-09-05T00:02:29
147,433,460
0
0
null
null
null
null
UTF-8
Swift
false
false
2,193
swift
// // AppDelegate.swift // Conversion Calculator UI // // Created by Brian Robinson on 5/6/18. // Copyright © 2018 Brian Robinson. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } func applicationWillResignActive(_ application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. } func applicationDidEnterBackground(_ application: UIApplication) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } func applicationWillEnterForeground(_ application: UIApplication) { // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. } func applicationDidBecomeActive(_ application: UIApplication) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } }
[ 229380, 229383, 229385, 278539, 294924, 229388, 278542, 229391, 327695, 278545, 229394, 278548, 229397, 229399, 229402, 352284, 229405, 278556, 278559, 229408, 278564, 294950, 229415, 229417, 327722, 237613, 229422, 360496, 229426, 237618, 229428, 311349, 286774, 286776, 319544, 286778, 204856, 229432, 352318, 286791, 237640, 286797, 278605, 311375, 163920, 237646, 196692, 319573, 311383, 278623, 278626, 319590, 311400, 278635, 303212, 278639, 131192, 278648, 237693, 303230, 327814, 303241, 131209, 417930, 303244, 311436, 319633, 286873, 286876, 311460, 311469, 32944, 327862, 286906, 327866, 180413, 286910, 131264, 286916, 295110, 286922, 286924, 286926, 319694, 286928, 131281, 278743, 278747, 295133, 155872, 319716, 237807, 303345, 286962, 131314, 229622, 327930, 278781, 278783, 278785, 237826, 319751, 278792, 286987, 319757, 311569, 286999, 319770, 287003, 287006, 287009, 287012, 287014, 287016, 287019, 311598, 287023, 262448, 311601, 295220, 287032, 155966, 319809, 319810, 278849, 319814, 311623, 319818, 311628, 229709, 319822, 287054, 278865, 229717, 196963, 196969, 139638, 213367, 106872, 319872, 311683, 319879, 311693, 65943, 319898, 311719, 278952, 139689, 278957, 311728, 278967, 180668, 311741, 278975, 319938, 278980, 98756, 278983, 319945, 278986, 319947, 278990, 278994, 311767, 279003, 279006, 188895, 172512, 287202, 279010, 279015, 172520, 319978, 279020, 172526, 311791, 279023, 172529, 279027, 319989, 172534, 180727, 164343, 279035, 311804, 287230, 279040, 303617, 287234, 279045, 172550, 303623, 172552, 320007, 287238, 279051, 172558, 279055, 303632, 279058, 303637, 279063, 279067, 172572, 279072, 172577, 295459, 172581, 295461, 279082, 311850, 279084, 172591, 172598, 279095, 172607, 172609, 172612, 377413, 172614, 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, 279178, 287371, 311951, 287377, 172691, 287381, 311957, 221850, 287386, 230045, 172702, 287390, 303773, 172705, 287394, 172707, 303780, 164509, 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, 303985, 303987, 328563, 279413, 303991, 303997, 295806, 295808, 295813, 304005, 320391, 304007, 213895, 304009, 304011, 230284, 304013, 295822, 279438, 189325, 189329, 295825, 304019, 189331, 213902, 58262, 304023, 304027, 279452, 234648, 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, 295949, 197645, 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, 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, 337335, 288185, 279991, 222652, 312766, 173507, 296389, 222665, 230860, 312783, 288208, 230865, 288210, 370130, 288212, 222676, 148946, 288214, 239064, 329177, 288217, 280027, 288220, 288218, 239070, 288224, 280034, 288226, 280036, 288229, 280038, 288230, 288232, 370146, 288234, 320998, 288236, 288238, 288240, 288242, 296435, 288244, 288250, 296446, 321022, 402942, 148990, 296450, 206336, 230916, 230919, 214535, 230923, 304651, 304653, 370187, 402969, 230940, 222752, 108066, 296486, 296488, 157229, 239152, 230961, 157236, 288320, 288325, 124489, 280140, 280145, 288338, 280149, 288344, 280152, 239194, 280158, 403039, 370272, 181854, 239202, 370279, 312938, 280183, 280185, 280188, 280191, 116354, 280194, 280208, 280211, 288408, 280218, 280222, 419489, 190118, 321195, 296622, 321200, 337585, 296626, 296634, 296637, 419522, 313027, 280260, 419525, 206536, 280264, 206539, 206541, 206543, 263888, 313044, 280276, 321239, 280283, 313052, 18140, 288478, 313055, 419555, 321252, 313066, 288494, 280302, 280304, 313073, 321266, 419570, 288499, 288502, 280314, 288510, 124671, 67330, 280324, 198405, 288519, 280331, 198416, 280337, 296723, 116503, 321304, 329498, 296731, 321311, 313121, 313123, 304932, 321316, 280363, 141101, 165678, 280375, 321336, 296767, 288576, 345921, 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, 288909, 141455, 141459, 280725, 313498, 100520, 288936, 280747, 288940, 288947, 280755, 321717, 280759, 280764, 280769, 280771, 280774, 280776, 313548, 321740, 280783, 280786, 280788, 313557, 280793, 280796, 280798, 338147, 280804, 280807, 157930, 280811, 280817, 125171, 157940, 280819, 182517, 280823, 280825, 280827, 280830, 280831, 280833, 125187, 280835, 125191, 125207, 125209, 321817, 125218, 321842, 223539, 125239, 280888, 305464, 280891, 289087, 280897, 280900, 305480, 239944, 280906, 239947, 305485, 305489, 379218, 280919, 248153, 215387, 354653, 354656, 313700, 313705, 280937, 190832, 280946, 223606, 313720, 280956, 239997, 280959, 313731, 199051, 240011, 289166, 240017, 297363, 190868, 240021, 297365, 297368, 297372, 141725, 297377, 289186, 297391, 289201, 240052, 289207, 289210, 305594, 281024, 289218, 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, 338823, 322440, 314249, 240519, 183184, 142226, 289687, 240535, 224151, 297883, 289694, 289696, 289700, 289712, 281529, 289724, 52163, 183260, 420829, 281567, 289762, 322534, 297961, 183277, 281581, 322550, 134142, 322563, 314372, 330764, 175134, 322599, 322610, 314421, 281654, 314427, 314433, 207937, 314441, 207949, 322642, 314456, 281691, 314461, 281702, 281704, 314474, 281708, 281711, 289912, 248995, 306341, 306344, 306347, 322734, 306354, 142531, 199877, 289991, 306377, 289997, 249045, 363742, 363745, 298216, 330988, 126190, 216303, 322801, 388350, 257302, 363802, 199976, 199978, 314671, 298292, 298294, 257334, 216376, 380226, 298306, 224584, 224587, 224594, 216404, 306517, 150870, 314714, 224603, 159068, 314718, 265568, 314723, 281960, 150890, 306539, 314732, 314736, 290161, 216436, 306549, 298358, 314743, 306552, 290171, 314747, 306555, 298365, 290174, 224641, 281987, 298372, 314756, 281990, 224647, 265604, 298377, 314763, 142733, 298381, 314768, 224657, 306581, 314773, 314779, 314785, 314793, 282025, 282027, 241068, 241070, 241072, 282034, 241077, 150966, 298424, 306618, 282044, 323015, 306635, 306640, 290263, 290270, 290275, 339431, 282089, 191985, 282098, 290291, 282101, 241142, 191992, 290298, 151036, 290302, 282111, 290305, 175621, 306694, 192008, 323084, 257550, 282127, 290321, 282130, 323090, 290325, 282133, 241175, 290328, 282137, 290332, 241181, 282142, 282144, 290344, 306731, 290349, 290351, 290356, 28219, 282186, 224849, 282195, 282199, 282201, 306778, 159324, 159330, 314979, 298598, 323176, 224875, 241260, 323181, 257658, 315016, 282249, 290445, 282255, 282261, 175770, 298651, 282269, 323229, 298655, 323231, 61092, 282277, 306856, 196133, 282295, 323260, 282300, 323266, 282310, 323273, 282319, 306897, 241362, 306904, 282328, 298714, 52959, 216801, 282337, 241380, 216806, 323304, 282345, 12011, 282356, 323318, 282364, 282367, 306945, 241412, 323333, 282376, 216842, 323345, 282388, 323349, 282392, 184090, 315167, 315169, 282402, 315174, 323367, 241448, 315176, 241450, 282410, 306988, 306991, 315184, 323376, 315190, 241464, 159545, 282425, 298811, 118593, 307009, 413506, 307012, 241475, 298822, 315211, 282446, 307027, 315221, 323414, 315223, 241496, 241498, 307035, 307040, 110433, 282465, 241509, 110438, 298860, 110445, 282478, 315249, 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, 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, 307338, 233613, 241813, 307352, 299164, 241821, 299167, 315552, 184479, 184481, 315557, 184486, 307370, 307372, 184492, 307374, 307376, 299185, 323763, 184503, 176311, 299191, 307386, 258235, 307388, 307385, 307390, 176316, 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, 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, 127440, 315860, 176597, 283095, 127447, 299481, 127449, 176605, 242143, 127455, 127457, 291299, 340454, 127463, 242152, 291305, 127466, 176620, 127469, 127474, 291314, 291317, 127480, 135672, 291323, 233979, 127485, 291330, 127490, 283142, 127494, 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, 226053, 234246, 226056, 234248, 291593, 242443, 234252, 242445, 234254, 291601, 234258, 242450, 242452, 234261, 348950, 201496, 234264, 234266, 234269, 283421, 234272, 234274, 152355, 299814, 234278, 283432, 234281, 234284, 234287, 283440, 185138, 242483, 234292, 234296, 234298, 160572, 283452, 234302, 234307, 242499, 234309, 316233, 234313, 316235, 234316, 283468, 234319, 242511, 234321, 234324, 185173, 201557, 234329, 234333, 308063, 234336, 242530, 349027, 234338, 234341, 234344, 234347, 177004, 234350, 324464, 234353, 152435, 177011, 234356, 234358, 234362, 226171, 234364, 291711, 234368, 291714, 234370, 291716, 234373, 316294, 201603, 226182, 308105, 234375, 226185, 234379, 324490, 234384, 234388, 234390, 324504, 234393, 209818, 308123, 324508, 234396, 291742, 226200, 234398, 234401, 291747, 291748, 234405, 291750, 234407, 324520, 324518, 324522, 234410, 291756, 291754, 226220, 324527, 291760, 234417, 201650, 324531, 234414, 234422, 226230, 324536, 275384, 234428, 291773, 242623, 324544, 234431, 234434, 324546, 324548, 234437, 226245, 234439, 226239, 234443, 291788, 234446, 275406, 193486, 234449, 316370, 193488, 234452, 234455, 234459, 234461, 234464, 234467, 234470, 168935, 5096, 324585, 234475, 234478, 316400, 234481, 316403, 234484, 234485, 234487, 324599, 234490, 234493, 316416, 234496, 234501, 275462, 308231, 234504, 234507, 234510, 234515, 300054, 316439, 234520, 234519, 234523, 234526, 234528, 300066, 234532, 300069, 234535, 234537, 234540, 144430, 234543, 234546, 275508, 300085, 234549, 300088, 234553, 234556, 234558, 316479, 234561, 316483, 160835, 234563, 308291, 234568, 234570, 316491, 234572, 300108, 234574, 300115, 234580, 234581, 242777, 234585, 275545, 234590, 234593, 234595, 234597, 300133, 234601, 300139, 234605, 160879, 234607, 275569, 234610, 316530, 300148, 234614, 398455, 144506, 234618, 234620, 275579, 234623, 226433, 234627, 275588, 234629, 242822, 234634, 234636, 177293, 234640, 275602, 234643, 308373, 226453, 234647, 275606, 275608, 234650, 308379, 324757, 300189, 324766, 119967, 234653, 324768, 283805, 234657, 242852, 300197, 234661, 283813, 234664, 177318, 275626, 234667, 316596, 308414, 234687, 300223, 300226, 308418, 234692, 300229, 308420, 308422, 283844, 226500, 300234, 283850, 300238, 300241, 316625, 300243, 300245, 316630, 300248, 300253, 300256, 300258, 300260, 234726, 300263, 300265, 300267, 161003, 300270, 300272, 120053, 300278, 275703, 316663, 300284, 275710, 300287, 292097, 300289, 161027, 300292, 300294, 275719, 234760, 177419, 300299, 242957, 300301, 283917, 177424, 349451, 275725, 349464, 415009, 283939, 259367, 292143, 283951, 300344, 226617, 243003, 283963, 226628, 300357, 283973, 177482, 283983, 316758, 357722, 316766, 316768, 292192, 218464, 292197, 316774, 243046, 218473, 284010, 136562, 324978, 275834, 333178, 275836, 275840, 316803, 316806, 226696, 316811, 226699, 316814, 226703, 300433, 234899, 300436, 226709, 357783, 316824, 316826, 144796, 300448, 144807, 144810, 144812, 284076, 144814, 227426, 144820, 374196, 284084, 292279, 284087, 144826, 144828, 144830, 144832, 144835, 144837, 38342, 144839, 144841, 144844, 144847, 144852, 144855, 103899, 300507, 333280, 226787, 218597, 292329, 300523, 259565, 300527, 308720, 259567, 292338, 226802, 316917, 292343, 308727, 300537, 316933, 316947, 308757, 308762, 284191, 316959, 284194, 284196, 235045, 284199, 284204, 284206, 284209, 284211, 194101, 284213, 316983, 194103, 284215, 308790, 284218, 226877, 292414, 284223, 284226, 284228, 292421, 226886, 284231, 128584, 243268, 284234, 366155, 317004, 276043, 284238, 226895, 284241, 194130, 284243, 300628, 284245, 292433, 284247, 317015, 235097, 243290, 276053, 284249, 284251, 300638, 284253, 284255, 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, 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, 292845, 276464, 178161, 227314, 276466, 325624, 350200, 276472, 317435, 276476, 276479, 276482, 350210, 276485, 317446, 178181, 276490, 350218, 292876, 350222, 317456, 276496, 317458, 178195, 243733, 243740, 317468, 317472, 325666, 243751, 292904, 276528, 178224, 243762, 309298, 325685, 325689, 235579, 325692, 235581, 178238, 276539, 276544, 243779, 325700, 284739, 292934, 243785, 276553, 350293, 350295, 309337, 194649, 227418, 350299, 350302, 227423, 350304, 178273, 309346, 194657, 194660, 350308, 309350, 309348, 292968, 309352, 309354, 301163, 350313, 350316, 227430, 301167, 276583, 350321, 276590, 284786, 276595, 350325, 252022, 227440, 350328, 292985, 301178, 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, 227571, 309491, 309494, 243960, 276735, 227583, 227587, 276739, 211204, 276742, 227593, 227596, 325910, 309530, 342298, 211232, 317729, 276775, 211241, 325937, 325943, 211260, 260421, 276809, 285002, 276811, 235853, 276816, 235858, 276829, 276833, 391523, 276836, 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, 334488, 318108, 285340, 318110, 227998, 137889, 383658, 285357, 318128, 277170, 293555, 318132, 342707, 154292, 277173, 285368, 277177, 277181, 318144, 277187, 277191, 277194, 277196, 277201, 342745, 137946, 342747, 342749, 113378, 203491, 228069, 277223, 342760, 285417, 56041, 56043, 56045, 277232, 228081, 56059, 310015, 285441, 310020, 285448, 310029, 228113, 285459, 277273, 293659, 326430, 228128, 285474, 293666, 228135, 318248, 277291, 318253, 293677, 285489, 301876, 293685, 285494, 301880, 285499, 301884, 310080, 293696, 277317, 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, 276579, 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, 245191, 64966, 163272, 277959, 277963, 302541, 277966, 302543, 310737, 277971, 228825, 163290, 277978, 310749, 277981, 277984, 310755, 277989, 277991, 187880, 277995, 310764, 286188, 278000, 228851, 310772, 278003, 278006, 40440, 212472, 278009, 40443, 286203, 310780, 40448, 228864, 286214, 228871, 302603, 65038, 302614, 302617, 286233, 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, 286312, 40554, 286313, 310892, 40557, 40560, 188022, 122488, 294521, 343679, 294537, 310925, 286354, 278163, 302740, 122517, 278168, 179870, 327333, 229030, 212648, 278188, 302764, 278192, 319153, 278196, 302781, 319171, 302789, 294599, 278216, 294601, 302793, 343757, 212690, 319187, 286420, 278227, 229076, 286425, 319194, 278235, 278238, 229086, 286432, 294625, 294634, 302838, 319226, 286460, 278274, 302852, 278277, 302854, 294664, 311048, 352008, 319243, 311053, 302862, 319251, 294682, 278306, 188199, 294701, 319280, 278320, 319290, 229192, 302925, 188247, 280021, 188252, 237409, 229233, 294776, 360317, 294785, 327554, 360322, 40840, 40851, 294803, 188312, 294811, 237470, 319390, 40865, 319394, 294817, 294821, 311209, 180142, 343983, 294831, 188340, 40886, 319419, 294844, 294847, 237508, 393177, 294876, 294879, 294883, 393190, 294890, 311279, 278513, 237555, 311283, 278516, 278519, 237562 ]
344c60678f75e4c2cc7ada1ccebf03d150d69db2
8f90a25495095998b3cd8c322be81a2364e61454
/SPA/StatusTableViewController.swift
ea78b7a7bf929d23becdcc3f3e84f89389a689f1
[]
no_license
robertDurst/SpaOrderingApp
03e34a719ecb0f985e1c9ecd6f94709f4932e410
7da7c95f6d55cbde973a48be54c82b9326c15eaf
refs/heads/master
2021-01-21T13:26:03.453853
2016-05-05T21:13:00
2016-05-05T21:13:00
50,904,035
1
0
null
null
null
null
UTF-8
Swift
false
false
5,324
swift
// // StatusTableViewController.swift // SPA // // Created by Coder on 4/1/16. // Copyright © 2016 OWA. All rights reserved. // import UIKit import SwiftSpinner let manager3 = StatusChecker() var statusesOfOrders = manager3.fetchingFirstPage(currentUser.objectId) class StatusTableViewController: UITableViewController { override func viewDidLoad() { super.viewDidLoad() self.title = "Your Orders" statusesOfOrders = manager3.fetchingFirstPage(currentUser.objectId) //Create the refresh button let btnName = UIButton() btnName.setImage(UIImage(named: "Refresh"), forState: .Normal) btnName.frame = CGRectMake(0, 0, 30, 30) btnName.addTarget(self, action: Selector("refresh:"), forControlEvents: .TouchUpInside) //.... Set Right/Left Bar Button item let rightBarButton = UIBarButtonItem() rightBarButton.customView = btnName self.navigationItem.rightBarButtonItem = rightBarButton // Uncomment the following line to preserve selection between presentations // self.clearsSelectionOnViewWillAppear = false // Uncomment the following line to display an Edit button in the navigation bar for this view controller. // self.navigationItem.rightBarButtonItem = self.editButtonItem() } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } // MARK: - Table view data source override func numberOfSectionsInTableView(tableView: UITableView) -> Int { // #warning Incomplete implementation, return the number of sections return 1 } override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { // #warning Incomplete implementation, return the number of rows return statusesOfOrders.count } override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let cell = self.tableView.dequeueReusableCellWithIdentifier( "StatusTableCell", forIndexPath: indexPath) as! StatusTableViewCell let row = indexPath.row cell.StatusLabel.text = "\(row+1)) \(statusesOfOrders[row][1])" return cell } func refresh(sender:AnyObject) { SwiftSpinner.show("Refreshing") let seconds = 1.0 let delay = seconds * Double(NSEC_PER_SEC) // nanoseconds per seconds let dispatchTime = dispatch_time(DISPATCH_TIME_NOW, Int64(delay)) dispatch_after(dispatchTime, dispatch_get_main_queue(), { SwiftSpinner.hide() }) statusesOfOrders = manager3.fetchingFirstPage(currentUser.objectId) self.tableView.reloadData() } override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { if segue.identifier == "statusToItem" { if let detailViewController = segue.destinationViewController as? StatusItemViewController{ let myIndexPath = self.tableView.indexPathForSelectedRow let row = myIndexPath!.row detailViewController.orderInfo = statusesOfOrders[row] detailViewController.theCurrentOrderPlaceInArray = row } } } /* // Override to support conditional editing of the table view. override func tableView(tableView: UITableView, canEditRowAtIndexPath indexPath: NSIndexPath) -> Bool { // Return false if you do not want the specified item to be editable. return true } */ /* // Override to support editing the table view. override func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) { if editingStyle == .Delete { // Delete the row from the data source tableView.deleteRowsAtIndexPaths([indexPath], withRowAnimation: .Fade) } else if editingStyle == .Insert { // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view } } */ /* // Override to support rearranging the table view. override func tableView(tableView: UITableView, moveRowAtIndexPath fromIndexPath: NSIndexPath, toIndexPath: NSIndexPath) { } */ /* // Override to support conditional rearranging of the table view. override func tableView(tableView: UITableView, canMoveRowAtIndexPath indexPath: NSIndexPath) -> Bool { // Return false if you do not want the item to be re-orderable. return true } */ /* // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { // Get the new view controller using segue.destinationViewController. // Pass the selected object to the new view controller. } */ }
[ -1 ]
1f29905937ba139d2d0b609e22da8928dc2a3220
df1eea785964aa7e61412f2aa4d5134d512205c4
/breakpoint/FirstViewController.swift
542de5351a7833a9b575ee877597f45fa8c2360f
[]
no_license
calimat/breakpoint
b3029c0a643068102cda4b5ed550fe71d353890d
a922e304f692d0e6e45b301988fa96ec23e0c919
refs/heads/master
2021-04-27T22:22:35.514133
2018-02-22T01:58:12
2018-02-22T01:58:12
122,418,128
0
0
null
null
null
null
UTF-8
Swift
false
false
537
swift
// // FirstViewController.swift // breakpoint // // Created by Ricardo Herrera Petit on 2/21/18. // Copyright © 2018 Ricardo Herrera Petit. All rights reserved. // import UIKit class FirstViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } }
[ 279041, 279046, 281107, 300057, 296489, 281142, 300089, 238653, 288321, 286786, 129604, 228932, 228945, 203858, 280146, 212573, 309347, 309349, 309351, 309353, 286314, 296042, 277612, 311913, 164974, 284275, 277108, 284277, 284279, 292478, 284289, 284298, 278675, 349332, 284315, 284317, 282275, 284323, 313007, 284336, 276150, 280760, 296638, 277696, 280770, 280772, 280775, 284361, 230604, 298189, 302286, 230608, 317137, 290004, 284373, 290006, 189655, 302295, 298202, 278749, 280797, 298206, 363743, 290020, 301284, 286436, 277224, 280808, 199402, 280810, 304368, 286963, 289524, 286965, 120054, 226038, 280826, 276736, 280832, 312586, 278298, 329499, 287004, 281373, 281380, 233767, 283433, 278845, 279360, 296272, 281429, 289112, 281432, 188253, 292701, 311645, 227688, 216433, 277364, 207738, 290175, 183173, 233869, 304015, 226196, 284570, 284574, 284577, 289187, 289190, 289191, 305577, 291755, 289196, 370093, 279982, 286126, 297903, 305582, 282548, 293816, 127418, 293308, 278973, 291774, 286158, 280015, 301012, 280030, 279011, 289771, 282095, 293875, 302580, 236022, 288251, 287231 ]
4b05087d695fded871c6d464c30a5619a1194259
8f20766df8b19ab451113e0b9d9af359b5ea90b6
/AeroSpec/ViewController.swift
aaf725f71bc263e43d26f8b5c5fc421650431f08
[]
no_license
zafeingo/aerospec
5bcb6df9963dc7bddf559bb2d3f6cfb188f3b208
baaf63cd5178b237edb1fa6b7e3cae27aa4ed486
refs/heads/master
2020-04-15T12:45:57.217703
2016-10-11T02:33:53
2016-10-11T02:33:53
64,178,069
0
0
null
null
null
null
UTF-8
Swift
false
false
1,488
swift
// // ViewController.swift // AeroSpec // // Created by Zach Feingold on 7/24/16. // Copyright © 2016 nrg. All rights reserved. // import UIKit class ViewController: UIViewController, UITextFieldDelegate { let password = "123456" //MARK: Properties: @IBOutlet weak var LoginButton: UIButton! @IBOutlet weak var passwordTextField: UITextField! override func viewDidLoad() { super.viewDidLoad() self.passwordTextField.delegate = self // Do any additional setup after loading the view, typically from a nib. } func textFieldShouldReturn(passwordTextField: UITextField) -> Bool { passwordTextField.resignFirstResponder() return true; } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } @IBAction func loginButtonClicked(sender: AnyObject) { if (passwordTextField.text == password) { self.performSegueWithIdentifier("LoginButtonPressed", sender: self) } else { let alertController = UIAlertController(title: "Incorrect Password", message: "Please enter the correct password for this account.", preferredStyle: UIAlertControllerStyle.Alert) alertController.addAction(UIAlertAction(title: "Dismiss", style: UIAlertActionStyle.Default,handler: nil)) self.presentViewController(alertController, animated: true, completion: nil) } } }
[ -1 ]
2b9b289cabb8d44967d26201494bd179598ccb4f
36e7a3eb6dd69a39fe3c514459332e0adeb413fa
/Mawjood_mobile/Views/TakeAttendanceView.swift
e931bc6d31ec18432f845866e97948a09fc5ce79
[]
no_license
omsi96/mawjood_mobile
b7b9842ec2028a47bfd0507663b21d12073022ae
7cc70f38fbd684ebf5b22a130d336263f01e7db3
refs/heads/master
2023-06-27T03:19:57.125724
2021-07-24T04:36:37
2021-07-24T04:36:37
388,999,798
0
0
null
null
null
null
UTF-8
Swift
false
false
1,442
swift
// // ContentView.swift // Mawjood_mobile // // Created by Omar Alibrahim on 24/07/2021. // import SwiftUI import Alamofire import SwiftyJSON struct TakeAttendanceView: View { @State var text: String = "" @State var status: String = "" @State var showAlert: Bool = false @EnvironmentObject var env: NetworkEnv var body: some View { VStack{ Text("Type the class secret to get attended") .font(.title2) .bold() TextField("class secret", text: $text) .font(.largeTitle) .padding() .multilineTextAlignment(.center) Button("Submit", action: makeAttendanceRequest) .alert(isPresented: $showAlert, content: { Alert(title: Text("Alert!"), message: Text(status), dismissButton: .cancel()) }) } } func makeAttendanceRequest(){ env.attendSession(sessionSecret: text) { value in self.status = value as? String ?? "SUCCESS!" self.showAlert = true } fail: { self.status = "There is a problem connecting with the server please try again" self.showAlert = true } } } struct TakeAttendanceView_Previews: PreviewProvider { static var previews: some View { TakeAttendanceView() .environmentObject(NetworkEnv()) } }
[ -1 ]
c4f3308e1d0a0baf923c83979da9c2e621e646ee
c4aa9bdf585e60b8e60d7ee89fffdb651789f036
/03/Chap03-01App/Chap03-01AppUITests/Chap03_01AppUITests.swift
346955c98e98dead88aa0e10e27fb6556a8f6dee
[ "MIT" ]
permissive
aokiplayer/study_ios_arch_book
32b1b4d059105e310680bb314c002b296b0c7aef
b5d3932336220df96082afd1e1888297924e45b4
refs/heads/master
2020-07-26T08:12:05.216869
2019-09-17T07:54:56
2019-09-17T07:54:56
208,586,454
0
0
null
null
null
null
UTF-8
Swift
false
false
1,449
swift
// // Chap03_01AppUITests.swift // Chap03-01AppUITests // // Created by Hiroyuki Aoki on 2019/09/15. // Copyright © 2019 MyCompany. All rights reserved. // import XCTest class Chap03_01AppUITests: XCTestCase { override func setUp() { // Put setup code here. This method is called before the invocation of each test method in the class. // In UI tests it is usually best to stop immediately when a failure occurs. continueAfterFailure = false // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. } func testExample() { // UI tests must launch the application that they test. let app = XCUIApplication() app.launch() // Use recording to get started writing UI tests. // Use XCTAssert and related functions to verify your tests produce the correct results. } func testLaunchPerformance() { if #available(macOS 10.15, iOS 13.0, tvOS 13.0, *) { // This measures how long it takes to launch your application. measure(metrics: [XCTOSSignpostMetric.applicationLaunch]) { XCUIApplication().launch() } } } }
[ 333827, 182277, 243720, 354312, 241695, 178215, 315431, 315433, 344106, 325675, 346153, 124974, 243763, 319543, 249912, 352314, 376892, 32829, 325695, 333902, 196687, 176209, 329812, 53334, 368732, 356446, 217194, 249976, 381071, 333968, 323730, 333990, 323761, 125108, 346319, 321744, 385240, 356575, 147679, 334049, 325857, 147680, 317676, 125166, 125170, 356603, 125184, 262403, 125192, 125197, 180494, 125200, 194832, 325904, 125204, 272661, 61720, 334104, 315674, 125215, 125216, 125225, 338217, 325930, 332084, 125236, 368949, 362809, 127292, 332100, 319816, 254285, 383309, 344402, 348499, 348501, 272730, 332128, 391521, 215395, 366948, 242027, 160111, 354672, 139641, 248188, 313726, 240003, 340356, 106893, 39323, 317851, 436644, 254373, 311723, 375211, 334259, 342454, 338359, 336319, 317889, 242138, 256476, 369121, 195044, 360945, 324098, 322057, 334345, 340489, 254487, 322077, 342560, 348709, 348710, 330291, 352831, 369236, 244311, 191065, 436831, 375396, 244326, 176751, 313970, 244345, 344697, 356990, 152196, 344714, 326288, 316050, 346771, 363155, 180886, 352921, 176810, 164532, 342714, 355006, 135888, 242385, 361178, 338658, 369383, 361194, 342775, 359166, 35584, 346889, 264971, 326413, 322320, 207639, 326428, 336678, 318247, 318251, 336693, 355129, 342846, 355136, 222017, 355138, 348999, 355147, 355148, 355153, 244569, 322396, 252766, 275294, 127840, 435038, 355173, 351078, 355174, 342888, 242540, 242542, 201590, 211835, 269179, 340865, 330627, 349066, 316299, 236427, 252812, 189327, 355216, 256920, 400282, 209820, 359332, 359333, 256934, 326571, 140203, 252848, 326580, 326586, 330688, 127945, 211913, 252878, 359380, 340960, 340967, 123880, 343020, 248815, 347122, 201721, 328701, 328705, 418819, 357380, 330759, 320526, 347150, 361487, 384015, 326684, 384031, 336928, 330789, 248871, 345137, 361522, 21567, 257093, 314437, 250955, 361547, 339031, 205911, 156763, 361570, 214116, 253028, 257126, 214119, 250982, 363643, 150656, 248960, 349317, 140426, 337037, 177297, 326803, 347286, 359574, 324761, 339101, 351389, 339106, 253098, 373937, 367798, 339131, 343230, 259275, 148687, 259285, 357594, 339167, 351475, 251124, 320769, 242955, 126229, 245018, 320795, 115997, 130347, 257323, 353581, 116014, 208179, 312628, 345397, 159033, 333115, 216387, 359747, 359748, 337226, 109899, 259408, 331091, 150868, 316764, 314734, 312688, 314740, 314742, 314745, 243073, 388488, 304523, 9618, 112019, 314776, 148900, 333224, 374189, 134586, 380350, 54719, 200136, 339403, 337359, 329168, 329170, 327122, 353751, 310747, 329181, 320997, 3559, 191980, 259569, 251379, 191991, 253431, 210429, 312830, 343552, 366081, 208397, 359949, 329231, 253456, 323088, 349727, 146976, 372261, 245290, 245291, 374327, 210489, 134715, 235069, 425534, 349764, 333389, 128589, 333394, 196184, 99937, 345697, 323171, 415334, 204394, 138862, 206447, 54895, 339579, 337533, 333438, 224907, 345753, 255651, 245413, 317102, 224951, 224952, 370359, 323262, 323265, 333508, 259780, 319176, 241360, 333522, 345813, 241366, 224985, 245471, 325345, 337638, 333543, 181992, 345832, 325357, 141037, 319232, 175874, 360194, 323335, 124691, 169751, 321308, 341791, 339746, 325411, 255781, 241447, 333609, 319289, 241471, 325444, 339782, 325449, 315209, 323405, 337746, 317268, 325460, 345942, 241494, 339799, 341846, 362326, 345950, 370526, 362336, 259937, 362351, 325491, 333687, 350072, 317305, 124795, 339840, 182145, 315265, 325508, 327556, 333700, 243590, 350102, 124826, 329627, 253851, 333727, 354210, 118693, 219046, 253868, 188349, 362442, 346066, 212947, 212953, 354268, 329696, 360416, 190437, 247786, 253930, 313322, 337899, 354283, 124912 ]
4655614be3ec97f567901ed111a2b801a4204476
80228f48151f4ffd62b63c144120cef9991e23a4
/Algorithm/Algorithm/动态规划/_70_爬楼梯.swift
d54271ca970b9f5ba39b3aee9cb1dee5de22cca4
[]
no_license
Duzj/Algorithm
1e3a760e77deeb2899d6aeaecc8aef5eec8eb9b6
700b9250cdbf4be1b963ae084b2d4416292e0837
refs/heads/master
2021-07-16T08:59:38.018267
2021-06-24T02:33:42
2021-06-24T02:33:42
217,503,009
0
0
null
null
null
null
UTF-8
Swift
false
false
915
swift
// // _70_爬楼梯.swift // Algorithm // // Created by duzj on 2020/4/23. // Copyright © 2020 duzj. All rights reserved. // import Foundation /* 假设你正在爬楼梯。需要 n 阶你才能到达楼顶。 每次你可以爬 1 或 2 个台阶。你有多少种不同的方法可以爬到楼顶呢? 注意:给定 n 是一个正整数。 示例 1: 输入: 2 输出: 2 解释: 有两种方法可以爬到楼顶。 1. 1 阶 + 1 阶 2. 2 阶 示例 2: 输入: 3 输出: 3 解释: 有三种方法可以爬到楼顶。 1. 1 阶 + 1 阶 + 1 阶 2. 1 阶 + 2 阶 3. 2 阶 + 1 阶 来源:力扣(LeetCode) 链接:https://leetcode-cn.com/problems/climbing-stairs 著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。 */ class _70_爬楼梯 { func climbStairs(_ n: Int) -> Int { return 0 } }
[ -1 ]
6526042e57bd8c5dadc095b9896e190e65b06e7a
4f3a61cf231fa57cb702113ff867559aa1df4656
/CleanSwifLabTests/Stories/Posts/TestDoubles/Spies/PostsWorkingLogicSpy.swift
d1cedc5081488fca6da79ac758bf31c78d0f95b5
[]
no_license
LibinSergey/CleanSwiftLab
7ee60bf4dbd6dd1e4d83bf4f86a0f92fb240fd2d
be0ff9fbe9bae15f11ef5e4188422fe5ff0a7fae
refs/heads/master
2023-05-29T16:36:23.164228
2021-06-13T19:51:16
2021-06-13T19:51:16
376,627,761
0
0
null
null
null
null
UTF-8
Swift
false
false
512
swift
// // PostsWorkingLogicSpy.swift // CleanSwifLabTests // // Created by Sergey Libin 10/06/2021. // Copyright © 2021 Sergey Libin. All rights reserved. // import Foundation @testable import CleanSwifLab final class PostsWorkingLogicSpy: PostsWorkingLogic { // MARK: - Public Properties private(set) var isCalledFetchPosts = false // MARK: - Public Methods func fetchPosts(userId: Int, _ completion: @escaping ([Post]?) -> Void) { isCalledFetchPosts = true completion(nil) } }
[ -1 ]
65690265a1c87c6be43a32b1aab06241cd5c6fef
8fce4e88651566a686f2e6fed39ddeb0e85c034c
/LearnLanguagesApp/main/indexCollectionViewCell.swift
c47e7d7f892e3e25f3a55d726b4104ecfbe149b8
[]
no_license
IngR10/LearnLanguagesApp
8a204cfee74f6750d45cb86735994eee69fdad22
500c0c9fee7b8ed52ac0e45b0b2fa8fffbae608c
refs/heads/master
2016-09-14T07:57:07.956546
2016-05-11T04:42:27
2016-05-11T04:42:27
58,171,537
0
0
null
null
null
null
UTF-8
Swift
false
false
415
swift
// // indexCollectionViewCell.swift // SapbeFutbol // // Created by Ronald Edgardo Ramirez Diaz on 5/2/16. // Copyright © 2016 FutbolWin. All rights reserved. // import UIKit class indexCollectionViewCell : UICollectionViewCell { @IBOutlet weak var TeacherProfileUIImage: UIImageView! @IBOutlet weak var teacherNameLabel: UILabel! @IBOutlet weak var TeacherInformationLabel: UILabel! }
[ -1 ]
601e71a41b2d6adb309bcc9724e5a93a685aef59
6feea33c5ba73adb69fe0323c1b67d5ac163e2a5
/Sources/App/Migrations/009/CreateBuild.swift
75df2883e437378cfe1ffeae9e36169c8729ce8c
[ "Apache-2.0", "LicenseRef-scancode-generic-cla" ]
permissive
SwiftPackageIndex/SwiftPackageIndex-Server
978136312044014a22e36d59b36638e205f2207d
1910a042d248713dc2009705ff949f2f71039a9a
refs/heads/main
2023-08-31T13:26:25.209473
2023-08-24T18:55:29
2023-08-24T18:55:29
246,033,584
480
30
Apache-2.0
2023-09-13T12:11:06
2020-03-09T12:46:40
Swift
UTF-8
Swift
false
false
1,493
swift
// Copyright Dave Verwer, Sven A. Schmidt, and other contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. import Fluent struct CreateBuild: Migration { func prepare(on database: Database) -> EventLoopFuture<Void> { return database.schema("builds") // managed fields .id() .field("created_at", .datetime) .field("updated_at", .datetime) // reference fields .field("version_id", .uuid, .references("versions", "id", onDelete: .cascade)) // data fields .field("logs", .string) .field("platform", .json) .field("status", .string) .field("swift_version", .json) // constraints .unique(on: "version_id", "platform", "swift_version") .create() } func revert(on database: Database) -> EventLoopFuture<Void> { return database.schema("builds").delete() } }
[ -1 ]
ca30cc7b548a339dbb8a1e2dcb7c80dd520470b5
2cb4705cffb196b205991d866edf561cb6effe1b
/deleteCellPratice/deleteCellPratice/ViewController.swift
500d405667456a8c651062dfd8da5412bed22af5
[]
no_license
DeviantGhost/ToDoList
8547b2685daf490d708707f2b37ce2f55fa5a354
4564261a28f271d2c77dd542b90e13be4bbe379d
refs/heads/main
2023-08-03T07:34:35.891464
2021-09-21T21:09:06
2021-09-21T21:09:06
408,974,189
0
0
null
null
null
null
UTF-8
Swift
false
false
1,259
swift
// // ViewController.swift // deleteCellPratice // // Created by Carlon Rosales on 8/5/21. // import UIKit class ViewController: UITableViewController { var numbers = ["One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten"] override func viewDidLoad() { super.viewDidLoad() tableView.delegate = self tableView.dataSource = self print(numbers.count) } override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { print(numbers.count) return numbers.count } override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "numberCell", for: indexPath) cell.textLabel?.text = numbers[indexPath.row] return cell } override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath) { if editingStyle == UITableViewCell.EditingStyle.delete { numbers.remove(at: indexPath.row) tableView.deleteRows(at: [indexPath], with: UITableView.RowAnimation.automatic) } } }
[ -1 ]
7c68e8564ef82ea46c9ea8807f53530140d74731
aa23900c6b8e333d8654b247ca9c4979bb403b30
/TesteEdeployIOS/EnderecoCelula.swift
8f9d68b9f3c17353c00ffb0ad2ef12997ec139ad
[]
no_license
rodrigosenna/Teste_IOS_Edeploy
e64de62bf1a6d5127768e433ab20e6529f7b8fd9
dcd3e72e8d02cb738dd779ab4abe094ef60b533f
refs/heads/master
2021-01-01T18:10:08.571170
2017-09-14T17:42:34
2017-09-14T17:42:34
98,266,760
0
0
null
null
null
null
UTF-8
Swift
false
false
369
swift
// // EnderecoCelula.swift // TesteEdeployIOS // // Created by Rodrigo Sena de Oliveira on 23/07/17. // Copyright © 2017 RSO Tecnologia LTDA. All rights reserved. // import UIKit // kit padrão para criar interfaces class EnderecoCelula:UITableViewCell{ @IBOutlet weak var cidadeLabel: UILabel! @IBOutlet weak var estadoLabel: UILabel! }
[ -1 ]
47f189c5219e10475414b5e84209200155b33d74
94ff3d75e10be7d3f13abfc6c6e84013daa9ad9d
/RYKit/Sources/UI Component/InformationTipsView/MCInformationTipPreferences.swift
89461299a5dc95ffffdf3503fefc8d4ae13a4a86
[ "MIT" ]
permissive
MarcSteven/RYKit
30b40eae57040a1aa95626ca44e994d86fe8733a
d0b70aaea0c1ff4ba5307a0976283163e6ed8627
refs/heads/main
2023-08-21T14:15:09.443262
2021-09-06T23:30:17
2021-09-06T23:30:17
403,779,912
0
0
null
null
null
null
UTF-8
Swift
false
false
4,525
swift
// // MCInformationTipPreferences.swift // MemoryChainKit // // Created by Marc Zhao on 2019/6/15. // Copyright © 2019 Memory Chain technology(China) co,LTD. All rights reserved. // import Foundation import UIKit /// 信息tip @objc public class MCInformationTipPreferences:NSObject { /// drawing @objc public class Drawing:NSObject { @objc public class Arrow:NSObject { @objc public var tip:CGPoint = .zero @objc public var size:CGSize = CGSize(width:20,height:10) @objc public var tipCornerRadius:CGFloat = 5 } /// 气泡 @objc public class Bubble:NSObject { @objc public class Border:NSObject { @objc public var color:UIColor? = nil @objc public var width:CGFloat = 1 } @objc public var inset:CGFloat = 15 @objc public var spacing:CGFloat = 5 @objc public var cornerRadius:CGFloat = 5 @objc public var maxWidth:CGFloat = 210 @objc public var color:UIColor = UIColor.clear { didSet { gradientColors = [color] gradientLocations = [] } } @objc public var gradientColors:[UIColor] = [UIColor(red: 0.761, green: 0.914, blue: 0.984, alpha: 1.0),UIColor(red: 0.631, green: 0.769, blue: 0.992, alpha: 1.00)] @objc public var gradientLocations:[CGFloat] = [0.05,1.0] @objc public var border:Border = Border() } /// title @objc public class Title:NSObject { @objc public var font:UIFont = UIFont.systemFont(ofSize: 12, weight: .bold) @objc public var color:UIColor = .white } /// message @objc public class Message:NSObject { @objc public var font :UIFont = UIFont.systemFont(ofSize: 12, weight: .regular) @objc public var color:UIColor = .white } /// button @objc public class Button:NSObject { @objc public var font:UIFont = UIFont.systemFont(ofSize: 12, weight: .regular) @objc public var color:UIColor = .white } /// background @objc public class Background:NSObject { @objc public var color:UIColor = UIColor.clear { didSet { gradientColor = [.clear,color] } } //MARK: - TODO @objc public var gradientColor:[UIColor] = [.clear,UIColor.black.withAlphaComponent(0.4)] @objc public var gradientLocation:[CGFloat] = [0.05,1.0] } /// 箭头 @objc public var arrow:Arrow = Arrow() /// 气泡 @objc public var bubble:Bubble = Bubble() /// 标题 @objc public var title:Title = Title() /// 消息 @objc public var message:Message = Message() /// 按键 @objc public var button:Button = Button() /// 背景 @objc public var background:Background = Background() } /// 动画 @objc public class MCAnimating:NSObject { /// 消失传输 @objc public var dismissTransfor:CGAffineTransform = CGAffineTransform(scaleX: 0.1, y: 0.1) /// 呈现初始化变换 @objc public var displayInitialTransform:CGAffineTransform = CGAffineTransform(scaleX: 0, y: 0) /// 呈现最后的变换 @objc public var displayFinalTransform:CGAffineTransform = .identity /// spring 减弱间隔 @objc public var springDamping:CGFloat = 0.7 /// spring加速度 @objc public var springVelocity:CGFloat = 0.7 /// 呈现初始化透明 @objc public var displayInitialAlpha:CGFloat = 0 /// 隐藏最后的透明 @objc public var hideFinalAlpha:CGFloat = 0 /// 呈现的间隔 @objc public var durationOfDisplaying:TimeInterval = 0.7 /// 消失的时间间隔 @objc public var durationOfDismissing:TimeInterval = 0.7 } /// 绘画 @objc public var drawing:Drawing = Drawing() /// 动画 @objc public var animating:MCAnimating = MCAnimating() @objc public override init() { } }
[ -1 ]
7431a4db514e691f61b666a492260a6e619ef1e7
f5368ff2c61b9c50dc8d3fe5a5848a6124fa8b82
/Tap Or Hold Counter/Tap Or Hold CounterTests/Tap_Or_Hold_CounterTests.swift
1ae72f275f6433680dd62acb80720ce2a12f8cc4
[]
no_license
zmusmonov/100-Days-of-Swift
0e5b2e836b3dcc65c9f2cbcc8c8feeb080461f44
1a1201a00edf0c5f0c041f1a3024edacc873b0f7
refs/heads/master
2021-07-09T12:41:28.936865
2020-10-26T17:41:08
2020-10-26T17:41:08
209,771,205
0
0
null
null
null
null
UTF-8
Swift
false
false
970
swift
// // Tap_Or_Hold_CounterTests.swift // Tap Or Hold CounterTests // // Created by ZiyoMukhammad Usmonov on 9/20/19. // Copyright © 2019 ZiyoMukhammad Usmonov. All rights reserved. // import XCTest @testable import Tap_Or_Hold_Counter class Tap_Or_Hold_CounterTests: 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. } } }
[ 333828, 43014, 358410, 354316, 313357, 360462, 399373, 317467, 145435, 229413, 204840, 315432, 315434, 325674, 344107, 102445, 155694, 176175, 233517, 346162, 241716, 129076, 229430, 243767, 163896, 180280, 358456, 288828, 436285, 325694, 376894, 288833, 288834, 436292, 403525, 352326, 225351, 315465, 254027, 313041, 163917, 436301, 338001, 196691, 338003, 280661, 329814, 307289, 385116, 237663, 254048, 315487, 356447, 280675, 329829, 280677, 43110, 319591, 315497, 315498, 436329, 194666, 221290, 321637, 260207, 432240, 438377, 204916, 233589, 266357, 131191, 215164, 215166, 422019, 333955, 280712, 415881, 104587, 235662, 241808, 381073, 325776, 196760, 284826, 426138, 346271, 436383, 362659, 299174, 333991, 239793, 377009, 405687, 182456, 295098, 258239, 379071, 389313, 299203, 149703, 299209, 346314, 372941, 266449, 321745, 139479, 334042, 229597, 194782, 301279, 311519, 317664, 280802, 379106, 387296, 338150, 304524, 346346, 205035, 307435, 321772, 438511, 381172, 436470, 327929, 243962, 344313, 184575, 149760, 375039, 411906, 147717, 384720, 368905, 325905, 254226, 272658, 368916, 338197, 262421, 325912, 381208, 377114, 315673, 151839, 237856, 237857, 233762, 211235, 217380, 432421, 211238, 151847, 338218, 325931, 311597, 358703, 321840, 98610, 332083, 379186, 332085, 358709, 180535, 336183, 332089, 321860, 332101, 438596, 323913, 348492, 319821, 323920, 344401, 366930, 377169, 348500, 368981, 155990, 289110, 368984, 168281, 215385, 332123, 332127, 354655, 98657, 383332, 242023, 383336, 270701, 160110, 246127, 242029, 242033, 270706, 354676, 139640, 246137, 291192, 246136, 317820, 211326, 436608, 362881, 248194, 436611, 240002, 340357, 311685, 332167, 225670, 385417, 317831, 311691, 106888, 242058, 373134, 385422, 108944, 252308, 190871, 213403, 149916, 121245, 242078, 420253, 141728, 315810, 315811, 381347, 289189, 246178, 108972, 272813, 340398, 385454, 377264, 311727, 342450, 338356, 436661, 334260, 293303, 311738, 33211, 293310, 336320, 311745, 127427, 416197, 254406, 188871, 324039, 129483, 342476, 373197, 317901, 289232, 328152, 256477, 287198, 160225, 342498, 358882, 242148, 334309, 391655, 432618, 375276, 319981, 291311, 254456, 377338, 377343, 174593, 254465, 291333, 342536, 340490, 139792, 420369, 303636, 258581, 393751, 416286, 322078, 377376, 207393, 375333, 377386, 244269, 197167, 375343, 385588, 289332, 234036, 375351, 174648, 338489, 338490, 244281, 315960, 242237, 348732, 70209, 115270, 70215, 293448, 55881, 301638, 309830, 348742, 348749, 381517, 385615, 426576, 322120, 369235, 416341, 297560, 332378, 201308, 416351, 139872, 242273, 436832, 436834, 268899, 242277, 244327, 111208, 39530, 184940, 373358, 420463, 346737, 389745, 313971, 139892, 346740, 420471, 287352, 344696, 209530, 244347, 373375, 152195, 311941, 336518, 348806, 311945, 369289, 330379, 344715, 184973, 311949, 287374, 326287, 316049, 375440, 311954, 334481, 117396, 111253, 316053, 346772, 230040, 264856, 111258, 111259, 271000, 332446, 289434, 303771, 205471, 318106, 318107, 139939, 344738, 176808, 205487, 303793, 318130, 299699, 293556, 336564, 383667, 164533, 314040, 287417, 109241, 39614, 287422, 377539, 422596, 248517, 422599, 291530, 225995, 363211, 333521, 164560, 242386, 385747, 361176, 418520, 422617, 287452, 363230, 264928, 422626, 375526, 234217, 330474, 342763, 342762, 293612, 289518, 299759, 369385, 377489, 129773, 322291, 312052, 312053, 154359, 172792, 344827, 221948, 432893, 205568, 162561, 291585, 295682, 430849, 191235, 291592, 264968, 197386, 383754, 62220, 117517, 434957, 312079, 322319, 422673, 377497, 430865, 166676, 291604, 310036, 197399, 207640, 422680, 426774, 426775, 326429, 293664, 377500, 326433, 197411, 400166, 289576, 293672, 318250, 295724, 353069, 152365, 197422, 353070, 164656, 295729, 422703, 191283, 422709, 152374, 197431, 273207, 375609, 328499, 160571, 289598, 160575, 336702, 430910, 160580, 252741, 353095, 381773, 201551, 293711, 353109, 377686, 244568, 230234, 189275, 244570, 435039, 295776, 242529, 349026, 357218, 303972, 351077, 385893, 342887, 275303, 308076, 242541, 330609, 246641, 246643, 207732, 295798, 361337, 269178, 177019, 185211, 308092, 398206, 400252, 291712, 158593, 254850, 359298, 260996, 359299, 240518, 113542, 369538, 381829, 316298, 392074, 58253, 295824, 224145, 349072, 355217, 326553, 256922, 289690, 318364, 390045, 240544, 310176, 185250, 310178, 420773, 185254, 289703, 293800, 140204, 236461, 363438, 347055, 377772, 316333, 304051, 326581, 373687, 316343, 326587, 230332, 377790, 289727, 353216, 330689, 273344, 353215, 363458, 379844, 213957, 19399, 326601, 345033, 373706, 316364, 359381, 386006, 418776, 433115, 248796, 343005, 50143, 347103, 340961, 123881, 412651, 326635, 320494, 187374, 383983, 347123, 240630, 271350, 201720, 127992, 295927, 320507, 349175, 328700, 318461, 293886, 257024, 328706, 330754, 320516, 293893, 295942, 357379, 386056, 410627, 353290, 330763, 377869, 433165, 384016, 238610, 308243, 418837, 140310, 433174, 252958, 369701, 357414, 248872, 238639, 300084, 312373, 203830, 359478, 238651, 308287, 21569, 377926, 214086, 218186, 314448, 341073, 339030, 439384, 156764, 304222, 392290, 253029, 257125, 300135, 316520, 273515, 316526, 173166, 357486, 144496, 351344, 404593, 377972, 353397, 285814, 291959, 300150, 337017, 300151, 363641, 160891, 363644, 300158, 377983, 392318, 150657, 248961, 384131, 349316, 402565, 349318, 330888, 302216, 386189, 373903, 169104, 177296, 326804, 363669, 238743, 324760, 119962, 300187, 300188, 339100, 351390, 199839, 380061, 429214, 265379, 300201, 249002, 253099, 253100, 238765, 3246, 318639, 300202, 306346, 238769, 402613, 337077, 367799, 421048, 373945, 339130, 113850, 294074, 322749, 302274, 367810, 259268, 265412, 353479, 353482, 402634, 283852, 259280, 290000, 333011, 316627, 189653, 419029, 148696, 296153, 304351, 195808, 298208, 310497, 298212, 298213, 222440, 330984, 328940, 298221, 353523, 298228, 302325, 234742, 386294, 128251, 386301, 261377, 320770, 386306, 437505, 322824, 439562, 292107, 328971, 414990, 353551, 251153, 177428, 349462, 257305, 245019, 320796, 222494, 253216, 339234, 333090, 208164, 372009, 412971, 353584, 261425, 351537, 382258, 345396, 171317, 318775, 300343, 386359, 345402, 378172, 286013, 306494, 382269, 216386, 312648, 337225, 304456, 230729, 146762, 224586, 177484, 294218, 259406, 234831, 238927, 294219, 331090, 353616, 406861, 318805, 314710, 372054, 425304, 159066, 374109, 314720, 378209, 314726, 163175, 333160, 314728, 386412, 380271, 243056, 327024, 312689, 316787, 116084, 249204, 249205, 296307, 208244, 314739, 327031, 290173, 306559, 318848, 314751, 337281, 148867, 357762, 253317, 298374, 314758, 314760, 142729, 296329, 368011, 384393, 388487, 314766, 296335, 318864, 112017, 234898, 9619, 259475, 275859, 318868, 370071, 112018, 357786, 290207, 314783, 251298, 333220, 310692, 314789, 314791, 396711, 245161, 396712, 316842, 314798, 374191, 286129, 380337, 173491, 286132, 150965, 304564, 353719, 380338, 228795, 425405, 302531, 380357, 339398, 361927, 300489, 425418, 306639, 413137, 23092, 210390, 210391, 210393, 310748, 286172, 144867, 271843, 429542, 245223, 54765, 191981, 296433, 251378, 308723, 333300, 191990, 333303, 300536, 286202, 359930, 302590, 372227, 323080, 329225, 253451, 296461, 359950, 323087, 259599, 323089, 304656, 329232, 146964, 308756, 370197, 175639, 374296, 253463, 388632, 374299, 308764, 396827, 134686, 333343, 431649, 286244, 245287, 402985, 394794, 245292, 169518, 347694, 431663, 312880, 288309, 312889, 194110, 349763, 196164, 265798, 288327, 218696, 292425, 128587, 265804, 333388, 333393, 396882, 128599, 179801, 44635, 239198, 343647, 333408, 396895, 99938, 300644, 323172, 310889, 415338, 243307, 312940, 204397, 54893, 325231, 138863, 188016, 222832, 224883, 314998, 247416, 323196, 325245, 337534, 337535, 339584, 263809, 294529, 194180, 323207, 288392, 229001, 415375, 188048, 239250, 322316, 419478, 425626, 302754, 153251, 298661, 40614, 206504, 300714, 210603, 61101, 321199, 224946, 337591, 384695, 321207, 319162, 110268, 415420, 327358, 224958, 333503, 323264, 274115, 321219, 333509, 259781, 306890, 403148, 212685, 333517, 333520, 9936, 9937, 333523, 241361, 241365, 302802, 342682, 272085, 345814, 370388, 345821, 321247, 298720, 321249, 325346, 153319, 325352, 345833, 345834, 212716, 212717, 360177, 67315, 173814, 325371, 288512, 319233, 339715, 288516, 360195, 339720, 243472, 372496, 323346, 321302, 345879, 366360, 398869, 325404, 286494, 321310, 255776, 241441, 339745, 326414, 241442, 257830, 247590, 421672, 362283, 378668, 399147, 431916, 300848, 409394, 296755, 259899, 319292, 360252, 325439, 345919, 436031, 315202, 403267, 153415, 360264, 345929, 341836, 415567, 325457, 317269, 18262, 216918, 241495, 341847, 362327, 346779, 350044, 128862, 245599, 345951, 362337, 376669, 345955, 425825, 307039, 296806, 292712, 425833, 423789, 214895, 313199, 362352, 325492, 276341, 417654, 341879, 241528, 317304, 333688, 112509, 325503, 55167, 339841, 182144, 305026, 188292, 333701, 243591, 315273, 315274, 317323, 325518, 372626, 380821, 329622, 294807, 337815, 333722, 376732, 118685, 298909, 311199, 319392, 350109, 292771, 436131, 333735, 294823, 415655, 436137, 327596, 362417, 323507, 243637, 290745, 294843, 188348, 362431, 237504, 294850, 274371, 384964, 214984, 151497, 362443, 344013, 212942, 301008, 153554, 24532, 372701, 329695, 436191, 292836, 292837, 298980, 313319, 317415, 380908, 436205, 329712, 311281, 311282, 325619, 432116, 333817, 292858, 313339, 415741, 352917 ]
78b8c9c3fdadb0e883890e9485abbece5a730c28
4b6612caacbeaf84d686c8a9b058db581fd82701
/dev_swift/FastaiNotebooks/Sources/FastaiNotebooks/02_fully_connected.swift
111de6bcf82c7c5ee74578acb220ed754f925f7b
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
permissive
test-v1/fastai_docs
ca491ebd3ded796addd51c1e684cc3b162bf799c
5b26a49bbfe05381918864abdff8ce9516b764d4
refs/heads/master
2020-05-05T06:35:46.806094
2019-04-06T02:05:16
2019-04-06T02:05:16
null
0
0
null
null
null
null
UTF-8
Swift
false
false
699
swift
/* THIS FILE WAS AUTOGENERATED! DO NOT EDIT! file to edit: 02_fully_connected.ipynb */ import Path import TensorFlow public func normalize(_ x:Tensor<Float>, mean:Tensor<Float>, std:Tensor<Float>) -> Tensor<Float> { return (x-mean)/std } public extension Tensor where Scalar:FloatingPoint { func std() -> Tensor<Scalar> { return sqrt(self.variance(alongAxes: Array(self.shape.indices)).flattened()[0]) } } public func testNearZero(_ a:Tensor<Float>, tolerance:Float=1e-3) { assert(Raw.abs(a)<tolerance, "Near zero: \(a)") } func mse(_ out:Tensor<Float>, _ targ:Tensor<Float>) -> Tensor<Float> { return (out.squeezingShape(at: -1) - targ).squared().mean() }
[ -1 ]
2ca35f5fa47dfad247e65f0ff316ec221dbd4372
9314636ac738b836457d3f6877fd30c4f9522ee8
/TelepresencePoker/TPMainViewController.swift
7c12038ce6e732e10cbbd3a91f622c7a49edc2a1
[]
no_license
bschmuck/telepresencepoker
88ac2816fec8cde07bf6973dc119b0c6e59311d0
1d2eac8f9513393870691821f705a8f72a1ea193
refs/heads/master
2021-05-11T16:34:02.467290
2018-01-19T05:07:15
2018-01-19T05:07:15
117,768,483
0
0
null
null
null
null
UTF-8
Swift
false
false
17,757
swift
// // TPMainViewController.swift // TelepresencePoker // // Created by Brandon Schmuck on 1/16/18. // Copyright © 2018 Brandon Schmuck. All rights reserved. // import UIKit import TwilioVideo class TPMainViewController: UIViewController { struct PlatformUtils { static let isSimulator: Bool = { var isSim = false #if arch(i386) || arch(x86_64) isSim = true #endif return isSim }() } // Client Identity is "player_iphone" var player_iphone_accessToken: String = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiIsImN0eSI6InR3aWxpby1mcGE7dj0xIn0.eyJqdGkiOiJTS2RlZTM4YmU3MGVhOTllMTA5MzE1MzRkODdkZTRlNmNlLTE1MTYzMzY5MTkiLCJpc3MiOiJTS2RlZTM4YmU3MGVhOTllMTA5MzE1MzRkODdkZTRlNmNlIiwic3ViIjoiQUNjMWYzNWQzNzQzYzA5MjIwMWM5ZTUyN2MyMTM3Y2QxNSIsImV4cCI6MTUxNjM0MDUxOSwiZ3JhbnRzIjp7ImlkZW50aXR5IjoicGxheWVyX2lwaG9uZSIsInZpZGVvIjp7fX19.znKR8d9DXzll6J-h12U97QadHYYGHOlrsHxS9ubYuBo" var board_ipad_accessToken: String = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiIsImN0eSI6InR3aWxpby1mcGE7dj0xIn0.eyJqdGkiOiJTS2RlZTM4YmU3MGVhOTllMTA5MzE1MzRkODdkZTRlNmNlLTE1MTYzMzY5MzYiLCJpc3MiOiJTS2RlZTM4YmU3MGVhOTllMTA5MzE1MzRkODdkZTRlNmNlIiwic3ViIjoiQUNjMWYzNWQzNzQzYzA5MjIwMWM5ZTUyN2MyMTM3Y2QxNSIsImV4cCI6MTUxNjM0MDUzNiwiZ3JhbnRzIjp7ImlkZW50aXR5IjoiYm9hcmRfaXBhZCIsInZpZGVvIjp7fX19.TvQelxpI5ywa_k2UDieWJRr7BhLOi3hizOmAVXGBYVU" // Video SDK components var room: TVIRoom? var camera: TVICameraCapturer? var localVideoTrack: TVILocalVideoTrack? var localAudioTrack: TVILocalAudioTrack? var participant: TVIParticipant? var remoteView: TVIVideoView? // UI Element Outlets and handles @IBOutlet weak var previewView: TVIVideoView! @IBOutlet weak var betButton: UIButton! @IBOutlet weak var raiseButton: UIButton! @IBOutlet weak var foldButton: UIButton! @IBOutlet weak var decButton: UIButton! @IBOutlet weak var addButton: UIButton! @IBOutlet weak var cancelButton: UIButton! @IBOutlet weak var raiseView: UIView! @IBOutlet weak var raiseLabel: UILabel! @IBOutlet weak var handView: UIView! @IBOutlet weak var potLabel: UILabel! @IBOutlet weak var chipsLabel: UILabel! @IBOutlet weak var handCard1: UIImageView! @IBOutlet weak var handCard2: UIImageView! @IBOutlet weak var handCard3: UIImageView! @IBOutlet weak var handCard4: UIImageView! @IBOutlet weak var handCard5: UIImageView! @IBOutlet weak var tableCard1: UIImageView! @IBOutlet weak var tableCard2: UIImageView! @IBOutlet weak var tableCard3: UIImageView! @IBOutlet weak var tableCard4: UIImageView! @IBOutlet weak var tableCard5: UIImageView! @IBOutlet weak var rotateSlider: UISlider! @IBOutlet weak var headerView: UIView! let stateManager = TPGameState() var raiseVal = 15 override func viewDidLoad() { super.viewDidLoad() if PlatformUtils.isSimulator { // Do nothing } else { self.startPreview() } raiseButton.layer.cornerRadius = 15 betButton.layer.cornerRadius = 15 foldButton.layer.cornerRadius = 15 raiseView.layer.cornerRadius = 15 raiseView.isHidden = true decButton.addTarget(self, action: #selector(decRaise), for: .touchUpInside) addButton.addTarget(self, action: #selector(incRaise), for: .touchUpInside) cancelButton.addTarget(self, action: #selector(hideRaiseView), for: .touchUpInside) raiseButton.addTarget(self, action: #selector(showRaiseView), for: .touchUpInside) handView.layer.cornerRadius = 15 NotificationCenter.default.addObserver(self, selector: #selector(updateGameState), name: NSNotification.Name(rawValue: "GameStateDidUpdate"), object: nil) stateManager.getGameState() } func startPreview() { if PlatformUtils.isSimulator { return } // Preview our local camera track in the local video preview view. camera = TVICameraCapturer(source: .frontCamera, delegate: self) localVideoTrack = TVILocalVideoTrack.init(capturer: camera!) if (localVideoTrack == nil) { print("Failed to create video track") } else { // Add renderer to video track for local preview localVideoTrack!.addRenderer(self.previewView) print("Video track created") // We will flip camera on tap. //let tap = UITapGestureRecognizer(target: self, action: #selector(ViewController.flipCamera)) //self.previewView.addGestureRecognizer(tap) } } func setupRemoteVideoView() { // Creating `TVIVideoView` programmatically self.remoteView = TVIVideoView.init(frame: CGRect.zero, delegate:self) self.view.insertSubview(self.remoteView!, at: 0) // `TVIVideoView` supports scaleToFill, scaleAspectFill and scaleAspectFit // scaleAspectFit is the default mode when you create `TVIVideoView` programmatically. self.remoteView!.contentMode = .scaleAspectFit; let centerX = NSLayoutConstraint(item: self.remoteView!, attribute: NSLayoutAttribute.centerX, relatedBy: NSLayoutRelation.equal, toItem: self.view, attribute: NSLayoutAttribute.centerX, multiplier: 1, constant: 0); self.view.addConstraint(centerX) let centerY = NSLayoutConstraint(item: self.remoteView!, attribute: NSLayoutAttribute.centerY, relatedBy: NSLayoutRelation.equal, toItem: self.view, attribute: NSLayoutAttribute.centerY, multiplier: 1, constant: 0); self.view.addConstraint(centerY) let width = NSLayoutConstraint(item: self.remoteView!, attribute: NSLayoutAttribute.width, relatedBy: NSLayoutRelation.equal, toItem: self.view, attribute: NSLayoutAttribute.width, multiplier: 1, constant: 0); self.view.addConstraint(width) let height = NSLayoutConstraint(item: self.remoteView!, attribute: NSLayoutAttribute.height, relatedBy: NSLayoutRelation.equal, toItem: self.view, attribute: NSLayoutAttribute.height, multiplier: 1, constant: 0); self.view.addConstraint(height) } func connectChat(accessToken: String) { self.prepareLocalMedia() // Preparing the connect options with the access token that we fetched (or hardcoded). let connectOptions = TVIConnectOptions.init(token: accessToken) { (builder) in // Use the local media that we prepared earlier. builder.audioTracks = self.localAudioTrack != nil ? [self.localAudioTrack!] : [TVILocalAudioTrack]() builder.videoTracks = self.localVideoTrack != nil ? [self.localVideoTrack!] : [TVILocalVideoTrack]() // The name of the Room where the Client will attempt to connect to. Please note that if you pass an empty // Room `name`, the Client will create one for you. You can get the name or sid from any connected Room. builder.roomName = "TEST_ROOM"//self.roomTextField.text } // Connect to the Room using the options we provided. room = TwilioVideo.connect(with: connectOptions, delegate: self) print("Attempting to connect to room \(String(describing: "TEST_ROOM"))") } @IBAction func pressedStartChat(_ sender: Any) { connectChat(accessToken: board_ipad_accessToken) betButton.isHidden = true raiseButton.isHidden = true foldButton.isHidden = true handView.isHidden = true rotateSlider.isHidden = true headerView.isHidden = true raiseLabel.isHidden = true } @IBAction func pressedStartRemote(_ sender: Any) { connectChat(accessToken: player_iphone_accessToken) } @IBAction func stoppedSlidingSlider(_ sender: Any) { print("Ended sliding here") } func prepareLocalMedia() { // We will share local audio and video when we connect to the Room. // Create an audio track. if (localAudioTrack == nil) { localAudioTrack = TVILocalAudioTrack.init() if (localAudioTrack == nil) { print("Failed to create audio track") } } // Create a video track which captures from the camera. if (localVideoTrack == nil) { self.startPreview() } } @objc func updateGameState(notification: Notification) { DispatchQueue.main.async { self.chipsLabel.text = "$\(self.stateManager.chips)" self.potLabel.text = "$\(self.stateManager.pot)" self.betButton.setTitle("Bet $\(self.stateManager.bet)", for: .normal) if self.raiseVal < self.stateManager.bet { self.raiseVal = self.stateManager.bet self.raiseLabel.text = "$\(self.raiseVal)" } let hand = self.stateManager.hand if hand.count > 0 { let imageName = "\(hand[0]["suit"]!)_\(hand[0]["rank"]!)" self.handCard1.image = UIImage(named: "\(imageName)") self.handCard1.isHidden = false } else { self.handCard1.isHidden = true } if hand.count > 1 { self.handCard2.image = UIImage(named: "\(hand[1]["suit"]!)_\(hand[1]["rank"]!)") self.handCard2.isHidden = false } else { self.handCard2.isHidden = true } if hand.count > 2 { self.handCard3.image = UIImage(named: "\(hand[2]["suit"]!)_\(hand[2]["rank"]!)") self.handCard3.isHidden = false } else { self.handCard3.isHidden = true } if hand.count > 3 { self.handCard4.image = UIImage(named: "\(hand[3]["suit"]!)_\(hand[3]["rank"]!)") self.handCard4.isHidden = false } else { self.handCard4.isHidden = true } if hand.count > 4 { self.handCard5.image = UIImage(named: "\(hand[4]["suit"]!)_\(hand[4]["rank"]!)") self.handCard5.isHidden = false } else { self.handCard5.isHidden = true } let table = self.stateManager.table if table.count > 0 { self.tableCard1.image = UIImage(named: "\(table[0]["suit"]!)_\(table[0]["rank"]!)") self.tableCard1.isHidden = false } else { self.tableCard1.isHidden = true } if table.count > 1 { self.tableCard2.image = UIImage(named: "\(table[1]["suit"]!)_\(table[1]["rank"]!)") self.tableCard2.isHidden = false } else { self.tableCard2.isHidden = true } if table.count > 2 { self.tableCard3.image = UIImage(named: "\(table[2]["suit"]!)_\(table[2]["rank"]!)") self.tableCard3.isHidden = false } else { self.tableCard3.isHidden = true } if table.count > 3 { self.tableCard4.image = UIImage(named: "\(table[3]["suit"]!)_\(table[3]["rank"]!)") self.tableCard4.isHidden = false } else { self.tableCard4.isHidden = true } if table.count > 4 { self.tableCard5.image = UIImage(named: "\(table[4]["suit"]!)_\(table[4]["rank"]!)") self.tableCard5.isHidden = false } else { self.tableCard5.isHidden = true } } } @objc func showRaiseView() { UIView.animate(withDuration: 0.2) { self.raiseView.isHidden = false } } @objc func hideRaiseView() { UIView.animate(withDuration: 0.2) { self.raiseView.isHidden = true } } @objc func incRaise() { raiseVal += 10 DispatchQueue.main.async { self.raiseLabel.text = "$\(self.raiseVal)" } } @objc func decRaise() { if raiseVal >= self.stateManager.bet + 10 { raiseVal -= 10 } DispatchQueue.main.async { self.raiseLabel.text = "$\(self.raiseVal)" } } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } } // MARK: TVIRoomDelegate extension TPMainViewController : TVIRoomDelegate { func didConnect(to room: TVIRoom) { // At the moment, this example only supports rendering one Participant at a time. print("Connected to room \(room.name) as \(String(describing: room.localParticipant?.identity))") if (room.participants.count > 0) { self.participant = room.participants[0] self.participant?.delegate = self } } func room(_ room: TVIRoom, didDisconnectWithError error: Error?) { print("Disconncted from room \(room.name), error = \(String(describing: error))") // self.cleanupRemoteParticipant() self.room = nil // self.showRoomUI(inRoom: false) } func room(_ room: TVIRoom, didFailToConnectWithError error: Error) { print("Failed to connect to room with error") self.room = nil print(error.localizedDescription) // self.showRoomUI(inRoom: false) } func room(_ room: TVIRoom, participantDidConnect participant: TVIParticipant) { if (self.participant == nil) { self.participant = participant self.participant?.delegate = self } print("Room \(room.name), Participant \(participant.identity) connected") } func room(_ room: TVIRoom, participantDidDisconnect participant: TVIParticipant) { if (self.participant == participant) { // cleanupRemoteParticipant() } print("Room \(room.name), Participant \(participant.identity) disconnected") } } // MARK: TVIParticipantDelegate extension TPMainViewController : TVIParticipantDelegate { func participant(_ participant: TVIParticipant, addedVideoTrack videoTrack: TVIVideoTrack) { print("Participant \(participant.identity) added video track") if (self.participant == participant) { setupRemoteVideoView() videoTrack.addRenderer(self.remoteView!) } } func participant(_ participant: TVIParticipant, removedVideoTrack videoTrack: TVIVideoTrack) { print("Participant \(participant.identity) removed video track") if (self.participant == participant) { videoTrack.removeRenderer(self.remoteView!) self.remoteView?.removeFromSuperview() self.remoteView = nil } } func participant(_ participant: TVIParticipant, addedAudioTrack audioTrack: TVIAudioTrack) { print("Participant \(participant.identity) added audio track") } func participant(_ participant: TVIParticipant, removedAudioTrack audioTrack: TVIAudioTrack) { print("Participant \(participant.identity) removed audio track") } func participant(_ participant: TVIParticipant, enabledTrack track: TVITrack) { var type = "" if (track is TVIVideoTrack) { type = "video" } else { type = "audio" } print("Participant \(participant.identity) enabled \(type) track") } func participant(_ participant: TVIParticipant, disabledTrack track: TVITrack) { var type = "" if (track is TVIVideoTrack) { type = "video" } else { type = "audio" } print("Participant \(participant.identity) disabled \(type) track") } } extension TPMainViewController : TVIVideoViewDelegate { func videoView(_ view: TVIVideoView, videoDimensionsDidChange dimensions: CMVideoDimensions) { self.view.setNeedsLayout() print("CHANGED DIMENSIONS") } } // MARK: TVICameraCapturerDelegate extension TPMainViewController : TVICameraCapturerDelegate { func cameraCapturer(_ capturer: TVICameraCapturer, didStartWith source: TVICameraCaptureSource) { self.previewView.shouldMirror = (source == .frontCamera) } }
[ -1 ]
1296beb07ca8deb4b27a04412231a8a4fc3b0cf0
9b8b2d9654dfc9402a33ca8dc8c9f7a4ec9a6223
/HomebrUI/Homebrew/Homebrew.swift
9fbe37c3a3ec27e26559e2495dae5e97040f6dd7
[ "MIT" ]
permissive
huwr-loup/HomebrUI
07f031a58b6f2d1ef9d99f3aa31b6c746570346b
4537cd61ccd393a6e63b8229916057add0e3cd34
refs/heads/main
2023-02-01T07:00:45.421582
2020-12-20T20:42:04
2020-12-20T20:46:19
323,167,104
0
0
MIT
2020-12-20T21:20:57
2020-12-20T21:20:57
null
UTF-8
Swift
false
false
2,703
swift
import Foundation import Combine struct Homebrew { private let queue: HomebrewOperationQueue init(configuration: HomebrewConfiguration = .default) { self.queue = HomebrewOperationQueue(configuration: configuration) } var operationPublisher: AnyPublisher<HomebrewOperation, Never> { queue.operationPublisher } func installedPackages() -> AnyPublisher<HomebrewInfo, Error> { queue.run(.list) .tryMap { result in guard result.status == 0 else { throw HomebrewError(processResult: result) } return try JSONDecoder().decode(HomebrewInfo.self, from: result.standardOutput) } .eraseToAnyPublisher() } func search(for query: String) -> AnyPublisher<[HomebrewID], Error> { queue.run(.search(query)) .tryMap { result in guard result.status == 0 else { let errorMessage = String(decoding: result.standardError, as: UTF8.self) guard errorMessage.hasPrefix("Error: No formulae or casks found for") else { throw HomebrewError(processResult: result) } return [] } return String(decoding: result.standardOutput, as: UTF8.self) .split(separator: "\n") .compactMap { line in // Ignore any empty lines and dividers between Formulae and Casks if line.isEmpty || line.starts(with: "==>") { return nil } return HomebrewID(rawValue: String(line)) } } .eraseToAnyPublisher() } func info(for packages: [HomebrewID]) -> AnyPublisher<HomebrewInfo, Error> { queue.run(.info(packages.map(\.rawValue))) .tryMap { result in guard result.status == 0 else { throw HomebrewError(processResult: result) } return try JSONDecoder().decode(HomebrewInfo.self, from: result.standardOutput) } .eraseToAnyPublisher() } func uninstallFormulae(id: HomebrewID) -> AnyPublisher<String, Error> { queue.run(.uninstall(id.rawValue)) .tryMap { result in guard result.status == 0 else { throw HomebrewError(processResult: result) } return String(decoding: result.standardOutput, as: UTF8.self) } .eraseToAnyPublisher() } } private struct HomebrewError: LocalizedError { let status: Int let output: Data var errorDescription: String { "Exited with status \(status): \(String(decoding: output, as: UTF8.self))" } } private extension HomebrewError { init(processResult result: ProcessResult) { self.init( status: result.status, output: result.standardError.isEmpty ? result.standardOutput : result.standardError ) } }
[ -1 ]
78930c2af8d8d8d3ca10227c8947461e2fe9d020
97a840303e933d3c59b1c309cd2da198cbf421e1
/CWWeChat/MainClass/Message/Controller/PhotoBower/View/CWPhotoBrowserScrollView.swift
4f17aed280b53743b0f80a535d5efab883bb68db
[ "MIT" ]
permissive
jv9/CWWeChat
762f7e3ee5d0e48d8a8af9c30ad4a005a1962d38
ae8f215f7883e7d17af9ae26ca8be35098a169f8
refs/heads/master
2020-12-26T02:01:14.233326
2016-07-11T15:59:21
2016-07-11T15:59:21
null
0
0
null
null
null
null
UTF-8
Swift
false
false
1,217
swift
// // CWPhotoBrowserScrollView.swift // CWWeChat // // Created by chenwei on 16/7/9. // Copyright © 2016年 chenwei. All rights reserved. // import UIKit class CWPhotoBrowserScrollView: UIScrollView { var imageView:UIImageView! override init(frame: CGRect) { super.init(frame: frame) self.clipsToBounds = true self.backgroundColor = UIColor.blackColor() self.showsVerticalScrollIndicator = false self.showsHorizontalScrollIndicator = false self.delegate = self self.autoresizingMask = [.FlexibleHeight,.FlexibleWidth] self.minimumZoomScale = 1.0 self.maximumZoomScale = 2.0 setupUI() } ///配置 func setupUI() { imageView = UIImageView() self.addSubview(imageView) } override func layoutSubviews() { super.layoutSubviews() imageView.frame = self.bounds } func addGesture() { } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } } extension CWPhotoBrowserScrollView:UIScrollViewDelegate { }
[ -1 ]
6b54b66efb46d60855c482e6645740e9e24f35c5
ae3eaeba024e6121e98bfcd518f887372cc938f2
/Package.swift
464e1f7b3cb7b4900ed4e55d7aa4eccc504be956
[ "MIT" ]
permissive
djmckay/djmckay.tech
4fbb2b903c06e114211a7c838bcafe77eeb9639e
56d7196006e023d5b43bcca8ff9c324c233edb0a
refs/heads/master
2023-05-12T15:27:47.861161
2023-04-30T20:10:34
2023-04-30T20:10:34
157,421,372
0
0
null
null
null
null
UTF-8
Swift
false
false
1,106
swift
// swift-tools-version:4.0 import PackageDescription let package = Package( name: "djmckay.tech", dependencies: [ // 💧 A server-side Swift web framework. .package(url: "https://github.com/vapor/vapor.git", from: "3.1.0-rc"), // 🍃 An expressive, performant, and extensible templating language built for Swift. .package(url: "https://github.com/vapor/fluent-mysql.git", from: "3.0.0-rc"), .package(url: "https://github.com/vapor/leaf.git", from: "3.0.0-rc"), .package(url: "https://github.com/vapor/jwt.git", from: "3.0.0"), .package(url: "https://github.com/vapor/auth.git", from: "2.0.0-rc"), .package(url: "https://github.com/vapor/console.git", from: "3.0.0"), .package(url: "https://github.com/vapor/multipart.git", from: "3.0.0"), ], targets: [ .target(name: "App", dependencies: ["FluentMySQL", "Vapor", "Authentication", "JWT", "Leaf", "Logging", "Multipart"]), .target(name: "Run", dependencies: ["App"]), .testTarget(name: "AppTests", dependencies: ["App"]) ] )
[ -1 ]
b5d6a37684e802a39aee3ddd9e069fb0ab42d805
58af007c129c60c462b9ab8627cab290b2ba1494
/FSD/Helpers/FlickrRequestConfig.swift
0b6041ab2b4e79d26d07ff7dad68c2fc62fb0bb2
[]
no_license
LipatovEugene/demo
f95c573aab46b7ae62f07018dd3b58c489886436
8e5a574d448e1da8137520bf3aad5e98784f8f91
refs/heads/main
2023-02-04T06:20:58.433201
2020-12-22T18:21:46
2020-12-22T18:21:46
323,701,647
0
0
null
2020-12-22T18:17:44
2020-12-22T18:17:43
null
UTF-8
Swift
false
false
587
swift
// // FlickrRequestConfig.swift // FlickrSearchDemo // // Created by Eugen Lipatov on 22.12.2020. // import UIKit enum FlickrRequestConfig { case searchRequest(String, Int) var value: Request? { switch self { case .searchRequest(let searchText, let pageNo): let urlString = String(format: Constants.searchURL, searchText, pageNo) print("Select urk string") let reqConfig = Request.init(requestMethod: .get, urlString: urlString) return reqConfig } } }
[ -1 ]
e82e247d4cbbba13df4e0a8709f6fc0b007d1169
d6fb898be7e757dcadf38f8da9ff6f8a12f97a70
/http/IHttpClient.swift
1e008f7bd3f7bdc9c8209768e4f403062ff88986
[]
no_license
angelolloqui/blog-shared-architecure-swift
5d65909319d0a39f377b11e8efde9e8fba42cc95
5b3f5323efd290cddeb8cdf2f17e7f65817ec984
refs/heads/master
2020-03-26T02:16:24.481862
2018-08-11T17:46:56
2018-08-11T17:46:56
144,403,874
3
0
null
null
null
null
UTF-8
Swift
false
false
1,501
swift
// // IHttpClient.swift // Anemone SDK // // Created by Manuel Gonzalez Villegas on 5/12/16. // Copyright © 2016 Syltek Solutions S.L. All rights reserved. // import Foundation public protocol IHttpClient { func request(_ httpRequest: HttpRequest) -> Promise<HttpResponse> } extension IHttpClient { public func get(endpoint: String, params: [String: Any]?) -> Promise<Data> { return request(HttpRequest(method: .get, url: endpoint, queryParams: params, bodyParams: nil, headers: nil)) .then { $0.body } } public func post(endpoint: String, params: [String: Any]?) -> Promise<Data> { return request(HttpRequest(method: .post, url: endpoint, queryParams: nil, bodyParams: params, headers: nil)) .then { $0.body } } public func put(endpoint: String, params: [String: Any]?) -> Promise<Data> { return request(HttpRequest(method: .put, url: endpoint, queryParams: nil, bodyParams: params, headers: nil)) .then { $0.body } } public func patch(endpoint: String, params: [String: Any]?) -> Promise<Data> { return request(HttpRequest(method: .patch, url: endpoint, queryParams: nil, bodyParams: params, headers: nil)) .then { $0.body } } public func delete(endpoint: String, params: [String: Any]?) -> Promise<Data> { return request(HttpRequest(method: .delete, url: endpoint, queryParams: params, bodyParams: nil, headers: nil)) .then { $0.body } } }
[ -1 ]
396f7b2f3efb9f0c0b38210887677b01245af8f3
0f0b7de6b3013725144484c3479ca3ad68dd928e
/RxRoverTests/Photo+Mocks.swift
97b76e76255e0afa895db9ca99d77b2edee5334e
[]
no_license
greghive/RxRover
8dd46d4156c8e984a76ae6df424b1a50b9abe442
e62cf3264a1fe88b5cf1ad923973cab51c508391
refs/heads/main
2023-03-27T06:20:45.045653
2021-03-04T09:41:45
2021-03-04T09:41:45
344,192,370
1
0
null
null
null
null
UTF-8
Swift
false
false
491
swift
// // Photo+Mocks.swift // RxRoverTests // // Created by Greg Price on 04/03/2021. // @testable import RxRover extension Photo { static func mock() -> Photo { let camera = Camera(id: 1, name: "CMR", roverId: 1, fullName: "Camera") let rover = Rover(id: 1, name: "Spirit", landingDate: "2021-03-03", launchDate: "2021-03-03", status: "active") return Photo(id: 1, sol: 1, earthDate: "2021-03-03", camera: camera, rover: rover, imgSrc: "https://image") } }
[ -1 ]
56921781f3492170b1e1ad1ba4c46ca3958fa2fe
1502f429fbb30f570400b03d015cb4ef20287854
/PoopScoop/PoopScoopTests/PoopScoopTests.swift
ea36b79315dc3328a5ddd6d6601b50619f0fe92e
[]
no_license
jeffhsu07/Scoop
261d06b710c17dfeec0ad8155455cc1a60d2ffe6
7eda53600a010d38055e6713092bb7b4ceef7c33
refs/heads/master
2020-03-24T15:37:41.178190
2018-08-25T23:02:56
2018-08-25T23:02:56
142,796,224
0
0
null
null
null
null
UTF-8
Swift
false
false
974
swift
// // PoopScoopTests.swift // PoopScoopTests // // Created by jeff hsu on 7/29/18. // Copyright © 2018 Jeffrey Hsu. All rights reserved. // import XCTest @testable import PoopScoop class PoopScoopTests: 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. } } }
[ 282633, 245457, 313357, 182296, 305179, 145435, 241692, 278558, 98333, 16419, 102437, 229413, 292902, 204840, 354345, 227370, 223274, 278570, 233517, 155694, 344107, 229424, 124975, 253999, 346162, 229430, 319542, 180280, 124984, 358456, 213052, 288833, 286788, 352326, 311372, 354385, 196691, 223316, 280661, 315476, 329814, 278615, 307289, 338007, 200794, 354393, 315487, 237663, 45153, 309345, 280675, 227428, 307301, 280677, 313447, 307299, 131178, 278634, 194666, 315498, 319598, 288879, 352368, 299121, 284788, 233589, 223350, 233590, 280694, 237689, 333940, 131191, 215164, 313469, 215166, 131198, 292992, 278655, 194691, 227460, 333955, 280712, 215178, 235662, 311438, 241808, 323729, 325776, 317587, 306542, 278677, 284826, 278685, 346271, 311458, 278691, 233636, 49316, 299174, 333991, 333992, 184484, 233642, 284842, 278699, 32941, 323236, 278704, 239793, 278708, 125109, 131256, 182456, 278714, 223419, 280762, 295098, 299198, 184505, 379071, 227513, 280768, 299203, 301251, 309444, 338119, 280778, 282831, 321745, 254170, 280795, 227548, 229597, 301279, 356576, 338150, 176362, 286958, 125169, 338164, 227576, 327929, 184570, 243962, 125183, 309503, 184575, 125188, 313608, 125193, 375051, 278797, 180493, 125198, 325905, 254226, 125203, 361927, 125208, 325912, 309529, 299293, 278816, 125217, 233762, 211235, 217380, 305440, 227616, 151847, 282919, 125235, 332085, 280887, 125240, 332089, 278842, 315706, 282939, 307517, 287041, 241986, 260418, 287043, 311621, 139589, 280902, 319813, 332101, 182598, 227654, 323916, 319821, 254286, 348492, 250192, 6481, 323920, 344401, 348500, 366929, 289110, 305495, 155990, 6489, 366930, 272729, 379225, 293556, 278869, 323935, 106847, 391520, 321894, 416104, 280939, 242029, 246127, 285040, 313713, 354676, 199029, 291192, 139640, 246136, 246137, 311681, 362881, 248194, 225670, 395659, 227725, 227726, 395661, 240016, 291224, 293274, 317852, 283038, 61857, 285090, 61859, 381347, 289189, 375207, 340398, 377264, 299441, 61873, 283064, 61880, 278970, 319930, 336317, 293310, 278978, 291267, 127427, 127428, 283075, 188871, 324039, 278989, 317901, 281040, 278993, 326100, 278999, 328152, 176601, 242139, 369116, 188894, 287198, 279008, 160225, 285150, 342498, 242148, 195045, 279013, 279018, 311786, 291311, 281072, 279029, 279032, 233978, 279039, 301571, 291333, 342536, 287241, 279050, 340490, 283153, 230499, 279062, 289304, 279065, 342553, 291358, 182817, 180771, 375333, 377386, 244269, 283182, 283184, 236081, 296448, 23092, 234036, 279094, 315960, 352829, 70209, 115270, 70215, 309830, 301638, 348742, 322120, 55881, 348749, 281166, 293448, 281171, 244310, 285271, 295519, 354911, 436832, 66150, 111208, 344680, 279146, 191082, 313966, 281199, 295536, 287346, 287352, 301689, 279164, 291454, 189057, 311941, 348806, 279177, 369289, 152203, 330379, 344715, 184973, 311949, 330387, 330388, 352917, 227990, 230040, 271000, 289434, 303771, 342682, 279206, 295590, 287404, 205487, 285361, 303793, 299699, 342706, 299700, 166582, 164533, 314040, 287417, 158394, 338613, 342713, 285373, 287422, 66242, 287433, 225995, 154316, 363211, 333521, 287439, 279252, 333523, 96984, 318173, 289502, 363230, 299746, 295652, 279269, 338662, 285415, 234217, 342762, 346858, 230125, 289518, 299759, 279280, 312047, 125684, 230134, 199414, 154359, 299770, 234234, 279294, 35583, 205568, 242433, 295682, 299776, 162561, 363263, 285444, 322313, 322319, 295697, 285458, 291604, 166676, 207640, 283419, 326429, 336671, 326433, 344865, 281377, 234277, 283430, 279336, 289576, 262954, 318250, 295724, 152365, 312108, 285487, 164656, 301871, 303920, 262962, 318252, 353069, 234294, 328499, 242485, 353078, 230199, 353079, 285497, 336702, 160575, 281408, 295744, 420677, 318278, 353094, 353095, 299849, 283467, 201551, 293711, 281427, 353109, 281433, 230234, 301918, 295776, 279392, 293730, 349026, 303972, 351077, 279397, 275303, 230248, 177001, 342887, 308076, 242541, 400239, 246641, 330609, 207732, 228215, 209783, 209785, 279417, 246648, 269178, 177019, 361337, 291712, 254850, 359298, 113542, 287622, 240518, 228233, 228234, 308107, 56208, 308112, 234386, 295824, 293781, 209817, 324506, 324507, 318364, 310176, 310178, 189348, 324517, 283558, 289703, 279464, 293800, 310182, 353195, 140204, 236461, 293806, 353197, 304051, 189374, 289727, 353216, 349121, 363458, 19399, 213960, 279498, 316364, 338899, 304087, 340955, 248797, 207838, 50143, 130016, 340961, 64485, 314342, 123881, 324586, 320493, 289774, 183279, 304110, 320494, 340974, 287731, 314355, 316405, 240630, 295927, 201720, 304122, 314362, 320507, 328700, 328706, 234500, 320516, 134150, 354343, 322570, 230410, 320527, 146448, 324625, 234514, 308243, 316437, 140310, 418837, 197657, 281626, 201755, 238623, 336929, 189474, 300068, 357414, 248872, 345132, 238639, 300084, 252980, 322612, 359478, 324666, 302139, 238651, 308287, 21569, 359495, 238664, 300111, 314448, 234577, 341073, 296019, 353367, 234587, 156764, 156765, 304222, 113760, 281697, 314467, 281700, 250981, 285798, 300135, 322663, 300136, 228458, 316520, 279660, 207979, 316526, 15471, 357486, 300146, 187506, 353397, 285814, 300151, 279672, 291959, 160891, 341115, 363644, 300158, 150657, 187521, 248961, 285828, 279685, 302213, 222343, 302216, 349316, 349318, 228491, 228493, 234638, 285838, 169104, 162961, 177296, 308372, 185493, 296086, 238743, 326804, 119962, 300187, 296092, 300188, 339102, 302240, 306338, 343203, 234663, 300201, 249002, 300202, 253099, 238765, 282327, 279728, 238769, 367799, 339130, 64700, 283840, 343234, 279747, 367810, 259268, 283847, 353479, 62665, 353481, 353482, 244940, 283852, 283853, 279760, 290000, 228563, 189652, 279765, 296153, 357595, 279774, 304351, 298212, 304356, 290022, 330984, 279785, 228588, 234733, 253167, 279792, 353523, 298228, 302325, 234742, 292085, 216315, 292091, 208124, 316669, 363771, 388349, 228609, 234755, 279814, 322824, 242954, 292107, 312587, 328971, 251153, 173334, 245019, 320796, 126237, 339234, 130338, 304421, 130343, 279854, 351537, 345396, 300343, 116026, 222524, 286018, 113987, 193859, 279875, 300359, 304456, 230729, 294218, 234827, 224586, 372043, 296270, 234831, 238927, 177484, 251213, 296273, 120148, 318805, 283991, 357719, 222559, 314720, 292195, 294243, 281957, 230756, 163175, 333160, 230765, 284014, 296303, 243056, 279920, 312689, 296307, 314739, 116084, 327025, 327031, 111993, 290173, 306559, 378244, 298374, 314758, 314760, 142729, 388487, 368011, 296329, 314766, 296335, 318864, 112017, 112018, 306579, 234898, 224661, 282007, 357786, 318875, 290207, 314783, 333220, 314789, 279974, 282022, 282024, 310692, 241066, 316842, 279984, 286129, 173491, 286132, 279989, 210358, 284089, 228795, 292283, 302529, 415171, 302531, 163268, 380357, 300487, 306631, 296392, 280010, 284107, 310732, 302540, 312782, 64975, 306639, 300489, 370123, 222675, 148940, 280013, 327121, 366037, 210390, 210391, 353750, 228827, 286172, 210393, 280032, 144867, 310757, 187878, 280041, 361963, 54765, 191981, 306673, 321009, 251378, 306677, 343542, 300535, 280055, 288249, 286202, 300536, 290300, 286205, 302590, 228861, 294400, 300542, 282114, 290301, 306692, 306693, 210433, 228867, 366083, 230921, 323080, 253452, 296461, 323087, 304656, 282129, 329232, 316946, 308756, 146964, 398869, 282136, 308764, 282141, 349726, 282146, 306723, 286244, 245287, 313339, 245292, 349741, 169518, 230959, 286254, 288309, 290358, 288318, 235070, 194110, 280130, 349763, 196164, 124485, 56902, 288327, 282183, 218696, 288326, 292425, 243274, 128587, 333388, 228943, 286288, 333393, 300630, 290390, 235095, 306776, 196187, 239198, 343647, 157281, 286306, 374372, 282213, 300644, 317032, 310889, 323178, 54893, 138863, 222832, 314998, 247416, 366203, 175741, 337535, 235135, 294529, 239237, 224901, 286343, 288392, 229001, 282245, 290443, 310923, 282246, 188048, 323217, 239250, 282259, 345752, 229020, 333470, 282271, 282273, 302754, 255649, 282276, 40613, 40614, 40615, 282280, 290471, 298661, 298667, 300714, 245412, 229029, 286388, 286391, 300728, 321207, 296632, 319162, 280251, 282303, 286399, 280257, 218819, 321219, 282312, 306890, 280267, 212685, 333517, 282318, 9936, 9937, 302802, 212688, 333520, 241361, 280278, 286423, 280280, 278233, 18138, 278234, 67292, 298712, 294622, 321247, 278240, 229088, 298720, 153319, 12010, 288491, 212716, 239341, 212717, 280300, 282348, 284401, 282355, 282358, 313081, 229113, 286459, 325371, 124669, 194303, 194304, 288512, 278272, 175873, 288516, 319233, 323331, 280327, 323332, 280329, 311042, 300811, 282378, 284429, 278291, 294678, 321302, 366360, 116505, 284442, 249626, 325404, 282391, 286494, 321310, 282400, 241441, 325410, 339745, 341796, 247590, 257830, 282409, 294700, 280366, 317232, 282417, 200498, 280372, 321337, 282427, 280380, 360252, 325439, 282434, 307011, 315202, 280390, 282438, 280392, 345929, 341836, 304977, 307025, 413521, 325457, 18262, 216918, 307031, 280410, 188251, 284507, 370522, 300894, 245599, 237408, 284512, 284514, 302946, 345951, 362337, 345955, 276327, 296806, 292712, 288619, 288620, 325484, 282480, 292720, 362352, 313203, 325492, 300918, 241528, 194429, 124798, 325503, 182144, 305026, 253829, 333701, 67463, 282504, 315273, 315274, 243591, 243597, 325518, 110480, 184208, 282518, 282519, 124824, 214937, 214938, 294809, 329622, 118685, 294814, 298909, 319392, 300963, 292771, 354212, 294823, 298920, 333735, 284587, 292782, 124852, 243637, 288697, 290746, 294843, 98239, 237504, 214977, 280514, 343543, 163781, 280519, 214984, 284619, 247757, 344013, 231375, 301008, 153554, 194515, 212946, 219101, 280541, 292836, 292837, 298980, 294886, 337895, 247785, 253929, 296941, 327661, 362480, 311281, 311282, 325619, 333817, 292858, 290811 ]
3aa09a93fe9ff230b0023bc93467e8a0efffd430
fb638e6d02fe84eef991f4e8725558b9de47bac7
/test/Constraints/members.swift
bcf5665657f171e53e220af942d4b97f070b2ed1
[ "Apache-2.0", "Swift-exception" ]
permissive
gottesmm/swift
84e1c61dfd522a6bf4e3c3a91da0ed10d535f20d
a7422b7aacaa8b61dba35a03b30c9154d8aae499
refs/heads/main
2023-08-30T17:48:35.270339
2020-12-28T05:03:29
2020-12-29T21:32:17
47,728,072
2
0
Apache-2.0
2023-08-26T15:16:15
2015-12-10T00:36:58
C++
UTF-8
Swift
false
false
23,971
swift
// RUN: %target-typecheck-verify-swift -swift-version 5 //// // Members of structs //// struct X { func f0(_ i: Int) -> X { } func f1(_ i: Int) { } mutating func f1(_ f: Float) { } func f2<T>(_ x: T) -> T { } } struct Y<T> { func f0(_: T) -> T {} func f1<U>(_ x: U, y: T) -> (T, U) {} } var i : Int var x : X var yf : Y<Float> func g0(_: (inout X) -> (Float) -> ()) {} _ = x.f0(i) x.f0(i).f1(i) g0(X.f1) // expected-error{{partial application of 'mutating' method}} _ = x.f0(x.f2(1)) _ = x.f0(1).f2(i) _ = yf.f0(1) _ = yf.f1(i, y: 1) // Members referenced from inside the struct struct Z { var i : Int func getI() -> Int { return i } mutating func incI() {} func curried(_ x: Int) -> (Int) -> Int { return { y in x + y } } subscript (k : Int) -> Int { get { return i + k } mutating set { i -= k } } } struct GZ<T> { var i : T func getI() -> T { return i } func f1<U>(_ a: T, b: U) -> (T, U) { return (a, b) } func f2() { var f : Float var t = f1(i, b: f) f = t.1 var zi = Z.i; // expected-error{{instance member 'i' cannot be used on type 'Z'}} var zj = Z.asdfasdf // expected-error {{type 'Z' has no member 'asdfasdf'}} } } var z = Z(i: 0) var getI = z.getI var incI = z.incI // expected-error{{partial application of 'mutating'}} var zi = z.getI() var zcurried1 = z.curried var zcurried2 = z.curried(0) var zcurriedFull = z.curried(0)(1) //// // Members of modules //// // Module Swift.print(3, terminator: "") //// // Unqualified references //// //// // Members of literals //// // FIXME: Crappy diagnostic "foo".lower() // expected-error{{value of type 'String' has no member 'lower'}} var tmp = "foo".debugDescription //// // Members of enums //// enum W { case Omega func foo(_ x: Int) {} func curried(_ x: Int) -> (Int) -> () {} } var w = W.Omega var foo = w.foo var fooFull : () = w.foo(0) var wcurried1 = w.curried var wcurried2 = w.curried(0) var wcurriedFull : () = w.curried(0)(1) // Member of enum type func enumMetatypeMember(_ opt: Int?) { opt.none // expected-error{{enum case 'none' cannot be used as an instance member}} } //// // Nested types //// // Reference a Type member. <rdar://problem/15034920> class G<T> { class In { class func foo() {} } } func goo() { G<Int>.In.foo() } //// // Misc ambiguities //// // <rdar://problem/15537772> struct DefaultArgs { static func f(_ a: Int = 0) -> DefaultArgs { return DefaultArgs() } init() { self = .f() } } class InstanceOrClassMethod { func method() -> Bool { return true } class func method(_ other: InstanceOrClassMethod) -> Bool { return false } } func testPreferClassMethodToCurriedInstanceMethod(_ obj: InstanceOrClassMethod) { let result = InstanceOrClassMethod.method(obj) let _: Bool = result // no-warning let _: () -> Bool = InstanceOrClassMethod.method(obj) } protocol Numeric { static func +(x: Self, y: Self) -> Self } func acceptBinaryFunc<T>(_ x: T, _ fn: (T, T) -> T) { } func testNumeric<T : Numeric>(_ x: T) { acceptBinaryFunc(x, +) } /* FIXME: We can't check this directly, but it can happen with multiple modules. class PropertyOrMethod { func member() -> Int { return 0 } let member = false class func methodOnClass(_ obj: PropertyOrMethod) -> Int { return 0 } let methodOnClass = false } func testPreferPropertyToMethod(_ obj: PropertyOrMethod) { let result = obj.member let resultChecked: Bool = result let called = obj.member() let calledChecked: Int = called let curried = obj.member as () -> Int let methodOnClass = PropertyOrMethod.methodOnClass let methodOnClassChecked: (PropertyOrMethod) -> Int = methodOnClass } */ struct Foo { var foo: Int } protocol ExtendedWithMutatingMethods { } extension ExtendedWithMutatingMethods { mutating func mutatingMethod() {} var mutableProperty: Foo { get { } set { } } var nonmutatingProperty: Foo { get { } nonmutating set { } } var mutatingGetProperty: Foo { mutating get { } set { } } } class ClassExtendedWithMutatingMethods: ExtendedWithMutatingMethods {} class SubclassExtendedWithMutatingMethods: ClassExtendedWithMutatingMethods {} func testClassExtendedWithMutatingMethods(_ c: ClassExtendedWithMutatingMethods, // expected-note* {{}} sub: SubclassExtendedWithMutatingMethods) { // expected-note* {{}} c.mutatingMethod() // expected-error{{cannot use mutating member on immutable value: 'c' is a 'let' constant}} c.mutableProperty = Foo(foo: 0) // expected-error{{cannot assign to property}} c.mutableProperty.foo = 0 // expected-error{{cannot assign to property}} c.nonmutatingProperty = Foo(foo: 0) c.nonmutatingProperty.foo = 0 c.mutatingGetProperty = Foo(foo: 0) // expected-error{{cannot use mutating}} c.mutatingGetProperty.foo = 0 // expected-error{{cannot use mutating}} _ = c.mutableProperty _ = c.mutableProperty.foo _ = c.nonmutatingProperty _ = c.nonmutatingProperty.foo // FIXME: diagnostic nondeterministically says "member" or "getter" _ = c.mutatingGetProperty // expected-error{{cannot use mutating}} _ = c.mutatingGetProperty.foo // expected-error{{cannot use mutating}} sub.mutatingMethod() // expected-error{{cannot use mutating member on immutable value: 'sub' is a 'let' constant}} sub.mutableProperty = Foo(foo: 0) // expected-error{{cannot assign to property}} sub.mutableProperty.foo = 0 // expected-error{{cannot assign to property}} sub.nonmutatingProperty = Foo(foo: 0) sub.nonmutatingProperty.foo = 0 sub.mutatingGetProperty = Foo(foo: 0) // expected-error{{cannot use mutating}} sub.mutatingGetProperty.foo = 0 // expected-error{{cannot use mutating}} _ = sub.mutableProperty _ = sub.mutableProperty.foo _ = sub.nonmutatingProperty _ = sub.nonmutatingProperty.foo _ = sub.mutatingGetProperty // expected-error{{cannot use mutating}} _ = sub.mutatingGetProperty.foo // expected-error{{cannot use mutating}} var mutableC = c mutableC.mutatingMethod() mutableC.mutableProperty = Foo(foo: 0) mutableC.mutableProperty.foo = 0 mutableC.nonmutatingProperty = Foo(foo: 0) mutableC.nonmutatingProperty.foo = 0 mutableC.mutatingGetProperty = Foo(foo: 0) mutableC.mutatingGetProperty.foo = 0 _ = mutableC.mutableProperty _ = mutableC.mutableProperty.foo _ = mutableC.nonmutatingProperty _ = mutableC.nonmutatingProperty.foo _ = mutableC.mutatingGetProperty _ = mutableC.mutatingGetProperty.foo var mutableSub = sub mutableSub.mutatingMethod() mutableSub.mutableProperty = Foo(foo: 0) mutableSub.mutableProperty.foo = 0 mutableSub.nonmutatingProperty = Foo(foo: 0) mutableSub.nonmutatingProperty.foo = 0 _ = mutableSub.mutableProperty _ = mutableSub.mutableProperty.foo _ = mutableSub.nonmutatingProperty _ = mutableSub.nonmutatingProperty.foo _ = mutableSub.mutatingGetProperty _ = mutableSub.mutatingGetProperty.foo } // <rdar://problem/18879585> QoI: error message for attempted access to instance properties in static methods are bad. enum LedModules: Int { case WS2811_1x_5V } extension LedModules { static var watts: Double { return [0.30][self.rawValue] // expected-error {{instance member 'rawValue' cannot be used on type 'LedModules'}} } } // <rdar://problem/15117741> QoI: calling a static function on an instance produces a non-helpful diagnostic class r15117741S { static func g() {} } func test15117741(_ s: r15117741S) { s.g() // expected-error {{static member 'g' cannot be used on instance of type 'r15117741S'}} } // <rdar://problem/22491394> References to unavailable decls sometimes diagnosed as ambiguous struct UnavailMember { @available(*, unavailable) static var XYZ : UnavailMember { get {} } // expected-note {{'XYZ' has been explicitly marked unavailable here}} } let _ : [UnavailMember] = [.XYZ] // expected-error {{'XYZ' is unavailable}} let _ : [UnavailMember] = [.ABC] // expected-error {{type 'UnavailMember' has no member 'ABC'}} // <rdar://problem/22490787> QoI: Poor error message iterating over property with non-sequence type that defines an Iterator type alias struct S22490787 { typealias Iterator = AnyIterator<Int> } func f22490787() { var path: S22490787 = S22490787() for p in path { // expected-error {{for-in loop requires 'S22490787' to conform to 'Sequence'}} } } // <rdar://problem/23942743> [QoI] Bad diagnostic when errors inside enum constructor enum r23942743 { case Tomato(cloud: String) } let _ = .Tomato(cloud: .none) // expected-error {{reference to member 'Tomato' cannot be resolved without a contextual type}} // expected-error@-1 {{cannot infer contextual base in reference to member 'none'}} // SR-650: REGRESSION: Assertion failed: (baseTy && "Couldn't find appropriate context"), function getMemberSubstitutions enum SomeErrorType { case StandaloneError case UnderlyingError(String) static func someErrorFromString(_ str: String) -> SomeErrorType? { if str == "standalone" { return .StandaloneError } if str == "underlying" { return .UnderlyingError } // expected-error {{member 'UnderlyingError' expects argument of type 'String'}} return nil } } // SR-2193: QoI: better diagnostic when a decl exists, but is not a type enum SR_2193_Error: Error { case Boom } do { throw SR_2193_Error.Boom } catch let e as SR_2193_Error.Boom { // expected-error {{enum case 'Boom' is not a member type of 'SR_2193_Error'}} } // rdar://problem/25341015 extension Sequence { func r25341015_1() -> Int { return max(1, 2) // expected-error {{use of 'max' refers to instance method rather than global function 'max' in module 'Swift'}} expected-note {{use 'Swift.' to reference the global function in module 'Swift'}} } } class C_25341015 { static func baz(_ x: Int, _ y: Int) {} func baz() {} func qux() { baz(1, 2) // expected-error {{static member 'baz' cannot be used on instance of type 'C_25341015'}} {{5-5=C_25341015.}} } } struct S_25341015 { static func foo(_ x: Int, y: Int) {} func foo(z: Int) {} func bar() { foo(1, y: 2) // expected-error {{static member 'foo' cannot be used on instance of type 'S_25341015'}} {{5-5=S_25341015.}} } } func r25341015() { func baz(_ x: Int, _ y: Int) {} class Bar { func baz() {} func qux() { baz(1, 2) // expected-error {{use of 'baz' refers to instance method rather than local function 'baz'}} } } } func r25341015_local(x: Int, y: Int) {} func r25341015_inner() { func r25341015_local() {} r25341015_local(x: 1, y: 2) // expected-error {{argument passed to call that takes no arguments}} } // rdar://problem/32854314 - Emit shadowing diagnostics even if argument types do not much completely func foo_32854314() -> Double { return 42 } func bar_32854314() -> Int { return 0 } extension Array where Element == Int { func foo() { let _ = min(foo_32854314(), bar_32854314()) // expected-note {{use 'Swift.' to reference the global function in module 'Swift'}} {{13-13=Swift.}} // expected-error@-1 {{use of 'min' refers to instance method rather than global function 'min' in module 'Swift'}} } func foo(_ x: Int, _ y: Double) { let _ = min(x, y) // expected-note {{use 'Swift.' to reference the global function in module 'Swift'}} {{13-13=Swift.}} // expected-error@-1 {{use of 'min' refers to instance method rather than global function 'min' in module 'Swift'}} } func bar() { let _ = min(1.0, 2) // expected-note {{use 'Swift.' to reference the global function in module 'Swift'}} {{13-13=Swift.}} // expected-error@-1 {{use of 'min' refers to instance method rather than global function 'min' in module 'Swift'}} } } // Crash in diagnoseImplicitSelfErrors() struct Aardvark { var snout: Int mutating func burrow() { dig(&snout, .y) // expected-error {{type 'Int' has no member 'y'}} } func dig(_: inout Int, _: Int) {} } func rdar33914444() { struct A { enum R<E: Error> { case e(E) // expected-note {{'e' declared here}} } struct S { enum E: Error { case e1 } let e: R<E> } } _ = A.S(e: .e1) // expected-error@-1 {{type 'A.R<A.S.E>' has no member 'e1'; did you mean 'e'?}} } // SR-5324: Better diagnostic when instance member of outer type is referenced from nested type struct Outer { var outer: Int struct Inner { var inner: Int func sum() -> Int { return inner + outer // expected-error@-1 {{instance member 'outer' of type 'Outer' cannot be used on instance of nested type 'Outer.Inner'}} } } } // rdar://problem/39514009 - don't crash when trying to diagnose members with special names print("hello")[0] // expected-error {{value of type '()' has no subscripts}} func rdar40537782() { class A {} class B : A { override init() {} func foo() -> A { return A() } } struct S<T> { init(_ a: T...) {} } func bar<T>(_ t: T) { _ = S(B(), .foo(), A()) // expected-error {{type 'A' has no member 'foo'}} } } func rdar36989788() { struct A<T> { func foo() -> A<T> { return self } } func bar<T>(_ x: A<T>) -> (A<T>, A<T>) { return (x.foo(), x.undefined()) // expected-error {{value of type 'A<T>' has no member 'undefined'}} } } func rdar46211109() { struct MyIntSequenceStruct: Sequence { struct Iterator: IteratorProtocol { var current = 0 mutating func next() -> Int? { return current + 1 } } func makeIterator() -> Iterator { return Iterator() } } func foo<E, S: Sequence>(_ type: E.Type) -> S? where S.Element == E { return nil } let _: MyIntSequenceStruct? = foo(Int.Self) // expected-error@-1 {{type 'Int' has no member 'Self'}} } class A {} enum B { static func foo() { bar(A()) // expected-error {{instance member 'bar' cannot be used on type 'B'}} } func bar(_: A) {} } class C { static func foo() { bar(0) // expected-error {{instance member 'bar' cannot be used on type 'C'}} } func bar(_: Int) {} } class D { static func foo() {} func bar() { foo() // expected-error {{static member 'foo' cannot be used on instance of type 'D'}} } } func rdar_48114578() { struct S<T> { var value: T static func valueOf<T>(_ v: T) -> S<T> { return S<T>(value: v) } } typealias A = (a: [String]?, b: Int) func foo(_ a: [String], _ b: Int) -> S<A> { let v = (a, b) return .valueOf(v) } func bar(_ a: [String], _ b: Int) -> S<A> { return .valueOf((a, b)) // Ok } } struct S_Min { var xmin: Int = 42 } func xmin(_: Int, _: Float) -> Int { return 0 } func xmin(_: Float, _: Int) -> Int { return 0 } extension S_Min : CustomStringConvertible { public var description: String { return "\(xmin)" // Ok } } // rdar://problem/50679161 func rdar50679161() { struct Point {} struct S { var w, h: Point } struct Q { init(a: Int, b: Int) {} init(a: Point, b: Point) {} } func foo() { _ = { () -> Void in var foo = S // expected-error@-1 {{expected member name or constructor call after type name}} // expected-note@-2 {{add arguments after the type to construct a value of the type}} // expected-note@-3 {{use '.self' to reference the type object}} if let v = Int?(1) { var _ = Q( a: v + foo.w, // expected-error@-1 {{instance member 'w' cannot be used on type 'S'}} // expected-error@-2 {{cannot convert value of type 'Point' to expected argument type 'Int'}} b: v + foo.h // expected-error@-1 {{instance member 'h' cannot be used on type 'S'}} // expected-error@-2 {{cannot convert value of type 'Point' to expected argument type 'Int'}} ) } } } } func rdar_50467583_and_50909555() { if #available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *) { // rdar://problem/50467583 let _: Set = [Int][] // expected-error {{no 'subscript' candidates produce the expected contextual result type 'Set'}} // expected-error@-1 {{no exact matches in call to subscript}} // expected-note@-2 {{found candidate with type '(Int) -> Int'}} // expected-note@-3 {{found candidate with type '(Range<Int>) -> ArraySlice<Int>'}} // expected-note@-4 {{found candidate with type '((UnboundedRange_) -> ()) -> ArraySlice<Int>'}} // expected-note@-5 {{found candidate with type '(Range<Array<Int>.Index>) -> Slice<[Int]>' (aka '(Range<Int>) -> Slice<Array<Int>>')}} } // rdar://problem/50909555 struct S { static subscript(x: Int, y: Int) -> Int { // expected-note {{'subscript(_:_:)' declared here}} return 1 } } func test(_ s: S) { s[1] // expected-error {{static member 'subscript' cannot be used on instance of type 'S'}} {{5-6=S}} // expected-error@-1 {{missing argument for parameter #2 in call}} {{8-8=, <#Int#>}} } } // SR-9396 (rdar://problem/46427500) - Nonsensical error message related to constrained extensions struct SR_9396<A, B> {} extension SR_9396 where A == Bool { // expected-note {{where 'A' = 'Int'}} func foo() {} } func test_sr_9396(_ s: SR_9396<Int, Double>) { s.foo() // expected-error {{referencing instance method 'foo()' on 'SR_9396' requires the types 'Int' and 'Bool' be equivalent}} } // rdar://problem/34770265 - Better diagnostic needed for constrained extension method call extension Dictionary where Key == String { // expected-note {{where 'Key' = 'Int'}} func rdar_34770265_key() {} } extension Dictionary where Value == String { // expected-note {{where 'Value' = 'Int'}} func rdar_34770265_val() {} } func test_34770265(_ dict: [Int: Int]) { dict.rdar_34770265_key() // expected-error@-1 {{referencing instance method 'rdar_34770265_key()' on 'Dictionary' requires the types 'Int' and 'String' be equivalent}} dict.rdar_34770265_val() // expected-error@-1 {{referencing instance method 'rdar_34770265_val()' on 'Dictionary' requires the types 'Int' and 'String' be equivalent}} } // SR-12672 _ = [.e] // expected-error {{reference to member 'e' cannot be resolved without a contextual type}} let _ : [Any] = [.e] // expected-error {{type 'Any' has no member 'e'}} _ = [1 :.e] // expected-error {{reference to member 'e' cannot be resolved without a contextual type}} _ = [.e: 1] // expected-error {{reference to member 'e' cannot be resolved without a contextual type}} let _ : [Int: Any] = [1 : .e] // expected-error {{type 'Any' has no member 'e'}} let _ : (Int, Any) = (1, .e) // expected-error {{type 'Any' has no member 'e'}} _ = (1, .e) // expected-error {{cannot infer contextual base in reference to member 'e'}} // SR-13359 typealias Pair = (Int, Int) func testSR13359(_ pair: (Int, Int), _ alias: Pair, _ void: Void, labeled: (a: Int, b: Int)) { _ = pair[0] // expected-error {{cannot access element using subscript for tuple type '(Int, Int)'; did you mean to use '.0'?}} {{11-14=.0}} _ = pair[1] // expected-error {{cannot access element using subscript for tuple type '(Int, Int)'; did you mean to use '.1'?}} {{11-14=.1}} _ = pair[2] // expected-error {{cannot access element using subscript for tuple type '(Int, Int)'; use '.' notation instead}} {{none}} _ = pair[100] // expected-error {{cannot access element using subscript for tuple type '(Int, Int)'; use '.' notation instead}} {{none}} _ = pair["strting"] // expected-error {{cannot access element using subscript for tuple type '(Int, Int)'; use '.' notation instead}} {{none}} _ = pair[-1] // expected-error {{cannot access element using subscript for tuple type '(Int, Int)'; use '.' notation instead}} {{none}} _ = pair[1, 1] // expected-error {{cannot access element using subscript for tuple type '(Int, Int)'; use '.' notation instead}} {{none}} _ = void[0] // expected-error {{value of type 'Void' has no subscripts}} // Other representations of literals _ = pair[0x00] // expected-error {{cannot access element using subscript for tuple type '(Int, Int)'; use '.' notation instead}} {{none}} _ = pair[0b00] // expected-error {{cannot access element using subscript for tuple type '(Int, Int)'; use '.' notation instead}} {{none}} _ = alias[0] // expected-error {{cannot access element using subscript for tuple type 'Pair' (aka '(Int, Int)'); did you mean to use '.0'?}} {{12-15=.0}} _ = alias[1] // expected-error {{cannot access element using subscript for tuple type 'Pair' (aka '(Int, Int)'); did you mean to use '.1'?}} {{12-15=.1}} _ = alias[2] // expected-error {{cannot access element using subscript for tuple type 'Pair' (aka '(Int, Int)'); use '.' notation instead}} {{none}} _ = alias[100] // expected-error {{cannot access element using subscript for tuple type 'Pair' (aka '(Int, Int)'); use '.' notation instead}} {{none}} _ = alias["strting"] // expected-error {{cannot access element using subscript for tuple type 'Pair' (aka '(Int, Int)'); use '.' notation instead}} {{none}} _ = alias[-1] // expected-error {{cannot access element using subscript for tuple type 'Pair' (aka '(Int, Int)'); use '.' notation instead}} {{none}} _ = alias[1, 1] // expected-error {{cannot access element using subscript for tuple type 'Pair' (aka '(Int, Int)'); use '.' notation instead}} {{none}} _ = alias[0x00] // expected-error {{cannot access element using subscript for tuple type 'Pair' (aka '(Int, Int)'); use '.' notation instead}} {{none}} _ = alias[0b00] // expected-error {{cannot access element using subscript for tuple type 'Pair' (aka '(Int, Int)'); use '.' notation instead}} {{none}} // Labeled tuple base _ = labeled[0] // expected-error {{cannot access element using subscript for tuple type '(a: Int, b: Int)'; did you mean to use '.0'?}} {{14-17=.0}} _ = labeled[1] // expected-error {{cannot access element using subscript for tuple type '(a: Int, b: Int)'; did you mean to use '.1'?}} {{14-17=.1}} _ = labeled[2] // expected-error {{cannot access element using subscript for tuple type '(a: Int, b: Int)'; use '.' notation instead}} {{none}} _ = labeled[100] // expected-error {{cannot access element using subscript for tuple type '(a: Int, b: Int)'; use '.' notation instead}} {{none}} _ = labeled["strting"] // expected-error {{cannot access element using subscript for tuple type '(a: Int, b: Int)'; use '.' notation instead}} {{none}} _ = labeled[-1] // expected-error {{cannot access element using subscript for tuple type '(a: Int, b: Int)'; use '.' notation instead}} {{none}} _ = labeled[1, 1] // expected-error {{cannot access element using subscript for tuple type '(a: Int, b: Int)'; use '.' notation instead}} {{none}} _ = labeled[0x00] // expected-error {{cannot access element using subscript for tuple type '(a: Int, b: Int)'; use '.' notation instead}} {{none}} _ = labeled[0b00] // expected-error {{cannot access element using subscript for tuple type '(a: Int, b: Int)'; use '.' notation instead}} {{none}} // Suggesting use label access _ = labeled["a"] // expected-error {{cannot access element using subscript for tuple type '(a: Int, b: Int)'; did you mean to use '.a'?}} {{14-19=.a}} _ = labeled["b"] // expected-error {{cannot access element using subscript for tuple type '(a: Int, b: Int)'; did you mean to use '.b'?}} {{14-19=.b}} _ = labeled["c"] // expected-error {{cannot access element using subscript for tuple type '(a: Int, b: Int)'; use '.' notation instead}} {{none}} _ = labeled[""] // expected-error {{cannot access element using subscript for tuple type '(a: Int, b: Int)'; use '.' notation instead}} {{none}} } // rdar://problem/66891544 - incorrect diagnostic ("type is ambiguous") when base type of a reference cannot be determined func rdar66891544() { func foo<T>(_: T, defaultT: T? = nil) {} func foo<U>(_: U, defaultU: U? = nil) {} foo(.bar) // expected-error {{cannot infer contextual base in reference to member 'bar'}} }
[ 82999 ]
264357efb15ca5ed4ea2d3b610c55e0a27ae759a
bf0cd3d70830550268c5b71269ec6512dbda6822
/HW2_EmreKeskinUITests/HW2_EmreKeskinUITests.swift
3b645895b68e6f7001fbb034698cc4753cb7176c
[]
no_license
Hepsiburada-mobil-iOS-Bootcamp/HW2_EmreKeskin
27730e60b5d7a14fd5fb293f074b2ca67aa462bc
9269a992d247062f5d92a35d5b4a8276468951dd
refs/heads/main
2023-08-15T06:02:33.571332
2021-10-01T20:41:58
2021-10-01T20:41:58
412,610,068
0
0
null
null
null
null
UTF-8
Swift
false
false
1,448
swift
// // HW2_EmreKeskinUITests.swift // HW2_EmreKeskinUITests // // Created by Emre Keskin on 1.10.2021. // import XCTest class HW2_EmreKeskinUITests: XCTestCase { override func setUpWithError() throws { // Put setup code here. This method is called before the invocation of each test method in the class. // In UI tests it is usually best to stop immediately when a failure occurs. continueAfterFailure = false // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. } override func tearDownWithError() throws { // Put teardown code here. This method is called after the invocation of each test method in the class. } func testExample() throws { // UI tests must launch the application that they test. let app = XCUIApplication() app.launch() // Use recording to get started writing UI tests. // Use XCTAssert and related functions to verify your tests produce the correct results. } func testLaunchPerformance() throws { if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 7.0, *) { // This measures how long it takes to launch your application. measure(metrics: [XCTApplicationLaunchMetric()]) { XCUIApplication().launch() } } } }
[ 360463, 155665, 376853, 344106, 253996, 163894, 180279, 385078, 319543, 352314, 213051, 376892, 32829, 286787, 352324, 237638, 352327, 385095, 393291, 163916, 368717, 311373, 196687, 278607, 311377, 254039, 426074, 368732, 180317, 32871, 352359, 221292, 278637, 385135, 319599, 376945, 131190, 385147, 131199, 426124, 196758, 49308, 65698, 311459, 49317, 377008, 377010, 180409, 295099, 377025, 377033, 164043, 417996, 254157, 368849, 368850, 139478, 229591, 385240, 254171, 147679, 147680, 311520, 205034, 254189, 286957, 254193, 344312, 336121, 262403, 147716, 385291, 368908, 180494, 262419, 254228, 368915, 319764, 278805, 377116, 254250, 311596, 131374, 418095, 336177, 368949, 180534, 155968, 287040, 311622, 270663, 319816, 368969, 254285, 180559, 377168, 344402, 229716, 368982, 270703, 139641, 385407, 385409, 106893, 270733, 385423, 385433, 213402, 385437, 254373, 156069, 385448, 385449, 311723, 115116, 385463, 319931, 278974, 336319, 336323, 188870, 278988, 278992, 262619, 377309, 377310, 369121, 369124, 279014, 270823, 279017, 311787, 213486, 360945, 139766, 393719, 279030, 377337, 279033, 254459, 410108, 410109, 262657, 377346, 279042, 279053, 410126, 393745, 385554, 303635, 279060, 279061, 262673, 254487, 410138, 279066, 188957, 377374, 385569, 385578, 377388, 197166, 393775, 418352, 33339, 352831, 33344, 385603, 377419, 385612, 303693, 426575, 385620, 369236, 115287, 189016, 270938, 287327, 279143, 279150, 287345, 352885, 352886, 344697, 189054, 287359, 369285, 385669, 311944, 344714, 311950, 377487, 311953, 287379, 336531, 426646, 180886, 352921, 377499, 221853, 344737, 295591, 352938, 295598, 418479, 279215, 279218, 164532, 336565, 287418, 377531, 303802, 377534, 377536, 66243, 385737, 287434, 385745, 279249, 303826, 369365, 369366, 385751, 230105, 361178, 352989, 352990, 418529, 295649, 385763, 295653, 369383, 230120, 361194, 312046, 418550, 344829, 279293, 205566, 197377, 434956, 312076, 295698, 418579, 426772, 197398, 426777, 221980, 344864, 197412, 336678, 262952, 262957, 189229, 164655, 197424, 328495, 197428, 336693, 230198, 377656, 426809, 197433, 222017, 295745, 377669, 197451, 369488, 279379, 385878, 385880, 295769, 197467, 435038, 230238, 279393, 303973, 279398, 385895, 197479, 385901, 197489, 295799, 164730, 336765, 254851, 369541, 172936, 320394, 426894, 189327, 377754, 140203, 172971, 377778, 304050, 189362, 189365, 377789, 189373, 345030, 345034, 279499, 418774, 386007, 386009, 418781, 386016, 123880, 418793, 320495, 435185, 222193, 271351, 214009, 312313, 435195, 312317, 328701, 386049, 328705, 418819, 410629, 377863, 189448, 230411, 320526, 361487, 435216, 386068, 254997, 336928, 336930, 410665, 345137, 361522, 312372, 238646, 238650, 320571, 386108, 410687, 336962, 238663, 377927, 361547, 205911, 156763, 361570, 230500, 214116, 214119, 402538, 279659, 173168, 230514, 238706, 279666, 312435, 377974, 66684, 377986, 279686, 402568, 222344, 140426, 337037, 386191, 410772, 222364, 418975, 124073, 402618, 148674, 402632, 148687, 402641, 189651, 419028, 279766, 189656, 304353, 279780, 222441, 279789, 386288, 66802, 271607, 386296, 369913, 419066, 369912, 386300, 279803, 386304, 320769, 369929, 419097, 320795, 115997, 222496, 320802, 304422, 369964, 353581, 116014, 66863, 312628, 345397, 345398, 386363, 222523, 230730, 353611, 337228, 353612, 345418, 296269, 222542, 238928, 296274, 337226, 353617, 378201, 230757, 296304, 312688, 337280, 296328, 263561, 296330, 304523, 353672, 370066, 9618, 411028, 279955, 370072, 148899, 148900, 361928, 337359, 329168, 312785, 222674, 329170, 353751, 280025, 239069, 329181, 320997, 361958, 271850, 280042, 280043, 271853, 329198, 411119, 337391, 116209, 296434, 386551, 288252, 312830, 271880, 198155, 304655, 329231, 370200, 222754, 157219, 157220, 394793, 312879, 288305, 288319, 288322, 280131, 288328, 353875, 99937, 345697, 312937, 271980, 206447, 403057, 42616, 337533, 280193, 370307, 419462, 149127, 149128, 419464, 288391, 214667, 411275, 239251, 345753, 198304, 255651, 337590, 370359, 280252, 280253, 321217, 239305, 296649, 403149, 313042, 345813, 370390, 272087, 345817, 337638, 345832, 181992, 345835, 288492, 141037, 313082, 288508, 288515, 173828, 395018, 395019, 116491, 395026, 124691, 116502, 435993, 345882, 411417, 321308, 255781, 362281, 378666, 403248, 378673, 345910, 182070, 182071, 436029, 345918, 337734, 280396, 272207, 272208, 337746, 395092, 362326, 345942, 345950, 370526, 362336, 255844, 296807, 214894, 362351, 214896, 313200, 313204, 124795, 182145, 280451, 67464, 305032, 337816, 124826, 239515, 329627, 436130, 354210, 436135, 10153, 313257, 362411, 370604, 362418, 411587, 280517, 362442, 346066, 231382, 354268, 436189, 403421, 329696, 354273, 403425, 190437, 354279, 436199, 174058, 354283, 337899, 247787, 296942, 247786, 313322, 436209, 124912, 239610, 346117, 182277, 354311, 403463, 43016, 354310, 354312, 313356, 436235, 419857, 305173, 436248, 223269, 346153, 354346, 313388, 124974, 272432, 403507, 378933, 378934, 436283, 288835, 403524, 436293, 313415, 239689, 436304, 223317, 411738, 272477, 280676, 313446, 395373, 288878, 346237, 215165, 436372, 329884, 378186, 362658, 436388, 215204, 125108, 133313, 395458, 338118, 436429, 346319, 321744, 379102, 387299, 18661, 379110, 338151, 125166, 149743, 379120, 436466, 125170, 411892, 395511, 436471, 313595, 436480, 125184, 272644, 125192, 338187, 338188, 125197, 395536, 125200, 338196, 272661, 379157, 125204, 157973, 125215, 125216, 338217, 125225, 321839, 125236, 362809, 379193, 395591, 289109, 272730, 436570, 215395, 239973, 280938, 321901, 354671, 362864, 354672, 272755, 354678, 199030, 223611, 248188, 313726, 436609, 240003, 395653, 436613, 395660, 264591, 272784, 420241, 240020, 190870, 190872, 289185, 436644, 289195, 272815, 436659, 338359, 436677, 289229, 281038, 281039, 256476, 420326, 166403, 322057, 420374, 322077, 289328, 330291, 322119, 191065, 436831, 117350, 420461, 313970, 346739, 346741, 420473, 297600, 166533, 346771, 363155, 264855, 363161, 289435, 436897, 248494, 166581, 355006, 363212, 363228, 436957, 322269, 436960, 264929, 338658, 289511, 330473, 346859, 330476, 289517, 215790, 199415, 289534, 322302, 35584, 133889, 322312, 346889, 264971, 322320, 166677, 207639, 363295, 355117, 191285, 355129, 273209, 273211, 355136, 355138, 420680, 355147, 355148, 355153, 281426, 387927, 363353, 363354, 281434, 322396, 420702, 363361, 363362, 412516, 355173, 355174, 281444, 207724, 355182, 207728, 420722, 314240, 158594, 330627, 240517, 265094, 387977, 396171, 355216, 224146, 224149, 256918, 256919, 256920, 240543, 256934, 273336, 289720, 289723, 273341, 330688, 379845, 363462, 19398, 273353, 191445, 207839, 347104, 314343, 134124, 412653, 257007, 248815, 347122, 183291, 437245, 257023, 125953, 396292, 330759, 347150, 330766, 412692, 330789, 248871, 281647, 412725, 257093, 404550, 314437, 207954, 339031, 257126, 404582, 265318, 322664, 396395, 265323, 404589, 273523, 363643, 248960, 150656, 363658, 404622, 224400, 265366, 347286, 429209, 339101, 429216, 339106, 265381, 380069, 3243, 208044, 322733, 421050, 339131, 265410, 183492, 273616, 421081, 339167, 298209, 421102, 363769, 52473, 208123, 52476, 412926, 437504, 322826, 388369, 380178, 429332, 126229, 412963, 257323, 437550, 273713, 298290, 208179, 159033, 347451, 216387, 372039, 257353, 257354, 109899, 437585, 331091, 150868, 314708, 372064, 429410, 437602, 281958, 388458, 265579, 306541, 314734, 314740, 314742, 421240, 314745, 224637, 388488, 298378, 306580, 282008, 396697, 314776, 282013, 290206, 396709, 298406, 241067, 380331, 314797, 380335, 355761, 421302, 134586, 380348, 380350, 216511, 216510, 306630, 200136, 273865, 306634, 339403, 372172, 413138, 437726, 429540, 3557, 3559, 191980, 282097, 191991, 265720, 216575, 290304, 372226, 437766, 323083, 208397, 323088, 413202, 388630, 413206, 175640, 216610, 372261, 347693, 323120, 396850, 200245, 323126, 290359, 134715, 323132, 421437, 396865, 282182, 413255, 265800, 273992, 421452, 265809, 396885, 290391, 265816, 396889, 306777, 388699, 396896, 323171, 388712, 388713, 314997, 290425, 339579, 396927, 282248, 224907, 396942, 405140, 274071, 323226, 208547, 208548, 405157, 388775, 282279, 364202, 421556, 224951, 224952, 306875, 282302, 323262, 323265, 241360, 241366, 224985, 282330, 159462, 372458, 397040, 12017, 323315, 274170, 200444, 175874, 249606, 323335, 282379, 216844, 372497, 397076, 421657, 339746, 216868, 257831, 167720, 241447, 421680, 282418, 421686, 274234, 241471, 339782, 315209, 159563, 241494, 339799, 307038, 274276, 282471, 274288, 372592, 274296, 339840, 315265, 372625, 282517, 298912, 118693, 438186, 126896, 151492, 380874, 372699, 323554, 380910, 380922, 380923, 274432, 372736, 241695, 315431, 430120, 102441, 315433, 430127, 405552, 282671, 241717, 249912, 225347, 307269, 421958, 233548, 176209, 381013, 53334, 315477, 356446, 323678, 438374, 176231, 438378, 233578, 217194, 422000, 249976, 266361, 422020, 381061, 168070, 168069, 381071, 241809, 323730, 430231, 200856, 422044, 192670, 192671, 299166, 258213, 299176, 323761, 184498, 266427, 356550, 299208, 372943, 266447, 258263, 356575, 307431, 438512, 372979, 389364, 381173, 135416, 356603, 184574, 266504, 217352, 61720, 381210, 315674, 282908, 389406, 282912, 233761, 438575, 315698, 266547, 397620, 332084, 438583, 127292, 438592, 332100, 323914, 201037, 397650, 348499, 250196, 348501, 389465, 332128, 110955, 242027, 242028, 160111, 250227, 315768, 291193, 438653, 291200, 266628, 340356, 242059, 225684, 373141, 373144, 291225, 389534, 397732, 373196, 176602, 242138, 184799, 291297, 201195, 324098, 233987, 340489, 397841, 283154, 258584, 397855, 291359, 348709, 348710, 397872, 283185, 234037, 340539, 266812, 438850, 348741, 381515, 348748, 430681, 332379, 242274, 184938, 373357, 184942, 176751, 389744, 356983, 356984, 209529, 356990, 291455, 422529, 373377, 152196, 201348, 356998, 348807, 356999, 316044, 316050, 275102, 176805, 340645, 422567, 176810, 160441, 422591, 291529, 225996, 135888, 242385, 398039, 234216, 373485, 373486, 21239, 275193, 348921, 234233, 242428, 299777, 430853, 430860, 62222, 430880, 234276, 234290, 152372, 160569, 430909, 160576, 348999, 283466, 439118, 234330, 275294, 381791, 127840, 357219, 439145, 177002, 308075, 242540, 242542, 381811, 201590, 177018, 398205, 340865, 291713, 349066, 316299, 349068, 234382, 308111, 381840, 308113, 390034, 373653, 430999, 209820, 381856, 185252, 398244, 422825, 381872, 177074, 398268, 349122, 398275, 373705, 127945, 340960, 398305, 340967, 398313, 234476, 127990, 349176, 201721, 349179, 234499, 357380, 398370, 357413, 357420, 300087, 21567, 308288, 398405, 349254, 218187, 250955, 300109, 234578, 250965, 439391, 250982, 398444, 62574, 357487, 300147, 119925, 349304, 234626, 349315, 349317, 234635, 373902, 177297, 324761, 234655, 234662, 373937, 373939, 324790, 300215, 218301, 283841, 283846, 259275, 316628, 259285, 357594, 414956, 251124, 316661, 292092, 439550, 439563, 242955, 414989, 349458, 259346, 259347, 382243, 382246, 382257, 292145, 382264, 333115, 193853, 193858, 251212, 406862, 234830, 259408, 283990, 357720, 300378, 300379, 316764, 374110, 234864, 382329, 259449, 357758, 243073, 357763, 112019, 398740, 234902, 374189, 251314, 284086, 259513, 54719, 292291, 300490, 300526, 259569, 251379, 300539, 398844, 210429, 366081, 316951, 374297, 153115, 431646, 349727, 431662, 374327, 210489, 235069, 349764, 292424, 292426, 128589, 333389, 333394, 349780, 128600, 235096, 300643, 300645, 415334, 54895, 366198, 210558, 210559, 415360, 325246, 333438, 415369, 431754, 210569, 267916, 415376, 259741, 153252, 399014, 210601, 202413, 317102, 415419, 259780, 333508, 267978, 333522, 325345, 333543, 431861, 284410, 161539, 284425, 300812, 284430, 366358, 169751, 431901, 341791, 325411, 186148, 186149, 333609, 399148, 284460, 431918, 202541, 153392, 431935, 415555, 325444, 153416, 325449, 341837, 415566, 431955, 325460, 317268, 341846, 300893, 259937, 382820, 276326, 415592, 292713, 292719, 325491, 341878, 276343, 350072, 333687, 317305, 112510, 325508, 333700, 243590, 325514, 350091, 350092, 350102, 350108, 333727, 219046, 284584, 292783, 300983, 128955, 219102, 292835, 6116, 317416, 432114, 325620, 415740, 268286, 415744, 333827, 243720, 399372, 153618, 358418, 178215, 325675, 243763, 358455, 325695, 399433, 104534, 194667, 260206, 432241, 284789, 374913, 374914, 415883, 333968, 153752, 333990, 104633, 260285, 227517, 268479, 374984, 301270, 301271, 325857, 334049, 268515, 383208, 317676, 260337, 260338, 432373, 375040, 309504, 260355, 432387, 375052, 194832, 325904, 391448, 334104, 268570, 178459, 186660, 268581, 334121, 358698, 317738, 260396, 325930, 358707, 432435, 178485, 358710, 14654, 268609, 227655, 383309, 383327, 391521, 366948, 416101, 416103, 383338, 432503, 432511, 211327, 227721, 285074, 252309, 39323, 285083, 317851, 285089, 375211, 334259, 129461, 342454, 358844, 293309, 317889, 326083, 416201, 129484, 154061, 416206, 326093, 432608, 285152, 195044, 391654, 432616, 334315, 375281, 293368, 317949, 334345, 309770, 342537, 432650, 342549, 416288, 342560, 350758, 350759, 358951, 358952, 293420, 219694, 219695, 375345, 432694, 244279, 309831, 375369, 375373, 416334, 301647, 416340, 244311, 416353, 260705, 375396, 268901, 244326, 244345, 334473, 375438, 326288, 285348, 293552, 342705, 285362, 383668, 342714, 39616, 383708, 342757, 269036, 432883, 342775, 203511, 383740, 416509, 359166, 162559, 375552, 432894, 228099, 285443, 285450, 383755, 326413, 285467, 318247, 342827, 391980, 318251, 375610, 301883, 342846, 416577, 416591, 244569, 375644, 252766, 293729, 351078, 342888, 392057, 211835, 269179, 392065, 260995, 400262, 392071, 424842, 252812, 400271, 392080, 400282, 7070, 211871, 359332, 359333, 293801, 326571, 252848, 326580, 261045, 261046, 326586, 359365, 211913, 342990, 252878, 433104, 56270, 359380, 433112, 433116, 359391, 187372, 343020, 383980, 203758, 383994, 171009, 384004, 433166, 384015, 433173, 293911, 326684, 252959, 384031, 375848, 318515, 203829, 261191, 375902, 375903, 392288, 253028, 351343, 187505, 138354, 187508, 384120, 302202, 285819, 392317, 343166, 384127, 392320, 285823, 285833, 285834, 318602, 228492, 187539, 359574, 285850, 351389, 302239, 253098, 302251, 367791, 367792, 367798, 64699, 294075, 228541, 343230, 367809, 253124, 113863, 351445, 310496, 253168, 351475, 351489, 367897, 367898, 245018, 130342, 130344, 130347, 261426, 212282, 294210, 359747, 359748, 146760, 146763, 114022, 253288, 425327, 425331, 163190, 327030, 384379, 253316, 294278, 384391, 318860, 253339, 253340, 318876, 343457, 245160, 359860, 359861, 343480, 310714, 228796, 228804, 425417, 310731, 327122, 425434, 310747, 310758, 253431, 359931, 187900, 343552, 245249, 228868, 409095, 359949, 294413, 253456, 302613, 253462, 146976, 245290, 245291, 343606, 163385, 425534, 138817, 147011, 147020, 179800, 196184, 343646, 212574, 204386, 155238, 204394, 138862, 310896, 188021, 294517, 286351, 188049, 425624, 229021, 245413, 286387, 384693, 376502, 286392, 302778, 409277, 286400, 319176, 409289, 425682, 286419, 294621, 245471, 155360, 294629, 212721, 163575, 286457, 286463, 319232, 360194, 409355, 155408, 417556, 294699, 204600, 319289, 384826, 409404, 360253, 409416, 376661, 237397, 368471, 425820, 368486, 384871, 425832, 40809, 368489, 409446, 417648, 417658, 360315, 253828, 327556, 311183, 425875, 294806, 294808, 253851, 376733, 204702, 319393, 294820, 253868, 204722, 188349, 98240, 212947, 212953, 360416, 294887, 253930, 327666, 385011 ]
08d9c57bc4e7e163e61d552182037976a9a2a938
2530575a6d0ebffdb401d5db93bfb81eafef71c2
/pinit/Services/AuthenticationService.swift
f3f1ab81a7e8134760c92f8162a29ccc40959331
[ "MIT" ]
permissive
Janmajayamall/pinit
51802cf4fe7c00ea7a0c49da7d7460411823d73a
4e5326783a1132335e21c715d55f1697563f746f
refs/heads/master
2023-07-30T00:08:49.910099
2021-09-20T13:38:58
2021-09-20T13:38:58
287,886,408
0
0
null
null
null
null
UTF-8
Swift
false
false
8,570
swift
// // AuthenticationService.swift // pinit // // Created by Janmajaya Mall on 16/8/2020. // Copyright © 2020 Janmajaya Mall. All rights reserved. // import Foundation import FirebaseAuth import Firebase import FirebaseAnalytics import AuthenticationServices import CryptoKit import Combine import UIKit class AuthenticationService { private var handle: AuthStateDidChangeListenerHandle? private var user: User? init(){} func registerStateListener(){ self.stopStateListener() self.handle = Auth.auth().addStateDidChangeListener({(auth, user) in self.user = user self.postNotification(for: .authenticationServiceDidAuthStatusChange, withObject: user) }) } func signOut(){ do { try Auth.auth().signOut() }catch { print("Error trying to sign out: \(error.localizedDescription)") } } func stopStateListener(){ if let handle = self.handle { Auth.auth().removeStateDidChangeListener(handle) } } func startService(){ // self.registerStateListener() } func stopService(){ self.stopStateListener() } func setupService() { self.registerStateListener() } func postNotification(for notificationType: Notification.Name, withObject object: User?){ NotificationCenter.default.post(name: notificationType, object: object) } } class SignInWithAppleCoordinator: NSObject { private weak var window: UIWindow! private var onSignedInHandler: ((User) -> Void)? private var currentNonce: String? init(window: UIWindow?) { self.window = window } private func appleIDRequest(withState: SignInState) -> ASAuthorizationAppleIDRequest { let appleIDProvider = ASAuthorizationAppleIDProvider() let request = appleIDProvider.createRequest() request.requestedScopes = [.fullName, .email] request.state = withState.rawValue let nonce = randomNonceString() self.currentNonce = nonce request.nonce = sha256(nonce) return request } func signIn(onSignedInHandler: @escaping (User) -> Void) { self.onSignedInHandler = onSignedInHandler let request = self.appleIDRequest(withState: .signIn) let authorizationController = ASAuthorizationController(authorizationRequests: [request]) authorizationController.delegate = self authorizationController.presentationContextProvider = self authorizationController.performRequests() } } extension SignInWithAppleCoordinator: ASAuthorizationControllerDelegate { func authorizationController(controller: ASAuthorizationController, didCompleteWithAuthorization authorization: ASAuthorization) { if let appleIDCredential = authorization.credential as? ASAuthorizationAppleIDCredential { guard let nonce = self.currentNonce else { fatalError("Invalid state: A login callback was received, but no login request was sent.") } guard let appleIDToken = appleIDCredential.identityToken else { print("Unable to fetch identity token") return } guard let idTokenString = String(data: appleIDToken, encoding: .utf8) else { print("Unable to serialise token string from data: \(appleIDToken.debugDescription)") return } guard let stateRaw = appleIDCredential.state, let state = SignInState(rawValue: stateRaw) else { print("Invalid state: request must be started with one of the SignInStates") return } let credential = OAuthProvider.credential(withProviderID: "apple.com", idToken: idTokenString, rawNonce: nonce) switch state { case .signIn: Auth.auth().signIn(with: credential, completion: {(result, error) in if let error = error { print("Error authenticating: \(error.localizedDescription)") return } // create an event AnalyticsService.logSignUpEvent(withProvider: .apple) guard let user = result?.user else {return} if let onSignedInHandler = self.onSignedInHandler { onSignedInHandler(user) } }) default: break } } } func authorizationController(controller: ASAuthorizationController, didCompleteWithError error: Error) { print("Sign in with Apple error: \(error.localizedDescription)") } } extension SignInWithAppleCoordinator: ASAuthorizationControllerPresentationContextProviding { func presentationAnchor(for controller: ASAuthorizationController) -> ASPresentationAnchor { return self.window } } // Adapted from https://auth0.com/docs/api-auth/tutorials/nonce#generate-a-cryptographically-random-nonce private func randomNonceString(length: Int = 32) -> String { precondition(length > 0) let charset: Array<Character> = Array("0123456789ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvwxyz-._") var result = "" var remainingLength = length while remainingLength > 0 { let randoms: [UInt8] = (0 ..< 16).map { _ in var random: UInt8 = 0 let errorCode = SecRandomCopyBytes(kSecRandomDefault, 1, &random) if errorCode != errSecSuccess { fatalError("Unable to generate nonce. SecRandomCopyBytes failed with OSStatus \(errorCode)") } return random } randoms.forEach { random in if remainingLength == 0 { return } if random < charset.count { result.append(charset[Int(random)]) remainingLength -= 1 } } } return result } @available(iOS 13, *) private func sha256(_ input: String) -> String { let inputData = Data(input.utf8) let hashedData = SHA256.hash(data: inputData) let hashString = hashedData.compactMap { return String(format: "%02x", $0) }.joined() return hashString } class SignInWithEmailCoordinator { var emailId: String var password: String var onSignedInHandler: ((User) -> Void)? init(emailId: String, password:String){ self.emailId = emailId self.password = password } func login(onSignedInHandler: @escaping (User) -> Void, onErrorHandler: @escaping (AuthErrorCode) -> Void) { self.onSignedInHandler = onSignedInHandler Auth.auth().signIn(withEmail: self.emailId, password: self.password) { (result, error) in if let error = error { print("Sign In with email & password failed with error: \(error._code)") // default error code is 17009 (i.e. when password is wrong) onErrorHandler(AuthErrorCode(rawValue: error._code) ?? AuthErrorCode(rawValue: 17009)!) } guard let user = result?.user else {return} if let onSignedInHandler = self.onSignedInHandler { onSignedInHandler(user) } } } func signUp(onSignedInHandler: @escaping (User) -> Void, onErrorHandler: @escaping (AuthErrorCode) -> Void) { self.onSignedInHandler = onSignedInHandler Auth.auth().createUser(withEmail: self.emailId, password: self.password) { (result, error) in if let error = error { print("Create user with email & password failed with error: \(error.localizedDescription)") // default error coe is 17020 (i.e. network error) onErrorHandler(AuthErrorCode(rawValue: error._code) ?? AuthErrorCode(rawValue: 17020)!) return } guard let user = result?.user else {return} if let onSignedInHandler = self.onSignedInHandler { onSignedInHandler(user) } } } } enum SignInState: String { case signIn case reauth }
[ -1 ]
7ff540d918b9ff57af3517946248059393ef3cdc
9d27c0608504035a0553df6438adffc6ae2e17ca
/Youlv/Controllers/Discovery/GroupTopicsTableViewController.swift
bf2dd6c5ad691767abbccbb2d2c431ca163d1a1a
[]
no_license
lostwater/youlv-iOS
06defcae799d0b849f7ab28fc75f6bb525459603
e501f3fe90121b0f4f388983cc3f04d50a836e72
HEAD
2016-08-09T22:43:01.318843
2016-03-24T16:30:58
2016-03-24T16:30:58
54,657,249
0
0
null
null
null
null
UTF-8
Swift
false
false
4,493
swift
// // GroupTopicsTableViewController.swift // Youlv // // Created by Lost on 14/05/2015. // Copyright (c) 2015 Ramy. All rights reserved. // import UIKit class GroupTopicsTableViewController: BaseTableViewController { @IBOutlet weak var topicImageView: UIImageView! @IBOutlet weak var userImageView: UIImageView! @IBOutlet weak var fansCount: UILabel! @IBOutlet weak var readCount: UILabel! @IBOutlet weak var repliedCount: UILabel! @IBOutlet weak var markButton: NSLayoutConstraint! @IBOutlet weak var groupTitle: UILabel! @IBOutlet weak var newReplyButton: UIButton! @IBOutlet weak var buttonFollow: UIButton! @IBAction func buttonFollowClicked(sender: AnyObject) { let groupId = groupDict.objectForKey("topictype_id") as! Int httpClient.topicGroupUp(groupId) { (dict, error) -> () in self.buttonFollow.selected = !self.buttonFollow.selected } } @IBAction func unwindToGroupTopics(segue: UIStoryboardSegue) { //performSegueWithIdentifier("UnwindToGroupTopics", sender: self) } var groupDict : NSDictionary! override func viewDidLoad() { } override func httpGet() { let groupId = groupDict.objectForKey("topictype_id") as! Int super.httpGet() httpClient.getTopicEventList(groupId) {(dict, error) -> () in self.httpGetCompleted(dict, error: error) } } override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { if segue.destinationViewController.isKindOfClass(DiscussDetailViewController) { let discussDetail = segue.destinationViewController as! DiscussDetailViewController discussDetail.topicId = (tableView.cellForRowAtIndexPath(tableView.indexPathForSelectedRow!) as! TopicEventCell).topicId } } override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let content = dataArray.objectAtIndex(indexPath.row) as! NSDictionary var cell : TopicEventCell? if content.objectForKey("type") as! Int == 0 { cell = tableView.dequeueReusableCellWithIdentifier("TopicCell", forIndexPath: indexPath) as? TopicEventCell } //if content.objectForKey("operate_type") as! Int == 1 else { cell = tableView.dequeueReusableCellWithIdentifier("TopicRefCell", forIndexPath: indexPath) as? TopicEventCell } cell?.configure(content) cell?.setNeedsLayout() cell?.setNeedsDisplay() cell?.layoutIfNeeded() return cell! } override func viewDidAppear(animated: Bool) { super.viewDidAppear(animated) self.navigationController?.navigationBar.barTintColor = UIColor.clearColor() self.navigationController?.navigationBar.translucent = true navigationController?.navigationBar.setBackgroundImage(UIImage(named:"bgTransNavi"), forBarMetrics: UIBarMetrics.Default) super.viewDidLoad() userImageView.sd_setImageWithURL(NSURL(string : groupDict.objectForKey("topictype_avatar_img") as! String)!, placeholderImage:defualtPic) topicImageView.sd_setImageWithURL(NSURL(string : groupDict.objectForKey("topictype_background_img") as! String)!, placeholderImage:defualtPic) fansCount.text = String(groupDict.objectForKey("follow_num") as! Int) readCount.text = String(groupDict.objectForKey("read_num") as! Int) repliedCount.text = String(groupDict.objectForKey("topic_num") as! Int) groupTitle.text = groupDict.objectForKey("title") as? String buttonFollow.selected = groupDict.objectForKey("follow_or_not") as! Bool //let view = self.tableView.headerViewForSection(0) //view!.frame = CGRectMake(0,-44,view!.frame.size.width,view!.frame.size.height) } override func viewWillDisappear(animated: Bool) { super.viewWillDisappear(animated) self.navigationController?.navigationBar.barTintColor = appBlueColor self.navigationController?.navigationBar.translucent = false navigationController?.navigationBar.setBackgroundImage(UIImage(named:"alpha0"), forBarMetrics: UIBarMetrics.Default) } }
[ -1 ]
1760bc168a7d23d10c9562fd1f4658c56624fa32
e817cba6b4e464b96f2329a37835213e1d5b9298
/WordPlayTWO/AppDelegate.swift
4c836a19da394fe67a2c44e36702c34ae1347ddf
[]
no_license
eswiderski7355/WordPlayTwo
a5917c08cfeddebd4050a845ae3bfafd4d2f770a
57a8c5e58fe1d2639a08cda089ad48033cebebdf
refs/heads/master
2021-01-01T20:41:25.591765
2014-12-15T15:48:30
2014-12-15T15:48:30
29,688,323
0
0
null
null
null
null
UTF-8
Swift
false
false
2,171
swift
// // AppDelegate.swift // WordPlayTWO // // Created by mobileapps on 12/15/14. // Copyright (c) 2014 mobileapps. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(application: UIApplication!, didFinishLaunchingWithOptions launchOptions: NSDictionary!) -> Bool { // Override point for customization after application launch. return true } func applicationWillResignActive(application: UIApplication!) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. } func applicationDidEnterBackground(application: UIApplication!) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } func applicationWillEnterForeground(application: UIApplication!) { // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. } func applicationDidBecomeActive(application: UIApplication!) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } func applicationWillTerminate(application: UIApplication!) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } }
[ 229380, 229383, 229385, 278539, 229388, 294924, 278542, 229391, 327695, 278545, 229394, 278548, 229397, 229399, 229402, 278556, 229405, 352284, 278559, 278564, 229415, 229417, 327722, 237613, 360496, 229426, 237618, 229428, 286774, 229432, 286776, 286778, 319544, 204856, 286791, 237640, 278605, 286797, 311375, 163920, 196692, 319573, 311383, 278623, 278626, 319590, 311400, 278635, 303212, 278639, 278648, 131192, 237693, 327814, 131209, 417930, 303241, 311436, 303244, 319633, 286873, 286876, 311460, 311469, 32944, 327862, 286906, 327866, 180413, 286910, 286916, 286922, 286924, 286926, 286928, 131281, 278743, 278747, 295133, 155872, 319716, 278760, 237807, 303345, 286962, 229622, 327930, 278781, 278783, 278785, 237826, 278792, 286987, 319757, 311569, 286999, 319770, 287003, 287006, 287009, 287012, 287014, 287016, 287019, 311598, 287023, 262448, 311601, 155966, 278849, 319809, 319810, 319814, 311623, 319818, 311628, 287054, 319822, 278865, 229717, 196963, 196969, 139638, 213367, 106872, 319872, 311683, 319879, 311693, 65943, 319898, 311719, 278952, 139689, 278957, 311728, 278967, 180668, 311741, 278975, 319938, 278980, 278983, 319945, 278986, 278990, 278994, 311767, 279003, 279006, 188895, 279010, 287202, 279015, 172520, 279020, 279023, 311791, 172529, 279027, 319989, 164343, 180727, 279035, 311804, 287230, 279040, 303617, 287234, 279045, 287238, 172550, 172552, 303623, 320007, 279051, 172558, 279055, 303632, 279058, 303637, 279063, 279067, 172572, 279072, 172577, 295459, 172581, 295461, 279082, 279084, 172591, 172598, 279095, 172607, 172609, 172612, 377413, 172614, 172618, 303690, 33357, 279124, 172634, 262752, 172644, 311911, 189034, 295533, 189039, 189040, 172655, 172656, 295538, 189044, 172660, 287349, 352880, 287355, 287360, 295553, 287365, 311942, 303751, 295557, 352905, 279178, 287371, 311946, 311951, 287377, 172691, 287381, 311957, 221850, 287386, 164509, 287390, 295583, 303773, 172702, 287394, 230045, 303780, 172705, 287398, 172707, 287400, 279208, 172714, 295595, 279212, 189102, 172721, 287409, 66227, 303797, 189114, 287419, 328381, 279231, 287423, 328384, 287427, 107208, 107212, 172748, 287436, 287440, 295633, 172755, 303827, 279255, 279258, 303835, 213724, 189149, 303838, 287450, 279267, 295654, 279272, 230128, 312048, 312050, 230131, 205564, 303871, 230146, 328453, 295685, 230154, 33548, 312077, 295695, 295701, 369433, 230169, 295707, 328476, 295710, 230175, 303914, 279340, 279353, 230202, 312124, 222018, 295755, 377676, 148302, 287569, 303959, 230237, 279390, 230241, 279394, 303976, 336744, 303985, 328563, 303987, 303991, 303997, 295806, 295808, 304005, 320391, 213895, 304007, 304009, 304011, 304013, 213902, 279438, 295822, 189329, 295825, 304019, 279445, 58262, 279452, 279461, 279462, 304042, 213931, 230327, 304055, 287675, 304063, 238528, 304065, 189378, 213954, 156612, 312272, 304084, 304090, 320481, 304106, 320490, 312302, 328687, 320496, 304114, 295928, 320505, 295945, 197645, 295949, 230413, 320528, 140312, 295961, 238620, 304164, 189479, 304170, 238641, 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, 312518, 230600, 230607, 148690, 320727, 279769, 304348, 279777, 304354, 296163, 320740, 279781, 304360, 279788, 320748, 279790, 304370, 296189, 320771, 312585, 296202, 296205, 230674, 320786, 230677, 296213, 296215, 320792, 230681, 230679, 214294, 304416, 230689, 173350, 312622, 296243, 312630, 222522, 222525, 296253, 312639, 296255, 296259, 378181, 230727, 238919, 320840, 296264, 296267, 296271, 222545, 230739, 312663, 337244, 222556, 230752, 312676, 230760, 173418, 410987, 230763, 230768, 296305, 312692, 230773, 279929, 181626, 304506, 304505, 181631, 312711, 312712, 296331, 288140, 230800, 288144, 337306, 288160, 173472, 288162, 288164, 279975, 304555, 370092, 279983, 288176, 279985, 312755, 296373, 279991, 312759, 288185, 337335, 222652, 312766, 173507, 296389, 222665, 230860, 280014, 312783, 288208, 230865, 288210, 370130, 288212, 280021, 288214, 222676, 239064, 288217, 288218, 280027, 288220, 329177, 239070, 288224, 288226, 370146, 280036, 288229, 280038, 288230, 288232, 280034, 288234, 288236, 288238, 288240, 291754, 288242, 296435, 288244, 288250, 402942, 148990, 296446, 206336, 296450, 230916, 230919, 370187, 304651, 304653, 230940, 222752, 108066, 296486, 296488, 157229, 230961, 288320, 288325, 124489, 280140, 280145, 288338, 280149, 280152, 288344, 239194, 280158, 403039, 370272, 312938, 280183, 280185, 280188, 280191, 280194, 116354, 280208, 280211, 288408, 280218, 280222, 321195, 296622, 321200, 337585, 296626, 296634, 296637, 313027, 280260, 280264, 206536, 206539, 206541, 206543, 280276, 321239, 280283, 313052, 288478, 313055, 321252, 313066, 280302, 288494, 419570, 321266, 288499, 288502, 280314, 288510, 124671, 67330, 280324, 198405, 288519, 280331, 198416, 296723, 116503, 321304, 329498, 296731, 321311, 313121, 313123, 304932, 321316, 280363, 141101, 165678, 280375, 321336, 288576, 345921, 280388, 304968, 280393, 280402, 313176, 42842, 280419, 321381, 296812, 313201, 1920, 255873, 305028, 280454, 247688, 280464, 124817, 280468, 239510, 280473, 124827, 247709, 214944, 313258, 321458, 296883, 124853, 10170, 296890, 288700, 296894, 280515, 190403, 296900, 337862, 165831, 280521, 231379, 296921, 239586, 313320, 231404, 124913, 165876, 321528, 239612, 313340, 288764, 239617, 313347, 288773, 313358, 321560, 305176, 313371, 354338, 305191, 223273, 313386, 354348, 124978, 124980, 288824, 288826, 321595, 378941, 313406, 288831, 288836, 67654, 280651, 354382, 288848, 280658, 215123, 354390, 288855, 288859, 280669, 313438, 280671, 223327, 149599, 321634, 149601, 149603, 280681, 313451, 223341, 280687, 313458, 280691, 313464, 329850, 321659, 280702, 288895, 321670, 215175, 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, 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, 338532, 281190, 199273, 281196, 158317, 313973, 281210, 297594, 158347, 133776, 314003, 117398, 314007, 289436, 174754, 330404, 289448, 133801, 314029, 314033, 240309, 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, 207737, 183172, 240519, 322440, 338823, 314249, 183184, 289687, 240535, 297883, 289694, 289696, 289700, 289712, 281529, 289724, 52163, 183260, 281567, 289762, 322534, 297961, 281581, 183277, 322550, 134142, 175134, 322599, 322610, 314421, 281654, 314427, 207937, 314433, 207949, 322642, 314456, 281691, 314461, 281702, 281704, 281708, 281711, 289912, 248995, 306341, 306347, 306354, 142531, 199877, 289991, 306377, 289997, 363742, 363745, 298216, 330988, 216303, 322801, 388350, 363802, 199976, 199978, 314671, 298292, 298294, 216376, 298306, 380226, 281923, 224584, 224587, 224594, 216404, 306517, 150870, 314714, 224603, 159068, 314718, 314723, 281960, 150890, 306539, 314732, 314736, 290161, 216436, 306549, 298358, 314743, 306552, 290171, 314747, 306555, 290174, 224641, 281987, 298372, 314756, 281990, 224647, 298377, 314763, 224657, 306581, 314779, 314785, 282025, 314793, 282027, 241068, 241070, 241072, 282034, 150966, 298424, 306618, 282044, 323015, 306635, 306640, 290263, 290270, 290275, 339431, 282089, 191985, 282098, 282101, 241142, 191992, 290298, 151036, 290302, 282111, 290305, 175621, 192008, 323084, 282127, 290321, 282130, 282133, 290325, 241175, 290328, 290332, 241181, 282142, 282144, 290344, 306731, 290349, 290351, 290356, 282186, 224849, 282195, 282201, 306778, 159324, 159330, 314979, 298598, 323176, 224875, 241260, 257658, 315016, 282249, 290445, 324757, 282261, 298651, 282269, 323229, 298655, 323231, 61092, 282277, 282295, 282300, 323260, 323266, 282310, 323273, 282319, 306897, 241362, 282328, 298714, 52959, 216801, 282337, 241380, 216806, 323304, 282345, 12011, 282356, 323318, 282364, 282367, 306945, 241412, 323333, 282376, 216842, 323345, 282388, 282392, 184090, 315167, 315169, 282402, 315174, 323367, 241448, 315176, 282410, 241450, 306988, 306991, 315184, 315190, 241464, 282425, 159545, 298811, 307009, 413506, 307012, 315211, 307027, 315221, 282454, 315223, 241496, 241498, 307035, 307040, 282465, 241509, 110438, 298860, 110445, 282478, 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, 241581, 241583, 323504, 241586, 282547, 241588, 290739, 241590, 241592, 241598, 290751, 241600, 241605, 151495, 241610, 298975, 241632, 298984, 241643, 298988, 241646, 241649, 241652, 323574, 290807, 241661, 299006, 282623, 315396, 241669, 315397, 282632, 282639, 282645, 241693, 282654, 241701, 102438, 217127, 282669, 323630, 282681, 290877, 282687, 159811, 315463, 315466, 192589, 307278, 307287, 315482, 217179, 315483, 192605, 200801, 299105, 217188, 299109, 307303, 315495, 356457, 45163, 307307, 315502, 192624, 307314, 323700, 299126, 233591, 307329, 307338, 233613, 241813, 307352, 299164, 184479, 299167, 184481, 184486, 307370, 307372, 307374, 307376, 323763, 176311, 299191, 307385, 307386, 258235, 176316, 307388, 307390, 184503, 299200, 307394, 307396, 184518, 307399, 323784, 307409, 307411, 176343, 299225, 233701, 307432, 282881, 282893, 291089, 282906, 291104, 233766, 307508, 315701, 307510, 332086, 151864, 307512, 307515, 282942, 307518, 151874, 282947, 282957, 323917, 110926, 233808, 323921, 315733, 323926, 233815, 315739, 299357, 242018, 242024, 299373, 315757, 250231, 242043, 315771, 299391, 291202, 299398, 242057, 291212, 299405, 291222, 283033, 291226, 242075, 315801, 291231, 283042, 291238, 291241, 127403, 127405, 291247, 127407, 299440, 299444, 127413, 283062, 291254, 127417, 291260, 283069, 127421, 127424, 299457, 127431, 283080, 176592, 315856, 315860, 176597, 283095, 127447, 299481, 176605, 242143, 291299, 127463, 242152, 291305, 127466, 176620, 127474, 291314, 291317, 135672, 233979, 291323, 291330, 283142, 127497, 233994, 135689, 233998, 234003, 234006, 152087, 127511, 283161, 242202, 234010, 135707, 242206, 135710, 242208, 291361, 291378, 234038, 152118, 234041, 70213, 242250, 111193, 242275, 299620, 242279, 168562, 184952, 135805, 291456, 135808, 373383, 135820, 316051, 225941, 316054, 299672, 135834, 373404, 299677, 135839, 299680, 225954, 299684, 242343, 209576, 242345, 373421, 135870, 135873, 135876, 135879, 299720, 299723, 225998, 299726, 226002, 226005, 119509, 226008, 201444, 299750, 283368, 234219, 283372, 226037, 283382, 234231, 316151, 234236, 226045, 234239, 242431, 209665, 234242, 299778, 242436, 226053, 234246, 226056, 234248, 291593, 242443, 234252, 242445, 234254, 291601, 234258, 242450, 242452, 234261, 348950, 201496, 234264, 234266, 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, 291711, 234368, 234370, 201603, 234373, 226182, 234375, 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, 193486, 275406, 193488, 234446, 234449, 316370, 234452, 234455, 234459, 234461, 234467, 234470, 168935, 5096, 324585, 234475, 234478, 316400, 234481, 316403, 234484, 234485, 324599, 234487, 234490, 234493, 234496, 316416, 234501, 275462, 308231, 234504, 234507, 234510, 234515, 300054, 234519, 316439, 234520, 234523, 234526, 234528, 300066, 234532, 300069, 234535, 234537, 234540, 144430, 234543, 234546, 275508, 234549, 300085, 300088, 234553, 234556, 234558, 316479, 234561, 316483, 234563, 308291, 234568, 234570, 316491, 300108, 234572, 234574, 300115, 234580, 234581, 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, 300289, 292097, 300292, 300294, 275719, 300299, 177419, 283917, 300301, 242957, 177424, 275725, 349464, 283939, 259367, 283951, 292143, 300344, 283963, 243003, 226628, 283973, 300357, 283983, 316758, 357722, 316766, 292192, 316768, 218464, 292197, 316774, 284010, 136562, 324978, 275834, 275836, 275840, 316803, 316806, 316811, 316814, 226703, 300433, 234899, 226709, 357783, 316824, 316826, 144796, 300448, 144807, 144810, 284076, 144812, 144814, 144820, 284084, 284087, 292279, 144826, 144828, 144830, 144832, 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, 284191, 284194, 284196, 235045, 284199, 284204, 284206, 284209, 284211, 284213, 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, 284258, 292452, 292454, 284263, 284265, 292458, 284267, 292461, 284272, 284274, 276086, 284278, 292470, 292473, 284283, 276093, 284286, 276095, 284288, 292481, 276098, 284290, 325250, 284292, 292479, 292485, 284297, 317066, 284299, 317068, 276109, 284301, 284303, 276114, 284306, 284308, 284312, 284314, 284316, 276127, 284320, 284322, 284327, 276137, 284329, 284331, 317098, 284333, 284335, 276144, 284337, 284339, 300726, 284343, 284346, 284350, 276160, 358080, 284354, 358083, 276166, 284358, 358089, 276170, 284362, 276175, 284368, 276177, 284370, 317138, 284372, 358098, 284377, 276187, 284379, 284381, 284384, 284386, 358114, 358116, 276197, 317158, 358119, 284392, 325353, 284394, 358122, 284397, 276206, 284399, 358126, 358128, 358133, 358135, 276216, 358140, 284413, 358142, 284418, 358146, 317187, 317189, 317191, 284428, 300816, 300819, 317207, 284440, 186139, 300828, 300830, 276255, 325408, 284449, 300834, 300832, 227109, 317221, 358183, 276268, 300845, 194351, 243504, 300850, 284469, 276280, 325436, 276291, 366406, 276295, 153417, 276308, 284502, 317271, 276315, 292700, 284511, 227175, 292715, 300912, 284529, 292721, 300915, 292729, 317306, 284540, 292734, 325512, 276365, 284564, 358292, 284566, 350106, 284572, 276386, 284579, 276388, 358312, 284585, 317353, 276395, 292784, 358326, 161718, 276410, 276411, 358330, 276418, 301009, 301011, 301013, 292823, 301015, 301017, 358360, 292828, 276446, 153568, 276448, 276452, 276455, 292839, 292843, 276460, 276464, 178161, 276466, 227314, 276472, 317435, 276476, 276479, 276482, 276485, 317446, 276490, 292876, 276496, 317456, 317458, 243733, 243740, 317468, 317472, 325666, 243751, 292904, 276528, 243762, 309298, 325685, 325689, 276539, 235579, 235581, 325692, 178238, 276544, 284739, 292934, 276553, 243785, 350293, 350295, 194649, 227418, 309337, 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, 350375, 350379, 350381, 350383, 129200, 350385, 350387, 350389, 350395, 350397, 350399, 227520, 350402, 227522, 301252, 350406, 227529, 309450, 301258, 276685, 276689, 309462, 301272, 309468, 309471, 301283, 317672, 276713, 317674, 325867, 227571, 309491, 309494, 243960, 227583, 276735, 227587, 276739, 276742, 227593, 227596, 325910, 309530, 342298, 276766, 211232, 317729, 276775, 325937, 325943, 211260, 260421, 276809, 285002, 276811, 235853, 235858, 276829, 276833, 391523, 276836, 276843, 293227, 276848, 293232, 186744, 211324, 227709, 285061, 317833, 178572, 285070, 178575, 285077, 227738, 317853, 276896, 317858, 342434, 285093, 317864, 285098, 276907, 235955, 276917, 293304, 293307, 293314, 309707, 317910, 293336, 235996, 317917, 293343, 358880, 276961, 227810, 293346, 276964, 293352, 236013, 293364, 301562, 317951, 309764, 301575, 121352, 236043, 342541, 113167, 277011, 317971, 309781, 309779, 227877, 227879, 293417, 227882, 309804, 293421, 105007, 236082, 285236, 277054, 129603, 318020, 301636, 301639, 301643, 277071, 285265, 399955, 309844, 277080, 309849, 285277, 285282, 326244, 318055, 277100, 277106, 121458, 170619, 309885, 309888, 277122, 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, 277187, 277191, 277194, 277196, 277201, 137946, 113378, 228069, 277223, 342760, 285417, 56043, 277232, 228081, 56059, 310015, 285441, 310020, 285448, 310029, 228113, 285459, 277273, 293659, 326430, 228128, 293666, 285474, 228135, 318248, 277291, 293677, 318253, 285489, 293685, 285494, 301880, 301884, 310080, 293696, 277317, 277322, 277329, 301911, 301913, 277337, 301921, 400236, 236397, 162671, 310134, 277368, 15224, 236408, 416639, 416640, 113538, 416648, 39817, 187274, 277385, 301972, 424853, 277405, 277411, 310179, 293798, 293802, 236460, 277426, 293811, 293820, 203715, 293849, 293861, 228327, 228328, 228330, 318442, 228332, 277486, 326638, 318450, 293876, 293877, 285686, 302073, 285690, 244731, 121850, 302075, 293882, 293887, 277504, 277507, 277511, 277519, 293908, 277526, 293917, 293939, 277561, 277564, 310336, 293956, 277573, 228422, 310344, 277577, 293960, 277583, 203857, 310355, 293971, 310359, 236632, 277594, 138332, 277598, 285792, 277601, 203872, 310374, 203879, 277608, 310376, 228460, 318573, 203886, 187509, 285815, 285817, 367737, 285821, 302205, 285824, 392326, 285831, 253064, 302218, 285835, 384148, 162964, 187542, 302231, 285849, 302233, 285852, 302237, 285854, 285856, 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, 228606, 204031, 64768, 310531, 285958, 228617, 138505, 318742, 204067, 277798, 130345, 113964, 285997, 285999, 113969, 318773, 318776, 286010, 417086, 286016, 294211, 302403, 384328, 294221, 326991, 294223, 179547, 146784, 302436, 294246, 327015, 310632, 327017, 351594, 351607, 310648, 310651, 310657, 351619, 294276, 310659, 327046, 253320, 310665, 318858, 310672, 351633, 310689, 130468, 228776, 277932, 310703, 310710, 130486, 310712, 310715, 302526, 228799, 64966, 245191, 163272, 302534, 310727, 292968, 302541, 302543, 310737, 286169, 228825, 163290, 310749, 310755, 187880, 286188, 310764, 310772, 40440, 212472, 40443, 286203, 228864, 40448, 286214, 228871, 302603, 65038, 302614, 286233, 302617, 302621, 146977, 187939, 294435, 286246, 294439, 286248, 278057, 294440, 294443, 40486, 294445, 40488, 310831, 40499, 40502, 212538, 40507, 40511, 228933, 40521, 286283, 40525, 40527, 228944, 212560, 400976, 147032, 40537, 40539, 278109, 40541, 40550, 286312, 286313, 40554, 40552, 310892, 40557, 294521, 343679, 278150, 310925, 286354, 278163, 122517, 278168, 327333, 229030, 278188, 278192, 319153, 278196, 302781, 319171, 302789, 294599, 278216, 294601, 302793, 343757, 212690, 278227, 229076, 286420, 319187, 286425, 319194, 278235, 229086, 278238, 286432, 294625, 294634, 302838, 319226, 286460, 171774, 278274, 302852, 278277, 302854, 294664, 311048, 352008, 319243, 311053, 302862, 319251, 294682, 278306, 188199, 294701, 278320, 319280, 319290, 229192, 302925, 188247, 237409, 294776, 294785, 327554, 40851, 294811, 319390, 294817, 319394, 40865, 311209, 180142, 294831, 188340, 40886, 294844, 294847, 393177, 294876, 294879, 294883, 311279, 278513, 237555, 278516, 311283, 278519, 237562 ]
1dfeb90980e6db8707445ed6e3a461e3ad239a68
27471b5e3199131f8f2f81fef79ef48e15b02764
/Content/iOS/设计模式/SwiftDesignPatten/SwiftDesignPatten/Observer/ObserverViewController.swift
84d0dc3a6bba5e14a918ed4ccfed7802958de13c
[]
no_license
jesusLove/Owenli_Blog
270baa54fd5a28e606d7094e8239586c1bfea8fa
f177c6312bfc43c90d62efabd70a4a3bfa986220
refs/heads/master
2022-03-01T06:58:18.034036
2022-02-10T23:35:15
2022-02-10T23:35:15
114,976,510
4
3
null
null
null
null
UTF-8
Swift
false
false
1,209
swift
// // ObserverViewController.swift // SwiftDesignPatten // // Created by lqq on 2018/12/12. // Copyright © 2018 LQQ. All rights reserved. // import UIKit class ObserverViewController: UIViewController, ObservedProtocol { @IBOutlet weak var topView: UIView! @IBOutlet weak var bottomView: UIView! // Mock 一些负责观察网络状况的实体对象。 var networkConnectionHandler1: NetworkConnectionHandler? var networkConnectionHandler2: NetworkConnectionHandler? let statusKey: StatusKey = StatusKey.networkStatusKey let notification: Notification.Name = .networkConnection override func viewDidLoad() { super.viewDidLoad() networkConnectionHandler1 = NetworkConnectionHandler(view: topView) networkConnectionHandler2 = NetworkConnectionHandler(view: bottomView) } // 模拟检测网络状态 // 连接和断开 @IBAction func switchChange(_ sender: UISwitch) { if sender.isOn { notifyObservers(about: NetworkConnectionStatus.connected.rawValue) } else { notifyObservers(about: NetworkConnectionStatus.disconnected.rawValue) } } }
[ -1 ]
62575347ca60bc0a8a6f98c211a910823532d8f0
fdb2ad21092b3dbf3a4b81881b25834c8af91d1e
/Cours iOS/MapView/MapView/MapAnnotation.swift
8eba807f3d0d88334bcdba302a23e63f43bf8b6f
[]
no_license
sviaty/Mobile-iOS-Swift
9fbf5d12f621c03570e39959d5d3e1f2fd01a4b5
950e8781b22c01f506f72c1d1bc5f6285cf0792a
refs/heads/master
2023-03-17T21:40:31.825882
2023-03-14T11:06:26
2023-03-14T11:06:26
189,054,019
0
0
null
null
null
null
UTF-8
Swift
false
false
559
swift
// // MapAnnotation.swift // MapView // // Created by Dufour Sviatoslav on 02/03/2023. // Copyright © 2023 Merge Light. All rights reserved. // import MapKit import CoreLocation class MapAnnotation: NSObject, MKAnnotation { var coordinate: CLLocationCoordinate2D var location: PinLocation var title: String? var subtitle: String? init(_ location: PinLocation) { self.location = location self.coordinate = location.coordinate self.title = location.title self.subtitle = location.subTitle } }
[ -1 ]
dff31cbb4d54ea33af6f55abba47abb2eeda3a41
484a239dda662004315cac7040b16024e3c80794
/Agile Board Team/Issue/View/IssueTypeRowView.swift
ff06488462595425438a23ef518c8ac9b430db79
[]
no_license
phuhuynh2411/Agile-Board-Team
24127268174fadae2734c93f81892250dbf36a01
997f1093dcaccfd3d940be9cee560a2b35c758d6
refs/heads/master
2021-03-10T14:32:53.349379
2020-06-01T03:03:03
2020-06-01T03:03:03
246,461,530
1
1
null
null
null
null
UTF-8
Swift
false
false
1,372
swift
// // IssueTypeRow.swift // Agile Board Team // // Created by Huynh Tan Phu on 3/25/20. // Copyright © 2020 Filesoft. All rights reserved. // import SwiftUI import Combine struct IssueTypeRowView: View { var issueType: IssueType var body: some View { HStack(spacing: 16) { self.iconView VStack(alignment: .leading, spacing: 5) { Text("Issue Type") .font(.system(size: 14)) .foregroundColor(.secondary) Text(issueType.name) .font(.system(size: 16)) } Spacer() } } private var iconView: some View { guard let url = self.issueType.icon else { return AnyView(Image(systemName: "photo") .resizable() .frame(width: 25, height: 25, alignment: .center)) } return AnyView(RemoteImage(stringURL: url) .frame(width: 25, height: 25, alignment: .center) .foregroundColor(.lightGreyColor)) } } //struct IssueTypeRow_Previews: PreviewProvider { // static var isUpdating: Bool = true // static var issueType: IssueType? = issueData[0].type // // static var previews: some View { // IssueTypeRowView(issueType: self.issueType, isUpdating: self.isUpdating) // } //}
[ -1 ]
ad0c69d0298721a57e24b2c9233ee5c608005189
1bbdd9acc96b5650ce333ffc7cfc651f38939c31
/Azazai/ui/EventCell.swift
9be57fb96c14f063470dc80936dc85439ca12b28
[]
no_license
tiksem/Events-iOS
59a57ad0003d812f6e639bed91f6c7aa5f006634
ba33a67cead08dd833c10c4c75ff9ab761844b91
refs/heads/master
2020-12-20T20:43:31.441754
2016-08-08T00:24:52
2016-08-08T00:24:52
48,590,996
0
0
null
null
null
null
UTF-8
Swift
false
false
409
swift
// // Created by Semyon Tikhonenko on 12/28/15. // Copyright (c) 2015 ___FULLUSERNAME___. All rights reserved. // import Foundation import UIKit class EventCell : UITableViewCell { @IBOutlet weak var eventName: UILabel! @IBOutlet weak var eventDescription: UILabel! @IBOutlet weak var peopleNumber: UILabel! @IBOutlet weak var icon: UIImageView! @IBOutlet weak var eventDate: UILabel! }
[ -1 ]
62ed45d70b2e4aa05f7e74ebd1ccb628285efeea
ea25b9179651dfb25e3d812a5d66ea4da616f074
/Weathards/Weathards/Models/Weather.swift
586aa97f7820d6ada061ca568f40ea57f0c4da23
[]
no_license
MariaFilatova/weathards
c4473c17c8270ca11d6f5c6d32055ecc8c2b8aaf
453a3b76bee5602d04fdd05cb3d289967946be87
refs/heads/main
2023-09-01T12:04:30.286531
2021-10-19T17:41:44
2021-10-19T17:41:44
415,848,807
0
0
null
null
null
null
UTF-8
Swift
false
false
3,407
swift
// // Weather.swift // WeatherApp // // Created by Waind Storm on 24.09.21. // import Foundation public struct Weather { var dateTimeInterval: Int? var temperature: Double /// This temperature parameter accounts for the human perception of weather. var feelsLike: Double /// Humidity, %. var humidity: Int /// Wind speed, metre/sec. var windSpeed: Double var weatherDescription: WeatherDescription var date: Date { guard let dateTimeInterval = dateTimeInterval else { return Date() } return Date(timeIntervalSince1970: TimeInterval(dateTimeInterval)) } public init(dateTimeInterval: Int, temperature: Double, feelsLike: Double, humidity: Int, windSpeed: Double, weatherDescription: WeatherDescription) { self.dateTimeInterval = dateTimeInterval self.temperature = temperature self.feelsLike = feelsLike self.humidity = humidity self.windSpeed = windSpeed self.weatherDescription = weatherDescription } } // MARK: - Codable extension Weather: Codable { enum CodingKeys: String, CodingKey { case dateTimeInterval = "dt" case temperature = "temp" case feelsLike = "feels_like" case humidity case windSpeed = "wind_speed" case weatherDescriptionArray = "weather" } public init(from decoder: Decoder) throws { let values = try decoder.container(keyedBy: CodingKeys.self) dateTimeInterval = try values.decode(Int.self, forKey: .dateTimeInterval) temperature = try values.decode(Double.self, forKey: .temperature).round(to: 1) feelsLike = try values.decode(Double.self, forKey: .feelsLike).round(to: 1) humidity = try values.decode(Int.self, forKey: .humidity) windSpeed = try values.decode(Double.self, forKey: .windSpeed).round(to: DECIMALS_NUMBER) let weatherDescriptionArray = try values.decode([WeatherDescription].self, forKey: .weatherDescriptionArray) guard let value = weatherDescriptionArray.first else { let context = DecodingError.Context(codingPath: [CodingKeys.weatherDescriptionArray], debugDescription: "Array is empty") throw DecodingError.valueNotFound(DailyWeather.self, context) } weatherDescription = value } public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(date, forKey: .dateTimeInterval) try container.encode(temperature, forKey: .temperature) try container.encode(feelsLike, forKey: .feelsLike) try container.encode(humidity, forKey: .humidity) try container.encode(windSpeed, forKey: .windSpeed) try container.encode([weatherDescription], forKey: .weatherDescriptionArray) } } // MARK: - Equatable extension Weather: Equatable { public static func ==(lhs: Weather, rhs: Weather) -> Bool { return lhs.dateTimeInterval == rhs.dateTimeInterval && lhs.temperature == rhs.temperature && lhs.feelsLike == rhs.feelsLike && lhs.humidity == rhs.humidity && lhs.windSpeed == rhs.windSpeed && lhs.weatherDescription == rhs.weatherDescription } }
[ -1 ]
48ae4a1b7d6a5b2f9afdf22a9602436fcbba84e1
253e42607a4bb02a5a327b43ebf669549ee8a1e1
/ParstagramTests/ParstagramTests.swift
449135e5ba466efb4eaa4847605b770b9fa0cf0e
[]
no_license
tiffany-meng/codepath-parstagram
1af376abf824b36afbc0a984b9720a193043d840
e14785791eb14be80dee49a7138243e723806055
refs/heads/main
2023-05-03T20:19:22.344541
2021-05-12T01:37:41
2021-05-12T01:37:41
366,557,610
0
0
null
null
null
null
UTF-8
Swift
false
false
905
swift
// // ParstagramTests.swift // ParstagramTests // // Created by Tiffany Meng on 5/10/21. // import XCTest @testable import Parstagram class ParstagramTests: XCTestCase { override func setUpWithError() throws { // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDownWithError() throws { // Put teardown code here. This method is called after the invocation of each test method in the class. } func testExample() throws { // This is an example of a functional test case. // Use XCTAssert and related functions to verify your tests produce the correct results. } func testPerformanceExample() throws { // This is an example of a performance test case. self.measure { // Put the code you want to measure the time of here. } } }
[ 333828, 346118, 43014, 358410, 354316, 313357, 360462, 399373, 317467, 145435, 16419, 223268, 229413, 204840, 315432, 325674, 344107, 102445, 155694, 176175, 253999, 233517, 346162, 129076, 241716, 229430, 243767, 163896, 180280, 358456, 352315, 288828, 436285, 376894, 288833, 288834, 436292, 403525, 352326, 225351, 315465, 436301, 338001, 196691, 338003, 280661, 329814, 338007, 307289, 385116, 356447, 254048, 237663, 315487, 280675, 280677, 43110, 319591, 321637, 436329, 194666, 221290, 438377, 260207, 432240, 352368, 204916, 233589, 266357, 131191, 215164, 215166, 422019, 280712, 415881, 104587, 235662, 241808, 381073, 196760, 284826, 426138, 346271, 436383, 362659, 258214, 299174, 333991, 32941, 239793, 377009, 405687, 182456, 295098, 379071, 258239, 389313, 299203, 149703, 299209, 346314, 372941, 266449, 321745, 139479, 254170, 229597, 194782, 301279, 311519, 317664, 280802, 379106, 387296, 346346, 205035, 307435, 321772, 438511, 381172, 338164, 436470, 336120, 327929, 356602, 243962, 344313, 184575, 149760, 375039, 411906, 147717, 368905, 375051, 180493, 325905, 254226, 272658, 272660, 368916, 262421, 325912, 381208, 377114, 151839, 237856, 237857, 233762, 211235, 217380, 432421, 211238, 338218, 254251, 311597, 358703, 321840, 98610, 332083, 379186, 332085, 358709, 180535, 336183, 332089, 321860, 332101, 438596, 323913, 348492, 254286, 383311, 323920, 344401, 366930, 377169, 348500, 368981, 155990, 289110, 368984, 272729, 168281, 215385, 332123, 332127, 98657, 383332, 242023, 383336, 270701, 160110, 242033, 270706, 354676, 354677, 139640, 291192, 106874, 211326, 436608, 362881, 240002, 436611, 340357, 225670, 311685, 317831, 106888, 242058, 395659, 385417, 395661, 373134, 385422, 108944, 252308, 190871, 213403, 39324, 149916, 121245, 242078, 420253, 141728, 315810, 315811, 381347, 289189, 375207, 108972, 272813, 340398, 385454, 377264, 342450, 338356, 436661, 293303, 311738, 33211, 293310, 336320, 311745, 342466, 127427, 416197, 254406, 188871, 324039, 129483, 342476, 373197, 289232, 328152, 256477, 287198, 160225, 342498, 358882, 334309, 391655, 432618, 375276, 319981, 291311, 254456, 377338, 377343, 174593, 254465, 291333, 340490, 348682, 139792, 420369, 303636, 258581, 393751, 254488, 416286, 377376, 207393, 375333, 377386, 358954, 244269, 197167, 375343, 385588, 289332, 234036, 375351, 174648, 338489, 338490, 244281, 315960, 242237, 348732, 70209, 115270, 70215, 293448, 55881, 301638, 309830, 348742, 348749, 381517, 385615, 426576, 369235, 416341, 297560, 332378, 201308, 354911, 416351, 139872, 436832, 436834, 268899, 111208, 39530, 184940, 373358, 420463, 346737, 389745, 313971, 346740, 139892, 420471, 344696, 287352, 209530, 244347, 356989, 373375, 152195, 311941, 348806, 336518, 369289, 311945, 330379, 344715, 311949, 287374, 326287, 375440, 316049, 311954, 334481, 117396, 352917, 111253, 316053, 346772, 230040, 342682, 264856, 111258, 111259, 271000, 289434, 303771, 205471, 318106, 318107, 139939, 344738, 176808, 336558, 205487, 303793, 318130, 299699, 293556, 336564, 383667, 314040, 287417, 39614, 287422, 377539, 422596, 422599, 291530, 225995, 363211, 164560, 242386, 385747, 361176, 418520, 422617, 287452, 363230, 264928, 422626, 338662, 422631, 375526, 234217, 346858, 330474, 342762, 293612, 342763, 289518, 299759, 369385, 377489, 312052, 154359, 172792, 348920, 344827, 344828, 221948, 432893, 35583, 363263, 205568, 162561, 291585, 295682, 430849, 291592, 197386, 383754, 62220, 117517, 434957, 322319, 422673, 377497, 430865, 166676, 291604, 310036, 197399, 207640, 422680, 426774, 426775, 326429, 293664, 344865, 377500, 326433, 197411, 400166, 289576, 293672, 189228, 295724, 152365, 197422, 353070, 164656, 295729, 422703, 191283, 422709, 353078, 152374, 197431, 273207, 355130, 375609, 160571, 289598, 160575, 336702, 355137, 430910, 355139, 160580, 252741, 355146, 381773, 201551, 293711, 355121, 355152, 355154, 353109, 377686, 244568, 230234, 189275, 244570, 355165, 435039, 295776, 127841, 357218, 242529, 349026, 303972, 385893, 342887, 360417, 355178, 308076, 242541, 207729, 330609, 246643, 207732, 295798, 361337, 177019, 185211, 308092, 398206, 400252, 291712, 158593, 254850, 359298, 260996, 359299, 113542, 369538, 381829, 316298, 392074, 349067, 295824, 224145, 349072, 355217, 256922, 289690, 318364, 390045, 310176, 185250, 310178, 337227, 420773, 185254, 289703, 293800, 140204, 236461, 363438, 347055, 377772, 252847, 304051, 326581, 373687, 326587, 230332, 377790, 289727, 273344, 349121, 363458, 330689, 359364, 353215, 379844, 213957, 19399, 326601, 345033, 373706, 316364, 211914, 381897, 359381, 386006, 418776, 359387, 433115, 248796, 343005, 347103, 50143, 248797, 207838, 64485, 123881, 326635, 359406, 187374, 383983, 347123, 349171, 240630, 349175, 201720, 271350, 127992, 295927, 328700, 318461, 293886, 257024, 328706, 330754, 320516, 293893, 295942, 357379, 386056, 410627, 353290, 254987, 330763, 377869, 433165, 146448, 384016, 238610, 308243, 418837, 140310, 433174, 201755, 252958, 369701, 357414, 248872, 238639, 252980, 300084, 359478, 312373, 203830, 238651, 132158, 308287, 336960, 361535, 257094, 359495, 377926, 361543, 218186, 250954, 250956, 314448, 341073, 339030, 439384, 361566, 304222, 392290, 250981, 253029, 257125, 300135, 316520, 273515, 357486, 173166, 351344, 144496, 404593, 187506, 377972, 285814, 291959, 300150, 300151, 363641, 160891, 363644, 341115, 300158, 377983, 392318, 248961, 150657, 384131, 349316, 402565, 349318, 302216, 330888, 386189, 337039, 169104, 373903, 177296, 347283, 326804, 363669, 238743, 119962, 300187, 300188, 339100, 351390, 199839, 380061, 429214, 343203, 265379, 300201, 249002, 253099, 253100, 238765, 3246, 300202, 306346, 238769, 318639, 402613, 367799, 421048, 373945, 113850, 294074, 343234, 367810, 259268, 302274, 265412, 353479, 62665, 402634, 283852, 259280, 290000, 316627, 333011, 189653, 351446, 419029, 148696, 296153, 357595, 359647, 304351, 195808, 298208, 310497, 298212, 298213, 222440, 330984, 328940, 298221, 66801, 298228, 302325, 234742, 386294, 351478, 128251, 363771, 386301, 261377, 351490, 320770, 386306, 437505, 322824, 66825, 369930, 439562, 292107, 328971, 414990, 353551, 251153, 177428, 349462, 257305, 320796, 222494, 253216, 339234, 372009, 412971, 130348, 66862, 353584, 351537, 261425, 382258, 345396, 300343, 386359, 116026, 378172, 286013, 306494, 382269, 216386, 312648, 337225, 304456, 230729, 146762, 224586, 177484, 294218, 353616, 259406, 234831, 238927, 294219, 331090, 406861, 318805, 314710, 372054, 159066, 425304, 374109, 314720, 378209, 163175, 333160, 386412, 380271, 327024, 296307, 116084, 208244, 249204, 316787, 382330, 290173, 357759, 306559, 337281, 314751, 318848, 378244, 148867, 357762, 253317, 298374, 314758, 314760, 142729, 296329, 368011, 384393, 388487, 314766, 296335, 318864, 112017, 234898, 9619, 259475, 275859, 318868, 370071, 357786, 290207, 314783, 251298, 310692, 314789, 333220, 314791, 396711, 245161, 396712, 208293, 374191, 286129, 380337, 173491, 286132, 150965, 210358, 304564, 353719, 380338, 343476, 228795, 425405, 302531, 163268, 380357, 339398, 361927, 300489, 425418, 306639, 413137, 366037, 23092, 210390, 210391, 210393, 286172, 144867, 271843, 429542, 361963, 296433, 251378, 308723, 300536, 286202, 359930, 302590, 210433, 366083, 372227, 323080, 329225, 253451, 296461, 359950, 259599, 304656, 329232, 146964, 398869, 308756, 370197, 175639, 253463, 374296, 388632, 374299, 423453, 308764, 396827, 134686, 431649, 349726, 355876, 286244, 245287, 402985, 394794, 245292, 349741, 169518, 347694, 431663, 288309, 312889, 194110, 425535, 349763, 196164, 265798, 288327, 218696, 292425, 128587, 265804, 333388, 396882, 349781, 128599, 179801, 44635, 239198, 343647, 333408, 396895, 99938, 374372, 300644, 323172, 310889, 415338, 243307, 312940, 54893, 204397, 138863, 188016, 222832, 325231, 224883, 314998, 370296, 366203, 323196, 325245, 337534, 337535, 339584, 339585, 263809, 294529, 194180, 224901, 288392, 229001, 415375, 188048, 239250, 419478, 345752, 425626, 255649, 302754, 153251, 298661, 40614, 300714, 210603, 224946, 337591, 384695, 370363, 110268, 415420, 224958, 327358, 333503, 274115, 259781, 306890, 403148, 212685, 333517, 9936, 9937, 241361, 302802, 333520, 272085, 345814, 370388, 384720, 345821, 321247, 298720, 321249, 325346, 153319, 325352, 345833, 345834, 212716, 212717, 360177, 67315, 173814, 325371, 288512, 319233, 339715, 288516, 360195, 339720, 243472, 372496, 323346, 321302, 345879, 366360, 249626, 169754, 325404, 286494, 321310, 255776, 339745, 257830, 421672, 362283, 378668, 399147, 431916, 300848, 339762, 409394, 296755, 259899, 319292, 360252, 325439, 345919, 436031, 403267, 339783, 153415, 345929, 360264, 341836, 415567, 337745, 325457, 317269, 18262, 216918, 241495, 341847, 362327, 350044, 346779, 128862, 345951, 245599, 362337, 376669, 345955, 425825, 296806, 292712, 425833, 423789, 214895, 362352, 313199, 325492, 276341, 417654, 341879, 241528, 317304, 333688, 112509, 55167, 182144, 325503, 305026, 339841, 188292, 253829, 333701, 243591, 315273, 315274, 350093, 325518, 372626, 380821, 329622, 294807, 337815, 333722, 376732, 118685, 298909, 311199, 319392, 350109, 292771, 436131, 294823, 415655, 436137, 327596, 362417, 323507, 243637, 290745, 294843, 188348, 362431, 237504, 294850, 274371, 384964, 214984, 151497, 362443, 344013, 212942, 301008, 212946, 153554, 24532, 212951, 372701, 219101, 329695, 354272, 436191, 354274, 354269, 292836, 292837, 298980, 313319, 354280, 253929, 317415, 337895, 380908, 436205, 174057, 311281, 311282, 325619, 432116, 292858, 415741 ]
60581db9e2e81464dcde18cd787515249ad77705
e17dd33c8adb3797a89140e0cefd4275f45c7079
/VCUIKit/Classes/VCTheme/StyleKit/VCUIKitStyleKit.swift
3782596de4e46632bfe116ee89da24ea2e1e7d9a
[ "MIT" ]
permissive
ripventura/VCUIKit
d775d7faa15863326502b8361d852189641ffab6
922301d3560634653dd998fcf2525680795213a6
refs/heads/master
2021-01-19T13:08:03.862473
2018-11-06T21:05:19
2018-11-06T21:05:19
92,542,893
1
0
null
null
null
null
UTF-8
Swift
false
false
47,372
swift
// // VCUIKitStyleKit.swift // VCUIKit // // Created by Vitor Cesco on 13/04/17. // Copyright © 2017 Vitor Cesco. All rights reserved. // // Generated by PaintCode // http://www.paintcodeapp.com // import UIKit public class VCUIKitStyleKit : NSObject { //// Cache private struct Cache { static let navigationBarBackgroundColor: UIColor = VCUIKitStyleKit.blueBLOX static let navigationBarTintColor: UIColor = VCUIKitStyleKit.white static let navigationBarTitleColor: UIColor = VCUIKitStyleKit.white static let viewControllerViewBackgroundColor: UIColor = VCUIKitStyleKit.greyIOSLightGrey static let viewControllerViewTintColor: UIColor = VCUIKitStyleKit.blueIOS static let labelTextColor: UIColor = VCUIKitStyleKit.blackGray1 static let labelBackgroundColor: UIColor = VCUIKitStyleKit.transparent static let tableViewBackgroundColor: UIColor = VCUIKitStyleKit.greyIOSLightGrey static let tableViewCellBackgroundColor: UIColor = VCUIKitStyleKit.white static let tableViewCellTintColor: UIColor = VCUIKitStyleKit.blueIOS static let tableViewCellTitleTextColor: UIColor = VCUIKitStyleKit.black static let tableViewDetailTextColor: UIColor = VCUIKitStyleKit.greyIOSPlaceholder static let signaturePickerViewControllerViewBackgroundColor: UIColor = VCUIKitStyleKit.white static let signaturePickerViewControllerStrokeColor: UIColor = VCUIKitStyleKit.black static let bannerSuccessBackgroundColor: UIColor = VCUIKitStyleKit.greenIOS static let bannerInfoBackgroundColor: UIColor = VCUIKitStyleKit.whiteGrey2.withAlpha(1) static let tabBarTintColor: UIColor = VCUIKitStyleKit.blueIOS static let alertTitleTextColor: UIColor = VCUIKitStyleKit.black static let alertMessageTextColor: UIColor = VCUIKitStyleKit.greyIOSContext static let alertViewTintColor: UIColor = VCUIKitStyleKit.blueIOS static let alertBackgroundColor: UIColor = VCUIKitStyleKit.white static let alertCancelButtonBackgroundColor: UIColor = VCUIKitStyleKit.blueBLOX static let alertCancelButtonTitleColor: UIColor = VCUIKitStyleKit.white static let alertButtonTitleColor: UIColor = VCUIKitStyleKit.white static let alertButtonBackgroundColor: UIColor = VCUIKitStyleKit.blueBLOX static let redIOS: UIColor = UIColor(red: 0.996, green: 0.220, blue: 0.141, alpha: 1.000) static let bannerDangerBackgroundColor: UIColor = VCUIKitStyleKit.redIOS static let greenIOS: UIColor = UIColor(red: 0.267, green: 0.859, blue: 0.369, alpha: 1.000) static let blueIOS: UIColor = UIColor(red: 0.000, green: 0.463, blue: 1.000, alpha: 1.000) static let black: UIColor = UIColor(red: 0.000, green: 0.000, blue: 0.000, alpha: 1.000) static let white: UIColor = UIColor(red: 1.000, green: 1.000, blue: 1.000, alpha: 1.000) static let blueBLOX: UIColor = UIColor(red: 0.231, green: 0.569, blue: 0.859, alpha: 1.000) static let whiteGrey1: UIColor = VCUIKitStyleKit.white.shadow(withLevel: 0.1) static let transparent: UIColor = UIColor(red: 1.000, green: 1.000, blue: 1.000, alpha: 0.000) static let whiteGrey2: UIColor = VCUIKitStyleKit.whiteGrey1.shadow(withLevel: 0.1) static let blackGray1: UIColor = VCUIKitStyleKit.black.highlight(withLevel: 0.1) static let greyIOSPlaceholder: UIColor = UIColor(red: 0.780, green: 0.780, blue: 0.804, alpha: 1.000) static let greyIOSContext: UIColor = UIColor(red: 0.561, green: 0.557, blue: 0.580, alpha: 1.000) static let greyIOSLightGrey: UIColor = UIColor(red: 0.937, green: 0.937, blue: 0.957, alpha: 1.000) static let vCFlatUIButtonBackgroundColor: UIColor = VCUIKitStyleKit.blueBLOX static let vCFlatUIButtonShadowColor: UIColor = VCUIKitStyleKit.white static let hUDMessageTextColor: UIColor = VCUIKitStyleKit.white static let hUDTintColor: UIColor = VCUIKitStyleKit.white static let hUDBackgroundColor: UIColor = VCUIKitStyleKit.blueBLOX static let vCFlatUIButtonNormalTitleColor: UIColor = VCUIKitStyleKit.white static let vCFlatUIButtonPressedTitleColor: UIColor = VCUIKitStyleKit.white static let vCIconButtonFillColor: UIColor = VCUIKitStyleKit.white } //// Colors @objc public dynamic class var navigationBarBackgroundColor: UIColor { return Cache.navigationBarBackgroundColor } @objc public dynamic class var navigationBarTintColor: UIColor { return Cache.navigationBarTintColor } @objc public dynamic class var navigationBarTitleColor: UIColor { return Cache.navigationBarTitleColor } @objc public dynamic class var viewControllerViewBackgroundColor: UIColor { return Cache.viewControllerViewBackgroundColor } @objc public dynamic class var viewControllerViewTintColor: UIColor { return Cache.viewControllerViewTintColor } @objc public dynamic class var labelTextColor: UIColor { return Cache.labelTextColor } @objc public dynamic class var labelBackgroundColor: UIColor { return Cache.labelBackgroundColor } @objc public dynamic class var tableViewBackgroundColor: UIColor { return Cache.tableViewBackgroundColor } @objc public dynamic class var tableViewCellBackgroundColor: UIColor { return Cache.tableViewCellBackgroundColor } @objc public dynamic class var tableViewCellTintColor: UIColor { return Cache.tableViewCellTintColor } @objc public dynamic class var tableViewCellTitleTextColor: UIColor { return Cache.tableViewCellTitleTextColor } @objc public dynamic class var tableViewDetailTextColor: UIColor { return Cache.tableViewDetailTextColor } @objc public dynamic class var signaturePickerViewControllerViewBackgroundColor: UIColor { return Cache.signaturePickerViewControllerViewBackgroundColor } @objc public dynamic class var signaturePickerViewControllerStrokeColor: UIColor { return Cache.signaturePickerViewControllerStrokeColor } @objc public dynamic class var bannerSuccessBackgroundColor: UIColor { return Cache.bannerSuccessBackgroundColor } @objc public dynamic class var bannerInfoBackgroundColor: UIColor { return Cache.bannerInfoBackgroundColor } @objc public dynamic class var tabBarTintColor: UIColor { return Cache.tabBarTintColor } @objc public dynamic class var alertTitleTextColor: UIColor { return Cache.alertTitleTextColor } @objc public dynamic class var alertMessageTextColor: UIColor { return Cache.alertMessageTextColor } @objc public dynamic class var alertViewTintColor: UIColor { return Cache.alertViewTintColor } @objc public dynamic class var alertBackgroundColor: UIColor { return Cache.alertBackgroundColor } @objc public dynamic class var alertCancelButtonBackgroundColor: UIColor { return Cache.alertCancelButtonBackgroundColor } @objc public dynamic class var alertCancelButtonTitleColor: UIColor { return Cache.alertCancelButtonTitleColor } @objc public dynamic class var alertButtonTitleColor: UIColor { return Cache.alertButtonTitleColor } @objc public dynamic class var alertButtonBackgroundColor: UIColor { return Cache.alertButtonBackgroundColor } @objc public dynamic class var redIOS: UIColor { return Cache.redIOS } @objc public dynamic class var bannerDangerBackgroundColor: UIColor { return Cache.bannerDangerBackgroundColor } @objc public dynamic class var greenIOS: UIColor { return Cache.greenIOS } @objc public dynamic class var blueIOS: UIColor { return Cache.blueIOS } @objc public dynamic class var black: UIColor { return Cache.black } @objc public dynamic class var white: UIColor { return Cache.white } @objc public dynamic class var blueBLOX: UIColor { return Cache.blueBLOX } @objc public dynamic class var whiteGrey1: UIColor { return Cache.whiteGrey1 } @objc public dynamic class var transparent: UIColor { return Cache.transparent } @objc public dynamic class var whiteGrey2: UIColor { return Cache.whiteGrey2 } @objc public dynamic class var blackGray1: UIColor { return Cache.blackGray1 } @objc public dynamic class var greyIOSPlaceholder: UIColor { return Cache.greyIOSPlaceholder } @objc public dynamic class var greyIOSContext: UIColor { return Cache.greyIOSContext } @objc public dynamic class var greyIOSLightGrey: UIColor { return Cache.greyIOSLightGrey } @objc public dynamic class var vCFlatUIButtonBackgroundColor: UIColor { return Cache.vCFlatUIButtonBackgroundColor } @objc public dynamic class var vCFlatUIButtonShadowColor: UIColor { return Cache.vCFlatUIButtonShadowColor } @objc public dynamic class var hUDMessageTextColor: UIColor { return Cache.hUDMessageTextColor } @objc public dynamic class var hUDTintColor: UIColor { return Cache.hUDTintColor } @objc public dynamic class var hUDBackgroundColor: UIColor { return Cache.hUDBackgroundColor } @objc public dynamic class var vCFlatUIButtonNormalTitleColor: UIColor { return Cache.vCFlatUIButtonNormalTitleColor } @objc public dynamic class var vCFlatUIButtonPressedTitleColor: UIColor { return Cache.vCFlatUIButtonPressedTitleColor } @objc public dynamic class var vCIconButtonFillColor: UIColor { return Cache.vCIconButtonFillColor } //// Drawing Methods @objc public dynamic class func drawViewController(frame targetFrame: CGRect = CGRect(x: 0, y: 0, width: 377, height: 667), resizing: ResizingBehavior = .aspectFit) { //// General Declarations let context = UIGraphicsGetCurrentContext()! //// Resize to Target Frame context.saveGState() let resizedFrame: CGRect = resizing.apply(rect: CGRect(x: 0, y: 0, width: 377, height: 667), target: targetFrame) context.translateBy(x: resizedFrame.minX, y: resizedFrame.minY) context.scaleBy(x: resizedFrame.width / 377, y: resizedFrame.height / 667) //// View Drawing let viewPath = UIBezierPath(rect: CGRect(x: 0, y: 0, width: 377, height: 667)) VCUIKitStyleKit.viewControllerViewBackgroundColor.setFill() viewPath.fill() //// Text Drawing let textRect = CGRect(x: 0, y: 130, width: 377, height: 34) let textTextContent = "Random Button" let textStyle = NSMutableParagraphStyle() textStyle.alignment = .center let textFontAttributes = [NSAttributedStringKey.font: UIFont(name: "HelveticaNeue-Medium", size: 17)!, NSAttributedStringKey.foregroundColor: VCUIKitStyleKit.viewControllerViewTintColor, NSAttributedStringKey.paragraphStyle: textStyle] let textTextHeight: CGFloat = textTextContent.boundingRect(with: CGSize(width: textRect.width, height: CGFloat.infinity), options: .usesLineFragmentOrigin, attributes: textFontAttributes, context: nil).height context.saveGState() context.clip(to: textRect) textTextContent.draw(in: CGRect(x: textRect.minX, y: textRect.minY + (textRect.height - textTextHeight) / 2, width: textRect.width, height: textTextHeight), withAttributes: textFontAttributes) context.restoreGState() context.restoreGState() } @objc public dynamic class func drawNavigationBar(frame targetFrame: CGRect = CGRect(x: 0, y: 0, width: 375, height: 64), resizing: ResizingBehavior = .aspectFit) { //// General Declarations let context = UIGraphicsGetCurrentContext()! //// Resize to Target Frame context.saveGState() let resizedFrame: CGRect = resizing.apply(rect: CGRect(x: 0, y: 0, width: 375, height: 64), target: targetFrame) context.translateBy(x: resizedFrame.minX, y: resizedFrame.minY) context.scaleBy(x: resizedFrame.width / 375, y: resizedFrame.height / 64) //// Image Declarations let image = UIImage(named: "image.png")! //// Picture Drawing context.saveGState() context.translateBy(x: 0, y: 64) context.scaleBy(x: 1.54, y: -1.52) let picturePath = UIBezierPath(rect: CGRect(x: 0, y: 0, width: 245.3, height: 42)) context.saveGState() picturePath.addClip() context.translateBy(x: 0, y: 0) context.scaleBy(x: 1, y: -1) context.translateBy(x: 0, y: -image.size.height) context.draw(image.cgImage!, in: CGRect(x: 0, y: 0, width: image.size.width, height: image.size.height)) context.restoreGState() context.restoreGState() //// Rectangle 3 Drawing let rectangle3Path = UIBezierPath(rect: CGRect(x: 0, y: 0, width: 377, height: 64)) VCUIKitStyleKit.navigationBarBackgroundColor.setFill() rectangle3Path.fill() //// Label Drawing let labelRect = CGRect(x: 339.71, y: 28, width: 30.93, height: 25) let labelTextContent = "Edit" let labelStyle = NSMutableParagraphStyle() labelStyle.alignment = .center let labelFontAttributes = [NSAttributedStringKey.font: UIFont(name: "SFUIText-Regular", size: 17)!, NSAttributedStringKey.foregroundColor: VCUIKitStyleKit.navigationBarTintColor, NSAttributedStringKey.paragraphStyle: labelStyle] let labelTextHeight: CGFloat = labelTextContent.boundingRect(with: CGSize(width: labelRect.width, height: CGFloat.infinity), options: .usesLineFragmentOrigin, attributes: labelFontAttributes, context: nil).height context.saveGState() context.clip(to: labelRect) labelTextContent.draw(in: CGRect(x: labelRect.minX, y: labelRect.minY + (labelRect.height - labelTextHeight) / 2, width: labelRect.width, height: labelTextHeight), withAttributes: labelFontAttributes) context.restoreGState() //// Label 2 Drawing let label2Rect = CGRect(x: 169.95, y: 28, width: 39.15, height: 25) let label2TextContent = "Title" let label2Style = NSMutableParagraphStyle() label2Style.alignment = .center let label2FontAttributes = [NSAttributedStringKey.font: UIFont(name: "SFUIText-Semibold", size: 17)!, NSAttributedStringKey.foregroundColor: VCUIKitStyleKit.navigationBarTitleColor, NSAttributedStringKey.paragraphStyle: label2Style] let label2TextHeight: CGFloat = label2TextContent.boundingRect(with: CGSize(width: label2Rect.width, height: CGFloat.infinity), options: .usesLineFragmentOrigin, attributes: label2FontAttributes, context: nil).height context.saveGState() context.clip(to: label2Rect) label2TextContent.draw(in: CGRect(x: label2Rect.minX, y: label2Rect.minY + (label2Rect.height - label2TextHeight) / 2, width: label2Rect.width, height: label2TextHeight), withAttributes: label2FontAttributes) context.restoreGState() //// Label 3 Drawing let label3Rect = CGRect(x: 27, y: 28, width: 30.07, height: 25) let label3TextContent = "Bac" let label3Style = NSMutableParagraphStyle() label3Style.alignment = .center let label3FontAttributes = [NSAttributedStringKey.font: UIFont(name: "SFUIText-Regular", size: 17)!, NSAttributedStringKey.foregroundColor: VCUIKitStyleKit.navigationBarTintColor, NSAttributedStringKey.paragraphStyle: label3Style] let label3TextHeight: CGFloat = label3TextContent.boundingRect(with: CGSize(width: label3Rect.width, height: CGFloat.infinity), options: .usesLineFragmentOrigin, attributes: label3FontAttributes, context: nil).height context.saveGState() context.clip(to: label3Rect) label3TextContent.draw(in: CGRect(x: label3Rect.minX, y: label3Rect.minY + (label3Rect.height - label3TextHeight) / 2, width: label3Rect.width, height: label3TextHeight), withAttributes: label3FontAttributes) context.restoreGState() //// Label 4 Drawing let label4Rect = CGRect(x: 55.84, y: 28, width: 9.23, height: 25) let label4TextContent = "k" let label4Style = NSMutableParagraphStyle() label4Style.alignment = .center let label4FontAttributes = [NSAttributedStringKey.font: UIFont(name: "SFUIText-Regular", size: 17)!, NSAttributedStringKey.foregroundColor: VCUIKitStyleKit.navigationBarTintColor, NSAttributedStringKey.paragraphStyle: label4Style] let label4TextHeight: CGFloat = label4TextContent.boundingRect(with: CGSize(width: label4Rect.width, height: CGFloat.infinity), options: .usesLineFragmentOrigin, attributes: label4FontAttributes, context: nil).height context.saveGState() context.clip(to: label4Rect) label4TextContent.draw(in: CGRect(x: label4Rect.minX, y: label4Rect.minY + (label4Rect.height - label4TextHeight) / 2, width: label4Rect.width, height: label4TextHeight), withAttributes: label4FontAttributes) context.restoreGState() //// Bezier 2 Drawing let bezier2Path = UIBezierPath() bezier2Path.move(to: CGPoint(x: 8.55, y: 41)) bezier2Path.addLine(to: CGPoint(x: 19.1, y: 30.5)) bezier2Path.addLine(to: CGPoint(x: 21.11, y: 32.5)) bezier2Path.addLine(to: CGPoint(x: 12.57, y: 41)) bezier2Path.addLine(to: CGPoint(x: 21.11, y: 49.5)) bezier2Path.addLine(to: CGPoint(x: 19.1, y: 51.5)) bezier2Path.addLine(to: CGPoint(x: 8.55, y: 41)) bezier2Path.close() bezier2Path.usesEvenOddFillRule = true VCUIKitStyleKit.navigationBarTintColor.setFill() bezier2Path.fill() context.restoreGState() } @objc public dynamic class func drawNormalLabel(frame targetFrame: CGRect = CGRect(x: 0, y: 0, width: 232, height: 64), resizing: ResizingBehavior = .aspectFit) { //// General Declarations let context = UIGraphicsGetCurrentContext()! //// Resize to Target Frame context.saveGState() let resizedFrame: CGRect = resizing.apply(rect: CGRect(x: 0, y: 0, width: 232, height: 64), target: targetFrame) context.translateBy(x: resizedFrame.minX, y: resizedFrame.minY) context.scaleBy(x: resizedFrame.width / 232, y: resizedFrame.height / 64) //// Text Drawing let textRect = CGRect(x: 0, y: 1, width: 232, height: 63) let textPath = UIBezierPath(rect: textRect) VCUIKitStyleKit.labelBackgroundColor.setFill() textPath.fill() let textTextContent = "Lorem ipsum dolor" let textStyle = NSMutableParagraphStyle() textStyle.alignment = .center let textFontAttributes = [NSAttributedStringKey.font: UIFont(name: "HelveticaNeue", size: 13)!, NSAttributedStringKey.foregroundColor: VCUIKitStyleKit.labelTextColor, NSAttributedStringKey.paragraphStyle: textStyle] let textTextHeight: CGFloat = textTextContent.boundingRect(with: CGSize(width: textRect.width, height: CGFloat.infinity), options: .usesLineFragmentOrigin, attributes: textFontAttributes, context: nil).height context.saveGState() context.clip(to: textRect) textTextContent.draw(in: CGRect(x: textRect.minX, y: textRect.minY + (textRect.height - textTextHeight) / 2, width: textRect.width, height: textTextHeight), withAttributes: textFontAttributes) context.restoreGState() context.restoreGState() } @objc public dynamic class func drawCollectionView(frame targetFrame: CGRect = CGRect(x: 0, y: 0, width: 375, height: 667), resizing: ResizingBehavior = .aspectFit) { //// General Declarations let context = UIGraphicsGetCurrentContext()! //// Resize to Target Frame context.saveGState() let resizedFrame: CGRect = resizing.apply(rect: CGRect(x: 0, y: 0, width: 375, height: 667), target: targetFrame) context.translateBy(x: resizedFrame.minX, y: resizedFrame.minY) context.scaleBy(x: resizedFrame.width / 375, y: resizedFrame.height / 667) //// View Drawing let viewPath = UIBezierPath(rect: CGRect(x: 0, y: 0, width: 377, height: 667)) UIColor.red.setFill() viewPath.fill() context.restoreGState() } @objc public dynamic class func drawTableView(frame targetFrame: CGRect = CGRect(x: 0, y: 0, width: 377, height: 667), resizing: ResizingBehavior = .aspectFit) { //// General Declarations let context = UIGraphicsGetCurrentContext()! //// Resize to Target Frame context.saveGState() let resizedFrame: CGRect = resizing.apply(rect: CGRect(x: 0, y: 0, width: 377, height: 667), target: targetFrame) context.translateBy(x: resizedFrame.minX, y: resizedFrame.minY) context.scaleBy(x: resizedFrame.width / 377, y: resizedFrame.height / 667) //// View Drawing let viewPath = UIBezierPath(rect: CGRect(x: 0, y: 0, width: 377, height: 667)) VCUIKitStyleKit.tableViewBackgroundColor.setFill() viewPath.fill() //// TableViewCellDetail //// Rectangle 2 Drawing let rectangle2Path = UIBezierPath(rect: CGRect(x: 0, y: 166, width: 377, height: 54)) VCUIKitStyleKit.tableViewCellBackgroundColor.setFill() rectangle2Path.fill() //// Bezier 5 Drawing let bezier5Path = UIBezierPath() bezier5Path.move(to: CGPoint(x: 349, y: 188.5)) bezier5Path.addLine(to: CGPoint(x: 350.5, y: 187)) bezier5Path.addLine(to: CGPoint(x: 357, y: 193.5)) bezier5Path.addLine(to: CGPoint(x: 350.5, y: 200)) bezier5Path.addLine(to: CGPoint(x: 349, y: 198.5)) bezier5Path.addLine(to: CGPoint(x: 354, y: 193.5)) bezier5Path.addLine(to: CGPoint(x: 349, y: 188.5)) bezier5Path.close() bezier5Path.usesEvenOddFillRule = true VCUIKitStyleKit.tableViewDetailTextColor.setFill() bezier5Path.fill() //// Detail Drawing let detailRect = CGRect(x: 287, y: 180, width: 53.05, height: 25) let detailTextContent = "Detail" let detailStyle = NSMutableParagraphStyle() detailStyle.alignment = .right let detailFontAttributes = [NSAttributedStringKey.font: UIFont(name: "SFUIText-Regular", size: 17)!, NSAttributedStringKey.foregroundColor: VCUIKitStyleKit.tableViewDetailTextColor, NSAttributedStringKey.paragraphStyle: detailStyle] let detailTextHeight: CGFloat = detailTextContent.boundingRect(with: CGSize(width: detailRect.width, height: CGFloat.infinity), options: .usesLineFragmentOrigin, attributes: detailFontAttributes, context: nil).height context.saveGState() context.clip(to: detailRect) detailTextContent.draw(in: CGRect(x: detailRect.minX, y: detailRect.minY + (detailRect.height - detailTextHeight) / 2, width: detailRect.width, height: detailTextHeight), withAttributes: detailFontAttributes) context.restoreGState() //// Label 2 Drawing let label2Rect = CGRect(x: 47, y: 179, width: 45, height: 25) let label2TextContent = "Title" let label2Style = NSMutableParagraphStyle() label2Style.alignment = .left let label2FontAttributes = [NSAttributedStringKey.font: UIFont(name: "SFUIText-Regular", size: 17)!, NSAttributedStringKey.foregroundColor: VCUIKitStyleKit.tableViewCellTitleTextColor, NSAttributedStringKey.paragraphStyle: label2Style] let label2TextHeight: CGFloat = label2TextContent.boundingRect(with: CGSize(width: label2Rect.width, height: CGFloat.infinity), options: .usesLineFragmentOrigin, attributes: label2FontAttributes, context: nil).height context.saveGState() context.clip(to: label2Rect) label2TextContent.draw(in: CGRect(x: label2Rect.minX, y: label2Rect.minY + (label2Rect.height - label2TextHeight) / 2, width: label2Rect.width, height: label2TextHeight), withAttributes: label2FontAttributes) context.restoreGState() //// Bezier 4 Drawing let bezier4Path = UIBezierPath() bezier4Path.move(to: CGPoint(x: 21.05, y: 192.5)) bezier4Path.addLine(to: CGPoint(x: 19.58, y: 194)) bezier4Path.addLine(to: CGPoint(x: 23.5, y: 198)) bezier4Path.addLine(to: CGPoint(x: 32.31, y: 189.5)) bezier4Path.addLine(to: CGPoint(x: 30.85, y: 188)) bezier4Path.addLine(to: CGPoint(x: 23.5, y: 195)) bezier4Path.addLine(to: CGPoint(x: 21.05, y: 192.5)) bezier4Path.close() bezier4Path.usesEvenOddFillRule = true VCUIKitStyleKit.tableViewCellTintColor.setFill() bezier4Path.fill() //// TableViewCellAccessory //// Rectangle Drawing let rectanglePath = UIBezierPath(rect: CGRect(x: 0, y: 82, width: 377, height: 54)) VCUIKitStyleKit.tableViewCellBackgroundColor.setFill() rectanglePath.fill() //// Bezier 2 Drawing let bezier2Path = UIBezierPath() bezier2Path.move(to: CGPoint(x: 346.64, y: 120)) bezier2Path.addCurve(to: CGPoint(x: 335.87, y: 109), controlPoint1: CGPoint(x: 340.7, y: 120), controlPoint2: CGPoint(x: 335.87, y: 115.08)) bezier2Path.addCurve(to: CGPoint(x: 346.64, y: 98), controlPoint1: CGPoint(x: 335.87, y: 102.92), controlPoint2: CGPoint(x: 340.7, y: 98)) bezier2Path.addCurve(to: CGPoint(x: 357.42, y: 109), controlPoint1: CGPoint(x: 352.59, y: 98), controlPoint2: CGPoint(x: 357.42, y: 102.92)) bezier2Path.addCurve(to: CGPoint(x: 346.64, y: 120), controlPoint1: CGPoint(x: 357.42, y: 115.08), controlPoint2: CGPoint(x: 352.59, y: 120)) bezier2Path.close() bezier2Path.move(to: CGPoint(x: 346.64, y: 119)) bezier2Path.addCurve(to: CGPoint(x: 356.44, y: 109), controlPoint1: CGPoint(x: 352.05, y: 119), controlPoint2: CGPoint(x: 356.44, y: 114.52)) bezier2Path.addCurve(to: CGPoint(x: 346.64, y: 99), controlPoint1: CGPoint(x: 356.44, y: 103.48), controlPoint2: CGPoint(x: 352.05, y: 99)) bezier2Path.addCurve(to: CGPoint(x: 336.85, y: 109), controlPoint1: CGPoint(x: 341.24, y: 99), controlPoint2: CGPoint(x: 336.85, y: 103.48)) bezier2Path.addCurve(to: CGPoint(x: 346.64, y: 119), controlPoint1: CGPoint(x: 336.85, y: 114.52), controlPoint2: CGPoint(x: 341.24, y: 119)) bezier2Path.close() bezier2Path.move(to: CGPoint(x: 344.69, y: 106.5)) bezier2Path.addLine(to: CGPoint(x: 347.62, y: 106.5)) bezier2Path.addLine(to: CGPoint(x: 347.62, y: 114.5)) bezier2Path.addLine(to: CGPoint(x: 348.6, y: 114.5)) bezier2Path.addLine(to: CGPoint(x: 348.6, y: 115)) bezier2Path.addLine(to: CGPoint(x: 344.69, y: 115)) bezier2Path.addLine(to: CGPoint(x: 344.69, y: 114.5)) bezier2Path.addLine(to: CGPoint(x: 345.66, y: 114.5)) bezier2Path.addLine(to: CGPoint(x: 345.66, y: 107)) bezier2Path.addLine(to: CGPoint(x: 344.69, y: 107)) bezier2Path.addLine(to: CGPoint(x: 344.69, y: 106.5)) bezier2Path.close() bezier2Path.move(to: CGPoint(x: 346.4, y: 105)) bezier2Path.addCurve(to: CGPoint(x: 345.18, y: 103.75), controlPoint1: CGPoint(x: 345.72, y: 105), controlPoint2: CGPoint(x: 345.18, y: 104.44)) bezier2Path.addCurve(to: CGPoint(x: 346.4, y: 102.5), controlPoint1: CGPoint(x: 345.18, y: 103.06), controlPoint2: CGPoint(x: 345.72, y: 102.5)) bezier2Path.addCurve(to: CGPoint(x: 347.62, y: 103.75), controlPoint1: CGPoint(x: 347.08, y: 102.5), controlPoint2: CGPoint(x: 347.62, y: 103.06)) bezier2Path.addCurve(to: CGPoint(x: 346.4, y: 105), controlPoint1: CGPoint(x: 347.62, y: 104.44), controlPoint2: CGPoint(x: 347.08, y: 105)) bezier2Path.close() bezier2Path.usesEvenOddFillRule = true VCUIKitStyleKit.tableViewCellTintColor.setFill() bezier2Path.fill() //// Title Drawing let titleRect = CGRect(x: 47, y: 95, width: 105, height: 25) let titleTextContent = "Title" let titleStyle = NSMutableParagraphStyle() titleStyle.alignment = .left let titleFontAttributes = [NSAttributedStringKey.font: UIFont(name: "SFUIText-Regular", size: 17)!, NSAttributedStringKey.foregroundColor: VCUIKitStyleKit.tableViewCellTitleTextColor, NSAttributedStringKey.paragraphStyle: titleStyle] let titleTextHeight: CGFloat = titleTextContent.boundingRect(with: CGSize(width: titleRect.width, height: CGFloat.infinity), options: .usesLineFragmentOrigin, attributes: titleFontAttributes, context: nil).height context.saveGState() context.clip(to: titleRect) titleTextContent.draw(in: CGRect(x: titleRect.minX, y: titleRect.minY + (titleRect.height - titleTextHeight) / 2, width: titleRect.width, height: titleTextHeight), withAttributes: titleFontAttributes) context.restoreGState() //// Bezier 3 Drawing let bezier3Path = UIBezierPath() bezier3Path.move(to: CGPoint(x: 21.05, y: 108.5)) bezier3Path.addLine(to: CGPoint(x: 19.58, y: 110)) bezier3Path.addLine(to: CGPoint(x: 23.5, y: 114)) bezier3Path.addLine(to: CGPoint(x: 32.31, y: 105.5)) bezier3Path.addLine(to: CGPoint(x: 30.85, y: 104)) bezier3Path.addLine(to: CGPoint(x: 23.5, y: 111)) bezier3Path.addLine(to: CGPoint(x: 21.05, y: 108.5)) bezier3Path.close() bezier3Path.usesEvenOddFillRule = true VCUIKitStyleKit.tableViewCellTintColor.setFill() bezier3Path.fill() //// Group 2 context.restoreGState() } @objc public dynamic class func drawSignatureViewController(frame targetFrame: CGRect = CGRect(x: 0, y: 0, width: 667, height: 375), resizing: ResizingBehavior = .aspectFit) { //// General Declarations let context = UIGraphicsGetCurrentContext()! //// Resize to Target Frame context.saveGState() let resizedFrame: CGRect = resizing.apply(rect: CGRect(x: 0, y: 0, width: 667, height: 375), target: targetFrame) context.translateBy(x: resizedFrame.minX, y: resizedFrame.minY) context.scaleBy(x: resizedFrame.width / 667, y: resizedFrame.height / 375) //// Rectangle Drawing let rectanglePath = UIBezierPath(rect: CGRect(x: 0, y: 0, width: 667, height: 375)) VCUIKitStyleKit.signaturePickerViewControllerViewBackgroundColor.setFill() rectanglePath.fill() //// Bezier Drawing let bezierPath = UIBezierPath() bezierPath.move(to: CGPoint(x: 139, y: 164)) bezierPath.addCurve(to: CGPoint(x: 195, y: 112), controlPoint1: CGPoint(x: 195, y: 112), controlPoint2: CGPoint(x: 139, y: 92)) bezierPath.addCurve(to: CGPoint(x: 290, y: 216), controlPoint1: CGPoint(x: 251, y: 132), controlPoint2: CGPoint(x: 385, y: 128)) bezierPath.addCurve(to: CGPoint(x: 450, y: 266), controlPoint1: CGPoint(x: 195, y: 304), controlPoint2: CGPoint(x: 410, y: 316)) bezierPath.addCurve(to: CGPoint(x: 429, y: 112), controlPoint1: CGPoint(x: 490, y: 216), controlPoint2: CGPoint(x: 507, y: 112)) bezierPath.addCurve(to: CGPoint(x: 290, y: 34), controlPoint1: CGPoint(x: 351, y: 112), controlPoint2: CGPoint(x: 210, y: 34)) VCUIKitStyleKit.signaturePickerViewControllerStrokeColor.setStroke() bezierPath.lineWidth = 5.5 bezierPath.lineCapStyle = .round bezierPath.stroke() context.restoreGState() } @objc public dynamic class func drawBannerSuccess(frame targetFrame: CGRect = CGRect(x: 0, y: 0, width: 375, height: 80), resizing: ResizingBehavior = .aspectFit) { //// General Declarations let context = UIGraphicsGetCurrentContext()! //// Resize to Target Frame context.saveGState() let resizedFrame: CGRect = resizing.apply(rect: CGRect(x: 0, y: 0, width: 375, height: 80), target: targetFrame) context.translateBy(x: resizedFrame.minX, y: resizedFrame.minY) context.scaleBy(x: resizedFrame.width / 375, y: resizedFrame.height / 80) //// Rectangle Drawing let rectanglePath = UIBezierPath(rect: CGRect(x: 0, y: 0, width: 375, height: 80)) VCUIKitStyleKit.bannerSuccessBackgroundColor.setFill() rectanglePath.fill() context.restoreGState() } @objc public dynamic class func drawBannerInfo(frame targetFrame: CGRect = CGRect(x: 0, y: 0, width: 375, height: 80), resizing: ResizingBehavior = .aspectFit) { //// General Declarations let context = UIGraphicsGetCurrentContext()! //// Resize to Target Frame context.saveGState() let resizedFrame: CGRect = resizing.apply(rect: CGRect(x: 0, y: 0, width: 375, height: 80), target: targetFrame) context.translateBy(x: resizedFrame.minX, y: resizedFrame.minY) context.scaleBy(x: resizedFrame.width / 375, y: resizedFrame.height / 80) //// Rectangle Drawing let rectanglePath = UIBezierPath(rect: CGRect(x: 0, y: 0, width: 375, height: 80)) VCUIKitStyleKit.bannerInfoBackgroundColor.setFill() rectanglePath.fill() context.restoreGState() } @objc public dynamic class func drawBannerDanger(frame targetFrame: CGRect = CGRect(x: 0, y: 0, width: 375, height: 80), resizing: ResizingBehavior = .aspectFit) { //// General Declarations let context = UIGraphicsGetCurrentContext()! //// Resize to Target Frame context.saveGState() let resizedFrame: CGRect = resizing.apply(rect: CGRect(x: 0, y: 0, width: 375, height: 80), target: targetFrame) context.translateBy(x: resizedFrame.minX, y: resizedFrame.minY) context.scaleBy(x: resizedFrame.width / 375, y: resizedFrame.height / 80) //// Rectangle Drawing let rectanglePath = UIBezierPath(rect: CGRect(x: 0, y: 0, width: 375, height: 80)) VCUIKitStyleKit.bannerDangerBackgroundColor.setFill() rectanglePath.fill() context.restoreGState() } @objc public dynamic class func drawTabBar(frame targetFrame: CGRect = CGRect(x: 0, y: 0, width: 375, height: 64), resizing: ResizingBehavior = .aspectFit) { //// General Declarations let context = UIGraphicsGetCurrentContext()! //// Resize to Target Frame context.saveGState() let resizedFrame: CGRect = resizing.apply(rect: CGRect(x: 0, y: 0, width: 375, height: 64), target: targetFrame) context.translateBy(x: resizedFrame.minX, y: resizedFrame.minY) context.scaleBy(x: resizedFrame.width / 375, y: resizedFrame.height / 64) //// Label Drawing let labelRect = CGRect(x: 11.71, y: 39, width: 55.29, height: 25) let labelTextContent = "Contacts" let labelStyle = NSMutableParagraphStyle() labelStyle.alignment = .center let labelFontAttributes = [NSAttributedStringKey.font: UIFont(name: "SFUIText-Regular", size: 11)!, NSAttributedStringKey.foregroundColor: VCUIKitStyleKit.tabBarTintColor, NSAttributedStringKey.paragraphStyle: labelStyle] let labelTextHeight: CGFloat = labelTextContent.boundingRect(with: CGSize(width: labelRect.width, height: CGFloat.infinity), options: .usesLineFragmentOrigin, attributes: labelFontAttributes, context: nil).height context.saveGState() context.clip(to: labelRect) labelTextContent.draw(in: CGRect(x: labelRect.minX, y: labelRect.minY + (labelRect.height - labelTextHeight) / 2, width: labelRect.width, height: labelTextHeight), withAttributes: labelFontAttributes) context.restoreGState() //// Label 2 Drawing let label2Rect = CGRect(x: 100.21, y: 39, width: 55.29, height: 25) let label2TextContent = "Recents" let label2Style = NSMutableParagraphStyle() label2Style.alignment = .center let label2FontAttributes = [NSAttributedStringKey.font: UIFont(name: "SFUIText-Regular", size: 11)!, NSAttributedStringKey.foregroundColor: VCUIKitStyleKit.tabBarTintColor, NSAttributedStringKey.paragraphStyle: label2Style] let label2TextHeight: CGFloat = label2TextContent.boundingRect(with: CGSize(width: label2Rect.width, height: CGFloat.infinity), options: .usesLineFragmentOrigin, attributes: label2FontAttributes, context: nil).height context.saveGState() context.clip(to: label2Rect) label2TextContent.draw(in: CGRect(x: label2Rect.minX, y: label2Rect.minY + (label2Rect.height - label2TextHeight) / 2, width: label2Rect.width, height: label2TextHeight), withAttributes: label2FontAttributes) context.restoreGState() //// Label 3 Drawing let label3Rect = CGRect(x: 186.71, y: 39, width: 55.29, height: 25) let label3TextContent = "Settings" let label3Style = NSMutableParagraphStyle() label3Style.alignment = .center let label3FontAttributes = [NSAttributedStringKey.font: UIFont(name: "SFUIText-Regular", size: 11)!, NSAttributedStringKey.foregroundColor: VCUIKitStyleKit.tabBarTintColor, NSAttributedStringKey.paragraphStyle: label3Style] let label3TextHeight: CGFloat = label3TextContent.boundingRect(with: CGSize(width: label3Rect.width, height: CGFloat.infinity), options: .usesLineFragmentOrigin, attributes: label3FontAttributes, context: nil).height context.saveGState() context.clip(to: label3Rect) label3TextContent.draw(in: CGRect(x: label3Rect.minX, y: label3Rect.minY + (label3Rect.height - label3TextHeight) / 2, width: label3Rect.width, height: label3TextHeight), withAttributes: label3FontAttributes) context.restoreGState() //// Rectangle Drawing let rectanglePath = UIBezierPath(roundedRect: CGRect(x: 26, y: 13, width: 26, height: 26), cornerRadius: 4) VCUIKitStyleKit.tabBarTintColor.setFill() rectanglePath.fill() //// Rectangle 2 Drawing let rectangle2Path = UIBezierPath(roundedRect: CGRect(x: 115, y: 13, width: 26, height: 26), cornerRadius: 4) VCUIKitStyleKit.tabBarTintColor.setFill() rectangle2Path.fill() //// Rectangle 3 Drawing let rectangle3Path = UIBezierPath(roundedRect: CGRect(x: 201.5, y: 13, width: 26, height: 26), cornerRadius: 4) VCUIKitStyleKit.tabBarTintColor.setFill() rectangle3Path.fill() context.restoreGState() } @objc public dynamic class func drawVCFlatUIButtonNormal(vCFlatUIButtonSize: CGSize = CGSize(width: 200, height: 44), vCFlatUIButtonShadowHeight: CGFloat = 3, vCFlatUIButtonCornerRadius: CGFloat = 6) { //// Variable Declarations let vCFlatButtonNormalFrontShapeHeight: CGFloat = vCFlatUIButtonSize.height - vCFlatUIButtonShadowHeight //// Back Drawing let backPath = UIBezierPath(roundedRect: CGRect(x: 0, y: 0, width: vCFlatUIButtonSize.width, height: vCFlatUIButtonSize.height), cornerRadius: vCFlatUIButtonCornerRadius) VCUIKitStyleKit.vCFlatUIButtonShadowColor.setFill() backPath.fill() //// Front Drawing let frontPath = UIBezierPath(roundedRect: CGRect(x: 0, y: 0, width: vCFlatUIButtonSize.width, height: vCFlatButtonNormalFrontShapeHeight), cornerRadius: vCFlatUIButtonCornerRadius) VCUIKitStyleKit.vCFlatUIButtonBackgroundColor.setFill() frontPath.fill() } @objc public dynamic class func drawVCFlatUIButtonPressed(vCFlatUIButtonSize: CGSize = CGSize(width: 200, height: 44), vCFlatUIButtonShadowHeight: CGFloat = 3, vCFlatUIButtonCornerRadius: CGFloat = 6) { //// Variable Declarations let vCFlatUIButtonPressedFrontYPosition: CGFloat = vCFlatUIButtonShadowHeight / 3.0 let vCFlatButtonPressedFrontShapeHeight: CGFloat = vCFlatUIButtonSize.height - vCFlatUIButtonPressedFrontYPosition //// Back Drawing let backPath = UIBezierPath(roundedRect: CGRect(x: 0, y: 0, width: vCFlatUIButtonSize.width, height: vCFlatUIButtonSize.height), cornerRadius: vCFlatUIButtonCornerRadius) VCUIKitStyleKit.vCFlatUIButtonShadowColor.setFill() backPath.fill() //// Front Drawing let frontPath = UIBezierPath(roundedRect: CGRect(x: 0, y: vCFlatUIButtonPressedFrontYPosition, width: vCFlatUIButtonSize.width, height: vCFlatButtonPressedFrontShapeHeight), cornerRadius: vCFlatUIButtonCornerRadius) VCUIKitStyleKit.vCFlatUIButtonBackgroundColor.setFill() frontPath.fill() } @objc public dynamic class func drawRoundedXIcon(frame targetFrame: CGRect = CGRect(x: 0, y: 0, width: 100, height: 100), resizing: ResizingBehavior = .aspectFit) { //// General Declarations let context = UIGraphicsGetCurrentContext()! //// Resize to Target Frame context.saveGState() let resizedFrame: CGRect = resizing.apply(rect: CGRect(x: 0, y: 0, width: 100, height: 100), target: targetFrame) context.translateBy(x: resizedFrame.minX, y: resizedFrame.minY) context.scaleBy(x: resizedFrame.width / 100, y: resizedFrame.height / 100) //// Bezier Drawing let bezierPath = UIBezierPath() bezierPath.move(to: CGPoint(x: 66.07, y: 31.25)) bezierPath.addLine(to: CGPoint(x: 60.57, y: 31.25)) bezierPath.addLine(to: CGPoint(x: 50.09, y: 46.82)) bezierPath.addLine(to: CGPoint(x: 49.91, y: 46.82)) bezierPath.addLine(to: CGPoint(x: 39.57, y: 31.25)) bezierPath.addLine(to: CGPoint(x: 33.74, y: 31.25)) bezierPath.addLine(to: CGPoint(x: 46.76, y: 50.4)) bezierPath.addLine(to: CGPoint(x: 46.76, y: 50.58)) bezierPath.addCurve(to: CGPoint(x: 46.39, y: 51.13), controlPoint1: CGPoint(x: 46.76, y: 50.58), controlPoint2: CGPoint(x: 46.64, y: 50.77)) bezierPath.addCurve(to: CGPoint(x: 45.43, y: 52.54), controlPoint1: CGPoint(x: 46.17, y: 51.46), controlPoint2: CGPoint(x: 45.85, y: 51.93)) bezierPath.addCurve(to: CGPoint(x: 42.14, y: 57.39), controlPoint1: CGPoint(x: 44.55, y: 53.85), controlPoint2: CGPoint(x: 43.45, y: 55.47)) bezierPath.addCurve(to: CGPoint(x: 38.21, y: 63.18), controlPoint1: CGPoint(x: 40.84, y: 59.32), controlPoint2: CGPoint(x: 39.53, y: 61.25)) bezierPath.addCurve(to: CGPoint(x: 34.91, y: 68.04), controlPoint1: CGPoint(x: 36.89, y: 65.11), controlPoint2: CGPoint(x: 35.79, y: 66.73)) bezierPath.addCurve(to: CGPoint(x: 33.58, y: 70), controlPoint1: CGPoint(x: 34.02, y: 69.35), controlPoint2: CGPoint(x: 33.58, y: 70)) bezierPath.addLine(to: CGPoint(x: 39.06, y: 70)) bezierPath.addLine(to: CGPoint(x: 49.5, y: 54.56)) bezierPath.addLine(to: CGPoint(x: 49.69, y: 54.56)) bezierPath.addLine(to: CGPoint(x: 59.98, y: 70)) bezierPath.addLine(to: CGPoint(x: 65.78, y: 70)) bezierPath.addLine(to: CGPoint(x: 52.7, y: 50.8)) bezierPath.addLine(to: CGPoint(x: 52.7, y: 50.64)) bezierPath.addLine(to: CGPoint(x: 66.07, y: 31.25)) bezierPath.close() bezierPath.move(to: CGPoint(x: 100, y: 50)) bezierPath.addCurve(to: CGPoint(x: 50, y: 100), controlPoint1: CGPoint(x: 100, y: 77.61), controlPoint2: CGPoint(x: 77.61, y: 100)) bezierPath.addCurve(to: CGPoint(x: 0, y: 50), controlPoint1: CGPoint(x: 22.39, y: 100), controlPoint2: CGPoint(x: 0, y: 77.61)) bezierPath.addCurve(to: CGPoint(x: 19.89, y: 10.08), controlPoint1: CGPoint(x: 0, y: 33.69), controlPoint2: CGPoint(x: 7.81, y: 19.2)) bezierPath.addCurve(to: CGPoint(x: 50, y: 0), controlPoint1: CGPoint(x: 28.27, y: 3.75), controlPoint2: CGPoint(x: 38.7, y: 0)) bezierPath.addCurve(to: CGPoint(x: 100, y: 50), controlPoint1: CGPoint(x: 77.61, y: 0), controlPoint2: CGPoint(x: 100, y: 22.39)) bezierPath.close() VCUIKitStyleKit.vCIconButtonFillColor.setFill() bezierPath.fill() context.restoreGState() } @objc(VCUIKitStyleKitResizingBehavior) public enum ResizingBehavior: Int { case aspectFit /// The content is proportionally resized to fit into the target rectangle. case aspectFill /// The content is proportionally resized to completely fill the target rectangle. case stretch /// The content is stretched to match the entire target rectangle. case center /// The content is centered in the target rectangle, but it is NOT resized. public func apply(rect: CGRect, target: CGRect) -> CGRect { if rect == target || target == CGRect.zero { return rect } var scales = CGSize.zero scales.width = abs(target.width / rect.width) scales.height = abs(target.height / rect.height) switch self { case .aspectFit: scales.width = min(scales.width, scales.height) scales.height = scales.width case .aspectFill: scales.width = max(scales.width, scales.height) scales.height = scales.width case .stretch: break case .center: scales.width = 1 scales.height = 1 } var result = rect.standardized result.size.width *= scales.width result.size.height *= scales.height result.origin.x = target.minX + (target.width - result.width) / 2 result.origin.y = target.minY + (target.height - result.height) / 2 return result } } } private extension UIColor { func withHue(_ newHue: CGFloat) -> UIColor { var saturation: CGFloat = 1, brightness: CGFloat = 1, alpha: CGFloat = 1 self.getHue(nil, saturation: &saturation, brightness: &brightness, alpha: &alpha) return UIColor(hue: newHue, saturation: saturation, brightness: brightness, alpha: alpha) } func withSaturation(_ newSaturation: CGFloat) -> UIColor { var hue: CGFloat = 1, brightness: CGFloat = 1, alpha: CGFloat = 1 self.getHue(&hue, saturation: nil, brightness: &brightness, alpha: &alpha) return UIColor(hue: hue, saturation: newSaturation, brightness: brightness, alpha: alpha) } func withBrightness(_ newBrightness: CGFloat) -> UIColor { var hue: CGFloat = 1, saturation: CGFloat = 1, alpha: CGFloat = 1 self.getHue(&hue, saturation: &saturation, brightness: nil, alpha: &alpha) return UIColor(hue: hue, saturation: saturation, brightness: newBrightness, alpha: alpha) } func withAlpha(_ newAlpha: CGFloat) -> UIColor { var hue: CGFloat = 1, saturation: CGFloat = 1, brightness: CGFloat = 1 self.getHue(&hue, saturation: &saturation, brightness: &brightness, alpha: nil) return UIColor(hue: hue, saturation: saturation, brightness: brightness, alpha: newAlpha) } func highlight(withLevel highlight: CGFloat) -> UIColor { var red: CGFloat = 1, green: CGFloat = 1, blue: CGFloat = 1, alpha: CGFloat = 1 self.getRed(&red, green: &green, blue: &blue, alpha: &alpha) return UIColor(red: red * (1-highlight) + highlight, green: green * (1-highlight) + highlight, blue: blue * (1-highlight) + highlight, alpha: alpha * (1-highlight) + highlight) } func shadow(withLevel shadow: CGFloat) -> UIColor { var red: CGFloat = 1, green: CGFloat = 1, blue: CGFloat = 1, alpha: CGFloat = 1 self.getRed(&red, green: &green, blue: &blue, alpha: &alpha) return UIColor(red: red * (1-shadow), green: green * (1-shadow), blue: blue * (1-shadow), alpha: alpha * (1-shadow) + shadow) } }
[ -1 ]
eb67d90cfd6eb1acefdd9395fa061f8e13b07c70
055af7c62ba13100fb7dc5f4faba8fc04e38de2b
/DressMe/ClothPickerButton.swift
42f90fa7060e4aac3b30d4d3fb9de4431032aa39
[]
no_license
hvaghasia/DressMe
43b68ae41607129aefa8bca667cb0ef18a8f77db
7e66a2903c0566e8681a314ad87f23be19f5b4de
refs/heads/master
2021-01-10T10:09:57.822867
2015-11-10T10:35:25
2015-11-10T10:35:25
45,904,528
1
0
null
null
null
null
UTF-8
Swift
false
false
1,705
swift
// // ClothPickerButton.swift // DressMe // // Created by Hardik on 10/11/15. // Copyright © 2015 Hardik. All rights reserved. // import Foundation import UIKit class ClothPickerButton: UIButton { private var buttonSize: CGFloat = 150 convenience init(title: String, bkgColor: UIColor, buttonSize: CGFloat, action: Selector, target: AnyObject) { self.init() self.setTitle(title, forState: .Normal) self.backgroundColor = bkgColor self.layer.cornerRadius = 0.5 * buttonSize self.addTarget(target, action: action, forControlEvents: .TouchUpInside) self.translatesAutoresizingMaskIntoConstraints = false self.buttonSize = buttonSize } func applyConstraints(var constraintsToSuperView: [NSLayoutConstraint]) { let horizontalCenter = NSLayoutConstraint(item: self, attribute: NSLayoutAttribute.CenterX, relatedBy: NSLayoutRelation.Equal, toItem: self.superview, attribute: NSLayoutAttribute.CenterX, multiplier: 1, constant: 0) constraintsToSuperView.append(horizontalCenter) self.superview?.addConstraints(constraintsToSuperView) let height = NSLayoutConstraint(item: self, attribute: NSLayoutAttribute.Height, relatedBy: NSLayoutRelation.Equal, toItem: nil, attribute: NSLayoutAttribute.Height, multiplier: 1, constant: self.buttonSize) self.addConstraint(height) let width = NSLayoutConstraint(item: self, attribute: NSLayoutAttribute.Width, relatedBy: NSLayoutRelation.Equal, toItem: nil, attribute: NSLayoutAttribute.Width, multiplier: 1, constant: self.buttonSize) self.addConstraint(width) } }
[ -1 ]
27042501559602f01277a335dbfc0d83e38ed48e
8f0832f033557399f0c33f2303964815a76ade0c
/Count4/AppDelegate.swift
8460eee1ade728a856a93b4976de5f34faa0c481
[]
no_license
nana-i/count
5c7c91d01d383e93bebe6eaeedcfb6bb6f88617b
6b879b1161180f13d39f794792aa0fbe74650697
refs/heads/master
2021-01-02T08:50:03.700951
2017-08-02T07:13:31
2017-08-02T07:13:31
99,076,070
0
0
null
null
null
null
UTF-8
Swift
false
false
2,175
swift
// // AppDelegate.swift // Count4 // // Created by nttr on 2017/08/02. // Copyright © 2017年 net.nana.ichikawa. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } func applicationWillResignActive(_ application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. } func applicationDidEnterBackground(_ application: UIApplication) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } func applicationWillEnterForeground(_ application: UIApplication) { // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. } func applicationDidBecomeActive(_ application: UIApplication) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } }
[ 229380, 229383, 229385, 278539, 294924, 229388, 278542, 229391, 327695, 278545, 229394, 278548, 229397, 229399, 229402, 352284, 229405, 278556, 278559, 229408, 278564, 294950, 229415, 229417, 327722, 237613, 229422, 360496, 229426, 237618, 229428, 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, 295110, 286922, 286924, 286926, 319694, 286928, 131281, 278743, 278747, 295133, 155872, 319716, 237807, 303345, 286962, 303347, 131314, 229622, 327930, 278781, 278783, 278785, 237826, 319751, 278792, 286987, 319757, 311569, 286999, 319770, 287003, 287006, 287009, 287012, 287014, 287016, 287019, 311598, 287023, 262448, 311601, 295220, 287032, 155966, 319809, 319810, 278849, 319814, 311623, 319818, 311628, 229709, 319822, 287054, 278865, 229717, 196963, 196969, 139638, 213367, 106872, 319872, 311683, 319879, 311693, 65943, 319898, 311719, 278952, 139689, 278957, 311728, 278967, 180668, 311741, 278975, 319938, 278980, 98756, 278983, 319945, 278986, 319947, 278990, 278994, 311767, 279003, 279006, 188895, 172512, 287202, 279010, 279015, 172520, 319978, 279020, 172526, 311791, 279023, 172529, 279027, 319989, 172534, 180727, 164343, 279035, 311804, 287230, 279040, 303617, 287234, 279045, 172550, 303623, 172552, 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, 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, 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, 234648, 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, 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, 148946, 288214, 239064, 288217, 329177, 280027, 288220, 288218, 239070, 288224, 280034, 288226, 280036, 288229, 280038, 288230, 288232, 370146, 288234, 320998, 288236, 288238, 288240, 288242, 296435, 288244, 288250, 296446, 321022, 402942, 148990, 296450, 206336, 230916, 230919, 214535, 230923, 304651, 304653, 370187, 402969, 230940, 222752, 108066, 296486, 296488, 157229, 239152, 230961, 157236, 288320, 288325, 124489, 280140, 280145, 288338, 280149, 288344, 280152, 239194, 280158, 403039, 370272, 181854, 239202, 370279, 312938, 280183, 280185, 280188, 280191, 116354, 280194, 280208, 280211, 288408, 280218, 280222, 419489, 190118, 198310, 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, 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, 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, 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, 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, 142226, 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, 196133, 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, 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, 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, 127440, 315860, 176597, 283095, 127447, 299481, 127449, 176605, 242143, 127455, 127457, 291299, 340454, 127463, 242152, 291305, 127466, 176620, 127469, 127474, 291314, 291317, 127480, 135672, 291323, 233979, 127485, 291330, 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, 324768, 283805, 234657, 242852, 300197, 234661, 283813, 234664, 275626, 234667, 316596, 308414, 234687, 300223, 300226, 308418, 234692, 300229, 308420, 308422, 226500, 283844, 300234, 283850, 300238, 300241, 316625, 300243, 300245, 316630, 300248, 300253, 300256, 300258, 300260, 234726, 300263, 300265, 300267, 161003, 300270, 300272, 120053, 300278, 275703, 316663, 300284, 275710, 300287, 292097, 300289, 161027, 300292, 300294, 275719, 234760, 177419, 300299, 242957, 300301, 283917, 177424, 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, 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, 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, 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, 292845, 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, 121458, 277106, 170618, 170619, 309885, 309888, 277122, 227975, 277128, 285320, 301706, 318092, 326285, 334476, 318094, 277136, 277139, 227992, 334488, 318108, 285340, 318110, 227998, 137889, 383658, 285357, 318128, 277170, 293555, 342707, 154292, 318132, 277173, 285368, 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, 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, 310780, 40448, 228864, 286214, 228871, 302603, 65038, 302614, 286233, 302617, 302621, 286240, 146977, 187936, 187939, 40484, 294435, 40486, 286246, 294440, 40488, 294439, 294443, 40491, 294445, 278057, 310831, 245288, 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, 280021, 188252, 237409, 229233, 294776, 360317, 294785, 327554, 360322, 40840, 40851, 294803, 188312, 294811, 237470, 319390, 40865, 319394, 294817, 294821, 311209, 180142, 343983, 294831, 188340, 40886, 319419, 294844, 294847, 393177, 294876, 294879, 294883, 393190, 294890, 311279, 278513, 237555, 278516, 311283, 278519, 237562 ]
ad0ca49607d10ed511e8c4cf2c435f77d7450818
4c50e86a33b2b899c59487b854faecd88ccde836
/MovieTests/MovieTests.swift
5ffa8e30c4ed1254ad31c76bece085c839df73e6
[ "MIT" ]
permissive
tomdwipo/movie-mvvm
d7d6aac5b569aa71148346ba1b4ef12f7b72beee
a22c5e7ab4a9a1438745681884ee56d16b073a7e
refs/heads/master
2022-11-15T00:08:28.111664
2020-07-02T05:25:23
2020-07-02T05:25:23
null
0
0
null
null
null
null
UTF-8
Swift
false
false
882
swift
// // MovieTests.swift // MovieTests // // Created by user on 29/06/20. // Copyright © 2020 Tommy. All rights reserved. // import XCTest @testable import Movie class MovieTests: 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. } } }
[ 98333, 16419, 229413, 204840, 278570, 344107, 253999, 229424, 229430, 319542, 352326, 254027, 311372, 311374, 196691, 278615, 180311, 180312, 237663, 278634, 131178, 319598, 352368, 204916, 131191, 237689, 131198, 278655, 319629, 311438, 278677, 278685, 311458, 278691, 49316, 32941, 278704, 278708, 131256, 180408, 295098, 254170, 286958, 344313, 327929, 180493, 278797, 254226, 319763, 278816, 98610, 278842, 287041, 319813, 139589, 319821, 254286, 344401, 155990, 106847, 246127, 139640, 246136, 246137, 311691, 246178, 377264, 278970, 319930, 311738, 336317, 311745, 278978, 188871, 278989, 278993, 278999, 328152, 369116, 287198, 279008, 279013, 279018, 311786, 319987, 279029, 279032, 279039, 287241, 279050, 279062, 279065, 377386, 352829, 115270, 377418, 295519, 66150, 344680, 279146, 295536, 287346, 279164, 189057, 311941, 279177, 369289, 344715, 311949, 352917, 230040, 271000, 295576, 221852, 279206, 295590, 287404, 295599, 205487, 303793, 164533, 287417, 287422, 66242, 279252, 287452, 295652, 221948, 279294, 205568, 295682, 312079, 295697, 336671, 344865, 279336, 295724, 353069, 312108, 328499, 353078, 230199, 353079, 336702, 295746, 353094, 353095, 353109, 230234, 303972, 230248, 246641, 246648, 279417, 361337, 254850, 287622, 295824, 189348, 353195, 140204, 353197, 230332, 189374, 353215, 353216, 213960, 345033, 279498, 50143, 123881, 304110, 320494, 287731, 295927, 304122, 320507, 328700, 312314, 328706, 320516, 353290, 230410, 320527, 238610, 418837, 320536, 197657, 336929, 189474, 369701, 345132, 238639, 238651, 214086, 238664, 296019, 353367, 156764, 156765, 230499, 312434, 353397, 337017, 279685, 222343, 296086, 296092, 238765, 279728, 230588, 353479, 353481, 353482, 189652, 189653, 279765, 148696, 296153, 279774, 304351, 304356, 279792, 353523, 320770, 279814, 312587, 328971, 320796, 115998, 279854, 345396, 116026, 222524, 279875, 312648, 230729, 238927, 296273, 222559, 230756, 230765, 296303, 279920, 312689, 116084, 181625, 337281, 378244, 304524, 296335, 9619, 279974, 173491, 279989, 280004, 361927, 296392, 370123, 148940, 280013, 312782, 222675, 329173, 353750, 280041, 361963, 329200, 321009, 280055, 288249, 230913, 230921, 329225, 304656, 329232, 230943, 230959, 288309, 288318, 280130, 124485, 288326, 288327, 280147, 157281, 312940, 222832, 370296, 247416, 337535, 312965, 288392, 239250, 345752, 255649, 321199, 321207, 296632, 337591, 280251, 280257, 321219, 280267, 9936, 9937, 313041, 280278, 280280, 18138, 321247, 321249, 280300, 313081, 124669, 288512, 280329, 321295, 321302, 116505, 321310, 313120, 247590, 296755, 321337, 280392, 345929, 18262, 370522, 280410, 345951, 362337, 345955, 296806, 288619, 296814, 280430, 362352, 313203, 124798, 182144, 305026, 247686, 247687, 67463, 329622, 124824, 214937, 214938, 354212, 313254, 124852, 288697, 214977, 280514, 214984, 247757, 231375, 280541, 329695, 337895, 247785, 296941, 362480, 223218, 313339, 313357, 182296, 239650, 329765, 354343, 354345, 223274, 124975, 346162, 124984, 288828, 288833, 288834, 354385, 280661, 329814, 338007, 354393, 280675, 280677, 43110, 313447, 321637, 329829, 288879, 280694, 223350, 288889, 215164, 313469, 215166, 329859, 280712, 215178, 346271, 239793, 125109, 182456, 280762, 379071, 280768, 338119, 321745, 280795, 338150, 346346, 321772, 125169, 338164, 125183, 125188, 313608, 125193, 321800, 125198, 125203, 338197, 125208, 305440, 125217, 125235, 280887, 125240, 182597, 182598, 280902, 289110, 272729, 379225, 354655, 321894, 280939, 313713, 354676, 362881, 248194, 395659, 395661, 240016, 108944, 141728, 289189, 289194, 108972, 281037, 281040, 289232, 330218, 281072, 109042, 289304, 182817, 174648, 338490, 322120, 281166, 281171, 354911, 436832, 191082, 313966, 281199, 330379, 330387, 330388, 117397, 338613, 289462, 314040, 109241, 158394, 248517, 363211, 289502, 363230, 338662, 346858, 330474, 289518, 199414, 35583, 363263, 322313, 322319, 166676, 207640, 281377, 420677, 281427, 281433, 322395, 109409, 330609, 174963, 109428, 207732, 240518, 109447, 289690, 289698, 289703, 240552, 289722, 363458, 338899, 248797, 207838, 314342, 52200, 289774, 240630, 314362, 134150, 330763, 281626, 175132, 330788, 248872, 322612, 314448, 339030, 281697, 314467, 281700, 322663, 281706, 207979, 363644, 150657, 248961, 330888, 339102, 306346, 339130, 208058, 322749, 290000, 298212, 290022, 330984, 298228, 216315, 208124, 388349, 363771, 322824, 126237, 298291, 224586, 372043, 331090, 314709, 314710, 134491, 314720, 134506, 306542, 314739, 249204, 249205, 290169, 306559, 224640, 306560, 298374, 314758, 314760, 388487, 142729, 314766, 306579, 224661, 282007, 290207, 314783, 314789, 282024, 241066, 314798, 380357, 306631, 191981, 282096, 191990, 290301, 282114, 323080, 323087, 323089, 282141, 282146, 306723, 290358, 282183, 224847, 118353, 290390, 306776, 44635, 282213, 323178, 224883, 314998, 323196, 175741, 339585, 224901, 282245, 282246, 290443, 323217, 282259, 282273, 257699, 323236, 298661, 282280, 61101, 282303, 323264, 306890, 282318, 241361, 241365, 298712, 298720, 282339, 12010, 282348, 282358, 175873, 323331, 323332, 216839, 323346, 249626, 282400, 241441, 339745, 315171, 257830, 282417, 200498, 282427, 315202, 307011, 282434, 282438, 323406, 413521, 307031, 307039, 282474, 282480, 241528, 315264, 241540, 315273, 315274, 110480, 282518, 282519, 118685, 298909, 323507, 282549, 290746, 298980, 282633, 241692, 102437, 315434, 233517, 282672, 241716, 315465, 315476, 307289, 200794, 307299, 315498, 299121, 233589, 233590, 241808, 323729, 233636, 323762, 299187, 184505, 299198, 258239, 299203, 282831, 356576, 176362, 184570, 299293, 233762, 217380, 151847, 282919, 332083, 332085, 332089, 315706, 282939, 241986, 332101, 323916, 348492, 250192, 323920, 282960, 348500, 168281, 332123, 323935, 332127, 242029, 242033, 291192, 315770, 315773, 291198, 225670, 332167, 242058, 291224, 283038, 242078, 61857, 315810, 61859, 315811, 381347, 340398, 61873, 299441, 61880, 283064, 291265, 127427, 127428, 283075, 291267, 324039, 373197, 176601, 242139, 160225, 242148, 127465, 233978, 324097, 340490, 291358, 283184, 234036, 315960, 348742, 348749, 111208, 291454, 348806, 184973, 316049, 111253, 111258, 299699, 299700, 242386, 299746, 299759, 299776, 242433, 291585, 291592, 291604, 291612, 152365, 242485, 299849, 283467, 201549, 242529, 357218, 275303, 177001, 201577, 242541, 209783, 209785, 177019, 291712, 316298, 308107, 308112, 209817, 324506, 324507, 127902, 324517, 316333, 316343, 349121, 316364, 340955, 340961, 324586, 340974, 316405, 201720, 324625, 308243, 316437, 201755, 300068, 357414, 300084, 324666, 21569, 300111, 341073, 250981, 300135, 300136, 316520, 316526, 357486, 144496, 300150, 300151, 291959, 160891, 341115, 300158, 349316, 349318, 169104, 177296, 308372, 185493, 119962, 300187, 300188, 283802, 300201, 300202, 259268, 283847, 62665, 283852, 283853, 316627, 357595, 333022, 234733, 292091, 316669, 234755, 242954, 292107, 251153, 177428, 333090, 300343, 333117, 193859, 300359, 177484, 251213, 120148, 283991, 357719, 316765, 234850, 292195, 333160, 243056, 111993, 112017, 112018, 234898, 357786, 333220, 316842, 210358, 284089, 292283, 415171, 300487, 300489, 284107, 366037, 210390, 210391, 210393, 144867, 103909, 316902, 54765, 251378, 333300, 333303, 300536, 300542, 210433, 366083, 292356, 316946, 308756, 398869, 308764, 349726, 333343, 349741, 169518, 235070, 194110, 349763, 292423, 292425, 243274, 128587, 333388, 333393, 349781, 300630, 235095, 128599, 333408, 374372, 243307, 54893, 333430, 366203, 325245, 218819, 333509, 333517, 333520, 333521, 333523, 153319, 284401, 325371, 194303, 194304, 284429, 284431, 243472, 161554, 366360, 284442, 325404, 325410, 341796, 333610, 284459, 317232, 325439, 325445, 153415, 341836, 325457, 317269, 284507, 300894, 284514, 276327, 292712, 325484, 292720, 325492, 300918, 333688, 317304, 194429, 325503, 333701, 243591, 325515, 243597, 325518, 333722, 300963, 292771, 333735, 284587, 292782, 317360, 243637, 284619, 219101, 292836, 317415, 325619, 333817, 292858, 333828, 145435, 317467, 292902, 325674, 358456, 309345, 284788, 333940, 292992, 333955, 235662, 325776, 317587, 284826, 333991, 333992, 284842, 333996, 227513, 301251, 309444, 227524, 194782, 317664, 243962, 309503, 194820, 375051, 325905, 325912, 309529, 227616, 211235, 211238, 260418, 325968, 6481, 366929, 366930, 6489, 334171, 391520, 211326, 227725, 178582, 293274, 317852, 285084, 285090, 375207, 293310, 317901, 326100, 285150, 342498, 195045, 301571, 342536, 342548, 342553, 375333, 293419, 244269, 23092, 301638, 55881, 244310, 244327, 301689, 244347, 227990, 342682, 342706, 342713, 285373, 154316, 318173, 285415, 154359, 162561, 285444, 326414, 285458, 326429, 293664, 326433, 318250, 318252, 285487, 301871, 285497, 293693, 318278, 293711, 301918, 293730, 351077, 342887, 400239, 310131, 269178, 359298, 113542, 416646, 228233, 228234, 236428, 56208, 293781, 326553, 318364, 310182, 236461, 293806, 359387, 130016, 64485, 203757, 359406, 277492, 293886, 293893, 146448, 326685, 318514, 252980, 359478, 302139, 359495, 228458, 318572, 15471, 187506, 285820, 187521, 302213, 228491, 228493, 285838, 162961, 326804, 285851, 302240, 343203, 253099, 367799, 64700, 228540, 228542, 343234, 367810, 244940, 228563, 228588, 253167, 228609, 318733, 245019, 130338, 130343, 351537, 171317, 318775, 286013, 286018, 113987, 294218, 318805, 294243, 163175, 327024, 327025, 327031, 318848, 294275, 179587, 368011, 212375, 318875, 310692, 245161, 286129, 228795, 302529, 302531, 163268, 310732, 302540, 64975, 310736, 327121, 228827, 286172, 310757, 187878, 245223, 343542, 343543, 286202, 286205, 228867, 253452, 146964, 187938, 286244, 245287, 245292, 286254, 56902, 228943, 196187, 343647, 286306, 204397, 138863, 294529, 286343, 229001, 310923, 188048, 302739, 229020, 245412, 40613, 40614, 40615, 229029, 319162, 327358, 286399, 212685, 245457, 302802, 286423, 278234, 294622, 278240, 229088, 212716, 212717, 286459, 278272, 319233, 278291, 294678, 294700, 360252, 319292, 188251, 245599, 237408, 302946, 188292, 253829, 327557, 294807, 294809, 311199, 319392, 294823, 294843, 163781, 344013, 212946, 24532, 294886, 253929, 327661, 278512, 311281, 311282 ]
001233a7a7008331b118e549bef716c56adf009d
7dbf1db1631cb3b1aa048de8f6a9ff833c1aee63
/PortfolioApp/Views/ExpirencesView.swift
0fd93c87ca567a0382d7c00a96bb0340bd7bf72a
[]
no_license
rushi-pa/PortfolioApp
9fa2b2090c9b8bb8fdb8ba8e0e2f99ae32ebe95f
1932e4dac5c148a3c877c66e07722be86a7b8c6a
refs/heads/main
2023-08-15T10:36:50.513113
2021-09-25T01:33:56
2021-09-25T01:33:56
403,709,165
0
0
null
null
null
null
UTF-8
Swift
false
false
1,504
swift
// // ExpirencesView.swift // PortfolioApp // // Created by Rushi Patel on 2021-09-11. // import SwiftUI struct ExpirencesView: View { var expirences : [Experience]; @State var showExpirence = false var body: some View { VStack{ VStack(alignment: .leading, spacing : 24){ HStack(spacing: 16){ Text("Experiences") .font(Montserrat.bold.font(size: 21)) .opacity(0.7); Button(action: { withAnimation(.easeInOut(duration: 0.35)){ self.showExpirence.toggle() } }, label: { Image(systemName: "chevron.up") .font(.system(size: 18, weight: .medium)) .rotationEffect(self.showExpirence ? .zero : .degrees(180)) }).buttonStyle(PlainButtonStyle()); } .padding(.bottom,14) if(showExpirence) { ForEach(expirences) { experience in ExpirenceView(experience: experience) } } }.padding() }.fixedSize() } } struct ExpirencesView_Previews: PreviewProvider { static var previews: some View { GeometryReader{proxy in ExpirencesView(expirences: AppModel().portfolio.experience) } } }
[ -1 ]
f3af8fbbf0f7636b84f715fe07a18cdda94ff02f
3c060415a23fe2509807ae8c95c1cef3ac835d54
/Sources/SampleSwiftyModbusResult/main.swift
2a106ade440bf57213c285f7655f5acb5f35a49b
[ "MIT" ]
permissive
DimaRU/SampleSwiftyModbus
103c6550beadeb2809e3d70a274a56f44a3214d7
7d6c5bc6f2317f5fe1e097d1dd9bb63833d6ce48
refs/heads/master
2023-08-30T12:19:05.918032
2021-10-23T14:59:00
2021-10-23T14:59:00
null
0
0
null
null
null
null
UTF-8
Swift
false
false
1,044
swift
import Foundation import SwiftyModbus let modbusQueue = DispatchQueue(label: "queue.modbus") modbusQueue.async { modbusIO() } RunLoop.main.run() func modbusIO() { let modbus = SwiftyModbusResult(address: "127.0.0.1", port: 503) modbus.responseTimeout = 1.5 // Set response timeout for 1.5 sec print("Modbus responce timeout:", modbus.responseTimeout) if case let .failure(error) = modbus.connect() { print(error.message) exit(1) } do { let registers = try modbus.readRegisters(addr: 102, count: 10).get() print(registers) try modbus.writeRegisters(addr: 102, data: [1,2,3,4,5,6,7,8,9,10]).get() let inputRegisters = try modbus.readInputRegisters(addr: 102, count: 10).get() print(inputRegisters) try modbus.writeBits(addr: 104, status: [0,1,0,1]).get() let bits = try modbus.readBits(addr: 104, count: 4).get() print(bits) modbus.disconnect() exit(0) } catch { print(error) exit(1) } }
[ -1 ]
a07364b5466e1a14214a6638b3386cd8eec422e9
61079b4989efad4e6ecdf843747607f0bfde87a3
/Twitter/Tweet.swift
5d0967dd1f48e208d7710375e22657b96c015f5e
[]
no_license
xke/Twitter-Contd
eb73d3394ed7fe7d9367121126f6b50072cec47c
d51113d4c80ade827c98d6e06349f1ed7776c5b8
refs/heads/master
2021-01-10T01:21:39.041277
2015-10-11T20:13:29
2015-10-11T20:13:29
44,067,669
0
0
null
null
null
null
UTF-8
Swift
false
false
1,754
swift
// // Tweet.swift // Twitter // // Created by Xian on 10/3/15. // Copyright © 2015 swifterlabs. All rights reserved. // import UIKit class Tweet: NSObject { var user: User? var text: String? var createdAtString: String? var createdAt: NSDate? var idStr: String? // used for infinite loading init(dictionary: NSDictionary) { // api reference: https://dev.twitter.com/rest/reference/post/statuses/update user = User(dictionary: dictionary["user"] as! NSDictionary) text = dictionary["text"] as? String createdAtString = dictionary["created_at"] as? String idStr = dictionary["id_str"] as? String let formatter = NSDateFormatter() formatter.dateFormat = "EEE MMM d HH:mm:ss Z y" createdAt = formatter.dateFromString(createdAtString!) // and spit back the string in a more readable form! formatter.dateFormat = "EEE MMM d, y - HH:mm a" createdAtString = formatter.stringFromDate(createdAt!) } class func formatTimeElapsed(sinceDate: NSDate) -> String { let formatter = NSDateComponentsFormatter() formatter.unitsStyle = NSDateComponentsFormatterUnitsStyle.Abbreviated formatter.collapsesLargestUnit = true formatter.maximumUnitCount = 1 let interval = NSDate().timeIntervalSinceDate(sinceDate) return formatter.stringFromTimeInterval(interval)! } class func tweetsWithArray(array: [NSDictionary]) -> [Tweet] { var tweets = [Tweet]() for dictionary in array { tweets.append(Tweet(dictionary: dictionary)) } return tweets } }
[ -1 ]
20c69503fec7e0a7cefaba828eb0d5ec39232946
bebcdcf37a23d58f74cf7772009122a83034c880
/SourceryRuntime/Sources/Generated/Equality.generated.swift
58da307b69377c4fe9895e435ef8468c84c8440c
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
nagyist/Sourcery
0e92dc61526634f5ca269a2750e5238d2b156985
7c04194eb422c753df83e951247e5968113198d7
refs/heads/master
2023-08-17T04:14:10.809616
2023-08-12T14:51:53
2023-08-12T14:51:53
77,846,187
0
0
MIT
2023-09-14T04:26:57
2017-01-02T16:23:21
Swift
UTF-8
Swift
false
false
27,844
swift
// Generated using Sourcery 2.0.2 — https://github.com/krzysztofzablocki/Sourcery // DO NOT EDIT // swiftlint:disable vertical_whitespace extension Actor { /// :nodoc: public override func isEqual(_ object: Any?) -> Bool { guard let rhs = object as? Actor else { return false } return super.isEqual(rhs) } } extension ArrayType { /// :nodoc: public override func isEqual(_ object: Any?) -> Bool { guard let rhs = object as? ArrayType else { return false } if self.name != rhs.name { return false } if self.elementTypeName != rhs.elementTypeName { return false } return true } } extension AssociatedType { /// :nodoc: public override func isEqual(_ object: Any?) -> Bool { guard let rhs = object as? AssociatedType else { return false } if self.name != rhs.name { return false } if self.typeName != rhs.typeName { return false } return true } } extension AssociatedValue { /// :nodoc: public override func isEqual(_ object: Any?) -> Bool { guard let rhs = object as? AssociatedValue else { return false } if self.localName != rhs.localName { return false } if self.externalName != rhs.externalName { return false } if self.typeName != rhs.typeName { return false } if self.defaultValue != rhs.defaultValue { return false } if self.annotations != rhs.annotations { return false } return true } } extension Attribute { /// :nodoc: public override func isEqual(_ object: Any?) -> Bool { guard let rhs = object as? Attribute else { return false } if self.name != rhs.name { return false } if self.arguments != rhs.arguments { return false } if self._description != rhs._description { return false } return true } } extension BytesRange { /// :nodoc: public override func isEqual(_ object: Any?) -> Bool { guard let rhs = object as? BytesRange else { return false } if self.offset != rhs.offset { return false } if self.length != rhs.length { return false } return true } } extension Class { /// :nodoc: public override func isEqual(_ object: Any?) -> Bool { guard let rhs = object as? Class else { return false } return super.isEqual(rhs) } } extension ClosureParameter { /// :nodoc: public override func isEqual(_ object: Any?) -> Bool { guard let rhs = object as? ClosureParameter else { return false } if self.argumentLabel != rhs.argumentLabel { return false } if self.name != rhs.name { return false } if self.typeName != rhs.typeName { return false } if self.`inout` != rhs.`inout` { return false } if self.defaultValue != rhs.defaultValue { return false } if self.annotations != rhs.annotations { return false } return true } } extension ClosureType { /// :nodoc: public override func isEqual(_ object: Any?) -> Bool { guard let rhs = object as? ClosureType else { return false } if self.name != rhs.name { return false } if self.parameters != rhs.parameters { return false } if self.returnTypeName != rhs.returnTypeName { return false } if self.isAsync != rhs.isAsync { return false } if self.asyncKeyword != rhs.asyncKeyword { return false } if self.`throws` != rhs.`throws` { return false } if self.throwsOrRethrowsKeyword != rhs.throwsOrRethrowsKeyword { return false } return true } } extension DictionaryType { /// :nodoc: public override func isEqual(_ object: Any?) -> Bool { guard let rhs = object as? DictionaryType else { return false } if self.name != rhs.name { return false } if self.valueTypeName != rhs.valueTypeName { return false } if self.keyTypeName != rhs.keyTypeName { return false } return true } } extension DiffableResult { /// :nodoc: public override func isEqual(_ object: Any?) -> Bool { guard let rhs = object as? DiffableResult else { return false } if self.identifier != rhs.identifier { return false } return true } } extension Enum { /// :nodoc: public override func isEqual(_ object: Any?) -> Bool { guard let rhs = object as? Enum else { return false } if self.cases != rhs.cases { return false } if self.rawTypeName != rhs.rawTypeName { return false } return super.isEqual(rhs) } } extension EnumCase { /// :nodoc: public override func isEqual(_ object: Any?) -> Bool { guard let rhs = object as? EnumCase else { return false } if self.name != rhs.name { return false } if self.rawValue != rhs.rawValue { return false } if self.associatedValues != rhs.associatedValues { return false } if self.annotations != rhs.annotations { return false } if self.documentation != rhs.documentation { return false } if self.indirect != rhs.indirect { return false } return true } } extension FileParserResult { /// :nodoc: public override func isEqual(_ object: Any?) -> Bool { guard let rhs = object as? FileParserResult else { return false } if self.path != rhs.path { return false } if self.module != rhs.module { return false } if self.types != rhs.types { return false } if self.functions != rhs.functions { return false } if self.typealiases != rhs.typealiases { return false } if self.inlineRanges != rhs.inlineRanges { return false } if self.inlineIndentations != rhs.inlineIndentations { return false } if self.modifiedDate != rhs.modifiedDate { return false } if self.sourceryVersion != rhs.sourceryVersion { return false } return true } } extension GenericRequirement { /// :nodoc: public override func isEqual(_ object: Any?) -> Bool { guard let rhs = object as? GenericRequirement else { return false } if self.leftType != rhs.leftType { return false } if self.rightType != rhs.rightType { return false } if self.relationship != rhs.relationship { return false } if self.relationshipSyntax != rhs.relationshipSyntax { return false } return true } } extension GenericType { /// :nodoc: public override func isEqual(_ object: Any?) -> Bool { guard let rhs = object as? GenericType else { return false } if self.name != rhs.name { return false } if self.typeParameters != rhs.typeParameters { return false } return true } } extension GenericTypeParameter { /// :nodoc: public override func isEqual(_ object: Any?) -> Bool { guard let rhs = object as? GenericTypeParameter else { return false } if self.typeName != rhs.typeName { return false } return true } } extension Import { /// :nodoc: public override func isEqual(_ object: Any?) -> Bool { guard let rhs = object as? Import else { return false } if self.kind != rhs.kind { return false } if self.path != rhs.path { return false } return true } } extension Method { /// :nodoc: public override func isEqual(_ object: Any?) -> Bool { guard let rhs = object as? Method else { return false } if self.name != rhs.name { return false } if self.selectorName != rhs.selectorName { return false } if self.parameters != rhs.parameters { return false } if self.returnTypeName != rhs.returnTypeName { return false } if self.isAsync != rhs.isAsync { return false } if self.`throws` != rhs.`throws` { return false } if self.`rethrows` != rhs.`rethrows` { return false } if self.accessLevel != rhs.accessLevel { return false } if self.isStatic != rhs.isStatic { return false } if self.isClass != rhs.isClass { return false } if self.isFailableInitializer != rhs.isFailableInitializer { return false } if self.annotations != rhs.annotations { return false } if self.documentation != rhs.documentation { return false } if self.definedInTypeName != rhs.definedInTypeName { return false } if self.attributes != rhs.attributes { return false } if self.modifiers != rhs.modifiers { return false } return true } } extension MethodParameter { /// :nodoc: public override func isEqual(_ object: Any?) -> Bool { guard let rhs = object as? MethodParameter else { return false } if self.argumentLabel != rhs.argumentLabel { return false } if self.name != rhs.name { return false } if self.typeName != rhs.typeName { return false } if self.`inout` != rhs.`inout` { return false } if self.isVariadic != rhs.isVariadic { return false } if self.defaultValue != rhs.defaultValue { return false } if self.annotations != rhs.annotations { return false } return true } } extension Modifier { /// :nodoc: public override func isEqual(_ object: Any?) -> Bool { guard let rhs = object as? Modifier else { return false } if self.name != rhs.name { return false } if self.detail != rhs.detail { return false } return true } } extension Protocol { /// :nodoc: public override func isEqual(_ object: Any?) -> Bool { guard let rhs = object as? Protocol else { return false } if self.associatedTypes != rhs.associatedTypes { return false } if self.genericRequirements != rhs.genericRequirements { return false } return super.isEqual(rhs) } } extension ProtocolComposition { /// :nodoc: public override func isEqual(_ object: Any?) -> Bool { guard let rhs = object as? ProtocolComposition else { return false } if self.composedTypeNames != rhs.composedTypeNames { return false } return super.isEqual(rhs) } } extension Struct { /// :nodoc: public override func isEqual(_ object: Any?) -> Bool { guard let rhs = object as? Struct else { return false } return super.isEqual(rhs) } } extension Subscript { /// :nodoc: public override func isEqual(_ object: Any?) -> Bool { guard let rhs = object as? Subscript else { return false } if self.parameters != rhs.parameters { return false } if self.returnTypeName != rhs.returnTypeName { return false } if self.readAccess != rhs.readAccess { return false } if self.writeAccess != rhs.writeAccess { return false } if self.annotations != rhs.annotations { return false } if self.documentation != rhs.documentation { return false } if self.definedInTypeName != rhs.definedInTypeName { return false } if self.attributes != rhs.attributes { return false } if self.modifiers != rhs.modifiers { return false } return true } } extension TemplateContext { /// :nodoc: public override func isEqual(_ object: Any?) -> Bool { guard let rhs = object as? TemplateContext else { return false } if self.parserResult != rhs.parserResult { return false } if self.functions != rhs.functions { return false } if self.types != rhs.types { return false } if self.argument != rhs.argument { return false } return true } } extension TupleElement { /// :nodoc: public override func isEqual(_ object: Any?) -> Bool { guard let rhs = object as? TupleElement else { return false } if self.name != rhs.name { return false } if self.typeName != rhs.typeName { return false } return true } } extension TupleType { /// :nodoc: public override func isEqual(_ object: Any?) -> Bool { guard let rhs = object as? TupleType else { return false } if self.name != rhs.name { return false } if self.elements != rhs.elements { return false } return true } } extension Type { /// :nodoc: public override func isEqual(_ object: Any?) -> Bool { guard let rhs = object as? Type else { return false } if self.module != rhs.module { return false } if self.imports != rhs.imports { return false } if self.typealiases != rhs.typealiases { return false } if self.isExtension != rhs.isExtension { return false } if self.accessLevel != rhs.accessLevel { return false } if self.isUnknownExtension != rhs.isUnknownExtension { return false } if self.isGeneric != rhs.isGeneric { return false } if self.localName != rhs.localName { return false } if self.rawVariables != rhs.rawVariables { return false } if self.rawMethods != rhs.rawMethods { return false } if self.rawSubscripts != rhs.rawSubscripts { return false } if self.annotations != rhs.annotations { return false } if self.documentation != rhs.documentation { return false } if self.inheritedTypes != rhs.inheritedTypes { return false } if self.inherits != rhs.inherits { return false } if self.containedTypes != rhs.containedTypes { return false } if self.parentName != rhs.parentName { return false } if self.attributes != rhs.attributes { return false } if self.modifiers != rhs.modifiers { return false } if self.fileName != rhs.fileName { return false } if self.kind != rhs.kind { return false } return true } } extension TypeName { /// :nodoc: public override func isEqual(_ object: Any?) -> Bool { guard let rhs = object as? TypeName else { return false } if self.name != rhs.name { return false } if self.generic != rhs.generic { return false } if self.isProtocolComposition != rhs.isProtocolComposition { return false } if self.attributes != rhs.attributes { return false } if self.modifiers != rhs.modifiers { return false } if self.tuple != rhs.tuple { return false } if self.array != rhs.array { return false } if self.dictionary != rhs.dictionary { return false } if self.closure != rhs.closure { return false } return true } } extension Typealias { /// :nodoc: public override func isEqual(_ object: Any?) -> Bool { guard let rhs = object as? Typealias else { return false } if self.aliasName != rhs.aliasName { return false } if self.typeName != rhs.typeName { return false } if self.module != rhs.module { return false } if self.accessLevel != rhs.accessLevel { return false } if self.parentName != rhs.parentName { return false } return true } } extension Types { /// :nodoc: public override func isEqual(_ object: Any?) -> Bool { guard let rhs = object as? Types else { return false } if self.types != rhs.types { return false } if self.typealiases != rhs.typealiases { return false } return true } } extension Variable { /// :nodoc: public override func isEqual(_ object: Any?) -> Bool { guard let rhs = object as? Variable else { return false } if self.name != rhs.name { return false } if self.typeName != rhs.typeName { return false } if self.isComputed != rhs.isComputed { return false } if self.isAsync != rhs.isAsync { return false } if self.`throws` != rhs.`throws` { return false } if self.isStatic != rhs.isStatic { return false } if self.readAccess != rhs.readAccess { return false } if self.writeAccess != rhs.writeAccess { return false } if self.defaultValue != rhs.defaultValue { return false } if self.annotations != rhs.annotations { return false } if self.documentation != rhs.documentation { return false } if self.attributes != rhs.attributes { return false } if self.modifiers != rhs.modifiers { return false } if self.definedInTypeName != rhs.definedInTypeName { return false } return true } } // MARK: - Actor AutoHashable extension Actor { public override var hash: Int { var hasher = Hasher() hasher.combine(super.hash) return hasher.finalize() } } // MARK: - ArrayType AutoHashable extension ArrayType { public override var hash: Int { var hasher = Hasher() hasher.combine(self.name) hasher.combine(self.elementTypeName) return hasher.finalize() } } // MARK: - AssociatedType AutoHashable extension AssociatedType { public override var hash: Int { var hasher = Hasher() hasher.combine(self.name) hasher.combine(self.typeName) return hasher.finalize() } } // MARK: - AssociatedValue AutoHashable extension AssociatedValue { public override var hash: Int { var hasher = Hasher() hasher.combine(self.localName) hasher.combine(self.externalName) hasher.combine(self.typeName) hasher.combine(self.defaultValue) hasher.combine(self.annotations) return hasher.finalize() } } // MARK: - Attribute AutoHashable extension Attribute { public override var hash: Int { var hasher = Hasher() hasher.combine(self.name) hasher.combine(self.arguments) hasher.combine(self._description) return hasher.finalize() } } // MARK: - BytesRange AutoHashable extension BytesRange { public override var hash: Int { var hasher = Hasher() hasher.combine(self.offset) hasher.combine(self.length) return hasher.finalize() } } // MARK: - Class AutoHashable extension Class { public override var hash: Int { var hasher = Hasher() hasher.combine(super.hash) return hasher.finalize() } } // MARK: - ClosureParameter AutoHashable extension ClosureParameter { public override var hash: Int { var hasher = Hasher() hasher.combine(self.argumentLabel) hasher.combine(self.name) hasher.combine(self.typeName) hasher.combine(self.`inout`) hasher.combine(self.defaultValue) hasher.combine(self.annotations) return hasher.finalize() } } // MARK: - ClosureType AutoHashable extension ClosureType { public override var hash: Int { var hasher = Hasher() hasher.combine(self.name) hasher.combine(self.parameters) hasher.combine(self.returnTypeName) hasher.combine(self.isAsync) hasher.combine(self.asyncKeyword) hasher.combine(self.`throws`) hasher.combine(self.throwsOrRethrowsKeyword) return hasher.finalize() } } // MARK: - DictionaryType AutoHashable extension DictionaryType { public override var hash: Int { var hasher = Hasher() hasher.combine(self.name) hasher.combine(self.valueTypeName) hasher.combine(self.keyTypeName) return hasher.finalize() } } // MARK: - DiffableResult AutoHashable extension DiffableResult { public override var hash: Int { var hasher = Hasher() hasher.combine(self.identifier) return hasher.finalize() } } // MARK: - Enum AutoHashable extension Enum { public override var hash: Int { var hasher = Hasher() hasher.combine(self.cases) hasher.combine(self.rawTypeName) hasher.combine(super.hash) return hasher.finalize() } } // MARK: - EnumCase AutoHashable extension EnumCase { public override var hash: Int { var hasher = Hasher() hasher.combine(self.name) hasher.combine(self.rawValue) hasher.combine(self.associatedValues) hasher.combine(self.annotations) hasher.combine(self.documentation) hasher.combine(self.indirect) return hasher.finalize() } } // MARK: - FileParserResult AutoHashable extension FileParserResult { public override var hash: Int { var hasher = Hasher() hasher.combine(self.path) hasher.combine(self.module) hasher.combine(self.types) hasher.combine(self.functions) hasher.combine(self.typealiases) hasher.combine(self.inlineRanges) hasher.combine(self.inlineIndentations) hasher.combine(self.modifiedDate) hasher.combine(self.sourceryVersion) return hasher.finalize() } } // MARK: - GenericRequirement AutoHashable extension GenericRequirement { public override var hash: Int { var hasher = Hasher() hasher.combine(self.leftType) hasher.combine(self.rightType) hasher.combine(self.relationship) hasher.combine(self.relationshipSyntax) return hasher.finalize() } } // MARK: - GenericType AutoHashable extension GenericType { public override var hash: Int { var hasher = Hasher() hasher.combine(self.name) hasher.combine(self.typeParameters) return hasher.finalize() } } // MARK: - GenericTypeParameter AutoHashable extension GenericTypeParameter { public override var hash: Int { var hasher = Hasher() hasher.combine(self.typeName) return hasher.finalize() } } // MARK: - Import AutoHashable extension Import { public override var hash: Int { var hasher = Hasher() hasher.combine(self.kind) hasher.combine(self.path) return hasher.finalize() } } // MARK: - Method AutoHashable extension Method { public override var hash: Int { var hasher = Hasher() hasher.combine(self.name) hasher.combine(self.selectorName) hasher.combine(self.parameters) hasher.combine(self.returnTypeName) hasher.combine(self.isAsync) hasher.combine(self.`throws`) hasher.combine(self.`rethrows`) hasher.combine(self.accessLevel) hasher.combine(self.isStatic) hasher.combine(self.isClass) hasher.combine(self.isFailableInitializer) hasher.combine(self.annotations) hasher.combine(self.documentation) hasher.combine(self.definedInTypeName) hasher.combine(self.attributes) hasher.combine(self.modifiers) return hasher.finalize() } } // MARK: - MethodParameter AutoHashable extension MethodParameter { public override var hash: Int { var hasher = Hasher() hasher.combine(self.argumentLabel) hasher.combine(self.name) hasher.combine(self.typeName) hasher.combine(self.`inout`) hasher.combine(self.isVariadic) hasher.combine(self.defaultValue) hasher.combine(self.annotations) return hasher.finalize() } } // MARK: - Modifier AutoHashable extension Modifier { public override var hash: Int { var hasher = Hasher() hasher.combine(self.name) hasher.combine(self.detail) return hasher.finalize() } } // MARK: - Protocol AutoHashable extension Protocol { public override var hash: Int { var hasher = Hasher() hasher.combine(self.associatedTypes) hasher.combine(self.genericRequirements) hasher.combine(super.hash) return hasher.finalize() } } // MARK: - ProtocolComposition AutoHashable extension ProtocolComposition { public override var hash: Int { var hasher = Hasher() hasher.combine(self.composedTypeNames) hasher.combine(super.hash) return hasher.finalize() } } // MARK: - Struct AutoHashable extension Struct { public override var hash: Int { var hasher = Hasher() hasher.combine(super.hash) return hasher.finalize() } } // MARK: - Subscript AutoHashable extension Subscript { public override var hash: Int { var hasher = Hasher() hasher.combine(self.parameters) hasher.combine(self.returnTypeName) hasher.combine(self.readAccess) hasher.combine(self.writeAccess) hasher.combine(self.annotations) hasher.combine(self.documentation) hasher.combine(self.definedInTypeName) hasher.combine(self.attributes) hasher.combine(self.modifiers) return hasher.finalize() } } // MARK: - TemplateContext AutoHashable extension TemplateContext { public override var hash: Int { var hasher = Hasher() hasher.combine(self.parserResult) hasher.combine(self.functions) hasher.combine(self.types) hasher.combine(self.argument) return hasher.finalize() } } // MARK: - TupleElement AutoHashable extension TupleElement { public override var hash: Int { var hasher = Hasher() hasher.combine(self.name) hasher.combine(self.typeName) return hasher.finalize() } } // MARK: - TupleType AutoHashable extension TupleType { public override var hash: Int { var hasher = Hasher() hasher.combine(self.name) hasher.combine(self.elements) return hasher.finalize() } } // MARK: - Type AutoHashable extension Type { public override var hash: Int { var hasher = Hasher() hasher.combine(self.module) hasher.combine(self.imports) hasher.combine(self.typealiases) hasher.combine(self.isExtension) hasher.combine(self.accessLevel) hasher.combine(self.isUnknownExtension) hasher.combine(self.isGeneric) hasher.combine(self.localName) hasher.combine(self.rawVariables) hasher.combine(self.rawMethods) hasher.combine(self.rawSubscripts) hasher.combine(self.annotations) hasher.combine(self.documentation) hasher.combine(self.inheritedTypes) hasher.combine(self.inherits) hasher.combine(self.containedTypes) hasher.combine(self.parentName) hasher.combine(self.attributes) hasher.combine(self.modifiers) hasher.combine(self.fileName) hasher.combine(kind) return hasher.finalize() } } // MARK: - TypeName AutoHashable extension TypeName { public override var hash: Int { var hasher = Hasher() hasher.combine(self.name) hasher.combine(self.generic) hasher.combine(self.isProtocolComposition) hasher.combine(self.attributes) hasher.combine(self.modifiers) hasher.combine(self.tuple) hasher.combine(self.array) hasher.combine(self.dictionary) hasher.combine(self.closure) return hasher.finalize() } } // MARK: - Typealias AutoHashable extension Typealias { public override var hash: Int { var hasher = Hasher() hasher.combine(self.aliasName) hasher.combine(self.typeName) hasher.combine(self.module) hasher.combine(self.accessLevel) hasher.combine(self.parentName) return hasher.finalize() } } // MARK: - Types AutoHashable extension Types { public override var hash: Int { var hasher = Hasher() hasher.combine(self.types) hasher.combine(self.typealiases) return hasher.finalize() } } // MARK: - Variable AutoHashable extension Variable { public override var hash: Int { var hasher = Hasher() hasher.combine(self.name) hasher.combine(self.typeName) hasher.combine(self.isComputed) hasher.combine(self.isAsync) hasher.combine(self.`throws`) hasher.combine(self.isStatic) hasher.combine(self.readAccess) hasher.combine(self.writeAccess) hasher.combine(self.defaultValue) hasher.combine(self.annotations) hasher.combine(self.documentation) hasher.combine(self.attributes) hasher.combine(self.modifiers) hasher.combine(self.definedInTypeName) return hasher.finalize() } }
[ -1 ]
74ae008ba07d26b89ff78e15de7943a06405d863
af8b5b0ca6ccef6884b59722127643c43974c50a
/project15/project15/project15/ViewController.swift
55e32cd130b925d4c64993acec7dbb31558f74b6
[]
no_license
delboy1978uk/swift-playground
39162bd6f7d6b17c69bf169141843c79452c6915
398b19daa982fb333a3c0930560d7832267fd64c
refs/heads/master
2020-04-24T23:37:35.989631
2020-04-10T12:50:52
2020-04-10T12:50:52
172,350,626
0
0
null
null
null
null
UTF-8
Swift
false
false
2,136
swift
// // ViewController.swift // project15 // // Created by Derek Stephen McLean on 05/05/2019. // Copyright © 2019 Derek Stephen McLean. All rights reserved. // import UIKit class ViewController: UIViewController { var imageView: UIImageView! var currentAnimation = 0 override func viewDidLoad() { super.viewDidLoad() // load image into view imageView = UIImageView(image: UIImage(named: "penguin")) imageView.center = CGPoint(x: 512, y: 384) view.addSubview(imageView) } @IBAction func tapped(_ sender: UIButton) { // hide the sender button until the animation is complete sender.isHidden = true // animate for 1 second with no iteresting options // UIView.animate(withDuration: 1, delay: 0, options: [], animations: { UIView.animate(withDuration: 1, delay: 0, usingSpringWithDamping: 0.5, initialSpringVelocity: 5, options: [], animations: { switch self.currentAnimation { case 0: self.imageView.transform = CGAffineTransform(scaleX: 2, y: 2) case 1: self.imageView.transform = .identity case 2: self.imageView.transform = CGAffineTransform(translationX: -256, y: -256) case 3: self.imageView.transform = .identity case 4: self.imageView.transform = CGAffineTransform(rotationAngle: CGFloat.pi) case 5: self.imageView.transform = .identity case 6: self.imageView.alpha = 0.1 self.imageView.backgroundColor = UIColor.green case 7: self.imageView.alpha = 1 self.imageView.backgroundColor = UIColor.clear default: break } }) { finished in // show the button again sender.isHidden = false } currentAnimation += 1 if currentAnimation > 7 { currentAnimation = 0 } } }
[ 350363 ]
7c504fceb2066f456fa9982dc0eb5bd788c73f8b
6389d498df92f62bac8aae057ba7d55a45db6b20
/Skillzy/Validator/Validator.swift
601c5854edd81cbf4d0f5ad68a32bd1d4d0215ce
[]
no_license
Jeddawy/SKILLZY
3e86ea4f9c1697fa90000fe916f6df96381bafbe
d82c29d93dbf12cef3f6951f8d1fec9e792cbbad
refs/heads/master
2020-04-10T13:07:18.284270
2018-12-09T13:18:39
2018-12-09T13:18:39
161,041,197
0
0
null
null
null
null
UTF-8
Swift
false
false
1,097
swift
// // Validator.swift // Skillzy // // Created by Ibrahim El-geddawy on 10/18/18. // Copyright © 2018 Ibrahim El-geddawy. All rights reserved. // import UIKit class Validator: UIViewController { func isValidEmail(email : String?) -> Bool { guard let email = email?.trimmingCharacters(in: .whitespaces), !email.isEmpty else { self.showErrorMessage(message: "Please Enter Valid E-mail") return false } let emailRegEx = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,64}" let emailPred = NSPredicate(format:"SELF MATCHES %@", emailRegEx) if !emailPred.evaluate(with: email){ self.showErrorMessage(message: "Please Enter Valid E-mail") return false } return true } func isValidPassword(password : String?) -> Bool { guard let password = password, !password.isEmpty, password.count >= 8 else { self.showErrorMessage(message: "Please Enter Valid Password and At Least 8 Characters") return false } return true } }
[ -1 ]
e1d00d8f406b90c9099ac974d13d4a138e83b488
69fa0c21ccd1d53fed49654407f32cea8afd96cd
/DriftReading/DriftReading/Address.swift
f773f1b4be97ebb71b2389d2f7416797161bd3c6
[ "MIT" ]
permissive
kpse/DriftBook
17e7186bc3b2cee10336dcf8fc01800ae24209cd
5e6e5629ccf229e4541192fdb4fbdecf7da403b9
refs/heads/master
2020-02-26T14:00:26.584204
2015-07-25T06:51:54
2015-07-25T06:56:56
39,675,628
0
0
null
2015-07-25T06:53:08
2015-07-25T06:53:08
null
UTF-8
Swift
false
false
619
swift
// // Address.swift // DriftReading // // Created by Ming Gong on 7/24/15. // Copyright © 2015 gongmingqm10. All rights reserved. // import Foundation class Address: NSObject { var latitude: Double! var longitude: Double! var province: String! var city: String! var street: String! init(json: [String: AnyObject]) { self.latitude = json["latitude"] as! Double self.longitude = json["longitude"] as! Double self.province = json["province"] as! String self.city = json["city"] as! String self.street = json["street"] as! String } }
[ -1 ]
5f50929012f69ac10cccdfd6ab916af1a584e9e7
7a4c69e61a5e81e2aac4898d79c47528a9f5390b
/GithubStars/util/accessibility/UI+Accessibility.swift
7e886cd9404986467e0611dca6aa141fd3b08123
[]
no_license
alexrodrigues/GithubRepos
2af348ad347ed7073a75e55edc1dcc352a752722
7b95833c7649d22ce8753f6351326f57fb76aec7
refs/heads/master
2020-04-19T14:59:36.608050
2019-03-12T14:46:33
2019-03-12T14:46:33
168,260,854
0
0
null
null
null
null
UTF-8
Swift
false
false
511
swift
// // UI+Accessibility.swift // GithubStars // // Created by Alex Rodrigues on 22/02/19. // Copyright © 2019 Alex Rodrigues. All rights reserved. // import UIKit extension UIView { func receiveAccessibilityIdentifier(identifier: AccessibilityIdentifiers) { self.accessibilityIdentifier = identifier.rawValue } } extension UIBarButtonItem { func receiveAccessibilityIdentifier(identifier: AccessibilityIdentifiers) { self.accessibilityIdentifier = identifier.rawValue } }
[ -1 ]
3d450e24b05a4b6f28c5c25fdf54cb8634404332
2bf7b49a5275cde0c9fae4cc9863ba73a37f1896
/Tests/ViewInspectorTests/ViewModifiers/AccessibilityModifiersTests.swift
8527757f32820d2a27e22f3bc9927d7ce610d667
[ "MIT" ]
permissive
fermoya/ViewInspector
ba88a9b6e332e7c25bb8aa547bf7140238d22a8e
fda20cdfdc5d4620d694c82f224e6093771367b3
refs/heads/master
2020-12-29T21:30:21.325590
2020-02-06T15:58:22
2020-02-06T15:58:22
238,739,174
1
0
MIT
2020-02-06T16:58:32
2020-02-06T16:58:30
null
UTF-8
Swift
false
false
7,907
swift
import XCTest import SwiftUI import Combine @testable import ViewInspector // MARK: - ViewAccessibilityTests final class ViewAccessibilityTests: XCTestCase { func testAccessibilityLabel() throws { let sut = EmptyView().accessibility(label: Text("")) XCTAssertNoThrow(try sut.inspect().emptyView()) } func testAccessibilityLabelInspection() throws { let string = "abc" let sut = try EmptyView().accessibility(label: Text(string)) .inspect().emptyView().accessibilityLabel().string() XCTAssertEqual(sut, string) } func testAccessibilityValue() throws { let sut = EmptyView().accessibility(value: Text("")) XCTAssertNoThrow(try sut.inspect().emptyView()) } func testAccessibilityValueInspection() throws { let string = "abc" let sut = try EmptyView().accessibility(value: Text(string)) .inspect().emptyView().accessibilityValue().string() XCTAssertEqual(sut, string) } func testAccessibilityHint() throws { let sut = EmptyView().accessibility(hint: Text("")) XCTAssertNoThrow(try sut.inspect().emptyView()) } func testAccessibilityHintInspection() throws { let string = "abc" let sut = try EmptyView().accessibility(hint: Text(string)) .inspect().emptyView().accessibilityHint().string() XCTAssertEqual(sut, string) } func testAccessibilityHidden() throws { let sut = EmptyView().accessibility(hidden: false) XCTAssertNoThrow(try sut.inspect().emptyView()) } func testAccessibilityHiddenInspection() throws { let sut1 = try EmptyView().accessibility(hidden: true) .inspect().emptyView().accessibilityHidden() XCTAssertTrue(sut1) let sut2 = try EmptyView().accessibility(hidden: false) .inspect().emptyView().accessibilityHidden() XCTAssertFalse(sut2) } func testAccessibilityIdentifier() throws { let sut = EmptyView().accessibility(identifier: "") XCTAssertNoThrow(try sut.inspect().emptyView()) } func testAccessibilityIdentifierInspection() throws { let string = "abc" let sut = try EmptyView().accessibility(identifier: string) .inspect().emptyView().accessibilityIdentifier() XCTAssertEqual(sut, string) } func testAccessibilitySelectionIdentifier() throws { let sut = EmptyView().accessibility(selectionIdentifier: "") XCTAssertNoThrow(try sut.inspect().emptyView()) } func testAccessibilitySelectionIdentifierInspection() throws { let string = "abc" let sut = try EmptyView().accessibility(selectionIdentifier: string) .inspect().emptyView().accessibilitySelectionIdentifier() XCTAssertEqual(sut, string) } func testAccessibilityActivationPoint() throws { let sut = EmptyView().accessibility(activationPoint: .center) XCTAssertNoThrow(try sut.inspect().emptyView()) } func testAccessibilityActivationPointInspection() throws { let point: UnitPoint = .bottomTrailing let sut = try EmptyView().accessibility(activationPoint: point) .inspect().emptyView().accessibilityActivationPoint() XCTAssertEqual(sut, point) } func testAccessibilityAction() throws { let sut = EmptyView().accessibilityAction(.default) { } XCTAssertNoThrow(try sut.inspect().emptyView()) } func testAccessibilityActionInspection() throws { let exp = XCTestExpectation(description: "accessibilityAction") let sut = EmptyView().accessibilityAction(.default) { exp.fulfill() } try sut.inspect().emptyView().callAccessibilityAction(.default) wait(for: [exp], timeout: 0.1) } func testAccessibilityActionInspectionError() throws { let sut = EmptyView().accessibilityAction(.escape) { } XCTAssertThrowsError(try sut.inspect().emptyView().callAccessibilityAction(.default)) } func testAccessibilityActionInspectionMultipleCallbacks() throws { let exp1 = XCTestExpectation(description: "accessibilityAction1") let exp2 = XCTestExpectation(description: "accessibilityAction2") exp1.assertForOverFulfill = true exp2.assertForOverFulfill = true exp1.expectedFulfillmentCount = 1 exp2.expectedFulfillmentCount = 2 let sut = EmptyView().accessibilityAction(.default) { exp1.fulfill() }.accessibilityAction(.escape) { exp2.fulfill() } let view = try sut.inspect().emptyView() try view.callAccessibilityAction(.escape) try view.callAccessibilityAction(.default) try view.callAccessibilityAction(.escape) wait(for: [exp1, exp2], timeout: 0.1) } func testAccessibilityAdjustableAction() throws { let sut = EmptyView().accessibilityAdjustableAction { _ in } XCTAssertNoThrow(try sut.inspect().emptyView()) } func testAccessibilityAdjustableActionInspection() throws { let exp = XCTestExpectation(description: "accessibilityAdjustableAction") let sut = EmptyView().accessibilityAdjustableAction { direction in XCTAssertEqual(direction, .decrement) exp.fulfill() } try sut.inspect().emptyView().callAccessibilityAdjustableAction(.decrement) wait(for: [exp], timeout: 0.1) } func testAccessibilityScrollAction() throws { let sut = EmptyView().accessibilityScrollAction { _ in } XCTAssertNoThrow(try sut.inspect().emptyView()) } func testAccessibilityScrollActionInspection() throws { let exp = XCTestExpectation(description: "accessibilityScrollAction") let sut = EmptyView().accessibilityScrollAction { edge in XCTAssertEqual(edge, .leading) exp.fulfill() } try sut.inspect().emptyView().callAccessibilityScrollAction(.leading) wait(for: [exp], timeout: 0.1) } func testAccessibilityElement() throws { let sut = EmptyView().accessibilityElement(children: .contain) XCTAssertNoThrow(try sut.inspect().emptyView()) } func testAccessibilityAddTraits() throws { let sut = EmptyView().accessibility(addTraits: AccessibilityTraits()) XCTAssertNoThrow(try sut.inspect().emptyView()) } func testAccessibilityRemoveTraits() throws { let sut = EmptyView().accessibility(removeTraits: AccessibilityTraits()) XCTAssertNoThrow(try sut.inspect().emptyView()) } func testAccessibilitySortPriority() throws { let sut = EmptyView().accessibility(sortPriority: 5) XCTAssertNoThrow(try sut.inspect().emptyView()) } func testAccessibilitySortPriorityInspection() throws { let sut = try EmptyView().accessibility(sortPriority: 6) .inspect().emptyView().accessibilitySortPriority() XCTAssertEqual(sut, 6) } func testAccessibilityMultipleAttributes() throws { let label = "abc" let value = "xyz" let sut = try EmptyView() .accessibility(label: Text(label)) .accessibility(value: Text(value)) .accessibility(addTraits: [.isImage]) .inspect().emptyView() XCTAssertEqual(try sut.accessibilityLabel().string(), label) XCTAssertEqual(try sut.accessibilityValue().string(), value) } func testMissingAccessibilityAttribute() throws { let sut = try EmptyView() .accessibility(label: Text("test")) .accessibility(addTraits: [.isImage]) .inspect().emptyView() XCTAssertThrowsError(try sut.accessibilityValue()) } }
[ -1 ]
d200506d25e68be7f5c97ac4635afac3ae829552
4333fc0cab33568a66a29b2fa28062be801bd842
/Sources/PackageDescription/Package.swift
20b6b2b10d5bbdfb40da9cd134113c6416e299fa
[ "Apache-2.0", "Swift-exception" ]
permissive
Ssunnyy/swift-package-manager
b83d71aea86516d0f8a289260fb551c075cdbea6
987ea09e11ed31e657c877f29a34e6a5c4f31a3e
refs/heads/master
2021-01-15T10:35:33.201068
2016-03-03T07:41:21
2016-03-03T07:41:21
null
0
0
null
null
null
null
UTF-8
Swift
false
false
4,404
swift
/* This source file is part of the Swift.org open source project Copyright 2015 - 2016 Apple Inc. and the Swift project authors Licensed under Apache License v2.0 with Runtime Library Exception See http://swift.org/LICENSE.txt for license information See http://swift.org/CONTRIBUTORS.txt for Swift project authors */ #if os(Linux) import Glibc #else import Darwin.C #endif /// The description for a complete package. public final class Package { /// The description for a package dependency. public class Dependency { public let versionRange: Range<Version> public let url: String init(_ url: String, _ versionRange: Range<Version>) { self.url = url self.versionRange = versionRange } public class func Package(url url: String, versions: Range<Version>) -> Dependency { return Dependency(url, versions) } public class func Package(url url: String, majorVersion: Int) -> Dependency { return Dependency(url, Version(majorVersion, 0, 0)..<Version(majorVersion, .max, .max)) } public class func Package(url url: String, majorVersion: Int, minor: Int) -> Dependency { return Dependency(url, Version(majorVersion, minor, 0)..<Version(majorVersion, minor, .max)) } public class func Package(url url: String, _ version: Version) -> Dependency { return Dependency(url, version...version) } } /// The name of the package, if specified. public let name: String? /// The list of targets. public var targets: [Target] /// The list of dependencies. public var dependencies: [Dependency] /// The list of test dependencies. They aren't exposed to a parent Package public var testDependencies: [Dependency] /// The list of folders to exclude. public var exclude: [String] /// Construct a package. public init(name: String? = nil, targets: [Target] = [], dependencies: [Dependency] = [], testDependencies: [Dependency] = [], exclude: [String] = []) { self.name = name self.targets = targets self.dependencies = dependencies self.testDependencies = testDependencies self.exclude = exclude // Add custom exit handler to cause package to be dumped at exit, if requested. // // FIXME: This doesn't belong here, but for now is the mechanism we use // to get the interpreter to dump the package when attempting to load a // manifest. if getenv("SWIFT_DUMP_PACKAGE") != nil { dumpPackageAtExit(self) } } } // MARK: TOMLConvertible extension Package.Dependency: TOMLConvertible { public func toTOML() -> String { return "[\"\(url)\", \"\(versionRange.startIndex)\", \"\(versionRange.endIndex)\"]," } } extension Package: TOMLConvertible { public func toTOML() -> String { var result = "" result += "[package]\n" if let name = self.name { result += "name = \"\(name)\"\n" } result += "dependencies = [" for dependency in dependencies { result += dependency.toTOML() } result += "]\n" result += "testDependencies = [" for dependency in testDependencies { result += dependency.toTOML() } result += "]\n" result += "\n" + "exclude = \(exclude)" + "\n" for target in targets { result += "[[package.targets]]\n" result += target.toTOML() } return result } } // MARK: Equatable extension Package : Equatable { } public func ==(lhs: Package, rhs: Package) -> Bool { return (lhs.name == rhs.name && lhs.targets == rhs.targets && lhs.dependencies == rhs.dependencies) } extension Package.Dependency : Equatable { } public func ==(lhs: Package.Dependency, rhs: Package.Dependency) -> Bool { return lhs.url == rhs.url && lhs.versionRange == rhs.versionRange } // MARK: Package Dumping private var thePackageToDump: Package? = nil private func dumpPackageAtExit(package: Package) { func dump() { print(thePackageToDump!.toTOML()) for product in products { print("[[products]]") print(product.toTOML()) print() } } thePackageToDump = package atexit(dump) }
[ -1 ]
3853f8a30f1379b9e9a92ffd7ea17d505f2d0961
a6ebcf337f169a006ba0800477344d2bb9cd2525
/Sources/OpenAPI/Generated/Paths/PathsV1BetaAppClipInvocationsWithID.swift
0a669f975d17448d68b8b590d97c0a335c3972c5
[ "MIT" ]
permissive
AvdLee/appstoreconnect-swift-sdk
9965c7aa5b1c39b0e4c79b259335801086aa95aa
2d7d7eb7fbbe9980c7584dd53862576c6ba7eb12
refs/heads/master
2023-07-18T23:11:34.653279
2023-07-10T07:35:55
2023-07-10T07:35:55
156,271,126
1,226
189
NOASSERTION
2023-09-04T09:33:49
2018-11-05T19:27:31
Swift
UTF-8
Swift
false
false
2,000
swift
// Generated by Create API // https://github.com/CreateAPI/CreateAPI // // swiftlint:disable all import Foundation import URLQueryEncoder extension APIEndpoint.V1.BetaAppClipInvocations { public func id(_ id: String) -> WithID { WithID(path: "\(path)/\(id)") } public struct WithID { /// Path: `/v1/betaAppClipInvocations/{id}` public let path: String public func get(parameters: GetParameters? = nil) -> Request<AppStoreConnect_Swift_SDK.BetaAppClipInvocationResponse> { .get(path, query: parameters?.asQuery) } public struct GetParameters { public var fieldsBetaAppClipInvocations: [FieldsBetaAppClipInvocations]? public var include: [Include]? public var limitBetaAppClipInvocationLocalizations: Int? public enum FieldsBetaAppClipInvocations: String, Codable, CaseIterable { case betaAppClipInvocationLocalizations case buildBundle case url } public enum Include: String, Codable, CaseIterable { case betaAppClipInvocationLocalizations } public init(fieldsBetaAppClipInvocations: [FieldsBetaAppClipInvocations]? = nil, include: [Include]? = nil, limitBetaAppClipInvocationLocalizations: Int? = nil) { self.fieldsBetaAppClipInvocations = fieldsBetaAppClipInvocations self.include = include self.limitBetaAppClipInvocationLocalizations = limitBetaAppClipInvocationLocalizations } public var asQuery: [(String, String?)] { let encoder = URLQueryEncoder(explode: false) encoder.encode(fieldsBetaAppClipInvocations, forKey: "fields[betaAppClipInvocations]") encoder.encode(include, forKey: "include") encoder.encode(limitBetaAppClipInvocationLocalizations, forKey: "limit[betaAppClipInvocationLocalizations]") return encoder.items } } public func patch(_ body: AppStoreConnect_Swift_SDK.BetaAppClipInvocationUpdateRequest) -> Request<AppStoreConnect_Swift_SDK.BetaAppClipInvocationResponse> { .patch(path, body: body) } public var delete: Request<Void> { .delete(path) } } }
[ -1 ]
3c657418ae7cdeb02d8a2df0752813e8cf6704d4
d93c19cf9ab35516a470c57550480826c821149f
/UnstoppableWallet/UnstoppableWallet/Modules/Balance/BalanceItem.swift
2652c2b3ff9009ae1935c6ed66ad17b20acf3ba3
[ "MIT" ]
permissive
Zeeging/unstoppable-wallet-ios
d866d99cd77a8f80c5520aea644e98f4cd3e7a1d
40731384aa0dedb7d01d1cfd1caa69d7b91fe435
refs/heads/master
2023-04-10T14:03:44.704969
2021-04-22T13:31:18
2021-04-22T15:28:22
null
0
0
null
null
null
null
UTF-8
Swift
false
false
428
swift
import Foundation import XRatesKit class BalanceItem { let wallet: Wallet var balance: Decimal? var balanceLocked: Decimal? var state: AdapterState? var latestRate: LatestRate? var balanceTotal: Decimal? { guard let balance = balance else { return nil } return balance + (balanceLocked ?? 0) } init(wallet: Wallet) { self.wallet = wallet } }
[ -1 ]
8eb12e70d769c5273fe0da1b7d1c4836ebf257ce
7c44d558de5c4e9acb05a753c89656d0542fee55
/DZ10/DZ10/Scroll/ScrollViewController.swift
4148f281d5cf2e72d6cbd891c4d2d9fb55557a96
[]
no_license
angryQ/skillboxMHW
9d4e9313b34a2cd993de6ad6915d5c3f74820fd3
382aa3e000d7915e1f007a1211113f35553dca96
refs/heads/master
2023-05-07T23:38:45.134998
2021-05-13T05:30:55
2021-05-13T05:30:55
294,208,903
0
0
null
2021-05-16T15:48:27
2020-09-09T19:24:51
Swift
UTF-8
Swift
false
false
1,185
swift
// // ScrollViewController.swift // DZ10 // // Created by Kristina Kudinova on 18.11.2020. // Copyright © 2020 Kristina Kudinova. All rights reserved. // import UIKit import MapKit class ScrollViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() } } extension UIView { @IBInspectable var cornerRadius: CGFloat { get { return layer.cornerRadius } set { layer.cornerRadius = newValue layer.masksToBounds = newValue > 0 } } @IBInspectable var borderWidth: CGFloat { get { return layer.borderWidth } set { layer.borderWidth = newValue layer.masksToBounds = newValue > 0 } } @IBInspectable var borderColor: UIColor? { get { if let color = layer.borderColor { return UIColor(cgColor: color) } return nil } set { if let color = newValue { layer.borderColor = color.cgColor } else { layer.borderColor = nil } } } }
[ -1 ]
3c9420286718456b4a80a9fbad656b30a1518d99
22f1d5f787278c8d57ab89d15627a7700a5e516f
/Acronomicon/AppDelegate.swift
a9ebecc2c785d99b771a8191f5822eee7ed5b87c
[]
no_license
arguellesv/Acronomicon
8973fe3f29bf19531a12ce02a4abc53a6cfb3e5c
33e7dc3f4c93da0b415aede9229594be072aa04c
refs/heads/main
2023-05-12T10:56:49.999191
2021-06-10T18:55:47
2021-06-10T19:00:26
375,782,224
0
0
null
null
null
null
UTF-8
Swift
false
false
1,358
swift
// AppDelegate.swift // Acronomicon // // Created by Victor Argüelles on 08/06/21. // // import UIKit @main class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } // MARK: UISceneSession Lifecycle func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { // Called when a new scene session is being created. // Use this method to select a configuration to create the new scene with. return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) } func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) { // Called when the user discards a scene session. // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. // Use this method to release any resources that were specific to the discarded scenes, as they will not return. } }
[ 393222, 393224, 393230, 393250, 344102, 393261, 393266, 213048, 385081, 376889, 393275, 376905, 327756, 254030, 286800, 368727, 180313, 368735, 180320, 376931, 286831, 368752, 286844, 417924, 262283, 286879, 286888, 377012, 327871, 180416, 377036, 180431, 377046, 418007, 418010, 377060, 327914, 205036, 393456, 393460, 418043, 336123, 385280, 262404, 180490, 164106, 368911, 262416, 262422, 377117, 262436, 336180, 262454, 393538, 262472, 344403, 213332, 65880, 262496, 418144, 262499, 213352, 246123, 262507, 262510, 213372, 385419, 393612, 262550, 262552, 385440, 385443, 262566, 385451, 262573, 393647, 385458, 262586, 344511, 262592, 360916, 369118, 328177, 328179, 328182, 328189, 328192, 164361, 410128, 393747, 254490, 188958, 385570, 33316, 377383, 197159, 352821, 197177, 418363, 188987, 369223, 385609, 385616, 352864, 369253, 262760, 352874, 352887, 254587, 377472, 148105, 377484, 352918, 98968, 344744, 361129, 336555, 385713, 434867, 164534, 336567, 328378, 164538, 328386, 352968, 344776, 352971, 418507, 352973, 385742, 385748, 361179, 189153, 369381, 361195, 418553, 344831, 336643, 344835, 344841, 361230, 336659, 418580, 418585, 434970, 369435, 418589, 262942, 418593, 336675, 328484, 418598, 418605, 336696, 361273, 328515, 336708, 328519, 361288, 336711, 328522, 336714, 426841, 254812, 361309, 197468, 361315, 361322, 328573, 377729, 369542, 361360, 222128, 345035, 386003, 345043, 386011, 386018, 386022, 435187, 328702, 328714, 361489, 386069, 386073, 336921, 336925, 345118, 377887, 345133, 345138, 386101, 361536, 197707, 189520, 345169, 156761, 361567, 148578, 345199, 386167, 361593, 410745, 361598, 214149, 345222, 386186, 337047, 345246, 214175, 337071, 337075, 345267, 386258, 328924, 66782, 222437, 386285, 328941, 386291, 345376, 353570, 345379, 410917, 345382, 337205, 345399, 378169, 369978, 337222, 337229, 337234, 263508, 402791, 345448, 271730, 378227, 271745, 181638, 353673, 181643, 181649, 181654, 230809, 181673, 181681, 337329, 181684, 361917, 181696, 337349, 337365, 271839, 329191, 361960, 329194, 116210, 337398, 337415, 329226, 419339, 419343, 419349, 345625, 419355, 370205, 419359, 394786, 419362, 370213, 419368, 419376, 206395, 214593, 419400, 419402, 353867, 419406, 419410, 394853, 345701, 222830, 370297, 403070, 353919, 403075, 345736, 198280, 403091, 345749, 419483, 345757, 345762, 419491, 345765, 419497, 419501, 370350, 419506, 419509, 419512, 337592, 419517, 337599, 419527, 419530, 419535, 272081, 419542, 394966, 419544, 181977, 345818, 419547, 419550, 419559, 337642, 419563, 337645, 370415, 337659, 141051, 337668, 362247, 395021, 362255, 116509, 345887, 378663, 345905, 354106, 354111, 247617, 354117, 370503, 329544, 345930, 370509, 354130, 247637, 337750, 370519, 313180, 354142, 354150, 354156, 345967, 345970, 345974, 403320, 354172, 247691, 337808, 247700, 329623, 436126, 436132, 337833, 362413, 337844, 346057, 247759, 346063, 329697, 354277, 190439, 247789, 354313, 346139, 436289, 378954, 395339, 338004, 100453, 329832, 329855, 329867, 329885, 411805, 346272, 362660, 100524, 387249, 379066, 387260, 256191, 395466, 346316, 411861, 411864, 411868, 411873, 379107, 411876, 387301, 346343, 338152, 387306, 387312, 346355, 436473, 321786, 379134, 411903, 411916, 379152, 395538, 387349, 338199, 387352, 182558, 338211, 395566, 248111, 362822, 436555, 190796, 379233, 354673, 321910, 248186, 420236, 379278, 272786, 354727, 338352, 330189, 338381, 338386, 256472, 338403, 338409, 248308, 199164, 330252, 199186, 420376, 330267, 354855, 10828, 199249, 346721, 174695, 248425, 191084, 338543, 191092, 346742, 354974, 150183, 174774, 248504, 174777, 223934, 355024, 273108, 355028, 264918, 183005, 256734, 436962, 338660, 338664, 264941, 363251, 207619, 264964, 338700, 256786, 199452, 363293, 396066, 346916, 396069, 215853, 355122, 355131, 355140, 355143, 338763, 355150, 330580, 355166, 265055, 265058, 355175, 387944, 355179, 330610, 330642, 355218, 412599, 207808, 379848, 396245, 248792, 248798, 347105, 257008, 183282, 265207, 330748, 265214, 330760, 330768, 248862, 396328, 347176, 158761, 199728, 396336, 330800, 396339, 339001, 388154, 388161, 347205, 248904, 330826, 248914, 412764, 339036, 257120, 265320, 248951, 420984, 330889, 347287, 248985, 339097, 44197, 380070, 339112, 249014, 126144, 330958, 330965, 265432, 265436, 388319, 388347, 175375, 159005, 175396, 208166, 273708, 347437, 372015, 347441, 372018, 199988, 44342, 175415, 396600, 437566, 175423, 437570, 437575, 437583, 331088, 437587, 331093, 396633, 175450, 437595, 175457, 208227, 175460, 175463, 265580, 437620, 175477, 249208, 175483, 175486, 249214, 175489, 249218, 249227, 175513, 175516, 396705, 175522, 355748, 380332, 396722, 208311, 388542, 372163, 216517, 380360, 216522, 339404, 372176, 208337, 339412, 413141, 339417, 339420, 249308, 339424, 339428, 339434, 249328, 69113, 372228, 208398, 380432, 175635, 265778, 265795, 396872, 265805, 224853, 224857, 257633, 224870, 372327, 257646, 372337, 224884, 224887, 224890, 224894, 224897, 372353, 216707, 126596, 421508, 224904, 224909, 11918, 159374, 224913, 126610, 339601, 224916, 224919, 126616, 224922, 208538, 224926, 224929, 224932, 224936, 257704, 224942, 257712, 224947, 257716, 257720, 224953, 257724, 224959, 257732, 224965, 224969, 339662, 224975, 257747, 224981, 224986, 257761, 224993, 257764, 224999, 339695, 225012, 257787, 225020, 339710, 257790, 225025, 257794, 339721, 257801, 257804, 225038, 257807, 225043, 372499, 167700, 225048, 257819, 225053, 184094, 225058, 257833, 225066, 257836, 413484, 225070, 225073, 372532, 257845, 225079, 397112, 225082, 397115, 225087, 225092, 225096, 323402, 257868, 225103, 257871, 397139, 225108, 225112, 257883, 257886, 225119, 257890, 339814, 225127, 257896, 274280, 257901, 225137, 339826, 257908, 225141, 257912, 225148, 257916, 257920, 225155, 339844, 225165, 397200, 225170, 380822, 225175, 225180, 118691, 184244, 372664, 372702, 372706, 356335, 380918, 372738, 405533, 430129, 266294, 266297, 421960, 356439, 430180, 421990, 266350, 356466, 266362, 381068, 225423, 250002, 250004, 225429, 356506, 225437, 135327, 225441, 438433, 225444, 438436, 225447, 438440, 225450, 258222, 225455, 225458, 225461, 225466, 389307, 225470, 381120, 372929, 430274, 225475, 389320, 225484, 225487, 225490, 225493, 266453, 225496, 225499, 225502, 225505, 356578, 225510, 217318, 225514, 225518, 372976, 381176, 397571, 389380, 61722, 356637, 356640, 356643, 356646, 266536, 356649, 356655, 332080, 340275, 356660, 397622, 332090, 225597, 332097, 201028, 348488, 332106, 332117, 348502, 250199, 250202, 332125, 250210, 332152, 389502, 250238, 332161, 356740, 332172, 373145, 340379, 389550, 324030, 266687, 160234, 127471, 340472, 381436, 324094, 266754, 324099, 324102, 324111, 340500, 324117, 324131, 332324, 381481, 356907, 324139, 324142, 356916, 324149, 324155, 348733, 324164, 356934, 348743, 381512, 324170, 324173, 324176, 389723, 332380, 381545, 340627, 373398, 184982, 258721, 332453, 332459, 389805, 332463, 381617, 332471, 332483, 332486, 373449, 332493, 357069, 357073, 332511, 332520, 340718, 332533, 348924, 389892, 373510, 389926, 348978, 152370, 340789, 348982, 398139, 127814, 357201, 357206, 389978, 430939, 357211, 357214, 201579, 201582, 349040, 340849, 201588, 430965, 381813, 324472, 398201, 340858, 324475, 430972, 340861, 324478, 119674, 324481, 373634, 398211, 324484, 324487, 381833, 324492, 324495, 324498, 430995, 324501, 324510, 422816, 324513, 398245, 201637, 324524, 340909, 324533, 324538, 324541, 398279, 340939, 340941, 209873, 340957, 431072, 398306, 340963, 209895, 201711, 349172, 381946, 349180, 439294, 431106, 357410, 250914, 185380, 357418, 209965, 209968, 209975, 209979, 209987, 209995, 341071, 349267, 250967, 210010, 341091, 210025, 210027, 210030, 210036, 210039, 349308, 349311, 160895, 152703, 210052, 349319, 210055, 218247, 210067, 210071, 210077, 210080, 251044, 210084, 185511, 210088, 210098, 210107, 210115, 332997, 210127, 333009, 210131, 333014, 210138, 210143, 218354, 218360, 251128, 275712, 275715, 275721, 349459, 333078, 251160, 349484, 349491, 251189, 415033, 251210, 357708, 210260, 365911, 259421, 365921, 333154, 251235, 374117, 333162, 234866, 390516, 333175, 357755, 251271, 136590, 374160, 112020, 349590, 357792, 259515, 415166, 415185, 366034, 366038, 415191, 415193, 415196, 415199, 423392, 333284, 415207, 366056, 366061, 415216, 210420, 415224, 423423, 415257, 415263, 366117, 415270, 144939, 415278, 415281, 415285, 210487, 415290, 415293, 349761, 415300, 333386, 366172, 333413, 423528, 423532, 210544, 415353, 333439, 415361, 267909, 153227, 333498, 210631, 333511, 259788, 358099, 153302, 333534, 366307, 366311, 431851, 366318, 210672, 366321, 366325, 210695, 268041, 210698, 366348, 210706, 399128, 333594, 210719, 358191, 366387, 210739, 399159, 358200, 325440, 366401, 341829, 325446, 46920, 341834, 341838, 341843, 415573, 341851, 350045, 399199, 259938, 399206, 268143, 358255, 399215, 358259, 341876, 333689, 243579, 325504, 333698, 333708, 333724, 382890, 350146, 333774, 358371, 350189, 350193, 350202, 333818, 350206, 350213, 268298, 350224, 350231, 333850, 350237, 350240, 350244, 350248, 178218, 350251, 350256, 350259, 350271, 243781, 350285, 374864, 342111, 342133, 374902, 432271, 333997, 334011, 260289, 260298, 350410, 350416, 350422, 211160, 350425, 268507, 334045, 350445, 375026, 358644, 350458, 350461, 350464, 325891, 350467, 350475, 375053, 268559, 350480, 432405, 350486, 325914, 350490, 325917, 350493, 325919, 350498, 194852, 350504, 358700, 391468, 350509, 358704, 358713, 358716, 383306, 334161, 383321, 383330, 383333, 391530, 383341, 334203, 268668, 194941, 391563, 366990, 416157, 342430, 268701, 375208, 326058, 375216, 334262, 334275, 326084, 358856, 334304, 334311, 375277, 334321, 350723, 391690, 186897, 342545, 334358, 342550, 342554, 334363, 358941, 350761, 252461, 334384, 383536, 358961, 334394, 252482, 219718, 334407, 334420, 350822, 375400, 334465, 334468, 162445, 326290, 342679, 342683, 260766, 342710, 244409, 260797, 260801, 350917, 154317, 391894, 154328, 416473, 64230, 113388, 342766, 375535, 203506, 342776, 391937, 391948, 375568, 326416, 375571, 375574, 162591, 326441, 383793, 326451, 326454, 326460, 260924, 375612, 244540, 326467, 244551, 326473, 326477, 326485, 416597, 326490, 342874, 326502, 375656, 433000, 326507, 326510, 211825, 211831, 351097, 392060, 359295, 351104, 342915, 400259, 236430, 342930, 252822, 392091, 400285, 252836, 359334, 211884, 400306, 351168, 359361, 326598, 359366, 359382, 359388, 383967, 343015, 359407, 261108, 244726, 261111, 383997, 261129, 359451, 261147, 211998, 261153, 261159, 359470, 359476, 343131, 384098, 384101, 384107, 367723, 187502, 343154, 384114, 212094, 351364, 384135, 384139, 384143, 351381, 384160, 384168, 367794, 384181, 367800, 384191, 351423, 384198, 326855, 244937, 253130, 343244, 146642, 359649, 343270, 351466, 351479, 384249, 343306, 261389, 359694, 384269, 253200, 261393, 384275, 245020, 245029, 171302, 351534, 376110, 245040, 384314, 425276, 384323, 212291, 343365, 212303, 367965, 343393, 343398, 367980, 425328, 343409, 253303, 154999, 343417, 327034, 245127, 384397, 245136, 245142, 245145, 343450, 245148, 245151, 245154, 245157, 245162, 327084, 359865, 384443, 146876, 327107, 384453, 327110, 327115, 327117, 359886, 359890, 343507, 368092, 343534, 343539, 368119, 343544, 368122, 409091, 359947, 359955, 359983, 343630, 179802, 155239, 327275, 245357, 138864, 155254, 155273, 368288, 245409, 425638, 425649, 155322, 425662, 155327, 155351, 155354, 212699, 155363, 245475, 155371, 245483, 409335, 155393, 155403, 155422, 360223, 155438, 155442, 155447, 417595, 360261, 155461, 376663, 155482, 261981, 425822, 155487, 376671, 155490, 155491, 327531, 261996, 376685, 261999, 262002, 327539, 147317, 262005, 425845, 262008, 262011, 155516, 155521, 155525, 360326, 376714, 155531, 262027, 262030, 262033, 262036, 262039, 262042, 155549, 262045, 262048, 262051, 327589, 155559, 155562, 155565, 393150, 393169, 384977, 155611, 155619, 253923, 155621, 253926, 327654, 204784, 393203, 360438, 253943, 393206, 393212, 155646 ]
1dbefd967ecefd99a6e250bf68f69a2e5dddcf73
9a65a9d8fc892f5002e59d0e4cf47bb4e75bc2d5
/Scatter and Gather/ViewController.swift
3287c681da0251d3b359745a516cc1b5c064416a
[]
no_license
hendoware/ScatterAndGather
7f03891180182a42568f60c40a63e217c01ad462
037064a7067bf03ddeb9660543088bfadabbb1c9
refs/heads/master
2020-04-06T16:20:00.385888
2018-11-15T15:48:14
2018-11-15T15:48:14
157,615,644
0
0
null
null
null
null
UTF-8
Swift
false
false
4,512
swift
// // ViewController.swift // Scatter and Gather // // Created by Sean Hendrix on 11/14/18. // Copyright © 2018 Sean Hendrix. All rights reserved. // import UIKit import AVFoundation class ViewController: UIViewController { var musicPlayer: AVAudioPlayer! var shouldScamble = false var timer = Timer() //@IBOutlet weak var lambdaPic: UIImageView! @IBOutlet weak var lambdaLogo: UIImageView! @IBOutlet var letters: [UILabel]! @IBOutlet weak var letterL: UILabel! @IBOutlet weak var letterA1: UILabel! @IBOutlet weak var letterM: UILabel! @IBOutlet weak var letterB: UILabel! @IBOutlet weak var letterD: UILabel! @IBOutlet weak var letterA: UILabel! override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. initAudio() setup() } func initAudio() { let path = Bundle.main.path(forResource: "music", ofType: "mp3")! let url = URL(fileURLWithPath: path) do { musicPlayer = try AVAudioPlayer(contentsOf: url) musicPlayer.prepareToPlay() musicPlayer.numberOfLoops = -1 musicPlayer.play() } catch let err as NSError{ print(err.debugDescription) } } @IBAction func musicBtn(_ sender: UIButton) { if musicPlayer.isPlaying { musicPlayer.pause() //sender.alpha = 0.2 } else{ musicPlayer.play() //sender.alpha = 1.0 } } func setup() { if !shouldScamble { // view.backgroundColor = .green } if shouldScamble { // view.backgroundColor = .yellow } } func generateRandomColor() -> UIColor { let hue : CGFloat = CGFloat(arc4random() % 256) / 256 let saturation : CGFloat = CGFloat(arc4random() % 128) / 256 + 0.5 let brightness : CGFloat = CGFloat(arc4random() % 128) / 256 + 0.5 return UIColor(hue: hue, saturation: saturation, brightness: brightness, alpha: 1) } @IBAction func toggleBtn(_ sender: Any) { shouldScamble.toggle() saveCoordinates() //view.backgroundColor = generateRandomColor() if shouldScamble { scramble() } else { unscramble() timer.invalidate() } } func scramble() { timer = Timer.scheduledTimer(timeInterval: 0, target: self, selector: #selector(self.animode), userInfo: nil, repeats: true) } func unscramble() { for letter in letters { UIView.animate(withDuration: 2) { self.lambdaLogo.alpha = 1 letter.transform = .identity letter.backgroundColor = nil letter.textColor = .black self.view.backgroundColor = .white } } } @objc func animode() { UIView.animate(withDuration: 0.5, animations: { self.lambdaLogo.alpha = 0 }) { (_) in UIView.animate(withDuration: 0.5, animations: { self.lambdaLogo.alpha = 1 }) } for letter in letters { let location = randomLocation() UIView.animate(withDuration: 4) { var matrix = letter.transform matrix.rotated(by: CGFloat.pi / 1.5) matrix = CGAffineTransform(rotationAngle: CGFloat.pi / 1.3) matrix.tx = location.x matrix.ty = location.y letter.backgroundColor = self.generateRandomColor() letter.textColor = self.generateRandomColor() letter.transform = matrix } } view.backgroundColor = generateRandomColor() } func randomLocation() -> (x: CGFloat, y: CGFloat) { return (CGFloat.random(in: -10...100), CGFloat.random(in: -20...200)) } var xCoordinates: [CGFloat] = [8, 16, 24, 36, 44, 52] var yCoordinates: [CGFloat] = [8, 16, 24, 36, 44, 52] func saveCoordinates() { var count = 0 for letter in letters { xCoordinates[count] = letter.center.x yCoordinates[count] = letter.center.y count += 1 } } }
[ -1 ]
8d0c32b88e26c635c26a1ee13c684c9e4351429c
216ee545c50ced6e4dc93ee4045299952062546a
/euler/euler4.swift
0e2dcba1caeef562e3cef00dcd073450eacf48b7
[]
no_license
callie42/euler
4224d2e2b0e5595e2580b8b2315a16dd8af6baba
4232b0663759e584f1a9a56082df9eddd9d81743
refs/heads/master
2021-06-26T19:20:32.068992
2017-09-15T13:08:44
2017-09-15T13:08:44
103,220,109
0
0
null
null
null
null
UTF-8
Swift
false
false
845
swift
// // euler4.swift // euler // // Created by Calliope on 15/9/17. // Copyright © 2017 crc. All rights reserved. // import Foundation // // // A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers // is 9009 = 91 × 99. // // Find the largest palindrome made from the product of two 3-digit numbers. // func euler4() -> Void { print("PE4: Start") print("PE4: Largest palindrome product of 2, 3 digit numbers") var largest = 0 for i in 100 ... 999 { for j in i ... 999 { let product = i*j var s1 = "\(product)" var s2 = "" for c in s1.characters.reversed() { s2.append(c) } if ((s1 == s2) && (product > largest)) { largest = product } } } print("PE4: largest = \(largest)") print("PE4: End\n") }
[ -1 ]
0fa97ffc92da7eb68d99009a43270a521780c054
afe523d56437d9f2bdda51aebb4e2b2c8b80b8bb
/Sources/SwiftyBeagle/SwiftyBeagle+SummaryRoute.swift
a6a1049b0714a9fd776c30c840da410adeb02887
[]
no_license
Bersaelor/SwiftyBeagle
5511162f96468e42a199d2864977b35620d7f487
f1c5c43d8de1a881d9c03c493e93ed0e15c8262c
refs/heads/master
2020-03-28T06:33:05.352225
2018-09-16T10:22:54
2018-09-16T10:22:54
147,843,317
5
0
null
null
null
null
UTF-8
Swift
false
false
1,947
swift
import CouchDB import Kitura import KituraContracts import LoggerAPI extension SwiftyBeagle { func initializeSummaryRoutes() { router.get("/summaries", handler: getSummaries) router.post("/summaries", handler: addSummary) router.delete("/summaries", handler: deleteItem) } func getSummaries(completion: @escaping ([ValidationSummary]?, RequestError?) -> Void) { guard let database = database else { return completion(nil, .internalServerError) } ValidationSummary.Persistence.getAll(from: database) { (results, error) in return completion(results, error as? RequestError) } } func getAllResults(for summary: ValidationSummary, completion: @escaping ([ValidationResult]?, RequestError?) -> Void) { guard let id = summary.id, let database = database else { return completion(nil, .internalServerError) } ValidationResult.Persistence.getAll(from: database, with: id) { (results, error) in if let error = error { Log.error("Failed to retrieve results for summary: \(error)") completion(nil, .internalServerError) } else if let results = results { completion(results, nil) } } } func addSummary(_ summary: ValidationSummary, completion: @escaping (ValidationSummary?, RequestError?) -> Void) { guard let database = database else { return completion(nil, .internalServerError) } ValidationSummary.Persistence.save(summary, to: database) { id, error in guard let id = id else { return completion(nil, .notAcceptable) } ValidationSummary.Persistence.get(from: database, with: id, callback: { (result, error) in return completion(result, error as? RequestError) }) } } }
[ -1 ]
8938d7d8e76ba0863aef1d9e2deaaca824a9d3b2
433087d375debedf9618e34976717df7b96a06a6
/VideoBackGround/VideoBackGround/VideoSplashViewController.swift
49bf9abfdbe99f398ff0400113e174bbcff7ac40
[]
no_license
ducanh080820/100DaysWithSwift
86aa157133520569d3dee37d0da53abe650924c9
039de88605bd297d0e5fc193fba200eb19ea59e2
refs/heads/master
2020-06-05T00:41:25.750457
2019-07-10T10:36:54
2019-07-10T10:36:54
192,254,469
1
0
null
null
null
null
UTF-8
Swift
false
false
3,597
swift
// // VideoSplashViewController.swift // VideoBackGround // // Created by DSCO on 6/27/19. // Copyright © 2019 DSCO. All rights reserved. // import UIKit import MediaPlayer import AVKit public enum ScalingMode { case resize case resizeAspect case resizeAspectFill } open class VideoSplashViewController: UIViewController { fileprivate let moviePlayer = AVPlayerViewController() fileprivate var moviePlayerSoundLevel: Float = 1.0 open var contentURL: URL? { didSet { setMoviePlayer(contentURL!) } } open var videoFrame: CGRect = CGRect() open var startTime: CGFloat = 0.0 open var duration: CGFloat = 0.0 open var backgroundColor: UIColor = UIColor.black { didSet { view.backgroundColor = backgroundColor } } open var sound: Bool = true { didSet { if sound { moviePlayerSoundLevel = 1.0 }else{ moviePlayerSoundLevel = 0.0 } } } open var alpha: CGFloat = CGFloat() { didSet { moviePlayer.view.alpha = alpha } } open var alwaysRepeat: Bool = true { didSet { if alwaysRepeat { NotificationCenter.default.addObserver(self, selector: #selector(VideoSplashViewController.playerItemDidReachEnd), name: NSNotification.Name.AVPlayerItemDidPlayToEndTime, object: moviePlayer.player?.currentItem) } } } open var fillMode: ScalingMode = .resizeAspectFill { didSet { switch fillMode { case .resize: moviePlayer.videoGravity = AVLayerVideoGravity.resize case .resizeAspect: moviePlayer.videoGravity = AVLayerVideoGravity.resizeAspect case .resizeAspectFill: moviePlayer.videoGravity = AVLayerVideoGravity.resizeAspectFill } } } override open func viewDidAppear(_ animated: Bool) { moviePlayer.view.frame = videoFrame moviePlayer.showsPlaybackControls = false view.addSubview(moviePlayer.view) view.sendSubviewToBack(moviePlayer.view) } override open func viewWillDisappear(_ animated: Bool) { super.viewDidDisappear(animated) NotificationCenter.default.removeObserver(self) } fileprivate func setMoviePlayer(_ url: URL){ let videoCutter = VideoCutter() videoCutter.cropVideoWithUrl(videoUrl: url, startTime: startTime, duration: duration) { (videoPath, error) -> Void in if let path = videoPath as URL? { let priority = DispatchQueue.GlobalQueuePriority.default DispatchQueue.global(priority: priority).async { DispatchQueue.main.async { self.moviePlayer.player = AVPlayer(url: path) self.moviePlayer.player?.play() self.moviePlayer.player?.volume = self.moviePlayerSoundLevel } } } } } override open func viewDidLoad() { super.viewDidLoad() } override open func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() } @objc func playerItemDidReachEnd() { moviePlayer.player?.seek(to: CMTime.zero) moviePlayer.player?.play() } }
[ 40442 ]
7f4b002fc21becb26a662a6b1199aa99c75b4bb9
7cb6e729933d172aded1cf28ffde019b54151d0f
/Sources/Hummingbird/Server/ResponsePatch.swift
41243583d7a887d0ae4c46dd53a71d044cbf249f
[ "Apache-2.0" ]
permissive
mcritz/hummingbird
7708b71fd0c5de8648a0eec09b07cd6ddece8b9e
1c546e455aa5fa1e9a360d610db363d5fefea20f
refs/heads/main
2023-08-11T23:05:33.968245
2021-10-06T16:14:09
2021-10-06T16:14:09
null
0
0
null
null
null
null
UTF-8
Swift
false
false
6,082
swift
//===----------------------------------------------------------------------===// // // This source file is part of the Hummingbird server framework project // // Copyright (c) 2021-2021 the Hummingbird authors // Licensed under Apache License v2.0 // // See LICENSE.txt for license information // See hummingbird/CONTRIBUTORS.txt for the list of Hummingbird authors // // SPDX-License-Identifier: Apache-2.0 // //===----------------------------------------------------------------------===// import NIOHTTP1 extension HBRequest { // MARK: Response patching /// Patches Response via `HBResponse.apply(patch:)` /// /// Allow you to patch the response generated by your route handler via the `HBRequest` supplied. If your handler is only /// returning the payload you can edit the status and headers via `request.response` eg. /// ``` /// func myHandler(_ request: HBRequest) -> String { /// request.response.status = .accepted /// return "hello" /// } /// ``` public final class ResponsePatch { /// patch status of reponse public var status: HTTPResponseStatus? /// headers to add to response public var headers: HTTPHeadersPatch init() { self.status = nil self.headers = [:] } } /// Allows you to edit the status and headers of the response. /// /// `HBRequest.response` is only available within route handlers that have had the option `.editResponse`. /// Trying to access it outside of one of these will cause the application to crash public var response: ResponsePatch { get { self.extensions.get( \.response, error: "Cannot edit response via HBRequest.response outside of a route with the .editResponse option set" ) } set { self.extensions.set(\.response, value: newValue) } } /// return `ResponsePatch` only if it exists. Used internally var optionalResponse: ResponsePatch? { self.extensions.get(\.response) } } extension HBResponse { /// apply `HBRequest.ResponsePatch` to `HBResponse` mutating func apply(patch: HBRequest.ResponsePatch?) -> Self { guard let patch = patch else { return self } if let status = patch.status { self.status = status } self.headers.apply(patch: patch.headers) return self } } /// Used to Patch HTTPHeaders. Remembers if a header was added in with `add` or `replaceOrAdd` public struct HTTPHeadersPatch: ExpressibleByDictionaryLiteral { @usableFromInline internal var addHeaders: HTTPHeaders internal var replaceHeaders: HTTPHeaders /// Construct a `HTTPHeaders` structure. /// /// - parameters /// - elements: name, value pairs provided by a dictionary literal. public init(dictionaryLiteral elements: (String, String)...) { self.replaceHeaders = .init(elements) self.addHeaders = .init() } /// Add a header name/value pair to the block. /// /// This method is strictly additive: if there are other values for the given header name /// already in the block, this will add a new entry. /// /// - Parameter name: The header field name. For maximum compatibility this should be an /// ASCII string. For future-proofing with HTTP/2 lowercase header names are strongly /// recommended. /// - Parameter value: The header field value to add for the given name. public mutating func add(name: String, value: String) { self.addHeaders.add(name: name, value: value) } /// Add a sequence of header name/value pairs to the block. /// /// This method is strictly additive: if there are other entries with the same header /// name already in the block, this will add new entries. /// /// - Parameter contentsOf: The sequence of header name/value pairs. For maximum compatibility /// the header should be an ASCII string. For future-proofing with HTTP/2 lowercase header /// names are strongly recommended. @inlinable public mutating func add<S: Sequence>(contentsOf other: S) where S.Element == (String, String) { self.addHeaders.add(contentsOf: other) } /// Add a header name/value pair to the block, replacing any previous values for the /// same header name that are already in the block. /// /// This is a supplemental method to `add` that essentially combines `remove` and `add` /// in a single function. It can be used to ensure that a header block is in a /// well-defined form without having to check whether the value was previously there. /// Like `add`, this method performs case-insensitive comparisons of the header field /// names. /// /// - Parameter name: The header field name. For maximum compatibility this should be an /// ASCII string. For future-proofing with HTTP/2 lowercase header names are strongly // recommended. /// - Parameter value: The header field value to add for the given name. public mutating func replaceOrAdd(name: String, value: String) { self.addHeaders.remove(name: name) self.replaceHeaders.remove(name: name) self.replaceHeaders.add(name: name, value: value) } /// Remove all values for a given header name from the block. /// /// This method uses case-insensitive comparisons for the header field name. /// /// - Parameter name: The name of the header field to remove from the block. public mutating func remove(name nameToRemove: String) { self.addHeaders.remove(name: nameToRemove) self.replaceHeaders.remove(name: nameToRemove) } } extension HTTPHeaders { /// Apply header patch to headers /// - Parameter patch: header patch mutating func apply(patch: HTTPHeadersPatch) { self.add(contentsOf: patch.addHeaders) for header in patch.replaceHeaders { self.replaceOrAdd(name: header.name, value: header.value) } } }
[ -1 ]
f1b9b152f480b9f5053b280c14808be4c4db232f
78b843fe3690c14f0e4ea95dd5da28ad7855776b
/UIImageViewAligned.swift
8a9a36ab14197a480f5c932cf9e8dc1a8fa91b48
[ "MIT" ]
permissive
k-mats/UIImageViewAlignedSwift
5fdc3df5c1886a46ca58a92948c53dac9ec81190
629eecf0509cc7b3ab84e8b02c3e9e81cc95cdb7
refs/heads/master
2020-07-29T10:41:12.156417
2019-09-20T11:26:52
2019-09-20T11:29:41
209,765,988
0
0
MIT
2019-09-20T10:32:04
2019-09-20T10:32:04
null
UTF-8
Swift
false
false
7,404
swift
// // UIImageViewAligned.swift // UIImageViewAlignedSwift // // MIT License. // import UIKit public struct UIImageViewAlignmentMask: OptionSet { public let rawValue: Int public init(rawValue: Int) { self.rawValue = rawValue } /// The option to align the content to the center. public static let center = UIImageViewAlignmentMask(rawValue: 0) /// The option to align the content to the left. public static let left = UIImageViewAlignmentMask(rawValue: 1) /// The option to align the content to the right. public static let right = UIImageViewAlignmentMask(rawValue: 2) /// The option to align the content to the top. public static let top = UIImageViewAlignmentMask(rawValue: 4) /// The option to align the content to the bottom. public static let bottom = UIImageViewAlignmentMask(rawValue: 8) /// The option to align the content to the top left. public static let topLeft: UIImageViewAlignmentMask = [top, left] /// The option to align the content to the top right. public static let topRight: UIImageViewAlignmentMask = [top, right] /// The option to align the content to the bottom left. public static let bottomLeft: UIImageViewAlignmentMask = [bottom, left] /// The option to align the content to the bottom right. public static let bottomRight: UIImageViewAlignmentMask = [bottom, right] } @IBDesignable open class UIImageViewAligned: UIView { /** The technique to use for aligning the image. Changes to this property can be animated. */ open var alignment: UIImageViewAlignmentMask = .center { didSet { guard alignment != oldValue else { return } updateLayout() } } open var image: UIImage? { set { realImageView?.image = newValue setNeedsLayout() } get { return realImageView?.image } } open var highlightedImage: UIImage? { set { realImageView?.highlightedImage = newValue setNeedsLayout() } get { return realImageView?.highlightedImage } } /** The option to align the content to the top. It is available in Interface Builder and should not be set programmatically. Use `alignment` property if you want to set alignment outside Interface Builder. */ @IBInspectable open var alignTop: Bool { set { setInspectableProperty(newValue, alignment: .top) } get { return getInspectableProperty(.top) } } /** The option to align the content to the left. It is available in Interface Builder and should not be set programmatically. Use `alignment` property if you want to set alignment outside Interface Builder. */ @IBInspectable open var alignLeft: Bool { set { setInspectableProperty(newValue, alignment: .left) } get { return getInspectableProperty(.left) } } /** The option to align the content to the right. It is available in Interface Builder and should not be set programmatically. Use `alignment` property if you want to set alignment outside Interface Builder. */ @IBInspectable open var alignRight: Bool { set { setInspectableProperty(newValue, alignment: .right) } get { return getInspectableProperty(.right) } } /** The option to align the content to the bottom. It is available in Interface Builder and should not be set programmatically. Use `alignment` property if you want to set alignment outside Interface Builder. */ @IBInspectable open var alignBottom: Bool { set { setInspectableProperty(newValue, alignment: .bottom) } get { return getInspectableProperty(.bottom) } } /** The inner image view. It should be used only when necessary. Accessible to keep compatibility with the original `UIImageViewAligned`. */ public private(set) var realImageView: UIImageView? private var realContentSize: CGSize { var size = bounds.size guard let image = image else { return size } let scaleX = size.width / image.size.width let scaleY = size.height / image.size.height switch contentMode { case .scaleAspectFill: let scale = max(scaleX, scaleY) size = CGSize(width: image.size.width * scale, height: image.size.height * scale) case .scaleAspectFit: let scale = min(scaleX, scaleY) size = CGSize(width: image.size.width * scale, height: image.size.height * scale) case .scaleToFill: size = CGSize(width: image.size.width * scaleX, height: image.size.height * scaleY) default: size = image.size } return size } public override init(frame: CGRect) { super.init(frame: frame) setup() } public required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) setup() } open override func layoutSubviews() { super.layoutSubviews() layoutIfNeeded() updateLayout() } open override func didMoveToSuperview() { super.didMoveToSuperview() layer.contents = nil } open override func didMoveToWindow() { super.didMoveToWindow() layer.contents = nil if #available(iOS 11, *) { let currentImage = realImageView?.image image = nil realImageView?.image = currentImage } } private func setup(image: UIImage? = nil, highlightedImage: UIImage? = nil) { realImageView = UIImageView(image: image, highlightedImage: highlightedImage) realImageView?.frame = bounds realImageView?.autoresizingMask = [.flexibleWidth, .flexibleHeight] realImageView?.contentMode = contentMode addSubview(realImageView!) } private func updateLayout() { let realSize = realContentSize var realFrame = CGRect(origin: CGPoint(x: (bounds.size.width - realSize.width) / 2.0, y: (bounds.size.height - realSize.height) / 2.0), size: realSize) if alignment.contains(.left) { realFrame.origin.x = 0.0 } else if alignment.contains(.right) { realFrame.origin.x = bounds.maxX - realFrame.size.width } if alignment.contains(.top) { realFrame.origin.y = 0.0 } else if alignment.contains(.bottom) { realFrame.origin.y = bounds.maxY - realFrame.size.height } realImageView?.frame = realFrame.integral // Make sure we clear the contents of this container layer, since it refreshes from the image property once in a while. layer.contents = nil } private func setInspectableProperty(_ newValue: Bool, alignment: UIImageViewAlignmentMask) { if newValue { self.alignment.insert(alignment) } else { self.alignment.remove(alignment) } } private func getInspectableProperty(_ alignment: UIImageViewAlignmentMask) -> Bool { return self.alignment.contains(alignment) } }
[ 67913 ]
19993bba14b4d48bf938703b34c4fc6894c8f055
49f7da1a2c52f2f7b2696e3f52dd3b61e291b9e7
/RunTogether1.2/RunTogether1.2/HelperFiles/LocationManager.swift
6f232d23a722ec1ca9c24c56a318fdfd96bc68d3
[]
no_license
Ian-H411/RunTogether
056303cb002fdf1bffd4db8f374d468a9c7212e2
543ae0794ebbd7ff5a06b0fa0ee7710c60d712c4
refs/heads/master
2020-06-30T00:08:11.879157
2019-08-31T02:45:31
2019-08-31T02:45:31
200,663,621
0
0
null
null
null
null
UTF-8
Swift
false
false
304
swift
// // LocationManager.swift // RunTogether1.2 // // Created by Ian Hall on 8/18/19. // Copyright © 2019 Ian Hall. All rights reserved. // import Foundation import CoreLocation class LocationManager { static let shared = CLLocationManager() private init () { } }
[ -1 ]
f8fb30e5f8e3448e2d09a0bba7cd7d440b16b201
833b3e47d427f828ba9a2ef398e3dba93149f32d
/taskapp/Task.swift
93a9b34e500c11599b93c1a502e50acf100abb10
[]
no_license
take0327take/taskapp
fd49ce7d37abe5b0df36d767fede79cf8593245d
41ecc83f1863661d641af2d1e56674458f75b767
refs/heads/master
2020-04-11T13:53:54.326102
2016-09-13T08:05:02
2016-09-13T08:05:02
68,005,981
0
0
null
null
null
null
UTF-8
Swift
false
false
576
swift
// // Task.swift // taskapp // // Created by TakeshiTakeuchi on 2016/09/04. // Copyright © 2016年 jp.techacademy.takeshi.takeuchi. All rights reserved. // import RealmSwift class Task: Object { // 管理用 ID。プライマリーキー dynamic var id = 0 // タイトル dynamic var title = "" // 内容 dynamic var contents = "" /// 日時 dynamic var date = NSDate() /** id をプライマリーキーとして設定 */ override static func primaryKey() -> String? { return "id" } }
[ -1 ]
fcd60621e25dbe3fa9399fcf4cbf12d8a144d1da
d439a95c18c503bc47b418d78094b97bcfd895cc
/validation-test/compiler_crashers_fixed/00727-swift-clangmoduleunit-getadaptermodule.swift
f76d4ca03a835ed2c3ace5dbe8568b4306e23d30
[ "Apache-2.0", "Swift-exception" ]
permissive
DougGregor/swift
7e40d5a1b672e6fca9b28130ef8ac0ce601cf650
16b686989c12bb1acf9d1a490c1f301d71428f47
refs/heads/master
2023-08-05T05:11:53.545515
2016-07-06T18:23:34
2016-07-06T18:23:34
50,400,732
14
2
Apache-2.0
2023-08-23T05:19:32
2016-01-26T03:34:10
C++
UTF-8
Swift
false
false
2,344
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 http://swift.org/LICENSE.txt for license information // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // RUN: not %target-swift-frontend %s -parse } } func b<T -> T ->() protocol b in typealias F = a import Foundation } switch x in a { return "" func ^(f: B 0 var b { for c in c = 1, end) typealias f = b> Any] = Swift.a(range.<h: [$0.endIndex - range: c, y: U) + seq } self) typealias e == [c self.init(f<Q<T: A { struct e = b(Any, i(t: T where T { return { let x } typealias F>([T>(.Type) -> : a { import Foundation case C(A.f = A, e<f = a let d protocol b where H.d: d == h } case c().startIndex, x } protocol b in c = [[(""foobar""")! } struct X<b(T.count](e> (start, x in return [("\(T> (b: C("") } } class A: ()?) -> T) { extension NSSet { class B<d { } return true var b class b) -> Any, end) } } class A { A<3] = B<h, k : S<j : c in a { typealias F class A { ""\(object1, let a<() -> { extension NSSet { let x in a = c } private let x } class func a(s: Collection where f<f = F>) -> : d : A".startIndex) } let c: e: c(x): func c(() self[unowned self) protocol b = A, AnyObject) -> V, A<T) { } } } b(self) func e } print(seq: c } } func g.E == F>() -> String class A { func g> Bool { typealias f : P { } } } enum A { class a<Y> (h: A { () protocol e = nil protocol P { protocol d where k) -> U) { } } return g.dynamicType) typealias e where f, Any] in let foo as String) { typealias d : l.init() import Foundation get { func f<T> func b: Int>() let g : Any, A = 1))) class C) { typealias B } protocol c { } } } } c: Array) { } protocol a { assert(#object1: b: Any, e> { } } func g<T> A : k) { func g.c((") class A : NSManagedObject { e = b(object1: Int { let t.C())) return ") func g: (self[T where f(i: (c, object2: Sequence, i: l) { var b(n: c) { class a() override func e: Any, AnyObject) let a { private class b: a { func d } let i: d : C { } var b(a() func b, x } func b({ } } case b = f) func d()) -> V, k : A<d { b super.Type) { } class b(.f : Sequence where Optional<Q<T! { typealias B })")(t: 1 ") } func x) } protocol b : a { case .substringWithRange() ") init(f.C() func a) typeal
[ 94690, 78284 ]
fe3288c9c1b2750de0de0c744601829021467190
aba9812980b4d49cf36d5d06d1c5e4b093974860
/JukeByte/ViewController.swift
3f2c3ba5731e688013ee65dd412cf05f99ac44d2
[]
no_license
Aksene/JukeByte-songs-3
84dd07e071595fc18b17c5793b9de2751469e44a
66886e35f41bf8f2329abe24fddb7231e8b1b53e
refs/heads/main
2023-06-09T18:08:36.632707
2021-06-25T03:10:30
2021-06-25T03:10:30
376,696,950
1
0
null
null
null
null
UTF-8
Swift
false
false
10,159
swift
// // ViewController.swift // JukeByte // // Created by Abdou K Sene on 1/12/19. // Copyright © 2019 Abdou K Sene. All rights reserved. // import UIKit import MediaPlayer import Social import Accounts import AVFoundation class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource { @IBOutlet weak var nowPlayingLabel: UILabel! @IBOutlet weak var tableView: UITableView! @IBOutlet weak var playPauseButton: UIButton! @IBOutlet weak var artistsLabel: UILabel! @IBOutlet weak var songsLabel: UILabel! @IBOutlet weak var nowPlayingArtistLabel: UILabel! var nowPlayingId: Int! var player: Player! var songs: [Song] = [] var currentId: Int! var currentSong: Song! var nextSong: Song! var prevSong: Song! var prevOne: Int = 1 var nextOne: Int = 1 var currentName = String() var currentArtist = String() //var currentIndexPath: IndexPath = [] @IBAction func nextButton(_ sender: UIButton) { let tabbar = tabBarController as! BaseTabBarController tabbar.player.playStream(fileURL: "http://jukebyte.co/music/" + nextSong.getArtists() + " - " + nextSong.getName()) tabbar.nowPlaying = nextSong.getName() tabbar.nowPlayingArtist = nextSong.getArtists() nowPlayingLabel.text = nextSong.getName() nowPlayingArtistLabel.text = nextSong.getArtists() //nextSong = songs[currentIndexPath.row] nextIndexPath() nextOne += 1 } @IBAction func prevButton(_ sender: UIButton) { let tabbar = tabBarController as! BaseTabBarController tabbar.player.playStream(fileURL: "http://jukebyte.co/music/" + nextSong.getArtists() + " - " + nextSong.getName()) tabbar.nowPlaying = nextSong.getName() tabbar.nowPlayingArtist = nextSong.getArtists() nowPlayingLabel.text = nextSong.getName() nowPlayingArtistLabel.text = nextSong.getArtists() //nextSong = songs[currentIndexPath.row] nextIndexPath() nextOne = 1 nextOne -= 1 } @IBAction func likeButton(_ sender: UIButton) { let tabbar = tabBarController as! BaseTabBarController if let id = currentId{ tabbar.likeSong(id: id) } } /*@IBAction func Artist(_ sender: Any) { performSegue(withIdentifier: "segue", sender: self) }*/ override func viewDidLoad() { super.viewDidLoad() setSession() UIApplication.shared.beginReceivingRemoteControlEvents() becomeFirstResponder() NotificationCenter.default.addObserver(self, selector: #selector(handleInterruption),name: AVAudioSession.interruptionNotification, object: nil) player = Player() tableView.delegate = self tableView.dataSource = self self.tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell") retrieveSongs() } //delegate and source for tableview func numberOfSections(in tableView: UITableView) -> Int { return 1 } func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return songs.count } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "coolCell", for: indexPath) cell.textLabel?.text = songs[indexPath.row].getName() cell.detailTextLabel?.text = songs[indexPath.row].getArtists() print("POPULATE") return cell } func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { tableView.deselectRow(at: indexPath, animated: true) let tabbar = tabBarController as! BaseTabBarController tabbar.currentIndexPath = indexPath tabbar.player.playStream(fileURL: "http://jukebyte.co/music/" + songs[indexPath.row].getArtists() + " - " + songs[indexPath.row].getName()) changePlayButton() nowPlayingLabel.text = songs[indexPath.row].getName() nowPlayingArtistLabel.text = songs[indexPath.row].getArtists() tabbar.songPlayed(id: songs[indexPath.row].getId()) currentId = songs[indexPath.row].getId() currentSong = songs[indexPath.row] currentName = songs[indexPath.row].getName() currentArtist = songs[indexPath.row].getArtists() nextOne = 1 tabbar.currentIndexPath = indexPath if tabbar.currentIndexPath.isEmpty{ print("Queue empty") tabbar.currentIndexPath = indexPath }else { print("Not empty") tabbar.currentIndexPath.row = indexPath.row nextIndexPath() } tabbar.nowPlaying = songs[indexPath.row].getName() tabbar.nowPlayingArtist = songs[indexPath.row].getArtists() tabbar.nowPlayingId = songs[indexPath.row].getId() } func nextIndexPath(){ let tabbar = tabBarController as! BaseTabBarController if tabbar.currentIndexPath.isEmpty{ print("Queue empty") nextSong = songs[tabbar.currentIndexPath.row] }else { print("Not empty") nextSong = songs[tabbar.currentIndexPath.row+nextOne] } //nextSong.getName() == songs[currentIndexPath.row].getName() // nextSong.getArtists() == songs[currentIndexPath.row].getArtists() } //END func prevIndexPath(){ let tabbar = tabBarController as! BaseTabBarController if tabbar.currentIndexPath.isEmpty{ print("Queue empty") nextSong = songs[tabbar.currentIndexPath.row] }else { print("Not empty") nextSong = songs[tabbar.currentIndexPath.row-nextOne] } } override var canBecomeFirstResponder: Bool{ return true } func setSession (){ do{ try AVAudioSession.sharedInstance().setCategory(AVAudioSession.Category.playback, mode: .default, policy: .longForm, options: []) } catch{ print(error) } } override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) setLabels() } func setLabels(){ let tabbar = tabBarController as! BaseTabBarController print("Updating Now Playing") print("-----------------------") print(tabbar.nowPlaying) print(tabbar.nowPlayingArtist) print("-----------------------") //player = Player() nowPlayingLabel.text = tabbar.nowPlaying nowPlayingArtistLabel.text = tabbar.nowPlayingArtist nowPlayingId = tabbar.nowPlayingId } @IBAction func playpauseButtonClick(_ sender: Any) { let tabbar = tabBarController as! BaseTabBarController if (tabbar.player.avPlayer.rate > 0) { tabbar.player.pauseAudio() }else{ tabbar.player.playAudio()} changePlayButton() } func changePlayButton(){ let tabbar = tabBarController as! BaseTabBarController if(tabbar.player.avPlayer.rate > 0){ playPauseButton.setImage(UIImage(named: "pauseIcon"), for: UIControl.State.normal) } else{ playPauseButton.setImage(UIImage(named: "playIcon"), for: UIControl.State.normal) } } override func remoteControlReceived(with event: UIEvent?) { if event!.type == UIEvent.EventType.remoteControl{ if event!.subtype == UIEvent.EventSubtype.remoteControlPause{ print("pause") player.pauseAudio() } else if event!.subtype == UIEvent.EventSubtype.remoteControlPlay{ print("playing") player.playAudio() } } } @objc func handleInterruption(notification: NSNotification){ player.pauseAudio() let interruptionTypeAsObject = notification.userInfo![AVAudioSessionInterruptionTypeKey] as! NSNumber /* let interruptionType = AVAudioSessionInterruptionTypeKey(rawValue: interruptionTypeAsObject.unsignedLongVal) if let type = interruptionType{ if type == .ended { player.playAudio() } } //add heasphone handling */} //Retrieve & Parse Songs func retrieveSongs(){ let path = "http://jukebyte.co/music/getmusic.php" let url = URL(string: path) let session = URLSession.shared let task = session.dataTask(with:url!) { (data, response,error) in let retrievedList = String(data: data!, encoding: String.Encoding.utf8) print(retrievedList!) self.parseSongs(data: retrievedList!) print("STORE SONGS") } task.resume() print("GETTING SONGS") } func parseSongs(data: String){ if (data.contains("*")){ let dataArray = (data as String).split{$0 == "*"}.map(String.init) for item in dataArray{ let itemData = item.split{$0 == ","}.map(String.init) let newSong = Song(id: itemData[0], name: itemData[1], numLikes: itemData[2], numPlays: itemData[3], artists: itemData[4]) songs.append(newSong!) print("PARSING NAME") } for s in songs{ print ("--------------") print (s.getName()) print (s.getId()) print("GET NAME") } DispatchQueue.main.async { [unowned self] in self.tableView.reloadData() } } } //END }
[ -1 ]
c8040131e05a8921537df3d80e41dcdc9b0906b2
b1fc08aa8b9503ad7ce3fcc56bb7be60bef64fba
/SpreeiOS/Controllers/Checkout/CartViewController.swift
8de048f344c9d9e94edddb4d1b5291b37ff12115
[]
no_license
softwaredev21/ShoppingIOS
842f07ee57ee61a760c3e734f097e214ebd47d0d
a5a10e9a138ea67fd7df134369d59fbba6e6e63a
refs/heads/master
2022-01-21T05:53:55.600865
2019-06-26T07:40:24
2019-06-26T07:40:24
null
0
0
null
null
null
null
UTF-8
Swift
false
false
4,773
swift
// // CartViewController.swift // SpreeiOS // // Created by Bharat Gupta on 07/06/16. // Copyright © 2016 Vinsol. All rights reserved. // import UIKit class CartViewController: BaseViewController { enum STATE { case Loading case Empty case Filled } var isLoading = true var order: Order? var currentState: STATE { if isLoading { return .Loading } else if order!.itemsCount == 0 { return .Empty } else { return .Filled } } @IBOutlet weak var tableView: UITableView! @IBOutlet weak var checkoutView: UIView! @IBOutlet weak var itemsCountLabel: UILabel! @IBOutlet weak var totalPriceLabel: UILabel! @IBOutlet weak var checkoutButton: UIButton! @IBAction func checkout(_ sender: UIButton) { if order!.state == .cart { CheckoutApiClient.next(order!.id, success: { order in Order.currentOrder = order self.moveToNextCheckoutStep() }, failure: { apiError in self.showApiErrorAlert(apiError) }) } else { self.moveToNextCheckoutStep() } } override func viewDidLoad() { super.viewDidLoad() checkoutView.isHidden = true checkoutButton.layer.borderWidth = 0.5 checkoutButton.layer.borderColor = UIColor.secondary.cgColor } override func viewWillAppear(_ animated: Bool) { fetchCartDetails() self.tabBarController?.tabBar.isHidden = false } func refreshCartView() { self.order = Order.currentOrder self.tableView.reloadData() if currentState == .Filled { checkoutView.isHidden = false } else { checkoutView.isHidden = true } self.itemsCountLabel.text = "Total (\(order?.itemsCount ?? 0))" if let order = order { self.totalPriceLabel.text = "$ \(order.total!)" } else { self.totalPriceLabel.text = "$ 0.00" } } } private extension CartViewController { func fetchCartDetails() { OrderApiClient.current({ order in Order.currentOrder = order self.isLoading = false self.refreshCartView() }, failure: { apiError in self.showApiErrorAlert(apiError) }) } func removeLineItemFromCart(id: Int) { CartApiClient.removeLineItem(order!.id, lineItemID: id, success: { order in Order.currentOrder = order self.refreshCartView() self.refreshCartItemBadgeCount() }, failure: { apiError in self.showApiErrorAlert(apiError) }) } func changeQuantityForLineItem(id: Int, to qty: Int) { var data = URLRequestParams() data["line_item[quantity]"] = qty CartApiClient.updateLineItem(order!.id, lineItemID: id, data: data, success: { order in Order.currentOrder = order self.refreshCartView() }, failure: { apiError in self.showApiErrorAlert(apiError) }) } } extension CartViewController: UITableViewDataSource { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { switch currentState { case .Loading: return 1 case .Empty: return 1 case .Filled: return order!.lineItems.count } } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { switch currentState { case .Loading: return TableViewLoadingCell() case .Empty: return EmptyCartCell() case .Filled: return cartCell(for: indexPath) } } private func cartCell(for indexPath: IndexPath) -> CartCell { let cell = tableView.dequeueReusableCell(withIdentifier: "CartCell", for: indexPath) as! CartCell let lineItem = order!.lineItems[indexPath.row] cell.delegate = self cell.configure(forLineItem: lineItem) return cell } } extension CartViewController: UITableViewDelegate { func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { switch currentState { case .Loading: return view.bounds.height - 108 case .Empty: return view.bounds.height - 108 case .Filled: return 120 } } } extension CartViewController: CartCellDelegate { func removeLineItem(id: Int) { removeLineItemFromCart(id: id) } func changeQtyOfLineItem(id: Int, to qty: Int) { changeQuantityForLineItem(id: id, to: qty) } }
[ -1 ]
e27416ad9f810081eb0f8be20cc4665639471f08
6fce71084125f5c34773f768e4488bb05a155aad
/Spotify/Spotify/AppDelegate.swift
a773315cee4811cbbdae0acabba4ec04b522abb7
[]
no_license
Farazkarimi/Spotify
67f31c465b4d8421c189f726e8860a6a4d3b34a7
0e13efc71a9fc93b9df8971209c5970e7185ba2f
refs/heads/master
2020-06-18T18:23:45.852496
2019-07-13T10:46:53
2019-07-13T10:46:53
196,399,197
0
0
null
null
null
null
UTF-8
Swift
false
false
2,497
swift
// // AppDelegate.swift // Spotify // // Created by Faraz on 7/11/19. // Copyright © 2019 mydigipay. 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:. } func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool { let userInfo = ["url":url] NotificationCenter.default.post(name: NSNotification.Name(rawValue: Constants.afterLoginNotificationKey), object: nil, userInfo: userInfo ) return true } }
[ 229380, 229383, 229385, 294924, 229388, 278542, 327695, 229391, 278545, 229394, 278548, 229397, 229399, 229402, 278556, 229405, 278559, 229408, 294950, 229415, 229417, 327722, 237613, 229422, 360496, 229426, 237618, 229428, 286774, 229432, 319544, 204856, 286776, 286778, 286791, 237640, 278605, 286797, 311375, 163920, 237646, 196692, 319573, 311383, 319590, 311400, 278635, 303212, 278639, 278648, 131192, 237693, 303230, 327814, 303241, 131209, 417930, 311436, 303244, 319633, 286873, 286876, 311460, 311469, 32944, 327862, 327866, 286906, 180413, 286910, 131264, 286916, 286922, 286924, 286926, 319694, 286928, 131281, 278743, 278747, 295133, 155872, 319716, 237807, 303345, 286962, 303347, 131314, 229622, 327930, 278781, 278783, 278785, 237826, 319751, 278792, 286987, 319757, 311569, 286999, 319770, 287003, 287006, 287009, 287012, 287014, 287016, 287019, 311598, 287023, 262448, 311601, 287032, 155966, 319809, 319810, 278849, 319814, 311623, 319818, 311628, 229709, 319822, 287054, 278865, 229717, 196963, 196969, 139638, 213367, 106872, 319872, 311683, 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, 311791, 279023, 172529, 279027, 319989, 164343, 180727, 279035, 311804, 287230, 279040, 303617, 287234, 279045, 287238, 320007, 172552, 172550, 303623, 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, 172644, 311911, 189034, 295533, 189039, 352880, 172656, 295538, 172655, 189044, 287349, 172660, 189040, 287355, 287360, 295553, 295557, 287365, 311942, 303751, 352905, 311946, 287371, 279178, 311951, 287377, 172691, 311957, 287381, 221850, 287386, 164509, 230045, 287390, 172702, 172705, 287394, 172707, 303780, 295583, 287398, 279208, 287400, 172714, 295595, 279212, 189102, 172721, 287409, 66227, 303797, 189114, 287419, 303804, 328381, 287423, 328384, 279231, 287427, 312006, 107208, 172748, 287436, 107212, 172751, 287440, 295633, 172755, 303827, 279255, 172760, 287450, 303835, 279258, 189149, 303838, 213724, 279267, 312035, 295654, 279272, 312048, 230128, 312050, 230131, 205564, 303871, 230146, 328453, 295685, 230154, 33548, 312077, 295695, 295701, 230169, 369433, 295707, 328476, 295710, 230175, 303914, 279340, 205613, 279353, 230202, 312124, 328508, 222018, 295755, 377676, 148302, 287569, 303959, 230237, 279390, 230241, 279394, 303976, 336744, 303981, 303985, 328563, 303987, 279413, 303991, 303997, 295806, 295808, 304005, 295813, 320391, 304007, 304009, 213895, 304011, 230284, 304013, 279438, 295822, 189329, 295825, 304019, 189331, 58262, 304023, 279452, 410526, 279461, 279462, 304042, 213931, 230327, 304055, 287675, 197564, 304063, 238528, 304065, 213954, 189378, 156612, 295873, 213963, 312272, 304084, 304090, 320481, 320490, 304106, 312302, 328687, 320496, 304114, 295928, 320505, 312321, 295945, 197645, 295949, 230413, 320528, 140312, 238620, 197663, 304164, 304170, 304175, 238641, 312374, 238652, 238655, 230465, 238658, 296004, 336964, 205895, 320584, 238666, 296021, 402518, 336987, 230497, 296036, 296040, 361576, 205931, 296044, 164973, 279661, 205934, 312432, 279669, 337018, 189562, 279679, 279683, 222340, 205968, 296084, 238745, 304285, 238756, 205991, 222377, 165035, 337067, 165038, 238766, 230576, 304311, 230592, 279750, 312518, 230600, 230607, 148690, 320727, 279769, 304348, 279777, 304354, 296163, 279781, 304360, 320748, 279788, 279790, 304370, 296189, 320771, 312585, 296202, 296205, 320786, 230674, 230677, 214294, 230679, 320792, 296215, 230681, 296213, 304416, 230689, 173350, 312622, 296243, 312630, 222522, 296253, 222525, 296255, 312639, 230718, 296259, 378181, 230727, 238919, 296264, 320840, 296267, 296271, 222545, 230739, 312663, 337244, 222556, 230752, 312676, 230760, 173418, 230763, 410987, 230768, 296305, 312692, 230773, 304505, 304506, 181626, 181631, 312711, 312712, 296331, 288140, 230800, 288144, 304533, 337306, 288154, 288160, 173472, 288162, 288164, 279975, 304555, 370092, 279983, 288176, 173488, 279985, 312755, 296373, 279991, 312759, 288185, 337335, 222652, 312766, 173507, 296389, 222665, 230860, 312783, 288208, 230865, 288210, 370130, 222676, 288212, 288214, 280021, 239064, 329177, 288218, 288217, 288220, 280027, 239070, 288224, 288226, 370146, 280036, 288229, 280038, 288230, 288232, 280034, 288234, 320998, 288236, 288238, 288240, 288242, 296435, 288244, 288250, 402942, 321022, 206336, 148990, 296450, 296446, 230916, 230919, 214535, 304651, 370187, 304653, 230940, 222752, 108066, 296486, 296488, 157229, 230961, 288320, 288325, 124489, 280140, 280145, 288338, 280149, 280152, 288344, 239194, 280158, 403039, 370272, 181854, 239202, 312938, 280183, 280185, 280188, 280191, 116354, 280194, 280208, 280211, 288408, 280218, 280222, 190118, 321195, 296622, 321200, 337585, 296626, 296634, 296637, 313027, 280260, 206536, 280264, 206539, 206541, 206543, 280276, 313044, 321239, 280283, 288478, 313055, 321252, 313066, 280302, 288494, 280304, 313073, 321266, 288499, 419570, 288502, 280314, 288510, 124671, 67330, 280324, 280331, 198416, 280337, 296723, 116503, 321304, 329498, 296731, 321311, 313121, 313123, 321316, 304932, 280363, 141101, 165678, 280375, 321336, 296767, 288576, 345921, 280388, 304968, 280393, 280402, 173907, 313176, 280419, 321381, 296812, 313201, 1920, 255873, 305028, 280454, 247688, 280464, 124817, 280468, 239510, 280473, 124827, 214940, 247709, 214944, 280487, 313258, 321458, 296883, 124853, 214966, 296890, 10170, 288700, 296894, 190403, 280515, 296900, 337862, 165831, 280521, 231379, 296921, 239586, 313320, 231404, 124913, 165876, 321528, 313340, 239612, 288764, 239617, 313347, 288773, 313358, 321560, 305176, 313371, 354338, 305191, 223273, 313386, 354348, 124978, 215090, 124980, 288824, 288826, 321595, 378941, 313406, 288831, 288836, 67654, 280651, 354382, 288848, 280658, 215123, 354390, 288855, 288859, 280669, 313438, 223327, 280671, 149601, 321634, 149603, 149599, 329830, 280681, 313451, 223341, 280687, 215154, 280691, 313458, 313464, 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, 182517, 280823, 280825, 280827, 280830, 280831, 280833, 125187, 280835, 125191, 125207, 321817, 125209, 125218, 321842, 223539, 125239, 280888, 280891, 289087, 280897, 280900, 305480, 239944, 280906, 239947, 305485, 305489, 379218, 280919, 354653, 313700, 313705, 280937, 190832, 280946, 223606, 313720, 280956, 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, 166378, 305647, 281075, 174580, 240124, 281084, 305662, 305664, 240129, 305666, 240132, 223749, 305668, 281095, 223752, 338440, 150025, 223757, 281102, 223763, 223765, 281113, 322074, 281116, 281121, 182819, 281127, 150066, 158262, 158266, 289342, 281154, 322115, 158283, 281163, 281179, 338528, 338532, 281190, 199273, 281196, 158317, 19053, 313973, 281210, 297594, 158347, 133776, 314003, 117398, 314007, 289436, 174754, 330404, 289448, 133801, 174764, 314029, 314033, 240309, 133817, 314045, 314047, 314051, 199364, 297671, 158409, 289493, 363234, 289513, 289522, 289525, 289532, 322303, 289537, 322310, 264969, 322314, 322318, 281361, 281372, 322341, 215850, 281388, 281401, 289593, 289601, 281410, 281413, 281414, 240458, 281420, 240468, 281430, 322393, 297818, 281435, 281438, 281442, 174955, 224110, 207733, 207737, 158596, 183172, 338823, 322440, 314249, 240519, 183184, 240535, 289687, 297883, 289694, 289696, 289700, 289712, 281529, 289724, 52163, 281567, 289762, 322534, 297961, 183277, 322550, 134142, 322563, 314372, 175134, 322599, 322610, 314421, 281654, 314427, 314433, 207937, 314441, 207949, 322642, 281691, 314461, 281702, 281704, 314474, 281708, 281711, 248995, 306341, 306344, 306347, 322734, 306354, 142531, 199877, 289991, 306377, 249045, 363742, 363745, 298216, 330988, 126190, 216303, 322801, 388350, 257302, 363802, 199976, 199978, 314671, 298292, 298294, 257334, 216376, 298306, 380226, 224584, 224587, 224594, 216404, 306517, 150870, 314714, 224603, 159068, 314718, 265568, 314723, 281960, 150890, 306539, 314732, 314736, 290161, 216436, 306549, 298358, 314743, 306552, 290171, 314747, 298365, 306555, 290174, 224641, 281987, 314756, 298372, 281990, 224647, 265604, 298377, 314763, 142733, 298381, 314768, 224657, 306581, 314773, 314779, 314785, 282025, 314793, 282027, 241068, 241070, 241072, 282034, 241077, 150966, 298424, 306618, 282044, 323015, 306635, 306640, 290263, 290270, 290275, 339431, 282089, 191985, 282098, 290291, 282101, 241142, 191992, 290298, 151036, 290302, 282111, 290305, 175621, 192008, 323084, 257550, 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, 282261, 298651, 323229, 282269, 323231, 298655, 61092, 282277, 306856, 282295, 324766, 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, 323376, 315184, 315190, 241464, 159545, 282425, 298811, 307009, 413506, 241475, 307012, 298822, 148946, 315211, 282446, 307027, 315221, 323414, 315223, 241496, 241498, 307035, 307040, 110433, 282465, 241509, 110438, 298860, 110445, 282478, 315249, 282481, 110450, 315251, 315253, 315255, 339838, 282499, 315267, 315269, 241544, 282505, 241546, 241548, 298896, 282514, 298898, 44948, 298901, 241556, 241560, 282520, 241563, 241565, 241567, 241569, 282531, 241574, 282537, 298922, 36779, 241581, 282542, 241583, 323504, 241586, 290739, 282547, 241588, 241590, 241592, 241598, 290751, 241600, 241605, 151495, 241610, 298975, 241632, 298984, 241640, 241643, 298988, 241646, 241649, 241652, 323574, 290807, 241661, 299006, 282623, 315396, 315397, 241669, 282632, 282639, 290835, 282645, 241693, 282654, 102438, 217127, 282669, 323630, 282681, 290877, 282687, 159811, 315463, 315466, 192589, 307278, 192596, 176213, 307287, 315482, 217179, 315483, 192605, 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, 184479, 184481, 315557, 184486, 307370, 307372, 184492, 307374, 307376, 323763, 176311, 184503, 307385, 307386, 258235, 176316, 307388, 307390, 299200, 184512, 307394, 299204, 307396, 184518, 307399, 323784, 307409, 307411, 176343, 299225, 233701, 307432, 184572, 282881, 184579, 282893, 323854, 291089, 282906, 291104, 233766, 176435, 307508, 168245, 307510, 332086, 307512, 315701, 307515, 307518, 282942, 282947, 323917, 110926, 282957, 233808, 323921, 315733, 323926, 233815, 315739, 323932, 299357, 242018, 242024, 299373, 315757, 250231, 315771, 242043, 299388, 299391, 291202, 299398, 242057, 291212, 299405, 291222, 315801, 291226, 242075, 283033, 291231, 61855, 283042, 291238, 291241, 127403, 127405, 291247, 127407, 299440, 299444, 127413, 283062, 291254, 127417, 291260, 127421, 127424, 299457, 127429, 127431, 315856, 176592, 315860, 176597, 283095, 127447, 299481, 176605, 242143, 291299, 242152, 291305, 127466, 176620, 127474, 291314, 291317, 135672, 233979, 291323, 291330, 283142, 135689, 233994, 127497, 291341, 233998, 234003, 234006, 127511, 152087, 283161, 234010, 135707, 242202, 135710, 242206, 242208, 291361, 303773, 242220, 291378, 234038, 152118, 234041, 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, 225998, 299726, 226002, 119509, 226005, 226008, 242396, 299740, 201444, 299750, 283368, 234219, 283372, 226037, 283382, 316151, 234231, 234236, 226045, 242431, 234239, 209665, 234242, 242436, 234246, 226056, 234248, 291593, 242443, 234252, 242445, 234254, 291601, 234258, 242450, 242452, 234261, 348950, 201496, 234264, 234266, 234269, 283421, 234272, 234274, 152355, 234278, 299814, 283432, 234281, 234284, 234287, 283440, 185138, 242483, 234292, 234296, 234298, 160572, 283452, 234302, 234307, 242499, 234309, 292433, 234313, 316233, 316235, 234316, 283468, 234319, 242511, 234321, 234324, 201557, 234329, 234333, 308063, 234336, 242530, 234338, 349027, 234341, 234344, 234347, 177004, 234350, 324464, 234353, 152435, 234356, 177011, 234358, 234362, 234364, 291711, 234368, 234370, 291714, 291716, 234373, 226182, 234375, 226185, 308105, 234379, 234384, 234388, 234390, 226200, 234393, 209818, 308123, 234396, 324504, 234398, 291742, 324508, 234401, 291747, 291748, 234405, 291750, 234407, 324518, 324520, 291754, 324522, 226220, 291756, 234414, 324527, 291760, 234417, 201650, 324531, 234422, 226230, 324536, 275384, 234428, 291773, 226239, 324544, 234431, 234434, 324546, 242623, 324548, 234437, 226245, 234439, 234443, 291788, 193486, 234446, 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, 308231, 234504, 234507, 234510, 234515, 300054, 316439, 234520, 234519, 234523, 234526, 234528, 300066, 234532, 300069, 234535, 234537, 234540, 234543, 234546, 275508, 234549, 300085, 300088, 234556, 234558, 316479, 234561, 316483, 234563, 308291, 234568, 234570, 316491, 234572, 300108, 234574, 300115, 234580, 234581, 234585, 275545, 242777, 234590, 234593, 234595, 234597, 300133, 234601, 300139, 234605, 234607, 160879, 275569, 234610, 300148, 234614, 398455, 234618, 144506, 234620, 275579, 234623, 226433, 234627, 275588, 234629, 234634, 234636, 177293, 234640, 275602, 234643, 324757, 308373, 226453, 234647, 275608, 234650, 308379, 275606, 234653, 234648, 119967, 324768, 234657, 283805, 300189, 242852, 234661, 300197, 283813, 234664, 275626, 234667, 316596, 308414, 234687, 300223, 300226, 308418, 234692, 308420, 283844, 300229, 283850, 300234, 300238, 316625, 300241, 300243, 300245, 316630, 300248, 300253, 300256, 300258, 300260, 234726, 300263, 300265, 300267, 161003, 300270, 300272, 120053, 300278, 316663, 275703, 300284, 275710, 300287, 292097, 300289, 300292, 300294, 275719, 177419, 300299, 242957, 275725, 283917, 177424, 300301, 349464, 283939, 259367, 283951, 292143, 300344, 226617, 243003, 283963, 226628, 283973, 300357, 177482, 283983, 316758, 357722, 316766, 316768, 292192, 218464, 292197, 243046, 316774, 218473, 284010, 324978, 136562, 275834, 333178, 275836, 275840, 316803, 316806, 226696, 316811, 226699, 316814, 226703, 300433, 234899, 226709, 357783, 316824, 316826, 300448, 144807, 144810, 144812, 284076, 144814, 374196, 144820, 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, 316947, 308757, 308762, 316959, 284191, 284194, 284196, 235045, 284199, 284204, 284206, 284209, 284211, 284213, 308790, 316983, 284215, 194103, 284218, 194101, 226877, 284223, 284226, 243268, 284228, 226886, 284231, 292421, 128584, 284234, 366155, 317004, 276043, 284238, 226895, 284241, 194130, 284243, 300628, 276053, 284245, 317015, 284247, 235097, 243290, 284249, 284251, 284253, 300638, 284255, 243293, 284258, 292452, 292454, 284263, 177766, 284265, 292458, 284267, 292461, 284272, 284274, 284278, 276086, 292470, 292473, 284283, 276093, 284286, 276095, 284288, 292479, 325250, 284290, 284292, 292485, 276098, 292481, 284297, 317066, 284299, 317068, 276109, 284301, 284303, 284306, 276114, 284308, 284312, 284314, 284316, 276127, 284320, 284322, 284327, 276137, 317098, 284329, 284331, 284333, 284335, 276144, 284337, 284339, 300726, 284343, 284346, 284350, 358080, 276160, 284354, 358083, 284358, 276166, 358089, 276170, 284362, 276175, 284368, 276177, 284370, 358098, 284372, 317138, 284377, 284379, 284381, 284384, 284386, 358114, 358116, 276197, 317158, 358119, 284392, 325353, 284394, 358122, 284397, 276206, 284399, 358128, 358126, 358133, 358135, 276216, 358138, 300795, 358140, 284413, 358142, 284418, 317187, 358146, 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, 358224, 284499, 276308, 284502, 317271, 178006, 276315, 292700, 317279, 284511, 227175, 292715, 300912, 284529, 292721, 300915, 284533, 300920, 292729, 317306, 284540, 292734, 325512, 169868, 276365, 284564, 358292, 284566, 350106, 284572, 276386, 284579, 276388, 358312, 317353, 284585, 276395, 292776, 292784, 276402, 358326, 161718, 358330, 276411, 276418, 276425, 301009, 301011, 301013, 292823, 358360, 301017, 301015, 292828, 276446, 153568, 276448, 276452, 276455, 292839, 292843, 276460, 178161, 227314, 276466, 276472, 325624, 317435, 276476, 276479, 276482, 276485, 276490, 292876, 317456, 276496, 317458, 243733, 243740, 317468, 317472, 325666, 243751, 292904, 276528, 243762, 309298, 325685, 325689, 235579, 325692, 235581, 178238, 276539, 276544, 284739, 325700, 292934, 243785, 276553, 350293, 350295, 194649, 227418, 350299, 309337, 194654, 350302, 227423, 178273, 227426, 276579, 194660, 350308, 309348, 276583, 292968, 350313, 309354, 309350, 350316, 309352, 301163, 301167, 276586, 350321, 276590, 227440, 284786, 350325, 276595, 350328, 292985, 301178, 292989, 301185, 317570, 350339, 292993, 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, 309450, 301258, 276685, 276689, 309462, 301272, 276699, 309468, 194780, 309471, 301283, 317672, 317674, 325867, 243948, 194801, 309491, 227571, 309494, 243960, 227583, 276735, 276739, 211204, 276742, 227596, 325910, 342298, 309530, 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, 317833, 178572, 285070, 285077, 178583, 227738, 317853, 276896, 317858, 342434, 285093, 285098, 276907, 235955, 276917, 293304, 293307, 293314, 309707, 293325, 317910, 293336, 235996, 317917, 293343, 358880, 276961, 293346, 276964, 293352, 236013, 293364, 301562, 317951, 309764, 301575, 121352, 236043, 317963, 342541, 55822, 113167, 317971, 309779, 309781, 277011, 55837, 227877, 227879, 293417, 227882, 293421, 105007, 236082, 285236, 23094, 277054, 244288, 219714, 129603, 318020, 301636, 301639, 301643, 285265, 399955, 309844, 277080, 309849, 285277, 285282, 326244, 318055, 277100, 277106, 121458, 170618, 170619, 309885, 309888, 277122, 227975, 277128, 285320, 301706, 318092, 326285, 318094, 334476, 277136, 277139, 227992, 318108, 285340, 318110, 227998, 137889, 383658, 285357, 318128, 277170, 342707, 318132, 293555, 154292, 277173, 285368, 277177, 277181, 318144, 277187, 277191, 277194, 277196, 277201, 137946, 113378, 203491, 228069, 277223, 342760, 285417, 56041, 56043, 277232, 228081, 56059, 310015, 285441, 310020, 310029, 228113, 285459, 277273, 293659, 326430, 228128, 293666, 285474, 228135, 318248, 277291, 318253, 293677, 285489, 293685, 285494, 301880, 285499, 301884, 293696, 310080, 277317, 293706, 277322, 277329, 162643, 310100, 301911, 277337, 301913, 301921, 400236, 236397, 162671, 326514, 310134, 236408, 15224, 277368, 416639, 416640, 113538, 310147, 416648, 277385, 187274, 39817, 301972, 424853, 277405, 277411, 310179, 293798, 293802, 236460, 277426, 293811, 293817, 293820, 203715, 326603, 293849, 293861, 228327, 228328, 318442, 228332, 326638, 277486, 318450, 293876, 293877, 285686, 302073, 121850, 285690, 244731, 293882, 302075, 293887, 277504, 277507, 277511, 277519, 293908, 293917, 293939, 318516, 277561, 277564, 310336, 7232, 293956, 277573, 228422, 310344, 277577, 293960, 277583, 203857, 293971, 310359, 236632, 277594, 138332, 277598, 285792, 277601, 203872, 310374, 203879, 310376, 228460, 318573, 203886, 187509, 285815, 285817, 367737, 285821, 302205, 392326, 253064, 302218, 285835, 294026, 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, 302296, 384222, 310498, 285927, 318698, 302315, 228592, 294132, 138485, 228601, 204026, 228606, 204031, 64768, 310531, 228617, 138505, 318742, 204067, 277798, 130345, 277801, 113964, 285997, 277804, 285999, 277807, 113969, 277811, 318773, 318776, 277816, 286010, 277819, 294204, 417086, 277822, 302403, 294211, 384328, 277832, 277836, 294221, 326991, 277839, 277842, 277847, 277850, 179547, 277853, 146784, 277857, 302436, 277860, 294246, 327015, 310632, 327017, 351594, 277864, 277869, 277872, 351607, 310648, 277880, 310651, 277884, 277888, 310657, 351619, 294276, 310659, 327046, 277892, 253320, 310665, 318858, 277894, 277898, 277903, 310672, 277905, 351633, 277908, 277917, 310689, 277921, 130468, 228776, 277928, 277932, 310703, 277937, 130486, 310710, 310712, 277944, 310715, 277947, 302526, 228799, 277950, 277953, 64966, 245191, 310727, 302534, 277959, 277963, 302541, 277966, 302543, 310737, 277971, 228825, 163290, 277978, 310749, 277981, 277984, 310755, 277989, 277991, 187880, 277995, 286188, 310764, 278000, 228851, 310772, 278003, 278006, 40440, 212472, 278009, 286203, 40443, 40446, 40448, 228864, 286214, 228871, 302603, 302614, 286233, 302617, 302621, 286240, 146977, 294435, 187939, 40484, 40486, 294439, 40488, 286246, 294440, 294443, 40491, 294445, 286248, 310831, 40499, 40502, 212538, 40507, 40511, 40513, 228933, 40521, 286283, 40525, 40527, 212560, 228944, 400976, 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, 319163, 302781, 319171, 302789, 294599, 278216, 294601, 302793, 343757, 319187, 286420, 278227, 229076, 286425, 319194, 278235, 278238, 229086, 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, 40840, 40851, 294803, 188312, 294811, 319390, 237470, 294817, 319394, 40865, 294821, 311209, 180142, 343983, 309346, 294831, 188340, 40886, 319419, 294844, 294847, 393177, 294876, 294879, 294883, 294890, 311279, 278513, 237555, 278516, 311283, 278519, 237562 ]