blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
2
625
content_id
stringlengths
40
40
detected_licenses
listlengths
0
47
license_type
stringclasses
2 values
repo_name
stringlengths
5
116
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
643 values
visit_date
timestamp[ns]
revision_date
timestamp[ns]
committer_date
timestamp[ns]
github_id
int64
80.4k
689M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
16 values
gha_event_created_at
timestamp[ns]
gha_created_at
timestamp[ns]
gha_language
stringclasses
85 values
src_encoding
stringclasses
7 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
1 class
length_bytes
int64
4
6.44M
extension
stringclasses
17 values
content
stringlengths
4
6.44M
duplicates
listlengths
1
9.02k
0783064de515c943c97d07b87529d348a575f2c3
9c59902a287ded5e48520e4ad433f8f3254ffa8d
/CrabflixPremium/CrabflixPremium/service/FilmService.swift
97c8a3e3876088dfca0c7a246954e4890a9de9f4
[]
no_license
luezcurra/Crabflix-Premium
887afa6b6aebc092072f10f8a34a685ec6cfd6aa
15b0edac8674698e2925a2c9ddff8c2c6ce5fff1
refs/heads/master
2020-08-06T02:58:22.401579
2019-10-04T12:25:05
2019-10-04T12:25:05
212,808,588
0
0
null
null
null
null
UTF-8
Swift
false
false
1,031
swift
// // FilmService.swift // CrabflixPremium // // Created by Luciana Ines Ezcurra on 26/09/2019. // Copyright © 2019 Luciana Ines Ezcurra. All rights reserved. // import Foundation class FilmService { func getFilm(serviceCompleted: @escaping(([Film])) -> Void) -> Void { let filmsDao = FilmDAO() filmsDao.getProductFromAPI { (response) in serviceCompleted(response) } } func search(query: String?, daoCompleted: @escaping (([Film]) -> Void)) -> Void { if let aQuery = query { let filmsDao = FilmDAO() filmsDao.search(query: aQuery) { (response) in daoCompleted(response) } } } func searchTrailer(movieID: Int?, daoCompleted: @escaping (([Trailer]) -> Void)) -> Void { if let aKey = movieID { let filmsDao = FilmDAO() filmsDao.searchTrailer(movieID: aKey) { (trailers) in daoCompleted(trailers) } } } }
[ -1 ]
a577086a068e59c6ca016acf03e2f24b4adfaf8f
f2acd28e0ab98e7c52254c94f420f089bbff4a0a
/SwiftUtils/DateExtensions.swift
be46c2a1be9e3e0112dd0db79c3f2d62c17275b7
[ "MIT" ]
permissive
hisaac/SwiftUtils
ee595cd930cf35c36d458ebee7044e4976c0b32d
94efe37122d7afa7647714716ba576914f4d01d5
refs/heads/master
2021-09-20T14:09:54.888135
2018-08-10T13:37:07
2018-08-10T13:37:07
119,621,060
0
0
null
null
null
null
UTF-8
Swift
false
false
2,630
swift
// Created by Isaac Halvorson on 1/31/18 import Foundation /// Date extensions for anything extension Date { /// Returns the start of the day public var startOfDay: Date { return Calendar.current.startOfDay(for: self) } /** Returns the last second of the day */ public var endOfDay: Date { /// There are 86400 seconds in a day, so if we add one less than that to `startOfDay`, we get the end of the day return startOfDay.addingTimeInterval(86_399) } public func secondsFrom(_ date: Date) -> Int { return interval(ofComponent: .second, fromDate: date) } public func minutesFrom(_ date: Date) -> Int { return interval(ofComponent: .minute, fromDate: date) } public func interval(ofComponent component: Calendar.Component, fromDate date: Date) -> Int { let currentCalendar = Calendar.current guard let start = currentCalendar.ordinality(of: component, in: .era, for: date) else { return 0 } guard let end = currentCalendar.ordinality(of: component, in: .era, for: self) else { return 0 } return end - start } public func add(_ amount: Int, ofComponent component: Calendar.Component) -> Date? { return Calendar.current.date(byAdding: component, value: amount, to: self) } public func isSameDay(as dateToCompare: Date) -> Bool { let currentCalendar = Calendar.current return currentCalendar.compare(self, to: dateToCompare, toGranularity: .day) == .orderedSame } } /// Date extensions for display use extension Date { /// Returns the date as a string in the `.medium` format public var dateForDisplay: String { let dateFormatter = DateFormatter() dateFormatter.dateStyle = .medium dateFormatter.locale = Locale.current return dateFormatter.string(from: self) } public var timeForDisplay: String { let dateFormatter = DateFormatter() dateFormatter.timeStyle = .short dateFormatter.locale = Locale.current return dateFormatter.string(from: self) } public var dateTimeForDisplay: String { let dateFormatter = DateFormatter() dateFormatter.dateStyle = .medium dateFormatter.timeStyle = .short dateFormatter.locale = Locale.current return dateFormatter.string(from: self) } } /// Date extensions for API calls extension Date { public func formatDateForService() -> String { let dateFormatter = DateFormatter() dateFormatter.locale = Locale(identifier: "en_US_POSIX") dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSS" dateFormatter.timeZone = TimeZone(abbreviation: "UTC") dateFormatter.calendar = Calendar(identifier: .iso8601) let formattedDateString = "\(dateFormatter.string(from: Date()))Z" return formattedDateString } }
[ -1 ]
9a6e27a8e6601809e7860c023ccfda454842cd98
bbbc891ceeaf77ef99f2d9df28525c42d1c57d0e
/MedOpsTrialManagement/MedOpsTrialManagement/Views/PieChartCell.swift
749a640fd728dc8e69c70354347097728754e77d
[]
no_license
jaimin23/MedOps_iOS
708a91f1683458df2abc78a4071972a9508e5834
5e063de94d3bda3a4e6fc6d574294a0afa6cfb94
refs/heads/master
2020-06-24T08:51:33.444014
2019-08-21T02:03:12
2019-08-21T02:03:12
198,920,920
0
0
null
null
null
null
UTF-8
Swift
false
false
1,648
swift
// // PieChartCellView.swift // MedOpsTrialManagement // // Created by Jaimin Patel on 2018-11-25. // Copyright © 2018 Jaimin Patel. All rights reserved. // import Foundation import UIKit import Charts class PieChartCell: UITableViewCell{ @IBOutlet weak var pieChartView: PieChartView! var item: [MockPerson]? { didSet{ guard let item = item else{return} var pieCharEntries = [PieChartDataEntry]() var genders = ["Male","Female"] var maleCount = 0 var femaleCount = 0 for gender in (item){ if(gender.gender.elementsEqual("female")){ femaleCount += 1 } else{ maleCount += 1 } } let genderCount = [maleCount, femaleCount] for(index, value) in genderCount.enumerated(){ let entry = PieChartDataEntry() entry.y = Double(value) entry.label = genders[index] pieCharEntries.append(entry) } let dataSet = PieChartDataSet(values: pieCharEntries, label: "Gender Population") dataSet.colors = ChartColorTemplates.joyful() let data = PieChartData(dataSet: dataSet) pieChartView.data = data pieChartView.isUserInteractionEnabled = true pieChartView.animate(yAxisDuration: 2.0) } } static var nib:UINib{ return UINib(nibName: identifier, bundle: nil) } static var identifier: String{ return String(describing: self) } }
[ -1 ]
500782608e6a7ccca929383a509f9cb95ffd2b3a
cd87d25ebab8b17b50646e33ba0ff3352d6077c6
/MarvelApp/App/Components/ImageCache.swift
47da6ce5f7375bce108e9de6abdbd4038b93ccc7
[]
no_license
zxcv7143/MVVM-SwiftUI
ea5d6f391c986368d23b5483b39e73b4807edf46
edf35977a6166cefca2f2af704eb37f18e57237a
refs/heads/master
2022-11-05T19:34:20.683823
2020-06-30T08:42:05
2020-06-30T08:42:05
269,119,923
1
0
null
null
null
null
UTF-8
Swift
false
false
641
swift
// // ImageCache.swift // MarvelApp // // Created by Anton Zuev on 20/04/2020. // // import Foundation import SwiftUI import UIKit struct ImageCacheKey: EnvironmentKey { static let defaultValue: ImageCache = TemporaryImageCache() } protocol ImageCache { subscript(_ url: URL) -> UIImage? { get set } } struct TemporaryImageCache: ImageCache { private let cache = NSCache<NSURL, UIImage>() subscript(_ key: URL) -> UIImage? { get { cache.object(forKey: key as NSURL) } set { newValue == nil ? cache.removeObject(forKey: key as NSURL) : cache.setObject(newValue!, forKey: key as NSURL) } } }
[ -1 ]
98f32b3393bd43fed8567b34a2f6a71821d675a4
92f7492f6ab9b91748eff131840b89be36840ac5
/DJSwiftUI/DJSwiftUI/B/ViewModel/LoginViewModel.swift
2deab81b909ccb41ffe6b759cd22a74ad9ce8187
[]
no_license
doublejiahub/DJSwiftUI
caad5c695658a78590d30ee39923093d27fe8822
2e96d3218f7418d6ba05e573a9162286e967ea37
refs/heads/main
2023-06-07T20:55:28.478629
2021-06-24T12:21:49
2021-06-24T12:21:49
378,896,465
0
0
null
null
null
null
UTF-8
Swift
false
false
2,398
swift
// // LoginViewModel.swift // HJJLogin // // Created by 郝旭姗 on 2021/1/18. // import Foundation import Combine struct LoginViewModel { var username: String = "" var password: String = "" func login(in store: Store) { //这个返回值是一个 AnyCancellable,在它被释放时,cancel() 会被自动调用,导致订阅取消。上面的代 码里发生的正是这一情况:因为我们没有存储这个值,它在创建后就立即被释放掉, 导致订阅取消。如果我们不想要这个异步操作在完成之前就被取消掉,就需要想办 法持有 sink 的返回值,直到异步操作完成。为了达到这一点,可以添加一个 SubscriptionToken 来持有 AnyCancellable let token = SubscriptionToken() LoginRequest(username: username, password: password) .publisher .sink { (complete) in if case .failure(let error) = complete { print(error.description) store.executeAction(action: .loginComplete(result: .failure(error))) //isLogining = false } token.unseal() } receiveValue: { (user) in print("用户名: \(user.username) 密码: \(user.password)") store.executeAction(action: .loginComplete(result: .success(user))) //appState.isLogging = true //isLogining = false } .seal(in: token) } } class SubscriptionToken { var cancellable: AnyCancellable? func unseal() { cancellable = nil } } extension AnyCancellable { //seal 会把当前的 AnyCancellable 值 “封印” 到 SubscriptionToken 中去 func seal(in token: SubscriptionToken) { token.cancellable = self } } /* 1. 创建一个 SubscriptionToken 值备用,它需要存活到订阅的异步事件结束。 2. 在 sink 订阅后,把返回的 AnyCancellable 存放到 token 里。 3. 调用 token 的 unseal 方法将 AnyCancellable 释放。在这里,unseal 中里将 cancellable 置为 nil 的操作其实并不是必须的,因为一旦 token 离开作用域 被释放后,它其中的 cancellable 也会被释放,从而导致订阅资源的释放。这 里的关键是利用闭包,让 token 本身存活到事件结束,以保证订阅本身不被取消。 */
[ -1 ]
b0d9d996e238c990a7d4502be3a993e912739694
6329961db2dc932a351bec37b8ee9c1e49b98e6e
/WheatherAppFactory/MainView/MainViewController.swift
6e9ea90e2445e09a3440456757d7434109bf26a2
[]
no_license
myCRObaM/WeatherFactoryApp
a28d9ed5829a69225fc57aef32776fe967a8e679
57c72cd476a9af31b154d7aa186e697c9ae81ee7
refs/heads/master
2020-07-23T11:02:10.748768
2019-09-16T12:53:34
2019-09-16T12:53:34
207,537,055
0
0
null
null
null
null
UTF-8
Swift
false
false
15,854
swift
// // ViewController.swift // WheatherAppFactory // // Created by Matej Hetzel on 10/09/2019. // Copyright © 2019 Matej Hetzel. All rights reserved. // import UIKit import RxSwift import Hue import MapKit import CoreLocation class MainViewController: UIViewController, UISearchBarDelegate, CLLocationManagerDelegate{ let viewModel: MainViewModel! let disposeBag = DisposeBag() var customView: MainView! var tempUnits: String = "°C" var speedUnit: String = "km/h" var searchBarCenterY: NSLayoutConstraint! var openSearchScreenDelegate: SearchScreenDelegate! var openSettingScreenDelegate: SettingsScreenDelegate! var vSpinner : UIView? var dataIsDoneLoading: hideViewController! let locationManager = CLLocationManager() func fetchCityAndCountry(from location: CLLocation, completion: @escaping (_ city: String?, _ country: String?, _ error: Error?) -> ()) { CLGeocoder().reverseGeocodeLocation(location) { placemarks, error in completion(placemarks?.first?.locality, placemarks?.first?.country, error) } } func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) { guard let location: CLLocation = manager.location else { return } guard let locValue: CLLocationCoordinate2D = manager.location?.coordinate else { return } print("locations = \(locValue.latitude) \(locValue.longitude)") viewModel.locationToUse = String(String(locValue.latitude) + "," + String(locValue.longitude)) viewModel.getLocationSubject.onNext(false) fetchCityAndCountry(from: location) { city, country, error in guard let city = city, let country = country, error == nil else { return } print(city + ", " + country) self.viewModel.locationsData = LocationsObject(placeName: city, countryCode: Locale.current.regionCode ?? country, lng: locValue.longitude, lat: locValue.latitude, isSelected: true) self.viewModel.firstLoadOfRealm.onNext(true) self.viewModel.getDataSubject.onNext(self.viewModel.locationToUse) } } func setupSearchBar() { let searchTextField:UITextField = customView.searchBar.subviews[0].subviews.last as! UITextField searchTextField.layer.cornerRadius = 15 searchTextField.textAlignment = NSTextAlignment.left let image:UIImage = UIImage(named: "search_icon")! let imageView:UIImageView = UIImageView.init(image: image) searchTextField.leftView = nil searchTextField.placeholder = "Search" searchTextField.rightView = imageView imageView.image = imageView.image?.withRenderingMode(.alwaysTemplate) imageView.tintColor = UIColor(hex: "#6DA133") if let backgroundview = searchTextField.subviews.first { backgroundview.layer.cornerRadius = 18; backgroundview.clipsToBounds = true; } searchTextField.rightViewMode = UITextField.ViewMode.always } override func viewDidLoad() { super.viewDidLoad() setupView() setupViewModel() } override func viewDidAppear(_ animated: Bool) { setupSearchBar() super.viewDidAppear(animated) } init(viewModel: MainViewModel) { self.viewModel = viewModel super.init(nibName: nil, bundle: nil) } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } func setupView(){ customView = MainView(frame: view.frame) view.addSubview(customView) setupConstraints() customView.settingsImage.addTarget(self, action: #selector(settingPressed), for: .touchUpInside) } func setupConstraints() { NSLayoutConstraint.activate([ customView.topAnchor.constraint(equalTo: view.topAnchor), customView.bottomAnchor.constraint(equalTo: view.bottomAnchor), customView.leadingAnchor.constraint(equalTo: view.leadingAnchor), customView.trailingAnchor.constraint(equalTo: view.trailingAnchor) ]) setupSearchBarConstraints() } func setupSearchBarConstraints(){ customView.searchBar.delegate = self searchBarCenterY = NSLayoutConstraint(item: customView.searchBar, attribute: .centerY, relatedBy: .equal, toItem: customView.settingsImage, attribute: .centerY, multiplier: 1, constant: 0) NSLayoutConstraint.activate([ customView.searchBar.heightAnchor.constraint(equalToConstant: 70), customView.searchBar.leadingAnchor.constraint(equalTo: customView.settingsImage.trailingAnchor, constant: 10), customView.searchBar.trailingAnchor.constraint(equalTo: customView.trailingAnchor, constant: -10) ]) view.addConstraint(searchBarCenterY) } func checkSettings(){ if viewModel.settingsObjects.humidityIsSelected { setupHumidity() } else { customView.moreInfoStackView.removeArrangedSubview(customView.humidityStackView) customView.humidityStackView.removeFromSuperview() } if viewModel.settingsObjects.windIsSelected { setupWind() } else { customView.moreInfoStackView.removeArrangedSubview(customView.windStackView) customView.windStackView.removeFromSuperview() } if viewModel.settingsObjects.pressureIsSelected { setupPressure() } else { customView.moreInfoStackView.removeArrangedSubview(customView.pressureStackView) customView.pressureStackView.removeFromSuperview() } checkForChangesInUnits() } func setupHumidity(){ customView.humidityStackView.addArrangedSubview(customView.humidityImage) customView.humidityStackView.addArrangedSubview(customView.humidityLabel) customView.moreInfoStackView.addArrangedSubview(customView.humidityStackView) } func setupWind(){ customView.windStackView.addArrangedSubview(customView.windImage) customView.windStackView.addArrangedSubview(customView.windLabel) customView.moreInfoStackView.addArrangedSubview(customView.windStackView) } func setupPressure(){ customView.pressureStackView.addArrangedSubview(customView.pressureImage) customView.pressureStackView.addArrangedSubview(customView.pressureLabel) customView.moreInfoStackView.addArrangedSubview(customView.pressureStackView) } func setupViewModel(){ viewModel.getData(subject: viewModel.getDataSubject).disposed(by: disposeBag) spinnerControl(subject: viewModel.dataIsDoneLoading).disposed(by: disposeBag) viewModel.addObjectToRealm(subject: viewModel.firstLoadOfRealm).disposed(by: disposeBag) viewModel.loadDataForScreen(subject: viewModel.loadSettingSubject).disposed(by: disposeBag) viewModel.loadLocationsFromRealm(subject: viewModel!.setupCurrentLocationSubject).disposed(by: disposeBag) locationManager.requestWhenInUseAuthorization() viewModel.loadSettingSubject.onNext(true) setupLocation(subject: viewModel.getLocationSubject).disposed(by: disposeBag) viewModel.addLocationToRealm(subject: viewModel.addLocationToRealmSubject).disposed(by: disposeBag) } func setupLocation(subject: PublishSubject<Bool>) -> Disposable{ return subject .observeOn(MainScheduler.instance) .subscribeOn(viewModel.scheduler) .subscribe(onNext: {[unowned self] bool in switch bool{ case true: if CLLocationManager.locationServicesEnabled() { self.locationManager.delegate = self self.locationManager.desiredAccuracy = kCLLocationAccuracyHundredMeters self.locationManager.startUpdatingLocation() } case false: self.locationManager.stopUpdatingLocation() } })} func setupData(){ let weatherData = viewModel.mainWeatherData.currently checkSettings() customView.currentTemperatureLabel.text = String(Int(weatherData.temperature)) + "°" customView.currentSummaryLabel.text = weatherData.summary customView.location.text = viewModel.locationsData.placeName customView.humidityLabel.text = String(Int(weatherData.humidity * 100)) + " %" customView.windLabel.text = String((weatherData.windSpeed * 10).rounded()/10) + speedUnit customView.pressureLabel.text = String(Int(weatherData.pressure)) + " hpa" let imageExtension = weatherData.icon customView.headerImage.image = UIImage(named: "header_image-\(imageExtension)") customView.mainBodyImage.image = UIImage(named: "body_image-\(imageExtension)") setupGradient(weatherData) setupLowAndHighTemperatures(viewModel.mainWeatherData) viewModel.isDownloadingFromSearch = false } func checkForChangesInUnits(){ if viewModel.settingsObjects.metricSelected { viewModel.unitMode = "si" } else { viewModel.unitMode = "us" } if viewModel.unitMode == "si" { tempUnits = "°C" speedUnit = "km/h" } else { tempUnits = "°F" speedUnit = "mph" } } func setupGradient(_ data: Currently){ var firstColor = UIColor(hex: "#15587B") var secondColor = UIColor(hex: "#4A75A2") if data.icon == "clear-day" || data.icon == "wind" { firstColor = UIColor(hex: "#59B7E0") secondColor = UIColor(hex: "#D8D8D8") } else if data.icon == "clear-night" || data.icon == "partly-cloudy-night"{ firstColor = UIColor(hex: "#044663") secondColor = UIColor(hex: "#234880") } else if data.icon == "rain" || data.icon == "cloudy" || data.icon == "thunderstorm" || data.icon == "tornado" || data.icon == "hail"{ firstColor = UIColor(hex: "#15587B") secondColor = UIColor(hex: "#4A75A2") } else if data.icon == "snow" || data.icon == "sleet" { firstColor = UIColor(hex: "#0B3A4E") secondColor = UIColor(hex: "#80D5F3") } else if data.icon == "fog" || data.icon == "cloudy" || data.icon == "partly-cloudy-day" { firstColor = UIColor(hex: "#ABD6E9") secondColor = UIColor(hex: "#D8D8D8") } let gradientLocal: CAGradientLayer = { let gradientLocal: CAGradientLayer = [ firstColor, secondColor ].gradient() gradientLocal.startPoint = CGPoint(x: 0.5, y: 0) gradientLocal.endPoint = CGPoint(x: 0.5, y: 0.98) return gradientLocal }() customView.gradientView.setupUI(gradientLocal) } func setupLowAndHighTemperatures(_ data: MainDataClass){ let calendar = Calendar.current let currentDay = calendar.component(.day, from: NSDate(timeIntervalSince1970: Double(data.currently.time)) as Date) for day in data.daily.data { let searchDay = calendar.component(.day, from: NSDate(timeIntervalSince1970: Double(day.time)) as Date) if currentDay == searchDay { self.customView.lowTemperatureLabel.text = String((day.temperatureMin * 10).rounded() / 10) + tempUnits self.customView.highTemperatureLabel.text = String((day.temperatureMax * 10).rounded() / 10) + tempUnits } } } func spinnerControl(subject: PublishSubject<DataDoneEnum>) -> Disposable{ return subject .observeOn(MainScheduler.instance) .subscribeOn(viewModel.scheduler) .subscribe(onNext: {[unowned self] bool in switch bool { case .dataForMainDone: self.setupData() self.removeSpinner() self.viewModel.addLocationToRealmSubject.onNext(true) case .dataNotReady: self.showSpinner(onView: self.view) case .dataFromSearchDone: self.view.addSubview(self.customView.searchBar) self.setupSearchBarConstraints() self.customView.searchBar.text = "" self.dataIsDoneLoading.didLoadData() self.setupData() self.removeSpinner() self.viewModel.addLocationToRealmSubject.onNext(true) self.viewModel.firstLoadOfRealm.onNext(true) } }) } func showSpinner(onView : UIView) { let spinnerView = UIView.init(frame: onView.bounds) spinnerView.backgroundColor = UIColor.init(red: 0.5, green: 0.5, blue: 0.5, alpha: 0.5) let ai = UIActivityIndicatorView.init(style: .whiteLarge) ai.startAnimating() ai.center = spinnerView.center DispatchQueue.main.async { spinnerView.addSubview(ai) onView.addSubview(spinnerView) } vSpinner = spinnerView } func removeSpinner() { DispatchQueue.main.async { self.vSpinner?.removeFromSuperview() self.vSpinner = nil } } func hideSearch(){ self.view.addSubview(self.customView.searchBar) self.setupSearchBarConstraints() self.customView.searchBar.text = "" } @objc func settingPressed(){ openSettingScreenDelegate.buttonPressed(rootController: self) } func searchBarPressed(){ openSearchScreenDelegate.openSearchScreen(searchBar: customView.searchBar, rootController: self) } func searchBarShouldBeginEditing(_ searchBar: UISearchBar) -> Bool { searchBarPressed() return false } } extension MainViewController: hideKeyboard { func hideViewController() { hideSearch() } } extension MainViewController: ChangeLocationBasedOnSelection{ func didSelectLocation(long: Double, lat: Double, location: String, countryc: String) { viewModel.isDownloadingFromSearch = true let location = CLLocation(latitude: lat, longitude: long) fetchCityAndCountry(from: location) { city, country, error in guard let city = city, let _ = country, error == nil else { return } self.viewModel.locationToUse = String(String(lat) + "," + String(String(long))) self.viewModel.locationsData = LocationsObject(placeName: city, countryCode: countryc, lng: long, lat: lat, isSelected: true) self.viewModel.settingsObjects = SettingsScreenObject(metricSelected: true, humidityIsSelected: true, windIsSelected: true, pressureIsSelected: true, lastSelectedLocation: self.viewModel.locationsData.placeName) self.viewModel.getDataSubject.onNext(self.viewModel.locationToUse) } } } extension MainViewController: DoneButtonIsPressedDelegate { func close(settings: SettingsScreenObject, location: LocationsObject) { viewModel.locationsData = location viewModel.settingsObjects = settings checkForChangesInUnits() viewModel.loadSettingSubject.onNext(true) } }
[ -1 ]
329fa590a2957e343774defd2db96b9893abec46
e642e6889d9f5c862827f8e1ca3d03c0deaf1159
/SampleDesignUI/Extensions/UIViewExtension.swift
cc5e1d7d6abc4a1d611d5a3dfb8292d36a137059
[]
no_license
kurians2006/SampleUI
88dfd36c544dcd95f88e857b6f4dc5127c7bdbcf
3e951f2585df70d4e34b403a5eee2b5bc91a444e
refs/heads/master
2020-05-22T08:48:58.339112
2019-05-13T19:58:35
2019-05-13T19:58:35
186,286,931
0
0
null
null
null
null
UTF-8
Swift
false
false
894
swift
// // UIViewExtension.swift // SampleDesignUI // // Created by MacBook Pro on 11/05/2019. // Copyright © 2019 Naeem Paracha. All rights reserved. // import UIKit @IBDesignable extension UIView { @IBInspectable var borderColor: UIColor? { set { layer.borderColor = newValue?.cgColor } get { guard let color = layer.borderColor else { return nil } return UIColor(cgColor: color) } } @IBInspectable var borderWidth: CGFloat { set { layer.borderWidth = newValue } get { return layer.borderWidth } } @IBInspectable var cornerRadius: CGFloat { set { layer.cornerRadius = newValue clipsToBounds = newValue > 0 } get { return layer.cornerRadius } } }
[ -1 ]
bfaa76e29b8124fac91923a766beaa5173649e07
c74ddca2f9383528c0455845742aaedb8d98b7cc
/DemoTests/DemoTests.swift
e822bd0c1f0c0e149845efb3b65ade8640134e0d
[]
no_license
ShiviOSDeveloper/Nitish
369eeaaf5ff8734769949e594fc46f58da27ee14
98b3711e08a5b23eca2b1edd1ab5e634ef35ae98
refs/heads/master
2020-04-27T21:12:17.403859
2019-03-12T18:43:38
2019-03-12T18:43:38
174,687,687
0
0
null
null
null
null
UTF-8
Swift
false
false
881
swift
// // DemoTests.swift // DemoTests // // Created by Little on 07/03/19. // Copyright © 2019 Nitish. All rights reserved. // import XCTest @testable import Demo class DemoTests: XCTestCase { override func setUp() { // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. } func testExample() { // This is an example of a functional test case. // Use XCTAssert and related functions to verify your tests produce the correct results. } func testPerformanceExample() { // This is an example of a performance test case. self.measure { // Put the code you want to measure the time of here. } } }
[ 360462, 98333, 16419, 229413, 204840, 278570, 344107, 155694, 253999, 229424, 229430, 319542, 163896, 180280, 352315, 376894, 352326, 254027, 311372, 163917, 196691, 278615, 180311, 180312, 385116, 237663, 254048, 319591, 221290, 278634, 319598, 352368, 204916, 131191, 237689, 278655, 278677, 196760, 426138, 278685, 311458, 278691, 49316, 32941, 278704, 377009, 278708, 131256, 295098, 139479, 254170, 229597, 311519, 205035, 385262, 286958, 327929, 344313, 147717, 368905, 180493, 254226, 319763, 368916, 262421, 377114, 237856, 237857, 278816, 311597, 98610, 180535, 336183, 278842, 287041, 319821, 254286, 344401, 377169, 368981, 155990, 368984, 106847, 98657, 270701, 246127, 270706, 139640, 246137, 106874, 246136, 311685, 106888, 385417, 311691, 385422, 213403, 246178, 385454, 311727, 377264, 319930, 311738, 33211, 336317, 278970, 336320, 311745, 278978, 254406, 188871, 278993, 278999, 328152, 369116, 287198, 279008, 279013, 279018, 319981, 319987, 279029, 254456, 279032, 377338, 377343, 279039, 254465, 287241, 279050, 139792, 303636, 393751, 254488, 279065, 377376, 377386, 197167, 385588, 352829, 115270, 385615, 426576, 369235, 295519, 139872, 66150, 344680, 279146, 287346, 139892, 344696, 287352, 279164, 189057, 311941, 336518, 369289, 311945, 344715, 279177, 311949, 287374, 377489, 311954, 352917, 230040, 271000, 377497, 303771, 377500, 295576, 221852, 205471, 344738, 139939, 279206, 295590, 287404, 205487, 295599, 303793, 336564, 164533, 287417, 287422, 66242, 377539, 164560, 385747, 279252, 361176, 418520, 287452, 295652, 369385, 312047, 418546, 312052, 172792, 344827, 221948, 205568, 295682, 197386, 434957, 312079, 295697, 426774, 197399, 426775, 336671, 344865, 197411, 262951, 279336, 262954, 295724, 353069, 197422, 353070, 164656, 295729, 312108, 328499, 353078, 353079, 197431, 230199, 336702, 279362, 353094, 353095, 353109, 377686, 230234, 189275, 435039, 295776, 279392, 303972, 385893, 230248, 246641, 246643, 295798, 246648, 361337, 279417, 254850, 369538, 287622, 426895, 295824, 189348, 353195, 140204, 353197, 377772, 304051, 230332, 377790, 353215, 353216, 189374, 213957, 213960, 345033, 279498, 386006, 418776, 50143, 123881, 320493, 320494, 304110, 271350, 295927, 304122, 320507, 328700, 328706, 410627, 320516, 295942, 386056, 353290, 230410, 377869, 320527, 238610, 418837, 140310, 320536, 197657, 336929, 189474, 369701, 345132, 238639, 312373, 238651, 377926, 361543, 238664, 353367, 156764, 156765, 304222, 173166, 377972, 353397, 337017, 377983, 402565, 279685, 222343, 386189, 296086, 238743, 296092, 238765, 279728, 238769, 402613, 353479, 353481, 353482, 402634, 189653, 419029, 279765, 148696, 296153, 279774, 304351, 304356, 222440, 328940, 279792, 353523, 386294, 386301, 320770, 386306, 279814, 328971, 312587, 353551, 320796, 222494, 369956, 353584, 345396, 386359, 345402, 116026, 378172, 222524, 279875, 312648, 337225, 304456, 230729, 238927, 353616, 296273, 222559, 378209, 230756, 386412, 230765, 296303, 279920, 312689, 296307, 116084, 337281, 148867, 378244, 296329, 296335, 9619, 370071, 279974, 173491, 304564, 353719, 361927, 296392, 370123, 148940, 280013, 312782, 222675, 329173, 353750, 280032, 271843, 280041, 361963, 296433, 321009, 280055, 288249, 296448, 230921, 329225, 296461, 304656, 329232, 370197, 230943, 402985, 394794, 230959, 288309, 312889, 288318, 280130, 124485, 288326, 288327, 280147, 239198, 99938, 312940, 222832, 247416, 337534, 337535, 263809, 288392, 239250, 419478, 345752, 255649, 321199, 337591, 321207, 296632, 280251, 280257, 321219, 280267, 403148, 9936, 9937, 370388, 272085, 345814, 181975, 280278, 280280, 18138, 345821, 321247, 321249, 345833, 345834, 280300, 67315, 173814, 313081, 124669, 288512, 288516, 280329, 321302, 345879, 116505, 321310, 255776, 247590, 362283, 378668, 296755, 321337, 345919, 436031, 403267, 345929, 337745, 255829, 18262, 362327, 370522, 280410, 345951, 362337, 345955, 296806, 288619, 280430, 214895, 313199, 362352, 296814, 313203, 124798, 182144, 305026, 67463, 329622, 337815, 124824, 214937, 239514, 436131, 354212, 436137, 362417, 124852, 288697, 362431, 214977, 214984, 321480, 362443, 247757, 346067, 280541, 329695, 436191, 313319, 337895, 247785, 436205, 124911, 329712, 362480, 313339, 43014, 354316, 313357, 182296, 223268, 354345, 223274, 321583, 124975, 346162, 124984, 288828, 436285, 288833, 288834, 436292, 403525, 436301, 338001, 354385, 338003, 280661, 329814, 338007, 354393, 280675, 329829, 280677, 43110, 321637, 436329, 313447, 288879, 280694, 288889, 215164, 313469, 215166, 280712, 215178, 346271, 436383, 362659, 239793, 125109, 182456, 280762, 379071, 149703, 338119, 346314, 321745, 387296, 280802, 379106, 338150, 346346, 321772, 125169, 338164, 436470, 125183, 149760, 411906, 125188, 313608, 125193, 125198, 125199, 272658, 125203, 338197, 125208, 305440, 125217, 338218, 321840, 379186, 125235, 280887, 125240, 321860, 182598, 289110, 215385, 272729, 379225, 321894, 280939, 354676, 199029, 313727, 436608, 362881, 248194, 240002, 436611, 395659, 395661, 108944, 240016, 190871, 149916, 420253, 141728, 289189, 289194, 108972, 272813, 338356, 436661, 289232, 281040, 256477, 330218, 281072, 174593, 420369, 289304, 322078, 207393, 182817, 289332, 174648, 338489, 338490, 322120, 281166, 281171, 297560, 354911, 436832, 436834, 191082, 313966, 420463, 281199, 346737, 313971, 346740, 420471, 330379, 330387, 117396, 346772, 330388, 117397, 264856, 314009, 289434, 346779, 363163, 338613, 314040, 158394, 363211, 363230, 289502, 264928, 338662, 330474, 346858, 289518, 322291, 125684, 199414, 35583, 363263, 191235, 264968, 322316, 117517, 322319, 166676, 207640, 289576, 191283, 273207, 355130, 289598, 355139, 420677, 355146, 355152, 355154, 281427, 281433, 322395, 355165, 355178, 330609, 207732, 158593, 240518, 224145, 355217, 256922, 289690, 240544, 289698, 420773, 289703, 256935, 363438, 347055, 289727, 273344, 330689, 363458, 379844, 19399, 183248, 338899, 330708, 248796, 248797, 207838, 347103, 314342, 52200, 412651, 289774, 347123, 240630, 314362, 257024, 330754, 330763, 330772, 281626, 248872, 322612, 314448, 339030, 314467, 281700, 257125, 322663, 273515, 207979, 404593, 363641, 363644, 150657, 248961, 330888, 363669, 339100, 380061, 339102, 199839, 429214, 265379, 249002, 306346, 3246, 421048, 339130, 208058, 322749, 265412, 290000, 298208, 298212, 298213, 290022, 330984, 298221, 298228, 216315, 208124, 388349, 363771, 437505, 322824, 257305, 126237, 339234, 208164, 109861, 372009, 412971, 298291, 306494, 216386, 224586, 372043, 331090, 314710, 372054, 159066, 314720, 314728, 134506, 380271, 314739, 249204, 249205, 314741, 208244, 290173, 306559, 314751, 298374, 314758, 314760, 142729, 388487, 314766, 306579, 282007, 290207, 314783, 314789, 314791, 396711, 396712, 241066, 282024, 380337, 380338, 150965, 380357, 339398, 306639, 413137, 429542, 191981, 191990, 290301, 282114, 372227, 323080, 323087, 323089, 175639, 388632, 396827, 134686, 282146, 306723, 347694, 290358, 265798, 265804, 396882, 290390, 306776, 44635, 396895, 323172, 282213, 323178, 224883, 314998, 323196, 175741, 339584, 224901, 282245, 323207, 282246, 323217, 282259, 298654, 282273, 323236, 298661, 282280, 61101, 364207, 224946, 110268, 224958, 282303, 323264, 274115, 306890, 282318, 241361, 241365, 298712, 298720, 282339, 12010, 282348, 282358, 175873, 339715, 323332, 323331, 339720, 372496, 323346, 249626, 282400, 241441, 339745, 257830, 421672, 282417, 282427, 315202, 307011, 282434, 282438, 339783, 323406, 216918, 241495, 282474, 282480, 241528, 339841, 241540, 315273, 315274, 110480, 372626, 380821, 282518, 282519, 118685, 298909, 323507, 282549, 290745, 290746, 274371, 151497, 372701, 298980, 380908, 290811, 282633, 241692, 102437, 315432, 315434, 102445, 233517, 176175, 241716, 241720, 225351, 315465, 315476, 307289, 200794, 315487, 356447, 45153, 307299, 315497, 315498, 438377, 299121, 233589, 266357, 422019, 241808, 381073, 323729, 233636, 299174, 323762, 299187, 405687, 184505, 299198, 258239, 389313, 299203, 299209, 372941, 282831, 266449, 356576, 176362, 307435, 438511, 381172, 356602, 184570, 184575, 381208, 315673, 299293, 151839, 233762, 217380, 151847, 282919, 332083, 332085, 332089, 315706, 282939, 241986, 438596, 332101, 323913, 348492, 323916, 323920, 250192, 348500, 168281, 332123, 332127, 323935, 242023, 242029, 160110, 242033, 291192, 315770, 340357, 225670, 332167, 242058, 373134, 291224, 242078, 283038, 61857, 315810, 315811, 381347, 61859, 340398, 61873, 61880, 283064, 127427, 127428, 283075, 291267, 324039, 373197, 176601, 242139, 160225, 242148, 291311, 233978, 291333, 340490, 348682, 258581, 291358, 283182, 283184, 234036, 234040, 315960, 348732, 242237, 70209, 348742, 70215, 348749, 340558, 381517, 332378, 201308, 242273, 242277, 111208, 184940, 373358, 389745, 209530, 373375, 152195, 348806, 184973, 316049, 316053, 111253, 111258, 111259, 332446, 176808, 299699, 299700, 422596, 422599, 291530, 225995, 242386, 422617, 422626, 234217, 299759, 299776, 291585, 430849, 242433, 291592, 62220, 422673, 430865, 291604, 422680, 152365, 422703, 422709, 152374, 242485, 160571, 430910, 160575, 160580, 299849, 283467, 381773, 201551, 242529, 349026, 357218, 275303, 201577, 308076, 242541, 209783, 209785, 177019, 185211, 308092, 398206, 291712, 381829, 316298, 349067, 308107, 349072, 308112, 209817, 324506, 324507, 390045, 185250, 324517, 185254, 316333, 316343, 373687, 349121, 373706, 316364, 340955, 340961, 324586, 340974, 316405, 349175, 201720, 127992, 357379, 324625, 308243, 316437, 201755, 300068, 357414, 300084, 324666, 324667, 308287, 21569, 218186, 300111, 341073, 439384, 250981, 300135, 316520, 300136, 316526, 357486, 144496, 300146, 300150, 291959, 300151, 160891, 341115, 300158, 349316, 349318, 373903, 169104, 177296, 308372, 185493, 324760, 119962, 300187, 300188, 300201, 300202, 373945, 259268, 283847, 62665, 283852, 283853, 259280, 333011, 316627, 357595, 234733, 292085, 234742, 128251, 316669, 234755, 439562, 292107, 242954, 414990, 251153, 177428, 349462, 382258, 300343, 382269, 333117, 193859, 177484, 406861, 259406, 234831, 251213, 120148, 283991, 374109, 316765, 234850, 292195, 333160, 243056, 316787, 357762, 112017, 234898, 259475, 275859, 112018, 357786, 251298, 333220, 316842, 374191, 210358, 284089, 292283, 415171, 300487, 300489, 366037, 210390, 210391, 210392, 210393, 144867, 316902, 54765, 251378, 308723, 333300, 333303, 300536, 300542, 210433, 366083, 259599, 316946, 308756, 398869, 374296, 374299, 308764, 349726, 333343, 431649, 349741, 169518, 431663, 194110, 235070, 349763, 218696, 292425, 243274, 128587, 333388, 333393, 349781, 300630, 128599, 235095, 333408, 374372, 300644, 415338, 243307, 54893, 325231, 333430, 366203, 325245, 194180, 415375, 153251, 300714, 210603, 415420, 333503, 218819, 333509, 259781, 333517, 333520, 333521, 333523, 325346, 153319, 325352, 284401, 325371, 194303, 284429, 284431, 243472, 366360, 284442, 325404, 325410, 341796, 333610, 399147, 431916, 317232, 300848, 259899, 325439, 153415, 341836, 415567, 325457, 317269, 341847, 350044, 128862, 284514, 276327, 292712, 325484, 423789, 292720, 325492, 276341, 300918, 341879, 317304, 333688, 112509, 194429, 325503, 55167, 333701, 243591, 317323, 325515, 350093, 325518, 243597, 333722, 350109, 300963, 292771, 333735, 415655, 284587, 317360, 243637, 284619, 301008, 153554, 219101, 292836, 292837, 317415, 325619, 432116, 333817, 292858, 415741, 333828, 358410, 399373, 317467, 145435, 292902, 325674, 243759, 129076, 243767, 358456, 325694, 309345, 194666, 260207, 432240, 333940, 284788, 292992, 333955, 415881, 104587, 235662, 325776, 317587, 284826, 333991, 333992, 284842, 333996, 301251, 309444, 227524, 334042, 194782, 301279, 317664, 243962, 375039, 309503, 194820, 375051, 325905, 334103, 325912, 309529, 227616, 211235, 432421, 211238, 325931, 358703, 358709, 260418, 6481, 366930, 366929, 6489, 391520, 383332, 383336, 211326, 317831, 227725, 252308, 178582, 293274, 39324, 121245, 317852, 285090, 375207, 342450, 334260, 293303, 293310, 342466, 416197, 129483, 342476, 317901, 6606, 334290, 326100, 285150, 342498, 358882, 195045, 334309, 391655, 432618, 375276, 301571, 342536, 342553, 416286, 375333, 244269, 375343, 236081, 23092, 375351, 244281, 301638, 309830, 293448, 55881, 416341, 309846, 244310, 416351, 268899, 244327, 39530, 244347, 326287, 375440, 334481, 227990, 318106, 318107, 342682, 318130, 383667, 293556, 342713, 285373, 39614, 318173, 375526, 285415, 342762, 342763, 293612, 154359, 432893, 162561, 285444, 383754, 285458, 310036, 326429, 293664, 326433, 400166, 293672, 318250, 318252, 285487, 375609, 285497, 342847, 252741, 293711, 244568, 244570, 301918, 293730, 351077, 342887, 326505, 211829, 269178, 211836, 400252, 359298, 359299, 260996, 416646, 113542, 228233, 392074, 228234, 56208, 293781, 326553, 400283, 318364, 310176, 310178, 293800, 236461, 252847, 326581, 326587, 326601, 359381, 433115, 343005, 130016, 64485, 326635, 203757, 187374, 383983, 383982, 318461, 293886, 293893, 433165, 384016, 146448, 433174, 326685, 252958, 252980, 203830, 359478, 302139, 359495, 392290, 253029, 285798, 228458, 351344, 187506, 285814, 392318, 187521, 384131, 302216, 228491, 228493, 285838, 162961, 326804, 351390, 302240, 343203, 253099, 253100, 318639, 294068, 367799, 113850, 294074, 64700, 228542, 302274, 367810, 343234, 244940, 228563, 359647, 195808, 310497, 228588, 253167, 302325, 228600, 261377, 228609, 245019, 253216, 130338, 130343, 130348, 261425, 351537, 171317, 318775, 286013, 286018, 146762, 294218, 294219, 318805, 425304, 294243, 163175, 327024, 327025, 327031, 318848, 179587, 253317, 384393, 368011, 318864, 318868, 212375, 318875, 310692, 245161, 286129, 286132, 228795, 425405, 302529, 302531, 163268, 425418, 302540, 310732, 64975, 310736, 327121, 228827, 310748, 286172, 310757, 187878, 245223, 343542, 343543, 286202, 359930, 286205, 302590, 294400, 228867, 253451, 253452, 359950, 146964, 253463, 187938, 286244, 245287, 245292, 286254, 425535, 196164, 56902, 179801, 196187, 343647, 286306, 310889, 204397, 138863, 188016, 294529, 286343, 229001, 310923, 188048, 425626, 229020, 302754, 245412, 40613, 40614, 40615, 229029, 286391, 384695, 319162, 327358, 286399, 319177, 212685, 384720, 245457, 302802, 286423, 278234, 294622, 278240, 212716, 212717, 294638, 360177, 286459, 278272, 319233, 360195, 278291, 294678, 286494, 409394, 319292, 360252, 360264, 188251, 376669, 245599, 425825, 425833, 417654, 188292, 327557, 253829, 294807, 294809, 376732, 311199, 319392, 253856, 294823, 327596, 294843, 188348, 237504, 294850, 384964, 163781, 344013, 212942, 212946, 24532, 212951, 360417, 294886, 253929, 327661, 311281, 311282 ]
b69b0c1b9a1b7ec62cefe1d0a32880609539ce2c
49e7326f9edbfc698db9096bfe183fbdd65e4045
/HelloViewContoller轉場/ControllerPresentAnimation/ControllerPresentAnimation/AppDelegate.swift
f406cf1cc512a2ceb95d42e4f523e0bac7e3c4fa
[]
no_license
j11042004/AppTestForSelf
33cd60bf51cc389f20d38a0202ac4087b7afcb78
e35765a1a237b3bedf333a87d57193458eb38468
refs/heads/master
2020-07-26T15:50:13.478811
2020-06-27T10:56:24
2020-06-27T10:56:24
208,693,834
1
0
null
null
null
null
UTF-8
Swift
false
false
2,179
swift
// // AppDelegate.swift // ControllerPresentAnimation // // Created by Uran on 2018/12/6. // Copyright © 2018 Uran. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } func applicationWillResignActive(_ application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. } func applicationDidEnterBackground(_ application: UIApplication) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } func applicationWillEnterForeground(_ application: UIApplication) { // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. } func applicationDidBecomeActive(_ application: UIApplication) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } }
[ 229380, 229383, 229385, 278539, 294924, 229388, 278542, 229391, 327695, 278545, 229394, 278548, 229397, 229399, 229402, 352284, 229405, 278556, 278559, 229408, 278564, 294950, 229415, 229417, 327722, 237613, 229422, 360496, 229426, 237618, 229428, 311349, 286774, 286776, 319544, 286778, 229432, 204856, 352318, 286791, 237640, 286797, 278605, 311375, 163920, 237646, 196692, 319573, 311383, 278623, 278626, 319590, 311400, 278635, 303212, 278639, 131192, 278648, 237693, 303230, 327814, 303241, 131209, 417930, 303244, 311436, 319633, 286873, 286876, 311460, 311469, 32944, 327862, 286906, 327866, 180413, 286910, 131264, 286916, 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, 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, 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, 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, 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, 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, 181854, 370272, 239202, 370279, 312938, 280183, 280185, 280188, 280191, 116354, 280194, 280208, 280211, 288408, 280218, 280222, 419489, 190118, 321195, 296622, 321200, 337585, 296626, 296634, 296637, 419522, 313027, 280260, 419525, 206536, 280264, 206539, 206541, 206543, 313044, 280276, 321239, 280283, 313052, 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, 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, 280823, 280825, 280827, 280830, 280831, 280833, 125187, 280835, 125191, 125207, 125209, 321817, 125218, 321842, 223539, 125239, 280888, 280891, 289087, 280897, 280900, 305480, 239944, 280906, 239947, 305485, 305489, 379218, 280919, 248153, 215387, 354653, 354656, 313700, 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, 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, 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, 127434, 315856, 176592, 127440, 315860, 176597, 127447, 283095, 299481, 127449, 176605, 242143, 127455, 127457, 291299, 340454, 127463, 242152, 291305, 127466, 176620, 127469, 127474, 291314, 291317, 127480, 135672, 291323, 233979, 127485, 291330, 283142, 127494, 127497, 233994, 135689, 127500, 291341, 233998, 127506, 234003, 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, 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, 226185, 308105, 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, 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, 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, 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, 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, 276452, 292839, 276455, 350186, 292843, 276460, 292845, 276464, 178161, 227314, 325624, 350200, 276472, 317435, 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, 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, 309494, 243960, 276735, 227583, 227587, 276739, 211204, 276742, 227593, 227596, 325910, 309530, 342298, 211232, 317729, 276775, 211241, 325937, 325943, 211260, 260421, 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, 55837, 227877, 227879, 293417, 227882, 309804, 293421, 105007, 236082, 285236, 23094, 277054, 244288, 219714, 129603, 301636, 318020, 301639, 301643, 277071, 285265, 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, 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, 277804, 384302, 285999, 285997, 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, 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, 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, 277978, 310749, 277981, 277984, 310755, 277989, 277991, 187880, 277995, 310764, 286188, 278000, 228851, 310772, 278003, 278006, 40440, 212472, 278009, 40443, 286203, 40448, 228864, 286214, 228871, 302603, 65038, 302614, 286233, 302617, 302621, 286240, 146977, 187936, 187939, 40484, 294435, 40486, 286246, 294440, 40488, 294439, 294443, 40491, 294445, 278057, 310831, 245288, 286248, 40499, 40502, 212538, 40507, 40511, 40513, 228933, 327240, 40521, 286283, 40525, 40527, 212560, 400976, 228944, 40533, 147032, 40537, 40539, 40541, 278109, 40544, 40548, 40550, 40552, 286313, 40554, 286312, 310892, 40557, 40560, 188022, 122488, 294521, 343679, 294537, 310925, 286354, 278163, 302740, 122517, 278168, 179870, 327333, 229030, 212648, 278188, 302764, 278192, 319153, 278196, 302781, 319171, 302789, 294599, 278216, 294601, 302793, 343757, 212690, 319187, 278227, 286420, 229076, 286425, 319194, 278235, 301163, 278238, 229086, 286432, 294625, 294634, 302838, 319226, 286460, 278274, 302852, 278277, 302854, 294664, 311048, 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, 188340, 40886, 319419, 294844, 294847, 393177, 294876, 294879, 294883, 393190, 294890, 311279, 278513, 237555, 278516, 311283, 278519, 237562 ]
0e4f534da161b1a4a15100d82285f416aadf3651
e6bc07a9a22bd478c18daf33fc600bbaf3fd7320
/chapter7_tableview/chapter7_tableview/ViewController.swift
553e05daa0338f609d001e2dfec7d00aecdc377f
[]
no_license
KoheiHayakawa/swift_study
95f878ad4cdaef63dbfa483c0f2c90fdc290792f
97acf27ff9e39da325128a21b369310707c91fdc
refs/heads/master
2020-04-29T07:56:57.739693
2015-01-24T12:40:19
2015-01-24T12:40:19
29,281,450
1
0
null
null
null
null
UTF-8
Swift
false
false
1,598
swift
// // ViewController.swift // chapter7_tableview // // Created by Kohei Hayakawa on 1/21/15. // Copyright (c) 2015 Kohei Hayakawa. All rights reserved. // import UIKit class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource { 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. } func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { if section == 0 { return 3 } else { return 5 } } func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as UITableViewCell cell.textLabel?.text = "セル" + (indexPath.row).description cell.detailTextLabel?.text = "サブタイトル" return cell } func numberOfSectionsInTableView(tableView: UITableView) -> Int { return 3 } func tableView(tableView: UITableView, titleForHeaderInSection section: Int) -> String? { return "セクション" + section.description } func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { println("セクション\(indexPath.section)のセル\(indexPath.row)が選択された") } }
[ -1 ]
eddad6bf6380a4deee5dafb5a8c24f24707aba23
21e5da895bf8f104d6950b8b5aed7deff3458d09
/UI Tests 10.15/UI Tests 10.15/9 - View Tests/Z - Views/z_SubscriptionView.swift
883729d6cca0a5f2cf61852351bdaff1bb025179
[ "MIT" ]
permissive
bclnet/SwiftUIJson-Apps
5e438260ee514b5e9380772a3cd5fd15c2fdeff2
3e17f207317c258920958d590aec34dfd3e6bb24
refs/heads/master
2023-03-04T08:52:23.447206
2021-02-15T01:16:19
2021-02-15T01:16:19
303,219,479
0
0
null
null
null
null
UTF-8
Swift
false
false
473
swift
import SwiftUI import SwiftUIJson import Combine struct z_SubscriptionView: View { var body: some View { VStack { Text("SubscriptionView") SubscriptionView(content: Text("content"), publisher: PassthroughSubject<Any, Never>()) { _ in print("action") } } } } struct z_SubscriptionView_Previews: PreviewProvider { static var previews: some View { JsonPreview { z_SubscriptionView() } } }
[ -1 ]
d74fe0880619f8980a1bae731806fa9b6a2e026f
4c99b2e15371552e27ca489ee482b25a0477f8f3
/Assignment8_UsingSB/UsingSB/AppDelegate.swift
136e401fb8725d35d048483f501e6e222f031f3b
[]
no_license
SandhyaGitH/iOS_HappyCoding
bee12cbc8dafe92485c001d8f4203490d6071c92
6387cc9968e7ee72881bcd34f302643ecc0d1c38
refs/heads/main
2023-03-22T20:44:23.579580
2021-03-15T22:34:18
2021-03-15T22:34:18
308,411,364
0
0
null
null
null
null
UTF-8
Swift
false
false
27,611
swift
// // AppDelegate.swift // UsingSB // // Created by Samarth chaturvedi on 11/17/20. // import UIKit @main class AppDelegate: UIResponder, UIApplicationDelegate { static var inventOrg = Inventory(); static var uiCreation = UICreation(); func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } static func AddCustomer(_ cust:Customer) { //let parentWin:UIView = sender.superview!; inventOrg.nCustomer.vFirstName = cust.vFirstName inventOrg.nCustomer.vLastName = cust.vLastName inventOrg.nCustomer.vEmailID = cust.vEmailID inventOrg.nCustomer.vAddress = cust.vAddress inventOrg.nCustomer.vContactDetails = cust.vContactDetails if(validateinput(inventOrg.nCustomer)) { if(inventOrg.nCustomer.vEmailID.validateEmailId()) { if(inventOrg.nCustomer.vContactDetails.validaPhoneNumber()) { let Custmr = Customer() Custmr.Add(inventOrg) let alert = uiCreation.CreateAlert("Alert","Saved Successfully") alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { [self] action in })) // window?.rootViewController!.present(alert, animated: true, completion: nil) // addSubMenu(sender:sender) } else { let alert = uiCreation.CreateAlert("Alert","Invalid Phone number") alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { [self] action in })) // window?.rootViewController!.present(alert, animated: true, completion: nil) } } else { let alert = uiCreation.CreateAlert("Alert","Invalid Email Address") alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { [self] action in })) // window?.rootViewController!.present(alert, animated: true, completion: nil) } } else { let alert = uiCreation.CreateAlert("Alert","First Name and Email can't be empty") alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { [self] action in })) // window?.rootViewController!.present(alert, animated: true, completion: nil) } } static func validateinput(_ pCustomer : Customer)->Bool { var result = true; if( pCustomer.vFirstName == "" || pCustomer.vEmailID == "" ) { result = false } return result; } static func validateinput(_ pSupplier : Supplier)->Bool { var result = true; if( pSupplier.vName == "" || pSupplier.vEmailID == "" ) { result = false } return result; } static func validateinput(_ pDepartment: Department)->Bool { var result = true; if( pDepartment.vName == "" ) { result = false } return result; } static func validateinput(_ pCategory: Category, _ DeptID: String)->Bool { var result = true; if( pCategory.vName == "" || DeptID == "") { result = false } return result; } static func validateinput(_ pProduct: Product, _ DeptID: String , _ CatID: String , _ SupID: String)->Bool { var result = true; if( pProduct.vName == "" || DeptID == "" || CatID == "" || SupID == "") { result = false } return result; } static func validateinput(_ pProduct: Product)->Bool { var result = true; if( pProduct.vName == "" ) { result = false } return result; } static func EditProductImage(_ prod:Product, _ img: Data) { let result = inventOrg.products.FindProfile(String(prod.vID)) let index = inventOrg.products.firstIndex(of: result) // let custmer=fillCustomerForm() prod.prodImage = img inventOrg.products[index!] = prod print("Updated!") } static func UpdateProduct(_ newprod:Product, _ OldProd:Product) { let result = inventOrg.products.FindProfile(String(OldProd.vID)) let index = inventOrg.products.firstIndex(of: result) // let custmer=fillCustomerForm() // prod.prodImage = img inventOrg.products[index!] = newprod print("Updated!") } // Product--- static func SearchBySupID(sender : UIButton) { let parentWin:UIView = sender.superview!; let view:UIView = UIView(frame:(parentWin.bounds)) view.backgroundColor = UIColor.blue parentWin.addSubview(view) let a = 1 var userInput: [String] = Array() if let myTextField = parentWin.viewWithTag(a) as? UITextField { let tekstInput = myTextField.text userInput.insert(tekstInput!, at: a-1) } if(inventOrg.suppliers.isUniqueidExist(userInput[0])) { let Arr = inventOrg.products.FindProductBYSupID(userInput[0]) // inventOrg.nProduct = inventOrg.products.FindProfile(String(userInput[0])) if(Arr.count>0) { var y = 200; for index in Range(0...Arr.count-1) { y = y+50 var text : UITextView = uiCreation.CreatTextView(50, y, 300, 50,Arr[index].toString()) // print(inventOrg.products[index].toString()) //text.tag = 1 view.addSubview(text) } } else{ let alert = uiCreation.CreateAlert("Alert","Not Found") alert.addAction(UIAlertAction(title: "Back", style: .default, handler: { [self] action in switch action.style{ case .default: // addSearchOptions(sender: sender) print("default") case .cancel: print("cancel") case .destructive: print("destructive") }})) // window?.rootViewController!.present(alert, animated: true, completion: nil) } } else{ let alert = uiCreation.CreateAlert("Alert","Invalid SupplierID") alert.addAction(UIAlertAction(title: "Retry", style: .default, handler: { [self] action in switch action.style{ case .default: // addSearchOptions(sender: sender) print("default") case .cancel: print("cancel") case .destructive: print("destructive") }})) // window?.rootViewController!.present(alert, animated: true, completion: nil) // addSubMenu(sender:sender) } } static func SearchByCatID(sender : UIButton) { let parentWin:UIView = sender.superview!; let view:UIView = UIView(frame:(parentWin.bounds)) view.backgroundColor = UIColor.blue parentWin.addSubview(view) let a = 1 var userInput: [String] = Array() if let myTextField = parentWin.viewWithTag(a) as? UITextField { let tekstInput = myTextField.text userInput.insert(tekstInput!, at: a-1) } if(inventOrg.categories.isUniqueidExist(userInput[0])) { let Arr = inventOrg.products.FindProductBYCatID(userInput[0]) // inventOrg.nProduct = inventOrg.products.FindProfile(String(userInput[0])) if(Arr.count>0) { var y = 200; for index in Range(0...Arr.count-1) { y = y+50 var text : UITextView = uiCreation.CreatTextView(50, y, 300, 50,Arr[index].toString()) // print(inventOrg.products[index].toString()) //text.tag = 1 // view.addSubview(text) } } else{ let alert = uiCreation.CreateAlert("Alert","Not Found") alert.addAction(UIAlertAction(title: "Back", style: .default, handler: { [self] action in switch action.style{ case .default: // addSearchOptions(sender: sender) print("default") case .cancel: print("cancel") case .destructive: print("destructive") }})) // window?.rootViewController!.present(alert, animated: true, completion: nil) } } else{ let alert = uiCreation.CreateAlert("Alert","Invalid Category ID") alert.addAction(UIAlertAction(title: "Retry", style: .default, handler: { [self] action in switch action.style{ case .default: // addSearchOptions(sender: sender) print("default") case .cancel: print("cancel") case .destructive: print("destructive") }})) // window?.rootViewController!.present(alert, animated: true, completion: nil) } // y = y + 50 } static func SearchByDeptID(sender : UIButton) { let parentWin:UIView = sender.superview!; let view:UIView = UIView(frame:(parentWin.bounds)) view.backgroundColor = UIColor.blue parentWin.addSubview(view) let a = 1 var userInput: [String] = Array() if let myTextField = parentWin.viewWithTag(a) as? UITextField { let tekstInput = myTextField.text userInput.insert(tekstInput!, at: a-1) } if(inventOrg.departments.isUniqueidExist(userInput[0])) { let Arr = inventOrg.products.FindProductBYDeptID(userInput[0]) // inventOrg.nProduct = inventOrg.products.FindProfile(String(userInput[0])) if(Arr.count>0) { var y = 200; for index in Range(0...Arr.count-1) { y = y+50 var text : UITextView = uiCreation.CreatTextView(50, y, 300, 50,Arr[index].toString()) // print(inventOrg.products[index].toString()) //text.tag = 1 view.addSubview(text) } } else{ let alert = uiCreation.CreateAlert("Alert","Not Found") alert.addAction(UIAlertAction(title: "Back", style: .default, handler: { [self] action in switch action.style{ case .default: //addSearchOptions(sender: sender) print("default") case .cancel: print("cancel") case .destructive: print("destructive") }})) // window?.rootViewController!.present(alert, animated: true, completion: nil) } } else{ let alert = uiCreation.CreateAlert("Alert","Invalid Department ID") alert.addAction(UIAlertAction(title: "Retry", style: .default, handler: { [self] action in switch action.style{ case .default: //addSearchOptions(sender: sender) print("default") case .cancel: print("cancel") case .destructive: print("destructive") }})) // window?.rootViewController!.present(alert, animated: true, completion: nil) } } static func SearchByprodID(sender : UIButton) { let parentWin:UIView = sender.superview!; let view:UIView = UIView(frame:(parentWin.bounds)) view.backgroundColor = UIColor.blue parentWin.addSubview(view) let a = 1 var userInput: [String] = Array() if let myTextField = parentWin.viewWithTag(a) as? UITextField { let tekstInput = myTextField.text userInput.insert(tekstInput!, at: a-1) } if(inventOrg.products.isUniqueidExist(userInput[0])) { let Arr = inventOrg.products.FindProductBYProdID(userInput[0]) // inventOrg.nProduct = inventOrg.products.FindProfile(String(userInput[0])) if(Arr.count>0) { var y = 200; for index in Range(0...Arr.count-1) { y = y+50 var text : UITextView = uiCreation.CreatTextView(50, y, 300, 50,Arr[index].toString()) // print(inventOrg.products[index].toString()) //text.tag = 1 view.addSubview(text) } } else{ let alert = uiCreation.CreateAlert("Alert","Not Found") alert.addAction(UIAlertAction(title: "Back", style: .default, handler: { [self] action in switch action.style{ case .default: //addSearchOptions(sender: sender) print("default") case .cancel: print("cancel") case .destructive: print("destructive") }})) // window?.rootViewController!.present(alert, animated: true, completion: nil) } } else{ let alert = uiCreation.CreateAlert("Alert","Invalid Product ID") alert.addAction(UIAlertAction(title: "Retry", style: .default, handler: { [self] action in switch action.style{ case .default: // addSearchOptions(sender: sender) print("default") case .cancel: print("cancel") case .destructive: print("destructive") }})) // window?.rootViewController!.present(alert, animated: true, completion: nil) } // addSubMenu(sender: sender) // takeCustInput(sender: sender, cust) //self.present(alert, animated: true, completion: nil) } static func AddSupplier(sender : UIButton) { let parentWin:UIView = sender.superview!; var a = 1 var userInput1: [String] = Array() while a < 5 { if let myTextField = parentWin.viewWithTag(a) as? UITextField { let tekstInput = myTextField.text userInput1.insert(tekstInput!, at: a-1) } a = a + 1 } let Sup = Supplier() inventOrg.nSupplier.vName = userInput1[0] // inventOrg.nSupplier.vLastName = userInput[1] inventOrg.nSupplier.vEmailID = userInput1[1] inventOrg.nSupplier.vAddress = userInput1[2] inventOrg.nSupplier.vPhone = userInput1[3] if(validateinput(inventOrg.nSupplier)) { if(inventOrg.nSupplier.vEmailID.validateEmailId()) { if(inventOrg.nSupplier.vPhone.validaPhoneNumber()) { Sup.Add(inventOrg) let alert = uiCreation.CreateAlert("Alert","Saved Successfully") alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { [self] action in })) // window?.rootViewController!.present(alert, animated: true, completion: nil) // addSubMenu(sender:sender) } else { let alert = uiCreation.CreateAlert("Alert","Invalid Phone number") alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { [self] action in })) // window?.rootViewController!.present(alert, animated: true, completion: nil) } } else { let alert = uiCreation.CreateAlert("Alert","Invalid Email Address") alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { [self] action in })) // window?.rootViewController!.present(alert, animated: true, completion: nil) } } else { let alert = uiCreation.CreateAlert("Alert","First Name and Email can't be empty") alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { [self] action in })) // window?.rootViewController!.present(alert, animated: true, completion: nil) } } static func AddCategory(sender : UIButton) { let parentWin:UIView = sender.superview!; var a = 1 var userInput: [String] = Array() while a < 4 { if let myTextField = parentWin.viewWithTag(a) as? UITextField { let tekstInput = myTextField.text userInput.insert(tekstInput!, at: a-1) } a = a + 1 } let cat = Category() inventOrg.nCategory.vName = userInput[0] if(validateinput(inventOrg.nCategory, userInput[1])) { inventOrg.nCategory.vDeptID = Int(userInput[1])! if(inventOrg.departments.isUniqueidExist(userInput[1])) { cat.Add(inventOrg) let alert = uiCreation.CreateAlert("Alert","Saved Successfully") alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { [self] action in })) // window?.rootViewController!.present(alert, animated: true, completion: nil) } else { let alert = uiCreation.CreateAlert("Alert","Department ID Does not exist") alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { [self] action in })) // window?.rootViewController!.present(alert, animated: true, completion: nil) } } else { let alert = uiCreation.CreateAlert("Alert","Category Name and Department ID can't be empty") alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { [self] action in })) // window?.rootViewController!.present(alert, animated: true, completion: nil) } } static func AddProduct(_ Pprod:Product){ let prod = Product() inventOrg.nProduct.vName = Pprod.vName inventOrg.nProduct.vType = Pprod.vType inventOrg.nProduct.vAvailableQuantity = Pprod.vAvailableQuantity if(validateinput(inventOrg.nProduct,String(Pprod.vDeptID),String(Pprod.vCatID),String(Pprod.vSupID))) { inventOrg.nProduct.vDeptID = Pprod.vDeptID inventOrg.nProduct.vCatID = Pprod.vCatID inventOrg.nProduct.vSupID = Pprod.vSupID if(!inventOrg.departments.isUniqueidExist(String(Pprod.vDeptID))) { let alert = uiCreation.CreateAlert("Alert","Department ID Does not exist") alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { [self] action in })) // window?.rootViewController!.present(alert, animated: true, completion: nil) } else if(!inventOrg.categories.isUniqueidExist(String(Pprod.vCatID))) { let alert = uiCreation.CreateAlert("Alert","Category ID Does not exist") alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { [self] action in })) // window?.rootViewController!.present(alert, animated: true, completion: nil) } else if(!inventOrg.suppliers.isUniqueidExist(String(Pprod.vSupID))) { let alert = uiCreation.CreateAlert("Alert","Supplier ID Does not exist") alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { [self] action in })) // window?.rootViewController!.present(alert, animated: true, completion: nil) } else{ prod.Add(inventOrg) let alert = uiCreation.CreateAlert("Alert","Saved Successfully") alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { [self] action in })) // window?.rootViewController!.present(alert, animated: true, completion: nil) // addSubMenu(sender:sender) } } else { let alert = uiCreation.CreateAlert("Alert"," Name , DeptID, Category ID and Sup ID can't be empty") alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { [self] action in })) // window?.rootViewController!.present(alert, animated: true, completion: nil) } } static func addToOrder (_ newProduct:Product)->Void { var quant = 1; if( inventOrg.ProdsForOrder.isUniqueidExist(String(newProduct.vID))) { // quant = quant+1; var org = Inventory(); org = inventOrg; if let idx = inventOrg.nOrdertuple.firstIndex(where: { $0.prod == newProduct }) { quant = inventOrg.nOrdertuple[idx].Quantity + 1 inventOrg.nOrdertuple[idx].Quantity = quant } // let result = inventObj.customers.FindProfile(String(CustId)) let index = inventOrg.ProdsForOrder.firstIndex(of: newProduct) inventOrg.ProdsForOrder.remove(at: index!) inventOrg.ProdsForOrder.append((newProduct)) } else{ inventOrg.nOrdertuple.append((newProduct,quant)) inventOrg.ProdsForOrder.append(newProduct) } /* let alert = uiCreation.CreateAlert("Alert","Added to Cart") alert.addAction(UIAlertAction(title: "ok", style: .default, handler: { [self] action in })) window?.rootViewController!.present(alert, animated: true, completion: nil) */ } 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. } }
[ -1 ]
c5cba22636be224d4f9c83f17fd7e57a4436c66c
9bd877969e1456b629602355913fa885402aa05b
/Anamnesia/Controller/MainMenuController.swift
d1ed2857c53449afa156f3e84f56f3d0a567d380
[]
no_license
yigitpolat/Anamnesia
668eb587d91788d1569ba2c247b8a2adca2b333e
eafbb550d55101fd05f636c65affbfb6017be77e
refs/heads/master
2021-09-01T04:59:48.684856
2017-12-24T18:09:56
2017-12-24T18:09:56
115,273,599
0
1
null
null
null
null
UTF-8
Swift
false
false
868
swift
// // MainMenuController.swift // Anamnesia // // Created by Yigit Polat on 24.12.2017. // Copyright © 2017 Yigit Polat. All rights reserved. // import UIKit class MainMenuController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } /* // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepare(for segue: UIStoryboardSegue, sender: Any?) { // Get the new view controller using segue.destinationViewController. // Pass the selected object to the new view controller. } */ }
[ 278786, 296451, 233869, 289519, 290160, 291569, 302927, 314351, 290166, 237655, 289112, 185464, 298359 ]
d8b2190f6f53a27dc1f91906ad17030033e90fdf
e5b037ca88ac3d1f31700024943f41f2d2657a67
/TouTiao/Home/Controller/TestViewController.swift
d364a94cce1cc55a01fbf583356ea9bcc09e0adc
[]
no_license
CarzyCode/TouTiaoTest
a8aa97bd29a2a2bc54bfd39b6d0a5b159d98d79a
863728ad8c3129ef344037c4ba40ef4533b94461
refs/heads/master
2020-12-05T20:27:25.705517
2020-01-10T06:02:08
2020-01-10T06:02:08
232,238,072
0
0
null
null
null
null
UTF-8
Swift
false
false
3,196
swift
// // TestViewController.swift // TouTiao // // Created by Henry Li on 2019/3/27. // Copyright © 2019 Henry Li. All rights reserved. // import UIKit class TestViewController: UIViewController, UIGestureRecognizerDelegate { var UrlStr:String = "" let headView = UIView() override func viewWillDisappear(_ animated: Bool) { self.navigationController?.setNavigationBarHidden(false, animated: true) } override func viewWillAppear(_ animated: Bool) { self.navigationController?.setNavigationBarHidden(true, animated: true) // self.navigationController?.navigationBar.isHidden = true self.navigationController?.navigationBar.isTranslucent = false self.navigationController?.interactivePopGestureRecognizer!.delegate = self self.navigationController?.interactivePopGestureRecognizer?.isEnabled = true // [self.navigationController.interactivePopGestureRecognizer setValue:@([UIScreen mainScreen].bounds.size.width) forKeyPath:@"_recognizer._settings._edgeSettings._edgeRegionSize"]; // self.navigationController?.interactivePopGestureRecognizer?.setValue(<#T##value: Any?##Any?#>, forKeyPath: <#T##String#>) // self.navigationController?.interactivePopGestureRecognizer?.setValue(kScreenWidth, forKeyPath: "_recognizer._settings._edgeSettings._edgeRegionSize") } // func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool { // if self.navigationController?.viewControllers.count == 1{ // return false; // } // return true; // } override func viewDidLoad() { super.viewDidLoad() headView.backgroundColor = UIColor.yellow; self.view.addSubview(headView) headView.snp.makeConstraints { (make) in make.left.top.equalTo(0) make.height.equalTo(64) make.width.equalTo(kScreenWidth) } let LoginBtn = UIButton() LoginBtn.backgroundColor = UIColor.clear LoginBtn.setTitle("首页", for: UIControl.State.normal) LoginBtn.setTitleColor(UIColor.black, for: UIControl.State.normal) LoginBtn.addTarget(self, action: #selector(LoginAction), for: UIControl.Event.touchUpInside) headView.addSubview(LoginBtn) LoginBtn.snp.makeConstraints { (make) in make.width.equalTo(40) make.height.equalTo(40) make.left.equalTo(20) make.top.equalTo(20) } self.title = "测试" self.view.backgroundColor = UIColor.yellow // Do any additional setup after loading the view. // _recognizer._settings._edgeSettings._edgeRegionSize } @objc func LoginAction(){ self.navigationController?.popViewController(animated: true) } /* // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepare(for segue: UIStoryboardSegue, sender: Any?) { // Get the new view controller using segue.destination. // Pass the selected object to the new view controller. } */ }
[ -1 ]
59618f188f69eb21085fae43e2b3467d192f2ad3
08294566712c5890c951dd712388c2026d890024
/ios/Library/Source/DDL/FormScreenlet/ServerOperations/LiferayDDLFormSubmitOperation.swift
3783f7e0e0f5d2e61c598c88f2a53103023b6b48
[]
no_license
aritzg/liferay-screens
0e66872e97095f06a72b61662c3ac0373562f5e8
af3d8141eedc7669419c9ab1d19e988de96b2c2e
refs/heads/master
2020-12-28T20:43:31.214730
2014-10-14T15:33:06
2014-10-14T15:33:06
null
0
0
null
null
null
null
UTF-8
Swift
false
false
2,959
swift
/** * Copyright (c) 2000-present Liferay, Inc. All rights reserved. * * This library is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free * Software Foundation; either version 2.1 of the License, or (at your option) * any later version. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. */ import UIKit public class LiferayDDLFormSubmitOperation: ServerOperation { public var groupId: Int64? public var userId: Int64? public var recordId: Int64? public var recordSetId: Int64? public var autoscrollOnValidation = true public var result: (recordId: Int64, attributes: NSDictionary)? internal override var hudLoadingMessage: HUDMessage? { return ("Submitting form...", details: "Wait few seconds...") } internal override var hudSuccessMessage: HUDMessage? { return ("Done!", details: nil) } internal override var hudFailureMessage: HUDMessage? { return ("An error happened submitting form", details: nil) } internal var formData: DDLFormData { return screenlet.screenletView as DDLFormData } //MARK: ServerOperation override func validateData() -> Bool { if userId == nil { return false } if groupId == nil { return false } if recordId != nil && recordSetId == nil { return false } if formData.values.isEmpty { return false } if !formData.validateForm(autoscroll: autoscrollOnValidation) { showHUD(message: "Some values are not valid", details: "Please, review your form", closeMode: .AutocloseDelayed(3.0, true), spinnerMode: .NoSpinner) return false } return true } override internal func doRun(#session: LRSession) { let service = LRDDLRecordService_v62(session: session) let serviceContextAttributes = [ "userId": NSNumber(longLong: userId!), "scopeGroupId": NSNumber(longLong: groupId!)] let serviceContextWrapper = LRJSONObjectWrapper(JSONObject: serviceContextAttributes) var recordDictionary: NSDictionary result = nil if recordId == nil { recordDictionary = service.addRecordWithGroupId(groupId!, recordSetId: recordSetId!, displayIndex: 0, fieldsMap: formData.values, serviceContext: serviceContextWrapper, error: &lastError) } else { recordDictionary = service.updateRecordWithRecordId(recordId!, displayIndex: 0, fieldsMap: formData.values, mergeFields: true, serviceContext: serviceContextWrapper, error: &lastError) } if lastError == nil { if let recordIdValue = recordDictionary["recordId"]! as? Int { result = (Int64(recordIdValue), recordDictionary) } else { lastError = createError(cause: .InvalidServerResponse) result = nil } } } }
[ 226577 ]
e1be0dfbe9d1d9630fd734e5343c4635acb9205f
ff90af69adb5eb37233637f21d40e2897608ca3b
/iOS/Dag3/To-Do/To-Do/ToDoItem.swift
84db63053e203e81503d6e2487ebc29149ede040
[]
no_license
ErikVestesen/Skole
4ab6345aab383cc1a1f98d404e1a4215b3d91647
4ea52c5e1ba2b04182fe07ef792f847d4cc73d00
refs/heads/master
2020-12-25T15:08:41.837321
2016-12-12T23:46:52
2016-12-12T23:46:52
66,099,769
0
0
null
null
null
null
UTF-8
Swift
false
false
1,631
swift
// // ToDoItem.swift // To-Do // // Created by Erik Vestesen on 08/09/16. // Copyright © 2016 Erik Vestesen. All rights reserved. // import Foundation class ToDoItem: NSObject,NSCoding { let name : String let creationDate : NSDate var completed : Bool init(name: String, creationDate: NSDate, completed: Bool) { self.name = name self.creationDate = creationDate self.completed = completed } //coder external name, ADecoder internal name. /* Decoding a ToDoITem and instantiate it It can fail, so the ? at the end of the init */ required init?(coder ADecoder: NSCoder) { name = ADecoder.decodeObjectForKey(Keys.Name.rawValue) as! String creationDate = ADecoder.decodeObjectForKey(Keys.CreationDate.rawValue) as! NSDate completed = ADecoder.decodeObjectForKey(Keys.Completed.rawValue) as! Bool } /* Encodes the instances of the class as a string for easier storing on disc - this func is not responsible for storing on disc. My ToDoItem should be able to encode itself, so others can store it This one is not required by the protocol, but if you provide it It will be called by someone */ func encodeWithCoder(aCoder: NSCoder) { aCoder.encodeObject(name,forKey: Keys.Name.rawValue) aCoder.encodeObject(creationDate,forKey: Keys.CreationDate.rawValue) aCoder.encodeObject(completed,forKey: Keys.Completed.rawValue) } enum Keys : String { case Name = "name" case Completed = "completed" case CreationDate = "creationdate" } }
[ -1 ]
1b2cbc64d945165016a0e1ef59c60662926fea62
5588392df0ccd6e2c973ee8c6a521cbdc9db925f
/Tests/testLexerTests/LexerPerformanceTests.swift
2db88df48814140f593d789d2bb847d91ef56696
[]
no_license
Schwake/testLexer
f2d6c9f7b68ce9a28e2f799a76e792e4da42416f
ce3375708b1ffcb372cd5b2708e0e88ccda5d758
refs/heads/main
2023-04-02T18:07:37.428725
2021-04-01T15:27:22
2021-04-01T15:27:22
332,313,014
0
0
null
null
null
null
UTF-8
Swift
false
false
3,165
swift
// // LexerPerformanceTests.swift // testLexerTests // // Created by Greg Main on 12/03/2021. // import XCTest @testable import testLexer class LexerPerformanceTests: XCTestCase { func testSourceCreationPerformance() { let opAnd = "\u{2227}" let opOr = "\u{2228}" measure { let n = 100000 var source = "" for index in (1...n) { source = source + (" (X\(index) \(opOr) y\(index) ) \(opAnd)") } } } func testLexerPerformance() { let opAnd = "\u{2227}" let opOr = "\u{2228}" // (Xn OR Yn) AND let term = (" (X1 \(opOr) Y1 ) \(opAnd)") let n = 100000 var source = "" for _ in (1...n) { source += term } source += " z" measure { Lexer(source: source) } } func testLexerVariableOrderingPerformance() { let opAnd = "\u{2227}" let opOr = "\u{2228}" // (Xn OR Yn) AND let term = (" (X1 \(opOr) Y1) \(opAnd)") let n = 1000000 var source = "" for _ in (1...n) { source += term } source += " z" let lexer = Lexer(source: source) measure { lexer.variableOrdering() } } func testAstOrderDictPerformance() { let opAnd = "\u{2227}" let opOr = "\u{2228}" // (Xn OR Yn) AND let term = (" (X1 \(opOr) Y1) \(opAnd)") let n = 10000 var source = "" for _ in (1...n) { source += term } source += " z" let lexer = Lexer(source: source) let ast = Ast(lexer: lexer) measure { ast.collectVariablesSet() // Inout variant - double speed // ast.collectVariables() } } func testAstPerformance() { let opAnd = "\u{2227}" let opOr = "\u{2228}" // (Xn OR Yn) AND let term = (" (X1 \(opOr) Y1) \(opAnd)") let n = 100000 var source = "" for _ in (1...n) { source += term } source += " z" let lexer = Lexer(source: source) measure { Ast(lexer: lexer) } } func testBddAndersonPerformance() { let opAnd = "\u{2227}" let opOr = "\u{2228}" var source = "" // x and y or x and y ... and z (21 pow 2 operations) for index in (1...10) { source += "x\(index) " + opAnd + " y\(index) " + opOr } source = source + " z1" let lexer = Lexer(source: source) let varOrdering = lexer.variableOrdering() let ast = Ast(lexer: lexer) let rootNode = ast.rootNode! let aBddAndersen = BddAndersen(variableOrdering: varOrdering) measure { aBddAndersen.build(node: rootNode) } } }
[ -1 ]
76cd079a81dad57cfa39d85191afdc76e2cb550a
118501a3e03380352d93cd0329d5edba96e8a3a1
/TweetTests/TweetTests.swift
0f9d411a43540ed8f888a194150a0cb44eed6f3f
[]
no_license
AddinDev/Tweet
22d352a93b4ff47141bb43ae23de4d4be2803bc4
d1fe7107bc389d6a6785f0fbd5807d8c6ac77909
refs/heads/main
2023-06-02T22:21:47.325028
2021-06-25T03:16:22
2021-06-25T03:16:22
377,757,408
0
0
null
null
null
null
UTF-8
Swift
false
false
879
swift
// // TweetTests.swift // TweetTests // // Created by addin on 11/06/21. // import XCTest @testable import Tweet class TweetTests: XCTestCase { override func setUpWithError() throws { // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDownWithError() throws { // Put teardown code here. This method is called after the invocation of each test method in the class. } func testExample() throws { // This is an example of a functional test case. // Use XCTAssert and related functions to verify your tests produce the correct results. } func testPerformanceExample() throws { // This is an example of a performance test case. self.measure { // Put the code you want to measure the time of here. } } }
[ 360462, 98333, 16419, 229413, 204840, 278570, 344107, 155694, 253999, 229430, 319542, 163896, 180280, 376894, 352326, 311372, 196691, 278615, 385116, 237663, 254048, 319591, 221290, 278634, 319598, 352368, 204916, 131191, 237689, 278655, 278677, 196760, 426138, 278685, 311458, 278691, 49316, 32941, 278704, 377009, 278708, 131256, 295098, 417988, 417994, 139479, 254170, 229597, 311519, 205035, 286958, 327929, 344313, 147717, 368905, 180493, 254226, 368916, 262421, 377114, 237856, 237857, 278816, 254251, 311597, 98610, 180535, 336183, 278842, 287041, 319821, 254286, 344401, 377169, 368981, 155990, 368984, 106847, 98657, 270701, 246127, 270706, 139640, 246136, 246137, 311685, 106888, 385417, 385422, 213403, 385454, 377264, 311738, 33211, 278970, 319930, 336317, 336320, 311745, 278978, 254406, 188871, 278993, 278999, 328152, 369116, 287198, 279008, 279013, 279018, 319981, 279029, 254456, 279032, 377338, 377343, 279039, 254465, 287241, 279050, 139792, 303636, 393751, 254488, 279065, 377376, 377386, 197167, 385588, 352829, 115270, 385615, 426576, 369235, 139872, 66150, 344680, 139892, 344696, 287352, 279164, 189057, 311941, 336518, 311945, 369289, 344715, 279177, 311949, 287374, 377489, 311954, 352917, 230040, 271000, 377497, 303771, 377500, 205471, 344738, 139939, 279206, 295590, 352937, 287404, 205487, 303793, 336564, 164533, 287417, 287422, 66242, 377539, 164560, 385747, 279252, 361176, 418520, 287452, 295652, 369385, 312052, 172792, 344827, 221948, 205568, 295682, 197386, 434957, 426774, 197399, 426775, 336671, 344865, 197411, 279336, 189228, 295724, 197422, 353070, 164656, 295729, 312108, 353069, 328499, 353078, 197431, 230199, 353079, 336702, 353094, 353095, 353109, 377686, 230234, 189275, 435039, 295776, 303972, 385893, 246641, 246643, 295798, 246648, 361337, 279417, 254850, 369538, 287622, 295824, 189348, 353195, 140204, 377772, 353197, 304051, 230332, 377790, 353215, 353216, 213957, 213960, 345033, 279498, 386006, 418776, 50143, 123881, 304110, 320494, 271350, 295927, 304122, 320507, 328700, 328706, 410627, 320516, 295942, 386056, 353290, 254987, 230410, 377869, 320527, 238610, 418837, 140310, 197657, 336929, 369701, 345132, 238639, 312373, 238651, 377926, 361543, 238664, 353367, 156764, 156765, 304222, 361566, 173166, 377972, 353397, 377983, 402565, 279685, 222343, 386189, 296086, 238743, 296092, 238765, 279728, 238769, 402613, 353479, 353481, 402634, 353482, 189653, 419029, 148696, 296153, 279774, 304351, 304356, 222440, 328940, 279792, 353523, 386294, 386301, 320770, 386306, 279814, 369930, 328971, 312587, 353551, 320796, 222494, 353584, 345396, 386359, 116026, 378172, 222524, 279875, 312648, 337225, 304456, 230729, 238927, 353616, 296273, 222559, 378209, 230756, 386412, 230765, 279920, 312689, 296307, 116084, 337281, 148867, 378244, 296329, 296335, 9619, 370071, 279974, 173491, 304564, 353719, 361927, 370123, 148940, 280013, 312782, 222675, 353750, 271843, 280041, 361963, 296433, 321009, 280055, 288249, 329225, 230921, 296461, 304656, 329232, 370197, 402985, 394794, 230959, 288309, 312889, 288318, 124485, 288326, 288327, 239198, 99938, 312940, 222832, 370296, 247416, 337534, 337535, 263809, 288392, 239250, 419478, 345752, 255649, 337591, 321207, 296632, 280251, 321219, 280267, 403148, 9936, 9937, 370388, 272085, 345814, 280278, 280280, 18138, 345821, 321247, 321249, 345833, 345834, 280300, 67315, 173814, 313081, 124669, 288512, 288516, 280329, 321302, 345879, 116505, 321310, 255776, 247590, 362283, 378668, 296755, 321337, 345919, 436031, 403267, 345929, 255829, 18262, 362327, 370522, 345951, 362337, 345955, 296806, 288619, 214895, 313199, 362352, 313203, 124798, 182144, 305026, 67463, 329622, 337815, 124824, 214937, 436131, 354212, 436137, 362417, 124852, 288697, 362431, 214977, 174019, 214984, 362443, 247757, 280541, 329695, 354272, 436191, 337895, 354280, 313319, 247785, 174057, 436205, 247791, 362480, 313339, 346118, 43014, 354316, 313357, 182296, 354345, 223274, 124975, 346162, 124984, 288828, 436285, 288833, 288834, 436292, 403525, 436301, 338001, 354385, 338003, 280661, 329814, 338007, 354393, 280675, 280677, 43110, 321637, 313447, 436329, 288879, 280694, 215164, 313469, 215166, 280712, 215178, 346271, 436383, 362659, 239793, 125109, 182456, 379071, 149703, 338119, 346314, 321745, 387296, 280802, 379106, 338150, 346346, 321772, 125169, 338164, 436470, 125183, 149760, 411906, 125188, 313608, 125193, 125198, 272658, 125203, 272660, 125208, 305440, 125217, 338218, 321840, 379186, 125235, 280887, 125240, 321860, 182598, 289110, 215385, 272729, 379225, 321894, 280939, 354676, 436608, 362881, 240002, 436611, 248194, 395659, 395661, 108944, 240016, 190871, 149916, 420253, 141728, 289189, 108972, 272813, 338356, 436661, 289232, 281040, 256477, 281072, 174593, 420369, 289304, 207393, 182817, 289332, 174648, 338489, 338490, 322120, 281166, 297560, 354911, 436832, 436834, 191082, 313966, 420463, 281199, 346737, 313971, 346740, 420471, 330379, 330387, 346772, 117396, 330388, 264856, 354969, 289434, 346779, 338613, 314040, 158394, 363211, 363230, 289502, 264928, 338662, 330474, 346858, 289518, 199414, 35583, 363263, 117517, 322319, 166676, 207640, 289576, 355121, 191283, 273207, 355130, 289598, 355139, 420677, 355154, 281427, 281433, 355178, 207727, 330609, 207732, 158593, 240518, 224145, 355217, 256922, 289690, 420773, 289703, 363438, 347055, 289727, 273344, 330689, 363458, 379844, 19399, 338899, 248796, 248797, 207838, 347103, 314342, 289774, 347123, 240630, 314362, 257024, 330754, 330763, 281626, 248872, 322612, 314448, 339030, 314467, 281700, 257125, 322663, 273515, 207979, 404593, 363641, 363644, 150657, 248961, 330888, 347283, 363669, 339100, 380061, 429214, 199839, 339102, 265379, 249002, 306346, 3246, 421048, 339130, 265412, 290000, 298208, 298212, 298213, 330984, 298221, 298228, 216315, 208124, 363771, 388349, 437505, 322824, 257305, 126237, 339234, 372009, 412971, 306494, 216386, 224586, 372043, 331090, 314710, 372054, 159066, 314720, 380271, 314739, 208244, 249204, 290173, 306559, 314751, 298374, 314758, 314760, 142729, 388487, 314766, 306579, 282007, 290207, 314783, 314789, 314791, 396711, 396712, 282024, 241066, 380337, 380338, 150965, 380357, 339398, 306639, 413137, 429542, 191981, 290301, 282114, 372227, 323080, 323087, 175639, 388632, 396827, 134686, 282146, 306723, 355876, 347694, 290358, 265798, 265804, 396882, 290390, 44635, 396895, 323172, 282213, 323178, 224883, 314998, 323196, 175741, 339584, 224901, 282245, 282246, 323217, 282259, 323236, 298661, 282280, 364207, 224946, 110268, 224958, 282303, 274115, 306890, 241361, 298712, 298720, 12010, 282348, 282358, 175873, 339715, 323331, 323332, 339720, 372496, 323346, 249626, 282400, 339745, 241441, 257830, 421672, 282417, 282427, 315202, 307011, 216918, 241495, 241528, 339841, 315273, 315274, 372626, 380821, 282518, 282519, 118685, 298909, 323507, 290745, 274371, 151497, 372701, 298980, 380908, 282633, 241692, 102437, 315432, 102445, 233517, 176175, 241716, 225351, 315465, 315476, 307289, 200794, 315487, 356447, 438377, 315498, 299121, 233589, 266357, 422019, 241808, 381073, 323729, 233636, 299174, 405687, 184505, 299198, 258239, 389313, 299203, 299209, 372941, 282831, 266449, 356576, 176362, 307435, 438511, 381172, 184570, 184575, 381208, 299293, 151839, 233762, 217380, 151847, 282919, 332083, 332085, 332089, 315706, 282939, 241986, 438596, 332101, 323913, 348492, 323916, 323920, 250192, 348500, 168281, 332123, 332127, 323935, 242023, 242029, 160110, 242033, 291192, 315770, 340357, 225670, 242058, 373134, 291224, 242078, 283038, 61857, 315810, 315811, 381347, 61859, 340398, 61873, 61880, 283064, 127427, 127428, 283075, 324039, 373197, 176601, 242139, 160225, 242148, 291311, 233978, 291333, 340490, 348682, 258581, 291358, 283184, 234036, 315960, 348732, 242237, 70209, 348742, 70215, 348749, 381517, 332378, 201308, 111208, 184940, 373358, 389745, 209530, 356989, 373375, 152195, 348806, 184973, 316049, 111253, 316053, 111258, 111259, 176808, 299699, 299700, 422596, 422599, 291530, 225995, 242386, 422617, 422626, 234217, 299759, 299776, 291585, 430849, 291592, 62220, 422673, 430865, 291604, 422680, 152365, 422703, 422709, 152374, 242485, 160571, 430910, 160575, 160580, 348998, 299849, 283467, 381773, 201551, 242529, 357218, 349026, 275303, 308076, 242541, 209785, 177019, 185211, 308092, 398206, 291712, 381829, 316298, 349067, 308107, 349072, 308112, 209817, 324506, 324507, 390045, 185250, 324517, 185254, 373687, 349121, 373706, 316364, 340955, 340961, 324586, 340974, 349171, 316405, 349175, 201720, 127992, 357379, 324625, 308243, 316437, 201755, 300068, 357414, 357423, 300084, 324666, 308287, 21569, 218186, 300111, 341073, 439384, 250981, 300135, 316520, 300136, 349294, 357486, 144496, 316526, 300150, 291959, 300151, 160891, 341115, 300158, 349316, 349318, 373903, 169104, 177296, 308372, 119962, 300187, 300188, 300201, 300202, 373945, 259268, 283847, 62665, 283852, 283853, 259280, 316627, 333011, 357595, 333022, 234733, 234742, 128251, 316669, 439562, 292107, 242954, 414990, 251153, 177428, 349462, 382258, 300343, 382269, 193859, 177484, 406861, 259406, 234831, 251213, 120148, 283991, 374109, 292195, 333160, 243056, 316787, 357762, 112017, 234898, 259475, 275859, 112018, 357786, 251298, 333220, 316842, 374191, 210358, 284089, 292283, 415171, 300487, 300489, 366037, 210390, 210391, 210392, 210393, 144867, 366053, 54765, 251378, 308723, 300536, 210433, 366083, 259599, 316946, 308756, 398869, 374296, 374299, 308764, 349726, 431649, 349741, 169518, 431663, 194110, 235070, 349763, 218696, 292425, 243274, 128587, 333388, 333393, 349781, 300630, 128599, 235095, 333408, 374372, 300644, 415338, 243307, 54893, 325231, 366203, 325245, 194180, 415375, 153251, 300714, 210603, 415420, 333503, 218819, 259781, 333517, 333520, 333521, 333523, 325346, 153319, 325352, 284401, 325371, 194303, 284429, 243472, 366360, 169754, 284442, 325404, 325410, 341796, 399147, 431916, 300848, 317232, 259899, 325439, 153415, 341836, 415567, 325457, 317269, 341847, 350044, 128862, 284514, 292712, 325484, 423789, 292720, 325492, 276341, 341879, 317304, 333688, 112509, 194429, 55167, 325503, 333701, 243591, 350093, 325518, 243597, 333722, 350109, 292771, 415655, 333735, 284587, 243637, 301008, 153554, 219101, 292836, 292837, 317415, 325619, 432116, 333817, 292858, 415741, 333828, 358410, 399373, 317467, 145435, 292902, 325674, 129076, 243767, 358456, 309345, 194666, 260207, 432240, 284788, 333940, 292992, 333955, 415881, 104587, 235662, 325776, 317587, 284826, 333991, 333992, 284842, 301251, 309444, 194782, 301279, 317664, 243962, 375039, 309503, 375051, 325905, 325912, 211235, 432421, 211238, 358703, 358709, 260418, 383311, 6481, 366930, 366929, 6489, 391520, 383332, 383336, 211326, 317831, 227725, 252308, 39324, 121245, 317852, 285090, 375207, 342450, 293303, 293310, 416197, 129483, 342476, 317901, 326100, 285150, 342498, 358882, 334309, 195045, 391655, 432618, 375276, 342536, 342553, 416286, 375333, 358954, 244269, 375343, 23092, 375351, 244281, 301638, 309830, 293448, 55881, 416341, 244310, 416351, 268899, 39530, 244347, 326287, 375440, 334481, 227990, 318106, 318107, 342682, 318130, 383667, 293556, 342713, 285373, 39614, 318173, 375526, 285415, 342762, 342763, 293612, 154359, 432893, 162561, 285444, 383754, 310036, 326429, 293664, 326433, 400166, 293672, 318250, 318252, 375609, 252741, 293711, 244568, 244570, 293730, 351077, 342887, 211829, 269178, 400252, 359298, 359299, 260996, 113542, 228233, 392074, 228234, 56208, 400283, 318364, 310176, 310178, 293800, 236461, 326581, 326587, 326601, 359381, 433115, 359387, 343005, 130016, 64485, 326635, 187374, 383983, 318461, 293886, 293893, 433165, 384016, 146448, 433174, 252958, 252980, 359478, 203830, 302139, 359495, 392290, 253029, 228458, 351344, 187506, 285814, 392318, 187521, 384131, 302216, 228491, 228493, 285838, 162961, 326804, 351390, 302240, 343203, 253099, 253100, 318639, 367799, 113850, 294074, 64700, 302274, 367810, 343234, 253125, 244940, 228563, 351446, 359647, 195808, 310497, 228588, 253167, 302325, 261377, 351490, 228609, 245019, 253216, 130338, 130343, 351537, 261425, 286013, 286018, 146762, 294218, 294219, 318805, 425304, 294243, 163175, 327024, 327025, 327031, 318848, 253317, 384393, 368011, 318864, 318868, 310692, 245161, 286129, 286132, 228795, 425405, 302529, 302531, 163268, 425418, 310732, 64975, 327121, 228827, 286172, 310757, 187878, 343542, 343543, 286202, 359930, 286205, 302590, 228867, 253451, 253452, 359950, 146964, 253463, 286244, 245287, 245292, 286254, 425535, 196164, 56902, 179801, 196187, 343647, 310889, 204397, 138863, 188016, 294529, 229001, 310923, 188048, 425626, 229020, 302754, 245412, 40613, 40614, 40615, 229029, 384695, 319162, 327358, 286399, 212685, 384720, 245457, 302802, 278234, 294622, 278240, 212716, 212717, 360177, 286459, 278272, 319233, 360195, 278291, 294678, 286494, 409394, 360252, 319292, 360264, 188251, 376669, 245599, 425825, 368488, 425833, 417654, 188292, 253829, 294807, 376732, 311199, 253856, 319392, 294823, 327596, 294843, 188348, 237504, 294850, 384964, 163781, 344013, 212942, 212946, 24532, 294886, 253929, 327661, 311281, 311282 ]
bf0c4faf96b3ee1bccb7dc3c132bcf33f56e2a6e
7f35d61a9bddfd916038ca3378e3c8daa23f56ba
/PintrestPinboardTests/PinterestPinboardTests_PinboardListServiceTest.swift
ff572cc3cdad3b4451736e3c49de77e24a21bdd4
[]
no_license
Zulqurnain24/PintrestPinboard
8c0d3016f18a401a03e85b9f98c62d59041faff3
8da9399a377e78b6f308ba89632a9fb2609b9374
refs/heads/master
2020-12-01T11:12:03.808808
2019-12-29T06:19:34
2019-12-29T06:19:34
230,614,624
0
0
null
null
null
null
UTF-8
Swift
false
false
1,175
swift
// // PinterestPinboardTests_PinboardListService.swift // PintrestPinboardTests // // Created by Mohammad Zulqarnain on 28/12/2019. // Copyright © 2019 Mohammad Zulqarnain. All rights reserved. // import XCTest @testable import PintrestPinboard class PinterestPinboardTests_PinboardListServiceTest: XCTestCase { var sut: PinboardListService! override func setUp() { super.setUp() sut = PinboardListService() } override func tearDown() { sut = nil super.tearDown() } func testPinboardListService() { let expectation = self.expectation(description: "Download Pinboard Items") sut.getPins { (result) in switch result { case .success(let pins): XCTAssertEqual(pins.count, 10, "Pinboard Items Fetched successfully") expectation.fulfill() break case .failure(_): expectation.fulfill() break } } waitForExpectations(timeout: TimeInterval(Int(Constants.testWebserviceTimeInterval)!), handler: nil) } }
[ -1 ]
d3d329204f33a1b95516baddc69715e1759438f5
5c944542db61fb190b19f8c7857d86964770399e
/XTeam/Model/MediaItem.swift
95611d1eebfc7536d56258a5f831739af4d44f2d
[]
no_license
JustinLennox/XTeam
14a2193f37362a1382b3dc56d4fafb7d24a9b045
31ec50480bc125071b5f644454fb3875b1b6de93
refs/heads/master
2022-05-28T20:44:02.446759
2020-04-30T06:58:58
2020-04-30T06:58:58
260,107,637
0
0
null
null
null
null
UTF-8
Swift
false
false
298
swift
// // MediaItem.swift // XTeam // // Created by Justin Lennox on 4/29/20. // Copyright © 2020 Justin Lennox. All rights reserved. // import Foundation enum MediaType: String, Codable { case image, video } struct MediaItem: Codable { let mediaType: MediaType let assetName: String }
[ -1 ]
ce62fdf07de7cf7ceac678e915769089fde6e6d7
d5c630bfc6bf8405c2bf438c0f9cf62e58833dfd
/ZJXT_Project/ZJXT_Swift/ZJXT_Swift/Modules/Home/View/ZJHomeNoticeCell.swift
f60602789af7f013f83c2cfdac62e87d5dbe2495
[ "Apache-2.0" ]
permissive
Grandaunt/IOS_intern
cc76ad59cf0e481609c7f2b243a55cd73806edb4
2cc5a72a107e729adae4ba9790efbec47f872e4c
refs/heads/master
2021-08-20T05:25:30.705945
2017-11-28T07:47:37
2017-11-28T07:47:37
112,302,733
0
0
null
null
null
null
UTF-8
Swift
false
false
1,247
swift
// // ZJHomeNoticeCell.swift // ZJXT_Swift // // Created by User on 2017/9/25. // Copyright © 2017年 runer. All rights reserved. // import UIKit class ZJHomeNoticeCell: UITableViewCell { @IBOutlet weak var mesImgView: UIImageView! lazy var cycleView: SDCycleScrollView = { let view = SDCycleScrollView(frame: CGRect.zero, delegate: nil, placeholderImage: nil) view?.scrollDirection = .vertical view?.onlyDisplayText = true view?.disableScrollGesture() view?.autoScrollTimeInterval = 5.0 view?.titleLabelBackgroundColor = UIColor.white view?.titleLabelTextColor = UIColor.color(hex: "#333333") return view! }() override func awakeFromNib() { super.awakeFromNib() self.addSubview(self.cycleView) self.cycleView.snp.makeConstraints { (make) in make.left.equalTo(self.mesImgView.snp.right) make.top.bottom.equalToSuperview() make.right.equalToSuperview().offset(-kHomeEdgeSpace) } } override func setSelected(_ selected: Bool, animated: Bool) { super.setSelected(selected, animated: animated) // Configure the view for the selected state } }
[ -1 ]
860641230599ee7d6cfdb302c72583a6d64e1c0a
968ec84389d742716a2ad7dadba14401e16598cd
/CmdBluetoothDemo/CmdBleExample/AppDelegate.swift
49be0f1c52a6740dd1118f5dbf05400fbde0932c
[ "MIT" ]
permissive
ZeroFengLee/CmdBluetooth
6d64c6c8dc5178079ffa8f17aa912d2c88f18479
375fc7e9a2d873d719e94adf72ee8f7d5bd1feb2
refs/heads/master
2020-05-21T17:42:38.482395
2018-08-21T10:46:12
2018-08-21T10:46:12
64,298,020
33
0
null
null
null
null
UTF-8
Swift
false
false
2,301
swift
// // AppDelegate.swift // CmdBleExample // // Created by Zero on 16/8/8. // Copyright © 2016年 Zero. All rights reserved. // import UIKit import CmdBluetooth @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { let centerManager = CmdCentralManager.manager let parser = MyParser() parser.dataComingMonitor = ReceiveDataCenter() centerManager.parser = parser 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:. } }
[ 287234, 229380, 306694, 229383, 121352, 192008, 229385, 236043, 229388, 229391, 229394, 223763, 223765, 229397, 229399, 321560, 229402, 229405, 294950, 309804, 310831, 281654, 204856, 300088, 286778, 310336, 230465, 325700, 205895, 310344, 242250, 307278, 311383, 309849, 151036, 280671, 228460, 309871, 160879, 280691, 170619, 303230, 292993, 373383, 287371, 276109, 141455, 133776, 141459, 299672, 179870, 287390, 287400, 133801, 172714, 337067, 133817, 307386, 180413, 314045, 302275, 410820, 287427, 199364, 283844, 203987, 384222, 155872, 363745, 363234, 280804, 419570, 280831, 306945, 323330, 278277, 296723, 214294, 329498, 296731, 211232, 303914, 306988, 262448, 296243, 284469, 289593, 280891, 282942, 296767, 283973, 239944, 110926, 310100, 297818, 173418, 410987, 328563, 324599, 181626, 255873, 201603, 310147, 299398, 247688, 39817, 187274, 142733, 230800, 297883, 284572, 214944, 288162, 144820, 40886, 337335, 281529, 197564, 144828, 230334, 319938, 291788, 288229, 215526, 322534, 288232, 297961, 228332, 292338, 288244, 308727, 239612 ]
525c4e7cf61fb4fa7bfa1b8a27e9c24f3ce2c131
c1c278c0db7e8c034185f050df929f1f6af8ab74
/macOS/Views/ItemListView.swift
4ac2246ee6986b91f4b0411d9fd8d70fd92ab79d
[]
no_license
AdaGOP/SwiftUI-MacOS
e9c19e4d14f858d004d8d7fd636713994d9d4bcd
285e37e4c107be5ec6fa04eee34c88ac2e12232a
refs/heads/main
2023-06-26T18:34:22.335143
2021-07-29T05:00:46
2021-07-29T05:00:46
390,287,736
0
0
null
null
null
null
UTF-8
Swift
false
false
1,214
swift
// // ItemListView.swift // MartabakManis (macOS) // // Created by David Gunawan on 28/07/21. // import SwiftUI struct ItemsListView: View { @ObservedObject private var menuList = MartabakService() var body: some View { return view .frame(minWidth: 400, minHeight: 600) .toolbar { ToolbarItem(placement: .automatic) { Button(action: { menuList.fetchMartabakList() }) { Image(systemName: "arrow.clockwise") } .keyboardShortcut("R", modifiers: .command) } ToolbarItem(placement: .automatic) { Button(action: { NSApp.keyWindow?.firstResponder?.tryToPerform(#selector(NSSplitViewController.toggleSidebar(_:)), with: nil) }) { Image(systemName: "sidebar.left") } .keyboardShortcut("S", modifiers: .command) } } } @ViewBuilder private var view: some View { List(menuList.menus) { item in MenuCarouselView(title: "", menus: menuList.menus) }.onAppear(perform: { menuList.fetchMartabakList() }) } }
[ -1 ]
1ad7640b75eed66b2e32a1a4de02a3d6dc4f8bf4
b8d413ecad94e32720152eaa61dc9cac3a3d8e97
/CanTossARTests/PaperTossARTests.swift
ca6252dd2cc487d2a86c683a6efb579429692004
[]
no_license
Maze-Cat/CanTossARGame
f7c6f032cac868e8519e136ff6bb2354b9847a61
b5d74c243b2f6dca503fcf014bf23f783b613c78
refs/heads/master
2022-04-23T07:51:35.712443
2020-04-25T00:21:24
2020-04-25T00:21:24
258,651,990
2
0
null
null
null
null
UTF-8
Swift
false
false
965
swift
// // PaperTossARTests.swift // PaperTossARTests // // Created by Yuchen Yang on 2020/4/5. // Copyright © 2020 Yuchen Yang. All rights reserved. // import XCTest @testable import PaperTossAR class PaperTossARTests: 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, 43014, 358410, 354316, 313357, 360462, 399373, 182296, 145435, 317467, 16419, 223268, 229413, 204840, 315432, 325674, 344107, 102445, 155694, 176175, 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, 307289, 385116, 237663, 254048, 315487, 356447, 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, 49316, 299174, 333991, 258214, 333992, 239793, 377009, 405687, 182456, 295098, 258239, 379071, 389313, 299203, 149703, 299209, 346314, 372941, 266449, 321745, 139479, 254170, 229597, 194782, 301279, 311519, 317664, 280802, 379106, 387296, 346346, 205035, 307435, 321772, 438511, 381172, 436470, 327929, 243962, 344313, 184575, 149760, 375039, 411906, 147717, 368905, 325905, 254226, 272658, 368916, 262421, 272660, 325912, 381208, 377114, 151839, 237856, 237857, 233762, 211235, 217380, 432421, 211238, 338218, 251213, 311597, 358703, 321840, 98610, 332083, 379186, 332085, 358709, 180535, 336183, 332089, 321860, 332101, 438596, 323913, 348492, 383311, 323920, 344401, 366930, 377169, 348500, 368981, 155990, 289110, 368984, 168281, 215385, 332123, 363163, 272729, 332127, 98657, 383332, 242023, 383336, 270701, 160110, 242033, 270706, 354676, 139640, 291192, 211326, 436608, 362881, 240002, 436611, 311685, 225670, 317831, 106888, 340357, 242058, 385417, 373134, 385422, 108944, 252308, 190871, 213403, 149916, 121245, 242078, 420253, 141728, 39324, 315810, 315811, 381347, 289189, 108972, 272813, 340398, 385454, 377264, 342450, 338356, 436661, 293303, 311738, 33211, 293310, 336320, 311745, 378244, 127427, 342466, 416197, 254406, 188871, 324039, 129483, 342476, 373197, 289232, 328152, 256477, 287198, 160225, 342498, 358882, 334309, 340453, 391655, 432618, 375276, 319981, 291311, 254456, 377338, 377343, 174593, 254465, 291333, 340490, 139792, 420369, 303636, 258581, 393751, 416286, 377376, 207393, 375333, 377386, 244269, 197167, 375343, 385588, 289332, 234036, 375351, 174648, 338489, 338490, 244281, 315960, 242237, 348732, 352829, 70209, 115270, 70215, 293448, 55881, 301638, 309830, 348742, 348749, 381517, 385615, 426576, 340558, 369235, 416341, 297560, 332378, 201308, 416351, 139872, 436832, 436834, 268899, 111208, 39530, 184940, 373358, 420463, 346737, 389745, 313971, 139892, 346740, 420471, 287352, 344696, 209530, 244347, 373375, 152195, 311941, 336518, 348806, 311945, 369289, 330379, 344715, 311949, 287374, 326287, 375440, 316049, 311954, 334481, 117396, 111253, 316053, 346772, 230040, 264856, 111258, 111259, 271000, 289434, 303771, 205471, 318106, 318107, 342682, 139939, 344738, 377500, 176808, 205487, 303793, 318130, 299699, 293556, 336564, 383667, 314040, 287417, 342713, 39614, 287422, 377539, 422596, 422599, 291530, 225995, 363211, 164560, 242386, 385747, 361176, 418520, 422617, 287452, 363230, 264928, 422626, 375526, 234217, 330474, 342762, 293612, 342763, 289518, 299759, 369385, 377489, 346858, 312052, 154359, 172792, 348920, 344827, 221948, 432893, 35583, 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, 326433, 344865, 197411, 400166, 289576, 293672, 295724, 152365, 197422, 353070, 164656, 295729, 422703, 191283, 189228, 422709, 152374, 197431, 273207, 375609, 353078, 160571, 289598, 160575, 336702, 430910, 160580, 252741, 420677, 381773, 201551, 293711, 353109, 377686, 244568, 230234, 189275, 244570, 435039, 295776, 242529, 349026, 357218, 303972, 385893, 342887, 308076, 242541, 207727, 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, 420773, 185254, 289703, 293800, 140204, 236461, 363438, 347055, 377772, 252847, 304051, 326581, 373687, 326587, 230332, 377790, 289727, 273344, 330689, 353215, 363458, 379844, 213957, 349121, 19399, 359364, 326601, 345033, 373706, 316364, 359381, 386006, 418776, 433115, 248796, 343005, 340955, 50143, 347103, 130016, 123881, 326635, 187374, 383983, 347123, 240630, 271350, 201720, 127992, 295927, 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, 357423, 300084, 312373, 203830, 359478, 252980, 238651, 308287, 248901, 377926, 359495, 218186, 250954, 314448, 341073, 339030, 439384, 304222, 392290, 253029, 257125, 300135, 316520, 273515, 173166, 357486, 144496, 351344, 404593, 187506, 377972, 285814, 291959, 300150, 300151, 363641, 160891, 363644, 341115, 300158, 377983, 392318, 150657, 248961, 384131, 349316, 402565, 349318, 302216, 330888, 386189, 373903, 169104, 177296, 326804, 363669, 238743, 119962, 300187, 300188, 339100, 351390, 199839, 380061, 429214, 265379, 343203, 300201, 249002, 253099, 253100, 238765, 3246, 300202, 306346, 238769, 318639, 402613, 367799, 421048, 373945, 113850, 294074, 302274, 367810, 259268, 265412, 353479, 402634, 283852, 259280, 290000, 316627, 333011, 189653, 419029, 351446, 148696, 296153, 134366, 304351, 195808, 298208, 310497, 359647, 298212, 298213, 222440, 330984, 328940, 298221, 298228, 302325, 234742, 386294, 351476, 351478, 128251, 363771, 386301, 261377, 320770, 386306, 437505, 322824, 439562, 292107, 328971, 369930, 414990, 353551, 251153, 177428, 349462, 257305, 250192, 320796, 222494, 253216, 339234, 372009, 412971, 353584, 261425, 351537, 382258, 345396, 300343, 386359, 116026, 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, 163175, 333160, 386412, 380271, 327024, 296307, 116084, 208244, 249204, 316787, 290173, 306559, 314751, 318848, 337281, 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, 374191, 286129, 380337, 173491, 286132, 150965, 304564, 353719, 380338, 210358, 228795, 425405, 302531, 380357, 339398, 361927, 300489, 425418, 306639, 413137, 23092, 210390, 210391, 210393, 353750, 210392, 286172, 144867, 271843, 429542, 361963, 296433, 251378, 308723, 300536, 286202, 359930, 302590, 210433, 372227, 366083, 323080, 329225, 253451, 296461, 359950, 259599, 304656, 329232, 146964, 308756, 370197, 175639, 253463, 374296, 388632, 374299, 308764, 396827, 134686, 349726, 431649, 286244, 355876, 245287, 402985, 394794, 245292, 349741, 169518, 347694, 431663, 288309, 312889, 194110, 349763, 196164, 265798, 288327, 218696, 292425, 128587, 265804, 333388, 396882, 128599, 179801, 44635, 239198, 343647, 333408, 396895, 99938, 300644, 323172, 310889, 415338, 243307, 312940, 54893, 204397, 138863, 188016, 222832, 325231, 224883, 120427, 314998, 370296, 366203, 323196, 325245, 337534, 337535, 339584, 263809, 294529, 194180, 224901, 288392, 229001, 415375, 188048, 239250, 419478, 425626, 302754, 153251, 298661, 40614, 300714, 210603, 224946, 337591, 384695, 110268, 415420, 224958, 327358, 333503, 274115, 259781, 306890, 403148, 212685, 333517, 9936, 9937, 241361, 302802, 333520, 272085, 345814, 370388, 384720, 224984, 345821, 321247, 298720, 321249, 325346, 153319, 325352, 345833, 345834, 212716, 212717, 372460, 360177, 67315, 173814, 325371, 288512, 319233, 175873, 339715, 288516, 360195, 339720, 243472, 372496, 323346, 321302, 345879, 366360, 398869, 249626, 325404, 286494, 321310, 255776, 339745, 341796, 257830, 421672, 362283, 378668, 399147, 431916, 300848, 409394, 296755, 259899, 319292, 360252, 325439, 345919, 436031, 403267, 153415, 360264, 345929, 341836, 415567, 325457, 317269, 18262, 216918, 241495, 341847, 362327, 255829, 346779, 350044, 128862, 245599, 345951, 362337, 376669, 345955, 425825, 296806, 292712, 425833, 423789, 214895, 313199, 362352, 325492, 276341, 417654, 341879, 241528, 317304, 333688, 112509, 55167, 182144, 325503, 305026, 339841, 188292, 333701, 253829, 243591, 315273, 315274, 325518, 372626, 380821, 329622, 294807, 337815, 333722, 376732, 118685, 298909, 311199, 319392, 350109, 253856, 292771, 436131, 354212, 294823, 415655, 436137, 327596, 362417, 323507, 243637, 290745, 294843, 188348, 362431, 237504, 294850, 274371, 384964, 214984, 151497, 362443, 344013, 212942, 301008, 153554, 212946, 24532, 346067, 372701, 219101, 329695, 436191, 360417, 292836, 292837, 298980, 313319, 317415, 253929, 380908, 436205, 247791, 362480, 311281, 311282, 325619, 432116, 292858, 415741, 352917 ]
e3d285fe9d0a86bc61fbe5d3c2311d78b8111261
2fd763066e4f9dc8f722d9ecd1d5101bd9a2e250
/Typhoon-Swift-Example-master/PocketForecast/UserInterface/Controllers/WeatherReport/WeatherReportViewController.swift
a9a26be9dfb900d4290832ab29c449404ee15183
[ "Apache-2.0" ]
permissive
73153/Swift_Projects_Demo4
a18378dd7360536a03ad171317ff75d9d55513be
b0d355c84227e2039b7b673148eea802206c5822
refs/heads/master
2020-04-14T23:54:02.856896
2015-03-19T05:21:12
2015-03-19T05:21:12
32,500,670
2
0
null
null
null
null
UTF-8
Swift
false
false
4,692
swift
//////////////////////////////////////////////////////////////////////////////// // // TYPHOON FRAMEWORK // Copyright 2013, Jasper Blues & Contributors // All Rights Reserved. // // NOTICE: The authors permit you to use, modify, and distribute this file // in accordance with the terms of the license agreement accompanying it. // //////////////////////////////////////////////////////////////////////////////// import UIKit public class WeatherReportViewController: UIViewController { public var weatherReportView : WeatherReportView { get { return self.view as WeatherReportView } set { self.view = newValue } } public private(set) var weatherClient : WeatherClient public private(set) var weatherReportDao : WeatherReportDao public private(set) var cityDao : CityDao public private(set) var assembly : ApplicationAssembly private var cityName : String? private var weatherReport : WeatherReport? //------------------------------------------------------------------------------------------- // MARK: - Initialization & Destruction //------------------------------------------------------------------------------------------- public dynamic init(view: WeatherReportView, weatherClient : WeatherClient, weatherReportDao : WeatherReportDao, cityDao : CityDao, assembly : ApplicationAssembly) { self.weatherClient = weatherClient self.weatherReportDao = weatherReportDao self.cityDao = cityDao self.assembly = assembly super.init(nibName: nil, bundle: nil) self.weatherReportView = view } public required init(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } //------------------------------------------------------------------------------------------- // MARK: - Overridden Methods //------------------------------------------------------------------------------------------- public override func viewWillAppear(animated: Bool) { super.viewWillAppear(animated) self.navigationController!.navigationBarHidden = true self.cityName = self.cityDao.loadSelectedCity() if (self.cityName != nil) { self.weatherReport = self.weatherReportDao.getReportForCityName(self.cityName) if (self.weatherReport != nil) { self.weatherReportView.weatherReport = self.weatherReport } else if (self.cityName != nil) { self.refreshData() } } } public override func viewDidAppear(animated: Bool) { super.viewDidAppear(animated) if (self.cityName != nil) { let cityListButton = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.Bookmarks, target: self, action: "presentMenu") cityListButton.tintColor = UIColor.whiteColor() let space = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.FlexibleSpace, target: nil, action: nil) let refreshButton = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.Refresh, target: self, action: "refreshData") refreshButton.tintColor = UIColor.whiteColor() self.weatherReportView.toolbar.items = [ cityListButton, space, refreshButton ] } } public override func viewWillDisappear(animated: Bool) { self.navigationController!.navigationBarHidden = false super.viewWillDisappear(animated) } //------------------------------------------------------------------------------------------- // MARK: - Private Methods //------------------------------------------------------------------------------------------- private dynamic func refreshData() { ICLoader.present() self.weatherClient.loadWeatherReportFor(self.cityName, onSuccess: { (weatherReport) in self.weatherReportView.weatherReport = weatherReport ICLoader.dismiss() }, onError: { (message) in ICLoader.dismiss() println ("Error" + message) }) } private dynamic func presentMenu() { let rootViewController = self.assembly.rootViewController() as RootViewController rootViewController.toggleSideViewController() } }
[ -1 ]
1db03e6ad4ee0b4f8f5b3f8e1c583d3b72519fe3
0fc24ad0c21c75530694bb9cfad10f0b9c6cbe37
/SimBatchDelete/Sources/Command/SimCtlCommand.swift
56583b55bda49cd12ceb33e6e2bb85660499a23d
[]
no_license
pkazantsev/SimBatchDelete
70f6926dc5b13304f068de276bb804c7a0efe9db
a9b80424c7bf2450b59b519ef1cca1e988afb045
refs/heads/develop
2022-01-11T21:42:20.051127
2022-01-07T09:08:21
2022-01-07T09:08:21
211,366,107
7
1
null
2022-01-07T09:08:21
2019-09-27T17:05:28
Swift
UTF-8
Swift
false
false
3,414
swift
// // SimCtlCommand.swift // import Foundation struct SimCtlCommand: Command { enum Subcommand { // case create // Create a new device. // case clone // Clone an existing device. // case upgrade // Upgrade a device to a newer runtime. /// Delete spcified devices, unavailable devices, or all devices. case delete(deviceId: UUID) // case pair // Create a new watch and phone pair. // case unpair // Unpair a watch and phone pair. // case pair_activate // Set a given pair as active. // case erase // Erase a device's contents and settings. // case boot // Boot a device. // case shutdown // Shutdown a device. // case rename // Rename a device. // case getenv // Print an environment variable from a running device. // case openurl // Open a URL in a device. // case addmedia // Add photos, live photos, videos, or contacts to the library of a device. // case install // Install an app on a device. // case uninstall // Uninstall an app from a device. // case get_app_container // Print the path of the installed app's container // case launch // Launch an application by identifier on a device. // case terminate // Terminate an application by identifier on a device. // case spawn // Spawn a process by executing a given executable on a device. /// List available devices, device types, runtimes, or device pairs. /// /// Returns JSON representation. case list // case icloud_sync // Trigger iCloud sync on a device. // case pbsync // Sync the pasteboard content from one pasteboard to another. // case pbcopy // Copy standard input onto the device pasteboard. // case pbpaste // Print the contents of the device's pasteboard to standard output. // case help // Prints the usage for a given subcommand. // case io // Set up a device IO operation. // case diagnose // Collect diagnostic information and logs. // case logverbose // enable or disable verbose logging for a device // case status_bar // Set or clear status bar overrides } private let command: ConsoleCommand init(command: Subcommand) { self.command = ConsoleCommand( cmdPath: "/usr/bin/xcrun", arguments: ["simctl"] + Self.arguments(for: command), expectingLongOutput: command.expectingLongOutput ) } func run(then completion: @escaping (Result<Data, CommandError>) -> Void) { command.run(then: completion) } private static func arguments(for command: Subcommand) -> [String] { switch command { case .delete(let deviceId): return ["delete", deviceId.uuidString] case .list: return ["list", "-j"] } } } private extension SimCtlCommand.Subcommand { var expectingLongOutput: Bool { switch self { case .delete: return false case .list: return true } } }
[ -1 ]
ed6665789977a3a2bf22165102eb8bc53d92b54f
32598a2bf5c9541ad73bc74123775d5cd8e2d3be
/GN/GNHelper/GNHTTP/Manager/GNHTTPManager.swift
e815975e9e10aca4bc044e8ac66a61d337a81d9e
[]
no_license
QFDXXDS/GNConfManager
0d64c4469a09e62e9ba6360de4b928deeb1562ef
55c41f54d35876274188a17f4bb8888a31f4d57f
refs/heads/master
2020-04-02T13:09:54.218166
2018-11-02T03:38:12
2018-11-02T03:38:12
154,470,106
0
0
null
null
null
null
UTF-8
Swift
false
false
832
swift
// // GNHTTPManager.swift // GN // // Created by Xianxiangdaishu on 2018/9/21. // Copyright © 2018年 XXDS. All rights reserved. // import Foundation import Alamofire func HTTPRequesgt(req: GNHTTPReq) -> GNSignal<Any, GNNoError > { let (signal,ob) = GNSignal<Any, GNNoError>.pipe() Alamofire.request(req.URLStr(), method: req.reqMethod(), parameters: req.parameters()).responseJSON { (rsp) in switch rsp.result { case .success(let value): ob.send(value:value ) break case .failure(let fail): NotificationCenter.default.post(name: kHTTPFAil, object: fail.localizedDescription) break } ob.sendCompleted() } return signal }
[ -1 ]
f98bd687e7fe8bc251a68a04a7c01d43b4666580
6a585680084548f5bb0c6d2292c0d5e1c1f4e0c2
/Resuscitation/service/TextToSpeech.swift
3f9c7213bb3ea992c81f7c1310da1e12b0fb62a1
[]
no_license
codinux-gmbh/Resuscitation
ebd4e8286b7b4fff6af6e83a09930ee96d9a50a8
6b44a0b5a9c3c30a0fc5a6fef27c1d529605804a
refs/heads/master
2023-01-20T12:26:01.249327
2020-11-13T11:41:30
2020-11-13T11:41:30
307,176,552
0
0
null
null
null
null
UTF-8
Swift
false
false
768
swift
import AVFoundation class TextToSpeech { func read(_ text: String) { do { let session = AVAudioSession.sharedInstance() try session.setCategory(AVAudioSession.Category.playAndRecord, options: .defaultToSpeaker) try session.setActive(true, options: .notifyOthersOnDeactivation) let utterance = AVSpeechUtterance(string: text) utterance.voice = AVSpeechSynthesisVoice(language: AVSpeechSynthesisVoice.currentLanguageCode()) ?? AVSpeechSynthesisVoice(language: "en-GB") let synthesizer = AVSpeechSynthesizer() synthesizer.speak(utterance) } catch { NSLog("Could not start text-to-speech: \(error)") } } }
[ -1 ]
75664eba06831d4593bf8702eee356ed9ff47174
abffd3c7989c1e67c3830fca800f22810972794c
/Sources/Networking+Private.swift
7459008a794df844d8429821dc15b2165bd592db
[ "MIT" ]
permissive
clementleroy/Networking
eb17bdb2e3a5537cd7abf02f6572530e3e88821d
c5b3c36c159fa1aeaae1fff4d50ea1d1445615fd
refs/heads/master
2023-04-16T19:49:15.224170
2021-04-27T08:29:12
2021-04-27T08:29:12
303,972,650
0
0
MIT
2020-10-14T09:57:12
2020-10-14T09:57:11
null
UTF-8
Swift
false
false
24,106
swift
import Foundation extension Networking { func objectFromCache(for path: String, cacheName: String?, cachingLevel: CachingLevel, responseType: ResponseType) -> Any? { /// Workaround: Remove URL parameters from path. That can lead to writing cached files with names longer than /// 255 characters, resulting in error. Another option to explore is to use a hash version of the url if it's /// longer than 255 characters. guard let destinationURL = try? destinationURL(for: path, cacheName: cacheName) else { fatalError("Couldn't get destination URL for path: \(path) and cacheName: \(String(describing: cacheName))") } switch cachingLevel { case .memory: try? FileManager.default.remove(at: destinationURL) return cache.object(forKey: destinationURL.absoluteString as AnyObject) case .memoryAndFile: if let object = cache.object(forKey: destinationURL.absoluteString as AnyObject) { return object } else if FileManager.default.exists(at: destinationURL) { var returnedObject: Any? let object = destinationURL.getData() if responseType == .image { returnedObject = Image(data: object) } else { returnedObject = object } if let returnedObject = returnedObject { cache.setObject(returnedObject as AnyObject, forKey: destinationURL.absoluteString as AnyObject) } return returnedObject } else { return nil } case .none: cache.removeObject(forKey: destinationURL.absoluteString as AnyObject) try? FileManager.default.remove(at: destinationURL) return nil } } func registerFake(requestType: RequestType, path: String, fileName: String, bundle: Bundle) { do { if let result = try FileManager.json(from: fileName, bundle: bundle) { registerFake(requestType: requestType, path: path, response: result, responseType: .json, statusCode: 200) } } catch ParsingError.notFound { fatalError("We couldn't find \(fileName), are you sure is there?") } catch { fatalError("Converting data to JSON failed") } } func registerFake(requestType: RequestType, path: String, response: Any?, responseType: ResponseType, statusCode: Int) { var requests = fakeRequests[requestType] ?? [String: FakeRequest]() requests[path] = FakeRequest(response: response, responseType: responseType, statusCode: statusCode) fakeRequests[requestType] = requests } func handleFakeRequest(_ fakeRequest: FakeRequest, path: String, cacheName: String?, cachingLevel: CachingLevel, completion: @escaping (_ body: Any?, _ response: HTTPURLResponse, _ error: NSError?) -> Void) -> String { var error: NSError? let url = try! composedURL(with: path) let response = HTTPURLResponse(url: url, statusCode: fakeRequest.statusCode) if let unauthorizedRequestCallback = unauthorizedRequestCallback, fakeRequest.statusCode == 403 || fakeRequest.statusCode == 401 { TestCheck.testBlock(isSynchronous) { unauthorizedRequestCallback() } } else { if fakeRequest.statusCode.statusCodeType != .successful { error = NSError(fakeRequest: fakeRequest) } switch fakeRequest.responseType { case .image: cacheOrPurgeImage(data: fakeRequest.response as? Data, path: path, cacheName: cacheName, cachingLevel: cachingLevel) case .data: cacheOrPurgeData(data: fakeRequest.response as? Data, path: path, cacheName: cacheName, cachingLevel: cachingLevel) case .json: try? cacheOrPurgeJSON(object: fakeRequest.response, path: path, cacheName: cacheName, cachingLevel: cachingLevel) } completion(fakeRequest.response, response, error) } let requestID = UUID().uuidString return requestID } func handleJSONRequest(_ requestType: RequestType, path: String, cacheName: String?, parameterType: ParameterType?, parameters: Any?, parts: [FormDataPart]? = nil, responseType: ResponseType, cachingLevel: CachingLevel, completion: @escaping (_ result: JSONResult) -> Void) -> String { switch cachingLevel { case .memory, .memoryAndFile: if let object = objectFromCache(for: path, cacheName: nil, cachingLevel: cachingLevel, responseType: responseType) { TestCheck.testBlock(isSynchronous) { let url = try! self.composedURL(with: path) let response = HTTPURLResponse(url: url, statusCode: 200) completion(JSONResult(body: object, response: response, error: nil)) } } default: break } if let fakeRequest = FakeRequest.find(ofType: requestType, forPath: path, in: fakeRequests) { return handleFakeRequest(fakeRequest, path: path, cacheName: cacheName, cachingLevel: cachingLevel) { _, response, error in completion(JSONResult(body: fakeRequest.response, response: response, error: error)) } } else { return requestData(requestType, path: path, cachingLevel: cachingLevel, parameterType: parameterType, parameters: parameters, parts: parts, responseType: responseType) { data, response, error in TestCheck.testBlock(self.isSynchronous) { completion(JSONResult(body: data, response: response, error: error)) } } } } func handleDataRequest(_ requestType: RequestType, path: String, cacheName: String?, cachingLevel: CachingLevel, responseType: ResponseType, completion: @escaping (_ result: DataResult) -> Void) -> String { if let fakeRequests = fakeRequests[requestType], let fakeRequest = fakeRequests[path] { return handleFakeRequest(fakeRequest, path: path, cacheName: cacheName, cachingLevel: cachingLevel) { _, response, error in completion(DataResult(body: fakeRequest.response, response: response, error: error)) } } else { let object = objectFromCache(for: path, cacheName: cacheName, cachingLevel: cachingLevel, responseType: responseType) if let object = object { TestCheck.testBlock(isSynchronous) { let url = try! self.composedURL(with: path) let response = HTTPURLResponse(url: url, statusCode: 200) completion(DataResult(body: object, response: response, error: nil)) } let requestID = UUID().uuidString return requestID } else { return requestData(requestType, path: path, cachingLevel: cachingLevel, parameterType: nil, parameters: nil, parts: nil, responseType: responseType) { data, response, error in self.cacheOrPurgeData(data: data, path: path, cacheName: cacheName, cachingLevel: cachingLevel) TestCheck.testBlock(self.isSynchronous) { completion(DataResult(body: data, response: response, error: error)) } } } } } func handleImageRequest(_ requestType: RequestType, path: String, cacheName: String?, cachingLevel: CachingLevel, responseType: ResponseType, completion: @escaping (_ result: ImageResult) -> Void) -> String { if let fakeRequests = fakeRequests[requestType], let fakeRequest = fakeRequests[path] { return handleFakeRequest(fakeRequest, path: path, cacheName: cacheName, cachingLevel: cachingLevel) { _, response, error in completion(ImageResult(body: fakeRequest.response, response: response, error: error)) } } else { let object = objectFromCache(for: path, cacheName: cacheName, cachingLevel: cachingLevel, responseType: responseType) if let object = object { TestCheck.testBlock(isSynchronous) { let url = try! self.composedURL(with: path) let response = HTTPURLResponse(url: url, statusCode: 200) completion(ImageResult(body: object, response: response, error: nil)) } let requestID = UUID().uuidString return requestID } else { return requestData(requestType, path: path, cachingLevel: cachingLevel, parameterType: nil, parameters: nil, parts: nil, responseType: responseType) { data, response, error in let returnedImage = self.cacheOrPurgeImage(data: data, path: path, cacheName: cacheName, cachingLevel: cachingLevel) TestCheck.testBlock(self.isSynchronous) { completion(ImageResult(body: returnedImage, response: response, error: error)) } } } } } func requestData(_ requestType: RequestType, path: String, cachingLevel: CachingLevel, parameterType: ParameterType?, parameters: Any?, parts: [FormDataPart]?, responseType: ResponseType, completion: @escaping (_ response: Data?, _ response: HTTPURLResponse, _ error: NSError?) -> Void) -> String { let requestID = UUID().uuidString var request = URLRequest(url: try! composedURL(with: path), requestType: requestType, path: path, parameterType: parameterType, responseType: responseType, boundary: boundary, authorizationHeaderValue: authorizationHeaderValue, token: token, authorizationHeaderKey: authorizationHeaderKey, headerFields: headerFields) DispatchQueue.main.async { NetworkActivityIndicator.sharedIndicator.visible = true } var serializingError: NSError? if let parameterType = parameterType { switch parameterType { case .none: break case .json: if let parameters = parameters { do { request.httpBody = try JSONSerialization.data(withJSONObject: parameters, options: []) } catch let error as NSError { serializingError = error } } case .formURLEncoded: guard let parametersDictionary = parameters as? [String: Any] else { fatalError("Couldn't convert parameters to a dictionary: \(String(describing: parameters))") } do { let formattedParameters = try parametersDictionary.urlEncodedString() switch requestType { case .get, .delete: let urlEncodedPath: String if path.contains("?") { if let lastCharacter = path.last, lastCharacter == "?" { urlEncodedPath = path + formattedParameters } else { urlEncodedPath = path + "&" + formattedParameters } } else { urlEncodedPath = path + "?" + formattedParameters } request.url = try! composedURL(with: urlEncodedPath) case .post, .put, .patch: request.httpBody = formattedParameters.data(using: .utf8) } } catch let error as NSError { serializingError = error } case .multipartFormData: var bodyData = Data() if let parameters = parameters as? [String: Any] { for (key, value) in parameters { let usedValue: Any = value is NSNull ? "null" : value var body = "" body += "--\(boundary)\r\n" body += "Content-Disposition: form-data; name=\"\(key)\"" body += "\r\n\r\n\(usedValue)\r\n" bodyData.append(body.data(using: .utf8)!) } } if let parts = parts { for var part in parts { part.boundary = boundary bodyData.append(part.formData as Data) } } bodyData.append("--\(boundary)--\r\n".data(using: .utf8)!) request.httpBody = bodyData as Data case .custom: request.httpBody = parameters as? Data } } if let serializingError = serializingError { let url = try! composedURL(with: path) let response = HTTPURLResponse(url: url, statusCode: serializingError.code) completion(nil, response, serializingError) } else { var connectionError: Error? let semaphore = DispatchSemaphore(value: 0) var returnedResponse: URLResponse? var returnedData: Data? let session = self.session.dataTask(with: request) { data, response, error in returnedResponse = response connectionError = error returnedData = data if let httpResponse = response as? HTTPURLResponse { if httpResponse.statusCode >= 200 && httpResponse.statusCode < 300 { if let data = data, data.count > 0 { returnedData = data } } else { var errorCode = httpResponse.statusCode if let error = error as NSError?, error.code == URLError.cancelled.rawValue { errorCode = error.code } connectionError = NSError(domain: Networking.domain, code: errorCode, userInfo: [NSLocalizedDescriptionKey: HTTPURLResponse.localizedString(forStatusCode: httpResponse.statusCode)]) } } self.cacheOrPurgeData(data: data, path: path, cacheName: nil, cachingLevel: cachingLevel) if TestCheck.isTesting && self.isSynchronous == false { semaphore.signal() } else { DispatchQueue.main.async { NetworkActivityIndicator.sharedIndicator.visible = false } self.logError(parameterType: parameterType, parameters: parameters, data: returnedData, request: request, response: returnedResponse, error: connectionError as NSError?) if let unauthorizedRequestCallback = self.unauthorizedRequestCallback, let error = connectionError as NSError?, error.code == 403 || error.code == 401 { unauthorizedRequestCallback() } else { if let response = returnedResponse as? HTTPURLResponse { completion(returnedData, response, connectionError as NSError?) } else { let url = try! self.composedURL(with: path) let errorCode = (connectionError as NSError?)?.code ?? 200 let response = HTTPURLResponse(url: url, statusCode: errorCode) completion(returnedData, response, connectionError as NSError?) } } } } session.taskDescription = requestID session.resume() if TestCheck.isTesting && isSynchronous == false { _ = semaphore.wait(timeout: DispatchTime.now() + 60.0) logError(parameterType: parameterType, parameters: parameters, data: returnedData, request: request as URLRequest, response: returnedResponse, error: connectionError as NSError?) if let unauthorizedRequestCallback = unauthorizedRequestCallback, let error = connectionError as NSError?, error.code == 403 || error.code == 401 { unauthorizedRequestCallback() } else { if let response = returnedResponse as? HTTPURLResponse { completion(returnedData, response, connectionError as NSError?) } else { let url = try! composedURL(with: path) let errorCode = (connectionError as NSError?)?.code ?? 200 let response = HTTPURLResponse(url: url, statusCode: errorCode) completion(returnedData, response, connectionError as NSError?) } } } } return requestID } func cancelRequest(_ sessionTaskType: SessionTaskType, requestType: RequestType, url: URL) { let semaphore = DispatchSemaphore(value: 0) session.getTasksWithCompletionHandler { dataTasks, uploadTasks, downloadTasks in var sessionTasks = [URLSessionTask]() switch sessionTaskType { case .data: sessionTasks = dataTasks case .download: sessionTasks = downloadTasks case .upload: sessionTasks = uploadTasks } for sessionTask in sessionTasks { if sessionTask.originalRequest?.httpMethod == requestType.rawValue && sessionTask.originalRequest?.url?.absoluteString == url.absoluteString { sessionTask.cancel() break } } semaphore.signal() } _ = semaphore.wait(timeout: DispatchTime.now() + 60.0) } func logError(parameterType: ParameterType?, parameters: Any? = nil, data: Data?, request: URLRequest?, response: URLResponse?, error: NSError?) { guard isErrorLoggingEnabled else { return } guard let error = error else { return } print(" ") print("========== Networking Error ==========") print(" ") let isCancelled = error.code == NSURLErrorCancelled if isCancelled { if let request = request, let url = request.url { print("Cancelled request: \(url.absoluteString)") print(" ") } } else { print("*** Request ***") print(" ") print("Error \(error.code): \(error.description)") print(" ") if let request = request, let url = request.url { print("\(request.httpMethod ?? "") - URL: \(url.absoluteString)") print(" ") } if let headers = request?.allHTTPHeaderFields { print("Headers: \(headers)") print(" ") } if let parameterType = parameterType, let parameters = parameters { switch parameterType { case .json: do { let data = try JSONSerialization.data(withJSONObject: parameters, options: .prettyPrinted) let string = String(data: data, encoding: .utf8) if let string = string { print("Parameters: \(string)") print(" ") } } catch let error as NSError { print("Failed pretty printing parameters: \(parameters), error: \(error)") print(" ") } case .formURLEncoded: guard let parametersDictionary = parameters as? [String: Any] else { fatalError("Couldn't cast parameters as dictionary: \(parameters)") } do { let formattedParameters = try parametersDictionary.urlEncodedString() print("Parameters: \(formattedParameters)") } catch let error as NSError { print("Failed parsing Parameters: \(parametersDictionary) — \(error)") } print(" ") default: break } } if let data = data, let stringData = String(data: data, encoding: .utf8) { print("Data: \(stringData)") print(" ") } if let response = response as? HTTPURLResponse { print("*** Response ***") print(" ") print("Headers: \(response.allHeaderFields)") print(" ") print("Status code: \(response.statusCode) — \(HTTPURLResponse.localizedString(forStatusCode: response.statusCode))") print(" ") } } print("================= ~ ==================") print(" ") } func cacheOrPurgeJSON(object: Any?, path: String, cacheName: String?, cachingLevel: CachingLevel) throws { guard let destinationURL = try? self.destinationURL(for: path, cacheName: cacheName) else { return } if let unwrappedObject = object { switch cachingLevel { case .memory: self.cache.setObject(unwrappedObject as AnyObject, forKey: destinationURL.absoluteString as AnyObject) case .memoryAndFile: let convertedData = try JSONSerialization.data(withJSONObject: unwrappedObject, options: []) _ = try convertedData.write(to: destinationURL, options: [.atomic]) self.cache.setObject(unwrappedObject as AnyObject, forKey: destinationURL.absoluteString as AnyObject) case .none: break } } else { self.cache.removeObject(forKey: destinationURL.absoluteString as AnyObject) } } func cacheOrPurgeData(data: Data?, path: String, cacheName: String?, cachingLevel: CachingLevel) { guard let destinationURL = try? self.destinationURL(for: path, cacheName: cacheName) else { return } if let returnedData = data, returnedData.count > 0 { switch cachingLevel { case .memory: self.cache.setObject(returnedData as AnyObject, forKey: destinationURL.absoluteString as AnyObject) case .memoryAndFile: _ = try? returnedData.write(to: destinationURL, options: [.atomic]) self.cache.setObject(returnedData as AnyObject, forKey: destinationURL.absoluteString as AnyObject) case .none: break } } else { self.cache.removeObject(forKey: destinationURL.absoluteString as AnyObject) } } @discardableResult func cacheOrPurgeImage(data: Data?, path: String, cacheName: String?, cachingLevel: CachingLevel) -> Image? { guard let destinationURL = try? self.destinationURL(for: path, cacheName: cacheName) else { return nil } var image: Image? if let data = data, let nonOptionalImage = Image(data: data), data.count > 0 { switch cachingLevel { case .memory: self.cache.setObject(nonOptionalImage, forKey: destinationURL.absoluteString as AnyObject) case .memoryAndFile: _ = try? data.write(to: destinationURL, options: [.atomic]) self.cache.setObject(nonOptionalImage, forKey: destinationURL.absoluteString as AnyObject) case .none: break } image = nonOptionalImage } else { self.cache.removeObject(forKey: destinationURL.absoluteString as AnyObject) } return image } }
[ 252791 ]
2a062e9802dcdf3669f6e7c99df1d87f13adfd4f
83c3ed0dedc54962055127cc948f2288fb879ed1
/Scroggle/Gameplay/Nodes/GameSceneController+Animations.swift
aeadbc0b20e770be3ef1fff20ead4eb017f879db
[]
permissive
intere/scroggle
745e55174c4d26888a6b4f2eb75020fa05cae9bd
7c1296e0680cadba5ac7d1d555d366b4e7cd6aa7
refs/heads/master
2020-03-09T02:19:54.588124
2018-07-15T16:21:27
2018-07-15T16:21:27
128,537,309
1
0
MIT
2018-11-14T13:11:51
2018-04-07T14:41:07
Swift
UTF-8
Swift
false
false
3,498
swift
// // GameSceneController+Animations.swift // Scroggle // // Created by Eric Internicola on 6/3/18. // Copyright © 2018 Eric Internicola. All rights reserved. // import SceneKit import SpriteKit extension GameSceneController { /// Rolls the dice in the scene for you func rollDice() { helpRollDice() } /// Rolls all of the dice to random positions func helpRollDice(completion: GenericBlock? = nil) { dice.forEach { [weak self] die in self?.randomlyMove(die: die) } } /// Moves the provided die to a random position /// /// - Parameter die: The die to be moved func randomlyMove(die: SCNNode) { let originalPosition = die.position let randomEuler = eulerAngle(for: 5.random) rollRandom(die: die) { [weak self] in self?.reset(die: die, position: originalPosition, angle: randomEuler) } } /// Resets the provided die back to the provided position and angle. /// /// - Parameters: /// - die: The die to be reset back. /// - position: The position to move the die back to. /// - angle: The angle to move the die back to. /// - completion: optional block to be executed after the animation is complete. func reset(die: SCNNode, position: SCNVector3, angle: SCNVector3, completion: GenericBlock? = nil) { let moveAction = SCNAction.move(to: position, duration: AnimationConstants.duration) let rotateAction = SCNAction.rotateTo(x: CGFloat(angle.x), y: CGFloat(angle.y), z: CGFloat(angle.z), duration: AnimationConstants.duration) die.runAction(SCNAction.group([moveAction, rotateAction])) } /// Rolls the die at the provided index. /// /// - Parameter index: The index of the die you want to roll func rollRandom(at index: Int, completion: GenericBlock? = nil) { guard index < dice.count else { return } rollRandom(die: dice[index]) } /// Rolls the die to a random position /// /// - Parameter die: The die to be rolled to a random position. func rollRandom(die: SCNNode, completion: GenericBlock? = nil) { let randomX = Float(6.random) - 3 let randomY = Float(6.random) - 3 let randomZ = Float(25.random) + 5 DLog("Random Position: \(Int(randomX)), \(Int(randomY)), \(Int(randomZ))") let randomAngleX = CGFloat(360.random.radians) let randomAngleY = CGFloat(360.random.radians) let randomAngleZ = CGFloat(360.random.radians) let moveAction = SCNAction.move(to: SCNVector3Make(randomX, randomY, randomZ), duration: AnimationConstants.duration) let rotateAction = SCNAction.rotateTo(x: randomAngleX, y: randomAngleY, z: randomAngleZ, duration: AnimationConstants.duration) die.runAction(SCNAction.group([moveAction, rotateAction])) { completion?() } } struct AnimationConstants { static let duration = 0.5 } } // MARK: - Debugging extension GameSceneController { /// Debugging function that merely animates the position of each die. /// /// - Parameter index: The index of the die you want to animate. func animateDice(_ index: Int = 0) { guard index < dice.count else { return } randomlyMove(die: dice[index]) DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { [weak self] in self?.animateDice(index + 1) } } }
[ -1 ]
d9a6ec77c23f1623a562917bde1dba9b8b33515a
f23d6f0b123e71075c7212e551cf5d29c064a7aa
/Swift Game/anh_pham-master/anh_pham-master/Incoming!/Incoming!/GameViewController.swift
fdfb43f97685856eb055592a258500e469f2a49d
[]
no_license
naomitr/Incoming-Game
42a5f08bf104895d3dd9037b2a2539fa4d6a1bc4
9a0ec68004398f26ec01367f18b479b599b31fe7
refs/heads/master
2020-06-23T17:59:36.463398
2019-08-02T17:03:48
2019-08-02T17:03:48
198,708,126
1
0
null
null
null
null
UTF-8
Swift
false
false
1,222
swift
// // GameViewController.swift // Incoming! // // Created by Anh Pham on 7/22/19. // Copyright © 2019 Anh Pham. All rights reserved. // import UIKit import SpriteKit import GameplayKit class GameViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() if let view = self.view as! SKView? { // Load the SKScene from 'GameScene.sks' let scene = GameScene(size: CGSize(width: 1080, height: 1920)) // Set the scale mode to scale to fit the window scene.scaleMode = .aspectFill // Present the scene view.presentScene(scene) view.ignoresSiblingOrder = true view.showsFPS = true view.showsNodeCount = true } } override var shouldAutorotate: Bool { return true } override var supportedInterfaceOrientations: UIInterfaceOrientationMask { if UIDevice.current.userInterfaceIdiom == .phone { return .allButUpsideDown } else { return .all } } override var prefersStatusBarHidden: Bool { return true } }
[ 350209, 110435, 264645, 311046, 110440, 350217, 110447, 234545, 350199, 318584, 318591 ]
6800d06ef717fa46330313ff380fe31c23fe4db8
a522f84d2195faa71794b987d7d6dba78cd53e0c
/Pandora/UI/Layout/PDMediaCollectionViewLayout.swift
3e661cccba28ad5df67ef4ca87914ebc8f28cf1b
[]
no_license
lxw5689/Pandora
be23a201fd1ca33487578793619fe2aa11b60754
a9ac8304a759eed514d2d236e67b319a251d6419
refs/heads/master
2021-01-21T04:44:47.329969
2016-06-11T14:37:59
2016-06-11T14:37:59
55,346,780
0
0
null
null
null
null
UTF-8
Swift
false
false
4,983
swift
// // PDMediaCollectionViewLayout.swift // Pandora // // Created by xiangwenlai on 16/3/19. // Copyright © 2016年 xiangwenlai. All rights reserved. // import UIKit protocol PDMediaLayoutDataSource { func mediaItemCount() -> Int func mediaItemDataArr() -> Array<PDMediaItem>? func isReflesh() -> Bool func newAppendCount() -> Int } class PDMediaCollectionViewLayout: UICollectionViewLayout { let leftRightMargin: Float = 15 let itemSpaceGap: Float = 10 var column: Int? var attrItems: Array<UICollectionViewLayoutAttributes>? var dataSource: PDMediaLayoutDataSource? var mediaItems: Array<PDMediaItem>? var columYArr: Array<Float>? required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) } init(col: Int, dataSource: PDMediaLayoutDataSource?) { self.column = col self.attrItems = [] self.dataSource = dataSource super.init() } override func prepareLayout() { super.prepareLayout() if self.dataSource != nil { self.mediaItems = self.dataSource!.mediaItemDataArr() if self.dataSource!.isReflesh() { self.attrItems?.removeAll() self.columYArr = [] } self.layoutAttributeItems() } } func layoutAttributeItems() { guard self.column > 0 && self.mediaItems != nil else { return } let collectionViewWidth = self.collectionView?.bounds.size.width let itemWidth = (Float(collectionViewWidth!) - self.leftRightMargin * 2 - Float((self.column! - 1)) * self.itemSpaceGap) / Float(self.column!) let begin = self.dataSource!.isReflesh() ? 0 : (self.mediaItems!.count - self.dataSource!.newAppendCount()) print("begin:\(begin)") for index in begin ..< (self.mediaItems?.count)! { let (minIndex, minOffsetY) = self.getMinYOfColumn() let mediaItem = self.mediaItems![index] let wScale = itemWidth / mediaItem.coverWidth let height = mediaItem.coverHeight * wScale let itemFr = CGRectMake(CGFloat(self.leftRightMargin) + CGFloat(minIndex) * CGFloat((itemWidth + self.itemSpaceGap)), minOffsetY + CGFloat(self.itemSpaceGap), CGFloat(itemWidth), CGFloat(height)) if minIndex < self.columYArr?.count { self.columYArr?[minIndex] = Float(CGRectGetMaxY(itemFr)) } else { self.columYArr?.append(Float(CGRectGetMaxY(itemFr))) } let attItem: UICollectionViewLayoutAttributes = UICollectionViewLayoutAttributes(forCellWithIndexPath: NSIndexPath(forItem: index, inSection: 0)) attItem.frame = itemFr self.attrItems?.append(attItem) } } func getMinYOfColumn() -> (Int, CGFloat) { var minY: CGFloat = 0 var col: Int = 0 for index in 0 ..< Int(self.column!) { if index >= self.columYArr?.count { col = index minY = 0 break } let temp = self.columYArr![index] if index == 0 { minY = CGFloat(temp) continue } if CGFloat(temp) < minY { minY = CGFloat(temp) col = index } } return (col, minY) } override func layoutAttributesForElementsInRect(rect: CGRect) -> [UICollectionViewLayoutAttributes]? { var attArr: [UICollectionViewLayoutAttributes] = [UICollectionViewLayoutAttributes]() for (_, item) in (self.attrItems?.enumerate())! { if CGRectIntersectsRect(rect, item.frame) { attArr.append(item) } } return attArr } override func layoutAttributesForItemAtIndexPath(indexPath: NSIndexPath) -> UICollectionViewLayoutAttributes? { guard indexPath.item < self.attrItems?.count else { return nil } return self.attrItems?[indexPath.item] } override func collectionViewContentSize() -> CGSize { guard self.columYArr?.count > 0 else { return CGSizeZero } var maxHeight: Float = 0 for (_, height) in (self.columYArr?.enumerate())! { if height > maxHeight { maxHeight = height } } return CGSizeMake((self.collectionView?.bounds.width)!, CGFloat(maxHeight + self.leftRightMargin)) } }
[ -1 ]
2ee399a408572fa16f590772852a37dc25371a49
30d4836e519f8f27420a7b73e025a100a39a512d
/FBLA/FBLA/Views/SettingsView.swift
1de883273b9e019aaac50cf22c7432bb17eda98d
[]
no_license
satvikb/FBLA_MobileAppDev
48858d9438d5865a9a9f48040799ed1530155fc3
e8209ccaf3205b815b7a72e9c1f63c5c467bd500
refs/heads/master
2021-10-10T19:44:35.425758
2019-01-16T04:10:43
2019-01-16T04:10:43
150,659,495
0
0
null
null
null
null
UTF-8
Swift
false
false
6,866
swift
// // SettingsView.swift // FBLA // // Created by Satvik Borra on 1/6/19. // Copyright © 2019 satvik borra. All rights reserved. // import UIKit protocol SettingsViewDelegate : class { func settingsMenuButtonPressed() } // This view is the settings view class SettingsView : View, PopupViewDelegate, UITextViewDelegate{ weak var delegate: SettingsViewDelegate? // Create UI var title : Label! var menuButton : Button! var resetProgressButton : Button! var reportBugButton : Button! var creditsButton : Button! // Create View variables var resetProgressPopupView : PopupView! var creditsPopupView : PopupView! var reportBugPopupView : PopupView! override init(frame: CGRect) { super.init(frame: frame) // Create UI and buttons title = Label(outFrame: propToRect(prop: CGRect(x: -0.7, y: 0, width: 0.6, height: 0.15), frame: self.frame), inFrame: propToRect(prop: CGRect(x: 0.1, y: 0, width: 0.6, height: 0.15), frame: self.frame), text: "Settings", textColor: UIColor.white, valign: .Bottom, _insets: false) title.textAlignment = .left title.font = UIFont(name: "SFProText-Heavy", size: fontSize(propFontSize: 70)) self.addSubview(title) menuButton = Button(outFrame: propToRect(prop: CGRect(x: -0.5, y: 0, width: 0.5, height: 0.2), frame: self.frame), inFrame: propToRect(prop: CGRect(x: 0.75, y: 0.05, width: 0.25, height: 0.1), frame: self.frame), text: "", _insets: false, imageURL: "home.png") menuButton.backgroundColor = UIColor.clear menuButton.pressed = { self.delegate?.settingsMenuButtonPressed() } self.addSubview(menuButton) resetProgressButton = Button(outFrame: propToRect(prop: CGRect(x: -1, y: 0.15, width: 0.5, height: 0.1), frame: self.frame), inFrame: propToRect(prop: CGRect(x: 0.05, y: 0.25, width: 0.9, height: 0.1), frame: self.frame), text: "Reset All Progress") resetProgressButton.pressed = { // Reset data and show a popup DataHandler.resetCompletedQuestions() self.resetProgressPopupView = PopupView(outFrame: propToRect(prop: CGRect(x: -0.85, y: 0.075, width: 0.85, height: 0.85), frame: self.frame), inFrame: propToRect(prop: CGRect(x: 0.075, y: 0.075, width: 0.85, height: 0.85), frame: self.frame), title: "Progress Reset", text: "All question progress has been reset.") self.resetProgressPopupView.delegate = self self.resetProgressPopupView.textLabel.delegate = self self.addSubview(self.resetProgressPopupView) self.resetProgressPopupView.animateIn { } } self.addSubview(resetProgressButton) reportBugButton = Button(outFrame: propToRect(prop: CGRect(x: -1, y: 0.3, width: 0.5, height: 0.1), frame: self.frame), inFrame: propToRect(prop: CGRect(x: 0.05, y: 0.4, width: 0.9, height: 0.1), frame: self.frame), text: "Report Bug") reportBugButton.pressed = { // Show a popup to report bug self.reportBugPopupView = PopupView(outFrame: propToRect(prop: CGRect(x: -0.85, y: 0.075, width: 0.85, height: 0.85), frame: self.frame), inFrame: propToRect(prop: CGRect(x: 0.075, y: 0.075, width: 0.85, height: 0.85), frame: self.frame), title: "Report Bug", text: "") self.reportBugPopupView.textLabel.isEditable = true self.reportBugPopupView.delegate = self self.reportBugPopupView.textLabel.delegate = self self.addSubview(self.reportBugPopupView) self.reportBugPopupView.animateIn { } } self.addSubview(reportBugButton) creditsButton = Button(outFrame: propToRect(prop: CGRect(x: -1, y: 0.45, width: 0.5, height: 0.1), frame: self.frame), inFrame: propToRect(prop: CGRect(x: 0.05, y: 0.55, width: 0.9, height: 0.1), frame: self.frame), text: "Credits") creditsButton.pressed = { // Create a popup to show credits let creditText = """ Software development: Satvik Borra Images: Jessica Cao, Michael Valenti Additional Text Editing: Jessica Cao, Michael Valenti Question Content: fbla-pbl.org Program Used: Xcode All images and designs seen in this app were created specifically for this app. All fonts used are licenced under use only for Apple applications. """ self.creditsPopupView = PopupView(outFrame: propToRect(prop: CGRect(x: -0.85, y: 0.075, width: 0.85, height: 0.85), frame: self.frame), inFrame: propToRect(prop: CGRect(x: 0.075, y: 0.075, width: 0.85, height: 0.85), frame: self.frame), title: "Credits", text: creditText) self.creditsPopupView.delegate = self self.creditsPopupView.textLabel.delegate = self self.addSubview(self.creditsPopupView) self.creditsPopupView.animateIn { } } self.addSubview(creditsButton) } // Dismiss any possible open popups func dismiss() { if creditsPopupView != nil { creditsPopupView.animateOut { } } if reportBugPopupView != nil { reportBugPopupView.animateOut { } } if resetProgressPopupView != nil { resetProgressPopupView.animateOut { } } } // For bug reporting, clicking done hides the keyboard instead of creating a new line func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool { if text == "\n" { textView.resignFirstResponder() return false } return true } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } // Animation functions override func animateIn(completion: @escaping () -> Void) { title.animateIn() menuButton.animateIn() resetProgressButton.animateIn() reportBugButton.animateIn() creditsButton.animateIn() DispatchQueue.main.asyncAfter(deadline: .now() + Double(transitionTime), execute: { completion() }) } override func animateOut(completion: @escaping () -> Void) { title.animateOut() menuButton.animateOut() resetProgressButton.animateOut() reportBugButton.animateOut() creditsButton.animateOut() DispatchQueue.main.asyncAfter(deadline: .now() + Double(transitionTime), execute: { completion() }) } }
[ -1 ]
ede9a9299c11dcbbf7bcb9abad8a4cc8590e5c94
aa424c7c9cfde613c562e03f9a24972981cd4d82
/EmojiArt/EmojiArtApp.swift
cf560c175273e4cedc2dce0d1d1955c00c8f3293
[]
no_license
Evgen-ios/EmojiArt
26fcae98bb4b5b43b4347794dd881f28e33e50f2
bba4a760d6ab7db011baa87d50ecb6d81ed1ad16
refs/heads/main
2023-01-28T17:13:21.010286
2020-12-09T07:25:57
2020-12-09T07:25:57
319,874,814
0
0
null
null
null
null
UTF-8
Swift
false
false
271
swift
// // EmojiArtApp.swift // EmojiArt // // Created by Evgeniy Goncharov on 09.12.2020. // import SwiftUI @main struct EmojiArtApp: App { var body: some Scene { WindowGroup { EmojiArtDocumentView(document: EmojiArtDocument()) } } }
[ -1 ]
0d74640d5a1b5439bbc28828e25d015813fcf371
0a710fcf32cb985307a562d19296073871653e73
/SwiftyTransport.swift
2b0c9eec965c79e7438c48264ea5dc47b21b1fca
[ "MIT" ]
permissive
ast3150/SwiftyTransport
7086d0250c51ae9db9ff2e80cfd9f3b34bcbc896
69f09fc5c13b65d2d8af19659597b41834e9b48d
refs/heads/master
2021-01-18T23:37:27.306007
2016-06-10T09:27:08
2016-06-10T09:27:08
48,744,211
0
1
null
null
null
null
UTF-8
Swift
false
false
13,571
swift
// // SwiftyTransport.swift // // Created by Alain Stulz on 28/12/15. // Copyright © 2015 Alain Stulz. All rights reserved. // import UIKit let baseURL = "http://transport.opendata.ch/v1/" class SwiftyTransport: NSObject { let delegate: SwiftyTransportDelegate init(delegate: SwiftyTransportDelegate) { self.delegate = delegate } // MARK: Locations /** Returns the matching locations for the given parameters. Either query or ( x and y ) are required. The locations in the response are scored to determine which is the most exact location. This method can return a refine response, what means that the request has to be redone. - parameter query: A search query, e.g. "Bern, Bahnhof" - parameter coordinates: A Location to list the nearest locations - parameter type: Only with query, type of the location, see LocationType - parameter transportations: Only with coordinates, type of transportations leaving from location, see Transportations */ func getLocations(query: String?, coordinates:(x: Float, y: Float)?, type: LocationType?, transportations: [Transportations]?){ let resource = "locations" var parameters = [String]() // Parameters if let query = query { parameters.append("query=\(query)") if let type = type { parameters.append("type=\(type.rawValue)") } } if let coordinates = coordinates { parameters.append("x=\(coordinates.x)") parameters.append("y=\(coordinates.y)") if let transportations = transportations { for transportation in transportations { parameters.append("transportations[]=\(transportation.rawValue.lowercaseString)") } } } var urlString = baseURL + resource for parameter in parameters { if urlString == baseURL + resource { // First parameter urlString += "?\(parameter)" } else { urlString += "&\(parameter)" } } // Request let url = NSURL(string: urlString) let request = NSURLRequest(URL: url!) let session = NSURLSession.sharedSession() session.dataTaskWithRequest(request) { (data, response, error) -> Void in guard let response = response as? NSHTTPURLResponse where response.statusCode == 200 else { self.delegate.didFailWithError(nil) return } guard error == nil else { self.delegate.didFailWithError(error) return } guard data != nil else { self.delegate.didFailWithError(nil) return } self.delegate.didGetLocationsData(data!) }.resume() } /** getLocations by Query - parameter query: A search query, e.g. "Bern, Bahnhof" - parameter type: Type of the location, see LocationType */ func getLocationsForQuery(query: String, type: LocationType?) { getLocations(query, coordinates: nil, type: nil, transportations: nil) } /** getLocations by Coordinates - parameter coordinates: A Location to list the nearest locations - parameter transportations: Type of transportations leaving from location, see Transportations */ func getLocationsByCoordinates(coordinates: (x: Float, y: Float), transportations: [Transportations]?) { getLocations(nil, coordinates: coordinates, type: nil, transportations: transportations) } // MARK: Connections /** Returns the next connections from a location to another. - parameter from: Specifies the departure location of the connection - parameter to: Specifies the arrival location of the connection - parameter via: Specifies up to five via locations. - parameter date: Date of the connection, in the format YYYY-MM-DD - parameter time: Time of the connection, in the format hh:mm - parameter isArrivalTime: If set to true the passed date and time is the arrival time - parameter transportations: Type of transportations leaving from location, see Transportations - parameter limit: 1 - 6. Specifies the number of connections to return. If several connections depart at the same time they are counted as 1. - parameter page: 0 - 10. Allows pagination of connections. Zero-based, so first page is 0, second is 1, third is 2 and so on. - parameter direct: Defaults to false, if set to true only direct connections are allowed - parameter sleeper: Defaults to false, if set to true only night trains containing beds are allowed, implies direct=1 - parameter couchette: Defaults to false, if set to true only night trains containing couchettes are allowed, implies direct=1 - parameter bike: Defaults to false, if set to true only trains allowing the transport of bicycles are allowed - parameter accessibility: Sets the level of accessibility required, see AccessibilityType */ func getConnections(from: String, to: String, vias: [String]?, date: String?, time: String?, isArrivalTime: Bool?, transportations: [Transportations]?, limit: Int?, page: Int?, direct: Bool?, sleeper: Bool?, couchette: Bool?, bike: Bool?, accessibility: AccessibilityType?) throws { let resource = "connections" var parameters = [String]() // Parameters parameters.append("from=\(from)") parameters.append("to=\(to)") if let vias = vias { if vias.count == 1 { parameters.append("via=\(vias.first!)") } else { for via in vias { parameters.append("via[]=\(via)") } } } if let date = date { parameters.append("date=\(date)") } if let time = time { parameters.append("time=\(time)") } if let isArrivalTime = isArrivalTime { parameters.append("isArrivalTime=\(isArrivalTime ? 1 : 0)") } if let transportations = transportations { for transportation in transportations { parameters.append("transportations[]=\(transportation.rawValue.lowercaseString)") } } if let limit = limit { parameters.append("limit=\(limit)") } if let page = page { parameters.append("page=\(page)") } if let direct = direct { parameters.append("direct=\(direct ? 1 : 0)") } if let sleeper = sleeper { parameters.append("sleeper=\(sleeper ? 1 : 0)") } if let couchette = couchette { parameters.append("couchette=\(couchette ? 1 : 0)") } if let bike = bike { parameters.append("bike=\(bike ? 1 : 0)") } if let accessibility = accessibility { parameters.append("accessibility=\(accessibility.rawValue)") } var urlString = baseURL + resource for parameter in parameters { if urlString == baseURL + resource { // First parameter urlString += "?\(parameter)" } else { urlString += "&\(parameter)" } } // Request if let urlString = urlString.stringByAddingPercentEncodingWithAllowedCharacters(NSCharacterSet.URLQueryAllowedCharacterSet()) { let url = NSURL(string: urlString) let request = NSURLRequest(URL: url!) let session = NSURLSession.sharedSession() session.dataTaskWithRequest(request) { (data, response, error) -> Void in guard let response = response as? NSHTTPURLResponse where response.statusCode == 200 else { self.delegate.didFailWithError(nil) return } guard error == nil else { self.delegate.didFailWithError(error) return } guard data != nil else { self.delegate.didFailWithError(nil) return } self.delegate.didGetConnectionsData(data!) }.resume() } else { throw SwiftyTransportError.InvalidURL } } /** getConnections by Locations - parameter from: Specifies the departure location of the connection - parameter to: Specifies the arrival location of the connection */ func getConnectionsByLocations(from: String, to: String) throws { try getConnections(from, to: to, vias: nil, date: nil, time: nil, isArrivalTime: nil, transportations: nil, limit: nil, page: nil, direct: nil, sleeper: nil, couchette: nil, bike: nil, accessibility: nil) } // MARK: Stationboard /** Returns the next connections leaving from a specific location. - parameter station: Specifies the location of which a stationboard should be returned - parameter id: The id of the station whose stationboard should be returned. Alternative to the station parameter; one of these two is required. If both an id and a station are specified the id has precedence. - parameter limit: Number of departing connections to return. This is not a hard limit - if multiple connections leave at the same time it'll return any connections that leave at the same time as the last connection within the limit. - parameter transportations: Type of transportations leaving from location, see Transportations - parameter datetime: Date and time of departing connections, in the format YYYY-MM-DD hh:mm. */ func getStationboard(station: String?, id: String?, limit: Int?, transportations: [Transportations]?, datetime: String?) throws { guard (station != nil) || (id != nil) else { throw SwiftyTransportError.InvalidParameters } let resource = "stationboard" var parameters = [String]() // Parameters if let station = station { parameters.append("station=\(station)") } if let id = id { parameters.append("id=\(id)") } if let limit = limit { parameters.append("limit=\(limit)") } if let transportations = transportations { for transportation in transportations { parameters.append("transportations[]=\(transportation.rawValue.lowercaseString)") } } if let datetime = datetime { parameters.append("datetime=\(datetime)") } var urlString = baseURL + resource for parameter in parameters { if urlString == baseURL + resource { // First parameter urlString += "?\(parameter)" } else { urlString += "&\(parameter)" } } // Request let url = NSURL(string: urlString) let request = NSURLRequest(URL: url!) let session = NSURLSession.sharedSession() session.dataTaskWithRequest(request) { (data, response, error) -> Void in guard let response = response as? NSHTTPURLResponse where response.statusCode == 200 else { self.delegate.didFailWithError(nil) return } guard error == nil else { self.delegate.didFailWithError(error) return } guard data != nil else { self.delegate.didFailWithError(nil) return } self.delegate.didGetStationboardData(data!) }.resume() } /** getStationboard for Station Name - parameter station: Specifies the location of which a stationboard should be returned */ func getStationboardForStation(station: String) throws { try getStationboard(station, id: nil, limit: nil, transportations: nil, datetime: nil) } /** getStationboard for Station id - parameter id: The id of the station whose stationboard should be returned. Alternative to the station parameter */ func getStationboardForID(id: String) throws { try getStationboard(nil, id: id, limit: nil, transportations: nil, datetime: nil) } } enum LocationType: String { case All case Station case POI case Address } enum Transportations: String { case ICE_TGV_RJ case EC_IC case IR case RE_D case Ship case S_SN_R case Bus case Cableway case ARZ_EXT case Tramway_Underground } enum AccessibilityType: String { case Independent_Boarding case Assisted_Boarding case Advanced_Notice } enum SwiftyTransportError: ErrorType { case InvalidParameters case InvalidURL } protocol SwiftyTransportDelegate { optional func didGetLocationsData(data: NSData) optional func didGetConnectionsData(data: NSData) optional func didGetStationboardData(data: NSData) func didFailWithError(error: NSError?) }
[ -1 ]
10aabc2fdc92c307c49456037d572ef3aa657e67
35aa76447d32f48344280bf361e4db4b9ec817c3
/Instagrid/Controller/ViewController.swift
47ff7eaa9b13378fffc660f2ebf8fda6ab970859
[]
no_license
chlavergne/openclassroomsProjects-Project4
2fbd4b3a5458043737eccdb2ca8f8570ced6e366
60a160843ac03195fd91f3e8b07e5bf7cd997109
refs/heads/main
2023-05-09T04:16:24.795989
2021-05-27T11:53:56
2021-05-27T11:53:56
368,805,754
0
0
null
null
null
null
UTF-8
Swift
false
false
4,584
swift
// // ViewController.swift // Instagrid // // Created by Christophe Expleo on 03/05/2021. // import UIKit class ViewController: UIViewController { // 4 buttons in FrameView private var button: UIButton! private var swipeGesture = UISwipeGestureRecognizer(target: self, action: #selector(afterSwipeGesture(recognizer:))) // 3 buttons for the display mode @IBOutlet weak var buttonWideTop: UIButton! @IBOutlet weak var buttonWideBottom: UIButton! @IBOutlet weak var buttonFourSquare: UIButton! @IBOutlet weak var frameView: FrameView! // selection of the 3 possible display mode @IBAction func tapButtonWideTop(_ sender: UIButton) { frameView.style = .wideTop resetSelectButton(sender) } @IBAction func tapButtonWideBottom(_ sender: UIButton) { frameView.style = .wideBottom resetSelectButton(sender) } @IBAction func tapButtonFourSquare(_ sender: UIButton) { frameView.style = .fourSquare resetSelectButton(sender) } // action to pick an image in the gallery with the selected button @IBAction func chooseImage(_ sender: UIButton) { button = sender openGallery() } override func viewDidLoad() { super.viewDidLoad() swipeGesture = UISwipeGestureRecognizer(target: self, action: #selector(afterSwipeGesture(recognizer:))) self.frameView.addGestureRecognizer(swipeGesture) if UIDevice.current.orientation == .landscapeLeft || UIDevice.current.orientation == .landscapeRight { swipeGesture.direction = .left } else { swipeGesture.direction = .up } } // change the direction of the swipe when detect a screen rotation override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) { if UIDevice.current.orientation == .landscapeLeft || UIDevice.current.orientation == .landscapeRight { swipeGesture.direction = .left } else { swipeGesture.direction = .up } } // functions called after a swipe @objc func afterSwipeGesture(recognizer: UISwipeGestureRecognizer) { animView() share() } private func resetSelectButton(_ sender: UIButton) { buttonWideTop.isSelected = false buttonWideBottom.isSelected = false buttonFourSquare.isSelected = false sender.isSelected = true } // animates FrameView after swipe based on screen orientation private func animView() { let screenHeight = UIScreen.main.bounds.height let screenWidth = UIScreen.main.bounds.width var translationTransform: CGAffineTransform if UIDevice.current.orientation == .landscapeLeft || UIDevice.current.orientation == .landscapeRight { translationTransform = CGAffineTransform(translationX: -screenWidth, y: 0) } else { translationTransform = CGAffineTransform(translationX: 0, y: -screenHeight) } UIView.animate(withDuration: 0.4) { self.frameView.transform = translationTransform } } private func share() { let renderer = UIGraphicsImageRenderer(size: frameView.bounds.size) let screenshot = renderer.image { _ in frameView.drawHierarchy(in: frameView.bounds, afterScreenUpdates: true) } let activityController = UIActivityViewController(activityItems: [screenshot], applicationActivities: nil) present(activityController, animated: true) activityController.completionWithItemsHandler = { (_, _, _, _) in UIView.animate(withDuration: 0.2) { self.frameView.transform = .identity } } } } extension ViewController: UIImagePickerControllerDelegate, UINavigationControllerDelegate { // choose an image from the gallery and assign it to the button @objc func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey: Any]) { let image = info[UIImagePickerController.InfoKey.originalImage] button.setImage(image as? UIImage, for: .normal) button.subviews.first?.contentMode = .scaleAspectFill picker.dismiss(animated: true, completion: nil) } private func openGallery() { let imagePickerController = UIImagePickerController() imagePickerController.delegate = self imagePickerController.sourceType = .photoLibrary self.present(imagePickerController, animated: true, completion: nil) } }
[ -1 ]
108c088782117fd4776532e5c787a84cf9dcd28a
dde08aa1ae574aff055ca4f0c26b36640002dcb8
/NavigatorControllerEricWv1Tests/NavigatorControllerEricWv1Tests.swift
94b0226dcd3d9f824d36e82621a4940852121db9
[]
no_license
edubwitowski/NavigatorControllerEricWv1
f3a6ed345265a0f84bc5aecbb46bae5f539b8950
1798a931040bb149455049cdd732367881b1b464
refs/heads/master
2021-04-26T22:05:09.812319
2018-03-05T23:37:37
2018-03-05T23:37:37
124,020,731
0
0
null
null
null
null
UTF-8
Swift
false
false
1,042
swift
// // NavigatorControllerEricWv1Tests.swift // NavigatorControllerEricWv1Tests // // Created by Macbook on 3/5/18. // Copyright © 2018 Eric Witowski. All rights reserved. // import XCTest @testable import NavigatorControllerEricWv1 class NavigatorControllerEricWv1Tests: XCTestCase { override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. super.tearDown() } func testExample() { // This is an example of a functional test case. // Use XCTAssert and related functions to verify your tests produce the correct results. } func testPerformanceExample() { // This is an example of a performance test case. self.measure { // Put the code you want to measure the time of here. } } }
[ 360462, 278558, 229413, 204840, 278570, 344107, 360491, 155694, 229424, 229430, 163896, 180280, 376894, 286788, 352326, 311372, 311374, 196691, 385116, 237663, 254048, 319591, 278634, 221290, 278638, 204916, 131189, 131191, 131198, 311435, 311438, 278677, 196760, 426138, 311458, 278691, 196773, 377009, 278708, 131256, 278714, 295098, 139479, 229597, 311519, 205035, 286958, 327929, 344313, 147717, 368905, 254226, 319763, 368916, 262421, 377114, 278810, 278816, 237856, 237857, 311597, 98610, 262450, 180535, 336183, 278842, 287041, 287043, 139589, 319813, 311621, 344401, 377169, 368981, 155990, 368984, 106847, 98657, 270701, 270706, 246136, 139640, 311681, 311685, 106888, 385417, 385422, 213403, 246178, 385454, 311727, 377264, 278961, 278965, 278970, 319930, 311738, 33211, 336320, 311745, 278978, 254406, 188871, 278989, 278993, 278999, 328152, 369116, 188894, 287198, 279008, 279013, 279018, 319981, 279022, 319987, 279029, 254456, 377338, 279039, 377343, 254465, 287241, 279050, 303631, 139792, 303636, 393751, 279065, 377376, 180771, 377386, 197167, 385588, 279094, 115270, 385615, 426576, 369235, 295519, 139872, 66150, 279146, 295536, 287346, 139892, 287352, 344696, 279164, 303746, 311941, 336518, 311945, 369289, 344715, 311949, 287374, 377489, 311954, 352917, 230040, 271000, 377497, 303771, 377500, 205471, 344738, 139939, 295599, 205487, 303793, 336564, 230072, 287417, 287422, 377539, 287439, 164560, 385747, 279252, 361176, 418520, 287452, 279269, 246503, 369385, 312047, 279280, 312052, 230134, 172792, 344827, 221948, 279294, 205568, 295682, 197386, 434957, 426774, 197399, 426775, 197411, 279336, 262954, 295724, 197422, 353070, 164656, 303920, 262962, 295729, 197431, 230199, 336702, 279362, 353109, 377686, 230234, 189275, 435039, 295776, 279392, 303972, 385893, 230248, 246641, 246643, 295798, 246648, 279417, 361337, 254850, 369538, 287622, 213894, 58253, 295824, 279456, 189348, 279464, 140204, 377772, 304051, 230332, 287677, 189374, 377790, 353215, 213957, 213960, 345033, 279498, 386006, 418776, 50143, 123881, 287731, 271350, 295927, 304122, 328700, 328706, 410627, 320516, 295942, 386056, 353290, 230410, 377869, 238610, 418837, 140310, 230423, 197657, 369701, 238639, 312373, 238651, 230463, 377926, 238664, 296019, 304222, 230499, 279660, 173166, 156785, 312434, 377972, 337017, 377983, 279685, 402565, 222343, 386189, 296086, 238743, 296092, 238765, 279728, 238769, 402613, 230588, 279747, 353479, 402634, 279760, 189652, 279765, 189653, 419029, 148696, 296153, 279774, 304351, 304356, 222440, 279785, 328940, 279792, 386294, 386301, 320770, 386306, 312587, 328971, 353551, 173334, 320796, 222494, 304421, 279854, 353584, 345396, 386359, 222524, 378172, 279875, 304456, 312648, 337225, 230729, 222541, 296270, 238927, 353616, 296273, 378209, 230756, 386412, 279920, 296307, 116084, 181625, 337281, 148867, 296329, 296335, 230799, 9619, 370071, 279974, 279984, 173491, 304564, 279989, 353719, 296375, 296387, 361927, 296392, 296391, 280010, 280013, 312782, 239068, 280032, 271843, 280041, 296425, 329197, 329200, 296433, 280055, 288249, 230921, 329225, 296461, 149007, 304656, 329232, 370197, 402985, 394794, 312880, 288309, 312889, 288318, 280130, 288327, 280147, 239198, 99938, 312940, 222832, 288378, 337534, 337535, 263809, 239237, 288392, 239250, 419478, 206504, 321199, 198324, 296628, 337591, 280251, 280257, 280267, 403148, 9936, 313041, 9937, 370388, 272085, 345814, 280280, 18138, 67292, 345821, 321247, 321249, 345833, 345834, 313065, 280300, 239341, 419569, 67315, 173814, 313081, 288512, 288516, 280327, 280329, 321295, 321302, 345879, 321310, 255776, 362283, 378668, 296755, 321337, 280380, 345919, 436031, 403267, 280390, 280392, 345929, 304977, 18262, 362327, 280410, 345951, 362337, 345955, 296806, 288619, 288620, 280430, 214895, 313199, 362352, 313203, 182144, 305026, 67463, 329622, 337815, 214937, 214938, 239514, 247712, 436131, 436137, 362417, 362431, 280514, 280519, 214984, 362443, 231375, 280541, 329695, 436191, 313319, 296941, 436205, 329712, 43014, 354316, 313357, 305179, 313375, 239650, 354343, 354345, 223274, 346162, 288828, 436285, 288833, 288834, 436292, 403525, 313416, 280649, 436301, 354385, 338001, 338003, 223316, 280661, 329814, 223318, 354393, 288857, 280675, 280677, 43110, 313447, 321637, 436329, 288879, 223350, 280694, 288889, 215164, 313469, 215166, 280712, 215178, 141450, 346271, 436383, 362659, 239793, 182456, 280762, 223419, 379071, 280768, 149703, 280778, 346314, 321745, 280795, 387296, 280802, 379106, 346346, 321772, 436470, 157944, 149760, 411906, 313608, 272658, 338218, 321840, 379186, 280887, 321860, 280902, 289110, 215385, 354655, 321894, 313713, 354676, 436608, 362881, 248194, 240002, 436611, 280961, 240016, 108944, 190871, 149916, 420253, 141728, 289189, 108972, 272813, 338356, 436661, 281040, 289232, 256477, 281072, 174593, 420369, 223767, 223769, 207393, 289332, 174648, 338489, 338490, 281171, 297560, 436832, 436834, 313966, 281199, 420463, 346737, 313971, 346740, 420471, 330379, 133774, 117396, 117397, 346772, 264856, 289434, 346779, 166582, 314040, 158394, 199366, 363211, 363230, 264928, 330474, 289518, 199414, 191235, 322316, 117517, 322319, 166676, 207640, 281377, 289576, 191283, 273207, 289598, 281408, 322395, 330609, 207732, 158593, 224145, 355217, 256922, 289690, 289698, 420773, 289703, 363438, 347055, 289727, 273344, 330689, 363458, 379844, 19399, 52172, 183248, 248796, 347103, 289774, 183279, 347123, 314355, 240630, 257024, 330754, 134150, 322570, 330763, 322582, 281625, 281626, 175132, 248872, 322612, 207938, 314448, 339030, 281697, 281700, 257125, 273515, 404593, 363641, 363644, 150657, 248961, 330888, 363669, 339100, 380061, 339102, 199839, 429214, 330913, 306338, 265379, 249002, 306346, 3246, 421048, 208058, 265412, 290000, 298208, 363744, 298212, 298213, 290022, 330984, 298221, 298228, 216315, 208124, 388349, 437505, 322824, 257305, 339234, 199971, 372009, 412971, 306494, 216386, 224586, 331090, 314709, 314710, 372054, 159066, 224606, 314720, 142689, 281957, 281962, 306542, 380271, 208244, 249204, 290173, 306559, 224640, 314751, 298374, 314758, 314760, 142729, 388487, 281992, 314766, 306579, 282007, 290207, 314783, 314789, 282022, 314791, 282024, 396711, 396712, 314798, 380337, 380338, 150965, 380357, 339398, 306631, 306639, 413137, 429542, 282096, 306673, 306677, 191990, 290300, 282114, 372227, 306692, 306693, 323080, 192010, 323087, 282129, 175639, 282136, 388632, 396827, 282141, 134686, 347694, 265798, 282183, 265804, 396882, 290390, 44635, 396895, 323172, 282213, 323178, 224883, 314998, 323196, 175741, 339584, 192131, 282245, 290443, 323217, 282259, 298654, 282271, 282273, 282276, 298661, 290471, 282280, 298667, 224946, 110268, 224958, 282303, 323263, 274115, 306890, 282318, 241361, 216795, 298720, 323331, 323332, 339715, 216839, 339720, 372496, 323346, 339745, 257830, 421672, 159533, 200498, 315202, 282438, 307025, 413521, 216918, 307031, 241495, 282474, 282480, 241528, 315264, 339841, 282504, 315273, 315274, 110480, 184208, 372626, 380821, 282518, 282519, 44952, 298909, 118685, 298920, 200627, 323507, 290745, 290746, 274371, 151497, 372701, 298980, 380908, 282612, 307231, 102437, 315432, 233517, 102445, 176175, 241716, 159807, 225351, 315465, 315476, 307289, 315487, 356447, 315497, 315498, 438377, 233589, 233590, 266357, 422019, 241808, 323729, 381073, 233636, 299174, 233642, 299187, 405687, 299198, 258239, 389313, 299203, 299209, 372941, 282831, 266449, 307435, 438511, 233715, 381172, 168188, 184575, 381208, 299293, 151839, 282913, 233762, 217380, 282919, 332083, 332085, 332089, 315706, 282939, 307517, 438596, 332101, 323913, 348492, 323920, 348500, 168281, 332123, 323935, 332127, 242023, 160110, 242033, 291192, 340357, 225670, 242058, 373134, 291224, 242078, 61857, 315810, 61859, 315811, 381347, 340398, 299441, 283064, 127427, 127428, 324039, 373197, 176601, 160225, 291311, 291333, 340490, 283153, 258581, 291358, 283182, 234036, 315960, 348732, 242237, 70209, 348742, 70215, 348749, 381517, 332378, 201308, 111208, 184940, 373358, 389745, 209530, 291454, 373375, 184962, 152195, 348806, 152203, 316049, 111253, 316053, 111258, 111259, 176808, 299699, 422596, 422599, 291530, 225995, 225997, 242386, 226004, 226007, 422617, 422626, 226019, 234217, 299759, 299770, 234234, 299776, 242433, 291585, 430849, 234241, 209670, 291592, 226058, 234250, 62220, 234253, 422673, 430865, 291604, 234263, 422680, 283419, 291612, 234268, 234277, 283430, 234283, 152365, 234286, 422703, 234289, 422709, 234294, 152374, 160571, 234301, 430910, 160575, 160580, 234311, 234312, 299849, 381773, 234317, 201551, 234323, 234326, 234331, 242529, 349026, 357218, 234340, 234343, 177001, 201577, 234346, 308076, 242541, 234355, 209783, 234360, 209785, 234361, 177019, 185211, 308092, 398206, 234366, 291712, 234367, 234372, 381829, 226181, 226184, 316298, 308112, 349072, 234386, 234387, 234392, 324507, 390045, 234400, 185250, 234404, 283558, 185254, 234409, 275371, 234419, 373687, 234425, 234427, 234430, 234436, 234438, 373706, 316364, 234444, 234445, 234451, 234454, 234457, 234463, 234466, 234472, 234473, 324586, 234477, 234482, 349175, 201720, 127992, 234498, 357379, 234500, 234506, 234514, 308243, 234531, 357414, 234534, 234542, 300084, 234548, 234555, 308287, 234560, 234565, 234569, 218186, 300111, 234577, 341073, 234583, 439384, 234584, 234587, 300135, 300136, 316520, 275565, 357486, 144496, 275571, 300150, 300151, 291959, 234616, 398457, 160891, 300158, 234622, 349316, 349318, 275591, 234632, 373903, 169104, 177296, 234642, 308372, 185493, 119962, 300187, 300188, 119963, 234656, 234659, 234663, 300201, 300202, 275625, 226481, 373945, 283840, 259268, 283852, 283853, 259280, 316627, 333011, 234733, 234742, 292091, 128251, 439562, 292107, 414990, 251153, 177428, 349462, 226608, 382258, 300343, 382269, 226624, 300359, 226632, 234827, 177484, 406861, 259406, 234831, 357719, 283991, 374109, 218462, 292195, 333160, 284014, 316787, 357762, 112017, 234898, 259475, 275859, 357786, 251298, 333220, 374191, 415171, 292292, 300487, 300489, 284116, 210390, 210391, 210393, 226781, 144867, 316902, 251378, 308723, 300535, 300536, 300542, 259599, 316946, 308756, 398869, 374296, 374299, 308764, 431649, 169518, 431663, 194110, 349763, 218696, 292425, 276040, 128587, 333388, 366154, 276045, 300630, 128599, 243292, 333408, 300644, 317032, 415338, 243307, 54893, 325231, 276085, 325245, 235135, 194180, 415375, 276120, 276126, 153251, 300714, 210603, 415420, 333503, 259781, 333517, 276173, 333520, 325346, 276195, 153319, 325352, 284401, 276210, 325371, 276219, 194303, 194304, 300811, 276238, 243472, 366360, 284442, 325404, 276253, 399147, 431916, 300848, 276282, 259899, 276283, 325439, 276287, 276294, 153415, 276298, 341836, 415567, 325457, 317269, 341847, 284507, 350044, 128862, 284512, 284514, 276327, 292712, 423789, 292720, 325492, 276341, 300918, 341879, 317304, 333688, 276344, 194429, 112509, 55167, 325503, 333701, 243591, 325518, 333722, 350109, 300963, 292771, 415655, 284587, 292782, 243637, 276408, 276421, 276430, 301008, 153554, 194515, 276444, 292836, 292837, 276454, 317415, 276459, 325619, 432116, 292858, 415741, 333828, 358410, 399373, 317467, 145435, 227370, 325674, 309295, 129076, 276534, 243767, 358456, 227417, 194656, 309345, 227428, 276582, 194666, 276589, 260207, 432240, 227439, 284788, 333940, 292988, 292992, 194691, 227460, 415881, 104587, 235662, 276627, 276632, 284826, 333991, 284841, 284842, 129203, 309444, 276682, 227548, 194782, 301279, 317664, 211193, 243962, 375039, 194820, 325905, 325912, 309529, 211235, 432421, 211238, 358703, 358709, 227658, 276813, 325968, 6481, 366930, 6482, 6489, 276835, 383332, 383336, 416104, 276847, 285040, 317820, 211326, 317831, 227725, 178578, 252308, 293274, 121245, 285090, 342450, 293303, 276920, 276925, 293310, 416197, 129483, 342476, 326100, 227809, 358882, 342498, 334309, 227813, 391655, 432618, 375276, 301571, 276998, 342536, 186893, 416286, 375333, 293419, 244269, 375343, 236081, 23092, 375351, 277048, 244281, 301638, 309830, 293448, 55881, 416341, 309846, 416351, 268899, 277094, 39530, 277101, 277111, 301689, 244347, 277133, 326287, 375440, 334481, 318106, 318107, 342682, 285353, 285361, 342706, 318130, 293556, 383667, 285371, 285373, 39614, 154316, 334547, 203477, 96984, 375526, 285415, 342762, 342763, 293612, 129773, 277227, 154359, 228088, 432893, 162561, 383754, 310036, 285466, 326429, 293664, 326433, 400166, 293672, 318250, 318252, 301871, 285487, 375609, 293693, 162621, 162626, 277316, 252741, 318278, 277325, 293711, 244568, 244570, 301918, 293730, 342887, 400239, 277366, 228215, 277370, 400252, 359298, 359299, 260996, 277381, 113542, 228233, 228234, 392074, 56208, 293781, 318364, 310176, 310178, 293800, 236461, 293806, 326581, 326587, 326601, 359381, 433115, 343005, 277479, 326635, 187374, 383983, 277492, 318461, 293886, 293893, 277509, 277510, 433165, 384016, 277523, 433174, 252958, 310317, 203830, 359478, 277563, 277597, 113760, 302177, 392290, 253029, 285798, 228458, 15471, 351344, 285814, 285820, 392318, 384131, 285828, 302213, 253063, 302216, 326804, 187544, 351390, 302240, 253099, 253100, 318639, 367799, 113850, 294074, 277690, 302274, 367810, 244940, 195808, 310497, 195811, 228588, 302325, 204022, 228600, 228609, 261377, 253216, 277792, 130338, 277800, 113966, 261425, 351537, 286013, 113987, 15686, 294218, 146762, 294219, 318805, 425304, 294243, 163175, 327024, 327025, 318848, 179587, 253317, 384393, 368011, 318864, 318868, 318875, 310692, 245161, 286129, 286132, 228795, 425405, 302531, 163269, 425418, 310732, 64975, 228827, 286172, 310757, 187878, 286202, 359930, 286205, 302590, 228861, 294400, 253451, 359950, 65041, 146964, 253463, 204313, 286244, 245287, 245292, 278060, 286254, 196164, 228943, 286288, 179801, 196187, 147036, 343647, 286306, 310889, 204397, 138863, 188016, 188031, 294529, 286343, 229001, 310923, 188048, 302739, 425626, 229020, 302754, 40613, 40614, 40615, 229029, 278191, 286388, 286391, 384695, 327358, 286399, 212685, 302797, 384720, 212688, 302802, 286423, 278233, 278234, 278240, 212716, 212717, 360177, 229113, 278272, 319233, 311042, 360195, 294678, 278299, 286494, 294700, 409394, 319292, 360252, 360264, 376669, 245599, 237408, 425825, 425833, 417654, 188292, 40853, 294807, 294809, 376732, 294814, 311199, 319392, 294823, 327596, 294843, 188348, 98239, 237504, 294850, 384964, 344013, 212942, 24532, 294886, 311281, 311282 ]
06c0ac2efd24c01e7e825fa9adf069239de54cf4
fffa6306468cb879f6db4441600980df61b8f561
/Senior-Proj/heart_watch_compaion/heart_watch_compaionTests/heart_watch_compaionTests.swift
2fba1dea5b91368247bc652b568327a5ebd55024
[]
no_license
asaleminiK/linkedlists1
b007d202d15a19760b170c822f845e9376740e0e
689fb9a95973ee580ad899e45b2110dfa6ff15d7
refs/heads/master
2021-04-03T07:48:39.431145
2020-04-17T17:50:51
2020-04-17T17:50:51
125,163,161
0
0
null
null
null
null
UTF-8
Swift
false
false
1,008
swift
// // heart_watch_compaionTests.swift // heart_watch_compaionTests // // Created by Thomas Sciaroni on 4/16/20. // Copyright © 2020 Thomas Sciaroni. All rights reserved. // import XCTest @testable import heart_watch_compaion class heart_watch_compaionTests: 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. } } }
[ 358410, 354316, 360462, 182296, 16419, 223268, 344107, 253999, 346162, 352315, 376894, 325694, 288833, 352326, 338007, 356447, 254048, 352368, 299121, 233590, 284825, 362659, 49316, 258214, 333991, 333992, 258239, 379071, 346314, 254170, 338164, 336120, 356602, 254226, 272660, 368916, 151839, 237856, 338218, 254251, 348492, 254286, 383311, 250192, 344401, 366930, 348500, 272729, 160110, 354677, 362881, 340357, 39324, 340398, 342450, 336320, 342466, 188871, 289232, 342498, 340453, 334309, 254456, 254465, 279057, 254488, 207393, 377386, 358954, 197167, 348732, 352829, 348742, 348749, 340558, 332378, 354911, 436832, 139872, 139892, 356989, 152195, 336518, 348806, 369289, 344715, 346772, 352917, 271000, 342682, 363163, 289434, 346779, 344738, 139939, 336558, 342713, 287439, 164560, 361176, 346858, 348920, 344827, 344828, 35583, 363263, 162561, 312079, 344865, 189228, 355121, 353078, 285497, 355130, 336702, 355139, 252741, 420677, 355146, 355152, 377686, 189275, 355165, 127841, 357218, 342887, 355178, 207727, 361337, 254850, 359298, 260996, 359299, 349067, 349072, 355217, 140204, 363438, 252847, 347055, 373687, 349121, 359364, 211914, 359381, 183257, 340955, 359387, 343005, 248797, 130016, 123881, 349175, 201720, 257024, 254987, 146448, 418837, 201755, 252958, 357423, 252980, 132158, 361535, 336960, 248901, 359495, 361543, 250954, 250956, 341073, 253029, 257125, 351344, 187506, 341115, 363644, 285820, 248961, 349316, 349318, 337039, 169104, 347283, 339100, 351390, 343203, 253099, 367799, 113850, 367810, 351446, 134366, 359647, 222440, 234733, 351476, 351478, 363771, 128251, 261377, 369930, 353551, 349462, 257305, 130343, 66862, 353584, 345396, 116026, 286013, 337225, 337227, 251213, 353616, 159066, 290169, 337281, 357762, 378244, 388487, 251298, 208293, 210358, 163268, 380357, 296392, 366037, 353750, 210391, 210392, 210390, 210393, 361963, 282096, 286202, 359930, 302590, 210433, 366083, 179723, 253451, 398869, 253463, 349726, 134686, 355876, 349741, 347694, 349781, 120427, 54893, 138863, 370296, 366203, 337534, 339584, 339585, 224901, 288392, 345752, 255649, 224946, 224958, 345814, 224984, 345834, 372460, 212716, 212717, 360177, 175873, 360195, 323332, 339720, 345879, 249626, 169754, 341796, 257830, 362283, 339762, 259899, 339783, 360264, 345929, 341836, 255829, 341847, 241495, 350044, 345951, 245599, 362337, 362352, 341879, 253829, 327557, 350093, 350109, 253856, 354212, 313254, 362417, 288697, 188348, 362431, 212942, 212946, 346067, 212951, 219101, 354269, 360417, 354274, 337895, 354280, 253929, 174057, 247791, 362480, 282612 ]
11aa82ff117f0816679c35c8ac6588552cea39a9
3e34cf17ef86410e36a50a7eaf4fef30638ba659
/Crawl/Crawl/UI/CrawlListViewController.swift
4a1e55983dbd12a82351c991673be91155a8fd45
[ "MIT" ]
permissive
JonahStarling/Crawl-iOS
0464ae3acc975f7e01303fe3570237aa6b09edc3
2c5d7e2c4edfee32ab352106e3c1a9694370d647
refs/heads/master
2022-04-07T01:53:27.176382
2020-02-28T19:58:48
2020-02-28T19:58:48
null
0
0
null
null
null
null
UTF-8
Swift
false
false
2,355
swift
// // CrawlListViewController.swift // Crawl // // Created by Jonah Starling on 2/23/20. // Copyright © 2020 Jonah Starling. All rights reserved. // import Foundation import UIKit class CrawlListViewController: StandardBottomSheetViewController, UITableViewDelegate, UITableViewDataSource { @IBOutlet weak var topBar: UIView! @IBOutlet weak var crawlList: UITableView! private let crawls = Array(Crawls.allCrawls.values) override func viewDidLoad() { super.viewDidLoad() crawlList.delegate = self crawlList.dataSource = self crawlList.register(UINib(nibName: "CrawlCell", bundle: nil), forCellReuseIdentifier: "CrawlCell") topBar.layer.cornerRadius = 2.5 } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) } override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) } @IBAction func closeSheet(_ sender: Any) { NotificationCenter.default.post(name: NSNotification.Name(rawValue: "closeSheet"), object: nil) } func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { let id = self.crawls[indexPath.row].id let userInfo: [String: String] = ["crawlId": id] NotificationCenter.default.post(name: NSNotification.Name(rawValue: "crawlTapped"), object: nil, userInfo: userInfo) } func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return Crawls.allCrawls.count } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = self.crawlList.dequeueReusableCell(withIdentifier: "CrawlCell") as! CrawlCell let crawl = self.crawls[indexPath.row] cell.crawlName.text = crawl.data.name cell.crawlDuration.text = "Duration: \(crawl.data.timeframe)" let bars = CrawlRepository.getAllBarsForCrawlId(id: crawl.id) cell.crawlBars.text = "Bars: \(getConcatenatedBarNames(bars: bars))" return cell } func getConcatenatedBarNames(bars: Array<Bar>) -> String { var barNames = Array<String>() for bar in bars { barNames.append(bar.data.name) } return barNames.joined(separator: ", ") } }
[ -1 ]
4615674c354dd19b4ede214e3de3d45a8167582f
ca4260c53030b79e65cfa0c39ca9b0cea32efaff
/MoviesStore/DetailsPageViewController.swift
960a096c3d29d3fec5bac82335fb8c6e308789ad
[]
no_license
MohamedKhaled563/MoviesStore
d44bfaab65589ebe48a36157eb8cca9f0d99cfa5
269f4b64dfcdbc93d86a8b208d41670257571a4d
refs/heads/main
2023-02-27T02:02:19.061970
2021-02-03T22:45:02
2021-02-03T22:45:02
332,525,928
0
0
null
null
null
null
UTF-8
Swift
false
false
2,356
swift
// // DetailsPageViewController.swift // MoviesStore // // Created by Mohamed Khalid on 18/01/2021. // import UIKit import CoreData import SDWebImage protocol DetailsPageViewControllerDelegate: class { // func detailsPageViewControllerDelegateRequireDetails(_ controller: DetailsPageViewController) -> MovieDetails func detailsPageViewControllerDelegateRequireDetails(_ controller: DetailsPageViewController) -> NSManagedObject } class DetailsPageViewController: UIViewController { @IBOutlet weak var titleLabel: UILabel! @IBOutlet weak var imageLabel: UILabel! @IBOutlet weak var movieImageView: UIImageView! @IBOutlet weak var ratingLabel: UILabel! @IBOutlet weak var releaseYearLabel: UILabel! @IBOutlet weak var genreLabel: UILabel! weak var delegate: DetailsPageViewControllerDelegate? // var movieDetails: MovieDetails? var movieDetails: NSManagedObject? override func viewDidLoad() { super.viewDidLoad() print("Scene loaded") movieDetails = delegate?.detailsPageViewControllerDelegateRequireDetails(self) putDataOnScreen() print ("title: \(movieDetails?.value(forKey: "title") ?? "")") // Do any additional setup after loading the view. } // MARK:- Helpers // func putDataOnScreen(){ // titleLabel.text?.append(movieDetails?.title ?? "") // // TODO:- Add image download pod and download image in and put it in the view // ratingLabel.text?.append("\(movieDetails?.rating ?? 0)" ) // releaseYearLabel.text?.append("\(movieDetails?.releaseYear ?? 0)" ) // genreLabel.text?.append(movieDetails?.genre.joined(separator: ", ") ?? "") titleLabel.text?.append("\(movieDetails?.value(forKey: "title" ) ?? "")") // TODO:- Add image download pod and download image in and put it in the view let movieURL = movieDetails?.value(forKey: "image") as? String movieImageView.sd_setImage(with: URL(string: movieURL ?? ""), placeholderImage: UIImage(named: "movieImage.png")) ratingLabel.text?.append("\(movieDetails?.value(forKey: "rating") ?? 0)" ) releaseYearLabel.text?.append("\(movieDetails?.value(forKey: "releaseYear") ?? 0)" ) genreLabel.text?.append("\(movieDetails?.value(forKey: "genre") ?? "")") } }
[ -1 ]
ffb54fcc070e1d0ed2405329b4875a13896161a8
b0cf06a65d86c539659414ee2b6656e1717223b9
/WikiSearch/WikiSearch/ViewController.swift
8007c4af0ed1a6160086684ccfce19dc22337452
[]
no_license
Pedromag98/Movilesll
9f6adf85cf7b60ca8214379eca3bf9da4fb91193
eb7eda1d255bb6148dfda124c430653f08b03930
refs/heads/main
2023-05-16T12:32:12.502054
2021-05-26T07:18:41
2021-05-26T07:18:41
351,127,960
0
0
null
null
null
null
UTF-8
Swift
false
false
3,204
swift
// // ViewController.swift // WikiSearch // // Created by Mac8 on 12/05/21. // import UIKit import WebKit class ViewController: UIViewController { @IBOutlet weak var buscarTextField: UITextField! @IBOutlet weak var WebView: WKWebView! override func viewDidLoad() { super.viewDidLoad() if let urlWikipedia = URL(string: "https://upload.wikimedia.org/wikipedia/commons/thumb/1/1e/Wikipedia-logo-v2-es.svg/1200px-Wikipedia-logo-v2-es.svg.png"){ WebView.load(URLRequest(url: urlWikipedia)) } } @IBAction func buscaPalabraButton(_ sender: UIButton) { buscarTextField.resignFirstResponder() guard let palabraABuscar = buscarTextField.text else { return } buscarWikipedia(palabras: palabraABuscar) } func buscarWikipedia(palabras: String){ if let urlAPI = URL(string: "https://es.wikipedia.org/w/api.php?action=query&prop=extracts&format=json&titles=\(palabras.replacingOccurrences(of: " ", with: "%20"))") { let peticion = URLRequest(url: urlAPI) let tarea = URLSession.shared.dataTask(with: peticion) { [self] (datos, respuesta, err) in if err != nil { print(err?.localizedDescription) } else { do { let objJson = try JSONSerialization.jsonObject(with: datos!, options: JSONSerialization.ReadingOptions.mutableContainers) as AnyObject let querySubJson = objJson["query"] as! [String: Any] let pagesSubJson = querySubJson["pages"] as! [String: Any] let pageId = pagesSubJson.keys if pageId.contains("-1") == true { if let urlOOps = URL(string: "https://www.123dreamit.com/static/new_dream/img/no-resultados.png"){ DispatchQueue.main.async { WebView.load(URLRequest(url: urlOOps)) } } } else { let llaveExtracto = pageId.first! let idSubJson = pagesSubJson[llaveExtracto] as! [String: Any] let extracto = idSubJson["extract"] as? String //Imprimir en la Interfaz Grafica WebView DispatchQueue.main.async { self.WebView.loadHTMLString(extracto ?? "No se obtuvieron resultados", baseURL: nil) } } } catch { print("Error al procesar el JSON\(err?.localizedDescription)") } } } tarea.resume() } } }
[ -1 ]
fdb98711bc90f2373c8d63c8ef21a62e2eea910c
63dc1042858ebb935a6638d4a0127688e0904692
/SwiftyUtils Example/iOS Example/Classes/OthersExampleViewController.swift
9bf8fce2493b46a69cfdec0ed0a222fb080b2758
[ "MIT" ]
permissive
aotr/SwiftyUtils
9bec0da45cb7b859c567ec7ce55467f1c6c5e383
14e5808c0e8ce616b0338c2772c7280b89ee52e0
refs/heads/master
2021-07-10T10:06:31.336767
2017-10-10T09:26:15
2017-10-10T09:26:15
106,405,313
2
0
null
2017-10-10T10:57:24
2017-10-10T10:57:24
null
UTF-8
Swift
false
false
1,820
swift
// // Created by Tom Baranes on 24/11/15. // Copyright © 2015 Tom Baranes. All rights reserved. // import UIKit import SwiftyUtils final class OthersExampleViewController: UIViewController { // fromNib // NSMutableAttributedstring @IBOutlet weak var labelAppVersion: UILabel! { didSet { labelAppVersion.text = String(format: "App version: %@", Bundle.main.appVersion) } } @IBOutlet weak var labelAppBuild: UILabel! { didSet { labelAppBuild.text = String(format: "App build: %@", Bundle.main.appBuild) } } @IBOutlet weak var labelScreenOrientation: UILabel! { didSet { let isPortrait = UIInterfaceOrientationIsPortrait(UIScreen.currentOrientation) let orientation = isPortrait ? "portrait" : "landscape" labelScreenOrientation.text = String(format: "Screen orientation: %@", orientation) } } @IBOutlet weak var labelScreenSize: UILabel! { didSet { labelScreenSize.text = String(format: "Screen width: %.f, screen height: %.f", UIScreen.size.width, UIScreen.size.height) } } @IBOutlet weak var labelStatusBarHeight: UILabel! { didSet { labelStatusBarHeight.text = String(format: "Status bar height: %.f", UIScreen.statusBarHeight) } } @IBOutlet weak var labelScreenHeightWithoutStatusBar: UILabel! { didSet { let text = String(format: "Screen height without status bar: %.f", UIScreen.heightWithoutStatusBar) labelScreenHeightWithoutStatusBar.text = text } } override func viewDidLoad() { super.viewDidLoad() } }
[ -1 ]
4d86287bad555b28d0d5bc30d5d6988c8926746e
bedd6c4e4e8cbcdaa9e94a0889c87e9535e68452
/BaseBallScore/Model/Team.swift
c24a4283151c91ff8d63346c634208f28758df2e
[]
no_license
YujiHamada/BaseBallScore
a617a940843412d41ddd82339f3d1df0267c027e
633fe639d438fd9565c7d6a2e2406da438106a9c
refs/heads/master
2020-03-15T10:04:16.228606
2018-06-16T10:13:47
2018-06-16T10:13:47
132,091,129
0
0
null
null
null
null
UTF-8
Swift
false
false
511
swift
// // Team.swift // BaseBallScore // // Created by 濱田裕史 on 2018/04/28. // Copyright © 2018年 濱田裕史. All rights reserved. // import Foundation class Team: RealmUtilObject { @objc dynamic var id:String = NSUUID().uuidString @objc dynamic var name:String? @objc dynamic var created: Double = NSDate().timeIntervalSince1970 @objc dynamic var updated: Double = NSDate().timeIntervalSince1970 override static func primaryKey() -> String? { return "id" } }
[ -1 ]
457afa4f4153169af4333dfd8e53b005192eb418
26856ddf3f84da25ed069599409423bc004beda7
/tooth-ninja/tooth-ninja/Configuration/GameConfiguration.swift
2a5c708c0ba6da30ef47c84ec3c48c396d0e9002
[ "MIT" ]
permissive
kushagraVashisht/tooth-ninja
8ed24ecfa87928ba156863b208cd11d8fa28776e
d23640346255838bedab15ce557792266962dab0
refs/heads/master
2020-03-22T21:56:37.463183
2018-07-12T12:38:11
2018-07-12T12:38:11
null
0
0
null
null
null
null
UTF-8
Swift
false
false
2,424
swift
// // Created by David Lopez on 10/6/18. // Copyright (c) 2018 David Lopez. All rights reserved. // import Foundation import SpriteKit /* Decodable struct to be able to use JSONDecoder to parse */ struct GameConfigurationDecodable: Decodable { var speed: Double var size: Double var levels: [LevelConfig] struct LevelConfig: Decodable { var id: Int var teeth: [GameObjectConfig] var bacteria: [GameObjectConfig] var food: [GameObjectConfig] struct GameObjectConfig: Decodable { var name: String var kind: String? var position_x: Double? var position_y: Double? var position_z: Int var size_width: Double var size_height: Double var image: String } } } /* JSONLevelParser class provides methods to parse JSON files and creating a GameElementFactory for */ class GameConfiguration { static var screenSize: CGSize? let parsed: GameConfigurationDecodable init(file: String, size: CGSize) throws { GameConfiguration.screenSize = size let data = try GameConfiguration.readJSON(fileName: file) let decoder = JSONDecoder() parsed = try decoder.decode(GameConfigurationDecodable.self, from: data!) } static func readJSON (fileName: String) throws -> Data? { if let path = Bundle.main.path(forResource: fileName, ofType: "json") { let data = try Data(contentsOf: URL(fileURLWithPath: path), options: .mappedIfSafe) return data } return nil } /* Shameful redundancy happening below */ /* TODO (2): Abstract these functions */ func getTeethByLevel(id: Int) -> [GameObject] { var array: [GameObject] = [] for tooth in parsed.levels[id - 1].teeth { array.append(GameObject(type: GameObjectType.Tooth, properties: tooth)) } return array } func getObjectsByLevel(id: Int) -> [GameObject] { var array: [GameObject] = [] for bacteria in parsed.levels[id - 1].bacteria { print(bacteria) array.append(GameObject(type: GameObjectType.Other, properties: bacteria)) } for food in parsed.levels[id - 1].food { print(food) array.append(GameObject(type: GameObjectType.Other, properties: food)) } return array } }
[ -1 ]
b5ea3f88c9765ccd10e519787520155f8bb0791d
6d651447ff0924b7f2c76801cb1edf65b4d3b16d
/BinaryAddition/TableViewController.swift
6acc05618418b5d16f2db6950844977a728cae4e
[]
no_license
thisolivier/iOSTraining-BinaryAddition
f06c8a6722dd6f19bfabb268539753ac192aee0a
fb1b3828de969724e5b920d8e1592a40886acb55
refs/heads/master
2021-06-27T12:21:38.533617
2017-09-15T06:21:14
2017-09-15T06:21:14
103,611,946
0
0
null
null
null
null
UTF-8
Swift
false
false
221
swift
// // ViewController.swift // BinaryAddition // // Created by Olivier Butler on 14/09/2017. // Copyright © 2017 Olivier Butler. All rights reserved. // import UIKit class CustomTableViewController: UITableView{ }
[ -1 ]
e6a4191a04900c90b39506c4e264cdecd51b46d8
b1b9f64e9133ccbed03ed57c6ba7d6941229009b
/DDJDStoreSwift/Common/PublicAPPRelated.swift
ae6dc6a8f588e408b1063c9b74a15dcff06f3355
[]
no_license
xxpenghao1-ios/DDJDStoreSwift
4afd56b033ec63f5fe0a33836e95ded6769a59fe
fe17bbca397be3de7890bc9a78c6818170432f65
refs/heads/master
2020-03-13T18:12:45.653883
2018-08-17T08:49:29
2018-08-17T08:49:29
131,116,940
0
0
null
null
null
null
UTF-8
Swift
false
false
1,958
swift
// // PublicAPPRelated.swift // DDJDStoreSwift // // Created by hao peng on 2018/4/26. // Copyright © 2018年 zldd. All rights reserved. // import UIKit ///图片请求路径 let HTTP_URL_IMG="http://www.hnddjd.com"; //http://www.hnddjd.com/front/ ///c.hnddjd.com ///数据请求路径 let HTTP_URL="http://www.hnddjd.com/front/"; /// 屏幕宽 let SCREEN_WIDTH=UIScreen.main.bounds.width /// 屏幕高 let SCREEN_HEIGH=UIScreen.main.bounds.height /// 导航栏高度 let NAV_HEIGHT:CGFloat=SCREEN_HEIGH==812.0 ? 88 : 64 /// 底部安全距离 let BOTTOM_SAFETY_DISTANCE_HEIGHT:CGFloat=SCREEN_HEIGH==812.0 ? 34 : 0 /// tabBar高度 let TAB_BAR_HEIGHT:CGFloat=SCREEN_HEIGH==812.0 ? 83 : 49 /// 全局缓存 let USER_DEFAULTS=UserDefaults.standard /// 商品默认图片 let GOOD_DEFAULT_IMG="good_defualt" /// 幻灯片默认图片 let SLIDE_DEFAULT="slide_defualt" let APP=UIApplication.shared.delegate as! AppDelegate ///是否是iPhone_5 true是 let iPhone_5=SCREEN_WIDTH==320.0 ? true : false ///是否是iPhone_6 true是 let iPhone_6=SCREEN_WIDTH==375.0 ? true : false ///是否是iPhone_6Plus以上屏幕 true是 let iPhone_6Plus=SCREEN_WIDTH > 375.0 ? true : false ///获取县区id var county_Id:String?{ get{ return USER_DEFAULTS.object(forKey:"countyId") as? String } } ///店铺id var store_Id:String?{ get{ return USER_DEFAULTS.object(forKey:"storeId") as? String } } ///会员id var member_Id:String?{ get{ return USER_DEFAULTS.object(forKey:"memberId") as? String } } ///分站id var substation_Id:String?{ get{ return USER_DEFAULTS.object(forKey:"substationId") as? String } } // 自定义打印方法 func phLog<T>(_ message : T, file : String = #file, funcName : String = #function, lineNum : Int = #line) { #if DEBUG let fileName = (file as NSString).lastPathComponent print("\(fileName):\(funcName):(\(lineNum)line)-\(message)") #endif }
[ -1 ]
b2ccc3ae4f3116bdf11514d9a3161a8f98225d73
b6c8e45cd4a555c84d0067b7869f3f5d4a5e108e
/MyoPiano/ViewController.swift
90c7e0abd5a34ebbc82c8feeed5257e622c97550
[]
no_license
PRAN1999/MyoPiano
88d1cedac66286fe3a65bda633083e6146abe8fe
bc5749251f102f251b8f22b0dc340009d0f44fab
refs/heads/master
2020-03-09T03:02:19.837849
2018-04-09T19:19:35
2018-04-09T19:19:35
128,555,459
1
0
null
null
null
null
UTF-8
Swift
false
false
16,390
swift
// // ViewController.swift // MyPianoiOS // // Created by Pranay Neelagiri on 4/6/18. // Copyright © 2018 Pranay Neelagiri. All rights reserved. // import UIKit import AVFoundation extension String { var lines: [String] { var result: [String] = [] enumerateLines { line, _ in result.append(line) } return result } } class ViewController : UIViewController, UIGestureRecognizerDelegate { var currentPose: TLMPose! //All outlets to keys and UI features @IBOutlet weak var libToolbar: UIToolbar! @IBOutlet weak var connectToolbar: UIToolbar! @IBOutlet weak var pianoView: UIView! @IBOutlet weak var connectionItem: UIBarButtonItem! @IBOutlet weak var libraryButton: UIBarButtonItem! @IBOutlet weak var recordingLabel: UIBarButtonItem! @IBOutlet weak var key1: UIView! @IBOutlet weak var key2: UIView! @IBOutlet weak var key3: UIView! @IBOutlet weak var key4: UIView! @IBOutlet weak var key5: UIView! @IBOutlet weak var key6: UIView! @IBOutlet weak var key7: UIView! @IBOutlet weak var key8: UIView! @IBOutlet weak var key9: UIView! @IBOutlet weak var key10: UIView! @IBOutlet weak var key11: UIView! @IBOutlet weak var key12: UIView! @IBOutlet weak var key13: UIView! @IBOutlet weak var key14: UIView! var isRecording:Bool = false var isConnected:Bool = false var canMove = true //2D arrays for holding EMG data, and their corresponding "fill" flags var arr1: [Float] = [], arr2: [Float] = [] var means: [Float] = [] var stds: [Float] = [] var ct1 = 0, ct2 = 0 var arr2Fill: Bool = false //Arrays and sets to keep track of the key(s) being pressed, //and the audio that goes with them var keys: [UIView]! // activeKeys: [UIView]! = [] var map: [Int:String]! var pressedKey:UIView! var sounds: [String:AVAudioPlayer]! var track : [String]! //Used to keep track of horizontal motion through acceleration data var activeStart:Int!, pressed:Int! = -1 var lastPosition: Double = 5.0 override func viewDidLoad() { super.viewDidLoad() let notifier = NotificationCenter.default // Data notifications are received through NSNotificationCenter. // Posted whenever a TLMMyo connects notifier.addObserver(self, selector: #selector(ViewController.didConnectDevice(_:)), name: NSNotification.Name.TLMHubDidConnectDevice, object: nil) // Posted whenever a TLMMyo disconnects. notifier.addObserver(self, selector: #selector(ViewController.didDisconnectDevice(_:)), name: NSNotification.Name.TLMHubDidDisconnectDevice, object: nil) //Create an observer for recieving EMG data notifier.addObserver(self, selector: #selector(ViewController.didReceiveEMGChange(_:)), name: NSNotification.Name.TLMMyoDidReceiveEmgEvent, object: nil) notifier.addObserver(self, selector: #selector(ViewController.didRecieveGyroscopeData(_:)), name: NSNotification.Name.TLMMyoDidReceiveGyroscopeEvent, object: nil) let timer = Timer.scheduledTimer(timeInterval: 0.5, target: self, selector: #selector(self.updateGyro), userInfo: nil, repeats: true) timer.fire() //Create an gesture recognizer to hide and show the top and bottom toolbars let tap = UITapGestureRecognizer(target: self, action: #selector(self.tap(_:))) tap.delegate = self pianoView.addGestureRecognizer(tap) connectToolbar.isTranslucent = true libToolbar.isTranslucent = true keys = [key1, key2, key3, key4, key5, key6, key7, key8, key9, key10, key11, key12, key13, key14] map = [0: "C3", 1: "D3", 2: "E3", 3: "F3", 4: "G3", 5: "A3", 6: "B3", 7: "C4", 8: "D4", 9: "E4", 10: "F4", 11: "G4", 12: "A4", 13: "B4"] sounds = [String:AVAudioPlayer]() do { try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayback) try AVAudioSession.sharedInstance().setActive(true) } catch let error as NSError { print(error.description) } var i:Int = 0 for key in keys { key.layer.borderColor = UIColor.black.cgColor key.layer.borderWidth = 0.7 let path = Bundle.main.path(forResource: map[i]!, ofType: "mp3") let url = URL(fileURLWithPath: path!) do { sounds[map[i]!] = try AVAudioPlayer(contentsOf: url, fileTypeHint: AVFileType.mp3.rawValue) sounds[map[i]!]?.prepareToPlay() } catch let error as NSError { print(error.description) } i += 1 } //Read from mean.txt and std.txt to create the normalization arrays let meanPath = Bundle.main.path(forResource: "pop_mean-2", ofType: "txt") let meanURL = URL(fileURLWithPath: meanPath!) let stdPath = Bundle.main.path(forResource: "pop_std-2", ofType: "txt") let stdURL = URL(fileURLWithPath: stdPath!) do { let meanText = try String(contentsOf: meanURL, encoding: String.Encoding.utf8) let stdText = try String(contentsOf: stdURL, encoding: String.Encoding.utf8) let meanStrings = meanText.lines for string in meanStrings { means.append(Float(string)!) } let stdStrings = stdText.lines for string in stdStrings { stds.append(Float(string)!) } } catch let error as Error { print(error.localizedDescription) } activeStart = 5 updateKeys() //updatePressedKey(7) Model.loadGraph() } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() } @IBAction func didTapSettings(_ sender: AnyObject) { // Settings view must be in a navigation controller when presented let controller = TLMSettingsViewController.settingsInNavigationController() present(controller!, animated: true, completion: nil) } @objc func tap(_ gestureRecognizer: UITapGestureRecognizer) { UIView.animate(withDuration: 2, animations: { () -> Void in self.connectToolbar.isHidden = !self.connectToolbar.isHidden self.libToolbar.isHidden = !self.libToolbar.isHidden }) } // MARK: NSNotificationCenter Methods @objc func didConnectDevice(_ notification: Notification) { // Access the connected device. let userinfo = notification.userInfo let myo:TLMMyo = (userinfo![kTLMKeyMyo] as? TLMMyo)! print("Connected to %@.", myo.name); connectionItem.title = "Connected" isConnected = true myo.setStreamEmg(TLMStreamEmgType.enabled) } @objc func didDisconnectDevice(_ notification: Notification) { // Access the disconnected device. let userinfo = notification.userInfo let myo:TLMMyo = (userinfo![kTLMKeyMyo] as? TLMMyo)! print("Disconnected from %@.", myo.name); isConnected = false connectionItem.title = "Disconnected" } @objc func predictAndPlay(_ inputArray: [Float]) { //Send data to the TensorFlow model to be processed var arrayCopy = inputArray for i in 0..<arrayCopy.count { arrayCopy[i] = (arrayCopy[i] - means[i]) / stds[i] } let resultIndex = Model.predict(UnsafeMutablePointer<Float>(&arrayCopy)) - 1 if(resultIndex >= 0) { let keyIndex: Int = activeStart + Int(resultIndex) sounds[map[keyIndex]!]?.play() if(isRecording) { print(keyIndex) track.append(map[keyIndex]!) } updatePressedKey(keyIndex) } else { //Update the key, but we do not want a sound to be played updatePressedKey(-1) if(isRecording) { track.append("rest") } } } @objc func predictAndPlayThresh(_ inputArray: [Float]) { //Send data to the TensorFlow model to be processed var arrayCopy = inputArray // for i in 0..<arrayCopy.count { //// arrayCopy[i] = (arrayCopy[i] - means[i]) / stds[i] // } var chosenKeyIndex: Int = 0 var highHighResults: [Bool] = predictCrude(arrayCopy, 20, 45) var highResults: [Bool] = predictCrude(arrayCopy, 20, 40) var results: [Bool] = predictCrude(arrayCopy, 20, 30) var moderateResults: [Bool] = predictCrude(arrayCopy, 15, 20) var foundKey: Bool = false if(results[0]) { //Index finger if(highHighResults[3]) { chosenKeyIndex = 1 foundKey = true } else if (moderateResults[7]) { //Middle chosenKeyIndex = 2 foundKey = true } } if(!foundKey) { //Pinkie if(results[1]) { chosenKeyIndex = 4 } //Thumb else if(highResults[2]) { chosenKeyIndex = 0 } //None else { chosenKeyIndex = -1 } } print(chosenKeyIndex) if(chosenKeyIndex >= 0) { let keyIndex: Int = activeStart + Int(chosenKeyIndex) sounds[map[keyIndex]!]?.play() if(isRecording) { print(keyIndex) track.append(map[keyIndex]!) } updatePressedKey(keyIndex) } else { //Update the key, but we do not want a sound to be played updatePressedKey(-1) if(isRecording) { track.append("rest") } } } @objc func didReceiveEMGChange(_ notification:Notification) { var userInfo = notification.userInfo let data = userInfo![kTLMKeyEMGEvent] as! TLMEmgEvent arr1 += (data.rawData as! [Float]) ct1+=1 if(!arr2Fill) { if(ct1 < 50) { return } else { arr2Fill = true } } arr2 += (data.rawData as! [Float]) ct2+=1 if(ct1 == 100) { //Send data to the TensorFlow model to be processed predictAndPlayThresh(arr1) //Reset array arr1 = [] ct1 = 0 } else if(ct2 == 100) { //Send data to the TensorFlow model to be processed predictAndPlayThresh(arr2) //Reset array arr2 = [] ct2 = 0 } } //Gives crude predictions for which electrodes are activated @objc func predictCrude(_ emgData: [Float], _ thresh: Float, _ numThreshRequired: Int) -> [Bool] { var retValues: [Bool] = [] for electrode in 0..<8 { var numPastThresh: Int = 0 for point in stride(from: electrode, to: 800, by: 8) { let data: Float = emgData[point] if(data > thresh || data < -1*thresh) { numPastThresh += 1 } } // print(numPastThresh) if(numPastThresh > numThreshRequired) { retValues.append(true) } else { retValues.append(false) } } return retValues } //When acceleration data is recieved, update timestamp, velocity, and position @objc func didRecieveGyroscopeData(_ notification: Notification) { if(canMove) { //Handle acceleration data let userInfo = notification.userInfo let data = userInfo![kTLMKeyGyroscopeEvent] as! TLMGyroscopeEvent let yGyro = data.vector.y // print(yGyro) if(abs(data.vector.x) > 30 || abs(data.vector.z) > 30) { return } let possibleStartActive = Float(lastPosition) + (yGyro+5) / 10 activeStart = Int(possibleStartActive) activeStart = activeStart > 9 ? 9 : activeStart activeStart = activeStart < 0 ? 0 : activeStart lastPosition = Double(activeStart) updateKeys() canMove = false } } @objc func updateGyro() { canMove = true } @IBAction func toggleRecord() { if(isRecording) { stopRecording() if(isConnected) { createSound(soundFiles: track, outputFile: "test") track = [] } isRecording = false } else { startRecording() isRecording = true } } func changeActiveKey(activeStart: Int) { self.activeStart = activeStart } //Update the color of the key actually being pressed (the one predicted //by the model) func updatePressedKey(_ activeIndex: Int) { for i in activeStart...(activeStart+4) { let key: UIView = keys[i] if(i == activeIndex) { key.backgroundColor = UIColor(red: 167.0/255, green: 187.0/255, blue: 236.0/255, alpha: 1.0) } else { key.backgroundColor = UIColor(red: 199.0/255, green: 211.0/255, blue: 242.0/255, alpha: 1.0) } } } //Update the color so that all the "active keys" (i.e. the ones that //the player can play) are activated and everything else is deactivated func updateKeys() { for i in 0...13 { let key: UIView = keys[i] if(i < activeStart || i > activeStart + 4) { key.backgroundColor = UIColor(red: 231.0/255, green: 236.0/255, blue: 249.0/255, alpha: 1.0) } else { key.backgroundColor = UIColor(red: 199.0/255, green: 211.0/255, blue: 242.0/255, alpha: 1.0) } } } //Generates an audio file by concatenating all the //audio filenames given in list provided func createSound(soundFiles: [String], outputFile: String) { var startTime: CMTime = kCMTimeZero let composition: AVMutableComposition = AVMutableComposition() let compositionAudioTrack: AVMutableCompositionTrack = composition.addMutableTrack(withMediaType: AVMediaType.audio, preferredTrackID: kCMPersistentTrackID_Invalid)! for fileName in soundFiles { let sound: String = Bundle.main.path(forResource: fileName, ofType: "mp3")! let url: URL = URL(fileURLWithPath: sound) let avAsset: AVURLAsset = AVURLAsset(url: url) let timeRange: CMTimeRange = CMTimeRangeMake(kCMTimeZero, avAsset.duration) let audioTrack: AVAssetTrack = avAsset.tracks(withMediaType: AVMediaType.audio)[0] try! compositionAudioTrack.insertTimeRange(timeRange, of: audioTrack, at: startTime) startTime = CMTimeAdd(startTime, timeRange.duration) } let exportPath: String = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0].path+"/"+outputFile+".m4a" let export: AVAssetExportSession = AVAssetExportSession(asset: composition, presetName: AVAssetExportPresetAppleM4A)! export.outputURL = URL(fileURLWithPath: exportPath) export.outputFileType = AVFileType.m4a export.exportAsynchronously { if export.status == AVAssetExportSessionStatus.completed { NSLog("All done creating audio file!!!"); } } } func startRecording() { recordingLabel.image = UIImage(named: "stop") isRecording = true } func stopRecording() { recordingLabel.image = UIImage(named: "recording") isRecording = false } }
[ -1 ]
590149dd6606512b881344f93ebad4430f34767a
5828db82fb2b55b2ea16ea759bac70457df3b277
/Flake/WrongPasswordView.swift
fa156064eb7794ce7c096291b6bf94232023c807
[]
no_license
cenamorado3/Flake
068afd2348ae2db18dd899fc0753d5cdf0897ee8
913a341a659767fe0320ab5ad082b2d8826da7f1
refs/heads/main
2023-08-23T04:43:55.045959
2021-11-02T21:09:25
2021-11-02T21:09:25
421,710,360
0
0
null
null
null
null
UTF-8
Swift
false
false
1,542
swift
// // WrongPasswordView.swift // Flake // // Created by Christian Enamorado on 10/27/21. // import SwiftUI struct WrongPasswordView: View { @State private var username: String = "" @State private var pw: String = "" var body: some View { NavigationView{ Color.blue.ignoresSafeArea() VStack{ HStack{ TextField( "User name", text: $username ) .background(.thinMaterial) .scenePadding() .multilineTextAlignment(.center) SecureField( "Password", text: $pw ) .background(.thinMaterial) .scenePadding() .multilineTextAlignment(.center) } NavigationLink("Login", destination: Home(closure: { guard username == "A" && pw == "*" else { return false } return true })) .foregroundColor(.mint) } } } } struct WrongPasswordView_Previews: PreviewProvider { static var previews: some View { WrongPasswordView() } }
[ -1 ]
bd046bbf18d106dee947d9d62baf92ad869d311d
658bb98d8eae7d426bdaa03673518ff8ac00ef95
/EP QTc/Controllers/CalculatorViewController.swift
30ba5eb9fda0dbaab7875164583c23caae585fdb
[ "MIT", "Apache-2.0" ]
permissive
mannd/EP-QTc
ce5b3191e5b50ae5dce2f3bbacf6f58fb5f91a3a
362c1563a89739ea73515a8cbfd0b79950391793
refs/heads/master
2021-08-16T13:23:46.136426
2021-06-08T01:40:41
2021-06-08T01:40:41
115,071,240
1
0
null
null
null
null
UTF-8
Swift
false
false
19,911
swift
// // CalculatorViewController.swift // EP QTc // // Created by David Mann on 12/2/17. // Copyright © 2017 EP Studios. All rights reserved. // import UIKit import Validator import QTc import SafariServices // Best way to dismiss keyboard on tap on view. // See https://stackoverflow.com/questions/32281651/how-to-dismiss-keyboard-when-touching-anywhere-outside-uitextfield-in-swift extension UIViewController { func hideKeyboard() { let tap: UITapGestureRecognizer = UITapGestureRecognizer( target: self, action: #selector(UIViewController.dismissKeyboard)) view.addGestureRecognizer(tap) } @objc func dismissKeyboard() { view.endEditing(true) } func stringToDouble(_ string: String?) -> Double? { guard let string = string else { return nil } return string.stringToDouble() } func showCopyToClipboardDialog(inCSVFormat: Bool = false) { let message = String(format: "The data on this screen has been copied in %@ format to the system clipboard. You can switch to another application and paste it for further analysis.", inCSVFormat ? "CSV" : "text") let dialog = UIAlertController(title: "Data copied to clipboard", message: message, preferredStyle: .alert) dialog.addAction(UIAlertAction(title: "OK", style: .cancel, handler: nil)) self.present(dialog, animated: true) } @IBAction func showHelp(_ sender: Any) { performSegue(withIdentifier: "helpSegue", sender: self) } } // This version of stringToDouble respects locale // (i.e. 140.4 OK in US, 140,4 OK in France extension String { func stringToDouble() -> Double? { let nf = NumberFormatter() guard let number = nf.number(from: self) else { return nil } return number.doubleValue } } extension FormulaType { var name: String { get { switch self { case .qtc: return "QTc" case .qtp: return "QTp" } } } } class CalculatorViewController: UIViewController, UITextFieldDelegate { // All the controls on the calculator form @IBOutlet var scrollView: UIScrollView! @IBOutlet var unitsSegmentedControl: UISegmentedControl! @IBOutlet var qtTextField: CalculatorTextField! @IBOutlet var intervalRateSegmentedControl: UISegmentedControl! @IBOutlet var intervalRateTextField: CalculatorTextField! @IBOutlet var sexLabel: UILabel! @IBOutlet var sexSegmentedControl: UISegmentedControl! @IBOutlet var ageLabel: UILabel! @IBOutlet var ageTextField: AgeTextField! @IBOutlet var qtUnitsLabel: UILabel! @IBOutlet var intervalRateUnitsLabel: UILabel! @IBOutlet var optionalInformationLabel: UILabel! weak var viewController: UITableViewController? private let msecText = "msec" private let secText = "sec" private let bpmText = "bpm" private let qtHintInMsec = "QT (msec)" private let qtHintInSec = "QT (sec)" private let intervalRateHintInMsec = "RR (msec)" private let intervalRateHintInSec = "RR (sec)" private let intervalRateHintInBpm = "Heart rate (bpm)" private let invalidFieldsMessage = "Empty or invalid field(s)" private let badValuesMessage = "Zero or negative value(s)" private let ageOutOfRangeMessage = "Oldest human died at age 122" private let intervalOutOfRangeMessage = "Seems like your intervals are a bit too long" private let maxAge = 123.0 private let maxInterval = 10_000.0 private var activeField: UITextField? = nil private var errorMessage = "" private var units: Units = .msec private var intervalRateType: IntervalRateType = .interval private var formulaType: FormulaType? enum EntryErrorCode { case invalidEntry case zeroOrNegativeEntry case ageOutOfRange case intervalOutOfRange case noError } override func viewDidLoad() { super.viewDidLoad() // Transitions on mac look better without animation. UIView.setAnimationsEnabled(systemType() == .iOS) setupButtons() // if systemType() == .mac { // // Change toolbar buttons // // Remove help and prefs buttons: // // Note: must remove in reverse order, or index out of range! // toolbarItems?.remove(at: 8) // toolbarItems?.remove(at: 7) // toolbarItems?.remove(at: 6) // toolbarItems?.remove(at: 5) // } qtTextField.delegate = self intervalRateTextField.delegate = self ageTextField.delegate = self qtTextField.validateOnInputChange(enabled: true) qtTextField.validationHandler = { result in self.qtTextField.updateValidationState(result: result) } intervalRateTextField.validateOnInputChange(enabled: true) intervalRateTextField.validationHandler = { result in self.intervalRateTextField.updateValidationState(result: result) } ageTextField.validateOnInputChange(enabled: true) ageTextField.validationHandler = { result in self.ageTextField.updateValidationState(result: result) } qtTextField.placeholder = qtHintInMsec intervalRateTextField.placeholder = intervalRateHintInMsec let separator = NSLocale.current.decimalSeparator ?? "." // regex now prohibits negative values, 0, and things like 0.0, i.e. only positive floats accepted // see https://stackoverflow.com/questions/8910972/regex-exclude-zero let localizedPattern = String(format:"^(?!0*(\\%@0+)?$)(\\d+|\\d*\\%@\\d+)$", separator, separator) let isNumberRule = ValidationRulePattern(pattern: localizedPattern, error: CalculatorValidationError(message: "Invalid number")) var rules = ValidationRuleSet<String>() rules.add(rule: isNumberRule) qtTextField.validationRules = rules intervalRateTextField.validationRules = rules ageTextField.validationRules = rules // About info button - don't show on mac if systemType() == .iOS { let aboutButton = UIButton(type: .infoLight) aboutButton.addTarget(self, action: #selector(showAbout), for: UIControl.Event.touchUpInside) self.navigationItem.rightBarButtonItem = UIBarButtonItem(customView: aboutButton) } // set up default units/intervalRate preferences when app starts let preferences = Preferences.retrieve() if let unitsMsec = preferences.unitsMsec, !unitsMsec { unitsSegmentedControl.selectedSegmentIndex = 1 unitsChanged(self) } if let heartRateAsInterval = preferences.heartRateAsInterval, !heartRateAsInterval { intervalRateSegmentedControl.selectedSegmentIndex = 1 intervalRateChanged(self) } } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) registerNotifications() hideKeyboard() view.becomeFirstResponder() self.navigationController?.setToolbarHidden(false, animated: false) } override func viewWillDisappear(_ animated: Bool) { super.viewWillDisappear(animated) NotificationCenter.default.removeObserver(self) } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } private func registerNotifications() { NotificationCenter.default.addObserver(self, selector: #selector(keyboardWasShown(_:)), name: UIResponder.keyboardWillShowNotification, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillBeHidden(_:)), name: UIResponder.keyboardWillHideNotification, object: nil) } func setupButtons() { toolbarItems?.removeAll() let spacer = UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil) toolbarItems?.append(UIBarButtonItem(title: "QTc", style: .plain, target: self, action: #selector(calculateQTc))) toolbarItems?.append(spacer) toolbarItems?.append(UIBarButtonItem(title: "QTp", style: .plain, target: self, action: #selector(calculateQTp))) toolbarItems?.append(spacer) toolbarItems?.append(UIBarButtonItem(title: "Clear", style: .plain, target: self, action: #selector(clear))) // Hide these buttons with mac (they are in the menu instead). if systemType() == .iOS { toolbarItems?.append(spacer) toolbarItems?.append(UIBarButtonItem(title: "Prefs", style: .plain, target: self, action: #selector(showPreferences(_:)))) toolbarItems?.append(spacer) toolbarItems?.append(UIBarButtonItem(title: "Help", style: .plain, target: self, action: #selector(showHelp(_:)))) } // toolbarItems?.append(UIBarButtonItem(title: "Reset", style: .plain, target: self, action: #selector(ResultsTableViewController.resetEdit))) // toolbarItems?.append(spacer) // toolbarItems?.append(UIBarButtonItem(title: "Cancel", style: .plain, target: self, action: #selector(ResultsTableViewController.cancelEdit))) } @objc func keyboardWasShown(_ notification: NSNotification) { guard let info = notification.userInfo, let activeField = activeField else { return } if let kbSize = (info[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue.size { let contentInsets = UIEdgeInsets(top: 0, left: 0, bottom: kbSize.height, right: 0) self.scrollView.contentInset = contentInsets self.scrollView.scrollIndicatorInsets = contentInsets var rect = self.view.frame rect.size.height -= kbSize.height if !rect.contains(activeField.frame.origin) { self.scrollView.scrollRectToVisible(activeField.frame, animated: true) } } } @objc func keyboardWillBeHidden(_ notification: NSNotification) { let contentInsets = UIEdgeInsets() self.scrollView.contentInset = contentInsets self.scrollView.scrollIndicatorInsets = contentInsets } @objc fileprivate func showAbout() { let about = About() about.show(viewController: self) } struct CalculatorValidationError: ValidationError { public let message: String public init(message m: String) { message = m } } @IBAction func unitsChanged(_ sender: Any) { switch unitsSegmentedControl.selectedSegmentIndex { case 0: units = .msec case 1: units = .sec default: units = .msec } switch units { case .msec: qtUnitsLabel.text = msecText qtTextField.placeholder = qtHintInMsec if intervalRateType == .interval { intervalRateUnitsLabel.text = msecText intervalRateTextField.placeholder = intervalRateHintInMsec } case .sec: qtUnitsLabel.text = secText qtTextField.placeholder = qtHintInSec if intervalRateType == .interval { intervalRateUnitsLabel.text = secText intervalRateTextField.placeholder = intervalRateHintInSec } } } @IBAction func intervalRateChanged(_ sender: Any) { switch intervalRateSegmentedControl.selectedSegmentIndex { case 0: intervalRateType = .interval case 1: intervalRateType = .rate default: intervalRateType = .interval } switch intervalRateType { case .interval: if units == .msec { intervalRateUnitsLabel.text = msecText intervalRateTextField.placeholder = intervalRateHintInMsec } else { intervalRateUnitsLabel.text = secText intervalRateTextField.placeholder = intervalRateHintInSec } case .rate: intervalRateUnitsLabel.text = bpmText intervalRateTextField.placeholder = intervalRateHintInBpm } } @IBAction func sexChanged(_ sender: Any) { sexLabel.isEnabled = !(sexSegmentedControl.selectedSegmentIndex == 0) updateOptionalInformationLabel() } @IBAction func ageChanged(_ sender: Any) { ageLabel.isEnabled = ageTextField.text != nil && !ageTextField.text!.isEmpty updateOptionalInformationLabel() } private func updateOptionalInformationLabel() { optionalInformationLabel.isEnabled = sexLabel.isEnabled || ageLabel.isEnabled } @IBAction func calculateQTc(_ sender: Any) { formulaType = .qtc prepareCalculation() } @IBAction func calculateQTp(_ sender: Any) { formulaType = .qtp prepareCalculation() } @IBAction func showPreferences(_ sender: Any) { performSegue(withIdentifier: "preferencesSegue", sender: self) } // @IBAction func showHelp(_ sender: Any) { // performSegue(withIdentifier: "helpSegue", sender: self) // } private func prepareCalculation() { let validationCode = fieldsValidationResult() var message = "" var error = true switch validationCode { case .invalidEntry: message = invalidFieldsMessage case .zeroOrNegativeEntry: message = badValuesMessage case .ageOutOfRange: message = ageOutOfRangeMessage case .intervalOutOfRange: message = intervalOutOfRangeMessage case .noError: error = false } // one last check to ensure no nulls or 0s sent over if error { showErrorMessage(message) return } performSegue(withIdentifier: "resultsTableSegue", sender: self) } private func fieldsValidationResult() -> EntryErrorCode { // Empty qt and interval fields will be considered invalid var resultCode: EntryErrorCode = .invalidEntry let qtIsValid = qtTextField.validate() == .valid let intervalRateIsValid = intervalRateTextField.validate() == .valid // Empty age field is OK let ageIsValid = ageTextField.text == nil || ageTextField.text!.isEmpty || ageTextField.validate() == .valid if qtIsValid && intervalRateIsValid && ageIsValid { resultCode = .noError } // Check for zero and negative values. if let qt = stringToDouble(qtTextField.text) { if qt <= 0 { resultCode = .zeroOrNegativeEntry } if qt > maxInterval { resultCode = .intervalOutOfRange } } if let rr = stringToDouble(intervalRateTextField.text) { if rr <= 0 { resultCode = .zeroOrNegativeEntry if rr > maxInterval { resultCode = .intervalOutOfRange } } } if let age = stringToDouble(ageTextField.text) { if age <= 0 { resultCode = .zeroOrNegativeEntry } if age >= maxAge { resultCode = .ageOutOfRange } } return resultCode } private func showErrorMessage(_ message: String) { let dialog = UIAlertController(title: "Error", message: message, preferredStyle: UIAlertController.Style.alert) dialog.addAction(UIAlertAction(title: "OK", style: .default, handler: nil)) self.present(dialog, animated: true, completion: nil) } @IBAction func clear(_ sender: Any) { clearFields() resetFieldBorder([qtTextField, intervalRateTextField, ageTextField]) } private func resetFieldBorder(_ textFields: [UITextField]) { for textField in textFields { textField.resetFieldBorder() } } private func clearFields() { qtTextField.text = "" intervalRateTextField.text = "" ageTextField.text = "" ageLabel.isEnabled = false sexSegmentedControl.selectedSegmentIndex = 0 // set sex to "unknown" sexLabel.isEnabled = false optionalInformationLabel.isEnabled = false } // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepare(for segue: UIStoryboardSegue, sender: Any?) { // Get the new view controller using segue.destinationViewController. // Pass the selected object to the new view controller. if segue.identifier == "preferencesSegue" || segue.identifier == "helpSegue" { return } // Final sanity check! if !finalValueCheck() { showErrorMessage(invalidFieldsMessage) return } let vc = segue.destination as! ResultsTableViewController let qt = stringToDouble(qtTextField.text) ?? 0 let rr = stringToDouble(intervalRateTextField.text) ?? 0 // these conditions are checked in validation and in finaValueCheck(), so should never happen! assert(qt > 0 && rr > 0) let units: Units = unitsSegmentedControl.selectedSegmentIndex == 0 ? .msec : .sec let intervalRateType: IntervalRateType = intervalRateSegmentedControl.selectedSegmentIndex == 0 ? .interval : .rate var sex: Sex = .unspecified switch sexSegmentedControl.selectedSegmentIndex { case 0: sex = .unspecified case 1: sex = .male case 2: sex = .female default: assertionFailure("Sex segmented control out of range.") } let age = stringToDouble(ageTextField.text) var intAge: Int? if let age = age { intAge = Int(age) } let qtMeasurement = QtMeasurement(qt: qt, intervalRate: rr, units: units, intervalRateType: intervalRateType, sex: sex, age: intAge) if valuesOutOfRange(qtMeasurement: qtMeasurement) { showErrorMessage("Heart rate or QT interval out of range.\nAllowed heart rates 20-250 bpm.\nAllowed QT intervals 200-800 msec.") return } vc.qtMeasurement = qtMeasurement vc.formulaType = formulaType } // assumes no null or negative fields func valuesOutOfRange(qtMeasurement: QtMeasurement) -> Bool { let minQT = 0.2 let maxQT = 0.8 let minRate = 20.0 let maxRate = 250.0 var outOfRange = false if qtMeasurement.heartRate() < minRate || qtMeasurement.heartRate() > maxRate { outOfRange = true } if let qt = qtMeasurement.qtInSec() { if qt < minQT || qt > maxQT { outOfRange = true } } else { outOfRange = true } return outOfRange } func finalValueCheck() -> Bool { // Don't ever send any nils, zeros or negative numbers to the poor calculators! let qt = stringToDouble(qtTextField.text) ?? 0 let rr = stringToDouble(intervalRateTextField.text) ?? 0 return qt > 0 && rr > 0 } // MARK: - Delegates func textFieldShouldReturn(_ textField: UITextField) -> Bool { self.view.endEditing(false) return true } func textFieldDidBeginEditing(_ textField: UITextField) { activeField = textField } func textFieldDidEndEditing(_ textField: UITextField) { activeField = nil } }
[ -1 ]
e7d99dd698e6de68aa8d8e0dae24d9cff454ece6
8c7f4bc5316ffe9efccb84adbedc755d27161ed9
/Hello/SceneDelegate.swift
cf38be55b267625cdc9baaa82a2f60f5a38d72ba
[]
no_license
haleyysanchez/Hello
bd293033462e6a19fac768b1953c12091ab8c4c6
be4e973ae7712852f170965a5c478cb335e2a7b3
refs/heads/master
2023-06-21T01:09:11.018656
2021-07-20T14:30:29
2021-07-20T14:30:29
387,821,427
0
0
null
null
null
null
UTF-8
Swift
false
false
2,539
swift
// // SceneDelegate.swift // Hello // // Created by Haley Sanchez on 7/20/21. // Copyright © 2021 Haley Sanchez. 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. // Save changes in the application's managed object context when the application transitions to the background. (UIApplication.shared.delegate as? AppDelegate)?.saveContext() } }
[ 393221, 163849, 393228, 393231, 393251, 352294, 344103, 393260, 393269, 213049, 376890, 385082, 16444, 393277, 376906, 327757, 254032, 286804, 368728, 254045, 368736, 180322, 376932, 286833, 286845, 286851, 417925, 262284, 360598, 286880, 286889, 377003, 377013, 164029, 327872, 180418, 377030, 377037, 180432, 377047, 418008, 385243, 418012, 377063, 327915, 205037, 393457, 393461, 393466, 418044, 336124, 385281, 336129, 262405, 180491, 336140, 164107, 262417, 368913, 262423, 377118, 377121, 262437, 254253, 336181, 262455, 393539, 262473, 344404, 213333, 418135, 270687, 262497, 418145, 262501, 213354, 246124, 262508, 262512, 213374, 385420, 262551, 262553, 385441, 385444, 262567, 385452, 262574, 393649, 385460, 262587, 344512, 262593, 336326, 360917, 369119, 328178, 328180, 328183, 328190, 254463, 328193, 98819, 164362, 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, 336517, 344710, 385671, 148106, 377485, 352919, 98969, 336549, 344745, 361130, 336556, 434868, 164535, 336568, 164539, 328379, 328387, 352969, 418508, 385743, 385749, 189154, 369382, 361196, 418555, 344832, 336644, 344837, 344843, 328462, 361231, 394002, 336660, 418581, 418586, 434971, 369436, 262943, 369439, 418591, 418594, 336676, 418600, 418606, 271154, 328498, 369464, 361274, 328516, 336709, 328520, 336712, 361289, 328523, 336715, 361300, 213848, 426842, 361307, 197469, 361310, 254813, 361318, 344936, 361323, 361335, 328574, 369544, 361361, 222129, 345036, 386004, 345046, 386012, 386019, 386023, 328690, 435188, 328703, 328710, 418822, 377867, 328715, 386070, 336922, 345119, 377888, 328747, 214060, 345134, 345139, 361525, 361537, 377931, 197708, 189525, 156762, 402523, 361568, 148580, 345200, 361591, 386168, 361594, 410746, 214150, 345224, 386187, 337048, 345247, 361645, 337072, 345268, 337076, 402615, 361657, 402636, 328925, 165086, 165092, 328933, 222438, 328942, 386286, 386292, 206084, 115973, 328967, 345377, 345380, 353572, 345383, 263464, 337207, 345400, 378170, 369979, 386366, 337224, 337230, 337235, 263509, 353634, 337252, 402792, 345449, 99692, 271731, 378232, 337278, 271746, 181639, 353674, 181644, 361869, 181650, 181655, 230810, 181671, 181674, 181679, 181682, 337330, 181687, 370105, 181691, 181697, 361922, 337350, 181704, 337366, 271841, 329192, 361961, 329195, 116211, 337399, 402943, 337416, 329227, 419341, 419345, 329234, 419351, 345626, 419357, 345631, 419360, 370208, 394787, 419363, 370214, 419369, 394796, 419377, 419386, 206397, 214594, 419401, 353868, 419404, 173648, 419408, 214611, 419412, 403040, 345702, 222831, 370298, 353920, 403076, 345737, 198282, 403085, 403092, 345750, 419484, 345758, 345763, 419492, 345766, 419498, 419502, 370351, 419507, 337588, 419510, 419513, 419518, 403139, 337607, 419528, 419531, 419536, 272083, 394967, 419543, 419545, 345819, 419548, 181982, 419551, 345829, 419560, 337643, 419564, 337647, 370416, 141052, 337661, 337671, 362249, 362252, 395022, 362256, 321300, 345888, 116512, 362274, 378664, 354107, 354112, 247618, 370504, 329545, 345932, 354124, 370510, 247639, 337751, 370520, 313181, 182110, 354143, 354157, 345965, 345968, 345971, 345975, 182136, 403321, 1914, 354173, 395148, 247692, 337809, 247701, 329625, 436127, 436133, 247720, 337834, 362414, 337845, 190393, 247760, 346064, 346069, 329699, 354275, 190440, 247790, 354314, 346140, 337980, 436290, 395340, 378956, 436307, 338005, 329816, 100454, 329833, 329853, 329857, 329868, 411806, 329886, 346273, 362661, 100525, 387250, 379067, 387261, 256193, 395467, 346317, 411862, 411865, 411869, 411874, 379108, 411877, 387303, 395496, 346344, 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, 272787, 354728, 338353, 338363, 338382, 272849, 248279, 256474, 182755, 338404, 338411, 330225, 248309, 199165, 248332, 330254, 199182, 199189, 420377, 330268, 191012, 330320, 199250, 191069, 346722, 248427, 191085, 338544, 191093, 346743, 330384, 346769, 150184, 174775, 248505, 174778, 363198, 223936, 355025, 273109, 264919, 338661, 338665, 264942, 330479, 363252, 338680, 207620, 264965, 191240, 338701, 256787, 199455, 396067, 346917, 396070, 215854, 355123, 355141, 355144, 338764, 330581, 387929, 330585, 355167, 265056, 265059, 355176, 355180, 355185, 330612, 330643, 412600, 207809, 379849, 347082, 396246, 330711, 248794, 248799, 347106, 437219, 257009, 265208, 330750, 199681, 338951, 330761, 330769, 330775, 248863, 158759, 396329, 404526, 396337, 330803, 396340, 339002, 388155, 339010, 347208, 248905, 330827, 330830, 248915, 183384, 412765, 339037, 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, 175487, 249215, 175491, 249219, 249225, 249228, 249235, 175514, 175517, 396703, 396706, 175523, 355749, 396723, 388543, 380353, 216518, 339401, 380364, 339406, 372177, 339414, 249303, 413143, 339418, 339421, 249310, 339425, 249313, 339429, 339435, 249329, 69114, 372229, 339464, 249355, 208399, 175637, 134689, 339504, 265779, 421442, 413251, 265796, 265806, 224854, 224858, 339553, 257636, 224871, 372328, 257647, 372338, 339572, 224885, 224888, 224891, 224895, 126597, 421509, 224905, 11919, 224911, 224914, 126611, 224917, 224920, 126618, 208539, 224923, 224927, 224930, 224933, 257705, 224939, 224943, 257713, 224949, 257717, 257721, 224954, 257725, 224960, 257733, 224966, 224970, 257740, 224976, 257745, 257748, 224982, 257752, 224987, 257762, 224996, 225000, 339696, 225013, 225021, 339711, 257791, 225027, 257796, 339722, 257805, 225039, 257808, 249617, 225044, 167701, 372500, 257815, 225049, 257820, 225054, 184096, 397089, 257825, 225059, 339748, 225068, 257837, 413485, 225071, 225074, 257843, 225077, 257846, 225080, 397113, 225083, 397116, 257853, 225088, 225094, 225097, 323404, 257869, 257872, 225105, 339795, 397140, 225109, 257881, 225113, 257884, 257887, 225120, 413539, 225128, 257897, 225138, 339827, 257909, 225142, 257914, 257917, 225150, 257922, 380803, 225156, 339845, 257927, 225166, 397201, 225171, 380823, 225176, 225183, 184245, 372698, 372704, 372707, 356336, 380919, 393215, 372739, 405534, 266295, 266298, 217158, 421961, 200786, 356440, 217180, 430181, 266351, 356467, 266365, 192640, 266375, 381069, 225425, 250003, 225430, 250008, 356507, 250012, 225439, 135328, 192674, 225442, 438434, 225445, 225448, 438441, 225451, 258223, 225456, 430257, 225459, 225462, 225468, 389309, 225472, 225476, 389322, 225485, 225488, 225491, 266454, 225494, 225497, 225500, 225503, 225506, 356580, 225511, 217319, 225515, 225519, 381177, 397572, 389381, 356631, 356638, 356641, 356644, 356647, 266537, 389417, 356650, 356656, 332081, 307507, 340276, 356662, 397623, 332091, 225599, 332098, 201030, 348489, 332107, 151884, 430422, 348503, 332118, 332130, 250211, 340328, 250217, 348523, 348528, 332153, 356734, 389503, 332158, 438657, 250239, 332162, 348548, 356741, 332175, 160152, 373146, 373149, 70048, 356783, 266688, 324032, 201158, 127473, 217590, 340473, 324095, 324100, 324103, 324112, 340501, 324118, 324122, 340512, 332325, 324134, 381483, 356908, 324141, 324143, 356917, 324150, 324156, 168509, 348734, 324161, 324165, 356935, 348745, 381513, 324171, 324174, 324177, 389724, 332381, 373344, 340580, 348777, 381546, 119432, 340628, 184983, 373399, 340639, 258723, 332455, 332460, 332464, 332473, 381626, 332484, 332487, 332494, 357070, 357074, 332512, 332521, 340724, 332534, 348926, 389927, 348979, 152371, 398141, 127815, 357202, 389971, 357208, 136024, 389979, 430940, 357212, 357215, 439138, 201580, 201583, 349041, 340850, 201589, 381815, 430967, 324473, 398202, 340859, 324476, 430973, 119675, 324479, 340863, 324482, 324485, 324488, 185226, 381834, 324493, 324496, 324499, 430996, 324502, 324511, 422817, 324514, 201638, 373672, 324525, 5040, 111539, 324534, 5047, 324539, 324542, 398280, 349129, 340940, 340942, 209874, 340958, 431073, 398307, 340964, 209896, 201712, 209904, 349173, 381947, 201724, 349181, 431100, 431107, 349203, 209944, 209948, 250915, 250917, 169002, 357419, 209966, 209969, 209973, 209976, 209980, 209988, 209991, 431180, 209996, 349268, 177238, 250968, 210011, 373853, 341094, 210026, 210028, 210032, 349296, 210037, 210042, 210045, 349309, 160896, 349313, 152704, 210053, 210056, 349320, 259217, 373905, 210068, 210072, 210078, 210081, 210085, 210089, 210096, 210100, 324792, 210108, 357571, 210116, 210128, 333010, 210132, 333016, 210139, 210144, 218355, 251123, 218361, 275709, 128254, 275713, 242947, 275717, 275723, 333075, 349460, 333079, 251161, 349486, 349492, 415034, 251211, 210261, 365912, 259423, 374113, 251236, 374118, 234867, 390518, 357756, 374161, 112021, 349591, 357793, 333222, 210357, 259516, 415168, 366035, 415187, 366039, 415192, 415194, 415197, 415200, 333285, 415208, 366057, 366064, 415217, 415225, 423424, 415258, 415264, 366118, 415271, 382503, 349739, 144940, 415279, 415282, 415286, 210488, 415291, 415295, 333387, 333396, 374359, 333400, 366173, 333415, 423529, 423533, 333423, 210547, 415354, 333440, 267910, 267929, 333472, 333512, 259789, 358100, 366301, 333535, 366308, 366312, 431852, 399086, 366319, 210673, 366322, 399092, 366326, 333566, 268042, 210700, 366349, 210707, 399129, 333593, 333595, 210720, 366384, 358192, 210740, 366388, 358201, 399166, 325441, 366403, 325447, 341831, 341835, 341839, 341844, 415574, 358235, 341852, 350046, 399200, 399208, 268144, 358256, 358260, 399222, 325494, 186233, 333690, 243584, 325505, 333699, 399244, 333709, 333725, 333737, 382891, 333767, 358348, 333777, 219094, 399318, 358372, 350190, 350194, 333819, 350204, 350207, 325633, 325637, 350214, 333838, 350225, 350232, 333851, 350238, 350241, 374819, 350245, 350249, 350252, 178221, 350257, 350260, 350272, 243782, 350281, 350286, 374865, 252021, 342134, 374904, 268435, 333989, 333998, 334012, 260299, 350411, 350417, 350423, 350426, 334047, 350449, 375027, 358645, 350454, 350459, 350462, 350465, 350469, 325895, 268553, 194829, 350477, 268560, 350481, 432406, 350487, 350491, 350494, 325920, 350500, 350505, 358701, 391469, 350510, 358705, 358714, 358717, 383307, 358738, 334162, 383331, 383334, 391531, 383342, 334204, 268669, 194942, 391564, 366991, 342431, 375209, 326059, 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, 375401, 334466, 334469, 391813, 162446, 326291, 342680, 342685, 260767, 342711, 244410, 260798, 334530, 260802, 350918, 154318, 342737, 391895, 154329, 416476, 64231, 113389, 342769, 203508, 375541, 342777, 391938, 391949, 375569, 375572, 375575, 375580, 162592, 334633, 326444, 383794, 326452, 326455, 375613, 244542, 375616, 326468, 244552, 342857, 326474, 326479, 326486, 416599, 342875, 244572, 326494, 326503, 433001, 326508, 400238, 326511, 211826, 211832, 392061, 351102, 252801, 260993, 400260, 211846, 342921, 342931, 252823, 400279, 392092, 400286, 359335, 211885, 400307, 351169, 359362, 351172, 170950, 187335, 326599, 359367, 359383, 359389, 383968, 343018, 359411, 261109, 261112, 244728, 383999, 261130, 261148, 359452, 261155, 261160, 261166, 359471, 375868, 384099, 384102, 384108, 367724, 326764, 187503, 343155, 384115, 212095, 384136, 384140, 384144, 384152, 384158, 384161, 351399, 384169, 367795, 384182, 384189, 384192, 343232, 351424, 244934, 367817, 244938, 384202, 253132, 326858, 343246, 384209, 146644, 351450, 384225, 359650, 343272, 351467, 359660, 384247, 351480, 384250, 351483, 343307, 384270, 359695, 261391, 253202, 261395, 384276, 384284, 245021, 384290, 253218, 245032, 171304, 384299, 351535, 245042, 326970, 384324, 343366, 212296, 212304, 367966, 343394, 343399, 367981, 343410, 155000, 327035, 245121, 245128, 253321, 155021, 384398, 245137, 245143, 245146, 245149, 343453, 245152, 245155, 155045, 245158, 40358, 245163, 114093, 327090, 343478, 359867, 384444, 146878, 327108, 327112, 384457, 327118, 359887, 359891, 343509, 368093, 155103, 343535, 343540, 368120, 343545, 409092, 359948, 359951, 245295, 359984, 400977, 400982, 179803, 138865, 155255, 155274, 409237, 368289, 245410, 425639, 245415, 425652, 425663, 155328, 245463, 155352, 155356, 212700, 155364, 245477, 155372, 245487, 212723, 245495, 409336, 155394, 155404, 245528, 155423, 360224, 155439, 204592, 155444, 155448, 417596, 384829, 384831, 360262, 155463, 155477, 376665, 155484, 261982, 425823, 155488, 376672, 155492, 327532, 261997, 376686, 262000, 262003, 425846, 262006, 147319, 262009, 327542, 262012, 155517, 155523, 155526, 360327, 376715, 155532, 262028, 262031, 262034, 262037, 262040, 262043, 155550, 262046, 253854, 262049, 262052, 327590, 155560, 155563, 155566, 327613, 393152, 311244, 212945, 393170, 155604, 155620, 253924, 155622, 253927, 327655, 360432, 393204, 360439, 253944, 393209, 155647 ]
0d5582814ecd547dbaa3ef274bb3a0d574984137
a384ea09a6932681aca96621f60da6a2408061fc
/rectangle/main.swift
e245f5f26e9af4ab5511a1c6b834920b2c909ad0
[]
no_license
dupargudepriyu4/rectangle
af257f0b5942a386968507463ceea355318ca9b0
54d3560315c3649fed310d0ea17e7e626c58d745
refs/heads/master
2020-03-25T04:49:06.540642
2018-08-03T10:32:26
2018-08-03T10:32:26
143,414,458
0
0
null
null
null
null
UTF-8
Swift
false
false
274
swift
// // main.swift // rectangle // // Created by Student-001 on 03/08/18. // Copyright © 2018 minal. All rights reserved. import Foundation print("Hello, World!") func add() { let a=10,b=20 let c=a+b print("addition of \(a) and \(b)is \(c)") } add()
[ -1 ]
34fa11b1dcb667cf31e228677e430e019083f980
d68c7e3e10b369660352678798b7136d3bcbc814
/LoginFlow/LoginFlow/Scenes/OTP/OtpPresenter.swift
d28c888f7db355bcbab63bdbf54499df913fe866
[]
no_license
suraphanL/Modular-Clean-Swift-Coordinator
b89d881297166ce093a33b0a75ed6dfc5fde873f
5ed419641204fa1737c0598398d565ebeb58ebba
refs/heads/master
2020-07-24T21:08:10.895785
2019-09-16T08:14:57
2019-09-16T08:14:57
208,049,387
0
0
null
null
null
null
UTF-8
Swift
false
false
836
swift
// // OtpPresenter.swift // LoginFlow // // Created by Suraphan Laokondee on 16/9/19. // Copyright (c) 2019 SCB. All rights reserved. // import UIKit protocol OtpPresenterInterface { func presentSomething(response: Otp.Something.Response) } class OtpPresenter: OtpPresenterInterface { weak var viewController: OtpViewControllerInterface! // MARK: - Presentation logic func presentSomething(response: Otp.Something.Response) { // NOTE: Format the response from the Interactor and pass the result back to the View Controller. The resulting view model should be using only primitive types. Eg: the view should not need to involve converting date object into a formatted string. The formatting is done here. let viewModel = Otp.Something.ViewModel() viewController.displaySomething(viewModel: viewModel) } }
[ -1 ]
3c823393823bc73a96cc08e97585903e3fe507a4
a7d7c43aacf62688fbc460cab572f9ffd7d07bcc
/TodoList/Biz/Main/VC/MenuViewController.swift
d55656d90ff7ed581d776fc32c8b0e2f0a57be5b
[]
no_license
dreamgyf/TodoList-iOS
bf0a9d8d9c41dc433e8050cc6f28d52cab778aac
9ca51c50894738579cedf68f96943018144bdc2c
refs/heads/master
2023-01-23T02:18:30.351295
2020-12-01T05:39:44
2020-12-01T05:39:44
314,431,989
1
0
null
null
null
null
UTF-8
Swift
false
false
3,546
swift
// // MenuViewController.swift // TodoList // // Created by 高云峰 on 2020/11/22. // import UIKit class MenuViewController: UIViewController { private lazy var itemAll: MenuItemView = { let item = MenuItemView() item.label.text = "全部" item.action = { self.doAction(style: .all) } return item }() private lazy var itemToday: MenuItemView = { let item = MenuItemView() item.label.text = "今日" item.action = { self.doAction(style: .today) } return item }() private lazy var itemFinished: MenuItemView = { let item = MenuItemView() item.label.text = "已完成" item.action = { self.doAction(style: .finished) } return item }() private lazy var itemUnfinished: MenuItemView = { let item = MenuItemView() item.label.text = "未完成" item.action = { self.doAction(style: .unfinished) } return item }() override func viewDidLoad() { super.viewDidLoad() setupUI() } private func setupUI() { edgesForExtendedLayout = [.left, .right] view.backgroundColor = UIColor.white view.addSubview(itemAll) itemAll.snp.makeConstraints { (make) in make.width.equalToSuperview() make.height.equalTo(view.snp.width).multipliedBy(0.3) make.top.equalToSuperview() } let line1 = UIView() line1.backgroundColor = UIColor(hexString: "#E6E6E7") view.addSubview(line1) line1.snp.makeConstraints { (make) in make.width.equalToSuperview() make.height.equalTo(1) make.top.equalTo(itemAll.snp.bottom) } view.addSubview(itemToday) itemToday.snp.makeConstraints { (make) in make.width.equalToSuperview() make.height.equalTo(view.snp.width).multipliedBy(0.3) make.top.equalTo(line1.snp.bottom) } let line2 = UIView() line2.backgroundColor = UIColor(hexString: "#E6E6E7") view.addSubview(line2) line2.snp.makeConstraints { (make) in make.width.equalToSuperview() make.height.equalTo(1) make.top.equalTo(itemToday.snp.bottom) } view.addSubview(itemFinished) itemFinished.snp.makeConstraints { (make) in make.width.equalToSuperview() make.height.equalTo(view.snp.width).multipliedBy(0.3) make.top.equalTo(line2.snp.bottom) } let line3 = UIView() line3.backgroundColor = UIColor(hexString: "#E6E6E7") view.addSubview(line3) line3.snp.makeConstraints { (make) in make.width.equalToSuperview() make.height.equalTo(1) make.top.equalTo(itemFinished.snp.bottom) } view.addSubview(itemUnfinished) itemUnfinished.snp.makeConstraints { (make) in make.width.equalToSuperview() make.height.equalTo(view.snp.width).multipliedBy(0.3) make.top.equalTo(line3.snp.bottom) } } var action: ((_ style: TodoListViewController.Style) -> Void)? private func doAction(style: TodoListViewController.Style) { if let action = action { action(style) } dismiss(animated: true, completion: nil) } }
[ -1 ]
4cb2281e34fcc33b55a8be2710a34d45eba8d9f5
c22ccbb670cd5c179f9fc92ed6593dc2ee9ae52c
/Stock App/Models/NewsItem.swift
e8e701f905d21681665890f055481775ac308d6e
[]
no_license
ChrisBenua/Stock-App
3752fafa039e036399aec54c39e87de9defc9ade
0b5fa4b214ec55fd528df8a4000b22d74b3bdb09
refs/heads/master
2020-04-08T05:14:14.374503
2019-02-04T16:29:03
2019-02-04T16:29:03
159,052,280
0
0
null
null
null
null
UTF-8
Swift
false
false
5,462
swift
// // NewsItem.swift // Stock App // // Created by Ирина Улитина on 25/11/2018. // Copyright © 2018 Christian Benua. All rights reserved. // import Foundation /// Class for parsing Result from API public class SearchResults : Decodable { ///Array of NewsItems to parse from API var elements : [NewsItem] init() { elements = [NewsItem]() } init(items : [NewsItem]) { elements = items } enum CodingKeys : String, CodingKey { case elements = "elements" } required init?(coder aDecoder : Decoder) { do { let container = try aDecoder.container(keyedBy : CodingKeys.self) elements = try container.decode([NewsItem].self, forKey: .elements) } catch let err { elements = [NewsItem]() print("Error while parsing news array in SearchResults init(coder:) ", err) } } } /// One element from API response public class NewsItem : Decodable { /// Id of News Record var id : String /// Time, when News were discovered by newsriver var discoveryDate : String /// title for corresponding news item var title : String /// plain text without attributes var text : String /// URL to news' source var externalUrl : String //var nestedElems : NestedElementArray /// Images and others elements nested in `elements` tag var nestedElems : [NestedElement] init() { id = "" discoveryDate = "" title = "" text = "" externalUrl = "" //nestedElems = NestedElementArray() nestedElems = [NestedElement]() } init(id : String, publishDate : String, title : String, text : String, externalUrl : String) { self.id = id self.discoveryDate = publishDate self.title = title self.text = text self.externalUrl = externalUrl //nestedElems = NestedElementArray() nestedElems = [NestedElement]() } init(id : String, publishDate : String, title : String, text : String, externalUrl : String, nestedElems : [NestedElement]) { self.id = id self.discoveryDate = publishDate self.title = title self.text = text self.externalUrl = externalUrl //self.nestedElems = NestedElementArray(elems: nestedElems) self.nestedElems = nestedElems } required init?(coder aDecoder: Decoder) { do { let container = try aDecoder.container(keyedBy : CodingKeys.self) self.id = try container.decode(String.self, forKey: .id) self.discoveryDate = try container.decode(String.self, forKey: .discoveryDate) self.title = try container.decode(String.self, forKey: .title) self.text = try container.decode(String.self, forKey: .text) self.externalUrl = try container.decode(String.self, forKey: .externalUrl) self.nestedElems = try container.decode([NestedElement].self, forKey: .nestedElems) //self.nestedElems = try container.decode(NestedElementArray.self, forKey: .nestedElems) } catch let err { id = "" discoveryDate = "" title = "" text = "" externalUrl = "" nestedElems = [NestedElement]() //nestedElems = NestedElementArray() print("Error in decoding NewsItem ", err) } } enum CodingKeys : String, CodingKey { case id = "id" case discoveryDate = "discoverDate" case title = "title" case text = "text" case externalUrl = "url" case nestedElems = "elements" } } /// Class for parsing and stroing `elements` tag in API response class NestedElement : Decodable { /// type of content elem var type : String /// URL, repsresenting source URL of this element var url : String enum CodingKeys : String, CodingKey { case type = "type" case url = "url" } init() { type = "" url = "" } init(type : String, url : String) { self.type = type self.url = url } required init?(coder aDecoder: Decoder) { do { let container = try aDecoder.container(keyedBy : CodingKeys.self) self.type = try container.decode(String.self, forKey: .type) self.url = try container.decode(String.self, forKey: .url) } catch let err { type = "" url = "" print("Error in decoding NestedElement ", err) } } } ///class for parsing array of `elements` tag class NestedElementArray : Decodable { /// array of elements in `elements` tag var elements : [NestedElement] init() { elements = [NestedElement]() } init(elems : [NestedElement]) { elements = elems } required init?(coder aDecoder: Decoder) { do { let container = try aDecoder.container(keyedBy : CodingKeys.self) self.elements = try container.decode([NestedElement].self, forKey: .elements) } catch let err { self.elements = [NestedElement]() print("Error in decoding NestedElement ", err) } } enum CodingKeys : String, CodingKey { case elements = "elements" } }
[ -1 ]
697716a7d60a21666b46175e0fa2a460013bfbbb
511d1f28b231fc6238078fe191f612cba376ee2c
/SBBOLtest/Moduls/Translate/TranslateViewController.swift
1a5b967cb78877061e2c78ee21fdc1c376c12e63
[]
no_license
erikVildanov/SBBOLtest-ya.translate-
a46a12a3d79f87a129851a445663d4fa8a17f072
3947d75271034779ca10b1c85ba93a83f615ef7b
refs/heads/master
2020-05-30T14:06:00.162392
2019-06-01T21:55:02
2019-06-01T21:55:02
189,780,716
0
0
null
null
null
null
UTF-8
Swift
false
false
2,680
swift
// // TranslateViewController.swift // SBBOLtest // // Created by Erik Vildanov on 30/05/2019. // Copyright (c) 2019 Erik Vildanov. All rights reserved. // // This file was generated by the 🐍 VIPER generator // import UIKit final class TranslateViewController: UIViewController { // MARK: - Public properties - var presenter: TranslatePresenterInterface! let translateView = TranslateView() // MARK: - Lifecycle - override func viewDidLoad() { super.viewDidLoad() view = translateView presenter.viewDidLoad() } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) presenter.viewWillAppear(animated: animated) } } // MARK: - Extensions - extension TranslateViewController: TranslateViewInterface { func setTitleLangForBtn(source: String, translate: String) { translateView.sourceLangBtn.setTitle(source, for: .normal) translateView.translateLangBtn.setTitle(translate, for: .normal) } func setupTarget() { translateView.inputText.delegate = self translateView.sourceLangBtn.addTarget(self, action: #selector(openLanguageList(sender:)), for: .touchUpInside) translateView.translateLangBtn.addTarget(self, action: #selector(openLanguageList(sender:)), for: .touchUpInside) translateView.turnOverLabgBtn.addTarget(self, action: #selector(turnOverLanguage), for: .touchUpInside) let gesture = UITapGestureRecognizer(target: self, action: #selector(closeKeyboard)) self.view.addGestureRecognizer(gesture) } @objc func openLanguageList(sender: UIButton) { presenter.openLanguageList(lang: sender.currentTitle!, isSource: sender == translateView.sourceLangBtn) } @objc func turnOverLanguage() { presenter.turnOverLang() guard let text = translateView.outputText.text else { return } translateView.inputText.text = text presenter.translateText(text: text) } @objc func closeKeyboard() { self.view.endEditing(true) } func setTextOutput(text: String) { self.translateView.outputText.text = text } func cleanText() { self.translateView.inputText.text = "" self.translateView.outputText.text = "" } } extension TranslateViewController: UITextViewDelegate { func textViewDidChange(_ textView: UITextView) { guard let text = textView.text else { return } if text == "" { self.setTextOutput(text: "") } DispatchQueue.global(qos: .userInteractive).async { self.presenter.translateText(text: text) } } }
[ -1 ]
260ea86dd27676552bbcef571f7f43ddeb5a8ffc
a3e3946115df73800ff0a7a2936feacfb4309725
/TrashBotTests/TrashBotTests.swift
47d52f2af429d16d6b92e68eb5a922eb99c26b59
[]
no_license
plguo/TrashBot-iOS
2e7ef87fdbfb2971c5b1ce56550e0008008e5a8f
59c6d5fa470420d7db29e792db2ac2bf37b90dbd
refs/heads/master
2021-05-30T06:32:27.679252
2015-12-26T17:39:14
2015-12-26T17:39:14
48,255,595
1
0
null
null
null
null
UTF-8
Swift
false
false
587
swift
// // TrashBotTests.swift // TrashBotTests // // Created by Edward Guo on 2015-12-18. // Copyright © 2015 Peiliang Guo. All rights reserved. // import XCTest @testable import TrashBot class TrashBotTests: 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() } }
[ 69732, 306601, 194513, 194484, 125684, 228862 ]
7a8f9dd0691fc0291e4455cc716e8882b6a31eed
c5e8efbd15968b919efd144a1b0004de1d93a100
/ios/DrawDemo/DrawExamples.swift
e9bc2b8d8e20f30ecf77d4e7bec9203d6eb39fa9
[]
no_license
shengoo/demos
c7e80d3808b1a9a911d6d829a2ae5238c4eff2b3
3f540f88a9dedfd3a91536fde3a352bcd5d9600f
refs/heads/master
2020-05-26T02:52:27.323922
2020-01-16T10:28:14
2020-01-16T10:28:14
31,634,647
0
0
null
2020-01-16T10:27:33
2015-03-04T02:52:49
Objective-C
UTF-8
Swift
false
false
1,135
swift
// // DrawExamples.swift // DrawDemo // // Created by Qing Sheng on 15/7/2. // Copyright (c) 2015年 Sheng Qing. All rights reserved. // import UIKit class DrawExamples: UIView { override func drawRect(rect: CGRect) { //context is the object used for drawing let context = UIGraphicsGetCurrentContext() CGContextSetLineWidth(context, 3.0) CGContextSetStrokeColorWithColor(context, UIColor.purpleColor().CGColor) // //straight line // CGContextMoveToPoint(context, 50, 60) // CGContextAddLineToPoint(context, 250, 320) // CGContextMoveToPoint(context, 50, 50) // CGContextAddLineToPoint(context, 90, 130) // CGContextAddLineToPoint(context, 180, 100) // CGContextAddLineToPoint(context, 90, 60) // CGContextAddLineToPoint(context, 50, 50) //rectangle let rectangle = CGRectMake(50, 50, 200, 400) CGContextAddRect(context, rectangle) //actually draw the path CGContextStrokePath(context) } }
[ -1 ]
4f45de08f856790e091f80954502f26d7c81a301
b9c37a2ae1ae6652c550811772279edc1270b9b6
/chatlib/Controllers/Contact/ContactViewController.swift
a20eb1bf1afb99837f4161092b47ac1a6d8ba91e
[]
no_license
ashatreesa/chat
4f13241ee2641224c809da761772ba1f5bb97f26
e4ee90719eb70d787e4fc53aef3203138ddd1a99
refs/heads/master
2023-01-11T12:40:40.897729
2020-11-13T10:45:42
2020-11-13T10:45:42
312,541,759
0
0
null
null
null
null
UTF-8
Swift
false
false
12,499
swift
// // ContactViewController.swift // Chat // // Created by Asha Treesa Kurian on 26/09/20. // Copyright © 2020 fingent. All rights reserved. // import UIKit import Foundation protocol ContactView : class { func displayTime(timer : Int64) -> String func noDuplicates(_ arrayOfDicts: [[String: Any]]) -> [[String: Any]] } class ContactViewController: UIViewController { var userList = Array<Dictionary<String,Any>>() var searchstring = Array<Dictionary<String,Any>>() var Datapresenter: DataPresenter! var authpresenter: AuthPresenter! var userSearchedImageUrl :String = "" var searchActive: Bool = false var UNIQUEVAL = Array<Dictionary<String,Any>>() @IBOutlet var containerView: UIView! @IBOutlet weak var mainView: UIView! @IBOutlet weak var searchBar: UISearchBar! @IBOutlet weak var contactTableView: UITableView! override func viewDidLoad() { super.viewDidLoad() self.contactTableView.tableFooterView = UIView() self.contactTableView.separatorColor = UIColor.gray Datapresenter = DataPresenter() authpresenter = AuthPresenter() searchBar.delegate = self if let useList = AppDataManager.sharedInstance.fetchFromSharedPreference(key:Global.DatabaseKey.userlist)as? [Dictionary<String, Any>] { userList = useList contactTableView.reloadData() } if userList.count > 0 { print("lessthan0") } else{ print("greater than 0") } if #available(iOS 12.0, *) { if self.traitCollection.userInterfaceStyle == .dark { mainView.backgroundColor = UIColor.black containerView.backgroundColor = UIColor.black } else { mainView.backgroundColor = UIColor.white containerView.backgroundColor = UIColor.white } } else { // Fallback on earlier versions } // Do any additional setup after loading the view. } override func viewWillAppear(_ animated: Bool) { if let useList = AppDataManager.sharedInstance.fetchFromSharedPreference(key:Global.DatabaseKey.userlist) as? [Dictionary<String, Any>] { userList = useList contactTableView.reloadData() } } } extension ContactViewController :ContactView{ func displayTime(timer : Int64) -> String { var date = Date(timeIntervalSince1970: (TimeInterval(timer/1000))) var dateFormatter = DateFormatter() dateFormatter.dateFormat = "d/MM/yy,hh:mm a" var splitDate = (dateFormatter.string(from: date)).components(separatedBy: ",") var theDate = dateFormatter.string(from: date) let today = NSDate() let updateDate = dateFormatter.date(from: theDate)! var formatteddate = dateFormatter.string(from: updateDate) return formatteddate } func noDuplicates(_ arrayOfDicts: [[String: Any]]) -> [[String: Any]] { var noDuplicates = [[String: Any]]() var usedNames = [String]() for dict in arrayOfDicts { if let name = dict["userId"], !usedNames.contains(name as! String) { noDuplicates.append(dict) usedNames.append(name as! String) } } return noDuplicates } } extension ContactViewController : UISearchBarDelegate { func searchBar(_ searchBar: UISearchBar, textDidChange searchText: String) { searchstring = userList.filter({ let string = $0["display_name"] as! String return string.hasPrefix(searchText) }) searchActive = true self.searchBar.becomeFirstResponder() contactTableView.reloadData() } } extension ContactViewController : UITableViewDelegate,UITableViewDataSource{ func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { var count :Int = 0 if searchActive { self.searchBar.becomeFirstResponder() UNIQUEVAL = noDuplicates(searchstring) count = UNIQUEVAL.count } else { self.searchBar.resignFirstResponder() UNIQUEVAL = noDuplicates(userList) count = UNIQUEVAL.count } return count } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "MessageTableViewCell", for: indexPath)as?MessageTableViewCell cell?.lastMessage.isHidden = true cell?.dateLabel.isHidden = true if searchActive { let userdetail = UNIQUEVAL[indexPath.row] if let profileName = userdetail["display_name"]as?String { cell?.profileName.text = profileName } if let userId = userdetail["userId"]as?String{ if let employeeImageUrl = Datapresenter.getUserImageUrl(mattermostID: userId) as? String{ self.userSearchedImageUrl = employeeImageUrl authpresenter.getUserImage(imageURL: employeeImageUrl, userId: userId) { (success, image) in if success{ DispatchQueue.main.async { cell?.profileImage.image = image } }else{ DispatchQueue.main.async { cell?.profileImage.image = UIImage(named: "pro") } } } } Datapresenter.getImageFromDirectory(userID: userId) { (success, image) in if success{ cell?.profileImage.image = image }else{ cell?.profileImage.image = UIImage(named: "pro") } } } }else{ let userdet = UNIQUEVAL[indexPath.row] if let userId = userdet["userId"]as?String { if let employeeImageUrl = Datapresenter.getUserImageUrl(mattermostID: userId) as? String{ self.userSearchedImageUrl = employeeImageUrl authpresenter.getUserImage(imageURL: employeeImageUrl, userId: userId) { (success, image) in if success{ DispatchQueue.main.async { cell?.profileImage.image = image } }else{ DispatchQueue.main.async { cell?.profileImage.image = UIImage(named: "pro") } } } } } cell?.profileName.text = userdet["display_name"] as?String } return cell! } func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { return 60 } func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { let storyBoard : UIStoryboard = UIStoryboard(name: "Main", bundle:nil) let nextViewController = storyBoard.instantiateViewController(withIdentifier: "chatViewcontroller") as! chatViewcontroller if searchActive { let userdetail = UNIQUEVAL[indexPath.row] // print("searchstring\(searchstring)==\(userdetail)") let profileNam = userdetail["display_name"]as!String if indexPath.row != nil { nextViewController.profilename = profileNam if let userId = userdetail["userId"]as?String { nextViewController.userID = userId } if let channelIdId = userdetail["id"]as?String { nextViewController.channelID = channelIdId } if let totalcount = userdetail["total_msg_count"]as?Int { nextViewController.msgCount = totalcount } if let type = userdetail["type"]as?String { nextViewController.channelType = type } if let channeluserid = userdetail["name"]as?String { nextViewController.channelStatusId = channeluserid } nextViewController.userProfileImage = self.userSearchedImageUrl } self.searchBar.resignFirstResponder() } else{ let userdetail = UNIQUEVAL[indexPath.row] let profileNam = userdetail["display_name"]as!String if indexPath.row != nil { nextViewController.profilename = profileNam } if let userId = userdetail["userId"]as?String { nextViewController.userID = userId } if let channelIdId = userdetail["id"]as?String { nextViewController.channelID = channelIdId } if let totalcount = userdetail["total_msg_count"]as?Int { nextViewController.msgCount = totalcount } if let type = userdetail["type"]as?String { nextViewController.channelType = type } if let channeluserid = userdetail["name"]as?String { nextViewController.channelStatusId = channeluserid } nextViewController.userProfileImage = self.userSearchedImageUrl } self.navigationController?.pushViewController(nextViewController, animated: true) } }
[ -1 ]
31aa3dd5c6b3756e802d747a50a7efcc5028d857
06807fcb1a91b7f42b2ab873e18f9a7f86a9e8d3
/Krishakah/Controllers/FeedViewControllers/FeedVC.swift
addaf9ff2f05566d064a07d18857ed498a208f23
[]
no_license
PRAVEEN2363/farmify
4ed156e8ec57ad0ee102439484b5924f99aa3472
d5e3fcb52b34954b2f75335e6cfca2e997818bb3
refs/heads/main
2023-01-29T22:21:20.838572
2020-12-15T03:41:25
2020-12-15T03:41:25
320,216,486
0
0
null
null
null
null
UTF-8
Swift
false
false
3,964
swift
// // FeedVC.swift // Krishakah // // Created by RichLabs on 06/12/20. // import UIKit import Firebase import FirebaseAuth import FirebaseStorage import FirebaseDatabase import Kingfisher class FeedVC: UIViewController { @IBOutlet weak var tableView: UITableView! var postsList = [PostModel]() var feedType = String() override func viewDidLoad() { super.viewDidLoad() tableView.delegate = self tableView.dataSource = self getDataFromServer() } //Retreiveing Data from database func getDataFromServer() { Database.database().reference().child(feedType).observe(DataEventType.childAdded) {(snapshot) in let values = snapshot.value! as! NSDictionary let post = values["post"] as! NSDictionary let postIDs = post.allKeys for id in postIDs{ let singlePost = post[id] as! NSDictionary let itemName = singlePost["itemname"] as! String let itemPrice = singlePost["itemprice"] as! String let itemImage = singlePost["itemimage"] as! String let itemDetails = singlePost["itemdetails"] as! String let ownerName = singlePost["ownername"] as! String let mobileNumber = singlePost["mobilenumber"] as! String let currentPost = PostModel.init(itemName: itemName, itemPrice: itemPrice, itemImage: itemImage, itemDetails: itemDetails,ownerName:ownerName,mobileNumber: mobileNumber) self.postsList.append(currentPost) } self.tableView.reloadData() } } } extension FeedVC: UITableViewDelegate, UITableViewDataSource { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return postsList.count } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "LegumeFeedViewCell", for:indexPath) as! LegumeFeedViewCell let currentPost = postsList[indexPath.row] cell.contactButtonDelegate = self cell.itemName.text = currentPost.itemName cell.itemPrice.text = "₹ \(currentPost.itemPrice)" let imageUrl = URL(string: currentPost.itemImage)! cell.itemImage.kf.setImage(with: imageUrl) cell.itemDetails.text = currentPost.itemDetails cell.nameLabel.text = "Posted by \(currentPost.ownerName)" return cell } func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { return 600 } } //MARK:- ContactButtonDelegates extension FeedVC: FeedCellProtocol { func contactButtonClicked(tableCell: UITableViewCell) { let selectedCellId = (tableView.indexPath(for: tableCell)?.row)! let currentPost = postsList[selectedCellId] let mobileNumber = currentPost.mobileNumber if let url = URL(string: "tel://\(mobileNumber)"), UIApplication.shared.canOpenURL(url) { if #available(iOS 10, *) { UIApplication.shared.open(url) } else { UIApplication.shared.openURL(url) } } } } //MARK:- PostModel Class class PostModel { var itemName = String() var itemPrice = String() var itemImage = String() var itemDetails = String() var ownerName = String() var mobileNumber = String() init(itemName: String, itemPrice: String, itemImage: String, itemDetails: String,ownerName:String,mobileNumber:String) { self.itemName = itemName self.itemPrice = itemPrice self.itemImage = itemImage self.itemDetails = itemDetails self.ownerName = ownerName self.mobileNumber = mobileNumber } }
[ -1 ]
6fe0a33b027423d34115c1e62225a2d0a8a12292
f59f9504b27d3ae41ecb1be221b329db35fe9fc3
/IDPush/Source.swift
cbe416b94c6afeda8a932951c650305fd6ecc421
[]
no_license
omidgolparvar/IDPush
a3868f29a27778d908812184f9aedcab055f5456
17cb8fcd36c27e0bb9f0fbe4b38cd0fc5cff89d3
refs/heads/master
2020-03-29T16:24:16.803849
2019-06-12T12:46:27
2019-06-12T12:46:27
150,112,576
1
0
null
null
null
null
UTF-8
Swift
false
false
9,353
swift
// import Foundation import UIDeviceComplete public class IDPush { public typealias RoutesType = ( addDevice : String, editDevice : String ) private static let kUserDefaults_PreviousPlayerID = "IDPush_PreviousPlayerID" private static let BaseURL : String = "https://idpush.top/api/v1/" private static let Routes : RoutesType = ("device/add", "device/edit/") private static var ProjectID : String = "" private static var IsConfigured : Bool = false private static var PlayerID : String? = nil public static func Setup(projectID: String) { let _projectID = projectID.trimmingCharacters(in: .whitespacesAndNewlines) guard !_projectID.isEmpty else { print(IDPushConfigureError.missingProjectID.description) return } ProjectID = _projectID IsConfigured = true } public static func Perform(action: IDPushAction, then callback: @escaping (IDPushActionError?, Any?) -> Void) { guard IsConfigured else { let actionError = IDPushActionError.isNotConfigured PrintError(actionError, title: "Configuration") callback(actionError, nil) return } do { try action.validateBeforePerform() } catch { let actionError = error as! IDPushActionError PrintError(actionError, title: "Validation Error") callback(actionError, nil) return } let url = action.getURL() let parameters = action.getParameters() var request = URLRequest(url: url) request.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type") request.httpMethod = "POST" request.httpBody = parameters.percentEscaped().data(using: .utf8) let task = URLSession.shared.dataTask(with: request) { data, response, error in guard error == nil else { let actionError = IDPushActionError.custom(message: error!.localizedDescription) PrintError(actionError, title: "Request Failed") callback(actionError, nil) return } guard let data = data, let response = response as? HTTPURLResponse else { let actionError = IDPushActionError.custom(message: "Data or Response as NOT available") PrintError(actionError, title: "Data or Response") callback(actionError, nil) return } guard (200 ... 299) ~= response.statusCode else { let actionError = IDPushActionError.invalidResponse PrintError(actionError, title: "Invalid Response", extraMessage: "StatusCode = \(response.statusCode)") callback(actionError, nil) return } do { let jsonObject = try JSONSerialization.jsonObject(with: data, options: []) //print("JSON Object: \(String(describing: jsonObject))") guard let jsonDictionary = jsonObject as? [String: Any] else { let actionError = IDPushActionError.invalidResponse PrintError(actionError, title: "Invalid Response", extraMessage: "Casting JSON to Dictionary: Failed") callback(actionError, nil) return } //print("JSON Dictionary: \(String(describing: jsonDictionary))") guard let status = jsonDictionary["status"] as? Int, status == 1 else { let actionError = IDPushActionError.invalidResponse PrintError(actionError, title: "Invalid Response") callback(actionError, nil) return } switch action { case .addDevice: if let playerID = jsonDictionary["player_id"] as? String { IDPush.StorePlayerID(playerID) callback(nil, data) } else { let actionError = IDPushActionError.invalidResponse PrintError(actionError, title: "Invalid Response") callback(actionError, nil) } default: callback(nil, data) } } catch let error { let actionError = IDPushActionError.custom(message: error.localizedDescription) PrintError(actionError, title: "Invalid Response", extraMessage: "JSON Serialization: Failed") callback(actionError, nil) print(error.localizedDescription) } } task.resume() } public static func GetPlayerID() -> String? { if let playerID = PlayerID { return playerID } else if let playerID = UserDefaults.standard.string(forKey: kUserDefaults_PreviousPlayerID) { PlayerID = playerID return playerID } return nil } private static func StorePlayerID(_ playerID: String) { PlayerID = playerID UserDefaults.standard.set(playerID, forKey: kUserDefaults_PreviousPlayerID) } private enum IDPushConfigureError: Error, CustomStringConvertible { case missingProjectID var description: String { let errorPrefix = "🆔 ⚠️ - Configuration Error: " switch self { case .missingProjectID : return errorPrefix + "ProjectID is missing." + "\n" } } } public enum IDPushAction { case addDevice(token: String) case subscribe case unsubscribe case setTags(tags: [String: Any]) case editDevice(parameters: [String: Any]) fileprivate func getParameters() -> [String: Any] { var parameter: [String: Any] = [:] parameter["project_id"] = IDPush.ProjectID parameter["device_type"] = 0 parameter["game_version"] = Bundle.main.infoDictionary!["CFBundleShortVersionString"] as! String parameter["device_model"] = UIDevice.current.dc.deviceModel parameter["device_os"] = UIDevice.current.systemVersion switch self { case .addDevice(let token): parameter["identifier"] = token parameter["notification_types"] = 1 var isForTest: Bool = true #if DEBUG isForTest = true #else isForTest = false #endif parameter["test_type"] = isForTest ? 1 : 2 case .subscribe: guard let playerID = IDPush.PlayerID else { IDPush.PrintError(.missingPlayerID, title: "Action Parameters") return [:] } parameter["player_id"] = playerID parameter["notification_types"] = 1 case .unsubscribe: guard let playerID = IDPush.PlayerID else { IDPush.PrintError(.missingPlayerID, title: "Action Parameters") return [:] } parameter["player_id"] = playerID parameter["notification_types"] = -2 case .setTags(let tags): guard let playerID = IDPush.PlayerID else { IDPush.PrintError(.missingPlayerID, title: "Action Parameters") return [:] } parameter["player_id"] = playerID parameter["notification_types"] = 1 parameter["tags"] = tags.asJSONString case .editDevice(let parameters): guard let playerID = IDPush.PlayerID else { IDPush.PrintError(.missingPlayerID, title: "Action Parameters") return [:] } parameter["player_id"] = playerID parameters.forEach({ parameter[$0.key] = $0.value }) } return parameter } fileprivate func getURL() -> URL { switch self { case .addDevice(_) : return URL(string: IDPush.BaseURL + IDPush.Routes.addDevice)! case .subscribe, .unsubscribe, .setTags(_), .editDevice(_) : return URL(string: IDPush.BaseURL + IDPush.Routes.editDevice + IDPush.PlayerID!)! } } fileprivate func validateBeforePerform() throws { switch self { case .addDevice(let token) : guard !token.isTrimmedAndEmpty else { throw IDPushActionError.missingDeviceToken } case .subscribe, .unsubscribe, .setTags(_), .editDevice(_) : guard IDPush.PlayerID != nil else { throw IDPushActionError.missingPlayerID } } } } public enum IDPushActionError: Error, CustomStringConvertible { case missingDeviceToken case missingPlayerID case isNotConfigured case invalidResponse case custom(message: String) public var description: String { switch self { case .missingDeviceToken : return "APNs token is empty." case .missingPlayerID : return "PlayerID is missing." case .isNotConfigured : return "Framework is NOT configured. Call IDPush.Setup(...)." case .invalidResponse : return "Server response is NOT valid." case .custom(let message) : return "Custom error message: \(message)." } } } } extension IDPush { private static func PrintError(_ error: IDPushActionError, title: String, extraMessage: String? = nil) { let extraMessage = extraMessage == nil ? "" : " (\(extraMessage!))" print("🆔 ⚠️ - \(title): ") print(error.description + extraMessage) print() } } extension String { fileprivate var isTrimmedAndEmpty: Bool { return self.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty } } extension Dictionary { fileprivate func percentEscaped() -> String { return map { (key, value) in let escapedKey = "\(key)".addingPercentEncoding(withAllowedCharacters: .urlQueryValueAllowed) ?? "" let escapedValue = "\(value)".addingPercentEncoding(withAllowedCharacters: .urlQueryValueAllowed) ?? "" return escapedKey + "=" + escapedValue } .joined(separator: "&") } } extension Dictionary where Key == String , Value == Any { fileprivate var asJSONString: String { let jsonData = try! JSONSerialization.data(withJSONObject: self, options: []) let jsonString = String(data: jsonData, encoding: .utf8)! return jsonString } } extension CharacterSet { fileprivate static let urlQueryValueAllowed: CharacterSet = { let generalDelimitersToEncode = ":#[]@" // does not include "?" or "/" due to RFC 3986 - Section 3.4 let subDelimitersToEncode = "!$&'()*+,;=" var allowed = CharacterSet.urlQueryAllowed allowed.remove(charactersIn: "\(generalDelimitersToEncode)\(subDelimitersToEncode)") return allowed }() }
[ -1 ]
dde9840293566cb2eddb24782e6c6413898f87e3
b99f31d5ec10a01f7078f6625c4daf767a1caa5d
/Assessment NotebookUITests/Assessment_NotebookUITests.swift
87b72ac0b85719d91c20e1cf0681b87263346991
[]
no_license
Cynthia7979/Assessment-Notebook
73b312bdba50eb43a5e929ede78325e99946e657
9e22235e7563e5f207323af0436e14b7be934cbb
refs/heads/main
2023-06-27T09:46:14.894951
2021-07-29T09:53:39
2021-07-29T09:53:39
390,432,471
0
0
null
null
null
null
UTF-8
Swift
false
false
1,458
swift
// // Assessment_NotebookUITests.swift // Assessment NotebookUITests // // Created by Xia He on 2021/7/29. // import XCTest class Assessment_NotebookUITests: 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, 385078, 180279, 319543, 163894, 352314, 213051, 376892, 32829, 286787, 352324, 237638, 385095, 352327, 393291, 163916, 368717, 311373, 196687, 278607, 311377, 254039, 426074, 368732, 180317, 32871, 352359, 221292, 278637, 319599, 385135, 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, 286957, 254189, 254193, 344312, 336121, 262403, 147716, 368908, 180494, 368915, 254228, 319764, 278805, 262419, 377116, 254250, 311596, 131374, 418095, 336177, 368949, 180534, 155968, 287040, 311622, 270663, 319816, 368969, 254285, 180559, 377168, 344402, 229716, 368982, 139641, 385407, 385409, 106893, 270733, 385423, 385433, 213402, 385437, 254373, 156069, 385448, 385449, 311723, 115116, 385463, 319931, 278974, 336319, 336323, 188870, 278988, 278992, 377309, 377310, 369121, 369124, 279014, 270823, 279017, 311787, 213486, 360945, 279030, 139766, 393719, 279033, 377337, 254459, 410108, 410109, 262657, 279042, 377346, 279053, 410126, 393745, 385554, 303635, 279060, 279061, 262673, 254487, 279066, 410138, 188957, 377374, 385569, 385578, 377388, 197166, 393775, 418352, 352831, 33344, 385603, 377419, 385612, 303693, 426575, 369236, 385620, 115287, 189016, 270938, 287327, 279143, 279150, 287345, 352885, 352886, 344697, 189054, 287359, 369285, 311944, 344714, 311950, 377487, 311953, 287379, 336531, 180886, 426646, 352921, 377499, 221853, 344737, 295591, 352938, 295598, 279215, 418479, 279218, 164532, 336565, 287418, 303802, 377531, 377534, 377536, 66243, 385737, 287434, 279249, 303826, 385745, 369365, 369366, 385751, 230105, 361178, 352989, 352990, 295649, 418529, 385763, 295653, 369383, 230120, 361194, 312046, 344829, 279293, 205566, 197377, 312076, 434956, 295698, 418579, 426772, 197398, 426777, 221980, 344864, 197412, 336678, 262952, 189229, 262957, 164655, 328495, 197424, 197428, 336693, 230198, 377656, 197433, 426809, 222017, 295745, 377669, 197451, 369488, 279379, 385878, 385880, 295769, 197467, 230238, 435038, 279393, 303973, 279398, 197479, 385895, 385901, 197489, 295799, 164730, 336765, 254851, 369541, 172936, 320394, 426894, 189327, 377754, 172971, 140203, 304050, 377778, 189362, 189365, 189373, 377789, 345030, 345034, 279499, 418774, 386007, 418781, 386016, 123880, 418793, 320495, 222193, 435185, 271351, 214009, 312313, 435195, 328701, 312317, 328705, 386049, 418819, 410629, 377863, 189448, 230411, 320526, 361487, 386068, 254997, 336928, 336930, 410665, 345137, 361522, 312372, 238646, 238650, 320571, 386108, 410687, 336962, 238663, 377927, 361547, 205911, 156763, 361570, 214116, 230500, 214119, 402538, 279659, 173168, 230514, 238706, 279666, 312435, 377974, 66684, 279686, 222344, 402568, 140426, 337037, 386191, 222364, 418975, 124073, 402618, 148674, 402632, 148687, 189651, 419028, 279766, 189656, 304353, 279780, 222441, 279789, 386288, 66802, 271607, 369912, 369913, 386296, 279803, 419066, 386300, 386304, 320769, 369929, 419097, 320795, 115997, 222496, 320802, 304422, 369964, 353581, 116014, 66863, 312628, 345397, 345398, 222523, 386363, 345418, 337226, 230730, 337228, 296269, 222542, 238928, 353617, 296274, 378186, 353611, 353612, 378201, 230757, 296304, 312688, 337280, 296328, 263561, 296330, 304523, 353672, 9618, 279955, 370066, 411028, 370072, 148899, 148900, 361928, 337359, 329168, 312785, 329170, 222674, 353751, 280025, 239069, 329181, 320997, 361958, 280042, 280043, 271850, 271853, 329198, 337391, 411119, 116209, 296434, 386551, 288252, 312830, 271880, 198155, 329231, 304655, 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, 288391, 419464, 411275, 239251, 345753, 198304, 255651, 337590, 370359, 280252, 280253, 321217, 239305, 296649, 403149, 313042, 345813, 370390, 272087, 345817, 337638, 181992, 345832, 345835, 288492, 141037, 313082, 288508, 288515, 173828, 395018, 116491, 395019, 395026, 124691, 116502, 435993, 345882, 411417, 321308, 255781, 362281, 378666, 403248, 378673, 182070, 182071, 345910, 436029, 345918, 337734, 280396, 272207, 272208, 337746, 395092, 345942, 362326, 370526, 345950, 362336, 255844, 296807, 214894, 362351, 313200, 214896, 313204, 124795, 182145, 280451, 67464, 305032, 337816, 124826, 329627, 239515, 354210, 436130, 436135, 313257, 10153, 362411, 370604, 362418, 411587, 280517, 362442, 346066, 231382, 354268, 403421, 436189, 329696, 354273, 403425, 190437, 354279, 436199, 174058, 247787, 329707, 354283, 296942, 337899, 247786, 436209, 313322, 124912, 239610, 346117, 182277, 354310, 354312, 354311, 43016, 403463, 313356, 436235, 419857, 305173, 436248, 223269, 346153, 354346, 313388, 124974, 272432, 403507, 378933, 378934, 436283, 288835, 403524, 436293, 313415, 239689, 436304, 329812, 223317, 411738, 272477, 280676, 313446, 395373, 288878, 215165, 346237, 436372, 329884, 362658, 215204, 436388, 125108, 133313, 395458, 338118, 436429, 346319, 321744, 379102, 387299, 18661, 379110, 338151, 125166, 149743, 379120, 125170, 436466, 411892, 395511, 436471, 313595, 125184, 436480, 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, 436613, 395653, 395660, 264591, 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, 420461, 313970, 346739, 346741, 420473, 297600, 166533, 363155, 346771, 264855, 363161, 289435, 436897, 248494, 166581, 355006, 363212, 363228, 322269, 436957, 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, 281434, 363354, 322396, 420702, 363361, 363362, 281444, 355173, 355174, 412516, 207724, 355182, 207728, 420722, 314240, 158594, 330627, 240517, 265094, 387977, 396171, 355216, 224146, 224149, 256918, 256919, 256920, 240543, 256934, 289720, 273336, 289723, 273341, 330688, 379845, 363462, 19398, 273353, 191445, 207839, 347104, 314343, 134124, 412653, 248815, 257007, 347122, 437245, 257023, 125953, 396292, 330759, 347150, 330766, 412692, 330789, 248871, 281647, 412725, 257093, 404550, 314437, 207954, 339031, 257126, 265318, 322664, 404582, 265323, 404589, 273523, 363643, 248960, 150656, 363658, 404622, 224400, 347286, 265366, 339101, 429216, 339106, 265381, 380069, 3243, 208044, 322733, 421050, 339131, 265410, 183492, 273616, 339167, 298209, 421102, 52473, 363769, 208123, 52476, 412926, 437504, 322826, 388369, 380178, 429332, 126229, 412963, 257323, 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, 380331, 241067, 314797, 380335, 355761, 421302, 134586, 380348, 216510, 216511, 380350, 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, 372261, 347693, 323120, 396850, 200245, 323126, 290359, 134715, 323132, 421437, 396865, 282182, 413255, 265800, 273992, 421452, 265809, 396885, 290391, 265816, 306777, 396889, 388699, 396896, 323171, 388712, 388713, 314997, 290425, 339579, 396927, 282248, 224907, 405140, 274071, 323226, 208547, 208548, 405157, 282279, 388775, 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, 241447, 167720, 421680, 282418, 421686, 274234, 241471, 339782, 315209, 159563, 241494, 339799, 307038, 274276, 282471, 274288, 372592, 274296, 339840, 315265, 372625, 282517, 298912, 118693, 438186, 126896, 380874, 372699, 323554, 380910, 380922, 380923, 274432, 372736, 241695, 315431, 430120, 102441, 315433, 282671, 430127, 405552, 241717, 249912, 225347, 307269, 233548, 176209, 315477, 53334, 381013, 200795, 356446, 323678, 438374, 176231, 233578, 438378, 217194, 422000, 249976, 266361, 422020, 168069, 381061, 168070, 381071, 241809, 323730, 430231, 200856, 422044, 192670, 192671, 299166, 258213, 299176, 323761, 184498, 430263, 266427, 299208, 266447, 372943, 258263, 356575, 307431, 438512, 372979, 389364, 381173, 135416, 356603, 184574, 217352, 266504, 61720, 381210, 315674, 282908, 389406, 282912, 233761, 438575, 315698, 266547, 332084, 397620, 438583, 127292, 438592, 332100, 323914, 201037, 397650, 348499, 250196, 348501, 389465, 332128, 242027, 242028, 110955, 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, 291359, 348709, 348710, 397872, 283185, 234037, 340539, 266812, 348741, 381515, 348748, 430681, 332379, 242274, 184938, 373357, 184942, 176751, 389744, 356983, 356984, 209529, 356990, 291455, 373377, 422529, 152196, 201348, 356998, 348807, 356999, 316044, 316050, 275102, 340645, 176805, 176810, 160441, 422591, 291529, 225996, 135888, 242385, 234216, 373485, 373486, 21239, 348921, 234233, 275193, 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, 398244, 185252, 422825, 381872, 177074, 398268, 349122, 398275, 127945, 373705, 340960, 398305, 340967, 398313, 234476, 127990, 349176, 201721, 349179, 234499, 357380, 398370, 357413, 357420, 300087, 21567, 308288, 398405, 349254, 250955, 218187, 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, 242955, 439563, 414989, 349458, 259346, 259347, 382243, 382246, 292145, 382257, 382264, 333115, 193853, 193858, 251212, 234830, 406862, 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, 325246, 415360, 333438, 210569, 415369, 431754, 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, 284460, 399148, 202541, 431918, 153392, 431935, 415555, 325444, 153416, 325449, 341837, 415566, 431955, 325460, 317268, 341846, 300893, 259937, 382820, 276326, 415592, 292713, 292719, 325491, 341878, 333687, 350072, 276343, 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, 358418, 153618, 178215, 325675, 243763, 358455, 325695, 399433, 333902, 104534, 194667, 260206, 432241, 284789, 374913, 374914, 415883, 333968, 153752, 333990, 104633, 227517, 260285, 268479, 374984, 301270, 301271, 334049, 325857, 268515, 383208, 317676, 260337, 260338, 432373, 375040, 309504, 260355, 432387, 375052, 194832, 325904, 334104, 391448, 268570, 178459, 186660, 334121, 317738, 325930, 358698, 260396, 358707, 432435, 178485, 358710, 14654, 268609, 227655, 383309, 383327, 391521, 366948, 416101, 416103, 383338, 432503, 211327, 432511, 227721, 285074, 252309, 39323, 285083, 317851, 285089, 375211, 334259, 129461, 342454, 358844, 293309, 317889, 326083, 416201, 129484, 326093, 154061, 416206, 285152, 432608, 195044, 391654, 432616, 334315, 375281, 293368, 317949, 334345, 432650, 309770, 342537, 342549, 342560, 416288, 350758, 350759, 358951, 358952, 293420, 219694, 219695, 375345, 244279, 309831, 375369, 375373, 416334, 301647, 416340, 244311, 260705, 416353, 375396, 268901, 244326, 244345, 334473, 375438, 326288, 285348, 293552, 342705, 285362, 383668, 342714, 39616, 383708, 342757, 269036, 432883, 342775, 203511, 383740, 432894, 359166, 375552, 162559, 228099, 285443, 285450, 383755, 326413, 285467, 326428, 318247, 318251, 342827, 391980, 375610, 301883, 342846, 416577, 416591, 244569, 375644, 252766, 293729, 351078, 342888, 392057, 211835, 269179, 392065, 260995, 400262, 392071, 424842, 236427, 252812, 400271, 392080, 400282, 7070, 211871, 359332, 359333, 293801, 326571, 252848, 326580, 261045, 261046, 326586, 359365, 211913, 326602, 252878, 56270, 342990, 433104, 359380, 433112, 433116, 359391, 343020, 187372, 203758, 383980, 383994, 384004, 433166, 384015, 433173, 293911, 326684, 252959, 384031, 375848, 318515, 203829, 261191, 375902, 375903, 392288, 253028, 351343, 187505, 138354, 187508, 384120, 302202, 285819, 343166, 285823, 384127, 392320, 285833, 285834, 318602, 228492, 253074, 326803, 187539, 359574, 285850, 351389, 302239, 253098, 302251, 367791, 367792, 367798, 64699, 294075, 228541, 343230, 367809, 253124, 113863, 351445, 310496, 195809, 253168, 351475, 351489, 367897, 367898, 245018, 130342, 130344, 130347, 261426, 212282, 294210, 359747, 359748, 114022, 253288, 425327, 425331, 327030, 163190, 384379, 253316, 294278, 384391, 318860, 253339, 318876, 253340, 343457, 245160, 359860, 359861, 343480, 310714, 228796, 228804, 425417, 310731, 327122, 425434, 310747, 310758, 253431, 359931, 187900, 343552, 245249, 228868, 409095, 294413, 359949, 253456, 302613, 253462, 146976, 245290, 245291, 343606, 163385, 425534, 138817, 147011, 147020, 196184, 179800, 212574, 343646, 204386, 155238, 204394, 138862, 310896, 294517, 188021, 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, 237397, 376661, 368471, 425820, 368486, 384871, 409446, 40809, 368489, 425832, 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 ]
b4fab0823bb91c20e225b69f5b2bae9ba239ab94
db3320f6fbdda276f9dae445c127760ae3ace5cd
/Week2/RevBullsEye/RevBullsEye/HighScoreAnimation.swift
8941151baf02f3cad74b67196c0982f075a928f8
[ "MIT" ]
permissive
byaruhaf/RWiOSBootcamp
1a9d4265d56296b5ac536d9e00c9bf8482bb3690
2056a2f34128bdc5d15908257aa5a49a45baee80
refs/heads/main
2022-11-29T08:05:13.781627
2020-08-13T11:51:27
2020-08-13T11:51:27
266,933,174
7
2
null
null
null
null
UTF-8
Swift
false
false
2,547
swift
// // HighScoreAnimation.swift // BullsEye // // Created by Franklin Byaruhanga on 07/06/2020. // Copyright © 2020 Ray Wenderlich. All rights reserved. // https://medium.com/@prabhu_irl/particle-effects-in-swift-using-caemitterlayer-79fb88452724 import UIKit enum Colors { static let red = UIColor(red: 1.0, green: 0.0, blue: 77.0/255.0, alpha: 1.0) static let blue = UIColor.blue static let green = UIColor(red: 35.0/255.0 , green: 233/255, blue: 173/255.0, alpha: 1.0) static let yellow = UIColor(red: 1, green: 209/255, blue: 77.0/255.0, alpha: 1.0) } enum Images { static let box = UIImage(named: "Box")! static let triangle = UIImage(named: "Triangle")! static let circle = UIImage(named: "Circle")! static let swirl = UIImage(named: "Spiral")! } class HighScoreAnimation { var emitter = CAEmitterLayer() var colors:[UIColor] = [ Colors.red, Colors.blue, Colors.green, Colors.yellow ] var images:[UIImage] = [ Images.box, Images.triangle, Images.circle, Images.swirl ] var velocities:[Int] = [ 100, 90, 150, 200 ] func generateEmitterCells() -> [CAEmitterCell] { var cells:[CAEmitterCell] = [CAEmitterCell]() for index in 0..<16 { let cell = CAEmitterCell() cell.birthRate = 4.0 cell.lifetime = 14.0 cell.lifetimeRange = 0 cell.velocity = CGFloat(getRandomVelocity()) cell.velocityRange = 0 cell.emissionLongitude = CGFloat(Double.pi) cell.emissionRange = 0.5 cell.spin = 3.5 cell.spinRange = 0 cell.color = getNextColor(i: index) cell.contents = getNextImage(i: index) cell.scaleRange = 0.25 cell.scale = 0.1 cells.append(cell) } return cells } private func getRandomVelocity() -> Int { return velocities[getRandomNumber()] } private func getRandomNumber() -> Int { return Int(arc4random_uniform(4)) } private func getNextColor(i:Int) -> CGColor { if i <= 4 { return colors[0].cgColor } else if i <= 8 { return colors[1].cgColor } else if i <= 12 { return colors[2].cgColor } else { return colors[3].cgColor } } private func getNextImage(i:Int) -> CGImage { return images[i % 4].cgImage! } }
[ -1 ]
5e0aad485be36b9aa1f5c9f5ea9c2429fb339147
22a7b9de53559c9477748952bd20d9249af2a01d
/Sources/JDCloudSDKVpc/API/ModifyElasticIpRequest.swift
95b3bed81d101bbde44a966f0e78d73c671a9876
[ "Apache-2.0" ]
permissive
shijunLee/jdcloud-sdk-ios
2c7ecd959c2ee0c85611c662b5f0d7ab068dcff7
0df62bd84f2315b3e56dc01c35a328647430ec96
refs/heads/master
2020-04-13T18:29:58.041118
2018-12-28T06:40:33
2018-12-28T06:40:33
null
0
0
null
null
null
null
UTF-8
Swift
false
false
1,703
swift
/* Copyright 2018 JDCLOUD.COM 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. 弹性公网ip 弹性公网ip相关接口 OpenAPI spec version: v1 Contact: NOTE: This class is auto generated by the jdcloud code generator program. */ import Foundation import JDCloudSDKCore /// 修改弹性IP @objc(ModifyElasticIpRequest) public class ModifyElasticIpRequest:JdCloudRequest { /// 弹性公网IP的限速(单位:Mbps),取值范围为[1-200] var bandwidthMbps:Int /// ElasticIp ID var elasticIpId:String public init(regionId: String,bandwidthMbps:Int,elasticIpId:String){ self.bandwidthMbps = bandwidthMbps self.elasticIpId = elasticIpId super.init(regionId: regionId) } enum ModifyElasticIpRequestRequestCodingKeys: String, CodingKey { case bandwidthMbps case elasticIpId } public override func encode(to encoder: Encoder) throws { var encoderContainer = encoder.container(keyedBy: ModifyElasticIpRequestRequestCodingKeys.self) try encoderContainer.encode(bandwidthMbps, forKey: .bandwidthMbps) try encoderContainer.encode(elasticIpId, forKey: .elasticIpId) } }
[ -1 ]
82d9b6736dc74d25ef5c7e7bf046009eaad5eb7d
cfb176c60ebcfb3b83cf2469e8c451f8f4ff5f7d
/TestApiYoutube/Model/ModelHome/Items.swift
7c6e490d65fd7652ab389b33e4ff4a84224c9e71
[]
no_license
liemhd/Clone-Youtube
b7c4ef1b26ac034bd2ccbf3e3fe6854e0853de27
e3b57bee4c6164b5ab706aa10cf12d893511ce6e
refs/heads/master
2020-07-27T07:41:49.413402
2019-09-17T09:44:59
2019-09-17T09:44:59
209,018,827
0
0
null
null
null
null
UTF-8
Swift
false
false
236
swift
// // Items.swift // TestApiYoutube // // Created by Apple on 7/12/19. // Copyright © 2019 DuyLiem. All rights reserved. // import Foundation class Items { var kind: String? var etag: String? var id: String? }
[ -1 ]
6cf9ba297d00f8d63c8d86b7cc7b8675de785693
ecf4e58e07e45c8f6cf2ec1d810602c7b5c62172
/MapApp/Ui/Utils/Logger.swift
cb06c12610f365e306a6ae3ccda2f0cfbcf5edb3
[]
no_license
jorgesanji/MapApp
3f2d7316b4a922f3cce0a1570d20ff3be9c93602
583a387faea54866e197402a82d4311fbf338d2d
refs/heads/master
2021-05-03T11:40:53.849906
2018-02-14T13:56:05
2018-02-14T13:56:05
120,210,850
0
0
null
null
null
null
UTF-8
Swift
false
false
228
swift
// // Logger.swift // MapApp // // Created by Jorge Sanmartin on 1/31/18. // Copyright © 2018 Jorge Sanmartin. All rights reserved. // import Foundation class Logger{ static func log(_ name:String){ print(name) } }
[ -1 ]
4bce579648dfcdc84ee5e35b3b1a9cce2a545f81
01a094c3aceb2b83c0990f60d1ce2ee2d5fcd3c5
/PortalIntents/RegistrarOfficeIntentHandler.swift
baa0ced7ab2baa0234dfbabc777e9f387cfbcf3d
[]
no_license
kjwamlex/UWPortalRedesign
570bd3ce8a2188771dc87aa2e4de5869c1e3927a
f0c3e5652e5412de1f65f666fb493593389ccb08
refs/heads/master
2020-04-22T19:48:45.262428
2019-06-27T20:39:57
2019-06-27T20:39:57
170,620,041
8
0
null
null
null
null
UTF-8
Swift
false
false
859
swift
// // RegistrarOfficeIntentHandler.swift // PortalIntents // // Created by Joonwoo KIM on 2018-08-06. // Copyright © 2018 Joonwoo KIM. All rights reserved. // import Foundation import Intents class RegistrarOfficeIntentHandler: INExtension, RegistrarOfficeIntentHandling { func confirm(intent: RegistrarOfficeIntent, completion: @escaping (RegistrarOfficeIntentResponse) -> Void) { //completion(NextClassIntentResponse.init(code: .ready, userActivity: nil)) completion(RegistrarOfficeIntentResponse.init(code: .success, userActivity: nil)) } func handle(intent: RegistrarOfficeIntent, completion: @escaping (RegistrarOfficeIntentResponse) -> Void) { completion(RegistrarOfficeIntentResponse.init(code: .success, userActivity: nil)) } }
[ -1 ]
b3b0d5538ba0f066b6ce7ecf98e1e4200a5d45d8
94b4d2c07d1d080fafd33de012c0c7679108f6cf
/iDog/Base/Extensions/UIImageViewExtension.swift
eae1cbf34e6e03a5129be60efad63e362677e28d
[]
no_license
RxDx/iDog
1ba7b3bf1dc14b133e805e8c98f355837da81128
30caf7b685bba1ea039fa3e3a47f92eb81a01b09
refs/heads/master
2021-08-22T10:15:14.882442
2017-11-30T00:20:07
2017-11-30T00:20:07
112,543,187
1
0
null
null
null
null
UTF-8
Swift
false
false
317
swift
// // UIImageViewExtension.swift // SampleApp // // Created by Rodrigo Dumont on 10/08/17. // Copyright © 2017 RxDx. All rights reserved. // import UIKit import Kingfisher extension UIImageView { func loadFrom(url: String?) { let url = URL(string: url ?? "") kf.setImage(with: url) } }
[ -1 ]
69b440b3d23be0fa9531e604fd5816c151a212ed
b5f328b42579a1d9def07364dcd592c97cd39efc
/FH/AppDelegate.swift
9741562e74d4c85354f3d15e61b98f5a79d2a2e4
[]
no_license
piposchael/fh-survival
21ce121f45328c77a9a7f5a034f74560e425e53a
9a935d60abf7657d68d140ad39f81397f8396c3e
refs/heads/master
2021-01-19T00:57:46.891821
2016-07-26T23:43:32
2016-07-26T23:43:32
64,191,099
0
0
null
null
null
null
UTF-8
Swift
false
false
2,377
swift
// // AppDelegate.swift // FH // // Created by Philipp Schael on 29.06.16. // Copyright © 2016 Philipp Schael. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { // Override point for customization after application launch. let pageControl = UIPageControl.appearance() pageControl.pageIndicatorTintColor = UIColor.whiteColor() pageControl.currentPageIndicatorTintColor = UIColor.blackColor() return true } func applicationWillResignActive(application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. } func applicationDidEnterBackground(application: UIApplication) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } func applicationWillEnterForeground(application: UIApplication) { // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. } func applicationDidBecomeActive(application: UIApplication) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } func applicationWillTerminate(application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } }
[ 229380, 229383, 229385, 278539, 229388, 278542, 229391, 278545, 229394, 278548, 229397, 229399, 229402, 278556, 229405, 278559, 278564, 294950, 229415, 229417, 327722, 237613, 229426, 229428, 311349, 286774, 229432, 286776, 286778, 319544, 204856, 286791, 237640, 278605, 286797, 311375, 196692, 319573, 311383, 278623, 278626, 319590, 311400, 278635, 303212, 278639, 278648, 131192, 237693, 327814, 131209, 417930, 303241, 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, 278792, 286987, 319757, 311569, 286999, 319770, 287003, 287006, 287009, 287012, 287014, 287016, 287019, 311598, 287023, 262448, 311601, 155966, 278849, 319809, 319810, 319814, 319818, 311628, 287054, 319822, 278865, 196963, 196969, 139638, 213367, 106872, 319872, 311683, 319879, 311693, 65943, 319898, 311719, 278952, 139689, 278957, 311728, 278967, 180668, 311741, 278975, 319938, 278980, 278983, 319945, 278986, 278990, 278994, 311767, 279003, 279006, 188895, 279010, 287202, 279015, 172520, 319978, 279020, 279023, 311791, 172529, 279027, 319989, 164343, 279035, 311804, 287230, 279040, 303617, 287234, 279045, 172550, 287238, 172552, 303623, 320007, 279051, 172558, 279055, 279058, 279063, 279067, 172572, 279072, 172577, 295459, 172581, 295461, 279082, 279084, 172591, 172598, 279095, 172607, 172609, 172612, 377413, 172614, 172618, 303690, 33357, 279124, 172634, 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, 287381, 311957, 221850, 287386, 164509, 303773, 295583, 230045, 287390, 287394, 303780, 287398, 279208, 287400, 172714, 279212, 230061, 172721, 287409, 66227, 303797, 189114, 287419, 328381, 279231, 287423, 328384, 287427, 107208, 172748, 287436, 107212, 287440, 295633, 172755, 303827, 279255, 279258, 303835, 213724, 189149, 303838, 279267, 295654, 279272, 230128, 312048, 312050, 230131, 205564, 303871, 230146, 328453, 295685, 230154, 33548, 312077, 295695, 295701, 230169, 369433, 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, 295808, 304005, 213895, 320391, 304007, 304009, 304011, 304013, 213902, 279438, 295822, 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, 238641, 238652, 238655, 230465, 238658, 336964, 296004, 205895, 320584, 238666, 296021, 402518, 230497, 296036, 296040, 361576, 205931, 296044, 164973, 279661, 205934, 312432, 279669, 337018, 189562, 279679, 279683, 222340, 205968, 296084, 238745, 304285, 238756, 205991, 222377, 165035, 337067, 238766, 165038, 230576, 238770, 304311, 350308, 230592, 279750, 230600, 230607, 148690, 279769, 304348, 279777, 304354, 296163, 320740, 279781, 304360, 279788, 320748, 279790, 304370, 296189, 320771, 312585, 296202, 296205, 230674, 320786, 230677, 296213, 296215, 214294, 320792, 304416, 230689, 173350, 312622, 296243, 312630, 222522, 222525, 312639, 296255, 296259, 378181, 230727, 238919, 320840, 222545, 230739, 337244, 222556, 230752, 230760, 173418, 410987, 230763, 230768, 296305, 312692, 230773, 279929, 304506, 181626, 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, 230865, 370130, 288210, 288212, 280021, 288214, 222676, 239064, 288217, 288218, 280027, 329177, 288220, 239070, 288224, 370146, 280034, 280036, 288226, 280038, 288229, 288230, 288232, 288234, 288236, 288238, 288240, 291754, 288242, 296435, 288244, 288250, 402942, 206336, 296450, 230916, 230919, 370187, 304651, 304653, 230923, 230940, 222752, 108066, 296486, 296488, 157229, 230961, 157236, 288320, 288325, 124489, 280145, 288338, 280149, 280152, 288344, 239194, 280158, 403039, 370272, 312938, 280183, 280185, 280188, 280191, 280194, 116354, 280208, 280211, 288408, 280218, 280222, 280232, 321195, 296622, 321200, 337585, 296626, 296634, 296637, 313027, 280260, 206536, 280264, 206539, 206541, 206543, 280276, 321239, 280283, 313052, 288478, 313055, 321252, 313066, 280302, 288494, 321266, 419570, 288499, 288502, 280314, 288510, 124671, 67330, 280324, 198405, 288519, 280331, 198416, 296723, 116503, 321304, 329498, 296731, 321311, 313121, 313123, 304932, 321316, 280363, 141101, 165678, 280375, 321336, 288576, 345921, 280388, 304968, 280393, 280402, 173907, 313176, 280419, 321381, 296812, 313201, 1920, 255873, 305028, 280454, 247688, 280458, 280464, 124817, 280468, 239510, 280473, 124827, 214940, 247709, 214944, 313258, 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, 223327, 280671, 149599, 321634, 149603, 313451, 223341, 280687, 313458, 280691, 313464, 329850, 321659, 288895, 321670, 215175, 141455, 141459, 313498, 288936, 100520, 288940, 280755, 288947, 321717, 280759, 280764, 280769, 280771, 280774, 280776, 313548, 321740, 280783, 280786, 280788, 313557, 280793, 280796, 280798, 338147, 280804, 280807, 157930, 280811, 280817, 280819, 157940, 125171, 182517, 280823, 280825, 280827, 280830, 280831, 280833, 280835, 125187, 125191, 280852, 125207, 125209, 321817, 125218, 321842, 223539, 125239, 280888, 280891, 289087, 280897, 280900, 239944, 305480, 280906, 239947, 305485, 305489, 280919, 354653, 313700, 280937, 313705, 190832, 280946, 313720, 280956, 239997, 280959, 313731, 199051, 240011, 289166, 240017, 297363, 190868, 297365, 240021, 297368, 297372, 141725, 297377, 289186, 289201, 240052, 289207, 305594, 289210, 281024, 289218, 289221, 289227, 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, 289317, 281127, 281135, 158262, 158266, 289342, 281154, 322115, 158283, 281163, 281179, 199262, 338532, 281190, 199273, 281196, 158317, 313973, 281210, 158347, 133776, 314003, 117398, 314007, 289436, 174754, 330404, 289448, 133801, 314029, 314033, 240309, 133817, 314047, 314051, 199364, 297671, 199367, 289493, 363234, 289513, 289522, 289525, 289532, 322303, 322310, 264969, 322314, 322318, 281361, 281372, 322341, 215850, 281388, 281401, 289593, 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, 289700, 289712, 281529, 289724, 52163, 281567, 289762, 322534, 281581, 183277, 322550, 322610, 314421, 281654, 314427, 207937, 314433, 207949, 322642, 281691, 314461, 281702, 281704, 314474, 281708, 281711, 289912, 248995, 306341, 306347, 306354, 142531, 199877, 289991, 306377, 363742, 363745, 298216, 330988, 216303, 322801, 388350, 257302, 363802, 199978, 314671, 298292, 298294, 216376, 298306, 380226, 281923, 224587, 224594, 216404, 306517, 314714, 224603, 159068, 314718, 314723, 281960, 150890, 306539, 314732, 314736, 290161, 306549, 298358, 314743, 306552, 290171, 314747, 298365, 290174, 306555, 224641, 281987, 298372, 314756, 281990, 224647, 298377, 314763, 142733, 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, 192008, 323084, 282127, 290321, 282130, 282133, 290325, 241175, 290328, 290332, 241181, 282142, 282144, 290344, 306731, 290349, 290351, 290356, 282186, 224849, 282195, 282201, 306778, 159324, 159330, 314979, 298598, 224875, 241260, 257658, 315016, 282249, 290445, 324757, 282255, 282261, 298651, 282269, 323229, 298655, 323231, 61092, 282277, 282295, 282300, 323260, 323266, 282310, 323273, 282319, 306897, 241362, 282328, 306904, 298714, 52959, 216801, 282337, 241380, 216806, 323304, 282345, 12011, 282356, 323318, 282364, 282367, 306945, 241412, 323333, 282376, 216842, 323345, 282388, 282392, 184090, 315167, 315169, 282402, 315174, 323367, 241448, 315176, 282410, 241450, 306988, 315184, 315190, 241464, 282425, 159545, 298811, 307009, 413506, 307012, 315211, 282446, 307027, 315221, 282454, 315223, 241496, 241498, 307035, 307040, 282465, 241509, 110438, 298860, 110445, 282478, 315249, 110450, 315251, 282481, 315253, 315255, 339838, 282499, 315267, 315269, 241544, 282505, 241546, 241548, 298896, 298898, 282514, 44948, 298901, 241556, 282520, 241560, 241563, 241565, 241567, 241569, 282531, 241574, 282537, 298922, 241581, 241583, 323504, 241586, 282547, 241588, 241590, 241592, 241598, 290751, 241600, 241605, 241610, 298975, 241632, 298984, 241643, 298988, 241646, 241649, 241652, 323574, 290807, 241661, 299006, 282623, 315396, 241669, 315397, 282632, 282639, 282645, 241693, 282654, 241701, 102438, 217127, 282669, 323630, 282681, 290877, 282687, 159811, 315463, 315466, 192589, 307278, 307287, 315482, 315483, 217179, 192605, 200801, 299105, 217188, 299109, 307303, 315495, 45163, 307307, 315502, 192624, 307314, 299126, 233591, 307338, 233613, 241813, 307352, 299164, 184479, 299167, 184481, 307370, 307372, 307374, 307376, 299185, 323763, 176311, 299191, 307385, 307386, 258235, 176316, 307388, 307390, 184503, 299200, 307394, 307396, 299204, 184518, 323784, 307409, 307411, 176343, 233701, 307432, 282881, 282893, 291089, 282906, 291104, 233766, 307508, 315701, 307510, 332086, 307512, 151864, 307515, 282942, 307518, 151874, 282947, 282957, 323917, 110926, 233808, 323921, 315733, 323926, 233815, 315739, 299357, 242018, 242024, 299373, 315757, 250231, 242043, 315771, 291197, 299391, 291202, 299398, 242057, 291212, 299405, 291222, 283033, 291226, 242075, 315801, 291231, 61855, 283042, 291238, 291241, 127403, 127405, 291247, 127407, 299440, 299444, 127413, 283062, 291254, 127417, 291260, 283069, 127421, 127424, 299457, 127431, 283080, 127434, 176592, 315856, 315860, 176597, 127447, 299481, 160221, 176605, 242143, 291299, 242152, 291305, 127466, 176620, 127474, 291314, 291317, 135672, 291323, 233979, 291330, 283142, 127497, 233994, 135689, 234003, 234006, 152087, 127511, 283161, 242202, 234010, 135707, 242206, 242208, 291361, 135717, 291378, 234038, 152118, 70213, 242250, 111193, 242275, 299620, 242279, 168562, 184952, 135805, 291456, 135808, 373383, 135820, 316051, 225941, 316054, 135834, 373404, 299677, 135839, 299680, 225954, 242343, 209576, 242345, 373421, 299706, 135870, 135873, 135876, 299720, 299723, 225998, 299726, 226002, 226005, 119509, 226008, 201444, 283368, 234219, 283372, 381677, 226037, 283382, 234231, 316151, 234236, 226045, 234239, 242431, 209665, 234242, 299778, 242436, 226053, 234246, 226056, 234248, 291593, 242443, 234252, 242445, 234254, 291601, 234258, 242450, 242452, 234261, 348950, 201496, 234264, 234266, 234269, 283421, 234272, 234274, 152355, 234278, 299814, 283432, 234281, 234284, 234287, 283440, 185138, 234292, 234296, 234298, 283452, 160572, 234302, 234307, 234309, 234313, 316233, 316235, 234316, 283468, 242511, 234319, 234321, 234324, 185173, 201557, 234329, 234333, 308063, 234336, 234338, 242530, 349027, 234341, 234344, 234347, 177004, 234350, 324464, 234353, 152435, 234356, 234358, 234362, 226171, 234364, 234368, 234370, 201603, 234373, 226182, 234375, 226185, 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, 234434, 324548, 226245, 234437, 234439, 234443, 275406, 234446, 234449, 316370, 234452, 234455, 234459, 234461, 234464, 234467, 234470, 168935, 5096, 324585, 234475, 234478, 316400, 234481, 316403, 234484, 234485, 324599, 234487, 234490, 234493, 234496, 316416, 234501, 275462, 308231, 234504, 234507, 234510, 234515, 300054, 234519, 316439, 234520, 234523, 234528, 300066, 234532, 300069, 234535, 234537, 234540, 144430, 234543, 234546, 275508, 234549, 300085, 300088, 234556, 234558, 316479, 234561, 316483, 160835, 234563, 308291, 234568, 234570, 316491, 300108, 234572, 234574, 300115, 234580, 234581, 275545, 242777, 234585, 234590, 234593, 234595, 300133, 234597, 234601, 300139, 234605, 234607, 160879, 275569, 234610, 300148, 234614, 398455, 144506, 275579, 234618, 234620, 234623, 226433, 234627, 275588, 234629, 242822, 234634, 275594, 234636, 177293, 234640, 275602, 234643, 226453, 275606, 234647, 275608, 308373, 234650, 234648, 308379, 283805, 234653, 324766, 119967, 234657, 300189, 324768, 242852, 283813, 234661, 300197, 234664, 275626, 234667, 316596, 308414, 234687, 300226, 308418, 226500, 234692, 300229, 308420, 283844, 283850, 300234, 300238, 300241, 316625, 300243, 300245, 316630, 300248, 300253, 300256, 300258, 300260, 234726, 300263, 300265, 161003, 300267, 300270, 300272, 120053, 300278, 316663, 275703, 300284, 275710, 300287, 300289, 292097, 300292, 300294, 275719, 177419, 300299, 283917, 300301, 242957, 177424, 275725, 349464, 283939, 259367, 283951, 292143, 300344, 226617, 283963, 243003, 226628, 283973, 300357, 283983, 316758, 357722, 316766, 292192, 316768, 218464, 292197, 316774, 284010, 136562, 324978, 275834, 275836, 275840, 316803, 316806, 316811, 316814, 226703, 300433, 234899, 226709, 357783, 316824, 316826, 144796, 300448, 144807, 144810, 284076, 144812, 144814, 144820, 284084, 284087, 292279, 144826, 144828, 144830, 144832, 144835, 144837, 38342, 144839, 144841, 144844, 144847, 144852, 144855, 103899, 300507, 333280, 218597, 292329, 300523, 259565, 300527, 259567, 308720, 226802, 292338, 316917, 308727, 300537, 316947, 308757, 284191, 284194, 284196, 235045, 284199, 284204, 284206, 284209, 284211, 284213, 194103, 284215, 284218, 226877, 284223, 284226, 243268, 292421, 226886, 284231, 128584, 284228, 284234, 276043, 317004, 366155, 284238, 226895, 284241, 194130, 284243, 292433, 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, 276122, 284314, 284316, 276127, 284320, 284322, 284327, 276137, 284329, 284331, 317098, 284333, 284335, 276144, 284337, 284339, 284343, 284346, 284350, 276160, 358080, 284354, 358083, 276166, 284358, 358089, 276170, 284362, 276175, 284368, 276177, 284370, 317138, 284372, 358098, 284377, 276187, 284379, 284381, 284384, 284386, 358114, 358116, 276197, 317158, 358119, 284392, 325353, 284394, 358122, 284397, 276206, 284399, 358126, 358128, 358133, 358135, 276216, 358140, 284413, 358142, 284418, 358146, 317187, 317191, 284428, 300816, 300819, 317207, 284440, 186139, 300828, 300830, 276255, 325408, 284449, 300834, 300832, 227109, 317221, 358183, 276268, 300845, 194351, 243504, 284469, 276280, 325436, 276291, 366406, 276295, 153417, 358224, 284499, 276308, 284502, 317271, 178006, 276315, 292700, 284511, 227175, 300912, 284529, 292721, 300915, 284533, 292729, 317306, 284540, 292734, 325512, 276365, 284564, 358292, 284566, 350106, 284572, 276386, 284579, 276388, 358312, 284585, 292776, 276395, 317353, 292784, 358326, 161718, 276410, 276411, 358330, 276418, 301009, 276433, 301011, 301013, 292823, 301015, 301017, 358360, 292828, 276446, 153568, 276448, 276452, 276455, 292839, 292843, 276460, 276464, 178161, 227314, 276466, 276472, 317435, 276476, 276479, 276482, 276485, 317446, 276490, 276496, 317456, 317458, 243733, 243740, 317472, 325666, 243751, 292904, 276528, 243762, 309298, 325685, 276539, 235579, 235581, 178238, 325692, 276544, 284739, 292934, 276553, 243785, 350293, 350295, 194649, 227418, 309337, 350302, 227423, 194654, 194657, 178273, 276579, 227426, 194660, 227430, 276583, 309346, 309348, 276586, 309350, 309352, 309354, 276590, 350313, 350316, 350321, 284786, 276595, 227440, 301167, 350325, 350328, 292985, 292989, 292993, 301185, 350339, 317570, 317573, 350342, 350345, 276617, 350349, 317584, 325777, 350354, 350357, 350359, 350362, 276638, 350366, 284837, 350375, 350379, 350381, 350383, 129200, 350385, 350387, 350389, 350395, 350397, 350399, 227520, 227522, 350402, 301252, 350406, 227529, 309450, 301258, 276685, 276689, 309462, 301272, 276699, 309468, 309471, 301283, 317672, 276713, 325867, 227571, 309491, 309494, 243960, 276735, 227583, 227587, 276739, 276742, 227593, 227596, 325910, 309530, 342298, 276766, 211232, 317729, 276775, 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, 276907, 235955, 276917, 293304, 293307, 293314, 309707, 317910, 293336, 317917, 293343, 358880, 276961, 227810, 293346, 276964, 293352, 236013, 301562, 317951, 309764, 301575, 121352, 236043, 342541, 113167, 277011, 317971, 309781, 309779, 227877, 227879, 293417, 227882, 309804, 293421, 105007, 236082, 285236, 277054, 129603, 318020, 301639, 301643, 277071, 285265, 399955, 309844, 277080, 309849, 285277, 285282, 326244, 318055, 277100, 277106, 121458, 170619, 309885, 309888, 277122, 146052, 277128, 285320, 301706, 318092, 326285, 318094, 334476, 277136, 277139, 227992, 285340, 318108, 227998, 318110, 137889, 383658, 285357, 318128, 277170, 342707, 154292, 277173, 293555, 318132, 285368, 277177, 277181, 277187, 277191, 277194, 277196, 277201, 137946, 113378, 228069, 277223, 342760, 285417, 56043, 277232, 228081, 56059, 310015, 285441, 310020, 285448, 228113, 285459, 277273, 293659, 326430, 228128, 285474, 293666, 228135, 318248, 277291, 293677, 318253, 285489, 293685, 285494, 301880, 301884, 310080, 293696, 277314, 277317, 277322, 293706, 277329, 301911, 277337, 301913, 301921, 400236, 236397, 162671, 310134, 277368, 15224, 236408, 416639, 416640, 113538, 310147, 416648, 277385, 39817, 187274, 301972, 424853, 277405, 277411, 310179, 293798, 293802, 236460, 277426, 293811, 293820, 203715, 293849, 293861, 228327, 228328, 228330, 318442, 277486, 326638, 318450, 293876, 293877, 285686, 56313, 285690, 302073, 244731, 293882, 302075, 293887, 277504, 277507, 277511, 293899, 277519, 277526, 302105, 293917, 293939, 318516, 277561, 277564, 310336, 293956, 277573, 228422, 310344, 277577, 293960, 277583, 203857, 310355, 293971, 236632, 277594, 138332, 277598, 285792, 277601, 310374, 203879, 277608, 228460, 318573, 203886, 187509, 285815, 285817, 367737, 285821, 302205, 285824, 392326, 285831, 253064, 302218, 285835, 162964, 384148, 302231, 285849, 302233, 285852, 302237, 285854, 285856, 285862, 277671, 302248, 64682, 277678, 294063, 294065, 302258, 277687, 294072, 318651, 294076, 277695, 244930, 302275, 130244, 302277, 228550, 302282, 310476, 302285, 302288, 310481, 302290, 203987, 302292, 302294, 302296, 384222, 310498, 285927, 318698, 302315, 195822, 228592, 294132, 138485, 228601, 228606, 64768, 310531, 285958, 138505, 228617, 318742, 277798, 130345, 113964, 285997, 285999, 113969, 318773, 318776, 286010, 417086, 286016, 294211, 302403, 384328, 326991, 179547, 146784, 302436, 294246, 327015, 310632, 327017, 351594, 351607, 310648, 310651, 310657, 351619, 294276, 310659, 327046, 253320, 310665, 318858, 310672, 351633, 310689, 130468, 228776, 277932, 310703, 310710, 130486, 310712, 310715, 302526, 228799, 64966, 245191, 163272, 302534, 310727, 302541, 302543, 310737, 228825, 163290, 286169, 310749, 310755, 187880, 286188, 310764, 310772, 212472, 40443, 286203, 310780, 228864, 40448, 286214, 228871, 65038, 302614, 286233, 302617, 146977, 187939, 294435, 286246, 294439, 286248, 278057, 294440, 294443, 294445, 310831, 212538, 40507, 228933, 286283, 40525, 228944, 212560, 400976, 147032, 40537, 40539, 278109, 40550, 286312, 286313, 40554, 310892, 40557, 294521, 343679, 278150, 310925, 286354, 278163, 122517, 278168, 327333, 229030, 278188, 302764, 278192, 319153, 278196, 319171, 302789, 294599, 278216, 294601, 302793, 343757, 212690, 278227, 229076, 286420, 319187, 286425, 319194, 278235, 229086, 278238, 286432, 294625, 294634, 319226, 286460, 278274, 302852, 278277, 302854, 294664, 311048, 352008, 311053, 302862, 278306, 188199, 294701, 278320, 319280, 319290, 229192, 302925, 188247, 237409, 294776, 294785, 327554, 294803, 40851, 294811, 319390, 294817, 319394, 40865, 311209, 180142, 294831, 188340, 294844, 294847, 24528, 393177, 294876, 294879, 294890, 311279, 278513, 237555, 278516, 311283, 278519, 237562 ]
537bee39255144509addeb6649ef4d9a78b518e6
6cb856d7a2b5fd822313c4516e7c560290bdd81e
/Vridge/Vridge/API/PostService.swift
a136bc0c81df40b33476f6bddd598a72f828ac0c
[]
no_license
workoutplz/Vridge
6dc546f248db459d4ed0a70fe17ee26c7cd004a8
343b149ae91b1ad770f0f19da707d055cb91c6a8
refs/heads/master
2023-04-08T00:39:55.294718
2020-10-10T02:39:14
2020-10-10T02:39:14
null
0
0
null
null
null
null
UTF-8
Swift
false
false
2,958
swift
// // PostService.swift // Vridge // // Created by Kang Mingu on 2020/10/05. // import UIKit import Firebase struct PostService { static let shared = PostService() func uploadPost(caption: String?, photos: [UIImage?], indicator: UIActivityIndicatorView, view: UIViewController, completion: @escaping(Error?, DatabaseReference) -> Void) { indicator.startAnimating() var urlString: [String] = [] let uid = "thisIsUID" // 이 곳에 Auth.auth().currentUser?.uid for photo in photos { guard let imageData = photo?.jpegData(compressionQuality: 0.2) else { return } let filename = NSUUID().uuidString let storageRef = STORAGE_POST_IMAGES.child(filename) storageRef.putData(imageData, metadata: nil) { (meta, err) in storageRef.downloadURL { (url, err) in guard let imageURL = url?.absoluteString else { return } urlString.append(imageURL) // 사진을 모두 storage에 저장한 후, // 유저가 올린 사진의 갯수가 모두 추가 되었다면 db에 추가. if photos.count == urlString.count { guard let caption = caption else { return } let values = ["caption": caption, "images": urlString, "uid": "this is your uid.", "timestamp": "some number since 1970"] as [String: Any] REF_POSTS.childByAutoId().updateChildValues(values) { (err, ref) in guard let postID = ref.key else { return } REF_USER_POSTS.child(uid).updateChildValues([postID: 1], withCompletionBlock: completion) print("DEBUG: photo uploaded successfully to Storage/post_images.") DispatchQueue.main.async { indicator.stopAnimating() } view.dismiss(animated: true, completion: nil) } } } } } } // 모든 게시글 다 보기 func fetchPosts(completion: @escaping([Post]) -> Void) { var posts = [Post]() REF_POSTS.observe(.childAdded) { snapshot in guard let dic = snapshot.value as? [String: Any] else { return } guard let images = dic["images"] as? [String] else { return } completion(posts) } } // 내 타입 게시글만 보기 func fetchPosts(type: String) { // type을 enum으로 만들어 놓기. } }
[ -1 ]
30735b286a5abbcd73100b23c2b76cbe4f645d64
75c56a089d4ea6fda46923d3d850a6abfb1fafd5
/SecondKadaiApp/SceneDelegate.swift
2c96f1be517e925ca4945b6e93a960b4183d3b62
[]
no_license
Kyohey98/SecondKadaiApp
c9730bf662cc88c6c5950d200186d7f0dc3ababe
802027f634c0f18527cdf12f82cbc0b437e2c154
refs/heads/master
2022-12-26T03:53:02.020093
2020-09-30T13:11:35
2020-09-30T13:11:35
299,897,715
0
0
null
null
null
null
UTF-8
Swift
false
false
2,362
swift
// // SceneDelegate.swift // SecondKadaiApp // // Created by 松下恭平 on 2020/09/30. // Copyright © 2020 kyohei.matsushita. All rights reserved. // import UIKit class SceneDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow? func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). guard let _ = (scene as? UIWindowScene) else { return } } func sceneDidDisconnect(_ scene: UIScene) { // Called as the scene is being released by the system. // This occurs shortly after the scene enters the background, or when its session is discarded. // Release any resources associated with this scene that can be re-created the next time the scene connects. // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). } func sceneDidBecomeActive(_ scene: UIScene) { // Called when the scene has moved from an inactive state to an active state. // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. } func sceneWillResignActive(_ scene: UIScene) { // Called when the scene will move from an active state to an inactive state. // This may occur due to temporary interruptions (ex. an incoming phone call). } func sceneWillEnterForeground(_ scene: UIScene) { // Called as the scene transitions from the background to the foreground. // Use this method to undo the changes made on entering the background. } func sceneDidEnterBackground(_ scene: UIScene) { // Called as the scene transitions from the foreground to the background. // Use this method to save data, release shared resources, and store enough scene-specific state information // to restore the scene back to its current state. } }
[ 393221, 163849, 393228, 393231, 393251, 352294, 344103, 393260, 393269, 213049, 376890, 385082, 16444, 393277, 376906, 327757, 254032, 286804, 368728, 254045, 368736, 180322, 376932, 286833, 286845, 286851, 417925, 262284, 360598, 286880, 286889, 377003, 377013, 164029, 327872, 180418, 377030, 377037, 180432, 377047, 418008, 385243, 418012, 377063, 327915, 205037, 393457, 393461, 393466, 418044, 336124, 385281, 336129, 262405, 180491, 336140, 164107, 262417, 368913, 262423, 377118, 377121, 262437, 254253, 336181, 262455, 393539, 262473, 344404, 213333, 418135, 270687, 262497, 418145, 262501, 213354, 246124, 262508, 262512, 213374, 385420, 262551, 262553, 385441, 385444, 262567, 385452, 262574, 393649, 385460, 262587, 344512, 262593, 336326, 360917, 369119, 328178, 328180, 328183, 328190, 254463, 328193, 98819, 164362, 328207, 410129, 393748, 377372, 188959, 385571, 377384, 197160, 33322, 352822, 270905, 197178, 418364, 188990, 369224, 270922, 385610, 352844, 385617, 352865, 262761, 352875, 344694, 352888, 336513, 377473, 336517, 344710, 385671, 148106, 377485, 352919, 98969, 336549, 344745, 361130, 336556, 434868, 164535, 336568, 164539, 328379, 328387, 352969, 418508, 385743, 385749, 189154, 369382, 361196, 344832, 336644, 344837, 344843, 328462, 361231, 394002, 336660, 418581, 418586, 434971, 369436, 262943, 369439, 418591, 418594, 336676, 418600, 418606, 271154, 328498, 369464, 361274, 328516, 336709, 328520, 336712, 361289, 328523, 336715, 361300, 213848, 426842, 361307, 197469, 361310, 254813, 361318, 344936, 361323, 361335, 328574, 369544, 222129, 345036, 115661, 386004, 345046, 386012, 386019, 386023, 328690, 435188, 328703, 328710, 418822, 377867, 328715, 386070, 271382, 336922, 345119, 377888, 328747, 214060, 345134, 345139, 361525, 361537, 377931, 197708, 189525, 156762, 402523, 361568, 148580, 345200, 361591, 361594, 410746, 214150, 345224, 386187, 337048, 345247, 361645, 337072, 345268, 337076, 402615, 361657, 402636, 328925, 165086, 165092, 328933, 222438, 328942, 386286, 386292, 206084, 115973, 328967, 345377, 345380, 353572, 345383, 337207, 345400, 378170, 369979, 386366, 337224, 337230, 337235, 263509, 353634, 337252, 402792, 345449, 99692, 271731, 378232, 337278, 271746, 181639, 353674, 181644, 361869, 181650, 181655, 230810, 181671, 181674, 181679, 181682, 337330, 181687, 370105, 181691, 181697, 361922, 337350, 181704, 337366, 271841, 329192, 361961, 329195, 116211, 337399, 402943, 337416, 329227, 419341, 419345, 329234, 419351, 345626, 419357, 345631, 419360, 370208, 394787, 419363, 370214, 419369, 394796, 419377, 419386, 206397, 419401, 353868, 419404, 173648, 419408, 214611, 419412, 403040, 345702, 222831, 370298, 353920, 403073, 403076, 345737, 198282, 403085, 403092, 345750, 419484, 345758, 345763, 419492, 345766, 419498, 419502, 370351, 419507, 337588, 419510, 419513, 419518, 403139, 337607, 419528, 419531, 419536, 272083, 394967, 419543, 419545, 345819, 419548, 181982, 419551, 345829, 419560, 337643, 419564, 337647, 370416, 141052, 337661, 337671, 362249, 362252, 395022, 362256, 321300, 345888, 116512, 378664, 354107, 354112, 247618, 370504, 329545, 345932, 354124, 370510, 247639, 337751, 370520, 313181, 182110, 354143, 354157, 345965, 345968, 345971, 345975, 182136, 403321, 1914, 354173, 395148, 247692, 337809, 247701, 329625, 436127, 436133, 247720, 337834, 362414, 337845, 190393, 247760, 346064, 346069, 329699, 354275, 190440, 247790, 354314, 346140, 337980, 436290, 395340, 378956, 436307, 338005, 329816, 100454, 329833, 329853, 329857, 329868, 411806, 329886, 346273, 362661, 100525, 387250, 379067, 387261, 256193, 395467, 346317, 411862, 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, 272787, 354728, 338353, 338363, 338382, 272849, 248279, 256474, 182755, 338404, 338411, 330225, 248309, 199165, 248332, 330254, 199182, 199189, 420377, 330268, 191012, 330320, 199250, 191069, 346722, 248427, 191085, 338544, 191093, 346743, 330384, 346769, 150184, 174775, 248505, 174778, 363198, 223936, 355025, 273109, 264919, 256735, 338661, 338665, 264942, 330479, 363252, 338680, 207620, 264965, 191240, 338701, 199455, 396067, 346917, 396070, 215854, 355123, 355141, 355144, 338764, 330581, 387929, 330585, 355167, 265056, 265059, 355176, 355180, 355185, 330612, 330643, 412600, 207809, 379849, 347082, 396246, 330711, 248794, 248799, 437219, 257009, 265208, 330750, 199681, 338951, 330761, 330769, 330775, 248863, 158759, 396329, 347178, 404526, 396337, 330803, 396340, 339002, 388155, 339010, 347208, 248905, 330827, 330830, 248915, 183384, 412765, 339037, 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, 175487, 249215, 175491, 249219, 249225, 249228, 249235, 175514, 175517, 396703, 396706, 175523, 355749, 396723, 388543, 380353, 216518, 339401, 380364, 339406, 372177, 339414, 249303, 413143, 339418, 339421, 249310, 339425, 249313, 339429, 339435, 249329, 69114, 372229, 339464, 249355, 208399, 380433, 175637, 134689, 339504, 265779, 421442, 413251, 265796, 265806, 224854, 224858, 339553, 257636, 224871, 372328, 257647, 372338, 339572, 224885, 224888, 224891, 224895, 126597, 421509, 224905, 11919, 224911, 224914, 126611, 224917, 224920, 126618, 208539, 224923, 224927, 224930, 224933, 257705, 224939, 224943, 257713, 224949, 257717, 257721, 224954, 257725, 224960, 257733, 224966, 224970, 257740, 224976, 257745, 257748, 224982, 257752, 224987, 257762, 224996, 225000, 339696, 225013, 257788, 225021, 339711, 257791, 225027, 257796, 339722, 257802, 257805, 225039, 257808, 249617, 225044, 167701, 372500, 257815, 225049, 257820, 225054, 184096, 397089, 257825, 225059, 339748, 225068, 257837, 413485, 225071, 225074, 257843, 225077, 257846, 225080, 397113, 225083, 397116, 257853, 225088, 225094, 225097, 323404, 257869, 257872, 225105, 339795, 397140, 225109, 225113, 257881, 257884, 257887, 225120, 257891, 413539, 225128, 257897, 225138, 339827, 257909, 225142, 372598, 257914, 257917, 225150, 257922, 380803, 225156, 339845, 257927, 225166, 397201, 225171, 380823, 225176, 225183, 184245, 372698, 372704, 372707, 356336, 380919, 393215, 372739, 405534, 266295, 266298, 217158, 421961, 200786, 356440, 217180, 430181, 266351, 356467, 266365, 266375, 381069, 225425, 250003, 225430, 250008, 356507, 250012, 225439, 135328, 192674, 225442, 438434, 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, 225511, 217319, 225515, 225519, 381177, 397572, 389381, 356631, 356638, 356641, 356644, 356647, 266537, 389417, 356650, 356656, 332081, 307507, 340276, 356662, 397623, 332091, 225599, 332098, 201030, 348489, 332107, 151884, 430422, 348503, 332118, 250203, 332130, 250211, 340328, 250217, 348523, 348528, 332153, 356734, 389503, 332158, 438657, 250239, 332162, 348548, 356741, 332175, 160152, 373146, 373149, 70048, 356783, 266688, 324032, 201158, 340452, 127473, 217590, 340473, 324095, 324100, 324103, 324112, 340501, 324118, 324122, 340512, 332325, 324134, 381483, 356908, 324141, 324143, 356917, 324150, 324156, 168509, 348734, 324161, 324165, 356935, 348745, 381513, 324171, 324174, 324177, 389724, 332381, 373344, 340580, 348777, 381546, 119432, 340628, 184983, 373399, 340639, 258723, 332455, 332460, 332464, 332473, 381626, 332484, 332487, 332494, 357070, 357074, 332512, 332521, 340724, 332534, 373499, 348926, 389927, 348979, 152371, 398141, 127815, 357202, 389971, 357208, 136024, 389979, 430940, 357212, 357215, 201580, 201583, 349041, 340850, 201589, 381815, 430967, 324473, 398202, 340859, 324476, 430973, 119675, 324479, 340863, 324482, 324485, 324488, 185226, 381834, 324493, 324496, 324499, 430996, 324502, 324511, 422817, 324514, 201638, 373672, 324525, 5040, 111539, 324534, 5047, 324539, 324542, 398280, 349129, 340940, 340942, 209874, 340958, 431073, 398307, 340964, 209896, 201712, 209904, 349173, 381947, 201724, 349181, 431100, 431107, 349203, 209944, 209948, 250915, 250917, 169002, 357419, 209966, 209969, 209973, 209976, 209980, 209988, 209991, 431180, 209996, 349268, 177238, 250968, 210011, 373853, 341094, 210026, 210028, 210032, 349296, 210037, 210042, 210045, 349309, 160896, 349313, 152704, 210053, 210056, 349320, 259217, 373905, 210068, 210072, 210078, 210081, 210085, 210089, 210096, 210100, 324792, 210108, 357571, 210116, 210128, 333010, 210132, 333016, 210139, 210144, 218355, 251123, 218361, 275709, 128254, 275713, 242947, 275717, 275723, 333075, 349460, 333079, 251161, 349486, 349492, 415034, 251211, 210261, 365912, 259423, 374113, 251236, 374118, 234867, 390518, 357756, 374161, 112021, 349591, 357793, 333222, 210357, 259516, 415168, 366035, 415187, 366039, 415192, 415194, 415197, 415200, 333285, 415208, 366057, 366064, 415217, 415225, 415258, 415264, 366118, 415271, 382503, 349739, 144940, 415279, 415282, 415286, 210488, 415291, 415295, 333387, 333396, 333400, 366173, 333415, 423529, 423533, 333423, 210547, 415354, 333440, 267910, 267929, 333472, 333512, 259789, 358100, 366301, 333535, 366308, 366312, 431852, 399086, 366319, 210673, 366322, 399092, 366326, 333566, 268042, 210700, 366349, 210707, 399129, 333593, 333595, 210720, 366384, 358192, 210740, 366388, 358201, 399166, 325441, 366403, 325447, 341831, 341835, 341839, 341844, 415574, 358235, 341852, 350046, 399200, 399208, 268144, 358256, 358260, 399222, 325494, 186233, 333690, 243584, 325505, 333699, 399244, 333709, 333725, 333737, 382891, 333767, 358348, 333777, 219094, 358372, 350190, 350194, 333819, 350204, 350207, 325633, 325637, 350214, 268299, 333838, 350225, 350232, 333851, 350238, 350241, 374819, 350245, 350249, 350252, 178221, 350257, 350260, 350272, 243782, 350281, 350286, 374865, 252021, 342134, 374904, 268435, 333989, 333998, 334012, 260299, 350411, 350417, 350423, 350426, 334047, 350449, 375027, 358645, 350454, 350459, 350462, 350465, 350469, 325895, 268553, 194829, 350477, 268560, 350481, 432406, 350487, 350491, 350494, 325920, 350500, 350505, 358701, 391469, 350510, 358705, 358714, 358717, 383307, 358738, 334162, 383331, 383334, 391531, 383342, 334204, 268669, 194942, 391564, 366991, 334224, 342431, 375209, 326059, 375220, 342453, 334263, 326087, 358857, 195041, 334306, 334312, 104940, 375279, 162289, 350724, 186898, 342546, 350740, 342551, 334359, 342555, 334364, 416294, 350762, 252463, 358962, 334386, 334397, 252483, 219719, 399957, 244309, 334425, 326240, 375401, 334466, 334469, 391813, 162446, 326291, 342680, 342685, 260767, 342711, 244410, 260798, 334530, 260802, 350918, 154318, 342737, 391895, 154329, 416476, 64231, 113389, 342769, 203508, 375541, 342777, 391938, 391949, 375569, 375572, 375575, 375580, 162592, 334633, 326444, 383794, 326452, 326455, 375613, 244542, 260925, 375616, 326468, 244552, 342857, 326474, 326479, 326486, 416599, 342875, 244572, 326494, 326503, 433001, 326508, 400238, 326511, 211826, 211832, 392061, 351102, 252801, 260993, 400260, 211846, 342921, 342931, 252823, 400279, 392092, 400286, 359335, 211885, 400307, 351169, 359362, 351172, 170950, 187335, 326599, 359367, 359383, 359389, 383968, 343018, 359411, 261109, 261112, 244728, 383999, 261130, 261148, 359452, 211999, 261155, 261160, 261166, 359471, 375868, 384099, 384102, 384108, 367724, 326764, 187503, 343155, 384115, 212095, 384136, 384140, 384144, 384152, 384158, 384161, 351399, 384169, 367795, 244917, 384182, 384189, 384192, 351424, 343232, 244934, 367817, 244938, 384202, 253132, 326858, 343246, 384209, 146644, 351450, 384225, 359650, 343272, 351467, 359660, 384247, 351480, 384250, 351483, 351492, 343307, 384270, 359695, 261391, 253202, 261395, 384276, 384284, 245021, 384290, 253218, 245032, 171304, 384299, 351535, 245042, 326970, 384324, 343366, 212296, 212304, 367966, 343394, 343399, 367981, 343410, 155000, 327035, 245121, 245128, 253321, 155021, 384398, 245137, 245143, 245146, 245149, 343453, 245152, 245155, 155045, 245158, 40358, 245163, 114093, 327090, 343478, 359867, 384444, 146878, 327108, 327112, 384457, 327118, 359887, 359891, 343509, 368093, 155103, 343535, 343540, 368120, 343545, 409092, 359948, 359951, 245295, 359984, 400977, 400982, 179803, 155241, 138865, 155255, 155274, 368289, 245410, 425639, 245415, 425652, 425663, 155328, 245463, 155352, 155356, 212700, 155364, 245477, 155372, 245487, 212723, 245495, 409336, 155394, 155404, 245528, 155423, 360224, 155439, 204592, 155444, 155448, 417596, 384829, 360262, 155463, 155477, 376665, 155484, 261982, 425823, 155488, 376672, 155492, 327532, 261997, 376686, 262000, 262003, 425846, 262006, 147319, 262009, 327542, 262012, 155517, 155523, 155526, 360327, 376715, 155532, 262028, 262031, 262034, 262037, 262040, 262043, 155550, 253854, 262046, 262049, 262052, 327590, 155560, 155563, 155566, 327613, 393152, 311244, 212945, 393170, 155604, 155620, 253924, 155622, 253927, 327655, 360432, 393204, 360439, 253944, 393209, 155647 ]
5462f9ba668ba7a9e8cfff0b383271589eeb8d80
049e019a37b2daa17bee251ad356ac596f49c43e
/AboutCanadaPoc/Model/Country.swift
08062611d28720ff71e12c12fc21447ad1347dbd
[]
no_license
wasimnazma14/SystemTask
6c001535b5a36d59c48b0479910d9ebcdf86b694
3cb46d2a8c96eb7584877061efbdb9633c739ca6
refs/heads/master
2022-11-16T09:31:56.178711
2020-07-10T06:30:47
2020-07-10T06:30:47
278,556,456
0
0
null
null
null
null
UTF-8
Swift
false
false
393
swift
import Foundation struct Country: Codable { let title: String? let rows: [Detail]? private enum CodingKeys: String, CodingKey { case title = "title" case rows = "rows" } func getString() -> String { return "title: \(String(describing: self.title))" } init() { self.title = nil self.rows = nil } }
[ -1 ]
8d4f3d8bac26f33918529ddafb9db47cdb75fc52
a51a7aa59bd8de0ddb24e90feaa98ee77ae6e713
/swift/vapor-framework/Package.swift
74187c2418340c9b2021d7a11baca01016465e67
[ "MIT" ]
permissive
shootingfly/web-frameworks
1ecbe5309fb6613244e5357792355523e85f4c37
6dda40955bce58ff9430ca3c3687e6412fa894bf
refs/heads/master
2023-03-25T06:38:23.311353
2021-02-22T17:44:22
2021-02-22T17:44:22
341,445,807
0
0
MIT
2021-02-23T05:59:07
2021-02-23T05:59:06
null
UTF-8
Swift
false
false
841
swift
// swift-tools-version:5.2 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription let package = Package( name: "server", platforms: [ .macOS("10.15") ], dependencies: [ // Dependencies declare other packages that this package depends on. .package(url: "https://github.com/vapor/vapor.git", .upToNextMinor(from: "4.40.0")) ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. // Targets can depend on other targets in this package, and on products in packages which this package depends on. .target( name: "server", dependencies: [ .product(name: "Vapor", package: "vapor") ]), ] )
[ 62666 ]
8a68ce9680db98b1550b68bf63f88df8982c6407
c76da7839655c837f23557262dce4445e31f5b49
/KBChat/KBChat/Base/KBBaseTableView.swift
c7ead058222c069742d30c3d34dacac5b5436c8b
[ "MIT" ]
permissive
MrZhou1990/KBChat
a0d973b70906541497011de221920bdd1ceca0b5
17cbd5606d9d803d194836804c7ab8c6567eb95b
refs/heads/main
2023-06-29T23:24:02.177498
2021-08-02T01:38:46
2021-08-02T01:38:46
315,960,492
0
0
null
null
null
null
UTF-8
Swift
false
false
444
swift
// // KBBaseTableView.swift // KBChat // // Created by 周昊 on 2020/11/25. // import UIKit class KBBaseTableView: UITableView { override init(frame: CGRect, style: UITableView.Style) { super.init(frame: frame, style: style) tableFooterView = UIView() separatorStyle = .none } required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } }
[ -1 ]
c17af7effbaee3c448a72d9bf4aaaa2e018b1720
c7fa0c15a0429df0a7c78ce86954c05e820b90a8
/src/TulsiGenerator/XcodeProjectGenerator.swift
ecac81fc40fe81e44077d7f1488cc8bee9fdf8c7
[ "Apache-2.0" ]
permissive
thomasmarsh/tulsi
8a7edc5af7698135ffd59855a7335cc8f1561633
a306d1728746b1548b676120a189c73c8248ca66
refs/heads/master
2021-01-20T14:04:58.860203
2017-02-13T16:21:44
2017-02-13T19:43:39
82,737,175
0
0
null
2017-02-21T23:17:06
2017-02-21T23:17:06
null
UTF-8
Swift
false
false
53,051
swift
// Copyright 2016 The Tulsi Authors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. import Foundation /// Provides functionality to generate an Xcode project from a TulsiGeneratorConfig. final class XcodeProjectGenerator { enum Error: ErrorType { /// General Xcode project creation failure with associated debug info. case SerializationFailed(String) /// The given labels failed to resolve to valid targets. case LabelResolutionFailed(Set<BuildLabel>) } /// Encapsulates the source paths of various resources (scripts, utilities, etc...) that will be /// copied into the generated Xcode project. struct ResourceSourcePathURLs { let buildScript: NSURL // The script to run on "build" actions. let cleanScript: NSURL // The script to run on "clean" actions. let postProcessor: NSURL // Binary post processor utility. let stubInfoPlist: NSURL // Stub Info.plist (needed for Xcode 8). let stubIOSAppExInfoPlist: NSURL // Stub Info.plist (needed for app extension targets). let stubWatchOS2InfoPlist: NSURL // Stub Info.plist (needed for watchOS2 app targets). let stubWatchOS2AppExInfoPlist: NSURL // Stub Info.plist (needed for watchOS2 appex targets). } /// Path relative to PROJECT_FILE_PATH in which Tulsi generated files (scripts, artifacts, etc...) /// should be placed. private static let TulsiArtifactDirectory = ".tulsi" static let ScriptDirectorySubpath = "\(TulsiArtifactDirectory)/Scripts" static let UtilDirectorySubpath = "\(TulsiArtifactDirectory)/Utils" static let ConfigDirectorySubpath = "\(TulsiArtifactDirectory)/Configs" static let ProjectResourcesDirectorySubpath = "\(TulsiArtifactDirectory)/Resources" static let ManifestFileSubpath = "\(TulsiArtifactDirectory)/generatorManifest.json" private static let BuildScript = "bazel_build.py" private static let CleanScript = "bazel_clean.sh" private static let PostProcessorUtil = "post_processor" private static let StubInfoPlistFilename = "StubInfoPlist.plist" private static let StubInfoIOSAppExPlistFilename = "StubIOSAppExInfoPlist.plist" private static let StubWatchOS2InfoPlistFilename = "StubWatchOS2InfoPlist.plist" private static let StubWatchOS2AppExInfoPlistFilename = "StubWatchOS2AppExInfoPlist.plist" private let workspaceRootURL: NSURL private let config: TulsiGeneratorConfig private let localizedMessageLogger: LocalizedMessageLogger private let fileManager: NSFileManager private let workspaceInfoExtractor: BazelWorkspaceInfoExtractorProtocol private let resourceURLs: ResourceSourcePathURLs private let tulsiVersion: String private let pbxTargetGeneratorType: PBXTargetGeneratorProtocol.Type /// Exposed for testing. Simply writes the given NSData to the given NSURL. var writeDataHandler: (NSURL, NSData) throws -> Void = { (outputFileURL: NSURL, data: NSData) in try data.writeToURL(outputFileURL, options: NSDataWritingOptions.DataWritingAtomic) } /// Exposed for testing. Returns the current user name. var usernameFetcher: () -> String = NSUserName /// Exposed for testing. Suppresses writing any preprocessor defines integral to Bazel itself into /// the generated project. var suppressCompilerDefines = false /// Exposed for testing. Instead of writing the real workspace name into the generated project, /// write a stub value that will be the same regardless of the execution environment. var redactWorkspaceSymlink = false /// Exposed for testing. Suppresses creating folders for artifacts that are expected to be /// generated by Bazel. var suppressGeneratedArtifactFolderCreation = false init(workspaceRootURL: NSURL, config: TulsiGeneratorConfig, localizedMessageLogger: LocalizedMessageLogger, workspaceInfoExtractor: BazelWorkspaceInfoExtractorProtocol, resourceURLs: ResourceSourcePathURLs, tulsiVersion: String, fileManager: NSFileManager = NSFileManager.defaultManager(), pbxTargetGeneratorType: PBXTargetGeneratorProtocol.Type = PBXTargetGenerator.self) { self.workspaceRootURL = workspaceRootURL self.config = config self.localizedMessageLogger = localizedMessageLogger self.workspaceInfoExtractor = workspaceInfoExtractor self.resourceURLs = resourceURLs self.tulsiVersion = tulsiVersion self.fileManager = fileManager self.pbxTargetGeneratorType = pbxTargetGeneratorType } /// Determines the "best" common SDKROOT for a sequence of RuleEntries. static func projectSDKROOT<T where T: SequenceType, T.Generator.Element == RuleEntry>(targetRules: T) -> String? { var discoveredSDKs = Set<String>() for entry in targetRules { if let sdkroot = entry.XcodeSDKRoot { discoveredSDKs.insert(sdkroot) } } if discoveredSDKs.count == 1 { return discoveredSDKs.first! } if discoveredSDKs.isEmpty { // In practice this should not happen since it'd indicate a project that won't be able to // build. It is possible that the user is in the process of creating a new project, so // rather than fail the generation a default is selected. Since iOS happens to be the best // supported type by Bazel at the time of this writing, it is chosen as the default. return "iphoneos" } if discoveredSDKs == ["iphoneos", "watchos"] { // Projects containing just an iPhone host and a watchOS app use iphoneos as the project SDK // to match Xcode's behavior. return "iphoneos" } // Projects that have a collection that is not mappable to a standard Xcode project simply // do not set the SDKROOT. Unfortunately this will cause "My Mac" to be listed as a target // device regardless of whether or not the selected build target supports it, but this is // a somewhat better user experience when compared to any other device SDK (in which Xcode // will display every simulator for that platform regardless of whether or not the build // target can be run on them). return nil } /// Generates an Xcode project bundle in the given folder. /// NOTE: This may be a long running operation. func generateXcodeProjectInFolder(outputFolderURL: NSURL) throws -> NSURL { let generateProfilingToken = localizedMessageLogger.startProfiling("generating_project", context: config.projectName) defer { localizedMessageLogger.logProfilingEnd(generateProfilingToken) } try resolveConfigReferences() let mainGroup = pbxTargetGeneratorType.mainGroupForOutputFolder(outputFolderURL, workspaceRootURL: workspaceRootURL) let projectInfo = try buildXcodeProjectWithMainGroup(mainGroup) let serializingProgressNotifier = ProgressNotifier(name: SerializingXcodeProject, maxValue: 1, indeterminate: true) let serializer = OpenStepSerializer(rootObject: projectInfo.project, gidGenerator: ConcreteGIDGenerator()) let serializingProfileToken = localizedMessageLogger.startProfiling("serializing_project", context: config.projectName) guard let serializedXcodeProject = serializer.serialize() else { throw Error.SerializationFailed("OpenStep serialization failed") } localizedMessageLogger.logProfilingEnd(serializingProfileToken) let projectBundleName = config.xcodeProjectFilename #if swift(>=2.3) let projectURL = outputFolderURL.URLByAppendingPathComponent(projectBundleName)! #else let projectURL = outputFolderURL.URLByAppendingPathComponent(projectBundleName) #endif if !createDirectory(projectURL) { throw Error.SerializationFailed("Project directory creation failed") } #if swift(>=2.3) let pbxproj = projectURL.URLByAppendingPathComponent("project.pbxproj")! #else let pbxproj = projectURL.URLByAppendingPathComponent("project.pbxproj") #endif try writeDataHandler(pbxproj, serializedXcodeProject) serializingProgressNotifier.incrementValue() try installWorkspaceSettings(projectURL) try installXcodeSchemesForProjectInfo(projectInfo, projectURL: projectURL, projectBundleName: projectBundleName) installTulsiScripts(projectURL) installUtilities(projectURL) installGeneratorConfig(projectURL) installGeneratedProjectResources(projectURL) let artifactFolderProfileToken = localizedMessageLogger.startProfiling("creating_artifact_folders", context: config.projectName) createGeneratedArtifactFolders(mainGroup, relativeTo: projectURL) localizedMessageLogger.logProfilingEnd(artifactFolderProfileToken) let manifestProfileToken = localizedMessageLogger.startProfiling("writing_manifest", context: config.projectName) #if swift(>=2.3) let manifestFileURL = projectURL.URLByAppendingPathComponent(XcodeProjectGenerator.ManifestFileSubpath, isDirectory: false)! #else let manifestFileURL = projectURL.URLByAppendingPathComponent(XcodeProjectGenerator.ManifestFileSubpath, isDirectory: false) #endif let manifest = GeneratorManifest(localizedMessageLogger: localizedMessageLogger, pbxProject: projectInfo.project, intermediateArtifacts: projectInfo.intermediateArtifacts) manifest.writeToURL(manifestFileURL) localizedMessageLogger.logProfilingEnd(manifestProfileToken) return projectURL } // MARK: - Private methods /// Encapsulates information about the results of a buildXcodeProjectWithMainGroup invocation. private struct GeneratedProjectInfo { /// The newly created PBXProject instance. let project: PBXProject /// RuleEntry's for which build targets were created. Note that this list may differ from the /// set of targets selected by the user as part of the generator config. let buildRuleEntries: Set<RuleEntry> /// RuleEntry's for test_suite's for which special test schemes should be created. let testSuiteRuleEntries: [BuildLabel: RuleEntry] /// A mapping of indexer targets by name. let indexerTargets: [String: PBXTarget] /// Map of target name to any intermediate artifact files. let intermediateArtifacts: [String: [String]] } /// Invokes Bazel to load any missing information in the config file. private func resolveConfigReferences() throws { let resolvedLabels = loadRuleEntryMap() let unresolvedLabels = config.buildTargetLabels.filter() { resolvedLabels[$0] == nil } if !unresolvedLabels.isEmpty { throw Error.LabelResolutionFailed(Set<BuildLabel>(unresolvedLabels)) } } // Generates a PBXProject and a returns it along with a set of private func buildXcodeProjectWithMainGroup(mainGroup: PBXGroup) throws -> GeneratedProjectInfo { let xcodeProject = PBXProject(name: config.projectName, mainGroup: mainGroup) #if swift(>=2.3) if let enabled = config.options[.SuppressSwiftUpdateCheck].commonValueAsBool where enabled { xcodeProject.lastSwiftUpdateCheck = "0710" } #else if let enabled = config.options[.SuppressSwiftUpdateCheck].commonValueAsBool where enabled { xcodeProject.lastSwiftUpdateCheck = "0710" } #endif let buildScriptPath = "${PROJECT_FILE_PATH}/\(XcodeProjectGenerator.ScriptDirectorySubpath)/\(XcodeProjectGenerator.BuildScript)" let cleanScriptPath = "${PROJECT_FILE_PATH}/\(XcodeProjectGenerator.ScriptDirectorySubpath)/\(XcodeProjectGenerator.CleanScript)" let projectResourcesDirectory = "${PROJECT_FILE_PATH}/\(XcodeProjectGenerator.ProjectResourcesDirectorySubpath)" let plistPaths = StubInfoPlistPaths( defaultStub: "\(projectResourcesDirectory)/\(XcodeProjectGenerator.StubInfoPlistFilename)", iOSAppExStub: "\(projectResourcesDirectory)/\(XcodeProjectGenerator.StubInfoIOSAppExPlistFilename)", watchOSStub: "\(projectResourcesDirectory)/\(XcodeProjectGenerator.StubWatchOS2InfoPlistFilename)", watchOSAppExStub: "\(projectResourcesDirectory)/\(XcodeProjectGenerator.StubWatchOS2AppExInfoPlistFilename)") let generator = pbxTargetGeneratorType.init(bazelURL: config.bazelURL, bazelBinPath: workspaceInfoExtractor.bazelBinPath, project: xcodeProject, buildScriptPath: buildScriptPath, stubInfoPlistPaths: plistPaths, tulsiVersion: tulsiVersion, options: config.options, localizedMessageLogger: localizedMessageLogger, workspaceRootURL: workspaceRootURL, suppressCompilerDefines: suppressCompilerDefines, redactWorkspaceSymlink: redactWorkspaceSymlink) if let additionalFilePaths = config.additionalFilePaths { generator.generateFileReferencesForFilePaths(additionalFilePaths) } let ruleEntryMap = loadRuleEntryMap() var expandedTargetLabels = Set<BuildLabel>() var testSuiteRules = [BuildLabel: RuleEntry]() // Ideally this should use a generic SequenceType, but Swift 2.2 sometimes crashes in this case. // TODO(abaire): Go back to using a generic here when support for Swift 2.2 is removed. func expandTargetLabels(labels: Set<BuildLabel>) { for label in labels { guard let ruleEntry = ruleEntryMap[label] else { continue } if ruleEntry.type != "test_suite" { // Add the RuleEntry itself and any registered extensions. expandedTargetLabels.insert(label) expandedTargetLabels.unionInPlace(ruleEntry.extensions) } else { // Expand the test_suite to its set of tests. testSuiteRules[ruleEntry.label] = ruleEntry expandTargetLabels(ruleEntry.weakDependencies) } } } let buildTargetLabels = Set(config.buildTargetLabels) expandTargetLabels(buildTargetLabels) var targetRules = Set<RuleEntry>() var hostTargetLabels = [BuildLabel: BuildLabel]() func profileAction(name: String, @noescape action: () throws -> Void) rethrows { let profilingToken = localizedMessageLogger.startProfiling(name, context: config.projectName) try action() localizedMessageLogger.logProfilingEnd(profilingToken) } profileAction("gathering_sources_for_indexers") { let progressNotifier = ProgressNotifier(name: GatheringIndexerSources, maxValue: expandedTargetLabels.count) for label in expandedTargetLabels { progressNotifier.incrementValue() guard let ruleEntry = ruleEntryMap[label] else { localizedMessageLogger.error("UnknownTargetRule", comment: "Failure to look up a Bazel target that was expected to be present. The target label is %1$@", context: config.projectName, values: label.value) continue } targetRules.insert(ruleEntry) for hostTargetLabel in ruleEntry.linkedTargetLabels { hostTargetLabels[hostTargetLabel] = ruleEntry.label } generator.registerRuleEntryForIndexer(ruleEntry, ruleEntryMap: ruleEntryMap, pathFilters: config.pathFilters) } } var indexerTargets = [String: PBXTarget]() profileAction("generating_indexers") { let progressNotifier = ProgressNotifier(name: GeneratingIndexerTargets, maxValue: 1, indeterminate: true) indexerTargets = generator.generateIndexerTargets() progressNotifier.incrementValue() } profileAction("adding_buildfiles") { let buildfiles = workspaceInfoExtractor.extractBuildfiles(expandedTargetLabels) let paths = buildfiles.map() { $0.asFileName! } generator.generateFileReferencesForFilePaths(paths, pathFilters: config.pathFilters) } // Generate RuleEntry's for any test hosts to ensure that selected tests can be executed in // Xcode. for (hostLabel, testLabel) in hostTargetLabels { if config.buildTargetLabels.contains(hostLabel) { continue } localizedMessageLogger.warning("GeneratingTestHost", comment: "Warning to show when a user has selected an XCTest (%2$@) but not its host application (%1$@), resulting in an automated target generation which may have issues.", context: config.projectName, values: hostLabel.value, testLabel.value) let bazelBinPath = workspaceInfoExtractor.bazelBinPath let expectedArtifact = BazelFileInfo(rootPath: bazelBinPath, subPath: "\(hostLabel.asFileName!).ipa", isDirectory: false, targetType: .GeneratedFile) targetRules.insert(RuleEntry(label: hostLabel, type: "_test_host_", attributes: [:], artifacts: [expectedArtifact])) } let workingDirectory = pbxTargetGeneratorType.workingDirectoryForPBXGroup(mainGroup) profileAction("generating_clean_target") { generator.generateBazelCleanTarget(cleanScriptPath, workingDirectory: workingDirectory) } profileAction("generating_top_level_build_configs") { var buildSettings = [String: String]() if let sdkroot = XcodeProjectGenerator.projectSDKROOT(targetRules) { buildSettings = ["SDKROOT": sdkroot] } // Pull in transitive settings from the top level targets. for entry in targetRules { if let swiftVersion = entry.attributes[.swift_language_version] as? String { buildSettings["SWIFT_VERSION"] = swiftVersion } if let swiftToolchain = entry.attributes[.swift_toolchain] as? String { buildSettings["TOOLCHAINS"] = swiftToolchain } } generator.generateTopLevelBuildConfigurations(buildSettings) } var intermediateArtifacts = [String: [String]]() try profileAction("generating_build_targets") { intermediateArtifacts = try generator.generateBuildTargetsForRuleEntries(targetRules, ruleEntryMap: ruleEntryMap) } profileAction("patching_external_repository_references") { patchExternalRepositoryReferences(xcodeProject) } return GeneratedProjectInfo(project: xcodeProject, buildRuleEntries: targetRules, testSuiteRuleEntries: testSuiteRules, indexerTargets: indexerTargets, intermediateArtifacts: intermediateArtifacts) } // Examines the given xcodeProject, patching any groups that were generated under Bazel's magical // "external" container to absolute filesystem references. private func patchExternalRepositoryReferences(xcodeProject: PBXProject) { let mainGroup = xcodeProject.mainGroup guard let externalGroup = mainGroup.childGroupsByName["external"] else { return } let externalChildren = externalGroup.children as! [PBXGroup] for child in externalChildren { guard let resolvedPath = workspaceInfoExtractor.resolveExternalReferencePath("external/\(child.path!)") else { localizedMessageLogger.warning("ExternalRepositoryResolutionFailed", comment: "Failed to look up a valid filesystem path for the external repository group given as %1$@. The project should work correctly, but any files inside of the cited group will be unavailable.", context: config.projectName, values: child.path!) continue } let newChild = mainGroup.getOrCreateChildGroupByName("@\(child.name)", path: resolvedPath, sourceTree: .Absolute) newChild.serializesName = true newChild.migrateChildrenOfGroup(child) } mainGroup.removeChild(externalGroup) } private func installWorkspaceSettings(projectURL: NSURL) throws { func writeWorkspaceSettings(workspaceSettings: [String: AnyObject], toDirectoryAtURL directoryURL: NSURL, replaceIfExists: Bool = false) throws { #if swift(>=2.3) let workspaceSettingsURL = directoryURL.URLByAppendingPathComponent("WorkspaceSettings.xcsettings")! #else let workspaceSettingsURL = directoryURL.URLByAppendingPathComponent("WorkspaceSettings.xcsettings") #endif if (!replaceIfExists && fileManager.fileExistsAtPath(workspaceSettingsURL.path!)) || !createDirectory(directoryURL) { return } let data = try NSPropertyListSerialization.dataWithPropertyList(workspaceSettings, format: .XMLFormat_v1_0, options: 0) try writeDataHandler(workspaceSettingsURL, data) } #if swift(>=2.3) let workspaceSharedDataURL = projectURL.URLByAppendingPathComponent("project.xcworkspace/xcshareddata")! #else let workspaceSharedDataURL = projectURL.URLByAppendingPathComponent("project.xcworkspace/xcshareddata") #endif try writeWorkspaceSettings(["IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded": false], toDirectoryAtURL: workspaceSharedDataURL, replaceIfExists: true) #if swift(>=2.3) let workspaceUserDataURL = projectURL.URLByAppendingPathComponent("project.xcworkspace/xcuserdata/\(usernameFetcher()).xcuserdatad")! #else let workspaceUserDataURL = projectURL.URLByAppendingPathComponent("project.xcworkspace/xcuserdata/\(usernameFetcher()).xcuserdatad") #endif let perUserWorkspaceSettings = [ "LiveSourceIssuesEnabled": true, "IssueFilterStyle": "ShowAll", ] try writeWorkspaceSettings(perUserWorkspaceSettings, toDirectoryAtURL: workspaceUserDataURL) } private func loadRuleEntryMap() -> [BuildLabel: RuleEntry] { return workspaceInfoExtractor.ruleEntriesForLabels(config.buildTargetLabels, startupOptions: config.options[.BazelBuildStartupOptionsDebug], buildOptions: config.options[.BazelBuildOptionsDebug]) } // Writes Xcode schemes for non-indexer targets if they don't already exist. private func installXcodeSchemesForProjectInfo(info: GeneratedProjectInfo, projectURL: NSURL, projectBundleName: String) throws { #if swift(>=2.3) let xcschemesURL = projectURL.URLByAppendingPathComponent("xcshareddata/xcschemes")! #else let xcschemesURL = projectURL.URLByAppendingPathComponent("xcshareddata/xcschemes") #endif guard createDirectory(xcschemesURL) else { return } func targetForLabel(label: BuildLabel) -> PBXTarget? { if let pbxTarget = info.project.targetByName[label.targetName!] { return pbxTarget } else if let pbxTarget = info.project.targetByName[label.asFullPBXTargetName!] { return pbxTarget } return nil } func commandlineArguments(for ruleEntry: RuleEntry) -> [String] { return config.options[.CommandlineArguments, ruleEntry.label.value]?.componentsSeparatedByString(" ") ?? [] } func environmentVariables(for ruleEntry: RuleEntry) -> [String: String] { var environmentVariables: [String: String] = [:] config.options[.EnvironmentVariables, ruleEntry.label.value]?.componentsSeparatedByCharactersInSet(.newlineCharacterSet()).forEach() { keyValueString in let components = keyValueString.componentsSeparatedByString("=") let key = components.first ?? "" if !key.isEmpty { let value = components[1..<components.count].joinWithSeparator("=") environmentVariables[key] = value } } return environmentVariables } func preActionScripts(for ruleEntry: RuleEntry) -> [XcodeActionType: String] { var preActionScripts: [XcodeActionType: String] = [:] preActionScripts[.BuildAction] = config.options[.BuildActionPreActionScript, ruleEntry.label.value] ?? nil preActionScripts[.LaunchAction] = config.options[.LaunchActionPreActionScript, ruleEntry.label.value] ?? nil preActionScripts[.TestAction] = config.options[.TestActionPreActionScript, ruleEntry.label.value] ?? nil return preActionScripts } func postActionScripts(for ruleEntry: RuleEntry) -> [XcodeActionType: String] { var postActionScripts: [XcodeActionType: String] = [:] postActionScripts[.BuildAction] = config.options[.BuildActionPostActionScript, ruleEntry.label.value] ?? nil postActionScripts[.LaunchAction] = config.options[.LaunchActionPostActionScript, ruleEntry.label.value] ?? nil postActionScripts[.TestAction] = config.options[.TestActionPostActionScript, ruleEntry.label.value] ?? nil return postActionScripts } // Build a map of extension targets to hosts so the hosts may be referenced as additional build // requirements. This is necessary for watchOS2 targets (Xcode will spawn an error when // attempting to run the app without the scheme linkage, even though Bazel will create the // embedded host correctly) and does not harm other extensions. var extensionHosts = [BuildLabel: RuleEntry]() for entry in info.buildRuleEntries { for extensionLabel in entry.extensions { extensionHosts[extensionLabel] = entry } } let runTestTargetBuildConfigPrefix = pbxTargetGeneratorType.getRunTestTargetBuildConfigPrefix() for entry in info.buildRuleEntries { // Generate an XcodeScheme with a test action set up to allow tests to be run without Xcode // attempting to compile code. let target: PBXNativeTarget if let pbxTarget = targetForLabel(entry.label) as? PBXNativeTarget { target = pbxTarget } else { localizedMessageLogger.warning("XCSchemeGenerationFailed", comment: "Warning shown when generation of an Xcode scheme failed for build target %1$@", context: config.projectName, values: entry.label.value) continue } let filename = target.name + ".xcscheme" #if swift(>=2.3) let url = xcschemesURL.URLByAppendingPathComponent(filename)! #else let url = xcschemesURL.URLByAppendingPathComponent(filename) #endif let appExtension: Bool let launchStyle: XcodeScheme.LaunchStyle let runnableDebuggingMode: XcodeScheme.RunnableDebuggingMode let targetType = entry.pbxTargetType ?? .Application switch targetType { case .AppExtension: appExtension = true launchStyle = .AppExtension runnableDebuggingMode = .Default case .Watch1App: fallthrough case .Watch2App: appExtension = false launchStyle = .Normal runnableDebuggingMode = .WatchOS default: appExtension = false launchStyle = .Normal runnableDebuggingMode = .Default } var additionalBuildTargets = target.buildActionDependencies.map() { ($0, projectBundleName, XcodeScheme.makeBuildActionEntryAttributes()) } if let host = extensionHosts[entry.label] { guard let hostTarget = targetForLabel(host.label) else { localizedMessageLogger.warning("XCSchemeGenerationFailed", comment: "Warning shown when generation of an Xcode scheme failed for build target %1$@", details: "Extension host could not be resolved.", context: config.projectName, values: entry.label.value) continue } let hostTargetTuple = (hostTarget, projectBundleName, XcodeScheme.makeBuildActionEntryAttributes()) additionalBuildTargets.append(hostTargetTuple) } // Certain rules, like `ios_application`, only refer to their sources through a binary target. let buildLabel: BuildLabel if let binaryName = entry.attributes[.binary] as? String { buildLabel = BuildLabel(binaryName) } else { buildLabel = entry.label } let indexerName = PBXTargetGenerator.indexerNameForTargetName(buildLabel.targetName!, hash: buildLabel.hashValue) if let indexerTarget = info.indexerTargets[indexerName] { let indexerBuildActionEntryAttributes = XcodeScheme.makeBuildActionEntryAttributes(test: false, run: false, profile: false, archive: false) let indexerTargetTuple = (indexerTarget, projectBundleName, indexerBuildActionEntryAttributes) additionalBuildTargets.append(indexerTargetTuple) } let scheme = XcodeScheme(target: target, project: info.project, projectBundleName: projectBundleName, testActionBuildConfig: runTestTargetBuildConfigPrefix + "Debug", profileActionBuildConfig: runTestTargetBuildConfigPrefix + "Release", appExtension: appExtension, launchStyle: launchStyle, runnableDebuggingMode: runnableDebuggingMode, additionalBuildTargets: additionalBuildTargets, commandlineArguments: commandlineArguments(for: entry), environmentVariables: environmentVariables(for: entry), preActionScripts:preActionScripts(for: entry), postActionScripts:postActionScripts(for: entry)) let xmlDocument = scheme.toXML() #if swift(>=2.3) let data = xmlDocument.XMLDataWithOptions(Int(NSXMLNodeOptions.NodePrettyPrint.rawValue)) #else let data = xmlDocument.XMLDataWithOptions(NSXMLNodePrettyPrint) #endif try writeDataHandler(url, data) } func extractTestTargets(testSuite: RuleEntry) -> (Set<PBXTarget>, PBXTarget?) { var suiteHostTarget: PBXTarget? = nil var validTests = Set<PBXTarget>() for testEntryLabel in testSuite.weakDependencies { if let recursiveTestSuite = info.testSuiteRuleEntries[testEntryLabel] { let (recursiveTests, recursiveSuiteHostTarget) = extractTestTargets(recursiveTestSuite) validTests.unionInPlace(recursiveTests) if suiteHostTarget == nil { suiteHostTarget = recursiveSuiteHostTarget } continue } guard let testTarget = targetForLabel(testEntryLabel) as? PBXNativeTarget else { localizedMessageLogger.warning("TestSuiteUsesUnresolvedTarget", comment: "Warning shown when a test_suite %1$@ refers to a test label %2$@ that was not resolved and will be ignored", context: config.projectName, values: testSuite.label.value, testEntryLabel.value) continue } // Non XCTests are treated as standalone applications and cannot be included in an Xcode // test scheme. if testTarget.productType == .Application { localizedMessageLogger.warning("TestSuiteIncludesNonXCTest", comment: "Warning shown when a non XCTest %1$@ is included in a test suite %2$@ and will be ignored.", context: config.projectName, values: testEntryLabel.value, testSuite.label.value) continue } guard let testHostTarget = info.project.linkedHostForTestTarget(testTarget) as? PBXNativeTarget else { localizedMessageLogger.warning("TestSuiteTestHostResolutionFailed", comment: "Warning shown when the test host for a test %1$@ inside test suite %2$@ could not be found. The test will be ignored, but this state is unexpected and should be reported.", context: config.projectName, values: testEntryLabel.value, testSuite.label.value) continue } if suiteHostTarget == nil { suiteHostTarget = testHostTarget } validTests.insert(testTarget) } return (validTests, suiteHostTarget) } func installSchemeForTestSuite(suite: RuleEntry, named suiteName: String) throws { let (validTests, extractedHostTarget) = extractTestTargets(suite) guard let concreteTarget = extractedHostTarget where !validTests.isEmpty else { localizedMessageLogger.warning("TestSuiteHasNoValidTests", comment: "Warning shown when none of the tests of a test suite %1$@ were able to be resolved.", context: config.projectName, values: suite.label.value) return } let filename = suiteName + "_Suite.xcscheme" #if swift(>=2.3) let url = xcschemesURL.URLByAppendingPathComponent(filename)! #else let url = xcschemesURL.URLByAppendingPathComponent(filename) #endif let scheme = XcodeScheme(target: concreteTarget, project: info.project, projectBundleName: projectBundleName, testActionBuildConfig: runTestTargetBuildConfigPrefix + "Debug", profileActionBuildConfig: runTestTargetBuildConfigPrefix + "Release", explicitTests: Array(validTests), commandlineArguments: commandlineArguments(for: suite), environmentVariables: environmentVariables(for: suite), preActionScripts: preActionScripts(for: suite), postActionScripts:postActionScripts(for: suite)) let xmlDocument = scheme.toXML() #if swift(>=2.3) let data = xmlDocument.XMLDataWithOptions(Int(NSXMLNodeOptions.NodePrettyPrint.rawValue)) #else let data = xmlDocument.XMLDataWithOptions(NSXMLNodePrettyPrint) #endif try writeDataHandler(url, data) } var testSuiteSchemes = [String: [RuleEntry]]() for (label, entry) in info.testSuiteRuleEntries { let shortName = label.targetName! if let _ = testSuiteSchemes[shortName] { testSuiteSchemes[shortName]!.append(entry) } else { testSuiteSchemes[shortName] = [entry] } } for testSuites in testSuiteSchemes.values { for suite in testSuites { let suiteName: String if testSuites.count > 1 { suiteName = suite.label.asFullPBXTargetName! } else { suiteName = suite.label.targetName! } try installSchemeForTestSuite(suite, named: suiteName) } } } private func installTulsiScripts(projectURL: NSURL) { #if swift(>=2.3) let scriptDirectoryURL = projectURL.URLByAppendingPathComponent(XcodeProjectGenerator.ScriptDirectorySubpath, isDirectory: true)! #else let scriptDirectoryURL = projectURL.URLByAppendingPathComponent(XcodeProjectGenerator.ScriptDirectorySubpath, isDirectory: true) #endif if createDirectory(scriptDirectoryURL) { let profilingToken = localizedMessageLogger.startProfiling("installing_scripts", context: config.projectName) let progressNotifier = ProgressNotifier(name: InstallingScripts, maxValue: 1) defer { progressNotifier.incrementValue() } localizedMessageLogger.infoMessage("Installing scripts") installFiles([(resourceURLs.buildScript, XcodeProjectGenerator.BuildScript), (resourceURLs.cleanScript, XcodeProjectGenerator.CleanScript), ], toDirectory: scriptDirectoryURL) localizedMessageLogger.logProfilingEnd(profilingToken) } } private func installUtilities(projectURL: NSURL) { #if swift(>=2.3) let utilDirectoryURL = projectURL.URLByAppendingPathComponent(XcodeProjectGenerator.UtilDirectorySubpath, isDirectory: true)! #else let utilDirectoryURL = projectURL.URLByAppendingPathComponent(XcodeProjectGenerator.UtilDirectorySubpath, isDirectory: true) #endif if createDirectory(utilDirectoryURL) { let profilingToken = localizedMessageLogger.startProfiling("installing_utilities", context: config.projectName) let progressNotifier = ProgressNotifier(name: InstallingUtilities, maxValue: 1) defer { progressNotifier.incrementValue() } localizedMessageLogger.infoMessage("Installing utilities") installFiles([(resourceURLs.postProcessor, XcodeProjectGenerator.PostProcessorUtil)], toDirectory: utilDirectoryURL) localizedMessageLogger.logProfilingEnd(profilingToken) } } private func installGeneratorConfig(projectURL: NSURL) { #if swift(>=2.3) let configDirectoryURL = projectURL.URLByAppendingPathComponent(XcodeProjectGenerator.ConfigDirectorySubpath, isDirectory: true)! #else let configDirectoryURL = projectURL.URLByAppendingPathComponent(XcodeProjectGenerator.ConfigDirectorySubpath, isDirectory: true) #endif guard createDirectory(configDirectoryURL, failSilently: true) else { return } let profilingToken = localizedMessageLogger.startProfiling("installing_generator_config", context: config.projectName) let progressNotifier = ProgressNotifier(name: InstallingGeneratorConfig, maxValue: 1) defer { progressNotifier.incrementValue() } localizedMessageLogger.infoMessage("Installing generator config") #if swift(>=2.3) let configURL = configDirectoryURL.URLByAppendingPathComponent(config.defaultFilename)! #else let configURL = configDirectoryURL.URLByAppendingPathComponent(config.defaultFilename) #endif var errorInfo: String? = nil do { let data = try config.save() try writeDataHandler(configURL, data) } catch let e as NSError { errorInfo = e.localizedDescription } catch { errorInfo = "Unexpected exception" } if let errorInfo = errorInfo { localizedMessageLogger.syslogMessage("Generator config serialization failed. \(errorInfo)", context: config.projectName) return } #if swift(>=2.3) let perUserConfigURL = configDirectoryURL.URLByAppendingPathComponent(TulsiGeneratorConfig.perUserFilename)! #else let perUserConfigURL = configDirectoryURL.URLByAppendingPathComponent(TulsiGeneratorConfig.perUserFilename) #endif errorInfo = nil do { if let data = try config.savePerUserSettings() { try writeDataHandler(perUserConfigURL, data) } } catch let e as NSError { errorInfo = e.localizedDescription } catch { errorInfo = "Unexpected exception" } if let errorInfo = errorInfo { localizedMessageLogger.syslogMessage("Generator per-user config serialization failed. \(errorInfo)", context: config.projectName) return } localizedMessageLogger.logProfilingEnd(profilingToken) } private func installGeneratedProjectResources(projectURL: NSURL) { #if swift(>=2.3) let targetDirectoryURL = projectURL.URLByAppendingPathComponent(XcodeProjectGenerator.ProjectResourcesDirectorySubpath, isDirectory: true)! #else let targetDirectoryURL = projectURL.URLByAppendingPathComponent(XcodeProjectGenerator.ProjectResourcesDirectorySubpath, isDirectory: true) #endif guard createDirectory(targetDirectoryURL) else { return } let profilingToken = localizedMessageLogger.startProfiling("installing_project_resources", context: config.projectName) localizedMessageLogger.infoMessage("Installing project resources") installFiles([(resourceURLs.stubInfoPlist, XcodeProjectGenerator.StubInfoPlistFilename), (resourceURLs.stubIOSAppExInfoPlist, XcodeProjectGenerator.StubInfoIOSAppExPlistFilename), (resourceURLs.stubWatchOS2InfoPlist, XcodeProjectGenerator.StubWatchOS2InfoPlistFilename), (resourceURLs.stubWatchOS2AppExInfoPlist, XcodeProjectGenerator.StubWatchOS2AppExInfoPlistFilename), ], toDirectory: targetDirectoryURL) localizedMessageLogger.logProfilingEnd(profilingToken) } private func createDirectory(resourceDirectoryURL: NSURL, failSilently: Bool = false) -> Bool { do { try fileManager.createDirectoryAtURL(resourceDirectoryURL, withIntermediateDirectories: true, attributes: nil) } catch let e as NSError { if !failSilently { localizedMessageLogger.error("DirectoryCreationFailed", comment: "Failed to create an important directory. The resulting project will most likely be broken. A bug should be reported.", context: config.projectName, values: resourceDirectoryURL, e.localizedDescription) } return false } return true } private func installFiles(files: [(sourceURL: NSURL, filename: String)], toDirectory directory: NSURL, failSilently: Bool = false) { for (sourceURL, filename) in files { guard let targetURL = NSURL(string: filename, relativeToURL: directory) else { if !failSilently { localizedMessageLogger.error("CopyingResourceFailed", comment: "Failed to copy an important file resource, the resulting project will most likely be broken. A bug should be reported.", context: config.projectName, values: sourceURL, filename, "Target URL is invalid") } continue } let errorInfo: String? do { if fileManager.fileExistsAtPath(targetURL.path!) { try fileManager.removeItemAtURL(targetURL) } try fileManager.copyItemAtURL(sourceURL, toURL: targetURL) errorInfo = nil } catch let e as NSError { errorInfo = e.localizedDescription } catch { errorInfo = "Unexpected exception" } if !failSilently, let errorInfo = errorInfo { #if swift(>=2.3) let targetURLString = targetURL.absoluteString! #else let targetURLString = targetURL.absoluteString #endif localizedMessageLogger.error("CopyingResourceFailed", comment: "Failed to copy an important file resource, the resulting project will most likely be broken. A bug should be reported.", context: config.projectName, values: sourceURL, targetURLString, errorInfo) } } } private func createGeneratedArtifactFolders(mainGroup: PBXGroup, relativeTo path: NSURL) { if suppressGeneratedArtifactFolderCreation { return } let generatedArtifacts = mainGroup.allSources.filter() { !$0.isInputFile } let generatedFolders = PathTrie() for artifact in generatedArtifacts { #if swift(>=2.3) let url = path.URLByAppendingPathComponent(artifact.sourceRootRelativePath)! #else let url = path.URLByAppendingPathComponent(artifact.sourceRootRelativePath) #endif if let absoluteURL = url.URLByDeletingLastPathComponent?.URLByStandardizingPath { generatedFolders.insert(absoluteURL) } } var failedCreates = [String]() for url in generatedFolders.leafPaths() { if !createDirectory(url, failSilently: true) { failedCreates.append(url.path!) } } if !failedCreates.isEmpty { localizedMessageLogger.warning("CreatingGeneratedArtifactFoldersFailed", comment: "Failed to create folders for generated artifacts %1$@. The generated Xcode project may need to be reloaded after the first build.", context: config.projectName, values: failedCreates.joinWithSeparator(", ")) } } /// Models a node in a path trie. private class PathTrie { private var root = PathNode(pathElement: "") func insert(path: NSURL) { guard let components = path.pathComponents where !components.isEmpty else { return } root.addPath(components) } func leafPaths() -> [NSURL] { var ret = [NSURL]() for n in root.children.values { for path in n.leafPaths() { guard let url = NSURL.fileURLWithPathComponents(path) else { continue } ret.append(url) } } return ret } private class PathNode { let value: String var children = [String: PathNode]() init(pathElement: String) { self.value = pathElement } func addPath<T: CollectionType where T.SubSequence : CollectionType, T.SubSequence.Generator.Element == T.Generator.Element, T.SubSequence.SubSequence == T.SubSequence, T.Generator.Element == String>(pathComponents: T) { guard let firstComponent = pathComponents.first else { return } let node: PathNode if let existingNode = children[firstComponent] { node = existingNode } else { node = PathNode(pathElement: firstComponent) children[firstComponent] = node } let remaining = pathComponents.dropFirst() if !remaining.isEmpty { node.addPath(remaining) } } func leafPaths() -> [[String]] { if children.isEmpty { return [[value]] } var ret = [[String]]() for n in children.values { for childPath in n.leafPaths() { var subpath = [value] subpath.appendContentsOf(childPath) ret.append(subpath) } } return ret } } } /// Encapsulates high level information about the generated Xcode project intended for use by /// external scripts or to aid debugging. private class GeneratorManifest { /// Version number used to track changes to the format of the generated manifest. // This number may be used by consumers of the manifest for compatibility detection. private static let ManifestFormatVersion = 3 /// Suffix for manifest entries whose recursive contents are used by the Xcode project. private static let BundleSuffix = "/**" private static let NormalBundleTypes = Set(DirExtensionToUTI.values) private let localizedMessageLogger: LocalizedMessageLogger private let pbxProject: PBXProject var fileReferences: Set<String>! = nil var targets: [String: [String]]! = nil let intermediateArtifacts: [String: [String]] var artifacts: Set<String>! = nil init(localizedMessageLogger: LocalizedMessageLogger, pbxProject: PBXProject, intermediateArtifacts: [String: [String]]) { self.localizedMessageLogger = localizedMessageLogger self.pbxProject = pbxProject self.intermediateArtifacts = intermediateArtifacts } func writeToURL(outputURL: NSURL) -> Bool { if fileReferences == nil { parsePBXProject() } let dict = [ "manifestVersion": GeneratorManifest.ManifestFormatVersion, "fileReferences": Array(fileReferences).sort(), "targets": targets, "intermediateArtifacts": intermediateArtifacts, "artifacts": Array(artifacts).sort(), ] do { let data = try NSJSONSerialization.tulsi_newlineTerminatedDataWithJSONObject(dict, options: .PrettyPrinted) return data.writeToURL(outputURL, atomically: true) } catch let e as NSError { localizedMessageLogger.infoMessage("Failed to write manifest file \(outputURL.path!): \(e.localizedDescription)") return false } catch { localizedMessageLogger.infoMessage("Failed to write manifest file \(outputURL.path!): Unexpected exception") return false } } private func parsePBXProject() { fileReferences = Set() targets = [:] artifacts = Set() for ref in pbxProject.mainGroup.allSources { let artifactPath: String // Bundle-type artifacts are appended with BundleSuffix to indicate that the recursive // contents of the bundle are needed. if ref.fileType == "wrapper.xcdatamodel", let parent = ref.parent as? XCVersionGroup where parent.versionGroupType == "wrapper.xcdatamodel" { artifactPath = parent.sourceRootRelativePath + GeneratorManifest.BundleSuffix } else if let refType = ref.fileType where GeneratorManifest.NormalBundleTypes.contains(refType) { artifactPath = ref.sourceRootRelativePath + GeneratorManifest.BundleSuffix } else { artifactPath = ref.sourceRootRelativePath } if ref.isInputFile { fileReferences.insert(artifactPath) } else { artifacts.insert(artifactPath) } } for target in pbxProject.allTargets { let buildConfigList = target.buildConfigurationList if let debugConfig = buildConfigList.buildConfigurations["Debug"], let bazelOutputs = debugConfig.buildSettings["BAZEL_OUTPUTS"] { targets[target.name] = bazelOutputs.componentsSeparatedByString("\n").sort() } else { targets[target.name] = [] } } } } }
[ -1 ]
18f532ad9eba97c46a36f606e807296f779781e0
a84e05cfef2c3fd961e358a7eb4fb0de2565e1d3
/PlanMyDay/Helpers/Extensions/UIViewController+Extensions.swift
aff9a2780a83a41f5177aab6a3b6d011a336219e
[]
no_license
talipboke/PlanMyDay
dcf0d01b447b7ee4d099fde5134dd6434d4a7b45
1f9cd514ee3167c2b1b1bdc8f152447a978a4bdb
refs/heads/master
2020-06-11T13:19:59.502526
2019-08-02T19:18:16
2019-08-02T19:18:16
193,978,994
2
0
null
null
null
null
UTF-8
Swift
false
false
588
swift
// // UIViewController+Extensions.swift // PlanMyDay // // Created by Talip on 26.06.2019. // Copyright © 2019 Talip. All rights reserved. // import UIKit extension UIViewController{ func push<T :UIViewController>(storyBoard : UIStoryboard.Storyboard? = .home,targetVC : T.Type,transitionCallBack : ((T)->())? = nil){ let viewController : T = UIStoryboard.storyboard(storyboard: storyBoard!).instantiateVC() transitionCallBack?(viewController) self.navigationController?.pushViewController(viewController, animated: true) } }
[ -1 ]
f55c02a80bd172737c48267ca556c50a4f450dc6
5b852254a8bb03c376b43e46e367b48fbd7bf17e
/Sources/UI/Main/MainViewController.swift
986ca8fd69b6832a91fc559903b71c928eef2b9f
[]
no_license
ringoid/client-ios
04aab29c295f44424952f1267837a4e332f6ed50
1035d813a1e7584f4e7a848a38c64981b73f8315
refs/heads/master
2020-04-14T10:54:16.379112
2019-10-11T05:39:20
2019-10-11T05:39:20
163,799,263
0
0
null
null
null
null
UTF-8
Swift
false
false
31,288
swift
// // MainViewController.swift // ringoid // // Created by Victor Sukochev on 09/01/2019. // Copyright © 2019 Ringoid. All rights reserved. // import UIKit import RxSwift import RxCocoa enum CachedUIState { case discover case likes case chats case profile } enum RemoteFeedType: String { case unknown = "unknown" case likesYou = "NEW_LIKE_PUSH_TYPE" case matches = "NEW_MATCH_PUSH_TYPE" case messages = "NEW_MESSAGE_PUSH_TYPE" } class MainViewController: BaseViewController { var input: MainVMInput! var defaultState: SelectionState = .searchAndFetch fileprivate var viewModel: MainViewModel? fileprivate var containerVC: ContainerViewController! fileprivate weak var containedVC: UIViewController? fileprivate let disposeBag: DisposeBag = DisposeBag() fileprivate var menuVCCache: [CachedUIState: UIViewController] = [:] fileprivate var prevState: SelectionState? = nil fileprivate var isBannerClosedManually: Bool = false fileprivate var preshownLikesCount: Int = 0 fileprivate var preshownMatchesCount: Int = 0 fileprivate var preshownMessagesCount: Int = 0 @IBOutlet fileprivate weak var searchBtn: UIButton! @IBOutlet fileprivate weak var likeBtn: UIButton! @IBOutlet fileprivate weak var chatsBtn: UIButton! @IBOutlet fileprivate weak var profileBtn: UIButton! @IBOutlet fileprivate weak var profileIndicatorView: UIView! @IBOutlet fileprivate weak var effectsView: MainEffectsView! @IBOutlet fileprivate weak var buttonsStackView: UIView! @IBOutlet fileprivate weak var bottomShadowView: UIView! @IBOutlet fileprivate weak var likesYouIndicatorView: UIView! @IBOutlet fileprivate weak var chatIndicatorView: UIView! @IBOutlet fileprivate weak var notificationsBannerView: UIView! @IBOutlet fileprivate weak var notificationsBannerLabel: UILabel! @IBOutlet fileprivate weak var notificationsBannerSubLabel: UILabel! static func create() -> MainViewController { let storyboard = Storyboards.main() return storyboard.instantiateInitialViewController() as! MainViewController } override func viewDidLoad() { super.viewDidLoad() GlobalAnimationManager.shared.animationView = self.effectsView self.setupBindings() // let tapRecognizer = UITapGestureRecognizer(target: self, action: #selector(showDebugRateUsAlert)) // tapRecognizer.numberOfTapsRequired = 2 // self.likeBtn.addGestureRecognizer(tapRecognizer) } #if STAGE @objc func showDebugRateUsAlert() { RateUsManager.shared.showAlert(self) } @objc func showDebugLikesCount() { let size = self.likeBtn.bounds.size let center = self.likeBtn.convert(CGPoint(x: size.width / 2.0, y: size.height / 2.0), to: nil) let position = CGPoint(x: 44.0, y: center.y + 16.0) self.effectsView.animateLikes(5, from: position) self.effectsView.animateLikesDelta(20) } @objc func showDebugLikes() { let alertVC = UIAlertController(title: "Simulate likes", message: nil, preferredStyle: .alert) alertVC.addTextField(configurationHandler: { textField in textField.keyboardType = .numberPad }) alertVC.addAction(UIAlertAction(title: "Simulate", style: .default, handler: { _ in guard let text = alertVC.textFields?.first?.text, let count = Int(text) else { return } let size = self.likeBtn.bounds.size let center = self.likeBtn.convert(CGPoint(x: size.width / 2.0, y: size.height / 2.0), to: nil) let position = CGPoint(x: 44.0, y: center.y + 16.0) self.effectsView.animateLikes(count, from: position) self.effectsView.animateMatches(Int(Double(count) / 3.0), from: position) self.effectsView.animateMessages(Int(Double(count) / 2.0), from: position) })) alertVC.addAction(UIAlertAction(title: "Cancel", style: .cancel, handler: nil)) self.present(alertVC, animated: true, completion: nil) } #endif override func updateTheme() { self.view.backgroundColor = BackgroundColor().uiColor() } override func updateLocale() { self.notificationsBannerLabel.text = "settings_notifications_banner_title".localized() self.notificationsBannerSubLabel.text = "settings_notifications_banner_subtitle".localized() } override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if segue.identifier == "embed_container" { self.containerVC = segue.destination as? ContainerViewController } if segue.identifier == "embed_visual_notifications" { let vc = segue.destination as? VisualNotificationsViewController vc?.input = VisualNotificationsVMInput( manager: self.input.visualNotificationsManager, navigation: self.input.navigationManager ) } } // MARK: - Actions @IBAction func onSearchSelected() { self.viewModel?.moveToSearch() } @IBAction func onLikeSelected() { self.viewModel?.moveToLikes() } @IBAction func onProfileSelected() { self.viewModel?.moveToProfile() } @IBAction func onChatsSelected() { self.viewModel?.moveToChats() } @IBAction fileprivate func onBannerTap() { if let settingsUrl = URL(string: UIApplication.openSettingsURLString) { UIApplication.shared.open(settingsUrl) } self.closeBanner() } @IBAction fileprivate func onBannerClose() { self.isBannerClosedManually = true self.closeBanner() } fileprivate func closeBanner() { let animator = UIViewPropertyAnimator(duration: 0.1, curve: .easeIn) { [weak self] in self?.notificationsBannerView.alpha = 0.0 } animator.addCompletion { [weak self] _ in self?.notificationsBannerView.isHidden = true self?.notificationsBannerView.alpha = 1.0 } animator.startAnimation() } // MARK: - fileprivate func select(_ to: SelectionState) { self.input.actionsManager.commit() if let prevState = self.prevState, prevState == to { return } switch to { case .chat(_): self.prevState = .chats break default: self.prevState = to break } ModalUIManager.shared.hide(animated: false) switch to { case .search: self.searchBtn.setImage(UIImage(named: "main_bar_search_selected"), for: .normal) self.likeBtn.setImage(UIImage(named: "main_bar_like"), for: .normal) self.chatsBtn.setImage(UIImage(named: "main_bar_messages"), for: .normal) self.profileBtn.setImage(UIImage(named: "main_bar_profile"), for: .normal) self.embedNewFaces() break case .likes: self.searchBtn.setImage(UIImage(named: "main_bar_search"), for: .normal) self.likeBtn.setImage(UIImage(named: "main_bar_like_selected"), for: .normal) self.chatsBtn.setImage(UIImage(named: "main_bar_messages"), for: .normal) self.profileBtn.setImage(UIImage(named: "main_bar_profile"), for: .normal) self.embedLikes() break case .chats: self.chatsBtn.setImage(UIImage(named: "main_bar_messages_selected"), for: .normal) self.searchBtn.setImage(UIImage(named: "main_bar_search"), for: .normal) self.likeBtn.setImage(UIImage(named: "main_bar_like"), for: .normal) self.profileBtn.setImage(UIImage(named: "main_bar_profile"), for: .normal) self.embedChats() break case .profile: self.searchBtn.setImage(UIImage(named: "main_bar_search"), for: .normal) self.likeBtn.setImage(UIImage(named: "main_bar_like"), for: .normal) self.chatsBtn.setImage(UIImage(named: "main_bar_messages"), for: .normal) self.profileBtn.setImage(UIImage(named: "main_bar_profile_selected"), for: .normal) self.embedUserProfile() break case .profileAndPick: self.searchBtn.setImage(UIImage(named: "main_bar_search"), for: .normal) self.likeBtn.setImage(UIImage(named: "main_bar_like"), for: .normal) self.chatsBtn.setImage(UIImage(named: "main_bar_messages"), for: .normal) self.profileBtn.setImage(UIImage(named: "main_bar_profile_selected"), for: .normal) self.embedUserProfileAndPick() break case .profileAndFetch: self.searchBtn.setImage(UIImage(named: "main_bar_search"), for: .normal) self.likeBtn.setImage(UIImage(named: "main_bar_like"), for: .normal) self.chatsBtn.setImage(UIImage(named: "main_bar_messages"), for: .normal) self.profileBtn.setImage(UIImage(named: "main_bar_profile_selected"), for: .normal) self.embedUserProfileAndFetch() break case .profileAndAsk: self.searchBtn.setImage(UIImage(named: "main_bar_search"), for: .normal) self.likeBtn.setImage(UIImage(named: "main_bar_like"), for: .normal) self.chatsBtn.setImage(UIImage(named: "main_bar_messages"), for: .normal) self.profileBtn.setImage(UIImage(named: "main_bar_profile_selected"), for: .normal) self.embedUserProfileAndAsk() break case .searchAndFetch: self.searchBtn.setImage(UIImage(named: "main_bar_search_selected"), for: .normal) self.likeBtn.setImage(UIImage(named: "main_bar_like"), for: .normal) self.chatsBtn.setImage(UIImage(named: "main_bar_messages"), for: .normal) self.profileBtn.setImage(UIImage(named: "main_bar_profile"), for: .normal) self.embedNewFacesAndFetch() break case .searchAndFetchFirstTime: self.searchBtn.setImage(UIImage(named: "main_bar_search_selected"), for: .normal) self.likeBtn.setImage(UIImage(named: "main_bar_like"), for: .normal) self.chatsBtn.setImage(UIImage(named: "main_bar_messages"), for: .normal) self.profileBtn.setImage(UIImage(named: "main_bar_profile"), for: .normal) self.embedNewFacesAndFetchFirstTime() break case .likeAndFetch: self.searchBtn.setImage(UIImage(named: "main_bar_search"), for: .normal) self.likeBtn.setImage(UIImage(named: "main_bar_like_selected"), for: .normal) self.chatsBtn.setImage(UIImage(named: "main_bar_messages"), for: .normal) self.profileBtn.setImage(UIImage(named: "main_bar_profile"), for: .normal) self.embedMainLMMAndFetch() break case .chat(let profileId): self.chatsBtn.setImage(UIImage(named: "main_bar_messages_selected"), for: .normal) self.searchBtn.setImage(UIImage(named: "main_bar_search"), for: .normal) self.likeBtn.setImage(UIImage(named: "main_bar_like"), for: .normal) self.profileBtn.setImage(UIImage(named: "main_bar_profile"), for: .normal) self.embedChat(profileId) break } } fileprivate func embedNewFaces() { guard let vc = self.getNewFacesVC() else { return } self.containerVC.embed(vc) } fileprivate func embedNewFacesAndFetch() { guard let vc = self.getNewFacesVC() else { return } self.containedVC = vc self.containerVC.embed(vc) DispatchQueue.main.async { vc.reload(false) } } fileprivate func embedNewFacesAndFetchFirstTime() { guard let vc = self.getNewFacesVC() else { return } self.containedVC = vc self.containerVC.embed(vc) DispatchQueue.main.async { vc.reload(false) vc.showFilterFromFeed() } } fileprivate func embedLikes() { if let vc = self.menuVCCache[.likes] as? MainLMMContainerViewController { self.containedVC = vc self.containerVC.embed(vc) return } guard let vc = self.getMainLMMVC() else { return } self.containedVC = vc self.containerVC.embed(vc) self.menuVCCache[.likes] = vc DispatchQueue.main.async { vc.toggle(.likesYou) } } fileprivate func embedChats() { if let vc = self.menuVCCache[.chats] as? MainLMMContainerViewController { self.containedVC = vc self.containerVC.embed(vc) return } guard let vc = self.getMainLMMVC() else { return } self.containedVC = vc self.containerVC.embed(vc) self.menuVCCache[.chats] = vc DispatchQueue.main.async { vc.toggle(.messages) } } fileprivate func embedChat(_ profileId: String) { if let vc = self.menuVCCache[.chats] as? MainLMMContainerViewController { self.containedVC = vc self.containerVC.embed(vc) vc.openChat(profileId) return } guard let vc = self.getMainLMMVC() else { return } self.containedVC = vc self.containerVC.embed(vc) self.menuVCCache[.chats] = vc DispatchQueue.main.async { vc.toggle(.messages) vc.openChat(profileId) } } fileprivate func embedUserProfile() { guard let vc = self.getUserProfileVC() else { return } self.containedVC = vc self.containerVC.embed(vc) } fileprivate func embedUserProfileAndPick() { guard let vc = self.getUserProfileVC() else { return } self.containedVC = vc self.containerVC.embed(vc) vc.showPhotoPicker() } fileprivate func embedUserProfileAndFetch() { guard let vc = self.getUserProfileVC() else { return } self.containedVC = vc self.containerVC.embed(vc) vc.reload() } fileprivate func embedUserProfileAndAsk() { guard let vc = self.getUserProfileVC() else { return } self.containedVC = vc self.containerVC.embed(vc) vc.askIfNeeded() } fileprivate func embedMainLMMAndFetch() { guard let vc = self.getMainLMMVC() else { return } self.containedVC = vc self.containerVC.embed(vc) DispatchQueue.main.async { vc.reload() } } fileprivate func getMainLMMVC() -> MainLMMContainerViewController? { let storyboard = Storyboards.mainLMM() guard let vc = storyboard.instantiateInitialViewController() as? MainLMMContainerViewController else { return nil } vc.input = MainLMMVMInput( lmmManager: self.input.lmmManager, actionsManager: self.input.actionsManager, chatManager: self.input.chatManager, profileManager: self.input.profileManager, navigationManager: self.input.navigationManager, newFacesManager: self.input.newFacesManager, notifications: self.input.notifications, location: self.input.location, scenario: self.input.scenario, transition: self.input.transition, settings: self.input.settingsManager, filter: self.input.filter, externalLinkManager: self.input.externalLinkManager ) return vc } fileprivate func getUserProfileVC() -> UserProfilePhotosViewController? { if let vc = self.menuVCCache[.profile] as? UserProfilePhotosViewController { return vc } let storyboard = Storyboards.userProfile() guard let vc = storyboard.instantiateInitialViewController() as? UserProfilePhotosViewController else { return nil } vc.input = UserProfilePhotosVCInput( profileManager: self.input.profileManager, lmmManager: self.input.lmmManager, settingsManager: self.input.settingsManager, navigationManager: self.input.navigationManager, newFacesManager: self.input.newFacesManager, actionsManager: self.input.actionsManager, errorsManager: self.input.errorsManager, promotionManager: self.input.promotionManager, device: self.input.device, location: self.input.location, scenario: self.input.scenario, db: self.input.db, filter: self.input.filter, externalLinkManager: self.input.externalLinkManager ) self.menuVCCache[.profile] = vc return vc } fileprivate func getNewFacesVC() -> NewFacesViewController? { if let vc = self.menuVCCache[.discover] as? NewFacesViewController { return vc } let storyboard = Storyboards.newFaces() guard let vc = storyboard.instantiateInitialViewController() as? NewFacesViewController else { return nil } vc.input = NewFacesVMInput( newFacesManager: self.input.newFacesManager, actionsManager: self.input.actionsManager, profileManager: self.input.profileManager, lmmManager: self.input.lmmManager, navigationManager: self.input.navigationManager, notifications: self.input.notifications, location: self.input.location, scenario: self.input.scenario, transition: self.input.transition, filter: self.input.filter, externalLinkManager: self.input.externalLinkManager ) self.menuVCCache[.discover] = vc return vc } fileprivate func setupBindings() { self.viewModel = MainViewModel(self.input) self.viewModel?.input.navigationManager.mainItem.skip(1).observeOn(MainScheduler.instance).subscribe(onNext: { [weak self] item in UIView.performWithoutAnimation { self?.select(item.selectionState()) } }).disposed(by: self.disposeBag) self.viewModel?.availablePhotosCount.observeOn(MainScheduler.instance).subscribe(onNext: { [weak self] count in self?.profileIndicatorView.isHidden = count != 0 }).disposed(by: self.disposeBag) self.viewModel?.notSeenProfilesTotalCount.observeOn(MainScheduler.instance).subscribe(onNext: { value in UIApplication.shared.applicationIconBadgeNumber = value }).disposed(by: self.disposeBag) self.viewModel?.incomingLikesCount.observeOn(MainScheduler.instance).subscribe(onNext: { [weak self] count in guard let `self` = self else { return } let countToShow: Int = count - self.preshownLikesCount if countToShow > 0 { self.preshownLikesCount = 0 } else { self.preshownLikesCount -= count return } let size = self.likeBtn.bounds.size let center = self.likeBtn.convert(CGPoint(x: size.width / 2.0, y: size.height / 2.0), to: nil) let position = CGPoint(x: 44.0, y: center.y + 16.0) self.effectsView.animateLikes(countToShow, from: position) self.input.achivement.addLikes(countToShow) //self.effectsView.animateLikesDelta(countToShow) }).disposed(by: self.disposeBag) self.viewModel?.incomingMatches.observeOn(MainScheduler.instance).subscribe(onNext: { [weak self] count in guard let `self` = self else { return } let countToShow: Int = count - self.preshownMatchesCount if countToShow > 0 { self.preshownMatchesCount = 0 } else { self.preshownMatchesCount -= count return } let size = self.likeBtn.bounds.size let center = self.likeBtn.convert(CGPoint(x: size.width / 2.0, y: size.height / 2.0), to: nil) let position = CGPoint(x: 44.0, y: center.y + 16.0) self.effectsView.animateMatches(countToShow, from: position) self.input.achivement.addLikes(countToShow) }).disposed(by: self.disposeBag) self.viewModel?.incomingMessages.observeOn(MainScheduler.instance).subscribe(onNext: { [weak self] count in guard let `self` = self else { return } let countToShow: Int = count - self.preshownMessagesCount if countToShow > 0 { self.preshownMessagesCount = 0 } else { self.preshownMessagesCount -= count return } let size = self.likeBtn.bounds.size let center = self.likeBtn.convert(CGPoint(x: size.width / 2.0, y: size.height / 2.0), to: self.view) let position = CGPoint(x: 44.0, y: center.y + 16.0) self.effectsView.animateMessages(countToShow, from: position) }).disposed(by: self.disposeBag) self.input.notifications.notificationData.observeOn(MainScheduler.instance).subscribe(onNext: { [weak self] userInfo in guard let `self` = self else { return } guard let typeStr = userInfo["type"] as? String else { return } guard let remoteFeed = RemoteFeedType(rawValue: typeStr) else { return } guard let profileId = userInfo["oppositeUserId"] as? String else { return } guard self.viewModel?.isBlocked(profileId) == false else { return } guard ChatViewController.openedProfileId != profileId else { return } let size = self.likeBtn.bounds.size let center = self.likeBtn.convert(CGPoint(x: size.width / 2.0, y: size.height / 2.0), to: self.view) let position = CGPoint(x: 44.0, y: center.y + 16.0) switch remoteFeed { case .likesYou: self.preshownLikesCount += 1 self.fireImpact() self.effectsView.animateLikes(1, from: position) self.input.achivement.addLikes(1) break case .matches: guard !self.input.lmmManager.messages.value.map({ $0.id }).contains(profileId) else { return } self.preshownMatchesCount += 1 self.fireImpact() self.input.achivement.addLikes(1) self.effectsView.animateMatches(1, from: position) break case .messages: if self.viewModel?.isMessageProcessed(profileId) == true { return } self.preshownMessagesCount += 1 self.fireImpact() self.effectsView.animateMessages(1, from: position) DispatchQueue.main.async { self.viewModel?.markMessageAsProcessed(profileId) } break default: return } }).disposed(by: self.disposeBag) UIManager.shared.chatModeEnabled.observeOn(MainScheduler.instance).subscribe(onNext: { [weak self] state in guard let `self` = self else { return } self.buttonsStackView.isHidden = state self.profileIndicatorView.alpha = state ? 0.0 : 1.0 self.likesYouIndicatorView.alpha = state ? 0.0 : 1.0 self.bottomShadowView.isHidden = state if state { self.notificationsBannerView.isHidden = true } else { if self.input.notifications.isRegistered { self.notificationsBannerView.isHidden = self.input.notifications.isGranted.value || self.isBannerClosedManually } } }).disposed(by: self.disposeBag) UIManager.shared.wakeUpDelayTriggered.observeOn(MainScheduler.instance).subscribe(onNext: { [weak self] state in guard let `self` = self else { return } guard state else { return } if self.input.notifications.isRegistered { self.notificationsBannerView.isHidden = self.input.notifications.isGranted.value } }).disposed(by: self.disposeBag) UIManager.shared.blockModeEnabled.asObservable().observeOn(MainScheduler.instance).subscribe(onNext: { [weak self] state in self?.buttonsStackView.isHidden = state self?.profileIndicatorView.alpha = state ? 0.0 : 1.0 self?.likesYouIndicatorView.alpha = state ? 0.0 : 1.0 self?.bottomShadowView.isHidden = state }).disposed(by: self.disposeBag) self.input.notifications.responses.asObservable().observeOn(MainScheduler.instance).subscribe(onNext: { [weak self] response in guard let `self` = self else { return } let userInfo = response.notification.request.content.userInfo guard let typeStr = userInfo["type"] as? String else { self.input.navigationManager.mainItem.accept(.searchAndFetch) return } guard let type = RemoteFeedType(rawValue: typeStr) else { return } switch type { case .unknown: break case .likesYou: self.input.navigationManager.mainItem.accept(.likes) DispatchQueue.main.async { let vc = self.containedVC as? MainLMMContainerViewController vc?.prepareForNavigation() vc?.reload() } break case .matches: self.input.navigationManager.mainItem.accept(.chats) DispatchQueue.main.async { let vc = self.containedVC as? MainLMMContainerViewController vc?.prepareForNavigation() vc?.reload() } break case .messages: self.input.navigationManager.mainItem.accept(.chats) DispatchQueue.main.async { let vc = self.containedVC as? MainLMMContainerViewController //vc?.toggle(.messages) vc?.prepareForNavigation() vc?.reload() } break } }).disposed(by: self.disposeBag) self.input.notifications.isGranted.observeOn(MainScheduler.instance).subscribe(onNext:{ [weak self] _ in guard let `self` = self else { return } guard self.input.notifications.isRegistered else { return } guard !UIManager.shared.wakeUpDelayTriggered.value else { return } self.notificationsBannerView.isHidden = self.input.notifications.isGranted.value || self.isBannerClosedManually }).disposed(by: self.disposeBag) // Counters // self.input.lmmManager.allLikesYouProfilesCount.observeOn(MainScheduler.instance).subscribe(onNext: { [weak self] count in // let title: String? = count != 0 ? "\(count)" : nil // self?.likeBtn.setTitle(title, for: .normal) // }).disposed(by: self.disposeBag) // self.input.lmmManager.allMessagesProfilesCount.observeOn(MainScheduler.instance).subscribe(onNext: { [weak self] count in // let title: String? = count != 0 ? "\(count)" : nil // self?.chatsBtn.setTitle(title, for: .normal) // }).disposed(by: self.disposeBag) // Not seen profiles indicators self.input.lmmManager.notSeenLikesYouCount.observeOn(MainScheduler.instance).subscribe(onNext: { [weak self] count in guard let `self` = self else { return } self.likesYouIndicatorView.isHidden = count == 0 }).disposed(by: self.disposeBag) self.input.lmmManager.notSeenMessagesCount.observeOn(MainScheduler.instance).subscribe(onNext: { [weak self] count in guard let `self` = self else { return } self.chatIndicatorView.isHidden = !(count != 0 || self.input.lmmManager.notSeenMatchesCount.value != 0) }).disposed(by: self.disposeBag) self.input.lmmManager.notSeenMatchesCount.observeOn(MainScheduler.instance).subscribe(onNext: { [weak self] count in guard let `self` = self else { return } self.chatIndicatorView.isHidden = !(count != 0 || self.input.lmmManager.notSeenMessagesCount.value != 0) }).disposed(by: self.disposeBag) UIManager.shared.lmmRefreshModeEnabled.observeOn(MainScheduler.instance).subscribe(onNext: { [weak self] state in let alpha: CGFloat = state ? 0.0 : 1.0 self?.likesYouIndicatorView.alpha = alpha self?.chatIndicatorView.alpha = alpha }).disposed(by: self.disposeBag) self.input.achivement.text.skip(1).observeOn(MainScheduler.instance).subscribe(onNext: { [weak self] text in self?.effectsView.animateAchivementText(text) }).disposed(by: self.disposeBag) } fileprivate func fireImpact() { DispatchQueue.main.asyncAfter(deadline: .now() + 1.0, execute: { self.input.impact.perform(.light) }) } } extension MainNavigationItem { func selectionState() -> SelectionState { switch self { case .search: return .search case .likes: return .likes case .chats: return .chats case .profile: return .profile case .profileAndFetch: return .profileAndFetch case .profileAndPick: return .profileAndPick case .profileAndAsk: return .profileAndAsk case .searchAndFetch: return .searchAndFetch case .searchAndFetchFirstTime: return .searchAndFetchFirstTime case .likeAndFetch: return .likeAndFetch case .chat(let profileId): return .chat(profileId) } } }
[ -1 ]
f50713ec1e4571f22855c87f3db6952f1c50587c
5cda4952e080ba74a3cf8e39c849c8bdfd63799f
/Pods/TextFieldEffects/TextFieldEffects/TextFieldEffects/YokoTextField.swift
6e7fd0939d3a36af3f4859bf4bed60d338ddcdef
[]
no_license
Croe2019/OriginalApplication
692662ddaf9ef1fdaad8cc5242ac60ffcad09543
c9692216044ba1b395ef1e9131057e3dc150b00d
refs/heads/master
2023-05-08T11:34:46.071450
2021-05-30T12:43:13
2021-05-30T12:43:13
314,783,399
0
0
null
null
null
null
UTF-8
Swift
false
false
129
swift
version https://git-lfs.github.com/spec/v1 oid sha256:8cdd7b5629399febb4a5e049583e79061d7d76d11644f95bf029d81efa36b2fe size 8130
[ -1 ]
0d64c9b8f018cd4fbd590f4fb2b6a0935e2276e6
fbb886ed28d72f9bff1c106c4d21ce6259b79e10
/Homepwner/HomepwnerTests/HomepwnerTests.swift
fa63bc26f9a53cd04e1ea3b7ee6dad3440ce7a6f
[]
no_license
seabjackson/iOS-Programming-BNR
21bc6f44a105fa084d8fd3157da66da5bc402252
f796dca68d8e264f8e51fcf6f4b9b1389dc4bafe
refs/heads/master
2021-01-10T04:57:45.068777
2016-09-30T06:00:40
2016-09-30T06:00:40
49,682,475
1
0
null
null
null
null
UTF-8
Swift
false
false
970
swift
// // HomepwnerTests.swift // HomepwnerTests // // Created by lily on 4/7/16. // Copyright © 2016 Seab Jackson. All rights reserved. // import XCTest @testable import Homepwner class HomepwnerTests: 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. } } }
[ 313357, 305179, 239650, 16419, 223268, 102437, 292902, 229413, 204840, 354343, 227370, 354345, 223274, 233517, 155694, 102445, 229424, 309295, 278570, 282672, 237620, 229430, 352315, 325694, 288833, 288834, 286788, 352326, 313416, 311372, 354385, 223316, 280661, 315476, 307289, 354393, 315487, 237663, 45153, 309345, 280675, 227428, 307301, 280677, 313447, 319591, 315497, 131178, 278634, 194666, 315498, 288879, 284788, 333940, 223350, 233590, 280694, 237689, 288889, 131191, 292988, 313469, 131198, 215166, 292992, 215164, 194691, 227460, 280712, 215178, 235662, 311438, 325776, 323729, 278677, 284825, 284826, 311458, 278691, 233636, 299174, 233642, 284842, 239793, 299187, 278708, 278714, 223419, 280762, 299198, 258239, 280768, 227524, 309444, 280778, 282831, 280795, 227548, 229597, 301279, 311519, 280802, 176362, 286958, 184575, 311042, 194820, 313608, 278797, 325905, 319763, 325912, 309529, 282909, 278816, 237857, 211235, 217380, 211238, 151847, 282919, 311597, 98610, 280887, 332089, 278842, 315706, 282939, 307517, 287041, 260418, 321860, 311621, 139589, 280902, 319813, 182598, 348492, 383311, 325968, 6481, 305495, 6489, 379225, 332123, 323935, 106847, 354655, 416104, 280939, 160110, 285040, 313713, 242033, 199029, 354677, 246136, 106874, 317820, 211326, 311681, 248194, 225670, 332167, 227725, 240016, 190871, 291224, 293274, 39324, 285084, 242078, 141728, 61857, 285090, 61859, 315810, 289189, 315811, 246178, 311727, 299441, 334260, 293303, 283064, 278970, 319930, 278978, 291267, 127427, 127428, 283075, 278989, 281040, 278993, 289232, 326100, 278999, 328152, 176601, 369116, 285150, 188894, 287198, 279008, 160225, 358882, 279013, 279018, 319981, 291311, 281072, 309744, 319987, 279029, 254456, 279032, 279039, 301571, 291333, 342536, 287241, 279050, 303631, 283153, 279057, 279062, 254488, 279065, 291358, 180771, 375333, 244269, 283182, 283184, 236081, 23092, 234036, 279094, 234040, 315960, 338490, 348732, 70209, 115270, 70215, 322120, 55881, 309830, 340558, 281166, 281171, 309846, 287318, 332378, 295519, 66150, 111208, 279146, 313966, 281199, 295536, 287346, 287352, 301689, 344696, 244347, 279164, 348806, 369289, 152203, 287374, 316053, 352917, 111253, 314009, 289434, 303771, 111259, 221852, 205471, 279210, 287404, 295599, 285361, 303793, 299699, 342706, 336564, 166582, 318130, 314040, 342713, 158394, 230072, 287417, 285373, 287422, 303803, 287433, 225995, 154316, 287439, 164560, 242386, 334547, 279252, 96984, 287452, 363230, 289502, 279269, 246503, 285415, 342762, 330474, 293612, 129773, 289518, 312047, 279280, 125684, 312052, 230134, 199414, 154359, 228088, 299770, 234234, 221948, 279294, 205568, 242433, 295682, 299776, 191235, 285444, 291592, 322313, 322316, 312079, 285458, 291604, 310036, 285466, 283419, 326429, 293664, 281377, 234277, 283430, 279336, 289576, 262954, 318250, 295724, 353069, 318252, 301871, 164656, 285487, 303920, 262962, 312108, 353079, 285497, 293693, 336702, 289598, 281408, 160575, 279362, 318278, 355146, 201551, 355152, 355154, 281427, 281433, 322395, 355165, 301918, 295776, 242529, 293730, 303972, 275303, 230248, 177001, 355178, 201577, 308076, 242541, 400239, 246641, 174963, 207732, 211829, 310131, 228215, 209783, 209785, 279417, 361337, 211836, 246648, 177019, 308092, 158593, 260996, 113542, 287622, 416646, 228233, 228234, 308107, 58253, 56208, 308112, 234386, 293781, 324506, 324507, 400283, 318364, 310176, 310178, 289698, 283558, 289703, 279464, 293800, 236461, 293806, 316333, 353197, 252847, 304051, 316343, 189374, 330689, 19399, 213960, 279498, 316364, 183248, 330708, 183257, 343005, 50143, 314342, 234472, 234473, 324586, 203757, 289774, 183279, 320493, 320494, 287731, 316405, 240630, 304122, 318461, 234500, 134150, 322570, 254987, 234514, 308243, 316437, 140310, 418837, 322582, 197657, 175132, 326685, 238623, 238639, 300084, 252980, 312373, 322612, 238651, 308287, 238664, 250954, 234577, 296019, 234587, 156765, 304222, 277597, 113760, 281697, 302177, 281700, 253029, 285798, 300135, 300136, 228458, 207979, 279660, 316526, 15471, 144496, 351344, 300146, 234609, 312434, 285814, 300151, 291959, 337017, 279672, 160891, 363644, 285820, 300158, 150657, 187521, 234625, 285828, 279685, 349318, 222343, 302216, 302213, 285830, 228491, 234638, 347283, 326804, 185493, 296086, 238743, 187544, 308372, 119962, 283802, 296092, 300188, 339102, 285851, 302240, 300187, 306338, 234663, 300201, 249002, 238765, 279728, 238769, 294068, 208058, 339130, 230588, 64700, 228540, 228542, 283840, 302274, 279747, 283847, 62665, 353481, 353482, 244940, 283853, 283852, 279760, 290000, 189652, 279765, 189653, 148696, 279774, 304351, 298208, 310497, 298212, 304356, 298213, 290022, 279785, 228588, 234733, 298221, 298228, 302325, 234742, 292085, 228600, 216315, 292091, 316669, 388349, 208124, 228609, 320770, 292107, 312587, 251153, 177428, 173334, 349462, 339234, 130338, 109861, 286013, 306494, 216386, 279875, 286018, 300359, 294218, 234827, 224586, 222541, 296270, 234831, 238927, 331090, 318805, 314710, 283991, 357719, 234850, 292195, 294243, 230756, 281957, 163175, 314728, 230765, 284014, 279920, 327025, 296307, 116084, 314741, 181625, 290169, 290173, 306559, 224640, 357762, 179587, 298374, 314758, 314760, 142729, 368011, 296335, 112017, 306579, 9619, 282007, 357786, 318875, 251298, 279974, 282022, 282024, 314791, 314798, 173491, 304564, 279989, 228795, 292283, 302531, 292292, 380357, 339398, 300487, 306631, 300489, 280010, 296392, 310732, 302540, 280013, 64975, 310736, 312782, 306639, 366037, 210392, 228827, 286172, 239068, 280032, 144867, 187878, 316902, 280041, 329197, 329200, 306673, 282096, 308723, 306677, 191990, 280055, 300535, 288249, 286202, 290300, 286205, 302590, 290301, 294400, 296448, 282114, 300542, 306692, 306693, 323080, 230921, 253451, 253452, 296461, 323087, 304656, 282129, 316946, 308756, 282136, 282141, 302623, 286244, 312880, 288309, 290358, 288318, 194110, 425535, 280130, 349763, 196164, 288327, 282183, 218696, 292425, 333388, 228943, 286288, 349781, 300630, 290390, 128599, 306776, 196187, 239198, 333408, 286306, 374372, 282213, 317032, 310889, 323178, 312940, 54893, 204397, 222832, 314998, 288378, 325245, 175741, 235135, 239237, 282245, 286343, 282246, 229001, 288392, 290443, 323217, 282259, 345752, 229020, 298654, 282271, 282273, 302754, 282276, 40613, 40614, 40615, 282280, 290471, 229029, 298667, 298661, 206504, 300714, 321199, 286388, 286391, 300728, 337591, 280251, 282303, 286399, 280257, 323263, 321219, 218819, 306890, 280267, 302797, 9936, 9937, 302802, 241361, 313041, 280278, 282327, 298712, 278233, 18138, 278234, 67292, 224984, 321247, 278240, 298720, 282339, 153319, 280300, 239341, 282348, 284401, 282355, 313081, 229113, 286459, 325371, 300794, 194304, 288512, 319233, 339715, 288516, 278272, 323331, 280327, 323332, 280329, 216839, 300811, 284431, 161554, 278291, 278293, 321302, 284442, 286494, 282400, 313120, 315171, 284459, 294700, 280366, 317232, 300848, 282417, 200498, 280372, 321337, 282427, 315202, 282434, 280390, 153415, 282438, 339783, 304977, 307025, 413521, 255829, 18262, 216918, 307031, 241495, 280410, 188251, 284507, 245599, 237408, 284512, 284514, 362337, 276327, 292712, 288619, 288620, 280430, 282480, 292720, 313203, 300918, 194429, 315264, 339841, 305026, 327557, 243591, 282504, 67463, 350093, 243597, 110480, 184208, 282518, 282519, 294807, 214937, 214938, 294809, 239514, 298909, 294814, 337815, 300963, 313254, 294823, 298920, 333735, 284587, 292782, 317360, 323507, 200627, 288697, 290746, 294843, 98239, 237504, 280514, 294850, 280519, 214984, 151497, 212942, 301008, 153554, 194515, 212946, 346067, 298980, 292837, 294886, 296941, 247791, 329712, 311282, 325619, 282612, 292858, 290811 ]
94e3806c610033ac57c057895dc35a9b0f6c7ddf
be16174a2d60c31ba61bf3ea0334e46d7541477e
/iOS/lesson-9/notes/mealtracker/MealTableViewController.swift
c4a0cf19464e5e3e4e87bd48f7c311e3dfbcbdef
[]
no_license
bladechapman/Teaching
07a7b4dbaf84133b7b3e6e1b3de0162dd0282986
f23ae4e1cd78d342bc22209fa7be664a7d8196e2
refs/heads/master
2021-10-08T14:15:04.810589
2018-12-13T03:03:12
2018-12-13T03:03:12
108,627,060
0
0
null
null
null
null
UTF-8
Swift
false
false
6,323
swift
// // MealTableViewController.swift // mealtracker // // Created by Blade Chapman on 8/11/18. // Copyright © 2018 Blade Chapman. All rights reserved. // import UIKit class MealTableViewController: UITableViewController { var meals = Array<Meal>() override func viewDidLoad() { super.viewDidLoad() navigationItem.leftBarButtonItem = editButtonItem if let savedMeals = loadMeals() { meals += savedMeals } else { loadSampleMeals() } // 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 } func loadSampleMeals() { let defaultPhoto = UIImage(named: "defaultPhoto") guard let meal1 = Meal(name: "Caprese Salad", photo: defaultPhoto, rating: 4) else { fatalError("Unable to instantiate meal 1") } guard let meal2 = Meal(name: "Chicken and Potatoes", photo: defaultPhoto, rating: 1) else { fatalError("Unable to instantiate meal 2") } guard let meal3 = Meal(name: "Pasta with Meatballs", photo: defaultPhoto, rating: 3) else { fatalError("Unable to instantiate meal 3") } meals.append(meal1) meals.append(meal2) meals.append(meal3) } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } // MARK: - Table view data source override func numberOfSections(in tableView: UITableView) -> Int { // #warning Incomplete implementation, return the number of sections return 1 } override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { // #warning Incomplete implementation, return the number of rows return meals.count } override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cellIdentifier = "MealTableViewCell" guard let cell = tableView.dequeueReusableCell(withIdentifier: cellIdentifier, for: indexPath) as? MealTableViewCell else { fatalError("The dequeued cell is not an instance of MealTableViewCell.") } let meal = meals[indexPath.row] cell.mealLabel.text = meal.name cell.photoImageView.image = meal.photo cell.ratingControl.rating = meal.rating return cell } // Override to support conditional editing of the table view. override func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool { // Return false if you do not want the specified item to be editable. return true } // Override to support editing the table view. override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) { if editingStyle == .delete { // Delete the row from the data source meals.remove(at: indexPath.row) saveMeals() tableView.deleteRows(at: [indexPath], with: .fade) } else if editingStyle == .insert { // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view } } /* // Override to support rearranging the table view. override func tableView(_ tableView: UITableView, moveRowAt fromIndexPath: IndexPath, to: IndexPath) { } */ /* // Override to support conditional rearranging of the table view. override func tableView(_ tableView: UITableView, canMoveRowAt indexPath: IndexPath) -> Bool { // Return false if you do not want the item to be re-orderable. return true } */ // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepare(for segue: UIStoryboardSegue, sender: Any?) { super.prepare(for: segue, sender: sender) switch(segue.identifier ?? "") { case "AddItem": print("Adding a new meal") case "ShowDetail": guard let mealDetailViewController = segue.destination as? MealViewController else { fatalError("Unexpected destination") } guard let selectedMealCell = sender as? MealTableViewCell else { fatalError("Unexpected sender") } guard let indexPath = tableView.indexPath(for: selectedMealCell) else { fatalError("The selected cell is not being displayed in the table") } let selectedMeal = meals[indexPath.row] mealDetailViewController.meal = selectedMeal default: fatalError("Unexpected segue") } } @IBAction func unwindToMealList(sender: UIStoryboardSegue) { let sourceViewController = sender.source as? MealViewController let meal = sourceViewController?.meal if sourceViewController != nil && meal != nil { if let selectedIndexPath = tableView.indexPathForSelectedRow { meals[selectedIndexPath.row] = meal! tableView.reloadRows(at: [selectedIndexPath], with: .none) } else { // Add a new meal. let newIndexPath = IndexPath(row: meals.count, section: 0) meals.append(meal!) tableView.insertRows(at: [newIndexPath], with: .automatic) } saveMeals() } } private func saveMeals() { let isSuccessfulSave = NSKeyedArchiver.archiveRootObject(meals, toFile: Meal.ArchiveURL.path) if (isSuccessfulSave) { print("save successful") } else { print("save failed") } } private func loadMeals() -> [Meal]? { return NSKeyedUnarchiver.unarchiveObject(withFile: Meal.ArchiveURL.path) as? [Meal] } }
[ -1 ]
0b7ec0541e6ef242c7508de5d1af3035269b2057
a7fc74e5fcad9bc1b209e3b7663300cd5afd9b02
/budgeter/ExpenseViewController.swift
3413fce3d0703d1f837c8395d7f25935c77233a0
[]
no_license
kmaloles/Budgeter
169a898789b355cc6937dd34aa75f2d60084e9c8
6876a769eca9daa6ed9992c20531afa7869ec164
refs/heads/master
2021-01-13T02:47:09.857180
2017-01-01T21:41:42
2017-01-01T21:41:42
77,166,144
0
0
null
null
null
null
UTF-8
Swift
false
false
9,467
swift
// // ExpenseViewController.swift // budgeter // // Created by Kevin Maloles on 22/12/2016. // Copyright © 2016 KAM. All rights reserved. // import Foundation import UIKit import RealmSwift import Realm class ExpenseViewController: UIViewController, UITableViewDataSource, UITableViewDelegate { @IBOutlet weak var tableView: UITableView! @IBOutlet weak var expenseText: UITextField! @IBOutlet weak var addExpenseButton: UIButton! @IBOutlet weak var categoryImage: UIImageView! @IBOutlet weak var categoryText: UITextView! @IBOutlet weak var categoryView: UIView! let cellConfigurator = ExpenseCellConfigurator() var expense = [Int]() let realm = try! Realm() var expenseToPersist = Dictionary<String, AnyObject>() @IBAction func onAddExpenseTapped(sender: UIButton) { addExpense() } let dbmanager = DBManager.sharedInstance let dateFormatter = DateFormatter.sharedInstance // let newExpenseTpe = Dictionary[String] override func viewDidLoad() { // print("Date Sections : \(dbmanager.getExpensesForSection("20170101"))") tableView.registerNib(ExpenseTableCell.nib(), forCellReuseIdentifier: ExpenseTableCell.reuseIdentifier()) //Looks for single or multiple taps. let tap = UITapGestureRecognizer(target: self, action: #selector(dismissKeyboard)) let categoryTap = UITapGestureRecognizer(target: self, action: #selector(showCategorySelector)) //Uncomment the line below if you want the tap not not interfere and cancel other interactions. //tap.cancelsTouchesInView = false view.addGestureRecognizer(tap) categoryImage.addGestureRecognizer(categoryTap) categoryText.addGestureRecognizer(categoryTap) categoryView.addGestureRecognizer(categoryTap) // let border = CALayer() // let width = CGFloat(0.5) // border.borderColor = UIColor.lightGrayColor().CGColor // border.frame = CGRect(x: 0, y: expenseText.frame.size.height - width, width: expenseText.frame.size.width, height: expenseText.frame.size.height) // // border.borderWidth = width // expenseText.layer.addSublayer(border) // expenseText.layer.masksToBounds = true // let paddingView = UIView(frame:CGRectMake(0, 0, 30, 30)) expenseText.leftView = addExpenseButton expenseText.leftViewMode = .Always expenseText.clearButtonMode = .WhileEditing expenseText.setBottomBorder(UIColor.lightGrayColor()) addDoneButtonToKeyboard() } func refreshCategoriesView(type: String){ let newImage = UIImage(named: type) UIView.transitionWithView(self.categoryView, duration: 0.5, options: .TransitionCrossDissolve, animations: { self.categoryImage.image = newImage; self.categoryText.text = type }, completion: nil) } func showCategorySelector(){ let alertController = UIAlertController(title: nil, message: "Type of expense", preferredStyle: .ActionSheet) let cancelAction = UIAlertAction(title: "Cancel", style: .Cancel) { action in alertController.dismissViewControllerAnimated(true, completion: nil) } alertController.addAction(cancelAction) //TODO: yuck! simplify all these let fareSelected = UIAlertAction(title: "Fare", style: .Default) { action in self.refreshCategoriesView("Fare") } alertController.addAction(fareSelected) let foodSelected = UIAlertAction(title: "Food", style: .Default) { action in self.refreshCategoriesView("Food") } alertController.addAction(foodSelected) let billSelected = UIAlertAction(title: "Bill", style: .Default) { action in self.refreshCategoriesView("Bill") } alertController.addAction(billSelected) let rentSelected = UIAlertAction(title: "Rent", style: .Default) { action in self.refreshCategoriesView("Rent") } alertController.addAction(rentSelected) let transferSelected = UIAlertAction(title: "Transfer", style: .Default) { action in self.refreshCategoriesView("Transfer") } alertController.addAction(transferSelected) self.presentViewController(alertController, animated: true){} } func addDoneButtonToKeyboard(){ //Add done button to numeric pad keyboard let toolbarDone = UIToolbar.init() toolbarDone.sizeToFit() let barBtnDone = UIBarButtonItem.init(barButtonSystemItem: UIBarButtonSystemItem.Done, target: self, action: #selector(onDoneButtonPressed)) toolbarDone.items = [barBtnDone] // You can even add cancel button too expenseText.inputAccessoryView = toolbarDone } func onDoneButtonPressed(){ guard expenseText.text != "" else { dismissKeyboard(); return } addExpense() } func addExpense(){ if let value = Int(expenseText.text!){ let date = NSDate() expenseToPersist[expenseToPersist.keyExpense()] = value expenseToPersist[expenseToPersist.keyDate()] = date let initialSectionsCount = dbmanager.getDateSections().count dbmanager.persistExpense(expenseToPersist) expenseText.text = "" if dbmanager.getDateSections().count != initialSectionsCount{ tableView.reloadData() } let range = NSMakeRange(0, dbmanager.getDateSections().count) let sections = NSIndexSet(indexesInRange: range) self.tableView.reloadSections(sections, withRowAnimation: .Automatic) }else{ //enter edit mode if textfield is empty expenseText.becomeFirstResponder() } } //Calls this function when the tap is recognized. func dismissKeyboard() { //Causes the view (or one of its embedded text fields) to resign the first responder status. tableView.reloadData() view.endEditing(true) } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } func numberOfSectionsInTableView(tableView: UITableView) -> Int { return dbmanager.getDateSections().count } func tableView(tableView:UITableView, numberOfRowsInSection section:Int) -> Int { // return expense.count let sections = dbmanager.getDateSections() return dbmanager.getExpensesForSection(sections[section]).count } func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let cell:ExpenseTableCell = self.tableView.dequeueReusableCellWithIdentifier(ExpenseTableCell.reuseIdentifier(), forIndexPath: indexPath) as! ExpenseTableCell //get one section at a time let sections = dbmanager.getDateSections() let expensesForSection = dbmanager.getExpensesForSection(sections[indexPath.section]) let expenseItem = expensesForSection[indexPath.row] cellConfigurator.configure(expenseItem, cell: cell) return cell } func tableView(tableView: UITableView, titleForHeaderInSection section: Int) -> String? { let sectionRaw = dbmanager.getDateSections()[section] let date = dateFormatter.getDateForSection(sectionRaw) return dateFormatter.getHeaderTitleFromDate(date!) } func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { tableView.deselectRowAtIndexPath(indexPath, animated: true) print("You selected cell #\(indexPath.row)!") } func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat { return UITableViewAutomaticDimension } func tableView(tableView: UITableView, estimatedHeightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat { return UITableViewAutomaticDimension } func tableView(tableView: UITableView, editActionsForRowAtIndexPath indexPath: NSIndexPath) -> [UITableViewRowAction]? { let more = UITableViewRowAction(style: .Normal, title: "More") { action, index in print("more button tapped") } more.backgroundColor = Constants.blueColor let delete = UITableViewRowAction(style: .Normal, title: "Delete") { action, index in let section = self.dbmanager.getDateSections()[indexPath.section] self.dbmanager.deleteMyExpense(indexPath) //don't animate if there's no more item under a section guard self.dbmanager.getExpensesForSection(section).count > 0 else { tableView.reloadData(); return } tableView.deleteRowsAtIndexPaths([indexPath], withRowAnimation: .Fade) print("delete button tapped") } delete.backgroundColor = Constants.redColor return [delete, more] } func tableView(tableView: UITableView, canEditRowAtIndexPath indexPath: NSIndexPath) -> Bool { // the cells you would like the actions to appear needs to be editable return true } }
[ -1 ]
cb2cc491e4426dd35177763523e7ab32665115db
b3aafd35e2b357a24086a16226a893f4104b69d5
/Stanwood-assignment/Source/Modules/RepoDetailedView/Protocols/RepoDetailsViewInput.swift
9782988a2a47a9e8486c86679e4a1153c802fab5
[]
no_license
RafaelKayumov/StanwoodAssignment
84e2b24da512ac6744492b661fb27ca349ece22f
2ac6aeb01ce4acd150ddec702e827ce361bd4c68
refs/heads/master
2020-04-26T00:31:19.545898
2019-03-05T08:48:37
2019-03-05T08:55:35
173,180,949
0
0
null
null
null
null
UTF-8
Swift
false
false
282
swift
// // RepoDetailsViewInput.swift // Stanwood-assignment // // Created by Rafael Kayumov on 04/03/2019. // Copyright © 2019 Rafael Kayumov. All rights reserved. // import Foundation protocol RepoDetailsViewInput: class { func displayRepository(_ repository: Repository) }
[ -1 ]
50c310217e9ec577cd44f9fe3e463461c2e42c03
b0eef64204fce866bc829e87e92d3160e51ddcf1
/myContactInfo/ContactInfo.swift
35094aaf86074ca8f7fefdafbf47c0ae53b3e950
[]
no_license
ximonali/ContactInfo
644e8da3f7462724abefac3fab2f49be43a352b3
ff64d8abf63d9c80783d26db771e793e968aec47
refs/heads/master
2020-06-10T09:29:50.436448
2016-12-08T20:50:53
2016-12-08T20:50:53
75,974,215
0
0
null
null
null
null
UTF-8
Swift
false
false
1,796
swift
// // ContactInfo.swift // // // Created by macadmin on 2016-03-12. // // import UIKit class ContactInfo { var firstName: String; //EN VES DE STRING PUEDEN SER tipo: UILabel! var lastName: String; var address: String; var cellPhone: String; var profilePic: UIImage; var localArray = [ContactInfo]() init(){ firstName = ""; lastName = ""; address = ""; cellPhone = ""; profilePic = UIImage(); } init(pFirstName: String, pLastName: String, pAddress: String, pCellPhone: String,pProfilePic: UIImage){ firstName = pFirstName; lastName = pLastName; address = pAddress; cellPhone = pCellPhone; profilePic = pProfilePic; } func generateMyContacts ()-> [ContactInfo]{ let a = ContactInfo(pFirstName: "Simon", pLastName: "Gonzalez", pAddress: "28 Blakemanor Blv", pCellPhone: "416-8352266", pProfilePic: UIImage(named: "male")!) let b = ContactInfo(pFirstName: "Diana", pLastName: "Abreu", pAddress: "28 Blakemanor Blv", pCellPhone: "416-7896542", pProfilePic: UIImage(named: "female")!) let c = ContactInfo(pFirstName: "Julian", pLastName: "Ru", pAddress: "Address 3", pCellPhone: "416-1234578", pProfilePic: UIImage(named: "loginimage")!) let d = ContactInfo(pFirstName: "Diego", pLastName: "lala", pAddress: "Address 4", pCellPhone: "416-5978822", pProfilePic: UIImage(named: "male2")!) let e = ContactInfo(pFirstName: "Daniela", pLastName: "perez", pAddress: "Address 5", pCellPhone: "416-5556698", pProfilePic: UIImage(named: "female2")!) localArray.append(a); localArray.append(b); localArray.append(c); localArray.append(d); localArray.append(e); return localArray } }
[ -1 ]
68db4ccbb9e46893b4bc5857073419c658275c4c
f517ce1cd04468593a61f79a095b7f5e6e09380f
/week 5/pictureCollection detail share/pictureCollection/CollectionSupplementaryView.swift
0cc97c75dace30c73fa1a42ea4be1a5d12f6cfa2
[]
no_license
CUATLAS/Spring18_Adv_MAD_examples
38a6de9510737b02810e690ec6889e8bc36f5210
d59f9b470c873a632fcffebbc5b1be04dd6a6e58
refs/heads/master
2021-05-13T14:23:24.240605
2020-08-31T23:46:03
2020-08-31T23:46:03
116,737,584
4
4
null
null
null
null
UTF-8
Swift
false
false
290
swift
// // CollectionSupplementaryView.swift // pictureCollection // // Created by Aileen Pierce // Copyright © 2018 Aileen Pierce. All rights reserved. // import UIKit class CollectionSupplementaryView: UICollectionReusableView { @IBOutlet weak var headerLabel: UILabel! }
[ -1 ]
d218ad26c97d7d055b959a0ff9b8492a93c3146d
aed157aa3458afe840c5274bad486e47d01f91b1
/source/appInfo/AppManager.swift
d1c2a38ac4e1f4f2be205c7e4d3240d69e93af7a
[]
no_license
jovirus/BLEScanner
b2b136070b27d636229ab6cac1b1f80cbfb0ec82
c068166b0e078a5083ae8e104ea8c45be0ce150d
refs/heads/master
2022-06-22T01:57:54.597618
2018-02-08T10:17:36
2018-02-08T10:17:36
120,624,876
0
0
null
null
null
null
UTF-8
Swift
false
false
2,677
swift
// // AppManager.swift // MasterControlPanel // // Created by Jiajun Qiu on 22/06/16. // Copyright © 2016 Nordic Semiconductor. All rights reserved. // import Foundation open class AppManager { static var instance = AppManager() fileprivate(set) var shouldShowTutorialPage: Bool = false // @available(*, deprecated: 1.8, message: "use updateUserDefault() instead") // func updateUserInfo() { // var userInfoList: UserInfoList! // userInfoList = LocalAccessManager.instance.readUserInfo { (path, error) in // if error != nil { // NSLog((error?.localizedDescription)!) // } // } // // if userInfoList == nil { // let persistent = UserInfoList() // persistent.listOfUserInfo.append(UserInfo()) // LocalAccessManager.instance.createUserInfo(userInfo: persistent, completion: { (path, error) in // if error != nil { // NSLog((error?.localizedDescription)!) // } // }) // shouldShowTutorialPage = true // } else if userInfoList != nil && userInfoList.listOfUserInfo.count == 0 { // // can not read the file properly // userInfoList.listOfUserInfo.append(UserInfo()) // LocalAccessManager.instance.createUserInfo(userInfo: userInfoList, completion: { (path, error) in // if error != nil { // NSLog((error?.localizedDescription)!) // } // }) // shouldShowTutorialPage = true // } else if userInfoList != nil && userInfoList.listOfUserInfo.count > 0 // { // // the user info file read properly // let newInfo = UserInfo() // let lastUse = userInfoList.listOfUserInfo.last // if UserInfo.isNewVersion(lastUse: lastUse!, newInfo: newInfo) { // self.shouldShowTutorialPage = true // } // userInfoList.listOfUserInfo.append(newInfo) // LocalAccessManager.instance.createUserInfo(userInfo: userInfoList, completion: { (path, error) in // if error != nil { // NSLog((error?.localizedDescription)!) // } // }) // } // } func updateUserDefault() { if let result = UserInfo.getUserDefaults() { let newInfo = UserInfo() if UserInfo.isNewVersion(lastUse: result, newInfo: newInfo) { self.shouldShowTutorialPage = true newInfo.saveUserDefaults() } } else { UserInfo().saveUserDefaults() } } }
[ -1 ]
ba004ffd76f57cdb5a641ae05a32684eb4058c57
6e14a20621f807a79adc15a63fe58ba1a50771e2
/22. Protocols/8. OptionalProtocolRequirements.playground/Contents.swift
ae67e9953da3386abd1ab69939724e7c9e23d4e5
[ "MIT" ]
permissive
Dodant/Mastering-Swift
737cea2f8052f71d5f9fa7301f68369dc6469e27
7c4ba5e7de1a5c9dbc72c6c98787850a9737a191
refs/heads/master
2022-12-23T19:26:45.625388
2020-09-19T01:05:54
2020-09-19T01:05:54
277,226,699
0
0
null
null
null
null
UTF-8
Swift
false
false
1,543
swift
// // Copyright (c) 2018 KxCoding <[email protected]> // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // import UIKit /*: # Optional Protocol Requirements ![optional](optional.png) */ @objc protocol Drawable { @objc optional var strokeWidth: Double { get set } @objc optional var strokeColor: UIColor { get set } func draw() @objc optional func reset() } class Rectangle: Drawable { func draw() { } } let r: Drawable = Rectangle() r.draw() r.strokeWidth r.strokeColor r.reset?()
[ 194560, 395267, 196612, 395271, 395274, 395278, 395280, 395281, 395282, 395283, 395286, 395287, 395289, 395290, 196636, 196638, 395295, 395296, 196641, 98341, 61478, 98344, 98345, 98346, 98347, 98349, 59445, 124987, 174139, 354364, 229438, 229440, 229441, 395328, 174148, 327749, 229444, 395332, 174152, 327751, 395333, 395334, 174159, 229456, 112721, 106580, 106582, 106585, 106586, 106587, 112730, 174171, 354400, 208027, 213320, 235658, 229524, 303255, 303256, 229532, 125086, 125087, 215205, 215211, 215212, 241846, 241852, 191, 241859, 241862, 241864, 317640, 241866, 97327, 241870, 262357, 241877, 262359, 97329, 106713, 106715, 106719, 35040, 241894, 241897, 241901, 241903, 241904, 106737, 176369, 176370, 241907, 106741, 260342, 241908, 241910, 241916, 141565, 106750, 141566, 141567, 141569, 241923, 141576, 241928, 141578, 141577, 241930, 241934, 241936, 241937, 141586, 141588, 12565, 227604, 141591, 141592, 227608, 227610, 141595, 141596, 141597, 141598, 241944, 141600, 141601, 12569, 141603, 141599, 241952, 241957, 141606, 141607, 141608, 289062, 241962, 289068, 289067, 141612, 289071, 12592, 289074, 289078, 141626, 141627, 141628, 141629, 141632, 141634, 241989, 141639, 141640, 141641, 141642, 241994, 241992, 213319, 241998, 241999, 141643, 141649, 241996, 242002, 141651, 141654, 141655, 242006, 215384, 282967, 141660, 168285, 141663, 141664, 215396, 141670, 141676, 141677, 375153, 287090, 375155, 334196, 141681, 190836, 190840, 190841, 430456, 375163, 375164, 190843, 375166, 190844, 430458, 375168, 190842, 375171, 141700, 141701, 375173, 141702, 141707, 430476, 375181, 141711, 430483, 217492, 217494, 197018, 197019, 197021, 295330, 295331, 197029, 430502, 168359, 213421, 303550, 160205, 381398, 305637, 305638, 223741, 125456, 61971, 191006, 191007, 57893, 328232, 57896, 57899, 57900, 57901, 295467, 57905, 57906, 336445, 336446, 336450, 336451, 336454, 336455, 336457, 336459, 336460, 55886, 336464, 336465, 336467, 336469, 336470, 336471, 336472, 336473, 336474, 336478, 336479, 336480, 336481, 336482, 336483, 336489, 297620, 297636, 297639, 135860, 135861, 242361, 299713, 244419, 66247, 244427, 248524, 127693, 244430, 66261, 127702, 127703, 334562, 334563, 334564, 127716, 62183, 127727, 172784, 127729, 244469, 318199, 318200, 142073, 164601, 111356, 66302, 142078, 244480, 142081, 334590, 142083, 318207, 142085, 334591, 142087, 334596, 142089, 334601, 334600, 318220, 318218, 334603, 318223, 334602, 142097, 334606, 334607, 318231, 318233, 318234, 318236, 318237, 318241, 318246, 187174, 187176, 187175, 187177, 187179, 187180, 314167, 316216, 396088, 396089, 396091, 396092, 396094, 396095, 148287, 316224, 396098, 314179, 279366, 279367, 396104, 396110, 141602, 396112, 299858, 396115, 396114, 396118, 396119, 396120, 396122, 396123, 396125, 396126, 396127, 396128, 396129, 396134, 299880, 396137, 299884, 162668, 187248, 396147, 396151, 248696, 396153, 187258, 187259, 322430, 297858, 60304, 60312, 60319, 60323, 185258, 185259, 296688, 23469, 185262, 23470, 23472, 23473, 60337, 23474, 23475, 23476, 185267, 23479, 23481, 287674, 23483, 23487, 281539, 23492, 23493, 23494, 23499, 23501, 228306, 23508, 23515, 259036, 23517, 23519, 23523, 23531, 203755, 433131, 23533, 341058, 152560, 23552, 171008, 23554, 23555, 437252, 23557, 23559, 23560, 23561, 23562, 437258, 437266, 437267, 23572, 23573, 23574, 23575, 437273, 23580, 437277, 23582, 23581, 437281, 23585, 23590, 23591, 23594, 23596, 3119, 189488, 23599, 187442, 189490, 187444, 187445, 189492, 187447, 144440, 189493, 437305, 144443, 189491, 23607, 341054, 341055, 144441, 341057, 97339, 341059, 23612, 144444, 23616, 341063, 341060, 222278, 341066, 341062, 341068, 23636, 437333, 185428, 285783, 23640, 285784, 437338, 285787, 312412, 437340, 203862, 285782, 285785, 312417, 115805, 115806, 115807, 293982, 115809, 115810, 185446, 437353, 115817, 185451, 437356, 242794, 185454, 115819, 115820, 185452, 115823, 185455, 437364, 115825, 115827, 242807, 242803, 437369, 115829, 437371, 142463, 294015, 294016, 205959, 437384, 437390, 248975, 437392, 189590, 40088, 312473, 189594, 208026, 312476, 40092, 189598, 40095, 228512, 312478, 40098, 312479, 437412, 208029, 208033, 437415, 437416, 27810, 228513, 189607, 189609, 189610, 189612, 437423, 312489, 312493, 437426, 312499, 189617, 312501, 312502, 437431, 312497, 437433, 189619, 312498, 189621, 189623, 189626, 322751, 437440, 38081, 437445, 292041, 292042, 181455, 292049, 437458, 152789, 203993, 204000, 204003, 281832, 152821, 152825, 294138, 294137, 206094, 206097, 206098, 294162, 206102, 206104, 206107, 206108, 206109, 181533, 294181, 27943, 181544, 27945, 294183, 27948, 181553, 173368, 206138, 173379, 312480, 152906, 152907, 152908, 152909, 290126, 152910, 312482, 290123, 290125, 290127, 290130, 312483, 290135, 290136, 245081, 290137, 290139, 378208, 222562, 171363, 222563, 222566, 228717, 173425, 228721, 222581, 222582, 222587, 222590, 222591, 222594, 222596, 177543, 222600, 363913, 222599, 222603, 222604, 222605, 222601, 54669, 222606, 222607, 279954, 54673, 54678, 173465, 54692, 152998, 54698, 54701, 54703, 298431, 370118, 157151, 222689, 222692, 222693, 112111, 112115, 65016, 112120, 40450, 206344, 40459, 355859, 40471, 40482, 362020, 362022, 116267, 282156, 189595, 34359, 34362, 316993, 173634, 173635, 316995, 316997, 173640, 173641, 263755, 106082, 106085, 319081, 319085, 319088, 300660, 300661, 300662, 52855, 300663, 52884, 394905, 394908, 394910, 52896, 144435, 394912, 339622, 144437, 147115, 144438, 394930, 189624, 292544, 144442, 141593, 108230, 141594, 341052, 108240, 144445, 34516, 108245, 212694, 296684, 34531, 192230, 296679, 192231, 34537, 296681, 192232, 34538, 296685, 34540, 34541, 216812, 155377, 216814, 296691, 216815, 216816, 216818, 216819, 296687, 216822, 296692, 216826, 296700, 296698, 216828, 216829, 296699, 216832, 216833, 216834, 296703, 216836, 216837, 216838, 296707, 296708, 296710, 296712, 276236, 296713, 313101, 311055, 313104, 313108, 313111, 313112, 149274, 149275, 149280, 159523, 227116, 321342, 210755, 210756, 210757, 210758, 321353, 120655, 218960, 120656, 120657, 218959, 218963, 218964, 223065, 180058, 180059, 229209, 223069, 229213, 169824, 229217, 169826, 292708, 292709, 237413, 169830, 169828, 223081, 128873, 227179, 227180, 169835, 128876, 169837, 128878, 223086, 223087, 128881, 128882, 128883, 128884, 116600, 141181, 327550, 108419, 141198, 108431, 108432, 169881, 219033, 108448, 219040, 141219, 219043, 219044, 141223, 141228, 141229, 108460, 108462, 229294, 229295, 141235, 319426, 290767, 141264, 23601, 141272, 40931, 141284, 40932, 141290, 40940, 40941, 141293, 395247, 141295, 174063, 231406, 174067, 174066, 237559, 174074, 194558, 194559 ]
573618b1023ac6aac17cac2c4a9aaaaa664b4f43
11458741559105782a2ed9ece799b76ab1f9464b
/Huella Ecológica/AguaLluviasController.swift
4596743ee5e0217cd9be61a10084d9d920cb7ee7
[]
no_license
RichardRod/HuellaEcologica
dea5dc123fb2b38af41f0460afb69cadf37da75f
113325e9759a99ed2d89c2b04f051bc31669cfaa
refs/heads/master
2020-04-06T06:54:50.871124
2016-09-10T22:12:11
2016-09-10T22:12:11
65,335,029
0
0
null
null
null
null
UTF-8
Swift
false
false
4,364
swift
// // AguaLluviasController.swift // Huella Ecológica // // Created by Ricardo Rodriguez Haro on 9/6/16. // Copyright © 2016 Ricardo Rodriguez Haro. All rights reserved. // import UIKit class AguaLluvias: UIViewController, UIPickerViewDataSource, UIPickerViewDelegate, UITextFieldDelegate { var opcionesComienzo = ["", "Segunda mitad de Mayo", "Primera mitad de Junio", "Segunda mitad de Junio", "Primera mitad de Julio", "Segunda mitad de Julio"] var opcionesTermina = ["", "Primera mitad de Septiembre", "Segunda mitad de Septiembre", "Primera mitad de Octubre", "Segunda mitad de Octubre", "Primera mitad de Noviembre"] @IBOutlet weak var colectaAgua: UISegmentedControl! @IBAction func opcionColectaAgua(sender: UISegmentedControl) { } @IBOutlet weak var pickerComienzo: UIPickerView! @IBOutlet weak var pickerTermina: UIPickerView! @IBOutlet weak var txtCantidadAgua: UITextField! override func viewDidLoad() { super.viewDidLoad() self.hideKeyboardWhenTappedAround() pickerComienzo.delegate = self pickerComienzo.dataSource = self pickerComienzo.tag = 0 pickerComienzo.layer.cornerRadius = 5 pickerTermina.delegate = self pickerTermina.dataSource = self pickerTermina.tag = 1 pickerTermina.layer.cornerRadius = 5 txtCantidadAgua.delegate = self txtCantidadAgua.keyboardType = .DecimalPad txtCantidadAgua.addTarget(self, action: #selector(self.obtenerTextoCantidad(_:)), forControlEvents: UIControlEvents.EditingChanged) } func obtenerTextoCantidad(textField: UITextField) { if textField.text?.characters.count > 0 { DatosHidricaCompleta.aguaLluvias.aguaRecolectada = Double(textField.text!)! } else { DatosHidricaCompleta.aguaLluvias.aguaRecolectada = 0.0 } } func numberOfComponentsInPickerView(pickerView: UIPickerView) -> Int { return 1 } func pickerView(pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int { if pickerView.tag == 0 { return opcionesComienzo.count } else if pickerView.tag == 1 { return opcionesTermina.count } return 1 } func pickerView(pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? { if pickerView.tag == 0 { return opcionesComienzo[row] } else if pickerView.tag == 1 { return opcionesTermina[row] } return "" } func pickerView(pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) { if pickerView.tag == 0 { DatosHidricaCompleta.aguaLluvias.inicioTemporal = opcionesComienzo[row] } else if pickerView.tag == 1 { DatosHidricaCompleta.aguaLluvias.finTemporal = opcionesTermina[row] } } func pickerView(pickerView: UIPickerView, viewForRow row: Int, forComponent component: Int, reusingView view: UIView?) -> UIView { let pickerLabel = UILabel() if pickerView.tag == 0 { pickerLabel.textColor = UIColor(red: 86.0/255, green: 116/255, blue: 131/255, alpha: 1.0) pickerLabel.text = opcionesComienzo[row] pickerLabel.font = UIFont(name: "Arial Rounded MT Bold", size: 20) pickerLabel.textAlignment = NSTextAlignment.Center } else if pickerView.tag == 1 { pickerLabel.textColor = UIColor(red: 86.0/255, green: 116/255, blue: 131/255, alpha: 1.0) pickerLabel.text = opcionesTermina[row] pickerLabel.font = UIFont(name: "Arial Rounded MT Bold", size: 20) pickerLabel.textAlignment = NSTextAlignment.Center } return pickerLabel } func textField(textField: UITextField, shouldChangeCharactersInRange range: NSRange, replacementString string: String) -> Bool { let invalidCharacters = NSCharacterSet(charactersInString: "0123456789").invertedSet return string.rangeOfCharacterFromSet(invalidCharacters, options: [], range: string.startIndex ..< string.endIndex) == nil } }
[ -1 ]
dc74823978edeee16527afac7be05c3b048a0cdc
3e3bab2c582f1a80e90dbb00a32ad5b757d0e1f5
/Task/Sence/Brands/BrandsVC.swift
9804b8545bb680481e50a4958a11739f70769833
[]
no_license
a7medtaha/task
3bf2cc0d2955d72390f3a58a48785e45ff3b8f5a
f1bae493ce654fa669ffac9882a9f550b39eb900
refs/heads/master
2020-08-05T07:27:19.061829
2019-10-02T21:40:19
2019-10-02T21:40:19
212,446,466
0
0
null
null
null
null
UTF-8
Swift
false
false
554
swift
// // BrandsVC.swift // Task // // Created by a7med on 10/2/19. // Copyright © 2019 a7med. All rights reserved. // import UIKit class BrandsVC: UIViewController { var presenter : BrandsVCPresenter! @IBOutlet weak var spinner: UIActivityIndicatorView! @IBOutlet weak var table: UITableView! override func viewDidLoad() { super.viewDidLoad() presenter = BrandsVCPresenter(view: self) presenter.viewDidLoad() setupTableView() // Do any additional setup after loading the view. } }
[ -1 ]
f1e001f3fc117997c7439ded8fdb89732b5f43d6
ccdb59eeb20fe19c6a51ec0854da0749e21cd9ee
/Checklists/Checklists/Helpers/CustomNotification.swift
26e812c663501a68daf0f52b85daede79c742ab5
[ "MIT" ]
permissive
CypherPoet/book--iOS-apprentice
b846984d219239240bae2fb9aaafceb0f5f21042
977f93d8f96bc01a87f9e3f4c800a42e307888e3
refs/heads/master
2020-05-27T08:36:50.030652
2019-08-15T11:33:34
2019-08-15T11:33:34
188,548,012
0
0
null
null
null
null
UTF-8
Swift
false
false
1,511
swift
// // CustomNotificationRequest.swift // Checklists // // Created by Brian Sipple on 6/15/19. // Copyright © 2019 CypherPoet. All rights reserved. // import Foundation import UserNotifications enum CustomNotification { static let calendar = Calendar(identifier: .gregorian) case checklistItemReminder(for: Checklist.Item, dueAt: Date) var request: UNNotificationRequest { return UNNotificationRequest( identifier: self.identifier, content: self.content, trigger: self.trigger ) } var identifier: String { switch self { case .checklistItemReminder(let item, _): return item.notificationID } } var content: UNNotificationContent { let content = UNMutableNotificationContent() switch self { case .checklistItemReminder(let item, _): content.title = "📌 Reminder 📌" content.body = item.title content.sound = .default } return content } var trigger: UNNotificationTrigger { switch self { case .checklistItemReminder(_, let dueDate): let dateComponents = CustomNotification.calendar.dateComponents( [.year, .month, .hour, .minute], from: dueDate ) return UNCalendarNotificationTrigger(dateMatching: dateComponents, repeats: false) } } }
[ -1 ]
fe352cb67a7340a4ff8b79e9d97d41289d669675
d97bf931b6358e6c4cdc1bf6f8e4779b04f56e08
/TextInputTableViewCell.swift
b3decdaf2fe4fb26f618c0b12297fd5d1c48f7bd
[]
no_license
orange0401/chatApp
3c4151b6cfa3d9c92a188351605b73af217f38b9
1723cd99953207c378b93acc026e252642168ff2
refs/heads/master
2021-07-24T23:36:14.650392
2017-11-03T03:46:52
2017-11-03T03:46:52
109,208,478
0
0
null
null
null
null
UTF-8
Swift
false
false
592
swift
// // TextInputTableViewCell.swift // ChatApp // // Created by Yao Liu on 11/2/17. // Copyright © 2017 Yao Liu. All rights reserved. // import UIKit class TextInputTableViewCell: UITableViewCell { @IBOutlet weak var sendButton: UIButton! @IBAction func sendText(_ sender: Any) { } 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 } }
[ 172545, 322306, 277904, 230545, 307218, 320404, 336158, 123678, 366111, 123681, 349477, 278567, 293674, 287022, 300206, 110387, 281014, 282934, 289336, 292919, 123451, 228599, 66109, 306623, 200513, 306625, 306626, 306627, 317377, 317378, 317379, 313546, 311755, 278220, 311756, 311757, 311759, 228602, 310778, 332882, 278231, 290007, 291544, 298746, 200542, 115313, 115315, 115317, 244599, 244602, 196093 ]
33b3a9d2c07d9f4f08b13ba4989f322d1073386f
27ca315124689b91b1515ebdd0f74683855622ca
/Sources/PolymorphSwiftGen/Models/Classes/Builders/Default/Initializers/DefaultClassInitializerDescriptionBuilder.swift
091472f1a59c781b8dc1490daab04c7040c1c826
[ "BSD-3-Clause" ]
permissive
Digipolitan/polymorph-swift-gen
85a1f2a8ec455835ab2cd1d3121e07ef6023e069
43112aa4d3d609ee7a1a9b8ad8fb41cdcce0c144
refs/heads/master
2021-01-15T19:27:54.287208
2019-01-06T22:54:40
2019-01-06T22:54:40
99,824,579
0
0
null
null
null
null
UTF-8
Swift
false
false
2,361
swift
// // DefaultClassInitializerDescriptionBuilder.swift // PolymorphSwiftGen // // Created by Benoit BRIATTE on 18/08/2017. // import Foundation import PolymorphCore import CodeWriter import SwiftCodeWriter class DefaultClassInitializerDescriptionBuilder: ClassInitializerDescriptionBuilder { public static let shared = DefaultClassInitializerDescriptionBuilder() private init() { } public func build(element: Class) throws -> InitializerDescription? { var arguments: [String] = [] let impl = CodeBuilder() let parentProperties = element.parentProperties() var modules = Set<String>() let hasParentProperties = parentProperties.count > 0 var override = false var superArguments: [String] = [] if hasParentProperties { override = true for property in parentProperties { if property.isNonnull || (property.isConst && property.defaultValue == nil) { var type = try Mapping.shared.platformType(with: property) if !property.isNonnull { type += "? = nil" } modules.formUnion(try Mapping.shared.modules(with: property)) arguments.append("\(property.name): \(type)") superArguments.append("\(property.name): \(property.name)") } } } for property in element.properties { if property.isNonnull || (property.isConst && property.defaultValue == nil) { var type = try Mapping.shared.platformType(with: property) if !property.isNonnull { type += "? = nil" } modules.formUnion(try Mapping.shared.modules(with: property)) arguments.append("\(property.name): \(type)") impl.add(line: "self.\(property.name) = \(property.name)") if hasParentProperties { override = false } } } if hasParentProperties { impl.add(line: "super.init(\(superArguments.joined(separator: ", ")))") } return InitializerDescription(code: impl, options: .init(visibility: .public, isOverride: override), modules: Array(modules), arguments: arguments) } }
[ -1 ]
158fb158518c389fd73390a8b6695838dd41855c
220efe8b7b5178a01ff33b2418d0af1da68d6c69
/Day 5/OutaTime/OutaTime/AppDelegate.swift
b5a0a7cbed8c4f72b653227c2c32e430ebc85886
[ "CC0-1.0" ]
permissive
calkinssean/TIY-Assignments
5d46ced0e1533559ef610dcfd663f8f307bfe896
7d74ed1446f8447c0f8864ac8996c87b87245501
refs/heads/master
2021-01-10T12:59:10.775631
2016-03-28T15:25:14
2016-03-28T15:25:14
50,853,302
0
0
null
null
null
null
UTF-8
Swift
false
false
2,144
swift
// // AppDelegate.swift // OutaTime // // Created by Sean Calkins on 2/4/16. // Copyright © 2016 Sean Calkins. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { // Override point for customization after application launch. return true } func applicationWillResignActive(application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. } func applicationDidEnterBackground(application: UIApplication) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } func applicationWillEnterForeground(application: UIApplication) { // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. } func applicationDidBecomeActive(application: UIApplication) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } func applicationWillTerminate(application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } }
[ 229380, 229383, 229385, 278539, 229388, 294924, 278542, 229391, 327695, 278545, 229394, 278548, 229397, 229399, 229402, 278556, 229405, 352284, 278559, 229408, 278564, 294950, 229415, 229417, 327722, 237613, 229422, 360496, 229426, 237618, 229428, 286774, 229432, 286776, 286778, 319544, 204856, 286791, 237640, 278605, 286797, 311375, 163920, 237646, 196692, 319573, 311383, 278623, 278626, 319590, 311400, 278635, 303212, 278639, 278648, 131192, 237693, 327814, 131209, 417930, 303241, 303244, 311436, 319633, 286873, 286876, 311460, 311469, 32944, 327862, 286906, 327866, 180413, 286910, 131264, 286916, 286922, 286924, 286926, 319694, 286928, 131281, 278743, 278747, 295133, 155872, 319716, 278760, 237807, 303345, 286962, 131314, 229622, 327930, 278781, 278783, 278785, 237826, 319751, 278792, 286987, 319757, 311569, 286999, 319770, 287003, 287006, 287009, 287012, 287014, 287016, 287019, 311598, 287023, 262448, 311601, 287032, 155966, 278849, 319809, 319810, 319814, 311623, 319818, 311628, 229709, 287054, 319822, 278865, 229717, 196963, 196969, 139638, 213367, 106872, 319872, 311683, 319879, 311693, 65943, 319898, 311719, 278952, 139689, 278957, 311728, 278967, 180668, 311741, 278975, 319938, 278980, 98756, 278983, 319945, 278986, 319947, 278990, 278994, 311767, 279003, 279006, 188895, 172512, 279010, 287202, 279015, 172520, 319978, 279020, 172526, 279023, 311791, 172529, 279027, 319989, 164343, 180727, 279035, 311804, 287230, 279040, 303617, 287234, 279045, 172550, 287238, 172552, 303623, 320007, 279051, 172558, 279055, 303632, 279058, 303637, 279063, 279067, 172572, 279072, 172577, 295459, 172581, 295461, 279082, 311850, 279084, 172591, 172598, 279095, 172607, 172609, 172612, 377413, 172614, 172618, 303690, 33357, 287309, 279124, 172634, 262752, 172644, 311911, 189034, 295533, 189039, 189040, 172655, 172656, 295538, 189044, 172660, 287349, 352880, 287355, 287360, 295553, 287365, 311942, 303751, 295557, 352905, 279178, 287371, 311946, 311951, 287377, 172691, 287381, 311957, 221850, 287386, 164509, 303773, 295583, 172702, 230045, 287394, 287390, 303780, 172705, 287398, 172707, 279208, 287400, 172714, 295595, 279212, 189102, 172721, 287409, 66227, 303797, 189114, 287419, 303804, 328381, 279231, 287423, 328384, 287427, 312006, 107208, 279241, 172748, 287436, 107212, 172751, 287440, 295633, 172755, 303827, 279255, 172760, 279258, 303835, 213724, 189149, 303838, 287450, 279267, 312035, 295654, 279272, 230128, 312048, 312050, 230131, 205564, 303871, 230146, 328453, 295685, 230154, 33548, 312077, 295695, 295701, 369433, 230169, 295707, 328476, 295710, 230175, 303914, 279340, 205613, 279353, 230202, 312124, 222018, 295755, 377676, 148302, 287569, 279383, 303959, 230237, 279390, 230241, 279394, 303976, 336744, 303985, 328563, 303987, 279413, 303991, 303997, 295806, 295808, 304005, 295813, 213895, 320391, 304007, 304009, 304011, 230284, 304013, 213902, 279438, 295822, 189329, 295825, 304019, 189331, 279445, 58262, 279452, 410526, 279461, 279462, 304042, 213931, 230327, 304055, 287675, 197564, 304063, 238528, 304065, 189378, 213954, 156612, 295873, 213963, 312272, 304084, 304090, 320481, 304106, 320490, 312302, 328687, 320496, 304114, 295928, 320505, 312321, 295945, 197645, 295949, 230413, 320528, 140312, 295961, 238620, 197663, 304164, 189479, 304170, 238641, 312374, 238652, 238655, 230465, 238658, 336964, 296004, 205895, 320584, 238666, 296021, 402518, 336987, 230497, 296036, 296040, 361576, 205931, 296044, 164973, 279661, 205934, 312432, 279669, 337018, 189562, 279679, 279683, 222340, 205968, 296084, 238745, 304285, 238756, 205991, 222377, 165035, 337067, 238766, 165038, 230576, 238770, 304311, 350308, 230592, 279750, 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, 230718, 296259, 378181, 230727, 238919, 320840, 296264, 296267, 296271, 222545, 230739, 312663, 337244, 222556, 230752, 312676, 230760, 173418, 410987, 230763, 230768, 296305, 312692, 230773, 279929, 304506, 304505, 181626, 181631, 312711, 312712, 296331, 288140, 288144, 230800, 304533, 337306, 288154, 288160, 173472, 288162, 288164, 279975, 304555, 370092, 279983, 288176, 279985, 173488, 312755, 296373, 279991, 312759, 288185, 337335, 222652, 312766, 173507, 296389, 222665, 230860, 280014, 312783, 288208, 230865, 370130, 288210, 288212, 280021, 288214, 222676, 239064, 288217, 288218, 280027, 329177, 288220, 239070, 288224, 370146, 280034, 280036, 288226, 280038, 288229, 288230, 288232, 288234, 320998, 288236, 288238, 288240, 291754, 288242, 296435, 288244, 296439, 288250, 402942, 148990, 296446, 206336, 296450, 321022, 230916, 230919, 214535, 370187, 304651, 304653, 230940, 222752, 108066, 296486, 296488, 157229, 230961, 288320, 288325, 124489, 280140, 280145, 288338, 280149, 280152, 288344, 239194, 280158, 403039, 370272, 181854, 239202, 312938, 280183, 280185, 280188, 280191, 280194, 116354, 280208, 280211, 288408, 280218, 280222, 190118, 321195, 296622, 321200, 337585, 296626, 296634, 296637, 313027, 280260, 206536, 280264, 206539, 206541, 206543, 280276, 313044, 321239, 280283, 313052, 288478, 313055, 321252, 313066, 280302, 288494, 280304, 313073, 321266, 419570, 288499, 288502, 280314, 288510, 124671, 67330, 280324, 198405, 288519, 280331, 198416, 280337, 296723, 116503, 321304, 329498, 296731, 321311, 313121, 313123, 304932, 321316, 280363, 141101, 165678, 280375, 321336, 296767, 288576, 345921, 280388, 304968, 280393, 280402, 313176, 42842, 280419, 321381, 296812, 313201, 1920, 255873, 305028, 280454, 247688, 280458, 280464, 124817, 280468, 239510, 280473, 124827, 214940, 247709, 214944, 280487, 313258, 321458, 296883, 124853, 214966, 10170, 296890, 288700, 296894, 280515, 190403, 296900, 337862, 165831, 280521, 231379, 296921, 239586, 313320, 231404, 124913, 165876, 321528, 239612, 313340, 288764, 239617, 313347, 288773, 313358, 321560, 305176, 313371, 354338, 305191, 223273, 313386, 354348, 124978, 215090, 124980, 288824, 288826, 321595, 378941, 313406, 288831, 288836, 67654, 223303, 280651, 354382, 288848, 280658, 215123, 354390, 288855, 288859, 280669, 313438, 223327, 280671, 149599, 321634, 149601, 149603, 329830, 280681, 313451, 223341, 280687, 313458, 280691, 215154, 313464, 329850, 321659, 280702, 288895, 321670, 215175, 141446, 141455, 141459, 280725, 313498, 288936, 100520, 280747, 288940, 280755, 288947, 321717, 280759, 280764, 280769, 280771, 280774, 280776, 313548, 321740, 280783, 280786, 280788, 313557, 280793, 280796, 280798, 338147, 280804, 280807, 157930, 280811, 280817, 280819, 157940, 125171, 182517, 280823, 280825, 280827, 280830, 280831, 280833, 280835, 125187, 125191, 125207, 125209, 321817, 125218, 321842, 223539, 125239, 280888, 280891, 289087, 280897, 280900, 239944, 305480, 280906, 239947, 305485, 305489, 379218, 280919, 354653, 313700, 280937, 313705, 280940, 190832, 280946, 223606, 313720, 280956, 239997, 280959, 313731, 199051, 240011, 289166, 240017, 297363, 190868, 297365, 240021, 297368, 297372, 141725, 297377, 289186, 297391, 289201, 240052, 289207, 305594, 289210, 281024, 289218, 289221, 289227, 281045, 281047, 215526, 166378, 305647, 281075, 174580, 281084, 240124, 305662, 305664, 240129, 305666, 305668, 240132, 223749, 281095, 338440, 150025, 223752, 223757, 281102, 223763, 223765, 281113, 322074, 281116, 281121, 182819, 281127, 281135, 150066, 158262, 158266, 289342, 281154, 322115, 158283, 281163, 281179, 199262, 338528, 338532, 281190, 199273, 281196, 158317, 19053, 313973, 281210, 297594, 158347, 133776, 314003, 117398, 314007, 289436, 174754, 330404, 289448, 133801, 174764, 314029, 314033, 240309, 133817, 314045, 314047, 314051, 199364, 297671, 199367, 158409, 289493, 363234, 289513, 289522, 289525, 289532, 322303, 289537, 322310, 264969, 322314, 322318, 281361, 281372, 322341, 215850, 281388, 281401, 289593, 289601, 281410, 281413, 281414, 240458, 281420, 240468, 281430, 322393, 297818, 281435, 281438, 281442, 174955, 224110, 207733, 207737, 183172, 158596, 240519, 322440, 338823, 314249, 183184, 289687, 240535, 297883, 289694, 289696, 289700, 289712, 281529, 289724, 52163, 183260, 281567, 289762, 322534, 297961, 281581, 183277, 322550, 134142, 322563, 175134, 322599, 322610, 314421, 281654, 314427, 207937, 314433, 314441, 207949, 322642, 314456, 281691, 314461, 281702, 281704, 314474, 281708, 281711, 289912, 248995, 306341, 306344, 306347, 306354, 142531, 199877, 289991, 306377, 289997, 249045, 363742, 363745, 298216, 330988, 126190, 216303, 322801, 388350, 257302, 363802, 199976, 199978, 314671, 298292, 298294, 257334, 216376, 298306, 380226, 281923, 224584, 224587, 224594, 216404, 306517, 150870, 314714, 224603, 159068, 314718, 265568, 314723, 281960, 150890, 306539, 314732, 314736, 290161, 216436, 306549, 298358, 314743, 306552, 290171, 314747, 306555, 290174, 298365, 224641, 281987, 298372, 314756, 281990, 224647, 265604, 298377, 314763, 142733, 298381, 224657, 306581, 314779, 314785, 282025, 314793, 282027, 241068, 241070, 241072, 282034, 241077, 150966, 298424, 306618, 282044, 323015, 306635, 306640, 290263, 290270, 290275, 339431, 282089, 191985, 282098, 290291, 282101, 241142, 191992, 290298, 151036, 290302, 282111, 290305, 175621, 192008, 323084, 257550, 282127, 290321, 282130, 323090, 282133, 290325, 241175, 290328, 282137, 290332, 241181, 282142, 282144, 290344, 306731, 290349, 290351, 290356, 282186, 224849, 282195, 282199, 282201, 306778, 159324, 159330, 314979, 298598, 323176, 224875, 241260, 323181, 257658, 315016, 282249, 290445, 324757, 282261, 298651, 282269, 323229, 298655, 323231, 61092, 282277, 306856, 282295, 282300, 323260, 323266, 282310, 323273, 282319, 306897, 241362, 282328, 298714, 52959, 216801, 282337, 241380, 216806, 323304, 282345, 12011, 282356, 323318, 282364, 282367, 306945, 241412, 323333, 282376, 216842, 323345, 282388, 323349, 282392, 184090, 315167, 315169, 282402, 315174, 323367, 241448, 315176, 282410, 241450, 306988, 306991, 315184, 323376, 315190, 241464, 282425, 159545, 298811, 307009, 413506, 241475, 307012, 148946, 315211, 282446, 307027, 315221, 282454, 315223, 241496, 323414, 241498, 307035, 307040, 282465, 110433, 241509, 110438, 298860, 110445, 282478, 315249, 110450, 315251, 282481, 315253, 315255, 339838, 282499, 315267, 315269, 241544, 282505, 241546, 241548, 298896, 298898, 282514, 44948, 298901, 241556, 282520, 241560, 241563, 241565, 241567, 241569, 282531, 241574, 282537, 298922, 36779, 241581, 282542, 241583, 323504, 241586, 282547, 241588, 290739, 241590, 241592, 241598, 290751, 241600, 241605, 151495, 241610, 298975, 241632, 298984, 241640, 241643, 298988, 241646, 241649, 241652, 323574, 290807, 241661, 299006, 282623, 315396, 241669, 315397, 282632, 282639, 290835, 282645, 241693, 282654, 241701, 102438, 217127, 282669, 323630, 282681, 290877, 282687, 159811, 315463, 315466, 192589, 307278, 192596, 176213, 307287, 315482, 315483, 217179, 192605, 233567, 200801, 299105, 217188, 299109, 307303, 315495, 356457, 45163, 307307, 315502, 192624, 307314, 323700, 299126, 233591, 299136, 307329, 307338, 233613, 241813, 307352, 299164, 184479, 299167, 184481, 315557, 184486, 307370, 307372, 184492, 307374, 307376, 323763, 176311, 299191, 307385, 307386, 258235, 176316, 307388, 307390, 184503, 299200, 184512, 307394, 307396, 299204, 184518, 307399, 323784, 307409, 307411, 176343, 299225, 233701, 307432, 184572, 282881, 184579, 282893, 291089, 282906, 291104, 233766, 282931, 307508, 315701, 307510, 332086, 307512, 151864, 176435, 307515, 168245, 282942, 307518, 151874, 282947, 282957, 323917, 110926, 233808, 323921, 315733, 323926, 233815, 315739, 323932, 299357, 242018, 242024, 299373, 315757, 250231, 242043, 315771, 299388, 299391, 291202, 299398, 242057, 291212, 299405, 291222, 283033, 291226, 242075, 315801, 291231, 61855, 283042, 291238, 291241, 127403, 127405, 291247, 127407, 299440, 299444, 127413, 283062, 291254, 127417, 291260, 283069, 127421, 127424, 299457, 127429, 127431, 283080, 176592, 315856, 315860, 176597, 127447, 283095, 299481, 176605, 242143, 291299, 127463, 242152, 291305, 127466, 176620, 127474, 291314, 291317, 135672, 233979, 291323, 291330, 283142, 127497, 233994, 135689, 291341, 233998, 234003, 234006, 152087, 127511, 283161, 242202, 234010, 135707, 242206, 135710, 242208, 291361, 242220, 291378, 234038, 152118, 234041, 70213, 242250, 111193, 242275, 299620, 242279, 168562, 184952, 135805, 291456, 135808, 373383, 299655, 135820, 316051, 225941, 316054, 299672, 135834, 373404, 299677, 225948, 135839, 299680, 225954, 299684, 242343, 209576, 242345, 373421, 135870, 135873, 135876, 135879, 299720, 299723, 225998, 299726, 226002, 226005, 119509, 226008, 242396, 299740, 201444, 299750, 283368, 234219, 283372, 381677, 226037, 283382, 234231, 316151, 234236, 226045, 234239, 242431, 209665, 234242, 299778, 242436, 226053, 234246, 226056, 234248, 291593, 242443, 234252, 242445, 234254, 291601, 234258, 242450, 242452, 234261, 348950, 201496, 234264, 234266, 234269, 283421, 234272, 234274, 152355, 234278, 299814, 283432, 234281, 234284, 234287, 283440, 185138, 242483, 234292, 234296, 234298, 283452, 160572, 234302, 234307, 242499, 234309, 292433, 234313, 316233, 316235, 234316, 283468, 242511, 234319, 234321, 234324, 185173, 201557, 234329, 234333, 308063, 234336, 234338, 242530, 349027, 234341, 234344, 234347, 177004, 234350, 324464, 234353, 152435, 177011, 234356, 234358, 234362, 226171, 234364, 291711, 234368, 234370, 201603, 291714, 234373, 226182, 234375, 291716, 226185, 308105, 234379, 234384, 234388, 234390, 226200, 324504, 234393, 209818, 308123, 324508, 234398, 234396, 291742, 234401, 291747, 291748, 234405, 291750, 234407, 324518, 324520, 234410, 324522, 226220, 291756, 234414, 324527, 291760, 234417, 201650, 324531, 226230, 234422, 275384, 324536, 234428, 291773, 234431, 242623, 324544, 324546, 226239, 324548, 226245, 234437, 234439, 234434, 234443, 291788, 275406, 234446, 193486, 234449, 316370, 193488, 234452, 234455, 234459, 234461, 234464, 234467, 234470, 168935, 5096, 324585, 234475, 234478, 316400, 234481, 316403, 234484, 234485, 324599, 234487, 234490, 234493, 234496, 316416, 234501, 275462, 308231, 234504, 234507, 234510, 234515, 300054, 234519, 316439, 234520, 234523, 234526, 234528, 300066, 234532, 300069, 234535, 234537, 234540, 144430, 234543, 234546, 275508, 234549, 300085, 300088, 234553, 234556, 234558, 316479, 234561, 316483, 234563, 308291, 234568, 234570, 316491, 300108, 234572, 234574, 300115, 234580, 234581, 275545, 242777, 234585, 234590, 234593, 234595, 300133, 234597, 234601, 300139, 234605, 234607, 160879, 275569, 234610, 300148, 234614, 398455, 144506, 275579, 234618, 234620, 234623, 226433, 234627, 275588, 234629, 242822, 234634, 275594, 234636, 177293, 234640, 275602, 234643, 226453, 275606, 234647, 275608, 308373, 234650, 234648, 308379, 283805, 234653, 324766, 119967, 234657, 300189, 324768, 242852, 283813, 234661, 300197, 234664, 275626, 234667, 316596, 308414, 234687, 300226, 308418, 226500, 234692, 300229, 308420, 283844, 283850, 300234, 300238, 300241, 316625, 300243, 300245, 316630, 300248, 300253, 300256, 300258, 300260, 234726, 300263, 300265, 161003, 300267, 300270, 300272, 120053, 300278, 316663, 275703, 300284, 275710, 300287, 283904, 300289, 292097, 300292, 300294, 275719, 300299, 177419, 283917, 300301, 242957, 177424, 275725, 349464, 283939, 259367, 283951, 292143, 300344, 226617, 283963, 243003, 226628, 283973, 300357, 177482, 283983, 316758, 357722, 316766, 292192, 316768, 218464, 292197, 316774, 243046, 218473, 284010, 136562, 324978, 275834, 333178, 275836, 275840, 316803, 316806, 226696, 316811, 226699, 316814, 226703, 300433, 234899, 226709, 357783, 316824, 316826, 144796, 300448, 144807, 144810, 284076, 144812, 144814, 144820, 284084, 284087, 292279, 144826, 144828, 144830, 144832, 144835, 284099, 144837, 38342, 144839, 144841, 144844, 144847, 144852, 144855, 103899, 300507, 333280, 226787, 218597, 292329, 300523, 259565, 300527, 308720, 259567, 226802, 316917, 308727, 292343, 300537, 316947, 308757, 308762, 284191, 284194, 284196, 235045, 284199, 284204, 284206, 284209, 284211, 284213, 194101, 284215, 194103, 284218, 226877, 284223, 284226, 243268, 292421, 226886, 284231, 128584, 284228, 284234, 276043, 317004, 366155, 284238, 226895, 284241, 194130, 284243, 276052, 276053, 284245, 284247, 317015, 284249, 243290, 284251, 300628, 284253, 235097, 284255, 300638, 243293, 284258, 292452, 292454, 284263, 177766, 284265, 292458, 284267, 292461, 284272, 284274, 276086, 284278, 292470, 292473, 284283, 276093, 284286, 276095, 284288, 292481, 276098, 284290, 325250, 284292, 292479, 292485, 284297, 317066, 284299, 317068, 276109, 284301, 284303, 276114, 284306, 284308, 284312, 284314, 284316, 276127, 284320, 284322, 284327, 276137, 284329, 284331, 317098, 284333, 284335, 276144, 284337, 284339, 300726, 284343, 284346, 284350, 276160, 358080, 284354, 358083, 276166, 284358, 358089, 276170, 284362, 276175, 284368, 276177, 284370, 317138, 284372, 358098, 284377, 276187, 284379, 284381, 284384, 284386, 358114, 358116, 276197, 317158, 358119, 284392, 325353, 284394, 358122, 284397, 276206, 284399, 358126, 358128, 358133, 358135, 276216, 358138, 300795, 358140, 284413, 358142, 284418, 358146, 317187, 317189, 317191, 284428, 300816, 300819, 317207, 284440, 186139, 300828, 300830, 276255, 325408, 284449, 300834, 300832, 227109, 317221, 358183, 186151, 276268, 300845, 194351, 243504, 300850, 284469, 276280, 325436, 358206, 276291, 366406, 276295, 300872, 153417, 284499, 276308, 284502, 317271, 178006, 276315, 292700, 284511, 227175, 292715, 300912, 284529, 292721, 300915, 284533, 292729, 317306, 284540, 292734, 325512, 169868, 276365, 284564, 358292, 284566, 350106, 284572, 276386, 284579, 276388, 358312, 284585, 317353, 276395, 292776, 292784, 276402, 358326, 161718, 276410, 276411, 358330, 276418, 276425, 301009, 301011, 301013, 292823, 301015, 301017, 358360, 292828, 276446, 153568, 276448, 276452, 276455, 292839, 292843, 276460, 276464, 178161, 227314, 276466, 276472, 325624, 317435, 276476, 276479, 276482, 276485, 317446, 276490, 292876, 276496, 317456, 317458, 243733, 243740, 317468, 317472, 325666, 243751, 292904, 276528, 243762, 309298, 325685, 325689, 276539, 235579, 235581, 325692, 178238, 276544, 284739, 292934, 276553, 243785, 350293, 350295, 194649, 227418, 309337, 350302, 227423, 194654, 194657, 178273, 276579, 227426, 194660, 227430, 276583, 309346, 309348, 276586, 309350, 309352, 309354, 276590, 350313, 350316, 350321, 284786, 276595, 227440, 301167, 350325, 350328, 292985, 301178, 292989, 292993, 301185, 350339, 317570, 317573, 350342, 227463, 350345, 350349, 301199, 317584, 325777, 350354, 350357, 350359, 350362, 276638, 350366, 284837, 153765, 350375, 350379, 350381, 350383, 129200, 350385, 350387, 350389, 350395, 350397, 350399, 227520, 350402, 227522, 301252, 350406, 227529, 309450, 301258, 276685, 276689, 309462, 301272, 276699, 309468, 194780, 309471, 301283, 317672, 276713, 317674, 325867, 243948, 194801, 227571, 309491, 276725, 309494, 243960, 276735, 227583, 227587, 276739, 211204, 276742, 227593, 227596, 325910, 309530, 342298, 276766, 211232, 317729, 276775, 211241, 325937, 276789, 325943, 211260, 260421, 276809, 285002, 276811, 235853, 276816, 235858, 276829, 276833, 391523, 276836, 276843, 293227, 276848, 293232, 186744, 285051, 211324, 227709, 285061, 317833, 178572, 285070, 178575, 285077, 178583, 227738, 317853, 276896, 317858, 342434, 285093, 317864, 285098, 276907, 235955, 276917, 293304, 293307, 293314, 309707, 293325, 317910, 293336, 235996, 317917, 293343, 358880, 276961, 227810, 293346, 276964, 293352, 236013, 293364, 301562, 317951, 309764, 301575, 121352, 236043, 317963, 342541, 55822, 113167, 277011, 317971, 309781, 309779, 55837, 227877, 227879, 293417, 227882, 309804, 293421, 105007, 236082, 285236, 23094, 277054, 244288, 129603, 318020, 301636, 301639, 301643, 277071, 285265, 399955, 309844, 277080, 309849, 285277, 285282, 326244, 318055, 277100, 277106, 121458, 170618, 170619, 309885, 309888, 277122, 227975, 277128, 285320, 301706, 318092, 326285, 318094, 334476, 277136, 277139, 227992, 285340, 318108, 227998, 318110, 137889, 383658, 285357, 318128, 277170, 342707, 154292, 277173, 293555, 318132, 285368, 277177, 277181, 318144, 277187, 277191, 277194, 277196, 277201, 137946, 113378, 203491, 228069, 277223, 342760, 285417, 56041, 56043, 277232, 228081, 56059, 310015, 285441, 310020, 285448, 310029, 285453, 228113, 285459, 277273, 293659, 326430, 228128, 293666, 285474, 228135, 318248, 277291, 293677, 318253, 285489, 293685, 285494, 301880, 285499, 301884, 310080, 293696, 277314, 277317, 277322, 277329, 162643, 310100, 301911, 277337, 301913, 301921, 400236, 236397, 162671, 326514, 310134, 277368, 15224, 236408, 416639, 416640, 113538, 310147, 416648, 277385, 39817, 187274, 301972, 424853, 277405, 277411, 310179, 293798, 293802, 236460, 277426, 293811, 293817, 293820, 203715, 326603, 293849, 293861, 228327, 228328, 228330, 318442, 228332, 277486, 326638, 318450, 293876, 293877, 285686, 302073, 285690, 121850, 302075, 244731, 293882, 293887, 277504, 277507, 277511, 277519, 293908, 277526, 293917, 293939, 318516, 277561, 277564, 310336, 7232, 293956, 277573, 228422, 310344, 277577, 293960, 277583, 203857, 310355, 293971, 310359, 236632, 277594, 138332, 277598, 285792, 277601, 203872, 310374, 203879, 277608, 310376, 228460, 318573, 203886, 187509, 285815, 285817, 367737, 285821, 302205, 285824, 392326, 285831, 253064, 302218, 285835, 294026, 384148, 162964, 187542, 302231, 285849, 302233, 285852, 302237, 285854, 285856, 285862, 277671, 302248, 64682, 277678, 228526, 294063, 294065, 302258, 277687, 294072, 318651, 294076, 277695, 318657, 244930, 302275, 130244, 302277, 228550, 302282, 310476, 302285, 302288, 310481, 302290, 203987, 302292, 302294, 302296, 384222, 310498, 285927, 318698, 302315, 195822, 228592, 294132, 138485, 204023, 228601, 204026, 228606, 204031, 64768, 310531, 285958, 228617, 138505, 318742, 204067, 277798, 130345, 277801, 113964, 285997, 277804, 285999, 277807, 113969, 277811, 318773, 318776, 277816, 286010, 277819, 294204, 417086, 277822, 286016, 294211, 302403, 384328, 277832, 277836, 294221, 326991, 294223, 277839, 277842, 277847, 277850, 179547, 277853, 146784, 277857, 302436, 277860, 294246, 327015, 310632, 327017, 351594, 277864, 277869, 277872, 351607, 310648, 277880, 310651, 277884, 277888, 310657, 351619, 294276, 310659, 277892, 327046, 253320, 310665, 318858, 277898, 277894, 277903, 310672, 351633, 277905, 277908, 277917, 310689, 277921, 277923, 130468, 228776, 277928, 277932, 310703, 277937, 310710, 130486, 310712, 277944, 310715, 277947, 302526, 228799, 277950, 277953, 64966, 245191, 163272, 302534, 310727, 277959, 292968, 302541, 277966, 302543, 277963, 310737, 277971, 277975, 228825, 163290, 277978, 310749, 277981, 277984, 310755, 277989, 277991, 187880, 277995, 286188, 310764, 278000, 278003, 310772, 228851, 278006, 40440, 278009, 212472, 40443, 286203, 228864, 40448, 286214, 228871, 302603, 65038, 302614, 286233, 302617, 302621, 286240, 146977, 187939, 294435, 40484, 286246, 294439, 286248, 278057, 294440, 294443, 40486, 294445, 40488, 310831, 40491, 40499, 40502, 212538, 40507, 40511, 40513, 228933, 40521, 286283, 40525, 40527, 228944, 212560, 400976, 40533, 147032, 40537, 40539, 278109, 40541, 40544, 40548, 40550, 286312, 286313, 40554, 40552, 310892, 40557, 40560, 188022, 122488, 294521, 343679, 278150, 310925, 286354, 278163, 302740, 122517, 278168, 327333, 229030, 212648, 278188, 302764, 278192, 319153, 278196, 302781, 319171, 302789, 294599, 278216, 294601, 302793, 343757, 212690, 278227, 229076, 286420, 319187, 286425, 319194, 278235, 301163, 229086, 278238, 286432, 294625, 294634, 302838, 319226, 286460, 278274, 302852, 278277, 302854, 294664, 311048, 352008, 319243, 311053, 302862, 319251, 294682, 278306, 188199, 294701, 278320, 319280, 319290, 229192, 302925, 188247, 237409, 294776, 360317, 294785, 327554, 40840, 40851, 294803, 188312, 294811, 319390, 294817, 319394, 40865, 294821, 311209, 180142, 294831, 188340, 40886, 319419, 294844, 294847, 393177, 294876, 294879, 294883, 294890, 311279, 278513, 237555, 278516, 311283, 278519, 237562 ]
d30cf67b29c884d660c05a24d95fdb99428d40b8
8ac59d520c47d609ded13fae0dacb31dcb4b9ebf
/DeckOfOneCard/DeckOfOneCard/Models/Card.swift
8949f238ec4619cf0433d87e7ebc1424c657d798
[]
no_license
Squanto04/DeckOfOneCard
47e5da9551c8e126b80d32fead1370c57a24dbf4
e863ce5a95ad28c7dfc66237430d524d5cdc0d71
refs/heads/master
2020-08-03T22:42:02.811736
2019-09-30T18:39:00
2019-09-30T18:39:00
211,907,482
0
0
null
null
null
null
UTF-8
Swift
false
false
647
swift
// // Card.swift // DeckofOneCard // // Created by Jordan Lamb on 9/30/19. // Copyright © 2019 Squanto Inc. All rights reserved. // import Foundation struct TopLevelDictionary: Codable { /* JSON success : true deck_id : "xh3nc4tsjhlp" remaining : 50 cards */ let success: Bool let deck_id: String let remaining: Int let cards: [Card] } struct Card: Codable { /* value : "10" image : "https://deckofcardsapi.com/static/img/0C.png" suit : "CLUBS" images code : "0C" */ let value: String let image: String let suit: String let code: String }
[ -1 ]
99399455d546095ee495ee1162ee5bf2c2f471bb
ead66881c83a41732289380b782707ae0e67eeb0
/TheMealsAppViperArchitectureUITests/TheMealsAppViperArchitectureUITests.swift
42c152bffe7034198e4d8ee65ead15b52ab3a240
[]
no_license
Ajisaputrars/MealsAppWithViperArchitecture
38a2d5121de5f902b24cde028ceeedc243c05998
c492cbb0c96a93d0ef0adb52ffa2f3711f429887
refs/heads/master
2023-07-17T17:40:03.508976
2021-01-24T14:20:22
2021-01-24T14:20:22
331,872,970
0
0
null
null
null
null
UTF-8
Swift
false
false
1,486
swift
// // TheMealsAppViperArchitectureUITests.swift // TheMealsAppViperArchitectureUITests // // Created by Aji Saputra Raka Siwi on 21/01/21. // import XCTest class TheMealsAppViperArchitectureUITests: XCTestCase { override func setUpWithError() throws { // Put setup code here. This method is called before the invocation of each test method in the class. // In UI tests it is usually best to stop immediately when a failure occurs. continueAfterFailure = false // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. } override func tearDownWithError() throws { // Put teardown code here. This method is called after the invocation of each test method in the class. } func testExample() throws { // UI tests must launch the application that they test. let app = XCUIApplication() app.launch() // Use recording to get started writing UI tests. // Use XCTAssert and related functions to verify your tests produce the correct results. } func testLaunchPerformance() throws { if #available(macOS 10.15, iOS 13.0, tvOS 13.0, *) { // This measures how long it takes to launch your application. measure(metrics: [XCTApplicationLaunchMetric()]) { XCUIApplication().launch() } } } }
[ 274432, 372736, 415744, 182277, 346117, 354310, 354312, 354311, 43016, 403463, 436235, 399372, 360463, 419857, 358418, 376853, 436248, 178215, 430120, 346153, 344106, 253996, 430127, 272432, 405552, 403507, 378933, 378934, 358455, 249912, 385078, 352314, 436283, 376892, 32829, 225347, 403524, 352324, 436293, 352327, 385095, 399433, 163916, 368717, 333902, 436304, 176209, 329812, 381013, 53334, 254039, 104534, 411738, 200795, 368732, 180317, 356446, 426074, 272477, 438374, 32871, 176231, 352359, 438378, 221292, 395373, 260206, 385135, 422000, 376945, 432241, 249976, 266361, 385147, 346237, 374913, 374914, 422020, 168069, 381061, 168070, 415883, 426124, 381071, 333968, 436372, 196758, 430231, 200856, 422044, 192670, 192671, 362658, 65698, 436388, 258213, 49317, 333990, 377008, 377010, 430263, 104633, 266427, 260285, 268479, 133313, 395458, 377025, 374984, 377033, 164043, 417996, 254157, 436429, 346319, 266447, 368849, 368850, 372943, 139478, 385240, 254171, 379102, 147679, 147680, 334049, 356575, 268515, 387299, 18661, 379110, 383208, 205034, 254189, 149743, 379120, 254193, 260337, 260338, 372979, 381173, 411892, 395511, 436471, 438512, 436466, 356603, 389364, 432373, 344312, 135416, 375040, 336121, 436480, 260355, 147716, 272644, 432387, 266504, 338187, 338188, 368908, 180494, 375052, 194832, 325904, 395536, 368915, 254228, 272661, 338196, 262419, 61720, 379157, 381210, 178459, 377116, 157973, 391448, 389406, 186660, 334121, 254250, 338217, 325930, 358698, 260396, 418095, 438575, 336177, 131374, 358707, 332084, 266547, 180534, 438583, 397620, 362809, 379193, 178485, 127292, 358710, 14654, 155968, 268609, 438592, 332100, 270663, 395591, 368969, 254285, 383309, 180559, 377168, 344402, 348499, 250196, 348501, 397650, 389465, 272730, 436570, 383327, 332128, 215395, 366948, 416101, 383338, 110955, 160111, 362864, 354672, 250227, 272755, 354678, 432503, 438653, 385407, 432511, 385409, 436609, 266628, 340356, 436613, 395653, 395660, 106893, 270733, 264591, 385423, 420241, 225684, 252309, 373141, 373144, 385433, 213402, 39323, 385437, 389534, 436644, 254373, 397732, 385449, 375211, 115116, 272815, 334259, 436659, 129461, 342454, 338359, 385463, 358844, 336319, 326083, 436677, 188870, 416201, 129484, 154061, 373196, 416206, 256476, 377309, 377310, 184799, 432608, 369121, 369124, 420326, 270823, 432616, 334315, 201195, 213486, 360945, 375281, 139766, 393719, 377337, 254459, 410108, 410109, 262657, 324098, 166403, 377346, 334345, 340489, 432650, 410126, 393745, 385554, 397841, 262673, 342549, 420374, 254487, 258584, 410138, 188957, 377374, 342560, 416288, 385569, 348709, 350758, 350759, 358951, 358952, 385578, 348710, 197166, 219694, 219695, 397872, 393775, 330291, 418352, 340539, 266812, 352831, 33344, 385603, 348741, 381515, 348748, 375373, 416334, 426575, 369236, 385620, 416340, 244311, 191065, 430681, 270938, 332379, 436831, 260705, 416353, 375396, 268901, 184938, 373357, 184942, 176751, 389744, 420461, 346739, 346741, 352885, 352886, 356983, 244345, 356984, 344697, 209529, 420473, 356990, 400262, 373377, 422529, 152196, 369285, 356998, 348807, 356999, 166533, 344714, 201348, 375438, 377487, 326288, 363155, 346771, 180886, 264855, 426646, 352921, 363161, 275102, 344737, 436897, 340645, 176805, 176810, 352938, 418479, 164532, 336565, 383668, 160441, 342714, 377531, 355006, 377534, 39616, 422591, 377536, 385737, 432435, 135888, 385745, 369365, 369366, 385751, 361178, 363228, 352989, 352990, 383708, 436957, 264929, 338658, 295649, 385763, 418529, 436960, 369383, 361194, 346859, 269036, 373485, 373486, 330476, 432883, 342775, 203511, 348921, 275193, 21239, 383740, 344829, 432894, 162559, 35584, 133889, 197377, 430853, 346889, 383755, 430860, 326413, 62222, 434956, 418579, 426772, 197398, 207639, 426777, 326428, 363295, 344864, 430880, 197412, 336678, 342827, 391980, 189229, 355117, 197424, 152372, 336693, 197428, 191285, 377656, 355129, 197433, 273209, 273211, 430909, 426809, 160569, 355136, 160576, 355138, 416577, 377669, 348999, 420680, 355147, 197451, 355148, 439118, 369488, 355153, 385878, 387927, 385880, 244569, 363353, 197467, 363354, 375644, 252766, 420702, 127840, 363361, 363362, 357219, 435038, 355173, 355174, 197479, 342888, 385895, 439145, 412516, 207724, 385901, 351078, 207728, 197489, 420722, 381811, 201590, 392057, 164730, 211835, 398205, 340865, 392065, 254851, 260995, 369541, 330627, 392071, 265094, 172936, 349066, 236427, 252812, 349068, 387977, 400271, 355216, 381840, 390034, 392080, 396171, 224149, 256918, 256919, 256920, 430999, 377754, 224146, 373653, 400282, 211871, 381856, 359332, 398244, 256934, 359333, 422825, 326571, 172971, 252848, 381872, 377778, 189362, 326580, 261045, 261046, 189365, 273336, 326586, 398268, 273341, 377789, 330688, 349122, 398275, 359365, 363462, 379845, 127945, 211913, 326602, 345034, 273353, 252878, 342990, 373705, 433104, 359380, 418774, 386007, 433112, 433116, 418781, 207839, 340960, 347104, 359391, 386016, 398305, 340967, 123880, 418793, 398313, 343020, 187372, 383980, 248815, 412653, 222193, 347122, 134124, 257007, 435185, 127990, 271351, 349176, 201721, 383994, 349179, 435195, 328701, 437245, 257023, 328705, 125953, 418819, 357380, 386049, 410629, 330759, 377863, 384004, 189448, 347150, 361487, 384015, 330766, 433166, 386068, 254997, 433173, 412692, 326684, 252959, 384031, 336928, 336930, 398370, 330789, 357413, 248871, 375848, 410665, 357420, 345137, 361522, 412725, 386108, 257093, 404550, 377927, 398405, 261191, 250955, 361547, 218187, 250965, 339031, 156763, 375902, 375903, 392288, 439391, 361570, 214116, 253028, 250982, 214119, 257126, 265318, 402538, 265323, 398444, 404582, 62574, 351343, 173168, 357487, 187505, 404589, 273523, 119925, 377974, 349304, 384120, 363643, 66684, 343166, 384127, 248960, 392320, 349315, 349317, 402568, 140426, 363658, 373902, 386191, 224400, 404622, 253074, 326803, 347286, 359574, 265366, 222364, 351389, 339101, 418975, 429216, 265381, 380069, 124073, 253098, 367791, 367792, 373937, 373939, 324790, 367798, 402618, 339131, 421050, 218301, 343230, 367809, 265410, 253124, 113863, 402632, 259275, 273616, 419028, 259285, 351445, 357594, 339167, 195809, 222441, 414956, 421102, 253168, 386288, 66802, 351475, 251124, 271607, 369912, 52473, 363769, 369913, 52476, 386296, 412926, 439550, 386304, 351489, 437504, 419066, 369929, 439563, 414989, 388369, 349458, 259346, 380178, 429332, 259347, 367897, 367898, 245018, 115997, 222496, 412963, 382243, 382246, 130347, 257323, 353581, 116014, 66863, 369964, 273713, 382257, 208179, 345397, 345398, 382264, 159033, 333115, 347451, 193853, 386363, 359747, 359748, 257353, 345418, 257354, 109899, 337226, 406862, 378186, 259408, 353617, 437585, 331091, 150868, 251212, 378201, 374110, 372064, 429410, 437602, 114022, 253288, 388458, 265579, 327030, 163190, 421240, 382329, 259449, 384379, 337280, 357763, 253316, 384391, 388488, 263561, 353672, 424842, 9618, 112019, 370066, 398740, 411028, 370072, 396697, 253339, 253340, 343457, 353611, 148900, 396709, 353612, 245160, 333224, 374189, 380335, 355761, 251314, 359860, 359861, 421302, 343480, 259513, 134586, 380348, 216510, 54719, 216511, 380350, 361928, 200136, 273865, 339403, 372172, 425417, 337359, 329168, 327122, 329170, 413138, 353751, 425434, 437726, 426894, 429540, 3557, 361958, 3559, 271850, 271853, 329198, 411119, 259569, 116209, 251379, 253431, 386551, 265720, 359931, 398844, 210429, 375610, 216575, 343552, 366081, 372226, 437766, 409095, 271880, 198155, 208397, 359949, 329231, 253456, 413202, 253462, 388630, 175640, 370200, 413206, 431646, 349727, 146976, 157219, 157220, 372261, 394793, 245290, 245291, 347693, 431662, 323120, 396850, 200245, 323126, 343606, 374327, 210489, 163385, 134715, 235069, 425534, 421437, 396865, 147011, 265800, 273992, 147020, 128589, 333389, 421452, 265809, 333394, 353875, 349780, 396885, 196184, 179800, 396889, 265816, 388699, 343646, 396896, 155238, 415334, 388712, 388713, 204394, 271980, 138862, 54895, 206447, 403057, 188021, 366198, 42616, 339579, 337533, 210558, 210559, 396927, 415360, 370307, 419462, 149127, 149128, 210569, 415369, 224907, 419464, 431754, 267916, 411275, 415376, 405140, 274071, 425624, 345753, 259741, 255651, 208547, 245413, 153252, 208548, 399014, 210601, 364202, 405157, 388775, 202413, 421556, 384693, 337590, 370359, 224951, 224952, 376502, 415419, 409277, 259780, 333508, 409289, 267978, 403149, 333522, 425682, 345813, 370390, 272087, 224985, 345817, 245471, 325345, 337638, 333543, 181992, 345832, 159462, 345835, 372458, 141037, 325357, 397040, 212721, 12017, 431861, 163575, 274170, 360194, 175874, 173828, 249606, 395018, 395019, 409355, 155408, 372497, 395026, 397076, 417556, 366358, 169751, 421657, 345882, 435993, 411417, 431901, 341791, 339746, 255781, 257831, 167720, 362281, 378666, 399148, 202541, 431918, 153392, 378673, 403248, 182070, 182071, 345910, 421686, 274234, 384826, 409404, 436029, 204600, 431935, 360253, 415555, 325444, 337734, 339782, 409416, 325449, 341837, 415566, 272207, 272208, 337746, 431955, 325460, 376661, 341846, 339799, 345942, 362326, 368471, 395092, 425820, 370526, 345950, 362336, 259937, 255844, 274276, 368486, 384871, 409446, 40809, 368489, 415592, 425832, 382820, 214894, 362351, 214896, 274288, 372592, 325491, 417648, 341878, 333687, 350072, 276343, 274296, 360315, 381791, 417658, 112510, 182145, 253828, 325508, 243590, 333700, 350091, 350092, 372625, 425875, 350102, 337816, 329627, 253851, 350108, 376733, 333727, 354210, 436130, 118693, 436135, 10153, 438186, 362411, 370604, 253868, 362418, 128955, 188349, 411587, 362442, 380874, 346066, 212947, 212953, 372699, 354268, 403421, 219102, 436189, 329696, 354273, 360416, 403425, 6116, 354279, 436199, 174058, 247787, 253930, 329707, 354283, 247786, 337899, 380910, 436209, 432114, 385011, 380922, 380923, 415740, 268286 ]
0017aa473caffc076a0754a01a250fc03bd8d4f7
dc101eb5496b7c711415e41032f34bad17ed4cf3
/SonarCube/SceneDelegate.swift
5e70fbe216ef734945c96c4843abbcd1557b9e5c
[]
no_license
northoutAbhiraj/SonarCube
1a26865b19a5debe30c8f03f471c141a293a5347
bc4d388ed735f3fc2dee290d627db2e299938b42
refs/heads/master
2022-04-02T06:55:00.214178
2020-01-31T12:55:19
2020-01-31T12:55:19
237,391,039
0
0
null
null
null
null
UTF-8
Swift
false
false
2,354
swift
// // SceneDelegate.swift // SonarCube // // Created by MacMiniAbhiraj on 31/01/20. // Copyright © 2020 MacMiniAbhiraj. All rights reserved. // import UIKit class SceneDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow? func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). guard let _ = (scene as? UIWindowScene) else { return } } func sceneDidDisconnect(_ scene: UIScene) { // Called as the scene is being released by the system. // This occurs shortly after the scene enters the background, or when its session is discarded. // Release any resources associated with this scene that can be re-created the next time the scene connects. // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). } func sceneDidBecomeActive(_ scene: UIScene) { // Called when the scene has moved from an inactive state to an active state. // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. } func sceneWillResignActive(_ scene: UIScene) { // Called when the scene will move from an active state to an inactive state. // This may occur due to temporary interruptions (ex. an incoming phone call). } func sceneWillEnterForeground(_ scene: UIScene) { // Called as the scene transitions from the background to the foreground. // Use this method to undo the changes made on entering the background. } func sceneDidEnterBackground(_ scene: UIScene) { // Called as the scene transitions from the foreground to the background. // Use this method to save data, release shared resources, and store enough scene-specific state information // to restore the scene back to its current state. } }
[ 393221, 163849, 393228, 393231, 393251, 352294, 344103, 393260, 393269, 213049, 376890, 385082, 16444, 393277, 376906, 327757, 254032, 286804, 368728, 254045, 368736, 180322, 376932, 286833, 286845, 286851, 417925, 262284, 360598, 286880, 286889, 377003, 377013, 164029, 327872, 180418, 377030, 377037, 180432, 377047, 418008, 385243, 418012, 377063, 327915, 205037, 393457, 393461, 393466, 418044, 336124, 385281, 336129, 262405, 180491, 336140, 164107, 262417, 368913, 262423, 377118, 377121, 262437, 254253, 336181, 262455, 393539, 262473, 344404, 213333, 418135, 270687, 262497, 418145, 262501, 213354, 246124, 262508, 262512, 213374, 385420, 262551, 262553, 385441, 385444, 262567, 385452, 262574, 393649, 385460, 262587, 344512, 262593, 336326, 360917, 369119, 328178, 328180, 328183, 328190, 254463, 328193, 98819, 164362, 328207, 410129, 393748, 377372, 188959, 385571, 377384, 197160, 33322, 352822, 270905, 197178, 418364, 188990, 369224, 385610, 270922, 352844, 385617, 352865, 262761, 352875, 344694, 352888, 336513, 377473, 336517, 344710, 385671, 148106, 377485, 352919, 98969, 336549, 344745, 361130, 336556, 385714, 434868, 164535, 336568, 164539, 328379, 328387, 352969, 418508, 385743, 385749, 189154, 369382, 361196, 418555, 344832, 336644, 344837, 344843, 328462, 361231, 394002, 336660, 418581, 418586, 434971, 369436, 262943, 369439, 418591, 418594, 336676, 418600, 418606, 271154, 328498, 369464, 361274, 328516, 336709, 328520, 336712, 361289, 328523, 336715, 361300, 213848, 426842, 361307, 197469, 361310, 254813, 361318, 344936, 361323, 361335, 328574, 369544, 361361, 222129, 345036, 115661, 386004, 345046, 386012, 386019, 386023, 328690, 435188, 328703, 328710, 418822, 377867, 328715, 386070, 271382, 336922, 345119, 377888, 328747, 214060, 345134, 345139, 361525, 361537, 377931, 197708, 189525, 156762, 402523, 361568, 148580, 345200, 361591, 386168, 361594, 410746, 214150, 345224, 386187, 337048, 345247, 361645, 337072, 345268, 337076, 402615, 361657, 402636, 328925, 165086, 165092, 328933, 222438, 328942, 386286, 386292, 206084, 115973, 328967, 345377, 345380, 353572, 345383, 263464, 337207, 345400, 378170, 369979, 386366, 337224, 337230, 337235, 263509, 353634, 337252, 402792, 345449, 99692, 271731, 378232, 337278, 271746, 181639, 353674, 181644, 361869, 181650, 181655, 230810, 181671, 181674, 181679, 181682, 337330, 181687, 370105, 181691, 181697, 361922, 337350, 181704, 337366, 271841, 329192, 361961, 329195, 116211, 337399, 402943, 337416, 329227, 419341, 419345, 329234, 419351, 345626, 419357, 345631, 419360, 370208, 394787, 419363, 370214, 419369, 394796, 419377, 419386, 206397, 214594, 419401, 353868, 419404, 173648, 419408, 214611, 419412, 403040, 345702, 222831, 370298, 353920, 403076, 345737, 198282, 403085, 403092, 345750, 419484, 345758, 345763, 419492, 345766, 419498, 419502, 370351, 419507, 337588, 419510, 419513, 419518, 403139, 337607, 419528, 419531, 419536, 272083, 394967, 419543, 419545, 345819, 419548, 181982, 419551, 345829, 419560, 337643, 419564, 337647, 370416, 141052, 337661, 337671, 362249, 362252, 395022, 362256, 321300, 345888, 116512, 362274, 378664, 354107, 345916, 354112, 247618, 370504, 329545, 345932, 354124, 370510, 247639, 337751, 370520, 313181, 182110, 354143, 354157, 345965, 345968, 345971, 345975, 182136, 403321, 1914, 354173, 395148, 247692, 337809, 247701, 329625, 436127, 436133, 247720, 337834, 362414, 337845, 190393, 247760, 346064, 346069, 329699, 354275, 190440, 247790, 354314, 346140, 337980, 436290, 395340, 378956, 436307, 338005, 329816, 100454, 329833, 329853, 329857, 329868, 411806, 329886, 346273, 362661, 100525, 387250, 379067, 387261, 256193, 395467, 346317, 411862, 256214, 411865, 411869, 411874, 379108, 411877, 387303, 346344, 395496, 338154, 387307, 346350, 338161, 436474, 321787, 379135, 411905, 411917, 43279, 379154, 395539, 387350, 387353, 338201, 182559, 338212, 395567, 248112, 362823, 436556, 321880, 362844, 379234, 354674, 182642, 321911, 420237, 379279, 272787, 354728, 338353, 338363, 338382, 272849, 248279, 256474, 182755, 338404, 338411, 330225, 248309, 199165, 248332, 330254, 199182, 199189, 420377, 330268, 191012, 330320, 199250, 191069, 346722, 248427, 191085, 338544, 191093, 346743, 330384, 346769, 150184, 174775, 248505, 174778, 363198, 223936, 355025, 273109, 264919, 256735, 338661, 338665, 264942, 330479, 363252, 338680, 207620, 264965, 191240, 338701, 256787, 363294, 199455, 396067, 346917, 396070, 215854, 355123, 355141, 355144, 338764, 330581, 330585, 387929, 355167, 265056, 265059, 355176, 355180, 355185, 330612, 330643, 412600, 207809, 379849, 347082, 396246, 330711, 248794, 248799, 347106, 437219, 257009, 265208, 330750, 199681, 338951, 330761, 330769, 330775, 248863, 158759, 396329, 347178, 404526, 396337, 330803, 396340, 339002, 388155, 339010, 347208, 248905, 330827, 330830, 248915, 183384, 339037, 412765, 257121, 322660, 265321, 330869, 248952, 420985, 330886, 330890, 347288, 248986, 44199, 380071, 339118, 249018, 339133, 126148, 322763, 330959, 330966, 265433, 265438, 388320, 363757, 388348, 339199, 396552, 175376, 175397, 208167, 273709, 372016, 437553, 347442, 199989, 175416, 396601, 208189, 437567, 175425, 437571, 437576, 437584, 331089, 437588, 396634, 175451, 437596, 429408, 175458, 208228, 175461, 175464, 265581, 331124, 175478, 249210, 175484, 175487, 249215, 175491, 249219, 249225, 249228, 249235, 175514, 175517, 396703, 396706, 175523, 355749, 396723, 388543, 380353, 216518, 339401, 380364, 339406, 372177, 339414, 249303, 413143, 339418, 339421, 249310, 339425, 249313, 339429, 339435, 249329, 69114, 372229, 339464, 249355, 208399, 380433, 175637, 405017, 134689, 339504, 265779, 421442, 413251, 265796, 265806, 224854, 224858, 339553, 257636, 224871, 372328, 257647, 372338, 339572, 224885, 224888, 224891, 224895, 126597, 421509, 224905, 11919, 224911, 224914, 126611, 224917, 224920, 126618, 208539, 224923, 224927, 224930, 224933, 257705, 224939, 224943, 257713, 224949, 257717, 257721, 224954, 257725, 224960, 257733, 224966, 224970, 257740, 224976, 257745, 257748, 224982, 257752, 224987, 257762, 224996, 225000, 339696, 225013, 257788, 225021, 339711, 257791, 225027, 257796, 339722, 257802, 257805, 225039, 257808, 249617, 225044, 167701, 372500, 257815, 225049, 257820, 225054, 184096, 397089, 257825, 225059, 339748, 225068, 257837, 413485, 225071, 225074, 257843, 225077, 257846, 225080, 397113, 225083, 397116, 257853, 225088, 225094, 225097, 323404, 257869, 257872, 225105, 339795, 397140, 225109, 225113, 257881, 257884, 257887, 225120, 257891, 413539, 225128, 257897, 225138, 339827, 257909, 225142, 372598, 257914, 257917, 225150, 257922, 380803, 225156, 339845, 257927, 225166, 397201, 225171, 380823, 225176, 225183, 184245, 372698, 372704, 372707, 356336, 380919, 393215, 372739, 405534, 266295, 266298, 217158, 421961, 200786, 356440, 217180, 430181, 266351, 356467, 266365, 192640, 266375, 381069, 225425, 250003, 225430, 250008, 356507, 250012, 225439, 135328, 192674, 225442, 438434, 225445, 225448, 438441, 225451, 258223, 225456, 430257, 225459, 225462, 225468, 389309, 225472, 372931, 225476, 389322, 225485, 225488, 225491, 266454, 225494, 225497, 225500, 225503, 225506, 356580, 225511, 217319, 225515, 225519, 381177, 397572, 389381, 356631, 356638, 356641, 356644, 356647, 266537, 389417, 356650, 356656, 332081, 307507, 340276, 356662, 397623, 332091, 225599, 332098, 201030, 348489, 332107, 151884, 430422, 348503, 332118, 250203, 332130, 250211, 340328, 250217, 348523, 348528, 332153, 356734, 389503, 332158, 438657, 332162, 389507, 348548, 356741, 250239, 332175, 160152, 373146, 373149, 70048, 356783, 266688, 324032, 201158, 340452, 127473, 217590, 340473, 324095, 324100, 324103, 324112, 340501, 324118, 324122, 340512, 332325, 324134, 381483, 356908, 324141, 324143, 356917, 324150, 324156, 168509, 348734, 324161, 324165, 356935, 348745, 381513, 324171, 324174, 324177, 389724, 332381, 373344, 340580, 348777, 381546, 119432, 340628, 184983, 373399, 340639, 258723, 332455, 332460, 332464, 332473, 381626, 332484, 332487, 332494, 357070, 357074, 332512, 332521, 340724, 332534, 373499, 348926, 389927, 348979, 152371, 398141, 127815, 357202, 389971, 357208, 136024, 389979, 430940, 357212, 357215, 439138, 201580, 201583, 349041, 340850, 201589, 381815, 430967, 324473, 398202, 119675, 340859, 324476, 430973, 324479, 340863, 324482, 324485, 324488, 185226, 381834, 324493, 324496, 324499, 430996, 324502, 324511, 422817, 324514, 201638, 398246, 373672, 324525, 5040, 111539, 324534, 5047, 324539, 324542, 398280, 349129, 340940, 340942, 209874, 340958, 431073, 398307, 340964, 209896, 201712, 209904, 349173, 381947, 201724, 349181, 431100, 431107, 349203, 209944, 209948, 250915, 250917, 169002, 357419, 209966, 209969, 209973, 209976, 209980, 209988, 209991, 431180, 209996, 349268, 177238, 250968, 210011, 373853, 341094, 210026, 210028, 210032, 349296, 210037, 210042, 210045, 349309, 152704, 349313, 160896, 210053, 210056, 349320, 259217, 373905, 210068, 210072, 210078, 210081, 210085, 210089, 210096, 210100, 324792, 210108, 357571, 210116, 210128, 333010, 210132, 333016, 210139, 210144, 218355, 251123, 218361, 275709, 128254, 275713, 242947, 275717, 275723, 333075, 349460, 333079, 251161, 349486, 349492, 415034, 251211, 210261, 365912, 259423, 374113, 251236, 374118, 234867, 390518, 357756, 374161, 112021, 349591, 357793, 333222, 210357, 259516, 415168, 366035, 415187, 366039, 415192, 415194, 415197, 415200, 333285, 415208, 366057, 366064, 415217, 415225, 423424, 415258, 415264, 366118, 415271, 382503, 349739, 144940, 415279, 415282, 415286, 210488, 415291, 415295, 333387, 333396, 333400, 366173, 333415, 423529, 423533, 333423, 210547, 415354, 333440, 267910, 267929, 333472, 333512, 259789, 358100, 366301, 333535, 366308, 366312, 431852, 399086, 366319, 210673, 366322, 399092, 366326, 333566, 268042, 210700, 366349, 210707, 399129, 333593, 333595, 210720, 366384, 358192, 210740, 366388, 358201, 399166, 325441, 366403, 325447, 341831, 341835, 341839, 341844, 415574, 358235, 341852, 350046, 399200, 399208, 268144, 358256, 358260, 399222, 325494, 186233, 333690, 243584, 325505, 333699, 399244, 333709, 333725, 333737, 382891, 382898, 333767, 358348, 333777, 219094, 399318, 358372, 350190, 350194, 333819, 350204, 350207, 325633, 325637, 350214, 268299, 333838, 350225, 350232, 333851, 350238, 350241, 374819, 350245, 350249, 350252, 178221, 350257, 350260, 350272, 243782, 350281, 350286, 374865, 252021, 342134, 374904, 268435, 333989, 333998, 334012, 260299, 350411, 350417, 350423, 211161, 350426, 334047, 350449, 375027, 358645, 350454, 350459, 350462, 350465, 350469, 325895, 268553, 194829, 350477, 268560, 350481, 432406, 350487, 350491, 350494, 325920, 350500, 350505, 358701, 391469, 350510, 358705, 358714, 358717, 383307, 358738, 334162, 383331, 383334, 391531, 383342, 334204, 268669, 194942, 391564, 366991, 334224, 342431, 375209, 326059, 375220, 342453, 334263, 326087, 358857, 195041, 334306, 334312, 104940, 375279, 162289, 350724, 186898, 342546, 350740, 342551, 334359, 342555, 334364, 416294, 350762, 252463, 358962, 334386, 334397, 358973, 252483, 219719, 399957, 244309, 334425, 326240, 375401, 334466, 334469, 391813, 162446, 326291, 342680, 342685, 260767, 342711, 244410, 260798, 334530, 260802, 350918, 154318, 342737, 391895, 154329, 416476, 64231, 113389, 342769, 203508, 375541, 342777, 391938, 391949, 375569, 375572, 375575, 375580, 162592, 334633, 326444, 383794, 326452, 326455, 375613, 244542, 260925, 375616, 326468, 244552, 342857, 326474, 326479, 326486, 416599, 342875, 244572, 326494, 326503, 433001, 326508, 400238, 326511, 211826, 211832, 392061, 351102, 252801, 260993, 400260, 211846, 342921, 342931, 252823, 400279, 392092, 400286, 359335, 211885, 400307, 351169, 359362, 351172, 170950, 187335, 326599, 359367, 359383, 359389, 383968, 343018, 359411, 261109, 261112, 244728, 383999, 261130, 261148, 359452, 211999, 261155, 261160, 261166, 359471, 375868, 384099, 384102, 384108, 367724, 326764, 187503, 343155, 384115, 212095, 384136, 384140, 384144, 351382, 384152, 384158, 384161, 351399, 384169, 367795, 244917, 384182, 384189, 384192, 351424, 343232, 244934, 367817, 244938, 384202, 253132, 326858, 343246, 384209, 146644, 351450, 384225, 359650, 343272, 351467, 359660, 384247, 351480, 384250, 351483, 351492, 343307, 384270, 359695, 261391, 253202, 261395, 384276, 384284, 245021, 384290, 253218, 245032, 171304, 384299, 351535, 245042, 326970, 384324, 343366, 212296, 212304, 367966, 343394, 343399, 367981, 343410, 155000, 327035, 245121, 245128, 253321, 155021, 384398, 245137, 245143, 245146, 245149, 343453, 245152, 245155, 155045, 245158, 40358, 245163, 114093, 327090, 343478, 359867, 384444, 146878, 327108, 327112, 384457, 327118, 359887, 359891, 343509, 368093, 155103, 343535, 343540, 368120, 343545, 409092, 359948, 359951, 245295, 359984, 400977, 400982, 179803, 155241, 138865, 155255, 155274, 368289, 245410, 425639, 245415, 425652, 425663, 155328, 245463, 155352, 155356, 212700, 155364, 245477, 155372, 245487, 212723, 245495, 409336, 155394, 155404, 245528, 155423, 360224, 155439, 204592, 155444, 155448, 417596, 384829, 360262, 155463, 155477, 376665, 155484, 261982, 425823, 155488, 376672, 155492, 327532, 261997, 376686, 262000, 262003, 425846, 262006, 147319, 262009, 327542, 262012, 155517, 155523, 155526, 360327, 376715, 155532, 262028, 262031, 262034, 262037, 262040, 262043, 155550, 253854, 262046, 262049, 262052, 327590, 155560, 155563, 155566, 327613, 393152, 311244, 212945, 393170, 155604, 155620, 253924, 155622, 253927, 327655, 360432, 393204, 360439, 253944, 393209, 155647 ]
a48629754911e46a3a1f1544896130f5d3b0793f
722d520eb4af01d6380b7afbafb78b7a8723cfed
/MyUserDao.swift
0be1ef0972581ac180a9615b89ef90be44866afb
[]
no_license
repixels/ZOBA
ad09dd19c1144f1a6abb3fb4d8581de68bff7ff1
1944995fe301329eed11d8f8240b631b8c07e990
refs/heads/master
2020-04-15T14:00:05.416064
2016-10-03T20:48:57
2016-10-03T20:48:57
59,817,410
0
0
null
2016-10-03T20:48:58
2016-05-27T08:11:42
Swift
UTF-8
Swift
false
false
3,131
swift
// // MyUserDao.swift // ZOBA // // Created by me on 5/28/16. // Copyright © 2016 RE Pixels. All rights reserved. // import Foundation import CoreData class MyUserDao { var managedObjectContext : NSManagedObjectContext! init(managedObjectContext : NSManagedObjectContext){ self.managedObjectContext = managedObjectContext } func save(managedObjectContext : NSManagedObjectContext ,userId _id: Int, Email email : String, UserName userName :String , firstName first : String, LastName last : String , Phone phone : String , ImageUrl image :String) -> MyUser!{ let user = NSEntityDescription.insertNewObjectForEntityForName("MyUser", inManagedObjectContext: self.managedObjectContext!) as! MyUser // m = select() user.firstName = first user.email = email user.id = _id user.image = image user.lastName = last user.userName = userName user.phone = phone do { try managedObjectContext.save() print("saved") } catch let error { print(error) } return user; } func selectAll(managedObjectContext : NSManagedObjectContext) -> [MyUser]{ let fetched = NSFetchRequest(entityName : "MyUser") var res : [MyUser]! do{ res = try managedObjectContext.executeFetchRequest(fetched) as! [MyUser] }catch let error { print(error) } return res } func selectBy(managedObjectContext : NSManagedObjectContext,attribute : String , value :String) -> [MyUser]{ let fetchRequest = NSFetchRequest(entityName: "MyUser") let sortDescriptor = NSSortDescriptor(key: attribute, ascending: true) fetchRequest.sortDescriptors = [sortDescriptor] // Create a new predicate that filters out any object that // doesn't have a title of "Best Language" exactly. let predicate = NSPredicate(format: attribute + " = %@",value) // (format: "title == %@", "Best Language") // Set the predicate on the fetch request fetchRequest.predicate = predicate var res : [MyUser]! do{ res = try managedObjectContext.executeFetchRequest(fetchRequest) as! [MyUser] } catch let error { print(error) } return res } func selectById(managedObjectContext : NSManagedObjectContext,Id _id :Int) -> MyUser{ let users = selectBy(managedObjectContext, attribute: "id", value: String(_id)) var user :MyUser! if users.count > 0 { user = users[0] } return user } func delete(managedObjectContext : NSManagedObjectContext,Id _id :Int){ let user = selectById(managedObjectContext, Id: _id) do{ managedObjectContext.deleteObject(user) try managedObjectContext.save() } catch let error { print(error) } } }
[ -1 ]
dc3ce92a011f9544d3c8216ad9f00f1473a799db
bdf97631cec76950000ebb6aa5598290cad7fb9d
/Example/SwiftTableSpaces/ToDoTableViewCell.swift
4dd35cd95f511b9396f7de0ba493cc9e4f1eab4b
[ "MIT" ]
permissive
aj-bartocci/SwiftTableSpaces
d73af9720621327870165b41e7324f7e11830487
37b00d0f11d808871aadfac4dd84bccce31d872a
refs/heads/master
2020-03-08T23:35:10.268415
2018-08-18T19:16:25
2018-08-18T19:16:25
128,468,078
1
1
null
null
null
null
UTF-8
Swift
false
false
643
swift
// // ToDoTableViewCell.swift // SwiftTableSpaces_Example // // Created by AJ Bartocci on 4/11/18. // Copyright © 2018 CocoaPods. All rights reserved. // import UIKit class ToDoTableViewCell: UITableViewCell { @IBOutlet private weak var titleLabel: UILabel! override func awakeFromNib() { super.awakeFromNib() // Initialization code } override func setSelected(_ selected: Bool, animated: Bool) { super.setSelected(selected, animated: animated) // Configure the view for the selected state } func setTitle(text: String?) { self.titleLabel.text = text } }
[ -1 ]
1310d2ba9aa44fe7c12094745d83f55e91528c29
7dda67769177423cfa0eb1750be7720c102b34e0
/Sources/SwiftEOS/SDK/Sanctions/SanctionsActor.swift
266df4731b14e59da0fe503da31c3acb7c99b432
[]
no_license
roman-dzieciol/swift-eos
e417638275d901e36eaeb2e9c8fd182145274a98
777655acf1c63fc5ccfaf2fb0061defb80946134
refs/heads/main
2022-07-28T03:01:20.388788
2021-07-24T13:20:38
2021-07-24T13:20:38
382,996,384
0
0
null
null
null
null
UTF-8
Swift
false
false
7,449
swift
import Foundation import EOSSDK public final class SwiftEOS_Sanctions_Actor: SwiftEOSActor { public let Handle: EOS_HSanctions? /** Memberwise initializer */ public required init( Handle: EOS_HSanctions? ) { self.Handle = Handle } /** */ deinit { } /** Copies an active player sanction. You must call QueryActivePlayerSanctions first to retrieve the data from the service backend. On success, `EOS_Sanctions_PlayerSanction_Release` must be called on OutSanction to free memory. - Parameter TargetUserId: Product User ID of the user whose active sanctions are to be copied - Parameter SanctionIndex: Index of the sanction to retrieve from the cache - SeeAlso: `EOS_Sanctions_QueryActivePlayerSanctions` - SeeAlso: `EOS_Sanctions_PlayerSanction_Release` - Throws: `EOS_InvalidParameters` if you pass a null pointer for the out parameter `EOS_NotFound` if the player achievement is not found - Returns: The player sanction data for the given index, if it exists and is valid */ public func CopyPlayerSanctionByIndex( TargetUserId: EOS_ProductUserId?, SanctionIndex: Int ) throws -> SwiftEOS_Sanctions_PlayerSanction { try ____CopyPlayerSanctionByIndex(.init( TargetUserId: TargetUserId, SanctionIndex: SanctionIndex )) } /** Fetch the number of player sanctions that have been retrieved for a given player. You must call QueryActivePlayerSanctions first to retrieve the data from the service backend. - Parameter TargetUserId: Product User ID of the user whose sanction count should be returned - SeeAlso: `EOS_Sanctions_QueryActivePlayerSanctions` - SeeAlso: `EOS_Sanctions_CopyPlayerSanctionByIndex` - Returns: Number of available sanctions for this player. */ public func GetPlayerSanctionCount( TargetUserId: EOS_ProductUserId? ) throws -> Int { try ____GetPlayerSanctionCount(.init(TargetUserId: TargetUserId)) } /** Start an asynchronous query to retrieve any active sanctions for a specified user. Call `EOS_Sanctions_GetPlayerSanctionCount` and `EOS_Sanctions_CopyPlayerSanctionByIndex` to retrieve the data. - Parameter TargetUserId: Product User ID of the user whose active sanctions are to be retrieved. - Parameter LocalUserId: The Product User ID of the local user who initiated this request. Dedicated servers should set this to null. - Parameter CompletionDelegate: A callback that is fired when the async operation completes, either successfully or in error - SeeAlso: `EOS_Sanctions_GetPlayerSanctionCount` - SeeAlso: `EOS_Sanctions_CopyPlayerSanctionByIndex` */ public func QueryActivePlayerSanctions( TargetUserId: EOS_ProductUserId?, LocalUserId: EOS_ProductUserId?, CompletionDelegate: @escaping (SwiftEOS_Sanctions_QueryActivePlayerSanctionsCallbackInfo) -> Void ) throws { try ____QueryActivePlayerSanctions( .init( TargetUserId: TargetUserId, LocalUserId: LocalUserId ), CompletionDelegate ) } } extension SwiftEOS_Sanctions_Actor { /** Copies an active player sanction. You must call QueryActivePlayerSanctions first to retrieve the data from the service backend. On success, `EOS_Sanctions_PlayerSanction_Release` must be called on OutSanction to free memory. - Parameter Options: Structure containing the input parameters - SeeAlso: `EOS_Sanctions_QueryActivePlayerSanctions` - SeeAlso: `EOS_Sanctions_PlayerSanction_Release` - Throws: `EOS_InvalidParameters` if you pass a null pointer for the out parameter `EOS_NotFound` if the player achievement is not found - Returns: The player sanction data for the given index, if it exists and is valid */ private func ____CopyPlayerSanctionByIndex( _ Options: SwiftEOS_Sanctions_CopyPlayerSanctionByIndexOptions ) throws -> SwiftEOS_Sanctions_PlayerSanction { try withPointerManager { pointerManager in try throwingNilResult { try withSdkObjectOptionalPointerToOptionalPointerReturnedAsOptionalSwiftObject( managedBy: pointerManager, nest: { OutSanction in try withSdkObjectOptionalPointerFromOptionalSwiftObject(Options, managedBy: pointerManager) { Options in try throwingSdkResult { EOS_Sanctions_CopyPlayerSanctionByIndex( Handle, Options, OutSanction ) } } }, release: EOS_Sanctions_PlayerSanction_Release ) } } } /** Fetch the number of player sanctions that have been retrieved for a given player. You must call QueryActivePlayerSanctions first to retrieve the data from the service backend. - Parameter Options: Structure containing the input parameters - SeeAlso: `EOS_Sanctions_QueryActivePlayerSanctions` - SeeAlso: `EOS_Sanctions_CopyPlayerSanctionByIndex` - Returns: Number of available sanctions for this player. */ private func ____GetPlayerSanctionCount( _ Options: SwiftEOS_Sanctions_GetPlayerSanctionCountOptions ) throws -> Int { try withPointerManager { pointerManager in try returningTransformedResult( nested: { try withSdkObjectOptionalPointerFromOptionalSwiftObject(Options, managedBy: pointerManager) { Options in EOS_Sanctions_GetPlayerSanctionCount( Handle, Options ) } }, transformedResult: { try safeNumericCast(exactly: $0) } ) } } /** Start an asynchronous query to retrieve any active sanctions for a specified user. Call `EOS_Sanctions_GetPlayerSanctionCount` and `EOS_Sanctions_CopyPlayerSanctionByIndex` to retrieve the data. - Parameter Options: Structure containing the input parameters - Parameter CompletionDelegate: A callback that is fired when the async operation completes, either successfully or in error - SeeAlso: `EOS_Sanctions_GetPlayerSanctionCount` - SeeAlso: `EOS_Sanctions_CopyPlayerSanctionByIndex` */ private func ____QueryActivePlayerSanctions( _ Options: SwiftEOS_Sanctions_QueryActivePlayerSanctionsOptions, _ CompletionDelegate: @escaping (SwiftEOS_Sanctions_QueryActivePlayerSanctionsCallbackInfo) -> Void ) throws { try withPointerManager { pointerManager in try withCompletion(completion: CompletionDelegate, managedBy: pointerManager) { ClientData in try withSdkObjectOptionalPointerFromOptionalSwiftObject(Options, managedBy: pointerManager) { Options in EOS_Sanctions_QueryActivePlayerSanctions( Handle, Options, ClientData, { sdkCallbackInfoPointer in SwiftEOS_Sanctions_QueryActivePlayerSanctionsCallbackInfo.sendCompletion(sdkCallbackInfoPointer) } ) } } } } }
[ -1 ]
2326d2bb558e7262f9b0ee74751a6ac23d1aeeb8
703ebe2fb96fd059d7130034e844c7700d7aab92
/Sources/ConnectKit/MonoConfiguration.swift
03b4e0317bb83927d3da77f7d87c459eeb56bbee
[ "MIT" ]
permissive
OyegokeTomisin/connect-ios
0186bce3c2491293b45ad67a8d8099ce90822414
a9ca9fa8398590cb706073a87db3e024b3f6b0d9
refs/heads/master
2023-08-22T01:52:56.396199
2021-08-13T12:11:21
2021-08-13T12:11:21
null
0
0
null
null
null
null
UTF-8
Swift
false
false
1,532
swift
// // MonoConfiguration.swift // // Created by Tristan Tsvetanov on 02021-06-02. // import Foundation public class MonoConfiguration { // required parameters public var publicKey: String public var onSuccess: ((_ authCode: String) -> Void?) // optional parameters public var reference: String? public var onClose: (() -> Void?)? public var onEvent: ((_ event: ConnectEvent) -> Void?)? public var reauthCode: String? public var selectedInstitution: ConnectInstitution? public init(publicKey: String, onSuccess: @escaping ((_ authCode: String) -> Void?), reference: String? = nil, reauthCode: String? = nil, onClose: (() -> Void?)? = nil, onEvent: ((_ event: ConnectEvent) -> Void?)? = nil, selectedInstitution: ConnectInstitution? = nil){ self.publicKey = publicKey self.onSuccess = onSuccess if onClose != nil { self.onClose = onClose! }else{ self.onClose = nil } if onEvent != nil { self.onEvent = onEvent! }else{ self.onEvent = nil } if reference != nil { self.reference = reference }else{ self.reference = nil } if reauthCode != nil { self.reauthCode = reauthCode }else{ self.reauthCode = nil } if selectedInstitution != nil { self.selectedInstitution = selectedInstitution }else{ self.selectedInstitution = nil } } }
[ -1 ]
ff7b0fdfadcea4ea680182c4ce9b695bd61aed31
0fdeb46472f0ef0d9e1072559d6ca87f6d47928f
/Sources/SocksCore/TCPSocket.swift
10a6355426a7965fdca26107716ade1b83677c83
[ "MIT" ]
permissive
Joannis/socks
ea9a43b4ced37adc327d7ab870ddfbad99758a55
7af4a03099b8b2be67c97d7ff2ba4ba2c59106b0
refs/heads/master
2020-06-11T18:57:50.501902
2016-12-09T19:15:25
2016-12-09T19:15:25
75,629,698
0
0
null
2016-12-05T13:56:44
2016-12-05T13:56:44
null
UTF-8
Swift
false
false
7,720
swift
// // Socket+Impl.swift // Socks // // Created by Honza Dvorsky on 3/20/16. // // import Dispatch #if os(Linux) import Glibc private let socket_bind = Glibc.bind private let socket_connect = Glibc.connect private let socket_listen = Glibc.listen private let socket_accept = Glibc.accept private let socket_recv = Glibc.recv private let socket_send = Glibc.send private let socket_close = Glibc.close private let SOCKET_NOSIGNAL = Glibc.MSG_NOSIGNAL #else import Darwin private let socket_connect = Darwin.connect private let socket_bind = Darwin.bind private let socket_listen = Darwin.listen private let socket_accept = Darwin.accept private let socket_recv = Darwin.recv private let socket_send = Darwin.send private let socket_close = Darwin.close private let SOCKET_NOSIGNAL = Darwin.SO_NOSIGPIPE #endif public protocol TCPSocket: RawSocket { } public protocol TCPWriteableSocket: TCPSocket { } public protocol TCPReadableSocket: TCPSocket { } extension TCPReadableSocket { public func recv(maxBytes: Int = BufferCapacity) throws -> [UInt8] { let data = Bytes(capacity: maxBytes) let flags: Int32 = 0 //FIXME: allow setting flags with a Swift enum let receivedBytes = socket_recv(self.descriptor, data.rawBytes, data.capacity, flags) guard receivedBytes > -1 else { throw SocksError(.readFailed) } guard receivedBytes > 0 else { // receiving 0 indicates a proper close .. no error. // attempt a close, no failure possible because throw indicates already closed // if already closed, no issue. // do NOT propogate as error _ = try? self.close() return [] } let finalBytes = data.characters[0..<receivedBytes] let out = Array(finalBytes.map({ UInt8($0) })) return out } public func recvAll() throws -> [UInt8] { var buffer: [UInt8] = [] let chunkSize = 512 while true { let newData = try self.recv(maxBytes: chunkSize) buffer.append(contentsOf: newData) if newData.count < chunkSize { break } } return buffer } } extension TCPWriteableSocket { public func send(data: [UInt8]) throws { let len = data.count let flags = Int32(SOCKET_NOSIGNAL) //FIXME: allow setting flags with a Swift enum let sentLen = socket_send(self.descriptor, data, len, flags) guard sentLen == len else { throw SocksError(.sendFailedToSendAllBytes) } } } public class TCPInternetSocket: InternetSocket, TCPSocket, TCPReadableSocket, TCPWriteableSocket { public let descriptor: Descriptor public let config: SocketConfig public let address: ResolvedInternetAddress public var closed: Bool // the DispatchSource if the socket is being watched for reads private var watchingSource: DispatchSourceRead? public required init(descriptor: Descriptor?, config: SocketConfig, address: ResolvedInternetAddress) throws { if let descriptor = descriptor { self.descriptor = descriptor } else { self.descriptor = try TCPInternetSocket.createNewSocket(config: config) } self.config = config self.address = address self.closed = false try setReuseAddress(true) } public convenience init(address: InternetAddress) throws { var conf: SocketConfig = .TCP(addressFamily: address.addressFamily) let resolved = try address.resolve(with: &conf) try self.init(descriptor: nil, config: conf, address: resolved) } public func connect() throws { let res = socket_connect(self.descriptor, address.raw, address.rawLen) guard res > -1 else { throw SocksError(.connectFailed) } } public func connect(withTimeout timeout: Double?) throws { guard let to = timeout else { try connect() return } //set to nonblocking self.blocking = false //set back to blocking at the end defer { self.blocking = true } //call connect do { try connect() } catch { //only allow error "in progress" guard let err = error as? SocksError, err.number == EINPROGRESS else { throw error } } //wait for writeable socket or timeout let (_, writes, _) = try select(writes: [descriptor], timeout: timeval(seconds: to)) guard !writes.isEmpty else { throw SocksError(.connectTimedOut) } //ensure no error was encountered let err = try self.getErrorCode() guard err == 0 else { throw SocksError(.connectFailedWithSocketErrorCode(err)) } } public func listen(queueLimit: Int32 = 4096) throws { let res = socket_listen(self.descriptor, queueLimit) guard res > -1 else { throw SocksError(.listenFailed) } } public func accept() throws -> TCPInternetSocket { var length = socklen_t(MemoryLayout<sockaddr_storage>.size) let addr = UnsafeMutablePointer<sockaddr_storage>.allocate(capacity: 1) let addrSockAddr = UnsafeMutablePointer<sockaddr>(OpaquePointer(addr)) let clientSocketDescriptor = socket_accept(self.descriptor, addrSockAddr, &length) guard clientSocketDescriptor > -1 else { addr.deallocate(capacity: 1) if errno == SocksError.interruptedSystemCall { return try accept() } throw SocksError(.acceptFailed) } let clientAddress = ResolvedInternetAddress(raw: addr) let clientSocket = try TCPInternetSocket(descriptor: clientSocketDescriptor, config: config, address: clientAddress) return clientSocket } public func close() throws { stopWatching() closed = true if socket_close(self.descriptor) != 0 { throw SocksError(.closeSocketFailed) } } /** Start watching the socket for available data and execute the `handler` on the specified queue if data is ready to be received. */ public func startWatching(on queue:DispatchQueue, handler:@escaping ()->()) throws { if watchingSource != nil { throw SocksError(.generic("Socket is already being watched")) } // dispatch sources only work on non-blocking sockets self.blocking = false // create a read source from the socket's descriptor that will execute the handler on the specified queue if data is ready to be read let newSource = DispatchSource.makeReadSource(fileDescriptor: self.descriptor, queue: queue) newSource.setEventHandler(handler:handler) newSource.resume() // this source needs to be retained as long as the socket lives (or watching will end) watchingSource = newSource } /** Stops watching the socket for available data. */ public func stopWatching() { watchingSource?.cancel() watchingSource = nil } } public class TCPEstablishedSocket: TCPSocket { public let descriptor: Descriptor public init(descriptor: Descriptor) { self.descriptor = descriptor } } public class TCPEstablishedWriteableSocket: TCPEstablishedSocket, TCPWriteableSocket { } public class TCPEstablishedReadableSocket: TCPEstablishedSocket, TCPReadableSocket { }
[ -1 ]
0ad6c299b3649c0b64ae159889487b4a9f8ef5c8
74a000d1c50cc449da3e04e2db7b04c1531c0fc1
/zuixindeleyijingTests/zuixindeleyijingTests.swift
9af8e7c82a1bf867b174611c84f5be7ea1823f6b
[]
no_license
wuchaopang/zuixindeleyijing
a0590b3c73ab0ee3d810c2e2c6e373768fa1d2a6
f64f1f2a4dc51406de28612145e884092d8de995
refs/heads/master
2020-02-26T13:38:00.420498
2016-07-11T08:57:50
2016-07-11T08:57:50
62,847,826
0
0
null
null
null
null
UTF-8
Swift
false
false
1,012
swift
// // zuixindeleyijingTests.swift // zuixindeleyijingTests // // Created by 20141105049 on 16/7/6. // Copyright © 2016年 20141105049. All rights reserved. // import XCTest @testable import zuixindeleyijing class zuixindeleyijingTests: 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.measureBlock { // Put the code you want to measure the time of here. } } }
[ 98333, 278558, 16419, 229413, 204840, 278570, 344107, 155694, 253999, 229424, 229430, 319542, 180280, 213052, 286788, 352326, 311372, 196691, 278615, 237663, 278634, 278638, 319598, 352368, 131191, 237689, 131198, 278655, 311438, 278677, 278685, 311458, 278691, 49316, 278699, 32941, 278704, 278708, 131256, 278714, 295098, 254170, 229597, 311519, 286958, 327929, 278797, 180493, 254226, 278816, 278842, 287041, 287043, 139589, 319813, 319821, 254286, 344401, 278869, 155990, 106847, 246127, 139640, 246136, 246137, 311681, 377264, 278970, 319930, 336317, 278978, 188871, 278989, 278993, 278999, 328152, 369116, 188894, 287198, 279008, 279013, 279018, 311786, 279029, 279032, 279039, 287241, 279050, 303636, 279062, 279065, 180771, 377386, 279094, 352829, 115270, 377418, 295519, 66150, 344680, 279146, 295536, 287346, 287352, 279164, 189057, 311941, 279177, 369289, 344715, 311949, 352917, 230040, 271000, 303771, 221852, 279206, 295590, 287404, 295599, 205487, 303793, 164533, 287417, 303803, 287422, 66242, 287433, 287439, 279252, 295652, 279269, 230125, 312047, 279280, 230134, 205568, 295682, 295697, 336671, 344865, 262951, 279336, 262954, 295724, 312108, 353069, 164656, 303920, 262962, 328499, 353078, 230199, 353079, 336702, 295744, 295746, 353094, 353095, 353109, 230234, 295776, 279392, 303972, 279397, 230248, 246641, 295798, 246648, 279417, 361337, 254850, 287622, 295824, 189348, 279464, 353195, 140204, 353197, 304051, 189374, 353216, 213960, 279498, 304087, 50143, 123881, 320493, 304110, 320494, 287731, 295927, 304122, 312314, 320507, 328700, 328706, 320516, 230410, 320527, 418837, 140310, 197657, 336929, 189474, 345132, 238639, 238651, 238664, 296019, 353367, 156764, 156765, 304222, 230499, 279660, 312434, 353397, 279672, 279685, 222343, 296086, 238743, 296092, 238765, 279728, 238769, 279747, 353479, 353481, 353482, 279760, 189652, 279765, 296153, 279774, 304351, 304356, 279785, 279792, 353523, 279814, 312587, 328971, 173334, 320796, 304421, 279854, 345396, 116026, 222524, 279875, 304456, 230729, 222541, 296270, 238927, 296273, 222559, 230756, 230765, 296303, 279920, 312689, 296307, 116084, 148867, 378244, 296329, 296335, 279974, 279984, 173491, 279989, 361927, 296392, 280010, 370123, 148940, 280013, 312782, 222675, 353750, 280032, 280041, 361963, 296433, 321009, 280055, 288249, 296448, 230913, 230921, 296461, 304656, 329232, 230959, 288309, 288318, 280130, 124485, 288326, 288327, 239198, 157281, 222832, 247416, 337535, 239237, 288392, 239250, 345752, 255649, 321207, 296632, 280251, 280257, 321219, 280267, 9936, 9937, 280278, 280280, 18138, 67292, 321247, 288491, 280300, 239341, 313081, 124669, 288512, 288516, 280327, 280329, 321295, 321302, 116505, 321310, 247590, 280366, 296755, 280372, 321337, 280380, 345919, 280390, 280392, 345929, 304977, 18262, 280410, 370522, 345951, 362337, 345955, 296806, 288619, 288620, 280430, 362352, 313203, 124798, 182144, 305026, 67463, 329622, 124824, 214937, 214938, 354212, 124852, 288697, 214977, 280514, 280519, 214984, 247757, 231375, 280541, 337895, 247785, 296941, 362480, 313339, 313357, 182296, 354343, 354345, 223274, 124975, 346162, 124984, 288833, 288834, 354385, 223316, 280661, 329814, 338007, 354393, 280675, 280677, 313447, 288879, 223350, 280694, 215164, 313469, 215166, 280712, 215178, 346271, 239793, 125109, 182456, 280762, 223419, 379071, 280768, 338119, 280778, 321745, 280795, 338150, 125169, 338164, 125183, 125188, 313608, 125193, 125198, 125203, 125208, 305440, 125217, 125235, 280887, 125240, 280902, 182598, 289110, 272729, 379225, 321894, 280939, 313713, 354676, 199029, 362881, 248194, 395659, 395661, 240016, 190871, 289189, 281037, 281040, 281072, 289304, 182817, 289332, 322120, 281166, 281171, 354911, 436832, 191082, 313966, 281199, 330379, 330387, 330388, 117397, 289434, 338613, 166582, 289462, 314040, 158394, 363211, 289502, 363230, 338662, 346858, 289518, 125684, 199414, 35583, 363263, 322313, 322319, 166676, 207640, 281377, 289576, 281408, 420677, 281427, 281433, 330609, 207732, 240518, 289703, 289727, 363458, 19399, 338899, 248797, 207838, 314342, 289774, 183279, 314355, 240630, 314362, 134150, 322570, 281626, 248872, 322612, 314448, 281697, 314467, 281700, 322663, 207979, 363644, 150657, 248961, 339102, 330913, 306338, 249002, 339130, 290000, 298212, 290022, 330984, 298221, 298228, 216315, 208124, 363771, 388349, 322824, 126237, 339234, 298291, 224586, 372043, 314709, 314720, 281957, 306542, 314739, 290173, 306559, 298374, 314758, 314760, 142729, 388487, 314766, 306579, 224661, 282007, 290207, 314783, 314789, 282022, 282024, 241066, 380357, 306631, 306639, 191981, 306673, 306677, 290300, 290301, 282114, 306692, 306693, 323080, 323087, 282129, 282136, 282141, 282146, 306723, 290358, 282183, 290390, 306776, 282213, 323178, 314998, 175741, 224901, 282245, 282246, 290443, 323217, 282259, 282271, 282273, 323236, 282276, 298661, 290471, 282280, 298667, 306874, 282303, 282312, 306890, 282318, 241361, 282327, 298712, 298720, 12010, 282348, 282355, 323316, 282358, 175873, 323331, 323332, 216839, 282378, 282391, 249626, 282400, 241441, 339745, 257830, 282409, 282417, 200498, 282427, 282434, 307011, 315202, 282438, 307025, 413521, 216918, 307031, 282474, 282480, 241528, 282504, 315273, 315274, 110480, 184208, 282518, 282519, 298909, 118685, 298920, 290746, 298980, 290811, 282633, 241692, 102437, 233517, 282672, 315476, 307289, 200794, 315487, 307299, 315498, 299121, 233589, 233590, 241808, 323729, 233636, 184484, 299174, 233642, 184505, 299198, 299203, 282831, 356576, 176362, 184570, 184575, 282909, 299293, 282913, 233762, 217380, 151847, 282919, 332085, 332089, 315706, 282939, 307517, 241986, 332101, 323916, 348492, 250192, 323920, 348500, 168281, 323935, 242029, 291192, 225670, 291224, 283038, 61857, 61859, 381347, 340398, 299441, 61873, 283064, 61880, 127427, 127428, 291267, 283075, 324039, 176601, 242139, 160225, 242148, 291311, 233978, 291333, 340490, 283153, 291358, 283182, 283184, 234036, 315960, 70209, 348742, 70215, 348749, 111208, 291454, 348806, 152203, 184973, 299699, 299700, 225995, 299746, 234217, 299759, 299770, 234234, 299776, 242433, 291604, 234277, 283430, 152365, 242485, 234294, 160575, 299849, 283467, 201551, 349026, 275303, 177001, 308076, 242541, 209783, 209785, 177019, 291712, 308107, 308112, 234386, 209817, 324506, 324507, 324517, 283558, 349121, 316364, 340955, 340961, 324586, 340974, 316405, 201720, 234500, 324625, 234514, 316437, 201755, 300068, 357414, 300084, 324666, 308287, 21569, 300111, 234577, 341073, 234587, 250981, 300135, 300136, 316520, 316526, 357486, 300146, 300151, 291959, 160891, 341115, 300158, 349316, 349318, 234638, 169104, 177296, 308372, 185493, 119962, 300187, 300188, 234663, 300201, 300202, 283840, 259268, 283847, 62665, 283852, 283853, 357595, 234733, 292085, 234742, 292091, 316669, 234755, 242954, 292107, 251153, 300343, 193859, 300359, 234827, 177484, 251213, 234831, 120148, 357719, 283991, 292195, 333160, 284014, 243056, 111993, 112017, 112018, 234898, 357786, 333220, 316842, 210358, 284089, 292283, 415171, 292292, 300487, 300489, 284107, 366037, 210390, 210391, 210393, 144867, 54765, 251378, 300535, 300536, 300542, 210433, 366083, 316946, 308756, 398869, 308764, 349726, 349741, 169518, 235070, 194110, 349763, 218696, 292425, 243274, 128587, 333388, 333393, 300630, 128599, 235095, 300644, 374372, 317032, 54893, 366203, 235135, 333470, 300714, 218819, 333517, 333520, 333521, 333523, 153319, 284401, 325371, 194303, 194304, 300811, 284429, 366360, 284442, 325404, 325410, 341796, 317232, 325439, 341836, 325457, 284507, 300894, 284512, 284514, 276327, 292712, 325484, 292720, 325492, 300918, 194429, 325503, 333701, 243591, 243597, 325518, 300963, 292771, 333735, 284587, 292782, 243637, 284619, 301008, 153554, 194515, 219101, 292836, 292837, 325619, 333817, 292858, 145435, 292902, 227370, 358456, 309345, 227428, 194666, 284788, 333940, 292992, 194691, 227460, 333955, 235662, 325776, 317587, 284826, 333991, 333992, 284842, 153776, 227513, 301251, 309444, 227548, 301279, 227578, 243962, 309503, 375051, 325905, 325912, 309529, 227616, 211235, 260418, 227654, 6481, 366929, 366930, 6489, 391520, 416104, 285040, 227725, 227726, 293274, 317852, 285090, 375207, 293306, 293310, 317901, 326100, 285150, 342498, 195045, 309744, 301571, 342536, 342553, 375333, 293419, 244269, 236081, 23092, 309830, 301638, 293448, 55881, 244310, 301689, 227990, 342682, 285361, 342706, 293556, 342713, 285371, 285372, 285373, 285374, 154316, 96984, 318173, 285415, 342762, 154359, 228088, 162561, 285444, 285458, 326429, 326433, 318250, 318252, 301871, 285487, 285497, 293693, 318278, 293711, 301918, 293730, 351077, 342887, 400239, 269178, 359298, 113542, 228233, 228234, 56208, 293781, 318364, 310176, 310178, 310182, 293800, 236461, 293806, 130016, 64485, 326635, 203757, 277509, 146448, 277524, 293910, 252980, 359478, 302139, 359495, 277597, 113760, 228458, 15471, 187506, 285814, 285820, 187521, 285828, 302213, 285830, 302216, 228491, 228493, 285838, 162961, 326804, 187544, 302240, 343203, 253099, 367799, 294074, 64700, 228542, 302274, 343234, 367810, 244940, 228563, 310497, 228588, 253167, 302325, 228600, 228609, 245019, 130338, 130343, 351537, 286018, 113987, 294218, 318805, 294243, 163175, 327025, 327031, 294275, 368011, 318864, 318875, 310692, 310701, 286129, 286132, 228795, 302529, 302531, 163268, 310732, 302540, 64975, 327121, 228827, 286172, 310757, 187878, 343542, 343543, 286202, 286205, 302590, 228861, 294400, 228867, 253452, 146964, 286244, 245287, 245292, 286254, 196164, 56902, 228943, 286288, 196187, 343647, 286306, 310889, 138863, 294529, 286343, 229001, 310923, 188048, 229020, 302754, 245412, 40613, 40614, 40615, 229029, 286388, 286391, 319162, 286399, 212685, 212688, 245457, 302802, 286423, 278233, 278234, 294622, 278240, 229088, 212716, 212717, 229113, 286459, 278272, 319233, 311042, 278291, 294678, 286494, 294700, 360252, 188251, 245599, 237408, 302946, 253829, 294809, 294814, 311199, 319392, 294823, 294843, 98239, 163781, 344013, 212946, 294886, 253929, 327661, 311281, 311282 ]