blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
2
625
content_id
stringlengths
40
40
detected_licenses
sequencelengths
0
47
license_type
stringclasses
2 values
repo_name
stringlengths
5
116
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
643 values
visit_date
timestamp[ns]
revision_date
timestamp[ns]
committer_date
timestamp[ns]
github_id
int64
80.4k
689M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
16 values
gha_event_created_at
timestamp[ns]
gha_created_at
timestamp[ns]
gha_language
stringclasses
85 values
src_encoding
stringclasses
7 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
1 class
length_bytes
int64
4
6.44M
extension
stringclasses
17 values
content
stringlengths
4
6.44M
duplicates
sequencelengths
1
9.02k
8af6de4a9ce73f8e4cbde54562814855a6b5ffbd
7712bbd8fb0fd9d008de8dac643d10d3bc7be82c
/iOS/IMUIMessageCollectionView/Views/IMUIMessageCollectionView.swift
7ea8be22ee5ec1a7dcb76c13fe4e6e6f2cc3302d
[ "MIT" ]
permissive
njgaoqing/aurora-imui
bff4898b0a22c4983766066b114fbf7ab8b96516
b0d12d0f23150e55d55ecddd4452653037ac96a8
refs/heads/master
2021-05-04T19:19:28.217580
2017-10-12T06:54:57
2017-10-12T06:54:57
106,656,122
0
1
null
2017-10-12T06:55:09
2017-10-12T06:55:09
null
UTF-8
Swift
false
false
7,955
swift
// // IMUIMessageCollectionView.swift // IMUIChat // // Created by oshumini on 2017/3/2. // Copyright © 2017年 HXHG. All rights reserved. // import UIKit open class IMUIMessageCollectionView: UIView { @IBOutlet var view: UIView! @IBOutlet open weak var messageCollectionView: UICollectionView! var viewCache = IMUIReuseViewCache() var chatDataManager = IMUIChatDataManager() open weak var delegate: IMUIMessageMessageCollectionViewDelegate? open override func awakeFromNib() { super.awakeFromNib() } override init(frame: CGRect) { super.init(frame: frame) let bundle = Bundle.imuiBundle() view = bundle.loadNibNamed("IMUIMessageCollectionView", owner: self, options: nil)?.first as! UIView self.addSubview(view) view.frame = self.bounds self.chatDataManager = IMUIChatDataManager() self.setupMessageCollectionView() } required public init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) let bundle = Bundle.imuiBundle() view = bundle.loadNibNamed("IMUIMessageCollectionView", owner: self, options: nil)?.first as! UIView self.addSubview(view) view.frame = self.bounds self.chatDataManager = IMUIChatDataManager() self.setupMessageCollectionView() } override open func layoutSubviews() { super.layoutSubviews() IMUIMessageCellLayout.cellWidth = self.imui_width self.messageCollectionView.contentInset = UIEdgeInsets(top: 0, left: 0, bottom: 10, right: 0) } func setupMessageCollectionView() { self.messageCollectionView.delegate = self self.messageCollectionView.dataSource = self self.messageCollectionView.register(IMUIBaseMessageCell.self, forCellWithReuseIdentifier: IMUIBaseMessageCell.self.description()) self.messageCollectionView.isScrollEnabled = true } open func register(_ cellClass: AnyClass?, forCellWithReuseIdentifier identifier: String) { self.messageCollectionView.register(cellClass, forCellWithReuseIdentifier: identifier) } open subscript(index: Int) -> IMUIMessageProtocol { return chatDataManager[index] } open subscript(msgId: String) -> IMUIMessageProtocol? { return chatDataManager[msgId] } open var messageCount: Int { return chatDataManager.count } open func scrollToBottom(with animated: Bool) { if chatDataManager.count == 0 { return } let endIndex = IndexPath(item: chatDataManager.endIndex - 1, section: 0) self.messageCollectionView.scrollToItem(at: endIndex, at: .bottom, animated: animated) } open func appendMessage(with message: IMUIMessageProtocol) { self.chatDataManager.appendMessage(with: message) self.messageCollectionView.reloadData() self.scrollToBottom(with: true) } open func insertMessage(with message: IMUIMessageProtocol) { self.chatDataManager.insertMessage(with: message) self.messageCollectionView.reloadDataNoScroll() } open func insertMessages(with messages:[IMUIMessageProtocol]) { self.chatDataManager.insertMessages(with: messages) self.messageCollectionView.reloadDataNoScroll() } open func updateMessage(with message:IMUIMessageProtocol) { self.chatDataManager.updateMessage(with: message) if let index = chatDataManager.index(of: message) { let indexPath = IndexPath(item: index, section: 0) self.messageCollectionView.reloadItems(at: [indexPath]) } } open func removeMessage(with messageId: String) { self.chatDataManager.removeMessage(with: messageId) self.messageCollectionView.reloadDataNoScroll() } } // MARK: - UICollectionViewDelegate, UICollectionViewDataSource extension IMUIMessageCollectionView: UICollectionViewDelegate, UICollectionViewDataSource { public func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return self.chatDataManager.count } public func numberOfSections(in collectionView: UICollectionView) -> Int { collectionView.collectionViewLayout.invalidateLayout() return 1 } func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: IndexPath) -> CGSize { let height = self.delegate?.messageCollectionView?(messageCollectionView: collectionView, heightForItemAtIndexPath: indexPath, messageModel: chatDataManager[indexPath.item]) if let _ = height { return CGSize(width: messageCollectionView.imui_width, height: CGFloat(height!.floatValue)) } let messageModel = chatDataManager[indexPath.item] if messageModel is IMUIMessageModelProtocol { let message = messageModel as! IMUIMessageModelProtocol return CGSize(width: messageCollectionView.imui_width, height: message.layout.cellHeight) } return CGSize.zero } func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForFooterInSection section: Int) -> CGSize { return CGSize.zero } public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { var cellIdentify = "" let messageModel = self.chatDataManager[indexPath.item] cellIdentify = IMUIBaseMessageCell.self.description() let customCell = self.delegate?.messageCollectionView?(messageCollectionView: collectionView, forItemAt: indexPath, messageModel: messageModel) if let _ = customCell { return customCell! } let cell: IMUIMessageCellProtocol = collectionView.dequeueReusableCell(withReuseIdentifier: cellIdentify, for: indexPath) as! IMUIMessageCellProtocol cell.presentCell(with: messageModel as! IMUIMessageModelProtocol, viewCache: viewCache, delegate: delegate) self.delegate?.messageCollectionView?(collectionView, willDisplayMessageCell: cell as! UICollectionViewCell, forItemAt: indexPath, model: messageModel) return cell as! UICollectionViewCell } public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { let messageModel = self.chatDataManager[indexPath.item] self.delegate?.messageCollectionView?(collectionView, forItemAt: indexPath, model: messageModel) } public func collectionView(_ collectionView: UICollectionView, didEndDisplaying: UICollectionViewCell, forItemAt: IndexPath) { if forItemAt.item >= self.chatDataManager.count { return } let messageModel = self.chatDataManager[forItemAt.item] if messageModel.self is IMUIMessageModelProtocol.Type { (didEndDisplaying as! IMUIMessageCellProtocol).didDisAppearCell() self.delegate?.messageCollectionView?(collectionView, didEndDisplaying: didEndDisplaying, forItemAt: forItemAt, model: messageModel) } } } extension IMUIMessageCollectionView: UIScrollViewDelegate { public func scrollViewWillBeginDragging(_ scrollView: UIScrollView) { self.delegate?.messageCollectionView?(self.messageCollectionView) } } public extension UICollectionView { func reloadDataNoScroll() { var currentOffset = self.contentOffset let contentSizeBeforeInsert = self.collectionViewLayout.collectionViewContentSize self.reloadData(); let contentSizeAfterInsert = self.collectionViewLayout.collectionViewContentSize let deltaHeight = contentSizeAfterInsert.height - contentSizeBeforeInsert.height currentOffset.y += (deltaHeight > 0 ? deltaHeight : 0) print("the currentOffset\(currentOffset.y)") print("the currentOffset\(currentOffset)") self.setContentOffset(currentOffset, animated: false) } }
[ -1 ]
5502ea592c3ab4e01e64b56c2c6f70acd650655e
06c67b981ece655d5bf3de17e3c1a204ec17f588
/HelloDemo/HelloDemo/ViewController.swift
025343893925d012a206d2a93554eca2606c2784
[]
no_license
duoshankui/MyTest
acb6a0bb7e82e52a87e668c3e14d896304a81656
933f1ca905a7af41c2c0562cfa7bc18243142943
refs/heads/master
2023-03-07T03:30:50.789088
2020-09-21T08:43:39
2020-09-21T08:43:39
156,071,837
2
0
null
2019-02-21T07:34:45
2018-11-04T10:43:49
Swift
UTF-8
Swift
false
false
1,212
swift
// // ViewController.swift // HelloDemo // // Created by DoubleK on 2018/11/4. // Copyright © 2018 DoubleK. All rights reserved. // import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. let demo = demoView() view.addSubview(demo) let btn = UIButton.init(frame: CGRect.init(x: 100, y: 100, width: 100, height: 100)) btn.addTarget(self, action:#selector(btnAction), for: .touchUpInside) btn.backgroundColor = UIColor.red btn.layer.cornerRadius = 10.0 btn.layer.masksToBounds = true view.addSubview(btn) } @objc func btnAction() -> Void { let vc = ViewController() present(vc, animated: true, completion: nil) } //git rebase(变基)练习 func testRebase() { print("git rebase 练习") } //合并分支练习 func mergerBranch() { print("何必分支dev-1到develop") } func testMethod() { print("test Method") } func testRevertMethod() { print("test revert ") } }
[ -1 ]
576ccf2a338973625da1d21812f7e3de4b47f7db
f764804f97b53a52afd6ed9d564498732f96ff50
/MercadoPagoSDK/MercadoPagoSDK/PaymentMethodSelectedTableViewCell.swift
d3b5b8dbc9e3d364f28d1b432c467cfbc1796c51
[ "MIT" ]
permissive
AdamBCo/px-ios
d89147d2816d424af18fc650312dc30a5e6daa0d
adaf3af585b3b720ee1613ab0552da76bd65545d
refs/heads/master
2021-08-19T10:03:54.887543
2017-11-25T19:00:48
2017-11-25T19:00:48
112,011,522
0
0
null
2017-11-25T14:53:32
2017-11-25T14:53:32
null
UTF-8
Swift
false
false
7,663
swift
// // PaymentMethodSelectedTableViewCell.swift // MercadoPagoSDK // // Created by Maria cristina rodriguez on 12/5/16. // Copyright © 2016 MercadoPago. All rights reserved. // import UIKit class PaymentMethodSelectedTableViewCell: UITableViewCell { static let DEFAULT_ROW_HEIGHT = CGFloat(280) @IBOutlet weak var paymentMethodIcon: UIImageView! @IBOutlet weak var paymentDescription: MPLabel! @IBOutlet weak var paymentMethodDescription: MPLabel! @IBOutlet weak var selectOtherPaymentMethodButton: MPButton! @IBOutlet weak var CFT: UILabel! @IBOutlet weak var noRateLabel: MPLabel! @IBOutlet weak var changePaymentMethodCFTConstraint: NSLayoutConstraint! @IBOutlet weak var totalAmountLabel: MPLabel! override func awakeFromNib() { super.awakeFromNib() self.contentView.backgroundColor = UIColor.px_grayBackgroundColor() self.noRateLabel.text = "" self.noRateLabel.font = Utils.getFont(size: self.noRateLabel.font.pointSize) self.totalAmountLabel.attributedText = NSAttributedString(string : "") } override func setSelected(_ selected: Bool, animated: Bool) { super.setSelected(selected, animated: animated) } func fillCell(paymentData: PaymentData, amount: Double, reviewScreenPreference: ReviewScreenPreference = ReviewScreenPreference()) { fillIcon() fillPayerCostAndTotal(paymentData: paymentData, amount: amount) fillPaymentMethodDescription(paymentData: paymentData) fillCFT(payerCost: paymentData.getPayerCost()) fillChangePaymentMethodButton(reviewScreenPreference: reviewScreenPreference) fillSeparatorLine(payerCost: paymentData.getPayerCost(), reviewScreenPreference: reviewScreenPreference) } func fillIcon() { self.paymentMethodIcon.image = MercadoPago.getImage("MPSDK_review_iconoTarjeta") } func fillPaymentMethodDescription(paymentData: PaymentData) { let paymentMethodDescription = NSMutableAttributedString(string: paymentData.getPaymentMethod()!.name.localized, attributes: [NSAttributedStringKey.font: Utils.getFont(size: self.noRateLabel.font.pointSize)]) if !String.isNullOrEmpty(paymentData.getToken()?.lastFourDigits) { paymentMethodDescription.append(NSAttributedString(string : " terminada en ".localized + (paymentData.getToken()?.lastFourDigits)!, attributes: [NSAttributedStringKey.font: Utils.getFont(size: self.noRateLabel.font.pointSize)])) } self.paymentMethodDescription.attributedText = paymentMethodDescription } func fillPayerCostAndTotal(paymentData: PaymentData, amount: Double) { let currency = MercadoPagoContext.getCurrency() if let payerCost = paymentData.getPayerCost() { self.paymentDescription.attributedText = Utils.getTransactionInstallmentsDescription(String(payerCost.installments), currency:currency, installmentAmount: payerCost.installmentAmount, additionalString: NSAttributedString(string : ""), color: UIColor.black, fontSize : 24, centsFontSize: 12, baselineOffset: 9) let attributedAmount = Utils.getAttributedAmount(amount, currency: currency, color : UIColor.px_grayBaseText(), fontSize : 16, baselineOffset : 4) if payerCost.installments > 1 { let attributedAmountFinal = NSMutableAttributedString(string : "(") attributedAmountFinal.append(attributedAmount) attributedAmountFinal.append(NSAttributedString(string : ")")) self.totalAmountLabel.attributedText = attributedAmountFinal self.totalAmountLabel.attributedText = attributedAmountFinal } } else { self.paymentDescription.attributedText = Utils.getAttributedAmount(amount, thousandSeparator: currency.thousandsSeparator, decimalSeparator: currency.decimalSeparator, currencySymbol: currency.symbol, color: UIColor.black, fontSize: 24, centsFontSize: 12, baselineOffset: 9) self.totalAmountLabel.text = "" } self.noRateLabel.attributedText = NSAttributedString(string : "") if showBankInterestWarning(paymentData: paymentData) { self.noRateLabel.attributedText = NSAttributedString(string : "No incluye intereses bancarios".localized) self.noRateLabel.textColor = self.totalAmountLabel.textColor self.noRateLabel.font = Utils.getFont(size: self.totalAmountLabel.font.pointSize) } if showPayerCostDescription(paymentData: paymentData) { self.noRateLabel.attributedText = NSAttributedString(string : "Sin interés".localized) } } func showBankInterestWarning(paymentData: PaymentData) -> Bool { return paymentData.hasPayerCost() && MercadoPagoCheckout.showBankInterestWarning() } func showPayerCostDescription(paymentData: PaymentData) -> Bool { return paymentData.hasPayerCost() && !paymentData.getPayerCost()!.hasInstallmentsRate() && paymentData.getPayerCost()!.installments != 1 && !showBankInterestWarning(paymentData: paymentData) } func fillChangePaymentMethodButton(reviewScreenPreference: ReviewScreenPreference) { if reviewScreenPreference.isChangeMethodOptionEnabled() { self.selectOtherPaymentMethodButton.setTitle("Cambiar medio de pago".localized, for: .normal) self.selectOtherPaymentMethodButton.titleLabel?.font = Utils.getFont(size: self.noRateLabel.font.pointSize) self.selectOtherPaymentMethodButton.setTitleColor(UIColor.primaryColor(), for: UIControlState.normal) } else { self.selectOtherPaymentMethodButton.isHidden = true } } func fillSeparatorLine(payerCost: PayerCost? = nil, reviewScreenPreference: ReviewScreenPreference = ReviewScreenPreference()) { let separatorLine = ViewUtils.getTableCellSeparatorLineView(0, y: PaymentMethodSelectedTableViewCell.getCellHeight(payerCost: payerCost, reviewScreenPreference: reviewScreenPreference) - 1, width: UIScreen.main.bounds.width, height: 1) self.addSubview(separatorLine) } func fillCFT(payerCost: PayerCost? = nil) { CFT.font = Utils.getLightFont(size: CFT.font.pointSize) CFT.textColor = UIColor.px_grayDark() if needsDisplayAdditionalCost(payerCost: payerCost) { CFT.text = "CFT " + (payerCost?.getCFTValue())! } else { CFT.text = "" self.changePaymentMethodCFTConstraint.constant = 10 } } func needsDisplayAdditionalCost(payerCost: PayerCost? = nil) -> Bool { return needsDisplayCFT(payerCost : payerCost) } func needsDisplayCFT(payerCost: PayerCost? = nil) -> Bool { guard let payerCost = payerCost else { return false } if payerCost.getCFTValue() != nil && payerCost.installments != 1 { return true } return false } public static func getCellHeight(payerCost: PayerCost? = nil, reviewScreenPreference: ReviewScreenPreference = ReviewScreenPreference()) -> CGFloat { var cellHeight = DEFAULT_ROW_HEIGHT if payerCost != nil && payerCost?.installments == 1 { cellHeight -= 30 } if payerCost != nil && !payerCost!.hasInstallmentsRate() && payerCost?.installments != 1 { cellHeight += 20 } if reviewScreenPreference.isChangeMethodOptionEnabled() { cellHeight += 58 } if payerCost?.installments != 1, let _ = payerCost?.getCFTValue() { cellHeight += 50 } return cellHeight } }
[ -1 ]
d32713f1211738edc6629e440b6bbe4d868b1431
c119bb604de9d0c9ab617931a35f6bd8dc5212dc
/Example/SampleComponent/Apple - Working with UI Controls/Supporting Views/CircleImage.swift
d93991a4e1d0c9910b8c1bbc442d7bdb4d5cbfdc
[ "Apache-2.0", "MIT" ]
permissive
playbook-ui/playbook-ios
c3008c9646740b6e6344e1a7e60f28265ada52bd
3320069508e677858a5dbfac72622b885f3b351e
refs/heads/master
2023-06-07T03:18:45.795504
2023-02-17T05:34:36
2023-02-17T05:34:36
243,712,144
1,060
65
Apache-2.0
2023-08-16T09:03:31
2020-02-28T08:18:52
Swift
UTF-8
Swift
false
false
629
swift
/* See LICENSE folder for this sample’s licensing information. Abstract: A view that clips an image to a circle and adds a stroke and shadow. */ import SwiftUI public struct CircleImage: View { public var image: Image public var body: some View { image .clipShape(Circle()) .overlay(Circle().stroke(Color.white, lineWidth: 4)) .shadow(radius: 10) } public init(image: Image) { self.image = image } } internal struct CircleImage_Previews: PreviewProvider { static var previews: some View { CircleImage(image: Image("turtlerock")) } }
[ -1 ]
b84e5886baa06a35a217315cd29517d22cd81240
c57569ea54196e04cb57c17f8515f33a4bc013b3
/GeekBrains_VKClient-lesson2_7/VKClient/Managers/RealmManager 2.swift
18c872663d6b42e0fe3e51336ab5a50f8519475f
[]
no_license
Arhiv32/Swift-Servic
9b69ea14087396b11125f7d924e69b0ae6c6783d
0224648e85c64e31d1d29e67a44892a38979810b
refs/heads/honework2.3
2023-03-04T06:07:37.218692
2020-12-09T20:26:04
2020-12-09T20:26:04
300,519,730
0
0
null
2020-12-09T20:54:20
2020-10-02T06:17:36
Swift
UTF-8
Swift
false
false
1,269
swift
// // RealmManager.swift // VKClient // // Created by Федор Филимонов on 27.08.2020. // Copyright © 2020 fedorfilimonov. All rights reserved. // import RealmSwift class RealmManager { static let shared = RealmManager() private init?() { let configuration = Realm.Configuration(schemaVersion: 1, deleteRealmIfMigrationNeeded: true) guard let realm = try? Realm(configuration: configuration) else { return nil } self.realm = realm print("Realm database file path:") print(realm.configuration.fileURL ?? "") } private let realm: Realm // MARK: - Major methods func add<T: Object>(object: T) throws { try realm.write { realm.add(object, update: .all) } } func add<T: Object>(objects: [T]) throws { try realm.write { realm.add(objects, update: .all) } } func getObjects<T: Object>() -> Results<T> { return realm.objects(T.self) } func delete<T: Object>(object: T) throws { try realm.write { realm.delete(object) } } func deleteAll() throws { try realm.write { realm.deleteAll() } } }
[ -1 ]
618615610411f433a31d9dd84a033b5c53fba4ff
a64ce349ed4b10e97bf23d782092cc673f628cd1
/Sources/AnalystPresenter/GaugeConfiguration+Percentage.swift
d90b8c312c6d3392ca387803ff045cc577cdbf8c
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
Apodini/Analyst
eaf935cb7837c0bcdb630f0490c85c59a30db96d
66119f3f12971d0d609f4acaba8751ba8f62c04a
refs/heads/develop
2023-04-16T14:28:59.123673
2021-12-03T22:09:23
2021-12-03T22:09:23
377,774,866
0
0
MIT
2021-12-05T15:33:50
2021-06-17T09:26:13
Swift
UTF-8
Swift
false
false
300
swift
public struct PercentageGaugeConfiguration: GaugeConfiguration { public init() {} public var range: ClosedRange<Double> { 0...1 } public func content(for value: Double) -> some View { Text(.static(Int(value * 100).description + " %")) .padding(4) } }
[ -1 ]
246ea9b3b8a06e7b28b36dab1c52ef6ee44724d2
b00143abe608695c6bf386a7cf632e33f36c2a62
/BMI Calculator.playground/Contents.swift
ae8add90fa07f38eb05b692ad74174af296e45f7
[]
no_license
nancySoprano/Swift-Playground
b1618f8565dff4ca0bdfaf74324a7eb8b330ccf9
ca1d93cd73a861c1fc9a7ec11b6c956102700558
refs/heads/master
2020-04-15T10:31:56.138224
2019-04-07T16:40:53
2019-04-07T16:40:53
164,600,349
0
0
null
null
null
null
UTF-8
Swift
false
false
521
swift
import UIKit func BMI (height : Float, weight : Float) -> String { <<<<<<< HEAD let BMI = weight / pow(height,2) ======= let BMI = weight / (height * height) >>>>>>> 58dfffcebaf75ed990e93f2a9045e1925b6ca31a if BMI > 25 { return "You are overweight. Your BMI is \(BMI)" } else if BMI >= 18.5 && BMI <= 25 { return "Your weight is normal. Your BMI is \(BMI)" } else { return "You are underweight. Your BMI is \(BMI)" } } print (BMI (height: 1.7, weight: 70))
[ -1 ]
a0485967a73f7628ace5d083a056a0e57091729d
8b9eb600e4a1a2fee7127c3dadd0f1c7b45bd714
/0728_ServerJSON02/0728_ServerJSON02/JsonModel.swift
062e5adc848886b5a5d594752f336e6ee1e86b3a
[]
no_license
delight010/Swift_study
ac4d60eaf07212b13dff0f0ff1905b8e141ed8b1
3f857a8d9eeaf9c0fff96a26e403d0f4755ffdc7
refs/heads/main
2023-06-29T16:25:18.635346
2021-07-30T03:46:43
2021-07-30T03:46:43
385,923,809
0
0
null
null
null
null
UTF-8
Swift
false
false
3,302
swift
// // JsonModel.swift // 0728_ServerJSON02 // // Created by Seong A Oh on 2021/07/28. // import Foundation // Json Data를 넘겨주기 위한 Protocol protocol JsonModelProtocol: class { func itemDownloaded(items: NSArray) // 배열 생성, NSArray는 한번 생성되면 값을 바꿀 수 없음 // 함수 이름만 존재, 기능은 TableViewController.swift에서 } class JsonModel: NSObject { var delegate: JsonModelProtocol! // Protocol let urlPath = "http://192.168.200.180:8080/ios/student.json" // file 경로 지정 // async func downloadItems() { let url: URL = URL(string: urlPath)! // Session과 URL 연결 let defaultSession = URLSession(configuration: URLSessionConfiguration.default) // Task를 정의, Json의 전체를 가져오기 위함, let task = defaultSession.dataTask(with: url){(data, response, error) in if error != nil { print("Failed to download data") }else { print("Data is downloaded") self.parseJSON(data!) // parseJSON에 data를 넣어줌 } } task.resume() // task 실행 } func parseJSON(_ data: Data) { var jsonResult = NSArray() // json 데이터를 저장할 배열, 여러가지 자료형을 쓰기 위해 NSArray를 씀 do { // Json에서 Data를 불러옴 -> NSArray로 변환 // jsonResult에선 json의 {} 의 값을 Data 1개로 취급한다 jsonResult = try JSONSerialization.jsonObject(with: data, options: JSONSerialization.ReadingOptions.allowFragments) as! NSArray } catch let error as NSError { print(error) } var jsonElement = NSDictionary() // (Key, Value) 값으로 저장하기 위한 Dictionary let locations = NSMutableArray() // ArrayList와 같음, 데이터 삽입&수정&삭제가 가능하도록 NSMutableArray로 설정 for i in 0..<jsonResult.count{ // json의 {} 의 값을 Data 1개로 취급한다 jsonElement = jsonResult[i] as! NSDictionary // jsonResult를 NSDictionary로 변환 :: (Key, Value) 값으로 구성하기 위하여 if let scode = jsonElement["code"] as? String, // json의 "code"의 값을 불러옴, "code" : "S001" let sname = jsonElement["name"] as? String, let sdept = jsonElement["dept"] as? String, let sphone = jsonElement["phone"] as? String{ // let 변수 scode, sname, sdept, sphone이 이상이 없으면 // DBModel 생성자를 통하여 Data를 query 변수에 넣어줌 let query = DBModel(scode: scode, sname: sname, sdept: sdept, sphone: sphone) locations.add(query) // NSMutableArray(locations)에 Data를 넣어줌 } } DispatchQueue.main.async(execute: {() -> Void in // item 다운로드 시, 위의 코드를 실행 // locations와 async, 12행 참고, async는 다중 작업을 가능하게 함 // TableViewController 실행 시, JsomModel.swift도 같이 실행되게끔 함 self.delegate.itemDownloaded(items: locations) // 딕셔너리와 연결 }) } }
[ -1 ]
56a228cfe0698d5a0593c02ab9214949d34330fb
b03f6cfc4a3b15749978a3279660c6e3d5ab151f
/GraphWithMacawDemo/AppDelegate.swift
f6532810551f07b6f8e5daac0a808bf0dc93039b
[]
no_license
Ibraheemraw/GraphWithMacawDemo
a82d293bcfda0d6f8a285d1ce154ec4df6c148bb
ee2318386fed3f9290442b9e26b1ca8276658312
refs/heads/master
2022-04-21T02:05:03.702083
2020-04-21T14:18:43
2020-04-21T14:18:43
257,619,483
0
0
null
null
null
null
UTF-8
Swift
false
false
1,439
swift
// // AppDelegate.swift // GraphWithMacawDemo // // Created by Ibraheem rawlinson on 3/23/20. // Copyright © 2020 Ibraheem rawlinson. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } // MARK: UISceneSession Lifecycle func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { // Called when a new scene session is being created. // Use this method to select a configuration to create the new scene with. return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) } func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) { // Called when the user discards a scene session. // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. // Use this method to release any resources that were specific to the discarded scenes, as they will not return. } }
[ 393222, 393224, 393230, 393250, 344102, 393261, 393266, 163891, 213048, 376889, 385081, 393275, 376905, 327756, 254030, 286800, 368727, 180313, 368735, 180320, 376931, 286831, 286844, 262283, 286879, 286888, 377012, 327871, 180416, 377036, 180431, 377046, 377060, 327914, 205036, 393456, 393460, 418043, 336123, 336128, 385280, 262404, 180490, 368911, 262416, 262422, 377117, 262436, 336180, 262454, 262472, 344403, 213332, 65880, 418144, 213352, 246123, 262510, 213372, 385419, 262550, 262552, 385440, 385443, 385451, 262573, 393647, 385458, 262586, 344511, 262592, 360916, 369118, 328177, 328179, 328182, 328189, 328192, 164361, 328206, 410128, 393747, 254490, 188958, 385570, 33316, 197159, 377383, 352821, 188987, 418363, 369223, 385609, 352856, 352864, 369253, 262760, 352874, 352887, 254587, 377472, 148105, 377484, 352918, 98968, 344744, 361129, 336555, 385713, 434867, 164534, 336567, 164538, 328378, 328386, 352968, 344776, 352971, 418507, 385742, 385748, 361179, 189153, 369381, 418553, 344831, 336643, 344841, 361230, 336659, 418580, 418585, 434970, 369435, 418589, 418593, 336675, 328484, 418598, 418605, 361273, 328515, 336708, 328519, 336711, 328522, 336714, 426841, 254812, 361309, 197468, 361315, 361322, 328573, 377729, 369542, 222128, 345035, 345043, 386003, 386011, 386018, 386022, 435187, 328702, 328714, 361489, 386069, 336921, 386073, 336925, 345118, 377887, 345133, 345138, 386101, 361536, 197707, 189520, 345169, 156761, 361567, 148578, 345199, 386167, 361593, 410745, 214149, 345222, 386186, 337047, 345246, 214175, 337071, 337075, 386258, 328924, 66782, 222437, 328941, 386285, 386291, 345376, 353570, 345379, 410917, 345382, 337205, 345399, 378169, 369978, 337222, 337234, 263508, 345448, 271730, 378227, 271745, 181638, 353673, 181643, 181649, 181654, 230809, 181670, 181673, 181681, 337329, 181684, 181690, 361917, 181696, 337349, 181703, 337365, 271839, 329191, 361960, 329194, 116210, 337398, 337415, 329226, 419339, 419343, 419349, 345625, 419355, 370205, 419359, 394786, 419362, 370213, 419368, 419376, 206395, 214593, 419400, 419402, 353867, 419406, 214610, 419410, 345701, 394853, 222830, 370297, 403075, 198280, 345736, 345749, 345757, 345762, 419491, 345765, 419497, 419501, 370350, 419506, 419509, 419512, 337592, 337599, 419527, 419530, 419535, 272081, 419542, 394966, 419544, 181977, 419547, 419550, 419559, 337642, 419563, 337645, 337659, 141051, 337668, 362247, 395021, 362255, 321299, 116509, 345887, 378663, 345905, 354106, 354111, 247617, 354117, 370503, 329544, 370509, 354130, 247637, 337750, 370519, 313180, 354142, 345967, 345970, 345974, 403320, 354172, 247691, 337808, 247700, 329623, 436126, 436132, 337833, 362413, 337844, 346057, 247759, 346063, 329697, 354277, 190439, 247789, 354313, 346139, 436289, 378954, 395339, 338004, 100453, 329832, 329855, 329867, 329885, 411805, 346272, 362660, 100524, 387249, 379066, 387260, 256191, 346316, 411861, 411864, 411868, 411873, 379107, 411876, 387301, 346343, 338152, 387306, 387312, 346355, 436473, 321786, 379134, 411903, 379152, 387349, 338199, 387352, 182558, 338211, 395566, 248111, 362822, 436555, 190796, 321879, 354673, 321910, 248186, 420236, 379278, 354727, 338352, 330189, 338381, 338386, 338403, 338409, 248308, 199164, 330252, 199186, 330267, 354855, 10828, 199249, 174695, 248425, 191084, 338543, 191092, 346742, 330383, 150183, 174774, 248504, 174777, 223934, 273108, 355028, 264918, 183005, 256734, 338660, 338664, 264941, 363251, 207619, 264964, 338700, 256786, 199452, 363293, 396066, 346916, 215853, 355122, 355131, 355140, 355143, 338763, 355150, 330580, 355166, 265055, 355175, 387944, 355179, 330610, 330642, 355218, 412599, 207808, 379848, 330710, 248792, 248798, 347105, 257008, 183282, 265207, 330748, 330760, 330768, 248862, 396328, 158761, 199728, 330800, 339001, 388154, 388161, 347205, 248904, 330826, 248914, 339036, 257120, 248951, 420984, 330889, 347287, 248985, 339097, 44197, 380070, 339112, 249014, 126144, 330958, 330965, 265432, 388319, 388347, 175375, 159005, 175396, 208166, 273708, 372015, 347441, 372018, 199988, 175415, 396600, 437566, 175423, 437570, 437575, 437583, 331088, 437587, 331093, 396633, 175450, 437595, 175457, 208227, 175460, 175463, 265580, 437620, 175477, 249208, 175483, 175486, 249214, 175489, 249218, 249227, 249234, 175513, 175516, 396705, 175522, 355748, 380332, 396722, 372163, 216517, 380360, 216522, 339404, 372176, 208337, 339412, 413141, 339417, 249308, 339420, 339424, 339428, 339434, 249328, 69113, 372228, 208398, 380432, 175635, 339503, 265778, 265795, 396872, 265805, 224853, 224857, 257633, 224870, 372327, 257646, 372337, 224884, 224887, 224890, 224894, 224897, 372353, 216707, 126596, 339588, 421508, 224904, 224909, 11918, 159374, 224913, 126610, 339601, 224916, 224919, 126616, 224922, 208538, 224926, 224929, 224932, 224936, 257704, 224942, 257712, 224947, 257716, 257720, 224953, 257724, 224959, 257732, 224965, 224969, 339662, 224975, 257747, 224981, 224986, 257761, 224993, 257764, 224999, 339695, 225012, 257787, 225020, 339710, 257790, 225025, 257794, 339721, 257801, 257804, 225038, 257807, 225043, 372499, 167700, 225048, 257819, 225053, 184094, 225058, 339747, 339749, 257833, 225066, 257836, 413484, 225070, 225073, 372532, 257845, 225079, 397112, 225082, 397115, 225087, 225092, 225096, 323402, 257868, 225103, 257871, 397139, 225108, 225112, 257883, 257886, 225119, 257890, 339814, 225127, 257896, 274280, 257901, 225137, 339826, 257908, 225141, 257912, 257916, 225148, 257920, 225155, 339844, 225165, 225170, 380822, 225175, 225180, 118691, 184244, 372664, 372702, 372706, 356335, 380918, 405533, 430129, 217157, 421960, 356439, 430180, 421990, 356466, 266362, 381068, 225423, 250002, 250004, 225429, 356506, 225437, 135327, 225441, 438433, 225444, 438436, 225447, 438440, 258222, 225455, 430256, 225458, 225461, 225466, 389307, 225470, 381120, 372929, 430274, 225475, 389320, 225484, 225487, 225490, 225493, 225496, 225499, 225502, 225505, 356578, 225510, 217318, 225514, 225518, 372976, 381176, 389380, 356637, 356640, 356643, 356646, 356649, 356655, 332080, 340275, 356660, 397622, 332090, 225597, 332097, 201028, 348488, 332106, 332117, 250199, 250202, 332125, 250210, 348525, 332152, 389502, 250238, 332161, 332172, 373145, 340379, 389550, 324030, 340451, 160234, 127471, 340472, 324094, 266754, 324099, 324102, 324111, 340500, 324117, 324131, 332324, 381481, 324139, 356907, 324142, 356916, 324149, 324155, 348733, 324160, 324164, 356934, 348743, 381512, 324170, 324173, 324176, 389723, 332380, 381545, 340627, 184982, 373398, 258721, 332453, 332459, 389805, 332463, 381617, 332471, 332483, 332486, 332493, 357069, 357073, 332511, 332520, 340718, 332533, 348924, 389892, 389926, 152370, 348978, 340789, 348982, 398139, 127814, 357206, 389978, 430939, 357211, 357214, 201579, 201582, 349040, 340849, 201588, 430965, 324472, 398201, 119674, 340858, 324475, 430972, 340861, 324478, 324481, 373634, 398211, 324484, 324487, 381833, 324492, 324495, 324498, 430995, 324501, 324510, 422816, 324513, 201637, 398245, 324524, 340909, 324533, 5046, 324538, 324541, 398279, 340939, 340941, 340957, 431072, 398306, 340963, 209895, 201711, 349172, 349180, 439294, 431106, 209943, 250914, 357410, 185380, 357418, 209965, 209968, 209971, 209975, 209979, 209987, 209990, 341071, 349267, 250967, 210010, 341091, 210025, 210027, 210030, 210039, 341113, 349308, 210044, 349311, 152703, 160895, 210052, 349319, 210055, 210067, 210071, 210077, 210080, 251044, 210084, 185511, 210088, 210095, 210098, 210107, 210115, 332997, 333009, 210131, 333014, 210138, 218354, 218360, 251128, 275706, 275712, 275715, 275721, 349459, 333078, 251160, 349484, 349491, 251189, 415033, 251210, 357708, 210260, 365911, 259421, 365921, 333154, 251235, 374117, 333162, 234866, 390516, 333175, 357755, 251271, 136590, 112020, 349590, 357792, 259515, 415166, 415185, 366034, 366038, 423392, 333284, 366056, 210420, 423423, 366117, 144939, 210487, 349761, 415300, 333386, 333399, 366172, 333413, 423528, 423532, 210544, 415353, 333439, 415361, 267909, 333498, 210631, 333511, 358099, 333534, 366307, 366311, 431851, 366318, 210672, 366321, 366325, 210695, 210698, 366348, 210706, 399128, 333594, 210719, 358191, 366387, 399159, 358200, 325440, 366401, 341829, 325446, 46920, 341834, 341838, 341843, 415573, 358234, 341851, 350045, 399199, 259938, 399206, 268143, 358255, 399215, 358259, 341876, 333689, 243579, 325504, 333698, 333708, 333724, 382890, 350146, 358339, 333774, 358371, 350189, 350193, 333818, 350202, 350206, 350213, 268298, 350224, 350231, 333850, 350237, 350240, 350244, 350248, 178218, 350251, 350256, 350259, 350271, 243781, 350285, 374864, 342111, 342133, 374902, 432271, 333997, 334011, 260289, 260298, 350410, 350416, 350422, 211160, 350425, 268507, 334045, 350445, 375026, 358644, 350458, 350461, 350464, 325891, 350467, 350475, 350480, 432405, 350486, 350490, 325914, 325917, 350493, 350498, 350504, 358700, 350509, 391468, 358704, 358713, 358716, 383306, 334161, 383321, 383330, 383333, 391530, 383341, 334203, 268668, 194941, 391563, 366990, 416157, 342430, 268701, 375208, 326058, 375216, 334262, 334275, 326084, 358856, 334304, 334311, 375277, 334321, 350723, 186897, 342545, 334358, 342550, 342554, 334363, 350761, 252461, 334384, 383536, 358961, 334394, 252482, 219718, 334407, 334420, 350822, 375400, 334465, 334468, 162445, 326290, 342679, 342683, 260766, 342710, 244409, 260797, 334528, 260801, 350917, 154317, 391894, 154328, 416473, 64230, 113388, 342766, 375535, 203506, 342776, 391937, 391948, 375568, 326416, 375571, 375574, 162591, 326441, 326451, 326454, 326460, 244540, 260924, 375612, 326467, 244551, 326473, 326477, 326485, 416597, 326490, 342874, 326502, 375656, 326507, 326510, 211825, 211831, 351097, 392060, 359295, 351104, 342915, 400259, 236430, 342930, 252822, 392091, 400285, 252836, 359334, 211884, 400306, 351168, 326598, 359366, 359382, 359388, 383967, 343015, 359407, 261108, 244726, 261111, 383997, 261129, 359451, 261147, 211998, 261153, 261159, 359470, 359476, 343131, 384098, 384101, 384107, 367723, 187502, 343154, 384114, 212094, 351364, 384135, 384139, 384143, 351381, 384151, 384160, 384168, 367794, 244916, 384181, 384188, 384191, 351423, 326855, 244937, 384201, 343244, 384208, 146642, 384224, 359649, 343270, 351466, 384246, 351479, 343306, 261389, 359694, 261393, 384275, 384283, 245020, 384288, 245029, 171302, 351534, 376110, 245040, 425276, 384323, 212291, 343365, 212303, 367965, 343393, 343398, 367980, 343409, 253303, 154999, 343417, 327034, 245127, 384397, 245136, 245142, 245145, 343450, 245148, 245151, 245154, 245157, 245162, 327084, 359865, 384443, 146876, 327107, 384453, 327110, 327115, 327117, 359886, 359890, 343507, 368092, 343534, 343539, 368119, 343544, 368122, 409091, 359947, 359955, 359983, 343630, 327275, 245357, 138864, 155254, 155273, 245409, 425638, 425649, 155322, 425662, 155327, 253943, 245460, 155351, 155354, 212699, 245475, 155363, 245483, 155371, 409335, 155393, 155403, 245525, 155422, 360223, 155438, 155442, 155447, 155461, 376663, 155482, 261981, 425822, 155487, 376671, 155490, 155491, 327531, 261996, 376685, 261999, 262002, 327539, 262005, 147317, 425845, 262008, 262011, 155516, 155521, 155525, 360326, 155531, 262027, 262030, 262033, 262036, 262039, 262042, 155549, 262045, 262048, 262051, 327589, 155559, 155562, 155565, 393150, 384977, 393169, 155611, 155619, 253923, 155621, 253926, 327654, 393203, 360438, 393206, 393212, 155646 ]
5deb2ca75892371a5a6b18f899cb50dc09f5702e
03b37a16a160f0ba590e5b2989526d8de6abe1db
/FSNotes/View/SearchTextField.swift
52c0aebefda9f92f57ae95490b1a8e5a4d5d928e
[ "MIT" ]
permissive
clayreimann/fsnotes
a6746956f46395ef5483a4e8c27e5b01bf40f375
226d004b435257b386ccef732c59b6e3382f21cf
refs/heads/master
2020-03-23T02:09:03.116090
2018-07-24T13:48:56
2018-07-24T13:48:56
140,958,835
0
0
MIT
2018-07-17T01:36:59
2018-07-14T15:56:27
Swift
UTF-8
Swift
false
false
4,330
swift
// // SearchTextField.swift // FSNotes // // Created by Oleksandr Glushchenko on 8/3/17. // Copyright © 2017 Oleksandr Glushchenko. All rights reserved. // import Cocoa import Carbon.HIToolbox import FSNotesCore_macOS class SearchTextField: NSTextField, NSTextFieldDelegate { public var vcDelegate: ViewController! private var filterQueue = OperationQueue.init() private var searchTimer = Timer() public var allowAutocomplete = true public var searchQuery = "" public var selectedRange = NSRange() override func draw(_ dirtyRect: NSRect) { delegate = self super.draw(dirtyRect) } override func controlTextDidEndEditing(_ obj: Notification) { focusRingType = .none } override func keyUp(with event: NSEvent) { if (event.keyCode == kVK_DownArrow) { vcDelegate.focusTable() vcDelegate.notesTableView.selectNext() return } if (event.keyCode == kVK_LeftArrow) { vcDelegate.storageOutlineView.window?.makeFirstResponder(vcDelegate.storageOutlineView) vcDelegate.storageOutlineView.selectRowIndexes([1], byExtendingSelection: false) return } if event.keyCode == kVK_Return { vcDelegate.focusEditArea() } } override func performKeyEquivalent(with event: NSEvent) -> Bool { if ( event.keyCode == kVK_Escape || ( [kVK_ANSI_L, kVK_ANSI_N].contains(Int(event.keyCode)) && event.modifierFlags.contains(.command) ) ) { allowAutocomplete = true searchQuery = "" return true } return super.performKeyEquivalent(with: event) } public func suggestAutocomplete(_ note: Note) { if note.title == stringValue { return } searchQuery = stringValue if allowAutocomplete && note.title.lowercased().starts(with: searchQuery.lowercased()) { let text = searchQuery + note.title.suffix(note.title.count - searchQuery.count) stringValue = text currentEditor()?.selectedRange = NSRange(searchQuery.utf16.count..<note.title.utf16.count) allowAutocomplete = false } } func control(_ control: NSControl, textView: NSTextView, doCommandBy commandSelector: Selector) -> Bool { switch commandSelector.description { case "cancelOperation:": allowAutocomplete = true return true case "deleteBackward:": allowAutocomplete = false textView.deleteBackward(self) return true case "insertNewline:": if let note = vcDelegate.editArea.getSelectedNote(), stringValue.count > 0, note.title.lowercased().starts(with: searchQuery.lowercased()) { vcDelegate.focusEditArea() } else { vcDelegate.makeNote(self) } return true case "insertTab:": vcDelegate.focusEditArea() vcDelegate.editArea.scrollToCursor() return true case "deleteWordBackward:": textView.deleteWordBackward(self) return true default: return false } } override func controlTextDidChange(_ obj: Notification) { UserDataService.instance.searchTrigger = true filterQueue.cancelAllOperations() filterQueue.addOperation { DispatchQueue.main.async { self.vcDelegate.updateTable(search: true) { self.allowAutocomplete = true if UserDefaultsManagement.focusInEditorOnNoteSelect { self.searchTimer.invalidate() self.searchTimer = Timer.scheduledTimer(timeInterval: TimeInterval(1), target: self, selector: #selector(self.onEndSearch), userInfo: nil, repeats: false) } else { UserDataService.instance.searchTrigger = false } } } } } @objc func onEndSearch() { UserDataService.instance.searchTrigger = false } }
[ -1 ]
354792cfdf0747a0155cec6d6b507ca47de76103
c9d1f48aad98ae38fc1321792cdb0d85afbce1c3
/Millionaire/Controller/GameViewController.swift
fafdabf066ae5aef0ebc0523b012797885688568
[]
no_license
Syancheg/million
a991733e9516350a03ec66e6d89ce51bb615420c
b82ee7ab4fd4384ef25f4ae600b5ba8980eb2499
refs/heads/main
2023-03-15T15:38:26.390299
2021-03-03T09:47:43
2021-03-03T09:47:43
340,356,161
0
0
null
2021-03-03T09:47:44
2021-02-19T12:01:15
Swift
UTF-8
Swift
false
false
3,789
swift
// // GameViewController.swift // Millionaire // // Created by Константин Кузнецов on 18.02.2021. // import UIKit protocol GameViewControllerDelegate: class { func printScope(scope: Int) } protocol GameViewControllerSessionDelegate: class { func updateData(correctAnswer: Int) } class GameViewController: UIViewController { //MARK: - Properties lazy var contentView = self.view as! GameView lazy var game = Game.shared var questions: [Question] = [] var currentIssue: Question? var indexCurrentIssue: Int? var scope = Observable<Int>(0) weak var gameDelegate: GameViewControllerDelegate? weak var sessionDelegate: GameViewControllerSessionDelegate? var gameStrategy: GameStrategy? //MARK: - Controller Life Circle override func viewDidLoad() { super.viewDidLoad() guard let strategy = gameStrategy else { return } questions = strategy.sortArray(array: Question.getQuestions) let session = GameSession(questions: questions.count) sessionDelegate = session scope.addObserver(self, options: [.initial, .new]) { [weak self] (scope, _) in let percent = (Float(scope) / Float(self?.questions.count ?? 0)) * 100 self?.contentView.resultLabel.text = "Вопрос №\(scope), прогресс — \(Int(percent))%" } game.gameSession = session contentView.gameDelegate = self startGame() } //MARK: - Game Life Circle private func startGame(){ contentView.unSelectedButtons() if (indexCurrentIssue == nil) { guard let question = questions.first else {return} displayQuestion(question: question) indexCurrentIssue = 0 } else { indexCurrentIssue! += 1 if questions.count > indexCurrentIssue!{ let question = questions[indexCurrentIssue!] displayQuestion(question: question) } else { winGame() } } } private func winGame(){ sessionDelegate?.updateData(correctAnswer: scope.value) contentView.questionLabel.text = "Вы молодец, ответили на все вопросы, возьмите с полки пирожок, но потом верните его обратно" game.append() contentView.disabledButtons() returnMainMenu() } private func overGame(){ gameDelegate?.printScope(scope: scope.value) contentView.selectCorrectAnswer(index: currentIssue!.correctAnswer) contentView.questionLabel.text = "Вы ошиблись, игра окончена!" sessionDelegate?.updateData(correctAnswer: scope.value) game.append() contentView.disabledButtons() returnMainMenu() } private func displayQuestion(question: Question){ currentIssue = question contentView.questionLabel.text = question.question contentView.answerButtons.enumerated().forEach { (index, button) in button.setTitle(question.answers[index], for: .normal) } contentView.submitButton.isEnabled = false } //MARK: - return maint menu private func returnMainMenu(){ DispatchQueue.main.asyncAfter(deadline: .now() + 1.5) { self.dismiss(animated: true, completion: nil) } } } extension GameViewController: GameViewDelegate{ func newAnswer(tag: Int) { guard let correctAnswer = currentIssue?.correctAnswer else { return } if correctAnswer == tag { scope.value += 1 startGame() } else { overGame() } } }
[ -1 ]
0187f1c467cda57073d81459a8ae4c8a350e79c6
346e0e4433c346f7011804d07d68b73859c420e4
/MyFilesystem/SwiftFileManager/SwiftFileManager/SceneDelegate.swift
ce60b8d950c6c40f2822b5f1a9a2314f3a771861
[]
no_license
pavel-spitsin/SwiftCourseOrion
4b241c0102d8d3b835cec8d420307c97abd39769
de60744863bf25619a42763e3cbf421621fbd5e2
refs/heads/main
2023-07-28T07:14:14.136020
2021-09-17T15:48:10
2021-09-17T15:48:10
377,916,033
0
0
null
null
null
null
UTF-8
Swift
false
false
2,302
swift
// // SceneDelegate.swift // SwiftFileManager // // Created by Pavel Spitcyn on 02.07.2021. // import UIKit class SceneDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow? func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). guard let _ = (scene as? UIWindowScene) else { return } } func sceneDidDisconnect(_ scene: UIScene) { // Called as the scene is being released by the system. // This occurs shortly after the scene enters the background, or when its session is discarded. // Release any resources associated with this scene that can be re-created the next time the scene connects. // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead). } func sceneDidBecomeActive(_ scene: UIScene) { // Called when the scene has moved from an inactive state to an active state. // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. } func sceneWillResignActive(_ scene: UIScene) { // Called when the scene will move from an active state to an inactive state. // This may occur due to temporary interruptions (ex. an incoming phone call). } func sceneWillEnterForeground(_ scene: UIScene) { // Called as the scene transitions from the background to the foreground. // Use this method to undo the changes made on entering the background. } func sceneDidEnterBackground(_ scene: UIScene) { // Called as the scene transitions from the foreground to the background. // Use this method to save data, release shared resources, and store enough scene-specific state information // to restore the scene back to its current state. } }
[ 393221, 163849, 393228, 393231, 393251, 352294, 344103, 393260, 393269, 213049, 376890, 385082, 393277, 376906, 327757, 254032, 368728, 180314, 254045, 180322, 376932, 286833, 286845, 286851, 417925, 262284, 360598, 286880, 377003, 377013, 164029, 327872, 180418, 377030, 377037, 377047, 418008, 418012, 377063, 327915, 205037, 393457, 393461, 393466, 418044, 385281, 336129, 262405, 180491, 336140, 164107, 262417, 368913, 262423, 377118, 377121, 262437, 254253, 336181, 262455, 393539, 262473, 344404, 213333, 418135, 270687, 262497, 418145, 262501, 213354, 246124, 262508, 262512, 213374, 385420, 393613, 262551, 262553, 385441, 385444, 262567, 385452, 262574, 393649, 385460, 262587, 344512, 262593, 360917, 369119, 328178, 328180, 328183, 328190, 254463, 328193, 164362, 328207, 410129, 393748, 262679, 377372, 188959, 385571, 377384, 197160, 33322, 352822, 270905, 197178, 418364, 188990, 369224, 270922, 385610, 352844, 385617, 352865, 262761, 352875, 344694, 352888, 336513, 377473, 385671, 148106, 213642, 377485, 352919, 98969, 344745, 361130, 336556, 434868, 164535, 336568, 164539, 328379, 328387, 352969, 344777, 418508, 385743, 385749, 139998, 189154, 369382, 361196, 418555, 344832, 336644, 344837, 344843, 328462, 361231, 394002, 336660, 418581, 418586, 434971, 369436, 262943, 369439, 418591, 418594, 336676, 418600, 418606, 369464, 361274, 328516, 336709, 328520, 336712, 361289, 328523, 336715, 361300, 213848, 426842, 361307, 197469, 361310, 254813, 361318, 344936, 361323, 361335, 328574, 369544, 361361, 222129, 345036, 386004, 345046, 386012, 386019, 386023, 328690, 435188, 328703, 328710, 418822, 377867, 328715, 361490, 386070, 336922, 345119, 377888, 214060, 345134, 345139, 361525, 386102, 361537, 377931, 345172, 189525, 156762, 402523, 361568, 148580, 345200, 361591, 386168, 361594, 410746, 214150, 345224, 386187, 345247, 361645, 345268, 402615, 361657, 337093, 402636, 328925, 165086, 66783, 165092, 328933, 222438, 328942, 386286, 386292, 206084, 328967, 345377, 345380, 353572, 345383, 263464, 337207, 345400, 378170, 369979, 386366, 337224, 337230, 337235, 263509, 353634, 337252, 402792, 271731, 378232, 337278, 271746, 181639, 353674, 181644, 361869, 181650, 181655, 230810, 181671, 181674, 181679, 181682, 337330, 181687, 370105, 181691, 181697, 361922, 337350, 181704, 337366, 271841, 329192, 361961, 329195, 116211, 337399, 402943, 337416, 329227, 419341, 419345, 329234, 419351, 345626, 419357, 345631, 419360, 370208, 394787, 419363, 370214, 419369, 394796, 419377, 419386, 206397, 214594, 419401, 353868, 419404, 173648, 419408, 214611, 419412, 403040, 345702, 222831, 370298, 353920, 403073, 403076, 345737, 198282, 403085, 403092, 345750, 419484, 345758, 345763, 419492, 345766, 419498, 419502, 370351, 419507, 337588, 419510, 419513, 419518, 337601, 403139, 337607, 419528, 419531, 419536, 272083, 394967, 419543, 419545, 345819, 419548, 419551, 345829, 419560, 337643, 419564, 337647, 370416, 337671, 362249, 362252, 395022, 362256, 321300, 345888, 362274, 378664, 354107, 345916, 354112, 370504, 329545, 345932, 370510, 354132, 247639, 337751, 370520, 313181, 182110, 354143, 354157, 345965, 345968, 345971, 345975, 403321, 1914, 354173, 395148, 247692, 337809, 247701, 329625, 436127, 436133, 247720, 337834, 362414, 337845, 190393, 346059, 247760, 346064, 346069, 419810, 329699, 354275, 190440, 354314, 346140, 436290, 395340, 378956, 436307, 338005, 100454, 329833, 329853, 329857, 329868, 411806, 329886, 346273, 362661, 100525, 387250, 379067, 387261, 256193, 395467, 346317, 411862, 411865, 411869, 411874, 379108, 411877, 387303, 346344, 395496, 338154, 387307, 346350, 338161, 387314, 436474, 321787, 379135, 411905, 411917, 379154, 395539, 387350, 387353, 338201, 182559, 338212, 248112, 362823, 436556, 321880, 362844, 379234, 354674, 321911, 420237, 379279, 272787, 354728, 338353, 338382, 272849, 248279, 256474, 182755, 338404, 338411, 330225, 248309, 330254, 199189, 420377, 330268, 191012, 330320, 199250, 191069, 346722, 248427, 191085, 338544, 346736, 191093, 346743, 346769, 150184, 174775, 248505, 174778, 363198, 223936, 355025, 273109, 355029, 264919, 338661, 264942, 363252, 338680, 264965, 338701, 256787, 363294, 199455, 396067, 346917, 396070, 215854, 355123, 355141, 355144, 338764, 355151, 330581, 387929, 330585, 355167, 265056, 265059, 355176, 355180, 355185, 412600, 207809, 379849, 347082, 396246, 330711, 248794, 248799, 347106, 437219, 257009, 265208, 265215, 199681, 338951, 330761, 330769, 330775, 248863, 158759, 396329, 347178, 404526, 396337, 330803, 396340, 339002, 388155, 339010, 347208, 248905, 330827, 248915, 183384, 412765, 339037, 257121, 322660, 265321, 248952, 420985, 330886, 347288, 248986, 44199, 380071, 339118, 249018, 339133, 126148, 322763, 330959, 330966, 265433, 265438, 388320, 363757, 388348, 339199, 396552, 175376, 175397, 273709, 372016, 437553, 347442, 199989, 175416, 396601, 208189, 437567, 175425, 437571, 126279, 437576, 437584, 331089, 437588, 331094, 396634, 175451, 437596, 429408, 175458, 175461, 175464, 265581, 331124, 175478, 249210, 175484, 175487, 249215, 175491, 249219, 249225, 249228, 249235, 175514, 175517, 396703, 396706, 175523, 355749, 396723, 388543, 380353, 216518, 380364, 339406, 372177, 339414, 249303, 413143, 339418, 339421, 249310, 339425, 249313, 339429, 339435, 249329, 69114, 372229, 208399, 175637, 405017, 134689, 339504, 265779, 421442, 413251, 265796, 265806, 224854, 224858, 339553, 257636, 224871, 372328, 257647, 372338, 224885, 224888, 224891, 224895, 372354, 126597, 421509, 224905, 11919, 224911, 224914, 126611, 224917, 224920, 126618, 208539, 224923, 224927, 224930, 224933, 257705, 224939, 224943, 257713, 224949, 257717, 257721, 224954, 257725, 224960, 257733, 224966, 224970, 257740, 224976, 257745, 339664, 257748, 224982, 257752, 224987, 257762, 224996, 225000, 225013, 257788, 225021, 339711, 257791, 225027, 257796, 257802, 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, 257869, 257872, 225105, 397140, 225109, 225113, 257881, 257884, 257887, 225120, 257891, 413539, 225128, 257897, 339818, 225138, 339827, 257909, 225142, 372598, 257914, 257917, 225150, 257922, 380803, 225156, 339845, 257927, 225166, 397201, 225171, 380823, 225176, 225183, 372698, 372704, 372707, 356336, 380919, 372739, 405534, 266295, 266298, 217158, 421961, 200786, 356440, 217180, 430181, 266351, 356467, 266365, 192640, 266375, 381069, 225425, 250003, 225430, 250008, 356507, 250012, 225439, 135328, 192674, 225442, 438434, 225445, 438438, 225448, 438441, 356521, 225451, 258223, 225456, 430257, 225459, 225462, 225468, 389309, 225472, 372931, 225476, 430275, 389322, 225485, 225488, 225491, 266454, 225494, 225497, 225500, 225503, 225506, 356580, 225511, 217319, 225515, 225519, 381177, 397572, 389381, 381212, 356638, 356641, 356644, 356647, 266537, 389417, 356650, 356656, 332081, 307507, 340276, 356662, 397623, 332091, 225599, 201030, 348489, 332107, 151884, 430422, 348503, 250201, 250211, 340328, 250217, 348523, 348528, 332153, 356734, 389503, 332158, 438657, 250239, 389507, 348548, 356741, 332175, 160152, 373146, 340380, 373149, 70048, 356783, 373169, 266688, 324032, 201158, 127473, 217590, 340473, 324095, 324100, 324103, 324112, 340501, 324118, 324122, 340512, 332325, 324134, 381483, 356908, 324141, 324143, 356917, 324150, 324156, 168509, 348734, 324161, 324165, 356935, 348745, 381513, 324171, 324174, 324177, 389724, 332381, 373344, 340580, 348777, 381546, 119432, 340628, 184983, 373399, 258723, 332455, 332460, 389806, 332464, 332473, 381626, 332484, 332487, 332494, 357070, 357074, 332512, 332521, 340724, 332534, 155647, 348926, 389927, 348979, 152371, 348983, 340792, 398141, 357202, 389971, 357208, 389979, 430940, 357212, 357215, 439138, 201580, 201583, 349041, 340850, 381815, 430967, 324473, 398202, 119675, 340859, 324476, 430973, 324479, 340863, 324482, 373635, 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, 357411, 250915, 250917, 169002, 357419, 209966, 209969, 209973, 209976, 209980, 209988, 209991, 431180, 209996, 341072, 349268, 177238, 250968, 210011, 373853, 341094, 210026, 210028, 210032, 349296, 210037, 210042, 210045, 349309, 152704, 349313, 160896, 210053, 210056, 349320, 259217, 373905, 210068, 210072, 210078, 210081, 210085, 210089, 210096, 210100, 324792, 210108, 357571, 210116, 210128, 210132, 333016, 210139, 210144, 218355, 218361, 275709, 128254, 275713, 242947, 275717, 275723, 333075, 349460, 333079, 251161, 349486, 349492, 415034, 210261, 365912, 259423, 374113, 251236, 374118, 333164, 234867, 390518, 357756, 374161, 112021, 349591, 357793, 333222, 259516, 415168, 366035, 415187, 366039, 415192, 415194, 415197, 415200, 333285, 415208, 366057, 366064, 415217, 415225, 423424, 415258, 415264, 366118, 415271, 382503, 349739, 144940, 415279, 415282, 415286, 210488, 415291, 415295, 349762, 333396, 374359, 333400, 366173, 423529, 423533, 210547, 415354, 333440, 267910, 267929, 333512, 259789, 366301, 333535, 153311, 366308, 366312, 431852, 399086, 366319, 210673, 366322, 399092, 366326, 333566, 268042, 210700, 366349, 210707, 399129, 333595, 210720, 366384, 358192, 210740, 366388, 358201, 325441, 366403, 325447, 341831, 341835, 341839, 341844, 415574, 358235, 341852, 350046, 399200, 399208, 268144, 358256, 358260, 341877, 399222, 325494, 333690, 325505, 333699, 399244, 333709, 333725, 333737, 382891, 382898, 350153, 358348, 333777, 219094, 399318, 358372, 350190, 350194, 333819, 350204, 350207, 325633, 325637, 350214, 219144, 268299, 333838, 350225, 186388, 350232, 333851, 350238, 350241, 374819, 350245, 350249, 350252, 178221, 350257, 350260, 350272, 243782, 350281, 350286, 374865, 342113, 252021, 342134, 374904, 268435, 333998, 334012, 260299, 350411, 350417, 350423, 350426, 350449, 375027, 358645, 350459, 350462, 350465, 350469, 268553, 350477, 268560, 350481, 432406, 350487, 325915, 350491, 325918, 350494, 325920, 350500, 194854, 350505, 358701, 391469, 350510, 358705, 358714, 358717, 383307, 358738, 334162, 383331, 383334, 391531, 383342, 334204, 268669, 194942, 391564, 366991, 334224, 268702, 342431, 375209, 375220, 334263, 326087, 358857, 195041, 334312, 104940, 375279, 416255, 350724, 186898, 342546, 350740, 342551, 334359, 342555, 334364, 416294, 350762, 252463, 358962, 334386, 334397, 358973, 252483, 219719, 399957, 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, 326417, 375572, 375575, 375580, 162592, 334633, 326444, 383794, 326452, 326455, 375613, 244542, 326463, 375616, 326468, 342857, 326474, 326479, 326486, 416599, 342875, 244572, 326494, 433001, 400238, 326511, 211826, 211832, 392061, 351102, 359296, 252801, 260993, 351105, 400260, 211846, 342921, 342931, 252823, 400279, 392092, 400286, 252838, 359335, 211885, 252846, 400307, 351169, 359362, 351172, 170950, 187335, 326599, 359367, 359383, 359389, 383968, 343018, 359411, 261109, 261112, 244728, 383999, 261130, 261148, 359452, 211999, 261155, 261160, 261166, 359471, 375868, 343132, 384099, 384102, 384108, 367724, 187503, 343155, 384115, 212095, 351366, 384136, 384140, 384144, 384152, 384158, 384161, 351399, 384169, 367795, 384182, 367801, 384189, 384192, 351424, 343232, 367817, 244938, 384202, 253132, 326858, 384209, 146644, 351450, 384225, 359650, 343272, 351467, 359660, 384247, 351480, 384250, 351483, 351492, 343307, 384270, 359695, 261391, 253202, 261395, 384276, 384284, 245021, 384290, 253218, 245032, 171304, 384299, 351535, 376111, 245042, 326970, 384324, 343366, 212296, 212304, 367966, 343394, 367981, 343410, 155000, 327035, 245121, 245128, 253321, 155021, 384398, 245137, 245143, 245146, 245149, 343453, 245152, 245155, 155045, 245158, 40358, 245163, 114093, 327090, 343478, 359867, 384444, 146878, 327108, 327112, 384457, 359887, 359891, 368093, 155103, 343535, 343540, 368120, 343545, 409092, 253445, 359948, 359951, 245295, 359984, 343610, 400977, 400982, 179803, 245358, 155255, 155274, 368289, 245410, 425639, 425652, 425663, 155328, 245463, 155352, 155356, 212700, 155364, 245477, 155372, 245487, 212723, 409336, 155394, 155404, 245528, 155423, 360224, 155439, 204592, 155444, 155448, 417596, 384829, 384831, 360262, 155463, 155477, 376665, 155484, 261982, 425823, 155488, 376672, 155492, 327532, 261997, 376686, 262000, 262003, 425846, 262006, 147319, 262009, 327542, 262012, 155517, 155523, 155526, 360327, 376715, 155532, 262028, 262031, 262034, 262037, 262040, 262043, 155550, 253854, 262046, 262049, 262052, 327590, 155560, 155563, 155566, 327613, 393152, 311244, 393170, 155604, 155620, 253924, 155622, 253927, 327655, 360432, 393204, 360439, 253944, 393209, 393215 ]
5bffbff6a6fcc510b8a8d43c6f26134bfe3434c1
079a6a0c7b6e86630b93585cf6b24305f95b130f
/Example/Pods/CryptoSwift/Sources/CryptoSwift/PEM/DER.swift
54545a35ac025fe4cc781ed942844b8682f4e469
[ "BSD-2-Clause", "BSD-3-Clause", "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-other-permissive" ]
permissive
NordicSemiconductor/IOS-nRF-Mesh-Library
41ee1329f3ceee6686b4fa2216d2e8e0af416b4e
3c6cde5f07929872d11542dd27441776bf697580
refs/heads/main
2023-08-31T01:48:05.080325
2023-08-29T12:00:27
2023-08-29T12:00:27
130,366,442
286
122
BSD-3-Clause
2023-09-07T08:21:49
2018-04-20T13:33:07
Swift
UTF-8
Swift
false
false
4,413
swift
// // CryptoSwift // // Copyright (C) Marcin Krzyżanowski <[email protected]> // This software is provided 'as-is', without any express or implied warranty. // // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose,including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: // // - The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation is required. // - Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. // - This notice may not be removed or altered from any source or binary distribution. // import Foundation /// Conform to this protocol if your type can both be instantiated and expressed as an ASN1 DER representation. internal protocol DERCodable: DERDecodable, DEREncodable { } /// Conform to this protocol if your type can be instantiated from a ASN1 DER representation internal protocol DERDecodable { /// Attempts to instantiate an instance of your Public Key when given a DER representation of your Public Key /// /// - Parameter publicDER: The ASN.1 DER representation of your Public Key init(publicDER: Array<UInt8>) throws /// Attempts to instantiate an instance of your Private Key when given a DER representation of your Private Key /// /// - Parameter privateDER: The ASN.1 DER representation of your Private Key init(privateDER: Array<UInt8>) throws /// Attempts to instantiate a Key when given the ASN1 DER encoded external representation of the Key /// /// - Parameter rawRepresentation: The ASN1 DER Encoded external representation (either public or private) /// - Note: The external representation is identical to that of `SecKeyCopyExternalRepresentation` function from Apple's `Security` framework init(rawRepresentation: Data) throws } /// Conform to this protocol if your type can be described in an ASN1 DER representation internal protocol DEREncodable { /// Returns the DER encoded representation of the Public Key func publicKeyDER() throws -> Array<UInt8> /// Returns the DER encoded representation of the Private Key func privateKeyDER() throws -> Array<UInt8> /// A semantically similar function that mimics the `SecKeyCopyExternalRepresentation` function from Apple's `Security` framework /// - Note: If called on a Private Key, this method will return the Private Keys DER Representation. Likewise, if called on a Public Key, this method will return the Public Keys DER Representation /// - Note: If you'd like to export the Public Keys DER from a Private Key, use the `publicKeyExternalRepresentation()` function func externalRepresentation() throws -> Data /// A semantically similar function that mimics the `SecKeyCopyExternalRepresentation` function from Apple's `Security` framework /// - Note: This function only ever exports the Public Key's DER representation. If called on a Private Key, the corresponding Public Key will be extracted and exported. func publicKeyExternalRepresentation() throws -> Data } struct DER { internal enum Error: Swift.Error { /// We were provided invalid DER data case invalidDERFormat } /// Integer to Octet String Primitive /// - Parameters: /// - x: nonnegative integer to be converted /// - size: intended length of the resulting octet string /// - Returns: corresponding octet string of length xLen /// - Note: https://datatracker.ietf.org/doc/html/rfc3447#section-4.1 internal static func i2osp(x: [UInt8], size: Int) -> [UInt8] { var modulus = x while modulus.count < size { modulus.insert(0x00, at: 0) } if modulus[0] >= 0x80 { modulus.insert(0x00, at: 0) } return modulus } /// Integer to Octet String Primitive /// - Parameters: /// - x: nonnegative integer to be converted /// - size: intended length of the resulting octet string /// - Returns: corresponding octet string of length xLen /// - Note: https://datatracker.ietf.org/doc/html/rfc3447#section-4.1 internal static func i2ospData(x: [UInt8], size: Int) -> Data { return Data(DER.i2osp(x: x, size: size)) } }
[ 421940 ]
8221ee7381f15ec8cf2208c3bda3b404325bab58
b20b8cd3263653d0af3a1e51be4ab331e33ac9b8
/shopapp/ShopCart.swift
8e139c99f64339db7416018419b58165a09398ac
[ "MIT" ]
permissive
david-mtz/diplomado-ios
1df67832720492a34c1f30387cdc4072a7aa4857
f823bb3f238ebe7c1931cd9828acb7c60d8407d9
refs/heads/master
2020-06-09T07:59:56.997048
2019-08-12T04:50:55
2019-08-12T04:50:55
193,406,179
0
0
null
null
null
null
UTF-8
Swift
false
false
786
swift
// // ShopCart.swift // shopapp // // Created by David on 7/24/19. // Copyright © 2019 David. All rights reserved. // import Foundation class ShopCart { static let shared = ShopCart() var products: [Product] = [Product]() var directions: [Direction] = [Direction]() var purchased: [TransactionStored] = [TransactionStored]() init() { } func loadStorages() { directions = DirectionStorage.shared.load() ?? [Direction]() purchased = TransactionStorage.shared.load() ?? [TransactionStored]() } func saveDirectionStorage() { DirectionStorage.shared.save(data: directions) } func saveTransactionStorage() { TransactionStorage.shared.save(data: purchased) } }
[ -1 ]
50dbdf83715b508b1f39ee7dbc6bc155100c6e00
3c368934e8f0c5e14a9296d5ca3561fdd583ffb7
/PNImagePicker/Classes/PNProgressHUD.swift
0b5b6f1bf38976587d74bc44e0826b36578a4348
[ "MIT" ]
permissive
P1nov/PNImagePicker
562915a7de0807323c415a3c61693760600c1dcd
bc007820dda3ec0b3002b556d6a5d583b0280c33
refs/heads/master
2020-12-02T01:34:39.110688
2020-01-02T03:36:52
2020-01-02T03:36:52
230,844,228
1
0
null
null
null
null
UTF-8
Swift
false
false
7,806
swift
// // PNProgressHUD.swift // UITestDemo // // Created by ma c on 2019/12/22. // Copyright © 2019 ma c. All rights reserved. // import UIKit class PNProgressHUDView : UIView { lazy var titleLabel: UILabel = { let label = UILabel(frame: CGRect(x: 0, y: self.frame.origin.y - pScale(20), width: self.frame.width - pScale(50), height: 0.0)) label.textColor = UIColor.black label.font = UIFont.systemFont(ofSize: 14.0) label.numberOfLines = 0 label.textAlignment = .center label.clipsToBounds = true label.layer.cornerRadius = pScale(8) return label }() init() { super.init(frame: .init(x: 0, y: 0, width: UIScreen.main.bounds.width, height: UIScreen.main.bounds.height)) self.addSubview(titleLabel) titleLabel.center = self.center } required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } } class PNProgressHUD: NSObject { var loadingView : LSDMidIndicatorView? enum PresentType { case popup case fromTop case fromBottom } enum WarningType { case error case warning case success case `default` } /** - Parameters: - title: 提示内容(不能为空) - presentType: 弹窗方式 - font: 字体(可为空,为空使用默认字体) - backgroundColor: 弹窗提示的背景色(可为空,默认为白色) - textColor: 字色(可为空,默认为黑色) - superView: 父视图(为空则是window上显示) */ class func present(with title : NSString, presentType : PresentType, font : UIFont?, backgroundColor : UIColor?, textColor : UIColor?, in superView : UIView?) { let hudView : PNProgressHUDView = PNProgressHUDView() if backgroundColor != nil { hudView.titleLabel.backgroundColor = backgroundColor! } if textColor != nil { hudView.titleLabel.textColor = textColor } if font != nil { hudView.titleLabel.font = font! } let height = title.boundingRect(with: .init(width: hudView.bounds.width, height: 0.0), options: NSStringDrawingOptions.Element(rawValue: NSStringDrawingOptions.usesFontLeading.rawValue | NSStringDrawingOptions.usesLineFragmentOrigin.rawValue), attributes: [NSAttributedString.Key.font : font != nil ? font as Any : UIFont.systemFont(ofSize: 14.0)], context: nil).size.height hudView.titleLabel.text = String(title) hudView.titleLabel.frame.size.height = height + 40 presentAnimation(view: hudView, presentType: presentType, superView: superView) } class func presentAnimation(view : PNProgressHUDView, presentType : PresentType, superView : UIView?) { var newSuperView : UIView? if superView == nil { guard let currentWindow = UIApplication.shared.keyWindow else { return } currentWindow.addSubview(view) newSuperView = currentWindow }else { superView?.addSubview(view) newSuperView = superView } switch presentType { case .popup: view.titleLabel.center = view.center view.titleLabel.transform = CGAffineTransform.init(scaleX: 0.1, y: 0.1) UIView.animate(withDuration: 0.1, animations: { view.titleLabel.transform = CGAffineTransform.init(scaleX: 1.0, y: 1.0) }) { (completed) in UIView.animate(withDuration: 0.1, delay: 1, options: .curveEaseInOut, animations: { view.transform = CGAffineTransform.init(scaleX: 0.1, y: 0.1) }) { (completed) in view.removeFromSuperview() } } break case .fromTop: view.titleLabel.center = CGPoint(x: newSuperView!.bounds.width / 2.0, y: newSuperView!.bounds.origin.y - view.titleLabel.bounds.height / 2.0) UIView.animate(withDuration: 0.1, animations: { view.titleLabel.center = CGPoint(x: newSuperView!.bounds.width / 2.0, y: newSuperView!.bounds.origin.y + pScale(10) + view.titleLabel.frame.height) }) { (completed) in UIView.animate(withDuration: 0.1, delay: 1, options: .curveEaseInOut, animations: { view.titleLabel.center = CGPoint(x: newSuperView!.bounds.width / 2.0, y: newSuperView!.bounds.origin.y - view.titleLabel.bounds.height / 2.0) }) { (completed) in view.removeFromSuperview() } } break default: break } } class func loading(at superView : UIView?) { var newSuperView : UIView? var loadingView : LSDMidIndicatorView? if superView == nil { guard let currentWindow = UIApplication.shared.keyWindow else { return } loadingView = LSDMidIndicatorView() loadingView!.transform = CGAffineTransform.init(scaleX: 0.1, y: 0.1) currentWindow.addSubview(loadingView!) newSuperView = currentWindow }else { loadingView = LSDMidIndicatorView() loadingView!.transform = CGAffineTransform.init(scaleX: 0.1, y: 0.1) superView?.addSubview(loadingView!) newSuperView = superView } loadingView?.showMe(newSuperView!) } class func hideLoading(from superView : UIView?) { if superView == nil { var keyWindow : UIWindow? for window in UIApplication.shared.windows { if (window.isKeyWindow) { // you have the key window keyWindow = window break; } } guard let currentWindow = keyWindow else { return } var isHided : Bool = false for subView in currentWindow.subviews { if isHided { break } if subView.isKind(of: LSDMidIndicatorView.self) { (subView as! LSDMidIndicatorView).dismiss() isHided = true } } }else { var isHided : Bool = false for subView in superView!.subviews { if isHided { break } if subView.isKind(of: LSDMidIndicatorView.self) { (subView as! LSDMidIndicatorView).dismiss() isHided = true } } } } }
[ -1 ]
f526777e497609cfaea30781c39b5109da6ca3c1
f1ba256274c73092235990900749665bbd00311b
/SQLiteSwiftUI/UserModel.swift
b0f85551cc29c66f7dd2b8115600eb949b1289f1
[]
no_license
yokomotoh/SQLiteSwiftUI
59750839595780ad9d47b27ad6f2721fd7779f37
bf5a247dcd36d74ac27830cc8c562be9eb4c87ce
refs/heads/main
2023-09-05T09:56:34.573602
2021-11-17T20:54:33
2021-11-17T20:54:33
429,196,587
3
1
null
null
null
null
UTF-8
Swift
false
false
309
swift
// // UserModel.swift // SQLiteSwiftUI // // Created by vincent schmitt on 17/11/2021. // import Foundation class UserModel: Identifiable { public var id: Int64 = 0 public var username: String = "" public var email: String = "" public var age: Int64 = 0 public var price: Int64 = 0 }
[ -1 ]
12795593a000423481aea616974359e807a88d9c
45b5c38347932fbb40566f3f20d27858466da918
/MVVM-Moya/App/UI/Scenes/RoomMain/RoomMainNavigator.swift
ce6cb2777164c80007ef7e6efcf1c40a10b0af21
[]
no_license
thaihauit/MVVM-Demo
e8e3400fac0212c93ab08ac574cd93b8b6bfaa2f
e95e3a357b2c5af0cee3265cc3c190d5022878c1
refs/heads/master
2020-07-28T05:14:06.966454
2020-04-10T02:21:17
2020-04-10T02:21:17
209,319,368
0
0
null
2020-04-01T03:25:53
2019-09-18T13:45:33
Swift
UTF-8
Swift
false
false
386
swift
// // RoomMainNavigator.swift // MVVM-Moya // // Created by Ha Nguyen Thai on 2/24/20. // Copyright © 2020 Ha Nguyen Thai. All rights reserved. // import Foundation import UIKit protocol RoomMainNavigatorType { } struct RoomMainNavigator: RoomMainNavigatorType { unowned let assembler: Assembler unowned let navigationController: UINavigationController }
[ -1 ]
e9b88d0c33f370a096338d8410927ded71e8b36f
4d60c8efa62cb37c788dda6100ed23d4f90b751a
/inclass/music/music/ArtistAlbumsController.swift
45e7626df9c695b9313f71a9a0a401b5e6b3087f
[]
no_license
sabrinakavesh/sabrinakavesh_adv_mad
777c31ecde7d8f9647048613d79aa67cf8b67065
1b49de160f4dc08f4ffc05d71cd1c1e04c0e0f58
refs/heads/master
2020-12-13T08:15:18.859429
2020-05-07T03:46:15
2020-05-07T03:46:15
234,358,109
0
0
null
null
null
null
UTF-8
Swift
false
false
2,094
swift
// // ArtistAlbumsController.swift // music // // Created by Sabrina on 1/23/20. // Copyright © 2020 Sabrina. All rights reserved. // import Foundation enum DataError: Error { case BadFilePath case CouldNotDecodeData case NoData } class ArtistAlbumsController { //same name as file //properties var artistAlbumsData: [ArtistAlbums]? //made optional so when we load data later thres a chance it could fail so wouldn't have any data so don't want to assume we will have data when its possible we wont let filename = "artist-albums" //read from plist and decode to array of ArtistAlbums struct func loadData() throws { //throws: eitehr this function will execute correctly or we will throw an error print("Loading Data....") if let pathURL = Bundle.main.url(forResource: filename, withExtension: "plist") { //found the file let decoder = PropertyListDecoder() do { let data = try Data(contentsOf: pathURL) artistAlbumsData = try decoder.decode([ArtistAlbums].self, from: data) print("Data loaded") } catch { throw DataError.CouldNotDecodeData } } else { throw DataError.BadFilePath } } //get all the artists and return array of strings func getAllArtists() throws -> [String] { var artists = [String]() if let data = artistAlbumsData { //we have data for artistStruct in data { artists.append(artistStruct.name) } return artists } else { throw DataError.NoData } } //get all the albums for any of the artists func getAlbums(idx: Int) throws -> [String] { //make sure we have dat if let data = artistAlbumsData { //good data return data[idx].albums } else { //no dat throw DataError.NoData } } }
[ -1 ]
1c32c79cb5a51f715514a6f5c1505ab7c07bcf20
ff06b4b7bc3d867413b78b02753638f311242db0
/Flash Chat/LogInViewController.swift
7da6cc0889b0c36fbd9466e3c6b21388c91d49d2
[]
no_license
ahmedattia15/Flash-Chat
1e2b6d641b7bdf993cea414ac9fd78a044383930
4ebac91aee6ca0745136e19dcc62f22350001d81
refs/heads/master
2020-04-17T10:13:08.352615
2019-01-20T21:24:49
2019-01-20T21:24:49
166,491,982
0
0
null
null
null
null
UTF-8
Swift
false
false
1,057
swift
// // LogInViewController.swift // Flash Chat // // This is the view controller where users login import UIKit import Firebase import SVProgressHUD class LogInViewController: UIViewController { //Textfields pre-linked with IBOutlets @IBOutlet var emailTextfield: UITextField! @IBOutlet var passwordTextfield: UITextField! override func viewDidLoad() { super.viewDidLoad() } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() } @IBAction func logInPressed(_ sender: AnyObject) { SVProgressHUD.show() //TODO: Log in the user Auth.auth().signIn(withEmail: emailTextfield.text!, password: passwordTextfield.text!) { (user, error) in if error != nil { print(error!) } else { print("Log in successful!") SVProgressHUD.dismiss() self.performSegue(withIdentifier: "goToChat", sender: self) } } } }
[ 300825, 323359 ]
13f20940cef430dc0b0588ae955f3881998b8089
9813be84fc4a5d7886f927b9583c79c7f75a6541
/Example/iOS and tvOS Demo/ItemViewController.swift
fd192f065fb672e48b9870911b9c3690810a9c01
[ "MIT" ]
permissive
dropmark/Swift-SDK
66162623d6edd95ae796bc2b201b97211d47d4c5
6aadf04556315bb85891927d4eb3838530f94fa0
refs/heads/master
2023-07-19T04:23:55.024218
2022-04-21T05:42:23
2022-04-21T05:42:23
134,911,254
2
0
null
null
null
null
UTF-8
Swift
false
false
2,984
swift
// // ItemViewController.swift // // Copyright © 2020 Oak, LLC (https://oak.is) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // import UIKit import Alamofire import DropmarkSDK class ItemViewController: UIViewController { var item: DKItem! @IBOutlet weak var imageView: UIImageView! @IBOutlet weak var textView: UITextView! #if os(iOS) @IBOutlet weak var dropmarkLinkButton: UIButton! @IBOutlet weak var sourceLinkButton: UIButton! #elseif os(tvOS) @IBOutlet weak var dromparkLinkLabel: UILabel! @IBOutlet weak var sourceLinkLabel: UILabel! #endif override func viewDidLoad() { super.viewDidLoad() title = item.name if let thumbnailURL = item.thumbnails?.cropped { // Load thumbnail Alamofire.request(thumbnailURL).responseData { response in guard let data = response.data, let image = UIImage(data: data) else { return } self.imageView.image = image } } else if item.type == .text, let text = item.content as? String { // Show text view for text items textView.text = text textView.isHidden = false } #if os(iOS) dropmarkLinkButton.setTitle(item.url.absoluteString, for: .normal) sourceLinkButton.setTitle(item.link?.absoluteString, for: .normal) #elseif os(tvOS) dromparkLinkLabel.text = item.url.absoluteString sourceLinkLabel.text = item.link?.absoluteString #endif } #if os(iOS) @IBAction func didPressDropmarkLinkButton(_ sender: Any) { UIApplication.shared.open(item.url) } @IBAction func didPressSourceLinkButton(_ sender: Any) { if let link = item.link { UIApplication.shared.open(link) } } #endif }
[ -1 ]
57418a7f787423a1480392b07d1e4b462de943e5
be1428e89252583782d1136cbe9d87cff397adb5
/TheMovieDatabase/Models/CrewEntry.swift
301b5792944b4c2eba7620927d9751e5c82211cc
[]
no_license
jsyrtsov/TheMovieDatabase
8f04a0a1389c253c68065bc7833293fa19a70ec8
1bf7df253f98c08e3352d89d997bf17ebd84a779
refs/heads/master
2021-07-05T17:43:15.416717
2021-05-11T20:40:54
2021-05-11T20:40:54
242,175,564
3
3
null
2021-05-11T20:40:55
2020-02-21T15:52:49
Swift
UTF-8
Swift
false
false
365
swift
// // CrewEntry.swift // TheMovieDatabase // // Created by Evgeny Syrtsov on 3/21/20. // Copyright © 2020 Evgeny Syrtsov. All rights reserved. // import Foundation struct CrewEntry: Codable { let creditId: String? let department: String? let gender: Int? let id: Int? let job: String? let name: String? let profilePath: String? }
[ -1 ]
50ccfe8d1b8ede11af250e4ef12f64fe7eafe5dc
63090123632d03b494cddb3cb07266a4b294c2f5
/Tests/XcodeProjTests/Workspace/XCWorkspaceDataTests.swift
e3effd94a88172cbceff90e10df69e0adbf8aa89
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
8ll/XcodeProj
1df37f8c519632a7a4b701dfa1350577b8c9829a
377f349bb3a8738fce34e9d051dc76bd5967ad44
refs/heads/main
2023-05-11T14:08:23.239006
2021-02-15T23:51:32
2021-02-15T23:51:32
339,238,154
1
0
MIT
2023-05-09T17:12:17
2021-02-15T23:46:22
Swift
UTF-8
Swift
false
false
4,287
swift
import Foundation import PathKit import XcodeProj import XCTest final class XCWorkspaceDataTests: XCTestCase { var subject: XCWorkspaceData! var fileRef: XCWorkspaceDataFileRef! override func setUp() { super.setUp() fileRef = XCWorkspaceDataFileRef( location: .self("path") ) subject = XCWorkspaceData(children: []) } func test_equal_returnsTheCorrectValue() { let another = XCWorkspaceData(children: []) XCTAssertEqual(subject, another) } } final class XCWorkspaceDataIntegrationTests: XCTestCase { func test_init_returnsTheModelWithTheRightProperties() throws { let path = fixturePath() let got = try XCWorkspaceData(path: path) if case let XCWorkspaceDataElement.file(location: fileRef) = got.children.first! { XCTAssertEqual(fileRef.location, .self("")) } else { XCTAssertTrue(false, "Expected file reference") } } func test_init_throwsIfThePathIsWrong() { do { _ = try XCWorkspace(path: Path("/test")) XCTAssertTrue(false, "Expected to throw an error but it didn't") } catch {} } func test_write() { testWrite( from: fixturePath(), initModel: { try? XCWorkspaceData(path: $0) }, modify: { $0.children.append( .group(.init(location: .self("shakira"), name: "shakira", children: [])) ) return $0 }, assertion: { before, after in XCTAssertEqual(before, after) XCTAssertEqual(after.children.count, 2) switch after.children.last { case let .group(group)?: XCTAssertEqual(group.name, "shakira") XCTAssertEqual(group.children.count, 0) default: XCTAssertTrue(false, "Expected group") } } ) } func test_init_returnsAllChildren() throws { let workspace = try fixtureWorkspace() XCTAssertEqual(workspace.data.children.count, 4) } func test_init_returnsNestedElements() throws { let workspace = try fixtureWorkspace() if case let XCWorkspaceDataElement.group(group) = workspace.data.children.first! { XCTAssertEqual(group.children.count, 2) } else { XCTAssertTrue(false, "Expected group") } } func test_init_returnsAllLocationTypes() throws { let workspace = try fixtureWorkspace() if case let XCWorkspaceDataElement.group(group) = workspace.data.children[0] { if case let XCWorkspaceDataElement.file(fileRef) = group.children[0] { XCTAssertEqual(fileRef.location, .group("../WithoutWorkspace/WithoutWorkspace.xcodeproj")) } else { XCTAssertTrue(false, "Expected fileRef") } if case let XCWorkspaceDataElement.file(fileRef) = group.children[1] { XCTAssertEqual(fileRef.location, .container("iOS/BuildSettings.xcodeproj")) } else { XCTAssertTrue(false, "Expected fileRef") } } else { XCTAssertTrue(false, "Expected group") } if case let XCWorkspaceDataElement.file(fileRef) = workspace.data.children[2] { XCTAssertEqual(fileRef.location, .absolute("/Applications/Xcode.app/Contents/Developer/Applications/Simulator.app")) } else { XCTAssertTrue(false, "Expected fileRef") } if case let XCWorkspaceDataElement.file(fileRef) = workspace.data.children[3] { XCTAssertEqual(fileRef.location, .developer("Applications/Simulator.app")) } else { XCTAssertTrue(false, "Expected fileRef") } } // MARK: - Private private func fixturePath() -> Path { fixturesPath() + "iOS/Project.xcodeproj/project.xcworkspace/contents.xcworkspacedata" } private func fixtureWorkspace() throws -> XCWorkspace { let path = fixturesPath() + "Workspace.xcworkspace" return try XCWorkspace(path: path) } }
[ -1 ]
3211a85e273100b0c006025a9fe2809868ba8939
c7f3f4cddeec114d8764276858efbfdc5b8e6b8e
/Sources/SwiftDiagramComponentsGenerator/astTypesExtensions/DeclarationArrayExtension.swift
c277247e28408d160c3d43834b6c56b3de0f8adf
[ "MIT", "Apache-2.0" ]
permissive
ttorbik/swift-code-types-navigator
74a5f8f97bdc8fedca8c23c5a90d561be4fb03f4
c2a9f1756b91778956ba64a279ee0e99abd366da
refs/heads/master
2020-04-09T05:36:45.122330
2018-12-02T21:15:26
2018-12-02T21:15:26
159,880,517
0
0
null
null
null
null
UTF-8
Swift
false
false
329
swift
// // DeclarationArrayExtension.swift // SwiftDiagramComponentsGenerator // // Created by Jovan Jovanovski on 12/27/17. // import AST extension Array where Element == Declaration { var convertiblesToRelationships: [ConvertibleToRelationship] { return flatMap { $0.convertiblesToRelationships } } }
[ -1 ]
2488f19e059272dedc4de8b53fdd40611151d5fb
afa348a412884d4a15d1ec32956d9d47f4bf6839
/ios/Ping Home/CallHistory.swift
46222822fa4ba7b53b13259606fd4c81a4ec5309
[ "MIT" ]
permissive
tutertlob/rny-3
74d12ab8092cf2c81f070da841ef4d6cb7893826
5bdb25f0c5c88152330b3604d1007920a87d61de
refs/heads/master
2020-07-15T04:14:33.099869
2019-09-06T13:42:42
2019-09-06T13:42:42
205,476,681
0
0
null
null
null
null
UTF-8
Swift
false
false
1,082
swift
// // CallHistory.swift // Ping Home // // Created by 西山 零士 on 2019/08/16. // Copyright © 2019 西山 零士. All rights reserved. // import Foundation struct CallHistory: Codable, Equatable { let text: String let timeOfCall: String let date: Date private static let message: String = "来訪がありました" private static let formatter: DateFormatter = { let formatter = DateFormatter() formatter.dateFormat = DateFormatter.dateFormat(fromTemplate: "MMMdyHms", options: 0, locale: Locale(identifier: "ja_JP")) return formatter }() init() { text = CallHistory.message date = Date() timeOfCall = CallHistory.formatter.string(from: date) } init(withTimeOfCall date: Date) { text = CallHistory.message self.date = date timeOfCall = CallHistory.formatter.string(from: date) } init(withTitle text: String, timeOfCall date: Date) { self.text = text self.date = date timeOfCall = CallHistory.formatter.string(from: date) } public static func == (lhs: CallHistory, rhs: CallHistory) -> Bool { return lhs.date == rhs.date } }
[ -1 ]
ad47f94c2514e57e0ecfbc666ebfb5dba65002cb
1b39ce98d8a0644220e9b46f1061804224083826
/Roomguru/Source Files/Views/MaskingView.swift
80ff2c7fdb7338ca8cf2cda87f1149586b2533de
[ "MIT" ]
permissive
maqinjun/roomguru
f9d0429b6e31c58f25a6b330fd2d71e0232bd714
304005b3ef80e8c4341078a8d990bbf30bbf0c55
refs/heads/master
2021-01-14T08:05:48.671449
2015-12-08T16:02:19
2015-12-08T16:02:19
null
0
0
null
null
null
null
UTF-8
Swift
false
false
1,943
swift
// // MaskingView.swift // Roomguru // // Created by Radoslaw Szeja on 11/05/15. // Copyright (c) 2015 Netguru Sp. z o.o. All rights reserved. // import UIKit import Cartography class MaskingView: UIView { var maskingView: UIView! var contentView: UIView! private var didSetupConstraints = false override init(frame: CGRect) { super.init(frame: frame) commonInit() } required init(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } private func commonInit() { contentView = UIView() contentView.layer.masksToBounds = true contentView.layer.cornerRadius = 5 contentView.backgroundColor = .clearColor() maskingView = UIView(frame: frame) maskingView.backgroundColor = .blackColor() maskingView.alpha = 1.0 backgroundColor = .clearColor() addSubview(maskingView) addSubview(contentView) } override func updateConstraints() { super.updateConstraints() if !didSetupConstraints { defineConstraints() didSetupConstraints = true } } private func defineConstraints() { constrain(contentView) { content in let padding = self.frame.size.width * 0.1 content.left == content.superview!.left + padding content.right == content.superview!.right - padding content.height == 250 content.top == content.superview!.bottom content.centerX == content.superview!.centerX } constrain(maskingView) { masking in masking.top == masking.superview!.top - 20 masking.left == masking.superview!.left masking.right == masking.superview!.right masking.bottom == masking.superview!.bottom } } }
[ -1 ]
b851360e45134b8d30db9bd9a3e4df9d8f58cd91
244e033a4b69801a00e5a6e31add3b4959a4a140
/version3/swift/config_curve.swift
f5da8e2d14f23afd3ac335d7bd4abc4603c48737
[ "Apache-2.0" ]
permissive
jstuczyn/amcl
782d594e58457b86f7292abfefeef6a6c1d85089
5dcc7f99f523b80f9f8e0754d912bcbcf7380316
refs/heads/master
2020-03-30T15:51:11.062194
2019-01-10T15:58:13
2019-01-10T15:58:13
151,382,472
0
0
Apache-2.0
2018-10-03T08:27:23
2018-10-03T08:27:23
null
UTF-8
Swift
false
false
690
swift
public struct CONFIG_CURVE{ static public let WEIERSTRASS=0 static public let EDWARDS=1 static public let MONTGOMERY=2 static public let NOT=0 static public let BN=1 static public let BLS=2 static public let D_TYPE=0 static public let M_TYPE=1 static public let POSITIVEX=0 static public let NEGATIVEX=1 static public let CURVETYPE = @CT@ static public let CURVE_PAIRING_TYPE = @PF@ static public let SEXTIC_TWIST = @ST@ static public let SIGN_OF_X = @SX@ static public let HASH_TYPE = @HT@ static public let AESKEY = @AK@ static let USE_GLV = true static let USE_GS_G2 = true static let USE_GS_GT = true }
[ -1 ]
c4b7e786b19c84f2628c3441bc6fcceefe011824
9af59217cca2fe3c5b7a06314031ed3fba12e22d
/Unit:UI Test Project/WordSkill-Alireza-Toghyiani-Iran/Network/NetworkInterceptor.swift
e98f65adead19e5dd1c712f33719403d917f7ba5
[]
no_license
alireza12t/Wordskills_Russia_2020
6463c9cd738463a0e1a13e3eccd45de587f2a463
f2bd4ef633bc383bc842568fd1f32578713469d4
refs/heads/master
2023-02-01T10:19:12.782679
2020-12-14T11:56:03
2020-12-14T11:56:03
321,331,976
0
0
null
null
null
null
UTF-8
Swift
false
false
2,647
swift
import Foundation import Alamofire class NetworkInterceptor: Interceptor { let network: NetworkManager = NetworkManager.sharedInstance // MARK: - RequestRetrier override func retry(_ request: Request, for session: Session, dueTo error: Error, completion: @escaping (RetryResult) -> Void) { Log.e("\(error)") Log.e("REQUEST RETRY COUNT => \(request.retryCount)") Log.e("REQUEST URL => \(String(describing: request.request?.url))") if (request.retryCount > 5) { Log.e("REQUEST RETRIED 5 TIMES") completion(.doNotRetry) } else { NetworkManager.isUnreachable { _ in Log.i("Netowk is unreachable") DispatchQueue.main.async { DialogueHelper.showNetworkErrorBanner() completion(.doNotRetry) } } NetworkManager.isReachable { _ in Log.i("Netowk is reachable") DispatchQueue.main.async { if let afError = error.asAFError { Log.e("THIS IS ALAMOFIRE ERROR") if afError.isSessionTaskError { Log.e("SESSION TASK ERROR") completion(.retryWithDelay(TimeInterval(5))) } else if let response = request.task?.response as? HTTPURLResponse { Log.e("RESPONSE CODE => \(response.statusCode)") if response.statusCode == 500 { Log.e("SERVER UNAVAILABLE ERROR") completion(.retry) } else { Log.e("THIS IS NOT SERVER UN AVAILABLE") completion(.doNotRetry) } } else { Log.e("REQUEST IS NOT HTTP URL RESPONSE") completion(.doNotRetry) } } else if let response = request.task?.response as? HTTPURLResponse { Log.e("RESPONSE CODE => \(response.statusCode)") if response.statusCode == 500 { Log.e("SERVER UNAVAILABLE ERROR") completion(.retry) } } else { Log.e("REQUEST IS NOT HTTP URL RESPONSE") completion(.doNotRetry) } } } } } }
[ -1 ]
20f8c2a859cf2d369ba84ad975b9c6f082710141
b401e314e254d9abcd95edbc280317c85d6f3513
/VimR/VimR/BufferList.swift
a03faffc3f078fac93ab0d10715f877ad89e6a02
[ "MIT" ]
permissive
binesiyu/vimr
6d41d27d82ec2f3c856ac7eacf46a784ccab5dc4
ffc9ec021c4a9be5e6416f7d15072ac6855117ea
refs/heads/develop
2022-06-06T12:44:14.538818
2022-05-05T01:54:35
2022-05-05T01:54:35
183,177,302
0
0
MIT
2021-05-08T01:29:32
2019-04-24T07:53:48
Swift
UTF-8
Swift
false
false
5,861
swift
/** * Tae Won Ha - http://taewon.de - @hataewon * See LICENSE */ import Cocoa import Commons import NvimView import PureLayout import RxSwift class BuffersList: NSView, UiComponent, NSTableViewDataSource, NSTableViewDelegate, ThemedView { typealias StateType = MainWindow.State enum Action { case open(NvimView.Buffer) } private(set) var lastThemeMark = Token() private(set) var theme = Theme.default required init( source: Observable<StateType>, emitter: ActionEmitter, state: StateType ) { self.emit = emitter.typedEmit() self.uuid = state.uuid self.usesTheme = state.appearance.usesTheme self.showsFileIcon = state.appearance.showsFileIcon super.init(frame: .zero) self.bufferList.dataSource = self self.bufferList.allowsEmptySelection = true self.bufferList.delegate = self self.bufferList.target = self self.bufferList.doubleAction = #selector(BuffersList.doubleClickAction) self.addViews() source .observe(on: MainScheduler.instance) .subscribe(onNext: { state in if state.viewToBeFocused != nil, case .bufferList = state.viewToBeFocused! { self.beFirstResponder() } let themeChanged = changeTheme( themePrefChanged: state.appearance.usesTheme != self.usesTheme, themeChanged: state.appearance.theme.mark != self.lastThemeMark, usesTheme: state.appearance.usesTheme, forTheme: { self.updateTheme(state.appearance.theme) }, forDefaultTheme: { self.updateTheme(Marked(Theme.default)) } ) self.usesTheme = state.appearance.usesTheme if self.buffers == state.buffers, !themeChanged, self.showsFileIcon == state.appearance.showsFileIcon { return } self.showsFileIcon = state.appearance.showsFileIcon self.buffers = state.buffers self.bufferList.reloadData() }) .disposed(by: self.disposeBag) } private let emit: (UuidAction<Action>) -> Void private let disposeBag = DisposeBag() private let uuid: UUID private var usesTheme: Bool private var showsFileIcon: Bool private let bufferList = NSTableView.standardTableView() private var buffers = [NvimView.Buffer]() @available(*, unavailable) required init?(coder _: NSCoder) { fatalError("init(coder:) has not been implemented") } private func updateTheme(_ theme: Marked<Theme>) { self.theme = theme.payload self.bufferList.enclosingScrollView?.backgroundColor = self.theme.background self.bufferList.backgroundColor = self.theme.background self.lastThemeMark = theme.mark } private func addViews() { let scrollView = NSScrollView.standardScrollView() scrollView.borderType = .noBorder scrollView.documentView = self.bufferList self.addSubview(scrollView) scrollView.autoPinEdgesToSuperviewEdges() } } // MARK: - Actions extension BuffersList { @objc func doubleClickAction(_: Any?) { let clickedRow = self.bufferList.clickedRow guard clickedRow >= 0, clickedRow < self.buffers.count else { return } self.emit(UuidAction(uuid: self.uuid, action: .open(self.buffers[clickedRow]))) } } // MARK: - NSTableViewDataSource extension BuffersList { @objc(numberOfRowsInTableView:) func numberOfRows(in _: NSTableView) -> Int { self.buffers.count } } // MARK: - NSTableViewDelegate extension BuffersList { public func tableView( _ tableView: NSTableView, rowViewForRow _: Int ) -> NSTableRowView? { tableView.makeView( withIdentifier: NSUserInterfaceItemIdentifier("buffer-row-view"), owner: self ) as? ThemedTableRow ?? ThemedTableRow( withIdentifier: "buffer-row-view", themedView: self ) } func tableView( _ tableView: NSTableView, viewFor _: NSTableColumn?, row: Int ) -> NSView? { let cachedCell = (tableView.makeView( withIdentifier: NSUserInterfaceItemIdentifier("buffer-cell-view"), owner: self ) as? ThemedTableCell)?.reset() let cell = cachedCell ?? ThemedTableCell(withIdentifier: "buffer-cell-view") let buffer = self.buffers[row] cell.attributedText = self.text(for: buffer) guard self.showsFileIcon else { return cell } cell.image = self.icon(for: buffer) return cell } func tableView( _: NSTableView, didAdd rowView: NSTableRowView, forRow _: Int ) { guard let cellWidth = (rowView.view(atColumn: 0) as? NSTableCellView)? .fittingSize.width else { return } self.bufferList.tableColumns[0].width = max( self.bufferList.tableColumns[0].width, cellWidth + 10.0 ) } private func text(for buffer: NvimView.Buffer) -> NSAttributedString { guard let name = buffer.name else { return NSAttributedString(string: "No Name") } guard let url = buffer.url else { return NSAttributedString(string: name) } let pathInfo = url.pathComponents .dropFirst() .dropLast() .reversed() .joined(separator: " / ") + " /" let rowText = NSMutableAttributedString(string: "\(name) — \(pathInfo)") rowText.addAttribute( NSAttributedString.Key.foregroundColor, value: self.theme.foreground, range: NSRange(location: 0, length: name.count) ) rowText.addAttribute( NSAttributedString.Key.foregroundColor, value: self.theme.foreground.brightening(by: 1.15), range: NSRange(location: name.count, length: pathInfo.count + 3) ) return rowText } private func icon(for buffer: NvimView.Buffer) -> NSImage? { if let url = buffer.url { return FileUtils.icon(forUrl: url) } return genericIcon } } private let genericIcon = FileUtils.icon(forType: "public.data")
[ -1 ]
70ea29447e32ca072d6357e39e00f8ec2f69503e
53bedbab8ddd16873cbec15bc589950fc3c09a51
/StarWarsAppSaleem/Delegates/FilmTableViewDelegate.swift
a4ac034281fc7c83889cb184f641126f70960963
[]
no_license
SaleemManjoo/StarWarsNativeIOSApp
97567f30e5e9f393b9c82679096c2f634d5a7463
6623c50bbfb784017afe923f3dd8cc71a43ad232
refs/heads/master
2020-06-16T16:16:11.315103
2019-07-09T20:07:37
2019-07-09T20:07:37
195,633,182
0
0
null
null
null
null
UTF-8
Swift
false
false
1,736
swift
// // FilmTableViewDelegate.swift // StarWarsAppSaleem // // Created by Saleem Manjoo on 2019/07/07. // Copyright © 2019 Saleem Manjoo. All rights reserved. // import Foundation import UIKit class FilmTableViewDelegate: NSObject, UITableViewDelegate, UITableViewDataSource { var films: [Film] = [Film]() var parentNavigationController: UINavigationController? func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return films.count } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "FilmCell", for: indexPath) as! FilmCell let film: Film = films[indexPath.row] cell.addContent(film: film) return cell } func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { return CGFloat(120) } func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { let storyboard = UIStoryboard.init(name: "Main", bundle: nil) let detailViewController: FilmDetailViewController = storyboard.instantiateViewController(withIdentifier: "FilmDetailViewController") as! FilmDetailViewController detailViewController.film = films[indexPath.row] parentNavigationController?.pushViewController(detailViewController, animated: false) if let selectionIndexPath = tableView.indexPathForSelectedRow { tableView.deselectRow(at: selectionIndexPath, animated: false) } } func addToTableView(film: Film) { self.films.append(film) } }
[ -1 ]
4749d14fbd86e624741ef4381925a7e82f965875
bc5abdd206fe52777794d88f87e24b24ee100b0f
/POC-Twitter/POC-Twitter/TweetWebView.swift
e4f4499189d0641a062852a663aa0a03ba70d996
[]
no_license
warchimede/POC-iOS-Twitter
f1599705c369601c15b16199191c3455326ec1b6
cdfee1fe0d136ade7707db58774f6cad92c51c32
refs/heads/master
2021-05-21T03:19:35.216608
2020-04-02T17:14:34
2020-04-02T17:14:34
252,520,289
1
0
null
null
null
null
UTF-8
Swift
false
false
1,557
swift
// // TweetWebView.swift // POC-Twitter // // Created by William Archimède on 02/04/2020. // Copyright © 2020 William Archimede. All rights reserved. // import Foundation import WebKit class TweetWebView: WKWebView { private static let html = """ <html> <head> <meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no'> </head> <body> <div id='wrapper'></div> </body> </html> """ // Load widgets.js globally private static let widgetsScript: String? = try? String(contentsOf: URL(string: "https://platform.twitter.com/widgets.js")!) private static func loadScript(tweetId: Int) -> String { // Documentation: // https://developer.twitter.com/en/docs/twitter-for-websites/embedded-tweets/guides/embedded-tweet-javascript-factory-function return """ twttr.widgets.load(); twttr.widgets.createTweet( '\(tweetId)', document.getElementById('wrapper'), { align: 'center' } ).then(el => { window.webkit.messageHandlers.heightCallback.postMessage(el.offsetHeight.toString()) }); """ } var height = TweetCell.defaultCellHeight func loadHTML() { guard let url = URL(string: "https://france.tv") else { return } loadHTMLString(TweetWebView.html, baseURL: url) } func loadScripts(tweetId: Int) { guard let widgetsScript = TweetWebView.widgetsScript else { return } evaluateJavaScript(widgetsScript) evaluateJavaScript(TweetWebView.loadScript(tweetId: tweetId)) } }
[ -1 ]
07cf73320f880bd44a7f2947e6494d3a4729ab9d
c4940ad5c8c68b0eece8d9b3582e8eda87fb9739
/gen/grammars-v4/clojure/ClojureBaseListener.swift
7ee853709e8b1ec22cd6576227c1fc6824dbebf4
[ "BSD-2-Clause" ]
permissive
johndpope/ANTLR-Swift-Target
90011e2a016b6f2c1b1df8ae9dd27d875eff6b41
3cb7122b2e65ae95c8d76781ecf0dbfafb2cb4ef
refs/heads/master
2021-01-15T14:37:21.302181
2017-04-29T18:25:02
2017-04-29T18:25:02
57,343,692
0
0
null
2016-04-29T00:52:10
2016-04-29T00:52:10
null
UTF-8
Swift
false
false
12,825
swift
// Generated from ./grammars-v4/clojure/Clojure.g4 by ANTLR 4.5.1 import Antlr4 /** * This class provides an empty implementation of {@link ClojureListener}, * which can be extended to create a listener which only needs to handle a subset * of the available methods. */ open class ClojureBaseListener: ClojureListener { public init() { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterFile(_ ctx: ClojureParser.FileContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitFile(_ ctx: ClojureParser.FileContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterForm(_ ctx: ClojureParser.FormContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitForm(_ ctx: ClojureParser.FormContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterForms(_ ctx: ClojureParser.FormsContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitForms(_ ctx: ClojureParser.FormsContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterList(_ ctx: ClojureParser.ListContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitList(_ ctx: ClojureParser.ListContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterVector(_ ctx: ClojureParser.VectorContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitVector(_ ctx: ClojureParser.VectorContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterMap(_ ctx: ClojureParser.MapContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitMap(_ ctx: ClojureParser.MapContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterSet(_ ctx: ClojureParser.SetContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitSet(_ ctx: ClojureParser.SetContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterReader_macro(_ ctx: ClojureParser.Reader_macroContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitReader_macro(_ ctx: ClojureParser.Reader_macroContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterQuote(_ ctx: ClojureParser.QuoteContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitQuote(_ ctx: ClojureParser.QuoteContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterBacktick(_ ctx: ClojureParser.BacktickContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitBacktick(_ ctx: ClojureParser.BacktickContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterUnquote(_ ctx: ClojureParser.UnquoteContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitUnquote(_ ctx: ClojureParser.UnquoteContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterUnquote_splicing(_ ctx: ClojureParser.Unquote_splicingContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitUnquote_splicing(_ ctx: ClojureParser.Unquote_splicingContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterTag(_ ctx: ClojureParser.TagContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitTag(_ ctx: ClojureParser.TagContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterDeref(_ ctx: ClojureParser.DerefContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitDeref(_ ctx: ClojureParser.DerefContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterGensym(_ ctx: ClojureParser.GensymContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitGensym(_ ctx: ClojureParser.GensymContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterLambda(_ ctx: ClojureParser.LambdaContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitLambda(_ ctx: ClojureParser.LambdaContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterMeta_data(_ ctx: ClojureParser.Meta_dataContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitMeta_data(_ ctx: ClojureParser.Meta_dataContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterVar_quote(_ ctx: ClojureParser.Var_quoteContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitVar_quote(_ ctx: ClojureParser.Var_quoteContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterHost_expr(_ ctx: ClojureParser.Host_exprContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitHost_expr(_ ctx: ClojureParser.Host_exprContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterDiscard(_ ctx: ClojureParser.DiscardContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitDiscard(_ ctx: ClojureParser.DiscardContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterDispatch(_ ctx: ClojureParser.DispatchContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitDispatch(_ ctx: ClojureParser.DispatchContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterRegex(_ ctx: ClojureParser.RegexContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitRegex(_ ctx: ClojureParser.RegexContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterLiteral(_ ctx: ClojureParser.LiteralContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitLiteral(_ ctx: ClojureParser.LiteralContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterString(_ ctx: ClojureParser.StringContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitString(_ ctx: ClojureParser.StringContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterHex(_ ctx: ClojureParser.HexContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitHex(_ ctx: ClojureParser.HexContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterBin(_ ctx: ClojureParser.BinContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitBin(_ ctx: ClojureParser.BinContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterBign(_ ctx: ClojureParser.BignContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitBign(_ ctx: ClojureParser.BignContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterNumber(_ ctx: ClojureParser.NumberContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitNumber(_ ctx: ClojureParser.NumberContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterCharacter(_ ctx: ClojureParser.CharacterContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitCharacter(_ ctx: ClojureParser.CharacterContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterNamed_char(_ ctx: ClojureParser.Named_charContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitNamed_char(_ ctx: ClojureParser.Named_charContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterAny_char(_ ctx: ClojureParser.Any_charContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitAny_char(_ ctx: ClojureParser.Any_charContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterU_hex_quad(_ ctx: ClojureParser.U_hex_quadContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitU_hex_quad(_ ctx: ClojureParser.U_hex_quadContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterNil(_ ctx: ClojureParser.NilContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitNil(_ ctx: ClojureParser.NilContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterKeyword(_ ctx: ClojureParser.KeywordContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitKeyword(_ ctx: ClojureParser.KeywordContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterSimple_keyword(_ ctx: ClojureParser.Simple_keywordContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitSimple_keyword(_ ctx: ClojureParser.Simple_keywordContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterMacro_keyword(_ ctx: ClojureParser.Macro_keywordContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitMacro_keyword(_ ctx: ClojureParser.Macro_keywordContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterSymbol(_ ctx: ClojureParser.SymbolContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitSymbol(_ ctx: ClojureParser.SymbolContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterSimple_sym(_ ctx: ClojureParser.Simple_symContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitSimple_sym(_ ctx: ClojureParser.Simple_symContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterNs_symbol(_ ctx: ClojureParser.Ns_symbolContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitNs_symbol(_ ctx: ClojureParser.Ns_symbolContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterParam_name(_ ctx: ClojureParser.Param_nameContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitParam_name(_ ctx: ClojureParser.Param_nameContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterEveryRule(_ ctx: ParserRuleContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitEveryRule(_ ctx: ParserRuleContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func visitTerminal(_ node: TerminalNode) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func visitErrorNode(_ node: ErrorNode) { } }
[ -1 ]
0cd8c22ca9329a37663900b9fd2ec3b15291a5fe
759419a0e1cdb89f93e895bd095faeefd6c62a33
/Nymeria/Views/NYMenuTableViewCell.swift
451dc78ec107ffbb25929c71adf7f7ca15378b53
[]
no_license
alexiss03/fb101-blueprint
369c5275c54918c591892283dbf96a5a1c9bef0d
415fea70b791d604bde1cdfacaa9e8bc1196e036
refs/heads/master
2023-07-10T05:27:17.000919
2021-08-05T18:54:30
2021-08-05T18:54:30
393,143,027
0
0
null
null
null
null
UTF-8
Swift
false
false
480
swift
// // NYMenuTableViewCell.swift // Nymeria // // Created by Mary Alexis Solis on 06/06/2016. // Copyright © 2016 Boy Flores. All rights reserved. // import UIKit class NYMenuTableViewCell: UITableViewCell { @IBOutlet weak var titleLbl: UILabel! override func awakeFromNib() { super.awakeFromNib() } override func setSelected(_ selected: Bool, animated: Bool) { super.setSelected(selected, animated: animated) } }
[ 126149, 123527, 372751, 372752, 261180 ]
6c4115c30b702c5c442243ad97442774e1650f1d
183ed33af49ad0e95ef0b0fc3239ff1a2a99a6c5
/Tests/DatadogTests/DatadogObjc/DDLoggerBuilderTests.swift
503d3788f718eef7d44ba0e083e2ec4df72874f0
[ "Apache-2.0", "MIT" ]
permissive
chriskilpin/dd-sdk-ios
6a3c8a7b518f7c5f3e222e4c7f552177d751bef2
fcbacd6f7a2cfaaa9159cb6140a5ca19453f492f
refs/heads/master
2023-08-27T20:58:17.745646
2021-10-08T14:27:37
2021-10-08T14:27:37
null
0
0
null
null
null
null
UTF-8
Swift
false
false
1,050
swift
/* * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. * This product includes software developed at Datadog (https://www.datadoghq.com/). * Copyright 2019-2020 Datadog, Inc. */ import XCTest @testable import Datadog @testable import DatadogObjc class DDLoggerBuilderTests: XCTestCase { func testItForwardsConfigurationToSwift() { let swiftBuilder = Logger.builder let objcBuilder = DDLoggerBuilder(sdkBuilder: swiftBuilder) objcBuilder.set(loggerName: "logger-name") objcBuilder.set(serviceName: "service-name") objcBuilder.sendNetworkInfo(true) objcBuilder.sendLogsToDatadog(false) objcBuilder.printLogsToConsole(true) XCTAssertEqual(swiftBuilder.loggerName, "logger-name") XCTAssertEqual(swiftBuilder.serviceName, "service-name") XCTAssertTrue(swiftBuilder.sendNetworkInfo) XCTAssertFalse(swiftBuilder.useFileOutput) XCTAssertNotNil(swiftBuilder.useConsoleLogFormat) } }
[ -1 ]
1ebcf1698d15f725997fe6461282f040c23d6523
45d443e7f2c8f85a4d171f27057e9a9fe0ea5c74
/assessment/Module/ContactList/Scene/ContactListViewController.swift
d801333b65507ffb6c0f5ebe011141e766c71194
[]
no_license
MJieLai/assessment_tw
58d34cd6b4d40434c8ad199cec8a37d9372eb77f
836f932fa47220400159ba8cc098d042c1c92185
refs/heads/main
2023-08-16T00:06:25.957812
2021-10-16T05:37:03
2021-10-16T05:37:03
null
0
0
null
null
null
null
UTF-8
Swift
false
false
5,960
swift
// // ContactListViewController.swift // assessment // // Created by Hexa-MingJie.Lai on 16/10/2021. // import UIKit class ContactListViewController: UIViewController { //MARK: - Outlets @IBOutlet weak var searchBar: UISearchBar! @IBOutlet weak var listView: UITableView! //MARK: - Variables private var contactListViewModel : ContactListViewModel! private var dataSource: ContactListTableViewDataSource<ContactListTableViewCell, Contact>! var activityView: UIActivityIndicatorView? var isSearchBarShown: Bool = false let refreshControl = UIRefreshControl() //MARK: - Lifecycle override func viewDidLoad() { super.viewDidLoad() setupNavigationBar() setupView() callToViewModelForUIUpdate() } //MARK: - View Set up func setupNavigationBar() { self.title = "Contacts" let searchButton = UIBarButtonItem(barButtonSystemItem: .search, target: self, action: #selector(searchAction)) navigationItem.leftBarButtonItem = searchButton navigationItem.leftBarButtonItem?.tintColor = UIColor(rgb: 0xff8c00) let addButton = UIBarButtonItem(barButtonSystemItem: .add, target: self, action: #selector(addAction)) navigationItem.rightBarButtonItem = addButton navigationItem.rightBarButtonItem?.tintColor = UIColor(rgb: 0xff8c00) } func setupView() { searchBar.isHidden = true searchBar.delegate = self let nib = UINib(nibName: "ContactListTableViewCell", bundle: Bundle.main) listView.register(nib, forCellReuseIdentifier: "ContactListTableViewCell") listView.tableFooterView = UIView(frame: .zero) listView.rowHeight = 80 listView.delegate = self refreshControl.attributedTitle = NSAttributedString(string: "Pull to refresh") refreshControl.addTarget(self, action: #selector(self.refresh(_:)), for: .valueChanged) listView.addSubview(refreshControl) } //MARK: - View Model func callToViewModelForUIUpdate(){ self.contactListViewModel = ContactListViewModel() //* Call APi self.showActivityIndicator() self.contactListViewModel.getContactListData() //* Display data DispatchQueue.main.async { self.updateDataSource() } } func updateDataSource(){ let data = ((self.contactListViewModel.filteredContactList.count == 0) && !isSearchBarShown) ? self.contactListViewModel.contactListData : self.contactListViewModel.filteredContactList self.dataSource = ContactListTableViewDataSource(cellIdentifier: "ContactListTableViewCell", items: data, configureCell: { (cell, evm) in cell.contactNameLabel.text = "\(evm.firstName ?? "") \(evm.lastName ?? "")" }) DispatchQueue.main.async { self.hideActivityIndicator() self.listView.dataSource = self.dataSource self.listView.reloadData() } } //MARK:- Actions @objc func refresh(_ sender: AnyObject) { self.contactListViewModel.getContactListData() DispatchQueue.main.async { self.updateDataSource() self.refreshControl.endRefreshing() } } @objc func searchAction(sender: UIButton!) { isSearchBarShown = !isSearchBarShown searchBar.isHidden = !isSearchBarShown searchBar.endEditing(isSearchBarShown) } @objc func addAction(sender: UIButton!) { let contactDetailViewController = self.storyboard?.instantiateViewController(withIdentifier: "ContactDetailViewController") as! ContactDetailViewController contactDetailViewController.delegate = self self.navigationController?.pushViewController(contactDetailViewController, animated: true) } //MARK: - Helper func showActivityIndicator() { activityView = UIActivityIndicatorView(style: .large) activityView?.center = self.view.center self.view.addSubview(activityView!) activityView?.startAnimating() } func hideActivityIndicator(){ if (activityView != nil){ activityView?.stopAnimating() } } } extension ContactListViewController: UpdateContactDelegate { func updateContact(contact: Contact) { if let index = self.contactListViewModel.contactListData.firstIndex(where: {$0.id == contact.id}) { self.contactListViewModel.contactListData.remove(at: index) self.contactListViewModel.contactListData.insert(contact, at: index) } self.updateDataSource() } func createContact(contact: Contact) { self.contactListViewModel.contactListData.insert(contact, at: 0) self.updateDataSource() } } extension ContactListViewController: UITableViewDelegate { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { let contactDetailViewController = self.storyboard?.instantiateViewController(withIdentifier: "ContactDetailViewController") as! ContactDetailViewController contactDetailViewController.contactData = self.contactListViewModel.contactListData[indexPath.row] contactDetailViewController.delegate = self self.navigationController?.pushViewController(contactDetailViewController, animated: true) } } extension ContactListViewController: UISearchBarDelegate { func searchBar(_ searchBar: UISearchBar, textDidChange searchText: String) { let data = self.contactListViewModel.contactListData let filterdata = searchText.isEmpty ? data : data.filter { ($0.firstName?.contains(searchText) == true) || ($0.lastName?.contains(searchText) == true) } self.contactListViewModel.filteredContactList = filterdata self.updateDataSource() } }
[ -1 ]
7584efca7d8bb56ec888e62aff248fbd857f734b
e8bf8e8932c4872f83c4c35590403ce5b8b17666
/CBTabBarController/Classes/Menu/CBMenuPresentAnimationController.swift
c022e232fcb2eb9770c4c32e834fc4902c37a171
[ "MIT" ]
permissive
Razum1411/VpsvilleUI
a7ad02d1b42433af56fd3e2b0431f7bb9744ccd5
f9bb32212d0d06a3200c8d0dd9cfb35ffa321f46
refs/heads/master
2020-06-26T20:20:10.568816
2019-08-28T23:32:44
2019-08-28T23:32:44
199,746,715
0
0
null
null
null
null
UTF-8
Swift
false
false
12,566
swift
// // CBMenuPresentAnimationController.swift // CBTabBarController // // Created by Anton Skopin on 21/03/2019. // Copyright © 2019 cuberto. All rights reserved. // import UIKit class CBMenuPresentAnimationController: NSObject, UIViewControllerAnimatedTransitioning, UIViewControllerInteractiveTransitioning { var maxOffset: CGFloat = 0 let offsetSpeed: CGFloat = 650 private let duration: Double = 0.5 private var interactiveContext: UIViewControllerContextTransitioning? private var transitionContext: UIViewControllerContextTransitioning? private var fromView: UIView? private var toView: UIView? private var toViewController: CBMenuController? private var displayLink: CADisplayLink? private var lastProgress: CGFloat? private var lastOffset: CGFloat = 0 private var startTime: TimeInterval = CACurrentMediaTime() weak var menuButton: UIView? private var animationButton: UIView? private var animationButtonStart: CGRect = .zero deinit { clear() } func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval { return TimeInterval(maxOffset/offsetSpeed) } private func startTransition(using transitionContext: UIViewControllerContextTransitioning) { guard let fromView = transitionContext.view(forKey: .from) else { return } guard let toView = transitionContext.view(forKey: .to) else { return } toViewController = transitionContext.viewController(forKey: .to) as? CBMenuController self.fromView = fromView self.toView = toView self.transitionContext = transitionContext let mask = CAShapeLayer() let container = transitionContext.containerView container.addSubview(toView) if let menuButton = menuButton, let animationButton = menuButton.snapshotView(afterScreenUpdates: false) { container.addSubview(animationButton) animationButton.frame = fromView.convert(menuButton.frame, from: menuButton.superview) animationButtonStart = animationButton.frame self.animationButton = animationButton } toViewController?.menuContainer.alpha = 0 toViewController?.dismissButton.alpha = 0 menuButton?.isHidden = true toView.layer.mask = mask startTime = CACurrentMediaTime() lastOffset = 0 let displayLink = CADisplayLink(target: self, selector: #selector(screenUpdate)) displayLink.add(to: .current, forMode: .common) self.displayLink = displayLink } func animateTransition(using transitionContext: UIViewControllerContextTransitioning) { startTransition(using: transitionContext) } func startInteractiveTransition(_ transitionContext: UIViewControllerContextTransitioning) { interactiveContext = transitionContext startTransition(using: transitionContext) } func update(to progress: CGFloat, offset: CGFloat) { lastProgress = progress lastOffset = offset } var finishing: Bool = false var cancelling: Bool = false var lastScreenUpdateTime: TimeInterval = CACurrentMediaTime() @objc func screenUpdate() { defer { lastScreenUpdateTime = CACurrentMediaTime() } let progress = lastProgress ?? CGFloat((CACurrentMediaTime() - startTime)/duration) let timeDiff = CGFloat(CACurrentMediaTime() - lastScreenUpdateTime) var alphaProgress = min(1.0, progress/0.3) if cancelling || finishing { lastOffset -= offsetSpeed * timeDiff lastOffset = max(minOffset, lastOffset) } else if lastProgress == nil { lastOffset += offsetSpeed * timeDiff finishing = lastOffset > maxOffset finishOffset = -lastOffset } var btnOffset = -lastOffset var buttonOnPlace: Bool = false var buttonAnimationFinished: Bool = false let maskOnPlace: Bool = (lastOffset <= minOffset) let menuTargetOffsetY = (toViewController?.dismissButton.frame.minY ?? 0) - animationButtonStart.minY if finishing { let btnOffsetSpeed = offsetSpeed * (abs(menuTargetOffsetY)/(maxOffset + 100)) finishOffset -= btnOffsetSpeed * timeDiff buttonOnPlace = finishOffset <= menuTargetOffsetY btnOffset = max(menuTargetOffsetY, finishOffset) let finishPercent = (maxOffset + finishOffset)/(menuTargetOffsetY + maxOffset) toViewController?.menuContainer.alpha = min(1.0, finishPercent) if buttonOnPlace && !buttonAnimationFinished { let btnAlphaSpeed: CGFloat = 4 if let btnDismiss = toViewController?.dismissButton { btnDismiss.alpha = min(1.0, btnDismiss.alpha + btnAlphaSpeed * timeDiff) } if let btnPresent = animationButton { btnPresent.alpha = max(0.0, btnPresent.alpha - btnAlphaSpeed * timeDiff) buttonAnimationFinished = btnPresent.alpha <= 0 } else { buttonAnimationFinished = true } } } if cancelling { alphaProgress = min(alphaProgress, (lastOffset - minOffset)/(cancelOffset - minOffset)) } if let toView = toView { toView.alpha = alphaProgress if finishing { (toView.layer.mask as? CAShapeLayer)?.path = finishPath(forView: toView, offset: lastOffset) } else { (toView.layer.mask as? CAShapeLayer)?.path = path(forView: toView, offset: lastOffset) } } if let animationButton = animationButton { animationButton.transform = CGAffineTransform(translationX: 0, y: min(0, btnOffset)) .rotated(by: btnOffset/menuTargetOffsetY * CGFloat.pi/4.0) } if finishing && buttonOnPlace && maskOnPlace && buttonAnimationFinished { transitionContext?.completeTransition(true) menuButton?.isHidden = false toViewController?.menuContainer.alpha = 1.0 toViewController?.dismissButton.alpha = 1.0 clear() return } if cancelling && maskOnPlace { toView?.removeFromSuperview() menuButton?.isHidden = false transitionContext?.completeTransition(false) clear() return } } var minOffset: CGFloat { return 0 } func lineCoeff(pt1: CGPoint, pt2: CGPoint) -> (k: CGFloat, b: CGFloat) { if pt1.x == pt2.y { return (k: 0, b: 0) } let k = (pt1.y - pt2.y)/(pt1.x - pt2.x) let b = pt1.y - k * pt1.x return (k: k, b: b) } private let defaultCentralOffsetY: CGFloat = 60 func path(forView view: UIView, offset: CGFloat) -> CGPath { let centerX = menuButton?.frame.midX ?? view.bounds.width/2 let path = UIBezierPath() path.move(to: .zero) path.addLine(to: CGPoint(x: view.bounds.width, y: 0)) path.addLine(to: CGPoint(x: view.bounds.width, y: view.bounds.height)) let bottomOffset: CGFloat = 0 let pt1 = CGPoint(x: centerX + view.bounds.width/2, y: view.bounds.height + bottomOffset) path.addLine(to: pt1) let centralOffsetX = max(28.0, 50 - abs(offset * 0.2)) let centralOffsetY = 60 / 375 * view.bounds.width + offset * (0.83 / 320 * view.bounds.width) let pt2 = CGPoint(x: centerX + centralOffsetX, y: view.bounds.height - centralOffsetY) let pt3 = CGPoint(x: centerX - centralOffsetX, y: view.bounds.height - centralOffsetY) let pt4 = CGPoint(x: centerX - view.bounds.width/2, y: view.bounds.height + bottomOffset) let dcp21x: CGFloat = 55 / 375 * view.bounds.width let cpt21 = pt2.offsetBy(dx: max(-(centralOffsetX + 10), dcp21x - offset * 0.6), dy: 50 + max(0, offset * 0.5)) let rightLineCoeff = lineCoeff(pt1: cpt21, pt2: pt2) let cpt22y: CGFloat = pt2.y - max(10.0, dcp21x - max(0, offset * 0.1)) let cpt22x: CGFloat = rightLineCoeff.k != 0 ? (cpt22y - rightLineCoeff.b)/rightLineCoeff.k : 0 let cpt22 = CGPoint(x: cpt22x, y: cpt22y) let cpt31 = CGPoint(x: pt3.x + (pt2.x - cpt22.x), y: cpt22y) let cpt32 = CGPoint(x: pt3.x - (cpt21.x - pt2.x), y: cpt21.y) let dcpt12x = -44 / 375 * view.bounds.width - max(0, offset * 0.5) path.addCurve(to: pt2, controlPoint1: pt1.offsetBy(dx: dcpt12x, dy: 0), controlPoint2: cpt21) path.addCurve(to: pt3, controlPoint1: cpt22, controlPoint2: cpt31) path.addCurve(to: pt4, controlPoint1: cpt32, controlPoint2: pt4.offsetBy(dx: -dcpt12x, dy: 0)) path.addLine(to: CGPoint(x: 0, y: view.bounds.height)) path.close() return path.cgPath } func finishPath(forView view: UIView, offset: CGFloat) -> CGPath { let centerX = menuButton?.frame.midX ?? view.bounds.width/2 let correctedOffset = offset - 50 let path = UIBezierPath() path.move(to: .zero) path.addLine(to: CGPoint(x: view.bounds.width, y: 0)) path.addLine(to: CGPoint(x: view.bounds.width, y: view.bounds.height)) let bottomOffset: CGFloat = 0 let pt1 = CGPoint(x: centerX + view.bounds.width/2, y: view.bounds.height + bottomOffset) path.addLine(to: pt1) let centralOffsetX: CGFloat = 10 let centralOffsetY = correctedOffset * 0.9 let pt2 = CGPoint(x: centerX + centralOffsetX, y: view.bounds.height - centralOffsetY) let pt3 = CGPoint(x: centerX - centralOffsetX, y: view.bounds.height - centralOffsetY) let pt4 = CGPoint(x: centerX - view.bounds.width/2, y: view.bounds.height + bottomOffset) let dcp21x: CGFloat = 10 / 375 * view.bounds.width let dcp21xCorrected: CGFloat = dcp21x let cpt21 = pt2.offsetBy(dx: dcp21xCorrected, dy: min(view.bounds.height - pt2.y, 50 + max(0, correctedOffset * 0.5))) let rightLineCoeff = lineCoeff(pt1: cpt21, pt2: pt2) let cpt22y: CGFloat = pt2.y - min(cpt21.y - pt2.y, max(10.0, dcp21x - max(0, correctedOffset * 0.1))) let cpt22x: CGFloat = rightLineCoeff.k != 0 ? (cpt22y - rightLineCoeff.b)/rightLineCoeff.k : 0 let cpt22 = CGPoint(x: cpt22x, y: cpt22y) let cpt31 = CGPoint(x: pt3.x + (pt2.x - cpt22.x), y: cpt22y) let cpt32 = CGPoint(x: pt3.x - (cpt21.x - pt2.x), y: cpt21.y) let dcpt12x = -44 / 375 * view.bounds.width - max(0, correctedOffset * 0.5) path.addCurve(to: pt2, controlPoint1: pt1.offsetBy(dx: dcpt12x, dy: 0), controlPoint2: cpt21) path.addCurve(to: pt3, controlPoint1: cpt22, controlPoint2: cpt31) path.addCurve(to: pt4, controlPoint1: cpt32, controlPoint2: pt4.offsetBy(dx: -dcpt12x, dy: 0)) path.addLine(to: CGPoint(x: 0, y: view.bounds.height)) path.close() return path.cgPath } var cancelOffset: CGFloat = 0 var finishOffset: CGFloat = 0 func finishTransition() { finishOffset = -lastOffset interactiveContext?.finishInteractiveTransition() finishing = true } func cancelTransition() { cancelOffset = lastOffset interactiveContext?.cancelInteractiveTransition() cancelling = true } func clear() { toView?.layer.mask = nil fromView = nil toView = nil interactiveContext = nil displayLink?.remove(from: .current, forMode: .common) displayLink = nil cancelling = false cancelling = false menuButton = nil animationButton?.removeFromSuperview() animationButton = nil } }
[ -1 ]
3cf24d2eaf36db4ee0896519c75532e48a6542c1
9a8336938dbad40125800064fb921f18017c6eda
/Sources/micasaLib/Configuration.swift
4d624352031e1a61c884cc28ab569f63db40694b
[ "Apache-2.0" ]
permissive
MiCasa-HomeKit/MiCasa
12759d00fe785fcbf23cd85eda3f0691b291aeb2
1fb94b887bd37736f13f61b9ae6311caae7222c3
refs/heads/main
2023-08-22T23:01:31.693606
2021-05-10T17:20:58
2021-05-10T17:20:58
307,277,759
4
0
Apache-2.0
2020-11-06T18:26:16
2020-10-26T06:15:20
Swift
UTF-8
Swift
false
false
1,343
swift
/* Copyright 2020 MiCasa Development Team 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 import AnyCodable public struct BridgeConfiguration: Codable { public var name: String public var serialNumber: String public var setupCode: String } public struct PluginConfiguration: Codable { public var plugin: String public var configuration: [String: AnyCodable] } public struct Configuration: Codable { public var bridge: BridgeConfiguration public var plugins: [PluginConfiguration] public static func load(from url: URL) throws -> Configuration { let configJson = try Data(contentsOf: url) return try load(from: configJson) } public static func load(from data: Data) throws -> Configuration { let decoder = JSONDecoder() return try decoder.decode(Configuration.self, from: data) } }
[ -1 ]
ee6ad62ec24413eacdbf1cf07ac823136f879c13
2e6f7efbe6771a001dd5a60f00c2fe3e15776493
/Sources/ModelsR4/Extension.swift
423b9ec762924fdeab9481413f90ce48fdf95590
[ "Apache-2.0" ]
permissive
lightspeedretail/FHIRModels
b84aab57d62d89f4f81fe3857110201ddf1a8b7e
c91e5bb74397136f79656bebdfda76a523d3e88c
refs/heads/main
2023-01-13T11:10:12.661475
2020-11-18T00:06:17
2020-11-18T00:06:17
383,225,321
0
0
Apache-2.0
2021-07-05T18:00:39
2021-07-05T18:00:38
null
UTF-8
Swift
false
false
27,610
swift
// // Extension.swift // HealthSoftware // // Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Extension) // Copyright 2020 Apple Inc. // // 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 FMCore /** Optional Extensions Element. Optional Extension Element - found in all resources. */ open class Extension: Element { /// All possible types for "value[x]" public enum ValueX: Hashable { case address(Address) case age(Age) case annotation(Annotation) case attachment(Attachment) case base64Binary(FHIRPrimitive<Base64Binary>) case boolean(FHIRPrimitive<FHIRBool>) case canonical(FHIRPrimitive<Canonical>) case code(FHIRPrimitive<FHIRString>) case codeableConcept(CodeableConcept) case coding(Coding) case contactDetail(ContactDetail) case contactPoint(ContactPoint) case contributor(Contributor) case count(Count) case dataRequirement(DataRequirement) case date(FHIRPrimitive<FHIRDate>) case dateTime(FHIRPrimitive<DateTime>) case decimal(FHIRPrimitive<FHIRDecimal>) case distance(Distance) case dosage(Dosage) case duration(Duration) case expression(Expression) case humanName(HumanName) case id(FHIRPrimitive<FHIRString>) case identifier(Identifier) case instant(FHIRPrimitive<Instant>) case integer(FHIRPrimitive<FHIRInteger>) case markdown(FHIRPrimitive<FHIRString>) case meta(Meta) case money(Money) case oid(FHIRPrimitive<FHIRURI>) case parameterDefinition(ParameterDefinition) case period(Period) case positiveInt(FHIRPrimitive<FHIRPositiveInteger>) case quantity(Quantity) case range(Range) case ratio(Ratio) case reference(Reference) case relatedArtifact(RelatedArtifact) case sampledData(SampledData) case signature(Signature) case string(FHIRPrimitive<FHIRString>) case time(FHIRPrimitive<FHIRTime>) case timing(Timing) case triggerDefinition(TriggerDefinition) case unsignedInt(FHIRPrimitive<FHIRUnsignedInteger>) case uri(FHIRPrimitive<FHIRURI>) case url(FHIRPrimitive<FHIRURI>) case usageContext(UsageContext) case uuid(FHIRPrimitive<FHIRURI>) } /// identifies the meaning of the extension public var url: FHIRPrimitive<FHIRURI> /// Value of extension /// One of `value[x]` public var value: ValueX? /// Designated initializer taking all required properties public init(url: FHIRPrimitive<FHIRURI>) { self.url = url super.init() } /// Convenience initializer public convenience init( `extension`: [Extension]? = nil, id: FHIRPrimitive<FHIRString>? = nil, url: FHIRPrimitive<FHIRURI>, value: ValueX? = nil) { self.init(url: url) self.`extension` = `extension` self.id = id self.value = value } // MARK: - Codable private enum CodingKeys: String, CodingKey { case url; case _url case valueAddress case valueAge case valueAnnotation case valueAttachment case valueBase64Binary; case _valueBase64Binary case valueBoolean; case _valueBoolean case valueCanonical; case _valueCanonical case valueCode; case _valueCode case valueCodeableConcept case valueCoding case valueContactDetail case valueContactPoint case valueContributor case valueCount case valueDataRequirement case valueDate; case _valueDate case valueDateTime; case _valueDateTime case valueDecimal; case _valueDecimal case valueDistance case valueDosage case valueDuration case valueExpression case valueHumanName case valueId; case _valueId case valueIdentifier case valueInstant; case _valueInstant case valueInteger; case _valueInteger case valueMarkdown; case _valueMarkdown case valueMeta case valueMoney case valueOid; case _valueOid case valueParameterDefinition case valuePeriod case valuePositiveInt; case _valuePositiveInt case valueQuantity case valueRange case valueRatio case valueReference case valueRelatedArtifact case valueSampledData case valueSignature case valueString; case _valueString case valueTime; case _valueTime case valueTiming case valueTriggerDefinition case valueUnsignedInt; case _valueUnsignedInt case valueUri; case _valueUri case valueUrl; case _valueUrl case valueUsageContext case valueUuid; case _valueUuid } /// Initializer for Decodable public required init(from decoder: Decoder) throws { let _container = try decoder.container(keyedBy: CodingKeys.self) // Decode all our properties self.url = try FHIRPrimitive<FHIRURI>(from: _container, forKey: .url, auxiliaryKey: ._url) var _t_value: ValueX? = nil if let valueBase64Binary = try FHIRPrimitive<Base64Binary>(from: _container, forKeyIfPresent: .valueBase64Binary, auxiliaryKey: ._valueBase64Binary) { if _t_value != nil { throw DecodingError.dataCorruptedError(forKey: .valueBase64Binary, in: _container, debugDescription: "More than one value provided for \"value\"") } _t_value = .base64Binary(valueBase64Binary) } if let valueBoolean = try FHIRPrimitive<FHIRBool>(from: _container, forKeyIfPresent: .valueBoolean, auxiliaryKey: ._valueBoolean) { if _t_value != nil { throw DecodingError.dataCorruptedError(forKey: .valueBoolean, in: _container, debugDescription: "More than one value provided for \"value\"") } _t_value = .boolean(valueBoolean) } if let valueCanonical = try FHIRPrimitive<Canonical>(from: _container, forKeyIfPresent: .valueCanonical, auxiliaryKey: ._valueCanonical) { if _t_value != nil { throw DecodingError.dataCorruptedError(forKey: .valueCanonical, in: _container, debugDescription: "More than one value provided for \"value\"") } _t_value = .canonical(valueCanonical) } if let valueCode = try FHIRPrimitive<FHIRString>(from: _container, forKeyIfPresent: .valueCode, auxiliaryKey: ._valueCode) { if _t_value != nil { throw DecodingError.dataCorruptedError(forKey: .valueCode, in: _container, debugDescription: "More than one value provided for \"value\"") } _t_value = .code(valueCode) } if let valueDate = try FHIRPrimitive<FHIRDate>(from: _container, forKeyIfPresent: .valueDate, auxiliaryKey: ._valueDate) { if _t_value != nil { throw DecodingError.dataCorruptedError(forKey: .valueDate, in: _container, debugDescription: "More than one value provided for \"value\"") } _t_value = .date(valueDate) } if let valueDateTime = try FHIRPrimitive<DateTime>(from: _container, forKeyIfPresent: .valueDateTime, auxiliaryKey: ._valueDateTime) { if _t_value != nil { throw DecodingError.dataCorruptedError(forKey: .valueDateTime, in: _container, debugDescription: "More than one value provided for \"value\"") } _t_value = .dateTime(valueDateTime) } if let valueDecimal = try FHIRPrimitive<FHIRDecimal>(from: _container, forKeyIfPresent: .valueDecimal, auxiliaryKey: ._valueDecimal) { if _t_value != nil { throw DecodingError.dataCorruptedError(forKey: .valueDecimal, in: _container, debugDescription: "More than one value provided for \"value\"") } _t_value = .decimal(valueDecimal) } if let valueId = try FHIRPrimitive<FHIRString>(from: _container, forKeyIfPresent: .valueId, auxiliaryKey: ._valueId) { if _t_value != nil { throw DecodingError.dataCorruptedError(forKey: .valueId, in: _container, debugDescription: "More than one value provided for \"value\"") } _t_value = .id(valueId) } if let valueInstant = try FHIRPrimitive<Instant>(from: _container, forKeyIfPresent: .valueInstant, auxiliaryKey: ._valueInstant) { if _t_value != nil { throw DecodingError.dataCorruptedError(forKey: .valueInstant, in: _container, debugDescription: "More than one value provided for \"value\"") } _t_value = .instant(valueInstant) } if let valueInteger = try FHIRPrimitive<FHIRInteger>(from: _container, forKeyIfPresent: .valueInteger, auxiliaryKey: ._valueInteger) { if _t_value != nil { throw DecodingError.dataCorruptedError(forKey: .valueInteger, in: _container, debugDescription: "More than one value provided for \"value\"") } _t_value = .integer(valueInteger) } if let valueMarkdown = try FHIRPrimitive<FHIRString>(from: _container, forKeyIfPresent: .valueMarkdown, auxiliaryKey: ._valueMarkdown) { if _t_value != nil { throw DecodingError.dataCorruptedError(forKey: .valueMarkdown, in: _container, debugDescription: "More than one value provided for \"value\"") } _t_value = .markdown(valueMarkdown) } if let valueOid = try FHIRPrimitive<FHIRURI>(from: _container, forKeyIfPresent: .valueOid, auxiliaryKey: ._valueOid) { if _t_value != nil { throw DecodingError.dataCorruptedError(forKey: .valueOid, in: _container, debugDescription: "More than one value provided for \"value\"") } _t_value = .oid(valueOid) } if let valuePositiveInt = try FHIRPrimitive<FHIRPositiveInteger>(from: _container, forKeyIfPresent: .valuePositiveInt, auxiliaryKey: ._valuePositiveInt) { if _t_value != nil { throw DecodingError.dataCorruptedError(forKey: .valuePositiveInt, in: _container, debugDescription: "More than one value provided for \"value\"") } _t_value = .positiveInt(valuePositiveInt) } if let valueString = try FHIRPrimitive<FHIRString>(from: _container, forKeyIfPresent: .valueString, auxiliaryKey: ._valueString) { if _t_value != nil { throw DecodingError.dataCorruptedError(forKey: .valueString, in: _container, debugDescription: "More than one value provided for \"value\"") } _t_value = .string(valueString) } if let valueTime = try FHIRPrimitive<FHIRTime>(from: _container, forKeyIfPresent: .valueTime, auxiliaryKey: ._valueTime) { if _t_value != nil { throw DecodingError.dataCorruptedError(forKey: .valueTime, in: _container, debugDescription: "More than one value provided for \"value\"") } _t_value = .time(valueTime) } if let valueUnsignedInt = try FHIRPrimitive<FHIRUnsignedInteger>(from: _container, forKeyIfPresent: .valueUnsignedInt, auxiliaryKey: ._valueUnsignedInt) { if _t_value != nil { throw DecodingError.dataCorruptedError(forKey: .valueUnsignedInt, in: _container, debugDescription: "More than one value provided for \"value\"") } _t_value = .unsignedInt(valueUnsignedInt) } if let valueUri = try FHIRPrimitive<FHIRURI>(from: _container, forKeyIfPresent: .valueUri, auxiliaryKey: ._valueUri) { if _t_value != nil { throw DecodingError.dataCorruptedError(forKey: .valueUri, in: _container, debugDescription: "More than one value provided for \"value\"") } _t_value = .uri(valueUri) } if let valueUrl = try FHIRPrimitive<FHIRURI>(from: _container, forKeyIfPresent: .valueUrl, auxiliaryKey: ._valueUrl) { if _t_value != nil { throw DecodingError.dataCorruptedError(forKey: .valueUrl, in: _container, debugDescription: "More than one value provided for \"value\"") } _t_value = .url(valueUrl) } if let valueUuid = try FHIRPrimitive<FHIRURI>(from: _container, forKeyIfPresent: .valueUuid, auxiliaryKey: ._valueUuid) { if _t_value != nil { throw DecodingError.dataCorruptedError(forKey: .valueUuid, in: _container, debugDescription: "More than one value provided for \"value\"") } _t_value = .uuid(valueUuid) } if let valueAddress = try Address(from: _container, forKeyIfPresent: .valueAddress) { if _t_value != nil { throw DecodingError.dataCorruptedError(forKey: .valueAddress, in: _container, debugDescription: "More than one value provided for \"value\"") } _t_value = .address(valueAddress) } if let valueAge = try Age(from: _container, forKeyIfPresent: .valueAge) { if _t_value != nil { throw DecodingError.dataCorruptedError(forKey: .valueAge, in: _container, debugDescription: "More than one value provided for \"value\"") } _t_value = .age(valueAge) } if let valueAnnotation = try Annotation(from: _container, forKeyIfPresent: .valueAnnotation) { if _t_value != nil { throw DecodingError.dataCorruptedError(forKey: .valueAnnotation, in: _container, debugDescription: "More than one value provided for \"value\"") } _t_value = .annotation(valueAnnotation) } if let valueAttachment = try Attachment(from: _container, forKeyIfPresent: .valueAttachment) { if _t_value != nil { throw DecodingError.dataCorruptedError(forKey: .valueAttachment, in: _container, debugDescription: "More than one value provided for \"value\"") } _t_value = .attachment(valueAttachment) } if let valueCodeableConcept = try CodeableConcept(from: _container, forKeyIfPresent: .valueCodeableConcept) { if _t_value != nil { throw DecodingError.dataCorruptedError(forKey: .valueCodeableConcept, in: _container, debugDescription: "More than one value provided for \"value\"") } _t_value = .codeableConcept(valueCodeableConcept) } if let valueCoding = try Coding(from: _container, forKeyIfPresent: .valueCoding) { if _t_value != nil { throw DecodingError.dataCorruptedError(forKey: .valueCoding, in: _container, debugDescription: "More than one value provided for \"value\"") } _t_value = .coding(valueCoding) } if let valueContactPoint = try ContactPoint(from: _container, forKeyIfPresent: .valueContactPoint) { if _t_value != nil { throw DecodingError.dataCorruptedError(forKey: .valueContactPoint, in: _container, debugDescription: "More than one value provided for \"value\"") } _t_value = .contactPoint(valueContactPoint) } if let valueCount = try Count(from: _container, forKeyIfPresent: .valueCount) { if _t_value != nil { throw DecodingError.dataCorruptedError(forKey: .valueCount, in: _container, debugDescription: "More than one value provided for \"value\"") } _t_value = .count(valueCount) } if let valueDistance = try Distance(from: _container, forKeyIfPresent: .valueDistance) { if _t_value != nil { throw DecodingError.dataCorruptedError(forKey: .valueDistance, in: _container, debugDescription: "More than one value provided for \"value\"") } _t_value = .distance(valueDistance) } if let valueDuration = try Duration(from: _container, forKeyIfPresent: .valueDuration) { if _t_value != nil { throw DecodingError.dataCorruptedError(forKey: .valueDuration, in: _container, debugDescription: "More than one value provided for \"value\"") } _t_value = .duration(valueDuration) } if let valueHumanName = try HumanName(from: _container, forKeyIfPresent: .valueHumanName) { if _t_value != nil { throw DecodingError.dataCorruptedError(forKey: .valueHumanName, in: _container, debugDescription: "More than one value provided for \"value\"") } _t_value = .humanName(valueHumanName) } if let valueIdentifier = try Identifier(from: _container, forKeyIfPresent: .valueIdentifier) { if _t_value != nil { throw DecodingError.dataCorruptedError(forKey: .valueIdentifier, in: _container, debugDescription: "More than one value provided for \"value\"") } _t_value = .identifier(valueIdentifier) } if let valueMoney = try Money(from: _container, forKeyIfPresent: .valueMoney) { if _t_value != nil { throw DecodingError.dataCorruptedError(forKey: .valueMoney, in: _container, debugDescription: "More than one value provided for \"value\"") } _t_value = .money(valueMoney) } if let valuePeriod = try Period(from: _container, forKeyIfPresent: .valuePeriod) { if _t_value != nil { throw DecodingError.dataCorruptedError(forKey: .valuePeriod, in: _container, debugDescription: "More than one value provided for \"value\"") } _t_value = .period(valuePeriod) } if let valueQuantity = try Quantity(from: _container, forKeyIfPresent: .valueQuantity) { if _t_value != nil { throw DecodingError.dataCorruptedError(forKey: .valueQuantity, in: _container, debugDescription: "More than one value provided for \"value\"") } _t_value = .quantity(valueQuantity) } if let valueRange = try Range(from: _container, forKeyIfPresent: .valueRange) { if _t_value != nil { throw DecodingError.dataCorruptedError(forKey: .valueRange, in: _container, debugDescription: "More than one value provided for \"value\"") } _t_value = .range(valueRange) } if let valueRatio = try Ratio(from: _container, forKeyIfPresent: .valueRatio) { if _t_value != nil { throw DecodingError.dataCorruptedError(forKey: .valueRatio, in: _container, debugDescription: "More than one value provided for \"value\"") } _t_value = .ratio(valueRatio) } if let valueReference = try Reference(from: _container, forKeyIfPresent: .valueReference) { if _t_value != nil { throw DecodingError.dataCorruptedError(forKey: .valueReference, in: _container, debugDescription: "More than one value provided for \"value\"") } _t_value = .reference(valueReference) } if let valueSampledData = try SampledData(from: _container, forKeyIfPresent: .valueSampledData) { if _t_value != nil { throw DecodingError.dataCorruptedError(forKey: .valueSampledData, in: _container, debugDescription: "More than one value provided for \"value\"") } _t_value = .sampledData(valueSampledData) } if let valueSignature = try Signature(from: _container, forKeyIfPresent: .valueSignature) { if _t_value != nil { throw DecodingError.dataCorruptedError(forKey: .valueSignature, in: _container, debugDescription: "More than one value provided for \"value\"") } _t_value = .signature(valueSignature) } if let valueTiming = try Timing(from: _container, forKeyIfPresent: .valueTiming) { if _t_value != nil { throw DecodingError.dataCorruptedError(forKey: .valueTiming, in: _container, debugDescription: "More than one value provided for \"value\"") } _t_value = .timing(valueTiming) } if let valueContactDetail = try ContactDetail(from: _container, forKeyIfPresent: .valueContactDetail) { if _t_value != nil { throw DecodingError.dataCorruptedError(forKey: .valueContactDetail, in: _container, debugDescription: "More than one value provided for \"value\"") } _t_value = .contactDetail(valueContactDetail) } if let valueContributor = try Contributor(from: _container, forKeyIfPresent: .valueContributor) { if _t_value != nil { throw DecodingError.dataCorruptedError(forKey: .valueContributor, in: _container, debugDescription: "More than one value provided for \"value\"") } _t_value = .contributor(valueContributor) } if let valueDataRequirement = try DataRequirement(from: _container, forKeyIfPresent: .valueDataRequirement) { if _t_value != nil { throw DecodingError.dataCorruptedError(forKey: .valueDataRequirement, in: _container, debugDescription: "More than one value provided for \"value\"") } _t_value = .dataRequirement(valueDataRequirement) } if let valueExpression = try Expression(from: _container, forKeyIfPresent: .valueExpression) { if _t_value != nil { throw DecodingError.dataCorruptedError(forKey: .valueExpression, in: _container, debugDescription: "More than one value provided for \"value\"") } _t_value = .expression(valueExpression) } if let valueParameterDefinition = try ParameterDefinition(from: _container, forKeyIfPresent: .valueParameterDefinition) { if _t_value != nil { throw DecodingError.dataCorruptedError(forKey: .valueParameterDefinition, in: _container, debugDescription: "More than one value provided for \"value\"") } _t_value = .parameterDefinition(valueParameterDefinition) } if let valueRelatedArtifact = try RelatedArtifact(from: _container, forKeyIfPresent: .valueRelatedArtifact) { if _t_value != nil { throw DecodingError.dataCorruptedError(forKey: .valueRelatedArtifact, in: _container, debugDescription: "More than one value provided for \"value\"") } _t_value = .relatedArtifact(valueRelatedArtifact) } if let valueTriggerDefinition = try TriggerDefinition(from: _container, forKeyIfPresent: .valueTriggerDefinition) { if _t_value != nil { throw DecodingError.dataCorruptedError(forKey: .valueTriggerDefinition, in: _container, debugDescription: "More than one value provided for \"value\"") } _t_value = .triggerDefinition(valueTriggerDefinition) } if let valueUsageContext = try UsageContext(from: _container, forKeyIfPresent: .valueUsageContext) { if _t_value != nil { throw DecodingError.dataCorruptedError(forKey: .valueUsageContext, in: _container, debugDescription: "More than one value provided for \"value\"") } _t_value = .usageContext(valueUsageContext) } if let valueDosage = try Dosage(from: _container, forKeyIfPresent: .valueDosage) { if _t_value != nil { throw DecodingError.dataCorruptedError(forKey: .valueDosage, in: _container, debugDescription: "More than one value provided for \"value\"") } _t_value = .dosage(valueDosage) } if let valueMeta = try Meta(from: _container, forKeyIfPresent: .valueMeta) { if _t_value != nil { throw DecodingError.dataCorruptedError(forKey: .valueMeta, in: _container, debugDescription: "More than one value provided for \"value\"") } _t_value = .meta(valueMeta) } self.value = _t_value try super.init(from: decoder) } /// Encodable public override func encode(to encoder: Encoder) throws { var _container = encoder.container(keyedBy: CodingKeys.self) // Encode all our properties try url.encode(on: &_container, forKey: .url, auxiliaryKey: ._url) if let _enum = value { switch _enum { case .base64Binary(let _value): try _value.encode(on: &_container, forKey: .valueBase64Binary, auxiliaryKey: ._valueBase64Binary) case .boolean(let _value): try _value.encode(on: &_container, forKey: .valueBoolean, auxiliaryKey: ._valueBoolean) case .canonical(let _value): try _value.encode(on: &_container, forKey: .valueCanonical, auxiliaryKey: ._valueCanonical) case .code(let _value): try _value.encode(on: &_container, forKey: .valueCode, auxiliaryKey: ._valueCode) case .date(let _value): try _value.encode(on: &_container, forKey: .valueDate, auxiliaryKey: ._valueDate) case .dateTime(let _value): try _value.encode(on: &_container, forKey: .valueDateTime, auxiliaryKey: ._valueDateTime) case .decimal(let _value): try _value.encode(on: &_container, forKey: .valueDecimal, auxiliaryKey: ._valueDecimal) case .id(let _value): try _value.encode(on: &_container, forKey: .valueId, auxiliaryKey: ._valueId) case .instant(let _value): try _value.encode(on: &_container, forKey: .valueInstant, auxiliaryKey: ._valueInstant) case .integer(let _value): try _value.encode(on: &_container, forKey: .valueInteger, auxiliaryKey: ._valueInteger) case .markdown(let _value): try _value.encode(on: &_container, forKey: .valueMarkdown, auxiliaryKey: ._valueMarkdown) case .oid(let _value): try _value.encode(on: &_container, forKey: .valueOid, auxiliaryKey: ._valueOid) case .positiveInt(let _value): try _value.encode(on: &_container, forKey: .valuePositiveInt, auxiliaryKey: ._valuePositiveInt) case .string(let _value): try _value.encode(on: &_container, forKey: .valueString, auxiliaryKey: ._valueString) case .time(let _value): try _value.encode(on: &_container, forKey: .valueTime, auxiliaryKey: ._valueTime) case .unsignedInt(let _value): try _value.encode(on: &_container, forKey: .valueUnsignedInt, auxiliaryKey: ._valueUnsignedInt) case .uri(let _value): try _value.encode(on: &_container, forKey: .valueUri, auxiliaryKey: ._valueUri) case .url(let _value): try _value.encode(on: &_container, forKey: .valueUrl, auxiliaryKey: ._valueUrl) case .uuid(let _value): try _value.encode(on: &_container, forKey: .valueUuid, auxiliaryKey: ._valueUuid) case .address(let _value): try _value.encode(on: &_container, forKey: .valueAddress) case .age(let _value): try _value.encode(on: &_container, forKey: .valueAge) case .annotation(let _value): try _value.encode(on: &_container, forKey: .valueAnnotation) case .attachment(let _value): try _value.encode(on: &_container, forKey: .valueAttachment) case .codeableConcept(let _value): try _value.encode(on: &_container, forKey: .valueCodeableConcept) case .coding(let _value): try _value.encode(on: &_container, forKey: .valueCoding) case .contactPoint(let _value): try _value.encode(on: &_container, forKey: .valueContactPoint) case .count(let _value): try _value.encode(on: &_container, forKey: .valueCount) case .distance(let _value): try _value.encode(on: &_container, forKey: .valueDistance) case .duration(let _value): try _value.encode(on: &_container, forKey: .valueDuration) case .humanName(let _value): try _value.encode(on: &_container, forKey: .valueHumanName) case .identifier(let _value): try _value.encode(on: &_container, forKey: .valueIdentifier) case .money(let _value): try _value.encode(on: &_container, forKey: .valueMoney) case .period(let _value): try _value.encode(on: &_container, forKey: .valuePeriod) case .quantity(let _value): try _value.encode(on: &_container, forKey: .valueQuantity) case .range(let _value): try _value.encode(on: &_container, forKey: .valueRange) case .ratio(let _value): try _value.encode(on: &_container, forKey: .valueRatio) case .reference(let _value): try _value.encode(on: &_container, forKey: .valueReference) case .sampledData(let _value): try _value.encode(on: &_container, forKey: .valueSampledData) case .signature(let _value): try _value.encode(on: &_container, forKey: .valueSignature) case .timing(let _value): try _value.encode(on: &_container, forKey: .valueTiming) case .contactDetail(let _value): try _value.encode(on: &_container, forKey: .valueContactDetail) case .contributor(let _value): try _value.encode(on: &_container, forKey: .valueContributor) case .dataRequirement(let _value): try _value.encode(on: &_container, forKey: .valueDataRequirement) case .expression(let _value): try _value.encode(on: &_container, forKey: .valueExpression) case .parameterDefinition(let _value): try _value.encode(on: &_container, forKey: .valueParameterDefinition) case .relatedArtifact(let _value): try _value.encode(on: &_container, forKey: .valueRelatedArtifact) case .triggerDefinition(let _value): try _value.encode(on: &_container, forKey: .valueTriggerDefinition) case .usageContext(let _value): try _value.encode(on: &_container, forKey: .valueUsageContext) case .dosage(let _value): try _value.encode(on: &_container, forKey: .valueDosage) case .meta(let _value): try _value.encode(on: &_container, forKey: .valueMeta) } } try super.encode(to: encoder) } // MARK: - Equatable & Hashable public override func isEqual(to _other: Any?) -> Bool { guard let _other = _other as? Extension else { return false } guard super.isEqual(to: _other) else { return false } return url == _other.url && value == _other.value } public override func hash(into hasher: inout Hasher) { super.hash(into: &hasher) hasher.combine(url) hasher.combine(value) } }
[ -1 ]
f6d64b1e01909f66c369811cbc455d847b286c90
34f90b5661139b414b1759862bdebdcfe006ffb7
/Rivora/Presentation/Utils/View+LogLoading.swift
46336023ffdb0b1fce1373db64b4e6b197eb8e6f
[]
no_license
dtrofimov/Rivora
f07a3ff028fd2fc3eb40925cd1514a6161a96abc
e0813f8f63129754250b1395230287dc375a690f
refs/heads/master
2022-11-09T18:20:11.251245
2020-07-01T14:36:19
2020-07-01T14:39:26
276,401,081
0
0
null
null
null
null
UTF-8
Swift
false
false
481
swift
// // View+LogLoading.swift // Rivora // // Created by Dmitrii Trofimov on 17.03.2020. // Copyright © 2020 Dmitrii Trofimov. All rights reserved. // import SwiftUI private struct LoggingView<Wrapped: View>: View { let wrapped: Wrapped let name: String var body: some View { NSLog("Loading \(name)") return wrapped } } extension View { func logLoading(_ name: String) -> some View { LoggingView(wrapped: self, name: name) } }
[ -1 ]
2897397efa9c19a7b675b4549da82516b534de5a
d17b595adfdad8d8d336161f485f676b873d15d2
/Buttr/TimerProgressView.swift
5db1a2cd230133742af86b3957794bf6c36da318
[]
no_license
kjv93/buttr
dcbd649ce401bc1a85dbad92cba5be10e522c776
14ef8aacf3adbca45310741e636f8eb099f8df65
refs/heads/master
2021-01-18T07:24:45.356169
2015-08-14T19:10:28
2015-08-14T19:10:28
null
0
0
null
null
null
null
UTF-8
Swift
false
false
887
swift
// // TimerProgressView.swift // Buttr // // Created by Kyle Lucovsky on 8/10/15. // Copyright (c) 2015 Kyle Lucovsky. All rights reserved. // import UIKit class TimerProgressView: UIView { var timerDuration: Int = 60 var slider: TimerProgressSlider! override func awakeFromNib() { super.awakeFromNib() self.setTranslatesAutoresizingMaskIntoConstraints(false) self.backgroundColor = UIColor.clearColor() } func startTimer(duration: Int = 60, timeLeft: Int = 0) { timerDuration = duration let slider = TimerProgressSlider(color: UIColor.primaryTextColor(), frame: self.bounds, maxTimeUnits: timerDuration) self.addSubview(slider) self.slider = slider self.slider?.addTimeUnitByAmmount(timeLeft) } func updateSlider() { slider?.addTimeUnitByAmmount(-1) } }
[ -1 ]
7dac64f9291523631f52feed222391b46b0a5970
d439a95c18c503bc47b418d78094b97bcfd895cc
/validation-test/compiler_crashers_fixed/00526-swift-typechecker-validatedecl.swift
6f56b6d00b9983b794ccec7432e8c7c1538010f2
[ "Apache-2.0", "Swift-exception" ]
permissive
DougGregor/swift
7e40d5a1b672e6fca9b28130ef8ac0ce601cf650
16b686989c12bb1acf9d1a490c1f301d71428f47
refs/heads/master
2023-08-05T05:11:53.545515
2016-07-06T18:23:34
2016-07-06T18:23:34
50,400,732
14
2
Apache-2.0
2023-08-23T05:19:32
2016-01-26T03:34:10
C++
UTF-8
Swift
false
false
535
swift
// This source file is part of the Swift.org open source project // Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See http://swift.org/LICENSE.txt for license information // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // RUN: not %target-swift-frontend %s -parse protocol P { struct B<C<U -> : T>(t: A: T>(array: a { typealias F = ") } protocol A : P { class A where I) { print(false)")? enum A : B<T>() {
[ 91314, 91316, 91317, 91351, 91646, 91650, 91651, 91653, 91654, 91661, 91663, 91665, 91670, 91672, 91674, 91675, 91678, 91679, 91683, 91684, 91688, 91690, 91695, 91702, 91703, 91704, 91705, 91706, 91708, 91709, 91712, 91713, 91714, 91716, 91718, 91720, 91724, 91725, 91726, 91728, 91729, 91730, 91733, 91738, 91742, 91743, 91744, 91749, 91754, 91755, 91758, 91759, 91766, 91768, 91769, 91771, 91773, 91774, 91779, 91784, 91785, 91792, 91794, 91799, 91802, 91803, 91805, 91809, 91810, 91814, 91815, 91816, 91817, 91820, 91821, 91822, 91827, 91828, 91829, 91831, 91832, 91833, 91834, 91835, 91840, 91843, 91844, 91850, 91852, 91853, 91859, 91863, 91867, 91869, 91871, 91872, 91873, 91878, 91880, 91883, 91884, 91887, 91892, 91895, 91898, 91899, 91905, 91906, 91907, 91908, 91915, 91916, 91918, 91919, 91920, 91922, 91929, 91930, 91933, 91936, 91942, 91943, 91944, 91945, 91951, 91959, 91962, 91966, 91967, 91971, 91973, 91974, 91981, 91982, 91984, 91987, 91989, 91990, 91995, 91996, 91997, 91999, 92002, 92003, 92008, 92010, 92011, 92012, 92014, 92017, 92018, 92019, 92021, 92023, 92024, 92025, 92026, 92028, 92031, 92032, 92033, 92045, 92046, 92047, 92048, 92051, 92053, 92064, 92066, 92069, 92070, 92072, 92074, 92075, 92081, 92082, 92084, 92088, 92096, 92098, 92102, 92108, 92109, 92111, 92115, 92116, 92118, 92122, 92123, 92124, 92127, 92128, 92131, 92133, 92134, 92140, 92143, 92147, 92149, 92150, 92151, 92152, 75767, 92154, 92158, 92159, 92160, 92162, 92165, 92166, 92167, 92170, 92175, 92177, 92179, 92180, 92182, 92186, 92187, 92189, 92192, 92197, 92199, 92200, 92203, 92207, 92208, 92211, 92212, 92213, 92215, 92217, 92220, 92227, 92228, 92229, 92237, 92238, 92240, 92241, 92242, 92244, 92245, 92247, 92252, 92254, 92256, 92259, 92260, 92266, 92269, 92270, 92274, 92275, 92277, 92278, 92279, 92285, 92290, 92297, 92298, 92300, 92302, 92303, 92309, 92315, 92316, 92323, 92324, 92325, 92327, 92333, 92335, 92339, 92341, 92342, 92346, 92347, 92351, 92352, 92354, 92355, 92356, 92362, 92366, 92367, 92369, 92371, 92376, 92377, 92379, 92381, 92383, 92386, 92387, 92388, 92389, 92390, 92391, 92392, 92395, 92396, 92401, 92414, 92415, 92416, 92417, 92419, 92420, 92421, 92422, 92425, 92428, 92429, 92431, 92437, 92438, 92440, 92443, 92446, 92447, 92448, 92450, 92451, 92452, 92453, 92455, 92460, 92461, 92465, 92468, 92469, 92470, 92471, 92475, 92476, 92478, 92484, 92485, 92487, 92488, 92489, 92491, 92492, 92493, 92494, 92499, 92503, 92505, 92508, 92519, 92520, 92524, 92527, 92533, 92535, 92536, 92537, 92538, 92539, 92543, 92544, 92546, 92547, 92548, 92552, 92553, 92554, 92557, 92558, 92559, 92560, 92562, 92564, 92566, 92570, 92573, 92575, 92576, 92579, 92581, 92582, 92583, 92585, 92587, 92590, 92594, 92596, 92598, 92599, 92603, 92605, 92610, 92611, 92615, 92617, 92618, 92619, 92620, 92621, 92626, 92627, 92628, 92629, 92630, 92634, 92637, 92638, 92641, 92642, 92644, 92646, 92648, 92649, 92650, 92651, 92652, 92654, 92655, 92656, 92657, 92660, 92664, 92666, 92667, 92669, 92670, 92671, 92673, 92677, 92678, 92679, 92681, 92684, 92685, 92688, 92689, 92690, 92691, 92692, 92693, 92694, 92699, 92705, 92709, 92711, 92715, 92716, 92717, 92719, 92724, 92726, 92727, 92729, 92730, 92731, 76349, 92741, 92743, 92747, 92750, 92752, 92760, 92762, 92765, 92766, 92769, 92770, 92773, 92774, 92775, 92778, 92782, 92784, 92789, 92790, 92795, 92800, 92804, 92806, 92807, 92812, 92815, 92818, 92821, 92822, 92823, 92825, 92827, 92838, 92841, 92842, 92843, 92844, 92849, 92854, 92856, 92857, 92858, 92861, 92862, 92863, 92864, 92869, 92870, 92872, 92874, 92877, 92881, 92884, 92886, 92888, 92889, 92893, 92894, 92896, 92897, 92898, 92904, 92906, 92909, 92910, 92913, 92915, 92920, 92921, 92922, 92924, 92929, 92930, 92932, 92938, 92939, 92941, 92943, 92944, 92946, 92949, 92950, 92951, 92952, 92954, 92955, 92958, 92960, 92961, 92962, 92965, 92967, 92971, 92974, 92975, 92981, 92982, 92987, 92991, 92995, 92996, 93003, 93004, 93007, 93008, 93011, 93016, 93017, 93019, 93020, 93021, 93024, 93025, 93028, 93030, 93031, 93033, 93036, 93037, 93038, 93039, 93041, 93045, 93047, 93048, 93049, 93050, 93057, 93061, 93064, 93065, 93066, 93070, 93073, 93075, 93076, 93079, 93082, 93085, 93086, 93089, 93090, 93092, 93094, 93095, 93097, 93098, 93099, 93102, 93104, 93106, 93111, 93112, 93115, 93118, 93122, 93123, 93124, 93133, 93134, 93137, 93140, 93142, 93144, 93145, 93147, 93148, 93149, 93150, 93151, 93152, 93154, 93155, 93158, 93162, 93163, 93164, 93165, 93170, 93171, 93173, 93175, 93178, 93182, 93186, 93189, 93192, 93194, 93197, 93199, 93202, 93205, 93206, 93209, 93210, 93211, 93216, 93217, 93218, 93227, 93228, 93230, 93232, 93237, 93243, 93244, 76859, 93246, 93247, 93248, 93251, 93254, 93260, 93261, 93265, 93269, 93270, 93271, 93275, 93276, 93278, 93279, 93280, 93289, 93295, 93299, 93301, 93302, 93303, 93307, 93311, 93313, 93319, 93320, 93321, 93322, 93326, 76943, 93328, 93332, 93334, 93337, 93339, 93341, 93343, 93345, 93347, 93348, 93350, 93352, 93353, 93355, 93356, 93357, 93358, 93359, 93360, 93361, 93364, 93365, 93368, 93371, 93372, 93378, 93380, 93387, 93388, 93391, 93392, 93394, 93396, 93401, 93403, 93404, 93405, 93407, 93409, 93420, 93421, 93424, 93426, 93428, 93429, 93431, 93432, 93433, 93434, 93435, 93437, 93438, 93439, 93440, 93444, 93448, 93451, 93452, 93454, 93455, 93460, 93463, 93464, 93468, 93470, 93472, 93473, 93474, 93475, 93478, 93479, 93481, 93484, 93485, 93487, 93488, 93495, 93498, 93500, 93503, 93505, 93512, 93513, 93516, 93518, 93519, 93522, 93525, 93527, 93528, 93529, 93533, 93539, 93545, 93547, 93549, 93550, 93551, 93552, 93554, 93555, 93556, 93559, 93560, 93561, 93562, 93564, 93565, 93567, 93568, 93569, 93571, 93573, 93575, 93577, 93579, 93580, 93581, 93582, 93583, 93585, 93588, 93591, 93600, 93608, 93609, 93612, 93613, 93614, 93615, 93623, 93625, 93628, 93629, 93630, 93633, 93634, 93635, 93636, 93638, 93642, 93648, 93649, 93650, 93655, 93657, 93658, 93661, 93665, 93667, 93670, 93671, 93672, 93673, 93674, 93675, 93679, 93681, 93682, 93684, 93685, 93689, 93696, 93697, 93698, 93699, 93700, 93702, 93703, 93709, 93714, 93715, 93718, 93719, 93720, 93724, 93726, 93734, 93735, 93737, 93739, 93741, 93745, 93751, 93759, 93761, 93762, 93765, 93769, 93770, 93774, 93777, 93778, 93783, 93785, 93789, 93791, 93793, 93794, 93796, 93797, 93805, 93809, 93812, 93813, 93814, 93815, 93816, 93818, 93820, 93823, 93824, 93827, 93828, 93829, 93835, 93841, 93846, 93847, 93849, 93850, 93854, 93856, 93861, 93863, 93866, 93869, 93870, 93873, 93875, 93876, 93878, 93879, 93882, 93883, 93887, 93890, 93891, 93894, 93897, 93898, 93900, 93904, 93905, 93908, 93914, 93915, 93916, 93917, 93919, 93921, 93922, 93923, 93924, 93925, 93928, 93929, 93932, 93936, 93938, 93941, 93943, 93945, 93947, 93953, 93958, 93960, 93962, 93963, 93964, 93966, 93969, 93974, 93975, 93980, 93981, 93986, 93987, 93988, 93989, 93992, 93993, 94000, 94012, 94014, 94016, 94018, 94019, 94022, 94026, 94029, 94031, 94033, 94036, 94039, 94042, 94047, 94048, 94051, 94052, 94053, 94057, 94058, 94061, 94065, 94068, 94071, 94073, 94075, 94077, 94078, 94081, 94082, 94085, 94086, 94089, 94090, 94091, 94092, 94094, 94095, 94096, 94098, 94099, 94100, 94101, 94103, 94106, 94107, 94109, 94111, 94113, 94114, 94115, 94117, 94122, 94123, 94128, 94132, 94133, 94139, 94142, 94147, 94148, 94149, 94152, 94154, 94155, 94158, 94166, 94169, 94170, 94178, 94179, 94183, 94184, 94189, 94192, 94193, 94195, 94198, 94199, 94200, 94203, 94205, 94207, 94209, 94211, 94212, 94213, 94214, 94215, 94216, 94218, 94221, 94224, 94226, 94227, 94234, 94236, 94237, 94238, 94243, 94246, 94248, 94249, 94250, 94252, 94255, 94259, 94262, 94263, 94265, 94267, 94270, 94272, 94275, 94280, 94284, 94287, 94293, 94295, 94298, 94299, 94300, 94302, 94305, 94306, 94308, 94312, 94313, 94323, 94331, 94332, 94337, 94340, 94343, 94350, 94356, 94357, 94360, 94362, 94363, 94367, 94368, 94371, 94372, 94373, 77988, 94375, 94377, 94380, 94385, 94386, 94389, 94390, 94391, 94392, 94393, 94394, 94395, 94396, 94397, 94400, 94401, 94403, 94409, 94414, 94416, 94419, 94420, 94421, 94422, 94423, 94428, 94430, 94431, 94433, 94434, 94435, 94437, 94440, 94445, 94449, 94450, 94451, 94453, 94455, 94460, 94463, 94467, 94472, 94473, 94474, 94475, 94477, 94479, 94480, 94484, 94487, 94488, 94491, 94493, 94494, 94496, 94498, 94499, 94501, 94505, 94506, 94509, 94511, 94513, 94514, 94515, 94516, 94517, 94519, 94520, 94524, 94526, 94531, 94534, 94536, 94539, 94548, 94551, 94553, 94554, 94558, 94561, 94565, 94566, 94567, 94568, 94570, 94576, 94578, 94583, 94584, 94585, 94586, 94588, 94595, 94596, 94598, 94599, 94600, 94603, 94607, 94610, 94611, 94615, 94616, 94617, 94618, 94619, 94622, 94625, 94627, 94629, 94630, 94633, 94642, 94644, 94649, 94650, 94651, 94652, 94655, 94656, 94657, 94658, 94659, 94662, 94664, 94666, 94668, 94670, 94671, 94674, 94676, 94678, 94680, 94685, 94687, 94688, 94691, 94692, 94693, 94700, 94705, 94711, 94719, 94720, 94722, 94729, 94730, 94731, 94734, 94735, 94736, 94737, 94738, 94739, 94744, 94748, 94749, 94750, 94751, 94754, 94757, 94758, 94759, 94762, 94767, 94768, 94771, 94772, 94777, 94780, 94781, 94783, 94786, 94789, 94794, 94800, 94801, 94802, 94803, 94804, 94806, 94808, 94813, 94814, 94815, 94818, 94820, 94821, 94828, 94830, 94831, 94833, 94834, 94845, 94846, 94848, 94857, 94859, 94862, 94863, 94864, 94866, 94872, 94877, 94880, 94882, 94884, 94888, 94891, 94892, 94894, 94898, 94902, 94906, 94907, 94908, 94910, 94911, 94912, 94913, 94914, 94916, 94917, 94918, 94920, 94925, 94927, 94929, 94931, 94933, 94935, 94937, 94938, 94939, 94941, 94942, 94945, 94946, 94948, 94949, 94950, 94951, 94952, 94953, 94954, 94963, 94964, 94965, 94966, 94967, 94968, 94971, 94980, 94982, 94984, 94985, 94986, 94989, 94990, 94993, 94994, 94995, 94996, 94998, 94999, 95005, 95006, 95007, 95009, 95011, 95014, 95015, 95016, 95017, 95018, 95021, 95022, 95023, 95027, 95032, 95034, 95039, 95040, 95042, 95046, 95047, 95050, 95056, 95060, 95062, 95067, 95069, 95073, 95074, 95075, 95076, 95079, 95080, 95086, 95090, 95095, 95096, 95097, 95100, 95101, 95102, 95105, 95106, 95111, 95113, 95115, 95117, 95118, 95120, 95122, 95124, 95127, 95135, 95137, 95138, 95140, 95141, 95145, 95151, 95153, 95155, 95162, 95163, 95164, 95165, 95166, 95167, 95170, 95172, 95173, 95177, 95178, 95181, 95184, 95186, 95192, 95193, 95195, 95196, 95200, 95203, 95205, 95206, 95207, 95208, 95211, 95212, 95213, 95214, 95215, 95216, 95217, 95221, 95224, 95225, 95226, 95229, 95242, 95243, 95244, 95246, 95248, 95250, 95254, 95255, 95256, 95259, 95260, 95262, 95266, 95267, 95268, 95270, 95271, 95274, 95280, 95282, 95286, 95287, 95289, 95290, 95292, 95296, 95297, 95300, 95304, 95306, 95309, 95311, 95314, 95315, 95317, 95318, 95323, 95326, 95330, 95331, 95332, 95336, 95338, 95340, 95341, 95342, 95343, 95345, 95346, 95348, 95350, 95352, 95353, 95354, 95355, 95367, 95369, 95370, 95371, 95374, 95375, 95378, 95380, 95386, 95387, 95388, 95390, 95395, 95396, 95398, 95400, 95401, 95402, 95408, 95409, 95411, 95412, 95414, 95415, 95417, 95418, 95419, 95421, 95424, 95428, 95430, 95431, 95432, 95433, 95434, 95438, 95442, 95444, 95445, 95448, 95451, 95452, 95453, 95456, 95457, 95459, 95460, 95463, 95464, 95465, 95467, 95468, 95469, 95471, 95474, 95475, 95476, 95481, 95483, 95493, 95494, 95496, 95498, 95499, 95502, 95505, 95506, 95507, 95509, 95511, 95518, 95522, 95524, 95525, 95530, 95531, 95532, 95536, 95539, 95543, 95547, 95550, 95552, 95553, 95555, 95558, 95560, 95563, 95567, 95572, 95574, 95575, 95576, 95578, 95579, 95581, 95582, 95584, 95585, 95587, 95588, 95590, 95593, 95600, 95604, 95607, 95608, 95609, 95610, 95614, 95616, 95617, 95618, 95622, 95623, 95624, 95625, 95629, 95636, 95637, 95638, 95639, 95646, 95647, 95651, 95653, 95654, 95656, 95657, 95662, 95665, 95666, 95671, 95672, 95673, 95674, 95678, 95679, 95681, 95682, 95684, 95686, 95690, 95691, 95695, 95700, 95710, 95715, 95716, 95718, 95724, 95726, 95730, 95735, 95737, 95738, 95740, 95743, 95746, 95747, 95757, 95760, 95765, 95772, 95773, 95774, 95777, 95778, 95780, 95781, 95784, 95785, 95791, 95795, 95796, 95797, 95801, 95803, 95804, 95805, 95809, 95810, 95811, 95816, 95820, 95823, 95824, 95826, 95827, 95828, 95830, 95834, 95836, 95837, 95839, 95849, 95850, 95851, 95852, 95859, 95860, 95862, 95864, 95865, 95870, 95872, 95875, 95877, 95879, 95880, 95881, 95885, 95887, 95889, 95896, 95897, 95899, 95902, 95905, 95906, 95907, 95910, 95912, 95913, 95919, 95920, 95921, 95923, 95926, 95931, 95932, 95934, 95935, 95938, 95939, 95941, 95944, 95948, 95954, 95955, 95957, 95958, 95961, 95962, 95965, 95968, 95971, 95976, 95979, 95983, 95984, 95986, 95991, 95995, 95996, 95998, 95999, 96001, 96002, 96003, 96005, 96006, 96009, 96010, 96012, 96014, 96018, 96020, 96021, 96027, 96029, 96033, 96035, 96037, 96038, 96043, 96044, 96045, 96046, 96047, 96051, 96053, 96054, 96060, 96062, 96064, 96067, 96070, 96072, 96073, 96074, 96075, 96078, 96079, 96080, 96081, 96082, 96085, 96088, 96090, 96097, 96100, 96105, 96107, 96108, 96110, 96111, 96112, 96114, 96116, 96124, 96128, 96129, 96131, 96132, 96135, 96137, 96141, 96143, 96144, 96147, 96150, 96154, 96155, 96156, 96159, 96165, 96166, 96167, 96170, 96173, 96174, 96175, 96176, 96178, 96179, 96187, 96189, 96194, 96197, 96199, 96203, 96206, 96207, 96208, 96209, 96213, 96217, 96221, 96223, 96224, 96225, 96226, 96228, 96231, 96233, 96236, 96237, 96238, 96239, 96242, 96246, 96247, 96248, 96250, 96255, 96256, 96258, 96260, 96261, 96264, 96269, 96270, 96271, 96273, 96277, 96278, 96282, 96286, 96288, 96289, 96290, 96292, 96298, 96301, 96304, 96308, 96312, 96317, 96318, 96319, 96321, 96330, 96332, 96334, 96335, 96337, 96342, 96343, 96344, 96345, 96349, 96351, 96352, 96357, 96358, 96359, 96361, 96365, 96367, 96368, 96374, 96376, 96380, 96381, 96382, 96386, 96389, 96390, 96393, 96398, 96401, 96402, 96404, 96406, 96409, 96411, 96416, 96418, 96419, 96420, 96421, 96423, 96424, 96425, 96427, 96429, 96430, 96434, 96436, 96439, 96445, 96446, 96448, 96449, 96450, 96453, 96460, 96461, 96463, 96464, 96467, 96468, 96470, 96480, 96481, 96485, 96488, 96490, 96491, 96492, 96495, 96498, 96500, 96502, 96504, 96508, 96510, 96514, 96516, 96522, 96525, 96526, 96527, 96533, 96537, 96538, 96539, 96540, 96542, 96544, 96546, 96549, 96552, 96556, 96557, 96559, 96560, 96561, 96563, 96570, 96571, 96574, 96578, 96582, 96583, 96587, 96590, 96596, 96597, 96598, 96601, 96602, 96603, 96609, 96611, 96617, 96620, 96621, 96622, 96623, 96627, 96629, 96637, 96640, 96646, 96648, 96649, 96653, 96654, 96657, 96658, 96660, 96661, 96662, 96665, 96668, 96670, 96681, 96682, 96695, 96697, 96701, 96702, 96703, 96705, 96707, 96710, 96711, 96713, 96716, 96717, 96718, 96720, 96723, 96725, 96732, 96735, 96738, 96740, 96742, 96747, 96751, 96752, 96754, 96755, 96757, 96760, 96761, 96762, 96765, 96767, 96768, 96769, 96770, 96772, 96774, 96779, 96780, 96784, 96785, 96788, 96789, 96791, 96792, 96794, 96795, 96798, 96799, 96800, 96801, 96804, 96805, 96806, 96807, 96808, 96810, 96816, 96817, 96818, 96820, 96821, 96822, 96824, 96826, 96828, 96830 ]
b15d2f23871175cce8b45a95903c33c01e068236
c5ab369e9e995033fa6f2707b8e9ac5bb79ab982
/Network layer/ViewController.swift
bb2a7d1ff0596a4c7a23a19cbe120ac221a416e7
[]
no_license
MohamediosDev/NetWork-layer-important-
688529c144b5b39df195225193880366fcc8337a
988f71f19ac79f667187ed766a46b43496d63098
refs/heads/master
2022-11-08T05:29:10.865666
2020-07-04T21:24:41
2020-07-04T21:24:41
null
0
0
null
null
null
null
UTF-8
Swift
false
false
1,310
swift
// // ViewController.swift // Network layer // // Created by Mohamed on 7/3/20. // Copyright © 2020 Mohamed. All rights reserved. // import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. // let api = UserApi() // api.getusers { (result) in // switch result { // // case .success(let response): // let users = response?.data // for users in users ?? [] { // // print("\(users.firstname ?? ""),\(users.lastname ?? "")") // // // } // case .failure(let error): // print("erroe with server") let api:UserApiProtocol = UserApi() api.createUser(name: "Soda", jop: "software engineer") { (result) in switch result { case .success(let response): print(response) print("Done") print("name : \(response?.name ?? "")\nJop : \(response?.job ?? "") \nid: \(response?.id ?? "") \ncreate : \(response?.createdAt ?? "")") case .failure(let error): print("Bad !") } } } }
[ -1 ]
9e6eb938f329d567d9dd924ad4c8aa230a04956e
e05192e5f162ac8975ca0fe4605783fe3cf78492
/PingPongTests/PingPongTests.swift
14513a428aaf87ab496028728a2f858953da8003
[]
no_license
prybolovetz/PingPong-1
4500c4e26766292abaefa1f4b4f6e6f804afcab8
bf266b46bc26906a2798cd8d04a0c27c9c6491f0
refs/heads/master
2020-04-15T22:51:42.557394
2019-01-10T23:21:32
2019-01-10T23:21:32
165,087,486
0
0
null
null
null
null
UTF-8
Swift
false
false
892
swift
// // PingPongTests.swift // PingPongTests // // Created by Ivan on 1/10/19. // Copyright © 2019 Ivan. All rights reserved. // import XCTest @testable import PingPong class PingPongTests: 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. } } }
[ 313357, 145435, 241692, 317467, 239650, 16419, 223268, 102437, 292902, 329765, 315432, 354343, 325674, 315434, 223274, 102445, 243759, 282672, 241716, 319542, 243767, 352315, 288828, 325694, 288833, 288834, 352326, 313416, 315465, 254027, 311372, 311374, 354385, 196691, 280661, 329814, 338007, 354393, 200794, 315487, 45153, 309345, 280675, 321637, 329829, 319591, 280677, 43110, 194666, 315498, 131178, 319598, 288879, 204916, 223350, 131191, 233590, 288889, 280694, 131198, 333955, 280712, 319629, 235662, 311438, 241808, 323729, 325776, 317587, 333991, 333992, 239793, 241843, 180408, 227513, 295098, 258239, 280768, 301251, 227524, 309444, 338119, 321745, 334042, 280795, 194782, 356576, 317664, 280802, 338150, 346346, 321772, 125169, 327929, 12542, 194820, 313608, 321800, 278797, 338197, 334103, 325912, 315673, 237856, 237857, 227616, 278816, 305440, 211235, 151847, 282919, 325931, 311597, 321840, 98610, 332083, 127284, 332085, 336183, 332089, 282939, 287041, 241986, 332101, 182598, 139589, 182597, 280902, 323916, 348492, 319821, 325968, 323920, 282960, 366929, 289110, 168281, 332123, 334171, 354655, 391520, 106847, 323935, 332127, 321894, 242023, 242029, 160110, 246127, 242033, 250226, 313713, 199029, 246136, 139640, 106874, 246137, 317820, 291192, 211326, 313727, 315773, 291198, 240002, 225670, 332167, 242058, 311691, 227725, 108944, 291224, 293274, 39324, 317852, 121245, 285084, 141728, 242078, 315810, 315811, 246178, 381347, 289189, 108972, 311727, 377264, 299441, 334260, 283064, 319930, 311738, 336317, 293310, 311745, 291265, 278978, 291267, 127427, 127428, 324039, 283075, 129483, 317901, 278989, 281037, 281040, 278993, 289232, 328152, 242139, 369116, 285150, 279008, 160225, 242148, 242149, 279013, 127465, 330218, 279018, 311786, 319981, 109042, 319987, 279029, 254456, 233978, 324097, 301571, 342536, 279050, 279062, 254488, 289304, 279065, 322078, 291358, 375333, 293419, 244269, 236081, 234036, 234040, 338490, 242237, 115270, 322120, 55881, 377418, 340558, 309846, 244310, 332378, 295519, 242277, 244327, 344680, 295536, 287346, 313971, 344696, 287352, 301689, 244347, 279164, 291454, 311941, 348806, 369289, 330379, 184973, 311949, 326287, 316049, 311954, 334481, 330387, 316053, 352917, 111253, 330388, 314009, 111258, 111259, 318107, 295576, 279206, 295599, 318130, 342706, 336564, 164533, 299699, 299700, 289462, 109241, 342713, 248517, 363211, 154316, 164560, 242386, 334547, 279252, 318173, 363230, 289502, 299746, 295652, 330474, 129773, 289518, 312047, 299759, 322291, 312052, 125684, 312053, 154359, 199414, 221948, 279294, 299776, 295682, 191235, 291592, 336648, 264968, 322313, 322316, 117517, 326414, 312079, 322319, 295697, 310036, 291604, 207640, 291612, 326429, 336671, 293664, 281377, 326433, 289576, 279336, 318250, 295724, 353069, 152365, 312108, 285487, 301871, 318252, 328499, 353078, 353079, 230199, 293693, 336702, 342847, 295746, 353094, 353095, 318278, 355146, 201549, 355152, 355154, 281427, 353109, 244568, 244570, 230234, 322395, 355165, 109409, 242529, 351077, 275303, 201577, 326505, 355178, 177001, 242541, 400239, 246641, 330609, 174963, 207732, 211829, 109428, 310131, 209783, 361337, 211836, 260996, 416646, 287622, 240518, 109447, 113542, 316298, 236428, 58253, 228233, 56208, 308112, 326553, 209817, 400283, 318364, 289690, 127902, 240544, 310182, 289703, 240552, 353195, 316333, 353197, 252847, 347055, 236461, 293806, 326581, 316343, 289722, 230332, 353215, 353216, 330689, 279498, 316364, 330708, 248796, 343005, 340961, 52200, 203757, 320493, 320494, 340974, 289774, 287731, 277492, 316405, 240630, 312314, 320507, 328700, 314362, 330754, 328706, 320516, 293893, 134150, 330763, 320527, 324625, 238610, 308243, 316437, 418837, 322582, 320536, 197657, 281626, 175132, 326685, 336929, 300068, 345132, 252980, 300084, 312373, 322612, 324666, 238651, 302139, 336960, 21569, 214086, 250956, 296019, 339030, 353367, 156764, 156765, 281697, 314467, 230499, 253029, 250981, 228458, 207979, 318572, 281706, 316526, 15471, 144496, 351344, 300146, 312434, 353397, 300150, 291959, 300151, 337017, 363644, 285820, 300158, 150657, 302213, 349318, 228491, 228493, 177296, 326804, 324760, 119962, 283802, 285851, 296092, 339102, 300188, 249002, 300202, 306346, 3246, 318639, 294068, 337077, 339130, 228540, 230588, 228542, 353479, 353480, 62665, 353481, 353482, 244940, 283853, 316627, 189652, 189653, 148696, 333022, 304351, 310497, 304356, 298213, 290022, 330984, 328940, 298221, 234733, 279792, 353523, 353524, 292085, 298228, 216315, 128251, 316669, 388349, 208124, 292091, 228609, 320770, 322824, 242954, 328971, 292107, 318733, 353551, 251153, 177428, 349462, 245019, 126237, 115998, 339234, 333090, 208164, 109861, 130348, 279854, 298291, 171317, 318775, 312634, 286013, 333117, 216386, 193859, 345415, 312648, 300359, 224586, 294218, 296273, 331090, 120148, 318805, 314709, 314710, 357719, 134491, 316765, 222559, 314720, 314726, 163175, 314728, 333160, 230765, 306542, 296303, 327024, 243056, 312689, 316787, 116084, 314741, 327025, 314739, 327031, 249204, 249205, 181625, 111993, 290169, 314751, 318848, 224640, 357762, 306560, 294275, 314758, 298374, 368011, 304524, 296335, 112017, 112018, 9619, 234898, 224661, 318875, 314783, 251298, 333220, 310692, 314791, 245161, 316842, 241066, 314798, 286129, 150965, 210358, 279989, 228795, 292283, 280004, 380357, 339398, 300487, 306631, 300489, 284107, 302540, 310732, 312782, 64975, 310736, 327121, 366037, 210392, 310748, 286172, 144867, 103909, 316902, 245223, 191981, 282096, 321009, 329200, 333300, 191990, 280055, 300536, 290301, 300542, 286205, 294400, 296448, 230913, 292356, 323080, 329225, 230921, 253452, 323087, 329232, 323089, 316946, 175639, 374296, 282141, 187938, 245287, 313339, 245292, 230959, 312880, 288309, 290358, 312889, 194110, 425535, 288318, 196164, 56902, 288327, 282183, 292423, 243274, 333388, 224847, 228943, 118353, 280147, 349781, 290390, 128599, 235095, 196187, 44635, 333408, 157281, 286306, 345700, 374372, 243307, 312940, 54893, 120427, 204397, 138863, 325231, 224883, 314998, 333430, 247416, 323196, 325245, 175741, 337535, 339584, 294529, 312965, 282246, 229001, 290443, 188048, 282259, 302739, 345752, 229020, 298654, 257699, 245412, 323236, 40613, 40614, 206504, 40615, 298661, 61101, 321199, 286391, 337591, 321207, 280251, 327358, 323263, 323264, 282303, 321219, 333509, 319177, 306890, 212685, 333517, 333520, 241361, 245457, 313041, 333521, 241365, 9936, 181975, 298712, 9937, 18138, 302802, 321247, 229088, 298720, 325346, 321249, 333542, 153319, 12010, 280300, 313081, 325371, 194303, 194304, 319233, 323331, 339715, 216839, 284431, 243472, 321295, 323346, 161554, 321302, 116505, 325404, 313120, 241441, 241442, 325410, 339745, 341796, 247590, 315171, 284459, 294700, 317232, 200498, 319292, 325439, 315202, 307011, 325445, 282438, 153415, 280392, 159562, 325457, 413521, 255829, 18262, 317269, 284507, 300894, 307039, 245599, 362337, 237408, 345955, 302946, 276327, 325484, 296814, 313199, 292720, 282480, 313203, 325492, 317304, 333688, 241528, 194429, 325503, 182144, 339841, 305026, 315264, 188292, 327557, 247686, 243591, 241540, 67463, 315273, 325515, 315274, 350093, 325518, 243597, 329622, 337815, 294807, 239514, 118685, 311199, 319392, 300963, 292771, 313254, 333735, 294823, 292782, 317360, 323507, 243637, 290746, 294843, 214977, 280514, 174019, 214984, 151497, 284619, 344013, 231375, 153554, 212946, 346067, 294886, 317415, 174057, 327661, 296941, 329712, 362480, 278512, 311281, 223218, 311282, 333817, 292858, 290811 ]
65fcc63550588d4d1819035fe7bdf8908daaf82e
0a933dd824aba1b51e5a22886386bea14b588885
/GestureControlsSwiftTests/GestureControlsSwiftTests.swift
54840770faa09ea01b305f5287cc0eee1793f592
[]
no_license
Deepkapadia/GestureControlsSwift
1aaf61b537c10fdb5c315c48e0f6e775f1f8f005
6ea2ff13bb41a176f5746cb42d5a5881600ef4c3
refs/heads/master
2020-04-17T07:01:35.641276
2019-01-18T05:40:56
2019-01-18T05:40:56
166,350,324
0
0
null
null
null
null
UTF-8
Swift
false
false
1,008
swift
// // GestureControlsSwiftTests.swift // GestureControlsSwiftTests // // Created by MACOS on 6/3/17. // Copyright © 2017 MACOS. All rights reserved. // import XCTest @testable import GestureControlsSwift class GestureControlsSwiftTests: 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, 16419, 229413, 204840, 278570, 344107, 155694, 229424, 229430, 163896, 180280, 352315, 376894, 286788, 352326, 254027, 311372, 311374, 196691, 180311, 180312, 385116, 237663, 254048, 319591, 221290, 319598, 204916, 131191, 131198, 311438, 278677, 196760, 426138, 311458, 278691, 278704, 377009, 278708, 131256, 180408, 295098, 139479, 229597, 311519, 205035, 286958, 327929, 344313, 147717, 368905, 278797, 254226, 319763, 368916, 262421, 377114, 368923, 237856, 237857, 278816, 311597, 98610, 180535, 336183, 278842, 287041, 287043, 319813, 344401, 377169, 368981, 155990, 278869, 368984, 106847, 98657, 270701, 270706, 246136, 139640, 106874, 311681, 311685, 106888, 385417, 385422, 213403, 246178, 385454, 311727, 377264, 319930, 311738, 33211, 336320, 311745, 254406, 188871, 278989, 278993, 278999, 328152, 369116, 287198, 279013, 279018, 319981, 319987, 279029, 254456, 377338, 279039, 377343, 254465, 287241, 279050, 139792, 303636, 279062, 393751, 254488, 279065, 377376, 377386, 197167, 385588, 279094, 115270, 385615, 426576, 369235, 295519, 139872, 66150, 279146, 295536, 287346, 139892, 344696, 287352, 189057, 311941, 336518, 369289, 311945, 344715, 279177, 311949, 287374, 377489, 311954, 352917, 230040, 377497, 271000, 303771, 377500, 295576, 221852, 205471, 344738, 139939, 287404, 205487, 295599, 303793, 336564, 230072, 287417, 287422, 377539, 287433, 287439, 164560, 385747, 279252, 361176, 418520, 287452, 295652, 279269, 246503, 369385, 230125, 312047, 312052, 230134, 172792, 344827, 221948, 205568, 295682, 197386, 434957, 295697, 426774, 197399, 426775, 197411, 295724, 353069, 197422, 353070, 164656, 295729, 230199, 353079, 197431, 336702, 295744, 295746, 279362, 353109, 377686, 230234, 189275, 435039, 295776, 303972, 385893, 279397, 230248, 246641, 246643, 295798, 246648, 361337, 254850, 369538, 287622, 58253, 295824, 189348, 140204, 353197, 377772, 304051, 230332, 377790, 353215, 189374, 353216, 213957, 213960, 345033, 279498, 386006, 304087, 418776, 50143, 123881, 320493, 320494, 271350, 295927, 328700, 328706, 410627, 320516, 295942, 386056, 353290, 377869, 238610, 418837, 140310, 320536, 197657, 189474, 369701, 238639, 312373, 238651, 377926, 238664, 296019, 353367, 156765, 304222, 230499, 173166, 377972, 337017, 377983, 402565, 279685, 386189, 296086, 238743, 296092, 238765, 279728, 238769, 402613, 230588, 279747, 353479, 353481, 353482, 402634, 279760, 189652, 189653, 419029, 279765, 148696, 296153, 279774, 304351, 304356, 222440, 328940, 279792, 386294, 386301, 320770, 386306, 312587, 328971, 353551, 320796, 222494, 279854, 353584, 345396, 386359, 222524, 378172, 279875, 304456, 230729, 312648, 337225, 238927, 353616, 296273, 222559, 378209, 230756, 386412, 230765, 296303, 279920, 296307, 116084, 181625, 337281, 148867, 296329, 296335, 9619, 370071, 279984, 173491, 304564, 353719, 361927, 296392, 280010, 280013, 329173, 239068, 280032, 271843, 329197, 329200, 296433, 288249, 296448, 230913, 230921, 329225, 296461, 304656, 329232, 370197, 230943, 402985, 394794, 230959, 312880, 288309, 312889, 280130, 288327, 280147, 239198, 157281, 99938, 312940, 222832, 288378, 337534, 337535, 263809, 312965, 288392, 239250, 419478, 345752, 206504, 321199, 337591, 296632, 280251, 280257, 321219, 280267, 403148, 9936, 313041, 9937, 370388, 272085, 345814, 280278, 280280, 18138, 345821, 321247, 321249, 345833, 345834, 288491, 280300, 239341, 67315, 173814, 313081, 288512, 288516, 280327, 280329, 321295, 321302, 345879, 321310, 255776, 362283, 378668, 296755, 280372, 321337, 280380, 345919, 436031, 403267, 280390, 280392, 345929, 304977, 255829, 18262, 362327, 280410, 345951, 362337, 345955, 296806, 288620, 280430, 214895, 313199, 362352, 296814, 313203, 182144, 305026, 67463, 329622, 337815, 214937, 239514, 436131, 436137, 362417, 288697, 362431, 214977, 280514, 214984, 362443, 346067, 280541, 329695, 436191, 313319, 247785, 296941, 436205, 329712, 43014, 354316, 313357, 313375, 239650, 223268, 354343, 354345, 223274, 346162, 288828, 436285, 288833, 288834, 436292, 403525, 313416, 436301, 354385, 338001, 338003, 280661, 329814, 354393, 280675, 280677, 43110, 321637, 329829, 436329, 313447, 288879, 280694, 288889, 215164, 313469, 215166, 280712, 215178, 346271, 436383, 362659, 239793, 182456, 280762, 223419, 379071, 280768, 149703, 346314, 321745, 387296, 280802, 379106, 346346, 321772, 436470, 149760, 411906, 313608, 272658, 338218, 321840, 379186, 280887, 321860, 182598, 280902, 289110, 215385, 354655, 321894, 354676, 199029, 436608, 362881, 248194, 240002, 436611, 240016, 108944, 190871, 149916, 420253, 141728, 289189, 289194, 108972, 272813, 338356, 436661, 281040, 289232, 256477, 281072, 174593, 420369, 207393, 289332, 174648, 338489, 338490, 322120, 281166, 281171, 297560, 436832, 436834, 313966, 420463, 346737, 313971, 346740, 420471, 330379, 330387, 117396, 117397, 346772, 330388, 264856, 314009, 289434, 346779, 166582, 314040, 158394, 363211, 363230, 264928, 330474, 289518, 125684, 199414, 191235, 322316, 117517, 322319, 166676, 207640, 281377, 289576, 191283, 273207, 289598, 281408, 355146, 355152, 355154, 281433, 322395, 355165, 355178, 330609, 207732, 158593, 224145, 355217, 256922, 289690, 289698, 420773, 289703, 363438, 347055, 289727, 273344, 330689, 363458, 379844, 19399, 330708, 248796, 347103, 52200, 183279, 347123, 240630, 257024, 330754, 134150, 330763, 322582, 248872, 322612, 314448, 339030, 281697, 281700, 257125, 273515, 207979, 404593, 363641, 363644, 150657, 248961, 330888, 363669, 339100, 380061, 339102, 199839, 429214, 306338, 265379, 249002, 306346, 3246, 421048, 339130, 208058, 322749, 265412, 290000, 298208, 298212, 298213, 290022, 330984, 298221, 298228, 216315, 208124, 388349, 437505, 322824, 257305, 339234, 109861, 372009, 412971, 298291, 306494, 216386, 224586, 372043, 331090, 314710, 372054, 159066, 314720, 281957, 314728, 134506, 306542, 380271, 208244, 314741, 249204, 290173, 306559, 224640, 314751, 314758, 298374, 314760, 142729, 388487, 314766, 306579, 224661, 282007, 290207, 314783, 314789, 282022, 314791, 282024, 396711, 396712, 314798, 380337, 380338, 150965, 380357, 339398, 306639, 413137, 429542, 282096, 306673, 191990, 290300, 290301, 372227, 306692, 323080, 323087, 175639, 388632, 282136, 396827, 282141, 134686, 347694, 290358, 265798, 282183, 265804, 224847, 396882, 290390, 306776, 44635, 396895, 323172, 282213, 323178, 224883, 314998, 323196, 175741, 339584, 282245, 323217, 298654, 282271, 282273, 282276, 298661, 323236, 290471, 282280, 298667, 224946, 110268, 224958, 323263, 274115, 282312, 306890, 282318, 241361, 241365, 282327, 298712, 298720, 282339, 12010, 282348, 282355, 282358, 339715, 323331, 323332, 216839, 339720, 282378, 372496, 323346, 282391, 282400, 339745, 257830, 421672, 282409, 282417, 200498, 315202, 307011, 282434, 282438, 323406, 216918, 241495, 282474, 282480, 241528, 315264, 339841, 241540, 282504, 315273, 315274, 184208, 110480, 372626, 380821, 282518, 298909, 118685, 298920, 323507, 200627, 282549, 290745, 290746, 274371, 151497, 372701, 298980, 380908, 282612, 290811, 282633, 241692, 102437, 315432, 102445, 233517, 176175, 241716, 225351, 315465, 315476, 307289, 315487, 356447, 45153, 307299, 315497, 315498, 438377, 233589, 266357, 422019, 241808, 323729, 381073, 184484, 299174, 323762, 299187, 405687, 258239, 389313, 299203, 299209, 372941, 282831, 266449, 356576, 176362, 307435, 438511, 381172, 184570, 184575, 184584, 381208, 299293, 151839, 282913, 233762, 217380, 151847, 282919, 332083, 332085, 332089, 282939, 438596, 332101, 323913, 348492, 323920, 348500, 168281, 332123, 332127, 323935, 242023, 160110, 242033, 291192, 340357, 225670, 332167, 242058, 373134, 291224, 242078, 61857, 315810, 381347, 315811, 61859, 340398, 299441, 299456, 127427, 291267, 127428, 324039, 373197, 160225, 291311, 291333, 340490, 283153, 258581, 291358, 283182, 234036, 234040, 315960, 348732, 242237, 70209, 348742, 70215, 348749, 340558, 381517, 332378, 201308, 111208, 184940, 373358, 389745, 209530, 291454, 373375, 152195, 348806, 316049, 316053, 111253, 111258, 111259, 176808, 299699, 299700, 422596, 422599, 291530, 225995, 242386, 422617, 422626, 299746, 234217, 299759, 299770, 299776, 291585, 430849, 242433, 291592, 62220, 422673, 430865, 291604, 422680, 283419, 291612, 283430, 152365, 422703, 422709, 234294, 152374, 160571, 430910, 160575, 160580, 299849, 381773, 201551, 242529, 349026, 357218, 127841, 275303, 201577, 308076, 242541, 209783, 177019, 185211, 308092, 398206, 291712, 381829, 316298, 308112, 349072, 390045, 185250, 185254, 316333, 316343, 373687, 373706, 316364, 340961, 324586, 316405, 349175, 201720, 127992, 357379, 324625, 308243, 316437, 357414, 300084, 308287, 218186, 300111, 341073, 439384, 300135, 300136, 316520, 316526, 357486, 144496, 300146, 300150, 291959, 300151, 160891, 300158, 349316, 349318, 373903, 169104, 177296, 308372, 185493, 119962, 300187, 300188, 300201, 300202, 373945, 259268, 283847, 62665, 283852, 283853, 259280, 316627, 333011, 234733, 292085, 234742, 128251, 316669, 234755, 439562, 292107, 414990, 251153, 177428, 349462, 382258, 300343, 382269, 333117, 193859, 177484, 406861, 259406, 234831, 120148, 357719, 283991, 374109, 234850, 292195, 333160, 243056, 316787, 111993, 357762, 112017, 234898, 259475, 275859, 357786, 251298, 333220, 316842, 374191, 284089, 292283, 292292, 300487, 300489, 284107, 366037, 210390, 210391, 210392, 210393, 144867, 316902, 251378, 308723, 333300, 300535, 300536, 333303, 300542, 259599, 316946, 308756, 398869, 374296, 374299, 308764, 333343, 431649, 169518, 431663, 194110, 349763, 218696, 292425, 243274, 128587, 333388, 349781, 128599, 333408, 374372, 300644, 317032, 415338, 243307, 54893, 325231, 325245, 235135, 194180, 415375, 333470, 153251, 300714, 210603, 415420, 333503, 259781, 333517, 333520, 333521, 325346, 153319, 325352, 284401, 325371, 194304, 284431, 243472, 366360, 284442, 325404, 333610, 399147, 431916, 317232, 300848, 259899, 325439, 153415, 341836, 415567, 325457, 317269, 341847, 284507, 350044, 128862, 284512, 276327, 292712, 423789, 292720, 325492, 276341, 300918, 341879, 317304, 333688, 112509, 55167, 325503, 333701, 243591, 325515, 350093, 325518, 333722, 350109, 300963, 292771, 333735, 415655, 284587, 292782, 317360, 243637, 284619, 301008, 153554, 292836, 292837, 317415, 325619, 432116, 292858, 415741, 333828, 358410, 399373, 317467, 145435, 292902, 325674, 227370, 309295, 129076, 243767, 358456, 309345, 227428, 194666, 260207, 432240, 333940, 292988, 292992, 194691, 227460, 415881, 104587, 235662, 325776, 317587, 284826, 333991, 284841, 227513, 227524, 194782, 301279, 317664, 243962, 375039, 309503, 194820, 325905, 325912, 309529, 227616, 211235, 432421, 211238, 358703, 358709, 227654, 325968, 6481, 366930, 6489, 391520, 383332, 383336, 285040, 317820, 211326, 317831, 227725, 252308, 178582, 293274, 285084, 39324, 121245, 342450, 334260, 293303, 358843, 293310, 416197, 129483, 342476, 317901, 326100, 227809, 358882, 342498, 334309, 391655, 432618, 375276, 293367, 301571, 342536, 416286, 375333, 293419, 244269, 375343, 236081, 23092, 375351, 244281, 301638, 309830, 293448, 55881, 416341, 309846, 416351, 268899, 39530, 244347, 326287, 375440, 334481, 318106, 318107, 342682, 318130, 383667, 293556, 342713, 285371, 39614, 154316, 334547, 375526, 342762, 342763, 293612, 129773, 154359, 228088, 432893, 162561, 285444, 383754, 285458, 310036, 285466, 326429, 293664, 326433, 400166, 293672, 318250, 318252, 285487, 375609, 285497, 293693, 252741, 293711, 244568, 244570, 301918, 293730, 342887, 400239, 211829, 228215, 269178, 211836, 400252, 359298, 359299, 260996, 113542, 416646, 392074, 56208, 293781, 400283, 318364, 310176, 310178, 310182, 293800, 236461, 252847, 326581, 326587, 326601, 359381, 433115, 343005, 326635, 203757, 187374, 383983, 318461, 293886, 293893, 433165, 384016, 433174, 326685, 252958, 252980, 203830, 359478, 277597, 113760, 302177, 392290, 253029, 285798, 15471, 351344, 285814, 285820, 392318, 187521, 384131, 285828, 302216, 162961, 326804, 187544, 351390, 302240, 253099, 253100, 318639, 294068, 367799, 294074, 113850, 228542, 302274, 367810, 244940, 228563, 195808, 310497, 302325, 228600, 228609, 261377, 253216, 130338, 261425, 351537, 286013, 113987, 294218, 146762, 294219, 318805, 425304, 163175, 327024, 327025, 318848, 179587, 253317, 384393, 368011, 318864, 318868, 318875, 310692, 245161, 310701, 286129, 286132, 228795, 425405, 302531, 425418, 302540, 310736, 286172, 187878, 286202, 359930, 228861, 286205, 302590, 294400, 253451, 253452, 359950, 146964, 253463, 286244, 245287, 245292, 425535, 196164, 56902, 286288, 179801, 196187, 343647, 286306, 310889, 204397, 138863, 188016, 294529, 286343, 229001, 310923, 188048, 302739, 425626, 302754, 40613, 40614, 40615, 229029, 286391, 384695, 327358, 286399, 212685, 212688, 384720, 302802, 245457, 286423, 278233, 294622, 278240, 212716, 212717, 360177, 229113, 278272, 319233, 311042, 360195, 294678, 286494, 294700, 409394, 319292, 360252, 360264, 376669, 245599, 237408, 425825, 302946, 425833, 417654, 188292, 294807, 294809, 376732, 294814, 311199, 319392, 294823, 327596, 294843, 188348, 237504, 294850, 384964, 163781, 344013, 212942, 212946, 24532, 212951, 294886, 311281, 311282 ]
542ae04a01bcd0d78fffa71b305ed202cf5e0e30
158a95559a0d2d43e6dd886a3d035096e6bf0f31
/Cleanobot/Fences/FenceDoor.swift
b5aaa7e196aa0afcc37f88172bd1a97510e82fc0
[]
no_license
grebbledude/Cleanobot
65812e0617fe4832a16ee1ce778f71ebf30dd6ae
b8bf23352eb8554c7b7875139cdba3dfa669df70
refs/heads/master
2021-09-04T06:58:46.554237
2018-01-16T23:05:40
2018-01-16T23:05:40
113,590,013
0
0
null
null
null
null
UTF-8
Swift
false
false
2,760
swift
// // FenceDoor.swift // Robots // // Created by Pete Bennett on 03/09/2017. // Copyright © 2017 Pete Bennett. All rights reserved. // import UIKit class FenceDoor: Fence { static let OPENING = [UIImage(named: "doorOpening1")!, UIImage(named: "doorOpening2")!, UIImage(named: "doorOpening3")!, UIImage(named: "doorOpening4")!, UIImage(named: "doorOpening5")!] static let CLOSED = [UIImage(named: "doorClosed1")!, UIImage(named: "doorClosed2")!, UIImage(named: "doorClosed3")!, UIImage(named: "doorClosed4")!, UIImage(named: "doorClosed5")!] static let OPEN = [UIImage(named: "doorOpen1")!, UIImage(named: "doorOpen2")!, UIImage(named: "doorOpen3")!, UIImage(named: "doorOpen4")!, UIImage(named: "doorOpen5")!] enum DoorStatus: String { case open case closed case opening } var mStatus: DoorStatus var mPosition: FencePosition? var status: DoorStatus { get { return mStatus } } init (status: DoorStatus, position: FencePosition) { mStatus = status mPosition = position super.init() } override init() { mStatus = .closed super.init() } override var type: FenceType { return (mStatus == .open) ? .none : .electrified } override var fenceClass: FenceObject { get {return .door} } override var image: UIImage { get { switch mStatus { case .closed: return UIImage(named: "doorClosed")! case .opening: return UIImage(named: "doorOpening")! case .open: return UIImage(named: "doorOpen")! } } } func cycleStatus() { switch mStatus { case .open: mStatus = .closed case .closed: mStatus = .opening case .opening: mStatus = .open } mPosition?.display() } override func setAnimatingImages(for imageView: UIImageView) -> Bool { switch mStatus { case .closed: imageView.animationImages = FenceDoor.OPEN case .opening: imageView.animationImages = FenceDoor.CLOSED case .open: imageView.animationImages = FenceDoor.OPENING } imageView.animationDuration = 0.5 imageView.animationRepeatCount = 1 return true } }
[ -1 ]
d3a404cdc98e7c9ee1fe5939873c9b7e9c1e3046
09928bdca3c02e28fa62488ecd90d03d18a1405e
/IOS-Swift-CoreLocationMapKit/AppDelegate.swift
2fa2e59a02ae4c06a6aec2fb9c41ff0cb926f0e8
[]
no_license
soonin/IOS-Swift-CoreLocationMapKit
fdd952a47d1b895b110f992c57a2eddbc89bc2a9
4d187f30fcdabd124ce70240174406fc3e01e26e
refs/heads/master
2020-03-28T15:29:31.996257
2018-09-13T07:30:04
2018-09-13T07:30:04
148,599,488
0
0
null
null
null
null
UTF-8
Swift
false
false
2,183
swift
// // AppDelegate.swift // IOS-Swift-CoreLocationMapKit // // Created by Pooya on 2018-09-12. // Copyright © 2018 Pooya. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } func applicationWillResignActive(_ application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. } func applicationDidEnterBackground(_ application: UIApplication) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } func applicationWillEnterForeground(_ application: UIApplication) { // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. } func applicationDidBecomeActive(_ application: UIApplication) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } }
[ 229380, 229383, 229385, 278539, 294924, 229388, 278542, 327695, 229391, 229394, 278548, 229397, 229399, 229402, 352284, 278556, 229405, 278559, 229408, 294950, 229415, 229417, 327722, 237613, 229422, 360496, 229426, 237618, 229428, 311349, 286774, 286776, 319544, 286778, 204856, 229432, 352318, 286791, 237640, 286797, 278605, 311375, 163920, 237646, 196692, 319573, 311383, 278623, 278626, 319590, 311400, 278635, 303212, 278639, 131192, 237693, 303230, 327814, 303241, 131209, 417930, 303244, 311436, 319633, 286873, 286876, 311460, 311469, 32944, 327862, 286906, 327866, 180413, 286910, 131264, 286916, 295110, 286922, 286924, 286926, 319694, 286928, 131281, 278743, 278747, 295133, 155872, 319716, 237807, 303345, 286962, 303347, 131314, 229622, 327930, 278781, 278783, 278785, 237826, 319751, 278792, 286987, 319757, 311569, 286999, 319770, 287003, 287006, 287009, 287012, 287014, 287016, 287019, 311598, 287023, 262448, 311601, 295220, 287032, 155966, 319809, 319810, 278849, 319814, 311623, 319818, 311628, 229709, 319822, 287054, 278865, 229717, 196963, 196969, 139638, 213367, 106872, 319872, 311683, 319879, 311693, 65943, 319898, 311719, 278952, 139689, 278957, 311728, 278967, 180668, 311741, 278975, 319938, 278980, 98756, 278983, 319945, 278986, 319947, 278990, 278994, 311767, 279003, 279006, 188895, 172512, 287202, 279010, 279015, 172520, 319978, 279020, 172526, 311791, 279023, 172529, 279027, 319989, 172534, 180727, 164343, 279035, 311804, 287230, 279040, 303617, 287234, 279045, 172550, 303623, 172552, 320007, 287238, 279051, 172558, 279055, 303632, 279058, 303637, 279063, 279067, 172572, 279072, 172577, 295459, 172581, 295461, 279082, 311850, 279084, 172591, 172598, 279095, 172607, 172609, 172612, 377413, 172614, 213575, 172618, 303690, 33357, 287309, 303696, 279124, 172634, 262752, 254563, 172644, 311911, 189034, 295533, 172655, 172656, 352880, 295538, 189040, 172660, 287349, 189044, 189039, 287355, 287360, 295553, 172675, 295557, 311942, 303751, 287365, 352905, 311946, 287371, 279178, 311951, 287377, 172691, 287381, 311957, 221850, 287386, 230045, 172702, 287390, 303773, 172705, 287394, 172707, 303780, 164509, 287398, 205479, 287400, 279208, 172714, 295595, 279212, 189102, 172721, 287409, 66227, 303797, 189114, 287419, 303804, 328381, 287423, 328384, 172737, 279231, 287427, 312005, 312006, 107208, 172748, 287436, 107212, 172751, 287440, 295633, 172755, 303827, 279255, 172760, 287450, 303835, 279258, 189149, 303838, 213724, 312035, 279267, 295654, 279272, 230128, 312048, 312050, 230131, 189169, 205564, 303871, 230146, 328453, 295685, 230154, 33548, 312077, 295695, 295701, 230169, 369433, 295707, 328476, 295710, 230175, 295720, 303914, 279340, 205613, 279353, 230202, 312124, 328508, 222018, 295755, 377676, 148302, 287569, 303959, 230237, 279390, 230241, 279394, 303976, 336744, 303981, 303985, 303987, 328563, 279413, 303991, 303997, 295806, 295808, 295813, 304005, 320391, 304007, 213895, 304009, 304011, 230284, 304013, 295822, 213902, 279438, 189329, 295825, 304019, 189331, 58262, 304023, 304027, 279452, 410526, 279461, 279462, 304042, 213931, 230327, 304055, 287675, 197564, 230334, 304063, 238528, 304065, 189378, 213954, 156612, 295873, 213963, 197580, 312272, 304084, 304090, 320481, 304106, 320490, 312302, 328687, 320496, 304114, 295928, 320505, 312321, 295945, 230413, 197645, 295949, 320528, 140312, 295961, 238620, 197663, 304164, 304170, 304175, 238641, 312374, 238652, 238655, 230465, 238658, 336964, 132165, 296004, 205895, 320584, 238666, 296021, 402518, 336987, 230497, 296036, 296040, 361576, 205931, 296044, 164973, 205934, 312432, 279669, 337018, 189562, 279679, 304258, 279683, 222340, 66690, 205968, 296084, 238745, 304285, 238756, 205991, 222377, 165035, 337067, 238766, 165038, 230576, 238770, 304311, 230592, 312518, 279750, 230600, 230607, 148690, 320727, 279769, 304348, 279777, 304354, 296163, 320740, 279781, 304360, 320748, 279788, 279790, 304370, 296189, 320771, 312585, 296202, 296205, 230674, 320786, 230677, 296213, 296215, 320792, 230681, 214294, 304416, 230689, 173350, 312622, 296243, 312630, 222522, 296253, 222525, 296255, 312639, 230718, 296259, 378181, 296262, 230727, 238919, 296264, 320840, 296267, 296271, 222545, 230739, 312663, 222556, 337244, 230752, 312676, 230760, 173418, 148843, 410987, 230763, 230768, 296305, 312692, 230773, 304505, 304506, 181626, 279929, 181631, 148865, 312711, 312712, 296331, 288140, 288144, 230800, 304533, 288154, 337306, 288160, 173472, 288162, 288164, 279975, 304555, 370092, 279983, 173488, 288176, 279985, 312755, 296373, 312759, 337335, 288185, 279991, 222652, 312766, 173507, 296389, 222665, 230860, 312783, 288208, 230865, 148946, 370130, 222676, 288210, 288212, 288214, 280021, 329177, 288217, 288218, 280027, 288220, 239070, 239064, 288224, 370146, 280034, 288226, 288229, 280036, 280038, 288230, 288232, 288234, 320998, 288236, 288238, 288240, 288242, 296435, 288244, 288250, 296446, 321022, 402942, 148990, 296450, 206336, 230916, 230919, 214535, 230923, 304651, 304653, 370187, 230940, 222752, 108066, 296486, 296488, 157229, 239152, 230961, 157236, 288320, 288325, 124489, 280140, 280145, 288338, 280149, 288344, 280152, 239194, 280158, 403039, 370272, 181854, 239202, 312938, 280183, 280185, 280188, 280191, 116354, 280194, 280208, 280211, 288408, 280218, 280222, 419489, 190118, 321195, 296622, 321200, 337585, 296626, 296634, 296637, 419522, 313027, 280260, 419525, 206536, 280264, 206539, 206541, 206543, 263888, 313044, 280276, 321239, 280283, 313052, 18140, 288478, 313055, 419555, 321252, 313066, 288494, 280302, 280304, 313073, 321266, 419570, 288499, 288502, 280314, 288510, 124671, 67330, 280324, 198405, 288519, 280331, 198416, 280337, 296723, 116503, 321304, 329498, 296731, 321311, 313121, 313123, 304932, 321316, 280363, 141101, 165678, 280375, 321336, 296767, 288576, 345921, 337732, 280388, 304968, 280393, 280402, 173907, 313171, 313176, 42842, 280419, 321381, 296809, 296812, 313201, 1920, 255873, 305028, 280454, 247688, 280464, 124817, 280468, 239510, 280473, 124827, 214940, 247709, 214944, 280487, 313258, 321458, 296883, 124853, 214966, 296890, 10170, 288700, 296894, 190403, 296900, 280515, 337862, 165831, 280521, 231379, 296921, 354265, 354270, 239586, 313320, 354281, 231404, 124913, 165876, 321528, 239612, 313340, 288764, 239617, 313347, 288773, 313358, 305176, 313371, 354338, 305191, 223273, 313386, 354348, 124978, 215090, 124980, 288824, 288826, 321595, 378941, 313406, 288831, 288836, 67654, 280651, 354382, 288848, 280658, 215123, 354390, 288855, 288859, 280669, 313438, 149599, 280671, 149601, 321634, 149603, 223327, 329830, 280681, 313451, 223341, 280687, 149618, 215154, 313458, 280691, 313464, 329850, 321659, 280702, 288895, 321670, 215175, 141446, 288909, 141455, 275606, 141459, 280725, 313498, 100520, 288936, 280747, 288940, 288947, 280755, 321717, 280759, 280764, 280769, 280771, 280774, 280776, 313548, 321740, 280783, 280786, 280788, 313557, 280793, 280796, 280798, 338147, 280804, 280807, 157930, 280811, 280817, 125171, 280819, 157940, 182517, 280823, 280825, 280827, 280830, 280831, 280833, 125187, 280835, 125191, 125207, 125209, 321817, 125218, 321842, 223539, 125239, 280888, 280891, 289087, 280897, 280900, 305480, 239944, 280906, 239947, 305485, 305489, 379218, 280919, 248153, 354653, 354656, 313700, 313705, 280937, 190832, 280946, 223606, 313720, 280956, 280959, 313731, 199051, 240011, 289166, 240017, 297363, 190868, 240021, 297365, 297368, 297372, 141725, 297377, 289186, 297391, 289201, 240052, 289207, 289210, 305594, 281024, 289218, 289221, 289227, 281045, 281047, 166378, 305647, 281075, 174580, 240124, 281084, 305662, 305664, 240129, 305666, 305668, 223749, 240132, 330244, 223752, 150025, 338440, 281095, 223757, 281102, 223763, 223765, 281113, 322074, 281116, 281121, 182819, 281127, 281135, 150066, 158262, 158266, 289342, 281154, 322115, 158283, 281163, 281179, 338528, 338532, 281190, 199273, 281196, 19053, 158317, 313973, 297594, 281210, 158347, 264845, 182926, 133776, 314003, 117398, 314007, 289436, 174754, 330404, 289448, 133801, 174764, 314029, 314033, 240309, 133817, 314045, 314047, 314051, 199364, 297671, 158409, 256716, 289493, 363234, 289513, 289522, 289525, 289532, 322303, 289537, 322310, 264969, 322314, 322318, 281361, 281372, 322341, 215850, 281388, 289593, 281401, 289601, 281410, 281413, 281414, 240458, 281420, 240468, 281430, 322393, 297818, 281435, 281438, 281442, 174955, 224110, 207733, 207737, 158596, 183172, 338823, 322440, 314249, 240519, 183184, 142226, 289687, 240535, 297883, 289694, 289696, 289700, 289712, 281529, 289724, 52163, 183260, 281567, 289762, 322534, 297961, 183277, 322550, 134142, 322563, 314372, 330764, 175134, 322599, 322610, 314421, 281654, 314427, 314433, 207937, 314441, 207949, 322642, 314456, 281691, 314461, 281702, 281704, 314474, 281708, 281711, 289912, 248995, 306341, 306344, 306347, 322734, 306354, 142531, 199877, 289991, 306377, 289997, 249045, 363742, 363745, 298216, 330988, 126190, 216303, 322801, 388350, 257302, 363802, 199976, 199978, 314671, 298292, 298294, 257334, 216376, 380226, 298306, 224584, 224587, 224594, 216404, 306517, 150870, 314714, 224603, 159068, 314718, 265568, 314723, 281960, 150890, 306539, 314732, 314736, 290161, 216436, 306549, 298358, 314743, 306552, 290171, 314747, 306555, 298365, 290174, 224641, 281987, 298372, 314756, 281990, 224647, 265604, 298377, 314763, 142733, 298381, 314768, 224657, 306581, 314773, 314779, 314785, 314793, 282025, 282027, 241068, 241070, 241072, 282034, 241077, 150966, 298424, 306618, 282044, 323015, 306635, 306640, 290263, 290270, 290275, 339431, 282089, 191985, 282098, 290291, 282101, 241142, 191992, 290298, 151036, 290302, 282111, 290305, 175621, 306694, 192008, 323084, 257550, 282127, 290321, 282130, 323090, 290325, 282133, 241175, 290328, 282137, 290332, 241181, 282142, 282144, 290344, 306731, 290349, 290351, 290356, 28219, 282186, 224849, 282195, 282199, 282201, 306778, 159324, 159330, 314979, 298598, 323176, 224875, 241260, 323181, 257658, 315016, 282249, 290445, 282261, 175770, 298651, 282269, 323229, 298655, 323231, 61092, 282277, 306856, 282295, 323260, 282300, 323266, 282310, 323273, 282319, 306897, 241362, 306904, 282328, 298714, 52959, 216801, 282337, 241380, 216806, 323304, 282345, 12011, 282356, 323318, 282364, 282367, 306945, 241412, 323333, 282376, 216842, 323345, 282388, 323349, 282392, 184090, 315167, 315169, 282402, 315174, 323367, 241448, 315176, 241450, 282410, 306988, 306991, 315184, 323376, 315190, 241464, 159545, 282425, 298811, 118593, 307009, 413506, 307012, 241475, 298822, 315211, 282446, 307027, 315221, 323414, 315223, 241496, 241498, 307035, 307040, 110433, 282465, 241509, 110438, 298860, 110445, 282478, 315249, 282481, 110450, 315251, 315253, 315255, 339838, 315267, 282499, 315269, 241544, 282505, 241546, 241548, 298896, 298898, 282514, 241556, 298901, 241560, 282520, 241563, 241565, 241567, 241569, 282531, 241574, 282537, 298922, 36779, 241581, 282542, 241583, 323504, 241586, 290739, 241588, 282547, 241590, 241592, 241598, 290751, 241600, 241605, 151495, 241610, 298975, 241632, 298984, 241640, 241643, 298988, 241646, 241649, 241652, 323574, 290807, 299003, 241661, 299006, 282623, 315396, 241669, 315397, 282632, 282639, 290835, 282645, 241693, 282654, 241701, 102438, 217127, 282669, 323630, 282681, 290877, 282687, 159811, 315463, 315466, 192589, 307278, 192596, 176213, 307287, 307290, 217179, 315482, 192605, 315483, 233567, 299105, 200801, 217188, 299109, 307303, 315495, 356457, 45163, 307307, 315502, 192624, 307314, 323700, 299126, 233591, 299136, 307329, 315524, 307338, 233613, 241813, 307352, 299164, 241821, 299167, 315552, 184479, 184481, 315557, 184486, 307370, 307372, 184492, 307374, 307376, 299185, 323763, 184503, 299191, 176311, 307386, 258235, 307388, 176316, 307390, 307385, 299200, 184512, 307394, 299204, 307396, 184518, 307399, 323784, 233679, 307409, 307411, 176343, 299225, 233701, 307432, 184572, 282881, 184579, 282893, 323854, 291089, 282906, 291104, 233766, 295583, 176435, 307508, 315701, 332086, 307510, 307512, 168245, 307515, 307518, 282942, 282947, 323917, 282957, 110926, 233808, 323921, 315733, 323926, 233815, 315739, 323932, 299357, 242018, 242024, 299373, 315757, 250231, 242043, 315771, 299388, 299391, 291202, 299398, 242057, 291212, 299405, 291222, 315801, 283033, 242075, 291226, 61855, 291231, 283042, 291238, 291241, 127403, 127405, 291247, 299440, 127407, 299444, 127413, 291254, 283062, 127417, 291260, 127421, 127424, 299457, 127429, 127431, 127434, 315856, 127440, 176592, 315860, 176597, 127447, 283095, 299481, 127449, 176605, 242143, 127455, 127457, 291299, 340454, 127463, 242152, 291305, 127466, 176620, 127469, 127474, 291314, 291317, 127480, 135672, 291323, 233979, 127485, 291330, 127494, 283142, 135689, 233994, 127497, 127500, 291341, 233998, 127506, 234003, 234006, 127511, 152087, 283161, 234010, 135707, 242202, 135710, 242206, 242208, 291361, 242220, 291378, 152118, 234038, 234041, 315961, 70213, 242250, 111193, 242275, 299620, 242279, 168562, 184952, 135805, 135808, 291456, 373383, 299655, 135820, 316051, 225941, 316054, 299672, 135834, 373404, 299677, 225948, 135839, 299680, 225954, 299684, 135844, 242343, 209576, 242345, 373421, 135870, 135873, 135876, 135879, 299720, 299723, 299726, 225998, 226002, 119509, 226005, 226008, 299740, 242396, 201444, 299750, 283368, 234219, 283372, 226037, 283382, 316151, 234231, 234236, 226045, 242431, 234239, 209665, 234242, 299778, 242436, 234246, 226056, 291593, 234248, 242443, 234252, 242445, 234254, 291601, 234258, 242450, 242452, 234261, 348950, 201496, 234264, 234266, 234269, 283421, 234272, 234274, 152355, 299814, 234278, 283432, 234281, 234284, 234287, 283440, 185138, 242483, 234292, 234296, 234298, 160572, 283452, 234302, 234307, 242499, 234309, 316233, 234313, 316235, 234316, 283468, 234319, 242511, 234321, 234324, 185173, 201557, 234329, 234333, 308063, 234336, 242530, 349027, 234338, 234341, 234344, 234347, 177004, 234350, 324464, 234353, 152435, 177011, 234356, 234358, 234362, 226171, 234364, 291711, 234368, 291714, 234370, 291716, 234373, 316294, 226182, 234375, 308105, 226185, 234379, 201603, 324490, 234384, 234388, 234390, 226200, 234393, 209818, 308123, 324504, 234396, 291742, 324508, 234398, 234401, 291747, 291748, 234405, 291750, 324518, 324520, 234407, 324522, 234410, 291756, 291754, 226220, 324527, 234414, 234417, 201650, 324531, 291760, 234422, 226230, 324536, 275384, 234428, 291773, 242623, 324544, 234431, 234434, 324546, 324548, 234437, 226239, 226245, 234439, 234443, 291788, 234446, 193486, 193488, 234449, 275406, 234452, 234455, 234459, 234461, 234464, 234467, 234470, 168935, 5096, 324585, 234475, 234478, 316400, 234481, 316403, 234484, 234485, 234487, 324599, 234490, 234493, 316416, 234496, 234501, 275462, 308231, 234504, 234507, 234510, 234515, 300054, 316439, 234520, 234519, 234523, 234526, 234528, 300066, 234532, 300069, 234535, 234537, 234540, 234543, 234546, 275508, 300085, 234549, 300088, 234553, 234556, 234558, 316479, 234561, 316483, 160835, 234563, 308291, 234568, 234570, 316491, 234572, 300108, 234574, 300115, 234580, 234581, 234585, 275545, 242777, 234590, 234593, 234595, 234597, 300133, 234601, 300139, 234605, 160879, 234607, 275569, 234610, 316530, 300148, 234614, 398455, 144506, 234618, 234620, 275579, 234623, 226433, 234627, 275588, 234629, 234634, 234636, 177293, 234640, 275602, 234643, 308373, 226453, 234647, 234648, 275608, 234650, 308379, 324757, 300189, 324766, 119967, 234653, 324768, 283805, 234657, 242852, 300197, 234661, 283813, 234664, 177318, 275626, 234667, 316596, 308414, 234687, 300223, 300226, 308418, 234692, 300229, 308420, 308422, 283844, 300234, 283850, 300238, 300241, 316625, 300243, 300245, 316630, 300248, 300253, 300256, 300258, 300260, 234726, 300263, 300265, 300267, 161003, 300270, 300272, 120053, 300278, 275703, 316663, 300284, 275710, 300287, 292097, 300289, 161027, 300292, 300294, 275719, 234760, 177419, 300299, 242957, 300301, 275725, 177424, 283917, 349451, 349464, 415009, 283939, 259367, 292143, 283951, 300344, 226617, 243003, 283963, 226628, 300357, 283973, 177482, 283983, 316758, 357722, 316766, 316768, 292192, 218464, 292197, 316774, 243046, 218473, 136562, 324978, 333178, 275834, 275836, 275840, 316803, 316806, 226696, 316811, 226699, 316814, 226703, 300433, 234899, 300436, 226709, 357783, 316824, 316826, 300448, 144807, 144810, 144812, 284076, 144814, 227426, 144820, 374196, 284084, 292279, 284087, 144826, 144828, 144830, 144832, 144835, 144837, 38342, 144839, 144841, 144844, 144847, 144852, 144855, 103899, 300507, 333280, 226787, 218597, 292329, 300523, 259565, 300527, 308720, 259567, 292338, 226802, 316917, 292343, 308727, 300537, 316933, 316947, 308757, 308762, 284191, 316959, 284194, 284196, 235045, 284199, 284204, 284206, 284209, 284211, 194101, 284213, 316983, 194103, 284215, 308790, 284218, 226877, 292414, 284223, 284226, 284228, 243268, 292421, 284231, 226886, 128584, 284234, 366155, 317004, 276043, 284238, 226895, 284241, 194130, 284243, 300628, 284245, 292433, 284247, 317015, 235097, 243290, 276052, 276053, 284249, 300638, 284251, 284253, 284255, 284258, 243293, 292452, 292454, 284263, 177766, 284265, 292458, 284267, 292461, 284272, 284274, 284278, 292470, 276086, 292473, 284283, 276093, 284286, 292479, 284288, 292481, 284290, 325250, 284292, 292485, 325251, 276095, 276098, 284297, 317066, 284299, 317068, 284301, 276109, 284303, 284306, 276114, 284308, 284312, 284314, 284316, 276127, 284320, 284322, 284327, 284329, 317098, 284331, 276137, 284333, 284335, 276144, 284337, 284339, 300726, 284343, 284346, 284350, 358080, 276160, 284354, 358083, 284358, 276166, 358089, 284362, 276170, 284365, 276175, 284368, 276177, 284370, 358098, 284372, 317138, 284377, 284379, 284381, 284384, 358114, 284386, 358116, 276197, 317158, 358119, 284392, 325353, 358122, 284394, 284397, 358126, 284399, 358128, 276206, 358133, 358135, 276216, 358138, 300795, 358140, 284413, 358142, 358146, 317187, 284418, 317189, 317191, 284428, 300816, 300819, 317207, 300828, 300830, 276255, 300832, 325408, 300834, 317221, 227109, 358183, 186151, 276268, 300845, 243504, 300850, 284469, 276280, 325436, 358206, 276291, 366406, 276295, 300872, 292681, 153417, 358224, 284499, 276308, 178006, 317271, 284502, 276315, 292700, 317279, 284511, 227175, 292715, 300912, 292721, 284529, 300915, 284533, 292729, 317306, 284540, 292734, 325512, 169868, 317332, 358292, 284564, 284566, 399252, 350106, 284572, 276386, 284579, 276388, 358312, 317353, 284585, 276395, 292776, 292784, 276402, 358326, 161718, 358330, 276411, 276418, 276425, 301009, 301011, 301013, 292823, 358360, 301017, 301015, 292828, 276446, 153568, 276448, 292839, 276455, 292843, 276460, 292845, 178161, 227314, 276466, 325624, 276472, 317435, 276476, 276479, 276482, 276485, 317446, 276490, 350218, 292876, 350222, 317456, 276496, 317458, 178195, 243733, 243740, 317468, 317472, 325666, 243751, 292904, 276528, 243762, 309298, 325685, 325689, 235579, 325692, 235581, 178238, 276539, 276544, 284739, 325700, 243779, 292934, 243785, 276553, 350293, 350295, 309337, 227418, 350299, 194649, 350302, 194654, 350304, 178273, 309346, 227423, 194660, 350308, 309350, 309348, 292968, 309352, 309354, 301163, 350313, 350316, 227430, 301167, 276583, 350321, 276590, 284786, 276595, 350325, 252022, 227440, 350328, 292985, 301178, 350332, 292989, 301185, 292993, 350339, 317570, 317573, 350342, 350345, 350349, 301199, 317584, 325777, 350354, 350357, 350359, 350362, 350366, 276638, 153765, 284837, 350375, 350379, 350381, 350383, 129200, 350385, 350387, 350389, 350395, 350397, 350399, 227520, 350402, 227522, 301252, 350406, 227529, 301258, 309450, 276685, 309455, 276689, 309462, 301272, 276699, 194780, 309468, 309471, 301283, 317672, 317674, 325867, 243948, 194801, 309491, 227571, 309494, 243960, 227583, 276735, 227587, 276739, 211204, 276742, 227596, 325910, 309530, 342298, 211232, 317729, 276775, 211241, 325937, 325943, 211260, 260421, 276809, 285002, 276811, 235853, 276816, 235858, 276829, 276833, 391523, 276836, 293227, 276843, 293232, 276848, 186744, 211324, 227709, 285061, 366983, 317833, 178572, 285070, 285077, 178583, 227738, 317853, 276896, 317858, 342434, 285093, 317864, 285098, 276907, 235955, 276917, 293304, 293307, 293314, 309707, 293325, 317910, 293336, 235996, 317917, 293343, 358880, 276961, 293346, 227810, 276964, 293352, 236013, 293364, 301562, 293370, 317951, 309764, 301575, 121352, 293387, 236043, 342541, 317963, 113167, 55822, 309779, 317971, 309781, 277011, 55837, 227877, 227879, 293417, 227882, 309804, 293421, 105007, 236082, 285236, 23094, 277054, 244288, 219714, 129603, 301636, 318020, 301639, 301643, 285265, 399955, 309844, 277080, 309849, 285277, 285282, 326244, 318055, 277100, 309871, 121458, 170618, 170619, 309885, 309888, 277122, 227975, 277128, 285320, 301706, 318092, 326285, 334476, 318094, 277136, 277139, 227992, 334488, 318108, 285340, 318110, 227998, 137889, 383658, 285357, 318128, 277170, 293555, 318132, 342707, 154292, 277173, 277177, 277181, 318144, 277187, 277191, 277194, 277196, 277201, 342745, 137946, 342747, 342749, 113378, 203491, 228069, 277223, 342760, 285417, 56041, 56043, 277232, 228081, 56059, 310015, 285441, 310020, 285448, 310029, 228113, 285459, 277273, 293659, 326430, 228128, 285474, 293666, 228135, 318248, 277291, 318253, 293677, 285489, 301876, 293685, 285494, 301880, 285499, 301884, 293696, 310080, 277317, 293706, 277322, 277329, 162643, 310100, 301911, 301913, 277337, 301921, 400236, 236397, 162671, 326514, 310134, 236408, 15224, 277368, 416639, 416640, 113538, 310147, 416648, 39817, 187274, 277385, 301972, 424853, 277405, 277411, 310179, 293798, 293802, 236460, 277426, 293811, 276579, 293817, 293820, 203715, 326603, 342994, 276586, 293849, 293861, 228327, 228328, 318442, 228330, 228332, 326638, 277486, 351217, 318450, 293876, 293877, 285686, 302073, 121850, 293882, 302075, 244731, 285690, 293887, 277504, 277507, 277511, 293899, 277519, 293908, 302105, 293917, 293939, 318516, 277561, 277564, 310336, 7232, 293956, 277573, 228422, 293960, 310344, 277577, 277583, 203857, 293971, 310355, 310359, 236632, 277594, 138332, 277598, 203872, 277601, 285792, 310374, 203879, 310376, 228460, 318573, 203886, 187509, 285815, 367737, 285817, 302205, 285821, 392326, 285831, 253064, 294026, 302218, 285835, 162964, 384148, 187542, 302231, 285849, 302233, 285852, 302237, 285854, 285856, 302241, 285862, 277671, 302248, 64682, 277678, 294063, 294065, 302258, 277687, 294072, 318651, 294076, 277695, 318657, 244930, 302275, 130244, 302277, 228550, 302282, 310476, 302285, 302288, 310481, 302290, 203987, 302292, 302294, 310486, 302296, 384222, 310498, 285927, 318698, 302315, 228592, 294132, 138485, 228601, 204026, 228606, 204031, 64768, 310531, 138505, 228617, 318742, 204067, 277798, 130345, 277801, 113964, 285997, 277804, 285999, 277807, 113969, 277811, 318773, 318776, 277816, 286010, 277819, 294204, 417086, 277822, 286016, 302403, 294211, 384328, 277832, 277836, 294221, 294223, 326991, 277839, 277842, 277847, 277850, 179547, 277853, 146784, 277857, 302436, 277860, 294246, 327015, 310632, 327017, 351594, 277864, 277869, 277872, 351607, 310648, 277880, 310651, 277884, 277888, 310657, 351619, 294276, 310659, 327046, 277892, 253320, 310665, 318858, 277894, 277898, 277903, 310672, 351633, 277905, 277908, 277917, 310689, 277921, 130468, 228776, 277928, 277932, 310703, 277937, 310710, 130486, 310712, 277944, 310715, 277947, 302526, 228799, 277950, 277953, 302534, 310727, 245191, 64966, 277959, 277963, 302541, 277966, 302543, 310737, 277971, 228825, 163290, 277978, 310749, 277981, 277984, 310755, 277989, 277991, 187880, 277995, 310764, 286188, 278000, 228851, 310772, 278003, 278006, 40440, 212472, 278009, 40443, 286203, 310780, 40448, 228864, 286214, 228871, 302603, 302614, 302617, 286233, 302621, 286240, 146977, 187939, 40484, 294435, 40486, 286246, 294440, 40488, 294439, 294443, 40491, 294445, 196133, 310831, 245288, 286248, 40499, 40502, 212538, 40507, 40511, 40513, 228933, 327240, 40521, 286283, 40525, 40527, 212560, 400976, 228944, 40533, 147032, 40537, 40539, 40541, 278109, 40544, 40548, 40550, 40552, 286312, 40554, 286313, 310892, 40557, 40560, 188022, 122488, 294521, 343679, 294537, 310925, 286354, 278163, 302740, 122517, 278168, 179870, 327333, 229030, 212648, 278188, 302764, 278192, 319153, 278196, 302781, 319171, 302789, 294599, 278216, 294601, 302793, 343757, 212690, 319187, 286420, 278227, 229076, 286425, 319194, 278235, 229086, 278238, 286432, 294625, 294634, 302838, 319226, 286460, 278274, 302852, 278277, 302854, 294664, 311048, 352008, 319243, 311053, 302862, 319251, 294682, 278306, 188199, 294701, 319280, 278320, 319290, 229192, 302925, 188247, 188252, 237409, 229233, 294776, 360317, 294785, 327554, 360322, 40840, 40851, 294803, 188312, 294811, 237470, 319390, 40865, 319394, 294817, 294821, 311209, 180142, 343983, 294831, 188340, 40886, 319419, 294844, 294847, 237508, 393177, 294876, 294879, 294883, 393190, 294890, 311279, 278513, 237555, 311283, 278516, 278519, 237562 ]
26fe168bdd0550000fad44902727dcd6a782d7a4
3f3091ed8a664df2db5781304c108e3fe3e6587c
/TipsTests/TipsTests.swift
a713c736ec00e03ec64114e0b5286c40231753a8
[]
no_license
dp467/Tipsy
ba703a5ce5676b6d15edb54c9adba939763ab0d7
078bc4ce95f700f48dcb0e6a703deb42713aa3de
refs/heads/master
2022-08-12T10:55:46.922561
2020-05-10T14:44:14
2020-05-10T14:44:14
262,624,912
0
0
null
null
null
null
UTF-8
Swift
false
false
890
swift
// // TipsTests.swift // TipsTests // // Created by Dhruv Patel on 5/10/20. // Copyright © 2020 Dhruv Patel. All rights reserved. // import XCTest @testable import Tips class TipsTests: 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. } } }
[ 358410, 145435, 317467, 241692, 239650, 329765, 292902, 354343, 223274, 315434, 325674, 282672, 241716, 288828, 288833, 288834, 315465, 311372, 311374, 354385, 196691, 329814, 354393, 200794, 309345, 280675, 280677, 43110, 321637, 329829, 131178, 319598, 288879, 204916, 223350, 131191, 233590, 288889, 280694, 131198, 319629, 235662, 311438, 325776, 362659, 173, 239793, 405687, 180408, 227513, 295098, 379071, 258239, 280768, 301251, 417988, 227524, 309444, 417994, 321745, 280795, 194782, 356576, 346346, 125169, 344313, 327929, 149760, 194820, 321800, 180493, 278797, 254226, 338197, 227616, 278816, 305440, 211235, 151847, 282919, 332083, 332085, 332089, 282939, 287041, 139589, 182597, 280902, 282960, 325968, 366929, 155990, 289110, 215385, 168281, 332123, 334171, 106847, 323935, 332127, 354655, 321894, 242033, 313713, 291192, 246137, 315773, 211326, 291198, 225670, 332167, 242058, 395659, 311691, 227725, 108944, 252308, 291224, 39324, 285084, 317852, 242078, 141728, 315810, 315811, 381347, 289189, 108972, 299441, 283064, 311738, 293310, 291265, 278978, 291267, 127427, 127428, 283075, 311745, 317901, 278989, 281037, 281040, 278993, 334290, 289232, 369116, 285150, 279008, 160225, 279013, 127465, 279018, 311786, 330218, 109042, 319987, 279029, 233978, 301571, 342536, 279050, 279062, 289304, 279065, 291358, 293419, 244269, 234036, 315960, 338490, 115270, 55881, 377418, 436832, 244327, 295536, 287346, 344696, 301689, 244347, 279164, 356989, 291454, 311945, 369289, 330379, 311949, 334481, 316049, 330387, 330388, 111253, 295576, 111258, 279206, 295599, 342706, 299699, 299700, 164533, 289462, 109241, 248517, 363211, 154316, 242386, 279252, 289502, 299746, 295652, 299759, 199414, 344828, 221948, 279294, 363263, 299776, 295682, 291592, 322313, 326414, 312079, 322319, 295697, 291604, 207640, 291612, 326429, 293664, 281377, 326433, 279336, 295724, 152365, 312108, 285487, 301871, 318252, 353078, 230199, 293693, 295746, 318278, 201549, 281427, 353109, 230234, 322395, 109409, 177001, 201577, 242541, 207727, 400239, 330609, 174963, 109428, 207732, 310131, 209783, 113542, 109447, 416646, 228233, 316298, 236428, 349072, 56208, 308112, 209817, 289690, 127902, 185250, 310182, 240552, 353195, 236461, 293806, 316333, 316343, 289722, 230332, 353215, 279498, 248796, 52200, 203757, 289774, 287731, 277492, 316405, 240630, 312314, 314362, 328700, 328706, 293893, 134150, 330763, 320527, 238610, 308243, 316437, 197657, 281626, 175132, 326685, 300068, 322612, 359478, 238651, 302139, 361535, 21569, 314436, 214086, 359495, 296019, 339030, 353367, 361566, 281697, 230499, 314467, 228458, 207979, 281706, 318572, 316526, 15471, 351344, 312434, 353397, 300150, 300151, 337017, 285820, 300158, 150657, 302213, 228491, 228493, 169104, 177296, 326804, 119962, 283802, 285851, 296092, 300188, 300202, 306346, 253100, 228540, 230588, 228542, 353479, 62665, 353481, 353482, 189652, 189653, 148696, 333022, 304351, 304356, 290022, 234733, 279792, 353523, 298228, 216315, 208124, 292091, 261377, 228609, 320770, 292107, 353551, 251153, 177428, 245019, 126237, 115998, 333090, 279854, 298291, 171317, 318775, 286013, 333117, 300359, 312648, 294218, 296273, 331090, 120148, 314709, 314710, 357719, 134491, 316765, 222559, 163175, 333160, 306542, 296303, 327025, 249204, 249205, 181625, 111993, 290169, 224640, 306560, 294275, 298374, 368011, 304524, 296335, 112017, 112018, 234898, 224661, 318875, 310692, 241066, 316842, 314798, 286129, 279989, 353719, 228795, 292283, 280004, 300487, 306631, 284107, 302540, 310732, 312782, 64975, 310736, 327121, 366037, 210393, 286172, 144867, 103909, 316902, 245223, 54765, 191981, 282096, 321009, 329200, 191990, 280055, 300536, 359930, 290301, 286205, 300542, 230913, 292356, 323087, 323089, 282141, 187938, 355876, 245292, 230959, 288309, 290358, 194110, 288318, 56902, 282183, 288327, 292423, 243274, 333388, 224847, 228943, 118353, 280147, 290390, 128599, 235095, 196187, 44635, 333408, 157281, 286306, 374372, 312940, 204397, 224883, 333430, 370296, 247416, 175741, 337535, 294529, 312965, 282246, 229001, 290443, 188048, 282259, 302739, 229020, 257699, 40613, 40614, 40615, 298661, 61101, 321199, 337591, 280251, 327358, 333503, 282303, 323264, 321219, 333509, 9936, 9937, 302802, 229088, 298720, 321249, 153319, 12010, 280300, 325371, 194303, 194304, 216839, 284431, 243472, 321295, 161554, 323346, 116505, 313120, 241441, 315171, 284459, 294700, 200498, 319292, 325439, 315202, 307011, 325445, 282438, 153415, 280392, 337745, 325457, 413521, 317269, 18262, 284507, 300894, 245599, 237408, 302946, 276327, 325484, 296814, 282480, 292720, 325492, 241528, 194429, 325503, 315264, 188292, 253829, 241540, 327557, 67463, 243591, 315273, 317323, 315274, 243597, 329622, 294807, 333722, 311199, 292771, 300963, 313254, 294823, 292782, 317360, 294843, 362431, 214977, 280514, 174019, 214984, 284619, 344013, 231375, 294886, 317415, 354280, 247785, 296941, 362480, 278512, 311281, 223218, 311282, 333817, 292858 ]
c27e51c6526ffd3808925d2f8c87278da8d017c2
d8e77c3848826836c614dcd80759ba18f8381d4f
/GuidedProject/Playlist/Playlist/AppDelegate.swift
7c862ac9743522428d643a6bfca9f551849c4425
[]
no_license
hmiranda3/Module-8
dfe1afe4c9858d403eaed7f45b95de9774baa200
42f8efce697aec698a9c0bf84b95b22b16d05871
refs/heads/master
2021-01-01T04:30:21.340641
2016-05-11T21:37:09
2016-05-11T21:37:09
58,560,664
0
0
null
null
null
null
UTF-8
Swift
false
false
2,145
swift
// // AppDelegate.swift // Playlist // // Created by Habib Miranda on 5/11/16. // Copyright © 2016 littleJohns. 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, 303241, 417930, 311436, 303244, 319633, 286873, 286876, 311460, 311469, 32944, 327862, 286906, 327866, 180413, 286910, 131264, 286916, 286922, 286924, 286926, 319694, 286928, 131281, 278743, 278747, 295133, 155872, 319716, 278760, 237807, 303345, 286962, 131314, 229622, 327930, 278781, 278783, 278785, 237826, 319751, 278792, 286987, 319757, 311569, 286999, 319770, 287003, 287006, 287009, 287012, 287014, 287016, 287019, 311598, 287023, 262448, 311601, 287032, 155966, 278849, 319809, 319810, 319814, 311623, 319818, 311628, 229709, 287054, 319822, 278865, 229717, 196963, 196969, 139638, 213367, 106872, 319872, 311683, 319879, 311693, 65943, 319898, 311719, 278952, 139689, 278957, 311728, 278967, 180668, 311741, 278975, 319938, 278980, 98756, 278983, 319945, 278986, 319947, 278990, 278994, 311767, 279003, 279006, 188895, 172512, 279010, 287202, 279015, 172520, 319978, 279020, 172526, 279023, 311791, 172529, 279027, 319989, 164343, 180727, 279035, 311804, 287230, 279040, 303617, 287234, 279045, 287238, 172550, 172552, 303623, 320007, 279051, 172558, 279055, 303632, 279058, 303637, 279063, 279067, 172572, 279072, 172577, 295459, 172581, 295461, 279082, 311850, 279084, 172591, 172598, 279095, 172607, 172609, 172612, 377413, 172614, 172618, 303690, 33357, 287309, 279124, 172634, 262752, 172644, 311911, 189034, 295533, 189039, 189040, 172655, 172656, 295538, 189044, 172660, 287349, 352880, 287355, 287360, 295553, 287365, 311942, 303751, 295557, 352905, 279178, 287371, 311946, 311951, 287377, 172691, 287381, 311957, 221850, 287386, 164509, 287390, 295583, 303773, 172702, 287394, 230045, 303780, 172705, 287398, 172707, 287400, 279208, 172714, 295595, 279212, 189102, 172721, 287409, 66227, 303797, 189114, 287419, 303804, 328381, 279231, 287423, 328384, 287427, 312006, 107208, 279241, 107212, 172748, 287436, 172751, 287440, 295633, 172755, 303827, 279255, 172760, 279258, 303835, 213724, 189149, 303838, 287450, 279267, 312035, 295654, 279272, 230128, 312048, 312050, 230131, 205564, 303871, 230146, 328453, 295685, 230154, 33548, 312077, 295695, 295701, 369433, 230169, 295707, 328476, 295710, 230175, 303914, 279340, 205613, 279353, 230202, 312124, 222018, 295755, 377676, 148302, 287569, 279383, 303959, 230237, 279390, 230241, 279394, 303976, 336744, 303985, 328563, 303987, 279413, 303991, 303997, 295806, 295808, 304005, 295813, 213895, 320391, 304007, 304009, 304011, 230284, 304013, 213902, 279438, 295822, 189329, 295825, 304019, 189331, 279445, 58262, 279452, 410526, 279461, 279462, 304042, 213931, 230327, 304055, 287675, 304063, 238528, 304065, 189378, 213954, 156612, 295873, 213963, 312272, 304084, 304090, 320481, 304106, 320490, 312302, 328687, 320496, 304114, 295928, 320505, 312321, 295945, 295949, 197645, 230413, 320528, 140312, 295961, 238620, 197663, 304164, 189479, 304170, 238641, 312374, 238652, 238655, 230465, 238658, 296004, 336964, 205895, 320584, 238666, 296021, 402518, 336987, 230497, 296036, 296040, 361576, 205931, 296044, 164973, 205934, 279661, 312432, 279669, 337018, 189562, 279679, 279683, 222340, 205968, 296084, 238745, 304285, 238756, 205991, 222377, 165035, 337067, 165038, 238766, 230576, 238770, 304311, 230592, 279750, 312518, 230600, 230607, 148690, 320727, 279769, 304348, 279777, 304354, 296163, 320740, 279781, 304360, 320748, 279788, 279790, 304370, 296189, 320771, 312585, 296202, 296205, 230674, 320786, 230677, 296213, 296215, 320792, 230681, 230679, 214294, 304416, 230689, 173350, 312622, 296243, 312630, 222522, 222525, 296253, 312639, 296255, 230718, 296259, 378181, 230727, 238919, 320840, 296264, 296267, 296271, 222545, 230739, 312663, 337244, 222556, 230752, 312676, 230760, 173418, 410987, 230763, 230768, 296305, 312692, 230773, 279929, 181626, 304506, 304505, 181631, 312711, 312712, 296331, 288140, 230800, 288144, 304533, 337306, 288154, 288160, 173472, 288162, 288164, 279975, 304555, 370092, 279983, 288176, 279985, 173488, 312755, 296373, 279991, 312759, 288185, 337335, 222652, 312766, 173507, 296389, 222665, 230860, 280014, 312783, 288208, 230865, 288210, 370130, 288212, 280021, 288214, 222676, 239064, 288217, 288218, 280027, 288220, 329177, 239070, 288224, 288226, 370146, 280036, 288229, 280038, 288230, 288232, 280034, 288234, 320998, 288236, 288238, 288240, 288242, 296435, 288244, 296439, 288250, 402942, 148990, 296446, 206336, 296450, 321022, 230916, 230919, 214535, 370187, 304651, 304653, 230940, 222752, 108066, 296486, 296488, 157229, 230961, 288320, 288325, 124489, 280140, 280145, 288338, 280149, 280152, 288344, 239194, 280158, 403039, 370272, 181854, 239202, 312938, 280183, 280185, 280188, 280191, 280194, 116354, 280208, 280211, 288408, 280218, 280222, 190118, 321195, 296622, 321200, 337585, 296626, 296634, 296637, 313027, 280260, 280264, 206536, 206539, 206541, 206543, 280276, 313044, 321239, 280283, 313052, 288478, 313055, 321252, 313066, 280302, 288494, 280304, 313073, 419570, 321266, 288499, 288502, 280314, 288510, 124671, 67330, 280324, 198405, 288519, 280331, 198416, 280337, 296723, 116503, 321304, 329498, 296731, 321311, 313121, 313123, 304932, 321316, 280363, 141101, 165678, 280375, 321336, 296767, 288576, 345921, 280388, 304968, 280393, 280402, 313176, 42842, 280419, 321381, 296812, 313201, 1920, 255873, 305028, 280454, 247688, 280458, 280464, 124817, 280468, 239510, 280473, 124827, 214940, 247709, 214944, 280487, 313258, 321458, 296883, 124853, 214966, 10170, 296890, 288700, 296894, 280515, 190403, 296900, 337862, 165831, 280521, 231379, 296921, 239586, 313320, 231404, 124913, 165876, 321528, 239612, 313340, 288764, 239617, 313347, 288773, 313358, 321560, 305176, 313371, 354338, 305191, 223273, 313386, 354348, 124978, 215090, 124980, 288824, 288826, 321595, 378941, 313406, 288831, 288836, 67654, 223303, 280651, 354382, 288848, 280658, 215123, 354390, 288855, 288859, 280669, 313438, 280671, 223327, 149599, 321634, 149601, 149603, 329830, 280681, 313451, 223341, 280687, 313458, 280691, 215154, 313464, 329850, 321659, 280702, 288895, 321670, 215175, 141446, 141455, 141459, 280725, 313498, 100520, 288936, 280747, 288940, 280755, 288947, 321717, 280759, 280764, 280769, 280771, 280774, 280776, 313548, 321740, 280783, 280786, 280788, 313557, 280793, 280796, 280798, 338147, 280804, 280807, 157930, 280811, 280817, 125171, 157940, 280819, 182517, 280823, 280825, 280827, 280830, 280831, 280833, 125187, 280835, 125191, 125207, 125209, 321817, 125218, 321842, 223539, 125239, 280888, 280891, 289087, 280897, 280900, 239944, 305480, 280906, 239947, 305485, 305489, 379218, 280919, 354653, 313700, 280937, 313705, 280940, 190832, 280946, 223606, 313720, 280956, 239997, 280959, 313731, 199051, 240011, 289166, 240017, 297363, 190868, 297365, 240021, 297368, 297372, 141725, 297377, 289186, 297391, 289201, 240052, 289207, 305594, 289210, 281024, 289218, 289221, 289227, 281045, 281047, 215526, 166378, 305647, 281075, 174580, 281084, 240124, 305662, 305664, 240129, 305666, 305668, 240132, 223749, 281095, 338440, 150025, 223752, 223757, 281102, 223763, 223765, 281113, 322074, 281116, 281121, 182819, 281127, 281135, 150066, 158262, 158266, 289342, 281154, 322115, 158283, 281163, 281179, 199262, 338528, 338532, 281190, 199273, 281196, 158317, 19053, 313973, 281210, 297594, 158347, 133776, 314003, 117398, 314007, 289436, 174754, 330404, 289448, 133801, 174764, 314029, 314033, 240309, 133817, 314045, 314047, 314051, 199364, 297671, 199367, 158409, 289493, 363234, 289513, 289522, 289525, 289532, 322303, 289537, 322310, 264969, 322314, 322318, 281361, 281372, 322341, 215850, 281388, 207661, 289593, 281401, 289601, 281410, 281413, 281414, 240458, 281420, 240468, 281430, 322393, 297818, 281435, 281438, 281442, 174955, 224110, 207733, 207737, 183172, 158596, 240519, 322440, 338823, 314249, 183184, 289687, 240535, 297883, 289694, 289696, 289700, 289712, 281529, 289724, 52163, 183260, 281567, 289762, 322534, 297961, 183277, 281581, 322550, 134142, 322563, 175134, 322599, 322610, 314421, 281654, 314427, 207937, 314433, 314441, 207949, 322642, 314456, 281691, 314461, 281702, 281704, 314474, 281708, 281711, 289912, 248995, 306341, 306344, 306347, 306354, 142531, 199877, 289991, 306377, 289997, 249045, 363742, 363745, 298216, 330988, 126190, 216303, 322801, 388350, 257302, 363802, 199976, 199978, 314671, 298292, 298294, 257334, 216376, 298306, 380226, 281923, 224584, 224587, 224594, 216404, 306517, 150870, 314714, 224603, 159068, 314718, 265568, 314723, 281960, 150890, 306539, 314732, 314736, 290161, 216436, 306549, 298358, 314743, 306552, 290171, 314747, 306555, 290174, 298365, 224641, 281987, 298372, 314756, 281990, 224647, 265604, 298377, 314763, 142733, 298381, 224657, 306581, 314779, 314785, 282025, 314793, 282027, 241068, 241070, 241072, 282034, 241077, 150966, 298424, 306618, 282044, 323015, 306635, 306640, 290263, 290270, 290275, 339431, 282089, 191985, 282098, 290291, 282101, 241142, 191992, 290298, 151036, 290302, 282111, 290305, 175621, 192008, 323084, 257550, 282127, 290321, 282130, 323090, 282133, 290325, 241175, 290328, 282137, 290332, 241181, 282142, 282144, 290344, 306731, 290349, 290351, 290356, 282186, 224849, 282195, 282199, 282201, 306778, 159324, 159330, 314979, 298598, 323176, 224875, 241260, 323181, 257658, 315016, 282249, 290445, 324757, 282261, 298651, 282269, 323229, 298655, 323231, 61092, 282277, 306856, 282295, 282300, 323260, 323266, 282310, 323273, 282319, 306897, 241362, 282328, 298714, 52959, 216801, 282337, 241380, 216806, 323304, 282345, 12011, 282356, 323318, 282364, 282367, 306945, 241412, 323333, 282376, 216842, 323345, 282388, 323349, 282392, 184090, 315167, 315169, 282402, 315174, 323367, 241448, 315176, 241450, 282410, 306988, 306991, 315184, 323376, 315190, 241464, 159545, 282425, 298811, 307009, 413506, 241475, 307012, 148946, 315211, 282446, 307027, 315221, 282454, 315223, 241496, 323414, 241498, 307035, 307040, 282465, 110433, 241509, 110438, 298860, 110445, 282478, 282481, 110450, 315251, 315249, 315253, 315255, 339838, 282499, 315267, 315269, 241544, 282505, 241546, 241548, 298896, 282514, 298898, 44948, 298901, 241556, 282520, 241560, 241563, 241565, 241567, 241569, 282531, 241574, 282537, 298922, 36779, 241581, 282542, 241583, 323504, 241586, 282547, 241588, 290739, 241590, 241592, 241598, 290751, 241600, 241605, 151495, 241610, 298975, 241632, 298984, 241640, 241643, 298988, 241646, 241649, 241652, 323574, 290807, 241661, 299006, 282623, 315396, 241669, 315397, 282632, 282639, 290835, 282645, 241693, 282654, 241701, 102438, 217127, 282669, 323630, 282681, 290877, 282687, 159811, 315463, 315466, 192589, 307278, 192596, 176213, 307287, 315482, 217179, 315483, 192605, 233567, 200801, 299105, 217188, 299109, 307303, 315495, 356457, 45163, 307307, 315502, 192624, 307314, 323700, 299126, 233591, 299136, 307329, 307338, 233613, 241813, 307352, 299164, 184479, 299167, 184481, 315557, 184486, 307370, 307372, 184492, 307374, 307376, 323763, 176311, 299191, 307385, 307386, 258235, 176316, 307388, 307390, 184503, 299200, 184512, 307394, 307396, 299204, 184518, 307399, 323784, 307409, 307411, 176343, 299225, 233701, 307432, 184572, 282881, 184579, 282893, 291089, 282906, 291104, 233766, 176435, 307508, 315701, 307510, 332086, 151864, 307512, 168245, 307515, 282942, 307518, 151874, 282947, 323917, 110926, 282957, 233808, 323921, 315733, 323926, 233815, 315739, 323932, 299357, 242018, 242024, 299373, 315757, 250231, 242043, 315771, 299388, 299391, 291202, 299398, 242057, 291212, 299405, 291222, 283033, 291226, 242075, 315801, 291231, 61855, 283042, 291238, 291241, 127403, 127405, 291247, 127407, 299440, 299444, 127413, 283062, 291254, 127417, 291260, 283069, 127421, 127424, 299457, 127429, 127431, 283080, 176592, 315856, 315860, 176597, 283095, 127447, 299481, 176605, 242143, 291299, 127463, 242152, 291305, 127466, 176620, 127474, 291314, 291317, 135672, 233979, 291323, 291330, 283142, 127497, 233994, 135689, 291341, 233998, 234003, 234006, 152087, 127511, 283161, 242202, 234010, 135707, 242206, 135710, 242208, 291361, 242220, 291378, 234038, 152118, 234041, 70213, 242250, 111193, 242275, 299620, 242279, 168562, 184952, 135805, 291456, 135808, 373383, 299655, 135820, 316051, 225941, 316054, 299672, 135834, 373404, 299677, 225948, 135839, 299680, 225954, 299684, 242343, 209576, 242345, 373421, 135870, 135873, 135876, 135879, 299720, 299723, 225998, 299726, 226002, 226005, 119509, 226008, 242396, 299740, 201444, 299750, 283368, 234219, 283372, 226037, 283382, 234231, 316151, 234236, 226045, 234239, 242431, 209665, 234242, 299778, 242436, 226053, 234246, 226056, 234248, 291593, 242443, 234252, 242445, 234254, 291601, 234258, 242450, 242452, 234261, 348950, 201496, 234264, 234266, 283421, 234269, 234272, 234274, 152355, 234278, 299814, 283432, 234281, 234284, 234287, 283440, 185138, 242483, 234292, 234296, 234298, 283452, 160572, 234302, 234307, 242499, 234309, 292433, 234313, 316233, 316235, 234316, 283468, 242511, 234319, 234321, 234324, 185173, 201557, 234329, 234333, 308063, 234336, 234338, 242530, 349027, 234341, 234344, 234347, 177004, 234350, 324464, 234353, 152435, 177011, 234356, 234358, 234362, 226171, 291711, 234368, 234370, 201603, 291714, 234373, 226182, 234375, 291716, 226185, 308105, 234379, 234384, 234388, 234390, 226200, 324504, 234393, 209818, 308123, 324508, 234398, 234396, 291742, 234401, 291747, 291748, 234405, 291750, 234407, 324518, 324520, 234410, 324522, 226220, 291756, 291754, 324527, 291760, 234417, 201650, 324531, 234414, 234422, 226230, 275384, 324536, 234428, 291773, 234431, 242623, 324544, 324546, 226239, 324548, 226245, 234437, 234439, 234434, 234443, 291788, 193486, 234446, 193488, 275406, 234449, 316370, 234452, 234455, 234459, 234461, 234464, 234467, 234470, 168935, 5096, 324585, 234475, 234478, 316400, 234481, 316403, 234484, 234485, 324599, 234487, 234490, 234493, 234496, 316416, 234501, 275462, 308231, 234504, 234507, 234510, 234515, 300054, 234519, 316439, 234520, 234523, 234526, 234528, 300066, 234532, 300069, 234535, 234537, 234540, 144430, 234543, 234546, 275508, 234549, 300085, 300088, 234553, 234556, 234558, 316479, 234561, 316483, 234563, 308291, 234568, 234570, 316491, 300108, 234572, 234574, 300115, 234580, 234581, 242777, 234585, 275545, 234590, 234593, 234595, 300133, 234597, 234601, 300139, 234605, 160879, 234607, 275569, 234610, 300148, 234614, 398455, 144506, 234618, 275579, 234620, 234623, 226433, 234627, 275588, 234629, 242822, 234634, 275594, 234636, 177293, 234640, 275602, 234643, 226453, 275606, 234647, 275608, 308373, 234650, 234648, 308379, 283805, 234653, 324766, 119967, 234657, 300189, 324768, 242852, 283813, 234661, 300197, 234664, 275626, 234667, 316596, 308414, 234687, 316610, 300226, 226500, 234692, 300229, 308420, 283844, 308418, 283850, 300234, 300238, 300241, 316625, 300243, 300245, 316630, 300248, 300253, 300256, 300258, 300260, 234726, 300263, 300265, 161003, 300267, 300270, 300272, 120053, 300278, 316663, 275703, 300284, 275710, 300287, 283904, 300289, 292097, 300292, 300294, 275719, 300299, 177419, 283917, 300301, 242957, 177424, 275725, 349464, 283939, 259367, 283951, 292143, 300344, 226617, 243003, 283963, 226628, 283973, 300357, 177482, 283983, 316758, 357722, 316766, 292192, 316768, 218464, 292197, 316774, 243046, 218473, 284010, 136562, 324978, 275834, 333178, 275836, 275840, 316803, 316806, 226696, 316811, 226699, 316814, 226703, 300433, 234899, 226709, 357783, 316824, 316826, 144796, 300448, 144807, 144810, 144812, 284076, 144814, 144820, 284084, 284087, 292279, 144826, 144828, 144830, 144832, 284099, 144835, 144837, 38342, 144839, 144841, 144844, 144847, 144852, 144855, 103899, 300507, 333280, 226787, 218597, 292329, 300523, 259565, 259567, 300527, 308720, 226802, 316917, 308727, 292343, 300537, 316947, 308757, 308762, 284191, 284194, 284196, 235045, 284199, 284204, 284206, 284209, 284211, 284213, 194101, 284215, 194103, 284218, 226877, 284223, 284226, 243268, 292421, 226886, 284231, 128584, 284228, 284234, 366155, 276043, 317004, 284238, 226895, 284241, 194130, 284243, 276052, 284245, 276053, 284247, 317015, 284249, 243290, 284251, 300628, 284253, 235097, 284255, 300638, 243293, 284258, 292452, 292454, 284263, 177766, 284265, 292458, 284267, 292461, 284272, 284274, 276086, 284278, 292470, 292473, 284283, 276093, 284286, 276095, 284288, 292481, 284290, 325250, 284292, 276098, 292479, 292485, 284297, 317066, 284299, 317068, 276109, 284301, 284303, 276114, 284306, 284308, 284312, 284314, 284316, 276127, 284320, 284322, 284327, 276137, 284329, 284331, 317098, 284333, 284335, 276144, 284337, 284339, 300726, 284343, 284346, 284350, 276160, 358080, 284354, 358083, 276166, 284358, 358089, 276170, 284362, 276175, 284368, 276177, 284370, 317138, 284372, 358098, 284377, 276187, 284379, 284381, 284384, 284386, 358114, 358116, 276197, 317158, 358119, 284392, 325353, 284394, 358122, 284397, 276206, 284399, 358126, 358128, 358133, 358135, 276216, 358138, 300795, 358140, 284413, 358142, 284418, 358146, 317187, 317189, 317191, 284428, 300816, 300819, 317207, 284440, 186139, 300828, 300830, 276255, 325408, 284449, 300834, 300832, 317221, 227109, 358183, 186151, 276268, 300845, 194351, 243504, 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, 276466, 227314, 276472, 325624, 317435, 276476, 276479, 276482, 276485, 317446, 276490, 292876, 276496, 317456, 317458, 243733, 243740, 317468, 317472, 325666, 243751, 292904, 276528, 243762, 309298, 325685, 325689, 235579, 276539, 235581, 325692, 178238, 276544, 284739, 292934, 243785, 276553, 350293, 350295, 194649, 227418, 309337, 194654, 227423, 350302, 178273, 227426, 194657, 194660, 276579, 227430, 276583, 309346, 309348, 309350, 309352, 309354, 350308, 276590, 350313, 227440, 350316, 284786, 350321, 276595, 301167, 350325, 350328, 292985, 301178, 292989, 292993, 301185, 350339, 317570, 317573, 350342, 227463, 350345, 350349, 301199, 317584, 325777, 350354, 350357, 350359, 350362, 276638, 350366, 284837, 153765, 350375, 350379, 350381, 350383, 129200, 350385, 350387, 350389, 350395, 350397, 350399, 227520, 350402, 227522, 301252, 350406, 227529, 309450, 301258, 276685, 276689, 309462, 301272, 276699, 309468, 194780, 309471, 301283, 317672, 276713, 317674, 325867, 243948, 194801, 227571, 309491, 276725, 309494, 243960, 227583, 276735, 227587, 276739, 211204, 276742, 227593, 227596, 325910, 309530, 342298, 276766, 211232, 317729, 276775, 211241, 325937, 276789, 325943, 211260, 260421, 276809, 285002, 276811, 235853, 276816, 235858, 276829, 276833, 391523, 276836, 276843, 293227, 276848, 293232, 186744, 285051, 211324, 227709, 285061, 317833, 178572, 285070, 178575, 285077, 178583, 227738, 317853, 276896, 317858, 342434, 285093, 317864, 285098, 276907, 235955, 276917, 293304, 293307, 293314, 309707, 293325, 317910, 293336, 235996, 317917, 293343, 358880, 276961, 227810, 293346, 276964, 293352, 236013, 293364, 301562, 317951, 309764, 301575, 121352, 236043, 317963, 342541, 55822, 113167, 317971, 309779, 309781, 277011, 55837, 227877, 227879, 293417, 227882, 309804, 293421, 105007, 236082, 285236, 23094, 277054, 244288, 129603, 318020, 301636, 301639, 301643, 277071, 285265, 399955, 309844, 277080, 309849, 285277, 285282, 326244, 318055, 277100, 121458, 277106, 170618, 170619, 309885, 309888, 277122, 227975, 285320, 277128, 301706, 318092, 326285, 318094, 334476, 277136, 277139, 227992, 285340, 318108, 227998, 318110, 137889, 383658, 285357, 318128, 277170, 342707, 154292, 277173, 293555, 318132, 285368, 277177, 277181, 318144, 277187, 277191, 277194, 277196, 277201, 137946, 113378, 203491, 228069, 277223, 342760, 285417, 56041, 56043, 277232, 228081, 56059, 310015, 285441, 310020, 285448, 310029, 285453, 228113, 285459, 277273, 293659, 326430, 228128, 293666, 285474, 228135, 318248, 277291, 293677, 318253, 285489, 293685, 285494, 301880, 285499, 301884, 310080, 293696, 277314, 277317, 277322, 277329, 162643, 310100, 301911, 301913, 277337, 301921, 400236, 236397, 162671, 326514, 310134, 277368, 15224, 236408, 416639, 416640, 113538, 310147, 416648, 39817, 187274, 277385, 301972, 424853, 277405, 277411, 310179, 293798, 293802, 236460, 277426, 293811, 293817, 293820, 203715, 326603, 276586, 293849, 293861, 228327, 228328, 228330, 318442, 228332, 277486, 326638, 318450, 293876, 293877, 285686, 302073, 285690, 244731, 121850, 302075, 293882, 293887, 277504, 277507, 277511, 277519, 293908, 277526, 293917, 293939, 318516, 277561, 277564, 310336, 7232, 293956, 277573, 228422, 310344, 277577, 293960, 277583, 203857, 310355, 293971, 310359, 236632, 277594, 138332, 277598, 285792, 277601, 203872, 310374, 203879, 277608, 310376, 228460, 318573, 203886, 187509, 285815, 285817, 367737, 285821, 302205, 285824, 392326, 285831, 253064, 302218, 285835, 294026, 384148, 162964, 187542, 302231, 285849, 302233, 285852, 302237, 285854, 285856, 285862, 277671, 302248, 64682, 277678, 228526, 294063, 294065, 302258, 277687, 294072, 318651, 294076, 277695, 318657, 244930, 302275, 130244, 302277, 228550, 302282, 310476, 302285, 302288, 310481, 302290, 203987, 302292, 302294, 302296, 384222, 310498, 285927, 318698, 302315, 195822, 228592, 294132, 138485, 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, 286169, 228825, 163290, 277978, 310749, 277981, 277984, 310755, 277989, 277991, 187880, 277995, 310764, 286188, 278000, 278003, 310772, 228851, 278006, 40440, 278009, 212472, 40443, 286203, 40448, 228864, 286214, 228871, 302603, 65038, 302614, 286233, 302617, 302621, 286240, 146977, 187939, 294435, 40484, 286246, 294439, 286248, 278057, 294440, 294443, 40486, 294445, 40488, 310831, 40491, 40499, 40502, 212538, 40507, 40511, 40513, 228933, 40521, 286283, 40525, 40527, 212560, 228944, 400976, 40533, 147032, 40537, 40539, 278109, 40541, 40544, 40548, 40550, 286312, 286313, 40554, 40552, 310892, 40557, 40560, 188022, 122488, 294521, 343679, 278150, 310925, 286354, 278163, 302740, 122517, 278168, 327333, 229030, 212648, 278188, 302764, 278192, 319153, 278196, 302781, 319171, 302789, 294599, 278216, 294601, 302793, 343757, 212690, 278227, 286420, 319187, 229076, 286425, 319194, 278235, 301163, 229086, 278238, 286432, 294625, 294634, 302838, 319226, 286460, 171774, 278274, 302852, 278277, 302854, 294664, 311048, 352008, 319243, 311053, 302862, 319251, 294682, 278306, 188199, 294701, 278320, 319280, 319290, 229192, 302925, 188247, 237409, 294776, 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 ]
7531429c9f9f28576957af209d1f8fa34817b226
9a83aa358eb9ee5a2faccc01b0feba765c1674c0
/Sources/MemoryLayoutKit/Array.swift
e5be221b413b70d0e8994862dae8a4579ff60e3c
[ "Apache-2.0" ]
permissive
Octadero/MemoryLayoutKit
75e34b5af3146fc55b4546834324d0d9f93ebb48
06dc9f9ffbbc5844e72d9ddee83f4b78e8c564c0
refs/heads/master
2021-09-20T14:12:27.036837
2018-08-10T14:39:33
2018-08-10T14:39:33
108,969,100
0
1
null
null
null
null
UTF-8
Swift
false
false
2,430
swift
/* Copyright 2017 The Octadero Authors. All Rights Reserved. Created by Volodymyr Pavliukevych on 2017. Licensed under the Apache License 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 https://github.com/Octadero/MemoryLayoutKit/blob/master/LICENSE 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 public class CharStarConstStar: CustomStringConvertible { public enum CharStarConstStarError: Error { case canNotComputeCStringPointer } public let pointerList: UnsafeMutablePointer<UnsafePointer<Int8>?> public let count: Int public let encoding: String.Encoding public var sizes = [Int]() public init(array: [String], using encoding: String.Encoding) throws { count = array.count pointerList = UnsafeMutablePointer<UnsafePointer<Int8>?>.allocate(capacity: array.count) self.encoding = encoding for (i, value) in array.enumerated(){ guard let cString = value.cString(using: encoding) else { throw CharStarConstStarError.canNotComputeCStringPointer } pointerList[i] = UnsafePointer<Int8>(strdup(cString)) sizes.append(cString.count) } } public var description: String { var description = "" for index in 0..<count { if let pointer = pointerList[index] { description += "[" + String(cString: pointer) + "]" } } return description } deinit { for index in 0..<self.count { let pointer = UnsafeMutablePointer(mutating: self.pointerList[index]) pointer?.deallocate() } self.pointerList.deallocate() } } extension Array where Element == String { /// Return C style array char* const* you can use it for const char* const* API. /// Do not forget to free memory at defer statement. public func cArray(using encoding: String.Encoding = .utf8) throws -> CharStarConstStar { return try CharStarConstStar(array: self, using: encoding) } }
[ -1 ]
303360a21f1fea36936ce8e1a87eaae77bee2cb2
4fe476a086eea250a912c1ecb9ad5ebd25e31497
/EverythingIsPeachy/EverythingIsPeachy/SupportingFiles/AppDelegate.swift
638f054e3e7af91bce3a93fb91e278d2d086a5dd
[]
no_license
tanyaburke/Pursuit-Core-iOS-Comprehensive-Technical-Assessment
06190813b71c66caf12e9f6302db1de8aeaa1436
9e9cb1a80dbc47c0c16e9bc91334ce9150fb47aa
refs/heads/master
2022-06-16T08:05:27.377376
2020-05-05T21:34:26
2020-05-05T21:34:26
247,143,718
0
0
null
2020-05-05T21:34:28
2020-03-13T19:06:28
Swift
UTF-8
Swift
false
false
1,474
swift
// // AppDelegate.swift // EverythingIsPeachy // // Created by Tanya Burke on 3/16/20. // Copyright © 2020 Tanya Burke. All rights reserved. // import UIKit import Firebase @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. FirebaseApp.configure() return true } // MARK: UISceneSession Lifecycle func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { // Called when a new scene session is being created. // Use this method to select a configuration to create the new scene with. return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) } func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) { // Called when the user discards a scene session. // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. // Use this method to release any resources that were specific to the discarded scenes, as they will not return. } }
[ 393222, 393224, 393230, 393250, 344102, 393261, 393266, 163891, 213048, 385081, 376889, 393275, 376905, 327756, 254030, 286800, 368727, 180313, 368735, 180320, 376931, 286831, 368752, 286844, 417924, 262283, 286879, 286888, 377012, 327871, 180416, 377036, 180431, 377046, 377060, 327914, 205036, 393456, 393460, 336123, 418043, 336128, 385280, 262404, 180490, 368911, 262416, 262422, 377117, 262436, 336180, 262454, 393538, 262472, 344403, 213332, 65880, 262496, 418144, 262499, 213352, 246123, 262507, 262510, 213372, 385419, 393612, 262550, 262552, 385440, 385443, 385451, 262573, 393647, 385458, 262586, 344511, 262592, 360916, 369118, 328177, 328179, 328182, 328189, 328192, 164361, 328206, 410128, 393747, 254490, 188958, 385570, 33316, 197159, 377383, 352821, 188987, 418363, 369223, 385609, 385616, 352856, 352864, 369253, 262760, 352874, 352887, 254587, 377472, 336512, 148105, 377484, 352918, 98968, 344744, 361129, 385713, 434867, 164534, 336567, 328378, 328386, 352968, 418507, 352971, 352973, 385742, 385748, 361179, 189153, 369381, 361195, 418553, 344831, 336643, 344835, 344841, 361230, 336659, 418580, 418585, 434970, 369435, 418589, 262942, 418593, 336675, 328484, 418598, 418605, 336696, 361273, 328515, 336708, 328519, 336711, 328522, 336714, 426841, 197468, 254812, 361309, 361315, 361322, 328573, 377729, 369542, 222128, 345035, 345043, 386003, 386011, 386018, 386022, 435187, 328702, 328714, 361489, 386069, 336921, 386073, 336925, 345118, 377887, 345133, 345138, 386101, 361536, 197707, 189520, 345169, 156761, 361567, 148578, 345199, 386167, 361593, 410745, 361598, 214149, 345222, 386186, 337047, 345246, 214175, 337071, 337075, 345267, 386258, 328924, 386285, 328941, 386291, 345376, 345379, 410917, 337205, 345399, 378169, 369978, 337222, 337229, 337234, 263508, 402791, 345448, 271730, 378227, 271745, 181638, 353673, 181643, 181649, 181654, 230809, 181670, 181673, 181678, 337329, 181681, 181684, 181690, 361917, 181696, 337349, 181703, 337365, 271839, 329191, 361960, 329194, 116210, 337398, 337415, 329226, 419339, 419343, 419349, 345625, 419355, 370205, 419359, 419362, 394786, 370213, 419368, 419376, 206395, 214593, 419400, 419402, 353867, 419406, 419410, 345701, 394853, 222830, 370297, 353919, 403075, 345736, 198280, 403091, 345749, 345757, 345762, 419491, 345765, 419497, 419501, 370350, 419506, 419509, 337592, 419512, 337599, 419527, 419530, 419535, 272081, 394966, 419542, 419544, 181977, 345818, 419547, 419550, 419559, 337642, 419563, 337645, 370415, 141051, 337659, 337668, 362247, 395021, 362255, 321299, 116509, 345887, 378663, 345905, 354106, 354111, 247617, 354117, 370503, 329544, 370509, 354130, 247637, 337750, 370519, 313180, 354142, 345970, 345974, 403320, 354172, 247691, 337808, 247700, 329623, 436126, 436132, 337833, 362413, 337844, 346057, 247759, 346063, 329697, 354277, 190439, 247789, 354313, 346139, 436289, 378954, 395339, 338004, 100453, 329832, 329855, 329867, 329885, 346272, 362660, 100524, 387249, 379066, 387260, 256191, 395466, 346316, 411861, 411864, 411868, 411873, 379107, 411876, 387301, 346343, 338152, 387306, 387312, 346355, 436473, 321786, 379134, 411903, 411916, 379152, 395538, 387349, 338199, 387352, 182558, 338211, 248111, 362822, 436555, 190796, 321879, 379233, 354673, 321910, 248186, 420236, 379278, 272786, 354727, 338352, 330189, 338381, 338386, 256472, 338403, 338409, 248308, 199164, 330252, 199186, 330267, 354855, 10828, 199249, 346721, 174695, 248425, 191084, 338543, 191092, 346742, 330383, 354974, 150183, 174774, 248504, 174777, 223934, 355024, 273108, 264918, 183005, 256734, 338660, 338664, 264941, 363251, 207619, 338700, 256786, 199452, 363293, 396066, 346916, 396069, 215853, 355122, 355131, 355140, 355143, 338763, 355150, 330580, 355166, 265055, 265058, 355175, 387944, 355179, 330610, 330642, 412599, 207808, 379848, 396245, 330710, 248792, 248798, 347105, 257008, 183282, 330748, 330760, 330768, 248862, 396328, 158761, 396336, 199728, 330800, 396339, 339001, 388154, 388161, 347205, 248904, 330826, 248914, 339036, 412764, 257120, 265320, 248951, 420984, 330889, 248985, 339097, 44197, 380070, 339112, 249014, 330958, 330965, 265436, 388319, 388347, 175375, 159005, 175396, 208166, 273708, 372015, 372018, 199988, 44342, 175415, 396600, 437566, 175423, 437570, 437575, 437583, 331088, 437587, 331093, 396633, 175450, 437595, 175457, 208227, 175460, 175463, 437620, 175477, 249208, 175483, 175486, 249214, 175489, 249218, 249224, 249227, 249234, 175513, 175516, 396705, 175522, 355748, 380332, 396722, 208311, 372163, 216517, 380360, 216522, 339404, 372176, 208337, 339412, 413141, 339417, 249308, 339420, 249312, 339424, 339428, 339434, 69113, 372228, 339461, 208398, 380432, 175635, 339503, 265778, 265795, 396872, 265805, 224853, 224857, 257633, 224870, 372327, 257646, 372337, 224884, 224887, 224890, 224894, 224897, 372353, 216707, 339588, 126596, 421508, 224904, 159374, 11918, 339601, 224913, 126610, 224916, 224919, 126616, 208538, 224922, 224926, 224929, 224932, 224936, 257704, 224942, 257712, 257716, 257720, 257724, 224959, 257732, 224965, 224969, 339662, 224975, 257747, 224993, 257761, 257764, 224999, 339695, 225012, 225020, 339710, 257790, 225025, 257794, 339721, 257801, 257804, 225038, 257807, 372499, 167700, 225043, 257819, 225053, 184094, 225058, 257833, 225066, 257836, 413484, 225070, 225073, 372532, 257845, 397112, 225082, 397115, 225087, 225092, 225096, 323402, 257868, 257871, 225103, 397139, 225108, 225112, 257883, 257886, 225119, 339814, 225127, 257896, 274280, 257901, 225137, 257908, 225141, 257912, 257916, 225148, 257920, 225155, 339844, 225165, 397200, 225170, 380822, 225175, 225180, 118691, 184244, 372664, 372702, 372706, 356335, 380918, 405533, 430129, 266294, 266297, 217157, 421960, 356439, 430180, 421990, 266350, 266362, 381068, 225423, 250002, 250004, 225429, 356506, 225437, 135327, 225441, 438433, 225444, 438436, 225447, 438440, 225450, 258222, 225455, 430256, 225458, 225461, 225466, 389307, 225470, 381120, 372929, 430274, 225475, 389320, 225484, 225487, 225490, 266453, 225493, 225496, 225499, 225502, 225505, 356578, 225510, 217318, 225514, 225518, 372976, 381176, 397571, 389380, 61722, 356637, 356640, 356643, 356646, 266536, 356649, 356655, 332080, 340275, 356660, 397622, 332090, 225597, 332097, 201028, 348488, 332106, 250199, 250202, 332125, 250210, 348522, 348525, 348527, 332152, 250238, 389502, 356740, 332172, 373145, 340379, 389550, 324030, 266687, 340451, 160234, 127471, 340472, 324094, 266754, 324099, 324102, 324111, 340500, 324117, 324131, 332324, 381481, 324139, 356907, 324142, 356916, 324149, 324155, 348733, 324160, 324164, 356934, 348743, 381512, 324170, 324173, 324176, 389723, 332380, 373343, 381545, 340627, 184982, 373398, 258721, 332453, 332459, 389805, 332463, 381617, 332471, 332483, 332486, 373449, 332493, 357069, 357073, 332511, 332520, 340718, 332533, 348924, 373510, 389926, 152370, 340789, 348982, 398139, 127814, 357201, 357206, 389978, 357211, 430939, 357214, 201579, 201582, 349040, 340849, 201588, 430965, 324472, 398201, 119674, 324475, 340858, 340861, 324478, 324481, 373634, 398211, 324484, 324487, 381833, 324492, 324495, 430995, 324501, 324510, 422816, 324513, 398245, 201637, 324524, 340909, 324533, 5046, 324538, 324541, 398279, 340939, 340941, 209873, 340957, 431072, 398306, 340963, 209895, 201711, 349172, 349180, 439294, 431106, 209943, 209946, 250914, 357410, 209965, 209968, 209971, 209975, 209979, 209987, 209990, 341071, 349267, 250967, 210010, 341091, 210025, 210027, 210030, 210039, 341113, 210044, 349308, 152703, 160895, 349311, 210052, 210055, 349319, 210067, 210071, 210077, 210080, 210084, 251044, 185511, 210088, 210095, 210098, 210107, 210115, 332997, 210127, 333009, 210131, 333014, 210138, 210143, 218354, 251128, 218360, 275706, 275712, 275715, 275721, 333078, 251160, 349484, 349491, 251189, 415033, 251210, 357708, 365911, 259421, 365921, 333154, 251235, 374117, 333162, 234866, 390516, 333175, 136590, 112020, 349590, 357792, 259515, 415166, 415185, 366034, 366038, 415191, 415193, 415196, 415199, 423392, 333284, 415207, 366056, 415216, 210420, 415224, 423423, 415257, 415263, 366117, 415270, 144939, 415278, 415281, 415285, 210487, 415290, 415293, 349761, 415300, 333386, 333399, 366172, 333413, 423528, 423532, 210544, 415353, 333439, 415361, 153227, 333498, 333511, 210631, 259788, 333518, 358099, 333534, 366307, 366311, 431851, 366318, 210672, 366321, 366325, 210695, 268041, 210698, 366348, 210706, 399128, 333594, 210719, 358191, 210739, 366387, 399159, 358200, 325440, 366401, 341829, 325446, 46920, 341834, 341838, 341843, 415573, 358234, 341851, 350045, 399199, 259938, 399206, 358255, 399215, 268143, 358259, 341876, 333689, 243579, 325504, 333698, 333708, 333724, 382890, 350146, 358339, 333774, 358371, 350189, 350193, 350202, 350206, 350213, 268298, 350224, 350231, 333850, 350237, 350240, 350244, 350248, 178218, 350251, 350256, 350259, 350271, 243781, 350285, 374864, 342111, 342133, 374902, 432271, 333997, 260289, 350410, 260298, 350416, 350422, 211160, 350425, 268507, 334045, 350445, 375026, 358644, 350458, 350461, 350464, 325891, 350467, 350475, 268559, 350480, 432405, 350486, 350490, 325914, 325917, 350493, 350498, 350504, 358700, 350509, 391468, 358704, 358713, 358716, 383306, 334161, 383321, 383330, 383333, 391530, 383341, 334203, 268668, 194941, 391563, 366990, 416157, 268701, 375208, 375216, 334262, 334275, 326084, 358856, 334304, 334311, 375277, 334321, 350723, 186897, 342545, 334358, 342550, 342554, 334363, 358941, 350761, 252461, 334384, 383536, 358961, 334394, 252482, 219718, 334407, 350822, 375400, 334465, 162445, 326290, 342679, 342683, 260766, 342710, 244409, 260797, 334528, 260801, 350917, 391894, 154328, 416473, 64230, 342766, 375535, 203506, 342776, 391937, 391948, 326416, 375568, 375571, 375574, 162591, 326441, 326451, 326454, 244540, 326460, 375612, 326467, 244551, 326473, 326477, 326485, 416597, 326490, 326502, 375656, 326507, 326510, 211825, 211831, 351097, 392060, 359295, 351104, 342915, 236430, 342930, 252822, 392091, 400285, 252836, 359334, 211884, 400306, 351168, 359361, 359366, 359382, 359388, 383967, 343015, 359407, 261108, 244726, 261111, 383997, 261129, 359451, 261147, 211998, 261153, 261159, 359470, 359476, 343131, 384098, 384101, 367723, 384107, 187502, 384114, 343154, 212094, 351364, 384135, 384139, 384143, 351381, 384151, 384160, 384168, 367794, 244916, 384181, 384188, 351423, 384191, 384198, 326855, 244937, 384201, 253130, 343244, 384208, 146642, 384224, 359649, 343270, 351466, 384246, 351479, 384249, 343306, 261389, 359694, 253200, 261393, 384275, 384283, 245020, 384288, 245029, 171302, 351534, 376110, 245040, 384314, 425276, 384323, 212291, 343365, 212303, 367965, 343393, 343398, 367980, 425328, 343409, 154999, 253303, 343417, 327034, 245127, 384397, 245136, 245142, 245145, 343450, 245148, 245151, 245154, 245157, 245162, 327084, 359865, 384443, 146876, 327107, 384453, 327110, 327115, 327117, 359886, 359890, 343507, 368092, 343534, 343539, 368119, 343544, 368122, 359955, 359983, 343630, 327275, 245357, 138864, 155254, 155273, 368288, 245409, 425638, 155322, 425662, 155327, 245460, 155351, 155354, 212699, 245475, 155363, 245483, 155371, 409335, 155393, 155403, 245525, 155422, 360223, 155438, 155442, 155447, 155461, 360261, 376663, 155482, 261981, 425822, 155487, 376671, 155490, 155491, 327531, 261996, 376685, 261999, 262002, 327539, 262005, 147317, 425845, 262008, 262011, 155516, 155521, 155525, 360326, 155531, 262027, 262030, 262033, 262036, 262039, 262042, 155549, 262045, 262048, 262051, 327589, 155559, 155562, 155565, 393150, 393169, 384977, 155611, 155619, 253923, 155621, 327654, 253926, 204784, 393203, 360438, 253943, 393206, 393212, 155646 ]
616d84bfbbf337658c18f49d32ba26592bdca5cf
3f2102b9746932613c6d02634fd1fa8e9a8342ab
/Ouro/View/AppConstant.swift
08d4c03ed5eeb6ec8dc3cd6029b37e791cd1d2d2
[]
no_license
zhan1634/Ouro
38384b972656f235c12ff2f7b4b458dd39e642b2
12e5a40cb6d59c99f59b1d6b5a3f57d91c3b47c0
refs/heads/master
2020-05-17T21:04:03.842843
2020-02-25T05:34:51
2020-02-25T05:34:51
183,960,570
1
0
null
2019-08-25T03:30:36
2019-04-28T21:25:41
Swift
UTF-8
Swift
false
false
199
swift
// // AppConstant.swift // Ouro // // Created by PC on 23/10/19. // Copyright © 2019 PC. All rights reserved. // import Foundation struct Image { public static let menuimg = "Menu Icon" }
[ -1 ]
c45dc0266c6c98868274fd8b1c798687aab97817
a10f4ec9d29ace9e482ce21bdf896d219b64705a
/CivilRightsMedia/CivilRightsMedia/AppDelegate.swift
0b3c4fb0b5aca99afa6a1762e64858a872ddae23
[ "MIT" ]
permissive
GregKeeley/Civil-Rights-Media
b02dac963fccc6fd89c71f4d18b03ac4aa78d07a
f120033560db5dfca484baf44842a4bb5e9c7d44
refs/heads/main
2023-02-28T18:06:51.213887
2021-01-18T14:54:45
2021-01-18T14:54:45
null
0
0
null
null
null
null
UTF-8
Swift
false
false
1,348
swift
// // AppDelegate.swift // CivilRightsMedia // // Created by Alex Paul on 1/17/21. // import UIKit import Firebase @main class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. FirebaseApp.configure() return true } // MARK: UISceneSession Lifecycle func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { // Called when a new scene session is being created. // Use this method to select a configuration to create the new scene with. return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) } func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) { // Called when the user discards a scene session. // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. // Use this method to release any resources that were specific to the discarded scenes, as they will not return. } }
[ 393222, 393224, 393230, 393250, 344102, 393261, 393266, 213048, 385081, 376889, 393275, 376905, 327756, 254030, 286800, 368727, 180313, 368735, 180320, 376931, 286831, 368752, 286844, 417924, 262283, 286879, 286888, 377012, 327871, 180416, 377036, 180431, 377046, 418007, 418010, 377060, 327914, 205036, 393456, 393460, 418043, 336123, 336128, 385280, 262404, 180490, 368911, 262416, 262422, 377117, 262436, 336180, 262454, 393538, 262472, 344403, 213332, 65880, 262496, 418144, 262499, 213352, 246123, 262507, 262510, 213372, 385419, 393612, 262550, 262552, 385440, 385443, 262566, 385451, 262573, 393647, 385458, 262586, 344511, 262592, 360916, 369118, 328177, 328179, 328182, 328189, 328192, 164361, 410128, 393747, 254490, 188958, 385570, 33316, 197159, 377383, 352821, 418363, 188987, 369223, 385609, 385616, 352864, 369253, 262760, 352874, 352887, 254587, 377472, 148105, 377484, 352918, 98968, 344744, 361129, 336555, 385713, 434867, 164534, 336567, 328378, 164538, 328386, 344776, 352968, 418507, 352971, 352973, 385742, 385748, 361179, 189153, 369381, 361195, 418553, 344831, 336643, 344835, 344841, 361230, 336659, 418580, 418585, 434970, 369435, 418589, 262942, 418593, 336675, 328484, 418598, 418605, 336696, 361273, 328515, 328519, 336711, 328522, 336714, 426841, 197468, 254812, 361309, 361315, 361322, 328573, 377729, 369542, 222128, 345035, 345043, 386003, 386011, 386018, 386022, 435187, 328714, 361489, 386069, 386073, 336921, 336925, 345118, 377887, 345133, 345138, 386101, 361536, 197707, 189520, 345169, 156761, 361567, 148578, 345199, 386167, 361593, 410745, 361598, 214149, 345222, 386186, 337047, 345246, 214175, 337071, 337075, 345267, 386258, 328924, 66782, 222437, 328941, 386285, 386291, 345376, 353570, 345379, 410917, 345382, 337205, 345399, 378169, 369978, 337222, 337229, 337234, 263508, 402791, 345448, 271730, 378227, 271745, 181638, 353673, 181643, 181654, 230809, 181670, 181673, 181678, 181681, 337329, 181684, 181690, 361917, 181696, 337349, 181703, 271839, 329191, 361960, 116210, 337398, 337415, 329226, 419339, 419343, 419349, 419355, 370205, 419359, 394786, 419362, 370213, 419368, 419376, 206395, 214593, 419400, 419402, 353867, 419406, 419410, 345701, 394853, 222830, 370297, 353919, 403075, 198280, 345736, 403091, 345749, 419483, 345757, 345762, 419491, 345765, 419497, 419501, 370350, 419506, 419509, 419512, 337592, 419517, 337599, 419527, 419530, 419535, 272081, 394966, 419542, 419544, 181977, 345818, 419547, 419550, 419559, 337642, 419563, 337645, 370415, 337659, 141051, 337668, 362247, 395021, 362255, 116509, 345887, 378663, 345905, 354106, 354111, 247617, 354117, 370503, 329544, 370509, 354130, 247637, 337750, 370519, 354142, 354150, 345967, 345970, 345974, 403320, 354172, 247691, 337808, 247700, 329623, 436126, 436132, 337833, 362413, 337844, 346057, 247759, 346063, 329697, 354277, 190439, 247789, 354313, 346139, 436289, 378954, 395339, 338004, 100453, 329832, 329855, 329885, 411805, 346272, 362660, 100524, 387249, 379066, 387260, 256191, 395466, 346316, 411861, 411864, 411868, 411873, 379107, 411876, 387301, 346343, 338152, 387306, 387312, 346355, 436473, 321786, 379134, 411903, 411916, 379152, 395538, 387349, 338199, 387352, 182558, 338211, 395566, 248111, 362822, 436555, 190796, 379233, 354673, 248186, 420236, 379278, 272786, 354727, 338352, 338381, 330189, 338386, 256472, 338403, 338409, 248308, 199164, 330252, 199186, 330267, 354855, 10828, 199249, 346721, 174695, 248425, 191084, 191092, 346742, 330383, 354974, 150183, 174774, 248504, 174777, 223934, 355024, 273108, 355028, 264918, 183005, 256734, 436962, 338660, 338664, 264941, 363251, 207619, 264964, 338700, 256786, 199452, 363293, 396066, 346916, 396069, 215853, 355122, 355131, 355140, 355143, 338763, 355150, 330580, 355166, 265055, 265058, 355175, 387944, 355179, 330610, 330642, 355218, 412599, 207808, 379848, 396245, 330710, 248792, 248798, 347105, 257008, 183282, 265207, 330748, 265214, 330760, 330768, 248862, 347176, 158761, 396328, 199728, 330800, 396336, 396339, 339001, 388154, 388161, 347205, 248904, 330826, 248914, 412764, 339036, 257120, 265320, 248951, 420984, 330889, 347287, 248985, 339097, 44197, 380070, 339112, 249014, 126144, 330958, 330965, 265432, 265436, 388319, 388347, 175375, 159005, 175396, 208166, 273708, 347437, 372015, 347441, 372018, 199988, 44342, 175415, 396600, 437566, 175423, 437570, 437575, 437583, 331088, 437587, 331093, 396633, 175450, 437595, 175457, 208227, 175460, 175463, 265580, 437620, 175477, 249208, 175483, 249214, 175486, 175489, 249218, 249224, 249227, 249234, 175513, 175516, 396705, 175522, 355748, 380332, 396722, 208311, 372163, 216517, 380360, 216522, 339404, 372176, 208337, 339412, 413141, 339417, 249308, 339420, 249312, 339424, 339428, 339434, 249328, 69113, 372228, 208398, 380432, 175635, 265778, 265795, 396872, 265805, 224853, 224857, 257633, 224870, 372327, 257646, 372337, 224884, 224887, 224890, 224894, 372353, 224897, 216707, 421508, 126596, 224904, 224909, 159374, 11918, 224913, 126610, 224916, 224919, 126616, 208538, 224922, 224926, 224929, 224932, 224936, 257704, 224942, 257712, 224947, 257716, 257720, 224953, 257724, 224959, 257732, 224965, 224969, 224975, 257747, 224981, 224986, 224993, 257761, 257764, 224999, 339695, 225012, 257787, 225020, 339710, 257790, 225025, 257794, 257801, 339721, 257804, 225038, 257807, 372499, 167700, 225043, 225048, 257819, 225053, 184094, 225058, 257833, 225066, 257836, 413484, 225070, 225073, 372532, 257845, 225079, 397112, 225082, 397115, 225087, 225092, 225096, 323402, 257868, 257871, 225103, 397139, 225108, 225112, 257883, 257886, 225119, 257890, 339814, 225127, 257896, 274280, 257901, 225137, 339826, 257908, 225141, 257912, 257916, 225148, 257920, 225155, 339844, 225165, 397200, 225170, 380822, 225175, 225180, 118691, 184244, 372664, 372702, 372706, 356335, 380918, 405533, 430129, 266294, 266297, 421960, 356439, 430180, 421990, 266350, 356466, 266362, 381068, 225423, 250002, 250004, 225429, 356506, 225437, 135327, 225441, 438433, 225444, 438436, 225447, 438440, 225450, 258222, 225455, 430256, 225458, 225461, 225466, 389307, 225470, 381120, 372929, 430274, 225475, 389320, 225484, 225487, 225490, 225493, 266453, 225496, 225499, 225502, 225505, 217318, 225510, 225514, 225518, 372976, 381176, 397571, 389380, 61722, 356637, 356640, 356643, 356646, 266536, 356649, 356655, 332080, 340275, 356660, 397622, 332090, 225597, 332097, 201028, 348488, 332106, 332117, 250199, 250202, 332125, 250210, 348522, 348525, 348527, 332152, 389502, 250238, 332161, 356740, 332172, 373145, 340379, 389550, 324030, 266687, 160234, 127471, 340472, 381436, 324094, 266754, 324099, 324102, 324111, 340500, 324117, 324131, 332324, 381481, 324139, 356907, 324142, 356916, 324149, 324155, 348733, 324164, 356934, 348743, 381512, 324170, 324173, 324176, 389723, 332380, 373343, 381545, 340627, 184982, 373398, 258721, 332453, 332459, 389805, 332463, 381617, 332471, 332483, 332486, 373449, 357069, 332493, 357073, 332511, 332520, 340718, 332533, 348924, 373510, 389926, 152370, 348978, 340789, 348982, 398139, 127814, 357201, 357206, 389978, 357211, 430939, 357214, 201579, 201582, 349040, 340849, 430965, 324472, 398201, 119674, 324475, 340858, 340861, 324478, 430972, 324481, 373634, 324484, 324487, 381833, 324492, 324495, 430995, 324501, 324510, 422816, 324513, 398245, 201637, 324524, 340909, 324538, 324541, 398279, 340939, 340941, 209873, 340957, 431072, 398306, 340963, 209895, 201711, 349180, 439294, 431106, 250914, 357410, 185380, 357418, 209979, 341071, 349267, 250967, 210010, 341091, 210025, 210030, 210036, 349308, 160895, 152703, 349311, 210052, 210055, 349319, 210067, 251044, 185511, 210107, 332997, 210127, 333009, 210131, 333014, 210143, 218354, 218360, 251128, 275706, 275712, 275715, 275721, 349459, 333078, 251160, 349484, 349491, 251189, 415033, 251210, 357708, 210260, 259421, 365921, 333154, 251235, 374117, 333162, 234866, 390516, 333175, 357755, 251271, 136590, 374160, 112020, 349590, 357792, 259515, 415166, 415185, 366034, 366038, 415191, 415193, 415196, 415199, 423392, 333284, 415207, 366056, 415216, 210420, 415224, 423423, 415257, 415263, 366117, 415270, 144939, 415278, 415281, 415285, 210487, 415290, 415293, 349761, 415300, 333386, 366172, 333413, 423528, 423532, 210544, 415353, 333439, 415361, 267909, 153227, 333498, 210631, 333511, 259788, 358099, 153302, 333534, 366307, 366311, 431851, 366318, 210672, 366321, 366325, 210695, 268041, 210698, 366348, 210706, 399128, 333594, 210719, 358191, 366387, 210739, 358200, 325440, 366401, 341829, 325446, 46920, 341834, 341838, 341843, 415573, 358234, 341851, 350045, 399199, 259938, 399206, 358255, 399215, 268143, 358259, 333689, 243579, 325504, 333698, 333708, 333724, 382890, 350146, 358371, 350189, 350193, 350202, 333818, 350206, 350213, 268298, 350224, 350231, 333850, 350237, 350240, 350244, 350248, 178218, 350251, 350256, 350259, 350271, 243781, 350285, 374864, 342111, 342133, 374902, 432271, 333997, 334011, 260289, 260298, 350410, 350416, 350422, 350425, 334045, 350445, 375026, 358644, 350458, 350461, 350464, 350467, 325891, 350475, 268559, 350480, 432405, 350486, 325914, 350490, 325917, 350493, 325919, 350498, 350504, 358700, 350509, 391468, 358704, 358713, 358716, 383306, 334161, 383321, 383330, 383333, 391530, 383341, 334203, 268668, 194941, 366990, 268701, 416157, 342430, 375208, 326058, 375216, 334262, 326084, 358856, 334304, 334311, 375277, 334321, 350723, 186897, 342545, 334358, 342550, 342554, 334363, 358941, 350761, 252461, 334384, 383536, 358961, 334394, 252482, 219718, 334407, 334420, 350822, 375400, 334465, 334468, 326290, 342679, 342683, 260766, 342710, 244409, 260797, 260801, 350917, 154317, 391894, 154328, 416473, 64230, 113388, 342766, 375535, 203506, 342776, 391937, 391948, 375568, 326416, 375571, 162591, 326441, 383793, 326451, 326454, 375612, 244540, 326460, 260924, 326467, 244551, 326473, 326477, 416597, 326485, 326490, 342874, 326502, 375656, 326507, 326510, 211825, 211831, 351097, 392060, 359295, 342915, 400259, 236430, 342930, 252822, 392091, 400285, 252836, 359334, 211884, 400306, 351168, 359361, 326598, 359366, 359382, 359388, 383967, 343015, 359407, 261108, 244726, 261111, 383997, 261129, 359451, 261147, 211998, 261153, 261159, 359470, 359476, 343131, 384098, 384101, 367723, 384107, 187502, 343154, 384114, 212094, 351364, 384135, 384139, 384143, 351381, 384160, 351397, 384168, 367794, 384181, 351423, 384191, 384198, 326855, 244937, 253130, 343244, 146642, 359649, 343270, 351466, 351479, 384249, 343306, 261389, 384269, 359694, 253200, 261393, 384275, 245020, 245029, 171302, 351534, 376110, 245040, 384314, 425276, 384323, 212291, 343365, 212303, 367965, 343393, 343398, 367980, 425328, 343409, 154999, 253303, 343417, 327034, 245127, 384397, 245136, 245142, 245145, 343450, 245148, 245151, 245154, 245157, 245162, 327084, 359865, 384443, 146876, 327107, 384453, 327110, 327115, 327117, 359886, 359890, 343507, 368092, 343534, 343539, 368119, 343544, 368122, 409091, 359947, 359955, 359983, 327275, 245357, 138864, 155254, 155273, 368288, 245409, 425638, 425649, 155322, 425662, 155327, 253943, 155351, 155354, 155363, 155371, 245483, 409335, 155393, 155403, 155422, 360223, 155438, 155442, 155447, 417595, 360261, 155461, 376663, 155482, 261981, 425822, 155487, 376671, 155490, 155491, 327531, 261996, 376685, 261999, 262002, 327539, 147317, 262005, 425845, 262008, 262011, 155516, 155521, 155525, 360326, 376714, 262027, 155531, 262030, 262033, 262036, 262039, 262042, 155549, 262045, 262048, 262051, 327589, 155559, 155562, 155565, 393150, 384977, 393169, 155611, 253923, 155619, 155621, 253926, 327654, 204784, 393203, 360438, 393206, 393212, 155646 ]
404529b3ae253e8edeb2dd3463564bff1647c3e7
be701bec8042c43349094aa40c023bc062f77267
/DatePicker/Classes/Colors.swift
0e85a94d8f3c7f41897f51ecd7550bca301afd2f
[ "MIT" ]
permissive
tranngoclinh88/DatePicker
8684748a6929d1df8ca240d3f33db5842fd07497
502e0eeeef95cf33db95b6c4367cb6db1c027924
refs/heads/master
2020-03-26T23:51:16.890919
2018-08-16T02:13:22
2018-08-16T02:13:22
null
0
0
null
null
null
null
UTF-8
Swift
false
false
339
swift
// // Colors.swift // FreshDate // // Created by Amir Shayegh on 2018-08-06. // import Foundation import UIKit class Colors { static var background = UIColor(hex: "#FAFAFA") static var main = UIColor(hex: "#234075") static var inactiveText = UIColor(hex: "#CDCED2") static var selectedText = UIColor(hex: "#fefefe") }
[ -1 ]
7c9d4613ba026769b5ca4fe4c31f03dc737e307b
2ea29f6f02d3fa9871e9fee14d11c79cdd800300
/GEAR UP VR/Survey/SurveyViewController.swift
061ee0add739c3a2d65b3ea87fe6d2f501b84b1e
[]
no_license
uncetlab/GEAR-UP-IOS-Code
4555db9aa5b0fc9ef97be9ed530fa5b7600863c5
278b3608fb80b6660e7e8151b17da0299501eb8c
refs/heads/main
2023-04-11T10:31:28.576132
2021-04-23T17:51:50
2021-04-23T17:51:50
339,452,488
0
1
null
null
null
null
UTF-8
Swift
false
false
349
swift
// // SurveyViewController.swift // GEAR UP VR // // Created by Harikrishnan on 24/10/2019. // Copyright © 2019 Shineeth Hamza. All rights reserved. // import UIKit class SurveyViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. } }
[ 323334, 249229, 189326, 319888, 342547, 316949, 314774, 291223, 314780, 342300, 316317, 135840, 135842, 172578, 340649, 172586, 242346, 337068, 336557, 241071, 243505, 172722, 314048, 339520, 313029, 319815, 326600, 182474, 146645, 250212, 315492, 56044, 215408, 319990, 327033, 314748, 334205 ]
3154d0dd4088a40fadce2fdf8aeeeb08a2ae83ff
9b3133c6d61e60b977ca81233f92a1d823bb4347
/util/utilTests/DateTest.swift
952cb1211ed9cf6596e5acd7fc6a8105d1e80f4f
[]
no_license
DivakarSwift/swift
3a1418699f7a467540658602170b64c78778c34f
8b689c15f895e77ca01b74264adbeec7b3e41ad0
refs/heads/master
2020-03-30T02:43:17.715065
2018-03-02T17:12:49
2018-03-02T17:12:49
null
0
0
null
null
null
null
UTF-8
Swift
false
false
1,145
swift
// // DateTest.swift // LinUtil // // Created by lin on 1/12/15. // Copyright (c) 2015 lin. All rights reserved. // //import Cocoa import XCTest class DateTest: XCTestCase { override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. super.tearDown() } func testExample() { // This is an example of a functional test case. XCTAssert(true, "Pass") let dateFormatter = DateFormatter() // dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss" // superset of OP's format let str = dateFormatter.string(from: Date()) print("date:\(str)"); print("date:\(Date())"); } func testPerformanceExample() { // This is an example of a performance test case. self.measure() { // Put the code you want to measure the time of here. } } }
[ -1 ]
9b47f6e11d9b7e36d5a5c740abfa517f06a7775e
bb7d71d990ac6df9544559a25cb37729249c20ad
/Clima/Clima/Model/WeatherManager.swift
45e964c85cd03d317b9133a30bdf9e6ff03053b9
[]
no_license
anmolkalra17/SwiftProjects
47f0f7b596dfd06e5fda4e05d8027677fc49ea70
8f106c54e70a0dcb84636b346d3089df400fbcc7
refs/heads/master
2023-04-09T14:26:01.480750
2021-04-19T19:24:02
2021-04-19T19:24:02
282,982,066
0
0
null
null
null
null
UTF-8
Swift
false
false
2,193
swift
// // WeatherManager.swift // Clima // // Created by Anmol Kalra on 12/12/20. // Copyright © 2020 Anmol Kalra. All rights reserved. // import Foundation protocol WeatherManagerDelegate { func didUpdateWeather(_ weatherManager: WeatherManager ,weather: WeatherModel) func didFailWithError(error: Error) } struct WeatherManager { let weatherURL = "https://api.openweathermap.org/data/2.5/weather?appid=f93f3b985ef7a622593bc40daed7b9b5&units=metric" var delegate: WeatherManagerDelegate? func fetchWeather(cityName: String) { let urlString = "\(weatherURL)&q=\(cityName)" performRequest(with: urlString) } func fetchWeather(latitude: Double, longitude: Double) { let urlString = "\(weatherURL)&lat=\(latitude)&lon=\(longitude)" performRequest(with: urlString) } func performRequest(with urlString: String) { if let url = URL(string: urlString) { let session = URLSession(configuration: .default) let task = session.dataTask(with: url) { (data, response, error) in if error != nil { self.delegate?.didFailWithError(error: error!) return } if let safeData = data { if let weather = self.parseJSON(safeData) { self.delegate?.didUpdateWeather(self, weather: weather) } } } task.resume() } } func parseJSON(_ data: Data) -> WeatherModel? { let decoder = JSONDecoder() do{ let decodedData = try decoder.decode(WeatherData.self, from: data) let id = decodedData.weather[0].id let temp = decodedData.main.temp let name = decodedData.name let des = decodedData.weather[0].description let weather = WeatherModel(conditionId: id, cityName: name, temperature: temp, description: des) return weather } catch { delegate?.didFailWithError(error: error) return nil } } }
[ 200739, 200743 ]
f2c63838c8dc353b1e77267be54dbae686bca6a7
217c2bf9dabef35b28222143de842f036d79d47f
/VAP-JOBS/VAP-JOBS/Network/Session.swift
0fba4e323458ec4cd7c4035ee35d47a24aed98a3
[]
no_license
hoffsilva/vap_tech_project
a360104385398f89d082dc998d8aa7bce748f10b
7d0ea951fa997c01fb402256ab45a6df6a11f410
refs/heads/master
2021-05-11T06:01:04.417541
2018-01-23T00:47:48
2018-01-23T00:47:48
117,972,259
0
0
null
null
null
null
UTF-8
Swift
false
false
1,204
swift
// // Session.swift // // // Created by Hoff Henry Pereira da Silva on 01/08/17. // Copyright © 2017 Hoff Henry Pereira da Silva. All rights reserved. // import Foundation import Alamofire class Session { // MARK: - Properties - static let shared = Session() private var manager: SessionManager? // MARK: - Methods - func apiManager() -> SessionManager { if let manager = manager { return manager } else { let configuration = URLSessionConfiguration.default configuration.httpAdditionalHeaders = Alamofire.SessionManager.defaultHTTPHeaders configuration.timeoutIntervalForRequest = 30 configuration.timeoutIntervalForResource = 30 let serverTrustPolicy : [String: ServerTrustPolicy] = [ "\(EnvironmentLinks.shared)" : .disableEvaluation ] self.manager = SessionManager(configuration: configuration, delegate: SessionDelegate(), serverTrustPolicyManager: ServerTrustPolicyManager(policies: serverTrustPolicy)) return self.manager! } } }
[ -1 ]
0a379dbab0e4944f25a8df41cfebec7dbf7c9cba
3edbbcfb8d56da8595500739e463f0aa6ebf2658
/UIKietTest2/LectionUIKitTest/ImageViewController.swift
740a1afef7f076dbff499b9ca008ba4347c38e35
[]
no_license
oracoolsss/TenzorSwift
7bec231392fbc8a94bdcf7fea4b9d0d30f2d97bc
f8de58066f970300ba991cd679a8c77f03abf9c9
refs/heads/master
2020-08-27T05:03:35.989285
2019-12-19T09:58:36
2019-12-19T09:58:36
217,251,694
0
0
null
2019-12-24T10:52:27
2019-10-24T08:38:13
Swift
UTF-8
Swift
false
false
478
swift
// // ImageViewController.swift // LectionUIKitTest // // Created by Гость on 07/11/2019. // Copyright © 2019 Konstantin Polin. All rights reserved. // import UIKit class ImageViewController: UIViewController { @IBOutlet var greetingLabel: UILabel! var name: String = "" var surname: String = "" override func viewDidLoad() { super.viewDidLoad() greetingLabel.text = "Привет, \(name) \(surname)" } }
[ -1 ]
bfa32c206386efa1292dc3900fea02f6c507e7be
1c2f4b331771a0a0dfa825d9bba2470f33111b0e
/Hi.story/Services/NotificationService.swift
e04be383ec35fc81c678be1fd15e4036bd7125d0
[]
no_license
xspyhack/Hi.story
50e7c6588b96e806a21b537020343ea67efc48c2
5134c088a20c4828ba890a56bba3a7ac8ab6ddd7
refs/heads/master
2020-04-11T03:02:46.971215
2017-04-08T03:31:43
2017-04-08T03:31:43
68,179,314
1
1
null
null
null
null
UTF-8
Swift
false
false
2,054
swift
// // NotificationService.swift // Hi.story // // Created by bl4ckra1sond3tre on 01/03/2017. // Copyright © 2017 bl4ckra1sond3tre. All rights reserved. // import Foundation import UserNotifications class NotificationService: NSObject, UNUserNotificationCenterDelegate { static let shared = NotificationService() func trigger(title: String, body: String, fileURL: URL? = nil, userInfo: [String: Any] = [:], requestIdentifier: String, delay: TimeInterval = 2.33, repeats: Bool = false) { let content = UNMutableNotificationContent() content.title = title content.body = body content.userInfo = userInfo content.sound = UNNotificationSound.default() content.attachments = fileURL.flatMap { try? UNNotificationAttachment(identifier: "image", url: $0, options: nil) }.map { [$0] } ?? [] //content.categoryIdentifier = "com.xspyhack.History.localNotification" let trigger = UNTimeIntervalNotificationTrigger(timeInterval: delay, repeats: repeats) let request = UNNotificationRequest(identifier: "com.xspyhack.History." + requestIdentifier, content: content, trigger: trigger) // Schedule the notification. let center = UNUserNotificationCenter.current() center.add(request) } func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) { if let isBirthday = response.notification.request.content.userInfo["isBirthday"] as? Bool { print(isBirthday) // 跳转到 Home ,并且播放烟花或者五色纸片等效果 } completionHandler() } func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) { completionHandler([.sound, .alert]) } }
[ -1 ]
73d8bb19e44cc25dc6a514121f2689921e95dffd
c21d6314f6145d3750f06fe124f990fb97990ffa
/Rainbow/Main/Account/SignInViewController.swift
f405a5741f5e41cc6f7fc67716c1ab57e9163603
[]
no_license
cyrusblaer/Rainbow
735524de0ab084e4e123425352e3a9d338c1738f
f82dadfaae1f5c6b914cb18724dc156f178f03dd
refs/heads/master
2020-03-14T02:53:05.792198
2018-06-20T07:47:21
2018-06-20T07:47:21
131,408,436
1
0
null
null
null
null
UTF-8
Swift
false
false
1,639
swift
// // SignInViewController.swift // Rainbow // // Created by Blaer on 2018/4/30. // Copyright © 2018 cyrusblaer. All rights reserved. // import UIKit class SignInViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() let backBarButton = UIBarButtonItem(title: "", style: .plain, target: self, action: nil) self.navigationItem.backBarButtonItem = backBarButton let recordButton = UIBarButtonItem(title: "收支明细", style: .plain, target: self, action: #selector(self.pushToRecordVC)) self.navigationItem.rightBarButtonItem = recordButton } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) self.navigationController?.setNavigationBarHidden(false, animated: true) } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } // MARK: - Methods @objc func pushToRecordVC() { let vc = self.storyboard?.instantiateViewController(withIdentifier: "recordVC") as! RecordViewController vc.haveData = false self.navigationController?.pushViewController(vc, 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.destinationViewController. // Pass the selected object to the new view controller. } */ }
[ -1 ]
c9b88e078fad04af993bafe1afe406b7588cf9e1
c59639111234241e12b648b7c0b7b84d83f6f8e2
/Example/Example/AppDelegate.swift
c70809da8f9abc1e2272fcb23500288eec3322dd
[ "MIT" ]
permissive
Econa77/CookieStore
bfa2248b7f42b83cd35ed124418fc24c8c8f65aa
90ec01f9038223e970e89e3356f387fc436b909c
refs/heads/master
2016-08-13T00:04:33.563359
2016-02-09T15:53:09
2016-02-09T15:53:09
49,878,827
0
0
null
null
null
null
UTF-8
Swift
false
false
2,227
swift
// // AppDelegate.swift // Example // // Created by 古林 俊祐  on 2015/10/07. // Copyright © 2015年 Shunsuke Furubayashi. All rights reserved. // import UIKit import CookieStore @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { CookieStore.sharedStore.setup() CookieStore.sharedStore.saveDomains = ["clipy-app.com"] return true } func applicationWillResignActive(application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. } func applicationDidEnterBackground(application: UIApplication) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } func applicationWillEnterForeground(application: UIApplication) { // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. } func applicationDidBecomeActive(application: UIApplication) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } func applicationWillTerminate(application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } }
[ 229380, 229383, 229385, 278539, 229388, 278542, 229391, 278545, 229394, 278548, 229397, 229399, 229402, 278556, 229405, 278559, 278564, 229415, 229417, 327722, 229426, 229428, 286774, 229432, 286776, 286778, 319544, 286791, 237640, 278605, 196692, 311383, 278623, 278626, 319590, 311400, 278635, 278639, 278648, 131192, 327814, 131209, 303241, 417930, 311436, 319633, 286873, 286876, 311460, 311469, 327862, 286906, 180413, 286910, 286916, 286922, 286924, 286926, 286928, 278743, 278747, 155872, 319716, 278760, 237807, 303345, 286962, 229622, 327930, 278781, 278783, 278785, 278792, 286987, 319757, 286999, 287003, 287009, 287014, 287016, 287019, 262448, 155966, 278849, 319809, 319810, 319814, 319818, 311628, 287054, 319822, 278865, 196963, 196969, 106872, 311683, 319879, 65943, 319898, 311719, 278952, 139689, 311728, 278967, 180668, 311741, 278975, 319938, 278980, 278983, 319945, 278986, 278990, 278994, 279003, 279006, 188895, 279010, 287202, 279015, 172520, 279020, 279023, 311791, 172529, 279027, 164343, 279035, 311804, 279040, 303617, 287234, 279045, 287238, 172550, 172552, 303623, 320007, 279051, 172558, 279055, 279058, 279063, 279067, 172572, 279072, 172577, 172581, 279082, 279084, 172591, 172598, 279095, 172607, 172612, 377413, 172614, 213575, 172618, 303690, 33357, 279124, 172634, 262752, 311911, 189034, 295533, 189039, 189040, 172655, 172656, 295538, 189044, 172660, 287349, 352880, 287355, 287360, 295553, 287365, 311942, 303751, 352905, 279178, 287371, 311946, 311951, 287377, 287381, 311957, 221850, 287386, 164509, 287390, 295583, 303773, 287394, 303780, 287398, 287400, 279208, 172714, 279212, 172721, 287409, 66227, 303797, 189114, 287419, 328381, 279231, 287423, 328384, 287427, 107212, 172748, 287436, 172755, 303827, 279255, 279258, 303835, 213724, 189149, 303838, 279267, 279272, 312050, 230131, 230146, 328453, 230154, 33548, 312077, 369433, 295707, 328476, 303914, 279340, 279353, 230202, 222018, 377676, 148302, 287569, 279390, 230241, 279394, 303976, 336744, 328563, 213895, 320391, 304013, 213902, 279438, 279445, 58262, 279452, 279461, 279462, 304042, 213931, 230327, 304055, 287675, 304063, 238528, 304065, 189378, 213954, 156612, 295873, 312272, 304084, 304090, 320481, 304106, 320490, 312302, 328687, 320496, 295928, 320505, 295945, 295949, 197645, 320528, 140312, 295961, 238620, 304164, 189479, 238641, 238652, 238655, 230465, 296004, 336964, 205895, 320584, 238666, 296021, 205931, 164973, 205934, 279661, 279669, 337018, 279679, 279683, 222340, 205968, 296084, 238745, 238756, 205991, 165035, 337067, 165038, 238766, 238770, 230592, 279750, 230600, 230607, 148690, 279769, 304348, 279777, 304354, 320740, 279781, 304360, 320748, 279788, 279790, 296189, 320771, 296205, 230674, 320786, 230677, 296213, 296215, 312622, 312630, 222522, 222525, 312639, 378181, 230727, 238919, 320840, 222545, 230739, 337244, 230752, 173418, 410987, 148843, 230768, 296305, 312692, 230773, 279929, 181626, 304506, 181631, 312711, 312712, 296331, 288140, 230800, 304533, 337306, 288160, 288162, 288164, 279975, 370092, 279983, 288176, 296373, 279991, 312759, 288185, 337335, 222652, 312766, 173507, 230860, 280014, 288210, 370130, 288212, 280021, 288214, 239064, 288217, 288218, 280027, 288220, 329177, 239070, 288224, 288226, 370146, 280036, 288229, 280038, 288230, 288232, 280034, 288234, 288236, 288238, 288240, 288242, 288244, 288250, 402942, 370187, 304651, 304653, 230940, 108066, 296486, 157229, 288320, 124489, 280140, 280145, 288338, 280149, 280152, 239194, 280158, 403039, 370272, 312938, 280183, 280185, 280188, 280191, 280194, 280208, 280211, 288408, 280218, 280222, 321195, 321200, 337585, 296634, 313027, 280260, 280264, 206536, 206539, 206541, 206543, 280276, 321239, 280283, 313052, 288478, 313055, 313066, 280302, 288494, 419570, 321266, 288502, 280314, 288510, 67330, 280324, 198405, 288519, 280331, 198416, 296723, 116503, 329498, 321311, 313121, 313123, 304932, 321316, 280363, 141101, 165678, 280375, 321336, 296767, 280388, 304968, 280393, 280402, 313176, 280419, 321381, 313201, 1920, 255873, 305028, 280454, 247688, 280464, 124817, 280468, 280473, 124827, 247709, 214944, 280487, 296883, 10170, 296890, 296894, 280515, 190403, 296900, 337862, 165831, 280521, 231379, 296921, 231404, 124913, 239612, 313340, 313347, 313358, 321560, 313371, 354338, 223273, 313386, 354348, 124978, 124980, 321595, 313406, 288831, 67654, 280651, 354382, 288848, 280658, 215123, 354390, 288855, 288859, 280669, 313438, 280671, 223327, 321634, 280681, 313451, 223341, 280687, 313458, 280691, 313464, 329850, 321659, 280702, 288895, 321670, 215175, 141455, 141459, 280725, 313498, 100520, 288936, 280747, 288940, 280755, 288947, 321717, 280759, 280764, 280769, 280771, 280774, 280776, 313548, 321740, 280783, 280786, 280788, 313557, 280793, 280796, 280798, 338147, 280804, 280807, 157930, 280811, 280817, 125171, 157940, 280819, 280823, 280825, 280827, 280830, 280831, 280833, 125187, 280835, 125191, 125209, 321817, 125218, 321842, 223539, 125239, 280888, 280891, 289087, 280897, 280900, 239944, 305480, 280906, 239947, 305485, 280919, 354653, 313700, 280937, 280940, 190832, 280946, 313720, 280956, 239997, 280959, 199051, 240011, 240017, 190868, 297365, 297368, 297372, 141725, 297377, 289186, 240052, 289207, 305594, 281024, 289218, 289221, 289227, 281045, 281047, 215526, 166378, 305647, 281075, 281084, 240124, 305662, 305664, 240129, 305666, 305668, 281095, 338440, 150025, 223757, 281102, 223763, 223765, 281113, 322074, 281116, 281121, 182819, 281127, 281135, 158262, 289342, 281154, 322115, 158283, 281163, 199262, 338532, 281190, 281196, 158317, 313973, 281210, 158347, 133776, 314003, 117398, 314007, 174754, 330404, 289448, 133801, 174764, 314029, 314033, 240309, 314047, 314051, 297671, 199367, 363234, 289522, 289525, 322310, 322314, 322318, 281361, 281372, 215850, 281388, 207661, 289593, 281401, 281410, 281413, 281414, 240458, 281420, 240468, 281430, 297818, 281435, 281438, 281442, 224110, 207737, 183172, 158596, 240519, 322440, 289687, 297883, 289694, 289700, 52163, 281567, 322534, 297961, 183277, 281581, 322550, 134142, 322610, 314421, 281654, 314427, 207937, 207949, 322642, 281691, 314461, 281702, 281704, 281708, 281711, 289912, 248995, 306341, 306344, 306347, 306354, 142531, 199877, 289991, 306377, 363745, 330988, 216303, 322801, 199978, 314671, 298292, 298294, 298306, 380226, 281923, 224584, 224587, 224594, 216404, 306517, 314714, 224603, 159068, 314723, 281960, 150890, 306539, 314732, 314736, 290161, 298358, 314743, 306552, 290171, 314747, 290174, 281987, 281990, 298377, 314763, 224657, 314785, 282025, 314793, 282027, 241070, 282034, 150966, 298424, 306618, 282044, 323015, 306640, 290275, 339431, 282089, 191985, 282098, 282101, 191992, 290298, 151036, 290302, 282111, 175621, 306694, 192008, 282127, 290321, 282130, 282133, 290325, 290328, 290332, 241181, 282142, 282144, 290344, 306731, 290349, 290351, 282186, 224849, 282195, 282199, 282201, 159324, 159330, 241260, 257658, 282249, 282261, 298651, 282269, 323229, 298655, 323231, 61092, 282277, 282295, 282300, 323260, 323266, 282310, 323273, 282319, 306897, 241362, 282328, 52959, 216801, 282337, 241380, 216806, 323304, 282345, 12011, 282356, 323318, 282364, 282367, 306945, 241412, 323333, 282376, 323345, 282388, 282392, 184090, 315167, 315169, 282402, 315174, 323367, 241448, 241450, 282410, 306988, 315184, 323376, 315190, 241464, 159545, 282425, 307009, 307027, 315221, 282454, 315223, 241496, 241498, 307035, 307040, 282465, 282478, 282481, 110450, 315251, 315249, 315253, 315255, 282499, 282505, 298896, 282514, 298898, 44948, 298901, 282520, 282531, 282537, 282547, 298975, 323574, 290807, 299003, 241661, 282623, 315396, 241669, 315397, 282632, 282639, 282645, 282654, 241701, 217127, 282669, 323630, 282681, 290877, 282687, 159811, 315463, 192589, 307278, 307287, 315482, 217179, 315483, 192605, 200801, 299105, 217188, 299109, 307303, 45163, 307307, 315502, 192624, 307314, 299126, 233591, 307338, 233613, 241813, 307352, 299164, 184479, 184481, 307370, 168107, 307376, 323763, 176311, 299191, 307385, 307386, 258235, 176316, 307388, 307390, 299200, 307394, 307396, 323784, 307409, 307411, 176343, 233701, 282881, 184586, 282893, 291089, 282906, 291104, 233766, 307508, 315701, 307510, 151864, 307512, 307515, 282942, 307518, 151874, 282947, 323917, 110926, 282957, 323921, 323926, 233815, 315739, 299357, 242024, 250231, 242043, 291202, 299398, 242057, 291212, 299405, 283033, 291226, 242075, 315801, 291231, 283042, 291238, 291241, 127405, 291247, 299444, 127413, 283062, 283069, 127424, 299457, 283080, 176592, 315860, 176597, 283095, 299481, 242143, 127455, 127457, 291299, 242152, 291305, 176620, 127469, 127474, 291314, 291317, 135672, 291330, 283142, 127494, 233994, 234003, 234006, 152087, 283161, 242202, 234010, 135707, 242206, 242208, 291361, 234038, 70213, 242250, 111193, 242275, 299620, 242279, 168562, 184952, 135805, 291456, 373383, 316051, 225941, 299672, 135834, 373404, 299677, 299680, 225954, 242343, 209576, 242345, 373421, 135870, 135873, 135876, 299723, 225998, 226002, 226005, 226008, 201444, 283368, 234219, 283372, 226037, 283382, 234231, 234236, 226045, 234239, 242431, 209665, 234242, 299778, 226053, 234246, 226056, 234248, 234254, 291601, 242452, 234261, 201496, 283421, 234269, 234274, 234278, 299814, 283432, 234281, 234284, 234287, 283440, 185138, 234292, 234298, 283452, 234307, 234309, 234313, 316233, 316235, 234316, 283468, 242511, 234321, 234324, 185173, 201557, 234329, 234333, 308063, 234338, 242530, 349027, 234341, 234344, 234347, 177004, 324464, 234353, 152435, 234358, 234362, 226171, 234368, 234370, 201603, 226182, 234375, 226185, 234379, 234384, 234388, 234390, 226200, 324504, 234393, 209818, 308123, 324508, 234398, 291748, 291750, 234407, 324518, 324520, 234410, 324522, 226220, 291756, 234414, 324527, 291760, 234417, 201650, 324531, 275384, 234428, 291773, 234431, 242623, 324544, 324546, 226239, 324548, 226245, 234437, 234439, 234443, 291788, 193486, 234446, 193488, 275406, 234449, 316370, 234452, 234455, 234459, 234461, 234470, 168935, 5096, 324585, 234475, 234478, 316400, 316403, 234484, 324599, 234490, 234493, 234496, 316416, 234501, 234504, 234507, 234510, 234515, 300054, 234519, 316439, 234523, 234528, 300066, 234532, 234537, 234540, 144430, 234543, 275508, 234549, 300085, 300088, 234556, 234558, 316479, 234561, 316483, 234568, 234570, 316491, 300108, 234580, 234581, 242777, 234585, 234590, 234595, 300133, 234601, 300139, 160879, 234607, 275569, 234614, 398455, 144506, 234618, 275579, 234623, 226433, 234627, 275588, 234629, 242822, 234634, 275594, 234636, 177293, 275602, 234643, 226453, 275606, 234647, 275608, 308373, 234650, 283805, 234653, 324766, 119967, 234657, 283813, 234661, 234664, 275626, 316596, 234687, 316610, 300226, 226500, 234692, 300229, 308420, 283850, 300234, 300238, 300241, 316625, 300243, 300245, 300248, 300253, 300256, 300258, 300265, 161003, 300267, 300270, 300272, 120053, 300278, 316663, 300284, 275710, 300287, 300289, 300292, 283917, 300301, 177424, 283939, 259367, 283951, 243003, 226628, 283973, 300357, 283983, 316758, 357722, 316766, 292192, 316768, 218464, 292197, 316774, 284010, 136562, 275834, 275836, 275840, 316803, 316806, 316811, 226703, 300433, 234899, 226709, 316824, 316826, 144796, 300448, 144810, 144812, 144814, 144820, 284084, 284087, 292279, 144826, 144828, 144830, 144832, 284099, 144835, 144837, 38342, 144839, 144841, 144844, 144847, 144852, 144855, 103899, 333280, 292329, 300523, 259565, 259567, 300527, 226802, 292338, 308727, 316947, 308757, 284191, 316959, 284194, 284196, 235045, 284199, 284204, 284206, 284209, 284211, 284213, 284218, 226877, 284223, 292421, 226886, 284231, 128584, 366155, 276043, 284238, 226895, 284241, 194130, 284243, 276052, 284245, 276053, 284247, 317015, 284249, 243290, 284251, 284253, 284255, 284258, 292452, 284263, 284265, 292458, 284267, 292461, 284272, 284274, 276086, 284278, 292470, 292473, 284283, 276093, 276095, 284288, 292481, 284290, 325250, 284292, 276098, 284297, 284299, 317068, 276109, 284301, 284303, 276114, 284306, 284308, 284312, 284316, 276127, 284320, 284327, 276137, 284329, 284331, 317098, 284333, 284335, 284337, 284343, 284346, 284350, 276160, 358080, 284354, 358083, 276166, 284358, 358089, 276170, 284362, 276175, 276177, 284370, 317138, 284372, 276187, 284379, 284381, 284384, 284386, 358114, 358116, 276197, 358119, 284392, 325353, 284394, 358122, 284397, 276206, 284399, 358126, 358128, 358133, 276216, 284413, 284418, 358146, 317187, 317191, 284428, 300816, 284440, 186139, 300828, 276255, 325408, 284449, 300834, 317221, 227109, 358183, 276268, 194351, 243504, 284469, 276280, 325436, 276291, 276295, 358224, 276308, 284502, 317271, 276315, 292700, 284511, 227175, 284529, 300915, 292729, 317306, 284540, 276365, 284564, 284566, 350106, 284572, 276386, 284579, 276388, 358312, 284585, 276395, 358326, 276410, 276411, 358330, 276418, 301009, 301011, 301013, 292823, 301015, 301017, 358360, 292828, 276446, 153568, 276448, 276452, 276455, 292839, 292843, 276460, 276464, 276466, 227314, 276472, 317435, 276476, 276479, 276482, 276485, 317446, 276490, 276496, 317458, 243733, 243751, 292904, 276528, 243762, 309298, 325685, 235579, 276539, 235581, 276544, 284739, 243785, 276553, 350295, 194649, 227418, 309337, 194654, 227423, 350302, 178273, 227426, 194657, 194660, 276579, 227430, 276583, 309346, 309348, 309350, 309352, 309354, 350308, 276590, 350313, 227440, 350316, 284786, 350321, 276595, 350328, 292993, 301185, 350339, 350342, 350345, 325777, 350354, 350359, 276638, 350366, 284837, 350375, 350379, 350381, 350385, 350387, 350389, 350395, 350399, 227520, 301252, 350406, 227529, 309450, 276685, 276689, 309462, 301272, 309468, 301283, 317672, 276713, 227571, 243960, 227583, 276735, 227587, 276739, 276742, 227593, 227596, 325910, 309530, 342298, 276766, 211232, 276775, 260421, 276809, 285002, 276811, 235853, 276829, 276833, 391523, 276836, 276843, 293227, 276848, 293232, 186744, 211324, 227709, 285061, 317833, 178572, 285070, 178575, 285077, 227738, 317853, 276896, 317858, 285093, 317864, 285098, 276907, 276917, 293304, 317910, 293343, 276961, 227810, 293346, 276964, 293352, 236013, 317951, 309764, 121352, 236043, 342541, 113167, 317971, 309781, 227877, 227879, 227882, 309804, 105007, 236082, 285236, 277054, 129603, 318020, 277071, 285265, 309844, 277080, 309849, 285277, 285282, 326244, 277100, 121458, 277106, 170618, 170619, 277122, 285320, 277128, 301706, 318092, 326285, 318094, 334476, 277136, 277139, 227992, 285340, 318108, 227998, 383658, 285357, 318128, 277170, 342707, 154292, 277173, 285368, 277177, 277181, 277187, 277191, 277194, 277196, 277201, 137946, 113378, 228069, 277223, 342760, 285417, 56043, 277232, 228081, 56059, 285441, 310020, 285448, 228113, 285459, 277273, 326430, 228128, 228135, 318248, 277291, 293677, 318253, 285489, 293685, 285494, 301884, 310080, 277317, 277322, 277329, 301913, 277337, 301921, 400236, 236397, 162671, 310134, 277368, 15224, 236408, 416639, 416640, 310147, 39817, 187274, 277385, 301972, 424853, 277405, 277411, 310179, 293802, 236460, 277426, 293811, 293820, 203715, 276586, 293861, 228327, 228328, 228330, 318442, 228332, 277486, 326638, 318450, 293876, 285686, 285690, 244731, 293887, 277504, 277507, 277511, 277519, 277526, 293939, 277561, 277564, 310336, 277573, 228422, 310344, 277577, 277583, 310355, 277594, 138332, 277598, 285792, 277601, 310374, 203879, 277608, 228460, 318573, 203886, 187509, 285815, 285817, 367737, 285821, 302205, 285824, 392326, 285831, 294026, 285835, 285852, 302237, 285854, 285856, 277671, 302248, 277678, 228526, 302258, 277687, 318651, 277695, 244930, 302275, 302277, 228550, 302282, 310476, 302285, 302288, 310481, 302290, 203987, 302292, 302294, 302296, 285927, 318698, 302315, 195822, 228592, 294132, 138485, 228601, 228606, 204031, 64768, 310531, 285958, 228617, 318742, 204067, 277798, 130345, 113964, 285997, 285999, 113969, 318773, 318776, 286016, 294211, 302403, 326991, 179547, 302436, 294246, 327015, 310632, 327017, 351594, 351607, 310648, 310651, 310657, 351619, 294276, 253320, 310665, 318858, 310672, 351633, 310689, 277932, 310710, 310715, 228799, 64966, 245191, 163272, 302543, 310737, 286169, 228825, 310749, 310755, 187880, 310764, 286188, 40443, 286203, 40448, 228864, 228871, 65038, 302614, 286233, 146977, 286246, 286248, 278057, 310831, 212538, 40507, 228933, 40525, 212560, 228944, 400976, 147032, 40537, 40539, 278109, 40550, 286312, 286313, 40554, 310892, 40557, 294521, 343679, 278150, 310925, 286354, 278163, 278168, 327333, 229030, 278188, 278192, 319153, 278196, 302789, 294599, 278216, 343757, 212690, 278227, 286420, 319187, 229076, 319194, 278235, 229086, 278238, 286432, 294625, 286460, 171774, 278274, 278277, 302854, 294664, 311048, 311053, 302862, 278306, 294701, 278320, 229192, 302925, 327554, 40851, 294811, 294817, 319394, 294821, 311209, 180142, 188340, 294847, 393177, 294876, 294879, 294890, 311279, 278513, 237555, 278516, 311283, 278519, 237562 ]
6f03b2bae9932ac00028b5a15822e6dcc1950d8e
a1da25db49ddbe854409e9bfedfb6b28ae22fb98
/LAB_FUNC.playground/Contents.swift
80700ea005ce88752a76489c29bec050fa5de70b
[]
no_license
SehamFulayyih/week-02_LAB_Func
701603f558962d44764764e2b0ccd3a541583437
bb4a3c78b3fa1abe8a674da870319c27e215dac5
refs/heads/main
2023-08-15T07:24:10.399580
2021-10-10T08:15:06
2021-10-10T08:15:06
null
0
0
null
null
null
null
UTF-8
Swift
false
false
191
swift
import UIKit func printMyName(name:String,age:Int)->String{ return"this is my name :\(name)this is my age:\(age)" } var phrase = printMyName(name: "Seham",age:29) print(phrase)
[ -1 ]
a71ff4389e05dc45ecfba17bf13a0de061901478
f5cd2bff63155dde01e1a735c21395105a86bc31
/test/IRGen/tsan-attributes.swift
74b652b0a6e5c2f0115bd3145ad2e1686a7ffbde
[ "Apache-2.0", "Swift-exception" ]
permissive
shahmishal/swift
0ff1209c0702cba87239f9f79b8790d2ea2b04f5
6665a48de153bb4e5e7d2919db661943699c9a1c
refs/heads/master
2022-06-11T03:21:11.456449
2020-02-10T06:34:27
2020-02-10T06:34:27
143,474,720
6
1
Apache-2.0
2020-02-10T06:35:31
2018-08-03T21:27:21
C++
UTF-8
Swift
false
false
625
swift
// This test verifies that we add the function attributes used by TSan. // RUN: %target-swift-frontend -emit-ir -sanitize=thread %s | %FileCheck %s -check-prefix=TSAN // TSan is only supported on 64 bit. // REQUIRES: PTRSIZE=64 // TSAN: define {{.*}} @"$s4main4testyyF"() [[DEFAULT_ATTRS:#[0-9]+]] public func test() { } // TSAN: define {{.*}} @"$s4main1xSivr"({{.*}}) [[COROUTINE_ATTRS:#[0-9]+]] public var x: Int { _read { yield 0 } } // TSAN: attributes [[DEFAULT_ATTRS]] = // TSAN-SAME: sanitize_thread // TSAN-SAME: } // TSAN: attributes [[COROUTINE_ATTRS]] = // TSAN-SAME: sanitize_thread // TSAN-SAME: }
[ 83579 ]
61b911a288c33f0facfd94cc1b4bec8c5ae56e3d
3922c39030f8b05a6773a2e473f2ac0897a5ae72
/PDFViewer/CPDFViewHeaderView.swift
034f5682435d462e26e7e8ad77ea2d4c7809b9cc
[]
no_license
AndriiKogun/PDFViewer
3ab133b59fd66838e1f212a18c8939f8603434f6
ba279f061b57d68211d3519ca20fcf828d3cf11f
refs/heads/master
2020-11-29T15:57:00.708294
2019-12-25T22:07:09
2019-12-25T22:07:09
229,980,133
0
0
null
null
null
null
UTF-8
Swift
false
false
3,791
swift
// // CPDFViewHeaderView.swift // PDF // // Created by Andrii on 11/7/18. // Copyright © 2018 A K. All rights reserved. // import UIKit protocol CPDFViewHeaderViewDelegate: class { func dissmissAction(_ sender: UIButton) func writeNoteAction(_ sender: UIButton) func saveAction(_ sender: UIButton) func moreAction(_ sender: UIButton) } class CPDFViewHeaderView: UIView { weak var delegate: CPDFViewHeaderViewDelegate? private lazy var closeButton: UIButton = { let closeButton = UIButton(type: .custom) closeButton.backgroundColor = .black closeButton.layer.cornerRadius = 4 closeButton.setImage(UIImage(named: "PDF_close_icon"), for: .normal) closeButton.addTarget(self, action: #selector(dissmisAction(_:)), for: .touchUpInside) return closeButton }() private lazy var noteButton: UIButton = { let noteButton = UIButton(type: .custom) noteButton.backgroundColor = .black noteButton.layer.cornerRadius = 4 noteButton.setImage(UIImage(named: "PDF_write_note_icon"), for: .normal) noteButton.addTarget(self, action: #selector(writeNoteAction(_:)), for: .touchUpInside) return noteButton }() private lazy var savedButton: UIButton = { let savedButton = UIButton(type: .custom) savedButton.backgroundColor = .black savedButton.layer.cornerRadius = 4 savedButton.setImage(UIImage(named: "PDF_saved_icon"), for: .normal) savedButton.addTarget(self, action: #selector(saveAction(_:)), for: .touchUpInside) return savedButton }() private lazy var moreButton: UIButton = { let moreButton = UIButton(type: .custom) moreButton.backgroundColor = .black moreButton.layer.cornerRadius = 4 moreButton.setImage(UIImage(named: "PDF_saved_icon"), for: .normal) moreButton.addTarget(self, action: #selector(moreAction(_:)), for: .touchUpInside) return moreButton }() init() { super.init(frame: CGRect.zero) setupLayout() } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } private func setupLayout() { addSubview(closeButton) closeButton.snp.makeConstraints { (make) in make.centerY.equalToSuperview() make.height.equalTo(40) make.width.equalTo(40) make.left.equalToSuperview().offset(16) } addSubview(moreButton) moreButton.snp.makeConstraints { (make) in make.centerY.equalToSuperview() make.height.equalTo(40) make.width.equalTo(40) make.right.equalToSuperview().offset(-16) } addSubview(savedButton) savedButton .snp.makeConstraints { (make) in make.centerY.equalToSuperview() make.height.equalTo(40) make.width.equalTo(40) make.right.equalTo(moreButton.snp.left).offset(-12) } addSubview(noteButton) noteButton .snp.makeConstraints { (make) in make.centerY.equalToSuperview() make.height.equalTo(40) make.width.equalTo(40) make.right.equalTo(savedButton.snp.left).offset(-12) } } //MARK: - Actions @objc func dissmisAction(_ sender: UIButton) { delegate?.dissmissAction(sender) } @objc func writeNoteAction(_ sender: UIButton) { delegate?.writeNoteAction(sender) } @objc func saveAction(_ sender: UIButton) { delegate?.saveAction(sender) } @objc func moreAction(_ sender: UIButton) { delegate?.moreAction(sender) } }
[ -1 ]
d6f9e7abac1eea748b6cb34ca43785666f7862bc
741853b8f37b71fba4c5af35495ab7e93183376b
/poker/ViewControllerP1.swift
40abfecc81159d9cedc44ab0597ff822c3b8c839
[]
no_license
KaiWenMandy/poker
23e5aee135044decde2039b8982df75762220ed4
b5d20f5dab7164812ef35c66ff18a184168cbecf
refs/heads/master
2020-04-16T09:58:14.987288
2019-01-13T08:48:38
2019-01-13T08:48:38
165,483,990
0
0
null
null
null
null
UTF-8
Swift
false
false
13,072
swift
// // ViewController2.swift // poker // // Created by Kai Wen on 2018/12/26. // Copyright © 2018年 Kai Wen. All rights reserved. // import UIKit import AVFoundation class ViewControllerP1: UIViewController { // ----------普通版---------- // ///// @IBOutlet var playerImages: [UIImageView]! // 玩家的牌組 @IBOutlet var bankerImages: [UIImageView]! // 對手的牌組 @IBOutlet weak var groupImage: UIImageView! // 牌組 @IBOutlet weak var centerImage: UIImageView! // 中間 @IBOutlet weak var scoreLabel: UILabel! // 旁邊的總分 @IBOutlet var msgLabels: [UILabel]! // 訊息 @IBOutlet weak var messageLabel: UILabel! // 訊息 @IBOutlet weak var messageButton: UIButton! // 訊息 // 材料 let face = [ "A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K" ] // 點數 let suit = [ "Club", "Diamond", "Heart", "Spade" ] // 花色 var cardOrder:[Card] = [] // 原牌組 var cardGroup:[Card] = [] // 板上的牌組 var cardCenter:[Card] = [] // 中間已經出的牌組 var cardPlayer:[Card] = [] // 玩家的牌組 var cardBanker:[Card] = [] // 對手的牌組 var countGroup = 52 var countCenter = 0 var fouseImage:Int? var round:Bool = true // 音效 var cardAV: AVAudioPlayer? var groupAV: AVAudioPlayer? // ----------開始---------- // ///// override func viewDidLoad() { super.viewDidLoad() // 前置 for i in 0...51 { let num = i % 13 switch ( num ) { case 0: // 1 if ( i/13 == 3 ) { cardOrder.append(Card0(order: i, suit: suit[ i / 13 ], face: face[ i % 13 ])) } else { cardOrder.append(Card1(order: i, suit: suit[ i / 13 ], face: face[ i % 13 ])) } case 4: // card5 cardOrder.append(Card5(order: i, suit: suit[ i / 13 ], face: face[ i % 13 ])) case 12: // cardK cardOrder.append(CardK(order: i, suit: suit[ i / 13 ], face: face[ i % 13 ])) case 11: // cardQ cardOrder.append(CardQ(order: i, suit: suit[ i / 13 ], face: face[ i % 13 ])) case 10: // cardJ cardOrder.append(CardJ(order: i, suit: suit[ i / 13 ], face: face[ i % 13 ])) case 9: // card10 cardOrder.append(CardT(order: i, suit: suit[ i / 13 ], face: face[ i % 13 ])) default: // card cardOrder.append(Card(order: i, suit: suit[ i / 13 ], face: face[ i % 13 ])) } } for i in 0...4 { playerImages[i].center.x = 70 bankerImages[i].center.x = 70 playerImages[i].center.y = 448 bankerImages[i].center.y = 448 playerImages[i].image = UIImage(named: "Back") bankerImages[i].image = UIImage(named: "Back") } // 觸碰 for i in 0...4 { let singleTap = UITapGestureRecognizer(target: self, action: #selector( singleImageTap )) playerImages[i].tag = i playerImages[i].addGestureRecognizer(singleTap) playerImages[i].isUserInteractionEnabled = true } // 音效 var path = Bundle.main.path(forResource: "click.mp3", ofType: nil) var url = URL(fileURLWithPath: path!) do { cardAV = try AVAudioPlayer(contentsOf: url) } catch { print( "Can't not found the audio click.mp3" ) } path = Bundle.main.path(forResource: "yisell.mp3", ofType: nil) url = URL(fileURLWithPath: path!) do { groupAV = try AVAudioPlayer(contentsOf: url) } catch { print( "Can't not found the audio duble_clicks.mp3" ) } newGame() } // ----------點擊出牌---------- // ///// @objc func singleImageTap ( recognizer:UITapGestureRecognizer, order:Int ) { // 先抓目標tag let tapImage = recognizer.view as! UIImageView if ( fouseImage == nil ) { // 先判斷是否為無目標 UIView.animate(withDuration: 0.5) { tapImage.center.y -= 30 } DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { self.fouseImage = tapImage.tag } } else if ( tapImage.tag == fouseImage! ) { // 點擊兩下出牌 // 出牌 if ( round ) { cardPlayer[tapImage.tag].action() } else { cardBanker[tapImage.tag].action() } scoreLabel.text = String(Card.score) msgLabels[0].text = Card.message cardAV?.play() UIView.animate(withDuration: 0.5) { self.playerImages[tapImage.tag].center.x = 207 self.playerImages[tapImage.tag].center.y = 448 } // 判斷是否超過,有超過就結束 if ( Card.score > 99 ) { for i in 0...4 { playerImages[i].isUserInteractionEnabled = false } DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { if ( self.round ){ self.messageLabel.text = "B贏了!" } else { self.messageLabel.text = "P贏了!" } self.messageLabel.backgroundColor = UIColor.white.withAlphaComponent(0.7) self.messageButton.setTitle("重新一次", for: .normal) self.messageButton.isEnabled = true self.messageButton.backgroundColor = UIColor(red:0.00, green:0.60, blue:1.00, alpha:1.0) } } else { DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { self.drawCard(tag: tapImage.tag) self.fouseImage = nil self.messageButton.setTitle("", for: .normal) } DispatchQueue.main.asyncAfter(deadline: .now() + 1.5) { self.changePlayer() } } } else { // 點擊其他換牌 UIView.animate(withDuration: 0.5) { self.playerImages[self.fouseImage!].center.y += 30 tapImage.center.y -= 30 } DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { self.fouseImage = tapImage.tag } } } // ----------拿牌---------- // ///// func drawCard ( tag:Int ) { for i in 0...4 { playerImages[i].isUserInteractionEnabled = false } // 發牌 if ( round ) { // 如果是玩家回合 // 前置 countCenter += 1 centerImage.image = playerImages[tag].image playerImages[tag].center.x = 70 cardCenter.append(cardPlayer[tag]) cardPlayer[tag] = cardGroup[countGroup - 1] playerImages[tag].image = UIImage(named: cardPlayer[tag].image) countGroup -= 1 UIView.animate(withDuration: 1) { self.playerImages[tag].center.x = CGFloat(297 - tag * 45) self.playerImages[tag].center.y = 725 } } else { // 對手回合 countCenter += 1 centerImage.image = playerImages[tag].image playerImages[tag].center.x = 70 cardCenter.append(cardBanker[tag]) cardBanker[tag] = cardGroup[countGroup - 1] playerImages[tag].image = UIImage(named: cardBanker[tag].image) countGroup -= 1 UIView.animate(withDuration: 1) { self.playerImages[tag].center.x = CGFloat(297 - tag * 45) self.playerImages[tag].center.y = 725 } } // 之後判斷有沒有出玩牌 if ( countGroup == 0 ) { // 資料處理 cardGroup = cardCenter.shuffled() cardCenter = [] countGroup = countCenter countCenter = 0 // 圖片處理 groupImage.image = nil centerImage.image = UIImage(named: "Back") groupAV?.play() UIView.animate(withDuration: 0.5) { self.centerImage.center.x = 70 self.centerImage.center.y = 448 } DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { self.groupImage.image = UIImage(named: "Back") self.centerImage.image = nil self.centerImage.center.x = 207 self.centerImage.center.y = 448 } } //msgLabels[0].text = String(countGroup) //msgLabels[1].text = String(countCenter) } // ----------交換視角---------- // ///// func changePlayer () { for i in 0...4 { playerImages[i].image = UIImage(named: "Back") playerImages[i].isUserInteractionEnabled = false } DispatchQueue.main.asyncAfter(deadline: .now() + 1) { self.msgLabels[1].text = self.msgLabels[0].text self.msgLabels[0].text = "" if ( self.round ) { for i in 0...4 { self.playerImages[i].image = UIImage(named: self.cardBanker[i].image) //print(cardPlayer[i].image) } //print("") self.messageButton.setTitle("目前為B的回合", for: .normal) self.round = false } else { for i in 0...4 { self.playerImages[i].image = UIImage(named: self.cardPlayer[i].image) //print(cardBanker[i].image) } //print("") self.messageButton.setTitle("目前為P的回合", for: .normal) self.round = true } for i in 0...4 { self.playerImages[i].isUserInteractionEnabled = true } } } // ----------其他---------- // ///// func orderCard ( this:Card, that:Card ) -> Bool { return this.order < that.order } // ----------新遊戲---------- // ///// func newGame () { // 初始資料 countGroup = 52 countCenter = 0 Card.score = 0 scoreLabel.text = String(Card.score) cardGroup = cardOrder.shuffled() // 洗牌 messageLabel.text = "" messageButton.setTitle("", for: .normal) messageLabel.backgroundColor = nil messageButton.isEnabled = false messageButton.backgroundColor = nil centerImage.image = nil // 先發10張牌 for i in 0...9 { if ( i % 2 == 0 ) { cardPlayer.append(cardGroup[countGroup - 1]) countGroup -= 1 } else { cardBanker.append(cardGroup[countGroup - 1]) countGroup -= 1 } } cardPlayer = cardPlayer.sorted(by: orderCard) cardBanker = cardBanker.sorted(by: orderCard) for i in 0...4 { playerImages[i].image = UIImage(named: cardPlayer[i].image) } groupAV?.play() UIView.animate(withDuration: 1) { for i in 0...4 { self.playerImages[i].center.x = CGFloat(297 - i * 45) self.playerImages[i].center.y = 725 self.bankerImages[i].center.x = CGFloat(117 + i * 45) self.bankerImages[i].center.y = 175 } } // P必先出 DispatchQueue.main.asyncAfter(deadline: .now() + 1) { self.messageButton.setTitle("目前為P的回合", for: .normal) } } // ----------加減型---------- // ///// func creatButton ( card:Card ) { } // ----------重新遊戲---------- // ///// @IBAction func newGameButton(_ sender: Any) { msgLabels[0].text = "" msgLabels[1].text = "" fouseImage = nil for i in 0...4 { playerImages[i].center.x = 70 bankerImages[i].center.x = 70 playerImages[i].center.y = 448 bankerImages[i].center.y = 448 playerImages[i].image = UIImage(named: "Back") bankerImages[i].image = UIImage(named: "Back") playerImages[i].isUserInteractionEnabled = true } newGame() } }
[ -1 ]
09ebe31ac9f4876294427df2db116af02650bf75
e1191f7fd5a122280ca3b2c0cf0c958bd1e6051f
/Sources/Controllers/Omnibar/OmnibarImageCell.swift
f96b45794656e4dbb09645740d8d1513a376c73c
[ "MIT" ]
permissive
bientran/ello-ios
f6627883d9d8a3897d8a89f60100db3c8cd0d77e
ea248a77af241b4b008caeb7c1c7d362253428e2
refs/heads/master
2021-01-13T05:21:02.191903
2017-01-20T19:45:09
2017-01-20T19:45:09
null
0
0
null
null
null
null
UTF-8
Swift
false
false
3,289
swift
//// /// OmnibarImageCell.swift // public class OmnibarImageCell: UITableViewCell { static let reuseIdentifier = "OmnibarImageCell" struct Size { static let bottomMargin = CGFloat(15) static let editingMargins = UIEdgeInsets(top: 7.5, left: 8, bottom: 7.5, right: 12) static let editingHeight = CGFloat(80) } public let flImageView = FLAnimatedImageView() public let buyButton = UIButton() public var reordering = false public var hasBuyButtonURL = false public var omnibarImage: UIImage? { get { return flImageView.image } set { flImageView.image = newValue } } public var omnibarAnimagedImage: FLAnimatedImage? { get { return flImageView.animatedImage } set { flImageView.animatedImage = newValue } } override init(style: UITableViewCellStyle, reuseIdentifier: String?) { super.init(style: style, reuseIdentifier: reuseIdentifier) arrange() self.style() } required public init(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } private func style() { flImageView.clipsToBounds = true flImageView.contentMode = .ScaleAspectFit buyButton.backgroundColor = .greenD1() buyButton.adjustsImageWhenDisabled = false buyButton.adjustsImageWhenHighlighted = false buyButton.setImage(.BuyButton, imageStyle: .Normal, forState: .Normal) buyButton.setImage(.BuyButton, imageStyle: .Normal, forState: .Disabled) buyButton.layer.cornerRadius = buyButton.frame.size.width / 2 buyButton.hidden = true buyButton.enabled = false } private func arrange() { buyButton.frame.size = CGSize(width: 35, height: 35) contentView.addSubview(flImageView) contentView.addSubview(buyButton) } override public func layoutSubviews() { super.layoutSubviews() let margins: UIEdgeInsets if reordering { margins = Size.editingMargins flImageView.contentMode = .ScaleAspectFill buyButton.hidden = true } else { margins = UIEdgeInsets(all: 0) flImageView.contentMode = .ScaleAspectFit buyButton.hidden = !hasBuyButtonURL } let innerFrame = contentView.bounds let intrinsicSize = flImageView.intrinsicContentSize() flImageView.frame = CGRect( origin: .zero, size: CGSize( width: min(intrinsicSize.width, innerFrame.size.width), height: min(intrinsicSize.height, innerFrame.size.height) )).inset(margins) buyButton.frame.origin = CGPoint( x: flImageView.frame.maxX - 10 - buyButton.frame.size.width, y: 10 ) } public class func heightForImage(image: UIImage, tableWidth: CGFloat, editing: Bool) -> CGFloat { if editing { return Size.editingHeight } let cellWidth = tableWidth let imageWidth = max(image.size.width, 1) var height = image.size.height * cellWidth / imageWidth if editing { height += Size.bottomMargin } return min(height, image.size.height) } }
[ -1 ]
982bbd97f04dc96d8c2cd600df0020720849a0ad
44b0bea1f71b0f06b0c302ebb1a90c4e35b96ed1
/MeMe/View/MeMeTableViewCell.swift
3d1d4b79088d6d329d97ba19efbaca18640f6ef7
[]
no_license
noel-maldonado/MeMe
45e2564d938441459d8c0ad55aea6c931d108270
1c5fcffcef9abc1eb85d286dd336ab3227671188
refs/heads/master
2022-11-10T00:42:04.493768
2020-06-26T19:11:03
2020-06-26T19:11:03
261,549,358
0
0
null
null
null
null
UTF-8
Swift
false
false
316
swift
// // MeMeTableViewCell.swift // MeMe // // Created by Noel Maldonado on 6/23/20. // Copyright © 2020 Noel Maldonado. All rights reserved. // import UIKit class MeMeTableViewCell: UITableViewCell { @IBOutlet weak var cellLabel: UILabel! @IBOutlet weak var memeImageView: UIImageView! }
[ -1 ]
197d94a97e71276984071bc26e85f095119e0b50
f2d39aea5537c89b4a83f37989a7caf88bd87d7e
/Act3/Contents.swift
50929c829c7a880d87302aa0e351725eb89b1f26
[]
no_license
RubenSegoviaMeneses/Desarrollo-en-iOS
24253f128c0157e05f39865a636d55f49be9cc29
fa924449fc235cc29a1192808d962bef4f763c05
refs/heads/master
2020-12-13T16:47:59.813363
2020-02-28T02:33:02
2020-02-28T02:33:02
234,475,443
0
0
null
null
null
null
UTF-8
Swift
false
false
582
swift
import Foundation //4 Variables con 3 tipos de datos. var inferencia1 = 1 var inferencia2 = 2.5 var inferencia3 = "Inferencia" var inferencia4 = 4 //2 Variables por asociacion de tipo de datos. let declarativo1:Int = 2 let declarativo2:String = "Declarativo" //Array y Dictionary var numeros = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] var diasSemana = [1:"Lunes", 2:"Martes", 3:"Miercoles", 4:"Jueves", 5:"Viernes", 6:"Sabado", 7:"Domingo"] //Condicionales y Ciclos var datos = [3,6,9,2,4,1] for numeros in datos{ if(numeros<5){ print(numeros) } }
[ -1 ]
a724661bac5cd403c3e86384d9251e7411ac2464
dff2a8ea19d08217dcbd424afca81a69045210b0
/TimerAppy/ViewController.swift
e96e762cf2a69cf3796856945d8b8d1e27c3bb09
[]
no_license
fionapods/TimerApp
211a7ea0e6b3dd1c61b95ea71d765a0acf70ef62
fe48684b3d06e887803a2ba17c5d37219624beec
refs/heads/master
2020-03-26T06:04:50.641251
2018-08-13T14:10:52
2018-08-13T14:10:52
144,588,770
0
0
null
null
null
null
UTF-8
Swift
false
false
1,617
swift
// // ViewController.swift // TimerAppy // // Created by Fiona Podrima on 8/13/18. // Copyright © 2018 Cacttus Education. All rights reserved. // import UIKit class ViewController: UIViewController { @IBOutlet weak var timeLabel: UILabel! @IBOutlet weak var resetButton: UIButton! @IBOutlet weak var playButton: UIButton! @IBOutlet weak var pauseButton: UIButton! var timer = Timer() var counter = 0.0 var isRunning = false override func viewDidLoad() { super.viewDidLoad() timeLabel.text = "\(counter)" playButton.isEnabled = true pauseButton.isEnabled = false } @IBAction func resetButtonDidTouch(_ sender: Any) { timer.invalidate() isRunning = false counter = 0 timeLabel.text = "\(counter)" } @IBAction func playButtonDidTouch(_ sender: Any) { if !isRunning { timer = Timer.scheduledTimer(timeInterval: 0.1, target: self, selector: #selector(ViewController.updateTimer), userInfo: nil, repeats: true) playButton.isEnabled = false pauseButton.isEnabled = true isRunning = true } } @IBAction func pauseButtonDidTouch(_ sender: Any) { playButton.isEnabled = true pauseButton.isEnabled = false timer.invalidate() isRunning = false } @objc func updateTimer() { counter += 0.1 timeLabel.text = String(format: "%.1f", counter) } }
[ 287015 ]
5a9e18c1ce4ba682455f8201c6c80d2bf251b775
c862e280a2e8f2820ed5e012a364771c96729d66
/SwiftLearnProject/SwiftLearnProject/TheBasic/浮点数.playground/Contents.swift
3f37636a1a6e1629cd7df0ba95d83c1d44f0eaed
[ "MIT" ]
permissive
MINIProer/learn_swift_project
c2ddc2e113101f5a0db4e413978c0e1cc312094c
92173987774b29e7d7176f26d6529eda81053d72
refs/heads/main
2023-05-02T05:25:44.775670
2021-05-17T08:41:17
2021-05-17T08:41:17
366,906,003
0
0
null
null
null
null
UTF-8
Swift
false
false
456
swift
import UIKit /* ------------------------------< 浮点数 >------------------------------ */ let double_cl : Double = 3.14159265758123123 let float_cl : Float = 3.14159265758 /* Double表示64位浮点数 Float表示32位浮点数 Double的精度要比Float的精度高 两种类型都匹配的情况下,优先选择Double */ // ❌ SwiftGG官网上对Double的解释好像有问题,double_cl至少有16位,官网说是15位
[ -1 ]
2b94834c6881f5fbe8fc511dccc2111b1006da11
1e702ab4d4980e87c10afa2596e357956217f09a
/LeetCode-Swift/LeetCode/DP/Problem64.swift
7eec614da091a190c772357c1a21ded5064e4f0e
[]
no_license
cxjwin/algorithms
2154e536197e08b38c9d0653ceb3b432c70f6da6
cc6a0e3f3320a25c003f9e4441ed8dcd19b39a73
refs/heads/master
2021-07-05T05:32:20.604221
2020-11-13T00:09:19
2020-11-13T00:09:19
200,500,935
0
0
null
null
null
null
UTF-8
Swift
false
false
844
swift
// // Problem64.swift // LeetCode // // Created by smart on 2019/10/6. // Copyright © 2019 smart. All rights reserved. // /// https://leetcode.com/problems/minimum-path-sum/ public class Problem64: Problem { public func minPathSum(_ grid: [[Int]]) -> Int { if grid.count == 0 || grid[0].count == 0 { return 0 } let m = grid.count let n = grid[0].count var d = [Int](repeating: 0, count: n) d[0] = grid[0][0] for j in 1..<n { d[j] = d[j-1] + grid[0][j] } for i in 1..<m { d[0] = (d[0] + grid[i][0]) for j in 1..<n { // d[j] -> up, d[j-1] -> left d[j] = min(d[j], d[j-1]) + grid[i][j] } } return d[n-1] } }
[ -1 ]
10a0fef280223c63881b6796d62e98746222d9e0
d81399e8ada47a96c9678244d873068f3f55e59c
/HiPart/Presentation/UI/Home/Search/Detail/SearchDetailViewController.swift
d06e7a3e5865156cc2e20411fdcf15164d603eb5
[]
no_license
project-hipart/HiPart_IOS
a51ac9ad3636fd80772de1963f95de0ce3e69957
3dcfd42128d0abe3bd055a90854c392400594f45
refs/heads/master
2020-06-10T17:13:25.186053
2019-07-16T07:15:53
2019-07-16T07:15:53
193,687,498
0
3
null
2019-07-11T06:20:04
2019-06-25T10:34:41
Swift
UTF-8
Swift
false
false
4,050
swift
import UIKit import Hero class SearchDetailViewController: UIViewController { var keyword : String = "" private var viewModel = SearchDetailViewModel() @IBOutlet var collectionView: UICollectionView! @IBOutlet var notFoundImageView: UIImageView! @IBOutlet var notFoundBigLabel: UILabel! @IBOutlet var notFoundSmallLabel: UILabel! @IBOutlet var notFoundView: UIView! @IBOutlet var tabLayout: TabLayout! @IBOutlet var searchTextField: SearchTextField! } //MARK: Lifecycle extension SearchDetailViewController{ override func viewDidLoad() { super.viewDidLoad() debugE(#function) setupView() setupBinding() viewModel.loadDatas(keyword: keyword) } } //MARK: ViewModel Delegate extension SearchDetailViewController : SearchDetailViewModelDelegate{ func onChangeProfiles(profiles: [ProfileDTO]) { self.collectionView.reloadData() } } //MARK: Setup extension SearchDetailViewController{ private func setupBinding(){ self.viewModel.delegate = self } private func setupView(){ collectionView.register( UINib(nibName: "SearchCollectionViewCell", bundle: nil), forCellWithReuseIdentifier: String(describing: SearchCollectionViewCell.self) ) let layout = UICollectionViewFlowLayout() layout.sectionInset = UIEdgeInsets( top : 10 , left : 10 , bottom : 10 , right : 10) layout.minimumLineSpacing = 20 layout.minimumInteritemSpacing = 0 layout.itemSize = CGSize(width: 325.adjustedWidth , height : 171 ) collectionView.collectionViewLayout = layout self.notFoundSmallLabel.setLineHeight(lineHeight: 1.8) self.tabLayout.delegate = self self.searchTextField.text = keyword } } extension SearchDetailViewController : TabLayoutDelegate{ func onSelectedTab(_ index: Int) { viewModel.changeTypeFilter(UserType(rawValue: index)!) } } //MARK: CollectionView extension SearchDetailViewController : UICollectionViewDelegate{ func scrollViewDidScroll(_ scrollView: UIScrollView) { let offsetY = scrollView.contentOffset.y if offsetY < 0{ // adjustHeaderViewCollapsingProgress(progress: 0) }else{ if offsetY < 250{ // adjustHeaderViewCollapsingProgress(progress: min(1.0, offsetY/200)) } } } } //MARK: DataSource extension SearchDetailViewController : UICollectionViewDataSource{ func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return viewModel.profiles.count } func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let profile = viewModel.profiles[indexPath.row] if let cell = collectionView.dequeueReusableCell(withReuseIdentifier: String(describing: SearchCollectionViewCell.self) , for: indexPath) as? SearchCollectionViewCell{ cell.setProfile(profile: profile) cell.thumbnailView.hero.id = "HEROHERO\(indexPath.row)" return cell }else{ fatalError() } } func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { let item = viewModel.profiles[indexPath.row] if let cell = collectionView.cellForItem(at: indexPath) as? SearchCollectionViewCell{ self.navigateDetailViewController(myProfile: false, type: item.type, nickname: item.nickname, imageViewHeroId: cell.thumbnailView.hero.id ?? "", profileImage: cell.thumbnailView.image) } } } //MARK: Action extension SearchDetailViewController{ @IBAction func tapBackButton(_ sender: Any) { self.hero.dismissViewController() } @IBAction func screenEdgePanGestureRecognizer(_ sender: UIScreenEdgePanGestureRecognizer) { let x = sender.translation(in: self.view).x let screenWidth = UIScreen.main.bounds.width switch sender.state{ case .began: self.hero.dismissViewController() case .changed: Hero.shared.update(x/screenWidth) case .cancelled: Hero.shared.cancel() case .ended: if x > screenWidth * 0.5{ Hero.shared.finish(animate: true) }else{ Hero.shared.cancel(animate: true) } default: break } } }
[ -1 ]
7a89bfbfd51ba3e3726437cabb58747810a5f201
88cbb6f845315034538f89ed959c5e4bc7a3dfaa
/Flix/SceneDelegate.swift
9f2660b043e7808f829a158f81ba80647b722d93
[]
no_license
DumplingSociety/iOS-Unit1-Flix
824ab9f33fa2f02890103f7e18f6ed4705f9bee4
80b85358652aa57d04ccebfcf64be86339cf2ed4
refs/heads/main
2023-03-01T15:29:52.088688
2021-02-06T00:12:19
2021-02-06T00:12:19
null
0
0
null
null
null
null
UTF-8
Swift
false
false
2,285
swift
// // SceneDelegate.swift // Flix // // Created by Xiangwei Li on 1/27/21. // import UIKit class SceneDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow? func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). guard let _ = (scene as? UIWindowScene) else { return } } func sceneDidDisconnect(_ scene: UIScene) { // Called as the scene is being released by the system. // This occurs shortly after the scene enters the background, or when its session is discarded. // Release any resources associated with this scene that can be re-created the next time the scene connects. // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead). } func sceneDidBecomeActive(_ scene: UIScene) { // Called when the scene has moved from an inactive state to an active state. // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. } func sceneWillResignActive(_ scene: UIScene) { // Called when the scene will move from an active state to an inactive state. // This may occur due to temporary interruptions (ex. an incoming phone call). } func sceneWillEnterForeground(_ scene: UIScene) { // Called as the scene transitions from the background to the foreground. // Use this method to undo the changes made on entering the background. } func sceneDidEnterBackground(_ scene: UIScene) { // Called as the scene transitions from the foreground to the background. // Use this method to save data, release shared resources, and store enough scene-specific state information // to restore the scene back to its current state. } }
[ 393221, 163849, 393228, 393231, 393251, 352294, 344103, 393260, 393269, 213049, 376890, 385082, 393277, 376906, 327757, 254032, 368728, 180314, 254045, 180322, 376932, 286833, 286845, 286851, 417925, 262284, 360598, 286880, 377003, 377013, 164029, 327872, 180418, 377030, 377037, 377047, 418008, 418012, 377063, 327915, 205037, 393457, 393461, 393466, 418044, 385281, 336129, 262405, 180491, 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, 393613, 262551, 262553, 385441, 385444, 262567, 385452, 262574, 393649, 385460, 262587, 344512, 262593, 360917, 369119, 328178, 328180, 328183, 328190, 254463, 328193, 164362, 328207, 410129, 393748, 262679, 377372, 188959, 385571, 377384, 197160, 33322, 352822, 270905, 197178, 418364, 188990, 369224, 385610, 270922, 352844, 385617, 352865, 262761, 352875, 344694, 352888, 336513, 377473, 385671, 148106, 213642, 377485, 352919, 98969, 344745, 361130, 336556, 385714, 434868, 164535, 336568, 164539, 328379, 328387, 352969, 344777, 418508, 385743, 385749, 139998, 189154, 369382, 361196, 418555, 344832, 336644, 344837, 344843, 328462, 361231, 394002, 336660, 418581, 418586, 434971, 369436, 262943, 369439, 418591, 418594, 336676, 418600, 418606, 369464, 361274, 328516, 336709, 328520, 336712, 361289, 328523, 336715, 361300, 213848, 426842, 361307, 197469, 361310, 254813, 361318, 344936, 361323, 361335, 328574, 369544, 361361, 222129, 345036, 115661, 386004, 345046, 386012, 386019, 386023, 328690, 435188, 328703, 328710, 418822, 377867, 328715, 361490, 386070, 271382, 336922, 345119, 377888, 214060, 345134, 345139, 361525, 386102, 361537, 377931, 345172, 189525, 156762, 402523, 361568, 148580, 345200, 361591, 386168, 361594, 410746, 214150, 345224, 386187, 345247, 361645, 345268, 402615, 361657, 337093, 402636, 328925, 165086, 66783, 165092, 328933, 222438, 328942, 386286, 386292, 206084, 328967, 345377, 345380, 353572, 345383, 263464, 337207, 345400, 378170, 369979, 386366, 337224, 337230, 337235, 263509, 353634, 337252, 402792, 271731, 378232, 337278, 271746, 181639, 353674, 181644, 361869, 181650, 181655, 230810, 181671, 181674, 181679, 181682, 337330, 181687, 370105, 181691, 181697, 361922, 337350, 181704, 337366, 271841, 329192, 361961, 329195, 116211, 337399, 402943, 337416, 329227, 419341, 419345, 329234, 419351, 345626, 419357, 345631, 419360, 370208, 394787, 419363, 370214, 419369, 394796, 419377, 419386, 206397, 214594, 419401, 353868, 419404, 173648, 419408, 214611, 419412, 403040, 345702, 222831, 370298, 353920, 403073, 403076, 345737, 198282, 403085, 403092, 345750, 419484, 345758, 345763, 419492, 345766, 419498, 419502, 370351, 419507, 337588, 419510, 419513, 419518, 337601, 403139, 337607, 419528, 419531, 419536, 272083, 394967, 419543, 419545, 345819, 419548, 419551, 345829, 419560, 337643, 419564, 337647, 370416, 337671, 362249, 362252, 395022, 362256, 321300, 345888, 362274, 378664, 354107, 345916, 354112, 370504, 329545, 345932, 370510, 354132, 247639, 337751, 370520, 313181, 182110, 354143, 354157, 345965, 345968, 345971, 345975, 403321, 1914, 354173, 395148, 247692, 337809, 247701, 329625, 436127, 436133, 247720, 337834, 362414, 337845, 190393, 346059, 247760, 346064, 346069, 419810, 329699, 354275, 190440, 354314, 346140, 436290, 395340, 378956, 436307, 338005, 100454, 329833, 329853, 329857, 329868, 411806, 329886, 346273, 362661, 100525, 387250, 379067, 387261, 256193, 395467, 346317, 411862, 256214, 411865, 411869, 411874, 379108, 411877, 387303, 346344, 395496, 338154, 387307, 346350, 338161, 387314, 436474, 321787, 379135, 411905, 411917, 379154, 395539, 387350, 387353, 338201, 182559, 338212, 395567, 248112, 362823, 436556, 321880, 362844, 379234, 354674, 321911, 420237, 379279, 272787, 354728, 338353, 338382, 272849, 248279, 256474, 182755, 338404, 338411, 330225, 248309, 248332, 330254, 199189, 420377, 330268, 191012, 330320, 199250, 191069, 346722, 248427, 191085, 338544, 346736, 191093, 346743, 346769, 150184, 174775, 248505, 174778, 363198, 223936, 355025, 273109, 355029, 264919, 256735, 338661, 264942, 363252, 338680, 264965, 338701, 256787, 363294, 199455, 396067, 346917, 396070, 215854, 355123, 355141, 355144, 338764, 355151, 330581, 330585, 387929, 355167, 265056, 265059, 355176, 355180, 355185, 412600, 207809, 379849, 347082, 396246, 330711, 248794, 248799, 437219, 257009, 265208, 265215, 199681, 338951, 330761, 330769, 330775, 248863, 158759, 396329, 347178, 404526, 396337, 330803, 396340, 339002, 388155, 339010, 347208, 248905, 330827, 248915, 183384, 339037, 412765, 257121, 322660, 265321, 248952, 420985, 330886, 330890, 347288, 248986, 44199, 380071, 339118, 249018, 339133, 126148, 322763, 330959, 330966, 265433, 265438, 388320, 363757, 388348, 339199, 396552, 175376, 175397, 273709, 372016, 437553, 347442, 199989, 175416, 396601, 208189, 437567, 175425, 437571, 126279, 437576, 437584, 331089, 437588, 331094, 396634, 175451, 437596, 429408, 175458, 175461, 175464, 265581, 331124, 175478, 249210, 175484, 175487, 249215, 175491, 249219, 249225, 249228, 249235, 175514, 175517, 396703, 396706, 175523, 355749, 396723, 388543, 380353, 216518, 380364, 339406, 372177, 339414, 249303, 413143, 339418, 339421, 249310, 339425, 249313, 339429, 339435, 249329, 69114, 372229, 208399, 380433, 175637, 405017, 134689, 339504, 265779, 421442, 413251, 265796, 265806, 224854, 224858, 339553, 257636, 224871, 372328, 257647, 372338, 224885, 224888, 224891, 224895, 372354, 126597, 421509, 224905, 11919, 224911, 224914, 126611, 224917, 224920, 126618, 208539, 224923, 224927, 224930, 224933, 257705, 224939, 224943, 257713, 224949, 257717, 257721, 224954, 257725, 224960, 257733, 224966, 224970, 257740, 224976, 257745, 339664, 257748, 224982, 257752, 224987, 257762, 224996, 225000, 225013, 257788, 225021, 339711, 257791, 225027, 257796, 339722, 257802, 257805, 225039, 257808, 249617, 225044, 167701, 372500, 257815, 225049, 257820, 225054, 184096, 397089, 257825, 225059, 339748, 225068, 257837, 413485, 225071, 225074, 257843, 225077, 257846, 225080, 397113, 225083, 397116, 257853, 225088, 225094, 225097, 257869, 257872, 225105, 397140, 225109, 225113, 257881, 257884, 257887, 225120, 257891, 413539, 225128, 257897, 339818, 225138, 339827, 257909, 225142, 372598, 257914, 257917, 225150, 257922, 380803, 225156, 339845, 257927, 225166, 397201, 225171, 380823, 225176, 225183, 372698, 372704, 372707, 356336, 380919, 393215, 372739, 405534, 266295, 266298, 217158, 421961, 200786, 356440, 217180, 430181, 266351, 356467, 266365, 192640, 266375, 381069, 225425, 250003, 225430, 250008, 356507, 250012, 225439, 135328, 192674, 225442, 438434, 225445, 438438, 225448, 438441, 356521, 225451, 258223, 225456, 430257, 225459, 225462, 225468, 389309, 225472, 372931, 225476, 430275, 389322, 225485, 225488, 225491, 266454, 225494, 225497, 225500, 225503, 225506, 356580, 225511, 217319, 225515, 225519, 381177, 397572, 389381, 381212, 356638, 356641, 356644, 356647, 266537, 389417, 356650, 356656, 332081, 307507, 340276, 356662, 397623, 332091, 225599, 201030, 348489, 332107, 151884, 430422, 348503, 332118, 250201, 250203, 250211, 340328, 250217, 348523, 348528, 332153, 356734, 389503, 332158, 438657, 332162, 389507, 348548, 356741, 250239, 332175, 160152, 373146, 340380, 373149, 70048, 356783, 373169, 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, 258723, 332455, 332460, 389806, 332464, 332473, 381626, 332484, 332487, 332494, 357070, 357074, 332512, 332521, 340724, 332534, 373499, 348926, 389927, 348979, 152371, 348983, 340792, 398141, 357202, 389971, 357208, 389979, 430940, 357212, 357215, 439138, 201580, 201583, 349041, 340850, 381815, 430967, 324473, 398202, 119675, 340859, 324476, 430973, 324479, 340863, 324482, 373635, 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, 357411, 250915, 250917, 169002, 357419, 209966, 209969, 209973, 209976, 209980, 209988, 209991, 431180, 209996, 341072, 349268, 177238, 250968, 210011, 373853, 341094, 210026, 210028, 210032, 349296, 210037, 210042, 210045, 349309, 152704, 349313, 160896, 210053, 210056, 349320, 259217, 373905, 210068, 210072, 210078, 210081, 210085, 210089, 210096, 210100, 324792, 210108, 357571, 210116, 210128, 210132, 333016, 210139, 210144, 218355, 218361, 275709, 128254, 275713, 242947, 275717, 275723, 333075, 349460, 333079, 251161, 349486, 349492, 415034, 210261, 365912, 259423, 374113, 251236, 374118, 333164, 234867, 390518, 357756, 374161, 112021, 349591, 357793, 333222, 259516, 415168, 366035, 415187, 366039, 415192, 415194, 415197, 415200, 333285, 415208, 366057, 366064, 415217, 415225, 423424, 415258, 415264, 366118, 415271, 382503, 349739, 144940, 415279, 415282, 415286, 210488, 415291, 415295, 349762, 333396, 374359, 333400, 366173, 423529, 423533, 210547, 415354, 333440, 267910, 267929, 333512, 259789, 366301, 333535, 153311, 366308, 366312, 431852, 399086, 366319, 210673, 366322, 399092, 366326, 333566, 268042, 210700, 366349, 210707, 399129, 333595, 210720, 366384, 358192, 210740, 366388, 358201, 325441, 366403, 325447, 341831, 341835, 341839, 341844, 415574, 358235, 341852, 350046, 399200, 399208, 268144, 358256, 358260, 341877, 399222, 325494, 333690, 325505, 333699, 399244, 333709, 333725, 333737, 382891, 382898, 350153, 358348, 333777, 219094, 399318, 358372, 350190, 350194, 333819, 350204, 350207, 325633, 325637, 350214, 219144, 268299, 333838, 350225, 186388, 350232, 333851, 350238, 350241, 374819, 350245, 350249, 350252, 178221, 350257, 350260, 350272, 243782, 350281, 350286, 374865, 342113, 252021, 342134, 374904, 268435, 333998, 334012, 260299, 350411, 350417, 350423, 211161, 350426, 350449, 375027, 358645, 350459, 350462, 350465, 350469, 268553, 350477, 268560, 350481, 432406, 350487, 325915, 350491, 325918, 350494, 325920, 350500, 194854, 350505, 358701, 391469, 350510, 358705, 358714, 358717, 383307, 358738, 334162, 383331, 383334, 391531, 383342, 334204, 268669, 194942, 391564, 366991, 334224, 268702, 342431, 375209, 375220, 334263, 326087, 358857, 195041, 334312, 104940, 375279, 416255, 350724, 186898, 342546, 350740, 342551, 334359, 342555, 334364, 416294, 350762, 252463, 358962, 334386, 334397, 358973, 252483, 219719, 399957, 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, 326417, 375572, 375575, 375580, 162592, 334633, 326444, 383794, 326452, 326455, 375613, 244542, 260925, 375616, 326463, 326468, 342857, 326474, 326479, 326486, 416599, 342875, 244572, 326494, 433001, 400238, 326511, 211826, 211832, 392061, 351102, 359296, 252801, 260993, 351105, 400260, 211846, 342921, 342931, 252823, 400279, 392092, 400286, 252838, 359335, 211885, 252846, 400307, 351169, 359362, 351172, 170950, 187335, 326599, 359367, 359383, 359389, 383968, 343018, 359411, 261109, 261112, 244728, 383999, 261130, 261148, 359452, 211999, 261155, 261160, 261166, 359471, 375868, 343132, 384099, 384102, 384108, 367724, 187503, 343155, 384115, 212095, 351366, 384136, 384140, 384144, 351382, 384152, 384158, 384161, 351399, 384169, 367795, 244917, 384182, 367801, 384189, 384192, 351424, 343232, 367817, 244938, 384202, 253132, 326858, 384209, 146644, 351450, 384225, 359650, 343272, 351467, 359660, 384247, 351480, 384250, 351483, 351492, 343307, 384270, 359695, 261391, 253202, 261395, 384276, 384284, 245021, 384290, 253218, 245032, 171304, 384299, 351535, 376111, 245042, 326970, 384324, 343366, 212296, 212304, 367966, 343394, 367981, 343410, 155000, 327035, 245121, 245128, 253321, 155021, 384398, 245137, 245143, 245146, 245149, 343453, 245152, 245155, 155045, 245158, 40358, 245163, 114093, 327090, 343478, 359867, 384444, 146878, 327108, 327112, 384457, 359887, 359891, 368093, 155103, 343535, 343540, 368120, 343545, 409092, 253445, 359948, 359951, 245295, 359984, 343610, 400977, 400982, 179803, 155241, 245358, 155255, 155274, 368289, 245410, 425639, 425652, 425663, 155328, 245463, 155352, 155356, 212700, 155364, 245477, 155372, 245487, 212723, 409336, 155394, 155404, 245528, 155423, 360224, 155439, 204592, 155444, 155448, 417596, 384829, 384831, 360262, 155463, 155477, 376665, 155484, 261982, 425823, 155488, 376672, 155492, 327532, 261997, 376686, 262000, 262003, 425846, 262006, 147319, 262009, 327542, 262012, 155517, 155523, 155526, 360327, 376715, 155532, 262028, 262031, 262034, 262037, 262040, 262043, 155550, 253854, 262046, 262049, 262052, 327590, 155560, 155563, 155566, 327613, 393152, 311244, 393170, 155604, 155620, 253924, 155622, 253927, 327655, 360432, 393204, 360439, 253944, 393209, 155647 ]
5d9e878ff09af339cbf40b83577d8d3e30f860cc
1b02f69d33d2fc39ad9e6fdc70aeea9f8c41a45e
/Alarm/Model/DateHelper.swift
962fe3d8b32015ada9b6be66431cda52c69b9625
[]
no_license
TeaDoan/Alarm
c59a0ca8939ad8a28c722a3456307324821d6411
c4139516a835c8c6a9f43e16ddc8227474d9f375
refs/heads/master
2020-03-23T18:48:09.917918
2018-07-22T21:34:41
2018-07-22T21:34:41
141,932,348
0
0
null
null
null
null
UTF-8
Swift
false
false
601
swift
// // DateHelper.swift // Alarm // // Created by James Pacheco on 5/9/16. // Copyright © 2016 DevMountain. All rights reserved. // import Foundation enum DateHelper { static var thisMorningAtMidnight: Date? { let calendar = Calendar.current let now = Date() return calendar.date(bySettingHour: 0, minute: 0, second: 0, of: now) } static var tomorrowMorningAtMidnight: Date? { let calendar = Calendar.current guard let thisMorningAtMidnight = thisMorningAtMidnight else { return nil } return calendar.date(byAdding: .day, value: 1, to: thisMorningAtMidnight) } }
[ -1 ]
89a650e74d9947651e137af73532eb01c82eb73d
440027b60fe327f3d44c6e0a2552aab6c0aebcc9
/ZGYM/ZGYM/YXSModule/YXSPhotos/Controller/YXSPhotoClassPhotoAlbumListController.swift
73af6f75d03320eb355acfd5f6230b2cacd61f41
[]
no_license
syhouse/zgym
d9f6ee90455a304ec59914328b5ff5341a5f505e
3a5c0e70c3e405a3c699b24db1a46525cf305ca7
refs/heads/master
2022-11-07T21:10:07.875331
2020-06-24T09:54:18
2020-06-24T09:54:18
249,916,913
0
1
null
null
null
null
UTF-8
Swift
false
false
8,693
swift
// // YXSPhotoClassPhotoAlbumListController.swift // ZGYM // // Created by sy_mac on 2020/2/27. // Copyright © 2020 hmym. All rights reserved. // import UIKit import NightNight import ObjectMapper /// 相册列表 class YXSPhotoClassPhotoAlbumListController: YXSBaseCollectionViewController, UICollectionViewDelegateFlowLayout { var dataSource: [YXSPhotoAlbumsModel] = [YXSPhotoAlbumsModel]() var messageInfo: YXSPhotoClassPhotoAlbumListMsgModel? let classId: Int init(classId: Int) { self.classId = classId super.init() let layout = UICollectionViewFlowLayout() layout.minimumLineSpacing = 20 layout.minimumInteritemSpacing = 6 layout.sectionInset = UIEdgeInsets.init(top: 20, left: 15, bottom: 0, right: 15) let itemW = (SCREEN_WIDTH - CGFloat(15*2) - CGFloat(2*6))/3 layout.itemSize = CGSize.init(width: itemW, height: itemW + 49.5) self.layout = layout } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } override func viewDidLoad() { super.viewDidLoad() self.title = "班级相册" collectionView.register(YXSPhotoAlbumsListCell.self, forCellWithReuseIdentifier: "YXSPhotoAlbumsListCell") collectionView.register(YXSFriendsCircleMessageView.classForCoder(), forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: "YXSFriendsCircleMessageView") } override func yxs_refreshData() { self.currentPage = 1 yxs_loadData() } override func yxs_loadNextPage() { yxs_loadData() } func yxs_loadData() { YXSEducationAlbumPagequeryRequest.init(classId: classId, currentPage: currentPage).request({ [weak self](result) in guard let weakSelf = self else {return} weakSelf.yxs_endingRefresh() weakSelf.messageInfo = Mapper<YXSPhotoClassPhotoAlbumListMsgModel>().map(JSONObject: result["messageInfo"].object) if weakSelf.currentPage == 1{ weakSelf.dataSource.removeAll() } let list = Mapper<YXSPhotoAlbumsModel>().mapArray(JSONObject: result["classAlbumList"].object) ?? [YXSPhotoAlbumsModel]() weakSelf.dataSource += list if list.count != 0 && YXSPersonDataModel.sharePerson.personRole == .TEACHER{ let createAlbums = YXSPhotoAlbumsModel.init(JSON: ["": ""]) createAlbums?.isSystemCreateItem = true weakSelf.dataSource.insert(createAlbums!, at: 0) } weakSelf.loadMore = result["hasNext"].boolValue weakSelf.collectionView.reloadData() }) { (msg, code) in self.yxs_endingRefresh() MBProgressHUD.yxs_showMessage(message: msg) } } // MARK: - public public func updateCover(cover: String, albumId: Int){ for model in dataSource{ if model.id == albumId{ model.coverUrl = cover break } } collectionView.reloadData() } // MARK: - Action /// 创建相册 @objc func createAlbumClick() { let vc = YXSPhotoCreateAlbumController(classId: classId) vc.changeAlbumBlock = { [weak self] in guard let strongSelf = self else { return } strongSelf.yxs_refreshData() } self.navigationController?.pushViewController(vc) } /// 删除相册 /// - Parameter albumModel: 相册modle func removeAlbum(albumModel:YXSPhotoAlbumsModel){ let index = dataSource.firstIndex(of: albumModel) if let index = index{ dataSource.remove(at: index) collectionView.reloadData() } } /// 新消息按钮点击 @objc func newMessageClick(sender: YXSButton) { } // MARK: - tableViewDelegate override func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return dataSource.count } override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "YXSPhotoAlbumsListCell", for: indexPath) as! YXSPhotoAlbumsListCell cell.setCellModel(self.dataSource[indexPath.row]) return cell } func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { let model = self.dataSource[indexPath.row] if model.isSystemCreateItem{ createAlbumClick() }else{ let vc = YXSPhotoAlbumDetialListController.init(albumModel: model) vc.title = model.albumName vc.updateAlbumModel = {[weak self](albumModel) in guard let strongSelf = self else { return } strongSelf.dataSource[indexPath.row] = albumModel strongSelf.collectionView.reloadItems(at: [indexPath]) } self.navigationController?.pushViewController(vc) } } override func emptyDataSetShouldDisplay(_ scrollView: UIScrollView) -> Bool { return showEmptyDataSource } override func customView(forEmptyDataSet scrollView: UIScrollView) -> UIView? { let view = SLBaseEmptyView() view.frame = self.view.frame view.imageView.mixedImage = MixedImage(normal: "yxs_photo_nodata", night: "yxs_photo_nodata") if YXSPersonDataModel.sharePerson.personRole == .TEACHER { view.label.text = "你还没有创建过相册哦" view.button.isHidden = false view.button.setTitle("新建相册", for: .normal) view.button.setTitleColor(UIColor.white, for: .normal) view.button.titleLabel?.font = UIFont.systemFont(ofSize: 18) view.button.addTarget(self, action: #selector(createAlbumClick), for: .touchUpInside) view.button.yxs_gradualBackground(frame: CGRect.init(x: 0, y: 0, width: 230, height: 49), startColor: UIColor.yxs_hexToAdecimalColor(hex: "#4B73F6"), endColor: UIColor.yxs_hexToAdecimalColor(hex: "#77A3F8"), cornerRadius: 24.5) view.button.yxs_shadow(frame: CGRect.init(x: 0, y: 0, width: 230, height: 49), color: UIColor(red: 0.3, green: 0.45, blue: 0.96, alpha: 0.5), cornerRadius: 24.5, offset: CGSize(width: 0, height: 3)) view.button.snp.updateConstraints { (make) in make.size.equalTo(CGSize.init(width: 230, height: 49)) } view.button.cornerRadius = 24.5 } else { view.label.text = "老师还没有上传照片哦" view.button.isHidden = true } return view } // MARK: - Header Footer func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForHeaderInSection section: Int) -> CGSize { if messageInfo?.messageCount ?? 0 > 0 { return CGSize(width: SCREEN_WIDTH, height: 50) } else { return CGSize.zero } } func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView { if kind == UICollectionView.elementKindSectionHeader { let header: YXSFriendsCircleMessageView = collectionView.dequeueReusableSupplementaryView(ofKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: "YXSFriendsCircleMessageView", for: indexPath) as! YXSFriendsCircleMessageView header.setMessageTipsModel(messageModel: messageInfo) return header } return UICollectionReusableView() } } extension YXSPhotoClassPhotoAlbumListController: YXSRouterEventProtocol{ func yxs_user_routerEventWithName(eventName: String, info: [String : Any]?){ switch eventName { case kFriendsCircleMessageViewGoMessageEvent: let vc = YXSCommonMessageListController.init(photoClassId: classId) vc.loadSucess = { [weak self] in guard let strongSelf = self else { return } strongSelf.messageInfo = nil strongSelf.collectionView.reloadData() } self.navigationController?.pushViewController(vc) break default: print("") } } }
[ -1 ]
66a3ea8199a85ace5920d531bec98a2bc3e53d84
14143d34daa48300abb56153d466c8f2215087ca
/GantiAndro/Sources/FloatyItem.swift
6d26fa0e23d8e39e9924226b87e45d291b72e43c
[]
no_license
SwiftyCodes/GantiAndro
83a8567ed815a97f323f10a11be43ff7a42c6556
15c5a90a05998494a64f5341b843347ba4eafcd1
refs/heads/master
2021-04-27T04:39:10.831644
2018-02-23T06:44:29
2018-02-23T06:44:29
122,583,502
0
0
null
null
null
null
UTF-8
Swift
false
false
7,446
swift
import UIKit public enum FloatyItemLabelPositionType { case left case right } /** Floating Action Button Object's item. */ open class FloatyItem: UIView { // MARK: - Properties /** This object's button size. */ open var size: CGFloat = 42 { didSet { self.frame = CGRect(x: 0, y: 0, width: size, height: size) titleLabel.frame.origin.y = self.frame.height/2-titleLabel.frame.size.height/2 _iconImageView?.center = CGPoint(x: size/2, y: size/2) + imageOffset self.setNeedsDisplay() } } /** Button color. */ open var buttonColor: UIColor = UIColor.white /** Title label color. */ open var titleColor: UIColor = UIColor.white { didSet { titleLabel.textColor = titleColor } } /** Circle Shadow color. */ open var circleShadowColor: UIColor = UIColor.black /** Title Shadow color. */ open var titleShadowColor: UIColor = UIColor.black /** If you touch up inside button, it execute handler. */ open var handler: ((FloatyItem) -> Void)? = nil open var imageOffset: CGPoint = CGPoint.zero open var imageSize: CGSize = CGSize(width: 25, height: 25) { didSet { _iconImageView?.frame = CGRect(x: 0, y: 0, width: imageSize.width, height: imageSize.height) } } /** Reference to parent */ open weak var actionButton: Floaty? /** Shape layer of button. */ fileprivate var circleLayer: CAShapeLayer = CAShapeLayer() /** If you keeping touch inside button, button overlaid with tint layer. */ fileprivate var tintLayer: CAShapeLayer = CAShapeLayer() /** Item's title label position. deafult is left */ open var titleLabelPosition: FloatyItemLabelPositionType = .left /** Item's title label. */ var _titleLabel: UILabel? = nil open var titleLabel: UILabel { get { if _titleLabel == nil { _titleLabel = UILabel() _titleLabel?.textColor = titleColor addSubview(_titleLabel!) } return _titleLabel! } } /** Item's title. */ open var title: String? = nil { didSet { titleLabel.text = title titleLabel.sizeToFit() if(titleLabelPosition == .left) { titleLabel.frame.origin.x = -titleLabel.frame.size.width - 10 } else { //titleLabel will be on right titleLabel.frame.origin.x = iconImageView.frame.origin.x + iconImageView.frame.size.width + 20 } titleLabel.frame.origin.y = self.size/2-titleLabel.frame.size.height/2 } } /** Item's icon image view. */ var _iconImageView: UIImageView? = nil open var iconImageView: UIImageView { get { if _iconImageView == nil { _iconImageView = UIImageView(frame: CGRect(x: 0, y: 0, width: imageSize.width, height: imageSize.height)) _iconImageView?.center = CGPoint(x: size/2, y: size/2) + imageOffset _iconImageView?.contentMode = UIViewContentMode.scaleAspectFill addSubview(_iconImageView!) } return _iconImageView! } } /** Item's icon. */ open var icon: UIImage? = nil { didSet { iconImageView.image = icon } } /** Item's icon tint color change */ open var iconTintColor: UIColor! = nil { didSet { let image = iconImageView.image?.withRenderingMode(.alwaysTemplate) _iconImageView?.tintColor = iconTintColor _iconImageView?.image = image } } /** itemBackgroundColor change */ public var itemBackgroundColor: UIColor? = nil { didSet { circleLayer.backgroundColor = itemBackgroundColor?.cgColor } } // MARK: - Initialize /** Initialize with default property. */ public init() { super.init(frame: CGRect(x: 0, y: 0, width: size, height: size)) backgroundColor = UIColor.clear } required public init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) } /** Set size, frame and draw layers. */ open override func draw(_ rect: CGRect) { super.draw(rect) self.layer.shouldRasterize = true self.layer.rasterizationScale = UIScreen.main.scale createCircleLayer() setShadow() if _titleLabel != nil { bringSubview(toFront: _titleLabel!) } if _iconImageView != nil { bringSubview(toFront: _iconImageView!) } } fileprivate func createCircleLayer() { // circleLayer.frame = CGRectMake(frame.size.width - size, 0, size, size) let castParent : Floaty = superview as! Floaty circleLayer.frame = CGRect(x: castParent.itemSize/2 - (size/2), y: 0, width: size, height: size) circleLayer.backgroundColor = buttonColor.cgColor circleLayer.cornerRadius = size/2 layer.addSublayer(circleLayer) } fileprivate func createTintLayer() { // tintLayer.frame = CGRectMake(frame.size.width - size, 0, size, size) let castParent : Floaty = superview as! Floaty tintLayer.frame = CGRect(x: castParent.itemSize/2 - (size/2), y: 0, width: size, height: size) tintLayer.backgroundColor = UIColor.white.withAlphaComponent(0.2).cgColor tintLayer.cornerRadius = size/2 layer.addSublayer(tintLayer) } fileprivate func setShadow() { circleLayer.shadowOffset = CGSize(width: 1, height: 1) circleLayer.shadowRadius = 2 circleLayer.shadowColor = circleShadowColor.cgColor circleLayer.shadowOpacity = 0.4 titleLabel.layer.shadowOffset = CGSize(width: 1, height: 1) titleLabel.layer.shadowRadius = 2 titleLabel.layer.shadowColor = titleShadowColor.cgColor titleLabel.layer.shadowOpacity = 0.4 } open override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) { if touches.count == 1 { let touch = touches.first if touch?.tapCount == 1 { if touch?.location(in: self) == nil { return } createTintLayer() } } } open override func touchesMoved(_ touches: Set<UITouch>, with event: UIEvent?) { if touches.count == 1 { let touch = touches.first if touch?.tapCount == 1 { if touch?.location(in: self) == nil { return } createTintLayer() } } } open override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) { tintLayer.removeFromSuperlayer() if touches.count == 1 { let touch = touches.first if touch?.tapCount == 1 { if touch?.location(in: self) == nil { return } if actionButton != nil && actionButton!.autoCloseOnTap { actionButton!.close() } handler?(self) } } } } func + (left: CGPoint, right: CGPoint) -> CGPoint { return CGPoint(x: left.x + right.x, y: left.y + right.y) }
[ 178285 ]
d798b93b9fdfbb2fdcb252c4f0b9fd04543e0e84
9c453a75b732cf8e3cf5baa2faa8399cd0b2de90
/Connfa/Classes/Events/Program Details/ProgramDetailsSection.swift
17610686027d3e6399cb8ffab91ec43351de5ad4
[]
no_license
engsulta/connfa-ios
6861e64630d9a8fb4c21d1bcd445183dc0478153
a8fe47c52cef328408c09fee723a162068a13ff3
refs/heads/master
2020-07-27T04:21:13.531251
2019-03-01T14:29:44
2019-03-01T14:29:44
null
0
0
null
null
null
null
UTF-8
Swift
false
false
565
swift
// // ProgramDetailsSection.swift // Connfa // // Created by Marian Fedyk on 9/19/18. // Copyright © 2018 Lemberg Solution. All rights reserved. // import Foundation struct ProgramDetailsSection { enum SectionType { case logoSectionType case speakersAndWebAndTitleSectionType case sponsorsSectionType case interestedSectionType } var rowNumber: Int var type: SectionType init?(_ type: SectionType, rows: Int = 1){ if rows <= 0 { return nil } else { self.rowNumber = rows self.type = type } } }
[ -1 ]
c3d43b7612814d544b7a2c9bf7363ebc3f6cc42a
f8ab20e3b93f0d41fa0ec551691f61a08d9b78b4
/final-project-ios/Protocols/RecipeNotedListDelegate.swift
077d1b83b4e424514928eef95527235b207d8fcb
[]
no_license
wantonio/final-project-ios
f8bf8b53b3b9aaaa1771ff5c7485d3cd3ea2e5c5
840f2c728b5bb913cfc3d4a775d2bd1fa9057b74
refs/heads/main
2023-06-11T11:09:24.064736
2021-06-29T19:30:53
2021-06-29T19:30:53
379,125,230
0
0
null
2021-06-29T03:54:05
2021-06-22T03:01:54
Swift
UTF-8
Swift
false
false
282
swift
// // NoteListDelegate.swift // final-project-ios // // Created by Walter Calderon on 28/6/21. // import Foundation protocol RecipeNotedListDelegate { func addRecipeNoted(recipe: RecipeEntity) func updateRecipeNoted(recipe: RecipeEntity) func removeRecipeNoted() }
[ -1 ]
b55c55811b1a012be7aa1f12e0172d429ae39daf
31a5f3f2e72cd9df8c89c92711a20c1bab06ffae
/ResourceManager/Model/RMPort.swift
ed6612581b4c22265a991f53986e03257f21c1c6
[]
no_license
lizhihui0215/ResourceManager
03ac5632eb8edcc478f4c34eac7ac660a54f5f40
de3c73fb57363a40392d59305f2862c0e10eba3c
refs/heads/master
2021-01-18T03:48:52.072015
2018-05-31T03:47:16
2018-05-31T03:47:16
85,783,993
1
0
null
null
null
null
UTF-8
Swift
false
false
1,132
swift
// // RMPort.swift // ResourceManager // // Created by 李智慧 on 05/12/2017. // Copyright © 2017 北京海睿兴业. All rights reserved. // import ObjectMapper import RealmSwift import ObjectMapper_Realm import PCCWFoundationSwift class RMPort: RMModel, NSCopying { @objc dynamic var portType: String? = nil // dynamic var deviceName: String? @objc dynamic var deviceCode: String? = nil @objc dynamic var portName: String? = nil var links: List<RMLink> = List<RMLink>() required convenience init?(map: Map) { self.init() } override func mapping(map: Map) { super.mapping(map: map) deviceCode <- map["deviceCode"] portType <- map["portType"] portName <- map["portName"] links <- (map["links"], ListTransform<RMLink>()) } func copy(with zone: NSZone? = nil) -> Any { var JSONString: String? try? PFSRealm.realm.write { JSONString = self.toJSONString() } let copy = RMPort(JSONString: JSONString ?? "") copy?.uuid = self.uuid return copy ?? RMPort() } }
[ -1 ]
7fe03c9a73d22bf07f984f9b28d828193c2ff30a
d715c2e54548cee58c2388312c2a7d44f4c6ff1e
/Yaknak/Utils.swift
6c9b51cb0f86df62e390fa9e2969fafde5ad1393
[]
no_license
SvshX/Locals
b41a7806f6b5286330cc7f023d0408a3c43d5828
4789eaaa3ae91d681844341db4b154f0a87cfa36
refs/heads/master
2020-04-16T16:18:16.240509
2017-09-04T19:55:18
2017-09-04T19:55:18
165,731,128
1
0
null
null
null
null
UTF-8
Swift
false
false
1,963
swift
// // Utils.swift // Yaknak // // Created by Sascha Melcher on 13/07/2017. // Copyright © 2017 Locals Labs. All rights reserved. // import Foundation class Utils { static func containSameElements<T: Comparable>(_ array1: [T], _ array2: [T]) -> Bool { guard array1.count == array2.count else { return false // No need to sort if they already have different counts } return array1.sorted() == array2.sorted() } // Helper methods to determine radius static func determineRadius() -> Double? { return milesToKm(Double(SettingsManager.shared.defaultWalkingDuration) * 0.035) } static func milesToKm(_ miles: Double) -> Double { if miles > 0 { return miles * 1609.344 / 1000 } else { return 0 } } static func delay(withSeconds seconds: Double, completion: @escaping () -> ()) { DispatchQueue.main.asyncAfter(deadline: .now() + seconds) { completion() } } static func screenHeight() -> CGFloat { return UIScreen.main.bounds.height } // Redirect to enable location tracking in settings static func redirectToSettings() { guard let settingsUrl = URL(string: UIApplicationOpenSettingsURLString) else { return } if #available(iOS 10.0, *) { UIApplication.shared.open(settingsUrl as URL, options: [:], completionHandler: nil) } else { // Fallback on earlier versions if let settingsURL = URL(string: UIApplicationOpenSettingsURLString + Bundle.main.bundleIdentifier!) { UIApplication.shared.openURL(settingsURL as URL) } } } static func openMailClient() { let mailURL = URL(string: "message://")! if UIApplication.shared.canOpenURL(mailURL) { UIApplication.shared.openURL(mailURL) } } }
[ -1 ]
56fc51f221fb54d2a3f5db23d9a70f315aa0d777
5aad3ddf22d32e411651d18072021c0ceb6c2baa
/ScienceJournal/Analytics/AnalyticsEvent.swift
1ee1ffd87666b4f112310a10af832c7e13c357b7
[ "Apache-2.0" ]
permissive
conyconydev/science-journal-ios
0469a9d1e121b2fdb91db21c4d5909e82369f404
7c042178ceac3104e32c050669f88568c69064b3
refs/heads/master
2020-05-13T16:56:08.828812
2019-04-15T21:17:09
2019-04-15T21:17:10
null
0
0
null
null
null
null
UTF-8
Swift
false
false
9,165
swift
/* * Copyright 2019 Google Inc. 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 /// A struct for an Analytics Event which has a category and action, as well as an optional value /// and label. public struct AnalyticsEvent { // MARK: - Events // MARK: Claiming static let categoryClaimingData = "ClaimingData" static let claimAll = AnalyticsEvent(category: categoryClaimingData, action: "ClaimAll") static let claimingDeleteAll = AnalyticsEvent(category: categoryClaimingData, action: "DeleteAll") static let claimingSelectLater = AnalyticsEvent(category: categoryClaimingData, action: "SelectLater") static let claimingClaimSingle = AnalyticsEvent(category: categoryClaimingData, action: "ClaimSingle") static let claimingDeleteSingle = AnalyticsEvent(category: categoryClaimingData, action: "DeleteSingle") static let claimingSaveToFiles = AnalyticsEvent(category: categoryClaimingData, action: "SaveToFiles") static let claimingViewExperiment = AnalyticsEvent(category: categoryClaimingData, action: "ViewExperiment") static let claimingViewTrial = AnalyticsEvent(category: categoryClaimingData, action: "ViewTrial") static func claimingViewTrialNote(_ displayNote: DisplayNote) -> AnalyticsEvent { return AnalyticsEvent(category: categoryClaimingData, action: "ViewTrialNote", label: displayNote.noteType.analyticsLabel, value: displayNote.noteType.analyticsValue) } static func claimingViewNote(_ displayNote: DisplayNote) -> AnalyticsEvent { return AnalyticsEvent(category: categoryClaimingData, action: "ViewNote", label: displayNote.noteType.analyticsLabel, value: displayNote.noteType.analyticsValue) } static let claimingRemoveCoverImage = AnalyticsEvent(category: categoryClaimingData, action: "RemoveCoverImageForExperiment") static let claimingDeleteTrial = AnalyticsEvent(category: categoryClaimingData, action: "DeleteTrial") static func claimingDeleteTrialNote(_ displayNote: DisplayNote) -> AnalyticsEvent { return AnalyticsEvent(category: categoryClaimingData, action: "DeleteTrialNote", label: displayNote.noteType.analyticsLabel, value: displayNote.noteType.analyticsValue) } static func claimingDeleteNote(_ displayNote: DisplayNote) -> AnalyticsEvent { return AnalyticsEvent(category: categoryClaimingData, action: "DeleteNote", label: displayNote.noteType.analyticsLabel, value: displayNote.noteType.analyticsValue) } // MARK: Trial export static let categoryTrialExport = "ExportTrial" static let trialExported = AnalyticsEvent(category: categoryTrialExport, action: "DidExport") static let trialExportCancelled = AnalyticsEvent(category: categoryTrialExport, action: "ExportCancelled") static let trialExportError = AnalyticsEvent(category: categoryTrialExport, action: "ExportError") // MARK: Sidebar static let categorySidebar = "Sidebar" static let sidebarOpened = AnalyticsEvent(category: categorySidebar, action: "Opened") static let sidebarClosed = AnalyticsEvent(category: categorySidebar, action: "Closed") // MARK: Sign in static let categorySignIn = "SignIn" public static let signInStart = AnalyticsEvent(category: categorySignIn, action: "StartSignIn") public static let signInStartSwitch = AnalyticsEvent(category: categorySignIn, action: "StartSwitchAccount") static let signInFromWelcome = AnalyticsEvent(category: categorySignIn, action: "SignInFromWelcome") static let signInFromSidebar = AnalyticsEvent(category: categorySignIn, action: "SignInFromSidebar") static let signInLearnMore = AnalyticsEvent(category: categorySignIn, action: "LearnMore") public static let signInContinueWithoutAccount = AnalyticsEvent(category: categorySignIn, action: "ContinueWithoutAccount") public static let signInAccountChanged = AnalyticsEvent(category: categorySignIn, action: "AccountChanged") public static let signInAccountSignedIn = AnalyticsEvent(category: categorySignIn, action: "AccountSignedIn") public static let signInFailed = AnalyticsEvent(category: categorySignIn, action: "Failed") public static let signInSwitchFailed = AnalyticsEvent(category: categorySignIn, action: "SwitchFailed") public static let signInNoChange = AnalyticsEvent(category: categorySignIn, action: "NoChange") public static let signInRemovedAccount = AnalyticsEvent(category: categorySignIn, action: "RemovedAccount") public static let signInError = AnalyticsEvent(category: categorySignIn, action: "Error") public static func signInAccountType(_ accountType: AnalyticsAccountType) -> AnalyticsEvent { return AnalyticsEvent(category: categorySignIn, action: "AccountType", label: accountType.analyticsLabel, value: accountType.rawValue) } static let signInPermissionDenied = AnalyticsEvent(category: categorySignIn, action: "PermissionDenied") static let signInSyncExistingAccount = AnalyticsEvent(category: categorySignIn, action: "SyncExistingAccount") // MARK: Sync static let categorySync = "Sync" public static let syncExperimentFromDrive = AnalyticsEvent(category: categorySync, action: "SyncExperimentFromDrive") static let syncManualRefresh = AnalyticsEvent(category: categorySync, action: "ManualSyncStarted") // MARK: - Base struct public var category: String public var action: String public var label: String? public var value: NSNumber? init(category: String, action: String, label: String? = nil, value: NSNumber? = nil) { self.category = category self.action = action self.label = label self.value = value } } // MARK: - Account type values /// Analytics values for signed in account types. public enum AnalyticsAccountType: NSNumber { case other = 0 case gmail case gsuite case googleCorp case unknownOffline var analyticsLabel: String { switch self { case .other: return "Other" case .gmail: return "Gmail" case .gsuite: return "GSuite" case .googleCorp: return "GoogleCorp" case .unknownOffline: return "UnknownOffline" } } } // MARK: - Note type values /// Extends the DisplayNoteType enum to add values for analytics tracking various note types. extension DisplayNoteType { var analyticsValue: NSNumber { switch self { case .textNote: return 0 case .pictureNote: return 1 case .triggerNote: return 2 case .snapshotNote: return 3 } } var analyticsLabel: String { switch self { case .textNote: return "Text" case .pictureNote: return "Picture" case .triggerNote: return "Trigger" case .snapshotNote: return "Snapshot" } } }
[ -1 ]
6c5477a6261e52820571e77e1a288f9d1b82aa15
8ff5b093dfe7554da653d3847d99fcbed6fe0123
/Photorama/Photorama/Photo.swift
35c1291ef2ce93055aa3278cff753b04b7eef20b
[]
no_license
emadruga/bigNerdRanch5ed
5bf1f018c6b49f323842118a58f645f663614f77
30355a222135bfe5189b2ab86e0fa2e3c87f9502
refs/heads/master
2020-04-06T04:21:39.087101
2016-10-21T12:21:24
2016-10-21T12:21:24
57,066,674
0
0
null
null
null
null
UTF-8
Swift
false
false
689
swift
// // Photo.swift // Photorama // // Created by Ewerton Madruga on 6/20/16. // Copyright © 2016 Ewerton Madruga. All rights reserved. // import UIKit class Photo : Equatable { let title: String let remoteURL: NSURL let photoID: String let dateTaken: NSDate var image: UIImage? init(title: String, photoID: String, remoteURL: NSURL, dateTaken: NSDate) { self.title = title self.photoID = photoID self.remoteURL = remoteURL self.dateTaken = dateTaken } } extension Photo {} func == (lhs: Photo, rhs: Photo) -> Bool { // two photos are the same if they have the same photoID return lhs.photoID == rhs.photoID }
[ -1 ]
1b2677dc940682805e1dabf98d9ddd82ada1e8b1
d583479d8a28d51f53b19b42dc3c35f6adca5be1
/AnotherCalculator/ViewController.swift
6184c56c580a665c4e07c21d83276d56bac1614b
[]
no_license
j-fro/ios_calculator
86bfe13373f25a04e8f48819d3019cedebd49fd8
633e3fae94d88941fb87bb5da29e05630f915375
refs/heads/master
2021-01-21T05:23:35.378301
2017-02-26T05:40:33
2017-02-26T05:40:33
83,185,817
0
0
null
null
null
null
UTF-8
Swift
false
false
1,466
swift
// // ViewController.swift // AnotherCalculator // // Created by Jacob Froman on 2/25/17. // Copyright © 2017 Jacob Froman. All rights reserved. // import UIKit class ViewController: UIViewController { private var userIsTyping = false var savedProgram: CalculatorBrain.PropertyList? @IBAction func save() { savedProgram = brain.program } @IBAction func restore() { if savedProgram != nil { brain.program = savedProgram! displayValue = brain.result } } @IBOutlet private weak var display: UILabel! @IBAction private func touchDigit(_ sender: UIButton) { let digit = sender.currentTitle! if userIsTyping { display.text = display.text! + digit } else { display.text = digit } userIsTyping = true } private var displayValue: Double { get { return Double(display.text!)! } set { display.text = String(newValue) } } private var brain = CalculatorBrain() @IBAction private func operation(_ sender: UIButton) { if userIsTyping { brain.setOperand(operand: displayValue) userIsTyping = false } if let mathematicalSymbol = sender.currentTitle { brain.performOperation(symbol: mathematicalSymbol) } displayValue = brain.result } }
[ -1 ]
20bd3192eef99611aedcb49b21d7424cbed18926
add548b26915009116dc6e4aa611813fe05674c2
/EngineKit/EngineKitiOS/iOSHandler.swift
633957885641fb4e06a070c33aee1f8428894ccf
[]
no_license
strogo/EngineKit
ab6cc42ab26421e9aea45d377947d7293f196c0f
dd11abceca2f543e3c43b1e3271c06cc399ccf93
refs/heads/master
2023-01-25T01:55:43.000590
2020-11-27T17:29:44
2020-11-27T17:29:44
null
0
0
null
null
null
null
UTF-8
Swift
false
false
187
swift
// // iOSHandler.swift // EngineKit // // Created by Vinicius Vendramini on 4/16/16. // // import Foundation public func printOSInfo() { print("Using EngineKit - iOS framework.") }
[ -1 ]
d66d3023090a449fe9634f9540cfcc57e9ca3762
faf60cf3665709a081833eef890f2a0427716df4
/Charts/ChartsTests/LineChartTests.swift
d48f1578cad81c5d2f7f08d7aecd64a1044d339e
[ "Apache-2.0" ]
permissive
ygromovwork/Charts
de63ab9aa0c6fe6048e1195515b8145426a63cf1
8bcee833161e8207accbf52370148f45b27c698b
refs/heads/master
2020-03-28T14:41:14.433485
2016-09-15T17:40:52
2016-09-15T17:40:52
148,511,810
1
0
Apache-2.0
2018-09-12T16:46:53
2018-09-12T16:46:53
null
UTF-8
Swift
false
false
1,914
swift
import XCTest import FBSnapshotTestCase @testable import Charts class LineChartTests: FBSnapshotTestCase { var chart: LineChartView! var dataSet: LineChartDataSet! override func setUp() { super.setUp() // Set to `true` to re-capture all snapshots self.recordMode = false // Sample data let values: [Double] = [8, 104, 81, 93, 52, 44, 97, 101, 75, 28, 76, 25, 20, 13, 52, 44, 57, 23, 45, 91, 99, 14, 84, 48, 40, 71, 106, 41, 45, 61] var entries: [ChartDataEntry] = Array() var xValues: [String] = Array() for (i, value) in values.enumerate() { entries.append(ChartDataEntry.init(value: value, xIndex: i)) xValues.append("\(i)") } dataSet = LineChartDataSet(yVals: entries, label: "First unit test data") chart = LineChartView(frame: CGRectMake(0, 0, 480, 350)) chart.leftAxis.axisMinValue = 0.0 chart.rightAxis.axisMinValue = 0.0 chart.data = LineChartData(xVals: xValues, dataSet: dataSet) } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. super.tearDown() } func testDefaultValues() { FBSnapshotVerifyView(chart) } func testHidesValues() { dataSet.drawValuesEnabled = false FBSnapshotVerifyView(chart) } func testDoesntDrawCircles() { dataSet.drawCirclesEnabled = false FBSnapshotVerifyView(chart) } func testIsCubic() { dataSet.drawCubicEnabled = true FBSnapshotVerifyView(chart) } func testDoesntDrawCircleHole() { dataSet.drawCircleHoleEnabled = false FBSnapshotVerifyView(chart) } }
[ 282689, 282690, 286044 ]
661de69d0c1a4aee0d01e4faef7b87cd2e664cd3
eceae9df92568c642a1ff343cedc733c82703c2d
/ChatAppWithFirebase/Views/ChatRoomTableViewCell.swift
2517bc9a4956205eeb454b05e03c94179f937feb
[]
no_license
kamijo042/ChatAppWithFirebase
31c3540f8a0f1accf166ef8c01ba4543823790b2
8230e2852dee50168f529cdb89278730208f8ac5
refs/heads/main
2023-02-03T20:12:49.218934
2020-12-28T16:07:13
2020-12-28T16:07:13
325,055,318
0
0
null
null
null
null
UTF-8
Swift
false
false
3,691
swift
// // ChatRoomTableViewCell.swift // ChatAppWithFirebase // // Created by Tetsuya Kamijo on 2020/12/07. // Copyright © 2020 Tetsuya Kamijo. All rights reserved. // import UIKit import FirebaseAuth import Nuke class ChatRoomTableViewCell: UITableViewCell { var message: Message? { didSet { } } @IBOutlet weak var userImageView: UIImageView! @IBOutlet weak var partnerMessageTextView: UITextView! @IBOutlet weak var myMessageTextView: UITextView! @IBOutlet weak var partnerDateLabel: UILabel! @IBOutlet weak var myDateLabel: UILabel! @IBOutlet weak var partnerMessageTextViewWidthConstraint: NSLayoutConstraint! @IBOutlet weak var myMessageTextViewWidthConstraint: NSLayoutConstraint! override func awakeFromNib() { super.awakeFromNib() backgroundColor = .clear userImageView.layer.cornerRadius = 30 partnerMessageTextView.layer.cornerRadius = 15 myMessageTextView.layer.cornerRadius = 15 } override func setSelected(_ selected: Bool, animated: Bool) { super.setSelected(selected, animated: animated) checkWitchUserMessage() } private func checkWitchUserMessage() { guard let uid = Auth.auth().currentUser?.uid else {return} if uid == message?.uid { partnerMessageTextView.isHidden = true partnerDateLabel.isHidden = true userImageView.isHidden = true myMessageTextView.isHidden = false myDateLabel.isHidden = false if let message = message { myMessageTextView.text = message.message let width = estimateFrameForTextView(text: message.message).width + 20 myMessageTextViewWidthConstraint.constant = width myDateLabel.text = dateFormatterForDateLabel(date: message.createdAt.dateValue()) } } else { partnerMessageTextView.isHidden = false partnerDateLabel.isHidden = false userImageView.isHidden = false myMessageTextView.isHidden = true myDateLabel.isHidden = true if let urlString = message?.partnerUser?.profileImageURL, let url = URL(string: urlString) { Nuke.loadImage(with: url, into: userImageView) } if let message = message { partnerMessageTextView.text = message.message let width = estimateFrameForTextView(text: message.message).width + 20 partnerMessageTextViewWidthConstraint.constant = width partnerDateLabel.text = dateFormatterForDateLabel(date: message.createdAt.dateValue()) } } } // メッセージの幅の長さを自動調整 private func estimateFrameForTextView(text: String) -> CGRect { let size = CGSize(width: 200, height: 1000) let options = NSStringDrawingOptions.usesFontLeading.union(.usesLineFragmentOrigin) return NSString(string: text).boundingRect(with: size, options: options, attributes: [NSAttributedString.Key.font: UIFont.systemFont(ofSize: 16)], context: nil) } private func dateFormatterForDateLabel(date: Date) -> String { let formatter = DateFormatter() formatter.dateStyle = .short formatter.timeStyle = .short formatter.locale = Locale(identifier: "ja_JP") return formatter.string(from: date) } }
[ -1 ]
bd01fa03222eb0acd3f9065e0c74e171962c06a7
9bb80472327e465a6c606ec3f54ed98c08e5473c
/SwipeablePageView/MGSwipeablePageView/MGSwipeableViewController.swift
b060160720de824753f5527c768727d451fbfa11
[]
no_license
chackle/mg-swipeable-view-controller
1326aee589e59dfe2977cff2fe493eb4a4badd6a
22a33d6432ae97666d7f0d34530348f735bb56c5
refs/heads/master
2020-04-27T20:40:29.352659
2015-04-25T15:52:02
2015-04-25T15:52:02
34,067,967
0
0
null
null
null
null
UTF-8
Swift
false
false
3,606
swift
// // MGSwipeableViewController.swift // SwipeablePageView // // Created by Michael Green on 17/04/2015. // Copyright (c) 2015 Michael Green. All rights reserved. // import UIKit typealias PageTuple = (viewController: UIViewController, name: String) class MGSwipeableViewController: UIViewController, UIScrollViewDelegate, MGSwipeablePageHeaderDelegate { private var currentPagePosition: CGFloat var pages: [PageTuple] @IBOutlet var pageView: MGSwipeablePageView! @IBOutlet var pageHeader: MGSwipeablePageHeader! var pagePosition: CGFloat { set { currentPagePosition = newValue if Int(currentPagePosition) > (pages.count-1) { currentPagePosition = CGFloat(pages.count) } pageView.snapToPagePosition(currentPagePosition) } get { return currentPagePosition } } // MARK: Lifecycle required init(coder aDecoder: NSCoder) { pages = [PageTuple]() currentPagePosition = 1 super.init(coder: aDecoder) } override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) { pages = [PageTuple]() currentPagePosition = 1 super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil) } override func viewDidLoad() { super.viewDidLoad() pageView.delegate = self pageHeader.delegate = self pageHeader.pageDelegate = self } override func viewWillAppear(animated: Bool) { super.viewWillAppear(animated) self.view.setNeedsLayout() self.view.layoutIfNeeded() } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() } override func loadView() { NSBundle.mainBundle().loadNibNamed("MGSwipeableViewController", owner: self, options: nil) } override func willAnimateRotationToInterfaceOrientation(toInterfaceOrientation: UIInterfaceOrientation, duration: NSTimeInterval) { pageHeader.refreshViews() pageView.refreshViews() pageView.snapToPagePosition(currentPagePosition) } // MARK: UIScrollView Delegate func scrollViewDidScroll(scrollView: UIScrollView) { if scrollView.isEqual(pageView) { let contentOffsetX = scrollView.contentOffset.x let headerContentOffsetX = contentOffsetX / 3 var pageHeaderRect = pageHeader.bounds pageHeaderRect.origin.x = headerContentOffsetX pageHeader.scrollRectToVisible(pageHeaderRect, animated: false) } else if scrollView.isEqual(pageHeader) { pageHeader.updateDisplayPropertiesForButtons() } } func scrollViewDidEndDecelerating(scrollView: UIScrollView) { if scrollView.isEqual(pageView) { currentPagePosition = (pageView.contentOffset.x / pageView.bounds.width) + 1 } } // MARK: MGSwipeablePageHeaderDelegate func pageHeader(pageHeader: MGSwipeablePageHeader, didSelectPosition position: Int) { if pageHeader.isEqual(self.pageHeader) { var pageRect = pageView.bounds pageRect.origin.x = CGFloat(position) * pageRect.size.width pageView.scrollRectToVisible(pageRect, animated: true) } } // MARK: Functional func addViewControllers(viewControllers: [UIViewController], withTitles titles: [String]) { for var i = 0; i < viewControllers.count; i++ { addViewController(viewControllers[i], withTitle:titles[i]) } pageHeader.addPages(pages) pageView.addPages(pages) } private func addViewController(viewController: UIViewController, withTitle title: String) { self.addChildViewController(viewController) viewController.didMoveToParentViewController(self) pages.append((viewController, title)) } }
[ -1 ]
5d54cc0e6039c70f51e5d9500435c674fa5ded33
c3247146e8a1e317c79b014b05d4f2d9a3e0bb1c
/Destini/Model/StoryBrain.swift
590b1433551273851a8bd2f174eb7742fd4c34d9
[]
no_license
Dayton159/Destini
ca2e8b67fae2121cc701d0803a627dc540bc6285
818994575c6bed9084fdcb496c2ab8fb15136ca3
refs/heads/main
2023-02-09T21:26:38.429654
2021-01-06T16:35:27
2021-01-06T16:35:27
320,374,767
0
0
null
null
null
null
UTF-8
Swift
false
false
3,079
swift
// // StoryBrain.swift // Destini // // Created by Dayton on 11/12/20. // import Foundation struct StoryBrain { let stories = [ Story( title: "Your car has blown a tire on a winding road in the middle of nowhere with no cell phone reception. You decide to hitchhike. A rusty pickup truck rumbles to a stop next to you. A man with a wide brimmed hat with soulless eyes opens the passenger door for you and asks: 'Need a ride, boy?'.", choice1: "I'll hop in. Thanks for the help!", choice1Destination: 2, choice2: "Better ask him if he's a murderer first.", choice2Destination: 1 ), Story( title: "He nods slowly, unfazed by the question.", choice1: "At least he's honest. I'll climb in.", choice1Destination: 2, choice2: "Wait, I know how to change a tire.", choice2Destination: 3 ), Story( title: "As you begin to drive, the stranger starts talking about his relationship with his mother. He gets angrier and angrier by the minute. He asks you to open the glovebox. Inside you find a bloody knife, two severed fingers, and a cassette tape of Elton John. He reaches for the glove box.", choice1: "I love Elton John! Hand him the cassette tape.", choice1Destination: 5, choice2: "It's him or me! You take the knife and stab him.", choice2Destination: 4 ), Story( title: "What? Such a cop out! Did you know traffic accidents are the second leading cause of accidental death for most adult age groups?", choice1: "The", choice1Destination: 0, choice2: "End", choice2Destination: 0 ), Story( title: "As you smash through the guardrail and careen towards the jagged rocks below you reflect on the dubious wisdom of stabbing someone while they are driving a car you are in.", choice1: "The", choice1Destination: 0, choice2: "End", choice2Destination: 0 ), Story( title: "You bond with the murderer while crooning verses of 'Can you feel the love tonight'. He drops you off at the next town. Before you go he asks you if you know any good places to dump bodies. You reply: 'Try the pier.'", choice1: "The", choice1Destination: 0, choice2: "End", choice2Destination: 0 ) ] var currentStory = 0 mutating func checkChoice(_ userChoice:String) { if userChoice == stories[currentStory].choice1 { currentStory = stories[currentStory].choice1Destination } else if userChoice == stories[currentStory].choice2{ currentStory = stories[currentStory].choice2Destination }else{ } } func getNextStory() ->String{ return stories[currentStory].title } func getNextChoice1() -> String{ return stories[currentStory].choice1 } func getNextChoice2() -> String{ return stories[currentStory].choice2 } }
[ 181675, 358877, 352878, 249231 ]
fb7bf7a912a681ac7f98f22e2ef124bfb533701b
5f8a757931d7aab2d5c653e5d0b180f20e9d3920
/NewYorkTimes/New Group/PageContentViewController.swift
ae1434a79b4f04c15f8bf92f633ce2ced7841026
[]
no_license
khinleiwah/NewYorkTimes
7fed0c7920daeee664433dc24e1661ba83e919d0
8659182eb00373b41f48a2d17f950c44989af28f
refs/heads/master
2020-05-20T01:20:23.496231
2019-05-07T03:03:30
2019-05-07T03:03:30
185,309,303
0
0
null
null
null
null
UTF-8
Swift
false
false
1,361
swift
// // PageContentViewController.swift // NewYorkTimes // // Created by Win on 5/5/19. // Copyright © 2019 Win. All rights reserved. // import UIKit import WebKit class PageContentViewController: UIViewController,WKNavigationDelegate { @IBOutlet var indicatorView: UIActivityIndicatorView! @IBOutlet weak var webView: WKWebView! var webURL:String! override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. self.indicatorView.startAnimating() let request = URLRequest.init(url: URL(string: self.webURL)!) self.webView.accessibilityIdentifier = "webViewId"//AccessibilityIdentifier.webView.rawValue self.webView.navigationDelegate = self self.webView.load(request) } func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) { self.indicatorView.stopAnimating() self.indicatorView.hidesWhenStopped = 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 ]
ff75ab62f856e78b3cfc2747474f1982875e5535
6a786bae827480266e324d1b28545c17093d072c
/Clima/AppDelegate.swift
ed4383e7f2fcca22eb1d5c2e4a78212d8d23c4ad
[]
no_license
sha-since1999/Clima-weatherApp-
c5db55835a28a1bf3def2368e73c85d5e6f0027f
31581bc793986ba7cccd8a6f35d332fb7fe2c10e
refs/heads/master
2022-11-21T21:04:10.738819
2020-07-30T16:28:38
2020-07-30T16:28:38
null
0
0
null
null
null
null
UTF-8
Swift
false
false
1,314
swift
// // AppDelegate.swift // Clima import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } // MARK: UISceneSession Lifecycle func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { // Called when a new scene session is being created. // Use this method to select a configuration to create the new scene with. return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) } func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) { // Called when the user discards a scene session. // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. // Use this method to release any resources that were specific to the discarded scenes, as they will not return. } }
[ 393222, 393224, 393230, 393250, 344102, 393261, 393266, 163891, 213048, 376889, 385081, 393275, 376905, 327756, 254030, 286800, 368727, 180313, 368735, 180320, 376931, 286831, 368752, 286844, 417924, 262283, 286879, 286888, 377012, 327871, 180416, 377036, 180431, 377046, 418010, 377060, 327914, 205036, 393456, 393460, 418043, 336123, 336128, 385280, 262404, 180490, 164106, 368911, 262416, 262422, 377117, 262436, 336180, 262454, 393538, 262472, 344403, 213332, 65880, 262496, 418144, 262499, 213352, 246123, 262507, 262510, 213372, 385419, 393612, 262550, 262552, 385440, 385443, 385451, 262573, 393647, 385458, 262586, 344511, 262592, 360916, 369118, 328177, 328179, 328182, 328189, 328192, 164361, 328206, 410128, 393747, 254490, 188958, 385570, 33316, 377383, 197159, 352821, 197177, 188987, 418363, 369223, 385609, 385616, 352856, 352864, 369253, 262760, 352874, 352887, 254587, 377472, 148105, 377484, 352918, 98968, 344744, 361129, 336555, 385713, 434867, 164534, 336567, 328378, 164538, 328386, 352968, 344776, 352971, 418507, 352973, 385742, 385748, 361179, 189153, 369381, 361195, 418553, 344831, 336643, 344835, 344841, 361230, 336659, 418580, 418585, 434970, 369435, 418589, 262942, 418593, 336675, 328484, 418598, 418605, 336696, 361273, 328515, 336708, 328519, 336711, 361288, 328522, 336714, 426841, 254812, 361309, 197468, 361315, 361322, 328573, 377729, 369542, 361360, 222128, 345035, 345043, 386003, 386011, 386018, 386022, 435187, 328702, 328714, 361489, 386069, 336921, 386073, 336925, 345118, 377887, 345133, 345138, 386101, 361536, 197707, 189520, 345169, 156761, 361567, 148578, 345199, 386167, 361593, 410745, 361598, 214149, 345222, 386186, 337047, 345246, 214175, 337071, 337075, 345267, 386258, 328924, 66782, 222437, 328941, 386285, 386291, 345376, 353570, 345379, 410917, 345382, 337205, 345399, 378169, 369978, 337222, 337229, 337234, 263508, 402791, 345448, 271730, 378227, 271745, 181638, 353673, 181643, 181649, 181654, 230809, 181670, 181673, 181681, 337329, 181684, 181690, 361917, 181696, 337349, 181703, 337365, 271839, 329191, 361960, 329194, 116210, 337398, 337415, 329226, 419339, 419343, 419349, 345625, 419355, 370205, 419359, 394786, 419362, 370213, 419368, 419376, 206395, 214593, 419400, 419402, 353867, 419406, 214610, 419410, 345701, 394853, 222830, 370297, 403070, 353919, 403075, 198280, 345736, 403091, 345749, 345757, 345762, 419491, 345765, 419497, 419501, 370350, 419506, 419509, 419512, 337592, 419517, 337599, 419527, 419530, 419535, 272081, 419542, 394966, 419544, 181977, 345818, 419547, 419550, 419559, 337642, 419563, 337645, 370415, 337659, 141051, 337668, 362247, 395021, 362255, 321299, 116509, 345887, 378663, 345905, 354106, 354111, 247617, 354117, 370503, 329544, 345930, 370509, 354130, 247637, 337750, 370519, 313180, 354142, 354150, 354156, 345964, 345967, 345970, 345974, 403320, 354172, 247691, 337808, 247700, 329623, 436126, 436132, 337833, 362413, 337844, 346057, 247759, 346063, 329697, 354277, 190439, 247789, 354313, 346139, 436289, 378954, 395339, 338004, 100453, 329832, 329855, 329867, 329885, 411805, 346272, 362660, 100524, 387249, 379066, 387260, 256191, 395466, 346316, 411861, 411864, 411868, 411873, 379107, 411876, 387301, 346343, 338152, 387306, 387312, 346355, 436473, 321786, 379134, 411903, 379152, 395538, 387349, 338199, 387352, 182558, 338211, 395566, 248111, 362822, 436555, 190796, 321879, 379233, 354673, 321910, 248186, 420236, 379278, 272786, 354727, 338352, 330189, 338381, 338386, 256472, 338403, 338409, 248308, 199164, 330252, 199186, 420376, 330267, 354855, 10828, 199249, 174695, 248425, 191084, 338543, 191092, 346742, 330383, 354974, 150183, 174774, 248504, 174777, 223934, 355024, 273108, 355028, 264918, 183005, 256734, 436962, 338660, 338664, 264941, 363251, 207619, 264964, 338700, 256786, 199452, 363293, 396066, 346916, 396069, 215853, 355122, 355131, 355140, 355143, 338763, 355150, 330580, 355166, 265055, 355175, 387944, 355179, 330610, 330642, 355218, 412599, 207808, 379848, 396245, 330710, 248792, 248798, 347105, 257008, 183282, 265207, 330748, 265214, 330760, 330768, 248862, 396328, 158761, 347176, 199728, 330800, 396336, 396339, 339001, 388154, 388161, 347205, 248904, 330826, 248914, 339036, 412764, 257120, 265320, 248951, 420984, 330889, 347287, 248985, 339097, 44197, 380070, 339112, 249014, 126144, 330958, 330965, 265432, 388319, 388347, 175375, 159005, 175396, 208166, 273708, 372015, 347441, 372018, 199988, 44342, 175415, 396600, 437566, 175423, 437570, 437575, 437583, 331088, 437587, 331093, 396633, 175450, 437595, 175457, 208227, 175460, 175463, 265580, 437620, 175477, 249208, 175483, 175486, 249214, 175489, 249218, 249227, 249234, 175513, 175516, 396705, 175522, 355748, 380332, 396722, 208311, 388542, 372163, 216517, 380360, 216522, 339404, 372176, 208337, 339412, 413141, 339417, 249308, 339420, 339424, 339428, 339434, 249328, 69113, 372228, 208398, 380432, 175635, 339503, 265778, 265795, 396872, 265805, 224853, 224857, 257633, 224870, 372327, 339563, 257646, 372337, 224884, 224887, 224890, 224894, 224897, 372353, 216707, 126596, 339588, 421508, 224904, 224909, 11918, 159374, 224913, 126610, 339601, 224916, 224919, 126616, 224922, 208538, 224926, 224929, 224932, 224936, 257704, 224942, 257712, 224947, 257716, 257720, 224953, 257724, 224959, 257732, 224965, 224969, 339662, 224975, 257747, 224981, 224986, 257761, 224993, 257764, 224999, 339695, 225012, 257787, 225020, 339710, 257790, 225025, 257794, 339721, 257801, 257804, 225038, 257807, 225043, 372499, 167700, 225048, 257819, 225053, 184094, 225058, 339747, 339749, 257833, 225066, 257836, 413484, 225070, 225073, 372532, 257845, 225079, 397112, 225082, 397115, 225087, 225092, 225096, 323402, 257868, 225103, 257871, 397139, 225108, 225112, 257883, 257886, 225119, 257890, 339814, 225127, 257896, 274280, 257901, 225137, 339826, 257908, 225141, 257912, 257916, 225148, 257920, 225155, 339844, 225165, 397200, 225170, 380822, 225175, 225180, 118691, 184244, 372664, 372702, 372706, 356335, 380918, 405533, 430129, 266294, 266297, 217157, 421960, 356439, 430180, 421990, 266350, 356466, 266362, 381068, 225423, 250002, 250004, 225429, 356506, 225437, 135327, 225441, 438433, 225444, 438436, 225447, 438440, 225450, 258222, 225455, 430256, 225458, 225461, 225466, 389307, 225470, 381120, 372929, 430274, 225475, 389320, 225484, 225487, 225490, 225493, 266453, 225496, 225499, 225502, 225505, 356578, 225510, 217318, 225514, 225518, 372976, 381176, 389380, 61722, 356637, 356640, 356643, 356646, 266536, 356649, 356655, 332080, 340275, 356660, 397622, 332090, 225597, 332097, 201028, 348488, 332106, 332117, 348502, 250199, 250202, 332125, 250210, 348525, 332152, 389502, 250238, 332161, 356740, 332172, 373145, 340379, 389550, 324030, 266687, 340451, 160234, 127471, 340472, 324094, 266754, 324099, 324102, 324111, 340500, 324117, 324131, 332324, 381481, 324139, 356907, 324142, 356916, 324149, 324155, 348733, 324160, 324164, 356934, 348743, 381512, 324170, 324173, 324176, 389723, 332380, 373343, 381545, 340627, 184982, 373398, 258721, 332453, 332459, 389805, 332463, 381617, 332471, 332483, 332486, 373449, 332493, 357069, 357073, 332511, 332520, 340718, 332533, 348924, 389892, 373510, 389926, 152370, 348978, 340789, 348982, 398139, 127814, 357201, 357206, 389978, 430939, 357211, 357214, 201579, 201582, 349040, 340849, 201588, 430965, 381813, 324472, 398201, 340858, 324475, 430972, 340861, 324478, 119674, 324481, 373634, 398211, 324484, 324487, 381833, 324492, 324495, 324498, 430995, 324501, 324510, 422816, 324513, 398245, 201637, 324524, 340909, 324533, 5046, 324538, 324541, 398279, 340939, 340941, 209873, 340957, 431072, 398306, 340963, 209895, 201711, 349172, 381946, 349180, 439294, 431106, 209943, 250914, 357410, 185380, 357418, 209965, 209968, 209971, 209975, 209979, 209987, 209990, 341071, 349267, 250967, 210010, 341091, 210025, 210027, 210030, 210036, 210039, 341113, 349308, 210044, 349311, 152703, 160895, 210052, 349319, 210055, 210067, 210071, 210077, 210080, 251044, 210084, 185511, 210088, 210095, 210098, 210107, 210115, 332997, 210127, 333009, 210131, 333014, 210138, 210143, 218354, 218360, 251128, 275706, 275712, 275715, 275721, 349459, 333078, 251160, 349484, 349491, 251189, 415033, 251210, 357708, 210260, 365911, 259421, 365921, 333154, 251235, 374117, 333162, 234866, 390516, 333175, 357755, 251271, 136590, 374160, 112020, 349590, 357792, 259515, 415166, 415185, 366034, 366038, 415191, 415193, 415196, 415199, 423392, 333284, 415207, 366056, 366061, 415216, 210420, 415224, 423423, 415257, 415263, 366117, 415270, 144939, 415278, 415281, 415285, 210487, 415290, 415293, 349761, 415300, 333386, 333399, 366172, 333413, 423528, 423532, 210544, 415353, 333439, 415361, 267909, 153227, 333498, 210631, 333511, 259788, 358099, 153302, 333534, 366307, 366311, 431851, 366318, 210672, 366321, 366325, 210695, 268041, 210698, 366348, 210706, 399128, 333594, 210719, 358191, 366387, 210739, 399159, 358200, 325440, 366401, 341829, 325446, 46920, 341834, 341838, 341843, 415573, 358234, 341851, 350045, 399199, 259938, 399206, 268143, 358255, 399215, 358259, 341876, 333689, 243579, 325504, 333698, 333708, 333724, 382890, 350146, 358339, 333774, 358371, 350189, 350193, 333818, 350202, 350206, 350213, 268298, 350224, 350231, 333850, 350237, 350240, 350244, 350248, 178218, 350251, 350256, 350259, 350271, 243781, 350285, 374864, 342111, 342133, 374902, 432271, 333997, 334011, 260289, 260298, 350410, 350416, 350422, 211160, 350425, 268507, 334045, 350445, 375026, 358644, 350458, 350461, 350464, 325891, 350467, 350475, 375053, 268559, 350480, 432405, 350486, 350490, 325914, 325917, 350493, 350498, 194852, 350504, 358700, 350509, 391468, 358704, 358713, 358716, 383306, 334161, 383321, 383330, 383333, 391530, 383341, 334203, 268668, 194941, 391563, 366990, 416157, 342430, 268701, 375208, 326058, 375216, 334262, 334275, 326084, 358856, 195039, 334304, 334311, 375277, 334321, 350723, 391690, 186897, 342545, 334358, 342550, 342554, 334363, 358941, 350761, 252461, 334384, 383536, 358961, 334394, 252482, 219718, 334407, 334420, 350822, 375400, 334465, 334468, 162445, 326290, 342679, 342683, 260766, 342710, 244409, 260797, 334528, 260801, 350917, 154317, 391894, 154328, 416473, 64230, 113388, 342766, 375535, 203506, 342776, 391937, 391948, 375568, 326416, 375571, 375574, 162591, 326441, 383793, 326451, 326454, 326460, 244540, 260924, 375612, 326467, 244551, 326473, 326477, 326485, 416597, 326490, 342874, 326502, 375656, 433000, 326507, 326510, 211825, 211831, 351097, 392060, 359295, 351104, 400259, 342915, 236430, 342930, 252822, 392091, 400285, 252836, 359334, 211884, 400306, 351168, 359361, 326598, 359366, 359382, 359388, 383967, 343015, 359407, 261108, 244726, 261111, 383997, 261129, 359451, 261147, 211998, 261153, 261159, 359470, 359476, 343131, 384098, 384101, 384107, 367723, 187502, 343154, 384114, 212094, 351364, 384135, 384139, 384143, 351381, 384151, 384160, 384168, 367794, 244916, 384181, 367800, 384188, 384191, 351423, 384198, 326855, 244937, 384201, 253130, 343244, 384208, 146642, 384224, 359649, 343270, 351466, 384246, 351479, 384249, 343306, 261389, 359694, 253200, 261393, 384275, 384283, 245020, 384288, 245029, 171302, 351534, 376110, 245040, 384314, 425276, 384323, 212291, 343365, 212303, 367965, 343393, 343398, 367980, 425328, 343409, 253303, 154999, 343417, 327034, 245127, 384397, 245136, 245142, 245145, 343450, 245148, 245151, 245154, 245157, 245162, 327084, 359865, 384443, 146876, 327107, 384453, 327110, 327115, 327117, 359886, 359890, 343507, 368092, 343534, 343539, 368119, 343544, 368122, 409091, 359947, 359955, 359983, 343630, 327275, 245357, 138864, 155254, 155273, 368288, 245409, 425638, 425649, 155322, 425662, 155327, 245460, 155351, 155354, 212699, 245475, 155363, 245483, 155371, 409335, 155393, 155403, 245525, 155422, 360223, 155438, 155442, 155447, 155461, 360261, 376663, 155482, 261981, 425822, 155487, 376671, 155490, 155491, 327531, 261996, 376685, 261999, 262002, 327539, 147317, 262005, 425845, 262008, 262011, 155516, 155521, 155525, 360326, 376714, 155531, 262027, 262030, 262033, 262036, 262039, 262042, 155549, 262045, 262048, 262051, 327589, 155559, 155562, 155565, 393150, 384977, 393169, 155611, 155619, 253923, 155621, 253926, 327654, 393203, 360438, 253943, 393206, 393212, 155646 ]
e8d88d8978f17cb9cf40c2373e27e73b4bfb36ed
c8a0d8fe4195c90a795b7f236bee6896b7672b43
/SwiftUISample/Views/CircleImage.swift
6860d442e0b5ad829c63c2130625c4c6afbbbbb0
[]
no_license
1rsrx/SwiftUITutorial
17b7a08b66bec7cd614a7f076336d16e43c83358
03965014bbe25f819c9b9d37cf151c09a0e33a42
refs/heads/main
2023-07-19T17:26:47.529736
2021-06-16T09:49:08
2021-06-16T09:49:08
null
0
0
null
null
null
null
UTF-8
Swift
false
false
488
swift
// // CircleImaeg.swift // SwiftUISample // // Created by HikaruKuroda on 2021/06/14. // import SwiftUI struct CircleImage: View { var image: Image var body: some View { image .clipShape(Circle()) .overlay(Circle().stroke(Color.white, lineWidth: 4)) .shadow(radius: 7) } } struct CircleImaeg_Previews: PreviewProvider { static var previews: some View { CircleImage(image: Image("tutlerock")) } }
[ 255780, 252837 ]
3ad13e10841da4eb05026ddf2e7eee47cf8e29d4
d329a2508e5cfffa94f1309241ee38ef083dcd9f
/ToDoListApp/ToDoListApp/Views/xib/HeaderVC.swift
8839c47edccd8b459ca74b0b4db3ac1caa5c1e05
[ "MIT" ]
permissive
geasscode/TodoList
240e2532528a39d841f7a80f96c716f0a29370db
ae2fd594a3e174a601de80b7a1e1fcb3f43bc924
refs/heads/master
2021-01-02T22:38:51.469344
2014-12-30T03:26:30
2014-12-30T03:26:30
null
0
0
null
null
null
null
UTF-8
Swift
false
false
3,139
swift
// // HeaderVC.swift // ToDoListApp // // Created by phoenix on 11/13/14. // Copyright (c) 2014 Phoenix. All rights reserved. // import UIKit class HeaderVC: UIViewController,UITextFieldDelegate { @IBOutlet weak var newTask: UITextField! override func viewDidLoad() { super.viewDidLoad() //设置了delegate crash 不知道神马原因。 //newTask.delegate = self // Do any additional setup after loading the view. } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } // override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) { // super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil) // } // // required init(coder aDecoder: NSCoder) { // fatalError("init(coder:) has not been implemented") // } // /* optional func textFieldShouldBeginEditing(textField: UITextField) -> Bool // return NO to disallow editing. optional func textFieldDidBeginEditing(textField: UITextField) // became first responder optional func textFieldShouldEndEditing(textField: UITextField) -> Bool // return YES to allow editing to stop and to resign first responder status. NO to disallow the editing session to end optional func textFieldDidEndEditing(textField: UITextField) // may be called if forced even if shouldEndEditing returns NO (e.g. view removed from window) or endEditing:YES called optional func textField(textField: UITextField, shouldChangeCharactersInRange range: NSRange, replacementString string: String) -> Bool // return NO to not change text optional func textFieldShouldClear(textField: UITextField) -> Bool // called when clear button pressed. return NO to ignore (no notifications) optional func textFieldShouldReturn(textField: UITextField) -> Bool // called when 'return' key pressed. return NO to ignore. */ func textFieldShouldReturn(textField: UITextField!) -> Bool { textField.resignFirstResponder() NSNotificationCenter.defaultCenter().postNotificationName("taskName", object: textField) return true } func textFieldDidEndEditing(textField: UITextField!) { println(textField.text) } func textFieldShouldBeginEditing(textField: UITextField) -> Bool { println("textViewShouldBeginEditing") return true } func textFieldDidBeginEditing(textField: UITextField) { println("textFieldDidBeginEditing") } func textFieldDidEndEditing(textField: UITextField) { println("textFieldDidEndEditing") } /* // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { // Get the new view controller using segue.destinationViewController. // Pass the selected object to the new view controller. } */ }
[ -1 ]
883772ed31c8764ffac0ef79312d87af74c1fdeb
b8b849bd45ab6015a338795678ac5bcb525e6eb6
/MovieFinder/FileManager+DocumentsDirectory.swift
9e21f243ce26232a1f7ba45d581563694c3bb070
[]
no_license
simonbromberg/MovieFinder
0b21286f794b64cc6f473ca72a880def3c097322
13577a7595048f0ddcac5d373cd6f956545176cf
refs/heads/master
2021-01-11T03:33:16.112161
2016-10-16T01:50:20
2016-10-16T01:50:29
71,019,153
0
0
null
null
null
null
UTF-8
Swift
false
false
453
swift
// // FileManager+DocumentsDirectory.swift // MovieFinder // // Created by Simon Bromberg on 2016-10-13. // Copyright © 2016 Bupkis. All rights reserved. // import Foundation extension FileManager { var applicationDocumentsDirectoryURL : URL { return urls(for: .documentDirectory, in: .userDomainMask).first! } var applicationDocumentsDirectoryPath : String { return applicationDocumentsDirectoryURL.path } }
[ -1 ]
f2edafff317694e1feb840718277f9f7cb881ad3
b717792890c4deecb04120c47e5914c7a3a4d9e3
/skhustudy/Global/Extensions/UIScrollView+Extension.swift
b30a2a2db51ae53f6f7f2810c6c91d55061bb7aa
[ "CC-BY-4.0" ]
permissive
SKHU-STUDY/StudySearch
a9f884276827687db5bdb40b7f1084e92a086dd8
235ddd5fc27315d8cd775548062f4abc230fd840
refs/heads/develop
2021-05-17T23:18:27.362436
2020-07-04T14:52:55
2020-07-04T14:52:55
250,997,151
0
1
null
2020-11-06T05:08:53
2020-03-29T09:36:49
Swift
UTF-8
Swift
false
false
4,451
swift
// // UIScrollView+Extension.swift // SKHUStudy // // Created by Junhyeon on 2020/06/12. // Copyright © 2020 anniversary. All rights reserved. // import Foundation import UIKit protocol ReusableView: class { static var defaultReuseIdentifier: String { get } } protocol NibLoadableView: class { static var nibName: String { get } } extension ReusableView where Self: UIView { static var defaultReuseIdentifier: String { return String(describing: self) } } extension NibLoadableView where Self: UIView { static var nibName: String { return String(describing: self) } } //Confirming Collection View and TableView for Registering and Dequeing extension UICollectionView { func register<T: UICollectionViewCell>(_: T.Type) where T: ReusableView { register(T.self, forCellWithReuseIdentifier: T.defaultReuseIdentifier) } func register<T: UICollectionViewCell>(_: T.Type) where T: ReusableView, T: NibLoadableView { let bundle = Bundle(for: T.self) let nib = UINib(nibName: T.nibName, bundle: bundle) register(nib, forCellWithReuseIdentifier: T.defaultReuseIdentifier) } //Registering Supplementary View func register<T: UICollectionReusableView>(_: T.Type, supplementaryViewOfKind: String) where T: ReusableView { register(T.self, forSupplementaryViewOfKind: supplementaryViewOfKind, withReuseIdentifier: T.defaultReuseIdentifier) } func register<T: UICollectionReusableView>(_: T.Type, supplementaryViewOfKind: String) where T: ReusableView, T: NibLoadableView { let bundle = Bundle(for: T.self) let nib = UINib(nibName: T.nibName, bundle: bundle) register(nib, forSupplementaryViewOfKind: supplementaryViewOfKind, withReuseIdentifier: T.defaultReuseIdentifier) } //Dequeing func dequeueReusableCell<T: UICollectionViewCell>(for indexPath: IndexPath) -> T where T: ReusableView { guard let cell = dequeueReusableCell(withReuseIdentifier: T.defaultReuseIdentifier, for: indexPath) as? T else { fatalError("Could not dequeue cell with identifier: \(T.defaultReuseIdentifier)") } return cell } func dequeueReusableSupplementaryView<T: UICollectionReusableView>(ofKind: String, indexPath: IndexPath) -> T where T: ReusableView { guard let supplementaryView = dequeueReusableSupplementaryView(ofKind: ofKind, withReuseIdentifier: T.defaultReuseIdentifier, for: indexPath) as? T else { fatalError("Could not dequeue supplementary view with identifier: \(T.defaultReuseIdentifier)") } return supplementaryView } } extension UITableView { //Registering Cell func register<T: UITableViewCell>(_: T.Type) where T: ReusableView { register(T.self, forCellReuseIdentifier: T.defaultReuseIdentifier) } func register<T: UITableViewCell>(_: T.Type) where T: ReusableView, T: NibLoadableView { let bundle = Bundle(for: T.self) let nib = UINib(nibName: T.nibName, bundle: bundle) register(nib, forCellReuseIdentifier: T.defaultReuseIdentifier) } //Registering HeaderFooterView func register<T: UITableViewHeaderFooterView>(_: T.Type) where T: ReusableView { register(T.self, forHeaderFooterViewReuseIdentifier: T.defaultReuseIdentifier) } func register<T: UITableViewHeaderFooterView>(_: T.Type) where T: ReusableView, T: NibLoadableView { let bundle = Bundle(for: T.self) let nib = UINib(nibName: T.nibName, bundle: bundle) register(nib, forHeaderFooterViewReuseIdentifier: T.defaultReuseIdentifier) } //Dequeing func dequeueReusableCell<T: UITableViewCell>(for indexPath: IndexPath) -> T where T: ReusableView { guard let cell = dequeueReusableCell(withIdentifier: T.defaultReuseIdentifier, for: indexPath) as? T else { fatalError("Could not dequeue cell with identifier: \(T.defaultReuseIdentifier)") } return cell } func dequeueReusableHeaderFooterView<T: UITableViewHeaderFooterView>(_ : T.Type) -> T where T: ReusableView { guard let headerFooter = dequeueReusableHeaderFooterView(withIdentifier: T.defaultReuseIdentifier) as? T else { fatalError("Could not dequeue Header/Footer with identifier: \(T.defaultReuseIdentifier)") } return headerFooter } }
[ 168622 ]
4a15fbf00bfb8cadbfaa0eb0424522fac1c3ca20
2f13f1afa2b83cf7a307bfed0e77061854ebbdd2
/Cerberus/Classes/EventsCollectionViewController.swift
b7423288bf308b05956f76db95cc652f4ea832bb
[ "MIT" ]
permissive
wantedly/Cerberus
7f39d8720d592e1c20fb14476ddf1937ac8acfe2
71ffdb37a75a933ab87f107009fefd0d26ba397f
refs/heads/master
2021-07-04T19:38:37.512576
2016-12-26T10:11:15
2016-12-26T10:11:15
36,964,650
5
1
null
2015-06-15T10:23:31
2015-06-06T02:36:51
Swift
UTF-8
Swift
false
false
4,359
swift
import UIKit import EventKit import Async import Timepiece import EasyAnimation class EventsCollectionViewController: UICollectionViewController { var calendar: Calendar! override func viewDidLoad() { super.viewDidLoad() self.calendar = Calendar() self.calendar.authorize { status in switch status { case .Error: Async.background { let alert = UIAlertController( title: "許可されませんでした", message: "Privacy->App->Reminderで変更してください", preferredStyle: UIAlertControllerStyle.Alert ) let okAction = UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: nil) alert.addAction(okAction) self.presentViewController(alert, animated: true, completion: nil) } case .Success: print("Authorized") } } let nib = UINib(nibName: XibNames.EventCollectionViewCell.rawValue, bundle: nil) self.collectionView?.registerNib(nib, forCellWithReuseIdentifier: CollectionViewCellreuseIdentifier.EventCell.rawValue) NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(EventsCollectionViewController.didEventChange(_:)), name: NotifictionNames.CalendarModelDidChangeEventNotification.rawValue, object: nil) } deinit { NSNotificationCenter.defaultCenter().removeObserver(self) } // MARK: Update calendar events func updateCalendarEvents() { self.collectionView?.reloadData() NSNotificationCenter.defaultCenter().postNotificationName(NotifictionNames.TimelineCollectionViewControllerDidUpdateTimelineNotification.rawValue, object: nil) } func didEventChange(notification: NSNotification) { updateCalendarEvents() } // MARK: UICollectionViewDataSource override func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return self.calendar.events.count } override func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell { let cell = collectionView.dequeueReusableCellWithReuseIdentifier(CollectionViewCellreuseIdentifier.EventCell.rawValue, forIndexPath: indexPath) as! EventCollectionViewCell cell.eventModel = self.calendar.events[indexPath.row] return cell } func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize { let eventsCollectionViewFlowLayout = collectionViewLayout as! EventsCollectionViewFlowLayout let event = self.calendar.events[indexPath.row] return eventsCollectionViewFlowLayout.sizeForEvent(event) } override func scrollViewDidScroll(scrollView: UIScrollView) { let (visibles, nearestCenter) = getVisibleCellsAndNearestCenterCell() let eventsCollectionViewFlowLayout = self.collectionViewLayout as! EventsCollectionViewFlowLayout for cellInfo in visibles { let cell = cellInfo.cell as! EventCollectionViewCell cell.hidden = false let event = self.calendar.events[cellInfo.row] var dy: CGFloat = 0.0 var height: CGFloat = eventsCollectionViewFlowLayout.sizeForEvent(event).height var alpha: CGFloat = 0.0 if cell == nearestCenter.cell { height += TimelineHeight alpha = 1.0 } else { dy = (cellInfo.row < nearestCenter.row ? -1 : +1) * TimelineHeight / 2 alpha = 0.5 } UIView.animateWithDuration(0.6, delay: 0.0, usingSpringWithDamping: 0.5, initialSpringVelocity: 0.0, options: .CurveEaseInOut, animations: { () -> Void in cell.bounds.size.height = height cell.transform = CGAffineTransformMakeTranslation(0, dy) cell.alpha = alpha }, completion: nil ) } } }
[ -1 ]
dcb400f14315a4ac4b54db23af9ac4a95b63bf65
7095117efba5cb0b3ac73cb45629c8de4d533721
/Athena/Player/Swift/Frame.swift
2ade6c29afeb90d9e2ea472088314b9834b1087d
[]
no_license
r-aamir/Athena
4d6f6784af7e2c549897f78615a8e2eb29352c9c
db038e8867fa929394439f562090a28733ece692
refs/heads/master
2020-06-30T02:54:39.292627
2019-03-01T09:38:59
2019-03-01T09:38:59
null
0
0
null
null
null
null
UTF-8
Swift
false
false
3,952
swift
// // Frame.swift // Athena // // Created by Theresa on 2019/2/3. // Copyright © 2019 Theresa. All rights reserved. // import MetalKit import Foundation @objc public protocol Frame: NSObjectProtocol { var position: TimeInterval { get } var duration: TimeInterval { get } } @objc class MarkerFrame: NSObject, Frame { var position: TimeInterval = -.greatestFiniteMagnitude var duration: TimeInterval = -.greatestFiniteMagnitude } @objc class AudioFrame: NSObject, Frame { var position: TimeInterval var duration: TimeInterval var samples: UnsafeMutablePointer<Float>? // let length: Int // let outputOffset: Int // let bufferSize: Int deinit { free(samples) } init(position: TimeInterval, duration: TimeInterval, samplesLength: UInt) { self.position = position self.duration = duration } func setting(samplesLength: Int) { } } @objc class NV12VideoFrame: NSObject, Frame, RenderDataNV12 { let width: Int let height: Int let pixelBuffer: CVPixelBuffer let position: TimeInterval let duration: TimeInterval @objc init(position: TimeInterval, duration: TimeInterval, pixelBuffer: CVPixelBuffer) { self.position = position self.duration = duration self.pixelBuffer = pixelBuffer self.width = CVPixelBufferGetWidth(pixelBuffer) self.height = CVPixelBufferGetHeight(pixelBuffer) } } @objc class I420VideoFrame: NSObject, Frame, RenderDataI420 { var luma_channel_pixels: UnsafeMutablePointer<UInt8> var chromaB_channel_pixels: UnsafeMutablePointer<UInt8> var chromaR_channel_pixels: UnsafeMutablePointer<UInt8> let width: Int let height: Int let position: TimeInterval let duration: TimeInterval deinit { luma_channel_pixels.deallocate() chromaB_channel_pixels.deallocate() chromaR_channel_pixels.deallocate() } @objc init(position: TimeInterval, duration: TimeInterval, width: Int, height: Int, frame: UnsafeMutablePointer<AVFrame>) { self.position = position self.duration = duration self.width = width self.height = height let linesize_y = Int(frame.pointee.linesize.0) let linesize_u = Int(frame.pointee.linesize.1) let linesize_v = Int(frame.pointee.linesize.2) let needsize_y = I420VideoFrame.checkSize(width: width, height: height, lineSize: linesize_y) let needsize_u = I420VideoFrame.checkSize(width: width/2, height: height/2, lineSize: linesize_u) let needsize_v = I420VideoFrame.checkSize(width: width/2, height: height/2, lineSize: linesize_v) luma_channel_pixels = UnsafeMutablePointer<UInt8>.allocate(capacity: needsize_y) chromaB_channel_pixels = UnsafeMutablePointer<UInt8>.allocate(capacity: needsize_u) chromaR_channel_pixels = UnsafeMutablePointer<UInt8>.allocate(capacity: needsize_v) I420VideoFrame.copyData(width: width, height: height, src: frame.pointee.data.0!, des: luma_channel_pixels, dataSize: needsize_y) I420VideoFrame.copyData(width: width / 2, height: height / 2, src: frame.pointee.data.1!, des: chromaB_channel_pixels, dataSize: needsize_u) I420VideoFrame.copyData(width: width / 2, height: height / 2, src: frame.pointee.data.2!, des: chromaR_channel_pixels, dataSize: needsize_v) } static func checkSize(width: Int, height: Int, lineSize: Int) -> Int { return max(width, lineSize) * height } static func copyData(width: Int, height: Int, src: UnsafeMutablePointer<UInt8>, des: UnsafeMutablePointer<UInt8>, dataSize: Int) { var temp = des var src = src memset(des, 0, dataSize) for _ in 0..<height { memcpy(temp, src, width) temp += width src += width; } } }
[ -1 ]
d78454e7290ad7735dc4650327af17d88d8f93bf
14dc9c719a563d6e63ce26cc302ea88d660bac23
/github-followers/Services/CacheService/Cache.swift
be6245c355a68e648fa2bf708744267d61efa15e
[]
no_license
Fedor117/github-followers
511fdac3cfc263e324edbcb61b4aa7c4bf7cbe7f
7b8ab557c949eaa5a8b676d2e766f99450940a96
refs/heads/master
2020-12-06T09:04:38.418180
2020-08-06T19:36:55
2020-08-06T19:36:55
232,417,933
0
0
null
null
null
null
UTF-8
Swift
false
false
2,241
swift
// // Cache.swift // github-followers // // Created by Theodor Valiavko on 5/6/20. // Copyright © 2020 Theodor Valiavko. All rights reserved. // import Foundation final class Cache<Key: Hashable, Value> { private let wrapped = NSCache<WrappedKey, Entry>() private let keyTracker = KeyTracker() func insert(_ value: Value, forKey key: Key) { let entry = Entry(key: key, value: value) wrapped.setObject(entry, forKey: WrappedKey(entry.key)) keyTracker.keys.insert(entry.key) } func value(forKey key: Key) -> Value? { guard let entry = wrapped.object(forKey: WrappedKey(key)) else { return nil } return entry.value } func removeValue(forKey key: Key) { wrapped.removeObject(forKey: WrappedKey(key)) } } // MARK: - Entry class declaration private extension Cache { final class Entry { let key: Key let value: Value init(key: Key, value: Value) { self.key = key self.value = value } } } // MARK: - KeyTracker class declaration private extension Cache { final class KeyTracker: NSObject, NSCacheDelegate { var keys = Set<Key>() func cache(_ cache: NSCache<AnyObject, AnyObject>, willEvictObject object: Any) { guard let entry = object as? Entry else { return } keys.remove(entry.key) } } } // MARK: - WrappedKey class declaration private extension Cache { final class WrappedKey: NSObject { let key: Key init(_ key: Key) { self.key = key } override var hash: Int { key.hashValue } override func isEqual(_ object: Any?) -> Bool { guard let value = object as? WrappedKey else { return false } return value.key == key } } } // MARK: - Subscript for Entry extension Cache { subscript(key: Key) -> Value? { get { value(forKey: key) } set { guard let value = newValue else { removeValue(forKey: key) return } insert(value, forKey: key) } } }
[ 179333 ]
4fa6b2c89af635d2ff343fd3e73119b807580b3c
04c472b19271e731bc786218548496c736f53bd7
/CSV/AppDelegate.swift
5d7f13d68db47dc6c69cbff1ee56423f7a28f68a
[]
no_license
WholeCheese/CSV
b622e8e39db5add7c3b74ccda718421fc8fa6eb9
f1fdbbeb9efcbf8fdee85ae6ed06e0c710806db5
refs/heads/master
2021-01-19T05:57:56.790991
2017-12-30T01:41:55
2017-12-30T01:41:55
64,976,820
6
1
null
null
null
null
UTF-8
Swift
false
false
2,538
swift
// // AppDelegate.swift // CSV // // Created by Allan Hoeltje on 8/2/16. // Copyright © 2016 Allan Hoeltje. // // 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 Cocoa @NSApplicationMain class AppDelegate: NSObject, NSApplicationDelegate, CSVParserDelegate { var exampleStart: Date? func applicationDidFinishLaunching(_ aNotification: Notification) { // Insert code here to initialize your application // doStuff() // Use this to time really big files. } func applicationWillTerminate(_ aNotification: Notification) { // Insert code here to tear down your application } func doStuff() { exampleStart = Date() let pathName = "/path/to/a/really/big/file.csv" let csv = CSVParser(path: pathName, delegate: self) let workQueue = DispatchQueue(label: "doStuff!", attributes: []) workQueue.async { csv.startReader() } } func parserDidStartDocument(_ parser: CSVParser) { var name = "" let pathComponents = parser.csvFile.path.components(separatedBy: "/") if let n = pathComponents.last { name = n } NSLog("\n") NSLog("Did start document: \(name)") } func parserDidReadLine(_ parser: CSVParser, line: [String]) { // print("\nline: \(parser.lineCount), \(line.count) fields: \(line)") // for field in line // { // print("|\(field)|") // } } func parserDidEndDocument(_ parser: CSVParser) { NSLog("\nDid end document: \(parser.lineCount) lines read.") NSLog("Finish time: \(Date().timeIntervalSince(exampleStart!))") NSLog("\n") } }
[ -1 ]
dd45b78e0aba01f3ec71709e0f7407e0e44bebd7
5e6f015e69c1f1902abdff88c6151aaf6c8d005e
/00657110_hw2/Preview Content/DemoView.swift
5bdf4ab01e8e3ffc33d6e0164fc1bbbb24b705e2
[]
no_license
jeremy289/00657110_hw2-master-4-master
1022751d18aae9929814d3d495985a41549db256
561b779509dc34b34f3911a6e99d0a289ef3193b
refs/heads/master
2022-05-19T21:03:18.519268
2020-04-29T09:46:29
2020-04-29T09:46:29
259,866,009
0
0
null
null
null
null
UTF-8
Swift
false
false
935
swift
// // DemoView.swift // 00657110_hw2 // // Created by User04 on 2020/4/8. // Copyright © 2020 110. All rights reserved. // import SwiftUI import SafariServices /*if let url = URL(string: "https://developer.apple.com") { let controller = SFSafariViewController(url: url) }*/ struct DemoView: View { let lyrics = ["crazy"] var body: some View { VStack { Button(action: { print("test") }) { Text("Button") } ForEach(lyrics, id: \.self) { (message) in Text(message) } // ForEach(lyrics.indices) { item in // Text(self.lyrics[item]) // } } } } struct DemoView_Previews: PreviewProvider { static var previews: some View { DemoView() } }
[ -1 ]
1fedd0559f7144979adf51718ac3c2e30f4c0f3f
6d3644c6b1c47e9e5fc52237b13b53a00bdd7c8c
/Mage/Extensions/KeyboardHelper.swift
dc80fd70326b2606b22c46030c045a9561052146
[ "Apache-2.0", "LicenseRef-scancode-free-unknown", "LicenseRef-scancode-public-domain" ]
permissive
lemmingapex/mage-ios
3e9e4284bb0c5c758a8bbbfd4bb6f3e47a927ab3
a6108317da243f5efc5861656fb3e38eb95ff299
refs/heads/master
2022-11-18T04:29:36.384469
2022-11-08T17:53:21
2022-11-08T17:53:21
43,529,024
0
0
Apache-2.0
2022-11-08T17:53:23
2015-10-02T00:44:15
Objective-C
UTF-8
Swift
false
false
1,864
swift
extension KeyboardHelper { enum Animation { case keyboardWillShow case keyboardWillHide case keyboardDidShow } typealias HandleBlock = (_ animation: Animation, _ keyboardFrame: CGRect, _ duration: TimeInterval) -> Void } final class KeyboardHelper { private let handleBlock: HandleBlock init(handleBlock: @escaping HandleBlock) { self.handleBlock = handleBlock setupNotification() } deinit { NotificationCenter.default.removeObserver(self) } private func setupNotification() { _ = NotificationCenter.default .addObserver(forName: UIResponder.keyboardWillShowNotification, object: nil, queue: .main) { [weak self] notification in self?.handle(animation: .keyboardWillShow, notification: notification) } _ = NotificationCenter.default .addObserver(forName: UIResponder.keyboardWillHideNotification, object: nil, queue: .main) { [weak self] notification in self?.handle(animation: .keyboardWillHide, notification: notification) } _ = NotificationCenter.default .addObserver(forName: UIResponder.keyboardDidShowNotification, object: nil, queue: .main) { [weak self] notification in self?.handle(animation: .keyboardDidShow, notification: notification) } } private func handle(animation: Animation, notification: Notification) { guard let userInfo = notification.userInfo, let keyboardFrame = (userInfo[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue, let duration = userInfo[UIResponder.keyboardAnimationDurationUserInfoKey] as? Double else { return } handleBlock(animation, keyboardFrame, duration) } }
[ -1 ]
8720163a3b5ed518bd0f03b4b94bc8bba50dbffd
8316e31564a7f11342ed671da87ef67db105970c
/Marvel-App/Views/Duels/Round2View.swift
3c46183327fa13ac0f88765685745de071c0e86c
[]
no_license
rodrigogasp/MarvelApp
6041594a5cc144caf85e77fa8d18ba2f8da3d1f6
a122d77e804fba59760898d4fd78963e773fcef4
refs/heads/master
2023-08-23T09:34:00.683323
2021-10-29T18:15:47
2021-10-29T18:15:47
325,435,622
1
0
null
null
null
null
UTF-8
Swift
false
false
14,212
swift
// // Round2View.swift // Marvel-App // // Created by Rodrigo Gaspar on 28/01/21. // import UIKit class Round2View: UIView { /* ******************************************************************************** ** ** MARK: Variables Declaration ** **********************************************************************************/ var scrollView: UIScrollView! var backButton : UIButton! var titleLabel : UILabel! var fighter1ImageView : UIImageView! var fighter1Label : UILabel! var fighter1Button : UIButton! var fighter1View : UIView! var fighter2ImageView : UIImageView! var fighter2Label : UILabel! var fighter2Button : UIButton! var fighter2View : UIView! var fighter3ImageView : UIImageView! var fighter3Label : UILabel! var fighter3Button : UIButton! var fighter3View : UIView! var fighter4ImageView : UIImageView! var fighter4Label : UILabel! var fighter4Button : UIButton! var fighter4View : UIView! var versus1ImageView : UIImageView! var versus2ImageView : UIImageView! var winner1ImageView : UIImageView! var winner2ImageView : UIImageView! var winner3ImageView : UIImageView! var winner4ImageView : UIImageView! var nextButton : UIButton! /* ****************************************************************************** ** ** MARK: Init ** ********************************************************************************/ init(view: UIView, parent: UIViewController) { super.init(frame: view.frame); view.backgroundColor = .white let width = view.frame.size.width let height = view.frame.size.height var yPosition = height*0.13 //------------------------- Scroll View ----------------------------- scrollView = UIScrollView(frame: CGRect(x: 0, y: 0, width: width, height: height - parent.tabBarController!.tabBar.frame.height)) scrollView.isScrollEnabled = true scrollView.backgroundColor = .marvelBack() view.addSubview(scrollView) //------------------------- Back Button ----------------------------- backButton = UIButton(frame: CGRect(x: width*0.05, y: height*0.02, width: 25, height: 25)) backButton.setImage(UIImage(named: "back"), for: .normal) backButton.imageView?.contentMode = .scaleAspectFit scrollView.addSubview(backButton) //------------------------- Title Label ----------------------------- titleLabel = UILabel(frame: CGRect(x: 0, y: 0, width: 0, height: 0)) titleLabel.text = "Round 2" titleLabel.textColor = .goldBack() titleLabel.font = UIFont.defaultFont(size: 24, type: .regular) titleLabel.sizeToFit() titleLabel.center.y = backButton.center.y titleLabel.center.x = width/2 scrollView.addSubview(titleLabel) //------------------------- Fight 1 ----------------------------- fighter1ImageView = UIImageView(frame: CGRect(x: width*0.05, y: yPosition, width: width*0.45, height: 150)) fighter1ImageView.contentMode = .scaleAspectFill fighter1ImageView.layer.cornerRadius = fighter1ImageView.frame.height/2 fighter1ImageView.layer.maskedCorners = [.layerMinXMinYCorner, .layerMinXMaxYCorner] scrollView.addSubview(fighter1ImageView) winner1ImageView = UIImageView(frame: CGRect(x: 0, y: 0, width: 60, height: 60)) winner1ImageView.image = UIImage(named: "winner") winner1ImageView.contentMode = .scaleAspectFit winner1ImageView.frame.origin.x = fighter1ImageView.frame.origin.x + fighter1ImageView.frame.width - winner1ImageView.frame.width - 10 winner1ImageView.isHidden = true winner1ImageView.alpha = 0 winner1ImageView.frame.origin.y = fighter1ImageView.frame.origin.y + 5 scrollView.addSubview(winner1ImageView) fighter1View = UIView(frame: CGRect(x: width*0.05, y: 0, width: width*0.45, height: 50)) fighter1View.backgroundColor = .goldBack() fighter1View.layer.cornerRadius = 12 fighter1View.layer.maskedCorners = [.layerMinXMaxYCorner] fighter1View.frame.origin.y = yPosition + fighter1ImageView.frame.height scrollView.addSubview(fighter1View) fighter1Label = UILabel(frame: CGRect(x: 0, y: 0, width: width*0.4, height: 45)) fighter1Label.textColor = .black fighter1Label.font = UIFont.defaultFont(size: 16, type: .regular) fighter1Label.numberOfLines = 0 fighter1Label.lineBreakMode = .byWordWrapping fighter1Label.textAlignment = .center fighter1Label.center.x = fighter1View.center.x fighter1Label.center.y = fighter1View.center.y scrollView.addSubview(fighter1Label) fighter1Button = UIButton(frame: CGRect(x: width*0.05, y: yPosition, width: width*0.45, height: 200)) fighter1Button.backgroundColor = .clear fighter1Button.layer.cornerRadius = 12 fighter1Button.layer.maskedCorners = [.layerMinXMinYCorner, .layerMinXMaxYCorner] fighter1Button.frame.origin.y = fighter1ImageView.frame.origin.y scrollView.addSubview(fighter1Button) fighter2ImageView = UIImageView(frame: CGRect(x: width*0.5, y: yPosition, width: width*0.45, height: 150)) fighter2ImageView.contentMode = .scaleAspectFill fighter2ImageView.layer.cornerRadius = fighter2ImageView.frame.height/2 fighter2ImageView.layer.maskedCorners = [.layerMaxXMinYCorner, .layerMinXMaxYCorner] scrollView.addSubview(fighter2ImageView) winner2ImageView = UIImageView(frame: CGRect(x: 0, y: 0, width: 60, height: 60)) winner2ImageView.image = UIImage(named: "winner") winner2ImageView.contentMode = .scaleAspectFit winner2ImageView.frame.origin.x = fighter2ImageView.frame.origin.x + fighter2ImageView.frame.width - winner2ImageView.frame.width - 10 winner2ImageView.isHidden = true winner2ImageView.alpha = 0 winner2ImageView.frame.origin.y = fighter2ImageView.frame.origin.y + 5 scrollView.addSubview(winner2ImageView) fighter2View = UIView(frame: CGRect(x: width*0.5, y: 0, width: width*0.45, height: 50)) fighter2View.backgroundColor = .goldBack() fighter2View.layer.cornerRadius = 12 fighter2View.layer.maskedCorners = [.layerMaxXMaxYCorner] fighter2View.frame.origin.y = yPosition + fighter2ImageView.frame.height scrollView.addSubview(fighter2View) fighter2Label = UILabel(frame: CGRect(x: 0, y: 0, width: width*0.4, height: 45)) fighter2Label.textColor = .black fighter2Label.font = UIFont.defaultFont(size: 16, type: .regular) fighter2Label.numberOfLines = 0 fighter2Label.lineBreakMode = .byWordWrapping fighter2Label.textAlignment = .center fighter2Label.center.x = fighter2View.center.x fighter2Label.center.y = fighter2View.center.y scrollView.addSubview(fighter2Label) fighter2Button = UIButton(frame: CGRect(x: width*0.5, y: 0, width: width*0.45, height: 200)) fighter2Button.backgroundColor = .clear fighter2Button.layer.cornerRadius = 12 fighter2Button.layer.maskedCorners = [.layerMaxXMaxYCorner] fighter2Button.frame.origin.y = fighter2ImageView.frame.origin.y scrollView.addSubview(fighter2Button) versus1ImageView = UIImageView(frame: CGRect(x: 0, y: 0, width: 200, height: 200)) versus1ImageView.image = UIImage(named: "versus") versus1ImageView.contentMode = .scaleAspectFit versus1ImageView.center.x = width/2 versus1ImageView.center.y = fighter1ImageView.center.y scrollView.addSubview(versus1ImageView) yPosition = yPosition + fighter2Button.frame.height + 50 //------------------------- Fight 2 ----------------------------- fighter3ImageView = UIImageView(frame: CGRect(x: width*0.05, y: yPosition, width: width*0.45, height: 150)) fighter3ImageView.contentMode = .scaleAspectFill fighter3ImageView.layer.cornerRadius = fighter3ImageView.frame.height/2 fighter3ImageView.layer.maskedCorners = [.layerMinXMinYCorner, .layerMinXMaxYCorner] scrollView.addSubview(fighter3ImageView) winner3ImageView = UIImageView(frame: CGRect(x: 0, y: 0, width: 60, height: 60)) winner3ImageView.image = UIImage(named: "winner") winner3ImageView.contentMode = .scaleAspectFit winner3ImageView.frame.origin.x = fighter3ImageView.frame.origin.x + fighter3ImageView.frame.width - winner3ImageView.frame.width - 10 winner3ImageView.isHidden = true winner3ImageView.alpha = 0 winner3ImageView.frame.origin.y = fighter3ImageView.frame.origin.y + 5 scrollView.addSubview(winner3ImageView) fighter3View = UIView(frame: CGRect(x: width*0.05, y: 0, width: width*0.45, height: 50)) fighter3View.backgroundColor = .goldBack() fighter3View.layer.cornerRadius = 12 fighter3View.layer.maskedCorners = [.layerMinXMaxYCorner] fighter3View.frame.origin.y = yPosition + fighter3ImageView.frame.height scrollView.addSubview(fighter3View) fighter3Label = UILabel(frame: CGRect(x: 0, y: 0, width: width*0.4, height: 45)) fighter3Label.textColor = .black fighter3Label.font = UIFont.defaultFont(size: 16, type: .regular) fighter3Label.numberOfLines = 0 fighter3Label.lineBreakMode = .byWordWrapping fighter3Label.textAlignment = .center fighter3Label.center.x = fighter3View.center.x fighter3Label.center.y = fighter3View.center.y scrollView.addSubview(fighter3Label) fighter3Button = UIButton(frame: CGRect(x: width*0.05, y: yPosition, width: width*0.45, height: 200)) fighter3Button.backgroundColor = .clear fighter3Button.layer.cornerRadius = 12 fighter3Button.layer.maskedCorners = [.layerMinXMinYCorner, .layerMinXMaxYCorner] fighter3Button.frame.origin.y = fighter3ImageView.frame.origin.y scrollView.addSubview(fighter3Button) fighter4ImageView = UIImageView(frame: CGRect(x: width*0.5, y: yPosition, width: width*0.45, height: 150)) fighter4ImageView.contentMode = .scaleAspectFill fighter4ImageView.layer.cornerRadius = fighter4ImageView.frame.height/2 fighter4ImageView.layer.maskedCorners = [.layerMaxXMinYCorner, .layerMinXMaxYCorner] scrollView.addSubview(fighter4ImageView) winner4ImageView = UIImageView(frame: CGRect(x: 0, y: 0, width: 60, height: 60)) winner4ImageView.image = UIImage(named: "winner") winner4ImageView.contentMode = .scaleAspectFit winner4ImageView.frame.origin.x = fighter4ImageView.frame.origin.x + fighter4ImageView.frame.width - winner4ImageView.frame.width - 10 winner4ImageView.isHidden = true winner4ImageView.alpha = 0 winner4ImageView.frame.origin.y = fighter4ImageView.frame.origin.y + 5 scrollView.addSubview(winner4ImageView) fighter4View = UIView(frame: CGRect(x: width*0.5, y: 0, width: width*0.45, height: 50)) fighter4View.backgroundColor = .goldBack() fighter4View.layer.cornerRadius = 12 fighter4View.layer.maskedCorners = [.layerMaxXMaxYCorner] fighter4View.frame.origin.y = yPosition + fighter4ImageView.frame.height scrollView.addSubview(fighter4View) fighter4Label = UILabel(frame: CGRect(x: 0, y: 0, width: width*0.4, height: 45)) fighter4Label.textColor = .black fighter4Label.font = UIFont.defaultFont(size: 16, type: .regular) fighter4Label.numberOfLines = 0 fighter4Label.lineBreakMode = .byWordWrapping fighter4Label.textAlignment = .center fighter4Label.center.x = fighter4View.center.x fighter4Label.center.y = fighter4View.center.y scrollView.addSubview(fighter4Label) fighter4Button = UIButton(frame: CGRect(x: width*0.5, y: yPosition, width: width*0.45, height: 200)) fighter4Button.backgroundColor = .clear fighter4Button.layer.cornerRadius = 12 fighter4Button.layer.maskedCorners = [.layerMaxXMaxYCorner] fighter4Button.frame.origin.y = fighter4ImageView.frame.origin.y scrollView.addSubview(fighter4Button) versus2ImageView = UIImageView(frame: CGRect(x: 0, y: 0, width: 200, height: 200)) versus2ImageView.image = UIImage(named: "versus") versus2ImageView.contentMode = .scaleAspectFit versus2ImageView.center.x = width/2 versus2ImageView.center.y = fighter3ImageView.center.y scrollView.addSubview(versus2ImageView) yPosition = yPosition + fighter4Button.frame.height + 50 //------------------------- Next Button ----------------------------- nextButton = UIButton(frame: CGRect(x: 0, y: 0, width: width*0.9, height: 50)) nextButton.backgroundColor = .goldBack() nextButton.setTitle("Next", for: .normal) nextButton.setTitleColor(.black, for: .normal) nextButton.center.x = width/2 nextButton.frame.origin.y = fighter4Button.frame.origin.y + fighter4Button.frame.height + 30 nextButton.layer.cornerRadius = 12 scrollView.addSubview(nextButton) scrollView.contentSize = CGSize(width: width, height: yPosition + 200 + 120) } required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } }
[ -1 ]