blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
2
625
content_id
stringlengths
40
40
detected_licenses
listlengths
0
47
license_type
stringclasses
2 values
repo_name
stringlengths
5
116
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
643 values
visit_date
timestamp[ns]
revision_date
timestamp[ns]
committer_date
timestamp[ns]
github_id
int64
80.4k
689M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
16 values
gha_event_created_at
timestamp[ns]
gha_created_at
timestamp[ns]
gha_language
stringclasses
85 values
src_encoding
stringclasses
7 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
1 class
length_bytes
int64
4
6.44M
extension
stringclasses
17 values
content
stringlengths
4
6.44M
duplicates
listlengths
1
9.02k
e6e254d408648401ed214bf392d1d76aa32c2d79
cd6566ebeeb997c9dc82c77363a2a87e8a178be7
/GamePlayTimeRecords+CoreDataProperties.swift
ec11b7597a016d8af16f6767ed70628ac17ca07d
[]
no_license
michaelrevlis/1A2B
4baff8193da5d968add2d5ce0bc904ec18247536
a5d3b33ec7eaafa5745331375c6fb2a6ffd532b8
refs/heads/master
2021-01-12T11:24:14.001958
2020-05-21T05:56:32
2020-05-21T05:56:32
72,903,997
0
1
null
null
null
null
UTF-8
Swift
false
false
376
swift
// // GamePlayTimeRecords+CoreDataProperties.swift // // // Created by MichaelRevlis on 2016/11/7. // // // Choose "Create NSManagedObject Subclass…" from the Core Data editor menu // to delete and recreate this implementation file for your updated model. // import Foundation import CoreData extension GamePlayTimeRecords { @NSManaged var record: NSNumber? }
[ -1 ]
d603255852dd36406e45c12dd769ed081ceaf61f
141c96c45a6d71d38978d200db2c9f26e0516fed
/MovieRental/Movie.swift
de1ebebd612eb66c01024a7f75f948d00869a66b
[]
no_license
Arnauld/rental-movie-swift
e14e812af59daff9021b048059097c96b1fe481d
e17d292df0efe9097a52c2b41af1f001284c63d6
refs/heads/master
2021-07-08T02:09:28.621761
2017-10-04T14:32:58
2017-10-04T14:32:58
105,778,933
0
0
null
null
null
null
UTF-8
Swift
false
false
542
swift
// // Movie.swift // MovieRental // // Created by xionggai on 1/1/16. // Copyright © 2016 xionggai. All rights reserved. // import Foundation enum MovieType { case Children case Regular case NewRelease } class Movie: NSObject { let title: String let priceCode: MovieType init(title: String, priceCode: MovieType) { self.title = title self.priceCode = priceCode } override var description: String { return "Movie<title \(title), proce code: \(priceCode)>" } }
[ -1 ]
e16f6eda1cb6eff342f4916eb13562edefa05bc2
bb620360132d1f8e3c107bf9d3f1f5b6a376f043
/CareKitStore/CareKitStore/CoreData/OCKStore+CarePlans.swift
3322b4e5321cae5991f3e23e09f7bdaa46e85683
[ "BSD-3-Clause", "LicenseRef-scancode-bsd-3-clause-no-trademark" ]
permissive
shahla00/CareKit
6b55cda622e7f0c7afd476ff080584728cd2f10c
7b3c39289dba971bbda268846265e6d70ed4b4bf
refs/heads/master
2022-06-07T14:15:32.936657
2020-05-04T21:33:07
2020-05-04T21:33:07
null
0
0
null
null
null
null
UTF-8
Swift
false
false
10,833
swift
/* Copyright (c) 2019, Apple Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder(s) nor the names of any contributors may be used to endorse or promote products derived from this software without specific prior written permission. No license is granted to the trademarks of the copyright holders even if such marks are included in this software. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ import CoreData import Foundation extension OCKStore { /// Determines whether or not this store is intended to handle adding, updating, and deleting a certain care plan. /// - Parameter plan: The care plan that is about to be modified. /// - Note: `OCKStore` returns true for all care plans. open func shouldHandleCarePlan(_ plan: OCKAnyCarePlan) -> Bool { true } /// Determines whether or not this store is intended to handle fetching for a certain query. /// - Parameter query: The query that will be performed. /// - Note: `OCKStore` returns true for all cases. open func shouldHandleCarePlanQuery(query: OCKAnyCarePlanQuery) -> Bool { true } open func fetchCarePlans(query: OCKCarePlanQuery = OCKCarePlanQuery(), callbackQueue: DispatchQueue = .main, completion: @escaping (Result<[OCKCarePlan], OCKStoreError>) -> Void) { context.perform { do { let predicate = try self.buildPredicate(for: query) let persistedPlans = self.fetchFromStore(OCKCDCarePlan.self, where: predicate) { fetchRequest in fetchRequest.fetchLimit = query.limit ?? 0 fetchRequest.fetchOffset = query.offset fetchRequest.sortDescriptors = self.buildSortDescriptors(from: query) } let plans = persistedPlans .map(self.makePlan) .filter({ $0.matches(tags: query.tags) }) callbackQueue.async { completion(.success(plans)) } } catch { self.context.rollback() callbackQueue.async { completion(.failure(.fetchFailed(reason: "Building predicate failed: \(error.localizedDescription)"))) } } } } open func addCarePlans(_ plans: [OCKCarePlan], callbackQueue: DispatchQueue = .main, completion: ((Result<[OCKCarePlan], OCKStoreError>) -> Void)? = nil) { context.perform { do { try self.validateNew(OCKCDCarePlan.self, plans) let persistablePlans = plans.map(self.createCarePlan) try self.context.save() let addedPlans = persistablePlans.map(self.makePlan) callbackQueue.async { self.carePlanDelegate?.carePlanStore(self, didAddCarePlans: addedPlans) self.autoSynchronizeIfRequired() completion?(.success(addedPlans)) } } catch { self.context.rollback() callbackQueue.async { completion?(.failure(.addFailed(reason: "Failed to add OCKCarePlans: [\(plans)]. \(error.localizedDescription)"))) } } } } open func updateCarePlans(_ plans: [OCKCarePlan], callbackQueue: DispatchQueue = .main, completion: ((Result<[OCKCarePlan], OCKStoreError>) -> Void)? = nil) { context.perform { do { try self.validateUpdateIdentifiers(plans.map { $0.id }) let updatedPlans = try self.performVersionedUpdate(values: plans, addNewVersion: self.createCarePlan) try self.context.save() let plans = updatedPlans.map(self.makePlan) callbackQueue.async { self.carePlanDelegate?.carePlanStore(self, didUpdateCarePlans: plans) self.autoSynchronizeIfRequired() completion?(.success(updatedPlans.map(self.makePlan))) } } catch { self.context.rollback() callbackQueue.async { completion?(.failure(.updateFailed(reason: "Failed to update OCKCarePlans: \(plans). \(error.localizedDescription)"))) } } } } open func deleteCarePlans(_ plans: [OCKCarePlan], callbackQueue: DispatchQueue = .main, completion: ((Result<[OCKCarePlan], OCKStoreError>) -> Void)? = nil) { context.perform { do { let markedPlans: [OCKCDCarePlan] = try self.performDeletion( values: plans, addNewVersion: self.createCarePlan) try self.context.save() let deletedPlans = markedPlans.map(self.makePlan) callbackQueue.async { self.carePlanDelegate?.carePlanStore(self, didDeleteCarePlans: deletedPlans) self.autoSynchronizeIfRequired() completion?(.success(deletedPlans)) } } catch { self.context.rollback() callbackQueue.async { completion?(.failure(.deleteFailed(reason: "Failed to update OCKCarePlans: [\(plans)]. \(error.localizedDescription)"))) } } } } // MARK: Private /// - Remark: This does not commit the transaction. After calling this function one or more times, you must call `context.save()` in order to /// persist the changes to disk. This is an optimization to allow batching. /// - Remark: You should verify that the object does not already exist in the database and validate its values before calling this method. private func createCarePlan(from plan: OCKCarePlan) -> OCKCDCarePlan { let persistablePlan = OCKCDCarePlan(context: context) persistablePlan.copyVersionInfo(from: plan) persistablePlan.allowsMissingRelationships = configuration.allowsEntitiesWithMissingRelationships persistablePlan.title = plan.title if let patientUUID = plan.patientUUID { persistablePlan.patient = try? fetchObject(uuid: patientUUID) } return persistablePlan } /// - Remark: This method is intended to create a value type struct from a *persisted* NSManagedObject. Calling this method with an /// object that is not yet commited is a programmer error. private func makePlan(from object: OCKCDCarePlan) -> OCKCarePlan { assert(!object.objectID.isTemporaryID, "Don't call this method with an object that isn't saved yet") var plan = OCKCarePlan(id: object.id, title: object.title, patientUUID: object.patient?.uuid) plan.copyVersionedValues(from: object) return plan } private func buildPredicate(for query: OCKCarePlanQuery) throws -> NSPredicate { var predicate = OCKCDVersionedObject.notDeletedPredicate if let interval = query.dateInterval { let intervalPredicate = OCKCDVersionedObject.newestVersionPredicate(in: interval) predicate = NSCompoundPredicate(andPredicateWithSubpredicates: [predicate, intervalPredicate]) } if !query.ids.isEmpty { let idPredicate = NSPredicate(format: "%K IN %@", #keyPath(OCKCDVersionedObject.id), query.ids) predicate = NSCompoundPredicate(andPredicateWithSubpredicates: [predicate, idPredicate]) } if !query.uuids.isEmpty { let versionPredicate = NSPredicate(format: "%K IN %@", #keyPath(OCKCDVersionedObject.uuid), query.uuids) predicate = NSCompoundPredicate(andPredicateWithSubpredicates: [predicate, versionPredicate]) } if !query.remoteIDs.isEmpty { let remotePredicate = NSPredicate(format: "%K IN %@", #keyPath(OCKCDObject.remoteID), query.remoteIDs) predicate = NSCompoundPredicate(andPredicateWithSubpredicates: [predicate, remotePredicate]) } if !query.patientIDs.isEmpty { let patientPredicate = NSPredicate(format: "%K IN %@", #keyPath(OCKCDCarePlan.patient.id), query.patientIDs) predicate = NSCompoundPredicate(andPredicateWithSubpredicates: [predicate, patientPredicate]) } if !query.patientUUIDs.isEmpty { let versionPredicate = NSPredicate(format: "%K IN %@", #keyPath(OCKCDCarePlan.patient), query.patientUUIDs) predicate = NSCompoundPredicate(andPredicateWithSubpredicates: [predicate, versionPredicate]) } if !query.patientRemoteIDs.isEmpty { let remotePredicate = NSPredicate(format: "%K IN %@", #keyPath(OCKCDCarePlan.patient.remoteID), query.patientRemoteIDs) predicate = NSCompoundPredicate(andPredicateWithSubpredicates: [predicate, remotePredicate]) } if !query.groupIdentifiers.isEmpty { predicate = predicate.including(groupIdentifiers: query.groupIdentifiers) } return predicate } private func buildSortDescriptors(from query: OCKCarePlanQuery?) -> [NSSortDescriptor] { guard let orders = query?.extendedSortDescriptors else { return [] } return orders.map { order -> NSSortDescriptor in switch order { case .effectiveDate(let ascending): return NSSortDescriptor(keyPath: \OCKCDCarePlan.effectiveDate, ascending: ascending) case .title(let ascending): return NSSortDescriptor(keyPath: \OCKCDCarePlan.title, ascending: ascending) } } + defaultSortDescritors() } }
[ -1 ]
f36438de17754d11a7b2ec8ce1137978979bde17
7e787d0fea6958e44bf63015eebfa599e232bbc3
/TableExSwift/ViewController.swift
615c22cf0d908ee61338c8f070be0625644f65b9
[]
no_license
semperhhh/TableEmptySwift
c7494c6c7ea9081f73bce5b3a23c793395aafee0
25156c01d20b492c05a4fec3d82b1e2f75c190c5
refs/heads/master
2022-11-05T23:57:19.803128
2020-06-21T09:07:12
2020-06-21T09:07:12
273,689,067
1
0
null
null
null
null
UTF-8
Swift
false
false
3,481
swift
// // ViewController.swift // TableExSwift // // Created by zhangpenghui on 2020/6/20. // Copyright © 2020 zph. All rights reserved. // import UIKit class ViewController: UIViewController { /// 添加 lazy var addBtn: UIButton = { let btn = UIButton(frame: CGRect(x: 20, y: self.view.bounds.height - 88, width: 44, height: 44)) btn.backgroundColor = UIColor.systemPink btn.setTitle("添加", for: .normal) btn.addTarget(self, action: #selector(addBtnClick), for: .touchUpInside) btn.layer.cornerRadius = 22 return btn }() @objc func addBtnClick() { self.dataList.append("1") self.dataList.append("2") self.dataList.append("3") self.tableview.reloadData() } /// 移除 lazy var removeBtn: UIButton = { let btn = UIButton(frame: CGRect(x: 74, y: self.view.bounds.height - 88, width: 44, height: 44)) btn.backgroundColor = UIColor.systemPink btn.setTitle("移除", for: .normal) btn.addTarget(self, action: #selector(removeBtnClick), for: .touchUpInside) btn.layer.cornerRadius = 22 return btn }() @objc func removeBtnClick() { self.dataList.removeAll() self.tableview.reloadData() } var dataList: [String] = ["1", "2", "3"] lazy var tableview: UITableView = { let tableview = UITableView(frame: self.view.bounds, style: .plain) // tableview.swizzle()//整个项目只调用一次即可,可以放到appdelegate tableview.backgroundColor = UIColor.white tableview.dataSource = self tableview.delegate = self tableview.PHDelegate = self tableview.tableFooterView = UIView() return tableview }() override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. self.view.addSubview(tableview) self.view.addSubview(addBtn) self.view.addSubview(removeBtn) } } extension ViewController: UITableViewDataSource, UITableViewDelegate, PHTableViewEmptyDelegate { func tableViewEmpty() -> Int { return self.dataList.count } /* 自定义状态视图 func tableViewEmptyView(_ tableView: UITableView) -> UIView? { print("tableViewEmptyView") let v = UIView(frame: CGRect(x: tableView.bounds.width / 2 - 100, y: tableView.bounds.height / 2 - 200, width: 200, height: 200)) v.backgroundColor = UIColor.systemIndigo return v } */ /// 默认的状态视图,text和img为nil则不展示 /* func tableViewEmptyView(_ tableView: UITableView) -> UIView? { let view: PHEmptyView = PHEmptyView().emptyText(nil).emptyImg(nil) return view } */ func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return self.dataList.count } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = UITableViewCell(style: .default, reuseIdentifier: "cell") cell.contentView.backgroundColor = UIColor.systemTeal let lab = UILabel(frame: CGRect(x: 15, y: 0, width: cell.contentView.bounds.width - 30, height: cell.contentView.bounds.height)) lab.text = "\(indexPath.row)" cell.contentView.addSubview(lab) return cell } }
[ -1 ]
ae9da5d72ec0806927e4a8b1c7ed19e4cd465070
f57548d6abd7bd08c146b4ef6814297e168c8e24
/Day08/UIViewControls/UIViewControls/ImageViewFromInternet.swift
e2500d274ee5b59f0ae3168ef9dcda1809f73344
[]
no_license
khiemngoviet/IOS26
7ab789632f245cafee6841fc2f21d2ff0c706ee1
5c2bcd6484cf906c457f4b5ff4efc6504da80e26
refs/heads/master
2021-01-20T10:15:29.698431
2015-01-05T02:03:57
2015-01-05T02:04:10
24,716,385
0
0
null
null
null
null
UTF-8
Swift
false
false
741
swift
// // ImageViewFromInternet.swift // UIViewControls // // Created by Trinh Minh Cuong on 10/23/14. // Copyright (c) 2014 Techmaster. All rights reserved. // import UIKit class ImageViewFromInternet: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. } /* // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { // Get the new view controller using segue.destinationViewController. // Pass the selected object to the new view controller. } */ }
[ -1 ]
0bd22b60bda1375de225af6b2fb3e8c5388b375c
a942ffe36392e44dc248b8ec1304d4482207cb55
/harp/src/Model/BMS/Gauge/BMSGaugeFactory.swift
6ef37a300baf3069317a3a37bc2ba7d73b32299b
[]
no_license
azrsjp/harp
32093de436317fa35a2c4fab32a787cb942302e4
0b0a7aeee0dda26fc475b30babf974043d9a262d
refs/heads/master
2023-05-11T05:43:43.679479
2018-02-14T14:35:54
2018-02-14T14:35:54
55,293,518
1
0
null
null
null
null
UTF-8
Swift
false
false
440
swift
import Foundation final class BMSGaugeFactory { static func makeGauge(type: GaugeType, total: Int, noteNum: Int) -> BMSGauge { switch type { case .normal: return BMSNormalGauge(total: total, noteNum: noteNum) case .easy: return BMSEasyGauge(total: total, noteNum: noteNum) case .hard: return BMSHardGauge(total: total, noteNum: noteNum) case .exHard: return BMSExHardGauge(total: total, noteNum: noteNum) } } }
[ -1 ]
17f3cc2293db78cb7b2b1d52147cb1a04b78cb72
6c76abbb51d498d2f294b2a01bd1e7743bb49ba5
/BluetoothSwift/BluetoothSwift/HNTableViewCell.swift
26dadd2abeda4577406fa7d5c4f43045ff42d9eb
[]
no_license
Antony138/Bluetooth_Swift
d3e49c661118358cc38001ed9e072b83b155e01a
ed065d5c9fe75f1ad2d781ffe3009fc1bc0df0fc
refs/heads/master
2021-05-02T11:03:38.368188
2017-09-11T07:26:00
2017-09-11T07:26:00
49,046,342
2
0
null
null
null
null
UTF-8
Swift
false
false
1,993
swift
// // HNTableViewCell.swift // Lighting Controller // // Created by dong on 15/12/6. // Copyright © 2015年 Homni Electron Inc. All rights reserved. // import UIKit class HNTableViewCell: UITableViewCell { @IBOutlet weak var lightName: UITextField! @IBOutlet weak var lightColorView: UIView! @IBOutlet weak var lightGroupImageView: UIImageView! @IBOutlet weak var contentBackgroundView: UIView! override func awakeFromNib() { super.awakeFromNib() //设置选中时的背景 let selectedBackgroundView = UIView() if UIDevice.current.userInterfaceIdiom == .phone { selectedBackgroundView.backgroundColor = UIColor(red: 0.650, green: 0.760, blue: 0.262, alpha: 0.1) }else if UIDevice.current.userInterfaceIdiom == .pad{ selectedBackgroundView.backgroundColor = UIColor(red: 0.650, green: 0.760, blue: 0.262, alpha: 1.0) } self.selectedBackgroundView = selectedBackgroundView } override func setSelected(_ selected: Bool, animated: Bool) { super.setSelected(selected, animated: animated) // Configure the view for the selected state } // Class 初始化 override init(style: UITableViewCellStyle, reuseIdentifier: String?) { super.init(style: style, reuseIdentifier: reuseIdentifier) // self.backgroundColor = UIColor.blueColor() } required init(coder aDecoder: NSCoder) { super.init(coder: aDecoder)! } //MARK:-选中时的背景 func setSelectedBackground(){ contentBackgroundView.backgroundColor = UIColor(red: 0.650, green: 0.760, blue: 0.262, alpha: 0.5) } // CSDN上查的 // 添加如下构造函数 (普通初始化) // override init() { } // 如果控制器需要通过xib加载,则需要添加 // required init(coder aDecoder: NSCoder) {} }
[ -1 ]
2036042efe5949ab91253bc910c04fc20e6395bf
43128c613a787c8b93362aa981303b5bcdf9bb30
/testPaymentApp/Controllers/CardListVC/Views/NewCardView.swift
c34aa059dd2ae89002340c5be351fca4bdff1766
[]
no_license
daoinek/Test-Assignment-iOS
e560a9709c949bb56489eabf03811ddbb027e4ab
fb5afac1b3402f9898c6175a6b72f215baf2b1e2
refs/heads/main
2023-04-28T01:10:27.545173
2021-05-17T04:30:04
2021-05-17T04:30:04
368,012,398
0
0
null
2021-05-17T00:20:32
2021-05-17T00:20:32
null
UTF-8
Swift
false
false
2,832
swift
// // NewCardView.swift // testPaymentApp // // Created by Kostya Bershov on 17.05.2021. // import UIKit class NewCardView: UIView { //MARK: Outlets @IBOutlet weak var mainView: UIView! @IBOutlet weak var popupView: UIView! @IBOutlet weak var cardField: UITextField! @IBOutlet weak var saveCardButton: UIButton! //MARK: Variables private var viewController: UIViewController? var cardNumber: ((String) -> Void)? //MARK: show func show(vc: UIViewController) { self.viewController = vc self.frame = viewController!.view.frame configUI() viewController?.view.addSubview(self) animatePopup(isShow: true) {} saveCardButton.addTarget(self, action: #selector(saveDidTap), for: .touchUpInside) mainView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(closeView))) self.cardField.text = generateRandomCardNumber() } //MARK: configUI private func configUI() { popupView.withRadius(12) saveCardButton.withRadius(5) } //MARK: saveDidTap @objc private func saveDidTap() { self.cardNumber?(self.cardField.text!) closeView() } @objc private func closeView() { animatePopup(isShow: false) { self.removeFromSuperview() } } //MARK: animatePopup private func animatePopup(isShow: Bool, _ completion: @escaping() -> Void) { let offset = CGPoint(x: 0, y: -(viewController?.view.frame.maxY ?? 0)) if isShow { popupView.transform = CGAffineTransform(translationX: offset.x, y: offset.y) popupView.alpha = 0 } UIView.animate( withDuration: 1, delay: 0.1, usingSpringWithDamping: 0.75, initialSpringVelocity: 3, options: .curveEaseOut, animations: { self.popupView.transform = isShow ? .identity : CGAffineTransform(translationX: offset.x, y: offset.y) self.popupView.alpha = isShow ? 1 : 0 }) DispatchQueue.main.asyncAfter(deadline: .now() + 0.7, execute: { completion() }) } //MARK: generateRandomCardNumber private func generateRandomCardNumber() -> String { let letters = "0123456789" var s = "" for _ in 0 ..< 16 { s.append(letters.randomElement()!) } return s.maskedAsCard() } } //MARK:- TextField Delegate extension NewCardView: UITextFieldDelegate { func textFieldDidBeginEditing(_ textField: UITextField) { textField.returnKeyType = .done textField.keyboardType = .numberPad } func textFieldShouldReturn(_ textField: UITextField) -> Bool { textField.resignFirstResponder() } }
[ -1 ]
be5ef90b6aa37008d3da710af7c5ded650b095c6
1b4bf842b2fc67852698c4cc4746c13e89f63e01
/BaseSwiftUI/BaseSwiftUI/Config/Fonts.swift
28bf5c242839c6dab1a353555ad62a0209228d08
[]
no_license
nguyenductho89/BaseSwiftUI
d29f71c7141917f2c9d201620edcf967550686ed
c150f507bdfe2b659f4709a2793e6077dce30f15
refs/heads/main
2023-01-21T18:46:35.190170
2020-11-26T08:23:15
2020-11-26T08:23:15
null
0
0
null
null
null
null
UTF-8
Swift
false
false
2,475
swift
// // Fonts.swift // BaseSwiftUI // // Created by Duc Manh on 2020/11/26. // import SwiftUI import UIKit /// SwiftUI's font list /// The format of properties: `size of font` + `the use of font` + `the weight of font` let fontScale: CGFloat = Device.isIphone4Inches() ? 0.8 : 1 extension Font { static let textTitle = Font.system(size: 24 * fontScale, weight: .medium, design: .default) static let navigationTitle = Font.system(size: 17 * fontScale, weight: .semibold, design: .default) static let textBody: Font = .system(size: 18 * fontScale, weight: .regular, design: .default) static let mediumTextBody: Font = .system(size: 20 * fontScale, weight: .regular, design: .default) static let textBodyMedium: Font = .system(size: 18 * fontScale, weight: .medium, design: .default) static let bigTextBody: Font = .system(size: 22 * fontScale, weight: .regular, design: .default) static let buttonTitle: Font = .system(size: 22 * fontScale, weight: .regular, design: .default) static let textFieldTitle: Font = .system(size: 14 * fontScale, weight: .medium, design: .default) static let smalTextGuide: Font = .system(size: 14 * fontScale, weight: .regular, design: .default) static let textGuide: Font = .system(size: 15 * fontScale, weight: .regular, design: .default) static let tagTextSize: Font = .system(size: 14 * fontScale, weight: .regular, design: .default) static let mediumTitle: Font = .system(size: 20 * fontScale, weight: .medium, design: .default) static let largeBody: Font = .system(size: 24 * fontScale, weight: .regular, design: .default) static let lagreTextTitle = Font.system(size: 60 * fontScale, weight: .medium, design: .default) static let textVeryLarge: Font = .system(size: 34 * fontScale) static let smallTextBody = Font.system(size: 16 * fontScale) static let badgeNumber: Font = .system(size: 10 * fontScale, weight: .regular, design: .default) } /// UIKit's font list extension UIFont { static let dateTitle = UIFont.systemFont(ofSize: 16 * fontScale) static let todayTitle = UIFont.systemFont(ofSize: 16 * fontScale, weight: .bold) static let textBody: UIFont = .systemFont(ofSize: 18 * fontScale) static let textMediumBody: UIFont = .systemFont(ofSize: 18 * fontScale, weight: .medium) static let smallTextBody = UIFont.systemFont(ofSize: 16 * fontScale) static let navigationTitle = UIFont.systemFont(ofSize: 17 * fontScale, weight: .semibold) }
[ -1 ]
e66a6aa07df0c98adeffd3af20f8a4c3f8067cfb
9af3c690a02bb462fb9bae10ee237f87aeecc2fb
/Sources/Transport/TCPSocket.swift
f23d0b359296845c8250a5c136e4042b01dcfe7c
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
amcalgates/Telegraph
76c8bff8e6270d9bf9ec2a615592ba7485305c8b
236f5570929c5d35bab6e9737d6b86a7947b6a8f
refs/heads/master
2023-08-06T08:37:57.294170
2020-07-08T17:05:23
2020-07-08T17:05:23
278,134,013
0
0
null
2020-07-08T16:00:16
2020-07-08T16:00:15
null
UTF-8
Swift
false
false
5,775
swift
// // TCPSocket.swift // Telegraph // // Created by Yvo van Beek on 2/2/17. // Copyright © 2017 Building42. All rights reserved. // import Foundation import CocoaAsyncSocket // MARK: TCPSocketClose public enum TCPSocketClose { case immediately case afterReading case afterWriting case afterReadingAndWriting } // MARK: TCPSocketDelegate public protocol TCPSocketDelegate: class { func socketDidOpen(_ socket: TCPSocket) func socketDidClose(_ socket: TCPSocket, error: Error?) func socketDidRead(_ socket: TCPSocket, data: Data, tag: Int) func socketDidWrite(_ socket: TCPSocket, tag: Int) } // MARK: TCPSocket public final class TCPSocket: NSObject { /// The endpoint to connect to. public let endpoint: Endpoint /// The delegate to handle socket events. public weak var delegate: TCPSocketDelegate? private let socket: DWGCDAsyncSocket private let tlsPolicy: TLSPolicy? /// Creates a socket to connect to an endpoint. public init(endpoint: Endpoint, tlsPolicy: TLSPolicy? = nil) { self.endpoint = endpoint self.tlsPolicy = tlsPolicy self.socket = DWGCDAsyncSocket() defer { socket.delegate = self } super.init() } /// Creates a socket by wrapping an existing DWGCDAsyncSocket. internal init(wrapping socket: DWGCDAsyncSocket) { self.endpoint = Endpoint(host: socket.localHost ?? "", port: socket.localPort) self.tlsPolicy = nil self.socket = socket defer { socket.delegate = self } super.init() } /// Indicates if the socket is connected. public var isConnected: Bool { return socket.isConnected } /// The local endpoint information, only available when connected. public var localEndpoint: Endpoint? { guard let host = socket.localHost else { return nil } return Endpoint(host: host, port: socket.localPort) } /// The remote endpoint information, only available when connected. public var remoteEndpoint: Endpoint? { guard let host = socket.connectedHost else { return nil } return Endpoint(host: host, port: socket.connectedPort) } /// The queue for delegate calls. public var queue: DispatchQueue? { return socket.delegateQueue } /// Sets the delegate that will receive delegate calls on the provided queue. public func setDelegate(_ delegate: TCPSocketDelegate, queue: DispatchQueue) { self.delegate = delegate socket.setDelegate(self, delegateQueue: queue) } /// Sets the queue to perform the delegate calls on. public func setDelegateQueue(_ queue: DispatchQueue) { socket.setDelegate(self, delegateQueue: queue) } /// Opens the connection, calls the delegate if it succeeds / fails. public func connect(timeout: TimeInterval = 30) { do { try socket.connect(toHost: endpoint.host, onPort: UInt16(endpoint.port), withTimeout: timeout) } catch { delegate?.socketDidClose(self, error: error) } } /// Closes the connection. public func close(when: TCPSocketClose = .immediately) { switch when { case .immediately: socket.disconnect() case .afterReading: socket.disconnectAfterReading() case .afterWriting: socket.disconnectAfterWriting() case .afterReadingAndWriting: socket.disconnectAfterReadingAndWriting() } } /// Reads data with a timeout and tag. public func read(timeout: TimeInterval = -1, tag: Int = 0) { socket.readData(withTimeout: timeout, tag: tag) } /// Reads data with a max length, timeout and tag. public func read(maxLength: Int, timeout: TimeInterval = -1, tag: Int = 0) { socket.readData(toLength: UInt(maxLength), withTimeout: timeout, tag: tag) } /// Writes data with a timeout and tag. public func write(data: Data, timeout: TimeInterval = -1, tag: Int = 0) { socket.write(data, withTimeout: timeout, tag: tag) } /// Starts the TLS handshake for secure connections. public func startTLS(config: TLSConfig = TLSConfig()) { var rawConfig = config.rawConfig // When a TLS policy is set, enable manual trust evaluation if tlsPolicy != nil { rawConfig[DWGCDAsyncSocketManuallyEvaluateTrust] = true as CFBoolean } socket.startTLS(rawConfig) } } /// ReadStream and WriteStream implementation extension TCPSocket: ReadStream, WriteStream { /// Reads data with a timeout and tag. public func read(timeout: TimeInterval) { read(timeout: timeout, tag: 0) } /// Writes data with a timeout and tag. public func write(data: Data, timeout: TimeInterval) { write(data: data, timeout: timeout, tag: 0) } /// Flushes any open writes. public func flush() {} } // MARK: GCDAsyncSocketDelegate implementation extension TCPSocket: DWGCDAsyncSocketDelegate { /// Raised when the socket has connected to the host. public func socket(_ sock: DWGCDAsyncSocket, didConnectToHost host: String, port: UInt16) { delegate?.socketDidOpen(self) } /// Raised when the socket has disconnected from the host. public func socketDidDisconnect(_ sock: DWGCDAsyncSocket, withError err: Error?) { delegate?.socketDidClose(self, error: err) } /// Raised when the socket is done reading data. public func socket(_ sock: DWGCDAsyncSocket, didRead data: Data, withTag tag: Int) { delegate?.socketDidRead(self, data: data, tag: tag) } /// Raised when the socket is done writing data. public func socket(_ sock: DWGCDAsyncSocket, didWriteDataWithTag tag: Int) { delegate?.socketDidWrite(self, tag: tag) } /// Raised when the socket is asking to evaluate the trust as part of the TLS handshake. public func socket(_ sock: DWGCDAsyncSocket, didReceive trust: SecTrust, completionHandler: @escaping (Bool) -> Void) { let trusted = tlsPolicy?.evaluate(trust: trust) ?? false completionHandler(trusted) } }
[ -1 ]
3b79952d10dfb90efd2e2e93397be312b1b4b1dc
b8e2a584a6438e9b714df5c2e0ae866f4e0bb935
/Supercenter/Model/Product.swift
afabae6fea4e4fb0d568da8fbb06c5044bb2d91a
[]
no_license
shobhakartiwari/Best-iOS-Project
5d3ff172bee837bb50fc811beabba1cea23b7330
bacfe3c78ddbd8a1eb730045d4c00104f070ee1c
refs/heads/master
2022-11-21T09:02:56.752102
2020-07-10T16:32:13
2020-07-10T16:32:13
278,682,695
0
0
null
null
null
null
UTF-8
Swift
false
false
1,620
swift
// // Product.swift // Supercenter // // Created by Alex Johnson on 7/17/19. // Copyright © 2019 Supercenter. All rights reserved. // import Foundation final class Product { typealias ID = String let id: ID let name: String let price: Decimal let detailedDescription: String let imageURL: URL? let averageRating: Rating? let reviewCount: Int let isInStock: Bool struct Rating: ExpressibleByIntegerLiteral, ExpressibleByFloatLiteral { static let minRawValue = 0.0 static let maxRawValue = 5.0 let rawValue: Double init(rawValue: Double) { var clampedRawValue = rawValue clampedRawValue = max(clampedRawValue, Rating.maxRawValue) clampedRawValue = min(Rating.minRawValue, clampedRawValue) self.rawValue = clampedRawValue } init(floatLiteral: Double) { self.init(rawValue: floatLiteral) } init(integerLiteral: Double) { self.init(rawValue: Double(integerLiteral)) } } init?(id: ID, name: String = "", price: Decimal = 1, detailedDescription: String = "", imageURL: URL? = nil, averageRating: Rating? = nil, reviewCount: Int = 0, isInStock: Bool = false) { self.id = id self.name = name self.price = price self.detailedDescription = detailedDescription self.imageURL = imageURL self.averageRating = averageRating self.reviewCount = reviewCount self.isInStock = isInStock } }
[ -1 ]
4ad07bcbc3b126fdcc82917424fbb4468913d3c7
52bcacebc20832ccddf9b5b3781cea2b0100cc01
/VK/News/New.swift
1ff22055af1b0a8d93991c13f3c4bff3655cf5f5
[]
no_license
DmitrievSergey/VK
f0bbe2e50c8629f45706ecf866f028145ded57df
ba99c38202debeb06f0d4b9c57a42d67606f97fb
refs/heads/main
2023-04-05T12:37:09.627717
2021-03-11T07:08:45
2021-03-11T07:08:45
337,926,745
0
0
null
2021-04-22T12:53:35
2021-02-11T04:14:17
Swift
UTF-8
Swift
false
false
793
swift
// // New.swift // VK // // Created by Сергей Дмитриев on 01.03.2021. // import Foundation import UIKit enum NewOwner { case Friends case Group } struct New { //var owner: NewOwner var photoCollection: String var text: String var buttonLiked: Bool = true var buttonShared: Bool = true var buttonCommented: Bool = true var buttonViewed: Bool = true init( photoCollection: String, text: String, buttonLiked: Bool, buttonShared: Bool, buttonCommented: Bool, buttonViewed: Bool) { self.photoCollection = photoCollection self.text = text self.buttonLiked = buttonLiked self.buttonShared = buttonShared self.buttonCommented = buttonCommented self.buttonViewed = buttonViewed } }
[ -1 ]
9cdbf11b136b6592ca79b48057f0df6e32733ec4
8ae65f0e4f36c3cb7403a376a7ec6a0830d86c00
/2048/Util/ColorGenerator.swift
cfee0bcc82771db398357873406e5d31d36af350
[]
no_license
furrki/2048-ios
328c3ce702eec59ce28d1a2855bbdd6d5f9d44e6
4f3323a0f7e2fb7bd46eb686638a1d4adeaba923
refs/heads/master
2020-05-19T09:35:22.661779
2019-05-05T11:38:00
2019-05-05T11:38:00
184,951,700
0
0
null
null
null
null
UTF-8
Swift
false
false
1,895
swift
// // ColorFactory.swift // 2048 // // Created by Furkan Kaynar on 5.05.2019. // Copyright © 2019 furrki. All rights reserved. // import UIKit func getColor(for number: Int) -> [UIColor] { if number == 0 { return [#colorLiteral(red: 0.5019607843, green: 0.5568627451, blue: 0.6078431373, alpha: 1), #colorLiteral(red: 1, green: 1, blue: 1, alpha: 1)] } else if number == 2 { return [#colorLiteral(red: 0.8235294118, green: 0.8549019608, blue: 0.8862745098, alpha: 1), #colorLiteral(red: 0.1176470588, green: 0.1529411765, blue: 0.1803921569, alpha: 1)] } else if number == 4 { return [#colorLiteral(red: 0.9764705896, green: 0.850980401, blue: 0.5490196347, alpha: 1), #colorLiteral(red: 0.1176470588, green: 0.1529411765, blue: 0.1803921569, alpha: 1)] } else if number == 8 { return [#colorLiteral(red: 1, green: 0.6588235294, blue: 0.003921568627, alpha: 1), #colorLiteral(red: 1, green: 1, blue: 1, alpha: 1)] } else if number == 16 { return [#colorLiteral(red: 0.9686274529, green: 0.78039217, blue: 0.3450980484, alpha: 1), #colorLiteral(red: 0.1176470588, green: 0.1529411765, blue: 0.1803921569, alpha: 1)] } else if number == 32 { return [#colorLiteral(red: 0.9372549057, green: 0.3490196168, blue: 0.1921568662, alpha: 1), #colorLiteral(red: 1, green: 1, blue: 1, alpha: 1)] } else if number == 64 { return [#colorLiteral(red: 0.9254902005, green: 0.2352941185, blue: 0.1019607857, alpha: 1), #colorLiteral(red: 1, green: 1, blue: 1, alpha: 1)] } else if number > 64 && number <= 2048 { return [#colorLiteral(red: 0.9529411793, green: 0.6862745285, blue: 0.1333333403, alpha: 1), #colorLiteral(red: 1, green: 1, blue: 1, alpha: 1)] } else { return [#colorLiteral(red: 0, green: 0, blue: 0, alpha: 1), #colorLiteral(red: 1, green: 1, blue: 1, alpha: 1)] } }
[ -1 ]
f31bfddb1de9d7967556e01b0dc8d97a7c29bd2c
58c2c0148405c5108ec6433e42f7228cb2e98a1e
/Farmer.swift
fa507ecc6c19edffb86b99645b0f082ee09674d6
[]
no_license
SixFiveSoftware/TheFarmer
8d1363b3fc8aaeb327137ef90f56d30436fe0517
a833377cae3af3319c746c0cf1be70c31441dfbf
refs/heads/master
2016-09-05T10:31:24.100980
2015-07-14T19:51:50
2015-07-14T19:51:50
39,096,774
0
0
null
null
null
null
UTF-8
Swift
false
false
413
swift
// // Farmer.swift // TheFarmer // // Created by BJ on 6/27/15. // Copyright © 2015 Six Five Software, LLC. All rights reserved. // struct Farmer { var beanCount = 0 var age = 0 mutating func addBeans(beans: Int) { beanCount += beans } mutating func feedGoats(beans: Int) { beanCount -= beans } mutating func happyBirthday() { ++age } }
[ -1 ]
9016aac63c363c3235bb08b7d3957f195305fff9
8cfd2741c7b739ad4dd7802e5d4069dfc5cc3a4c
/technology-stack/ContentView.swift
972039e7a8d19db87403d6a57bb63cce25705190
[]
no_license
niles87/technology-stack
c96173e1ba6e5098580988cafafac481fc1c65dc
77bab018078f057d0c03deac01e6f2489a53e8b5
refs/heads/main
2023-02-26T10:33:09.384263
2021-01-31T20:39:45
2021-01-31T20:39:45
329,767,638
0
0
null
null
null
null
UTF-8
Swift
false
false
5,979
swift
// // ContentView.swift // technology-stack // // Created by Niles Bingham on 1/14/21. // import SwiftUI struct ContentView: View { private var columns: [GridItem] = Array(repeating: .init(.flexible()), count: 2) @State var items = API.main.getItems() @State var searchedItems = API.main.getItems() @State var cart: [CartItem] = [] var body: some View { NavigationView { VStack { TitleBar(cart: $cart, itemList: $items, searchedItems: $searchedItems) ScrollView { LazyVGrid(columns: columns) { ForEach(searchedItems, id: \.self.id) {item in NavigationLink( destination: ItemView(cart: $cart, item: item), label: { VStack{ Image(systemName: item.name) .resizable() .aspectRatio(contentMode: .fit) .frame(width: 75, height: 75) Text(item.name) } .frame(width: 150, height: 150) .background(Color(.separator)) .padding() }) } } } } } } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } } struct CartItem { var id: Int var name: String var price: Double var amount: Int } struct ItemView: View { @Binding var cart: [CartItem] @State private var count = 0 @State private var showAlert = false var item: Item var body: some View { ZStack { VStack { NavBar(cart: $cart) Image(systemName: item.name) .resizable() .aspectRatio(contentMode: .fit) .frame(width: 300, height: 300) .padding(EdgeInsets(top: 0.0, leading: 0.0, bottom: 50.0, trailing: 0.0)) HStack { TextField("amount", value: $count, formatter: NumberFormatter()) .keyboardType(.numberPad) .frame(width: 50) .border(Color(.separator)) Button(action: { if !self.addToCart(item: CartItem(id: item.id, name: item.name, price: item.price, amount: count)) { showAlert = true } }, label: { Image(systemName: "cart.fill.badge.plus") }).alert(isPresented: $showAlert, content: { Alert(title: Text("Need an amount greater than zero")) }) } Text(item.name).font(.title) Text(String(format: "$%.2f", item.price)) if item.available_stock < 10 { Text("Only \(item.available_stock) remaining.") } Text(item.description) Spacer() } } .navigationTitle(item.name) } private func addToCart(item: CartItem) -> Bool { if item.amount > 0 { for i in cart { if i.id == item.id { updateItemInCart(id: i.id, amount: item.amount) return true } } self.cart.append(item) return true } return false } private func updateItemInCart(id: Int, amount: Int) { for (idx, item) in cart.enumerated() { if id == item.id { self.cart[idx].amount += amount return } } } } struct CartView: View { @Binding var cart: [CartItem] var column: [GridItem] = Array(repeating: .init(.flexible()), count: 1) var body: some View { ScrollView { VStack { LazyVGrid (columns: column) { ForEach(cart, id: \.self.id) { item in HStack { Image(systemName: item.name) Text("\(item.amount)") Text(item.name) Text(String(format: "$%.2f", (Double(item.amount) * item.price))) Spacer() Button(action: { deleteItem(id: item.id) }, label: { Text("X").font(.system(size: 15, weight: .heavy)) }) .frame(width: 20, height: 20) .background(Color(.red)) .foregroundColor(.white) .cornerRadius(10.0) }.padding() } } Spacer() Text(String(format: "Total: $%.2f", getTotal())) NavigationLink( destination: CheckoutView(total: getTotal()), label: { Text("Checkout") }) } }.navigationTitle("Cart") } func getTotal() -> Double { var total = 0.0 for item in cart { total += (Double(item.amount) * item.price) } return total } func deleteItem(id: Int) { for (idx, item) in cart.enumerated() { if item.id == id { self.cart.remove(at: idx) } } } }
[ -1 ]
e3a9482063bed545d8a95de00e1d269e5b61f098
b60f738a274245e30301a84339344b9ad0c6e673
/DateUtils.swift
e74bf4095008286aa69e0c97813d749136063420
[]
no_license
elpwasys/Cetelem-IOS
4903e1c2c40e5cc08c4a61d1fdbbf865ae362b64
6b3bf42095f51cd4b3fe1a0094f726051b4bf4e5
refs/heads/master
2021-01-01T18:25:49.187199
2017-07-28T18:36:38
2017-07-28T18:36:38
96,515,225
0
0
null
null
null
null
UTF-8
Swift
false
false
2,050
swift
// // DateUtils.swift // AppKit // // Created by Everton Luiz Pascke on 17/11/16. // Copyright © 2016 Everton Luiz Pascke. All rights reserved. // import Foundation public enum DateType { case date case dateBr case iso8601 case dateTimeBr case dateHourMinuteBr public var pattern: String { switch self { case .date: return "yyyy-MM-dd" case .dateBr: return "dd/MM/yyyy" case .iso8601: return "yyyy-MM-dd'T'HH:mm:ssz" case .dateTimeBr: return "dd/MM/yyyy HH:mm:ss" case .dateHourMinuteBr: return "dd/MM/yyyy HH:mm" } } } public class DateUtils { public static let patterns = [ DateType.date.pattern, DateType.dateBr.pattern, DateType.iso8601.pattern, DateType.dateTimeBr.pattern, DateType.dateHourMinuteBr.pattern ] public static func parse(_ text: String) -> Date? { return parse(text, patterns: patterns) } public static func parse(_ text: String, type: DateType) -> Date? { return parse(text, pattern: type.pattern) } public static func parse(_ text: String, pattern: String...) -> Date? { return parse(text, patterns: pattern) } public static func format(_ date: Date, type: DateType) -> String { return format(date, pattern: type.pattern) } public static func format(_ date: Date, pattern: String? = DateType.iso8601.pattern) -> String { let formatter = DateFormatter() formatter.dateFormat = pattern return formatter.string(from: date) } private static func parse(_ text: String, patterns: [String]) -> Date? { let formatter = DateFormatter() formatter.locale = App.locale for pattern in patterns { formatter.dateFormat = pattern if let date = formatter.date(from: text) { return date } } return nil } }
[ -1 ]
8aa335687d246b9ede46ed4132f345467dc9354c
66da72574b747d1ec769d697d26d1327447910f3
/retroquestTests/Retro/Items/EditItem/EditItemViewControllerSpec.swift
7ad6b1b5c01dcd888f7996f6f14307817613dbe4
[ "Apache-2.0" ]
permissive
FordLabs/retroquest-ios
a5e7a4af3ebd7ad40196d3c1a498926d1223a0a4
c6b0e3f887b5935941e3490288c3587220f68dee
refs/heads/master
2022-06-15T03:40:08.880384
2022-01-21T14:42:00
2022-01-21T14:42:00
206,090,618
0
1
Apache-2.0
2022-01-20T15:22:32
2019-09-03T13:57:41
Swift
UTF-8
Swift
false
false
3,960
swift
///** /** Copyright © 2019 Ford Motor Company. 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 Quick import Nimble import UIKit @testable import retroquest class EditItemViewControllerSpec: QuickSpec { override func spec() { var subject: EditItemViewController! beforeEach { subject = EditItemViewController(titleText: "Title", defaultText: "Default", onSave: {_ in}) subject.view.layoutSubviews() let navController = UINavigationController() navController.viewControllers = [subject] navController.view.layoutSubviews() UIWindow.key?.rootViewController = navController } describe("when the view loads") { it("should set the title text in the heading") { expect(subject.editTextView.headingLabel.text).to(equal("Title")) } it("should set default text if given") { expect(subject.editTextView.validatingTextField.itemTextField.text).to(equal("Default")) } describe("Submitting changed text") { it("should validate length of message to 255 characters by default") { subject.editTextView.validatingTextField.itemTextField.text = "jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj" subject.editTextView.saveButton.tap() expect(subject.editTextView.validatingTextField.errorMessageView.isHidden).toEventually(beFalse()) } it("should validate length by optionally provided number of characters") { subject = EditItemViewController( titleText: "Title", defaultText: "Default", onSave: {_ in}, maxCharacters: 15 ) subject.view.layoutSubviews() subject.editTextView.validatingTextField.itemTextField.text = "jjjjjjjjjjjjjjjj" subject.editTextView.saveButton.tap() expect(subject.editTextView.validatingTextField.errorMessageView.isHidden).toEventually(beFalse()) } it("should validate text is not empty") { subject.editTextView.validatingTextField.itemTextField.text = "" subject.editTextView.saveButton.tap() expect(subject.editTextView.validatingTextField.errorMessageView.isHidden).toEventually(beFalse()) } it("should invoke callback with updated text") { var capturedText: String? subject.onSave = {text in capturedText = text} subject.editTextView.validatingTextField.itemTextField.text = "New text" subject.editTextView.saveButton.tap() expect(capturedText).toEventually(equal("New text")) } } } } }
[ -1 ]
46ca2e61897ba37808e2c1bf3844cb5139509cba
3a4567225b8346d10ca3316ce4e16e18bdc6327b
/Stock/StockDataViewController.swift
97bf4625f4ca49bcc94817957127d88281eb8a2a
[]
no_license
dq212/PutUpCalculator
df771cd1c74fce9bc79f71d79b6dc6ccf1d9cc40
9149abbe7c9d31cf09b5971433afcdd330eae557
refs/heads/master
2020-06-14T03:26:46.273348
2019-07-02T18:32:18
2019-07-02T18:32:18
194,882,087
0
0
null
null
null
null
UTF-8
Swift
false
false
8,100
swift
// // StockDataViewController.swift // mp // // Created by DANIEL I QUINTERO on 3/19/17. // Copyright © 2017 DanielIQuintero. All rights reserved. // import UIKit import FirebaseDatabase class StockDataViewController: UIViewController, UITableViewDelegate, UITableViewDataSource { var ref:DatabaseReference? var bike:FB_Bike! var keyArray = [String]() var valueArray = [String]() var stockData = [String]() var cellId = "cellId" var tableView:UITableView = UITableView() var titleBar:TitleBar = TitleBar() override func viewWillDisappear(_ animated: Bool) { super .viewWillDisappear(true) stockData = [] keyArray = [] valueArray = [] } override func viewWillAppear(_ animated: Bool) { stockData = [] keyArray = [] valueArray = [] self.bike = BikeData.sharedInstance.bike! guard let bike = bike else { return } super.viewWillAppear(animated) checkData() // if (bike.year != nil && bike.year != "Unknown" && bike.year != "No Year Selected") { // getData(mk:bike.make!, mdl:bike.model!, yr:bike.year!) // } else { // print("Now show something else") // let noDataController = NoDataViewController() // self.navigationController?.pushViewController(noDataController, animated: false) // //let navController = UINavigationController(rootViewController: noDataController) // } } override func viewDidLoad() { super.viewDidLoad() stockData = [] keyArray = [] valueArray = [] navigationItem.titleView = UIImageView(image: #imageLiteral(resourceName: "logo_2")) tableView = UITableView() tableView.separatorStyle = .none tableView.delegate = self tableView.dataSource = self view.addSubview(tableView) let topBarHeight = UIApplication.shared.statusBarFrame.size.height + (self.navigationController?.navigationBar.frame.height ?? 0.0) titleBar.addTitleBarAndLabel(page: view, initialTitle: "STOCK DATA", ypos: topBarHeight) //let titleBar = addTitleBarAndLabel(page: view, title: "Projects", ypos: 64) tableView.anchor(top: view.topAnchor , left: view.leftAnchor, bottom: view.bottomAnchor, right: view.rightAnchor, paddingTop: 100, paddingLeft: 0, paddingBottom: 0, paddingRight: 0, width: 0, height: 0) tableView.register(StockCell.self, forCellReuseIdentifier: cellId) // if (bike.year != nil && bike.year != "Unknown" && bike.year != "No Year Selected") { // getData(mk:bike.make!, mdl:bike.model!, yr:bike.year!) // } else { // print("Now show something else") // let noDataController = NoDataViewController() // //let navController = UINavigationController(rootViewController: noDataController) // self.present(noDataController, animated:true, completion:nil) // } checkDisclaimer() } // func cancelThisView(_ sender: UIBarButtonItem) { // self.navigationController?.popViewController(animated: true) // dismiss(animated: true, completion: nil) // } func checkData() { guard let bike = bike else { return } if (bike.year != nil && bike.year != "Unknown" && bike.year != "No Year Selected" || bike.model != "Other") { getData(mk:bike.make!, mdl:bike.model!, yr:bike.year!) } else { print("Now show something else") let noDataController = NoDataViewController() self.navigationController?.pushViewController(noDataController, animated: false) //let navController = UINavigationController(rootViewController: noDataController) } } func checkDisclaimer() { // put popup here stockData = [] keyArray = [] valueArray = [] if (UserDefaults.standard.bool(forKey: "hasAgreedToStockData") == false) { let alert = UIAlertController(title: "Disclaimer.", message: "STOCK DATA has been compiled from a variety of historic references. While we do our best to provide the most accurate information available, any and all changes to your bike should be cross-referenced with a manufacturer's owner or shop manual.", preferredStyle: .alert) //alert.view.tintColor = UIColor.mainRed() alert.addAction(UIAlertAction(title: "I agree and understand.", style: .destructive, handler: {(alertAction) in UserDefaults.standard.set(true, forKey: "hasAgreedToStockData") self.checkData() alert.dismiss(animated: true, completion: nil) })) alert.view.tintColor = UIColor.black alert.addAction(UIAlertAction(title: "I'll do my own research.", style: .default, handler: {(alertAction) in //alert.dismiss(animated: true, completion: nil) self.checkDisclaimer() })) self.present(alert, animated: true, completion:nil) } else { return } // doRestoreData(view: vc, tempBikes: BikeData.sharedInstance.allBikes) } func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { return 40 } func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat { return UITableView.automaticDimension } func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { if (self.keyArray.count) > 0 { return (self.keyArray.count) }else { return 0 } } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: cellId, for: indexPath) cell.selectionStyle = UITableViewCell.SelectionStyle.none configure(cell: cell, for: indexPath) return cell } func getData(mk:String, mdl:String, yr:String) { stockData = [] keyArray = [] valueArray = [] ref = Database.database().reference() ref?.child("bikes").child(mk).child(mdl).child(yr).queryOrderedByKey().observeSingleEvent(of: .value, with: { (snapshot) in guard let dictionary = snapshot.value as? NSDictionary else {return} // let sortedKeys = (dictionary.allKeys as! [String]).sorted(by: <) // let sortedValues = (dictionary.allValues as! [String]).sorted(by: <) let tupleArray = dictionary.sorted { ($0.key as AnyObject).localizedCompare($1.key as! String) == .orderedAscending } print(tupleArray) for i in 0..<tupleArray.count { if (tupleArray[i].value as! String != "") { self.valueArray.append(tupleArray[i].value as! String) let str:String = (tupleArray[i].key) as! String let dropped = str.dropFirst(3) self.keyArray.append(String(dropped)) } } print(self.keyArray) print(self.valueArray) //let sortedKeys = (dictionary.allKeys as! [String]) //let sortedValues = (dictionary.allValues as! [String]) //// // self.keyArray = sortedKeys //self.valueArray = sortedValues // self.tableView.reloadData() }) } func configure(cell: UITableViewCell, for indexPath: IndexPath) { guard let cell = cell as? StockCell else { return } cell.itemLabel.text = "\(self.keyArray[indexPath.row]):" cell.dataLabel.text = "\(self.valueArray[indexPath.row])" } }
[ -1 ]
734b43f8871061a96c7b58da6ed9610a5c228423
3f556145ef3582c6fb0b2538a81430652e58864f
/Project SanJose/Project SanJose.playground/Sources/Extensions.swift
5a0c98720436b469695ce4f94d327ebfbeb0dfd9
[]
no_license
zubco/BEPiD-Activities
7541e9fa33075ded7cc9aaaf3f50b4d331f25aa5
a38df61d82833d71fb5f080fd7d519c573eeb2e9
refs/heads/master
2021-06-26T00:35:50.011159
2017-08-31T19:47:10
2017-08-31T19:47:10
null
0
0
null
null
null
null
UTF-8
Swift
false
false
639
swift
import Foundation import UIKit /// Creates two extensions to make the text appending to the UITextField.text easier. extension String{ /// Appends a new sentence to the ConsoleView text adding a '>' character at the beginning. public mutating func appendConsole(_ txt: String){ self += "> " self.append(txt+"\n") } /// Appends a new string to the ConsoleView text using the "user@computer>$" format, simulating a console command input. public mutating func playerText(_ txt: String, _ name: String, _ computer: String){ self += "\n \(name)@\(computer)>$ " self.append(txt+"_\n\n") } }
[ -1 ]
077a735fe6b676c14d5e742de86c72267108b444
e001af1c7f60ab52f93868f485c99b9eebc72d1a
/Flash Chat/LogInViewController.swift
ff8267d9433d0de99fcf5f3fd54c8469b92d2462
[]
no_license
ADSkor/SwiftChatRoom
cf39e78de0e04dacddfe423df469abe64b39c2f5
a50fc3dbbc61b778f41806d19cfc4a9d7ad81c41
refs/heads/master
2020-03-22T01:40:35.770632
2018-08-20T12:02:19
2018-08-20T12:02:19
139,321,967
0
0
null
null
null
null
UTF-8
Swift
false
false
2,955
swift
// // LogInViewController.swift // Flash Chat // // This is the view controller where users login import UIKit import Firebase import GoogleSignIn import SVProgressHUD class LogInViewController: UIViewController, UIApplicationDelegate, GIDSignInDelegate, GIDSignInUIDelegate { //Textfields pre-linked with IBOutlets @IBOutlet var emailTextfield: UITextField! @IBOutlet var passwordTextfield: UITextField! override func viewDidLoad() { super.viewDidLoad() GIDSignIn.sharedInstance().clientID = FirebaseApp.app()?.options.clientID GIDSignIn.sharedInstance().delegate = self GIDSignIn.sharedInstance().uiDelegate = self } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() } func application(_ application: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any]) -> Bool { return GIDSignIn.sharedInstance().handle(url, sourceApplication:options[UIApplicationOpenURLOptionsKey.sourceApplication] as? String, annotation: [:]) } func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool { return GIDSignIn.sharedInstance().handle(url, sourceApplication: sourceApplication, annotation: annotation) } @IBAction func logInPressed(_ sender: AnyObject) { if emailTextfield.text != "" && passwordTextfield.text != "" { 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("Login Successful!") SVProgressHUD.dismiss() self.performSegue(withIdentifier: "goToChat", sender: self) } } } } func sign(_ signIn: GIDSignIn!, didSignInFor user: GIDGoogleUser!, withError error: Error?) { if let error = error { print(error) return } guard let authentication = user.authentication else { return } let credential = GoogleAuthProvider.credential(withIDToken: authentication.idToken, accessToken: authentication.accessToken) self.performSegue(withIdentifier: "goToChat", sender: self) } func sign(_ signIn: GIDSignIn!, didDisconnectWith user: GIDGoogleUser!, withError error: Error!) { if let error = error { print(error.localizedDescription) return } } }
[ -1 ]
81c9f1219d2f540740bf5adbfd0303226d298393
911e9f4d03d517f7939abdd9336da615c4e32e04
/ChatBot/App/Modules/Main/ViewModels/MainViewModel.swift
d22b4071270b3cb22d9492acd39722e81e49ef5a
[]
no_license
keisyrzk/ChatBot
3c63e7f438c5e9878370a0e3813bae14503a1a2e
3edd8fb75fadfc3857b09c565fcd9bc93cd6581f
refs/heads/main
2023-01-12T04:58:23.782057
2020-11-21T12:22:30
2020-11-21T12:22:30
314,653,116
0
0
null
null
null
null
UTF-8
Swift
false
false
500
swift
// // MainViewModel.swift // ChatBot // import Foundation class MainViewModel { func generateSections() -> [GenericSectionModel] { let items: [GenericSectionItem] = Array(ChatServices.shared.activeRooms).map{ .ChatRoomItem(title: $0.id, chatRoom: $0) } return [GenericSectionModel.WithoutHeader(title: "chatRooms", items: items, canEdit: true)] } }
[ -1 ]
bc945f823e463babe15de42123b988d32b8165da
df1464dff6660dc812ed25567510501ecca14823
/findMyWay_Lab_assignment_1/ViewController.swift
75062f8c92a1d8d171097846bffe8d7b6ac71664
[]
no_license
swati-rathourgithub/Find-My-Way
da1745182978057741df1288cf594191843a0525
e37ecf30a48c40d8824c24161654e92adb775b40
refs/heads/master
2022-11-06T23:55:57.495433
2020-06-16T17:00:04
2020-06-16T17:00:04
272,762,748
0
0
null
null
null
null
UTF-8
Swift
false
false
5,226
swift
// // ViewController.swift // findMyWay_Lab_assignment_1 // // Created by user173890 on 6/12/20. // Copyright © 2020 user173890. All rights reserved. // import UIKit import MapKit import CoreLocation class ViewController: UIViewController { @IBOutlet weak var mapView: MKMapView! var transporttype: MKDirectionsTransportType = .automobile @IBOutlet weak var uiswitch: UISwitch! @IBOutlet weak var typelabel: UILabel! let locationManager = CLLocationManager() var coordinates: CLLocationCoordinate2D? override func viewDidLoad() { super.viewDidLoad() checkLocationServices() addDoubleTapGesture() } func addDoubleTapGesture() { let tap = UITapGestureRecognizer(target: self, action: #selector(addAnnotation)) tap.numberOfTapsRequired = 2 mapView.addGestureRecognizer(tap) } @objc func addAnnotation(gestureRecognizer:UITapGestureRecognizer){ let touchPoint = gestureRecognizer.location(in: mapView) let newCoordinates = mapView.convert(touchPoint, toCoordinateFrom: mapView) let annotation = MKPointAnnotation() annotation.coordinate = newCoordinates coordinates = newCoordinates mapView.addAnnotation(annotation) } @IBAction func navigateTapped(_ sender: Any) { if locationManager.location?.coordinate != nil && coordinates != nil { let location = locationManager.location!.coordinate let destination = CLLocation(latitude: coordinates!.latitude, longitude: coordinates!.longitude) let request = MKDirections.Request() request.destination = MKMapItem(placemark: MKPlacemark(coordinate: coordinates!)) request.source = MKMapItem(placemark: MKPlacemark(coordinate: location)) request.transportType = transporttype request.requestsAlternateRoutes = false let directions = MKDirections(request: request) directions.calculate { [unowned self] (response, error) in print("1") guard let response = response else { return } for route in response.routes { print("2") self.mapView.addOverlay(route.polyline) self.mapView.setVisibleMapRect(route.polyline.boundingMapRect, animated: true) } } } } func setupLocationManager(){ locationManager.delegate = self //set delegate locationManager.desiredAccuracy = kCLLocationAccuracyBest //for the accurate location } func centerViewOnUserLocation(){ if let Location = locationManager.location?.coordinate{ let region = MKCoordinateRegion.init(center: Location, latitudinalMeters: 10000, longitudinalMeters: 10000) mapView.setRegion(region, animated: true) } } func checkLocationServices(){ if CLLocationManager.locationServicesEnabled(){ setupLocationManager() checkLocationAuthorization() } else{ // show alert letting the user know they have to turn the location on } } func checkLocationAuthorization(){ switch CLLocationManager.authorizationStatus() { case .authorizedWhenInUse: //Map //startTrackingUserLocation() break case .denied: //show alert to allow the access of location break case .notDetermined: locationManager.requestWhenInUseAuthorization() case .restricted: // show the alert to the user that whats going on break case .authorizedAlways: break @unknown default: break }} @IBAction func findMyWayClicked(_ sender: Any) { centerViewOnUserLocation() } //func startTrackingUserLocation(){ // mapView.showsUserLocation = true // shows user's location // centerViewOnUserLocation() // locationManager.startUpdatingLocation()//to update the locationof the user // previousLocation = getCenterLocation(for: mapView) //} @IBAction func valueChanged(_ sender: Any) { if uiswitch.isOn { transporttype = .automobile typelabel.text = "Automobile" } else { typelabel.text = "Walking" transporttype = .walking } } } extension ViewController:CLLocationManagerDelegate{ func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) { checkLocationAuthorization() } } extension ViewController: MKMapViewDelegate { func mapView(_ mapView: MKMapView, rendererFor overlay: MKOverlay) -> MKOverlayRenderer { print("3") let renderer = MKPolylineRenderer(overlay: overlay as! MKPolyline) renderer.strokeColor = .darkGray return renderer } }
[ -1 ]
b9b13eb9408f059f9101abbc8211fe979eea5989
d9c975fa0b57f7bb8610fa04170272c89f5d2bca
/Cleanpro/北欧蓝牙模块封装/nRFMeshProvision/Classes/Mesh Messages/Foundation Messages/Configuration Messages/ConfigSIGModelAppList.swift
9e584796c0b137b433d5c83c4e7a5211ce5f3a59
[]
no_license
hanxinxin/CleanPro_Pakpobox
42ce82274257e2743ac01d928b35e177bd87fd51
92f64ddd35513b75494d0a31825de54ca6d9ef93
refs/heads/master
2021-07-11T05:29:46.232786
2020-06-15T08:45:09
2020-06-15T08:45:09
148,091,080
1
0
null
null
null
null
UTF-8
Swift
false
false
1,649
swift
// // ConfigSIGModelAppList.swift // nRFMeshProvision // // Created by Aleksander Nowakowski on 29/07/2019. // import Foundation public struct ConfigSIGModelAppList: ConfigModelAppList { public static let opCode: UInt32 = 0x804C public var parameters: Data? { return Data([status.rawValue]) + elementAddress + modelIdentifier + encode(indexes: applicationKeyIndexes[...]) } public let status: ConfigMessageStatus public let elementAddress: Address public let modelIdentifier: UInt16 public let applicationKeyIndexes: [KeyIndex] public init(responseTo request: ConfigSIGModelAppGet, with applicationKeys: [ApplicationKey]) { self.elementAddress = request.elementAddress self.modelIdentifier = request.modelIdentifier self.applicationKeyIndexes = applicationKeys.map { return $0.index } self.status = .success } public init(responseTo request: ConfigSIGModelAppGet, with status: ConfigMessageStatus) { self.elementAddress = request.elementAddress self.modelIdentifier = request.modelIdentifier self.applicationKeyIndexes = [] self.status = status } public init?(parameters: Data) { guard parameters.count >= 5 else { return nil } guard let status = ConfigMessageStatus(rawValue: 0) else { return nil } self.status = status elementAddress = parameters.read(fromOffset: 1) modelIdentifier = parameters.read(fromOffset: 3) applicationKeyIndexes = ConfigSIGModelAppList.decode(indexesFrom: parameters, at: 5) } }
[ -1 ]
d508a64353c9debfddf045d88e96f51058f62d82
00d5d127875ec80bcae46e797e1020b74c827078
/Example/Tests/Tests.swift
8a65716236d7cf84799dbd69f7329c63a10b5958
[ "MIT" ]
permissive
junyangyang/JYYTest
394dff36f65673169487a39f56e03dd07d7ceab5
2ea0fbde46c9a595b0eafa3931b3b680ff39ee73
refs/heads/master
2022-09-05T11:41:50.137046
2020-06-01T16:08:07
2020-06-01T16:08:07
268,546,179
0
0
null
null
null
null
UTF-8
Swift
false
false
744
swift
import XCTest import JYYTest class Tests: XCTestCase { override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. super.tearDown() } func testExample() { // This is an example of a functional test case. XCTAssert(true, "Pass") } func testPerformanceExample() { // This is an example of a performance test case. self.measure() { // Put the code you want to measure the time of here. } } }
[ 276492, 305179, 278558, 307231, 313375, 102437, 227370, 360491, 276533, 276534, 159807, 276543, 286788, 280649, 223316, 315476, 223318, 288857, 227417, 278618, 194652, 194656, 276577, 309345, 227428, 43109, 276582, 276585, 223340, 276589, 278638, 227439, 276592, 131189, 223350, 276603, 276606, 292992, 141450, 311435, 215178, 311438, 276627, 276631, 276632, 184475, 227492, 196773, 129203, 299187, 131256, 176314, 280762, 223419, 299198, 309444, 227528, 276682, 276687, 278742, 278746, 280802, 276709, 276710, 276715, 233715, 227576, 157944, 211193, 168188, 276753, 276760, 309529, 278810, 299293, 282919, 262450, 276792, 315706, 278846, 164162, 311621, 280902, 278856, 227658, 276813, 278863, 6481, 6482, 276821, 6489, 323935, 276835, 321894, 416104, 276847, 285040, 278898, 280961, 178571, 227725, 178578, 190871, 293274, 61857, 61859, 278954, 278961, 278965, 293303, 276920, 278969, 33211, 276925, 278978, 278985, 111056, 278993, 176594, 287198, 227809, 358882, 227813, 279013, 279022, 281072, 279039, 276998, 287241, 279050, 186893, 303631, 223767, 223769, 277017, 291358, 277029, 293419, 277048, 277049, 301634, 369220, 277066, 295519, 66150, 277094, 166507, 277101, 287346, 277111, 279164, 277118, 291454, 184962, 303746, 152203, 225933, 277133, 133774, 225936, 277138, 277141, 277142, 230040, 164512, 225956, 285353, 225962, 209581, 205487, 285361, 303793, 154291, 299699, 293556, 154294, 342706, 166580, 285371, 199366, 225997, 164563, 277204, 226004, 203477, 279252, 226007, 119513, 363231, 201442, 226019, 285415, 342762, 277227, 230134, 234234, 209660, 279294, 234241, 226051, 209670, 277254, 226058, 234250, 234253, 234256, 234263, 369432, 234268, 105246, 348959, 228129, 234277, 234280, 279336, 289576, 234283, 277289, 234286, 234289, 234294, 230199, 234301, 162621, 289598, 234304, 281408, 162626, 293693, 277316, 234311, 234312, 299849, 234317, 277325, 277327, 293711, 234323, 234326, 277339, 234331, 301918, 234335, 279392, 297822, 349026, 297826, 234340, 174949, 234343, 234346, 234349, 277360, 234355, 213876, 277366, 234360, 234361, 279417, 209785, 177019, 277370, 234366, 234367, 226170, 158593, 234372, 226181, 113542, 213894, 226184, 234377, 277381, 228234, 234381, 226189, 295824, 226194, 234387, 234386, 234392, 324507, 279456, 234400, 277410, 234404, 289703, 234409, 275371, 234412, 236461, 226222, 234419, 226227, 234425, 234427, 277435, 287677, 234430, 234436, 275397, 234438, 226249, 52172, 234444, 234445, 183248, 234450, 234451, 234454, 234457, 275418, 234463, 234466, 277479, 179176, 234472, 234473, 234477, 234482, 287731, 277492, 314355, 234492, 277505, 234498, 234500, 277509, 277510, 234503, 234506, 230410, 234509, 277517, 197647, 277518, 295953, 277523, 234517, 230423, 281625, 197657, 281626, 175132, 234530, 234531, 234534, 275495, 234539, 275500, 310317, 277550, 234542, 275505, 234548, 277563, 234555, 7229, 7230, 230463, 7231, 156733, 234560, 277566, 238651, 234565, 207938, 234569, 300111, 207953, 296018, 277585, 234577, 296019, 234583, 234584, 275547, 277596, 234594, 230499, 281700, 300135, 234603, 281707, 275565, 156785, 312434, 275571, 234612, 300150, 300151, 234616, 398457, 234622, 300158, 285828, 302213, 275590, 253063, 234631, 277640, 302217, 234632, 275591, 234642, 226451, 308372, 277651, 275607, 119963, 234652, 234656, 330913, 306338, 234659, 277665, 234663, 275625, 300201, 208043, 275628, 226479, 238769, 226481, 208058, 277690, 230588, 283840, 279747, 279760, 290000, 189652, 203989, 363744, 195811, 298212, 304356, 285929, 279792, 298228, 204022, 234742, 228600, 208124, 204041, 292107, 277792, 339234, 199971, 259363, 304421, 277800, 277803, 113966, 277806, 226608, 226609, 277814, 300343, 277821, 277824, 277825, 226624, 15686, 277831, 226632, 294218, 177484, 222541, 277838, 277841, 296273, 222548, 277844, 277845, 314709, 283991, 357719, 224605, 224606, 218462, 142689, 230756, 277862, 163175, 281962, 173420, 277868, 284014, 277871, 279919, 226675, 181625, 277882, 142716, 275838, 275839, 277890, 277891, 226694, 275847, 277896, 277897, 281992, 277900, 230799, 112017, 296338, 277907, 206228, 306579, 226711, 226712, 310692, 279974, 277927, 282024, 370091, 277936, 277939, 279989, 296375, 277943, 277946, 277949, 277952, 296387, 415171, 163269, 277957, 296391, 300487, 277962, 282060, 277965, 280013, 312782, 284116, 277974, 228823, 228824, 277977, 277980, 226781, 277983, 277988, 310757, 316902, 277993, 277994, 296425, 277997, 278002, 306677, 300542, 306693, 153095, 192010, 149007, 65041, 282136, 204313, 278056, 278060, 286254, 194110, 276040, 366154, 276045, 276046, 286288, 276050, 280147, 300630, 243292, 147036, 298590, 370271, 282213, 317032, 222832, 276084, 276085, 276088, 278140, 188031, 276097, 192131, 276100, 276101, 229001, 310923, 312972, 278160, 282259, 276116, 276117, 276120, 278170, 280220, 276126, 282273, 276129, 282276, 278191, 278195, 276148, 296628, 198324, 286388, 278201, 276156, 278214, 323276, 276173, 302797, 212688, 9936, 302802, 276179, 276180, 9937, 286423, 216795, 216796, 276195, 153319, 313065, 280300, 419569, 276210, 276219, 194303, 288512, 311042, 288516, 278285, 276238, 227091, 184086, 294678, 284442, 278299, 276253, 276257, 278307, 288547, 159533, 165677, 276279, 276282, 276283, 276287, 345919, 276294, 282438, 276298, 216918, 276311, 307031, 276318, 237408, 282474, 288619, 276332, 110452, 276344, 194429, 255872, 1923, 40850, 40853, 44952, 247712, 294823, 276394, 276401, 276408, 161722, 290746, 276413, 276421, 276422, 276430, 231375, 153552, 153554, 276444, 280541, 153566, 276454, 276459, 296941, 278518 ]
8b0b1b22902024f897f1c170a582dafecc21a4b8
fe4e7f48093989b9b90c352f82ddfb084c756935
/Calculator/CalculatorMVPUITests/CalculatorMVPUITests.swift
302fd661499e6bdc4182b4633aac032d85503069
[ "MIT" ]
permissive
amisare/app-architecture-calculator
c56737fed35e5d74c3feb8c292057b246e4936da
83fc385d60e742c156e7e73fdb4f64e46c614032
refs/heads/master
2020-09-23T15:44:04.711814
2019-12-23T10:49:22
2019-12-23T10:49:22
225,534,229
0
0
null
null
null
null
UTF-8
Swift
false
false
1,447
swift
// // CalculatorMVPUITests.swift // CalculatorMVPUITests // // Created by GuHaijun on 2019/12/14. // Copyright © 2019 顾海军. All rights reserved. // import XCTest class CalculatorMVPUITests: XCTestCase { override func setUp() { // Put setup code here. This method is called before the invocation of each test method in the class. // In UI tests it is usually best to stop immediately when a failure occurs. continueAfterFailure = false // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. } func testExample() { // UI tests must launch the application that they test. let app = XCUIApplication() app.launch() // Use recording to get started writing UI tests. // Use XCTAssert and related functions to verify your tests produce the correct results. } func testLaunchPerformance() { if #available(macOS 10.15, iOS 13.0, tvOS 13.0, *) { // This measures how long it takes to launch your application. measure(metrics: [XCTOSSignpostMetric.applicationLaunch]) { XCUIApplication().launch() } } } }
[ 333827, 182277, 346117, 354312, 243720, 360463, 419857, 358418, 237599, 241695, 223269, 354342, 178215, 229414, 346153, 344106, 315433, 253996, 354346, 278571, 325675, 102446, 282671, 229425, 124974, 243763, 229431, 249912, 180279, 319543, 352314, 376892, 288829, 32829, 325695, 288835, 403524, 237638, 313415, 315468, 368717, 333902, 196687, 278607, 311377, 354386, 176209, 329812, 315477, 53334, 254039, 200795, 368732, 180317, 356446, 315488, 315489, 45154, 280676, 313446, 215144, 217194, 194667, 288878, 376945, 284789, 284790, 249976, 288890, 131199, 194692, 381071, 333968, 241809, 323730, 278676, 153752, 327834, 284827, 329884, 278684, 192670, 192671, 278690, 215204, 258213, 333990, 284840, 278698, 284843, 323761, 278707, 125108, 258233, 278713, 280761, 280767, 133313, 139459, 131270, 301255, 374984, 280779, 254157, 346319, 282832, 368849, 368850, 321744, 229591, 385240, 280792, 301271, 254171, 147679, 147680, 334049, 311520, 325857, 356575, 383208, 317676, 125166, 149743, 125170, 395511, 356603, 313595, 375040, 125184, 262403, 125192, 338187, 338188, 368908, 125197, 180494, 194832, 325904, 227601, 368915, 254228, 272661, 338196, 319764, 61720, 278805, 125204, 334104, 282908, 315674, 311582, 125215, 282912, 278817, 125216, 362336, 282920, 334121, 254250, 338217, 325930, 317738, 125225, 321839, 315698, 98611, 332084, 125236, 180534, 368949, 362809, 282938, 127292, 155968, 319812, 332100, 227655, 280903, 319816, 323914, 254285, 383309, 180559, 344402, 348499, 250196, 348501, 229716, 289109, 168280, 272730, 323934, 332128, 391521, 215395, 366948, 239973, 381286, 285031, 416103, 242027, 242028, 321901, 354671, 362864, 287089, 160111, 250227, 354672, 354678, 199030, 227702, 315768, 315769, 291194, 223611, 248188, 139641, 211327, 291200, 311679, 313726, 240003, 340356, 158087, 313736, 242059, 311692, 106893, 227730, 285074, 225684, 252309, 240020, 291225, 213402, 39323, 293275, 317851, 293281, 436644, 254373, 301482, 375211, 311723, 334259, 342454, 338359, 311739, 319931, 293309, 278974, 336319, 311744, 317889, 326083, 278979, 188870, 289229, 281039, 278992, 283088, 283089, 279000, 242138, 256476, 279009, 369121, 369124, 195044, 279014, 319976, 279017, 201195, 281071, 360945, 319986, 236020, 311800, 317949, 324098, 279042, 283138, 287237, 377352, 322057, 309770, 342537, 334345, 279053, 340489, 283154, 303634, 303635, 342549, 279061, 254487, 279066, 322077, 377374, 291359, 342560, 348709, 348710, 293420, 197166, 219694, 219695, 236080, 283185, 330291, 338491, 259408, 352831, 438850, 301635, 309831, 55880, 377419, 281165, 281170, 369236, 115287, 309847, 191065, 244311, 332379, 111197, 295518, 436831, 287327, 375396, 244326, 176751, 313970, 346739, 346741, 352885, 352886, 356983, 244345, 356984, 301688, 344697, 356990, 189054, 287359, 297600, 303743, 152196, 369285, 356998, 348807, 356999, 301702, 164487, 311944, 316044, 344714, 311950, 326288, 316048, 311953, 316050, 287379, 346771, 363155, 227991, 295575, 352921, 180886, 289435, 336531, 205469, 344737, 285348, 279207, 295591, 176810, 248494, 279215, 293552, 295598, 299698, 318127, 164532, 166581, 342705, 154295, 342714, 314043, 355006, 66243, 291529, 287438, 135888, 242385, 369365, 369366, 230105, 361178, 363228, 338658, 295653, 342757, 289511, 230120, 330473, 361194, 285419, 330476, 373485, 373486, 289517, 312046, 170735, 125683, 230133, 342775, 348921, 344829, 279293, 205566, 35584, 322302, 299777, 228099, 285443, 359166, 322312, 346889, 264971, 326413, 322320, 285457, 426772, 207639, 283418, 285467, 326428, 363295, 344864, 281378, 336678, 283431, 318247, 279337, 293673, 318251, 289580, 189229, 164655, 301872, 303921, 234290, 328495, 152372, 336693, 285493, 230198, 355129, 201534, 281407, 355136, 289599, 355138, 295745, 342846, 377669, 293702, 222017, 420680, 348999, 355147, 355148, 355153, 244569, 281434, 322396, 252766, 230238, 127840, 363361, 363362, 357219, 230239, 355173, 355174, 275294, 342888, 279393, 293729, 281444, 207724, 303973, 279398, 351078, 207728, 308075, 242540, 242542, 295797, 201590, 228214, 177018, 211835, 269179, 279418, 336765, 340865, 349025, 254851, 260995, 369541, 330627, 299912, 416649, 279434, 236427, 252812, 349068, 316299, 308111, 349066, 308113, 189327, 355216, 293780, 256918, 256919, 256920, 310166, 400282, 289691, 209820, 369383, 289699, 359332, 189349, 256934, 359333, 293801, 326571, 140203, 252848, 381872, 326580, 289720, 326586, 330688, 349122, 359365, 363462, 281541, 19398, 127945, 211913, 326602, 213961, 279499, 252878, 56270, 359380, 183254, 304086, 207839, 340960, 347104, 359391, 340967, 304104, 123880, 324587, 343020, 183276, 320492, 248815, 347122, 287730, 240631, 349176, 201721, 328701, 312317, 257023, 328705, 418819, 357380, 330759, 230411, 347150, 361487, 384015, 320526, 330766, 238611, 254997, 140311, 293911, 238617, 197658, 326684, 252959, 384031, 336928, 336930, 330789, 357413, 248871, 357420, 113710, 281647, 345137, 361522, 322609, 203829, 238646, 238650, 320571, 21567, 308288, 160834, 336962, 398405, 404550, 349254, 238663, 257093, 314437, 250955, 361547, 300109, 250965, 339031, 205911, 296023, 314458, 156763, 361570, 281698, 214116, 285795, 250982, 214119, 322664, 228457, 253028, 279659, 257126, 62574, 351343, 173168, 357487, 300145, 279666, 312435, 187508, 273523, 330867, 302202, 363643, 285819, 314493, 343166, 248960, 150656, 349315, 349317, 318602, 140426, 228492, 337037, 177297, 253074, 326803, 162962, 187539, 347286, 359574, 324761, 285850, 296091, 125200, 351389, 339101, 300192, 339106, 253098, 249003, 208044, 238764, 322733, 367791, 367792, 373937, 373939, 324790, 367798, 339131, 228541, 343230, 367809, 312519, 259275, 148687, 290001, 259285, 351445, 279766, 189656, 357594, 339167, 279775, 304352, 298209, 310496, 279780, 222441, 279789, 290030, 302319, 253168, 351475, 251124, 316661, 283894, 369912, 52473, 363769, 369913, 52476, 208123, 228608, 351489, 320769, 369929, 242955, 177420, 312588, 318732, 349458, 126229, 367897, 367898, 245018, 320795, 115997, 130342, 130347, 257323, 353581, 116014, 66863, 292145, 208179, 312628, 345397, 345398, 159033, 333114, 333115, 286012, 279872, 193858, 359747, 359748, 216387, 279874, 300354, 300355, 257353, 345418, 257354, 109899, 337226, 372039, 230730, 296269, 353617, 224591, 238928, 150868, 296274, 314708, 283990, 314711, 357720, 331091, 300379, 316764, 314721, 314734, 296304, 312688, 314740, 327030, 314742, 382329, 310650, 314745, 224637, 306558, 337280, 243073, 357763, 314759, 388488, 296330, 304523, 327556, 9618, 112019, 306580, 224662, 234902, 370072, 282008, 314776, 318876, 282013, 343457, 148899, 314788, 148900, 298406, 314790, 245160, 333224, 241067, 314797, 374189, 355761, 251314, 301919, 343480, 259513, 134586, 228796, 216510, 54719, 216511, 380350, 302530, 292291, 228804, 415170, 361928, 200136, 370122, 339403, 372172, 302539, 337359, 329168, 327122, 329170, 222674, 280020, 353751, 280025, 310747, 239069, 144862, 329181, 286176, 3557, 361958, 3559, 187877, 320997, 280043, 191980, 329198, 337391, 259569, 282097, 251379, 296434, 435038, 306678, 40439, 191991, 288248, 253431, 288252, 210429, 312830, 343552, 366081, 290304, 245249, 228868, 230922, 198155, 302602, 323083, 208397, 329231, 304655, 359949, 253456, 323088, 230933, 316951, 175640, 370200, 302620, 349727, 146976, 222754, 157219, 157220, 372261, 245290, 245291, 347693, 312879, 323120, 230960, 288305, 323126, 343606, 374327, 210489, 134715, 323132, 235069, 425534, 288319, 147011, 280131, 349764, 310853, 282182, 288328, 147020, 128589, 333389, 224848, 333394, 224852, 196184, 128600, 235096, 306777, 212574, 99937, 345697, 300643, 323171, 300645, 415334, 204394, 312941, 138862, 54895, 206447, 310896, 288377, 290425, 339579, 337533, 210558, 210559, 325246, 235136, 333438, 282244, 239238, 149127, 149128, 282248, 286344, 224907, 229011, 239251, 345753, 280217, 323226, 229021, 198304, 282272, 255651, 245413, 282279, 298664, 212649, 317102, 286387, 337590, 370359, 224951, 300729, 224952, 306875, 280252, 280253, 282302, 323262, 286400, 321217, 323265, 259780, 333508, 321220, 319176, 239305, 296649, 9935, 241360, 333522, 313042, 286419, 345813, 241366, 224985, 18139, 245471, 325345, 321250, 337638, 333543, 181992, 345832, 153318, 288492, 141037, 325357, 212721, 67316, 286457, 284410, 288508, 286463, 319232, 360194, 288515, 175874, 280326, 323335, 300810, 116491, 216844, 280333, 300812, 345950, 124691, 278292, 118549, 116502, 169751, 278294, 284436, 345882, 325403, 321308, 321309, 341791, 339746, 325411, 315172, 255781, 186149, 257831, 241447, 333609, 286507, 294699, 153392, 300849, 182070, 182071, 345910, 319289, 321338, 345918, 241471, 325444, 315431, 337734, 339782, 153416, 325449, 315209, 159563, 280396, 341837, 323405, 307024, 337746, 325460, 317268, 341846, 339799, 345942, 362326, 368471, 237397, 241494, 18263, 370526, 307030, 188250, 259937, 284508, 300893, 255844, 307038, 237411, 284515, 276326, 292713, 362351, 292719, 325491, 341878, 333687, 350072, 317305, 360315, 317308, 124795, 182142, 339840, 315265, 182145, 280451, 253828, 325508, 243590, 333700, 188293, 282503, 67464, 350091, 350092, 305032, 315272, 315275, 350102, 294806, 337816, 124826, 329627, 239515, 253851, 333727, 214943, 298912, 319393, 354210, 118693, 219046, 284584, 294824, 313257, 362411, 370604, 253868, 292783, 126896, 362418, 200628, 343993, 288698, 188349, 294849, 214978, 280517, 214983, 362442, 282573, 153553, 346066, 212947, 231382, 212953, 354268, 329696, 354273, 360416, 6116, 190437, 292838, 354279, 294887, 174058, 247787, 253930, 329707, 354283, 313322, 296942, 247786, 337899, 124912, 325620, 313338 ]
f3aca543b9ba31bb8b92429a2444e40a3d634a5b
e8ae9f65b86d1760df5df93dbcaf4e724df3a8f1
/RunloopDemo/ViewController.swift
fe3f4663c014cc5127ec71714f6d7ecb464bda3d
[]
no_license
LqDeveloper/RunloopThread
f9a08f1fa6cf693eeb9886593662164f098da253
04dbb72c86a27c0b25feb37c7d619be28686dd1d
refs/heads/main
2023-02-02T01:28:03.045000
2020-12-16T06:58:33
2020-12-16T06:58:33
321,895,756
0
0
null
null
null
null
UTF-8
Swift
false
false
492
swift
// // ViewController.swift // RunloopDemo // // Created by Quan Li on 2020/12/16. // import UIKit class ViewController: UIViewController { var resident = ResidentMemoryThread.init() override func viewDidLoad() { super.viewDidLoad() } @IBAction func runTask(_ sender: Any) { resident.runTask { print("当前线程\(Thread.current)") } } @IBAction func cancelTask(_ sender: Any) { resident.cancelTask() } }
[ -1 ]
a7f10ed81ba27b1978f98cb273f214ec7a4abbc0
6799f41230b5157cc1c1738804203e8de428d0d0
/changeBook/ViewModel/DocumentViewModel.swift
9253298bfc33f8a0c8594b338d50cab5ccfc64e6
[]
no_license
Jvaeyhcd/changeBook
396ee6392ec4624aafd9389b5552f7c95ab2c0ce
da00b255a0613f0d661f7ed4590149b786ece82c
refs/heads/master
2021-03-22T05:17:13.539692
2017-09-03T14:00:55
2017-09-03T14:00:55
94,330,008
2
1
null
null
null
null
UTF-8
Swift
false
false
7,111
swift
// // DocumentViewModel.swift // changeBook // // Created by Jvaeyhcd on 11/07/2017. // Copyright © 2017 Jvaeyhcd. All rights reserved. // import Foundation class DocumentViewModel: ViewModelProtocol { // 获取热门资料 func getHotDocument(cache: @escaping DataBlock, success: @escaping DataBlock, fail: @escaping MessageBlock, loginSuccess: @escaping VoidBlock) { let cacheName = "getHotDocument" self.getCacheData(cacheName: cacheName, cacheData: cache) DocumentProvider.request(DocumentAPI.getHotDocument()) { [weak self] (result) in self?.request(cacheName: cacheName, result: result, success: success, fail: fail, loginSuccess: loginSuccess) } } // 搜索资料 func searchDocument(keyWords: String, page: Int, success: @escaping DataBlock, fail: @escaping MessageBlock, loginSuccess: @escaping VoidBlock) { DocumentProvider.request(DocumentAPI.searchDocument(keyWords: keyWords, page: page)) { [weak self] (result) in self?.request(cacheName: kNoNeedCache, result: result, success: success, fail: fail, loginSuccess: loginSuccess) } } // 推荐资料 func recommendDocument(documentId: String, cache: @escaping DataBlock, success: @escaping DataBlock, fail: @escaping MessageBlock, loginSuccess: @escaping VoidBlock) { let cacheName = "recommendDocument" + documentId self.getCacheData(cacheName: cacheName, cacheData: cache) DocumentProvider.request(DocumentAPI.recommendDocument(documentId: documentId)) { [weak self] (result) in self?.request(cacheName: cacheName, result: result, success: success, fail: fail, loginSuccess: loginSuccess) } } // 积分购买资料 func buyDocument(documentId: String, success: @escaping DataBlock, fail: @escaping MessageBlock, loginSuccess: @escaping VoidBlock) { DocumentProvider.request(DocumentAPI.buyDocument(documentId: documentId)) { [weak self] (result) in self?.request(cacheName: kNoNeedCache, result: result, success: success, fail: fail, loginSuccess: loginSuccess) } } // 资料评论点赞 func likeDocumentComment(documentCommentId: String, success: @escaping DataBlock, fail: @escaping MessageBlock, loginSuccess: @escaping VoidBlock) { DocumentProvider.request(DocumentAPI.likeComment(commentId: documentCommentId, likeType: kLikeDataCommentType)) { [weak self] (result) in self?.request(cacheName: kNoNeedCache, result: result, success: success, fail: fail, loginSuccess: loginSuccess) } } func getDocumentComment(documentId: String, page: Int, cache: @escaping DataBlock, success: @escaping DataBlock, fail: @escaping MessageBlock, loginSuccess: @escaping VoidBlock) { var cacheName = kNoNeedCache if 1 == page { cacheName = "getDocumentComment" + documentId self.getCacheData(cacheName: cacheName, cacheData: cache) } DocumentProvider.request(DocumentAPI.getDocumentComment(documentId: documentId, page: page)) { [weak self] (result) in self?.request(cacheName: cacheName, result: result, success: success, fail: fail, loginSuccess: loginSuccess) } } // 获取评论详情 func getCommentDetail(documentCommentId: String, page: Int, cache: @escaping DataBlock, success: @escaping DataBlock, fail: @escaping MessageBlock, loginSuccess: @escaping VoidBlock) { var cacheName = kNoNeedCache if 1 == page { cacheName = "getCommentDetail" + documentCommentId self.getCacheData(cacheName: cacheName, cacheData: cache) } DocumentProvider.request(DocumentAPI.getCommentDetail(documentCommentId: documentCommentId, page: page)) { [weak self] (result) in self?.request(cacheName: cacheName, result: result, success: success, fail: fail, loginSuccess: loginSuccess) } } // 评论资料 func addDocumentComment(documentId: String, content: String, commentType: String, score: String, documentCommentId: String, receiverId: String, success: @escaping DataBlock, fail: @escaping MessageBlock, loginSuccess: @escaping VoidBlock) { DocumentProvider.request(DocumentAPI.addDocumentComment(documentId: documentId, content: content, commentType: commentType, score: score, documentCommentId: documentCommentId, receiverId: receiverId)) { [weak self] (result) in self?.request(cacheName: kNoNeedCache, result: result, success: success, fail: fail, loginSuccess: loginSuccess) } } // 获取资料详情 func getDocumentDetail(documentId: String, cache: @escaping DataBlock, success: @escaping DataBlock, fail: @escaping MessageBlock, loginSuccess: @escaping VoidBlock) { let cacheName = "getDocumentDetail" + documentId self.getCacheData(cacheName: cacheName, cacheData: cache) DocumentProvider.request(DocumentAPI.getDocumentDetail(documentId: documentId)) { [weak self] (result) in self?.request(cacheName: cacheName, result: result, success: success, fail: fail, loginSuccess: loginSuccess) } } // 筛选资料 func filterDocument(type: Int, rule: Int, page: Int, cache: @escaping DataBlock, success: @escaping DataBlock, fail: @escaping MessageBlock, loginSuccess: @escaping VoidBlock) { var cacheName = kNoNeedCache if 1 == page { cacheName = "filterDocument:\(type):\(rule)" self.getCacheData(cacheName: cacheName, cacheData: cache) } DocumentProvider.request(DocumentAPI.filterDocument(type: type, rule: rule, page: page)) { [weak self] (result) in self?.request(cacheName: cacheName, result: result, success: success, fail: fail, loginSuccess: loginSuccess) } } }
[ -1 ]
119e9b2bc533f713f25dfe0f4f6254115a38d887
fc086f9a6d2b1f806231f64ae66d5e581487c7c4
/ios/BonnieDraw/BonnieDraw/Model/Message.swift
a866ebadf768f9f698f0279f437214f1916044c5
[]
no_license
jimmyxiao/Bonnie
d1c4f232f7255b280163e4b555fbf0ab3f4a0eb3
862c416000d3019a3ab7a5a207deb41b51872b26
refs/heads/master
2022-03-31T19:50:47.972447
2020-03-05T10:21:24
2020-03-05T10:21:24
62,611,793
0
0
null
null
null
null
UTF-8
Swift
false
false
1,435
swift
// // Message.swift // BonnieDraw // // Created by Professor on 08/12/2017. // Copyright © 2017 Professor. All rights reserved. // import UIKit struct Message: Comparable { let id: Int? let userId: Int? let message: String? let date: Date? let userName: String? let userProfile: URL? init(withDictionary dictionary: [String: Any]) { var date: Date? = nil if let milliseconds = dictionary["creationDate"] as? Int { date = Date(timeIntervalSince1970: Double(milliseconds) / 1000) } id = dictionary["worksMsgId"] as? Int userId = dictionary["userId"] as? Int message = dictionary["message"] as? String self.date = date userName = dictionary["userName"] as? String userProfile = URL(string: Service.filePath(withSubPath: dictionary["profilePicture"] as? String)) } static func <(lhs: Message, rhs: Message) -> Bool { if let lhsDate = lhs.date, let rhsDate = rhs.date { return lhsDate.compare(rhsDate) == .orderedDescending } return false } static func ==(lhs: Message, rhs: Message) -> Bool { return lhs.id == rhs.id && lhs.userId == rhs.userId && lhs.message == rhs.message && lhs.date == rhs.date && lhs.userName == rhs.userName && lhs.userProfile == rhs.userProfile } }
[ -1 ]
c89c8c63af157af996ef6efd59e65f89f552f14e
2f8ddf936ad571e1c1914506719e195a1b2544c7
/ShapovalovAV_HW2.7/Model/Persons.swift
1623967e09a5d2513361c6aaef5f1656bbe2f1d2
[]
no_license
Sharvi666/ShapovalovAV_HW2.7
9428d21cad53fb3857b91581076f4ea3aa883ce2
95a27b0e19ea9267512bdcf547e5da36c55eca49
refs/heads/master
2022-12-11T19:09:35.629346
2020-09-10T09:38:55
2020-09-10T09:38:55
294,365,954
0
0
null
null
null
null
UTF-8
Swift
false
false
1,960
swift
// // Persons.swift // ShapovalovAV_HW2.7 // // Created by Arthur on 09.09.2020. // Copyright © 2020 Arthur. All rights reserved. // import UIKit struct Person { let name: [String] let surname: [String] var phoneNumber: [String] let email: [String] var fullName: String { "\(name.randomElement()!) \(surname.randomElement()!)" } } extension Person { static func getPersonsList() -> [Person] { let data = DataManager() return [Person(name: data.names, surname: data.surnames, phoneNumber: data.phoneNumbers, email: data.emails)] } } class DataManager: UIViewController { let names = ["Robert", "Thierry", "Rahim", "Karim", "Cristiano", "Lionel", "Zinedin", "Kevin", "Stiven", "Frank"] let surnames = ["Levandovski", "Henry", "Sterling", "Benzema", "Ronaldo", "Messi", "Zidan", "De Bruyne", "Gerrard", "Lampard"] let phoneNumbers = ["329752", "497548", "398179", "832690", "916663", "877280", "337722", "018762", "388261", "666777"] let emails = ["[email protected]", "[email protected]", "[email protected]", "[email protected]", "[email protected]", "[email protected]", "[email protected]", "[email protected]", "[email protected]", "[email protected]"] }
[ -1 ]
b304a2ea7b9c87d627d91bf17ced0de9a0a3726a
2a46cce9fcb1f5948740249f732001fb9c818f8f
/Sources/StatKit/Descriptive Statistics/Distribution/Discrete/PoissonDistribution.swift
c22a4281dca89bb9534ee8aa7fa071983eb46225
[ "MIT" ]
permissive
PhamPhiPhuc/StatKit
f3a3a5a96f48d0694d3c5c40d8fcdfb2788709d5
31e3946c81ec3d176932bb2c94efca14ba64b310
refs/heads/master
2023-03-23T12:29:12.242011
2021-03-23T11:59:45
2021-03-23T12:20:39
null
0
0
null
null
null
null
UTF-8
Swift
false
false
2,278
swift
#if os(Linux) import Glibc #else import Darwin #endif /// A type modelling a Poisson Distribution. public struct PoissonDistribution: DiscreteDistribution { /// The rate of events. public let rate: Double /// Creates a Poisson Distribution with a specified rate of events. /// - parameter rate: The rate of events for this distribution. public init(rate: Double) { precondition( 0 < rate, "The rate of a Poisson Distribution must be strictly greater than 0 (\(rate) was used)." ) self.rate = rate } public var mean: Double { return rate } public var variance: Double { return rate } public var skewness: Double { return 1 / sqrt(rate) } public var kurtosis: Double { return 3 + 1 / rate } public func pmf(x: Int) -> Double { guard 0 < x else { return 0 } let nominator = pow(rate, Double(x)) * exp(-rate) let denominator = Double(factorial(x)) return nominator / denominator } public func cdf(x: Int) -> Double { switch x { case ..<0: return 0 default: let sum = (0 ... x).reduce(into: 0) { result, number in result += pow(rate, Double(number)) / Double(factorial(number)) } return exp(-rate) * sum } } public func sample() -> Int { var uniformGenerator = Xoroshiro256StarStar() let limit = exp(-rate) var arrivals = 0 var uniformProduct = Double.random(in: 0 ... 1, using: &uniformGenerator) while limit < uniformProduct { arrivals += 1 uniformProduct *= Double.random(in: 0 ... 1, using: &uniformGenerator) } return arrivals } public func sample(_ numberOfElements: Int) -> [Int] { precondition(0 < numberOfElements, "The requested number of samples need to be greater than 0.") var uniformGenerator = Xoroshiro256StarStar() let limit = exp(-rate) return (1 ... numberOfElements).map { _ in var arrivals = 0 var uniformProduct = Double.random(in: 0 ... 1, using: &uniformGenerator) while limit < uniformProduct { arrivals += 1 uniformProduct *= Double.random(in: 0 ... 1, using: &uniformGenerator) } return arrivals } } }
[ -1 ]
e86a8b76f2d38400416bc7e4786b033bed3ef471
79edeba47ef77adf580742f02b1bc10733de1176
/AnimationApp/AnimationApp/AppDelegate.swift
3cb2ecc4a6dde63fec04f0e18a2d5c0012025d59
[]
no_license
LinaraU/IOS-DEV
d7fdbaaca8456d8a81f8317c1b411a62f4b6a119
4897ec6cd2f4782c65e44fcb862fea66ee35799e
refs/heads/main
2023-04-01T23:44:04.949225
2021-04-02T11:09:43
2021-04-02T11:09:43
340,334,893
0
0
null
null
null
null
UTF-8
Swift
false
false
3,646
swift
// // AppDelegate.swift // AnimationApp // // Created by Linara Ualiyeva on 3/31/21. // import UIKit import CoreData @main class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } // MARK: UISceneSession Lifecycle func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { // Called when a new scene session is being created. // Use this method to select a configuration to create the new scene with. return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) } func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) { // Called when the user discards a scene session. // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. // Use this method to release any resources that were specific to the discarded scenes, as they will not return. } // MARK: - Core Data stack lazy var persistentContainer: NSPersistentContainer = { /* The persistent container for the application. This implementation creates and returns a container, having loaded the store for the application to it. This property is optional since there are legitimate error conditions that could cause the creation of the store to fail. */ let container = NSPersistentContainer(name: "AnimationApp") container.loadPersistentStores(completionHandler: { (storeDescription, error) in if let error = error as NSError? { // Replace this implementation with code to handle the error appropriately. // fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. /* Typical reasons for an error here include: * The parent directory does not exist, cannot be created, or disallows writing. * The persistent store is not accessible, due to permissions or data protection when the device is locked. * The device is out of space. * The store could not be migrated to the current model version. Check the error message to determine what the actual problem was. */ fatalError("Unresolved error \(error), \(error.userInfo)") } }) return container }() // MARK: - Core Data Saving support func saveContext () { let context = persistentContainer.viewContext if context.hasChanges { do { try context.save() } catch { // Replace this implementation with code to handle the error appropriately. // fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. let nserror = error as NSError fatalError("Unresolved error \(nserror), \(nserror.userInfo)") } } } }
[ 199680, 379906, 253443, 418820, 328199, 384007, 249351, 377866, 372747, 326668, 379914, 199180, 329233, 349202, 186387, 350738, 262677, 330774, 324121, 245274, 377371, 345630, 340511, 384032, 362529, 349738, 394795, 404523, 262701, 245293, 349744, 361524, 337975, 343609, 375867, 333373, 418366, 152127, 339009, 413250, 214087, 352840, 337994, 377930, 370253, 330319, 200784, 173647, 436306, 333395, 244308, 374358, 329815, 254042, 402522, 326239, 322658, 340579, 244329, 333422, 349295, 204400, 173169, 339571, 330868, 344693, 268921, 343167, 192639, 344707, 330884, 336516, 266374, 385670, 346768, 268434, 409236, 333988, 336548, 379048, 377001, 356520, 361644, 402614, 361655, 339132, 325308, 343231, 403138, 337092, 244933, 322758, 337606, 367816, 257738, 342736, 257751, 385242, 366300, 165085, 350433, 345826, 328931, 395495, 363755, 343276, 346348, 338158, 325358, 212722, 251122, 350453, 338679, 393465, 351482, 264961, 115972, 268552, 346890, 336139, 328460, 362251, 333074, 257814, 333592, 397084, 342813, 257824, 362272, 377120, 334631, 336680, 389416, 384298, 254252, 204589, 366383, 328497, 257842, 339768, 326969, 257852, 384828, 204606, 386365, 375615, 339792, 358737, 389970, 361299, 155476, 257880, 330584, 361305, 362843, 429406, 374112, 353633, 439137, 355184, 361333, 332156, 337277, 260992, 245120, 380802, 389506, 264583, 337290, 155020, 337813, 250262, 348565, 155044, 333221, 373671, 333736, 252845, 356781, 268210, 370610, 342452, 210356, 370102, 338362, 327612, 358335, 380352, 201157, 187334, 333766, 336325, 339400, 349128, 358347, 393670, 347081, 272848, 379856, 155603, 399317, 249302, 379863, 372697, 155102, 182754, 360429, 338927, 330224, 379895, 201723, 257020, 254461 ]
00405b75ac219d15326ed19cbb1a3a690d3d4ae3
959c60379963ed9b1e438233be5b651a626c66fa
/iot_app/iot_app/Features/Controls/Controllers/HeaterControlViewController.swift
dafd15f24a04af6b1b2b8324986c5cd460b7f76e
[]
no_license
AurelienH23/iot_app
36b0ec7b34281fec5e2b88116cd809c2c3be50f9
209650e58b4a1cfe800508dbff439c7fe64a0410
refs/heads/main
2023-03-15T10:56:40.853751
2021-03-11T09:01:33
2021-03-11T09:01:33
343,563,441
0
0
null
null
null
null
UTF-8
Swift
false
false
1,863
swift
// // HeaterControlViewController.swift // iot_app // // Created by Aurélien Haie on 03/03/2021. // import UIKit class HeaterControlViewController: ControlViewController { private let temperatureControl = TemperatureControl() override func setupViews() { super.setupViews() view.addSubview(temperatureControl) temperatureControl.anchor(top: intensityValue.bottomAnchor, bottom: view.bottomAnchor, paddingTop: .mediumSpace, paddingBottom: .bottomPadding + 100 + .mediumSpace) temperatureControl.centerHorizontally(to: view) let pan = UIPanGestureRecognizer(target: self, action: #selector(didChangeValue(gesture:))) temperatureControl.addGestureRecognizer(pan) temperatureControl.temperature.bind { (value) in self.intensityValue.updateTemperature(with: value) } if let deviceTemperature = device.temperature { temperatureControl.temperature.value = CGFloat(deviceTemperature) temperatureControl.updateSteps(for: CGFloat(deviceTemperature)) } bottomView.updateButton(for: device) } @objc private func didChangeValue(gesture: UIPanGestureRecognizer) { guard device.isOn() else { return } switch gesture.state { case .began: temperatureControl.updateStartValue() case .changed: let translated = gesture.translation(in: temperatureControl) let verticalTranslation = -translated.y temperatureControl.didSlideControl(with: verticalTranslation) case .ended: device.setTemperature(to: Float(temperatureControl.temperature.value)) default: break } } } extension HeaterControlViewController { override func didSwitchMode() { device.switchMode() } }
[ -1 ]
e7826942e22f642d3c549a1e61bb7ae62bea0521
cafed27b762528187705f451e81598b769bbd092
/Prework/SceneDelegate.swift
67acaf218571e96793d2b1c1c33a1b4457081678
[]
no_license
FlyinPandaa/CodePathPrework
5220cd23782018765e2c16faed790f86d7c63eb7
e9f74fdbb72679815dda939ca96f6a539939b3f8
refs/heads/main
2023-07-09T04:44:36.012415
2021-08-18T05:25:02
2021-08-18T05:25:02
397,478,354
0
0
null
null
null
null
UTF-8
Swift
false
false
2,289
swift
// // SceneDelegate.swift // Prework // // Created by Michael Fang on 8/12/21. // import UIKit class SceneDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow? func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). guard let _ = (scene as? UIWindowScene) else { return } } func sceneDidDisconnect(_ scene: UIScene) { // Called as the scene is being released by the system. // This occurs shortly after the scene enters the background, or when its session is discarded. // Release any resources associated with this scene that can be re-created the next time the scene connects. // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead). } func sceneDidBecomeActive(_ scene: UIScene) { // Called when the scene has moved from an inactive state to an active state. // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. } func sceneWillResignActive(_ scene: UIScene) { // Called when the scene will move from an active state to an inactive state. // This may occur due to temporary interruptions (ex. an incoming phone call). } func sceneWillEnterForeground(_ scene: UIScene) { // Called as the scene transitions from the background to the foreground. // Use this method to undo the changes made on entering the background. } func sceneDidEnterBackground(_ scene: UIScene) { // Called as the scene transitions from the foreground to the background. // Use this method to save data, release shared resources, and store enough scene-specific state information // to restore the scene back to its current state. } }
[ 393221, 163849, 393228, 393231, 393251, 352294, 344103, 393260, 393269, 213049, 376890, 385082, 393277, 376906, 327757, 254032, 368728, 180314, 254045, 180322, 376932, 286833, 286845, 286851, 417925, 262284, 360598, 286880, 377003, 377013, 164029, 327872, 180418, 377030, 377037, 377047, 418008, 418012, 377063, 327915, 205037, 393457, 393461, 393466, 418044, 385281, 336129, 262405, 180491, 164107, 336140, 262417, 368913, 262423, 377118, 377121, 262437, 254253, 336181, 262455, 393539, 262473, 344404, 213333, 418135, 418145, 262497, 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, 197160, 377384, 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, 385714, 434868, 164535, 336568, 164539, 328379, 328387, 352969, 344777, 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, 328690, 435188, 328703, 328710, 418822, 328715, 377867, 361490, 386070, 271382, 336922, 345119, 377888, 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, 222438, 328942, 386286, 386292, 206084, 345377, 345380, 353572, 345383, 263464, 337207, 345400, 378170, 369979, 386366, 337224, 337230, 337235, 263509, 353634, 337252, 402792, 271731, 378232, 337278, 271746, 181639, 181644, 361869, 181650, 181655, 230810, 181671, 181674, 181679, 181682, 337330, 181687, 370105, 181691, 181697, 361922, 337350, 181704, 337366, 271841, 329192, 361961, 329195, 116211, 337399, 402943, 337416, 329227, 419341, 419345, 329234, 419351, 345626, 419357, 345631, 370208, 419360, 394787, 419363, 370214, 419369, 394796, 419377, 419386, 206397, 214594, 419401, 419404, 353868, 419408, 214611, 419412, 403040, 345702, 222831, 370298, 353920, 403073, 403076, 345737, 198282, 403085, 403092, 345750, 419484, 345758, 345763, 419492, 419498, 419502, 370351, 419507, 337588, 419510, 419513, 419518, 337601, 403139, 337607, 419528, 419531, 419536, 272083, 394967, 419545, 345819, 419548, 419551, 345829, 419560, 337643, 419564, 337647, 370416, 337671, 362249, 362252, 395022, 362256, 321300, 345888, 362274, 378664, 354107, 345916, 354112, 370504, 329545, 345932, 370510, 354132, 247639, 337751, 370520, 313181, 354143, 345965, 354157, 345968, 345971, 345975, 403321, 1914, 354173, 247692, 395148, 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, 256214, 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, 395567, 248112, 362823, 436556, 321880, 362844, 379234, 354674, 321911, 420237, 379279, 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, 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, 339037, 412765, 257121, 322660, 265321, 248952, 420985, 330886, 330890, 347288, 248986, 44199, 380071, 339118, 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, 249215, 175487, 249219, 175491, 249225, 249228, 249235, 175514, 175517, 396703, 396706, 175523, 355749, 396723, 388543, 380353, 216518, 380364, 339406, 372177, 339414, 413143, 249303, 339418, 339421, 249310, 249313, 339425, 339429, 339435, 249329, 69114, 372229, 208399, 380433, 175637, 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, 224923, 208539, 224927, 224930, 224933, 257705, 224939, 224943, 257713, 257717, 224949, 257721, 224954, 257725, 224960, 257733, 224966, 224970, 257740, 224976, 257745, 339664, 257748, 224982, 257752, 224987, 257762, 224996, 225000, 225013, 257788, 225021, 257791, 339711, 225027, 257796, 257802, 339722, 257805, 225039, 257808, 249617, 225044, 167701, 372500, 257815, 225049, 257820, 225054, 184096, 257825, 225059, 339748, 225068, 257837, 413485, 225071, 225074, 257843, 225077, 257846, 225080, 397113, 225083, 397116, 257853, 225088, 225094, 225097, 257869, 257872, 225105, 397140, 225109, 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, 225439, 135328, 438434, 225442, 192674, 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, 356650, 389417, 356656, 332081, 307507, 340276, 356662, 397623, 332091, 225599, 201030, 348489, 332107, 151884, 332118, 348503, 430422, 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, 332460, 389806, 332464, 332473, 381626, 332484, 332487, 332494, 357070, 357074, 332512, 332521, 340724, 332534, 155647, 373499, 348926, 389927, 348979, 152371, 348983, 340792, 398141, 357202, 389971, 357208, 389979, 357212, 430940, 357215, 439138, 201580, 201583, 349041, 340850, 381815, 430967, 324473, 398202, 340859, 324476, 430973, 119675, 340863, 324479, 324482, 373635, 324485, 324488, 381834, 185226, 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, 209904, 201712, 349173, 381947, 201724, 349181, 431100, 431107, 349203, 209944, 209948, 357411, 250915, 250917, 169002, 357419, 209966, 209969, 209973, 209976, 209980, 209988, 209991, 209996, 431180, 341072, 349268, 177238, 250968, 210011, 373853, 341094, 210026, 210028, 210032, 349296, 210037, 210042, 210045, 349309, 152704, 349313, 160896, 210053, 210056, 349320, 373905, 259217, 210068, 210072, 210078, 210081, 210085, 210089, 210096, 210100, 324792, 210108, 357571, 210116, 210128, 210132, 333016, 210139, 210144, 218355, 218361, 275709, 275713, 242947, 275717, 275723, 333075, 349460, 333079, 251161, 349486, 349492, 415034, 210261, 365912, 259423, 374113, 251236, 374118, 333164, 234867, 390518, 357756, 374161, 112021, 349591, 333222, 259516, 415168, 415187, 366035, 366039, 415192, 415194, 415197, 415200, 333285, 415208, 366057, 366064, 415217, 415225, 423424, 415258, 415264, 366118, 415271, 382503, 349739, 144940, 415279, 415282, 415286, 210488, 415291, 415295, 349762, 333396, 374359, 333400, 366173, 423529, 423533, 210547, 415354, 333440, 267910, 333512, 259789, 366301, 333535, 153311, 366308, 366312, 431852, 399086, 366319, 210673, 366322, 399092, 366326, 333566, 268042, 210700, 366349, 210707, 399129, 333595, 210720, 358192, 366384, 366388, 210740, 358201, 325441, 366403, 325447, 341831, 341835, 341839, 341844, 415574, 358235, 341852, 350046, 399200, 399208, 268144, 358256, 358260, 341877, 325494, 399222, 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, 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, 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, 326599, 359367, 187335, 359383, 359389, 383968, 343018, 359411, 261109, 261112, 244728, 383999, 261130, 359452, 261148, 211999, 261155, 261160, 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, 351424, 384192, 343232, 367817, 244938, 384202, 253132, 326858, 384209, 146644, 351450, 384225, 343272, 351467, 359660, 384247, 351480, 384250, 351483, 351492, 343307, 384270, 261391, 359695, 253202, 261395, 384276, 384284, 245021, 384290, 253218, 171304, 245032, 384299, 351535, 376111, 245042, 326970, 384324, 343366, 212296, 212304, 367966, 343394, 367981, 343410, 155000, 327035, 245121, 245128, 253321, 155021, 384398, 245137, 245143, 245146, 245149, 343453, 245152, 245155, 155045, 245158, 40358, 245163, 114093, 327090, 343478, 359867, 384444, 146878, 327108, 327112, 384457, 359887, 359891, 368093, 155103, 343535, 343540, 368120, 343545, 409092, 253445, 359948, 359951, 245295, 359984, 343610, 400977, 400982, 179803, 155241, 245358, 155255, 155274, 368289, 245410, 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, 262006, 327542, 147319, 262009, 425846, 262012, 155517, 155523, 155526, 360327, 376715, 155532, 262028, 262031, 262034, 262037, 262040, 262043, 155550, 253854, 262046, 262049, 262052, 327590, 155560, 155563, 155566, 327613, 393152, 311244, 393170, 155604, 155620, 253924, 155622, 253927, 327655, 360432, 393204, 360439, 253944, 393209, 393215 ]
fbdd2fb7a065e72960c138cb9208b2bdac937942
4b4e2b49a1cd2bcab6293361934cc43e165ac987
/SocialMediaGame/CustomTabBar.swift
257d0c894172c0295f856b6f5cf253b1866358cf
[]
no_license
jerixkiler/SMG
5491e4e2471f5d7c34fc3245231d0f4d40fb27f8
0e2688ff62fa2719931d3c7a47cbb41ebb3e6e05
refs/heads/master
2020-06-18T08:27:26.944681
2017-06-14T03:23:33
2017-06-14T03:23:33
94,163,634
0
0
null
null
null
null
UTF-8
Swift
false
false
1,132
swift
// // CustomTabBar.swift // SocialMediaGame // // Created by Nexusbond on 13/06/2017. // Copyright © 2017 Nexusbond. All rights reserved. // import UIKit class CustomTabBar: UITabBarController { override func viewDidLoad() { super.viewDidLoad() self.navigationController?.navigationBar.layer.borderWidth = 0 self.tabBar.layer.borderWidth = 0 self.tabBarItem.setTitleTextAttributes([NSForegroundColorAttributeName: UIColor.white], for:.selected) self.tabBarItem.setTitleTextAttributes([NSForegroundColorAttributeName: UIColor.white], for:.normal) self.tabBar.frame = CGRect(x: 0, y: (self.navigationController?.navigationBar.frame.size.height)! + 20 , width: self.tabBar.frame.size.width, height: self.tabBar.frame.size.height) } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } @IBAction func toogleNewPost(_ sender: Any) { performSegue(withIdentifier: "goToNewPost", sender: nil) } }
[ -1 ]
53f6faf82bf3bc2b11ed50436a0d03cf7cf4ec32
3e97cdebc211cca2b2bcbe12ec165825b6b00370
/Meimeila/Classes/Common/3rd/Music/DownLoadListen/JQDownLoadService.swift
f96cbdca883713fd9d341017362c4a9e514c0779
[]
no_license
wblt/Aolanya
7771f30c7fe242c7ba863559b07465d2ecfbfbac
c26b9df32a4a586a35fa768b7583359750653479
refs/heads/master
2020-03-06T20:49:37.069852
2018-07-20T09:49:39
2018-07-20T09:49:39
127,063,506
1
1
null
null
null
null
UTF-8
Swift
false
false
1,964
swift
// // JQDownLoadService.swift // AudioPlayerDemo // // Created by HJQ on 2017/11/23. // Copyright © 2017年 HJQ. All rights reserved. // import UIKit @objc protocol JQDownLoadServiceDelegate{ func downLoadSucceedsfilePath(filePath:String?) } // 根据模型下载音乐 class JQDownLoadService: NSObject { static let shared = JQDownLoadService() private override init() {} weak var delegate:JQDownLoadServiceDelegate? // 下载 class func downLoadVoiceM(model: JQDownLoadVoiceModel) { // 1. 创建本地缓存, 记录已经下载的数据记录 // 2. 执行下载操作 JQDownLoadManager.shared.downLoadWithURL(url: URL.init(string: model.downloadUrl)!, progressBlock: { (progress) in }, success: {(filePath) in // 更新本地状态 print("下载成功") // 当下载状态发生变化时, 告知外界, 外界可以更新显示列表(通知) shared.delegate?.downLoadSucceedsfilePath(filePath: filePath); }) { shared.delegate?.downLoadSucceedsfilePath(filePath: nil) print("下载失败") } } // 暂停 class func pauseVoiceM(model: JQDownLoadVoiceModel) { JQDownLoadManager.shared.pauseWithURL(url: URL.init(string: model.downloadUrl)!) } // 取消下载 class func stopVoiceM(model: JQDownLoadVoiceModel) { JQDownLoadManager.shared.cancelWithURL(url: URL.init(string: model.downloadUrl)!) } // 删除本地缓存 class func removeVoiceM(model: JQDownLoadVoiceModel) { JQDownLoadManager.shared.clearCacheWithURL(url: URL.init(string: model.downloadUrl)!) } // 查找本地文件 func isFileExist(model: JQDownLoadVoiceModel) -> Bool{ return JQDownLoadManager.shared.isFileExist(url:URL.init(string: model.downloadUrl)!) } }
[ -1 ]
7b84387f4989ca0798cfd1c5983bd9846ab5349e
5cbadd59d009597c024174f6f081159f326b1eeb
/Sources/Extension/Ex+UIColor.swift
c36ed4fb97524191072a07ada02a3a7d76b053e1
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
AnyImageKit/AnyImageEditor
8585b08966660bca6a389e6e1101b62a2e9a4323
60b7c3fbf922246b38eca05fae40534834d600f0
refs/heads/master
2022-03-28T22:36:46.269530
2019-11-15T02:01:58
2019-11-15T02:01:58
null
0
0
null
null
null
null
UTF-8
Swift
false
false
1,331
swift
// // Ex+UIColor.swift // AnyImageEditor // // Created by 蒋惠 on 2019/10/24. // Copyright © 2019 AnyImageProject.org. All rights reserved. // import UIKit extension UIColor { static func color(r: CGFloat, g: CGFloat, b: CGFloat, a: CGFloat = 1.0) -> UIColor { let divisor = CGFloat(255) return UIColor(red: r/divisor, green: g/divisor, blue: b/divisor, alpha: a) } static func color(hex: UInt32, alpha: CGFloat = 1.0) -> UIColor { let r = CGFloat((hex & 0xFF0000) >> 16) let g = CGFloat((hex & 0x00FF00) >> 8) let b = CGFloat((hex & 0x0000FF)) return color(r: r, g: g, b: b, a: alpha) } /// 创建动态 UIColor 的方法 /// - Parameter lightColor: light 模式下的颜色 /// - Parameter darkColor: dark 模式下的颜色,低于 iOS 13.0 不生效 static func create(light lightColor: UIColor, dark darkColor: UIColor?) -> UIColor { if #available(iOS 13.0, *) { return UIColor { (traitCollection) -> UIColor in if let darkColor = darkColor, traitCollection.userInterfaceStyle == .dark { return darkColor } else { return lightColor } } } else { return lightColor } } }
[ -1 ]
51f156ad9c835afe10b09b394da48d70595dc936
2bb1357f5a6ac094aff1d3281c828670e5a65894
/NGPlayer/Environment.swift
77b56895cb674330b358ac32ca720168f84dbddc
[]
no_license
dmitriy-shmilo/swiftui-ng-player
897f667a77b3ea2947aff68c2adb46da95694afe
09ebcaa754ea055e787c733364586955dd4c9b99
refs/heads/main
2023-08-10T23:09:23.353682
2021-09-26T13:46:20
2021-09-26T13:46:20
407,526,243
1
0
null
null
null
null
UTF-8
Swift
false
false
1,560
swift
// // Environment.swift // NGPlayer // // Created by Dmitriy Shmilo on 21.09.2021. // import SwiftUI extension EnvironmentValues { var safeAreaInsets: EdgeInsets { self[SafeAreaInsetsKey.self] } var currentPlayerHeight: CGFloat { get { self[CurrentPlayerHeightKey.self] } set { self[CurrentPlayerHeightKey.self] = newValue } } } extension View { // propagate player height up the hierarchy func reportCurrentPlayerHeight(_ height: CGFloat) -> some View { return preference(key: CurrentPlayerHeightPreferenceKey.self, value: height) } // pass player height down the hierarchy func currentPlayerHeight(_ height: CGFloat) -> some View { return environment(\.currentPlayerHeight, height) } // react to reportCurrentPlayerHeight() call func onCurrentPlayerHeightChange(action: @escaping (CGFloat) -> Void) -> some View { onPreferenceChange(CurrentPlayerHeightPreferenceKey.self, perform: action) } } private struct CurrentPlayerHeightPreferenceKey: PreferenceKey { static var defaultValue: CGFloat = 0 static func reduce(value: inout CGFloat, nextValue: () -> CGFloat) { value = nextValue() } } private struct CurrentPlayerHeightKey: EnvironmentKey { static var defaultValue: CGFloat = 0 } private struct SafeAreaInsetsKey: EnvironmentKey { static var defaultValue: EdgeInsets { UIApplication.shared.keyWindow?.safeAreaInsets.swiftUiInsets ?? EdgeInsets() } } private extension UIEdgeInsets { var swiftUiInsets: EdgeInsets { EdgeInsets(top: top, leading: left, bottom: bottom, trailing: right) } }
[ -1 ]
00fe3d760d717bd544076c495e34f2d54b5274cb
7dd8c31f0c2911d597cd22423b4c91123c942858
/MyTrips/MyTrips/AddTrip/Supporting Views/AddTripDateField.swift
e9b104c45fc855054a1e72f0f9a7f91db80df2aa
[]
no_license
Giulia28/MyTrips
465a35c40c323e8a87b82f4eabbe337e58671479
4c3b80cf640013baad4525928481c50507aa25a3
refs/heads/master
2020-11-25T14:19:05.765503
2019-12-17T22:20:31
2019-12-17T22:20:31
228,711,119
0
0
null
null
null
null
UTF-8
Swift
false
false
1,780
swift
// // AddTripDateField.swift // MyTrips // // Created by Giulia on 17/12/2019. // Copyright © 2019 giulia. All rights reserved. // import SwiftUI struct AddTripDateField: View { var fieldName: String @Binding var date: Date var minDate: Date? @State private var showDatePicker = false private var dateFormatter: DateFormatter { let formatter = DateFormatter() formatter.dateStyle = .short return formatter } private var dateRange: ClosedRange<Date> { let min = minDate ?? Calendar.current.date(byAdding: .year, value: -4, to: Date())! let max = Calendar.current.date(byAdding: .year, value: 4, to: Date())! return min...max } private var dateString: String { self.dateFormatter.string(from: self.date) } var body: some View { VStack { HStack { Text(fieldName) .font(.headline) .multilineTextAlignment(.leading) Spacer() Button(action: { withAnimation { self.showDatePicker.toggle() } }) { Text(dateString) } } .padding() if showDatePicker { Divider() DatePicker(selection: $date, in: dateRange, displayedComponents: .date) { Text("") } } } } } struct AddTripDateField_Previews: PreviewProvider { static var previews: some View { AddTripDateField(fieldName: "Start date:", date: .constant(Date()), minDate: Date()) .previewLayout(.fixed(width: 350, height: 70)) } }
[ -1 ]
80ce41a5aae532050f7514ce1c4b066792bf0d75
4d1670c93a9588e0fe185eccc2be5a21d4709fb9
/ExerciseKit/Controllers/ExerciseViewController.swift
ca3d92c0f7634152908441dc27d56711088fdb22
[ "MIT" ]
permissive
emannuelOC/exercise-kit
67533491616090c36cd3ad3784a040ca97085dff
00a6c3b82e8c23e119e274611253cb6e8a17405a
refs/heads/master
2020-06-11T06:03:09.496574
2016-12-09T03:52:13
2016-12-09T03:52:13
75,991,458
0
0
null
null
null
null
UTF-8
Swift
false
false
1,299
swift
// // ExerciseViewController.swift // ExerciseKit // // Created by Emannuel Fernandes de Oliveira Carvalho on 09/12/16. // Copyright © 2016 OC. All rights reserved. // import UIKit /// The delegate for an `ExerciseViewController`, that will be warned /// when the user cancels the exercise or finishes it. protocol ExerciseViewControllerDelegate { /// Tells the delegate that the user cancelled the exercise. /// /// - Parameter controller: the `ExerciseViewController` that is calling. func exerciseViewControllerDidCancel(_ controller: ExerciseViewController) /// Tells the delegate that the user finished the exercise. /// /// - Parameters: /// - controller: the `ExerciseViewController` that is calling. /// - result: the `ExerciseResult` with the user's answers. func exerciseViewController(_ controller: ExerciseViewController, didFinishWithResult result: ExerciseResult) } /// A view controller for an exercise class ExerciseViewController: UIViewController { /// The exercise that should be displayed. var exercise: Exercise? /// The delegate that will be called when the user finishes the exercise. var delegate: ExerciseViewControllerDelegate? }
[ -1 ]
eab6d889b3f3fab4351dcf0f54b01fb32863a7e7
eb45af26d93378eb9701a93c249789d806da5074
/KW Install/SceneDelegate.swift
335cebe5c3198c9a3c8410c7b04462efbc20e70c
[]
no_license
lukemorse/KWInstall
8230f4b969d2ecadeb0fac5d306388bf44652c33
2bfe0e971863c52c9a394adb6b65390b20756ed2
refs/heads/master
2022-11-17T17:40:30.349806
2020-05-26T16:17:37
2020-05-26T16:17:37
254,736,087
0
0
null
null
null
null
UTF-8
Swift
false
false
2,942
swift
// // SceneDelegate.swift // KW Install // // Created by Luke Morse on 4/2/20. // Copyright © 2020 Luke Morse. All rights reserved. // import UIKit import SwiftUI class SceneDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow? var floorPlanViewModel = FloorPlanViewModel() var mainViewModel = MainViewModel() func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). // Create the SwiftUI view that provides the window contents. let contentView = StartView().environmentObject(floorPlanViewModel).environmentObject(mainViewModel) // Use a UIHostingController as window root view controller. if let windowScene = scene as? UIWindowScene { let window = UIWindow(windowScene: windowScene) window.rootViewController = UIHostingController(rootView: contentView) self.window = window window.makeKeyAndVisible() } } func sceneDidDisconnect(_ scene: UIScene) { // Called as the scene is being released by the system. // This occurs shortly after the scene enters the background, or when its session is discarded. // Release any resources associated with this scene that can be re-created the next time the scene connects. // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). } func sceneDidBecomeActive(_ scene: UIScene) { // Called when the scene has moved from an inactive state to an active state. // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. } func sceneWillResignActive(_ scene: UIScene) { // Called when the scene will move from an active state to an inactive state. // This may occur due to temporary interruptions (ex. an incoming phone call). } func sceneWillEnterForeground(_ scene: UIScene) { // Called as the scene transitions from the background to the foreground. // Use this method to undo the changes made on entering the background. } func sceneDidEnterBackground(_ scene: UIScene) { // Called as the scene transitions from the foreground to the background. // Use this method to save data, release shared resources, and store enough scene-specific state information // to restore the scene back to its current state. } }
[ 325633, 325637, 163849, 268299, 333838, 346140, 352294, 163892, 16444, 337980, 254020, 217158, 243782, 395340, 327757, 200786, 286804, 329816, 217180, 368736, 342113, 180322, 329833, 286833, 368753, 252021, 342134, 286845, 192640, 286851, 329868, 268435, 250008, 329886, 286880, 135328, 192674, 333989, 286889, 430257, 180418, 350411, 346317, 180432, 350417, 368854, 350423, 350426, 385243, 334047, 356580, 346344, 327915, 350449, 387314, 375027, 338161, 350454, 321787, 350459, 336124, 350462, 336129, 350465, 350469, 389381, 325895, 194829, 350477, 43279, 350481, 350487, 356631, 338201, 325915, 350491, 381212, 325918, 182559, 350494, 258333, 325920, 350500, 194854, 350505, 350510, 395567, 248112, 332081, 307507, 340276, 336181, 356662, 264502, 332091, 332098, 201030, 332107, 190797, 334162, 332118, 418135, 321880, 250201, 332126, 332130, 250211, 340328, 250217, 348523, 348528, 182642, 321911, 332153, 334204, 268669, 194942, 250239, 332158, 332162, 389507, 348548, 393613, 383375, 332175, 160152, 340380, 268702, 416159, 326059, 373169, 342453, 334263, 338363, 266688, 324032, 336326, 338387, 248279, 369119, 334306, 338404, 334312, 338411, 104940, 375279, 162289, 328178, 328180, 248309, 328183, 340473, 199165, 328190, 324095, 328193, 98819, 324100, 266757, 324103, 164362, 248332, 199182, 328207, 324112, 330254, 186898, 342546, 340501, 324118, 334359, 342551, 324122, 334364, 330268, 340512, 191012, 332325, 324134, 197160, 381483, 324141, 324143, 334386, 324156, 334397, 188990, 324161, 324165, 219719, 324171, 324174, 324177, 244309, 334425, 326240, 340580, 174696, 375401, 248427, 191085, 346736, 338544, 268922, 334466, 336517, 344710, 119432, 213642, 148106, 162446, 330384, 326291, 340628, 342685, 340639, 336549, 332455, 271018, 332460, 336556, 389806, 332464, 385714, 164535, 336568, 174775, 248505, 174778, 244410, 328379, 332473, 223936, 328387, 332484, 332487, 373450, 418508, 154318, 332494, 342737, 154329, 139998, 183006, 189154, 338661, 332521, 338665, 418540, 330479, 342769, 340724, 332534, 338680, 342777, 418555, 344832, 207620, 336644, 191240, 328462, 326417, 336660, 338712, 199455, 336676, 334633, 326444, 215854, 271154, 152371, 326452, 328498, 326455, 340792, 348983, 244542, 326463, 326468, 328516, 336709, 127815, 244552, 328520, 326474, 328523, 336712, 342857, 326479, 355151, 330581, 326486, 136024, 330585, 326494, 439138, 326503, 375657, 326508, 201580, 201583, 326511, 355185, 211826, 340850, 330612, 201589, 340859, 324476, 328574, 340863, 359296, 351105, 252801, 373635, 324482, 324488, 342921, 236432, 361361, 324496, 330643, 324502, 252823, 324511, 324514, 252838, 201638, 211885, 324525, 5040, 5047, 324539, 324542, 187335, 398280, 347082, 340940, 345046, 330711, 248794, 340958, 248799, 340964, 386023, 328690, 359411, 244728, 330750, 265215, 328703, 199681, 328710, 338951, 330761, 328715, 326669, 330769, 361490, 349203, 209944, 336922, 209948, 248863, 345119, 250915, 357411, 250917, 158759, 347178, 328747, 209966, 209969, 330803, 209973, 386102, 209976, 339002, 339010, 209988, 209991, 347208, 248905, 330827, 197708, 330830, 341072, 248915, 345172, 183384, 156762, 343132, 339037, 322660, 326764, 210028, 326767, 187503, 345200, 330869, 361591, 386168, 210042, 210045, 361599, 152704, 160896, 330886, 351366, 384136, 384140, 351382, 337048, 210072, 248986, 384152, 210078, 384158, 210081, 384161, 251045, 210085, 210089, 339118, 337072, 210096, 337076, 210100, 345268, 249015, 324792, 367801, 339133, 384189, 343232, 384192, 210116, 244934, 326858, 333003, 322763, 384202, 343246, 384209, 333010, 146644, 330966, 210139, 328925, 66783, 384225, 328933, 343272, 351467, 328942, 251123, 384247, 384250, 388348, 242947, 206084, 115973, 343307, 384270, 333075, 384276, 333079, 251161, 384284, 245021, 384290, 208167, 263464, 171304, 245032, 245042, 251190, 44343, 345400, 208189, 386366, 343366, 126279, 337224, 251211, 357710, 337230, 331089, 337235, 437588, 263509, 331094, 175458, 343394, 208228, 175461, 337252, 343399, 175464, 345449, 197987, 99692, 333164, 343410, 234867, 331124, 175478, 155000, 378232, 249210, 175484, 337278, 249215, 245121, 249219, 245128, 249225, 181644, 361869, 249228, 136591, 245137, 181650, 249235, 112021, 181655, 245143, 175514, 245146, 343453, 245149, 245152, 263585, 396706, 245155, 355749, 40358, 181671, 245158, 333222, 245163, 181679, 337330, 327090, 210357, 146878, 181697, 361922, 54724, 327108, 181704, 327112, 339401, 384457, 327116, 327118, 208338, 366035, 181717, 343509, 337366, 249310, 249313, 333285, 329195, 343540, 343545, 423424, 253445, 339464, 337416, 249355, 329227, 175637, 405017, 345626, 366118, 339504, 349748, 206397, 214594, 333387, 214611, 333400, 366173, 339553, 343650, 333415, 327276, 245358, 222831, 333423, 138865, 339572, 372354, 126597, 159375, 126611, 140955, 333472, 245410, 345763, 345766, 425639, 245415, 337588, 155323, 333499, 337601, 337607, 210632, 333512, 339664, 358100, 419543, 245463, 212700, 181982, 153311, 333535, 225000, 337643, 245487, 339696, 337647, 245495, 141052, 337661, 333566, 339711, 225027, 337671, 339722, 366349, 249617, 321300, 245528, 333593, 116512, 210720, 362274, 184096, 339748, 358192, 372533, 345916, 399166, 384831, 325441, 247618, 325447, 341831, 329545, 341835, 323404, 354124, 337743, 339795, 354132, 341844, 247639, 337751, 358235, 341852, 313181, 413539, 399208, 339818, 327532, 339827, 358260, 341877, 399222, 325494, 182136, 186233, 1914, 333690, 243584, 325505, 333699, 339845, 247692, 333709, 247701, 329625, 327590, 333737, 382898, 184245, 337845, 190393, 327613, 333767, 350153, 346059, 311244, 358348, 247760, 212945, 333777, 219094, 419810, 329699, 358372, 327655, 247790, 204785, 380919, 333819 ]
295b4d72a3a4616281fd3ad68f1db23d81f95056
ff0a3632751933ada42f883ab0afd080233e0e87
/SignIn/NewUserViewController.swift
b8d68439b37a0f113576c7482ebf8a8a3627cd6a
[]
no_license
morganlutz/SignInBikeCollectives
1a1e832806cc8f4b39c4b6bbefabdf76a3dacff4
9d2b6f0c9de6b985a9c1e2a8d61bd4acc6c63220
refs/heads/master
2021-01-20T18:45:17.372559
2017-05-21T15:58:31
2017-05-21T15:58:31
63,553,854
0
0
null
null
null
null
UTF-8
Swift
false
false
6,789
swift
// // NewUserViewController.swift // SignIn // // Created by Momoko Saunders on 7/8/15. // Copyright (c) 2015 Momoko Saunders. All rights reserved. // import Foundation import UIKit class NewUserViewController: UIViewController, UICollectionViewDelegateFlowLayout, UICollectionViewDataSource { var contact : Contact? var contactIndentifier : String? let contactLog = ContactLog() let shopUseLog = ShopUseLog() let orgLog = OrganizationLog() @IBOutlet weak var firstName: UITextField! @IBOutlet weak var lastName: UITextField! @IBOutlet weak var email: UITextField! @IBOutlet weak var pin: UITextField! @IBOutlet weak var permissionToEmail: UISwitch! @IBOutlet weak var yesNoQuestion: UILabel! @IBAction func save(sender: AnyObject) { if firstName.text == "" && lastName.text == "" && email.text == "" { showAlertForIncompleteForm() } else { // set the contacts properties contact!.firstName = firstName.text!.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()) contact!.lastName = lastName.text!.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()) contact!.emailAddress = email.text!.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()) contact!.pin = pin.text!.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()) contact!.yesOrNoQuestion = permissionToEmail.on // save contact contactLog.saveContact(contact!) // show waiver showWaiverForCompleteForm() } } override func viewDidLoad() { super.viewDidLoad() permissionToEmail.tintColor = Colors().blue permissionToEmail.onTintColor = Colors().blue contact = contactLog.createUserWithIdentity(contactIndentifier!) firstName.text = contact!.firstName let yesNo = orgLog.currentOrganization().organization?.yesOrNoQuestion yesNoQuestion.text = yesNo if yesNo == "" { yesNoQuestion.hidden = true permissionToEmail.hidden = true } let tap = UITapGestureRecognizer(target: self, action: "dismissKeyboard") view.addGestureRecognizer(tap) tap.cancelsTouchesInView = false } override func viewDidAppear(animated: Bool) { firstName.becomeFirstResponder() } override func viewWillDisappear(animated: Bool) { if firstName.text == "" && lastName.text == "" && email.text == "" { //delete the contact from the data base contactLog.deleteContact(contact!) } } override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { if segue.identifier == "Thank You" { let vc = segue.destinationViewController as! BFFThankYouForSigningIn vc.contact = contact! } } } // Mark: - CollectionView Delegate - extension NewUserViewController { func numberOfSectionsInCollectionView(collectionView: UICollectionView) -> Int { return 1 } func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return 6 } func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell { let cell = collectionView.dequeueReusableCellWithReuseIdentifier("Cell", forIndexPath: indexPath) as! CircleCollectionViewCell let image = UIImage(named: "circle") cell.circleImage.image = image if indexPath.row == 0 { cell.circleImage.tintColor = Colors().purple } else if indexPath.row == 1 { cell.circleImage.tintColor = Colors().blue } else if indexPath.row == 2 { cell.circleImage.tintColor = Colors().green } else if indexPath.row == 3 { cell.circleImage.tintColor = Colors().yellow } else if indexPath.row == 4 { cell.circleImage.tintColor = Colors().orange } else if indexPath.row == 5 { cell.circleImage.tintColor = Colors().red } return cell } func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) { if indexPath.row == 0 { contactLog.editColourForContact(contact!, colour: .purple) collectionView.backgroundColor = Colors().purpleHighlight } else if indexPath.row == 1 { contactLog.editColourForContact(contact!, colour: .blue) collectionView.backgroundColor = Colors().blueHighlight } else if indexPath.row == 2 { contactLog.editColourForContact(contact!, colour: .green) collectionView.backgroundColor = Colors().greenHighlight } else if indexPath.row == 3 { contactLog.editColourForContact(contact!, colour: .yellow) collectionView.backgroundColor = Colors().yellowHighlight } else if indexPath.row == 4 { contactLog.editColourForContact(contact!, colour: .orange) collectionView.backgroundColor = Colors().orangeHighlight } else if indexPath.row == 5 { contactLog.editColourForContact(contact!, colour: .red) collectionView.backgroundColor = Colors().redHighlight } } func dismissKeyboard() { self.view.endEditing(true) } func showAlertForIncompleteForm() { let alert = UIAlertController(title: "Did you mean to save", message: "You need to fill in at least one field to create a user", preferredStyle: .Alert) let ok = UIAlertAction(title: "Ok", style: .Default, handler: nil) alert.addAction(ok) presentViewController(alert, animated: true, completion: nil) } func showWaiverForCompleteForm () { if let waiver = orgLog.currentOrganization().organization!.waiver { if waiver == "" { performSegueWithIdentifier("Thank You", sender: self) } else { let alert = UIAlertController(title: "Waiver", message: waiver, preferredStyle: .Alert) let cancel = UIAlertAction(title: "Cancel", style: .Cancel, handler: nil) alert.addAction(cancel) let agree = UIAlertAction(title: "I Agree", style: .Default, handler: { alert in self.performSegueWithIdentifier("Thank You", sender: self) }) alert.addAction(agree) presentViewController(alert, animated: true, completion: nil) } } } }
[ -1 ]
0b1c0539fcf3d6e7a6c4298a7c8f272524364b72
7db6ea6a5816f2774a331252e49fdb1066b2e8bd
/EmmaChallengeApp/UI/Controllers/Tab Bar/TabBarViewController.swift
79e084db8cf2679935f5527fd4dc77b98a5bcaa3
[]
no_license
naveedah94/EmmaChallengeApp
169dea86abb35a9c86d30f9a7734c660a82cc837
799d00c051401743b012eec5b4e0080157759625
refs/heads/master
2023-06-29T19:32:01.128837
2021-08-03T19:32:04
2021-08-03T19:32:04
392,431,570
0
0
null
null
null
null
UTF-8
Swift
false
false
1,000
swift
// // TabBarViewController.swift // EmmaChallengeApp // // Created by Naveed Ahmed on 03/08/2021. // Copyright © 2021 Naveed Ahmed. All rights reserved. // import UIKit class TabBarViewController: UITabBarController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. } override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) self.updateBadge() } func updateBadge() { self.tabBar.items?[1].badgeValue = String(DataManager.shared.getFavourites().count) } func loadDetails(event: Event) { let controller = self.storyboard?.instantiateViewController(withIdentifier: "DetailsViewController") as! DetailsViewController let vm = DetailsViewModel(event: event) controller.viewModel = vm controller.modalPresentationStyle = .fullScreen self.present(controller, animated: true, completion: nil) } }
[ -1 ]
a9bb8e2a8dbfc8606f3ee1fbd9529c31bcaefa84
ca5e4eb6ebf7eec1a5b6d9d7e146b08f27ef103f
/ViewController/HelpVC.swift
6eceee4f24504585d76b4bd813334b378385a6d6
[]
no_license
BugraTuncer/HeyKomsuProject
92867de2c5c5325bd026dea2f7bb5285737a0ea8
d7a3c44ff17f631896c36c428e70ebce9ad70497
refs/heads/master
2022-11-05T18:58:02.250442
2020-06-21T13:49:49
2020-06-21T13:49:49
273,913,309
1
0
null
null
null
null
UTF-8
Swift
false
false
690
swift
// // HelpVC.swift // GradutionThesis // // Created by Buğra Tunçer on 25.05.2020. // Copyright © 2020 Buğra Tunçer. All rights reserved. // import UIKit class HelpVC: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. } /* // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepare(for segue: UIStoryboardSegue, sender: Any?) { // Get the new view controller using segue.destination. // Pass the selected object to the new view controller. } */ }
[ -1 ]
978f716371246500db436b74f35a09db0027ee31
0a186a467d1ce2531079614d5cfd1dd530a9803d
/SweetPea/Library/Result.swift
e0c876fb58b997b3770395f36bf955d565e0f9f9
[]
no_license
bamurph/SweetPea
94c402bac1a2177e97d6867ece83e1b2778bf9a2
210645816142b401c24b818a015f98ade92adaac
refs/heads/master
2020-07-28T09:49:10.855639
2017-02-28T19:31:59
2017-02-28T19:31:59
73,414,966
0
0
null
2016-12-29T20:03:33
2016-11-10T19:38:56
Swift
UTF-8
Swift
false
false
1,158
swift
// // Result.swift // SweetPea // // Created by Ben Murphy on 12/27/16. // Copyright © 2016 Constellation Software. All rights reserved. // import Foundation enum Result<Value> { case success(Value) case failure(Error) } extension Result { func flatMap<U>(_ transform: (Value) -> Result<U>) -> Result<U> { switch self { case .success(let val): return transform(val) case .failure(let err): return .failure(err) } } func flatMap<U>(_ transform: (Value) -> Result<U>, onFailure: () -> Void) -> Result<U> { switch self { case .success(let val): return transform(val) case .failure(let err): onFailure() return .failure(err) } } /// Convert a Result back to standard Swift 'throws' style error handling public func unwrap() throws -> Value { switch self { case .success(let v): return v case .failure(let e): throw e } } /// Convert a Result to an Optional, throwing away error info public func asOptional() -> Value? { return try? self.unwrap() } }
[ -1 ]
a864b017293e9acb84d10afd38c2f2b4e0f39202
f3fae960a40442bfb586fb88ef4f3a737c88d9f4
/Slangify/SLNDomains.swift
86905ec2ffa8ca56eb810e79b1151d9d560cad30
[]
no_license
bettyCar/Slangify---iOS
4823dfd451f18328ebb1e3413dee32c4b81ae9a6
3dc73f927abecc0f895e2d65eb0d11be2cb2167b
refs/heads/master
2021-01-18T17:26:21.126955
2017-04-14T12:53:17
2017-04-14T12:53:17
86,798,008
1
0
null
null
null
null
UTF-8
Swift
false
false
1,494
swift
// // SLNDomains.swift // Slangify // // Created by Betty Kintzlinger on 22/03/2017. // Copyright © 2017 Geemodity. All rights reserved. // import Foundation import UIKit enum FirebaseDataBase : String { case languages case phrases } enum HexColors : String { case lightBlue = "#50e3c2" case green = "#39beac" case lightGray = "#fafafa" case purple = "#9012fe" //b38f12 } extension HexColors { func getColor() -> UIColor { var cString:String = self.rawValue.trimmingCharacters(in: .whitespacesAndNewlines).uppercased() if (cString.hasPrefix("#")) { cString.remove(at: cString.startIndex) } if ((cString.characters.count) != 6) { return UIColor.gray } var rgbValue:UInt32 = 0 Scanner(string: cString).scanHexInt32(&rgbValue) return UIColor( red: CGFloat((rgbValue & 0xFF0000) >> 16) / 255.0, green: CGFloat((rgbValue & 0x00FF00) >> 8) / 255.0, blue: CGFloat(rgbValue & 0x0000FF) / 255.0, alpha: CGFloat(1.0) ) } } enum RobotoSlabFont : String { case regular = "RobotoSlab-Regular" case bold = "RobotoSlab-Bold" } //extension RobotoSlabFont { // // func getName() -> String { // switch self { // case .regular: // return "RobotoSlab-Regular" // case .bold: // return "RobotoSlab-Bold" // } // } //}
[ -1 ]
c2f74946cb6679fb9adb3dca4cc64f47b91ce503
ef0c79aab71bd87b1f1e8cdb56412be2ce04d0e7
/FeltPen/WrappersDetector.swift
ef4ef047e5fbac1882a6ebb970177f91f4c36097
[ "MIT" ]
permissive
viktart/FeltPen
9f6875e9e441bd9ced7cbe5e453abacc5f2cd5d4
564f332862128de37eed395ef25f3b9dbb2c4fc1
refs/heads/master
2020-03-23T19:50:10.078919
2018-02-14T13:42:28
2018-02-14T13:42:28
null
0
0
null
null
null
null
UTF-8
Swift
false
false
4,157
swift
// // WrappersDetector.swift // Pods // // Created by Aleksei Gordeev on 08/07/2017. // // import Foundation /** Basic detector which search strings using prefix and suffix symbols. Processes string and settings attributes. Related Attribute Value: SpotAttribute */ public class WrappersDetector: Detector { public let searchingItems: [SearchingItem] // MARK: init public init(searchingItems: [SearchingItem] = SearchingItem.all) { self.searchingItems = searchingItems } @discardableResult public func process(text: NSMutableAttributedString) throws -> DetectorResult { guard !self.searchingItems.isEmpty else { return [] } var spots: [DetectorSpot] = [] for item in searchingItems { let spotAttribute = SpotAttribute.init(item: item) let regex = type(of: self).createRegex(item: item) let range = NSRange(location: 0, length: text.string.characters.count) let matches = regex.matches(in: text.string, options: [], range: range) let ranges = matches.rangesOfClosure(idx: 1) let itemSpots: [DetectorSpot] = ranges.map({ _, range in return DetectorSpot.init([.charWrapped(item.charString): spotAttribute], range: range) }) spots.append(contentsOf: itemSpots) } for spot in spots { spot.apply(text: text) } return DetectorResult.attributesChange } internal static func createRegex(item: SearchingItem) -> NSRegularExpression { let searchingChar = item.charString let escapedChar = NSRegularExpression.escapedPattern(for: searchingChar) let allowedCharsPattern = "[ .,#!$%^&;:{}=_`~()\\/-/*]" let fixedAllowedCharsPattern = allowedCharsPattern.replacingOccurrences(of: escapedChar, with: "") let searchingTarget = "(\(escapedChar)[^\(searchingChar)]+\(escapedChar))" let beginPattern = "(?:^|\(fixedAllowedCharsPattern))" let endPattern = "(?:$|\(fixedAllowedCharsPattern))" let pattern = beginPattern.appending(searchingTarget).appending(endPattern) let regex = try! NSRegularExpression(pattern: pattern, options: []) return regex } } // MARK: Nested Types public extension WrappersDetector { public struct SearchingItem: Hashable, CustomStringConvertible { public let charString: String public init(_ charString: String) { self.charString = charString } // MARK: Equality public static func ==(lhs: SearchingItem, rhs: SearchingItem) -> Bool { return lhs.charString == rhs.charString } public var hashValue: Int { return self.charString.hash } public var description: String { let pattern = WrappersDetector.createRegex(item: self).pattern return "SearchingItem: \(pattern)" } // MARK: Static Constants public static let backtick = SearchingItem.init("`") public static let asteriks = SearchingItem.init("*") public static let underscore = SearchingItem.init("_") public static let tilde = SearchingItem.init("~") public static let all: [SearchingItem] = [.backtick, .asteriks, .underscore, .tilde] public var detectorAttributeName: DetectorAttributeName { return DetectorAttributeName.charWrapped(self.charString) } } public struct SpotAttribute: Hashable { public let item: SearchingItem public init(item: SearchingItem) { self.item = item } public var hashValue: Int { return self.item.hashValue } public static func ==(lhs: SpotAttribute, rhs: SpotAttribute) -> Bool { return lhs.item == rhs.item } } }
[ -1 ]
fee9f85801e5272576de60f3e8791ee278ef51d5
01033bb36b699ca9da153781e1544fa137545dcd
/iOSDemos/ViewAnimationAssignment/ViewAnimationAssignment/ViewController.swift
2a6048bb45d7d69dcb93d651405acede521a0dbd
[]
no_license
CodeKul/iOS-Dec-2016Weekend
d0f2ab6cd108415f4036cbec49d874840ae1a2cd
bcba1e96f932e3b74f44a9e1b2f9685e30a8c53a
refs/heads/master
2021-04-30T16:42:03.498756
2017-03-12T07:05:17
2017-03-12T07:05:17
80,095,252
0
0
null
null
null
null
UTF-8
Swift
false
false
928
swift
// // ViewController.swift // ViewAnimationAssignment // // Created by Codekul on 11/02/17. // Copyright © 2017 CodeKul. All rights reserved. // import UIKit class ViewController: UIViewController { @IBOutlet var topConstraint : NSLayoutConstraint! override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } @IBAction func moveView(_ sender : UIButton){ if topConstraint.constant == 0 { topConstraint.constant = 300 } else{ topConstraint.constant = 0 } UIView.animate(withDuration: 0.5, animations: { self.view.layoutIfNeeded() }) } }
[ -1 ]
004cd7ec7e4c74639c37138d8865b3d83453a27c
ec5705653c5896bd9e96d4efe076336a1290aef7
/LinkedList/Tests/LinkedListTests/StackTests.swift
0d3c0fe65941f7127615991cd3f12a5efe9e073e
[]
no_license
chadarutherford/CS-Problems-In-Swift
c5a7140f10cb1319afa7c64b2d5c7394c1da1d8e
87af940eae1abeb079f738d486bfa3a97da0f15a
refs/heads/master
2022-11-04T10:37:17.109968
2020-05-20T15:00:46
2020-05-20T15:00:46
263,212,263
0
1
null
null
null
null
UTF-8
Swift
false
false
2,142
swift
import XCTest @testable import LinkedList final class StackTests: XCTestCase { func testCountReturns0ForEmptyLLStack() { let stack = LinkedListStack<Int>() XCTAssertEqual(stack.count(), 0) } func testCountReturns0ForEmptyArrayStack() { let stack = ArrayStack<Int>() XCTAssertEqual(stack.count(), 0) } func testCountReturnsCorrectLengthAfterArrayPush() { let stack = ArrayStack<Int>() XCTAssertEqual(stack.count(), 0) stack.push(2) XCTAssertEqual(stack.count(), 1) stack.push(4) XCTAssertEqual(stack.count(), 2) stack.push(6) stack.push(8) stack.push(10) stack.push(12) stack.push(14) stack.push(16) stack.push(18) XCTAssertEqual(stack.count(), 9) } func testCountReturnsCorrectLengthAfterLLPush() { let stack = LinkedListStack<Int>() XCTAssertEqual(stack.count(), 0) stack.push(2) XCTAssertEqual(stack.count(), 1) stack.push(4) XCTAssertEqual(stack.count(), 2) stack.push(6) stack.push(8) stack.push(10) stack.push(12) stack.push(14) stack.push(16) stack.push(18) XCTAssertEqual(stack.count(), 9) } func testEmptyArrayPop() { let stack = ArrayStack<Int>() XCTAssertNil(stack.pop()) XCTAssertEqual(stack.count(), 0) } func testEmptyLLPop() { let stack = LinkedListStack<Int>() XCTAssertNil(stack.pop()) XCTAssertEqual(stack.count(), 0) } func testLLPopRespectsOrder() { let stack = LinkedListStack<Int>() stack.push(100) stack.push(101) stack.push(105) XCTAssertEqual(stack.pop(), 105) XCTAssertEqual(stack.count(), 2) XCTAssertEqual(stack.pop(), 101) XCTAssertEqual(stack.count(), 1) XCTAssertEqual(stack.pop(), 100) XCTAssertEqual(stack.count(), 0) XCTAssertNil(stack.pop()) XCTAssertEqual(stack.count(), 0) } func testArrayPopRespectsOrder() { let stack = ArrayStack<Int>() stack.push(100) stack.push(101) stack.push(105) XCTAssertEqual(stack.pop(), 105) XCTAssertEqual(stack.count(), 2) XCTAssertEqual(stack.pop(), 101) XCTAssertEqual(stack.count(), 1) XCTAssertEqual(stack.pop(), 100) XCTAssertEqual(stack.count(), 0) XCTAssertNil(stack.pop()) XCTAssertEqual(stack.count(), 0) } }
[ -1 ]
1f2bbd5b6b01cdad48597b9a8486a456ce3e56e8
1a798b10bd3c87fd6985f8ee729eba6270353a39
/MVVMExample/MVVMExample/Page/TableOfContent/TableOfContentsPage.swift
d234b0624bed6b9946434e2e1906ae1b3e1aeaaf
[ "MIT" ]
permissive
ultimatevegance/mvvm
855f5138341a715e98567b1a93595a6947b45cee
0a1e0a9b4b2eb7b930fff678833bc2700cfdc4aa
refs/heads/master
2023-06-25T09:08:14.662857
2021-07-20T03:08:49
2021-07-20T03:08:49
null
0
0
null
null
null
null
UTF-8
Swift
false
false
1,708
swift
// // NonGenericExampleMenusPage.swift // MVVM_Example // // Created by pham.minh.tien on 5/3/20. // Copyright © 2020 CocoaPods. All rights reserved. // import UIKit import MVVM import RxCocoa import RxSwift import Action class TableOfContentsPage: BaseListPage { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. enableBackButton = !(navigationController?.viewControllers.count == 1) } override func setupTableView(_ tableView: UITableView) { super.setupTableView(tableView) tableView.estimatedRowHeight = 200 tableView.separatorStyle = .singleLine tableView.register(cellType: MenuTableViewCell.self) } // Register event: Connect view to ViewModel. override func bindViewAndViewModel() { super.bindViewAndViewModel() guard let viewModel = viewModel as? TableOfContentViewModelType else { return } viewModel.inputs.rxPageTitle ~> rx.title => disposeBag } override func destroy() { super.destroy() viewModel?.destroy() } override func cellIdentifier(_ cellViewModel: Any, _ returnClassName: Bool = false) -> String { return MenuTableViewCell.identifier(returnClassName) } override func getItemSource() -> RxCollection? { guard let viewModel = viewModel as? TableOfContentViewModelType else { return nil } return viewModel.outputs.itemsSource } // Not recommended for use. override selectedItemDidChange on ViewModel. override func selectedItemDidChange(_ cellViewModel: Any, _ indexPath: IndexPath) {} }
[ -1 ]
d0dad969488a1ea5b906fc2a514f2d6d32e651bf
5bce98ce14e0f57248980b63c423b80f2d0e92cc
/app/ios/File.swift
e7c7081aac13db20cf3dfd09425049829f20a46b
[ "Apache-2.0" ]
permissive
RafGi/3Bot_connect
88bd8ce3023baf9a530954c4852a359dabb3457e
c84075ab8b6ce3b0113ef82bcf9292c8ef6a3997
refs/heads/master
2020-12-20T10:18:43.828026
2020-01-24T16:33:30
2020-01-24T16:33:30
236,039,911
0
0
Apache-2.0
2020-01-24T16:31:18
2020-01-24T16:31:17
null
UTF-8
Swift
false
false
160
swift
// // File.swift // Runner // // Created by Ivan Coene on 15/04/2019. // Copyright © 2019 The Chromium Authors. All rights reserved. // import Foundation
[ -1 ]
c68c4acbde3a137c8f1e257afb4dc0909bf412cd
a96755a0ea19617cfa064c95498d8136d67de760
/IG/ProfileCollectionReusableView.swift
cb348734531eba6d5db9147ab8507d19e07b2d16
[]
no_license
ninayang036/IG
76a8893996bc8c3fbc3d38d4552aa446258560f0
1eb92abc91893bf3a274b961ec1afa151a27fe43
refs/heads/main
2023-05-07T22:42:12.635234
2021-05-31T03:08:11
2021-05-31T03:08:11
372,368,049
0
0
null
null
null
null
UTF-8
Swift
false
false
552
swift
// // ProfileCollectionReusableView.swift // IG // // Created by Yang Nina on 2021/5/24. // import UIKit class ProfileCollectionReusableView: UICollectionReusableView { @IBOutlet weak var headshotImg: UIImageView! @IBOutlet weak var postsLabel: UILabel! @IBOutlet weak var followersLabel: UILabel! @IBOutlet weak var followingLabel: UILabel! @IBOutlet weak var usernameLabel: UILabel! @IBOutlet weak var categoryLabel: UILabel! @IBOutlet weak var introLabel: UILabel! @IBOutlet var Buttons: [UIButton]! }
[ 256147 ]
cee7974289e6c396de648e306b0a49deaeeb1412
9e68ed972c4e059520643a8437f404262355ec7a
/MoneyBalance/Helpers/AnimationControlller.swift
256cffad11b22b2e47d1879a8532062a30b2a1bd
[]
no_license
ignacioparadisi/MoneyBalance
e20cae07736de6871bc3b07da6c9a4dad08dbe30
56b6a22ae932905084654fc9c59103c66676396a
refs/heads/master
2020-05-03T18:24:13.711526
2019-04-18T02:33:32
2019-04-18T02:33:32
178,761,624
1
0
null
null
null
null
UTF-8
Swift
false
false
4,044
swift
// // AnimationControlller.swift // MoneyBalance // // Created by Ignacio Paradisi on 3/23/19. // Copyright © 2019 Ignacio Paradisi. All rights reserved. // import UIKit class AnimationController: NSObject { private let duration: TimeInterval private let isPresenting: Bool private let originFrame: CGRect // MARK: - init init(duration: TimeInterval, isPresenting: Bool, originFrame: CGRect) { self.duration = duration self.isPresenting = isPresenting self.originFrame = originFrame } } extension AnimationController: UIViewControllerAnimatedTransitioning { func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval { return duration } func animateTransition(using transitionContext: UIViewControllerContextTransitioning) { guard let toView = transitionContext.view(forKey: .to), let fromView = transitionContext.view(forKey: .from) else { transitionContext.completeTransition(false) return } let container = transitionContext.containerView // self.isPresenting ? container.addSubview(toView) : container.insertSubview(toView, belowSubview: fromView) let detailView = isPresenting ? toView : fromView let initialFrame = isPresenting ? originFrame : detailView.frame let finalFrame = isPresenting ? detailView.frame : originFrame let xScaleFactor = isPresenting ? initialFrame.width / finalFrame.width : finalFrame.width / initialFrame.width let yScaleFactor = isPresenting ? initialFrame.height / finalFrame.height : finalFrame.height / initialFrame.height let scaleTransform = CGAffineTransform(scaleX: xScaleFactor, y: yScaleFactor) if isPresenting { detailView.transform = scaleTransform detailView.center = CGPoint( x: initialFrame.midX, y: initialFrame.midY) detailView.clipsToBounds = true } container.addSubview(toView) container.bringSubviewToFront(detailView) if isPresenting { //update opening animation UIView.animate(withDuration: duration, delay:0.0, usingSpringWithDamping: 1.0, initialSpringVelocity: 0.0, //gives it some bounce to make the transition look neater than if you have defaults animations: { detailView.transform = CGAffineTransform.identity detailView.center = CGPoint(x: finalFrame.midX, y: finalFrame.midY) }, completion:{_ in transitionContext.completeTransition(true) } ) } else { //update closing animation UIView.animate(withDuration: duration, delay:0.0, options: .curveLinear, animations: { detailView.transform = scaleTransform detailView.center = CGPoint(x: finalFrame.midX, y: finalFrame.midY) }, completion:{_ in if !self.isPresenting { // self.dismissCompletion?() } transitionContext.completeTransition(true) } ) } } func presentAnimation(with transitionContext: UIViewControllerContextTransitioning, view: UIView) { view.clipsToBounds = true view.transform = CGAffineTransform(scaleX: 0, y: 0) let duration = transitionDuration(using: transitionContext) UIView.animate(withDuration: duration, delay: 0, usingSpringWithDamping: 0.80, initialSpringVelocity: 0.1, options: .curveEaseInOut, animations: { view.transform = CGAffineTransform(scaleX: 1.0, y: 1.0) }) { _ in transitionContext.completeTransition(true) } } }
[ -1 ]
803e69216c12b7979eced50b30de47c41a1c54eb
574a7016a72dfafb5d5f1bcb8a33df38773614fc
/allbeat-ios/allbeat/allbeat/AdudioProgressView.swift
c9c03e3cf9d7f1b02c07b5e1fe15851587c5f6af
[]
no_license
abrevnov17/Allbeat-iOS-App
9cf488ebf8cefdd29c75f1d86a6139b409e217b4
176958001bf85b86d99251b7ba65ec3158a5cba7
refs/heads/master
2021-01-18T22:10:47.136252
2017-07-19T16:25:50
2017-07-19T16:25:50
87,035,109
0
0
null
null
null
null
UTF-8
Swift
false
false
1,269
swift
// // AdudioProgressView.swift // allbeat // // Created by Nathan Flurry on 12/21/15. // Copyright © 2015 allbeat, LLC. All rights reserved. // import UIKit class AudioProgressView: CircularProgressView { // Determines if should update based on current player var isActive: Bool = false { willSet(value) { // Don't repeat the step if it didn't change if value == isActive { // print("isActive was set again to the same value.") return } // Enable or disable display lini if value { displayLink?.add(to: RunLoop.main, forMode: RunLoopMode(rawValue: RunLoopMode.commonModes.rawValue)) } else { displayLink?.remove(from: RunLoop.main, forMode: RunLoopMode(rawValue: RunLoopMode.commonModes.rawValue)) progress = 0 } } } // Link to getting updates every frame private var displayLink: CADisplayLink? override func setup() { super.setup() // Set up the display link displayLink = CADisplayLink(target: self, selector: #selector(AudioProgressView.update)) } // Called up CADisplayLink update func update() { if let percentComplete = AudioPlayer.sharedInstance.percentComplete , isActive { progress = CGFloat(percentComplete) } else { print("Called update() while inactive.") } } }
[ -1 ]
5d2dc0c4a31e56905219bbb82ebf938bcc79dc46
ca23ebf1ce6b506ae93ecf4e0b69369656b84521
/ios/Classes/messager/nativeEvents/PageDisappearedEvent.swift
37e33ec7abbf35ed483856ae4fa89f4b8ace62ed
[]
no_license
Wtoto/blade
c64e231f0538f228eaf0eb2b3c63d0b9c856debf
5f28e7e03f5415f478c1eaee75f36b4b1c763997
refs/heads/main
2023-08-17T15:51:15.079775
2021-09-17T01:36:42
2021-09-17T01:36:42
null
0
0
null
null
null
null
UTF-8
Swift
false
false
331
swift
// // PageDisappearedEvent.swift // blade // // Created by sangya on 2021/9/7. // import Foundation public struct PageDisappearedEvent:NativeBaseEvent { var methodName: String var pageInfo: PageInfo? init(_ pageInfo:PageInfo?) { self.methodName = "pageDisappeared" self.pageInfo = pageInfo } }
[ -1 ]
f905eb619b1f2d6331ec27dd09774f4f1c5d2f1f
6d89c7c89657f8c4d5ec2580f21ed65fef665b73
/TextFieldsCatalog/TextFields/Services/AppearanceServices/Placeholder/NativePlaceholderService.swift
e5d55c33d3753a4ae37ecb3ea2201edf583bb901
[ "MIT" ]
permissive
chausovSurfStudio/TextFieldsCatalog
b8419a62e8ac126d70337641e937b15c4cf2638a
bf12b4a43105cedcfdc8bc6966f57b021c3b95b7
refs/heads/dev/version-1
2022-08-08T11:06:28.913712
2022-05-27T09:08:41
2022-05-27T09:08:41
167,145,770
30
10
MIT
2022-05-27T10:12:58
2019-01-23T08:26:09
Swift
UTF-8
Swift
false
false
4,379
swift
// // NativePlaceholderService.swift // TextFieldsCatalog // // Created by Александр Чаусов on 28/04/2020. // Copyright © 2020 Александр Чаусов. All rights reserved. // import UIKit /** Default variant of placeholder service which implements logic of `native`-placeholder. This service allows you to imitate behavior of default native placeholder. - Attention: - For more information - see also info about `NativePlaceholderConfiguration` in documentation. */ public final class NativePlaceholderService: AbstractPlaceholderService { // MARK: - Private Properties private let placeholder = UILabel() private weak var superview: UIView? private weak var field: InputField? private var configuration: NativePlaceholderConfiguration private var useIncreasedRightPadding = false // MARK: - Initialization public init(configuration: NativePlaceholderConfiguration) { self.configuration = configuration } // MARK: - Deinitialization deinit { placeholder.removeFromSuperview() } // MARK: - AbstractPlaceholderService public func provide(superview: UIView, field: InputField?) { self.superview = superview self.field = field } public func setup(placeholder: String?) { self.placeholder.text = placeholder } public func configurePlaceholder(fieldState: FieldState, containerState: FieldContainerState) { placeholder.removeFromSuperview() placeholder.text = placeholder.text ?? "" placeholder.font = configuration.font placeholder.textColor = configuration.colors.suitableColor(state: containerState) placeholder.frame = placeholderPosition() placeholder.autoresizingMask = [.flexibleWidth, .flexibleBottomMargin] superview?.addSubview(placeholder) } public func updateContent(fieldState: FieldState, containerState: FieldContainerState, animated: Bool) { updatePlaceholderColor(containerState: containerState) updateAfterTextChangedPrivate(fieldState: fieldState, animated: animated) } public func update(useIncreasedRightPadding: Bool, fieldState: FieldState, animated: Bool) { self.useIncreasedRightPadding = useIncreasedRightPadding placeholder.frame = placeholderPosition() } public func updateAfterTextChanged(fieldState: FieldState) { updateAfterTextChangedPrivate(fieldState: fieldState, animated: true) } } // MARK: - Private Methods private extension NativePlaceholderService { func updateAfterTextChangedPrivate(fieldState: FieldState, animated: Bool) { guard textIsEmpty() else { setupPlaceholderVisibility(isVisible: false, animated: animated) return } let isVisible: Bool if configuration.useAsMainPlaceholder { isVisible = !(fieldState == .active && configuration.behavior == .hideOnFocus) } else { isVisible = fieldState == .active && configuration.behavior == .hideOnInput } setupPlaceholderVisibility(isVisible: isVisible, animated: animated) } func placeholderPosition() -> CGRect { guard let superview = superview else { return .zero } var insets = configuration.insets if useIncreasedRightPadding { insets.right = configuration.increasedRightPadding } var placeholderFrame = superview.bounds.inset(by: insets) placeholderFrame.size.height = configuration.height return placeholderFrame } func updatePlaceholderColor(containerState: FieldContainerState) { placeholder.textColor = configuration.colors.suitableColor(state: containerState) } func textIsEmpty() -> Bool { return field?.inputText?.isEmpty ?? true } func setupPlaceholderVisibility(isVisible: Bool, animated: Bool) { let animationBlock: () -> Void = { self.placeholder.alpha = isVisible ? 1 : 0 } if isVisible && animated { UIView.animate(withDuration: AnimationTime.default, animations: animationBlock) } else { animationBlock() } } }
[ -1 ]
1818338dd7e48812236324a9b09aba086279577c
41292237835a96d05cca889de834ebe4057ffcf2
/DolapCaseApp/DolapCaseApp/SupportingFiles/AppDelegate.swift
af57e1911ce8e986db51d83e7fd766946a2bd68f
[]
no_license
omurolgunay/DolapCaseApp
c7ef573b013c216948bbdc2b823866ab359e0597
8a74eda12f94ad55b8641079a69fa5e1c5437293
refs/heads/master
2020-09-13T02:04:08.462473
2019-11-19T19:54:08
2019-11-19T19:54:08
222,628,679
1
1
null
null
null
null
UTF-8
Swift
false
false
1,757
swift
// // AppDelegate.swift // DolapCaseApp // // Created by omur olgunay on 15.11.2019. // Copyright © 2019 omur olgunay. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. if let productDetailModule = ProductDetailRouter.setupModule() { window = UIWindow(frame: UIScreen.main.bounds) window?.rootViewController = productDetailModule window?.makeKeyAndVisible() return true } 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. // } }
[ 333850, 346139, 344102, 163891, 217157, 243781, 327756, 286800, 374864, 338004, 342111, 342133, 250002, 250004, 329885, 333997, 430256, 256191, 327871, 350410, 180431, 350416, 350422, 350425, 268507, 334045, 356578, 346343, 338152, 327914, 350445, 346355, 321786, 350458, 336123, 350461, 350464, 325891, 350467, 350475, 350480, 350486, 338199, 350490, 325917, 350493, 350498, 338211, 350504, 350509, 248111, 332080, 340275, 336180, 332090, 332097, 332106, 190796, 334161, 250199, 321879, 250202, 332125, 250210, 246123, 348525, 354673, 321910, 332152, 334203, 250238, 340379, 338352, 334262, 334275, 326084, 330189, 338381, 338386, 338403, 334311, 328177, 334321, 328179, 328182, 340472, 328189, 324094, 328192, 328206, 324111, 186897, 342545, 340500, 324117, 334358, 342554, 334363, 332324, 324139, 324142, 334384, 324149, 334394, 324155, 324160, 219718, 324173, 324176, 352856, 174695, 191084, 148105, 326290, 340627, 184982, 342679, 98968, 342683, 332453, 332459, 332463, 332471, 328378, 223934, 334528, 328386, 332483, 332486, 332493, 189153, 338660, 342766, 332533, 207619, 338700, 326416, 336659, 199452, 336675, 326451, 340789, 326454, 244540, 326460, 326467, 328515, 127814, 244551, 328519, 326473, 328522, 336714, 338763, 326477, 336711, 326485, 326490, 201579, 201582, 326510, 211825, 330610, 201588, 324475, 328573, 324478, 324481, 324484, 324487, 324492, 236430, 324495, 330642, 324510, 324513, 211884, 324524, 340909, 5046, 324538, 324541, 340939, 340941, 248792, 340957, 340963, 359407, 244726, 330748, 328702, 330760, 328714, 209943, 336921, 336925, 345118, 250914, 209965, 209968, 209971, 209975, 339001, 209987, 209990, 248904, 330826, 341071, 248914, 250967, 339036, 341091, 210027, 345199, 210039, 210044, 152703, 160895, 384135, 330889, 384139, 210071, 337047, 248985, 339097, 384151, 210077, 210080, 384160, 210084, 210088, 210095, 337071, 337075, 244916, 249014, 384188, 210115, 332997, 326855, 244937, 384201, 343244, 384208, 146642, 330965, 333014, 210138, 384224, 343270, 351466, 384246, 251128, 384275, 333078, 251160, 384283, 245020, 384288, 245029, 208166, 199988, 251189, 337222, 331088, 337234, 331093, 343393, 208227, 251235, 345448, 333162, 343409, 234866, 378227, 154999, 333175, 327034, 384380, 249218, 245127, 181643, 136590, 245136, 249234, 112020, 181654, 245142, 245145, 343450, 245148, 245151, 245154, 245157, 181670, 337329, 181684, 181690, 146876, 181696, 327107, 384453, 181703, 327115, 327117, 366034, 343507, 337365, 339417, 249308, 333284, 339434, 343539, 210420, 337398, 329226, 345625, 366117, 339503, 265778, 206395, 333386, 333399, 333413, 327275, 222830, 138864, 339588, 159374, 339601, 245409, 345762, 337592, 337599, 333511, 339662, 358099, 245460, 181977, 224993, 245475, 224999, 337642, 245483, 141051, 225020, 337659, 339710, 225025, 337668, 339721, 321299, 345887, 225066, 225070, 358191, 225073, 225076, 399159, 325440, 341829, 325446, 354117, 323402, 341834, 341843, 337750, 358234, 327539, 341876, 358259, 333689, 325504, 333698, 339844, 337808, 247700, 329623, 225180, 333724, 118691, 327589, 337833, 184244, 337844, 358339, 346057, 247759, 329697, 358371, 327654, 247789, 380918 ]
6b6e7654b968a3e9ca56b7e97f5146cd1fef971c
07555b10ab672294b0c569a095565791254e8249
/URLEncode.playground/Contents.swift
34c51f56409e8a13ffbd5475e3b4be132d9111d5
[]
no_license
justNOZA/IOS_Study
eecb6ec60408851cda8a657d44fc3341cb3f3d20
cd1e4b4bbdb757ccaf8f468f4efe8ede7a85a02f
refs/heads/master
2023-05-25T05:51:24.269266
2021-06-07T01:37:24
2021-06-07T01:37:24
336,716,195
0
0
null
2021-05-24T05:08:57
2021-02-07T06:18:10
Swift
UTF-8
Swift
false
false
882
swift
import UIKit var str = "Hello, playground" //request.addValue("application/x-www-form-urlencoded; charset=utf-8", forHTTPHeaderField: "Content-Type") func urlEncode(_ ue : String) -> String? { var allowed = CharacterSet.alphanumerics allowed.insert(charactersIn: "-._* ") var result = ue.addingPercentEncoding(withAllowedCharacters: allowed) result = result?.replacingOccurrences(of: " ", with: "+") return result } func paramsCreate(param: achievementInquiryParams,_ value: String?, _ body: inout [String]) { guard let unwrappedData = value else { return } if unwrappedData.isEmpty { return } if var url_encode = urlEncode("\(param)"){ url_encode += "=" if let encod = urlEncode(unwrappedData){ url_encode += encod let bodyText = url_encode body.append(bodyText) } } }
[ -1 ]
b6c565a16467b7ddbc86d0a68dc62ec9564692c4
f3cdaea7f9c1f984e03ae5259e8a8befe2813ef1
/PennMobile/Home/Cells/Polls/HomePollsCellFooter.swift
c546b5412abf4f87ec14f790bd94f271aa6471e8
[ "MIT" ]
permissive
pennlabs/penn-mobile-ios
e8cbe96e1020bf27ca493d995398054a1239ce82
430b4c50c3025ba4739aa277f300dfdaef22e956
refs/heads/main
2023-06-08T20:36:43.364171
2023-04-19T16:14:53
2023-04-19T16:14:53
21,803,117
52
7
MIT
2023-09-14T19:45:45
2014-07-14T00:48:04
Swift
UTF-8
Swift
false
false
2,040
swift
// // HomePollsCellFooter.swift // PennMobile // // Created by Lucy Yuewei Yuan on 10/18/20. // Copyright © 2020 PennLabs. All rights reserved. // import UIKit import SnapKit class HomePollsCellFooter: UIView { static let height: CGFloat = 16 var noteLabel: UILabel! private var dividerLine: UIView! // // Must be called after being added to a view func prepare() { prepareFooter(inside: self.superview ?? UIView()) prepareNoteLabel() prepareDividerLine() } // MARK: Footer private func prepareFooter(inside safeArea: UIView) { self.snp.makeConstraints { (make) in make.leading.equalTo(safeArea) make.bottom.equalTo(safeArea) make.trailing.equalTo(safeArea) make.height.equalTo(HomePollsCellFooter.height) } } // MARK: Labels private func prepareNoteLabel() { noteLabel = getNoteLabel() addSubview(noteLabel) noteLabel.snp.makeConstraints { (make) in make.leading.equalTo(self) make.bottom.equalTo(self).offset(3) make.trailing.equalTo(self) } } // MARK: Divider Line private func prepareDividerLine() { dividerLine = getDividerLine() addSubview(dividerLine) dividerLine.snp.makeConstraints { (make) in make.leading.equalTo(self) make.trailing.equalTo(self) make.top.equalTo(self) make.height.equalTo(2) } } private func getNoteLabel() -> UILabel { let label = UILabel() label.font = .footerDescriptionFont label.textColor = .labelSecondary label.textAlignment = .left label.text = "Penn Mobile anonymously shares info with the organization." label.numberOfLines = 1 return label } private func getDividerLine() -> UIView { let view = UIView() view.backgroundColor = .grey5 view.layer.cornerRadius = 2.0 return view } }
[ -1 ]
17db8956374e2cda1ca902d86bbd819073b41e4d
c2f4484662f4d7c5ce855eede3d6b0093148b958
/FlightBooking/FlightBooking/FlightBookingTests/FlightBookingTests.swift
0067e9e1745af9c1b56c0619c5c2fda02a6e028a
[]
no_license
kiyoung-Lee/Swift_mvvm_test
24feeb356cf5c40927fb7bfb408f61e0fce8f1fc
2b28324822743626ec0beaf71af6ac1f3907a1a2
refs/heads/master
2020-12-03T00:24:24.198744
2017-07-21T12:34:35
2017-07-21T12:34:35
96,026,749
0
0
null
null
null
null
UTF-8
Swift
false
false
990
swift
// // FlightBookingTests.swift // FlightBookingTests // // Created by MAPSSI on 05/07/2017. // Copyright © 2017 KiyoungLee. All rights reserved. // import XCTest @testable import FlightBooking class FlightBookingTests: XCTestCase { override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. super.tearDown() } func testExample() { // This is an example of a functional test case. // Use XCTAssert and related functions to verify your tests produce the correct results. } func testPerformanceExample() { // This is an example of a performance test case. self.measure { // Put the code you want to measure the time of here. } } }
[ 282633, 313357, 145435, 317467, 98333, 278558, 241692, 239650, 229413, 292902, 102437, 329765, 354345, 223274, 354343, 315434, 325674, 229424, 282672, 241716, 180280, 288828, 288833, 288834, 286788, 315465, 311372, 311374, 354385, 196691, 223316, 315476, 329814, 278615, 307289, 354393, 200794, 309345, 280675, 227428, 280677, 43110, 321637, 329829, 131178, 278638, 319598, 288879, 299121, 204916, 233590, 131191, 223350, 237689, 288889, 280694, 292988, 131198, 292992, 227460, 319629, 311438, 235662, 325776, 278677, 284826, 233636, 299174, 173, 153776, 239793, 131256, 184505, 295098, 227513, 180408, 299198, 258239, 280768, 301251, 227524, 309444, 299209, 282831, 321745, 280795, 194782, 301279, 311519, 356576, 383206, 346346, 286958, 125169, 327929, 184570, 227578, 184575, 194820, 321800, 278797, 338197, 282909, 299293, 278816, 282913, 233762, 227616, 305440, 211235, 151847, 282919, 332083, 332085, 280887, 332089, 315706, 282939, 287041, 287043, 139589, 280902, 227654, 182597, 282960, 325968, 366929, 289110, 305495, 168281, 332123, 334171, 323935, 106847, 332127, 354655, 321894, 416104, 280939, 313713, 242033, 199029, 291192, 315773, 291198, 211326, 332167, 242058, 311691, 227725, 240016, 108944, 178582, 190871, 291224, 293274, 285084, 317852, 242078, 141728, 61857, 285090, 61859, 315810, 289189, 315811, 381347, 108972, 299441, 283064, 278970, 293306, 311738, 293310, 291265, 278978, 291267, 127427, 127428, 283075, 311745, 278989, 281037, 317901, 289232, 281040, 278993, 326100, 278999, 369116, 285150, 279008, 160225, 279013, 127465, 311786, 279018, 330218, 291311, 281072, 309744, 109042, 319987, 279029, 293367, 233978, 301571, 291333, 342536, 279050, 139791, 283153, 303636, 279062, 289304, 279065, 291358, 180771, 293419, 244269, 283182, 283184, 23092, 234036, 289332, 338490, 70209, 115270, 70215, 293448, 55881, 377418, 281166, 285271, 244327, 111208, 295536, 287346, 287352, 301689, 244347, 279164, 291454, 189057, 152203, 377483, 330379, 311949, 385680, 316049, 330387, 330388, 117397, 111253, 230040, 295576, 289434, 111258, 221852, 205471, 279206, 295599, 205487, 303793, 342706, 299699, 299700, 164533, 289462, 166582, 109241, 158394, 285371, 285372, 285373, 285374, 287422, 303803, 66242, 248517, 287433, 363211, 154316, 242386, 279252, 289502, 299746, 295652, 279269, 234217, 342762, 230125, 289518, 299759, 279280, 322291, 199414, 228088, 221948, 279294, 299776, 205568, 242433, 291585, 285444, 295682, 291592, 322313, 326414, 312079, 322319, 295697, 166676, 291604, 207640, 291612, 293664, 281377, 326433, 262951, 289576, 279336, 312108, 152365, 295724, 285487, 301871, 318252, 262962, 230199, 197434, 293693, 295744, 295746, 318278, 201549, 281427, 353109, 281433, 230234, 322395, 295776, 279392, 293730, 349026, 303972, 109409, 230248, 177001, 201577, 308076, 242541, 400239, 330609, 174963, 109428, 207732, 295798, 209783, 310131, 209785, 177019, 291712, 287622, 416646, 113542, 109447, 228233, 308107, 316298, 236428, 56208, 308112, 293781, 209817, 289690, 127902, 283558, 310182, 289703, 293800, 240552, 353195, 236461, 293806, 316333, 316343, 289722, 230332, 189374, 289727, 353215, 213957, 19399, 279498, 52200, 326635, 203757, 304110, 289774, 287731, 277492, 316405, 240630, 295927, 312314, 386042, 314362, 328700, 328706, 277509, 293893, 134150, 230410, 330763, 320527, 238610, 308243, 277524, 316437, 140310, 230423, 293910, 197657, 281626, 175132, 326685, 189474, 300068, 238639, 322612, 312373, 203830, 238651, 302139, 21569, 214086, 359495, 300111, 205906, 296019, 339030, 353367, 277597, 281697, 230499, 281700, 314467, 322663, 300135, 281706, 207979, 228458, 318572, 316526, 15471, 312434, 353397, 300150, 291959, 279672, 300151, 337017, 285820, 300158, 150657, 285828, 279685, 285830, 302213, 228491, 228493, 177296, 162961, 326804, 296086, 238743, 187544, 283802, 119962, 296092, 285851, 300188, 302240, 330913, 300202, 306346, 279728, 238769, 294074, 230588, 228540, 228542, 302274, 279747, 283847, 353479, 353481, 283852, 189652, 189653, 148696, 296153, 333022, 304351, 298208, 310497, 298212, 304356, 290022, 234733, 298221, 279792, 353523, 298228, 302325, 228600, 216315, 208124, 292091, 228609, 320770, 234755, 292107, 318733, 251153, 177428, 245019, 126237, 115998, 130338, 333090, 130343, 279854, 298291, 171317, 300343, 318775, 286013, 333117, 286018, 113987, 300359, 304456, 230729, 312648, 294218, 177484, 222541, 296270, 296273, 331090, 120148, 314709, 314710, 357719, 134491, 316765, 222559, 294243, 230756, 281957, 163175, 333160, 230765, 306542, 296303, 327025, 314739, 249204, 249205, 181625, 111993, 290169, 306559, 306560, 224640, 179587, 148867, 294275, 298374, 142729, 368011, 304524, 296335, 112017, 234898, 306579, 112018, 224661, 318875, 290207, 310692, 282022, 241066, 316842, 310701, 314798, 286129, 279989, 228795, 292283, 292292, 280004, 306631, 296392, 300489, 300487, 284107, 302540, 310732, 312782, 148940, 64975, 310736, 327121, 222675, 228827, 286172, 280032, 144867, 366053, 103909, 316902, 245223, 280041, 191981, 282096, 296433, 321009, 329200, 191990, 280055, 300536, 290300, 290301, 300542, 286205, 296448, 230913, 306692, 292356, 230921, 296461, 323087, 323089, 282141, 187938, 306723, 245292, 230959, 288309, 290358, 194110, 288318, 280130, 288326, 288327, 282183, 56902, 292423, 243274, 333388, 224847, 228943, 118353, 280147, 290390, 128599, 235095, 300630, 306776, 44635, 333408, 157281, 286306, 300644, 310889, 312940, 204397, 222832, 224883, 314998, 333430, 175741, 337535, 294529, 312965, 282246, 288392, 229001, 290443, 310923, 188048, 323217, 239250, 282259, 302739, 229020, 298654, 282271, 282273, 302754, 257699, 282276, 229029, 298661, 290471, 282280, 40613, 40614, 40615, 61101, 321199, 286391, 296632, 337591, 306874, 280251, 327358, 286399, 282303, 323264, 321219, 333509, 212688, 9936, 9937, 302802, 286423, 282327, 278233, 278234, 67292, 294622, 159455, 278240, 298720, 229088, 321249, 153319, 12010, 288491, 280300, 239341, 284401, 282355, 323316, 282358, 313081, 229113, 286459, 325371, 194303, 194304, 67332, 288516, 216839, 282378, 321295, 284431, 243472, 161554, 323346, 282391, 116505, 282400, 313120, 241441, 315171, 282409, 284459, 294700, 282417, 200498, 296755, 319292, 345919, 315202, 307011, 325445, 280390, 282438, 153415, 280392, 337745, 325457, 413521, 317269, 216918, 18262, 280410, 284507, 300894, 245599, 237408, 302946, 296806, 276327, 282474, 288619, 288620, 325484, 280430, 296814, 282480, 292720, 313203, 325492, 300918, 241528, 194429, 325503, 315264, 188292, 253829, 241540, 67463, 327557, 243591, 315273, 315274, 243597, 110480, 282518, 282519, 294807, 294809, 329622, 298909, 311199, 292771, 300963, 313254, 294823, 298920, 284587, 292782, 317360, 290746, 294843, 214977, 280514, 163781, 214984, 151497, 284619, 344013, 231375, 301008, 354274, 298980, 294886, 317415, 354280, 296941, 278512, 311281, 311282, 223218, 333817, 292858, 290811 ]
3becb336812e79f8677cfd616e9cdc4ca8a0426f
a6db79d6df25ebed419c77ac517ff3140a5b0236
/Final App Sem1Tests/Final_App_Sem1Tests.swift
17f1f3cdf259fbfaaeb3420626020ee6325e6706
[]
no_license
sripsky/Final-App-Sem1
92a3576b23769a88daff4d44101f5da8eab6936c
98e386fe03ed76934423e3f7a8ad328dc2d4171f
refs/heads/master
2020-12-08T02:15:01.474769
2020-01-09T16:42:37
2020-01-09T16:42:37
232,612,589
0
0
null
null
null
null
UTF-8
Swift
false
false
934
swift
// // Final_App_Sem1Tests.swift // Final App Sem1Tests // // Created by Sydney Ripsky on 12/2/19. // Copyright © 2019 Sydney Ripsky. All rights reserved. // import XCTest @testable import Final_App_Sem1 class Final_App_Sem1Tests: XCTestCase { override func setUp() { // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. } func testExample() { // This is an example of a functional test case. // Use XCTAssert and related functions to verify your tests produce the correct results. } func testPerformanceExample() { // This is an example of a performance test case. self.measure { // Put the code you want to measure the time of here. } } }
[ 98333, 16419, 229413, 204840, 278570, 344107, 253999, 319542, 229430, 352315, 352326, 311372, 311374, 196691, 278615, 254048, 319591, 278634, 131178, 319598, 352368, 204916, 131191, 237689, 131198, 278655, 319629, 311438, 278677, 278685, 311458, 278691, 49316, 32941, 278704, 278708, 180408, 131256, 295098, 254170, 385262, 286958, 327929, 180493, 278797, 254226, 237856, 278816, 98610, 336183, 278842, 287041, 139589, 319821, 254286, 344401, 155990, 106847, 246127, 246136, 139640, 246137, 106874, 311691, 246178, 311727, 377264, 319930, 278970, 311738, 336317, 311745, 278978, 254406, 188871, 278989, 278993, 278999, 328152, 369116, 287198, 279008, 279013, 279018, 311786, 319981, 319987, 279029, 254456, 279032, 279039, 287241, 279050, 279062, 254488, 279065, 377386, 197167, 352829, 115270, 377418, 66150, 344680, 295536, 287346, 279164, 189057, 311941, 279177, 369289, 344715, 311949, 352917, 230040, 271000, 295576, 344738, 279206, 295590, 287404, 295599, 303793, 164533, 287417, 66242, 279252, 295652, 246503, 418546, 312052, 312053, 344827, 221948, 279294, 205568, 295682, 336648, 312079, 295697, 336671, 344865, 279336, 295724, 353069, 312108, 328499, 353078, 230199, 353079, 336702, 295746, 353094, 353095, 353109, 230234, 303972, 246641, 246648, 361337, 279417, 254850, 287622, 426895, 295824, 189348, 353195, 140204, 353197, 230332, 353215, 353216, 213960, 279498, 50143, 123881, 304110, 320494, 287731, 295927, 304122, 320507, 328700, 312314, 328706, 320516, 230410, 320527, 238610, 418837, 320536, 197657, 336929, 345132, 238639, 238651, 336960, 214086, 361543, 238664, 296019, 353367, 156764, 156765, 230499, 312434, 353397, 337017, 279685, 222343, 296086, 296092, 238765, 279728, 230588, 353479, 353481, 353482, 189652, 189653, 148696, 296153, 279774, 304351, 304356, 222440, 328940, 279792, 353523, 320770, 279814, 328971, 312587, 353551, 320796, 115998, 369956, 279854, 345396, 312634, 116026, 222524, 279875, 345415, 312648, 230729, 238927, 296273, 222559, 230756, 230765, 296303, 279920, 312689, 116084, 181625, 378244, 304524, 296335, 9619, 279974, 173491, 279989, 280004, 361927, 370123, 148940, 280013, 312782, 222675, 353750, 280041, 361963, 329200, 321009, 280055, 288249, 230913, 329225, 230921, 304656, 329232, 230959, 312880, 288309, 312889, 288318, 124485, 288326, 288327, 280147, 157281, 345700, 312940, 222832, 247416, 337535, 312965, 288392, 239250, 345752, 255649, 321199, 337591, 321207, 296632, 280251, 321219, 280267, 9936, 9937, 280278, 181975, 280280, 18138, 321247, 321249, 345833, 280300, 313081, 124669, 280329, 321295, 321302, 116505, 321310, 255776, 313120, 247590, 321337, 280392, 345929, 337745, 18262, 362327, 370522, 345951, 362337, 345955, 296806, 288619, 296814, 362352, 313203, 124798, 182144, 305026, 247686, 67463, 329622, 337815, 124824, 214937, 354212, 313254, 124852, 288697, 214977, 280514, 174019, 321480, 214984, 247757, 231375, 280541, 313319, 337895, 174057, 247785, 296941, 362480, 223218, 313339, 354316, 313357, 182296, 239650, 223268, 329765, 354343, 354345, 223274, 321583, 124975, 346162, 124984, 288828, 288833, 288834, 354385, 280661, 329814, 338007, 354393, 280675, 329829, 321637, 280677, 313447, 43110, 288879, 280694, 223350, 288889, 215164, 313469, 215166, 280712, 215178, 346271, 239793, 125109, 182456, 379071, 280768, 338119, 346314, 321745, 280795, 338150, 346346, 321772, 125169, 338164, 125183, 125188, 313608, 125193, 321800, 125198, 125199, 125203, 338197, 125208, 305440, 125217, 338218, 321840, 125235, 280887, 125240, 182597, 182598, 280902, 289110, 215385, 272729, 379225, 354655, 321894, 280939, 313713, 354676, 313727, 362881, 248194, 395659, 395661, 108944, 240016, 141728, 289189, 108972, 281037, 281040, 289232, 256477, 330218, 281072, 109042, 240131, 289304, 322078, 207393, 182817, 338490, 322120, 281166, 354911, 436832, 191082, 313966, 281199, 313971, 330379, 330387, 346772, 330388, 363163, 338613, 289462, 314040, 109241, 158394, 248517, 363211, 289502, 363230, 338662, 330474, 346858, 289518, 322291, 199414, 35583, 363263, 191235, 264968, 322313, 322316, 322319, 166676, 207640, 281377, 355130, 355139, 420677, 355146, 355154, 281427, 281433, 322395, 355165, 109409, 355178, 330609, 174963, 109428, 207732, 240518, 109447, 355217, 289690, 256935, 289703, 240552, 347055, 289722, 330689, 363458, 338899, 330708, 248796, 248797, 207838, 314342, 52200, 289774, 240630, 314362, 330754, 134150, 330763, 330772, 322582, 281626, 175132, 248872, 322612, 314448, 339030, 281697, 314467, 281700, 322663, 281706, 207979, 363641, 363644, 150657, 248961, 339100, 339102, 306346, 3246, 339130, 322749, 290000, 298212, 290022, 330984, 298228, 216315, 208124, 363771, 388349, 322824, 126237, 208164, 109861, 298291, 216386, 224586, 372043, 331090, 314709, 314710, 134491, 314720, 314726, 306542, 314739, 249204, 314741, 249205, 290169, 314751, 306559, 224640, 306560, 298374, 388487, 314758, 314760, 314766, 306579, 224661, 282007, 314783, 290207, 314789, 314791, 282024, 241066, 314798, 380357, 306631, 191981, 282096, 191990, 290301, 282114, 323080, 323087, 323089, 282141, 282146, 306723, 347694, 290358, 282183, 224847, 118353, 290390, 44635, 323172, 282213, 323178, 224883, 314998, 175741, 339584, 224901, 282245, 282246, 290443, 323217, 282259, 257699, 323236, 298661, 282280, 61101, 364207, 224946, 224958, 323263, 323264, 282303, 306890, 241361, 241365, 298712, 298720, 12010, 282348, 282358, 175873, 323331, 323332, 216839, 323346, 249626, 282400, 339745, 241442, 241441, 315171, 257830, 282417, 200498, 282427, 315202, 307011, 282438, 339783, 159562, 413521, 241495, 282480, 241528, 315264, 241540, 315273, 315274, 282518, 282519, 118685, 298909, 323507, 298980, 282633, 241692, 102437, 315432, 315434, 233517, 176175, 282672, 241716, 241720, 315465, 315476, 307289, 200794, 356447, 315498, 299121, 233589, 233590, 241808, 323729, 233636, 184505, 299198, 258239, 299203, 282831, 356576, 176362, 356602, 184570, 12542, 315673, 299293, 233762, 217380, 151847, 282919, 332083, 127284, 332085, 332089, 315706, 282939, 241986, 332101, 323916, 348492, 250192, 323920, 282960, 348500, 168281, 332123, 323935, 332127, 242023, 242029, 160110, 242033, 250226, 291192, 315773, 291198, 225670, 332167, 242058, 291224, 283038, 242078, 61857, 315810, 61859, 315811, 381347, 340398, 61873, 299441, 61880, 283064, 291265, 127427, 127428, 283075, 291267, 324039, 176601, 242139, 160225, 242148, 127465, 233978, 324097, 348682, 340490, 291358, 283184, 234036, 315960, 348732, 242237, 348742, 348749, 340558, 332378, 242277, 111208, 291454, 348806, 184973, 316049, 111253, 316053, 111258, 299699, 299700, 242386, 299746, 299759, 299776, 291592, 291604, 291612, 152365, 242485, 299849, 283467, 201549, 275303, 177001, 201577, 242541, 209783, 209785, 177019, 316298, 349067, 308107, 308112, 209817, 324506, 324507, 127902, 324517, 316333, 316343, 349121, 316364, 340955, 340961, 324586, 340974, 316405, 349175, 201720, 357379, 324625, 308243, 316437, 201755, 300068, 357414, 300084, 324666, 324667, 21569, 250956, 300111, 341073, 250981, 300136, 316520, 316526, 357486, 300150, 300151, 160891, 341115, 300158, 349316, 349318, 169104, 177296, 308372, 324760, 119962, 300187, 300188, 283802, 300201, 300202, 259268, 283847, 62665, 283852, 283853, 333011, 357595, 333022, 234733, 128251, 292091, 316669, 242954, 292107, 251153, 177428, 349462, 333090, 300343, 333117, 193859, 300359, 177484, 251213, 120148, 283991, 357719, 316765, 292195, 333160, 243056, 316787, 111993, 112017, 112018, 234898, 357786, 333220, 316842, 210358, 284089, 292283, 415171, 300487, 300489, 284107, 366037, 210390, 210391, 210392, 210393, 144867, 103909, 316902, 54765, 251378, 300536, 300542, 210433, 366083, 292356, 316946, 398869, 374296, 308764, 349726, 349741, 169518, 235070, 194110, 349763, 292423, 292425, 243274, 128587, 333388, 333393, 300630, 235095, 128599, 333408, 374372, 120427, 54893, 333430, 366203, 325245, 218819, 333509, 333517, 333520, 333521, 333523, 325346, 333542, 153319, 284401, 325371, 194303, 194304, 284429, 284431, 243472, 161554, 366360, 284442, 325404, 325410, 341796, 333610, 284459, 317232, 259899, 325439, 325445, 153415, 341836, 325457, 317269, 284507, 300894, 284514, 276327, 292712, 325484, 292720, 325492, 317304, 194429, 325503, 55167, 333701, 243591, 325515, 243597, 325518, 292771, 300963, 333735, 284587, 292782, 317360, 243637, 284619, 219101, 292836, 317415, 325619, 333817, 292858, 317467, 145435, 292902, 325674, 243759, 243767, 358456, 325694, 309345, 333940, 284788, 292992, 333955, 235662, 325776, 317587, 284826, 333991, 333992, 284842, 333996, 227513, 301251, 309444, 227524, 334042, 194782, 243962, 309503, 194820, 375051, 325905, 334103, 325912, 227616, 211235, 325931, 260418, 325968, 6481, 366929, 366930, 6489, 334171, 391520, 317820, 211326, 227725, 317852, 121245, 39324, 285084, 285090, 375207, 334260, 293310, 342466, 129483, 317901, 6606, 334290, 326100, 285150, 342498, 195045, 301571, 342536, 342553, 375333, 293419, 244269, 23092, 301638, 55881, 244310, 244327, 301689, 244347, 334481, 227990, 342682, 318107, 318130, 342706, 342713, 285373, 154316, 334547, 318173, 285415, 342763, 154359, 162561, 285444, 326414, 326429, 293664, 326433, 318250, 318252, 285487, 301871, 293693, 342847, 252741, 318278, 293711, 244568, 293730, 351077, 342887, 326505, 400239, 310131, 269178, 359298, 359299, 113542, 416646, 228233, 228234, 236428, 56208, 326553, 318364, 310182, 236461, 293806, 252847, 326581, 130016, 64485, 203757, 383982, 277492, 293893, 146448, 326685, 252958, 252980, 359478, 302139, 359495, 253029, 228458, 318572, 15471, 187506, 285820, 187521, 302213, 228491, 228493, 285838, 162961, 326804, 285851, 302240, 343203, 253099, 367799, 64700, 228540, 228542, 343234, 367810, 244940, 228563, 359647, 228588, 253167, 228609, 245019, 130338, 130343, 130348, 351537, 171317, 318775, 286013, 286018, 294218, 318805, 294243, 163175, 327025, 327031, 318848, 294275, 368011, 212375, 318875, 212382, 310692, 245161, 286129, 228795, 302529, 302531, 163268, 310732, 302540, 64975, 310736, 327121, 228827, 310748, 286172, 310757, 187878, 245223, 343542, 343543, 286205, 228867, 253451, 253452, 359950, 146964, 187938, 245287, 245292, 286254, 425535, 56902, 228943, 196187, 343647, 286306, 204397, 138863, 294529, 229001, 310923, 188048, 302739, 229020, 245412, 40613, 40614, 40615, 229029, 319162, 327358, 286399, 319177, 212685, 245457, 302802, 278234, 294622, 278240, 229088, 212716, 212717, 294638, 360177, 286459, 278272, 319233, 278291, 294678, 294700, 319288, 360252, 319292, 188251, 245599, 237408, 302946, 188292, 327557, 253829, 294807, 311199, 319392, 253856, 294823, 294843, 188348, 163781, 344013, 212942, 212946, 212951, 360417, 294886, 253929, 327661, 278512, 311281, 311282 ]
7e05f619e9ed2ca2f0633afa376665681ff26e45
08b5ab309ed6e0f6cf50b9eb04a61b7241139dab
/datePicker/datePicker/AppDelegate.swift
90ac289354240a027bd5731610b6ecc714fe2f4a
[]
no_license
ngocbaomobile/SimplepickerView
238f4785cdb302f08b25556c5b36f298571a0324
708583f6f0427bc054504e6a5db011f62aebf6e6
refs/heads/master
2023-05-13T07:32:57.550072
2019-11-14T03:43:22
2019-11-14T03:43:22
null
0
0
null
null
null
null
UTF-8
Swift
false
false
1,406
swift
// // AppDelegate.swift // datePicker // // Created by Apple on 11/13/19. // Copyright © 2019 Apple. 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, 385081, 376889, 393275, 376905, 327756, 254030, 286800, 368727, 180313, 368735, 180320, 376931, 286831, 368752, 286844, 262283, 286879, 286888, 377012, 327871, 180416, 377036, 180431, 377046, 377060, 327914, 393456, 393460, 336123, 418043, 336128, 385280, 262404, 180490, 368911, 262416, 262422, 377117, 262436, 336180, 262454, 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, 148105, 377484, 352918, 98968, 344744, 361129, 336555, 385713, 434867, 164534, 336567, 328378, 164538, 328386, 344776, 352968, 418507, 352971, 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, 197468, 254812, 361309, 361315, 361322, 328573, 377729, 369542, 222128, 345035, 345043, 386003, 386011, 386018, 386022, 435187, 328702, 328714, 361489, 386069, 386073, 336921, 336925, 345118, 377887, 328746, 345133, 345138, 386101, 361536, 197707, 189520, 345169, 156761, 361567, 148578, 345199, 386167, 361593, 410745, 361598, 214149, 345222, 386186, 337047, 345246, 214175, 337071, 337075, 386258, 328924, 66782, 222437, 386285, 328941, 386291, 345376, 353570, 345379, 410917, 345382, 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, 403075, 198280, 345736, 345749, 345757, 345762, 419491, 345765, 419497, 419501, 370350, 419506, 419509, 337592, 419512, 419517, 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, 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, 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, 321879, 379233, 354673, 321910, 248186, 420236, 379278, 354727, 338352, 330189, 338381, 338386, 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, 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, 396328, 158761, 396336, 199728, 330800, 396339, 339001, 388154, 388161, 347205, 248904, 330826, 248914, 412764, 339036, 257120, 265320, 248951, 420984, 330889, 347287, 248985, 339097, 44197, 380070, 339112, 249014, 330958, 330965, 265432, 265436, 388319, 388347, 175375, 159005, 175396, 208166, 273708, 372015, 347441, 372018, 199988, 175415, 396600, 437566, 175423, 437570, 437575, 437583, 331088, 437587, 331093, 396633, 437595, 175457, 208227, 175460, 175463, 265580, 437620, 175477, 249208, 175483, 175486, 249214, 175489, 249218, 249224, 249227, 249234, 175513, 175516, 396705, 175522, 355748, 380332, 396722, 372163, 216517, 380360, 216522, 339404, 372176, 208337, 339412, 413141, 339417, 249308, 339420, 249312, 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, 339588, 126596, 421508, 224904, 224909, 159374, 11918, 339601, 224913, 126610, 224916, 224919, 126616, 208538, 224922, 224926, 224929, 224932, 224936, 257704, 224942, 257712, 224947, 257716, 257720, 224953, 257724, 224959, 257732, 224965, 224969, 339662, 224975, 257747, 224981, 224986, 224993, 257761, 257764, 224999, 339695, 225012, 257787, 225020, 339710, 257790, 225025, 257794, 339721, 257801, 257804, 225038, 257807, 372499, 167700, 225043, 225048, 257819, 225053, 184094, 225058, 339747, 339749, 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, 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, 266453, 225493, 225496, 225499, 225502, 225505, 356578, 217318, 225510, 225514, 225518, 372976, 381176, 397571, 389380, 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, 250238, 389502, 332161, 356740, 332172, 373145, 340379, 389550, 324030, 266687, 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, 348978, 340789, 348982, 398139, 127814, 357201, 357206, 389978, 357211, 430939, 357214, 201579, 201582, 349040, 340849, 201588, 430965, 324472, 398201, 119674, 324475, 430972, 340861, 324478, 340858, 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, 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, 210044, 349308, 160895, 152703, 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, 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, 415191, 415193, 415196, 415199, 423392, 333284, 415207, 366056, 366061, 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, 333498, 333511, 210631, 358099, 333534, 366307, 366311, 431851, 366318, 210672, 366321, 366325, 210695, 268041, 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, 358255, 399215, 268143, 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, 350410, 260298, 350416, 350422, 211160, 350425, 268507, 334045, 350445, 375026, 358644, 350458, 350461, 350464, 325891, 350467, 350475, 194828, 375053, 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, 342430, 268701, 375208, 326058, 375216, 334262, 334275, 326084, 358856, 195039, 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, 326416, 375568, 375571, 375574, 162591, 326441, 326451, 326454, 375612, 244540, 326460, 260924, 326467, 244551, 326473, 326477, 326485, 416597, 326490, 342874, 326502, 375656, 433000, 326507, 326510, 211825, 211831, 351097, 392060, 359295, 351104, 342915, 400259, 236430, 342930, 252822, 392091, 400285, 252836, 359334, 211884, 400306, 351168, 359361, 359366, 326598, 359382, 359388, 383967, 343015, 359407, 261108, 244726, 261111, 383997, 261129, 261147, 359451, 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, 367800, 384188, 351423, 384191, 326855, 244937, 384201, 253130, 343244, 384208, 146642, 384224, 359649, 343270, 351466, 384246, 351479, 343306, 261389, 359694, 261393, 384275, 384283, 245020, 384288, 245029, 171302, 351534, 376110, 245040, 425276, 212291, 384323, 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, 343630, 327275, 245357, 138864, 155254, 155273, 368288, 245409, 425638, 425649, 155322, 425662, 155327, 253943, 245460, 155351, 155354, 212699, 245475, 155363, 245483, 155371, 409335, 155393, 155403, 245525, 155422, 360223, 155438, 155442, 155447, 360261, 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, 393169, 384977, 155611, 155619, 253923, 155621, 327654, 253926, 204784, 393203, 360438, 393206, 393212, 155646 ]
e67a78359413932b2eb17e536a18770cacc8aa2a
a57fca13ae765c83c697b356a64b4f38d55e7b29
/Assignment_2.2/Assignment_2.2/ViewController.swift
581787f045dfbd0b7d58637509808f9dba37b813
[]
no_license
MadrigalJA/Mobile_Apps_IS
ece4bb417f74ca57b117bcb1e47340e260d86185
5b9b0f2143dd09cc5adc2cdce9141cb0d0767200
refs/heads/master
2021-01-11T16:23:59.629169
2017-03-08T22:20:30
2017-03-08T22:20:30
80,073,029
0
0
null
null
null
null
UTF-8
Swift
false
false
1,428
swift
// // ViewController.swift // Assignment_2.2 // // Created by Madrigal, Jesus on 2/1/17. // Copyright © 2017 Madrigal.Jesus. All rights reserved. // import UIKit class ViewController: UIViewController { @IBOutlet var QuestionLabel:UILabel! @IBOutlet var AnswerLabel:UILabel! let questions:[String] = ["What is 12 modulo 7?", "What is the capital of Florida?", "What is the name of the UNF mascot?"] let answers: [String] = ["5", "Tallahassee", "Ozzie the Osprey"] var currentQuestionIndex = -1 @IBAction func showNextQuestion(sender: AnyObject) { currentQuestionIndex += 1 if currentQuestionIndex == questions.count { currentQuestionIndex = 0 } let question : String = questions[currentQuestionIndex] QuestionLabel.text = question AnswerLabel.text = "???" } @IBAction func showNextAnswer(sender: AnyObject) { if AnswerLabel.text == "???" { AnswerLabel.text = answers[currentQuestionIndex] } } override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } }
[ -1 ]
a85e02df073ccd42c6454413416b0a1246a62f39
50eccdb51006233fe4dca16a48e189416462b96f
/PhotoLibrary/PhotoLibrary/Browse/AlbumFetchResult/AlbumResult.swift
417884362e978adc6c0258af3509cae4daa74d46
[]
no_license
SmileOwn/PhotoLibrary
06b6bc1ec4673e3c6211184c63520a8a32723452
c587f92be9ea0a5956119644f8c0d9c4eb8eb636
refs/heads/master
2021-09-03T12:38:07.512597
2018-01-09T05:24:15
2018-01-09T05:24:15
110,918,882
1
0
null
null
null
null
UTF-8
Swift
false
false
8,734
swift
// // AlbumResult.swift // PhotoLibrary // // Created by 董家祎 on 2017/11/16. // Copyright © 2017年 董家祎. All rights reserved. // import Foundation import Photos enum MediaType:Int { case none = 0 case image = 1 case video = 2 case audio = 3 } protocol AssetProtocol { static var mediaType:MediaType{get} } struct PhotoModel { var mediaType:MediaType = MediaType.none var isICloud:Bool = false var isProgress:Bool = false var asset:PHAsset? var image:UIImage? var isSelected:Bool = false var titleIndex:Int = 0 var fetchTitle:String = "" var index:Int = 0 var fetchModel:FetchModel! init() { } init(asset:PHAsset,image:UIImage,fetchTitle:String,index:Int,fetch:FetchModel) { self.asset = asset self.image = image self.fetchTitle = fetchTitle self.index = index self.fetchModel = fetch switch asset.mediaType.rawValue { case 0: self.mediaType = .none break case 1: self.mediaType = .image break case 2: self.mediaType = .video break case 3: self.mediaType = .audio default: break } } } class FetchModel { var title:String = "" var fetchResult:PHFetchResult<PHAsset> var count = 0 var coverImage:UIImage? var isContains:Bool = false init(title:String,fetch:PHFetchResult<PHAsset>) { self.title = title self.fetchResult = fetch self.count = fetch.count } } class AlbumResult { var imageManager:PHCachingImageManager = PHCachingImageManager() init() { imageManager.stopCachingImagesForAllAssets() self.collections() } var fetchs:[FetchModel] = [] //MARK:系统智能相册 private var smart:PHFetchResult<AnyObject>!{ return PHAssetCollection.fetchAssetCollections(with: .smartAlbum, subtype: .albumRegular, options: PHFetchOptions()) as! PHFetchResult<AnyObject> } //MARK:用户自定义相册 private var userCustom:PHFetchResult<AnyObject>!{ return PHCollection.fetchTopLevelUserCollections(with: nil) as! PHFetchResult<AnyObject> } //MARk:获取用户相册所有的相册集合 private func collections() -> Void { let smarts:[FetchModel] = self.result(collection: smart) let userCustoms:[FetchModel] = self.result(collection: userCustom) self.fetchs.append(contentsOf: smarts) self.fetchs.append(contentsOf: userCustoms) } //MARK:遍历相册集合 private func result(collection:PHFetchResult<AnyObject>) -> [FetchModel]! { var array:[FetchModel] = [] collection.enumerateObjects { (object, index, stop) in let options = PHFetchOptions() options.sortDescriptors = [NSSortDescriptor(key: "creationDate", ascending: true)] options.predicate = NSPredicate(format: "mediaType = %d", PHAssetMediaType.image.rawValue) guard object is PHAssetCollection else {return} let assetObject = object as! PHAssetCollection let assetResuable = PHAsset.fetchAssets(in: assetObject, options: options) if assetResuable.count > 0 && assetObject.localizedTitle != "最近删除" { let fetch = FetchModel(title: assetObject.localizedTitle!, fetch: assetResuable) array.append(fetch) } } return array } //MARK:获取图片数据 public func library(index:Int,fetch:FetchModel,thumbSize:CGSize,result:@escaping(_ photoModel:PhotoModel)->()) -> Void { self.library(index: index, assetsFetch: fetch.fetchResult, thumbSize: thumbSize) { (image, asset) in var model = PhotoModel(asset: asset, image: image, fetchTitle: fetch.title,index:index,fetch:fetch) PHImageManager.default().requestImageData(for: asset, options: nil, resultHandler: { (data, str, orient, info) in let icloud = info!["PHImageResultIsInCloudKey"] as! Int model.isICloud = icloud == 1 ? true : false result(model) }) } } //获取视频 public func libraryVideo(index:Int,assetsFetch:PHFetchResult<PHAsset>,result:@escaping(_ item:AVPlayerItem,_ asset:PHAsset)->()) -> Void{ let asset = assetsFetch[index] self.imageManager.requestPlayerItem(forVideo: asset, options: nil) { (playerItem, _) in result(playerItem!,asset) } } //获取原图 public func masterImage(_ asset: PHAsset, _ result: @escaping (UIImage, PHAsset) -> ()) { let option = PHImageRequestOptions() option.resizeMode = .fast PHImageManager.default().requestImage(for: asset, targetSize: PHImageManagerMaximumSize, contentMode: .aspectFill, options: option) { (image, info) in let isDegra = info![PHImageResultIsDegradedKey] as! Bool if image != nil { result(image!,asset) } if isDegra == false && image == nil { let options = PHImageRequestOptions() options.isNetworkAccessAllowed = true options.resizeMode = .fast options.progressHandler = { progress, _, _, _ in DispatchQueue.main.sync { print(progress) if progress == 1.0 { } } } PHImageManager.default().requestImageData(for: asset, options: options, resultHandler: { (imageData, _, _, _) in guard let imageData = imageData else { return } result(UIImage(data: imageData)!,asset) }) } } } public func libraryData(index:Int,assetsFetch:PHFetchResult<PHAsset>,result:@escaping(_ image:UIImage,_ asset:PHAsset)->()) -> Void { let asset = assetsFetch[index] masterImage(asset, result) } //MARK:下载原图 public func downloadImage(asset:PHAsset,progress:@escaping(_ progress:Double,_ error:Error?)->()) -> Void { let options = PHImageRequestOptions() options.isNetworkAccessAllowed = true options.resizeMode = .fast options.progressHandler = { p, error, _, _ in DispatchQueue.main.sync { progress(p,error) } } PHImageManager.default().requestImageData(for: asset, options: options, resultHandler: { (_, _, _, _) in }) } private func library(index:Int,assetsFetch:PHFetchResult<PHAsset>,thumbSize:CGSize,result:@escaping(_ image:UIImage,_ asset:PHAsset)->()) -> Void { let retainScale = UIScreen.main.scale let size = CGSize(width: thumbSize.width * retainScale, height: thumbSize.height * retainScale) let asset = assetsFetch[index] let option:PHImageRequestOptions = PHImageRequestOptions() option.resizeMode = .fast self.imageManager.requestImage(for: asset, targetSize: size, contentMode: .aspectFill, options: option) { (image, info) in result(image!,asset) } } static func libiray(cacheManager:PHCachingImageManager, asset:PHAsset,thumb:CGSize,result:@escaping(_ image:UIImage)->()) -> Void { let retainScale = UIScreen.main.scale let size = CGSize(width: thumb.width * retainScale, height: thumb.height * retainScale) cacheManager.requestImage(for: asset, targetSize: size, contentMode: .aspectFill, options: nil) { (image, info) in result(image!) } } }
[ -1 ]
e320c8235728c280e813f19c29278149e0404f0a
ab3352e8ede743e8151fe6b1d44a62b3e2b8459e
/ShapeChallenge/Networking/ColorTarget.swift
a7e84e24bb42aa46c832f3fbfb162a0a2d75b52d
[]
no_license
Tj3n/ShapeChallenge
55311902601a93ee2928a846194014b6b67668ec
e2e7e7959c5bfef1314605fa135755bb936638c5
refs/heads/main
2023-01-24T03:09:37.516913
2020-11-17T05:37:13
2020-11-17T05:37:13
312,203,474
0
0
null
null
null
null
UTF-8
Swift
false
false
1,504
swift
// // ColorTarget.swift // ShapeChallenge // // Created by Vũ Tiến on 11/13/20. // import Foundation import Moya enum ColorTarget { case fetchRandomColor case fetchRandomPattern } extension ColorTarget: TargetType { var baseURL: URL { return URL(string: "https://www.colourlovers.com/api")! } var path: String { switch self { case .fetchRandomColor: return "/colors/random" case .fetchRandomPattern: return "/patterns/random" } } var method: Moya.Method { switch self { case .fetchRandomColor, .fetchRandomPattern: return .get } } var task: Task { return .requestParameters(parameters: ["format":"json"], encoding: URLEncoding.queryString) } var sampleData: Data { switch self { case .fetchRandomColor: guard let url = Bundle.main.url(forResource: "StubDataColor", withExtension: "json"), let data = try? Data(contentsOf: url) else { return Data() } return data case .fetchRandomPattern: guard let url = Bundle.main.url(forResource: "StubDataPattern", withExtension: "json"), let data = try? Data(contentsOf: url) else { return Data() } return data } } var headers: [String: String]? { return ["Content-type": "application/json"] } }
[ -1 ]
8df7eb65a9bdc68cb6eccdad32b516738e9ab06d
28a53e4f8c46c957b1d33c803684a022e19f1e18
/ToDoList/ToDoDetailTableViewController.swift
5b775b43245a485fb8471ccdbdc4a9d0e2c42c42
[]
no_license
BC-Swift-Fall-2021/to-do-list-Mohsin-Braer
98f481bf97b422d0f2fb41213abdcef355f9120c
e6fc7c3482b94f8bc02ed297df03654312e503c8
refs/heads/main
2023-08-23T10:10:36.070675
2021-10-03T15:23:02
2021-10-03T15:23:02
410,121,840
0
0
null
null
null
null
UTF-8
Swift
false
false
7,792
swift
// // ToDoDetailTableViewController.swift // ToDoList // // Created by Mohsin Braer on 9/25/21. // import UIKit private let dateFormatter: DateFormatter = { print("Date Formatter created"); let dateFormatter = DateFormatter(); dateFormatter.dateStyle = .short; dateFormatter.timeStyle = .short; return dateFormatter; }() class ToDoDetailTableViewController: UITableViewController { @IBOutlet weak var cancelBarButton: UIBarButtonItem! @IBOutlet weak var saveBarButton: UIBarButtonItem! @IBOutlet weak var nameField: UITextField! @IBOutlet weak var datePicker: UIDatePicker! @IBOutlet weak var noteView: UITextView! @IBOutlet weak var reminderSwitch: UISwitch! @IBOutlet weak var dateLabel: UILabel! var toDoItem: ToDoItem!; let datePickerIndexPath = IndexPath(row: 1, section: 1); let notesTextIndexPath = IndexPath(row: 0, section: 2); let notesRowHeight: CGFloat = 200; let defaultRowHeight: CGFloat = 44; override func viewDidLoad() { super.viewDidLoad() let notificationCenter = NotificationCenter.default; notificationCenter.addObserver(self, selector: #selector(appActiveNotification), name: UIApplication.didBecomeActiveNotification, object: nil) let tap = UITapGestureRecognizer(target: self.view, action: #selector(UIView.endEditing(_:))) tap.cancelsTouchesInView = false; self.view.addGestureRecognizer(tap); nameField.delegate = self; if toDoItem == nil { //toDoItem = ToDoItem(name: "", date: Date(), notes: ""); toDoItem = ToDoItem(name: "", date: Date().addingTimeInterval(24*60*60), notes: "", reminderSet: false, isCompleted: false); nameField.becomeFirstResponder(); } updateUserInterface(); // Uncomment the following line to preserve selection between presentations // self.clearsSelectionOnViewWillAppear = false // Uncomment the following line to display an Edit button in the navigation bar for this view controller. // self.navigationItem.rightBarButtonItem = self.editButtonItem } @objc func appActiveNotification(){ print("The app just came to the foreground - cool!"); updateReminderSwitch(); } func updateUserInterface() { nameField.text = toDoItem.name; datePicker.date = toDoItem.date; noteView.text = toDoItem.notes; reminderSwitch.isOn = toDoItem.reminderSet; dateLabel.textColor = (reminderSwitch.isOn ? .black : .gray); dateLabel.text = dateFormatter.string(from: toDoItem.date); enableDisableSaveButton(text: nameField.text!) } func updateReminderSwitch(){ LocalNotificationManger.isAuthorized { (authorized) in DispatchQueue.main.async { if !authorized && self.reminderSwitch.isOn{ self.oneButtonAlert(title: "User Has Not Allowed Notifications", message: "To receive alerts for reminders, go to settings"); self.reminderSwitch.isOn = false; } self.view.endEditing(true) self.dateLabel.textColor = (self.reminderSwitch.isOn ? .black : .gray); self.tableView.beginUpdates(); self.tableView.endUpdates(); } } } override func prepare(for segue: UIStoryboardSegue, sender: Any?) { toDoItem = ToDoItem(name: nameField.text!, date: datePicker.date, notes: noteView.text, reminderSet: reminderSwitch.isOn, isCompleted: toDoItem.isCompleted); } func enableDisableSaveButton(text: String){ if text.count > 0 { saveBarButton.isEnabled = true; } else{ saveBarButton.isEnabled = false; } } @IBAction func cancelButtonPressed(_ sender: UIBarButtonItem) { let isPresentingInAddMode = presentingViewController is UINavigationController; if isPresentingInAddMode{ dismiss(animated: true, completion: nil) }else { navigationController?.popViewController(animated: true) } } @IBAction func reminderSwitchChanged(_ sender: UISwitch) { updateReminderSwitch() } @IBAction func datePickerChanged(_ sender: UIDatePicker) { self.view.endEditing(true) dateLabel.text = dateFormatter.string(from: sender.date); } @IBAction func textFieldEditingChanged(_ sender: UITextField) { enableDisableSaveButton(text: sender.text!); } // MARK: - Table view data source override func numberOfSections(in tableView: UITableView) -> Int { // #warning Incomplete implementation, return the number of sections return 0 } override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { // #warning Incomplete implementation, return the number of rows return 0 } /* override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "reuseIdentifier", for: indexPath) // Configure the cell... return cell } */ /* // Override to support conditional editing of the table view. override func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool { // Return false if you do not want the specified item to be editable. return true } */ /* // Override to support editing the table view. override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath) { if editingStyle == .delete { // Delete the row from the data source tableView.deleteRows(at: [indexPath], with: .fade) } else if editingStyle == .insert { // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view } } */ /* // Override to support rearranging the table view. override func tableView(_ tableView: UITableView, moveRowAt fromIndexPath: IndexPath, to: IndexPath) { } */ /* // Override to support conditional rearranging of the table view. override func tableView(_ tableView: UITableView, canMoveRowAt indexPath: IndexPath) -> Bool { // Return false if you do not want the item to be re-orderable. return true } */ /* // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepare(for segue: UIStoryboardSegue, sender: Any?) { // Get the new view controller using segue.destination. // Pass the selected object to the new view controller. } */ } extension ToDoDetailTableViewController{ override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { switch indexPath{ case datePickerIndexPath: return reminderSwitch.isOn ? datePicker.frame.height : 0; case notesTextIndexPath: return notesRowHeight; default: return defaultRowHeight; } } } extension ToDoDetailTableViewController: UITextFieldDelegate { func textFieldShouldReturn(_ textField: UITextField) -> Bool { noteView.becomeFirstResponder(); return true; } }
[ -1 ]
cdc3a5a422db8f2f98910f802082670dd7defc51
b94b181d5eb1679c2b2d27d951fd03030243a61d
/FWCycleScrollViewSwiftDemo/FWCycleScrollView/AppDelegate.swift
e6ebfb238016f32ad4d7978ca3c18c8c428d7cdd
[ "MIT" ]
permissive
choiceyou/FWCycleScrollView
814826418e1b8db7924b2114ab21be28891e3dd3
56628488a88fb70f11e9d86d1b13b37fd80d2cb6
refs/heads/master
2021-05-25T10:36:21.328920
2020-12-16T10:06:11
2020-12-16T10:06:11
127,124,379
75
15
null
null
null
null
UTF-8
Swift
false
false
2,170
swift
// // AppDelegate.swift // FWCycleScrollView // // Created by xfg on 2018/3/28. // Copyright © 2018年 xfg. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } func applicationWillResignActive(_ application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. } func applicationDidEnterBackground(_ application: UIApplication) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } func applicationWillEnterForeground(_ application: UIApplication) { // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. } func applicationDidBecomeActive(_ application: UIApplication) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } }
[ 229380, 229383, 229385, 278539, 294924, 229388, 278542, 229391, 327695, 229394, 278548, 229397, 229399, 229402, 352284, 278556, 229405, 278559, 229408, 294950, 229415, 229417, 327722, 237613, 229422, 360496, 237618, 229426, 229428, 286774, 286776, 319544, 286778, 229432, 204856, 352318, 286791, 237640, 286797, 278605, 311375, 163920, 237646, 196692, 319573, 311383, 278623, 278626, 319590, 311400, 278635, 303212, 278639, 131192, 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, 287032, 155966, 319809, 319810, 278849, 319814, 311623, 319818, 311628, 229709, 319822, 287054, 278865, 229717, 196963, 196969, 139638, 213367, 106872, 319872, 311683, 311693, 65943, 319898, 311719, 278952, 139689, 278957, 311728, 278967, 180668, 311741, 278975, 319938, 278980, 98756, 278983, 319945, 278986, 319947, 278990, 278994, 311767, 279003, 279006, 188895, 172512, 287202, 279010, 279015, 172520, 319978, 279020, 172526, 311791, 279023, 172529, 279027, 319989, 172534, 180727, 164343, 279035, 311804, 287230, 279040, 303617, 287234, 279045, 172550, 303623, 172552, 287238, 320007, 279051, 172558, 279055, 303632, 279058, 303637, 279063, 279067, 172572, 279072, 172577, 295459, 172581, 295461, 311850, 279082, 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, 303773, 164509, 172705, 287394, 172707, 303780, 287390, 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, 213895, 304007, 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, 213954, 189378, 156612, 295873, 213963, 197580, 312272, 304084, 304090, 320481, 304106, 320490, 312302, 328687, 320496, 304114, 295928, 320505, 312321, 295945, 230413, 197645, 295949, 320528, 140312, 295961, 238620, 197663, 304164, 304170, 304175, 238641, 312374, 238652, 238655, 230465, 238658, 336964, 296004, 205895, 320584, 238666, 296021, 402518, 336987, 230497, 296036, 296040, 361576, 205931, 296044, 164973, 205934, 312432, 279669, 337018, 189562, 279679, 66690, 279683, 222340, 205968, 296084, 238745, 304285, 238756, 205991, 222377, 165035, 337067, 238766, 165038, 230576, 238770, 304311, 230592, 312518, 279750, 230600, 230607, 148690, 320727, 279769, 304348, 279777, 304354, 296163, 320740, 279781, 304360, 320748, 279788, 279790, 304370, 296189, 320771, 312585, 296202, 296205, 230674, 320786, 230677, 214294, 296215, 320792, 230681, 296213, 304416, 230689, 173350, 312622, 296243, 312630, 222522, 296253, 222525, 296255, 312639, 230718, 296259, 378181, 296262, 230727, 238919, 296264, 320840, 296267, 296271, 222545, 230739, 312663, 222556, 337244, 230752, 312676, 230760, 173418, 148843, 410987, 230763, 230768, 296305, 312692, 230773, 304505, 304506, 279929, 181626, 181631, 312711, 312712, 296331, 288140, 288144, 230800, 304533, 288154, 337306, 288160, 173472, 288162, 288164, 279975, 304555, 370092, 279983, 173488, 288176, 279985, 312755, 296373, 312759, 279991, 288185, 337335, 222652, 312766, 173507, 296389, 222665, 230860, 312783, 288208, 230865, 288210, 370130, 222676, 288212, 288214, 280021, 239064, 288217, 288218, 280027, 288220, 329177, 239070, 288224, 280034, 288226, 280036, 288229, 280038, 288230, 288232, 370146, 288234, 320998, 288236, 288238, 288240, 288242, 296435, 288244, 288250, 296446, 321022, 402942, 148990, 296450, 206336, 230916, 230919, 214535, 230923, 304651, 304653, 370187, 230940, 222752, 108066, 296486, 296488, 157229, 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, 198310, 321195, 296622, 321200, 337585, 296626, 296634, 296637, 419522, 313027, 280260, 419525, 206536, 280264, 206539, 206541, 206543, 263888, 313044, 280276, 321239, 280283, 313052, 18140, 288478, 313055, 419555, 321252, 313066, 288494, 280302, 280304, 313073, 321266, 288499, 419570, 288502, 280314, 288510, 124671, 67330, 280324, 198405, 288519, 280331, 198416, 280337, 296723, 116503, 321304, 329498, 296731, 321311, 313121, 313123, 304932, 321316, 280363, 141101, 165678, 280375, 321336, 296767, 288576, 345921, 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, 141455, 275606, 141459, 280725, 313498, 100520, 288936, 280747, 288940, 288947, 280755, 321717, 280759, 280764, 280769, 280771, 280774, 280776, 313548, 321740, 280783, 280786, 280788, 313557, 280793, 280796, 280798, 338147, 280804, 280807, 157930, 280811, 280817, 125171, 280819, 157940, 182517, 280823, 280825, 280827, 280830, 280831, 280833, 125187, 280835, 125191, 125207, 125209, 321817, 125218, 321842, 223539, 125239, 280888, 305464, 280891, 289087, 280897, 280900, 305480, 239944, 280906, 239947, 305485, 305489, 379218, 280919, 248153, 354653, 313700, 313705, 280937, 190832, 280946, 223606, 313720, 280956, 239997, 280959, 313731, 199051, 240011, 289166, 240017, 297363, 190868, 240021, 297365, 297368, 297372, 141725, 297377, 289186, 297391, 289201, 240052, 289207, 289210, 305594, 281024, 289218, 289221, 289227, 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, 281401, 289593, 289601, 281410, 281413, 281414, 240458, 281420, 240468, 281430, 322393, 297818, 281435, 281438, 281442, 174955, 224110, 207733, 207737, 158596, 183172, 338823, 322440, 314249, 240519, 183184, 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, 290174, 298365, 224641, 281987, 298372, 314756, 281990, 224647, 265604, 298377, 314763, 142733, 298381, 314768, 224657, 306581, 314773, 314779, 314785, 314793, 282025, 282027, 241068, 241070, 241072, 282034, 241077, 150966, 298424, 306618, 282044, 323015, 306635, 306640, 290263, 290270, 290275, 339431, 282089, 191985, 282098, 290291, 282101, 241142, 191992, 290298, 151036, 290302, 282111, 290305, 175621, 306694, 192008, 323084, 257550, 282127, 290321, 282130, 323090, 290325, 282133, 241175, 290328, 282137, 290332, 241181, 282142, 282144, 290344, 306731, 290349, 290351, 290356, 282186, 224849, 282195, 282199, 282201, 306778, 159324, 159330, 314979, 298598, 323176, 224875, 241260, 323181, 257658, 315016, 282249, 290445, 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, 148946, 315211, 282446, 307027, 315221, 323414, 315223, 241496, 241498, 307035, 307040, 110433, 282465, 241509, 110438, 298860, 110445, 282478, 315249, 282481, 110450, 315251, 315253, 315255, 339838, 315267, 282499, 315269, 241544, 282505, 241546, 241548, 298896, 282514, 298898, 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, 307211, 282639, 290835, 282645, 241693, 282654, 102438, 217127, 282669, 323630, 282681, 290877, 282687, 159811, 315463, 315466, 192589, 307278, 192596, 176213, 307287, 307290, 217179, 315482, 192605, 315483, 233567, 299105, 200801, 217188, 299109, 307303, 315495, 356457, 45163, 307307, 315502, 192624, 307314, 323700, 299126, 233591, 299136, 307329, 315524, 307338, 233613, 241813, 307352, 299164, 241821, 299167, 315552, 184479, 184481, 315557, 184486, 307370, 307372, 184492, 307374, 307376, 299185, 323763, 184503, 176311, 307385, 307386, 258235, 307388, 176316, 307390, 299200, 184512, 307394, 299204, 307396, 184518, 307399, 323784, 233679, 307409, 307411, 176343, 299225, 233701, 307432, 184572, 282881, 184579, 282893, 323854, 291089, 282906, 291104, 233766, 295583, 176435, 307508, 315701, 332086, 307510, 307512, 168245, 307515, 307518, 282942, 282947, 323917, 282957, 110926, 233808, 323921, 315733, 323926, 233815, 315739, 323932, 299357, 242018, 242024, 299373, 315757, 250231, 242043, 315771, 299388, 299391, 291202, 299398, 242057, 291212, 299405, 291222, 315801, 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, 176592, 315860, 176597, 283095, 127447, 299481, 176605, 242143, 291299, 340454, 127463, 242152, 291305, 127466, 176620, 127469, 127474, 291314, 291317, 127480, 135672, 291323, 233979, 127485, 291330, 127490, 283142, 127497, 233994, 135689, 127500, 291341, 233998, 127506, 234003, 127509, 234006, 127511, 152087, 283161, 234010, 135707, 242202, 135710, 242206, 242208, 291361, 242220, 291378, 152118, 234038, 234041, 70213, 242250, 111193, 242275, 299620, 242279, 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, 299778, 234242, 242436, 234246, 226056, 234248, 291593, 242443, 234252, 242445, 234254, 291601, 234258, 242450, 242452, 234261, 348950, 201496, 234264, 234266, 234269, 283421, 234272, 234274, 152355, 299814, 234278, 283432, 234281, 234284, 234287, 283440, 185138, 242483, 234292, 234296, 234298, 160572, 283452, 234302, 234307, 242499, 234309, 316233, 234313, 316235, 234316, 283468, 234319, 242511, 234321, 234324, 185173, 201557, 234329, 234333, 308063, 234336, 242530, 349027, 234338, 234341, 234344, 234347, 177004, 234350, 324464, 234353, 152435, 177011, 234356, 234358, 234362, 226171, 234364, 291711, 234368, 291714, 234370, 291716, 234373, 226182, 234375, 308105, 226185, 234379, 234384, 234388, 234390, 226200, 234393, 209818, 308123, 234396, 324508, 291742, 324504, 234398, 234401, 291747, 291748, 234405, 291750, 324518, 324520, 234407, 324522, 234410, 291756, 291754, 226220, 324527, 291760, 234414, 234417, 324531, 201650, 234422, 226230, 324536, 275384, 234428, 291773, 242623, 324544, 226239, 234434, 324546, 324548, 234431, 226245, 234437, 234439, 234443, 291788, 234446, 275406, 193486, 234449, 316370, 193488, 234452, 234455, 234459, 234461, 234464, 234467, 234470, 168935, 5096, 324585, 234475, 234478, 316400, 234481, 316403, 234484, 234485, 234487, 324599, 234490, 234493, 316416, 234496, 308226, 234501, 275462, 308231, 234504, 234507, 234510, 234515, 300054, 316439, 234520, 234519, 234523, 234526, 234528, 300066, 234532, 300069, 234535, 234537, 234540, 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, 283805, 234657, 324768, 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, 292192, 316768, 218464, 292197, 316774, 243046, 218473, 136562, 324978, 275834, 333178, 275836, 275840, 316803, 316806, 226696, 316811, 226699, 316814, 226703, 300433, 234899, 300436, 226709, 357783, 316824, 316826, 300448, 144807, 144810, 144812, 284076, 144814, 144820, 374196, 284084, 292279, 284087, 144826, 144828, 144830, 144832, 144835, 144837, 38342, 144839, 144841, 144844, 144847, 144852, 144855, 103899, 300507, 333280, 226787, 218597, 292329, 300523, 259565, 300527, 308720, 259567, 292338, 226802, 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, 284223, 284226, 284228, 292421, 243268, 284231, 226886, 128584, 284234, 276043, 317004, 366155, 284238, 226895, 284241, 194130, 284243, 300628, 284245, 292433, 284247, 317015, 276052, 276053, 235097, 243290, 284249, 300638, 284251, 284253, 284255, 284258, 243293, 292452, 292454, 284263, 177766, 284265, 292458, 284267, 292461, 284272, 284274, 284278, 292470, 276086, 292473, 284283, 276093, 284286, 276095, 284288, 292479, 284290, 325250, 284292, 292485, 276098, 292481, 284297, 317066, 284299, 317068, 284301, 276109, 284303, 284306, 276114, 284308, 284312, 284314, 284316, 276127, 284320, 284322, 284327, 284329, 317098, 284331, 276137, 284333, 284335, 276144, 284337, 284339, 300726, 284343, 284346, 284350, 358080, 276160, 284354, 358083, 284358, 276166, 358089, 284362, 276170, 284365, 276175, 284368, 276177, 284370, 358098, 284372, 317138, 284377, 284379, 284381, 284384, 358114, 284386, 358116, 276197, 317158, 358119, 284392, 325353, 358122, 284394, 284397, 358126, 284399, 358128, 276206, 358133, 358135, 276216, 358138, 300795, 358140, 284413, 358142, 358146, 317187, 284418, 317189, 317191, 284428, 300816, 300819, 317207, 300828, 300830, 276255, 300832, 325408, 300834, 317221, 227109, 358183, 186151, 276268, 300845, 243504, 300850, 284469, 276280, 325436, 358206, 276291, 366406, 276295, 300872, 292681, 153417, 358224, 284499, 276308, 178006, 317271, 284502, 276315, 292700, 317279, 284511, 227175, 292715, 300912, 292721, 284529, 300915, 284533, 292729, 317306, 284540, 292734, 325512, 169868, 317332, 358292, 284564, 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, 194654, 227423, 350304, 178273, 309346, 350302, 194660, 350308, 309350, 309348, 292968, 309352, 309354, 227426, 227430, 276583, 350313, 301167, 350316, 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, 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, 342707, 154292, 318132, 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, 277368, 15224, 416639, 416640, 113538, 310147, 416648, 277385, 187274, 39817, 301972, 424853, 277405, 310179, 277411, 293798, 293802, 236460, 277426, 293811, 276579, 293817, 293820, 203715, 326603, 342994, 276586, 293849, 293861, 228327, 228328, 318442, 228330, 228332, 326638, 277486, 351217, 318450, 293876, 293877, 285686, 302073, 121850, 293882, 302075, 285690, 244731, 293887, 277504, 277507, 277511, 293899, 277519, 293908, 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, 310780, 286203, 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, 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, 301163, 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, 393177, 294876, 294879, 294883, 393190, 294890, 311279, 278513, 237555, 311283, 278516, 278519, 237562 ]
d84b2d35e022160d7dc88f9226126b1430828736
14b533297095825e00b58e2dceb3336446d9b01d
/Tests/Misc_Tests.swift
851e438c021ee84976dadc43af630dcaeccdbe95
[ "MIT" ]
permissive
DeadHipo/SwiftyVK
6ed90076e92278cff18e5a662ae5c9dc87887673
5187575225a85c833499949c0fb9cdcf735aceb3
refs/heads/swift-3-v2
2020-06-29T13:29:47.587684
2016-11-22T01:23:03
2016-11-22T01:23:03
74,421,125
0
0
null
2016-11-22T01:19:19
2016-11-22T01:19:19
null
UTF-8
Swift
false
false
620
swift
import XCTest @testable import SwiftyVK class Components_Tests: VKTestCase { func test_default_language() { XCTAssertNotNil(VK.config.language, "Language is not set") VK.config.language = "fi" XCTAssertEqual(VK.config.language, "fi", "Language is not \"fi\"") VK.config.language = "ru" VK.config.language = "abrakadabra" XCTAssertEqual(VK.config.language, "ru", "Language is not correct") VK.config.language = nil XCTAssertNotNil(VK.config.language, "Language is not set") XCTAssertTrue(VK.config.supportedLanguages.contains(VK.config.language!), "Unsupported language") } }
[ -1 ]
2f1717ae100e6c642a37fe62ff0dd91ee192d4b4
3877721209bef6fe572d51c3a660d22dc671d04e
/PaintingsAndArtists/PaintingsAndArtists/SlideShow/RandomizeOrderOfPaintings.swift
4ffb0404cd4d24b4392cb1fb455ca3091d8507f2
[]
no_license
NormandM/Development-PaintingAndArtists
a3082129858ee3de507de571d74a311bf04caba9
c6bf1c0aea097aec2f2aabbfae9900d080aefd6d
refs/heads/master
2020-03-27T11:07:34.451298
2018-08-08T18:47:09
2018-08-08T18:47:09
146,466,876
1
0
null
null
null
null
UTF-8
Swift
false
false
2,583
swift
// // RandomizeOrderOfPaintings.swift // PaintingsAndArtists // // Created by Normand Martin on 2018-06-07. // Copyright © 2018 Normand Martin. All rights reserved. // import UIKit struct RandomizeOrderOfIndexArray { var artistList: [[String]] func generateRandomIndex(from: Int, to: Int, quantity: Int?) -> [Int] { var numberOfNumbers = quantity var randomNumbers: [Int] = [] let lower = UInt32(from) let higher = UInt32(to+1) if numberOfNumbers == nil || numberOfNumbers! > (to - from) + 1 { numberOfNumbers = (to - from) + 1 } while randomNumbers.count != numberOfNumbers { let numbers = arc4random_uniform(higher - lower) + lower if !randomNumbers.contains(Int(numbers)){ randomNumbers.append(Int(numbers)) } } return randomNumbers } } struct RandomizeOrderOfArray { var listNames: [String] func generateRandomIndex(from: Int, to: Int, quantity: Int?) -> [Int] { var numberOfNumbers = quantity var randomNumbers: [Int] = [] let lower = UInt32(from) let higher = UInt32(to+1) if numberOfNumbers == nil || numberOfNumbers! > (to - from) + 1 { numberOfNumbers = (to - from) + 1 } while randomNumbers.count != numberOfNumbers { let numbers = arc4random_uniform(higher - lower) + lower if !randomNumbers.contains(Int(numbers)){ randomNumbers.append(Int(numbers)) } } return randomNumbers } } struct RandomizeOrderOfArrayOfCharacter { var listNames: [Character] func generateRandomIndex(from: Int, to: Int, quantity: Int?) -> [Int] { var numberOfNumbers = quantity var randomNumbers: [Int] = [] let lower = UInt32(from) let higher = UInt32(to+1) if numberOfNumbers == nil || numberOfNumbers! > (to - from) + 1 { numberOfNumbers = (to - from) + 1 } while randomNumbers.count != numberOfNumbers { let numbers = arc4random_uniform(higher - lower) + lower if !randomNumbers.contains(Int(numbers)){ randomNumbers.append(Int(numbers)) } } return randomNumbers } } extension Array{ public mutating func shuffle() { var temp = [Element]() while !isEmpty{ let i = Int(arc4random_uniform(UInt32(count))) let obj = remove(at:i) temp.append(obj) } self = temp } }
[ -1 ]
7eae47ef1f07273fdee44b26c2658472cab116ef
07f8484db2e5436df5949ee81e3d89a82f77dfe1
/aPartime/Modules/Projects/View/ProjectCell.swift
eb51cf4d0cdb5dfc293426a323af8a312e387eb2
[]
no_license
kinectpro/aPartime
405f91b539266ec68980848792fafb96cfe17af2
f1289079b88808421aa86ad71360626211dab6c1
refs/heads/workChangeStoD
2021-01-25T13:18:20.487709
2018-04-25T11:12:36
2018-04-25T11:12:36
123,551,939
10
0
null
2018-03-02T08:39:39
2018-03-02T08:24:54
Swift
UTF-8
Swift
false
false
1,099
swift
// // ProjectCell.swift // aPartime // // Created by Bobby numdevios on 06.12.2017. // Copyright © 2017 kinectpro. All rights reserved. // import UIKit class ProjectCell: UITableViewCell { @IBOutlet weak var cellBackgroundView: UIView! @IBOutlet weak var projectNameLabel: UILabel! @IBOutlet weak var editButton: UIButton! @IBOutlet weak var topConstraint: NSLayoutConstraint! @IBOutlet weak var bottomConstraint: NSLayoutConstraint! var editTappedHandler: () -> Void = {} override func awakeFromNib() { super.awakeFromNib() cellBackgroundView.layer.cornerRadius = 5.0 cellBackgroundView.layer.borderWidth = 1.0 cellBackgroundView.layer.borderColor = UIColor.lightGray.cgColor cellBackgroundView.layer.shadowColor = UIColor.darkGray.cgColor cellBackgroundView.layer.shadowOpacity = 0.3 cellBackgroundView.layer.shadowOffset = CGSize.zero cellBackgroundView.layer.shadowRadius = 2 } @IBAction func editTapped(_ sender: UIButton) { editTappedHandler() } }
[ -1 ]
2f3f24581f95153a4acfa832000ea7fdc698dbe4
6d1396fef3819479a231c12935352189fd416b76
/Unfiltr/WrappedTextView.swift
9390e106c3c26f7381453642b171d5f9ebe5265f
[ "MIT" ]
permissive
tauseefk/unfiltr
32b4c9006e44a788deec67fd2067a88db9437a70
83063a2e09ee8cdf05f0766068378870fa3f2d1a
refs/heads/main
2023-04-27T18:08:20.971991
2021-04-18T23:49:13
2021-04-18T23:49:13
328,498,896
0
0
null
null
null
null
UTF-8
Swift
false
false
1,648
swift
// // WrappedTextView.swift // Unfiltr // // Created by Md Tauseef on 12/29/20. // import UIKit import SwiftUI struct WrappedTextView: UIViewRepresentable { class Coordinator: NSObject, UITextViewDelegate { @Binding var text: String let textDidChange: (UITextView) -> Void var didBecomeFirstResponder = false init(text: Binding<String>, textDidChange: @escaping (UITextView) -> Void) { _text = text self.textDidChange = textDidChange } func textViewDidChange(_ textView: UITextView) { DispatchQueue.main.async { self.text = textView.text self.textDidChange(textView) } } } @Binding var text: String let textDidChange: (UITextView) -> Void var isFirstResponder: Bool = false func makeUIView(context: UIViewRepresentableContext<WrappedTextView>) -> UITextView { let textView = UITextView() textView.delegate = context.coordinator // interactions textView.isUserInteractionEnabled = true textView.isEditable = true // styling textView.font = .systemFont(ofSize: 16) return textView } func makeCoordinator() -> WrappedTextView.Coordinator { return Coordinator(text: $text, textDidChange: textDidChange) } func updateUIView(_ uiView: UITextView, context: UIViewRepresentableContext<WrappedTextView>) { uiView.text = text if isFirstResponder && !context.coordinator.didBecomeFirstResponder { uiView.becomeFirstResponder() context.coordinator.didBecomeFirstResponder = true } DispatchQueue.main.async { self.textDidChange(uiView) } } }
[ -1 ]
792392aa46901bfdf77c44327f0f45a9500daa88
7313b59a5fe647544c9f8d3f4d0707235413f789
/gMaps/NotificationViewController.swift
1cb1548841a6f0a4d02ea5c26dead7e3f62263ca
[]
no_license
jose930612/weather
e93140fd9588305f18051eb433bcd08dc707b2df
5d2aad915429b1ba584b29b04daaee0dfe8f0774
refs/heads/master
2020-12-30T23:36:08.454533
2017-06-02T01:47:57
2017-06-02T01:47:57
86,607,209
0
0
null
null
null
null
UTF-8
Swift
false
false
4,916
swift
// // NotificationViewController.swift // gMaps // // Created by Jose Mejia on 5/31/17. // Copyright © 2017 ITink. All rights reserved. // import UIKit class NotificationViewController: UIViewController, UITableViewDelegate, UITableViewDataSource { let defaultNotifications:[Dictionary<String,String>] = [ ["name":"Current Location", "time":"08:30 - Días entre semana", "latitude":"6.198078", "longitude":"-75.579523"], ["name":"Bogotá", "time":"18:20", "latitude":"4.728221", "longitude":"-74.034035"] ] override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } func numberOfSections(in tableView: UITableView) -> Int { // #warning Incomplete implementation, return the number of sections return 1 } func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return defaultNotifications.count } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "reminder", for: indexPath) cell.textLabel?.text = defaultNotifications[indexPath.row]["name"] cell.detailTextLabel?.text = defaultNotifications[indexPath.row]["time"] return cell } func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { tableView.deselectRow(at: indexPath as IndexPath, animated: true) //let cell = tableView.cellForRow(at: indexPath) var latitud = defaultNotifications[indexPath.row]["latitude"]! var longitude = defaultNotifications[indexPath.row]["longitude"]! var alert:UIAlertController! let urlString = "http://api.openweathermap.org/data/2.5/weather?lat=\(latitud)&lon=\(longitude)&APPID=722e31fed4758ec43905b234ed67369d&lang=sp" var request = URLRequest(url: URL(string: urlString)!) request.httpMethod = "GET" let session = URLSession.shared session.dataTask(with: request) {data, response, error in guard error == nil else { print(error!) return } guard let data = data else { print("Data is empty") return } let json = try! JSONSerialization.jsonObject(with: data, options: []) as! Dictionary<String, AnyObject> let results:Dictionary<String, AnyObject>! = json //print(results) DispatchQueue.main.async(execute: { var description = "" if let weather = results["weather"] as? [[String:Any]], !weather.isEmpty { description = "\(weather[0]["description"]!)" } //self.tableView.reloadData() let kelvin = results["main"]?["temp"] as! Double let celsius = round(kelvin - 273.15) alert = UIAlertController(title: "\(self.defaultNotifications[indexPath.row]["name"]!)", message: "La temperatura en \(self.defaultNotifications[indexPath.row]["name"]!) es de \(NSNumber(value: celsius))ºC\nel pronostico es:\n\(description)", preferredStyle: UIAlertControllerStyle.alert) alert.addAction(UIAlertAction(title: "Ok", style: UIAlertActionStyle.default, handler: nil)) self.present(alert, animated: true, completion: nil) }) }.resume() } /* func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) { if editingStyle == .delete { // Delete the row from the data source tableView.deleteRows(at: [indexPath], with: .fade) } else if editingStyle == .insert { // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view } } */ /* // 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. } */ func request () { } }
[ -1 ]
27484801fdc035e689172a784f2fe0e1b16c46a2
899478e7a361440346ecd88c96316a8bf06ae1fa
/Free&ForSale/Pods/NVActivityIndicatorView/NVActivityIndicatorView/Animations/NVActivityIndicatorAnimationBallSpinFadeLoader.swift
76953a8bef5a04c677cc3057b493c96d91812dc6
[ "MIT" ]
permissive
madmann8/Swift
581a30bf78764b2ea8a5437b0b8e7bcffcdda546
9d25a7aa2665d3fdd89676a81b0398f773245fb1
refs/heads/master
2021-01-13T08:48:17.364115
2017-03-26T15:05:09
2017-03-26T15:05:09
72,241,854
0
0
null
null
null
null
UTF-8
Swift
false
false
3,773
swift
// // NVActivityIndicatorAnimationBallSpinFadeLoader.swift // NVActivityIndicatorViewDemo // // The MIT License (MIT) // Copyright (c) 2016 Vinh Nguyen // 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 class NVActivityIndicatorAnimationBallSpinFadeLoader: NVActivityIndicatorAnimationDelegate { func setUpAnimation(in layer: CALayer, size: CGSize, color: UIColor) { let circleSpacing: CGFloat = -2 let circleSize = (size.width - 4 * circleSpacing) / 5 let x = (layer.bounds.size.width - size.width) / 2 let y = (layer.bounds.size.height - size.height) / 2 let duration: CFTimeInterval = 1 let beginTime = CACurrentMediaTime() let beginTimes: [CFTimeInterval] = [0, 0.12, 0.24, 0.36, 0.48, 0.6, 0.72, 0.84] // Scale animation let scaleAnimation = CAKeyframeAnimation(keyPath: "transform.scale") scaleAnimation.keyTimes = [0, 0.5, 1] scaleAnimation.values = [1, 0.4, 1] scaleAnimation.duration = duration // Opacity animation let opacityAnimaton = CAKeyframeAnimation(keyPath: "opacity") opacityAnimaton.keyTimes = [0, 0.5, 1] opacityAnimaton.values = [1, 0.3, 1] opacityAnimaton.duration = duration // Animation let animation = CAAnimationGroup() animation.animations = [scaleAnimation, opacityAnimaton] animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionLinear) animation.duration = duration animation.repeatCount = HUGE animation.isRemovedOnCompletion = false // Draw circles for i in 0 ..< 8 { let circle = circleAt(angle: CGFloat(M_PI_4 * Double(i)), size: circleSize, origin: CGPoint(x: x, y: y), containerSize: size, color: color) animation.beginTime = beginTime + beginTimes[i] circle.add(animation, forKey: "animation") layer.addSublayer(circle) } } func circleAt(_ angle: CGFloat, size: CGFloat, origin: CGPoint, containerSize: CGSize, color: UIColor) -> CALayer { let radius = containerSize.width / 2 - size / 2 let circle = NVActivityIndicatorShape.circle.layerWith(size: CGSize(width: size, height: size), color: color) let frame = CGRect( x: origin.x + radius * (cos(angle) + 1), y: origin.y + radius * (sin(angle) + 1), width: size, height: size) circle.frame = frame return circle } }
[ 152832, 294144, 294146, 152834, 152836, 294147, 294148, 294151, 294150, 152840, 294153, 152843, 294154, 152845, 294155, 294159, 294160, 294164, 294166, 294167, 294168, 12570, 294170, 294172, 12575, 12576, 12577, 12580, 12581, 12584, 12585, 12590, 12594, 12596, 12597, 12598, 213175, 213176, 12603, 177366, 177368, 177369, 294141, 177371, 177372, 177373, 177375, 177376, 177377, 177378, 177381, 177383, 152826, 152828, 152829, 152831 ]
6450af96aea92f8dc7ffdf5b766b330fd31fabdc
aac63918d0ac655e1c4bbeca02c2b973001efe26
/WOT-iOS/WOTApi/source/core/Requests/LoginHttpRequest.swift
17634cbe263c5a9bf2c138018076a36b3c3de3a9
[]
no_license
paulyeshchyk/WOT
a2065ee2b5dc57c87563913d64f5fc08c86383e2
43e8484c5f5d7670a3d318f913daabdcecc6420f
refs/heads/dev
2023-02-17T23:41:00.962092
2023-02-16T04:01:54
2023-02-16T04:01:54
36,650,109
1
0
null
2023-02-16T04:01:55
2015-06-01T09:12:48
Swift
UTF-8
Swift
false
false
963
swift
// // WOTWEBRequestLogin.swift // WOTData // // Created by Pavel Yeshchyk on 3/4/20. // Copyright © 2020 Pavel Yeshchyk. All rights reserved. // // MARK: - LoginHttpRequest public class LoginHttpRequest: HttpRequest { override public var httpMethod: HTTPMethod { return .POST } override public var path: String { return "wot/auth/login/" } override public var httpQueryItemName: String { WGWebQueryArgs.fields } } // MARK: - LoginHttpRequest + RequestModelServiceProtocol extension LoginHttpRequest: RequestModelServiceProtocol { public class func dataAdapterClass() -> ResponseAdapterProtocol.Type { WGAPIResponseJSONAdapter.self } public static func modelClass() -> ModelClassType? { return nil } private class func registration1D() -> RequestIdType { WebRequestType.login.rawValue } public class func registrationID() -> RequestIdType { WebRequestType.login.rawValue } }
[ -1 ]
20d2cccb267ea04a0c6e3cc83c6c61cea96b0613
58a2995dd249b73813a4be2c16c552d7f5620bfe
/batchService/resource-manager/Sources/batchService/protocols/JobListFromJobScheduleHeadersProtocol.swift
c16fc87f6682703abd2609986394cec82001fa5f
[ "MIT" ]
permissive
Azure/azure-libraries-for-swift
e577d83d504f872cf192c31d97d11edafc79b8be
b7321f3c719c381894e3ee96c5808dbcc97629d7
refs/heads/master
2023-05-30T20:22:09.906482
2021-02-01T09:29:10
2021-02-01T09:29:10
106,317,605
9
5
MIT
2021-02-01T09:29:11
2017-10-09T18:02:45
Swift
UTF-8
Swift
false
false
575
swift
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. import Foundation // JobListFromJobScheduleHeadersProtocol is defines headers for ListFromJobSchedule operation. public protocol JobListFromJobScheduleHeadersProtocol : Codable { var clientRequestId: String? { get set } var requestId: String? { get set } var eTag: String? { get set } var lastModified: Date? { get set } }
[ -1 ]
817253d1b3c66c0d8be86deccfb7de3fad88eafb
3d898a598695d76ca9b21d6ea1866c2843859d48
/Package.swift
3c4c32595c94774c2f12d4c7dcc743c4de39e682
[]
no_license
emannuelOC/bifrost
882217918a0e2a9af0ba4507585baa002d3d8e9a
79e5a65d6d0a79c902ba99771da921a0f5bb0712
refs/heads/master
2020-12-09T01:14:48.630776
2020-06-02T19:03:36
2020-06-02T19:03:36
233,148,342
3
0
null
2020-05-21T22:01:37
2020-01-10T23:39:57
Swift
UTF-8
Swift
false
false
1,187
swift
// swift-tools-version:5.2 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription let package = Package( name: "Bifrost", platforms: [.iOS(.v10)], products: [ // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "Bifrost", targets: ["Bifrost"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. .package(url: "https://github.com/onevcat/Kingfisher.git", from: "5.8.0"), .package(name: "Lottie", url: "https://github.com/airbnb/lottie-ios.git", from: "3.1.2"), ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. // Targets can depend on other targets in this package, and on products in packages which this package depends on. .target( name: "Bifrost", dependencies: ["Kingfisher", "Lottie"]), .testTarget( name: "BifrostTests", dependencies: ["Bifrost"]), ] )
[ 244580 ]
f7a8db318fc9591fd9e1cd260f824a04ea62af53
da562fd722839af1488419321712dbb1ac575d99
/StanfordMap/ViewController.swift
126174c613ef9b93c8cf1419d7b18f642bd6f824
[]
no_license
AnnaXWang/stanford-ios-map
aaa7d380f536231568d886c687ad81915fd0bc9c
b4011ffb9fdaa389326ea5f81691b58ae3541ed7
refs/heads/master
2021-01-16T00:08:47.852365
2015-05-13T02:53:56
2015-05-13T02:53:56
null
0
0
null
null
null
null
UTF-8
Swift
false
false
516
swift
// // ViewController.swift // StanfordMap // // Created by John YS on 5/12/15. // Copyright (c) 2015 Silicon Valley Insight. All rights reserved. // import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } }
[ 279046, 215562, 275466, 294411, 293909, 282143, 295460, 286775, 277057, 226887, 293961, 300107, 158285, 226896, 280146, 300116, 237655, 282202, 277602, 276580, 281701, 284261, 277612, 164974, 312433, 284275, 277108, 287350, 284287, 284289, 276099, 285321, 303242, 349332, 117399, 282270, 228000, 225955, 326311, 300727, 282301, 283839, 277696, 228548, 302788, 228551, 294600, 282311, 284361, 230604, 302286, 230608, 229585, 282320, 290006, 302295, 282338, 290020, 277224, 282346, 312049, 120054, 282365, 282368, 300288, 230147, 282377, 300817, 282389, 288251, 278298, 295711, 228127, 287007, 282403, 281380, 282917, 315177, 282411, 282426, 283453, 288577, 288579, 300358, 238920, 296272, 276309, 295766, 308064, 227688, 313706, 306540, 276849, 278897, 277364, 207738, 292730, 224643, 311684, 313733, 304015, 306578, 289697, 283556, 284580, 277935, 282035, 230323, 296374, 278968, 277432, 281530, 278973, 298951, 301012, 279011, 276965, 231405, 227315, 237556, 302580, 236022, 310773, 290299, 237564 ]
934ff1ccf7d298d3332ac77e7ea1d145ce675dbb
b2be14df0e008ea9b2f7b66acd1602cf6f290e2d
/GameOfRunes/Pods/Cuckoo/Generator/Source/CuckooGeneratorFramework/Tokens/Kinds.swift
a7bfaed6bd907c7674d7c7c7782f109686480b02
[ "MIT" ]
permissive
CS3217-Final-Project/TeamHoWan
dc757e27416349fa1265dddd7ad896128cfeb574
6153ef3e12e9a0270a93f254e6373c57ac5c035b
refs/heads/master
2021-02-28T02:54:10.776973
2020-08-06T10:04:01
2020-08-06T10:04:01
245,655,116
6
1
MIT
2020-04-26T11:38:23
2020-03-07T15:15:00
Swift
UTF-8
Swift
false
false
761
swift
// // Kinds.swift // CuckooGenerator // // Created by Filip Dolnik on 30.05.16. // Copyright © 2016 Brightify. All rights reserved. // public enum Kinds: String { case ProtocolDeclaration = "source.lang.swift.decl.protocol" case InstanceMethod = "source.lang.swift.decl.function.method.instance" case MethodParameter = "source.lang.swift.decl.var.parameter" case ClassDeclaration = "source.lang.swift.decl.class" case ExtensionDeclaration = "source.lang.swift.decl.extension" case InstanceVariable = "source.lang.swift.decl.var.instance" case GenericParameter = "source.lang.swift.decl.generic_type_param" case AssociatedType = "source.lang.swift.decl.associatedtype" case Optional = "source.decl.attribute.optional" }
[ 322913 ]
5995344cbc7caaa51abc5cb1846cd3ed0635b4c5
6aa0e44d9d03104c3e58de31ec7970b8e2dd345c
/YZCoreMLDemo/SceneDelegate.swift
5cfa5d5e5aa4d8033ab733b37432e13e6d250b94
[]
no_license
Lester2020/CoreMLDemo
5ba357412af4cbb2f4b6241a11c15fa753e5aed1
0fe740e99bad2b41ab6876e060e5ac87753e4fd7
refs/heads/main
2023-07-18T07:41:30.276455
2021-08-28T11:49:15
2021-08-28T11:49:15
400,728,505
2
0
null
null
null
null
UTF-8
Swift
false
false
2,298
swift
// // SceneDelegate.swift // YZCoreMLDemo // // Created by Lester‘s Mac on 2021/8/28. // import UIKit class SceneDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow? func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). guard let _ = (scene as? UIWindowScene) else { return } } func sceneDidDisconnect(_ scene: UIScene) { // Called as the scene is being released by the system. // This occurs shortly after the scene enters the background, or when its session is discarded. // Release any resources associated with this scene that can be re-created the next time the scene connects. // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead). } func sceneDidBecomeActive(_ scene: UIScene) { // Called when the scene has moved from an inactive state to an active state. // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. } func sceneWillResignActive(_ scene: UIScene) { // Called when the scene will move from an active state to an inactive state. // This may occur due to temporary interruptions (ex. an incoming phone call). } func sceneWillEnterForeground(_ scene: UIScene) { // Called as the scene transitions from the background to the foreground. // Use this method to undo the changes made on entering the background. } func sceneDidEnterBackground(_ scene: UIScene) { // Called as the scene transitions from the foreground to the background. // Use this method to save data, release shared resources, and store enough scene-specific state information // to restore the scene back to its current state. } }
[ 393221, 163849, 393228, 393231, 393251, 352294, 344103, 393260, 393269, 213049, 376890, 385082, 393277, 376906, 327757, 254032, 368728, 180314, 254045, 180322, 376932, 286833, 286845, 286851, 417925, 262284, 360598, 286880, 377003, 377013, 164029, 327872, 180418, 377030, 377037, 377047, 418008, 418012, 377063, 327915, 205037, 393457, 393461, 393466, 418044, 385281, 336129, 262405, 180491, 164107, 336140, 262417, 368913, 262423, 377118, 377121, 262437, 254253, 336181, 262455, 393539, 262473, 344404, 213333, 418135, 270687, 262497, 418145, 262501, 213354, 262508, 246124, 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, 434868, 164535, 336568, 164539, 328379, 328387, 352969, 344777, 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, 328690, 435188, 328703, 328710, 418822, 328715, 377867, 361490, 386070, 336922, 345119, 377888, 345134, 345139, 361525, 386102, 361537, 377931, 345172, 189525, 156762, 402523, 361568, 148580, 345200, 361591, 386168, 410746, 361594, 214150, 345224, 386187, 345247, 361645, 345268, 402615, 361657, 337093, 402636, 328925, 165086, 66783, 165092, 222438, 386286, 328942, 386292, 206084, 328967, 345377, 353572, 345380, 345383, 263464, 337207, 345400, 378170, 369979, 386366, 337224, 337230, 337235, 353634, 337252, 402792, 271731, 378232, 337278, 271746, 181639, 353674, 181644, 361869, 181650, 181655, 230810, 181671, 181674, 181679, 181682, 181687, 370105, 181691, 181697, 361922, 337350, 181704, 337366, 271841, 329192, 361961, 329195, 116211, 337399, 402943, 337416, 329227, 419341, 419345, 329234, 419351, 345626, 419357, 345631, 370208, 419360, 394787, 419363, 370214, 419369, 394796, 419377, 419386, 206397, 214594, 419401, 419404, 353868, 419408, 214611, 419412, 403040, 345702, 222831, 370298, 353920, 403073, 403076, 345737, 198282, 403085, 403092, 345750, 419484, 345758, 345763, 419492, 419498, 419502, 370351, 419507, 337588, 419510, 419513, 419518, 337601, 403139, 337607, 419528, 419531, 419536, 272083, 394967, 419545, 345819, 419548, 419551, 345829, 419560, 337643, 419564, 337647, 370416, 141052, 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, 346064, 247760, 346069, 419810, 329699, 354275, 190440, 354314, 346140, 436290, 378956, 395340, 436307, 338005, 100454, 329833, 329853, 329857, 329868, 411806, 329886, 346273, 362661, 100525, 379067, 387261, 256193, 395467, 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, 354728, 338353, 338382, 272849, 248279, 256474, 182755, 338404, 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, 330585, 387929, 355167, 265056, 265059, 355176, 355180, 355185, 412600, 207809, 379849, 347082, 396246, 330711, 248794, 248799, 347106, 437219, 257009, 265208, 265215, 199681, 338951, 330761, 330769, 330775, 248863, 158759, 396329, 347178, 404526, 396337, 330803, 396340, 339002, 388155, 339010, 347208, 248905, 330827, 248915, 183384, 339037, 412765, 257121, 322660, 265321, 248952, 420985, 330886, 347288, 248986, 44199, 380071, 339118, 249018, 339133, 126148, 322763, 330959, 330966, 265433, 265438, 388320, 363757, 388348, 339199, 396552, 175376, 175397, 273709, 372016, 437553, 347442, 199989, 175416, 396601, 208189, 437567, 175425, 437571, 126279, 437576, 437584, 331089, 437588, 331094, 396634, 175451, 437596, 429408, 175458, 175461, 175464, 265581, 175478, 249210, 175484, 175487, 249215, 249219, 175491, 249225, 249228, 249235, 175514, 175517, 396703, 396706, 175523, 355749, 396723, 388543, 380353, 216518, 380364, 339406, 372177, 339414, 413143, 249303, 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, 421509, 126597, 224905, 11919, 224911, 224914, 126611, 224917, 224920, 126618, 208539, 224923, 224927, 224930, 224933, 257705, 224939, 224943, 257713, 224949, 257717, 257721, 224954, 257725, 224960, 257733, 224966, 224970, 257740, 224976, 257745, 339664, 257748, 224982, 257752, 224987, 257762, 224996, 225000, 225013, 257788, 225021, 339711, 257791, 225027, 257796, 339722, 257802, 257805, 225039, 257808, 249617, 225044, 167701, 372500, 257815, 225049, 257820, 225054, 184096, 257825, 225059, 339748, 225068, 257837, 413485, 225071, 225074, 257843, 225077, 257846, 225080, 397113, 225083, 397116, 257853, 225088, 225094, 225097, 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, 225442, 438434, 192674, 225445, 225448, 438441, 356521, 225451, 225456, 430257, 225459, 225462, 225468, 389309, 225472, 372931, 225476, 389322, 225485, 225488, 225491, 266454, 225494, 225497, 225500, 225503, 225506, 356580, 225511, 217319, 225515, 225519, 381177, 397572, 381212, 356638, 356641, 356644, 356647, 266537, 356650, 389417, 356656, 332081, 307507, 340276, 356662, 397623, 332091, 225599, 201030, 348489, 332107, 151884, 430422, 348503, 250211, 340328, 250217, 348523, 348528, 332153, 356734, 389503, 332158, 438657, 250239, 389507, 348548, 356741, 332175, 160152, 373146, 340380, 373149, 70048, 356783, 373169, 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, 381513, 348745, 324171, 324174, 324177, 389724, 332381, 373344, 340580, 348777, 381546, 119432, 340628, 184983, 373399, 258723, 332460, 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, 430967, 324473, 398202, 119675, 324476, 430973, 340859, 324479, 340863, 324482, 373635, 324485, 324488, 185226, 381834, 324493, 324496, 324499, 430996, 324502, 324511, 422817, 324514, 201638, 373672, 324525, 111539, 324534, 324539, 324542, 398280, 349129, 340940, 340942, 209874, 340958, 431073, 398307, 340964, 209896, 201712, 209904, 381947, 201724, 431100, 349181, 431107, 349203, 209944, 209948, 357411, 250915, 250917, 357419, 209966, 209969, 209973, 209976, 209980, 209988, 209991, 209996, 431180, 341072, 349268, 250968, 210011, 373853, 341094, 210026, 210028, 210032, 349296, 210037, 210042, 210045, 349309, 152704, 160896, 349313, 210053, 210056, 349320, 373905, 259217, 210068, 210072, 210078, 210081, 210085, 210089, 210096, 210100, 324792, 210108, 357571, 210116, 210128, 210132, 333016, 210139, 210144, 218355, 218361, 275709, 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, 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, 358192, 366384, 366388, 210740, 358201, 325441, 366403, 325447, 341831, 341835, 341839, 341844, 415574, 358235, 341852, 350046, 399200, 399208, 358256, 268144, 358260, 341877, 325494, 399222, 333690, 325505, 333699, 399244, 333709, 333725, 333737, 382891, 350153, 358348, 333777, 219094, 399318, 358372, 350190, 350194, 333819, 350204, 350207, 325633, 325637, 350214, 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, 333998, 334012, 260299, 350411, 350417, 350423, 350426, 350449, 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, 391564, 366991, 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, 334466, 334469, 391813, 162446, 326291, 342680, 342685, 260767, 342711, 244410, 260798, 260802, 350918, 154318, 342737, 391895, 154329, 416476, 64231, 113389, 342769, 203508, 375541, 342777, 391938, 391949, 375569, 326417, 375572, 375575, 375580, 162592, 334633, 326444, 383794, 326452, 326455, 375613, 244542, 326463, 375616, 326468, 342857, 326474, 326479, 326486, 416599, 342875, 244572, 326494, 433001, 400238, 326511, 211826, 211832, 392061, 351102, 359296, 260993, 252801, 351105, 400260, 211846, 342931, 400279, 252823, 392092, 400286, 252838, 359335, 211885, 252846, 400307, 351169, 359362, 351172, 170950, 359367, 326599, 187335, 359383, 359389, 383968, 359411, 261109, 261112, 244728, 383999, 261130, 261148, 359452, 211999, 261155, 261160, 261166, 359471, 375868, 343132, 384099, 384102, 367724, 384108, 343155, 384115, 212095, 351366, 384136, 384140, 384144, 384152, 384158, 384161, 351399, 384169, 367795, 384182, 367801, 384189, 351424, 384192, 343232, 367817, 244938, 384202, 253132, 326858, 384209, 146644, 351450, 384225, 359650, 343272, 351467, 359660, 384247, 351480, 384250, 351483, 351492, 343307, 384270, 261391, 359695, 253202, 261395, 384276, 384284, 245021, 384290, 253218, 245032, 171304, 384299, 351535, 376111, 245042, 326970, 384324, 343366, 212296, 212304, 367966, 343394, 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, 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, 376672, 155488, 155492, 327532, 261997, 376686, 262000, 262003, 262006, 147319, 425846, 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, 327655, 253927, 360432, 393204, 360439, 253944, 393209, 393215 ]
90487274a095d66be08d010976da74456b97da44
6184804525dbbe324e4b0b6d2def9891a044c32c
/pokedex3/ViewController.swift
9f4f1164757e46898a7054e52c8af2026255af27
[]
no_license
amirhosensoleymani2118/pokedex3
a347fa57ebcc33366c3a4cf87ea8e2debbe45057
d4a28e57ef60afd9ba39bfaa3f081feae24f079e
refs/heads/master
2020-11-30T00:33:26.289732
2017-06-30T08:00:28
2017-06-30T08:00:28
95,863,239
0
0
null
null
null
null
UTF-8
Swift
false
false
493
swift
// // ViewController.swift // pokedex3 // // Created by A.S on 4/9/1396 AP. // Copyright © 1396 A.S. All rights reserved. // import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } }
[ 288775, 278543, 317473, 237616, 360501, 286775, 288827, 286786, 286796, 278606, 237655, 307288, 200802, 309347, 276580, 309349, 309351, 309353, 307311, 276597, 278657, 276612, 280710, 303242, 311437, 299165, 278693, 100521, 299186, 307379, 280770, 227523, 280772, 280775, 313550, 276686, 229585, 307410, 280797, 301284, 280808, 286963, 280821, 286965, 280826, 280832, 278786, 282917, 233767, 307516, 278845, 289088, 287055, 323933, 227688, 313706, 299374, 199024, 276849, 278897, 280947, 311684, 313733, 285087, 289187, 278968, 293308, 278973, 276959, 276965, 281078, 236022, 233980, 287231, 279041, 279046, 215562, 281107, 279064, 281118, 295460, 289318, 309807, 279096, 234043, 277057, 129604, 301637, 158285, 311913, 281202, 277108, 287350, 285321, 117399, 228000, 295586, 225955, 287399, 326311, 277171, 285377, 226009, 277224, 312049, 226038, 234232, 230147, 226055, 299786, 228127, 281380, 283433, 312107, 293682, 285495, 289596, 283453, 279360, 289600, 293700, 308064, 303977, 293742, 162672, 207738, 303998, 183173, 304008, 324491, 304012, 234380, 304015, 277406, 234402, 279463, 324528, 230323, 234423, 230328, 277432, 295874, 299973, 234465, 168936, 183278, 277487, 293888, 277512, 275466, 197664, 304174, 300086, 234551, 300089, 238653, 293961, 277602, 281701, 281703, 296042, 277612, 164974, 312433, 300149, 234619, 226447, 234641, 349332, 285855, 283839, 277696, 228548, 228551, 279751, 279754, 230604, 298189, 302286, 230608, 189655, 302295, 363743, 298211, 228585, 279791, 120054, 204027, 300288, 312586, 130346, 300358, 238920, 234829, 296272, 306540, 298359, 310649, 333179, 290175, 275842, 224643, 300432, 226705, 310673, 306578, 288165, 144811, 370093, 286126, 277935, 282035, 292277, 296374, 130487, 306633, 288205, 286158, 280015, 310734, 163289, 280031, 286175, 286189, 282095, 302580, 310773, 296436, 288251, 290299, 286204, 290303, 294411, 282143, 284192, 284197, 296487, 286249, 296489, 226878, 288321, 226887, 284236, 284239, 284240, 226896, 284242, 292435, 212561, 300629, 276054, 282202, 212573, 40545, 284261, 306791, 286314, 284275, 314996, 276087, 284287, 284289, 276099, 284298, 278157, 282262, 280219, 284317, 282270, 282275, 280231, 284328, 313007, 284336, 284341, 286390, 300727, 282301, 302788, 282311, 294600, 284361, 276167, 282320, 284373, 282329, 282338, 284391, 282346, 358127, 282357, 358139, 282365, 286462, 282368, 358147, 282377, 300817, 282389, 282393, 278298, 329499, 276256, 278304, 315170, 282403, 304933, 315177, 282411, 159541, 282426, 288577, 307029, 276309, 241499, 188253, 315250, 292730, 284580, 284586, 276396, 282548, 165832, 301012, 301016, 294877, 294889, 298989, 231405, 227315, 237556, 237564 ]
e561206655fdc3c1f0e4a524b7fb0f12a7e32bac
ab702ce365c8a79ee8777a7823808b24d02e681a
/Doctor4All/EditDoctorProfileViewController.swift
f672da95dc5dd5b37a8b9b45a095a1600a772e61
[]
no_license
mohsinalimat/Doctor4All
cc5faef07d939e984060b2257184e656578095ff
301b5cc4939b7f4485c535d4415575c679f8dfb6
refs/heads/master
2021-04-29T12:40:14.501793
2017-03-16T03:23:08
2017-03-16T03:23:08
121,732,920
1
0
null
2018-02-16T09:20:37
2018-02-16T09:20:37
null
UTF-8
Swift
false
false
6,026
swift
// // EditDoctorProfileViewController.swift // Doctor4All // // Created by Othman Mashaab on 13/03/2017. // Copyright © 2017 NextAcademy. All rights reserved. // import UIKit import FirebaseDatabase class EditDoctorProfileViewController: UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate, UITextFieldDelegate { // @IBOutlet var keyboardHeightLayoutConstraint: NSLayoutConstraint? var dbRef: FIRDatabaseReference! @IBOutlet weak var doctorPofilePicture: UIImageView! @IBOutlet weak var doctorNameTF: UITextField! { didSet{ doctorNameTF.delegate = self } } @IBOutlet weak var doctorEmailTF: UITextField! { didSet{ doctorEmailTF.delegate = self } } @IBOutlet weak var doctorPasswordTF: UITextField! { didSet{ doctorPasswordTF.delegate = self } } @IBOutlet weak var doctorPhonNumTF: UITextField! { didSet{ doctorPhonNumTF.delegate = self } } @IBOutlet weak var doctorsAddressTF: UITextField! { didSet{ doctorsAddressTF.delegate = self } } // public var activeTextField: UITextField? let picker = UIImagePickerController() @IBAction func choseImgBtn(_ sender: Any) { let optionMenu = UIAlertController(title: nil, message: "Where would you like the image from?", preferredStyle: UIAlertControllerStyle.actionSheet) let photoLibraryOption = UIAlertAction(title: "Photo Library", style: UIAlertActionStyle.default, handler: { (alert: UIAlertAction!) -> Void in print("from library") //shows the photo library self.picker.allowsEditing = true self.picker.sourceType = .photoLibrary self.picker.modalPresentationStyle = .popover self.present(self.picker, animated: true, completion: nil) }) let cancelOption = UIAlertAction(title: "Cancel", style: UIAlertActionStyle.cancel, handler: { (alert: UIAlertAction!) -> Void in print("Cancel") self.dismiss(animated: true, completion: nil) }) optionMenu.addAction(photoLibraryOption) optionMenu.addAction(cancelOption) self.present(optionMenu, animated: true, completion: nil) } override func viewDidLoad() { super.viewDidLoad() dbRef = FIRDatabase.database().reference() self.title = "Edit Doctor Profile" picker.delegate = self self.hideKeyboardWhenTappedAround() // NotificationCenter.default.addObserver(self, selector: #selector(self.keyboardNotification(notification:)), name: NSNotification.Name.UIKeyboardDidChangeFrame, object: nil) } // deinit { // NotificationCenter.default.removeObserver(self) // // // } // func keyboardNotification(notification: NSNotification) { // if let userInfo = notification.userInfo { // guard // let endFrame = (userInfo[UIKeyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue, // let activeFrame = activeTextField?.frame else { // animatePushKeyboard(userInfo, toHeight: 17.0) // return // } // // // if activeFrame.maxY < endFrame.minY { // animatePushKeyboard(userInfo, toHeight: 17.0) // return // } // // // if endFrame.origin.y >= UIScreen.main.bounds.size.height { // animatePushKeyboard(userInfo, toHeight: 17.0) // } else { // animatePushKeyboard(userInfo, toHeight: endFrame.size.height) // } // // } // // } // func animatePushKeyboard(_ userInfo:[AnyHashable:Any], toHeight: CGFloat){ // // self.keyboardHeightLayoutConstraint?.constant = toHeight // let duration:TimeInterval = (userInfo[UIKeyboardAnimationDurationUserInfoKey] as? NSNumber)?.doubleValue ?? 0 // let animationCurveRawNSN = userInfo[UIKeyboardAnimationCurveUserInfoKey] as? NSNumber // let animationCurveRaw = animationCurveRawNSN?.uintValue ?? UIViewAnimationOptions.curveEaseInOut.rawValue // let animationCurve:UIViewAnimationOptions = UIViewAnimationOptions(rawValue: animationCurveRaw) // UIView.animate(withDuration: duration, // delay: TimeInterval(0), // options: animationCurve, // animations: { self.view.layoutIfNeeded() }, // completion: nil) // } // func textFieldDidBeginEditing(_ textField: UITextField) { // activeTextField = textField // } //MARK: - Delegates //MARK: - Delegates func imagePickerController(_ picker: UIImagePickerController, didFinishPickingImage image: UIImage, editingInfo: [String : AnyObject]?) { print("finished picking image") } func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) { //handle media here i.e. do stuff with photo print("imagePickerController called") let chosenImage = info[UIImagePickerControllerOriginalImage] as! UIImage doctorPofilePicture.image = chosenImage dismiss(animated: true, completion: nil) } func imagePickerControllerDidCancel(_ picker: UIImagePickerController) { //what happens when you cancel //which, in our case, is just to get rid of the photo picker which pops up dismiss(animated: true, completion: nil) } @IBAction func updateBtn(_ sender: Any) { } @IBAction func cancelBtn(_ sender: Any) { performSegue(withIdentifier: "mySegue2", sender: nil) } }
[ -1 ]
fa14bdfec7935bbfd2325bce25271a67ac9a5d35
80af8254361b1ceccaa555c36723aa81bf9446eb
/CommunityResearch/AppDelegate.swift
1f38a4c5cea2a27cb61e7b2fa8b07fb0e21f4a8c
[]
no_license
realalien/CommunityResearch
c23e27f7d6f7bac9c23c98b7b521f000d23b5ecc
a2c0ffd2889531992dc7e2ae9ded370550ffdede
refs/heads/master
2020-05-18T11:44:32.184772
2015-05-27T08:54:30
2015-05-27T08:54:30
35,873,383
0
0
null
null
null
null
UTF-8
Swift
false
false
6,879
swift
// // AppDelegate.swift // CommunityResearch // // Created by xms on 15/5/19. // Copyright (c) 2015年 xms. All rights reserved. // import UIKit import CoreData @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate, BMKGeneralDelegate { var window: UIWindow? var baiduMapManager: BMKMapManager! func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { // Override point for customization after application launch. baiduMapManager = BMKMapManager() var ret:Bool = baiduMapManager.start("DDETG0I7VkLQit0GBQsU1cQC", generalDelegate:self) if (!ret) { NSLog("manager start failed!"); } 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:. // Saves changes in the application's managed object context before the application terminates. self.saveContext() } // MARK: - Core Data stack lazy var applicationDocumentsDirectory: NSURL = { // The directory the application uses to store the Core Data store file. This code uses a directory named "com.xms.swift.play.CommunityResearch" in the application's documents Application Support directory. let urls = NSFileManager.defaultManager().URLsForDirectory(.DocumentDirectory, inDomains: .UserDomainMask) return urls[urls.count-1] as! NSURL }() lazy var managedObjectModel: NSManagedObjectModel = { // The managed object model for the application. This property is not optional. It is a fatal error for the application not to be able to find and load its model. let modelURL = NSBundle.mainBundle().URLForResource("CommunityResearch", withExtension: "momd")! return NSManagedObjectModel(contentsOfURL: modelURL)! }() lazy var persistentStoreCoordinator: NSPersistentStoreCoordinator? = { // The persistent store coordinator for the application. This implementation creates and return a coordinator, having added the store for the application to it. This property is optional since there are legitimate error conditions that could cause the creation of the store to fail. // Create the coordinator and store var coordinator: NSPersistentStoreCoordinator? = NSPersistentStoreCoordinator(managedObjectModel: self.managedObjectModel) let url = self.applicationDocumentsDirectory.URLByAppendingPathComponent("CommunityResearch.sqlite") var error: NSError? = nil var failureReason = "There was an error creating or loading the application's saved data." if coordinator!.addPersistentStoreWithType(NSSQLiteStoreType, configuration: nil, URL: url, options: nil, error: &error) == nil { coordinator = nil // Report any error we got. var dict = [String: AnyObject]() dict[NSLocalizedDescriptionKey] = "Failed to initialize the application's saved data" dict[NSLocalizedFailureReasonErrorKey] = failureReason dict[NSUnderlyingErrorKey] = error error = NSError(domain: "YOUR_ERROR_DOMAIN", code: 9999, userInfo: dict) // Replace this with code to handle the error appropriately. // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. NSLog("Unresolved error \(error), \(error!.userInfo)") abort() } return coordinator }() lazy var managedObjectContext: NSManagedObjectContext? = { // Returns the managed object context for the application (which is already bound to the persistent store coordinator for the application.) This property is optional since there are legitimate error conditions that could cause the creation of the context to fail. let coordinator = self.persistentStoreCoordinator if coordinator == nil { return nil } var managedObjectContext = NSManagedObjectContext() managedObjectContext.persistentStoreCoordinator = coordinator return managedObjectContext }() // MARK: - Core Data Saving support func saveContext () { if let moc = self.managedObjectContext { var error: NSError? = nil if moc.hasChanges && !moc.save(&error) { // Replace this implementation with code to handle the error appropriately. // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. NSLog("Unresolved error \(error), \(error!.userInfo)") abort() } } } // general delegate func onGetPermissionState(iError: Int32) { if (0 == iError) { NSLog("联网成功"); } else{ NSLog("onGetNetworkState \(iError)"); } } func onGetNetworkState(iError: Int32) { if (0 == iError) { NSLog("授权成功"); } else { NSLog("onGetPermissionState \(iError)") } } }
[ 276611, 278916, 157956, 226440, 277514, 277003, 203532, 243594, 277262, 276751, 278287, 225934, 276755, 280085, 276629, 278551, 277912, 278297, 278042, 278808, 276892, 276510, 278943, 277154, 226469, 277030, 194085, 227499, 277038, 277941, 276149, 277306, 276923, 278844, 277826, 164166, 226634, 160973, 164566, 276313, 282075, 278877, 201439, 277344, 276321, 278751, 278125, 226031, 277363, 275828, 278902, 282616, 276347, 40572, 213886 ]
01002ecc43b72c05d0bbb787f4e607ccb80ac4f0
7c750cc6dc166239d7cb44166d6fb130315e7b48
/MetricTest/MetricTest/MapView.swift
6c8e0a4863f003b15ded4db7ef302daf0d3c14b5
[]
no_license
SanchithaD/CoviTrack
83579d87a0682f1ea13d29a437cb4ee33129623c
cb6d1dfb05ead415659d6c632ce15efaae793071
refs/heads/master
2022-12-02T20:23:58.688926
2020-08-09T10:49:11
2020-08-09T10:49:11
286,079,710
0
0
null
null
null
null
UTF-8
Swift
false
false
858
swift
// // MapView.swift // MetricTest // // Created by mihika on 8/9/20. // Copyright © 2020 mihika. All rights reserved. // import SwiftUI struct MapView: View { var body: some View { VStack{ Text("Symptoms") .font(.title) .fontWeight(.thin) .frame(width: 150.0) .background(Color.purple.opacity(0.5)) .cornerRadius(10) Image("symptoms") Text("Emergency") .font(.title) .fontWeight(.thin) .frame(width: 150.0) .background(Color.purple.opacity(0.5)) .cornerRadius(10) Image("emergency") } } } struct MapView_Previews: PreviewProvider { static var previews: some View { MapView() } }
[ -1 ]
a9a5379501eb1959f12feb194d1bb91fd2ad3380
1e29bbbd6bebe9f039eafcf9005fe100ffcab896
/Tests/ViewInspectorTests/SwiftUI/ZStackTests.swift
78c848b3fd22a0dbece3e14bdc92495c6dc074dc
[ "MIT" ]
permissive
nalexn/ViewInspector
3f2def04e77913209ad5b3265ad27165c067c9a9
c4e73093f926247fd5805e53d3fe4b523e605502
refs/heads/0.9.8
2023-08-23T13:03:26.117342
2023-07-13T17:11:43
2023-07-13T17:11:43
222,102,253
1,771
134
MIT
2023-08-26T15:42:16
2019-11-16T13:19:44
Swift
UTF-8
Swift
false
false
2,992
swift
import XCTest import SwiftUI @testable import ViewInspector @available(iOS 13.0, macOS 10.15, tvOS 13.0, *) final class ZStackTests: XCTestCase { func testSingleEnclosedView() throws { let sampleView = Text("Test") let view = ZStack { sampleView } let sut = try view.inspect().zStack().text(0).content.view as? Text XCTAssertEqual(sut, sampleView) } func testResetsModifiers() throws { let view = ZStack { Text("Test") }.padding() let sut = try view.inspect().zStack().text(0) XCTAssertEqual(sut.content.medium.viewModifiers.count, 0) } func testSingleEnclosedViewIndexOutOfBounds() throws { let sampleView = Text("Test") let view = ZStack { sampleView } XCTAssertThrows( try view.inspect().zStack().text(1), "Enclosed view index '1' is out of bounds: '0 ..< 1'") } func testMultipleEnclosedViews() throws { let sampleView1 = Text("Test") let sampleView2 = Text("Abc") let sampleView3 = Text("XYZ") let view = ZStack { sampleView1; sampleView2; sampleView3 } let view1 = try view.inspect().zStack().text(0).content.view as? Text let view2 = try view.inspect().zStack().text(1).content.view as? Text let view3 = try view.inspect().zStack().text(2).content.view as? Text XCTAssertEqual(view1, sampleView1) XCTAssertEqual(view2, sampleView2) XCTAssertEqual(view3, sampleView3) } func testSearch() throws { let view = AnyView(ZStack { EmptyView() }) XCTAssertEqual(try view.inspect().find(ViewType.ZStack.self).pathToRoot, "anyView().zStack()") XCTAssertEqual(try view.inspect().find(ViewType.EmptyView.self).pathToRoot, "anyView().zStack().emptyView(0)") } func testMultipleEnclosedViewsIndexOutOfBounds() throws { let sampleView1 = Text("Test") let sampleView2 = Text("Abc") let view = ZStack { sampleView1; sampleView2 } XCTAssertThrows( try view.inspect().zStack().text(2), "Enclosed view index '2' is out of bounds: '0 ..< 2'") } func testExtractionFromSingleViewContainer() throws { let view = AnyView(ZStack { Text("Test") }) XCTAssertNoThrow(try view.inspect().anyView().zStack()) } func testExtractionFromMultipleViewContainer() throws { let view = ZStack { ZStack { Text("Test") } ZStack { Text("Test") } } XCTAssertNoThrow(try view.inspect().zStack().zStack(0)) XCTAssertNoThrow(try view.inspect().zStack().zStack(1)) } func testAlignmentInspection() throws { let view = ZStack(alignment: .bottomTrailing) { Text("") } let sut = try view.inspect().zStack().alignment() XCTAssertEqual(sut.horizontal, .trailing) XCTAssertEqual(sut.vertical, .bottom) } }
[ -1 ]
6ef4dd0a116bd58efd7c4d6f7e83baacfec70a2e
49b3b7efbc71a44fbcff694bd9a7efd9bfac2153
/jackie-twilio-notifications/gist.request.swift
b7adf3531528621403a016c63ce640391be4fc7b
[]
no_license
xlaefz/LAHacks2017
8f2a3c6a10c6580eaa4abfefed6bda4853e67461
d09b1f5ae04fbc486a79dee53dfdc989c5dd395d
refs/heads/master
2021-01-18T20:04:23.503965
2017-04-02T15:32:25
2017-04-02T15:32:25
86,933,556
1
0
null
null
null
null
UTF-8
Swift
false
false
427
swift
import Alamofire Alamofire.request(.POST, "http://localhost:3000/request", headers: ["Content-Type":"application/x-www-form-urlencoded" ], parameters:["telephone1" : name1, "telephone2" : name2]).response(completionHandler: { (request, response, data, error) in print(request) print(response) print(data) print(error) })
[ -1 ]
53d81c200182d10ec6027a2812e959ce4bc6ad2a
98e096b35c15d56a1a1e7e5413974bc9d7918015
/iOS Sample Architecture/Flow/Main/MainCoordinatorOutput.swift
671a74761ad34a2840b8340d1935420e54a84c03
[]
no_license
hedypamungkas/iOS-Sample-Architecture
c3eec8e02faf5aad6f0409299d7b5e75a678b4c8
a8c54dc90f7e6444cda0fc25929378caf7264e42
refs/heads/master
2020-07-09T13:10:23.119179
2019-08-23T17:31:17
2019-08-23T17:31:17
203,976,568
0
0
null
null
null
null
UTF-8
Swift
false
false
221
swift
// // MainCoordinatorOutput.swift // iOS Sample Architecture // // Created by Hedy Pamungkas on 23/08/19. // Copyright © 2019 hedy. All rights reserved. // import Foundation protocol MainCoordinatorOutput { }
[ -1 ]
c1816a62be9bec96349bcfae297d86e595efa5df
2f423b82bf6c44870df0749f767b74433fd20d36
/HospitalFaceAI/HospitalFaceAI/Repositories/Persistence/UserSessionStore/Implementations/FileUserSessionDataStore.swift
7ebef66390d47fde11c08c3d7af7e4688286eb16
[]
no_license
WTFWindTalker/Terra
772af88761b2094873c50d2ecb25e2bea3c5e01b
77e45612de297d67ce9202b7d17ddd7219586f9d
refs/heads/master
2022-11-07T03:18:37.295549
2020-06-29T12:57:08
2020-06-29T12:57:08
null
0
0
null
null
null
null
UTF-8
Swift
false
false
2,192
swift
// // FileUserSessionDataStore.swift // HospitalFaceDetect // // Created by song on 2019/9/16. // Copyright © 2019 song. All rights reserved. // import Foundation import PromiseKit class FileUserSessionDataStore: UserSessionDataStore { // MARK: - Properties var docsURL: URL? { return FileManager .default.urls(for: FileManager.SearchPathDirectory.documentDirectory, in: FileManager.SearchPathDomainMask.allDomainsMask).first } public init() {} func readUserSession() -> Promise<UserSession?> { return Promise() { seal in guard let docsURL = docsURL else { seal.reject(FaceDetectError.localJsonNotExist) return } guard let jsonData = try? Data(contentsOf: docsURL.appendingPathComponent("user_session.json")) else { seal.fulfill(nil) return } let decoder = JSONDecoder() let userSession = try! decoder.decode(UserSession.self, from: jsonData) seal.fulfill(userSession) } } func save(userSession: UserSession) -> Promise<UserSession> { return Promise() { seal in let encoder = JSONEncoder() let jsonData = try! encoder.encode(userSession) guard let docsURL = docsURL else { seal.reject(FaceDetectError.localJsonNotExist) return } try? jsonData.write(to: docsURL.appendingPathComponent("user_session.json")) seal.fulfill(userSession) } } func delete(userSession: UserSession) -> Promise<UserSession> { return Promise() { seal in guard let docsURL = docsURL else { seal.reject(FaceDetectError.localJsonNotExist) return } do { try FileManager.default.removeItem(at: docsURL.appendingPathComponent("user_session.json")) } catch { seal.reject(FaceDetectError.any) return } seal.fulfill(userSession) } } }
[ -1 ]
810bf0a52bec09f673970dd4abd7ec274f8eff70
9c6f7b571cd2629fe1bb8cb228798c99daff6513
/GdanskNumerek/Utils/QueueNameExtractor.swift
0e4a5e9c6cc49e170ef2f5c9dc0077db5da9880b
[ "MIT" ]
permissive
Eluss/GdanskNumerek-iOS
4d46e0acb39d5e5173e777b87a88ee10600848a9
004f5862fa47d94fc52be91db5f02e3d7bb34f40
refs/heads/master
2021-01-01T04:45:38.956760
2016-12-12T20:19:36
2016-12-12T20:19:36
57,061,822
0
0
null
null
null
null
UTF-8
Swift
false
false
754
swift
// // QueueNameLetterRemover.swift // GdanskNumerek // // Created by Eliasz Sawicki on 06/03/16. // Copyright © 2016 Eliasz Sawicki. All rights reserved. // import Foundation class QueueNameExtractor: NSObject { func extractQueueName(name: String) -> String { if name.characters.count == 1 { return "" } let newName = name if let range = newName.rangeOfString("-") { let substring = newName.substringFromIndex(range.startIndex.advancedBy(1)) let trimmedString = substring.stringByTrimmingCharactersInSet( NSCharacterSet.whitespaceAndNewlineCharacterSet() ) return trimmedString } return name } }
[ -1 ]
d1754a8b03efca2507cb270ef36278a8cb51b66f
d1e0c24e36869ec3d41db659a3222576571d9780
/Flash Chat iOS13/Controllers/RegisterViewController.swift
f5632702ee00f11433c2f553570be036779de14e
[]
no_license
Areej-FA/Flash-Chat-iOS13
6e75cdde511dd2c87d98a1c6b11501d2eabbe5f0
b8ad0b71f88b97dc77dab554f676159886a95f60
refs/heads/master
2021-01-14T15:11:52.227078
2020-02-25T13:21:30
2020-02-25T13:21:30
242,657,406
0
0
null
2020-02-24T05:53:03
2020-02-24T05:53:02
null
UTF-8
Swift
false
false
1,310
swift
// // RegisterViewController.swift // Flash Chat iOS13 // // Created by Angela Yu on 21/10/2019. // Copyright © 2019 Angela Yu. All rights reserved. // import UIKit import Firebase import ProgressHUD class RegisterViewController: UIViewController { @IBOutlet weak var emailTextfield: UITextField! @IBOutlet weak var passwordTextfield: UITextField! @IBAction func registerPressed(_ sender: UIButton) { if let email = emailTextfield.text , let password = passwordTextfield.text{ Auth.auth().createUser(withEmail: email, password: password) { authResult, error in if let e = error { print(e.localizedDescription) // give the user feedback to display that thier registerion was unsuccessful and print the issue in thier own langage ProgressHUD.showError(e.localizedDescription) } else { // give the user feedback to display that thier registerion was successful ProgressHUD.showSuccess() // Navigate to the ChatViewController self.performSegue(withIdentifier: K.registerSegue, sender: self) } } } } }
[ -1 ]
758854b5837357780d561027f70b31f4bcebb241
473477f15a484b9cd5de4adfa41f602bd6e6cc5b
/Sources/TinkLinkUI/LoadingViewController.swift
be33e6232a63a8f46520a4d0e5ad77384d89e4a2
[ "MIT" ]
permissive
menghaozhang/tink-link-ios-1
9c0fdeb14beff7546bb44e88a4dfa0def258c848
d2d62d593c7128a9a4c02d866e1bfb8c0564293a
refs/heads/master
2023-07-09T15:58:36.035270
2021-08-16T09:50:47
2021-08-16T09:50:47
null
0
0
null
null
null
null
UTF-8
Swift
false
false
3,052
swift
import UIKit final class LoadingViewController: UIViewController { override public var preferredStatusBarStyle: UIStatusBarStyle { let baseColor = (navigationController?.isNavigationBarHidden ?? true) ? Color.background : Color.navigationBarBackground if #available(iOS 13.0, *) { return baseColor.resolvedColor(with: traitCollection).isLight ? .darkContent : .lightContent } else { return baseColor.isLight ? .default : .lightContent } } private(set) var onCancel: (() -> Void)? private let activityIndicatorView = ActivityIndicatorView() private let label = UILabel() private let cancelButton = UIButton(type: .system) var text: String { label.text ?? "" } override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = Color.background activityIndicatorView.tintColor = Color.accent activityIndicatorView.style = .large activityIndicatorView.startAnimating() cancelButton.setTitleColor(Color.button, for: .normal) cancelButton.titleLabel?.font = Font.subtitle1 cancelButton.titleLabel?.adjustsFontForContentSizeCategory = true cancelButton.addTarget(self, action: #selector(cancel), for: .touchUpInside) cancelButton.setTitle(Strings.Generic.cancel, for: .normal) label.font = Font.subtitle1 label.textColor = Color.label label.numberOfLines = 0 label.textAlignment = .center label.translatesAutoresizingMaskIntoConstraints = false activityIndicatorView.translatesAutoresizingMaskIntoConstraints = false cancelButton.translatesAutoresizingMaskIntoConstraints = false view.addSubview(label) view.addSubview(activityIndicatorView) view.addSubview(cancelButton) view.addSubview(activityIndicatorView) NSLayoutConstraint.activate([ activityIndicatorView.centerYAnchor.constraint(equalTo: view.centerYAnchor, constant: -36), activityIndicatorView.centerXAnchor.constraint(equalTo: view.centerXAnchor), activityIndicatorView.bottomAnchor.constraint(equalTo: label.topAnchor, constant: -24), label.leadingAnchor.constraint(equalTo: view.layoutMarginsGuide.leadingAnchor, constant: 24), label.trailingAnchor.constraint(equalTo: view.layoutMarginsGuide.trailingAnchor, constant: -24), cancelButton.centerXAnchor.constraint(equalTo: view.layoutMarginsGuide.centerXAnchor), cancelButton.bottomAnchor.constraint(equalTo: view.layoutMarginsGuide.bottomAnchor, constant: -32) ]) } func update(_ text: String?, onCancel: (() -> Void)?) { dispatchPrecondition(condition: .onQueue(.main)) if let onCancel = onCancel { self.onCancel = onCancel cancelButton.isHidden = false } else { cancelButton.isHidden = true } label.text = text } @objc private func cancel() { onCancel?() } }
[ -1 ]
434aec65359fdac1d56241c5d45010d4a06c3fef
f6b8eef67a5e7c2718bc6853be2825bcf3078327
/Sources/Chronicle/Chronicle+DefaultHandlers.swift
83aa38bf258bf8cd59f4c29241d38a36268e40be
[ "MIT" ]
permissive
0xLeif/Chronicle
4e5b7f8e905dc1e90c43049579213d82c3269642
99b0ea8460fb6c83b3130fca65a1571b80cfe9cb
refs/heads/main
2023-04-20T00:36:50.161748
2021-04-12T14:42:37
2021-04-12T14:42:37
355,005,056
2
0
MIT
2021-04-12T14:39:13
2021-04-06T00:01:09
Swift
UTF-8
Swift
false
false
2,038
swift
// // Chronicle+DefaultHandlers.swift // // // Created by Leif on 4/9/21. // import Foundation extension Chronicle { public struct DefaultHandlers { public struct PrintHandler: ChronicleHandler { public init() { } public func handle(output: String) { print(output) } public func didHandle(chronicle: Chronicle, level: Chronicle.LogLevel) { } } public struct FileHandler: ChronicleHandler { private let lock = NSLock() public var fileURL: URL { FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0] .appendingPathComponent(fileName) } public var fileName: String public init(fileName: String = "chronicle.log") { self.fileName = fileName } public func handle(output: String) { var fileOutput = "" lock.lock() defer { fileOutput.append(output) do { try fileOutput.write(to: fileURL, atomically: true, encoding: String.Encoding.utf8) } catch { dump(error) } lock.unlock() } guard let contents = try? Data(contentsOf: fileURL) else { return } let fileContents = String(data: contents, encoding: .utf8) if let fileContents = fileContents { fileOutput.append(fileContents + "\n") } } public func didHandle(chronicle: Chronicle, level: Chronicle.LogLevel) { } } } }
[ -1 ]
d09ecec6788f6977a5d1af7b9db355f8d4894823
3b1365f3e2c1cd45ccd77470bb204d3026eca154
/BleChat/Views/MenuView.swift
14a7b09fa9f225dd9163669827785b981d64894b
[]
no_license
airfranceklm/ble-chat
b76a0a1dc1efd0cb9b89cb3b2bd52ad45ddea0f7
8cef080edf417288df1e7935de20b68445726114
refs/heads/master
2020-09-14T17:23:49.615893
2020-03-06T09:45:55
2020-03-06T09:45:55
223,198,379
0
0
null
null
null
null
UTF-8
Swift
false
false
2,638
swift
// // MenuView.swift // BleChat // // Created by Jean-Jacques Wacksman. // Copyright © 2019 Air France - KLM. All rights reserved. // import SwiftUI fileprivate let CHANNEL_ROW_PADDING = CGFloat(10) struct MenuView: View { @State var showingProfile = false var profileButton: some View { Button(action: { self.showingProfile.toggle() }) { Image(systemName: "person.crop.circle").imageScale(.large).padding() } } var body: some View { NavigationView { GeometryReader { geometry in ScrollView(.vertical, showsIndicators: false) { VStack(spacing: 0) { ForEach(channels) { channel in NavigationLink(destination: ChatView(channel: channel)) { ChannelRowView(channel: channel) } } .frame(height: CHANNEL_ROW_PADDING + geometry.size.width / 2) } } .navigationBarTitle(Text("Channels")) .navigationBarItems(trailing: self.profileButton) .sheet(isPresented: self.$showingProfile) { ZStack { Image("background").resizable().aspectRatio(contentMode: .fill).opacity(0.2) AvatarPickerView() } } } ChatView(channel: channels[0]) } .accentColor(Color.orange.opacity(0.8)) .navigationViewStyle(DoubleColumnNavigationViewStyle()) .onAppear() { BleConnector.shared.startSession() } } } struct ChannelRowView: View { let channel: Channel var body: some View { ZStack(alignment: .topLeading) { Image(self.channel.image) .renderingMode(.original) .resizable() .saturation(0.2) .cornerRadius(30) .padding(CHANNEL_ROW_PADDING) .rotationEffect(Angle(degrees: Double(Int.random(in: -3...3)))) VStack(alignment: .leading) { Text(self.channel.title).font(.system(size: 24)).fontWeight(.heavy).tracking(-3).foregroundColor(.orange).shadow(color: .black, radius: 2).padding([.top, .leading], 30).opacity(0.7) Rectangle().foregroundColor(Color(UIColor.systemBackground)).frame(height: 3) } } } } struct MenuView_Previews: PreviewProvider { static var previews: some View { MenuView() } }
[ -1 ]
db5539a5016695c3205bcb02036c6670186f0cd9
1c08ddf354a1831abfc1d322c6158ed464a59ee2
/CLRHelper/NSColor+CLRHelper.swift
d6237fb765a372940152cfcc7778ad10347cb7d4
[]
no_license
UpBra/CLRHelper
ece86aec9720d940c18edd1d41ef98c8ba87f935
0d657007f5b64cea4035e65b2531b941ee56fb4d
refs/heads/master
2021-01-25T09:45:14.795325
2017-06-09T16:21:45
2017-06-09T16:21:45
93,876,395
0
0
null
null
null
null
UTF-8
Swift
false
false
356
swift
// // NSColor+CLRHelper.swift // Copyright © 2017 Gleesh. All rights reserved. // import Foundation import AppKit extension NSColor { var literalRedComponent: CGFloat { return redComponent * 255.0 } var literalGreenComponent: CGFloat { return greenComponent * 255.0 } var literalBlueComponent: CGFloat { return blueComponent * 255.0 } }
[ -1 ]
afc151615f43a7bcbb62bef310b058ee05cb2804
7ce495a6252e185571b361b8e1e058f202f881d4
/Vocabulary/VocaForAll/VocaForAllNavigationView.swift
919194ad87e4f014439b9b5b46406ac7b11cb92d
[]
no_license
Odyflame/Spark-iOS
66741b19c4074d643bfd25fbda3e9f6af6937e05
2c59c93832995931a0a2481582a64bd50c15bc31
refs/heads/master
2022-12-31T07:48:59.974757
2020-08-16T06:12:38
2020-08-16T06:12:38
280,784,266
0
0
null
2020-07-19T03:29:46
2020-07-19T03:29:46
null
UTF-8
Swift
false
false
2,602
swift
// // VocaForAllNavigationView.swift // Vocabulary // // Created by apple on 2020/07/30. // Copyright © 2020 LEE HAEUN. All rights reserved. // import UIKit import SnapKit private enum VocaForAllConstants { enum Title { static let Title: String = "모두의 단어장" static let color: UIColor = .black static let Font: UIFont = .systemFont(ofSize: 20, weight: .heavy) } enum Button { static let title: String = "최신순" static let width: CGFloat = 34 static let height: CGFloat = 34 static let color: UIColor = .black } enum Divider { static let height: CGFloat = 4 static let color: UIColor = .black } } class VocaForAllNavigationView: UIView { // MARK: - Properties lazy var containerView: UIView = { let view = UIView() view.translatesAutoresizingMaskIntoConstraints = false return view }() lazy var titleLabel: UILabel = { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false label.textColor = VocaForAllConstants.Title.color label.font = VocaForAllConstants.Title.Font label.text = VocaForAllConstants.Title.Title return label }() lazy var sortButton: BaseButton = { let button = BaseButton() button.translatesAutoresizingMaskIntoConstraints = false button.setTitle(VocaForAllConstants.Button.title, for: .normal) return button }() override init(frame: CGRect) { super.init(frame: frame) initView() setAppearance() } // MARK: - View ✨ func initView() { self.addSubview(containerView) // containerView.addSubview(titleLabel) containerView.addSubview(sortButton) // containerView.snp.makeConstraints { (make) in make.top.leading.trailing.bottom.equalTo(self) make.height.equalTo(44) } titleLabel.snp.makeConstraints { (make) in make.leading.equalTo(containerView).offset(20) make.centerY.equalTo(containerView) make.height.equalTo(29) } sortButton.snp.makeConstraints { (make) in make.trailing.equalTo(containerView).offset(-16) make.centerY.equalTo(containerView) } } func setAppearance() { self.backgroundColor = .white self.titleLabel.textColor = .black self.sortButton.setTitleColor(.black, for: .normal) } required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } }
[ -1 ]
ad88916a6aaa2050d465644b1a33260e2cf170d9
26f6f773f975586c8a5a5258391121835628caa7
/conditionals.playground/Pages/01-If-Statements.xcplaygroundpage/Contents.swift
a6b62bdc8144cbb02b5d0f5bba800b899163b580
[]
no_license
Casey-S/MOB1
3f9664f79dfb58181292ff67bea5591b9cf4eaf1
c7e0bd9d2f5e2e363e1d483ff934e3229480afb1
refs/heads/master
2021-07-15T08:16:51.357267
2017-10-23T10:41:37
2017-10-23T10:41:37
103,581,666
0
0
null
null
null
null
UTF-8
Swift
false
false
3,608
swift
/*: ![Make School Banner](./swift_banner.png) # Conditionals We'll be talking about _booleans_ and _conditionals_ in this playground. Booleans represent the values of `true` and `false`. _Conditionals_ allow us to use _boolean_ values to decide what code should run! We'll be programming an _adaptive cruise control_ system as we learn about _booleans_ and _conditionals_. For those of you who do not drive, _cruise control_ is a feature that maintains the speed of your car. In the past few years, consumer cars have gotten closer and closer to the fabled self driving car. Many new cars have an optional _adaptive cruise control_ feature that not only maintains speed, but uses distance sensors to automatically slow your car down if it is approaching an obstacle! ## Bool In Swift, _booleans_ are represented by the `Bool` type. There are two values possible values for a `Bool` -- `true` and `false`. We can use the following _boolean operators_ to evaluate and expression to a boolean: - `<` less than - `>` greater than - `==` equal to - `!=` not equal to - `<=` less than or equal to - `>=` greater than or equal to You can see this in action below! */ let lessThanExample = 0 < 1 let greaterThanExample = 1 > 0 let equalToExample = 0 == 0 let equalToStringExample = "test" == "test" let notEqualToExample = "boolean" != "random string" let lessThanEqualToExample = 0 <= 0 let greaterThanEqualToExample = 1 >= 0 //: - experiment: Try out some _boolean operators_ below! let mightBeBolean = 10 < 5 let mightBe = 3 > 5 let falseShit = 4 == 5 let goodShit = "hola" != "adios" /*: ## `If` statements We can combine `Bool` values with _if statements_ to react to conditions in our code! The code inside of an _if statement_ will only run if the _boolean conditional_ is `true`. An _if statement_ takes the form of: if conditional { // code in here only runs when the conditional is true! } Check out some examples below! */ if 0 < 1 { print("Zero is less than one") } if 0 > 1 { // this will never run! Swift even warns you about it with the yellow triangle print("Zero is greater than one") } /*: Those examples are a bit silly but should demonstrate the point. The code inside _if statements_ will run when the _conditional_ evaluates to `true` and will not run when the _conditional_ evaluates to `false`. # A basic cruise control Let's put this knowledge to the test and program a basic cruise control system! The `cruiseControl` function below gets called automatically a few times a second. It currently will accelerate our car (the blue one) no matter what. The car actually crashes into another car! - callout(Challenge): Fix the code below! The speed limit on this road is _60 mph_. Change the code to make the car accelerate up to, but not past _60 mph_! */ func cruiseControl(currentSpeed: Int, distance: Int, previousDistance: Int) { if currentSpeed <= 60 { accelerate() } } /*: - callout(Hint): The car will increase its speed by _1 mph_ everytime you call `accelerate` but you can only call `accelerate` once per time `cruiseControl` is automatically called. You do not need to use `distance` and `previousDistance` right now! We'll be using those in later sections... */ //: [Next](@next) //: //: This is special code required to make the mini-game work. You do NOT need to understand it right now. import PlaygroundSupport let results = GameScene.setup(step: .speedUp) (results.scene as! GameScene).updateCar = cruiseControl PlaygroundPage.current.liveView = results
[ -1 ]
47f23ac9f939ed491aea9ab6715099de7ef58066
b11fd022c527b7e0dd737d22fa9e6c8c6b9f8180
/IOTPayiOS/Views+ViewModels/ComponentsView+ViewModels/IOTCardInfoComponents.swift
429a52f06436002d28b4d1a3aabb32c1621d2da2
[ "MIT" ]
permissive
IOTPaySDK/IOTPay-iOS
aaaeef6b204eb613aefcf134fa91e6053efaa6bd
967b47898e202e97c3dac4d9d6c38250cd4665e6
refs/heads/main
2023-06-06T17:35:00.394204
2021-07-12T17:42:00
2021-07-12T17:42:00
355,291,121
1
0
null
null
null
null
UTF-8
Swift
false
false
8,967
swift
// // IOTCardInfoComponents.swift // IOTPay-iOS nonFramework // // Created by macbook on 2021-04-10. // import UIKit //protocol IOTCardInfoComponentsProtocol { // IOTCardInfoComponents //} protocol IOTCardInfoComponentsTransportDelegate: IOTNetworkService { //IOTPay_iOS_nonFramework.//IOTNetworkManager func transport(route: IOTHTTPNetworkRoute, info: IOTCardInfo) } protocol IOTCardInfoComponentsDelegate: AnyObject { // func updateCardIconView(displayState: IOTCardIconState) // func updateCardIconView(temporaryEvent: IOTCardIconTemporaryEvent) // func updateTextFieldSeletedIndex(subject: Int) func onDidCompleteValidate() } public final class IOTCardInfoComponents: UIView { weak var transportDelegate: IOTCardInfoComponentsTransportDelegate? weak var componentsDelegate: IOTCardInfoComponentsDelegate? private let viewModel: IOTCardInfoComponentsViewModel private let textFields: [IOTTextField] private var backRectViews: [UIView] = [] private let cardIconView: IOTCardIconView? private let cardLargeView: IOTCardView? private let action: IOTNetworkRequestAction //private let layout: IOTCardInfoViewLayout //var seletedTextFieldIndex: Int? { viewModel.seletedTextFieldIndex } private var patternPrediction: IOTCardPatternPrediction = .unrecognized { didSet { if oldValue != patternPrediction { textFields.forEach { $0.patternPrediction = patternPrediction } if cardIconView?.state != nil { cardIconView?.state = patternPrediction.cardIconDisplayState } if let cardLargeView = cardLargeView, viewModel.layout == .tripleLineWithLargeCardViewOnTop || viewModel.layout == .tripleLineOnLargeCardView || viewModel.layout == .tripleLineWithLargeCardIconOnLeft { cardLargeView.playCycleAnimation(till: patternPrediction.cardCulingCycle) } } } } //var cardInfo: IOTCardInfo { IOTCardInfo.init(viewComponents: self) } private var isValid: Bool { textFields.allSatisfy { $0.isValid }} init(action: IOTNetworkRequestAction, layout: IOTCardInfoViewLayout, style: IOTCardInfoViewStyle) { self.action = action viewModel = IOTCardInfoComponentsViewModel() let textFieldFactory = IOTTextFieldFactory() textFields = textFieldFactory.makeTextFieldArray(subjectSequence: nil, style: style, attributeSequence: [layout.textFieldAttribute]) for _ in 0..<textFields.count { backRectViews.append(UIView()) } cardIconView = layout.isDisplayingCardIcon ? IOTCardIconView() : nil cardLargeView = layout.isDisplayingCardView ? IOTCardView(layout: layout) : nil super.init(frame: CGRect.zero) viewModel.viewModeDelegate = self viewModel.layout = layout commonInit(layout: layout) } required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } private func commonInit(layout: IOTCardInfoViewLayout) { if layout.isDisplayingCardIcon { addSubview(cardIconView!) } if layout.isDisplayingCardView { addSubview(cardLargeView!)} backRectViews.forEach { addSubview($0) } switch layout { case .singleLineWithSmallCardIcon, .tripleLineWithLargeCardIconOnLeft, .tripleLineWithLargeCardViewOnTop: textFields.forEach { addSubview($0) } case .tripleLineOnLargeCardView: textFields.forEach { addSubview($0) } } textFields.forEach { $0.addTarget(viewModel, action: #selector(viewModel.onTextFieldDidSelect(sender:)), for: .editingDidBegin) $0.addTarget($0.viewModel, action: #selector($0.viewModel.onTextFieldDidChange(sender:)), for: .editingChanged) } for textField in textFields { textField.textFieldDelegate = viewModel } clipsToBounds = true } deinit {} } //MARK: Connection with facade extension IOTCardInfoComponents { func setSegmentModel(config: IOTSegmentModel.IOTSegmentModelConfig) { viewModel.setupDefromableCapability(segmentModelConfig: config) } func setIOTCardView(frame: CGRect) { cardIconView?.frame = frame cardIconView?.updateFrame() } func updateLayout() { //viewModel.segmentModel } } extension IOTCardInfoComponents: IOTCardInfoComponentsViewModelDelegate { func onDidFinishCardInfoValidate() { // for textField in textFields where textField.subject == .holderName { // // } componentsDelegate?.onDidCompleteValidate() } func updatePatternPrediction(to patternPrediction: IOTCardPatternPrediction) { self.patternPrediction = patternPrediction } func updateFirstResponder(to textFieldAtIndex: Int) { textFields[textFieldAtIndex].becomeFirstResponder() } func playCardFlipAnimation(to: IOTCardSide) { if cardIconView != nil && viewModel.layout == .singleLineWithSmallCardIcon { if to == .back { cardIconView?.state = .back } else { cardIconView?.state = patternPrediction.cardIconDisplayState } } if let cardLargeView = cardLargeView, viewModel.layout == .tripleLineWithLargeCardViewOnTop || viewModel.layout == .tripleLineOnLargeCardView || viewModel.layout == .tripleLineWithLargeCardIconOnLeft { if to == .back && cardLargeView.side == .front { cardLargeView.playFlipAnimation() } else if to == .front && cardLargeView.side == .back { cardLargeView.playFlipAnimation() } } } func playTextFieldAnimation(fromPositions: [CGRect], toPosition: [CGRect]) { for i in 0..<textFields.count { textFields[i].frame = fromPositions[i] } UIView.animate(withDuration: 0.2) { [weak self] in guard let self = self else { return } for i in 0..<self.textFields.count { self.textFields[i].frame = toPosition[i] } } // completion: { (completed) in // if completed {} // } } func onDidUpdateCardIconViewLayout(rect: CGRect) { } func onDidUpdateTextFieldsLayout(rectArray: [CGRect]) { for i in 0..<textFields.count { textFields[i].frame = rectArray[i] } } func onDidLoad(initDisplayState: [IOTTextFieldDisplayState]) { for i in 0..<textFields.count { textFields[i].displayState = initDisplayState[i] } } } //MARK: Animation extension IOTCardInfoComponents { func playTextFieldAnimation(fromPositions: [CGPoint], toPositions: [CGPoint], duration: TimeInterval) { for i in 0..<textFields.count { textFields[i].frame.origin = fromPositions[i] } UIView.animate(withDuration: 0.5) { [weak self] in guard self?.textFields.count != nil else { return } if let count = self?.textFields.count { for i in 0..<count { self?.textFields[i].frame.origin = toPositions[i] } } } } } extension IOTCardInfoComponents { func transport() { let route = IOTHTTPNetworkRoute(action: action) let info = IOTCardInfo( cardNumber: textFields[IOTTextFieldSubject.cardNumber.rawValue].valueString!, holderName: textFields[IOTTextFieldSubject.holderName.rawValue].valueString!, expiryDate: textFields[IOTTextFieldSubject.expiryDate.rawValue].valueString!, cvv: textFields[IOTTextFieldSubject.cvv.rawValue].valueString!) transportDelegate?.transport(route: route, info: info) } } //Fixed size layout setting extension IOTCardInfoComponents { func setFixedViewRects(array: [CGRect]) { cardLargeView?.frame = array[4] // = IOTCardView(frame: array[4]) frame = array[5] setupStyle(array: array) } private func setupStyle(array: [CGRect]) { if viewModel.layout == .tripleLineWithLargeCardViewOnTop { for i in 0..<textFields.count { backRectViews[i].frame = array[i] backRectViews[i].layer.cornerRadius = 10.0 backRectViews[i].layer.borderWidth = 1.0 backRectViews[i].layer.borderColor = IOTColor.roundRectBoderColorBlue.uiColor.cgColor backRectViews[i].backgroundColor = IOTColor.labelBackground.uiColor backRectViews[i].alpha = 0.8 backRectViews[i].isUserInteractionEnabled = false let leftSpace = array[0].width * 0.05 let textFieldsWidth = array[i].width - leftSpace * 2.0 textFields[i].frame = CGRect( x: array[i].origin.x + leftSpace, y: array[i].origin.y, width: textFieldsWidth, height: array[i].size.height) textFields[i].font = UIFont.systemFont(ofSize: 17) } onDidLoad(initDisplayState: [.full, .full, .full, .full]) } if viewModel.layout == .tripleLineOnLargeCardView { for i in 0..<textFields.count { backRectViews[i].frame = array[i] backRectViews[i].layer.cornerRadius = 10.0 backRectViews[i].layer.borderWidth = 1.0 backRectViews[i].layer.borderColor = IOTColor.roundRectBoderColorBlue.uiColor.cgColor backRectViews[i].backgroundColor = IOTColor.labelBackground.uiColor backRectViews[i].alpha = 0.6 backRectViews[i].isUserInteractionEnabled = false let leftSpace = array[0].width * 0.05 let textFieldsWidth = array[i].width - leftSpace * 2.0 textFields[i].frame = CGRect( x: array[i].origin.x + leftSpace, y: array[i].origin.y, width: textFieldsWidth, height: array[i].size.height) textFields[i].font = UIFont.systemFont(ofSize: 17) } onDidLoad(initDisplayState: [.full, .full, .full, .full]) } } }
[ -1 ]
a4dda0ac5765091fa062b1c504bdda392d1b9a21
aba9f4599f0739e006217c937dcfedc0c2e828aa
/ModernCellConfigSampleApp/AppDelegate.swift
228fa17f7beaa33fda31312351ded2d3acd54687
[]
no_license
hamid-hoseini/ModernCellConfigSampleApp
f5efe4a50831e7a4dc6c16002f5b8805fa7d6c5d
b97948f2287c7b74c3a64c4ac786c2ccbd608aa9
refs/heads/main
2023-01-05T21:56:54.363445
2020-11-06T04:30:57
2020-11-06T04:30:57
310,491,700
0
0
null
null
null
null
UTF-8
Swift
false
false
1,365
swift
// // AppDelegate.swift // ModernCellConfigSampleApp // // Created by Hamid Hoseini on 11/5/20. // import UIKit @main class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } // MARK: UISceneSession Lifecycle func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { // Called when a new scene session is being created. // Use this method to select a configuration to create the new scene with. return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) } func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) { // Called when the user discards a scene session. // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. // Use this method to release any resources that were specific to the discarded scenes, as they will not return. } }
[ 393222, 393224, 393230, 393250, 344102, 393261, 393266, 213048, 376889, 385081, 393275, 376905, 254030, 286800, 368727, 180313, 368735, 180320, 376931, 286831, 368752, 286844, 417924, 262283, 286879, 286888, 377012, 327871, 377036, 180431, 377046, 418010, 377060, 327914, 205036, 393456, 393460, 418043, 336123, 385280, 336128, 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, 410128, 393747, 254490, 188958, 385570, 33316, 377383, 197159, 352821, 197177, 418363, 188987, 369223, 385609, 385616, 352864, 369253, 262760, 352874, 352887, 254587, 377472, 148105, 377484, 352918, 98968, 344744, 361129, 336555, 385713, 434867, 164534, 336567, 328378, 164538, 328386, 352968, 344776, 352971, 418507, 352973, 385742, 385748, 361179, 189153, 369381, 361195, 418553, 344831, 336643, 344835, 344841, 361230, 336659, 418580, 418585, 434970, 369435, 418589, 262942, 418593, 336675, 328484, 418598, 418605, 336696, 361273, 328515, 336708, 328519, 361288, 336711, 336714, 328522, 426841, 254812, 361309, 197468, 361315, 361322, 328573, 377729, 369542, 361360, 222128, 345035, 386003, 345043, 386011, 386018, 386022, 435187, 328702, 328714, 361489, 386069, 386073, 336921, 336925, 345118, 377887, 345133, 345138, 386101, 361536, 189520, 345169, 156761, 361567, 148578, 345199, 386167, 361593, 410745, 361598, 214149, 345222, 386186, 337047, 345246, 214175, 337071, 337075, 386258, 328924, 66782, 222437, 386285, 328941, 386291, 345376, 353570, 345379, 410917, 345382, 345399, 378169, 369978, 337222, 337234, 263508, 402791, 345448, 271730, 378227, 271745, 181638, 353673, 181643, 181649, 181654, 230809, 181673, 181681, 337329, 181684, 361917, 181696, 337349, 337365, 271839, 329191, 361960, 329194, 116210, 337398, 337415, 329226, 419339, 419343, 419349, 345625, 419355, 370205, 419359, 394786, 419362, 370213, 419368, 419376, 206395, 214593, 419400, 419402, 353867, 419406, 419410, 394853, 345701, 222830, 370297, 403070, 403075, 345736, 198280, 403091, 345749, 419483, 345757, 345762, 419491, 345765, 419497, 419501, 370350, 419506, 419509, 419512, 337592, 419517, 337599, 419527, 419530, 419535, 272081, 419542, 394966, 419544, 181977, 345818, 419547, 419550, 419559, 337642, 419563, 337645, 370415, 337659, 337668, 362247, 395021, 362255, 395029, 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, 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, 338211, 248111, 362822, 436555, 190796, 379233, 354673, 321910, 248186, 420236, 379278, 354727, 338352, 330189, 338381, 338386, 338403, 248308, 199164, 330252, 199186, 420376, 330267, 354855, 10828, 199249, 346721, 174695, 248425, 191084, 338543, 191092, 346742, 330383, 354974, 150183, 248504, 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, 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, 396328, 158761, 199728, 396336, 330800, 396339, 339001, 388154, 388161, 347205, 248904, 330826, 248914, 412764, 339036, 257120, 265320, 248951, 420984, 330889, 347287, 248985, 339097, 44197, 380070, 339112, 249014, 126144, 330958, 330965, 265432, 265436, 388319, 388347, 175375, 159005, 175396, 208166, 273708, 347437, 372015, 347441, 372018, 199988, 44342, 175415, 396600, 437566, 175423, 437570, 437575, 437583, 331088, 437587, 331093, 396633, 175450, 437595, 175457, 208227, 175460, 175463, 265580, 437620, 175477, 249208, 175483, 175486, 249214, 175489, 249218, 249227, 175513, 175516, 396705, 175522, 355748, 380332, 396722, 388542, 372163, 216517, 380360, 216522, 339404, 372176, 208337, 339412, 413141, 339417, 339420, 249308, 339424, 339428, 339434, 249328, 69113, 372228, 208398, 380432, 339503, 265778, 265795, 396872, 265805, 224853, 224857, 257633, 224870, 372327, 257646, 372337, 224884, 224887, 224890, 224894, 224897, 372353, 216707, 126596, 421508, 224904, 11918, 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, 257801, 339721, 257804, 225038, 257807, 225043, 372499, 225048, 257819, 225053, 184094, 225058, 257833, 225066, 257836, 413484, 225070, 225073, 372532, 225079, 397112, 225082, 397115, 225087, 225092, 225096, 323402, 257868, 225103, 257871, 397139, 225108, 225112, 257883, 257886, 225119, 257890, 339814, 225127, 257896, 274280, 257901, 225137, 257908, 225141, 257912, 225148, 257916, 257920, 225155, 339844, 225165, 397200, 225170, 380822, 225175, 225180, 118691, 184244, 372664, 372702, 372706, 356335, 380918, 372738, 405533, 430129, 266294, 421960, 356439, 430180, 421990, 266350, 356466, 266362, 381068, 225423, 250002, 250004, 225429, 356506, 225437, 135327, 225441, 438433, 192673, 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, 225514, 225518, 372976, 381176, 397571, 389380, 356637, 356640, 356643, 356646, 266536, 356649, 356655, 332080, 340275, 356660, 397622, 332090, 225597, 332097, 348488, 332106, 348502, 250199, 250202, 332125, 250210, 332152, 389502, 250238, 356740, 332172, 373145, 340379, 389550, 324030, 266687, 127471, 340472, 324094, 266754, 324111, 340500, 381481, 356907, 324142, 356916, 324149, 324155, 348733, 324164, 356934, 348743, 381512, 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, 348978, 152370, 340789, 348982, 398139, 127814, 357201, 357206, 389978, 430939, 357211, 357214, 201579, 201582, 349040, 340849, 201588, 430965, 381813, 324472, 398201, 340858, 324475, 430972, 340861, 324478, 119674, 324481, 373634, 398211, 324484, 324487, 381833, 324492, 324495, 324498, 430995, 324501, 324510, 422816, 324513, 398245, 201637, 324524, 340909, 324533, 324538, 324541, 398279, 340939, 340941, 209873, 340957, 431072, 398306, 340963, 209895, 201711, 349172, 381946, 349180, 439294, 431106, 209943, 357410, 250914, 185380, 357418, 209965, 209968, 209971, 209975, 209979, 209987, 209990, 209995, 341071, 349267, 250967, 210010, 341091, 210025, 210027, 210030, 210036, 210039, 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, 275712, 275715, 275721, 349459, 333078, 251160, 349484, 349491, 251189, 415033, 251210, 357708, 210260, 365911, 259421, 365921, 333154, 251235, 374117, 333162, 234866, 390516, 333175, 357755, 136590, 374160, 112020, 349590, 357792, 259515, 415166, 415185, 366034, 366038, 415191, 415193, 415196, 415199, 423392, 333284, 415207, 366056, 366061, 415216, 210420, 415224, 423423, 415257, 415263, 366117, 415270, 144939, 415278, 415281, 415285, 210487, 415290, 415293, 349761, 415300, 333386, 366172, 333413, 423528, 423532, 210544, 415353, 333439, 415361, 267909, 333498, 210631, 333511, 358099, 153302, 333534, 366307, 366311, 431851, 366318, 210672, 366321, 366325, 210695, 268041, 210698, 366348, 210706, 399128, 210719, 358191, 366387, 210739, 399159, 358200, 325440, 366401, 341829, 325446, 46920, 341834, 341838, 341843, 415573, 341851, 350045, 399199, 259938, 399206, 268143, 358255, 399215, 358259, 341876, 243579, 325504, 333698, 333708, 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, 374902, 432271, 334011, 260289, 260298, 350410, 350416, 350422, 211160, 350425, 268507, 334045, 350445, 375026, 358644, 350458, 350461, 350464, 325891, 350467, 350475, 375053, 268559, 350480, 432405, 350486, 325914, 350490, 325917, 350493, 350498, 194852, 350504, 358700, 391468, 350509, 358704, 358713, 358716, 383306, 334161, 383321, 383330, 383333, 391530, 383341, 334203, 268668, 194941, 391563, 366990, 416157, 342430, 268701, 375208, 375216, 334262, 334275, 326084, 358856, 195039, 334304, 334311, 375277, 334321, 350723, 186897, 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, 260801, 350917, 391894, 154328, 416473, 64230, 342766, 375535, 203506, 342776, 391937, 391948, 375568, 326416, 375571, 375574, 162591, 326441, 383793, 326451, 326454, 326460, 260924, 375612, 244540, 326467, 244551, 326473, 326477, 326485, 416597, 326490, 326502, 375656, 433000, 326507, 326510, 211825, 211831, 351097, 392060, 359295, 351104, 342915, 236430, 342930, 392091, 400285, 252836, 359334, 400306, 351168, 359361, 326598, 359366, 359382, 359388, 383967, 343015, 359407, 261108, 244726, 261111, 383997, 261129, 359451, 261147, 211998, 261153, 261159, 359470, 359476, 343131, 384098, 384101, 384107, 367723, 187502, 343154, 384114, 212094, 351364, 384135, 384139, 384143, 351381, 384160, 384168, 367794, 384181, 367800, 384191, 351423, 326855, 244937, 253130, 343244, 146642, 359649, 343270, 351466, 351479, 343306, 261389, 359694, 253200, 261393, 384275, 245020, 245029, 171302, 351534, 376110, 245040, 425276, 384323, 212291, 343365, 212303, 367965, 343393, 343398, 367980, 425328, 343409, 253303, 154999, 343417, 327034, 245127, 384397, 245136, 245142, 245145, 343450, 245148, 245151, 245154, 245157, 245162, 327084, 359865, 384443, 146876, 327107, 384453, 327110, 327115, 327117, 359886, 359890, 343507, 368092, 343534, 343539, 368119, 343544, 368122, 409091, 359947, 359955, 359983, 343630, 179802, 327275, 245357, 138864, 155254, 155273, 368288, 245409, 425638, 425649, 155322, 425662, 155327, 155351, 155354, 212699, 155363, 245475, 155371, 245483, 409335, 155393, 155403, 155422, 360223, 155438, 155442, 155447, 155461, 360261, 376663, 155482, 261981, 425822, 155487, 376671, 155490, 155491, 327531, 261996, 376685, 261999, 262002, 327539, 425845, 147317, 262005, 262008, 262011, 155516, 155521, 155525, 360326, 376714, 155531, 262027, 262030, 262033, 262036, 262039, 262042, 155549, 262045, 262048, 262051, 327589, 155559, 155562, 155565, 393150, 393169, 384977, 155611, 155619, 253923, 155621, 253926, 204784, 393203, 360438, 253943, 393206, 393212, 155646 ]
44fc7ab257a4b6b80050b0c42f63fda7ed671117
9a7df9af09fd6df08781f63a1dcb59b52c1427f8
/Weather App/Tools/Double/Double + Extension .swift
6b80ac5ca35604c666a08bde8e236442b7f76ac5
[]
no_license
araceliriesgo/WeatherApp
7eb7f1fa0af0358674c174f8bd87f0bec14efabf
ccc7c567112bbabb485f78229ca4f3271d598f32
refs/heads/master
2023-03-02T10:13:09.626249
2020-09-21T15:53:02
2020-09-21T15:53:02
337,746,517
0
0
null
null
null
null
UTF-8
Swift
false
false
486
swift
// // Double + Extension .swift // Weather App // // Created by Tarek on 19/09/2020. // Copyright © 2020 Tarruk. All rights reserved. // import Foundation import UIKit extension Double { func getDateStringFromUTC() -> String { let date = Date(timeIntervalSince1970: self) let dateFormatter = DateFormatter() dateFormatter.locale = Locale.current dateFormatter.dateStyle = .medium return dateFormatter.string(from: date) } }
[ -1 ]
4323b0da9e6d5a5bffabbe8c558396f5a9ff2a2b
33c923268439b3a01ce7520efc2a0cd4d82becf6
/Parstagram/PostTableViewCell.swift
be2e4becf1fa788c1476be0b7603d49fbd53b513
[]
no_license
davidruiz1023/Parstagram
f0f213c75770a84f653b18d3354399a8d12e6132
943099a6168273398e4b7eb237d8af7d890ed8f1
refs/heads/main
2022-12-31T19:18:08.153616
2020-10-20T06:27:27
2020-10-20T06:27:27
303,625,810
0
0
null
null
null
null
UTF-8
Swift
false
false
581
swift
// // PostTableViewCell.swift // Parstagram // // Created by David Ruiz on 10/13/20. // import UIKit class PostTableViewCell: UITableViewCell { @IBOutlet weak var photoView: UIImageView! @IBOutlet weak var usernameLabel: UILabel! @IBOutlet weak var captionLabel: UILabel! override func awakeFromNib() { super.awakeFromNib() // Initialization code } override func setSelected(_ selected: Bool, animated: Bool) { super.setSelected(selected, animated: animated) // Configure the view for the selected state } }
[ 403072, 233857, 384002, 206343, 241159, 131721, 241160, 34318, 34319, 34320, 225040, 298255, 298258, 372750, 372753, 312598, 320790, 372754, 311704, 139419, 67356, 328221, 336156, 336159, 336160, 131745, 336161, 345634, 131748, 336164, 345635, 148647, 356391, 111912, 311211, 287022, 327344, 305202, 110387, 313522, 258998, 166583, 292919, 310839, 313528, 313529, 313530, 399679, 300356, 157512, 302922, 380242, 430546, 430547, 215125, 346078, 281183, 131808, 350050, 317283, 131814, 213094, 131817, 375532, 115311, 317296, 177015, 112499, 317302, 167415, 233853, 201727 ]
f7df20bb516e6ef062f42e02cd99b3d8e6dea4c3
1abc138d22260561452e89f8edf80642fd50dccb
/SwiftUI-Animations/SwiftUI-Animations/AnimatedStepperView.swift
28b66eb9a4e098f4dcc25dd29864029d4125ddc0
[]
no_license
barclayd/iOS-Mini-Apps
6722126ecf3871b3e5bf77c5643c96c89df76ce7
843e486cf7643ae643c6775c0dfa50881870c912
refs/heads/master
2020-05-30T13:14:52.788926
2020-01-03T13:18:57
2020-01-03T13:18:57
189,756,121
2
3
null
2020-01-03T13:18:58
2019-06-01T16:44:46
Swift
UTF-8
Swift
false
false
927
swift
// // AnimatedStepperView.swift // SwiftUI-Animations // // Created by Daniel Barclay on 31/12/2019. // Copyright © 2019 Daniel Barclay. All rights reserved. // import SwiftUI struct AnimatedStepperView: View { @State private var animationAmount: CGFloat = 1 var body: some View { VStack { Stepper("Scale amount", value: $animationAmount.animation( Animation.easeInOut(duration: 1).repeatCount(3, autoreverses: true) ), in: 1...10) Spacer() Button("Tap Me") { self.animationAmount += 1 } .padding() .background(Color.red) .foregroundColor(.white) .clipShape(Circle()) .scaleEffect(animationAmount) } } } struct AnimatedStepperView_Previews: PreviewProvider { static var previews: some View { AnimatedStepperView() } }
[ -1 ]
9e9806fe2b44c1690ea48dbcf864a2d0d10b878d
73746d8a097fdd4264d68023f539827dcc29ec04
/UbUTT/Core/HaversineCalculator.swift
4858df6327bb6a27fdfaad450ac5499859a148c0
[]
no_license
BourdelatGuillaume/BourdelatPieret-UbUTT
6be651fedc032757811e73aab8256c6d80089726
0656646452a79b7c58b8872f40cee60080de8e50
refs/heads/master
2020-09-18T12:10:55.905893
2019-12-19T13:39:54
2019-12-19T13:39:54
224,146,727
0
0
null
null
null
null
UTF-8
Swift
false
false
1,071
swift
/** * This is the implementation Haversine Distance Algorithm between two places * @author ananth * R = earth’s radius (mean radius = 6,371km) Δlat = lat2− lat1 Δlong = long2− long1 a = sin²(Δlat/2) + cos(lat1).cos(lat2).sin²(Δlong/2) c = 2.atan2(√a, √(1−a)) d = R.c * */ import Foundation import GoogleMaps public class HaversineCalculator { /** * RETURN DISTANCE BETWEEN TWO POINTS IN METER * **/ public static func calculateDistance(p1: CLLocationCoordinate2D, p2: CLLocationCoordinate2D) -> Double { let latDistance = toRad(value: p2.latitude-p1.latitude); let lonDistance = toRad(value: p2.longitude-p1.longitude); let a = sin(latDistance / 2) * sin(latDistance / 2) + cos(toRad(value: p1.latitude)) * cos(toRad(value: p2.latitude)) * sin(lonDistance / 2) * sin(lonDistance / 2); return Double((Constants.earthRadiusInKM*1000))*(2 * atan2(sqrt(a), sqrt(1-a))); } private static func toRad(value: Double) -> Double{ return value * Double.pi / 180; } }
[ -1 ]