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
100d19af4cfbb60d4c9cf5c3aba6a1cf1860303a
2d100dd3316d811f9e049ac5de03687f73ade0f8
/Pokedex/Network/PokemonNetwork.swift
ded38009abe91879ddb1d1f330e65e6c91d0a2f5
[]
no_license
jonnattanChoque/pokedex
34a275c37cf66cc0f23ac08e3c49b8740dab07b2
153d7f91ec1c5fa61258f6007450cef83cefbaf5
refs/heads/master
2022-12-15T01:03:19.881612
2020-09-14T18:36:05
2020-09-14T18:36:05
295,297,330
1
0
null
null
null
null
UTF-8
Swift
false
false
1,649
swift
// // PokemonNetwork.swift // Pokedex // // Created by MacBook Retina on 12/09/20. // Copyright © 2020 Twon. All rights reserved. // import Foundation class PokemonNetwork{ func search(offset: Int){ ApiRequest.sharedInstance.getData(dec: Pokemons.self, endpoint: "pokemon/?limit=50&offset=\(offset)") { (data) in let result:[String: Pokemons] = ["result": data as! Pokemons]; DispatchQueue.main.async { NotificationCenter.default.post(name:Notification.Name(rawValue:Common.Notifications.Pokemon.searchNotificationSuccess),object:nil,userInfo:result) } } } func detail(id: Int){ ApiRequest.sharedInstance.getData(dec: myPokemon.self, endpoint: "pokemon/\(id)") { (data) in let myPokemon = data as! myPokemon let result:[String: myPokemon] = ["result": myPokemon]; DispatchQueue.main.async { NotificationCenter.default.post(name:Notification.Name(rawValue:Common.Notifications.Pokemon.detailNotificationSuccess),object:nil,userInfo:result) } } } func specie(id: Int){ ApiRequest.sharedInstance.getData(dec: Specie.self, endpoint: "pokemon-species/\(id)") { (data) in let specie = data as! Specie let result:[String: Specie] = ["result": specie]; DispatchQueue.main.async { NotificationCenter.default.post(name:Notification.Name(rawValue:Common.Notifications.Pokemon.specieNotificationSuccess),object:nil,userInfo:result) } } } }
[ -1 ]
7c62ad02e6b64ba8ece3b5a9221307335ba308dd
c92c4a52cfc765f4bc85d9ee2864cdda544b647e
/IWOHIntents/CreatePostIntentHandler.swift
82d3d4aedf057b242d48dc942626fbd541c95e76
[]
no_license
chrislemke/IWOH
593349a17bb6a3bfad53379beceee55c537f18d9
9830193412a699d20f50b56d1ac8dbbc2238ab5b
refs/heads/master
2023-06-20T03:49:55.187019
2021-07-16T18:21:52
2021-07-16T18:21:52
null
0
0
null
null
null
null
UTF-8
Swift
false
false
2,524
swift
import Intents import Combine import IWOHInteractionKit final class CreatePostIntentHandler: NSObject, CreatePostIntentHandling { private var cancellableSet = Set<AnyCancellable>() private let firestoreManager = FirestoreManager() private let mlManager = MLManager() private let authenticationManager = AuthenticationManager() private var locationManager: LocationManager? override init() { super.init() OperationQueue.main.addOperation { self.locationManager = LocationManager() } } // MARK: - Public func handle(intent: CreatePostIntent, completion: @escaping (CreatePostIntentResponse) -> ()) { authenticationManager.configureAccessGroup() OperationQueue.main.addOperation { [weak self] in guard let self = self, let locationManager = self.locationManager, let message = intent.message else { completion(CreatePostIntentResponse(code: .failure, userActivity: nil)) return } switch locationManager.location { case .error, .unspecified: completion(CreatePostIntentResponse(code: .failureNoLocation, userActivity: nil)) return case .location(let location): self.mlManager.detectLanguage(for: message).map { languageCode in Post(message: message, location: location, heading: nil, date: Date(), languageCode: languageCode, likes: 0, creatorID: self.authenticationManager.currentUserID ?? "") }.flatMap { post in self.firestoreManager.add(FirestorePost(post: post)) }.sink { submissionState in switch submissionState { case .error, .unspecified: completion(CreatePostIntentResponse(code: .failureSubmitting, userActivity: nil)) return case .success: completion(CreatePostIntentResponse(code: .success, userActivity: nil)) } }.store(in: &self.cancellableSet) } TrackingManager.track(.createPostIntentCTA) } } // swiftlint:disable:next line_length func resolveMessage(for intent: CreatePostIntent, with completion: @escaping (CreatePostMessageResolutionResult) -> ()) { guard let message = intent.message else { completion(CreatePostMessageResolutionResult.needsValue()) return } if message.count > maxMessageLength { completion(CreatePostMessageResolutionResult.unsupported(forReason: .textToLong)) } else if message.count == 0 { completion(CreatePostMessageResolutionResult.unsupported(forReason: .textToShort)) } completion(CreatePostMessageResolutionResult.success(with: message)) } }
[ -1 ]
344819336f03ae478acc709df7b26dd24d40901d
ea4f34fa8f7c96d92ec4bf5879b89696ef0bde21
/STab/here/FSPersonalCenterTVC.swift
9cd80d3438814835528f9dc15b5849b9aaad3d38
[]
no_license
dingyongg/STab
80f5d14232e53e212e78817fc4401547f774a8cb
0466ba6e0d63864f5c3eef8343fea4b07e5d86a1
refs/heads/master
2023-02-28T01:41:52.139907
2021-02-05T07:35:18
2021-02-05T07:35:18
335,481,795
2
0
null
null
null
null
UTF-8
Swift
false
false
3,659
swift
import UIKit class FSPersonalCenterTVC: UIViewController { var segment:FSPersonalCenterSegment? lazy var segmentV: UIView = { let c = UIView.init(frame: CGRect.init(x: 0, y: 0, width: view.bounds.width, height: 70 )) c.backgroundColor = .white let path = UIBezierPath.init(roundedRect: c.bounds, byRoundingCorners: [UIRectCorner.topRight, UIRectCorner.topLeft], cornerRadii: CGSize.init(width: 12.0, height: 12.0)) let maskLayer = CAShapeLayer() maskLayer.frame = c.bounds maskLayer.path = path.cgPath c.layer.mask = maskLayer let s = FSPersonalCenterSegment.init(frame: CGRect.init(x: 20, y: 15, width: c.bounds.width-40, height: c.bounds.height-30)) s.titlesA = ["Tab1", "Tab2", "Tab3"] s.selectedIndex = 0 s.delegate = self self.segment = s c.addSubview(s) return c }() lazy var tableView: FSPersonalCenterTV = { let v = FSPersonalCenterTV.init(frame: CGRect.init(x: 0, y: 0, width: view.bounds.width, height: SCREEN_HEIGHT)) v.backgroundColor = THEME_COLOR_PURPLE v.delegate = self v.dataSource = self return v }() lazy var headerV: UIView = { let v = UIView.init(frame: CGRect.init(x: 0, y: 0, width: SCREEN_WIDTH, height: 240)) return v }() lazy var footerV: FSPersnalCenterFooterV = { let v = FSPersnalCenterFooterV.init(frame: CGRect.init(x: 0, y: 0, width: SCREEN_WIDTH, height: self.view.bounds.height - segmentV.bounds.height)) v.delegate = self return v }() override func viewDidLoad() { super.viewDidLoad() view.addSubview(tableView) self.tableView.tableHeaderView = self.headerV self.tableView.tableFooterView = self.footerV //核心代码 FSPersonalCenterScrollerManager.shared.mainScroller = self.tableView } } extension FSPersonalCenterTVC: FSPersonalCenterSegmentDelegate, FSPersnalCenterFooterVDelegate{ func footer(_ footer: FSPersnalCenterFooterV, didScrollTo index: Int) { segment?.selectedIndex = index } func segmentDidSelected(_ index: Int) { self.footerV.scrollTo(index, animated: true) } } extension FSPersonalCenterTVC: UITableViewDelegate, UITableViewDataSource { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return 0 } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "", for: indexPath) return cell } func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { return self.segmentV } func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? { return nil } func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { if tableView == self.tableView { return 70 }else{ return 0 } } func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat { return 0 } //核心代码 func scrollViewDidScroll(_ scrollView: UIScrollView) { if scrollView.contentOffset.y >= self.headerV.bounds.height { scrollView.contentOffset = CGPoint.init(x: 0, y: self.headerV.bounds.height) FSPersonalCenterScrollerManager.shared.disnableScroll(scrollView) } } }
[ -1 ]
afe61ca7335c01869aa472050e993c674eed6909
b5a2741be1853f6e2caafcbb66fcd652c45bb175
/Mygro/MyGroCore/Managers/HomeManager.swift
ed68032aafd8f57360a4da18513c81ea54cb6a0d
[]
no_license
Vollan/MyGro
52071a38ec815bb9319ccc98e0b1944075ced83b
c8a78a6aaa6896e1ee1e315844fc140e1e794cc0
refs/heads/master
2020-05-03T02:36:43.804132
2019-03-29T09:38:25
2019-03-29T09:38:25
178,374,726
0
0
null
null
null
null
UTF-8
Swift
false
false
559
swift
// // HomeManager.swift // MyGro // // Created by Emil Sandström on 2017-09-06. // Copyright © 2017 Emil Sandström. All rights reserved. // import Foundation class UserManager { var seedsFetchedSuccessfully: (([Seed]) -> ())? public func getSeeds() { if let object = ReadFile.getContentOfFile(named: "Seeds") { guard let seeds = (object["Seeds"] as? [[String: Any]])?.flatMap({Seed(withDictionary: $0)}) else { return } seedsFetchedSuccessfully?(seeds) } } }
[ -1 ]
f03f8a79e0cac8c4a11526d7656eb57f6238a12d
e75d4631cb3456270b418e417e5822c27245c644
/iQuiz/FinishViewController.swift
df1fd001dab5293582b264e213548c63af99515d
[]
no_license
muhaamed/iQuiz
f10d0ce216259c74e63b122b4721509d33834146
4ae9541ce11e0dd9a10d85a23466fe14f39508af
refs/heads/master
2021-01-20T04:25:06.810741
2017-05-09T08:47:02
2017-05-09T08:47:02
89,683,847
0
0
null
null
null
null
UTF-8
Swift
false
false
2,332
swift
// // FinishViewController.swift // iQuiz // // Created by Muhaamed Drammeh on 5/6/17. // Copyright © 2017 Muhaamed Drammeh. All rights reserved. // import UIKit class FinishViewController: UIViewController { public static var numberOfMissedQuestions = 0 @IBOutlet weak var label: UILabel! @IBAction func finishButton(_ sender: UIButton) { FinishViewController.numberOfMissedQuestions = 0 let warningAlert = UIAlertController(title: "Warning", message: "Are you sure you want to return to home page", preferredStyle: UIAlertControllerStyle.alert) warningAlert.addAction(UIAlertAction(title: "YES", style: .default, handler: { (action: UIAlertAction!) in QuestionViewController.arrayOfButton = [] QuestionViewController.numberOfQuestion = 0 QuestionViewController.currentNumberOfQuestion = 0 QuestionViewController.fetchedQuizOnQuestionViewController = [] AnswerViewController.quizQuestion = [] AnswerViewController.fetchedQuestionsOnAnswerViewController = [] self.navigationController?.popToRootViewController(animated: false) })) warningAlert.addAction(UIAlertAction(title: "NO", style: .cancel, handler:nil)) present(warningAlert, animated: true, completion: nil) //self.navigationController?.popToRootViewController(animated: false) } override func viewDidLoad() { super.viewDidLoad() label.text = "You answered \(QuestionViewController.numberOfQuestion - FinishViewController.numberOfMissedQuestions) of \(QuestionViewController.numberOfQuestion) question correctly" self.navigationItem.hidesBackButton = true // Do any additional setup after loading the view. } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } /* // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepare(for segue: UIStoryboardSegue, sender: Any?) { // Get the new view controller using segue.destinationViewController. // Pass the selected object to the new view controller. } */ }
[ -1 ]
7520c5d6ac5af5d32ad11fa016313cedb35e4522
6560d39538b971edf17cf41f77d14c725cad7301
/CountriesApp/Sources/CountriesApp/Modules/CountryDetails/Presenter/CountryDetailsPresenter.swift
df982123ff4ec330bd1129607de751b076eb180f
[ "MIT" ]
permissive
ImKuz/CountriesApp
7c13844b79e10f41bf4b81a261ee6c31fc3e726d
c428b382d4cad9f054b268bc680fb4a127490b32
refs/heads/main
2023-01-22T03:16:40.853085
2020-12-06T22:14:09
2020-12-06T22:14:09
318,664,816
0
0
null
null
null
null
UTF-8
Swift
false
false
1,295
swift
import Model final class CountryDetailsPresenter: CountryDetailsPresenterOutput { typealias SectionsFactory = CountryDetailsSectionsFactory weak var snapshotProvider: CountryDetailsSnapshotProvider? var onSnapshotUpdate: ((CountryDetailsDataSnapshot) -> Void)? var onTitleSetup: ((String) -> Void)? } extension CountryDetailsPresenter: CountryDetailsPresenterInput { func configureInitialState(with model: CountryModel) { guard var snapshot = snapshotProvider?.currentSnapshot else { return } snapshot.appendSections(CountryDetailsTableViewSection.allCases) snapshot.appendItems([.loader], toSection: .borders) SectionsFactory .makeContentSecitons(from: model) .forEach { snapshot.appendItems($0.rows, toSection: $0.section) } onTitleSetup?(model.name) onSnapshotUpdate?(snapshot) } func configureBorders(with names: [String]) { guard var snapshot = snapshotProvider?.currentSnapshot else { return } if let data = SectionsFactory.makeBordersSection(from: names) { snapshot.appendItems(data.rows, toSection: data.section) } snapshot.deleteItems([.loader]) onSnapshotUpdate?(snapshot) } }
[ -1 ]
9dba768deb47f71ac91560bbb5de3a2a6eac39d4
d863d14832337eed45040a827c30c835907f0da2
/datastructuresTests/datastructuresTests.swift
44496863f81b0adf1f686b5f7c96d6eb5b00db3f
[]
no_license
aryan114/ds1
4cbbf962974c1c198054a7c31ba8161ce063e0c3
f164679f8897490e4866ec1b4c9aeb696fb895ee
refs/heads/master
2021-03-20T13:41:59.411984
2020-03-22T01:35:31
2020-03-22T01:35:31
247,210,960
0
0
null
null
null
null
UTF-8
Swift
false
false
937
swift
// // datastructuresTests.swift // datastructuresTests // // Created by Amberkar, Aryan on 3/13/20. // Copyright © 2020 Aryan Amberkar. All rights reserved. // import XCTest @testable import datastructures class datastructuresTests: XCTestCase { override func setUp() { // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. } func testExample() { // This is an example of a functional test case. // Use XCTAssert and related functions to verify your tests produce the correct results. } func testPerformanceExample() { // This is an example of a performance test case. self.measure { // Put the code you want to measure the time of here. } } }
[ 333828, 43014, 358410, 354316, 313357, 360462, 399373, 317467, 145435, 229413, 204840, 315432, 325674, 344107, 102445, 155694, 176175, 233517, 346162, 129076, 241716, 229430, 243767, 163896, 180280, 358456, 288828, 436285, 376894, 288833, 288834, 436292, 403525, 352326, 225351, 315465, 436301, 338001, 196691, 338003, 280661, 329814, 307289, 385116, 237663, 254048, 315487, 356447, 280675, 280677, 43110, 319591, 321637, 436329, 194666, 221290, 438377, 260207, 432240, 204916, 233589, 266357, 131191, 215164, 215166, 422019, 280712, 415881, 104587, 235662, 241808, 381073, 196760, 284826, 426138, 346271, 436383, 362659, 299174, 333991, 333996, 239793, 377009, 405687, 182456, 295098, 258239, 379071, 389313, 299203, 149703, 299209, 346314, 372941, 266449, 321745, 139479, 229597, 194782, 301279, 311519, 317664, 280802, 379106, 387296, 346346, 205035, 307435, 321772, 438511, 381172, 436470, 327929, 243962, 344313, 184575, 149760, 375039, 411906, 147717, 368905, 325905, 254226, 272658, 368916, 262421, 325912, 381208, 377114, 151839, 237856, 237857, 233762, 211235, 217380, 432421, 211238, 338218, 311597, 358703, 321840, 98610, 332083, 379186, 332085, 358709, 180535, 336183, 332089, 321860, 332101, 438596, 323913, 348492, 323920, 344401, 366930, 377169, 348500, 368981, 155990, 289110, 368984, 168281, 215385, 332123, 332127, 98657, 383332, 242023, 383336, 270701, 160110, 242033, 270706, 354676, 139640, 291192, 211326, 436608, 362881, 240002, 436611, 311685, 225670, 317831, 106888, 340357, 242058, 385417, 373134, 385422, 108944, 252308, 190871, 213403, 149916, 121245, 242078, 420253, 141728, 315810, 315811, 381347, 289189, 108972, 272813, 340398, 385454, 377264, 342450, 338356, 436661, 293303, 311738, 33211, 293310, 336320, 311745, 127427, 416197, 254406, 188871, 324039, 129483, 342476, 373197, 289232, 328152, 256477, 287198, 160225, 342498, 358882, 334309, 391655, 330218, 432618, 375276, 319981, 291311, 254456, 377338, 377343, 174593, 254465, 291333, 340490, 139792, 420369, 303636, 258581, 393751, 416286, 377376, 207393, 375333, 377386, 244269, 197167, 375343, 385588, 289332, 234036, 375351, 174648, 338489, 338490, 244281, 315960, 242237, 348732, 70209, 115270, 70215, 293448, 55881, 301638, 309830, 348742, 348749, 381517, 385615, 426576, 369235, 416341, 297560, 332378, 201308, 416351, 139872, 436832, 436834, 268899, 111208, 39530, 184940, 373358, 420463, 346737, 389745, 313971, 139892, 346740, 420471, 287352, 344696, 209530, 244347, 373375, 152195, 311941, 336518, 348806, 311945, 369289, 330379, 344715, 311949, 287374, 326287, 375440, 316049, 311954, 334481, 117396, 111253, 316053, 346772, 230040, 264856, 111258, 111259, 271000, 289434, 303771, 205471, 318106, 318107, 342682, 139939, 344738, 377500, 176808, 205487, 303793, 318130, 299699, 293556, 336564, 383667, 314040, 287417, 39614, 287422, 377539, 422596, 422599, 291530, 225995, 363211, 164560, 242386, 334547, 385747, 361176, 418520, 422617, 287452, 363230, 264928, 422626, 375526, 234217, 330474, 342762, 293612, 342763, 289518, 299759, 369385, 377489, 312052, 154359, 172792, 344827, 221948, 432893, 205568, 162561, 291585, 295682, 430849, 291592, 197386, 383754, 62220, 117517, 434957, 322319, 422673, 377497, 430865, 166676, 291604, 310036, 197399, 207640, 422680, 426774, 426775, 326429, 293664, 326433, 197411, 400166, 289576, 293672, 295724, 152365, 197422, 353070, 164656, 295729, 422703, 191283, 422709, 152374, 197431, 273207, 375609, 160571, 289598, 160575, 336702, 430910, 160580, 252741, 381773, 201551, 293711, 353109, 377686, 244568, 230234, 189275, 244570, 435039, 295776, 242529, 349026, 357218, 303972, 385893, 342887, 308076, 242541, 330609, 246643, 207732, 295798, 361337, 177019, 185211, 308092, 398206, 400252, 291712, 158593, 254850, 359298, 260996, 359299, 113542, 369538, 381829, 316298, 392074, 295824, 224145, 349072, 355217, 256922, 289690, 318364, 390045, 310176, 185250, 310178, 420773, 185254, 289703, 293800, 140204, 236461, 363438, 347055, 377772, 304051, 326581, 373687, 326587, 230332, 377790, 289727, 273344, 330689, 353215, 363458, 379844, 213957, 19399, 326601, 345033, 373706, 316364, 359381, 386006, 418776, 433115, 248796, 343005, 50143, 347103, 123881, 326635, 187374, 383983, 347123, 240630, 271350, 201720, 127992, 295927, 349175, 328700, 318461, 293886, 257024, 328706, 330754, 320516, 293893, 295942, 357379, 386056, 410627, 353290, 330763, 377869, 433165, 384016, 238610, 308243, 330772, 418837, 140310, 433174, 252958, 369701, 357414, 248872, 238639, 300084, 312373, 203830, 359478, 238651, 308287, 377926, 218186, 314448, 341073, 339030, 439384, 304222, 392290, 253029, 257125, 300135, 316520, 273515, 173166, 357486, 144496, 351344, 404593, 377972, 285814, 291959, 300150, 300151, 363641, 160891, 363644, 300158, 377983, 392318, 150657, 248961, 384131, 349316, 402565, 349318, 302216, 330888, 386189, 373903, 169104, 177296, 326804, 363669, 238743, 119962, 300187, 300188, 339100, 351390, 199839, 380061, 429214, 265379, 300201, 249002, 253099, 253100, 238765, 3246, 300202, 306346, 238769, 318639, 402613, 367799, 421048, 373945, 113850, 294074, 302274, 367810, 259268, 265412, 353479, 402634, 283852, 259280, 290000, 316627, 333011, 189653, 419029, 148696, 296153, 304351, 195808, 298208, 310497, 298212, 298213, 222440, 330984, 328940, 298221, 298228, 302325, 234742, 386294, 128251, 386301, 261377, 320770, 386306, 437505, 322824, 439562, 292107, 328971, 414990, 353551, 251153, 177428, 349462, 257305, 320796, 222494, 253216, 339234, 372009, 412971, 353584, 261425, 351537, 382258, 345396, 300343, 386359, 312634, 312635, 378172, 286013, 306494, 382269, 216386, 312648, 337225, 304456, 230729, 146762, 224586, 177484, 294218, 259406, 234831, 238927, 294219, 331090, 353616, 406861, 318805, 314710, 372054, 425304, 159066, 374109, 314720, 378209, 163175, 333160, 386412, 380271, 327024, 296307, 116084, 208244, 249204, 316787, 290173, 306559, 314751, 318848, 337281, 148867, 357762, 253317, 298374, 314758, 314760, 142729, 296329, 368011, 384393, 388487, 314766, 296335, 318864, 112017, 234898, 9619, 259475, 275859, 318868, 370071, 357786, 290207, 314783, 251298, 310692, 314789, 333220, 314791, 396711, 245161, 396712, 374191, 286129, 380337, 173491, 286132, 150965, 304564, 353719, 380338, 228795, 425405, 302531, 380357, 339398, 361927, 300489, 425418, 306639, 413137, 23092, 210390, 210391, 210393, 286172, 144867, 271843, 429542, 296433, 251378, 308723, 300536, 286202, 359930, 302590, 372227, 323080, 329225, 253451, 296461, 359950, 259599, 304656, 329232, 146964, 308756, 370197, 175639, 253463, 374296, 388632, 374299, 308764, 396827, 134686, 431649, 286244, 245287, 402985, 394794, 245292, 169518, 347694, 431663, 288309, 312889, 194110, 349763, 196164, 265798, 288327, 218696, 292425, 128587, 265804, 333388, 396882, 128599, 179801, 44635, 239198, 343647, 333408, 396895, 99938, 300644, 323172, 310889, 415338, 243307, 312940, 54893, 204397, 138863, 188016, 222832, 325231, 224883, 314998, 323196, 325245, 337534, 337535, 339584, 263809, 294529, 194180, 288392, 229001, 415375, 188048, 239250, 419478, 425626, 302754, 153251, 298661, 40614, 300714, 210603, 224946, 337591, 384695, 110268, 415420, 224958, 327358, 333503, 274115, 259781, 306890, 403148, 212685, 333517, 9936, 9937, 241361, 302802, 333520, 272085, 345814, 370388, 384720, 345821, 321247, 298720, 321249, 325346, 153319, 325352, 345833, 345834, 212716, 212717, 360177, 67315, 173814, 325371, 288512, 319233, 339715, 288516, 360195, 339720, 243472, 372496, 323346, 321302, 345879, 366360, 398869, 325404, 286494, 321310, 255776, 339745, 257830, 421672, 362283, 378668, 399147, 431916, 300848, 409394, 296755, 259899, 319292, 360252, 325439, 345919, 436031, 403267, 153415, 360264, 345929, 341836, 415567, 325457, 317269, 18262, 216918, 241495, 341847, 362327, 346779, 350044, 128862, 245599, 345951, 362337, 376669, 345955, 425825, 296806, 292712, 425833, 423789, 214895, 313199, 362352, 325492, 276341, 417654, 341879, 241528, 317304, 333688, 112509, 55167, 182144, 325503, 305026, 339841, 188292, 333701, 243591, 315273, 315274, 325518, 372626, 380821, 329622, 294807, 337815, 333722, 376732, 118685, 298909, 311199, 319392, 350109, 292771, 436131, 294823, 415655, 436137, 327596, 362417, 323507, 243637, 290745, 294843, 188348, 362431, 237504, 294850, 274371, 384964, 214984, 151497, 362443, 344013, 212942, 301008, 153554, 24532, 372701, 329695, 436191, 292836, 292837, 298980, 313319, 317415, 380908, 436205, 311281, 311282, 325619, 432116, 292858, 415741, 352917 ]
5bdec816d269e139da50107855e38ac21a045146
761d93a3deee89a44bf3635bc12fdf708e3c45bd
/thedeathnote/UI/List/ListTableViewCell.swift
4681a16c2b45d31029b1e41fee7b4a74f9727b2b
[]
no_license
charleyfromage/deathnote
29f87960cdafa7b4507d81e46dd5998f17e491d5
0e547458731b7737ea6760e7402a5cb9a5ba67ad
refs/heads/master
2021-04-18T19:19:47.978922
2018-03-26T10:06:21
2018-03-26T10:06:21
126,809,446
0
0
null
null
null
null
UTF-8
Swift
false
false
541
swift
// // ListTableViewCell.swift // thedeathnote // // Created by Charley on 23/03/2018. // Copyright © 2018 Charley. All rights reserved. // import UIKit fileprivate let cellIdentifier = "cellIdentifier" class ListTableViewCell: UITableViewCell { override func awakeFromNib() { super.awakeFromNib() } override func setSelected(_ selected: Bool, animated: Bool) { super.setSelected(selected, animated: animated) } static func identifier() -> String { return cellIdentifier } }
[ -1 ]
19b89ad6b5714149c1de7d478774e055003c4f80
9482e6db80fe5567ab6f39b8d2e3d251bfd8b799
/Networking/Image Request/Image Request/ViewController.swift
8154e79dcbec0410aa839bea34a0c5c1d14e1ed8
[]
no_license
majd-asab/iOS
47ed19e4f68ef4ef73aec8178a567e817e0f8e41
9f606f6b00baef46a876db2e248459dd9af67f7f
refs/heads/master
2020-04-05T10:18:12.985327
2019-08-22T02:38:50
2019-08-22T02:38:50
156,793,698
0
0
null
2019-08-22T02:38:51
2018-11-09T01:42:40
Swift
UTF-8
Swift
false
false
2,484
swift
// // ViewController.swift // Image Request // // Created by Majd on 2019-02-13. // Copyright © 2019 HappyWorld. All rights reserved. // import UIKit enum ImageURLs: String { case http = "http://developer.apple.com/swift/images/swift-og.png" case https = "https://developer.apple.com/swift/images/swift-og.png" case none = "not a url" } class ViewController: UIViewController { let imageLocation = ImageURLs.http.rawValue @IBOutlet weak var imageView: UIImageView! @IBAction func requestButton(_ sender: UIButton) { guard let imageUrl = URL(string: self.imageLocation) else { // convert string to URL print("cannot create URL from string") return } let task = URLSession.shared.dataTask(with: imageUrl) {(data, response, error) in // check if data came back guard let data = data else { print("didn't get data back") return } // convert data to UIImage let downloadableImage = UIImage(data: data) // disptach call to update from main thread DispatchQueue.main.async { self.imageView.image = downloadableImage } } // run the task task.resume() } @IBAction func openFromFileButton(_ sender: Any) { guard let imageUrl = URL(string: self.imageLocation) else { print("cannot create URL from string") return } let task = URLSession.shared.downloadTask(with: imageUrl) {(location, response, error) in guard let location = location else { print("location not retrievable") return } do { // get data from file let imageData = try Data(contentsOf: location) // load data in UIImage let image = UIImage(data: imageData) // update storyboard DispatchQueue.main.async { self.imageView.image = image } } catch { print("error loading image from file: \(error)") } } task.resume() } override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. } }
[ -1 ]
512672fd6d15682024ae6ae331cb19c436120ed7
803f141585b0389122a6b166f3b0b34b1f36d747
/ChatApp/Supporting Files/AlertService.swift
5e2ac8dcbea1e5b5c08e77b94ac96f72c32e32f3
[]
no_license
rdscoo1/ChatApp
5339260d75936533af562b96b976a6cc4fb8bab7
1976dfd6ee8518055727a89718495c5a77925af1
refs/heads/main
2023-04-30T13:24:01.444751
2021-05-16T11:05:59
2021-05-16T11:05:59
340,110,116
0
0
null
null
null
null
UTF-8
Swift
false
false
1,120
swift
// // AlertService.swift // ChatApp // // Created by Roman Khodukin on 23.04.2021. // import UIKit class AlertService { func presentAlert(vc: UIViewController?, title: String, message: String, additionalActions: [UIAlertAction] = [], primaryHandler: ((UIAlertAction) -> Void)? = nil) { DispatchQueue.main.async { let alertController = UIAlertController(title: title, message: message, preferredStyle: .alert) alertController.addAction(.init(title: "OK", style: .cancel, handler: primaryHandler)) additionalActions.forEach { alertController.addAction($0) } vc?.present(alertController, animated: true) } } func presentErrorAlert(vc: UIViewController?, message: String = Constants.LocalizationKey.actionNotAllowed.string, handler: ((UIAlertAction) -> Void)? = nil) { presentAlert(vc: vc, title: Constants.LocalizationKey.error.string, message: message, primaryHandler: handler) } }
[ -1 ]
522d5a16d9dd6a92c3f5144457d70af57a35d289
f8dc24e839f0c14de4689d81a2b6c6bd19dde3dd
/WoocommerceClientTests/WoocommerceClientTests.swift
f67253cc71279329c43d273d207a9beeed85353a
[ "MIT" ]
permissive
VigaasVentures/iOSWoocommerceClient
2c60fb1ed0ef453e72aa92af1942b666f20288a3
2f3163f92d7ecadcd09d1d8043fc4f7360f64cbd
refs/heads/master
2021-01-21T15:58:07.032384
2017-02-21T11:21:28
2017-02-21T11:21:28
81,637,186
0
0
null
null
null
null
UTF-8
Swift
false
false
1,018
swift
// // WoocommerceClientTests.swift // WoocommerceClientTests // // Created by Damandeep Singh on 14/02/17. // Copyright © 2017 Damandeep Singh. All rights reserved. // import XCTest @testable import WoocommerceClient class WoocommerceClientTests: XCTestCase { override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. super.tearDown() } func testExample() { // This is an example of a functional test case. // Use XCTAssert and related functions to verify your tests produce the correct results. } func testPerformanceExample() { // This is an example of a performance test case. self.measure { // Put the code you want to measure the time of here. } } }
[ 360462, 98333, 278558, 229413, 204840, 344107, 360491, 155694, 229430, 319542, 180280, 163896, 376894, 286788, 352326, 311372, 311374, 196691, 385116, 237663, 254048, 319591, 221290, 278638, 204916, 131189, 131191, 131198, 311435, 311438, 196760, 426138, 196773, 377009, 131256, 295098, 139479, 229597, 311519, 205035, 286958, 327929, 344313, 147717, 368905, 254226, 368916, 262421, 377114, 278810, 237856, 237857, 311597, 98610, 262450, 180535, 336183, 287041, 287043, 139589, 311621, 344401, 377169, 368981, 155990, 368984, 98657, 270701, 270706, 139640, 311685, 106888, 385417, 385422, 213403, 385454, 377264, 278961, 278965, 278970, 311738, 33211, 336320, 311745, 278978, 254406, 188871, 278989, 278993, 328152, 287198, 188894, 279008, 279013, 319981, 279022, 279029, 254456, 377338, 377343, 279039, 254465, 287241, 279050, 303631, 139792, 303636, 393751, 377376, 180771, 377386, 197167, 385588, 115270, 377418, 385615, 426576, 369235, 295519, 139872, 66150, 295536, 287346, 139892, 287352, 344696, 279164, 189057, 303746, 311941, 336518, 311945, 369289, 344715, 311949, 287374, 377489, 311954, 352917, 230040, 271000, 377497, 303771, 221852, 377500, 205471, 344738, 139939, 279206, 205487, 295599, 303793, 336564, 230072, 287417, 303803, 287422, 66242, 377539, 287433, 164560, 385747, 279252, 361176, 418520, 287452, 369385, 230125, 312052, 230134, 172792, 344827, 221948, 279294, 205568, 295682, 197386, 434957, 295697, 426774, 197399, 426775, 197411, 262951, 279336, 312108, 295724, 197422, 353070, 164656, 295729, 262962, 353069, 230199, 197431, 336702, 295746, 353095, 353109, 377686, 230234, 189275, 435039, 279392, 295776, 303972, 385893, 246643, 295798, 361337, 279417, 254850, 369538, 213894, 295824, 279456, 279464, 140204, 377772, 353197, 304051, 230332, 287677, 377790, 353215, 213957, 345033, 279498, 386006, 418776, 50143, 123881, 304110, 287731, 271350, 295927, 312314, 328700, 328706, 410627, 320516, 295942, 386056, 230410, 353290, 377869, 238610, 418837, 140310, 230423, 197657, 189474, 369701, 238639, 312373, 238651, 230463, 377926, 296019, 304222, 230499, 173166, 156785, 312434, 377972, 377983, 279685, 402565, 386189, 296086, 238743, 296092, 238765, 279728, 238769, 402613, 230588, 279747, 353479, 402634, 279760, 189652, 189653, 419029, 148696, 296153, 279774, 304351, 304356, 222440, 328940, 279792, 386294, 386301, 320770, 386306, 328971, 353551, 320796, 222494, 304421, 353584, 345396, 386359, 378172, 304456, 230729, 312648, 337225, 222541, 296270, 238927, 353616, 296273, 222559, 378209, 230756, 386412, 230765, 296303, 296307, 116084, 181625, 337281, 148867, 296329, 296335, 230799, 9619, 370071, 279974, 173491, 304564, 279989, 353719, 296375, 296387, 361927, 296392, 296391, 280013, 312782, 222675, 239068, 280032, 271843, 280041, 296425, 296433, 280055, 296448, 230913, 329225, 296461, 149007, 304656, 329232, 370197, 230943, 402985, 394794, 288309, 312889, 280130, 288326, 288327, 280147, 239198, 99938, 312940, 222832, 337534, 337535, 263809, 288392, 239250, 419478, 198324, 296628, 337591, 321207, 280251, 403148, 9936, 9937, 370388, 272085, 345814, 67292, 345821, 321247, 321249, 345833, 345834, 288491, 280300, 239341, 313065, 419569, 67315, 173814, 313081, 288512, 288516, 321295, 321302, 345879, 321310, 255776, 362283, 378668, 296755, 280374, 280380, 345919, 436031, 403267, 345929, 18262, 362327, 280410, 345951, 362337, 345955, 296806, 288619, 288620, 280430, 214895, 313199, 362352, 313203, 182144, 305026, 67463, 329622, 337815, 214938, 247712, 436131, 436137, 362417, 362431, 214977, 280514, 214984, 362443, 231375, 280541, 329695, 436191, 313319, 296941, 436205, 43014, 354316, 313357, 305179, 313375, 354345, 346162, 288828, 436285, 288833, 288834, 436292, 403525, 280649, 436301, 338001, 338003, 223316, 280661, 329814, 223318, 288857, 280675, 280677, 43110, 321637, 436329, 223350, 215164, 215166, 280712, 141450, 215178, 346271, 436383, 362659, 239793, 182456, 280762, 223419, 379071, 149703, 346314, 321745, 387296, 280802, 379106, 346346, 321772, 436470, 157944, 149760, 411906, 272658, 338218, 321840, 379186, 280887, 321860, 280902, 289110, 215385, 321894, 280939, 354676, 199029, 313727, 436608, 362881, 240002, 436611, 280961, 240016, 108944, 190871, 149916, 420253, 141728, 289189, 289194, 108972, 272813, 338356, 436661, 281037, 289232, 256477, 281072, 174593, 420369, 223767, 223769, 207393, 289332, 174648, 338489, 338490, 281166, 297560, 436832, 436834, 420463, 346737, 313971, 346740, 420471, 330379, 133774, 117396, 117397, 346772, 264856, 289434, 346779, 166582, 289462, 314040, 199366, 363211, 289502, 363230, 264928, 330474, 289518, 322313, 117517, 322319, 166676, 207640, 289576, 191283, 273207, 289598, 281408, 281433, 330609, 207732, 158593, 224145, 355217, 256922, 289690, 289698, 420773, 289703, 363438, 347055, 289727, 273344, 330689, 363458, 379844, 19399, 52172, 183248, 248796, 347103, 183279, 347123, 314355, 240630, 257024, 330754, 330763, 281625, 281626, 175132, 330788, 248872, 207938, 314448, 339030, 281700, 257125, 322663, 207979, 273515, 404593, 363641, 363644, 150657, 248961, 330888, 363669, 339100, 380061, 429214, 199839, 339102, 330913, 306338, 265379, 249002, 306346, 3246, 421048, 208058, 339130, 265412, 290000, 298208, 363744, 298212, 298213, 290022, 330984, 298221, 298228, 208124, 437505, 322824, 257305, 339234, 199971, 372009, 412971, 298291, 306494, 216386, 224586, 331090, 314709, 314710, 372054, 159066, 224606, 314720, 142689, 281957, 281962, 306542, 380271, 208244, 249204, 290173, 306559, 314751, 298374, 314758, 314760, 142729, 388487, 281992, 314766, 306579, 290207, 314783, 314789, 282022, 314791, 396711, 396712, 282024, 380337, 380338, 150965, 380357, 339398, 306631, 306639, 413137, 429542, 306677, 290300, 290301, 372227, 306692, 306693, 323080, 192010, 175639, 388632, 282136, 396827, 282141, 134686, 306723, 347694, 290358, 265798, 282183, 265804, 396882, 290390, 306776, 44635, 396895, 323172, 282213, 224883, 314998, 323196, 339584, 192131, 290443, 323217, 282259, 298654, 282271, 282273, 282276, 298661, 282280, 224946, 306874, 110268, 224958, 282303, 274115, 306890, 241361, 282327, 216795, 298720, 323316, 339715, 216839, 339720, 282378, 372496, 323346, 339745, 241442, 257830, 421672, 159533, 282417, 200498, 307011, 282438, 216918, 241495, 307031, 282474, 241528, 339841, 315273, 315274, 110480, 372626, 380821, 282518, 282519, 44952, 298909, 118685, 298920, 323507, 290745, 290746, 274371, 151497, 372701, 298980, 380908, 290811, 282633, 307231, 102437, 315432, 102445, 233517, 176175, 282672, 241716, 159807, 225351, 315465, 315476, 307289, 315487, 356447, 438377, 233589, 266357, 422019, 241808, 381073, 299174, 299187, 405687, 184505, 299198, 258239, 389313, 299203, 299209, 372941, 266449, 307435, 438511, 233715, 381172, 184570, 168188, 184575, 184584, 381208, 282909, 299293, 151839, 282913, 233762, 217380, 282919, 332083, 332085, 332089, 315706, 438596, 332101, 323913, 348492, 323920, 348500, 168281, 332123, 332127, 323935, 242023, 160110, 242033, 291192, 340357, 225670, 242058, 373134, 291224, 242078, 61857, 315810, 381347, 61859, 315811, 340398, 299441, 299456, 291267, 127427, 324039, 373197, 160225, 291311, 233978, 291333, 340490, 283153, 258581, 291358, 283184, 234036, 315960, 348732, 242237, 70209, 348742, 70215, 348749, 381517, 332378, 201308, 242273, 111208, 184940, 373358, 389745, 209530, 291454, 373375, 184962, 152195, 348806, 152203, 316049, 111253, 316053, 111258, 111259, 176808, 299699, 299700, 422596, 422599, 291530, 225995, 225997, 242386, 226004, 226007, 422617, 422626, 226019, 234217, 299759, 234234, 299776, 291585, 242433, 430849, 234241, 209670, 291592, 226058, 234250, 62220, 234253, 422673, 430865, 291604, 234263, 422680, 234268, 234277, 283430, 234283, 152365, 234286, 422703, 234289, 422709, 152374, 234294, 160571, 234301, 430910, 160575, 160580, 234311, 234312, 299849, 381773, 234317, 201551, 234323, 234326, 234331, 242529, 349026, 357218, 234340, 234343, 234346, 308076, 242541, 234355, 234360, 209785, 234361, 177019, 185211, 308092, 398206, 234366, 291712, 234367, 234372, 381829, 226181, 226184, 316298, 308107, 308112, 349072, 234386, 234387, 234392, 324507, 390045, 234400, 185250, 234404, 283558, 185254, 234409, 275371, 234419, 373687, 234425, 234427, 234430, 234436, 234438, 373706, 316364, 234444, 234445, 234451, 234454, 234457, 234463, 234466, 234472, 234473, 234477, 234482, 349175, 201720, 127992, 234498, 357379, 234500, 234506, 308243, 234531, 300068, 357414, 234534, 234542, 300084, 234548, 234555, 308287, 234560, 234565, 234569, 218186, 300111, 341073, 234577, 234583, 439384, 234584, 300135, 300136, 316520, 275565, 357486, 144496, 275571, 300150, 291959, 300151, 234616, 398457, 160891, 300158, 234622, 349316, 349318, 275591, 234632, 373903, 169104, 177296, 234642, 308372, 119962, 300187, 300188, 119963, 234656, 234659, 234663, 300201, 300202, 275625, 226481, 373945, 283840, 259268, 283847, 283852, 259280, 316627, 333011, 234733, 234742, 128251, 316669, 439562, 292107, 414990, 251153, 177428, 349462, 226608, 382258, 300343, 382269, 226624, 226632, 177484, 406861, 259406, 234831, 357719, 283991, 374109, 218462, 234850, 333160, 284014, 316787, 111993, 357762, 112017, 234898, 259475, 275859, 357786, 251298, 333220, 374191, 415171, 292292, 300487, 300489, 284116, 210390, 210391, 210393, 226781, 144867, 316902, 251378, 308723, 300535, 300536, 300542, 259599, 308756, 398869, 374296, 374299, 308764, 431649, 169518, 431663, 194110, 349763, 218696, 292425, 276040, 128587, 333388, 366154, 276045, 300630, 128599, 235095, 243292, 333408, 300644, 317032, 415338, 243307, 54893, 325231, 276085, 325245, 194180, 415375, 276120, 276126, 153251, 300714, 210603, 415420, 333503, 259781, 333517, 276173, 333520, 325346, 276195, 153319, 325352, 284401, 276210, 325371, 276219, 194303, 276238, 243472, 366360, 284442, 325404, 276253, 399147, 431916, 300848, 276282, 259899, 276283, 325439, 276287, 276294, 153415, 276298, 341836, 415567, 325457, 317269, 341847, 350044, 300894, 128862, 292712, 423789, 325492, 276341, 300918, 341879, 317304, 333688, 276344, 194429, 112509, 55167, 325503, 333701, 243591, 325518, 333722, 350109, 300963, 292771, 415655, 292782, 243637, 276408, 276421, 276430, 301008, 153554, 276444, 292836, 292837, 276454, 317415, 276459, 325619, 432116, 292858, 415741, 333828, 358410, 399373, 317467, 145435, 292902, 325674, 227370, 129076, 276534, 243767, 358456, 325694, 227417, 194656, 309345, 227428, 276582, 194666, 276589, 260207, 432240, 227439, 292992, 415881, 104587, 235662, 276627, 276632, 284826, 333991, 153776, 129203, 227513, 309444, 276682, 194782, 301279, 317664, 211193, 227578, 243962, 375039, 325905, 325912, 309529, 211235, 432421, 211238, 358703, 358709, 227654, 227658, 276813, 6481, 366930, 6482, 6489, 276835, 383332, 416104, 383336, 276847, 285040, 211326, 317831, 227725, 178578, 252308, 293274, 121245, 285090, 342450, 293303, 276920, 293306, 276925, 293310, 416197, 129483, 342476, 285150, 227809, 342498, 358882, 334309, 227813, 391655, 432618, 375276, 309744, 293367, 276998, 186893, 416286, 375333, 293419, 244269, 375343, 23092, 375351, 277048, 244281, 301638, 309830, 293448, 55881, 416341, 285271, 416351, 268899, 277094, 39530, 277101, 277111, 244347, 277133, 326287, 375440, 334481, 318106, 318107, 342682, 285353, 285361, 318130, 383667, 293556, 342706, 285371, 285372, 285373, 285374, 39614, 203477, 375526, 285415, 342762, 342763, 293612, 277227, 154359, 228088, 432893, 162561, 285444, 383754, 310036, 326429, 293664, 326433, 400166, 293672, 285487, 375609, 285497, 293693, 162621, 342847, 162626, 277316, 252741, 277325, 293711, 244568, 244570, 301918, 342887, 277366, 277370, 400252, 359298, 359299, 260996, 277381, 113542, 392074, 228234, 56208, 318364, 310176, 310178, 310182, 293800, 236461, 326581, 326587, 326601, 359381, 433115, 343005, 277479, 326635, 203757, 187374, 383983, 277492, 318461, 293886, 277509, 293893, 277510, 433165, 384016, 277523, 277524, 293910, 433174, 252958, 310317, 203830, 359478, 277563, 277597, 113760, 392290, 253029, 351344, 285814, 285820, 392318, 384131, 285828, 302213, 285830, 253063, 302216, 228491, 326804, 187544, 351390, 253099, 253100, 318639, 367799, 294074, 113850, 277690, 228542, 302274, 367810, 228563, 195808, 310497, 195811, 228588, 302325, 204022, 228600, 261377, 253216, 277792, 130338, 130343, 277800, 113966, 261425, 351537, 286013, 286018, 113987, 15686, 294218, 146762, 294219, 318805, 425304, 163175, 327024, 318848, 179587, 294275, 253317, 384393, 368011, 318864, 318868, 318875, 310692, 245161, 310701, 286129, 286132, 228795, 425405, 302531, 163269, 425418, 310732, 228827, 286172, 310757, 187878, 286202, 359930, 302590, 253451, 359950, 65041, 146964, 253463, 204313, 286244, 245287, 245292, 278060, 286254, 196164, 286288, 179801, 147036, 343647, 310889, 204397, 138863, 188016, 188031, 294529, 229001, 310923, 188048, 425626, 302754, 229029, 40614, 278191, 286388, 286391, 384695, 327358, 286399, 212685, 302797, 384720, 212688, 302802, 286423, 278233, 278234, 294622, 278240, 212716, 212717, 360177, 229113, 286459, 319233, 311042, 360195, 294678, 278299, 286494, 294700, 409394, 319288, 319292, 360252, 360264, 376669, 245599, 237408, 425825, 425833, 417654, 188292, 40853, 294807, 376732, 311199, 319392, 294823, 327596, 294843, 188348, 237504, 294850, 384964, 163781, 344013, 212942, 24532, 294886, 311281, 311282 ]
2fe79cd0ced5e80600890820085c4085120a6347
05db64c08dc05fdc3ce679630e20977ec70421b5
/osX/FaceDetection/FacesOSX/ViewController.swift
efa23b44e696011049aea0a342c42240808871b2
[]
no_license
SheilaEGR/studyNotes
c1f434dea70099a7c099517814e28204832645b3
e1e9d55cec88effd4a49ee7c6876f317a6e9f4d5
refs/heads/master
2020-07-26T12:12:29.665136
2019-10-30T02:03:38
2019-10-30T02:03:38
208,639,201
0
0
null
null
null
null
UTF-8
Swift
false
false
3,687
swift
// // ViewController.swift // FacesOSX // // Created by Sheila Gonzalez on 2019-10-21. // Copyright © 2019 Sheila Gonzalez. All rights reserved. // import Cocoa import Vision class ViewController: NSViewController { // We need two views: // imageView will display the frames from the camera // graphicsView will display the detection rects (custom view) @IBOutlet weak var imageView: NSImageView! @IBOutlet weak var graphicsView: GraphicsView! var videoCapture : VideoCapture! let context = CIContext() // The face detection is slooooow, so it will be performed // once every "maxFrames" var frameCount = 0 let maxFrames = 15 override func viewDidLoad() { super.viewDidLoad() // Start video capture, set this class as delegate // and choose the resolution of the camera // If the resolution is bigger, the time processing // frace detection will also increase videoCapture = VideoCapture() videoCapture.delegate = self videoCapture.resolution = .vga640x480 } override var representedObject: Any? { didSet { } } // If the app window dissapears, stop the camera override func viewWillDisappear() { videoCapture.stopCamera() } // Face detection using Vision framework func detectFaces(pixelBuffer : CVPixelBuffer) { let handler = VNImageRequestHandler(cvPixelBuffer: pixelBuffer, options: [:]) do { try handler.perform([request]) } catch let reqErr { print("Failed to perform request:", reqErr) } } // Vision framework request, with completion handler. // Every time the handler.perform (line 57) is called, // the code inside this completion handler will be called. lazy var request = VNDetectFaceRectanglesRequest { (req, error) in // If no faces could be detected if let error = error { print("Failed to detect faces:", error) return } // Put every detected face's bounding box inside an array var rects = [NSRect]() req.results?.forEach({ (res) in guard let faceObservation = res as? VNFaceObservation else { return } rects.append(faceObservation.boundingBox) }) // For main trhead DispatchQueue.main.async{ // Put the bounding boxes inside the graphics view self.graphicsView.rects = rects // Repaint! self.graphicsView.setNeedsDisplay(self.view.frame) } } } extension ViewController : VideoCaptureOSXDelegate { func captured(pixelBuffer: CVPixelBuffer) { // -----> DISPLAY ON IMAGE VIEW // Convert cvPixelBuffer to NSImage to display output let ciImage = CIImage(cvPixelBuffer: pixelBuffer) guard let cgImage = context.createCGImage(ciImage, from: ciImage.extent) else { return } let imageSize = NSSize(width: cgImage.width, height: cgImage.height) let image = NSImage(cgImage: cgImage, size: imageSize) // Display to output image view self.imageView.image = image // -----> PROCESS FACE DETECTION frameCount += 1 if frameCount == maxFrames { frameCount = 0 // Send vision request to utility thread, // Utility thread is for tasks that take a while to be done DispatchQueue.global(qos: .utility).async { self.detectFaces(pixelBuffer: pixelBuffer) } } } }
[ -1 ]
221584e0ba294200e361561ce204ef646d74346d
24791ae2325cfccb39cb472e65a89048ea3360eb
/SwiftPayroll/Vehicle/Car.swift
1a28076462ad7fbc638d9234a74410b7ef137d7d
[]
no_license
ravsingh3595/SwiftPayroll
7776024786319cf26a99813140c1fa388e85ec91
6962e33a3f713e218c1decd74a5025ec54317db5
refs/heads/master
2020-03-24T02:19:38.835803
2018-07-29T04:01:32
2018-07-29T04:01:32
142,369,087
0
0
null
null
null
null
UTF-8
Swift
false
false
621
swift
// // Car.swift // Group2_FinalProject_Payroll // // Created by user on 2018-07-23. // Copyright © 2018 RavSingh. All rights reserved. // import Foundation class Car: Vehicle { private var bootSpace: Double? var _bootSpace: Double? { get{ return bootSpace } } init(make: String, plate: String, bootSpace: Double) { super.init(make: make, plate: plate) self.bootSpace = bootSpace } override func printMyData() { print("Employee has a car") super.printMyData() print("\tBoot Space: \(bootSpace!)") } }
[ -1 ]
6ebff896d7e9b13f59b80e6615f8ec9c9815e4d2
ff11dd24508cb09daf368066956fe924d3b4b335
/laostra/laostra/Components/Drink/Drinks.swift
35cda9eb473c1b415c1092dd45dc866510dd6106
[ "MIT" ]
permissive
DanyNaelson/ios-restaurant
f78b0f1c6c41ee0ddd9134a8e9a7bbe69cb2d276
e420d578e58d24596c5f18f1f577ccd7ca3076de
refs/heads/main
2023-02-01T08:12:39.451718
2020-12-14T19:13:19
2020-12-14T19:13:19
322,429,014
0
0
null
null
null
null
UTF-8
Swift
false
false
2,484
swift
// // Drinks.swift // laostra // // Created by Daniel Mejia on 05/10/20. // Copyright © 2020 Daniel Mejia. All rights reserved. // import SwiftUI import SwiftyJSON struct Drinks: View { @State private var search: String = "" @State private var filter: String = "" @State var drinks: [ Drink ] = [] @EnvironmentObject var appState : AppState var body: some View { let drinks = self.search == "" ? self.drinks : self.drinks.filter{$0.nickname.localizedCaseInsensitiveContains(self.search)} let categories = getDrinkCategories(drinks: drinks) return VStack { Search(search: $search) Spacer() if !categories.isEmpty { CategoryFilter(filter: $filter, filters: categories) } Spacer() ScrollView(.vertical, showsIndicators: false) { if !drinks.isEmpty { ForEach(categories, id: \.self) { category in HorizontalDrinkList(drinks: drinks, category: category, filter: self.filter) } } else { VStack(alignment: .center) { Text(LocalizedStringKey("no_drinks")) .font(.headline) .frame(maxWidth: .infinity, alignment: .center) } } } // .gesture(DragGesture(minimumDistance: 3.0, coordinateSpace: .local) // .onEnded({ value in // if value.translation.height > 0 && value.translation.width < 100 && value.translation.width > -100 { // self.appState.drinkManager.getDrinks(query: ""){{ response in // let json = JSON(response) // // if json["ok"] == true { // self.drinks = self.appState.drinkManager.drinks // } // } // } // }) // ) } .onAppear(){ self.appState.drinkManager.getDrinks(query: ""){response in let json = JSON(response) if json["ok"] == true { self.drinks = self.appState.drinkManager.drinks } } } } } struct Drinks_Previews: PreviewProvider { static var previews: some View { Drinks() } }
[ -1 ]
86b4dbd827adee3f827a34cf7fdf29acd7caaec0
5b99e451144684dde6c8536381cea9a78453ae6d
/GrubHound/SwiftyStarRatingView.swift
6d325b699866698f0ef4b8681bc439bb8deb6b40
[]
no_license
umarF/FourSquare-API-integration
2338189dfc50dcddcd721f2fd6c9d183bdf30411
cfdbd27925f795f2616480953efca3f32392d16d
refs/heads/master
2021-01-20T00:06:27.387675
2017-03-03T12:50:38
2017-03-03T12:50:38
83,793,395
1
0
null
null
null
null
UTF-8
Swift
false
false
12,969
swift
// // SwiftyStarRatingView.swift // SwiftyStarRatingView // // Created by jerry on 16/12/2. // Copyright © 2016年 jerry. All rights reserved. // import UIKit public typealias SSRVShouldBeginGesRecBlock = (_ gesture:UIGestureRecognizer) -> Bool @IBDesignable public class SwiftyStarRatingView: UIControl { @IBInspectable public var maximumValue: CGFloat { set{ if _maximumValue != newValue { _maximumValue = newValue setNeedsDisplay() } } get{ return max(_maximumValue, _minimumValue) } } @IBInspectable public var minimumValue: CGFloat { set{ if _minimumValue != newValue { _minimumValue = newValue setNeedsDisplay() } } get{ return max(_minimumValue, 0) } } @IBInspectable public var value: CGFloat { set{ if _value != newValue { _value = newValue } } get{ return min(max(_value, _minimumValue),_maximumValue) } } @IBInspectable public var spacing: CGFloat = 5 { didSet{ if spacing != oldValue { setNeedsDisplay() } } } @IBInspectable public var allowsHalfStars: Bool = true { didSet{ setNeedsDisplay() } } @IBInspectable public var accurateHalfStars: Bool = true { didSet{ setNeedsDisplay() } } @IBInspectable public var continuous: Bool = true { didSet{ setNeedsDisplay() } } @IBInspectable public var emptyStarImage: UIImage? { didSet{ setNeedsDisplay() } } @IBInspectable public var halfStarImage: UIImage? { didSet{ setNeedsDisplay() } } @IBInspectable public var filledStarImage: UIImage? { didSet{ setNeedsDisplay() } } public var shouldBecomeFirstResponder: Bool = false public var shouldBeginGesRecBlock:SSRVShouldBeginGesRecBlock! fileprivate var _minimumValue: CGFloat! fileprivate var _maximumValue: CGFloat! fileprivate var shouldUseImages: Bool{ get{ return (self.emptyStarImage != nil && self.filledStarImage != nil) } } fileprivate var _value: CGFloat = 0 { didSet{ if _value != oldValue && _value >= _minimumValue && _value <= _maximumValue && continuous == true { self.sendActions(for: .valueChanged) } setNeedsDisplay() } } override public var isEnabled: Bool { willSet{ updateAppearance(enabled: newValue) } } override public var canBecomeFirstResponder: Bool { get{ return shouldBecomeFirstResponder } } override public var intrinsicContentSize: CGSize { get{ let height:CGFloat = 44.0 return CGSize(width: _maximumValue * height + (_maximumValue-1) * spacing, height: height) } } override public var tintColor: UIColor! { set{ super.tintColor = newValue setNeedsDisplay() } get{ return super.tintColor } } override init(frame: CGRect) { super.init(frame: frame) self.customInit() } required public init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) self.customInit() } override public func draw(_ rect: CGRect) { let context = UIGraphicsGetCurrentContext() context?.setFillColor((self.backgroundColor?.cgColor ?? UIColor.white.cgColor)!) context?.fill(rect) let availableWidth = rect.width - 2 - (spacing * (_maximumValue - 1)) let cellWidth = availableWidth / _maximumValue let starSide = (cellWidth <= rect.height) ? cellWidth : rect.height for idx in 0..<Int(_maximumValue) { let center = CGPoint(x: (cellWidth + spacing) * CGFloat(idx) + cellWidth / 2 + 1 , y: rect.size.height / 2) let frame = CGRect(x: center.x - starSide / 2, y: center.y - starSide / 2, width: starSide, height: starSide) let highlighted = (Float(idx+1) <= ceilf(Float(_value))) if allowsHalfStars && highlighted && (CGFloat(idx+1) > _value) { if accurateHalfStars { drawAccurateStar(frame: frame, tintColor: tintColor, progress: _value-CGFloat(idx)) }else { drawHalfStar(frame: frame, tintColor: tintColor) } }else { drawStar(frame: frame, tintColor: tintColor, highlighted: highlighted) } } } } fileprivate extension SwiftyStarRatingView { func customInit() { _value = 0 spacing = 0.0 continuous = true _minimumValue = 0 _maximumValue = 5 self.isExclusiveTouch = true self.updateAppearance(enabled: self.isEnabled) } func drawStar(frame:CGRect, tintColor:UIColor, highlighted:Bool) { if self.shouldUseImages { drawStartImage(frame: frame, tintColor: tintColor, highlighted: highlighted) }else { drawStarShape(frame: frame, tintColor: tintColor, highlighted: highlighted) } } func drawHalfStar(frame:CGRect, tintColor:UIColor) { if self.shouldUseImages { drawHalfStarImage(frame: frame, tintColor: tintColor) }else { drawHalfStarShape(frame: frame, tintColor: tintColor) } } func drawAccurateStar(frame:CGRect, tintColor:UIColor, progress:CGFloat) { if self.shouldUseImages { drawAccurateHalfStarImage(frame: frame, tintColor: tintColor, progress: progress) }else { drawAccurateHalfStarShape(frame: frame, tintColor: tintColor, progress: progress) } } func updateAppearance(enabled:Bool) { self.alpha = enabled ? 1.0 : 1.5 } } fileprivate extension SwiftyStarRatingView { //Image Drawing func drawStartImage(frame:CGRect, tintColor:UIColor, highlighted:Bool) { let image = highlighted ? self.filledStarImage : self.emptyStarImage draw(image: image!, frame: frame, tintColor: tintColor) } func drawHalfStarImage(frame:CGRect, tintColor:UIColor) { drawAccurateHalfStarImage(frame: frame, tintColor: tintColor, progress: 0.5) } func drawAccurateHalfStarImage(frame:CGRect, tintColor:UIColor, progress:CGFloat) { var image = self.halfStarImage var aFrame = frame if image == nil { let imageF = CGRect(x: 0, y: 0, width: (image?.size.width)!*(image?.scale)!*progress, height: (image?.size.height)!*(image?.scale)!) aFrame.size.width *= progress let imageRef = (image?.cgImage)!.cropping(to: imageF) let halfImage = UIImage(cgImage: imageRef!, scale: (image?.scale)!, orientation: (image?.imageOrientation)!) image = halfImage.withRenderingMode((image?.renderingMode)!) } self.draw(image: image!, frame: aFrame, tintColor: tintColor) } func draw(image:UIImage, frame:CGRect, tintColor:UIColor) { if image.renderingMode == .alwaysTemplate { tintColor.setFill() } image.draw(in: frame) } } fileprivate extension SwiftyStarRatingView { //Shape Drawing func drawStarShape(frame:CGRect, tintColor:UIColor, highlighted:Bool) { drawAccurateHalfStarShape(frame: frame, tintColor: tintColor, progress: highlighted ? 1.0 : 0.0) } func drawHalfStarShape(frame:CGRect, tintColor:UIColor) { drawAccurateHalfStarShape(frame: frame, tintColor: tintColor, progress: 0.5) } func drawAccurateHalfStarShape(frame:CGRect, tintColor:UIColor, progress:CGFloat) { let starShapePath = UIBezierPath() starShapePath.move(to: CGPoint(x: frame.minX + 0.62723 * frame.width, y: frame.minY + 0.37309 * frame.height)) starShapePath.addLine(to: CGPoint(x: frame.minX + 0.50000 * frame.width, y: frame.minY + 0.02500 * frame.height)) starShapePath.addLine(to: CGPoint(x: frame.minX + 0.37292 * frame.width, y: frame.minY + 0.37309 * frame.height)) starShapePath.addLine(to: CGPoint(x: frame.minX + 0.02500 * frame.width, y: frame.minY + 0.39112 * frame.height)) starShapePath.addLine(to: CGPoint(x: frame.minX + 0.30504 * frame.width, y: frame.minY + 0.62908 * frame.height)) starShapePath.addLine(to: CGPoint(x: frame.minX + 0.20642 * frame.width, y: frame.minY + 0.97500 * frame.height)) starShapePath.addLine(to: CGPoint(x: frame.minX + 0.50000 * frame.width, y: frame.minY + 0.78265 * frame.height)) starShapePath.addLine(to: CGPoint(x: frame.minX + 0.79358 * frame.width, y: frame.minY + 0.97500 * frame.height)) starShapePath.addLine(to: CGPoint(x: frame.minX + 0.69501 * frame.width, y: frame.minY + 0.62908 * frame.height)) starShapePath.addLine(to: CGPoint(x: frame.minX + 0.97500 * frame.width, y: frame.minY + 0.39112 * frame.height)) starShapePath.addLine(to: CGPoint(x: frame.minX + 0.62723 * frame.width, y: frame.minY + 0.37309 * frame.height)) starShapePath.close() starShapePath.miterLimit = 4 let frameWidth = frame.size.width let rightRectOfStar = CGRect(x: frame.origin.x + progress * frameWidth, y: frame.origin.y, width: frameWidth - progress * frameWidth, height: frame.size.height) let clipPath = UIBezierPath(rect: CGRect.infinite) clipPath.append(UIBezierPath(rect: rightRectOfStar)) clipPath.usesEvenOddFillRule = true UIGraphicsGetCurrentContext()!.saveGState() clipPath.addClip() tintColor.setFill() starShapePath.fill() UIGraphicsGetCurrentContext()!.restoreGState() tintColor.setStroke() starShapePath.lineWidth = 1 starShapePath.stroke() } } extension SwiftyStarRatingView { override public func beginTracking(_ touch: UITouch, with event: UIEvent?) -> Bool { if isEnabled { super.beginTracking(touch, with: event) if shouldBecomeFirstResponder && !self.isFirstResponder { self.becomeFirstResponder() } self.handle(touch: touch) return true }else { return false } } override public func continueTracking(_ touch: UITouch, with event: UIEvent?) -> Bool { if self.isEnabled { super.continueTracking(touch, with: event) self.handle(touch: touch) return true }else { return false } } override public func endTracking(_ touch: UITouch?, with event: UIEvent?) { super.endTracking(touch, with: event) if shouldBecomeFirstResponder && self.isFirstResponder { self.resignFirstResponder() } self.handle(touch: touch!) if !continuous { self.sendActions(for: .valueChanged) } } override public func cancelTracking(with event: UIEvent?) { super.cancelTracking(with: event) if shouldBecomeFirstResponder && self.isFirstResponder { self.resignFirstResponder() } } override public func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool { if (gestureRecognizer.view?.isEqual(self))! { return !self.isUserInteractionEnabled }else { return (self.shouldBeginGesRecBlock != nil) ? self.shouldBeginGesRecBlock(gestureRecognizer) : false } } fileprivate func handle(touch:UITouch) { let cellWidth = self.bounds.width/_maximumValue let location = touch.location(in: self) var aValue = location.x/cellWidth if allowsHalfStars { if accurateHalfStars { }else { if aValue+0.5 < ceil(aValue) { aValue = floor(aValue)+0.5 }else { aValue = ceil(aValue) } } }else { aValue = ceil(aValue) } self.value = aValue } } extension SwiftyStarRatingView { override public func accessibilityActivate() -> Bool { return true } override public func accessibilityIncrement() { let aValue = _value + (allowsHalfStars ? 0.5 : 1.0) self.value = aValue } override public func accessibilityDecrement() { let aValue = _value - (allowsHalfStars ? 0.5 : 1.0) self.value = aValue } }
[ 45165, 241718 ]
7cbf3d6db02531de41d16b51dd913ad88d398e0b
5fab9d78e53b9ee80511a2f7a58956130c5618cc
/99RedBalloonsTests/_9RedBalloonsTests.swift
b29521cf949e44d62850b944b84ef45d2fe77a57
[]
no_license
fsoeduardo/99Ballons
bfd5d5d909c485642f92ee82cda822c1e49d7f79
d344735e0db02c9cf14f7a553471dd8e3d76fdcf
refs/heads/master
2021-01-21T13:07:29.352021
2014-11-30T03:11:32
2014-11-30T03:11:32
null
0
0
null
null
null
null
UTF-8
Swift
false
false
915
swift
// // _9RedBalloonsTests.swift // 99RedBalloonsTests // // Created by Mac on 11/29/14. // Copyright (c) 2014 Eduardo Furtado. All rights reserved. // import UIKit import XCTest class _9RedBalloonsTests: XCTestCase { override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. super.tearDown() } func testExample() { // This is an example of a functional test case. XCTAssert(true, "Pass") } func testPerformanceExample() { // This is an example of a performance test case. self.measureBlock() { // Put the code you want to measure the time of here. } } }
[ 276481, 276489, 276492, 305179, 278558, 307231, 313375, 102437, 227370, 360491, 276534, 276543, 159807, 286788, 280649, 223316, 315476, 223318, 288857, 227417, 194652, 194656, 276577, 309345, 227428, 43109, 276582, 276581, 276585, 223340, 276589, 278638, 227439, 276592, 131189, 223350, 276603, 276606, 292992, 276613, 141450, 311435, 215178, 311438, 276627, 276631, 276632, 184475, 227492, 196773, 227495, 129203, 299187, 131256, 176314, 280762, 223419, 299198, 309444, 227528, 276682, 276684, 278742, 278746, 280802, 276709, 276710, 276715, 233715, 157944, 227576, 211193, 168188, 276753, 276760, 309529, 278810, 299293, 282919, 262450, 315706, 278846, 164162, 311621, 280902, 278856, 227658, 276813, 278862, 278863, 6481, 6482, 276821, 276822, 6489, 323935, 276831, 276835, 321894, 276839, 416104, 276847, 285040, 278898, 278908, 280961, 178571, 227725, 178578, 190871, 293274, 61857, 61859, 278951, 278954, 278961, 278965, 293303, 276920, 278969, 33211, 276925, 278978, 278985, 278993, 279002, 287198, 227809, 358882, 227813, 279013, 279019, 279022, 281072, 279039, 276998, 287241, 279050, 186893, 279054, 303631, 223767, 223769, 277017, 291358, 277029, 293419, 277048, 301634, 369220, 277066, 295519, 66150, 277094, 166507, 277101, 189037, 287346, 189042, 189043, 277111, 279164, 277118, 291454, 184962, 303746, 152203, 225933, 277133, 133774, 225936, 277138, 277142, 225943, 230040, 225944, 164512, 225956, 285353, 225962, 209581, 205487, 285361, 303793, 154291, 299699, 293556, 154294, 342706, 285371, 199366, 225997, 226001, 164563, 277204, 226004, 203477, 279252, 226007, 119513, 201442, 226019, 285415, 342762, 277227, 226035, 230134, 234234, 209660, 279294, 234238, 234241, 226051, 234245, 209670, 277254, 226058, 234250, 234253, 234256, 234263, 369432, 234268, 105246, 228129, 234277, 234280, 279336, 289576, 234283, 277289, 234286, 234289, 226097, 234294, 230199, 234301, 162621, 289598, 234304, 277312, 162626, 281408, 293693, 277316, 234305, 234311, 234312, 299849, 234317, 277325, 277327, 293711, 234323, 234326, 277339, 234331, 301918, 234335, 279392, 297822, 349026, 234340, 174949, 234343, 234346, 277354, 234349, 277360, 234355, 213876, 277366, 234360, 234361, 279417, 209785, 177019, 277370, 234366, 234367, 158593, 234372, 226181, 113542, 213894, 226184, 234377, 277381, 228234, 234381, 295824, 226194, 234387, 234386, 234392, 324507, 234395, 279456, 234400, 277410, 234404, 226214, 289703, 256937, 234409, 275371, 234412, 236461, 226223, 234419, 226227, 234425, 234427, 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, 234495, 277505, 234498, 234500, 277509, 277510, 234503, 234506, 230410, 234509, 277517, 197647, 277518, 295953, 275469, 277523, 234517, 230423, 281625, 197657, 281626, 175132, 234530, 234531, 234534, 275495, 234539, 275500, 310317, 277550, 234542, 275505, 234548, 277563, 234555, 7229, 7230, 7231, 156733, 234560, 277566, 238651, 230463, 234565, 207938, 281666, 234569, 300111, 207953, 277585, 296018, 234577, 296019, 234583, 234584, 275547, 277596, 234594, 230499, 281700, 277603, 300135, 234603, 281707, 275565, 156785, 312434, 275571, 234612, 300151, 234616, 398457, 234622, 300158, 275585, 285828, 302213, 275590, 234631, 253063, 277640, 302217, 234632, 275591, 234642, 226451, 308372, 226452, 275607, 119963, 234652, 234656, 330913, 306338, 234659, 277665, 234663, 275625, 300201, 208043, 226479, 238769, 226481, 277686, 208058, 277690, 230588, 277694, 283840, 279747, 279760, 290000, 189652, 275671, 363744, 195811, 298212, 304356, 285929, 279792, 298228, 204022, 234742, 228600, 120055, 208124, 204041, 292107, 277792, 339234, 199971, 259363, 304421, 277800, 277803, 113966, 277806, 226608, 226609, 277809, 300343, 277815, 277821, 277824, 277825, 226624, 15686, 277831, 226632, 294218, 177484, 222541, 277838, 277841, 296273, 222548, 277844, 277845, 314709, 283991, 357719, 277852, 224605, 224606, 218462, 142689, 230756, 277862, 163175, 281962, 173420, 277868, 284014, 277871, 279919, 277878, 275831, 181625, 277882, 277883, 142716, 275838, 275839, 277890, 277891, 275847, 277896, 277897, 281992, 277900, 230799, 112017, 296338, 277907, 206228, 306579, 226711, 226712, 277911, 310692, 277925, 279974, 277927, 282024, 370091, 277936, 277939, 277940, 279989, 296375, 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, 278005, 300542, 306693, 153095, 192010, 280077, 149007, 65041, 282136, 204313, 278060, 286254, 194110, 128583, 276040, 226888, 366154, 276045, 276046, 286288, 226897, 280147, 300630, 243292, 147036, 370271, 282213, 317032, 222832, 276085, 276088, 278140, 188031, 276097, 192131, 276100, 276101, 229001, 310923, 312972, 278160, 282259, 276116, 276117, 276120, 278170, 280220, 276126, 282273, 282276, 278191, 276146, 278195, 276148, 296628, 198324, 286388, 278201, 276156, 278214, 323276, 276173, 302797, 212688, 302802, 276179, 276180, 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, 278316, 159533, 276279, 276282, 276283, 288574, 276287, 345919, 276294, 282438, 276298, 216918, 276311, 307031, 188246, 237408, 282474, 288619, 276332, 110452, 276344, 194429, 40850, 40853, 44952, 247712, 276385, 294823, 276394, 276400, 276401, 276408, 161722, 290746, 276413, 276421, 276430, 231375, 153552, 153554, 276444, 280541, 276450, 276454, 276459, 296941, 276468, 276469, 278518, 276475, 276478 ]
87bb2eb44982e266f4224ddc7d75dae0f98947a1
295b2f33782060ee3b161303e30fa3e0c842cfa2
/Controllers/QuotesViewController.swift
f785b978a45e1b61f1b1d5d250187a2e3fff124d
[]
no_license
WillTomaz-dev/Pensamentos
e1e007a11b2e7d7b5d180a6f0a1a20b6566f28e5
f82c967d4f680a94302705dfdb38dcb42888bdf9
refs/heads/master
2022-08-24T07:29:06.917758
2020-05-26T19:40:44
2020-05-26T19:40:44
267,135,568
0
0
null
null
null
null
UTF-8
Swift
false
false
2,595
swift
// // QuotesViewController.swift // Pensamentos // // Created by William Tomaz on 25/05/20. // Copyright © 2020 William Tomaz. All rights reserved. // import UIKit class QuotesViewController: UIViewController { @IBOutlet weak var ivPhoto: UIImageView! @IBOutlet weak var ivPhotoBackground: UIImageView! @IBOutlet weak var lbQuotes: UILabel! @IBOutlet weak var lbAuthor: UILabel! @IBOutlet weak var lcTop: NSLayoutConstraint! let quotesManager = QuotesManager() var timer: Timer? let config = Configuration.shared override func viewDidLoad() { super.viewDidLoad() NotificationCenter.default.addObserver(forName: NSNotification.Name(rawValue: "Refresh"), object: nil, queue: nil) { (notification) in self.formatView() } } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) prepareQuote() formatView() } override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) { formatView() prepareQuote() } func prepareQuote() { timer?.invalidate()// invalida o agendamento anterior/ qualquer execução ja acionada if config.autorefresh { timer = Timer.scheduledTimer(withTimeInterval: config.timeInterval, repeats: true) { (timer) in self.showRandomQuote() } } showRandomQuote() } func showRandomQuote() { let quote = quotesManager.getRandomQuote() lbQuotes.text = quote.quote lbAuthor.text = quote.author ivPhoto.image = UIImage(named: quote.image) ivPhotoBackground.image = ivPhoto.image lbQuotes.alpha = 0.0 lbAuthor.alpha = 0.0 ivPhoto.alpha = 0.0 ivPhotoBackground.alpha = 0.0 lcTop.constant = 50 view.layoutIfNeeded() UIView.animate(withDuration: 2.5){ self.lbQuotes.alpha = 1.0 self.lbAuthor.alpha = 1.0 self.ivPhoto.alpha = 1.0 self.ivPhotoBackground.alpha = 0.25 self.lcTop.constant = 10 self.view.layoutIfNeeded() } } func formatView(){ view.backgroundColor = config.colorScheme == 0 ? .white : UIColor(red: 156.0/255.0, green: 68/255, blue: 15/255, alpha: 1.0) lbQuotes.textColor = config.colorScheme == 0 ? .black : .white lbAuthor.textColor = config.colorScheme == 0 ? UIColor(red: 192.0/255.0, green: 96/255, blue: 49/255, alpha: 1.0) : .yellow } }
[ -1 ]
20805393815500b169557c06ca8800c16ea0c4b7
e9cea589a00a2109c0eedb4f5ccc18c6f0ce8d53
/Airabela/Extensions/UIView+Extension.swift
23d76d84b4c645c53031b3fa7c0f2844197f01a5
[]
no_license
iPHYZLL/airabela-projekt
5b13f1e8181041c979b8bbc841c5367fd4acc282
43e5b28d41483c912317d95f305da19f4cb4fd6a
refs/heads/master
2021-04-27T04:22:22.321388
2018-04-03T12:58:39
2018-04-03T12:58:39
122,730,090
0
0
null
null
null
null
UTF-8
Swift
false
false
2,164
swift
// // UIView+Extension.swift // Airabela // // Created by Alen Kirm on 12. 02. 18. // Copyright © 2018 Alen Kirm. All rights reserved. // import UIKit extension UIView { func anchor(top : NSLayoutYAxisAnchor?, paddingTop : CGFloat, right : NSLayoutXAxisAnchor?, paddingRight : CGFloat, left : NSLayoutXAxisAnchor?, paddingLeft : CGFloat, bottom : NSLayoutYAxisAnchor?, paddingBottom : CGFloat, width : CGFloat, height : CGFloat) { translatesAutoresizingMaskIntoConstraints = false if let top = top { topAnchor.constraint(equalTo: top, constant: paddingTop).isActive = true } if let left = left { leftAnchor.constraint(equalTo: left, constant: paddingLeft).isActive = true } if let bottom = bottom { bottomAnchor.constraint(equalTo: bottom, constant: -paddingBottom).isActive = true } if let right = right { rightAnchor.constraint(equalTo: right, constant: -paddingRight).isActive = true } if height != 0 { heightAnchor.constraint(equalToConstant: height).isActive = true } if width != 0 { widthAnchor.constraint(equalToConstant: width).isActive = true } } func anchorCenter(to view : UIView, withHeight height : CGFloat, andWidth width : CGFloat) { translatesAutoresizingMaskIntoConstraints = false centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true if height != 0 { heightAnchor.constraint(equalToConstant: height).isActive = true } if width != 0 { widthAnchor.constraint(equalToConstant: width).isActive = true } } func heightConstraint(height : CGFloat) { translatesAutoresizingMaskIntoConstraints = false heightAnchor.constraint(equalToConstant: height).isActive = true } }
[ 397652 ]
bb413ef766b8ecf95af73e5ec606c2fc7e562f5e
04a1fd1bbdd47ca539e6d0d630c6c46ec85d0b74
/CalculatorUITests/CalculatorUITests.swift
10106a9cb4ce79565c99e5e74fb2c68288879842
[]
no_license
TimothyLaskey/Calculator
533b977ba8db9ac726dd069c160a9514b4d9f7a8
bc9a3fdb1cbd2a288275f7bf4962da5df0dbcd5a
refs/heads/master
2021-01-22T21:59:18.894422
2017-03-26T20:27:16
2017-03-26T20:27:16
85,498,351
0
0
null
null
null
null
UTF-8
Swift
false
false
1,259
swift
// // CalculatorUITests.swift // CalculatorUITests // // Created by Timothy Laskey on 3/13/17. // Copyright © 2017 Timothy Laskey. All rights reserved. // import XCTest class CalculatorUITests: XCTestCase { override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. // In UI tests it is usually best to stop immediately when a failure occurs. continueAfterFailure = false // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. XCUIApplication().launch() // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. super.tearDown() } func testExample() { // Use recording to get started writing UI tests. // Use XCTAssert and related functions to verify your tests produce the correct results. } }
[ 333827, 243720, 282634, 313356, 155665, 305173, 237599, 241695, 223269, 229414, 292901, 354342, 102441, 315433, 278571, 325675, 354346, 124974, 282671, 102446, 229425, 243763, 241717, 229431, 180279, 215095, 319543, 213051, 288829, 325695, 286787, 288835, 307269, 237638, 313415, 285360, 239689, 315468, 311373, 333902, 278607, 196687, 311377, 354386, 280660, 223317, 329812, 315477, 354394, 200795, 323678, 321632, 315489, 315488, 280674, 280676, 45154, 313446, 227432, 215144, 233578, 194667, 307306, 278637, 288878, 319599, 278642, 284789, 131190, 284790, 288890, 292987, 215165, 131199, 227459, 194692, 280708, 235661, 278669, 241809, 323730, 278676, 311447, 153752, 327834, 284827, 278684, 329884, 299166, 278690, 233635, 311459, 215204, 299176, 284840, 278698, 284843, 184489, 278703, 184498, 278707, 125108, 180409, 278713, 295099, 223418, 299197, 258233, 280767, 280761, 227517, 299202, 139459, 309443, 176325, 131270, 301255, 227525, 280779, 227536, 282832, 321744, 301270, 229591, 280792, 301271, 311520, 325857, 334049, 280803, 182503, 319719, 307431, 295147, 317676, 286957, 125166, 125170, 313595, 125180, 184574, 125184, 309504, 217352, 125192, 125197, 194832, 227601, 325904, 125200, 125204, 319764, 278805, 334104, 282908, 299294, 125215, 282912, 233761, 278817, 311582, 211239, 282920, 125225, 317738, 311596, 321839, 315698, 98611, 125236, 332084, 282938, 307514, 168251, 278843, 319812, 332100, 227655, 280903, 319816, 323914, 201037, 282959, 229716, 289109, 168280, 379224, 323934, 332128, 391521, 239973, 381286, 313703, 285031, 416103, 280938, 242027, 242028, 321901, 278895, 354671, 287089, 199030, 227702, 315768, 315769, 291194, 223611, 248188, 291193, 313726, 311679, 291200, 211327, 240003, 158087, 313736, 227721, 242059, 311692, 285074, 227730, 240020, 315798, 190870, 190872, 291225, 317851, 285083, 293275, 227743, 242079, 289185, 293281, 285089, 305572, 283039, 156069, 300490, 301482, 311723, 289195, 377265, 338359, 299449, 311739, 319931, 293309, 278974, 311744, 317889, 291266, 278979, 326083, 278988, 289229, 281038, 326093, 281039, 283089, 278992, 283088, 279000, 242138, 176602, 285152, 279009, 291297, 188899, 195044, 369121, 279014, 242150, 319976, 279017, 311787, 281071, 319986, 236020, 279030, 311800, 279033, 317949, 283138, 279042, 233987, 287237, 377352, 322057, 309770, 342537, 279053, 182802, 283154, 303634, 303635, 279061, 279060, 279066, 188954, 322077, 291359, 227881, 293420, 289328, 283185, 236080, 279092, 23093, 234037, 244279, 244280, 338491, 301635, 309831, 55880, 377419, 303693, 281165, 281170, 326229, 309847, 189016, 115287, 287319, 332379, 111197, 295518, 287327, 242274, 244326, 279143, 277095, 279150, 281200, 287345, 313970, 287348, 301688, 244345, 189054, 287359, 297600, 303743, 291455, 301702, 164487, 311944, 279176, 316044, 311948, 184974, 311950, 316048, 311953, 316050, 287379, 326288, 227991, 295575, 289435, 303772, 205469, 221853, 285348, 314020, 279207, 295591, 295598, 279215, 318127, 248494, 299698, 285362, 164532, 287412, 166581, 154295, 293552, 342705, 287418, 303802, 314043, 66243, 291529, 287434, 225996, 363212, 287438, 242385, 303826, 279249, 279253, 158424, 230105, 299737, 322269, 342757, 295653, 289511, 230120, 330473, 234216, 285419, 330476, 289517, 279278, 312046, 170735, 215790, 125683, 230133, 199415, 234233, 279293, 289534, 322302, 205566, 299777, 291584, 228099, 285443, 291591, 295688, 322312, 285450, 264971, 312076, 326413, 322320, 285457, 295698, 166677, 291605, 283418, 285467, 326428, 221980, 281378, 234276, 318247, 262952, 262953, 279337, 318251, 289580, 262957, 283431, 293673, 301872, 242481, 303921, 234290, 164655, 328495, 230198, 285493, 285496, 301883, 201534, 281407, 289599, 295745, 222017, 342846, 293702, 318279, 283466, 281426, 279379, 295769, 201562, 234330, 244569, 281434, 322396, 301919, 230239, 293729, 230238, 275294, 279393, 303973, 349025, 281444, 279398, 351078, 177002, 308075, 242540, 310132, 295797, 201590, 228214, 295799, 177018, 269179, 279418, 308093, 314240, 291713, 158594, 240517, 287623, 228232, 299912, 320394, 316299, 279434, 416649, 252812, 308111, 234382, 308113, 293780, 310166, 289691, 209820, 277404, 240543, 283551, 310177, 289699, 189349, 289704, 279465, 293801, 326571, 177074, 304050, 326580, 289720, 326586, 289723, 189373, 213956, 281541, 19398, 345030, 213961, 279499, 56270, 191445, 304086, 183254, 183258, 142309, 234469, 314343, 304104, 324587, 320492, 183276, 203758, 320495, 289773, 287730, 277493, 240631, 320504, 312313, 214009, 312315, 312317, 328701, 328705, 234499, 293894, 320520, 230411, 320526, 330766, 234513, 238611, 140311, 293911, 238617, 197658, 316441, 132140, 113710, 189487, 281647, 322609, 312372, 203829, 238646, 300087, 238650, 320571, 21567, 308288, 160834, 336962, 314437, 349254, 238663, 300109, 207954, 234578, 296023, 205911, 314458, 156763, 234588, 277600, 281698, 281699, 285795, 214116, 230500, 322664, 228457, 318571, 279659, 234606, 300145, 238706, 312435, 187508, 300147, 279666, 230514, 302202, 285819, 314493, 285823, 234626, 279686, 222344, 285834, 318602, 228492, 337037, 234635, 177297, 162962, 187539, 326803, 308375, 324761, 285850, 296091, 119965, 302239, 234655, 300192, 339106, 306339, 330912, 234662, 300200, 249003, 238764, 322733, 302251, 208044, 3243, 279729, 294069, 300215, 294075, 64699, 228541, 283841, 148674, 283846, 312519, 279752, 283849, 148687, 290001, 189651, 316628, 279766, 189656, 279775, 310496, 298209, 304353, 304352, 279780, 228587, 279789, 290030, 302319, 160224, 251124, 234741, 283894, 316661, 208123, 292092, 279803, 228608, 320769, 234756, 322826, 242955, 312588, 177420, 318732, 126229, 318746, 245018, 320795, 320802, 130342, 304422, 130344, 292145, 298290, 312628, 300342, 159033, 333114, 222523, 333115, 286012, 181568, 279872, 294210, 216387, 286019, 193858, 279874, 300354, 300355, 304457, 230730, 372039, 294220, 296269, 234830, 224591, 238928, 222542, 296274, 314708, 318804, 283990, 314711, 357720, 300378, 300379, 294236, 316764, 314721, 292194, 230757, 281958, 134504, 306541, 327023, 234864, 296304, 284015, 314740, 230772, 327030, 314742, 290170, 310650, 224637, 306558, 290176, 243073, 179586, 306561, 314752, 294278, 314759, 296328, 298378, 304523, 368012, 318860, 296330, 292242, 112019, 306580, 314771, 224662, 234902, 282008, 314776, 318876, 282013, 290206, 148899, 314788, 298406, 314790, 245160, 333224, 282023, 241067, 279979, 314797, 279980, 286128, 173492, 286133, 284086, 279988, 310714, 302523, 284090, 228796, 54719, 302530, 280003, 228804, 310725, 306630, 292291, 415170, 300488, 306634, 280011, 302539, 234957, 370122, 339403, 329168, 312785, 222674, 327122, 280020, 329170, 310735, 280025, 310747, 239069, 144862, 286176, 187877, 320997, 310758, 280042, 280043, 191980, 329198, 337391, 300526, 282097, 308722, 296434, 306678, 40439, 288248, 191991, 286201, 300539, 288252, 312830, 286208, 290304, 245249, 228868, 292359, 218632, 230922, 302602, 323083, 294413, 304655, 323088, 329231, 282132, 230933, 302613, 282135, 316951, 374297, 302620, 313338, 282147, 222754, 306730, 245291, 312879, 230960, 288305, 239159, 290359, 323132, 235069, 157246, 130622, 288319, 288322, 280131, 349764, 310853, 124486, 282182, 288328, 286281, 292426, 194118, 333389, 224848, 224852, 290391, 230999, 306777, 128600, 196184, 235096, 239192, 212574, 345697, 204386, 300643, 300645, 282214, 312937, 224874, 243306, 204394, 312941, 206447, 310896, 294517, 314997, 288377, 290425, 325246, 333438, 235136, 280193, 282244, 239238, 288391, 286344, 323208, 282248, 179853, 286351, 188049, 229011, 239251, 280217, 323226, 179868, 229021, 302751, 282272, 198304, 282279, 298664, 212649, 298666, 317102, 286387, 300725, 337590, 286392, 300729, 302778, 306875, 280252, 296636, 282302, 280253, 286400, 323265, 323262, 280259, 321217, 282309, 321220, 333508, 239305, 280266, 296649, 306891, 212684, 302798, 9935, 241360, 282321, 313042, 286419, 241366, 280279, 278232, 282330, 18139, 294621, 278237, 280285, 282336, 278241, 321250, 294629, 153318, 333543, 181992, 12009, 337638, 282347, 288492, 282349, 323315, 67316, 34547, 286457, 284410, 200444, 288508, 282366, 286463, 319232, 278273, 288515, 280326, 282375, 323335, 284425, 300810, 282379, 116491, 280333, 284430, 216844, 300812, 161553, 124691, 284436, 278292, 118549, 116502, 282390, 278294, 325403, 321308, 321309, 282399, 241440, 282401, 325411, 315172, 186149, 186148, 241447, 333609, 286507, 294699, 284460, 280367, 300849, 282418, 280373, 282424, 280377, 321338, 319289, 282428, 280381, 345918, 413500, 241471, 280386, 280391, 153416, 315209, 325449, 159563, 280396, 307024, 317268, 237397, 307030, 18263, 241494, 188250, 284508, 300893, 307038, 237411, 284515, 276326, 282471, 296807, 292713, 282476, 292719, 296815, 313200, 325491, 313204, 333687, 317305, 124795, 317308, 339840, 315265, 280451, 327556, 188293, 243590, 282503, 315272, 243592, 325514, 305032, 315275, 67464, 184207, 124816, 311183, 282517, 294806, 214936, 294808, 337816, 239515, 124826, 214943, 298912, 319393, 333727, 294820, 333734, 219046, 284584, 294824, 298921, 313257, 310731, 292783, 126896, 200628, 300983, 343993, 288698, 98240, 294849, 214978, 280517, 280518, 214983, 282572, 282573, 153553, 24531, 231382, 329696, 323554, 292835, 6116, 190437, 292838, 294887, 317416, 313322, 298987, 278507, 311277, 296942, 329707, 124912, 278515, 325620, 239610 ]
c070cb6dbc1b584af4335038c821b400458be484
8d8607e73e1574617f0b01c3e0c0309de01f5b5e
/Swift4/BlogReader/BlogReader/MasterViewController.swift
f322b56c5714c4bbaf8c8b6dc712a66e652ba6c8
[]
no_license
DustinTrinh/iOSDevelopment
cf62d57f966f436d9b0998b800c30c2c70d01982
83e9e86a7ae7b124fd2bace09ab5844846f81130
refs/heads/master
2023-07-24T10:52:50.839637
2021-09-05T06:40:33
2021-09-05T06:40:33
289,073,323
0
0
null
null
null
null
UTF-8
Swift
false
false
11,064
swift
// // MasterViewController.swift // BlogReader // // Created by Dustin Trinh on 2018-12-30. // Copyright © 2018 DustyTheCutie. All rights reserved. // import UIKit import CoreData class MasterViewController: UITableViewController, NSFetchedResultsControllerDelegate { var detailViewController: DetailViewController? = nil var managedObjectContext: NSManagedObjectContext? = nil override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. let url = URL(string: "https://www.googleapis.com/blogger/v3/blogs/2399953/posts?key=AIzaSyCWtuS8qsUokXQ87gK5jXSKtI_zJ1zC_oY")! let task = URLSession.shared.dataTask(with: url){ (data, resposnse, error) in if error != nil { print(error) }else{ if let urlContent = data { do{ let jsonResult = try JSONSerialization.jsonObject(with: urlContent, options: JSONSerialization.ReadingOptions.mutableContainers) as AnyObject print(jsonResult) if let items = jsonResult["items"] as? NSArray { let context = self.fetchedResultsController.managedObjectContext let request = NSFetchRequest<Event>(entityName: "Event") do{ let results = try context.fetch(request) if results.count > 0 { for result in results { context.delete(result) } do{ try context.save() }catch{ print("Specific delete failed") } } }catch{ print("Delete Failed") } for item in items as [AnyObject]{ print(item["published"]) print(item["title"]) print(item["content"]) let newEvent = Event(context: context) // If appropriate, configure the new managed object. newEvent.timestamp = Date() newEvent.setValue(item["published"] as! String, forKey: "published") newEvent.setValue(item["title"] as! String, forKey: "title") newEvent.setValue(item["content"] as! String, forKey: "content") // Save the context. 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)") } } DispatchQueue.main.async(execute: { self.tableView.reloadData() }) } }catch{ print("JSON processing failed!") } } } } task.resume() } @objc func insertNewObject(_ sender: Any) { let context = self.fetchedResultsController.managedObjectContext let newEvent = Event(context: context) // If appropriate, configure the new managed object. newEvent.timestamp = Date() // Save the context. 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)") } } // MARK: - Segues override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if segue.identifier == "showDetail" { if let indexPath = tableView.indexPathForSelectedRow { let object = fetchedResultsController.object(at: indexPath) let controller = (segue.destination as! UINavigationController).topViewController as! DetailViewController controller.detailItem = object controller.navigationItem.leftBarButtonItem = splitViewController?.displayModeButtonItem controller.navigationItem.leftItemsSupplementBackButton = true } } } // MARK: - Table View override func numberOfSections(in tableView: UITableView) -> Int { return fetchedResultsController.sections?.count ?? 0 } override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { let sectionInfo = fetchedResultsController.sections![section] return sectionInfo.numberOfObjects } override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath) let event = fetchedResultsController.object(at: indexPath) configureCell(cell, withEvent: event) return cell } override func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool { // Return false if you do not want the specified item to be editable. return false } func configureCell(_ cell: UITableViewCell, withEvent event: Event) { cell.textLabel!.text = event.value(forKey: "title") as? String } // MARK: - Fetched results controller var fetchedResultsController: NSFetchedResultsController<Event> { if _fetchedResultsController != nil { return _fetchedResultsController! } let fetchRequest: NSFetchRequest<Event> = Event.fetchRequest() // Set the batch size to a suitable number. fetchRequest.fetchBatchSize = 20 // Edit the sort key as appropriate. let sortDescriptor = NSSortDescriptor(key: "published", ascending: false) fetchRequest.sortDescriptors = [sortDescriptor] // Edit the section name key path and cache name if appropriate. // nil for section name key path means "no sections". let aFetchedResultsController = NSFetchedResultsController(fetchRequest: fetchRequest, managedObjectContext: self.managedObjectContext!, sectionNameKeyPath: nil, cacheName: "Master") aFetchedResultsController.delegate = self _fetchedResultsController = aFetchedResultsController do { try _fetchedResultsController!.performFetch() } 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)") } return _fetchedResultsController! } var _fetchedResultsController: NSFetchedResultsController<Event>? = nil func controllerWillChangeContent(_ controller: NSFetchedResultsController<NSFetchRequestResult>) { tableView.beginUpdates() } func controller(_ controller: NSFetchedResultsController<NSFetchRequestResult>, didChange sectionInfo: NSFetchedResultsSectionInfo, atSectionIndex sectionIndex: Int, for type: NSFetchedResultsChangeType) { switch type { case .insert: tableView.insertSections(IndexSet(integer: sectionIndex), with: .fade) case .delete: tableView.deleteSections(IndexSet(integer: sectionIndex), with: .fade) default: return } } func controller(_ controller: NSFetchedResultsController<NSFetchRequestResult>, didChange anObject: Any, at indexPath: IndexPath?, for type: NSFetchedResultsChangeType, newIndexPath: IndexPath?) { switch type { case .insert: tableView.insertRows(at: [newIndexPath!], with: .fade) case .delete: tableView.deleteRows(at: [indexPath!], with: .fade) case .update: configureCell(tableView.cellForRow(at: indexPath!)!, withEvent: anObject as! Event) case .move: configureCell(tableView.cellForRow(at: indexPath!)!, withEvent: anObject as! Event) tableView.moveRow(at: indexPath!, to: newIndexPath!) } } func controllerDidChangeContent(_ controller: NSFetchedResultsController<NSFetchRequestResult>) { tableView.endUpdates() } /* // Implementing the above methods to update the table view in response to individual changes may have performance implications if a large number of changes are made simultaneously. If this proves to be an issue, you can instead just implement controllerDidChangeContent: which notifies the delegate that all section and object changes have been processed. func controllerDidChangeContent(controller: NSFetchedResultsController) { // In the simplest, most efficient, case, reload the table view. tableView.reloadData() } */ }
[ -1 ]
695918a0bc7cda5146973276af1fbcf4d2c6cb3b
262145e07593222dc4118c949aa42b2174408bb5
/BDDProjectTests/BDDProjectTests.swift
e27ec3effae8eb55506025bea7988205ec80bbca
[]
no_license
Enkofey/BDDProject
2c2ac91c8dae227c4d6c0c9ac3ab1459e4bbe051
ae6467a45bfa86811871a5270d5cec7067b8e8aa
refs/heads/master
2023-05-02T17:43:48.386550
2021-05-23T18:43:12
2021-05-23T18:43:12
341,853,061
0
0
null
null
null
null
UTF-8
Swift
false
false
908
swift
// // BDDProjectTests.swift // BDDProjectTests // // Created by Julien DAVID on 24/02/2021. // import XCTest @testable import BDDProject class BDDProjectTests: XCTestCase { override func setUpWithError() throws { // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDownWithError() throws { // Put teardown code here. This method is called after the invocation of each test method in the class. } func testExample() throws { // This is an example of a functional test case. // Use XCTAssert and related functions to verify your tests produce the correct results. } func testPerformanceExample() throws { // This is an example of a performance test case. self.measure { // Put the code you want to measure the time of here. } } }
[ 360462, 98333, 16419, 229413, 204840, 278570, 344107, 155694, 253999, 229430, 319542, 163896, 180280, 352315, 376894, 352326, 311372, 196691, 278615, 385116, 237663, 254048, 319591, 221290, 278634, 319598, 352368, 204916, 131191, 237689, 278655, 278677, 196760, 426138, 278685, 311458, 278691, 49316, 32941, 278704, 377009, 278708, 131256, 295098, 139479, 254170, 229597, 311519, 205035, 385262, 286958, 327929, 344313, 147717, 368905, 180493, 254226, 368916, 262421, 377114, 237856, 237857, 278816, 254251, 311597, 98610, 180535, 336183, 278842, 287041, 319821, 254286, 344401, 377169, 368981, 155990, 368984, 106847, 98657, 270701, 246127, 270706, 139640, 246137, 106874, 246136, 311685, 106888, 385417, 385422, 213403, 385454, 311727, 377264, 311738, 33211, 278970, 336317, 319930, 336320, 311745, 278978, 254406, 188871, 278993, 278999, 328152, 369116, 287198, 279008, 279013, 279018, 319981, 319987, 279029, 254456, 279032, 377338, 377343, 279039, 254465, 287241, 279050, 139792, 303636, 393751, 254488, 279065, 377376, 377386, 197167, 385588, 352829, 115270, 385615, 426576, 369235, 139872, 66150, 344680, 139892, 287352, 344696, 279164, 189057, 311941, 336518, 369289, 311945, 344715, 279177, 311949, 287374, 377489, 311954, 352917, 230040, 271000, 377497, 303771, 377500, 205471, 344738, 139939, 279206, 295590, 287404, 205487, 303793, 336564, 164533, 287417, 287422, 66242, 377539, 164560, 385747, 279252, 361176, 418520, 287452, 295652, 369385, 418546, 312052, 172792, 344827, 344828, 221948, 205568, 295682, 197386, 434957, 426774, 197399, 426775, 336671, 344865, 197411, 279336, 189228, 295724, 197422, 353070, 164656, 295729, 312108, 353069, 328499, 353078, 197431, 230199, 353079, 336702, 353094, 353095, 353109, 377686, 230234, 189275, 435039, 295776, 303972, 385893, 246641, 246643, 295798, 246648, 361337, 279417, 254850, 369538, 287622, 426895, 295824, 189348, 353195, 140204, 377772, 353197, 304051, 230332, 377790, 353215, 353216, 213957, 213960, 345033, 279498, 386006, 418776, 50143, 123881, 304110, 320494, 271350, 295927, 304122, 320507, 328700, 328706, 410627, 320516, 295942, 386056, 353290, 230410, 377869, 320527, 238610, 418837, 140310, 197657, 336929, 369701, 345132, 238639, 312373, 238651, 361535, 336960, 377926, 361543, 238664, 353367, 156764, 156765, 361566, 304222, 173166, 377972, 353397, 377983, 402565, 279685, 222343, 386189, 337039, 296086, 238743, 296092, 238765, 279728, 238769, 402613, 353479, 353481, 402634, 353482, 189653, 419029, 148696, 296153, 279774, 304351, 304356, 222440, 328940, 279792, 353523, 386294, 386301, 320770, 386306, 279814, 369930, 328971, 312587, 353551, 320796, 222494, 369956, 353584, 345396, 386359, 116026, 378172, 222524, 279875, 312648, 337225, 304456, 230729, 238927, 353616, 296273, 222559, 378209, 230756, 386412, 230765, 279920, 312689, 296307, 116084, 337281, 148867, 378244, 296329, 296335, 9619, 370071, 279974, 173491, 304564, 353719, 361927, 370123, 148940, 280013, 312782, 222675, 353750, 271843, 280041, 361963, 296433, 321009, 280055, 288249, 329225, 230921, 296461, 304656, 329232, 370197, 402985, 394794, 230959, 288309, 312889, 288318, 124485, 288326, 288327, 239198, 99938, 312940, 222832, 247416, 337534, 337535, 263809, 288392, 239250, 419478, 345752, 255649, 321199, 337591, 321207, 296632, 370363, 280251, 321219, 280267, 403148, 9936, 9937, 370388, 272085, 345814, 181975, 280278, 280280, 18138, 345821, 321247, 321249, 345833, 345834, 280300, 67315, 173814, 313081, 124669, 288512, 288516, 280329, 321302, 345879, 116505, 321310, 255776, 247590, 362283, 378668, 296755, 321337, 345919, 436031, 403267, 345929, 337745, 255829, 18262, 362327, 370522, 345951, 362337, 345955, 296806, 288619, 214895, 362352, 313199, 313203, 124798, 182144, 305026, 67463, 329622, 337815, 124824, 214937, 436131, 354212, 436137, 362417, 124852, 288697, 362431, 214977, 174019, 214984, 321480, 362443, 247757, 280541, 329695, 354272, 436191, 354274, 313319, 354280, 337895, 247785, 436205, 247791, 362480, 313339, 346118, 43014, 354316, 313357, 182296, 223268, 354345, 223274, 321583, 124975, 346162, 124984, 288828, 436285, 288833, 288834, 436292, 403525, 436301, 338001, 354385, 338003, 280661, 329814, 338007, 354393, 280675, 280677, 43110, 321637, 329829, 436329, 313447, 288879, 280694, 215164, 313469, 215166, 280712, 215178, 346271, 436383, 362659, 239793, 125109, 182456, 379071, 149703, 338119, 346314, 321745, 387296, 280802, 379106, 338150, 346346, 321772, 125169, 338164, 436470, 125183, 149760, 411906, 125188, 313608, 125193, 125198, 125199, 272658, 125203, 125208, 305440, 125217, 338218, 321840, 379186, 125235, 280887, 125240, 321860, 182598, 289110, 215385, 272729, 379225, 321894, 280939, 354676, 313727, 436608, 362881, 240002, 436611, 248194, 395659, 395661, 108944, 240016, 190871, 149916, 420253, 141728, 289189, 108972, 272813, 338356, 436661, 289232, 281040, 256477, 281072, 174593, 420369, 289304, 322078, 207393, 182817, 289332, 174648, 338489, 338490, 322120, 281166, 297560, 354911, 436832, 436834, 191082, 313966, 420463, 281199, 346737, 313971, 346740, 420471, 330379, 330387, 117396, 346772, 330388, 264856, 289434, 363163, 346779, 338613, 314040, 158394, 363211, 363230, 289502, 264928, 338662, 346858, 330474, 289518, 199414, 363263, 35583, 191235, 264968, 322316, 117517, 322319, 166676, 207640, 289576, 191283, 273207, 355130, 289598, 355137, 355139, 420677, 355146, 355154, 281427, 281433, 322395, 355165, 355178, 207729, 330609, 207732, 158593, 240518, 224145, 355217, 256922, 289690, 420773, 289703, 256935, 363438, 347055, 289727, 273344, 330689, 363458, 379844, 19399, 338899, 330708, 248796, 248797, 207838, 347103, 314342, 52200, 289774, 347123, 240630, 314362, 257024, 330754, 330763, 330772, 281626, 248872, 322612, 257094, 314448, 339030, 314467, 281700, 257125, 322663, 273515, 207979, 404593, 363641, 363644, 248961, 150657, 330888, 347283, 363669, 339100, 380061, 429214, 199839, 339102, 265379, 249002, 306346, 3246, 421048, 339130, 265412, 290000, 298208, 298212, 298213, 330984, 298221, 298228, 216315, 208124, 363771, 388349, 437505, 322824, 257305, 126237, 339234, 109861, 372009, 412971, 306494, 216386, 224586, 372043, 331090, 314710, 372054, 159066, 314720, 380271, 314739, 208244, 249204, 314741, 290173, 306559, 314751, 298374, 314758, 314760, 142729, 388487, 314766, 306579, 282007, 290207, 314783, 314789, 314791, 396711, 396712, 282024, 241066, 380337, 380338, 150965, 380357, 339398, 306639, 413137, 429542, 191981, 290301, 282114, 372227, 323080, 323087, 323089, 175639, 388632, 396827, 134686, 282146, 306723, 355876, 347694, 290358, 265798, 265804, 396882, 290390, 44635, 396895, 323172, 282213, 323178, 224883, 314998, 323196, 175741, 339584, 339585, 224901, 282245, 282246, 323217, 282259, 323236, 298661, 282280, 364207, 224946, 110268, 224958, 282303, 323264, 274115, 306890, 241361, 241365, 298712, 298720, 12010, 282348, 282358, 175873, 339715, 323331, 323332, 339720, 372496, 323346, 249626, 282400, 339745, 241441, 257830, 421672, 282417, 339762, 282427, 315202, 307011, 339783, 216918, 241495, 241528, 339841, 315273, 315274, 372626, 380821, 282518, 282519, 118685, 298909, 323507, 290745, 274371, 151497, 372701, 298980, 380908, 282633, 241692, 102437, 315432, 315434, 102445, 233517, 176175, 241716, 241720, 225351, 315465, 315476, 307289, 200794, 356447, 315487, 438377, 315498, 299121, 233589, 266357, 422019, 241808, 381073, 323729, 233636, 258214, 299174, 405687, 184505, 299198, 258239, 389313, 299203, 299209, 372941, 282831, 266449, 356576, 176362, 307435, 438511, 381172, 356602, 184570, 184575, 381208, 315673, 299293, 151839, 233762, 217380, 151847, 282919, 332083, 332085, 332089, 315706, 282939, 241986, 438596, 332101, 323913, 348492, 323916, 323920, 250192, 348500, 168281, 332123, 332127, 323935, 242023, 242029, 160110, 242033, 291192, 340357, 225670, 332167, 242058, 373134, 291224, 242078, 283038, 61857, 315810, 315811, 381347, 61859, 340398, 61873, 61880, 283064, 127427, 127428, 283075, 324039, 373197, 176601, 242139, 160225, 242148, 291311, 233978, 291333, 348682, 340490, 258581, 291358, 283184, 234036, 315960, 348732, 242237, 70209, 348742, 70215, 348749, 381517, 332378, 201308, 242277, 111208, 184940, 373358, 389745, 209530, 356989, 373375, 152195, 348806, 184973, 316049, 111253, 316053, 111258, 111259, 176808, 299699, 299700, 422596, 422599, 291530, 225995, 242386, 422617, 422626, 422631, 234217, 299759, 299776, 291585, 430849, 291592, 62220, 422673, 430865, 291604, 422680, 152365, 422703, 422709, 152374, 242485, 160571, 430910, 160575, 160580, 299849, 283467, 381773, 201551, 127841, 242529, 349026, 357218, 275303, 308076, 242541, 209785, 177019, 185211, 308092, 398206, 291712, 381829, 316298, 349067, 308107, 349072, 308112, 209817, 324506, 324507, 390045, 185250, 324517, 185254, 373687, 349121, 373706, 316364, 340955, 340961, 324586, 340974, 316405, 349175, 201720, 127992, 357379, 324625, 308243, 316437, 201755, 300068, 357414, 357423, 300084, 324666, 324667, 308287, 21569, 218186, 250956, 300111, 341073, 439384, 250981, 300135, 316520, 300136, 357486, 316526, 144496, 300150, 291959, 300151, 160891, 341115, 300158, 349316, 349318, 373903, 169104, 177296, 308372, 119962, 300187, 300188, 300201, 300202, 373945, 259268, 283847, 62665, 283852, 283853, 259280, 316627, 333011, 357595, 234733, 234742, 128251, 316669, 439562, 292107, 242954, 414990, 251153, 177428, 349462, 382258, 300343, 382269, 193859, 177484, 406861, 259406, 234831, 251213, 120148, 283991, 374109, 316765, 292195, 333160, 243056, 316787, 382330, 357759, 357762, 112017, 234898, 259475, 275859, 112018, 357786, 251298, 333220, 316842, 374191, 210358, 284089, 292283, 415171, 300487, 300489, 366037, 210390, 210391, 210392, 210393, 144867, 54765, 251378, 308723, 300536, 210433, 366083, 259599, 316946, 308756, 398869, 374296, 374299, 308764, 423453, 349726, 431649, 349741, 169518, 431663, 194110, 235070, 349763, 218696, 292425, 243274, 128587, 333388, 333393, 300630, 128599, 235095, 333408, 374372, 300644, 415338, 243307, 54893, 325231, 333430, 366203, 325245, 194180, 415375, 153251, 300714, 210603, 415420, 333503, 218819, 259781, 333509, 333517, 333520, 333521, 333523, 325346, 153319, 325352, 284401, 325371, 194303, 284429, 243472, 366360, 284442, 325404, 325410, 341796, 333610, 399147, 431916, 300848, 317232, 259899, 325439, 153415, 341836, 415567, 325457, 317269, 341847, 350044, 128862, 284514, 292712, 325484, 423789, 292720, 325492, 276341, 341879, 317304, 333688, 112509, 194429, 55167, 325503, 333701, 243591, 325515, 243597, 325518, 333722, 350109, 292771, 415655, 333735, 284587, 243637, 301008, 153554, 219101, 292836, 292837, 317415, 325619, 432116, 333817, 292858, 415741, 333828, 358410, 399373, 317467, 145435, 292902, 325674, 243759, 129076, 243767, 358456, 325694, 309345, 194666, 260207, 432240, 333940, 284788, 292992, 333955, 415881, 104587, 235662, 325776, 317587, 284826, 333991, 333992, 284842, 333996, 301251, 309444, 194782, 301279, 317664, 243962, 375039, 309503, 194820, 375051, 325905, 334103, 325912, 211235, 432421, 211238, 358703, 358709, 260418, 383311, 6481, 366930, 366929, 6489, 391520, 383332, 383336, 211326, 317831, 227725, 252308, 39324, 121245, 317852, 285090, 375207, 342450, 293303, 293310, 342466, 416197, 129483, 342476, 317901, 6606, 334290, 326100, 285150, 342498, 358882, 334309, 195045, 391655, 432618, 375276, 342536, 342553, 416286, 375333, 244269, 375343, 23092, 375351, 244281, 301638, 309830, 293448, 55881, 416341, 244310, 416351, 268899, 39530, 244347, 326287, 375440, 334481, 227990, 342682, 318106, 318107, 318130, 383667, 293556, 342713, 285373, 39614, 318173, 375526, 285415, 342762, 342763, 293612, 154359, 432893, 162561, 285444, 383754, 310036, 326429, 293664, 326433, 400166, 293672, 318250, 318252, 375609, 342847, 252741, 293711, 244568, 244570, 293730, 351077, 342887, 326505, 211829, 269178, 400252, 359298, 359299, 260996, 113542, 228233, 392074, 228234, 56208, 318364, 310176, 310178, 293800, 236461, 252847, 326581, 326587, 359364, 326601, 359381, 359387, 433115, 343005, 130016, 64485, 326635, 359406, 187374, 383983, 383982, 318461, 293886, 293893, 433165, 146448, 384016, 433174, 252958, 252980, 359478, 203830, 302139, 359495, 392290, 253029, 228458, 351344, 187506, 285814, 392318, 187521, 384131, 302216, 228491, 228493, 285838, 162961, 326804, 351390, 302240, 343203, 253099, 253100, 318639, 367799, 113850, 294074, 64700, 367810, 302274, 343234, 244940, 228563, 351446, 359647, 195808, 310497, 228588, 253167, 302325, 261377, 351490, 228609, 245019, 253216, 130338, 130343, 130348, 351537, 261425, 359737, 286013, 286018, 146762, 294218, 294219, 318805, 425304, 294243, 163175, 327024, 327025, 327031, 318848, 253317, 384393, 368011, 318864, 318868, 310692, 245161, 286129, 286132, 228795, 425405, 302529, 302531, 163268, 425418, 310732, 64975, 327121, 228827, 286172, 310757, 187878, 245223, 343542, 343543, 286202, 359930, 286205, 302590, 228867, 253451, 253452, 359950, 146964, 253463, 187938, 286244, 245287, 245292, 286254, 425535, 196164, 56902, 179801, 196187, 343647, 310889, 204397, 138863, 188016, 294529, 229001, 310923, 188048, 425626, 229020, 302754, 245412, 40613, 40614, 40615, 229029, 384695, 319162, 327358, 286399, 319177, 212685, 384720, 245457, 302802, 278234, 294622, 278240, 212716, 212717, 294638, 360177, 286459, 278272, 319233, 360195, 278291, 294678, 286494, 409394, 319292, 360252, 360264, 188251, 376669, 245599, 425825, 425833, 417654, 188292, 253829, 327557, 294807, 376732, 311199, 319392, 253856, 294823, 327596, 294843, 188348, 237504, 294850, 384964, 163781, 344013, 212942, 212946, 24532, 212951, 360417, 294886, 253929, 327661, 311281, 311282 ]
d4f4892a34601b34ac662afba59035647506b21b
52999286d2fa127e5cc110d53d7ae14e55a682a6
/SwiftyEcharts/Models/Axis/SECAxis.swift
31939c6174d46ea30ed5bb15292aa227c1d859ce
[ "MIT" ]
permissive
DuanZhang/SwiftyEcharts
bbd80ad5f68b15690ffee4743aed8925695e349b
a62a8cdc6372844f1020097128f90e596323ed1c
refs/heads/master
2021-01-21T05:09:44.256461
2017-03-14T12:34:14
2017-03-14T12:34:14
83,135,432
0
0
null
2017-03-14T12:34:14
2017-02-25T14:01:41
Swift
UTF-8
Swift
false
false
11,378
swift
// // SECAxis.swift // SwiftyEcharts // // Created by Pluto Y on 06/12/2016. // Copyright © 2016 com.pluto-y. All rights reserved. // /// 坐标轴的定义 public struct SECAxis : SECZable { /// 类目数据,在类目轴(type: 'category')中有效。 /// /// 示例: /// /// // 所有类目名称列表 /// data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'] /// // 每一项也可以是具体的配置项,此时取配置项中的 `value` 为类目名 /// data: [{ /// value: '周一', /// // 突出周一 /// textStyle: { /// fontSize: 20, /// color: 'red' /// } /// }, '周二', '周三', '周四', '周五', '周六', '周日'] public struct Data { /// 单个类目名称。 public var value: String? /// 类目标签的文字样式。 public var textStyle: SECTextStyle? public init(_ value: String, _ textStyle: SECTextStyle? = nil) { self.value = value self.textStyle = textStyle } public init() { } } /// 坐标轴所在的 grid 的索引,默认位于第一个 grid。 public var gridIndex: UInt? /// 坐标轴的位置。 public var position: SECPosition? /// 坐标轴相对于默认位置的偏移,在相同的 position 上有多个 X 轴的时候有用。 public var offset: Float? /// 坐标轴类型。 public var type: SECAxisType? /// 坐标轴名称显示位置。 public var name: String? /// 坐标轴名称显示位置。 /// 可选: 'start', 'middle', 'end' public var nameLocation: String? // FIXME: ??? 是否需要添加枚举 /// 坐标轴名称的文字样式。 public var nameTextStyle: SECTextStyle? /// 坐标轴名称与轴线之间的距离。 public var nameGap: Float? /// 坐标轴名字旋转,角度值。 public var nameRotate: Float? /// 是否是反向坐标轴。ECharts 3 中新加。 public var inverse: Bool? /// 坐标轴两边留白策略,类目轴和非类目轴的设置和表现不一样。 /// /// 类目轴中 boundaryGap 可以配置为 true 和 false。默认为 true,这时候刻度只是作为分隔线,标签和数据点都会在两个刻度之间的带(band)中间。 /// 非类目轴,包括时间,数值,对数轴,boundaryGap是一个两个值的数组,分别表示数据最小值和最大值的延伸范围,可以直接设置数值或者相对的百分比,在设置 min 和 max 后无效。 /// /// 示例: /// /// boundaryGap: ['20%', '20%'] public var boundaryGap: SECBoundaryGap? /// 坐标轴刻度最小值,在类目轴中无效。 /// 可以设置成特殊值 'dataMin',此时取数据在该轴上的最小值作为最小刻度。 /// 不设置时会自动计算最小值保证坐标轴刻度的均匀分布。 public var min: Float? /// 坐标轴刻度最大值,在类目轴中无效。 /// 可以设置成特殊值 'dataMax',此时取数据在该轴上的最大值作为最大刻度。 /// 不设置时会自动计算最大值保证坐标轴刻度的均匀分布。 public var max: Float? /// 只在数值轴中(type: 'value')有效。 /// 是否是脱离 0 值比例。设置成 true 后坐标刻度不会强制包含零刻度。在双数值轴的散点图中比较有用。 /// 在设置 min 和 max 之后该配置项无效。 public var scale: Bool? /// 坐标轴的分割段数,需要注意的是这个分割段数只是个预估值,最后实际显示的段数会在这个基础上根据分割后坐标轴刻度显示的易读程度作调整。 /// - Note: 在类目轴中无效。 public var spliteNumber: UInt? /// 自动计算的坐标轴最小间隔大小。 /// 例如可以设置成1保证坐标轴分割刻度显示成整数。 /// - Note: 只在数值轴中(type: 'value')有效。 public var minInterval: UInt? /// 强制设置坐标轴分割间隔。 /// 因为 splitNumber 是预估的值,实际根据策略计算出来的刻度可能无法达到想要的效果,这时候可以使用 interval 配合 min、max 强制设定刻度划分,一般不建议使用。 /// 无法在类目轴中使用。在时间轴(type: 'time')中需要传时间戳,在对数轴(type: 'log')中需要传指数值。 public var interval: Int? /// 对数轴的底数,只在对数轴中(type: 'log')有效。 public var logBase: Float? /// 坐标轴是否是静态无法交互。 public var silent: Bool? /// 坐标轴的标签是否响应和触发鼠标事件,默认不响应。 /// 事件参数如下: /// /// { /// // 组件类型,xAxis, yAxis, radiusAxis, angleAxis /// // 对应组件类型都会有一个属性表示组件的 index,例如 xAxis 就是 xAxisIndex /// componentType: string, /// // 未格式化过的刻度值, 点击刻度标签有效 /// value: '', /// // 坐标轴名称, 点击坐标轴名称有效 /// name: '' /// } public var triggerEvent: Bool? /// 坐标轴轴线相关设置。 public var axisLine: SECAxisLine? /// 坐标轴刻度相关设置。 public var axisTick: SECAxisTick? /// 坐标轴刻度标签的相关设置。 public var axisLabel: SECAxisLabel? /// 坐标轴在 grid 区域中的分隔线。 public var splitLine: SECSplitLine? /// 坐标轴在 grid 区域中的分隔区域,默认不显示。 public var splitArea: SECSplitArea? /// 类目数据,在类目轴(type: 'category')中有效。 public var data: [SECJsonable]? /// X 轴所有图形的 zlevel 值。 /// zlevel用于 Canvas 分层,不同zlevel值的图形会放置在不同的 Canvas 中,Canvas 分层是一种常见的优化手段。我们可以把一些图形变化频繁(例如有动画)的组件设置成一个单独的zlevel。需要注意的是过多的 Canvas 会引起内存开销的增大,在手机端上需要谨慎使用以防崩溃。 /// zlevel 大的 Canvas 会放在 zlevel 小的 Canvas 的上面。 public var zlevel: Float? /// X 轴组件的所有图形的z值。控制图形的前后顺序。z值小的图形会被z值大的图形覆盖。 /// z相比zlevel优先级更低,而且不会创建新的 Canvas。 public var z: Float? public init() { } } extension SECAxis.Data : SECEnumable { public enum Enums { case value(String), textStyle(SECTextStyle) } public typealias ContentEnum = Enums public init(_ elements: Enums...) { for ele in elements { switch ele { case let .value(value): self.value = value case let .textStyle(textStyle): self.textStyle = textStyle } } } } extension SECAxis.Data : SECMappable { public func mapping(map: SECMap) { map["value"] = value map["textStyle"] = textStyle } } extension SECAxis : SECEnumable { public enum Enums { case gridIndex(UInt), position(SECPosition), offset(Float), type(SECAxisType), name(String), nameLocation(String), nameTextStyle(SECTextStyle), nameGap(Float), nameRotate(Float), inverse(Bool), boundaryGap(SECBoundaryGap), min(Float), max(Float), scale(Bool), spliteNumber(UInt), minInterval(UInt), interval(Int), logBase(Float), silent(Bool), triggerEvent(Bool), axisLine(SECAxisLine), axisTick(SECAxisTick), axisLabel(SECAxisLabel), splitLine(SECSplitLine), splitArea(SECSplitArea), data([SECJsonable]), zlevel(Float), z(Float) } public typealias ContentEnum = Enums public init(_ elements: Enums...) { for ele in elements { switch ele { case let .gridIndex(gridIndex): self.gridIndex = gridIndex case let .position(position): self.position = position case let .offset(offset): self.offset = offset case let .type(type): self.type = type case let .name(name): self.name = name case let .nameLocation(nameLocaltion): self.nameLocation = nameLocaltion case let .nameTextStyle(nameTextStyle): self.nameTextStyle = nameTextStyle case let .nameGap(nameGap): self.nameGap = nameGap case let .nameRotate(nameRotate): self.nameRotate = nameRotate case let .inverse(inverse): self.inverse = inverse case let .boundaryGap(boundaryGap): self.boundaryGap = boundaryGap case let .min(min): self.min = min case let .max(max): self.max = max case let .scale(scale): self.scale = scale case let .spliteNumber(spliteNumber): self.spliteNumber = spliteNumber case let .minInterval(minInterval): self.minInterval = minInterval case let .interval(interval): self.interval = interval case let .logBase(logBase): self.logBase = logBase case let .silent(silent): self.silent = silent case let .triggerEvent(triggerEvent): self.triggerEvent = triggerEvent case let .axisLine(axisLine): self.axisLine = axisLine case let .axisTick(axisTick): self.axisTick = axisTick case let .axisLabel(axisLabel): self.axisLabel = axisLabel case let .splitLine(splitLine): self.splitLine = splitLine case let .splitArea(splitArea): self.splitArea = splitArea case let .data(data): self.data = data case let .zlevel(zlevel): self.zlevel = zlevel case let .z(z): self.z = z } } } } extension SECAxis: SECMappable { public func mapping(map: SECMap) { map["gridIndex"] = gridIndex map["position"] = position map["offset"] = offset map["type"] = type map["name"] = name map["nameLocation"] = nameLocation map["nameTextStyle"] = nameTextStyle map["nameGap"] = nameGap map["nameRotate"] = nameRotate map["inverse"] = inverse map["boundaryGap"] = boundaryGap map["min"] = min map["max"] = max map["scale"] = scale map["spliteNumber"] = spliteNumber map["minInterval"] = minInterval map["interval"] = interval map["logBase"] = logBase map["silent"] = silent map["triggerEvent"] = triggerEvent map["axisLine"] = axisLine map["axisTick"] = axisTick map["axisLabel"] = axisLabel map["splitLine"] = splitLine map["splitArea"] = splitArea map["data"] = data map["zlevel"] = zlevel map["z"] = z } }
[ -1 ]
39d72c8b9e92a8d2b7aad8b40671fb5f4e716c1c
70ae293cc3b2b61592372526f25bc17e0d7ce4f9
/FetchRewards_Project/Model/Performer.swift
d3f0846f3ebc42440aab7042b5c8df2398f59a74
[]
no_license
ctran30/FetchRewards_Project
3b21536863808372739b29dee3434c6c4c9eb516
e85f4fc6ba7884212e758842026a1d16bd808d7a
refs/heads/main
2023-04-11T16:16:16.067916
2021-04-27T03:38:48
2021-04-27T03:38:48
361,255,836
0
0
null
null
null
null
UTF-8
Swift
false
false
220
swift
// // Performer.swift // FetchRewards_Project // // Created by Connie Tran on 4/26/21. // import Foundation class Performer { var image: String init (image: String) { self.image = image } }
[ -1 ]
3cff3ee31542cb12ad0de650d59991219c3641a9
65bb8559ecfc48483d319d0d8aef74b74207f463
/PlacenoteSDK/PNSDK/FeaturePointVisualizer.swift
5e05c05e07f31d1298cb23f5ccb081c3a6b7e6c9
[]
no_license
nmathew87/Placenote-SDK-iOS
c7d0c974201f97eb59fc1048d2793198a824a748
7ff6a441d196b52fe83b46d3d64405997a417012
refs/heads/master
2021-04-30T09:24:57.108769
2018-02-08T16:04:51
2018-02-08T16:04:51
121,308,608
1
0
null
null
null
null
UTF-8
Swift
false
false
7,227
swift
// // PointcloudHelper.swift // PlacenoteSDK // // Created by Yan Ma on 2018-01-09. // Copyright © 2018 Vertical AI. All rights reserved. // import Foundation /// A helper class that takes fetch the map of feature points from LibPlacenote /// and visualize it as a pointcloud periodically when enabled class FeaturePointVisualizer: PNDelegate { private let verticesPerCube: Int = 36 private var scene: SCNScene private var ptcloudNode: SCNNode = SCNNode() private var ptcloudTimer: Timer = Timer() /** Constructor that appends the the scene as an input and append a node containing the pointcloud geometry in it - Parameter inputScene: the scene where pointcloud is to rendered */ init(inputScene: SCNScene) { scene = inputScene scene.rootNode.addChildNode(ptcloudNode) LibPlacenote.instance.multiDelegate += self } /** A function to enable visualization of the map pointcloud */ func enableFeaturePoints() { ptcloudTimer = Timer.scheduledTimer( timeInterval: 0.5, target: self, selector: #selector(FeaturePointVisualizer.drawPointcloud), userInfo: nil, repeats: true ) } /** A function to disable visualization of the map pointcloud */ func disableFeaturePoints() { ptcloudTimer.invalidate() reset(); } /** A function to reset the pointcloud visualization */ func reset() { ptcloudNode.removeFromParentNode() } /** Callback to subscribe to pose measurements from LibPlacenote - Parameter outputPose: Inertial pose with respect to the map LibPlacenote is tracking against. - Parameter arkitPose: Odometry pose with respect to the ARKit coordinate frame that corresponds with 'outputPose' in time. */ func onPose(_ outputPose: matrix_float4x4, _ arkitPose: matrix_float4x4) -> Void { } /** Callback to subscribe to mapping session status changes. - Parameter prevStatus: Status before the status change - Parameter currStatus: Current status of the mapping engine */ func onStatusChange(_ prevStatus: LibPlacenote.MappingStatus, _ currStatus: LibPlacenote.MappingStatus) { if (currStatus == LibPlacenote.MappingStatus.waiting) { reset(); } } /** Function to be called periodically to draw the pointcloud geometry */ @objc private func drawPointcloud() { if (LibPlacenote.instance.getMappingStatus() == LibPlacenote.MappingStatus.running) { let landmarks = LibPlacenote.instance.getAllLandmarks(); if (landmarks.count > 0) { addPointcloud(landmarks: landmarks) } } } /** Function to that draws a pointcloud as a set of cubes from the input feature point array - Parameter landmarks: an array of feature points in the inertial map frame to be rendered */ private func addPointcloud(landmarks: Array<PNFeaturePoint>) { //TODO: Only works with OpenGL (where ARKit doesn't work) var vertices : [SCNVector3] = [SCNVector3]() var normals: [SCNVector3] = [SCNVector3]() var colors: [SCNVector3] = [SCNVector3]() vertices.reserveCapacity(landmarks.count*verticesPerCube) normals.reserveCapacity(landmarks.count*verticesPerCube) colors.reserveCapacity(landmarks.count*verticesPerCube) for lm in landmarks { if (lm.measCount < 4) { continue } let pos:SCNVector3 = SCNVector3(x: lm.point.x, y: lm.point.y, z: lm.point.z) getCube(position: pos, size: 0.01, resultCb: {(cubeVerts: [SCNVector3], cubeNorms: [SCNVector3]) -> Void in vertices += cubeVerts normals += cubeNorms }) let color = SCNVector3(x: 1 - Float(lm.measCount)/10, y: Float(lm.measCount)/10, z: 0.0) for _ in 0...(verticesPerCube - 1) { colors.append(color) } } let indices = vertices.enumerated().map{Int32($0.0)} let vertexSource = SCNGeometrySource(vertices: vertices) let normalSource = SCNGeometrySource(normals: normals) let colorData = NSData(bytes: UnsafeRawPointer(colors), length: MemoryLayout<SCNVector3>.size * colors.count) let colorSource: SCNGeometrySource = SCNGeometrySource(data: colorData as Data, semantic: SCNGeometrySource.Semantic.color, vectorCount: colors.count, usesFloatComponents: true, componentsPerVector: 3, bytesPerComponent: MemoryLayout<Float>.size, dataOffset: 0, dataStride: MemoryLayout<SCNVector3>.size ) let indexData = NSData(bytes: UnsafeRawPointer(indices), length: MemoryLayout<Int32>.size * indices.count) let element = SCNGeometryElement(data: indexData as Data, primitiveType: .triangles, primitiveCount: indices.count/3, bytesPerIndex: MemoryLayout<Int32>.size) let pointCloud = SCNGeometry(sources: [vertexSource, normalSource, colorSource], elements: [element]) ptcloudNode.removeFromParentNode() ptcloudNode = SCNNode(geometry: pointCloud) scene.rootNode.addChildNode(ptcloudNode) } /** Returns vertices and normals for a cube mesh given the center point and the size - Parameter position: position vector of the center point of the cube - Parameter size: length of the edge in a cube - Parameter resultCb: callback to return the vertices and normal for the resulting cube */ private func getCube(position: SCNVector3, size: Float, resultCb: (_ vertices: [SCNVector3], _ normals: [SCNVector3]) -> Void) { let halfEdge = size/2 let v0 = SCNVector3(x: -halfEdge + position.x, y: -halfEdge + position.y, z: halfEdge + position.z) let v1 = SCNVector3(x: halfEdge + position.x, y: -halfEdge + position.y, z: halfEdge + position.z) let v2 = SCNVector3(x: halfEdge + position.x, y: halfEdge + position.y, z: halfEdge + position.z) let v3 = SCNVector3(x: -halfEdge + position.x, y: halfEdge + position.y, z: halfEdge + position.z) let v4 = SCNVector3(x: -halfEdge + position.x, y: -halfEdge + position.y, z: -halfEdge + position.z) let v5 = SCNVector3(x: halfEdge + position.x, y: -halfEdge + position.y, z: -halfEdge + position.z) let v6 = SCNVector3(x: -halfEdge + position.x, y: halfEdge + position.y, z: -halfEdge + position.z) let v7 = SCNVector3(x: halfEdge + position.x, y: halfEdge + position.y, z: -halfEdge + position.z) let vertices: [SCNVector3] = [ // front face v0, v1, v3, v0, v1, v2, // right face v1, v7, v2, v1, v5, v7, // back face v5, v6, v7, v5, v4, v6, // left face v4, v3, v6, v4, v0, v3, // top face v3, v7, v6, v3, v2, v7, // bottom face v1, v4, v5, v1, v0, v4 ] let normalsPerFace = 6 let xUnitVec = SCNVector3(x: 1, y: 0, z: 0) let negXUnitVec = SCNVector3(x: -1, y: 0, z: 0) let yUnitVec = SCNVector3(x: 0, y: 1, z: 0) let negYUnitVec = SCNVector3(x: 0, y: -1, z: 0) let zUnitVec = SCNVector3(x: 0, y: 0, z: 1) let negZUnitVec = SCNVector3(x: 0, y: 0, z: -1) let normals: [SCNVector3] = [ zUnitVec, xUnitVec, negZUnitVec, negXUnitVec, yUnitVec, negYUnitVec ].map{[SCNVector3](repeating: $0, count: normalsPerFace)}.flatMap{$0} resultCb(vertices, normals) } }
[ -1 ]
28df8dcb395f7c4be68f6bd669ea4445fd8eab76
363e27c6fbb4f4c6ea245d9e8f3de51fc8e76636
/SmartCalendarDemo/UnitView/SCCalendarListView.swift
21869b8f17aab98d1ba9186a9eb5599c0df33680
[]
no_license
ProgLan/SmartCalendar
aea4531617a1cf2f51dd2bd3d002df8e6f66b92f
35d34bf0a2245d4793fdffe3b408932397f12685
refs/heads/master
2016-08-12T14:37:59.706164
2015-11-06T00:38:48
2015-11-06T00:38:48
45,346,927
0
0
null
null
null
null
UTF-8
Swift
false
false
166
swift
// // SCCalendarListView.swift // SmartCalendar // // Created by Lan Zhang on 11/4/15. // Copyright © 2015 Lan Zhang. All rights reserved. // import Foundation
[ -1 ]
1e5d1a6242e81716c559437db00486e880953f08
663f6fb8aa104024ac1abac02fad38a7718dd369
/fontawesome_sample/fontawesome-sampleTests/fontawesome_sampleTests.swift
cd66ef0c4c4acd2db01c543dab390d0ceff941b1
[]
no_license
takayuki-hara/sample-swift-xcode
065c15bdc6b22f8f1ec7ca5c089191a5fc693e94
19536a24c3502220b82830f86b7eb78ed268ce99
refs/heads/master
2020-03-14T10:03:19.876555
2018-07-25T08:27:27
2018-07-25T08:27:27
131,558,155
0
0
null
null
null
null
UTF-8
Swift
false
false
1,019
swift
// // fontawesome_sampleTests.swift // fontawesome-sampleTests // // Created by 原隆幸 on 2018/07/18. // Copyright © 2018年 takayuki.hara. All rights reserved. // import XCTest @testable import fontawesome_sample class fontawesome_sampleTests: 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, 182296, 241692, 98333, 307231, 16419, 229413, 102437, 354343, 204840, 354345, 227370, 278570, 292902, 233517, 155694, 309295, 229424, 282672, 223274, 344107, 237620, 124975, 229430, 253999, 346162, 319542, 124984, 358456, 288833, 288834, 286788, 352326, 311372, 354385, 196691, 223316, 280661, 315476, 329814, 278615, 307289, 354393, 338007, 200794, 237663, 315487, 309345, 45153, 280675, 227428, 280677, 313447, 278634, 315498, 319598, 288879, 352368, 299121, 284788, 233589, 223350, 233590, 280694, 131191, 333940, 237689, 215164, 313469, 215166, 131198, 292992, 317569, 278655, 194691, 227460, 333955, 280712, 215178, 235662, 311438, 241808, 323729, 325776, 317587, 278677, 284825, 284826, 278685, 346271, 311458, 278691, 233636, 49316, 333991, 333992, 233642, 284842, 323236, 32941, 278704, 239793, 299187, 278708, 125109, 131256, 182456, 278714, 223419, 280762, 184505, 299198, 379071, 280768, 299203, 227524, 309444, 301251, 338119, 280778, 282831, 321745, 254170, 280795, 227548, 229597, 301279, 311519, 356576, 280802, 338150, 176362, 286958, 125169, 338164, 327929, 184570, 243962, 125183, 309503, 125188, 313608, 125193, 375051, 278797, 180493, 125198, 325905, 254226, 125203, 125208, 325912, 282909, 299293, 278816, 237857, 125217, 211235, 217380, 233762, 211238, 305440, 151847, 282919, 125235, 332085, 280887, 125240, 332089, 278842, 315706, 282939, 307517, 287041, 260418, 241986, 139589, 280902, 319813, 311621, 332101, 182598, 323916, 319821, 254286, 348492, 250192, 6481, 323920, 344401, 348500, 366929, 155990, 366930, 6489, 379225, 272729, 323935, 106847, 391520, 321894, 416104, 280939, 242029, 246127, 285040, 313713, 242033, 354676, 139640, 246136, 246137, 291192, 311681, 362881, 248194, 311685, 225670, 395659, 227725, 395661, 240016, 291224, 285084, 317852, 283038, 300489, 61857, 285090, 61859, 289189, 375207, 340398, 377264, 299441, 61873, 293303, 283064, 61880, 278970, 319930, 336317, 293310, 278978, 127427, 127428, 283075, 291267, 188871, 324039, 278989, 317901, 281040, 278993, 326100, 278999, 328152, 176601, 242139, 369116, 188894, 287198, 279008, 160225, 358882, 285150, 342498, 279013, 242148, 195045, 279018, 291311, 281072, 309744, 279029, 279032, 233978, 279039, 291333, 342536, 287241, 279050, 340490, 303631, 283153, 279057, 279062, 289304, 279065, 342553, 291358, 182817, 180771, 375333, 377386, 244269, 283182, 283184, 236081, 234036, 23092, 279094, 315960, 352829, 70209, 309830, 301638, 348742, 55881, 322120, 348749, 281166, 281171, 287318, 309846, 244310, 295519, 354911, 436832, 66150, 111208, 344680, 279146, 191082, 313966, 281199, 295536, 287346, 287352, 301689, 279164, 189057, 311941, 348806, 279177, 369289, 152203, 330379, 344715, 287374, 184973, 311949, 330387, 330388, 352917, 227990, 230040, 314009, 271000, 303771, 221852, 342682, 279206, 295590, 279210, 287404, 285361, 303793, 299699, 342706, 299700, 166582, 164533, 314040, 287417, 158394, 303803, 338613, 285373, 287422, 342713, 66242, 287433, 225995, 154316, 363211, 287439, 279252, 96984, 287452, 318173, 289502, 363230, 295652, 338662, 285415, 342762, 346858, 293612, 289518, 312047, 279280, 199414, 154359, 230134, 299770, 234234, 221948, 35583, 205568, 242433, 295682, 299776, 285444, 162561, 363263, 322313, 322319, 291604, 166676, 207640, 326429, 336671, 293664, 326433, 344865, 234277, 283430, 279336, 289576, 262954, 318250, 295724, 312108, 152365, 301871, 164656, 303920, 262962, 318252, 353069, 328499, 242485, 353078, 230199, 285497, 353079, 289598, 160575, 281408, 336702, 420677, 318278, 353094, 353095, 299849, 283467, 201551, 293711, 281427, 353108, 353109, 281433, 230234, 301918, 295776, 293730, 303972, 351077, 275303, 230248, 177001, 342887, 308076, 242541, 400239, 246641, 330609, 174963, 207732, 310131, 209783, 246648, 209785, 279417, 269178, 308092, 177019, 361337, 158593, 254850, 359298, 113542, 287622, 240518, 228233, 228234, 308107, 56208, 308112, 234386, 295824, 293781, 209817, 324506, 324507, 318364, 310176, 310178, 189348, 324517, 283558, 289703, 279464, 293800, 353195, 140204, 236461, 293806, 353197, 353196, 304051, 189374, 353216, 349121, 363458, 213960, 279498, 316364, 183248, 338899, 340955, 248797, 207838, 50143, 130016, 340961, 64485, 314342, 234472, 234473, 123881, 324586, 289774, 183279, 304110, 320494, 340974, 287731, 316405, 240630, 295927, 201720, 304122, 314362, 320507, 328700, 328706, 234500, 320516, 322570, 230410, 320527, 146448, 324625, 234514, 316437, 140310, 418837, 197657, 281626, 201755, 175132, 336929, 300068, 357414, 248872, 345132, 238639, 300084, 252980, 322612, 359478, 324666, 238651, 302139, 308287, 21569, 359495, 238664, 300111, 314448, 234577, 341073, 296019, 353367, 234587, 156764, 277597, 304222, 156765, 281697, 302177, 314467, 281700, 250981, 300135, 322663, 300136, 228458, 207979, 279660, 316520, 316526, 15471, 144496, 234609, 312434, 357486, 187506, 353397, 285814, 300151, 279672, 160891, 341115, 363644, 300158, 150657, 187521, 234625, 285828, 279685, 302213, 222343, 302216, 285830, 248961, 228491, 349316, 349318, 234638, 228493, 285838, 169104, 162961, 177296, 308372, 185493, 326804, 238743, 296086, 119962, 283802, 296092, 285851, 300187, 300188, 339102, 302240, 306338, 343203, 234663, 300201, 249002, 300202, 253099, 238765, 279728, 238769, 367799, 208058, 339130, 64700, 228540, 228542, 283840, 302274, 279747, 343234, 367810, 259268, 283847, 353479, 62665, 353481, 353482, 283852, 244940, 283853, 279760, 290000, 228563, 189652, 279765, 296153, 357595, 279774, 304351, 298212, 304356, 330984, 279785, 228588, 234733, 253167, 279792, 353523, 298228, 302325, 234742, 353524, 216315, 292091, 208124, 316669, 363771, 388349, 228609, 279814, 322824, 242954, 292107, 312587, 328971, 251153, 173334, 245019, 320796, 126237, 339234, 130338, 130343, 351537, 345396, 300343, 116026, 222524, 286013, 286018, 279875, 193859, 300359, 230729, 294218, 234827, 224586, 222541, 296270, 234831, 238927, 372043, 177484, 251213, 296273, 120148, 318805, 283991, 357719, 222559, 314720, 292195, 294243, 230756, 281957, 163175, 333160, 230765, 284014, 279920, 243056, 312689, 296307, 314739, 116084, 327025, 327031, 181625, 290173, 306559, 224640, 378244, 298374, 314758, 314760, 142729, 388487, 368011, 314766, 296335, 112017, 112018, 306579, 234898, 282007, 357786, 318875, 290207, 314783, 333220, 314789, 282022, 279974, 282024, 241066, 316842, 286129, 173491, 304564, 279989, 210358, 284089, 228795, 292283, 302529, 302531, 163268, 380357, 415171, 300487, 306631, 296392, 280010, 361927, 310732, 302540, 280013, 64975, 312782, 306639, 310736, 370123, 148940, 327121, 222675, 366037, 210390, 210391, 353750, 228827, 286172, 239068, 210393, 280032, 144867, 310757, 187878, 316902, 280041, 361963, 54765, 191981, 306673, 321009, 308723, 251378, 306677, 343542, 300535, 280055, 288249, 286202, 300536, 290300, 286205, 302590, 343543, 294400, 290301, 282114, 210433, 306692, 306693, 228867, 366083, 323080, 230921, 253452, 296461, 323087, 304656, 282129, 329232, 316946, 308756, 146964, 398869, 282136, 308764, 282141, 349726, 302623, 282146, 306723, 286244, 245287, 245292, 349741, 169518, 230959, 286254, 288309, 290358, 288318, 235070, 280130, 349763, 124485, 56902, 282183, 218696, 288327, 292425, 288326, 243274, 128587, 333388, 228943, 286288, 333393, 290390, 300630, 306776, 235095, 196187, 239198, 343647, 286306, 374372, 282213, 317032, 323178, 54893, 138863, 222832, 314998, 247416, 288378, 366203, 175741, 337535, 294529, 239237, 282245, 286343, 282246, 229001, 288392, 290443, 224901, 310923, 188048, 323217, 239250, 282259, 345752, 229020, 282271, 282273, 302754, 255649, 282276, 40613, 40614, 40615, 282280, 290471, 229029, 298667, 300714, 245412, 298661, 286388, 286391, 321207, 296632, 319162, 280251, 282303, 286399, 280257, 218819, 321219, 306890, 280267, 302797, 212685, 333517, 333520, 241361, 302802, 245457, 333521, 333523, 280278, 282327, 298712, 278233, 278234, 280280, 67292, 18138, 294622, 321247, 278240, 282339, 12010, 282348, 239341, 212716, 212717, 280300, 284401, 282355, 282358, 313081, 229113, 300794, 286459, 325371, 124669, 194303, 194304, 288512, 278272, 311042, 288516, 175873, 319233, 280327, 216839, 280329, 323331, 300811, 323332, 284429, 284431, 278291, 278293, 294678, 321302, 366360, 116505, 284442, 249626, 325404, 286494, 321310, 282400, 313120, 241441, 315171, 325410, 339745, 341796, 247590, 257830, 284459, 294700, 280366, 317232, 282417, 200498, 280372, 321337, 282427, 360252, 325439, 282434, 315202, 307011, 280390, 282438, 345929, 341836, 304977, 307025, 413521, 325457, 18262, 216918, 307031, 280410, 284507, 188251, 370522, 345951, 237408, 284512, 284514, 362337, 345955, 296806, 276327, 292712, 288619, 288620, 325484, 280430, 282480, 292720, 362352, 313203, 325492, 300918, 241528, 194429, 124798, 325503, 182144, 305026, 253829, 333701, 67463, 282504, 243591, 243597, 325518, 110480, 184208, 282518, 282519, 124824, 214937, 214938, 294809, 239514, 329622, 294814, 118685, 298909, 319392, 300963, 292771, 354212, 294823, 298920, 333735, 284587, 292782, 124852, 243637, 288697, 98239, 214977, 280514, 294850, 163781, 280519, 247757, 344013, 301008, 212946, 194515, 219101, 280541, 292836, 292837, 294886, 298980, 337895, 247785, 253929, 296941, 327661, 362480, 311282, 325619, 333817, 292858, 313339 ]
f414b1621870abd9811780e46afe5d8e6f41439a
00d7ab63240268ea3812c90efff7b0a2c214efe6
/studentTestSwift/studentTestSwiftTests/studentTestSwiftTests.swift
ce4ff99d3caae60742831aa26d655c9b79ed8488
[]
no_license
myandroid007/zjSwiftRadio
517a744d432e3b403ed63f2775e45690778ad2df
ab29d04fdb02743c323e8bc8af5b07b0963cd6af
refs/heads/master
2021-01-15T15:31:55.039730
2016-02-23T10:25:12
2016-02-23T10:25:12
null
0
0
null
null
null
null
UTF-8
Swift
false
false
1,000
swift
// // studentTestSwiftTests.swift // studentTestSwiftTests // // Created by MACMINI on 16/2/4. // Copyright © 2016年 LZJ. All rights reserved. // import XCTest @testable import studentTestSwift class studentTestSwiftTests: XCTestCase { override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. super.tearDown() } func testExample() { // This is an example of a functional test case. // Use XCTAssert and related functions to verify your tests produce the correct results. } func testPerformanceExample() { // This is an example of a performance test case. self.measureBlock { // Put the code you want to measure the time of here. } } }
[ 333828, 282633, 313357, 305179, 317467, 98333, 278558, 307231, 313375, 241692, 102437, 292902, 354343, 229413, 354345, 278570, 227370, 360491, 176175, 282672, 229424, 276534, 319542, 180280, 288828, 325694, 159807, 288833, 288834, 286788, 280649, 254027, 311372, 311374, 223316, 315476, 223318, 278615, 180311, 307289, 288857, 227417, 180312, 237663, 194656, 309345, 315487, 307299, 227428, 329829, 276582, 313447, 131178, 278634, 276589, 278638, 227439, 319598, 288879, 204916, 284788, 223350, 131191, 280694, 131189, 288889, 215164, 131198, 278655, 292992, 141450, 215178, 311435, 311438, 278670, 276627, 317587, 278677, 276632, 284826, 278685, 311458, 196773, 299174, 284841, 284842, 153776, 278704, 323762, 129203, 299187, 131256, 184505, 280762, 227513, 295098, 278714, 223419, 299198, 180408, 227524, 309444, 276682, 282831, 280795, 227548, 301279, 311519, 317664, 280802, 356576, 321772, 286958, 233715, 157944, 211193, 184570, 227578, 168188, 184575, 319763, 309529, 278810, 368923, 282909, 299293, 278816, 282913, 233762, 227616, 211238, 282919, 262450, 98610, 280887, 315706, 282939, 278842, 287041, 287043, 139589, 280902, 227654, 311621, 332101, 227658, 276813, 6481, 6482, 278869, 289110, 168281, 6489, 323935, 106847, 391520, 276835, 321894, 416104, 280939, 276847, 285040, 199029, 291192, 106874, 313727, 280961, 340357, 311685, 227725, 240016, 178578, 178582, 190871, 293274, 285084, 61857, 285090, 61859, 246178, 289189, 289194, 108972, 377264, 278961, 278965, 293303, 283064, 276920, 278970, 293306, 33211, 276925, 358843, 319930, 278978, 291267, 283075, 127428, 324039, 278989, 281037, 317901, 281040, 278993, 373197, 326100, 176601, 369116, 285150, 287198, 279008, 227809, 358882, 188894, 279013, 227813, 279018, 279022, 291311, 309744, 281072, 294807, 279029, 279032, 233978, 279039, 291333, 276998, 287241, 279050, 186893, 303631, 283153, 279057, 303636, 279062, 223767, 279065, 223769, 291358, 182817, 180771, 293419, 244269, 283182, 283184, 236081, 234036, 289332, 279094, 23092, 277048, 338490, 242237, 115270, 293448, 55881, 377418, 281166, 281171, 285271, 297560, 295519, 242273, 66150, 277094, 279144, 111208, 279146, 277101, 313966, 281199, 295536, 287346, 277111, 287352, 279164, 291454, 189057, 184962, 303746, 152203, 277133, 133774, 311954, 330387, 330388, 117397, 227990, 230040, 295576, 289434, 303771, 221852, 205471, 279206, 285353, 295599, 205487, 303793, 279217, 285361, 342706, 299699, 166582, 289462, 293556, 336564, 230072, 285371, 285372, 285373, 285374, 287422, 303803, 158394, 66242, 199366, 287433, 225997, 287439, 242386, 279252, 226004, 203477, 226007, 287452, 289502, 226019, 279269, 375526, 285415, 234217, 342762, 277227, 330474, 230125, 289518, 312047, 279280, 209783, 199414, 230134, 228088, 299770, 234234, 344827, 221948, 279294, 205568, 242433, 295682, 299776, 285444, 291585, 209670, 234241, 322313, 226058, 234250, 234253, 295697, 285458, 310036, 166676, 234263, 285466, 283419, 291612, 234268, 326433, 234277, 283430, 262951, 289576, 293672, 279336, 234283, 312108, 353069, 234286, 285487, 234289, 262962, 234294, 230199, 285497, 293693, 162621, 234301, 289598, 281408, 295746, 162626, 277316, 342847, 234311, 234312, 299849, 353095, 234317, 277325, 293711, 234323, 234326, 281433, 230234, 234331, 301918, 279392, 127841, 349026, 242529, 303972, 234340, 234343, 230248, 201577, 234346, 400239, 246641, 234355, 295798, 228215, 277366, 234360, 279417, 177019, 209785, 234361, 277370, 234366, 291712, 158593, 234367, 269178, 234372, 226181, 287622, 113542, 213894, 226184, 228234, 308107, 277381, 56208, 308112, 234386, 295824, 234387, 293781, 234392, 277403, 324507, 400283, 234400, 279456, 310178, 289698, 189348, 234404, 283558, 310182, 293800, 279464, 289703, 234409, 275371, 236461, 353197, 234419, 234425, 234427, 287677, 189374, 289727, 234430, 353216, 234436, 234438, 279498, 52172, 234444, 234445, 183248, 234451, 234454, 304087, 234457, 234463, 340961, 234466, 277479, 234472, 234473, 52200, 326635, 324586, 203757, 304110, 234477, 234482, 287731, 277492, 314355, 316405, 295927, 312314, 293886, 234498, 330754, 234500, 277509, 134150, 277510, 230410, 234506, 330763, 295953, 324625, 277523, 277524, 140310, 293910, 230423, 197657, 281626, 281625, 175132, 320536, 189474, 234531, 300068, 330788, 234534, 310317, 234542, 238639, 234548, 238651, 234555, 277563, 230463, 234560, 207938, 234565, 234569, 300111, 234577, 296019, 234583, 234584, 353367, 234587, 277597, 304222, 113760, 281697, 302177, 230499, 281700, 257125, 300135, 322663, 228458, 207979, 275565, 15471, 144496, 156785, 312434, 275571, 300151, 234616, 398457, 291959, 160891, 285820, 234622, 300158, 187521, 285828, 279685, 285830, 302213, 253063, 234632, 275591, 228491, 330888, 162961, 234642, 308372, 185493, 296086, 238743, 187544, 300187, 296092, 119963, 339102, 302240, 330913, 234656, 306338, 234659, 234663, 275625, 300202, 281771, 300201, 3246, 279728, 238769, 226481, 294074, 208058, 277690, 230588, 228542, 339130, 283840, 322749, 302274, 279747, 283847, 353479, 283852, 279760, 290000, 228563, 189652, 189653, 333011, 279765, 316627, 296153, 279774, 363744, 310497, 195811, 304356, 298212, 290022, 222440, 228588, 234733, 298221, 328940, 279792, 298228, 204022, 234742, 228600, 208124, 316669, 234755, 322824, 312587, 292107, 328971, 277792, 130338, 339234, 199971, 304421, 109861, 130343, 277800, 279854, 113966, 226608, 298291, 300343, 222524, 333117, 226624, 286018, 113987, 279875, 193859, 15686, 304456, 230729, 226632, 294218, 177484, 222541, 296270, 238927, 372043, 296273, 120148, 314709, 318805, 357719, 283991, 218462, 224606, 222559, 142689, 234850, 230756, 281957, 163175, 281962, 134506, 230765, 306542, 296303, 279920, 284014, 243056, 327024, 181625, 290173, 306559, 179587, 148867, 294275, 298374, 281992, 142729, 296335, 230799, 112017, 306579, 9619, 282007, 357786, 318875, 290207, 310692, 333220, 282022, 279974, 282024, 316842, 310701, 279984, 286129, 279989, 296375, 284089, 296387, 292292, 415171, 163269, 306631, 296392, 300489, 296391, 300487, 310732, 280013, 312782, 64975, 222675, 284116, 329173, 228824, 212442, 228827, 239068, 226781, 286172, 280032, 310757, 187878, 316902, 280041, 296425, 306673, 296433, 308723, 333300, 306677, 191990, 280055, 300536, 300535, 333303, 286202, 290300, 286205, 228861, 302590, 290301, 296448, 230913, 300542, 306692, 306693, 329225, 192010, 296461, 149007, 304656, 65041, 308756, 282136, 204313, 282141, 230943, 333343, 306723, 286244, 278060, 286254, 230959, 288309, 290358, 312889, 194110, 280130, 349763, 288326, 282183, 288327, 276040, 366154, 218696, 243274, 276045, 333388, 224847, 286288, 280147, 290390, 128599, 235095, 300630, 306776, 147036, 243292, 239198, 333408, 286306, 300644, 282213, 317032, 310889, 325231, 222832, 276085, 314998, 325245, 188031, 294529, 192131, 312965, 282246, 286343, 288392, 229001, 290443, 310923, 323217, 302739, 282259, 276120, 298654, 282271, 276126, 282273, 302754, 282276, 40613, 40614, 40615, 282280, 229029, 300714, 290471, 323236, 278191, 198324, 286388, 296628, 286391, 321207, 296632, 306874, 280251, 286399, 282303, 280257, 282312, 280267, 276173, 282318, 302797, 212688, 333517, 302802, 245457, 241361, 241365, 333521, 286423, 280280, 282327, 278233, 278234, 67292, 216795, 294622, 18138, 278240, 276195, 282339, 153319, 313065, 12010, 288491, 280300, 239341, 282348, 284401, 419569, 276210, 323316, 282358, 229113, 313081, 286459, 276219, 194303, 194304, 278272, 288512, 311042, 288516, 319233, 323331, 216839, 280327, 280329, 282378, 323332, 276238, 321295, 284431, 278291, 278293, 294678, 116505, 284442, 278299, 276253, 282400, 241442, 333610, 284459, 159533, 282417, 200498, 296755, 280372, 280374, 319288, 321337, 276282, 276283, 280380, 345919, 276287, 282434, 307011, 280390, 282438, 280392, 276294, 276298, 323406, 304977, 216918, 307031, 341847, 280410, 284507, 300894, 284512, 237408, 296806, 276327, 282474, 288619, 288620, 280430, 313199, 282480, 296814, 313203, 246648, 300918, 276344, 317304, 194429, 241540, 67463, 282504, 315273, 315274, 325515, 184208, 110480, 40853, 282518, 282519, 44952, 214937, 239514, 294809, 214938, 298909, 294814, 311199, 247712, 292771, 294823, 298920, 284587, 292782, 323507, 282549, 276408, 288697, 161722, 294843, 290746, 280514, 276421, 280519, 284619, 344013, 276430, 231375, 301008, 153554, 24532, 212951, 276444, 280541, 329695, 292836, 298980, 294886, 276454, 247785, 276459, 296941, 278512, 311282, 282612, 292858, 290811 ]
3e236026560dcc0a2db0e29560360170b3fd45f2
af2278fe93b81ce61bafcc57e20b8322eaf83a3e
/Sources/IGDB/Extensions/Keyword+Composable.swift
5648a44de93f5bbb3a5bbde3aa2b16fb9963e7fb
[ "MIT" ]
permissive
dmarschner/igdb
ebb764f729b043174fe2ef69f6d8c10bfa39d64d
4725642bc33071c6a05fb4b624cc3d91c12b1f6e
refs/heads/master
2021-01-06T16:08:30.887257
2019-01-24T18:12:07
2019-01-24T18:12:07
null
0
0
null
null
null
null
UTF-8
Swift
false
false
962
swift
import Foundation import Apicalypse extension Keyword: Composable { // sourcery:inline:Keyword.Composable // swiftlint:disable all /// Returns the coding key of given `keyPath` /// /// - Parameter keyPath: The `keyPath` to look up /// - Returns: The coding keys of given `keyPath` public static func codingPath(for keyPath: PartialKeyPath<Keyword>) throws -> CodingKey { switch keyPath { // Evaluate the `keyPath`s in `Self` case \Keyword.identifier: return CodingKeys.identifier case \Keyword.createdAt: return CodingKeys.createdAt case \Keyword.updatedAt: return CodingKeys.updatedAt case \Keyword.name: return CodingKeys.name case \Keyword.slug: return CodingKeys.slug case \Keyword.url: return CodingKeys.url // No matching coding key found. default: throw Error.unexpectedKeyPath(keyPath) } } // swiftlint:enable all // sourcery:end }
[ -1 ]
4dfdb5f16cefd67362224c2b22393d73a3a9b545
131d033f368396d52899ca0125c3b52a318a626a
/Student Resources/2 - Introduction to UIKit/2 - Functions/lab/Lab - Functions.playground/Pages/4. App Exercise - Progress Updates.xcplaygroundpage/Contents.swift
f386d3e155be99cae85f844f7e9db05a6d3ff751
[]
no_license
carocaro22/app-dev-with-swift
ebec17a74c9ff393f88fe2454862ea389dde8132
12d713b72a30996c75181e2de0a95f0ab022c8cc
refs/heads/main
2023-08-24T19:34:08.521349
2021-09-26T10:17:29
2021-09-26T10:17:29
362,523,784
0
0
null
null
null
null
UTF-8
Swift
false
false
2,761
swift
/*: ## App Exercise - Progress Updates >These exercises reinforce Swift concepts in the context of a fitness tracking app. In many cases you want to provide input to a function. For example, the progress function you wrote in the Functioning App exercise might be located in an area of your project that doesn't have access to the value of `steps` and `goal`. In that case, whenever you called the function, you would need to provide it with the number of steps that have been taken and the goal for the day so it can print the correct progress statement. Rewrite the function `progressUpdate`, only this time give it two parameters of type `Int` called `steps` and `goal`, respectively. Like before, it should print "You're off to a good start." if steps is less than 10% of goal, "You're almost halfway there!" if steps is less than half of goal, "You're over halfway there!" if steps is less than 90% of goal, "You're almost there!" if steps is less than goal, and "You beat your goal!" otherwise. Call the function and observe the printout. Call the function a number of times, passing in different values of `steps` and `goal`. Observe the printouts and make sure what is printed to the console is what you would expect for the parameters passsed in. */ func progressUpdate(goal: Double, steps: Int){ if Double(steps) < (goal*0.1) { print("You're off to a good start") } else if goal*0.1 < Double(steps) && Double(steps) < goal*0.5 { print("You're almost halfway there!") } else if goal*0.5 < Double(steps) && Double(steps) < goal*0.9{ print("You're over halfway there!") } else if goal*0.9 < Double(steps) && Double(steps) < goal{ print("You're almost there!") } else if goal < Double(steps) { print("You beat your goal") } } progressUpdate(goal: 200, steps: 105) progressUpdate(goal: 20, steps: 1) /*: Your fitness tracking app is going to help runners stay on pace to reach their goals. Write a function called pacing that takes four `Double` parameters called `currentDistance`, `totalDistance`, `currentTime`, and `goalTime`. Your function should calculate whether or not the user is on pace to hit or beat `goalTime`. If yes, print "Keep it up!", otherwise print "You've got to push it just a bit harder!" */ func pacing (currentDistance: Double, totalDistance:Double, currentTime: Double, goalTime: Double) { if ((currentDistance/currentTime) >= (totalDistance/goalTime)) { print("Keep it up!") } else { print("You've got to push it just a bit harder") } } pacing(currentDistance: 6, totalDistance: 12, currentTime: 2, goalTime: 6) //: [Previous](@previous) | page 4 of 6 | [Next: Exercise - Return Values](@next)
[ -1 ]
163fc459c0a845291844b6abb32117b347a9bac1
2452f5027fac4d61dfbf800cc38ca432e91a9d61
/GIF/Views/CollectionViewCellWithGif/CollectionViewCellWithGif.swift
f8aa033695afe0ebcc858903d70adf2759767acd
[]
no_license
lagutik/SearchGif
283766dc7cb1891be63c19b3d6e27766543f8301
f294b02b0533d64cd3bf4b64c2260a4cf99893d2
refs/heads/master
2023-06-18T18:03:59.827946
2021-07-06T15:29:26
2021-07-06T15:29:26
383,426,660
0
0
null
null
null
null
UTF-8
Swift
false
false
486
swift
// // CollectionViewCellWithGif.swift // GIF // // Created by admin on 28.05.2021. // import UIKit import SwiftyGif class CollectionViewCellWithGif: UICollectionViewCell { // MARK: - Static static let identifier: String = "CollectionViewCellWithGif" // MARK: - IBOutlets @IBOutlet weak var gifImageView: UIImageView! // MARK: - Actions func runGif(with url: URL) { gifImageView.clear() gifImageView.setGifFromURL(url) } }
[ -1 ]
a765b882a7f0dba0d64872ace400d1c83d03ca5c
469ee63d8af7f84e3030d8a7c298245978cff026
/Citizen/Modules/Info/Contract/InfoContract.swift
d7913739538e9bd4fb95180a75c5ead98a70d061
[]
no_license
KainaKarimova/citizen
7e5fbddc0b1e5ba0c882501a96013a7de22d43eb
c3b63dbb1780f144c0fe2a0f58e844248a77f1d6
refs/heads/master
2020-12-14T03:35:08.935979
2020-02-08T15:35:51
2020-02-08T15:35:51
239,154,500
1
0
null
null
null
null
UTF-8
Swift
false
false
623
swift
// // InfoContract.swift // Citizen // // Created by Karina Karimova on 9/14/19. // Copyright © 2019 Karina Karimova. All rights reserved. // import Foundation protocol InfoView: IndicatableView { // TODO: Declare view methods } protocol InfoPresentation: class { // TODO: Declare presentation methods func refresh() func didTapLeftButton() } protocol InfoUseCase: class { // TODO: Declare use case methods } protocol InfoInteractorOutput: InteractorOutputProtocol { // TODO: Declare interactor output methods } protocol InfoWireframe: class { // TODO: Declare wireframe methods func popBack() }
[ -1 ]
6a0e589e28e8e0d8065aed588dccda78eba807cf
363fa12ec8d5653973149c849f115ec0f4c1387d
/ios/FinalProject/MenuTableViewController.swift
46a8fa7d149dcdfc06783f53923f651d7395cd61
[]
no_license
francopiloto/ParkingTicket
f4fd7383c73a5b1c0dc14e79847e77ce2e1ad3f8
7df5347f84b9bc709c780149ec59c5281f516464
refs/heads/master
2020-04-18T20:08:26.634758
2019-02-17T20:25:00
2019-02-17T20:25:00
167,715,971
0
0
null
null
null
null
UTF-8
Swift
false
false
1,195
swift
// // MenuTableViewController.swift // FinalProject // // Created by MacStudent on 2018-02-26. // Copyright © 2018 MacStudent. All rights reserved. // import UIKit class MenuTableViewController : UITableViewController { var viewName = [ ["HomeVC", "AddTicketVC", "LocationVC", "ReportVC"], ["ProfileVC", "InstructionVC", "ContactVC", "LoginVC"] ]; override func viewDidLoad() { super.viewDidLoad(); } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning(); } override func numberOfSections(in tableView: UITableView) -> Int { return viewName.count; } override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return viewName[section].count; } override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { let storyBoard : UIStoryboard = UIStoryboard(name: "Main", bundle: nil); let viewController = storyBoard.instantiateViewController(withIdentifier: viewName[indexPath.section][indexPath.row]); self.present(viewController, animated: true, completion: nil); } }
[ -1 ]
0ddcf71d868649c23d1e622e69cdff7bbe0b3c30
d7f4be07ab564196a062c60c7a08fbd39a24725f
/source/ZYScrollSegmentBar.swift
2cf12f4c2c4f02634a8c95682bc908b21a3fb115
[ "MIT" ]
permissive
alfredcc/ZYScrollSegmentBar
a1c1353d86dce138b01f26d055156c2e2c0e36ff
1808d9d92e0f6012384ab2005ab303294440ea66
refs/heads/master
2021-01-19T21:21:22.688077
2016-01-09T02:27:01
2016-01-09T02:27:01
46,568,225
3
0
null
null
null
null
UTF-8
Swift
false
false
8,250
swift
// // ZYScrollSegmentBar.swift // ZYScrollSegmentBar // // Created by race on 15/11/20. // Copyright © 2015年 alfredcc. All rights reserved. // import UIKit // MARK: - Protocol protocol ZYScrollSegmentBarDataSource: NSObjectProtocol { func numberOfItems(scrollTabBar: ZYScrollSegmentBar) -> Int func viewControllerForScrollTabBar(scrollTabBar: ZYScrollSegmentBar, atIndex: Int) -> UIViewController } @objc protocol ZYScrollSegmentBarDelegate: NSObjectProtocol { optional func tabBarDidScrollAtIndex(tabBar: ZYScrollSegmentBar, index:Int) } // MARK: - Appearance public struct ZYScrollSegmentBarAppearance { var textColor: UIColor = UIColor.darkGrayColor() var selectedTextColor: UIColor = UIColor.redColor() var font: UIFont = UIFont.systemFontOfSize(12) var selectedFont: UIFont = UIFont.systemFontOfSize(14) var bottomLineColor: UIColor = UIColor.redColor() var bottomLineHeight: CGFloat = 2.0 var tabBarHeight: CGFloat = 40.0 var tabMargin: CGFloat = 20.0 } class ZYScrollSegmentBar: UIView{ // MARK: Properties weak var dataSource: ZYScrollSegmentBarDataSource? weak var delegate: ZYScrollSegmentBarDelegate? private var _segmentBar = UIView() private var _scrollView = UIScrollView() private var _itemButtons = [UIButton]() private var _subViewControllers = [UIViewController]() private var _isDragging: Bool = false private var _canLayoutSubviews: Bool = false private var _itemButtonWidth: CGFloat! private var selectedTabIndex: Int = 0 private let _selectedLine = CALayer() var appearance: ZYScrollSegmentBarAppearance! { didSet { reloadView() } } // MARK: Initialization override init(frame: CGRect) { super.init(frame: frame) appearance = ZYScrollSegmentBarAppearance() } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } func reloadView() { configureView() selectTabWithIndex(selectedTabIndex, animated: true) } // MARK: - Setup View private func reset () { for sub in subviews { sub.removeFromSuperview() } _subViewControllers = [] _itemButtons = [] } private func configureView() { reset() _canLayoutSubviews = false guard let dataSource = dataSource else { return } _segmentBar.frame = CGRect(x: 0, y: 0, width: frame.width, height: appearance.tabBarHeight) addSubview(_segmentBar) _scrollView.frame = CGRectMake(0, appearance.tabBarHeight, frame.width, frame.height - appearance.tabBarHeight) _scrollView.delegate = self _scrollView.pagingEnabled = true _scrollView.userInteractionEnabled = true _scrollView.bounces = true _scrollView.showsHorizontalScrollIndicator = false _scrollView.autoresizingMask = [.FlexibleHeight, .FlexibleBottomMargin, .FlexibleWidth] addSubview(_scrollView) let number = dataSource.numberOfItems(self) _itemButtonWidth = (self.frame.width - appearance.tabMargin*2) / CGFloat(number) for index in 0..<number { // add SubViewController into scrollView let viewController = dataSource.viewControllerForScrollTabBar(self, atIndex: index) _subViewControllers.append(viewController) _scrollView.addSubview(viewController.view) // Add itemButtons let itemButton = UIButton(type: .Custom) itemButton.tag = index itemButton.titleLabel?.baselineAdjustment = .AlignCenters itemButton.titleLabel?.font = appearance.font itemButton.setTitle(viewController.title, forState: .Normal) itemButton.setTitleColor(appearance.textColor, forState: .Normal) itemButton.setTitleColor(appearance.selectedTextColor, forState: .Selected) itemButton.addTarget(self, action: Selector("onTabButtonSelected:"), forControlEvents: .TouchUpInside) _itemButtons.append(itemButton) _segmentBar.addSubview(itemButton) } // Add Selected Line _selectedLine.frame = CGRect(x: appearance.tabMargin, y: appearance.tabBarHeight - appearance.bottomLineHeight, width: _itemButtonWidth, height: appearance.bottomLineHeight) _selectedLine.backgroundColor = appearance.bottomLineColor.CGColor _segmentBar.layer.addSublayer(_selectedLine) _segmentBar.backgroundColor = UIColor.whiteColor() _canLayoutSubviews = true setNeedsLayout() } override func layoutSubviews() { if !_canLayoutSubviews { return } _scrollView.contentSize = CGSize(width: frame.width * CGFloat(_subViewControllers.count), height: appearance.tabBarHeight) for (index, vc) in _subViewControllers.enumerate() { vc.view.frame = CGRect(x: _scrollView.frame.width * CGFloat(index), y: 0, width: frame.width, height: _scrollView.frame.height) } for (index, button) in _itemButtons.enumerate() { button.frame = CGRect(x: appearance.tabMargin + _itemButtonWidth*CGFloat(index), y: 0, width: _itemButtonWidth, height: appearance.tabBarHeight) } } func onTabButtonSelected(button: UIButton) { if abs(button.tag - selectedTabIndex) > 1 { selectTabWithIndex(button.tag, animated:false) } else { selectTabWithIndex(button.tag, animated:true) } } func selectTabWithIndex(index: Int, animated: Bool) { let currentButton = _itemButtons[index] setSelectedItemButton(index) let moveSelectedLine: () -> Void = { self._selectedLine.frame = CGRect(x: currentButton.frame.origin.x, y: self.appearance.tabBarHeight - self.appearance.bottomLineHeight, width: self._itemButtonWidth, height: self.appearance.bottomLineHeight) } // Move Selected Line if (animated) { UIView.animateWithDuration(0.3, animations: moveSelectedLine, completion: nil) } else { moveSelectedLine() } scrollViewToIndex(index, animated: animated) delegate?.tabBarDidScrollAtIndex?(self, index: index) } private func scrollViewToIndex(index: Int, animated: Bool) { _scrollView.setContentOffset(CGPoint(x: CGFloat(index) * frame.width, y: 0), animated:animated) _isDragging = false } private func setSelectedItemButton(selectedIndex: Int) { for button in _itemButtons { button.titleLabel?.font = appearance.font button.selected = false if button.tag == selectedIndex { button.selected = true button.titleLabel?.font = appearance.selectedFont selectedTabIndex = selectedIndex } else { button.selected = false } } } } // MARK: - UI_scrollViewDelegate extension ZYScrollSegmentBar: UIScrollViewDelegate{ func scrollViewWillBeginDragging(scrollView: UIScrollView) { if scrollView === _scrollView { _isDragging = true } } func scrollViewDidScroll(scrollView: UIScrollView) { if scrollView === _scrollView { if _isDragging { move_selectedLineWithContentOffsetX(_scrollView.contentOffset.x) } } } func scrollViewDidEndDecelerating(scrollView: UIScrollView) { if _scrollView === _scrollView { _isDragging = false selectTabWithIndex(Int(_scrollView.contentOffset.x / bounds.width), animated: true) } } // Move selectedLine private func move_selectedLineWithContentOffsetX(offsetX: CGFloat) { if offsetX < 0 || offsetX > bounds.width * CGFloat(_itemButtons.count - 1){ return } let targetX = appearance.tabMargin + offsetX * _itemButtonWidth / (frame.width) _selectedLine.frame = CGRect(x: targetX, y: _selectedLine.frame.origin.y, width: _selectedLine.frame.width, height: _selectedLine.frame.height) } }
[ -1 ]
825aad2d20216a0e10f5fd4eaf27fae0df267656
068ff14bf8d2cfb63bfa93076de87b132df98018
/Yelp/WebViewController.swift
89e8fa25028f23d96594f0cefbb958827861d18c
[ "Apache-2.0" ]
permissive
zhidev/Yelp
1421115b90cce138d16cbb6882b09b51f394f460
107cc1452054db416adb71d26da0f1d29cdab06b
refs/heads/master
2021-01-10T01:43:50.039064
2016-04-05T13:54:05
2016-04-05T13:54:05
50,969,116
0
0
null
null
null
null
UTF-8
Swift
false
false
582
swift
// // WebViewController.swift // Yelp // // Created by Douglas on 2/7/16. // Copyright © 2016 Timothy Lee. All rights reserved. // import UIKit class WebViewController: UIViewController { @IBOutlet var yelpView: UIWebView! var websiteURL: NSURL? override func viewDidLoad() { super.viewDidLoad() yelpView.loadRequest(NSURLRequest(URL: websiteURL!)) } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } }
[ -1 ]
c29ed97d1b7ff9d2ea84feb3e69e9bae3fada43f
9e259e0e7a477be2ae8bced93ce0804b2e1d2088
/ProverbQuiz/ResultViewController.swift
5e295c46e71bf2674f3c38dc9884d79faaccb662
[]
no_license
ksugawara61/ProverbQuizOld
1be3bf3e4d3a21582bda8a4967e611e4f06a891a
f1f877e8126c7f8ee8dcdf2134f439dccc241e7a
refs/heads/master
2022-03-17T21:32:31.412091
2017-07-26T05:24:01
2017-07-26T05:24:01
null
0
0
null
null
null
null
UTF-8
Swift
false
false
2,382
swift
// // ResultViewController.swift // ProverbQuiz // // Created by 菅原勝也 on 2017/07/20. // Copyright © 2017年 nttr.inc. All rights reserved. // import UIKit class ResultViewController: UIViewController { var index: Int! var quizArray: [Quiz]! var status: Bool! var imageName: String! var proverb: String! var author: String! @IBOutlet var authorImageView: UIImageView! @IBOutlet var resultLavel: UILabel! @IBOutlet var proverbTextView: UITextView! @IBOutlet var authorLabel: UILabel! @IBOutlet var nextQuizButton: UIButton! override func viewDidLoad() { super.viewDidLoad() self.navigationItem.hidesBackButton = true if index >= Constant.maxQuizNum { nextQuizButton.setTitle("結果発表", for: .normal) } else { nextQuizButton.setTitle("次の問題", for: .normal) } nextQuizButton.titleLabel!.font = UIFont(name: "HiraMinProN-W6", size: 18) authorImageView.image = UIImage(named: imageName) proverbTextView.text = proverb authorLabel.text = author if (status) { resultLavel.text = "正解!" // スコアを加算 let userDefaults = UserDefaults.standard var score = userDefaults.integer(forKey: "Score") score = score + 1 userDefaults.set(score, forKey: "Score") userDefaults.synchronize() } else { resultLavel.text = "残念..." resultLavel.textColor = UIColor.red } } @IBAction func nextQuiz() { if index < Constant.maxQuizNum { self.performSegue(withIdentifier: "toNext", sender: nil) } else { // 最終問題であればトップページへ遷移 self.performSegue(withIdentifier: "toEnd", sender: nil) } } override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if index < Constant.maxQuizNum { let quizViewController = segue.destination as! QuizViewController quizViewController.index = index quizViewController.quizArray = quizArray } else { let endViewController = segue.destination as! EndViewController endViewController.quizArray = quizArray } } }
[ -1 ]
e6de4dafa92c09285c43b6ebd47def10a8298016
8af2e4024665a9556c2323cda6a2834bac989aad
/hmmrd-lite/Pojos/TriviaQuestion.swift
1d107c79b4e73a118a618e5c87efacdb35e60c2c
[]
no_license
swimmath27/hmmrd-lite
dd3efd5562d26216c3a6dc52e0c4d36a9be10fed
1555e4ecea3a4281d1f0fa1db89e38c6a6909027
refs/heads/master
2021-07-02T23:30:58.881826
2017-12-05T05:59:36
2017-12-05T05:59:36
95,062,656
0
0
null
null
null
null
UTF-8
Swift
false
false
661
swift
// // TriviaQuestion.swift // hmmrd-lite // // Created by Michael Lombardo on 8/21/17. // Copyright © 2017 hmmrd. All rights reserved. // import Foundation class TriviaQuestion: CustomStringConvertible { fileprivate(set) var question:String = "" fileprivate(set) var answers:[String] = [String]() convenience init() { self.init(question: "", answers: []); } init(question:String, answers:[String]) { self.question = question self.answers = answers } public var description: String { return "\n\(question)\n\(answers)\n" } public func isEmpty() -> Bool { return self.question == "" && self.answers == []; } }
[ -1 ]
ed2b4ecab6d7774f97f9edb8cc67a1fcf0608cd4
fe5a069d81f5fedd8995c4b19ef6ffbf38611483
/spotitUITests/spotitUITests.swift
e8a4f3c33e7c1868495fee492a3be63293aee2b3
[ "MIT" ]
permissive
itndehuiP/spotit
549c5a2394f4a32c70126b2f9cf63084b1364f73
8aa58f1e809af77156b9c7c4d2852a05877b94ed
refs/heads/main
2023-07-13T12:59:59.848330
2021-05-16T20:08:56
2021-05-16T20:08:56
367,971,379
0
0
null
null
null
null
UTF-8
Swift
false
false
1,425
swift
// // spotitUITests.swift // spotitUITests // // Created by Guerson Perez on 16/05/21. // import XCTest class spotitUITests: XCTestCase { override func setUpWithError() throws { // Put setup code here. This method is called before the invocation of each test method in the class. // In UI tests it is usually best to stop immediately when a failure occurs. continueAfterFailure = false // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. } override func tearDownWithError() throws { // Put teardown code here. This method is called after the invocation of each test method in the class. } func testExample() throws { // UI tests must launch the application that they test. let app = XCUIApplication() app.launch() // Use recording to get started writing UI tests. // Use XCTAssert and related functions to verify your tests produce the correct results. } func testLaunchPerformance() throws { if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 7.0, *) { // This measures how long it takes to launch your application. measure(metrics: [XCTApplicationLaunchMetric()]) { XCUIApplication().launch() } } } }
[ 360463, 155665, 376853, 344106, 253996, 385078, 163894, 180279, 319543, 352314, 213051, 376892, 32829, 286787, 352324, 237638, 352327, 385095, 393291, 163916, 368717, 311373, 196687, 278607, 311377, 254039, 426074, 368732, 180317, 32871, 352359, 221292, 278637, 319599, 385135, 376945, 131190, 385147, 131199, 426124, 196758, 49308, 65698, 311459, 49317, 377008, 377010, 180409, 295099, 377025, 377033, 164043, 417996, 254157, 368849, 368850, 139478, 229591, 385240, 254171, 147679, 147680, 311520, 205034, 254189, 286957, 254193, 262403, 147716, 385291, 368908, 180494, 262419, 368915, 254228, 319764, 278805, 377116, 254250, 311596, 131374, 418095, 336177, 368949, 180534, 155968, 287040, 311622, 270663, 319816, 368969, 254285, 180559, 377168, 344402, 229716, 368982, 270703, 139641, 385407, 385409, 270733, 106893, 385423, 385433, 213402, 385437, 254373, 156069, 385448, 385449, 311723, 115116, 385463, 319931, 278974, 336319, 336323, 188870, 278988, 278992, 262619, 377309, 377310, 369121, 369124, 279014, 270823, 279017, 311787, 213486, 360945, 139766, 393719, 279030, 377337, 279033, 254459, 410108, 410109, 262657, 377346, 279042, 279053, 410126, 262673, 385554, 393745, 303635, 279060, 279061, 254487, 410138, 279066, 188957, 377374, 385569, 385578, 377388, 197166, 393775, 418352, 33339, 352831, 33344, 385603, 377419, 385612, 303693, 426575, 385620, 369236, 115287, 189016, 270938, 287327, 279143, 279150, 287345, 352885, 352886, 344697, 189054, 287359, 385669, 369285, 311944, 344714, 311950, 377487, 311953, 287379, 336531, 180886, 426646, 352921, 377499, 221853, 344737, 295591, 352938, 295598, 418479, 279215, 279218, 164532, 336565, 287418, 377531, 303802, 377534, 377536, 66243, 385737, 287434, 385745, 279249, 303826, 369365, 369366, 385751, 230105, 361178, 352989, 352990, 418529, 295649, 385763, 295653, 369383, 230120, 361194, 312046, 418550, 344829, 279293, 205566, 197377, 434956, 312076, 295698, 418579, 426772, 197398, 426777, 221980, 344864, 197412, 336678, 262952, 189229, 262957, 164655, 197424, 328495, 197428, 336693, 230198, 377656, 426809, 197433, 222017, 295745, 377669, 197451, 369488, 279379, 385878, 385880, 295769, 197467, 435038, 230238, 279393, 303973, 279398, 385895, 197479, 385901, 197489, 295799, 164730, 336765, 254851, 369541, 172936, 320394, 426894, 189327, 377754, 172971, 140203, 377778, 304050, 189365, 377789, 189373, 345030, 345034, 279499, 418774, 386007, 386009, 418781, 386016, 123880, 418793, 320495, 222193, 435185, 271351, 214009, 312313, 435195, 328701, 312317, 386049, 328705, 418819, 410629, 377863, 189448, 230411, 320526, 361487, 435216, 386068, 254997, 336928, 336930, 410665, 345137, 361522, 312372, 238646, 238650, 320571, 386108, 410687, 336962, 377927, 238663, 361547, 205911, 156763, 361570, 214116, 230500, 214119, 402538, 279659, 173168, 230514, 238706, 279666, 312435, 377974, 66684, 377986, 279686, 402568, 222344, 140426, 337037, 386191, 410772, 222364, 418975, 124073, 402618, 148674, 402632, 148687, 402641, 189651, 419028, 279766, 189656, 304353, 279780, 222441, 279789, 386288, 66802, 271607, 369912, 386296, 369913, 419066, 386300, 279803, 386304, 320769, 369929, 419097, 320795, 115997, 222496, 320802, 304422, 369964, 353581, 116014, 66863, 312628, 345397, 345398, 386363, 222523, 345418, 353611, 337226, 230730, 337228, 296269, 222542, 353617, 238928, 296274, 353612, 378201, 230757, 296304, 312688, 337280, 353672, 263561, 296328, 296330, 304523, 370066, 9618, 411028, 279955, 370072, 148899, 148900, 361928, 337359, 329168, 312785, 329170, 222674, 353751, 280025, 239069, 329181, 320997, 361958, 271850, 280042, 280043, 271853, 329198, 411119, 337391, 116209, 296434, 386551, 288252, 312830, 271880, 198155, 329231, 304655, 370200, 222754, 157219, 157220, 394793, 312879, 288305, 288319, 288322, 280131, 288328, 353875, 99937, 345697, 312937, 271980, 206447, 403057, 42616, 337533, 280193, 370307, 419462, 149127, 149128, 419464, 288391, 411275, 214667, 239251, 345753, 198304, 255651, 337590, 370359, 280252, 280253, 321217, 239305, 296649, 403149, 313042, 345813, 370390, 272087, 337638, 181992, 345832, 345835, 288492, 141037, 313082, 288508, 288515, 173828, 395018, 395019, 116491, 395026, 124691, 116502, 435993, 345882, 411417, 321308, 255781, 362281, 378666, 403248, 378673, 345910, 182070, 182071, 436029, 345918, 337734, 280396, 272207, 272208, 337746, 395092, 362326, 345942, 370526, 345950, 362336, 255844, 296807, 214894, 362351, 214896, 313200, 313204, 124795, 182145, 280451, 67464, 305032, 337816, 124826, 329627, 239515, 436130, 354210, 436135, 10153, 313257, 362411, 370604, 362418, 411587, 280517, 362442, 346066, 231382, 354268, 436189, 403421, 329696, 354273, 403425, 190437, 354279, 436199, 174058, 337899, 354283, 247787, 329707, 296942, 247786, 436209, 313322, 124912, 239610, 182277, 346117, 403463, 43016, 354312, 354311, 436235, 313356, 354310, 419857, 305173, 436248, 223269, 346153, 354346, 313388, 124974, 272432, 403507, 378933, 378934, 436283, 288835, 403524, 436293, 313415, 239689, 436304, 329812, 223317, 411738, 272477, 280676, 313446, 395373, 288878, 346237, 215165, 436372, 329884, 362658, 436388, 215204, 125108, 133313, 395458, 338118, 436429, 346319, 321744, 379102, 387299, 18661, 379110, 338151, 125166, 149743, 379120, 436466, 125170, 411892, 436471, 395511, 313595, 436480, 125184, 272644, 125192, 338187, 338188, 125197, 395536, 125200, 338196, 272661, 379157, 125204, 157973, 125215, 125216, 338217, 125225, 321839, 125236, 362809, 379193, 395591, 289109, 272730, 436570, 215395, 239973, 280938, 321901, 354671, 362864, 354672, 272755, 354678, 199030, 223611, 248188, 313726, 436609, 240003, 436613, 395653, 395660, 264591, 272784, 420241, 240020, 190870, 43416, 190872, 289185, 436644, 289195, 272815, 436659, 338359, 436677, 289229, 281038, 281039, 256476, 420326, 166403, 322057, 420374, 322077, 289328, 330291, 322119, 191065, 436831, 117350, 420461, 313970, 346739, 346741, 420473, 297600, 166533, 363155, 346771, 264855, 363161, 289435, 436897, 248494, 166581, 355006, 363212, 363228, 436957, 322269, 436960, 264929, 338658, 289511, 330473, 346859, 330476, 289517, 215790, 199415, 289534, 322302, 35584, 133889, 322312, 346889, 264971, 322320, 166677, 207639, 363295, 355117, 191285, 273209, 355129, 273211, 355136, 355138, 420680, 355147, 355148, 355153, 281426, 387927, 363353, 363354, 281434, 322396, 420702, 363361, 363362, 412516, 355173, 355174, 281444, 207724, 355182, 207728, 420722, 314240, 158594, 330627, 240517, 387977, 396171, 355216, 224146, 224149, 256918, 256919, 256920, 240543, 256934, 273336, 289720, 289723, 273341, 330688, 379845, 363462, 19398, 420808, 273353, 191445, 207839, 347104, 314343, 134124, 412653, 248815, 257007, 347122, 183291, 437245, 257023, 125953, 396292, 330759, 347150, 330766, 412692, 330789, 248871, 281647, 412725, 257093, 404550, 314437, 207954, 339031, 404582, 257126, 265318, 322664, 265323, 396395, 404589, 273523, 363643, 248960, 150656, 363658, 404622, 224400, 265366, 347286, 429209, 339101, 429216, 339106, 380069, 265381, 3243, 208044, 322733, 421050, 339131, 265410, 183492, 421081, 339167, 298209, 421102, 363769, 52473, 208123, 52476, 412926, 437504, 322826, 388369, 380178, 429332, 126229, 412963, 257323, 437550, 273713, 298290, 208179, 159033, 347451, 216387, 372039, 257353, 257354, 109899, 437585, 331091, 150868, 314708, 372064, 429410, 437602, 281958, 388458, 265579, 306541, 314734, 314740, 314742, 421240, 314745, 224637, 388488, 298378, 306580, 282008, 396697, 314776, 282013, 290206, 396709, 298406, 241067, 314797, 380335, 355761, 421302, 134586, 380348, 216510, 380350, 216511, 306630, 200136, 273865, 306634, 339403, 372172, 413138, 421338, 437726, 429540, 3557, 3559, 191980, 282097, 191991, 265720, 216575, 290304, 372226, 437766, 323083, 208397, 323088, 413202, 413206, 388630, 175640, 216610, 372261, 347693, 323120, 396850, 200245, 323126, 290359, 134715, 323132, 421437, 396865, 282182, 413255, 273992, 265800, 421452, 265809, 396885, 290391, 265816, 396889, 306777, 388699, 396896, 323171, 388712, 388713, 314997, 290425, 339579, 396927, 282248, 224907, 396942, 405140, 274071, 323226, 208547, 208548, 405157, 388775, 282279, 364202, 421556, 224951, 224952, 306875, 282302, 323262, 323265, 241360, 241366, 224985, 282330, 159462, 372458, 397040, 12017, 323315, 274170, 200444, 175874, 249606, 323335, 282379, 216844, 372497, 397076, 421657, 339746, 216868, 257831, 167720, 241447, 421680, 282418, 421686, 274234, 241471, 339782, 315209, 159563, 241494, 339799, 307038, 274276, 282471, 274288, 372592, 274296, 339840, 315265, 372625, 282517, 298912, 118693, 438186, 126896, 151492, 380874, 372699, 323554, 380910, 380922, 380923, 274432, 372736, 241695, 315431, 430120, 102441, 315433, 430127, 405552, 282671, 241717, 249912, 225347, 307269, 421958, 233548, 176209, 381013, 53334, 315477, 200795, 356446, 323678, 438374, 176231, 438378, 233578, 217194, 422000, 249976, 266361, 422020, 168069, 381061, 168070, 381071, 241809, 323730, 430231, 200856, 422044, 192670, 192671, 299166, 258213, 299176, 323761, 184498, 430263, 266427, 356550, 299208, 372943, 266447, 258263, 356575, 307431, 438512, 372979, 389364, 381173, 135416, 356603, 184574, 266504, 217352, 61720, 381210, 315674, 282908, 389406, 282912, 233761, 438575, 315698, 266547, 397620, 332084, 438583, 127292, 438592, 332100, 323914, 201037, 348499, 250196, 348501, 389465, 332128, 110955, 242027, 242028, 160111, 250227, 315768, 291193, 438653, 291200, 266628, 340356, 242059, 225684, 373141, 373144, 291225, 389534, 397732, 373196, 176602, 242138, 184799, 291297, 201195, 324098, 233987, 340489, 397841, 283154, 258584, 291359, 397855, 348709, 348710, 397872, 283185, 234037, 340539, 266812, 438850, 348741, 381515, 348748, 430681, 332379, 242274, 184938, 373357, 184942, 176751, 389744, 356983, 356984, 209529, 356990, 291455, 373377, 422529, 201348, 152196, 356998, 348807, 356999, 316044, 316050, 275102, 176805, 340645, 422567, 176810, 160441, 422591, 291529, 225996, 135888, 242385, 398039, 234216, 373485, 373486, 21239, 275193, 348921, 234233, 242428, 299777, 430853, 430860, 62222, 430880, 234276, 234290, 152372, 160569, 430909, 160576, 348999, 283466, 439118, 234330, 275294, 381791, 127840, 357219, 439145, 177002, 308075, 242540, 242542, 381811, 201590, 177018, 398205, 340865, 291713, 349066, 316299, 349068, 234382, 308111, 381840, 308113, 390034, 373653, 430999, 209820, 381856, 398244, 185252, 422825, 381872, 177074, 398268, 349122, 398275, 373705, 127945, 340960, 398305, 340967, 398313, 234476, 127990, 349176, 201721, 349179, 234499, 357380, 398370, 357413, 357420, 300087, 21567, 308288, 398405, 349254, 218187, 250955, 300109, 234578, 250965, 439391, 250982, 398444, 62574, 357487, 300147, 119925, 349304, 234626, 349315, 349317, 234635, 373902, 177297, 324761, 234655, 234662, 373937, 373939, 324790, 300215, 218301, 283841, 283846, 259275, 316628, 259285, 357594, 414956, 251124, 316661, 292092, 439550, 439563, 242955, 414989, 259346, 349458, 382243, 382246, 382257, 292145, 382264, 333115, 193853, 193858, 251212, 406862, 234830, 259408, 283990, 357720, 300378, 300379, 316764, 374110, 234864, 259449, 382329, 357758, 243073, 357763, 112019, 398740, 234902, 374189, 251314, 284086, 259513, 54719, 292291, 300490, 300526, 259569, 251379, 300539, 398844, 210429, 366081, 316951, 374297, 153115, 431646, 349727, 431662, 374327, 210489, 235069, 349764, 292424, 292426, 128589, 333389, 333394, 349780, 128600, 235096, 300643, 300645, 415334, 54895, 366198, 210558, 210559, 415360, 325246, 333438, 415369, 431754, 210569, 267916, 415376, 259741, 153252, 399014, 210601, 202413, 317102, 415419, 259780, 333508, 267978, 333522, 325345, 333543, 431861, 284410, 161539, 284425, 300812, 284430, 366358, 169751, 431901, 341791, 325411, 186148, 186149, 333609, 399148, 202541, 284460, 431918, 153392, 431935, 415555, 325444, 153416, 325449, 341837, 415566, 431955, 325460, 317268, 341846, 300893, 259937, 382820, 276326, 415592, 292713, 292719, 325491, 341878, 276343, 350072, 333687, 317305, 112510, 325508, 333700, 243590, 325514, 350091, 350092, 350102, 350108, 333727, 219046, 284584, 292783, 300983, 128955, 219102, 292835, 6116, 317416, 432114, 325620, 415740, 268286, 415744, 333827, 243720, 399372, 153618, 358418, 178215, 325675, 243763, 358455, 325695, 399433, 333902, 104534, 194667, 260206, 432241, 284789, 374913, 374914, 415883, 333968, 153752, 333990, 104633, 260285, 227517, 268479, 374984, 301270, 301271, 334049, 325857, 268515, 383208, 317676, 260337, 260338, 375040, 309504, 260355, 375052, 194832, 325904, 391448, 334104, 268570, 178459, 186660, 268581, 334121, 358698, 317738, 260396, 325930, 432435, 358707, 178485, 358710, 14654, 268609, 227655, 383309, 383327, 391521, 366948, 416101, 416103, 383338, 432503, 432511, 211327, 227721, 285074, 252309, 39323, 285083, 317851, 285089, 375211, 334259, 129461, 342454, 358844, 293309, 317889, 326083, 416201, 129484, 154061, 326093, 416206, 432608, 285152, 195044, 391654, 432616, 334315, 375281, 293368, 317949, 334345, 432650, 309770, 342537, 342549, 342560, 416288, 350758, 350759, 358951, 358952, 293420, 219694, 219695, 375345, 244279, 309831, 375369, 375373, 416334, 301647, 416340, 244311, 416353, 260705, 375396, 268901, 244326, 244345, 334473, 375438, 326288, 285348, 293552, 342705, 285362, 383668, 342714, 39616, 383708, 342757, 269036, 432883, 203511, 342775, 383740, 416509, 432894, 359166, 375552, 162559, 228099, 285443, 285450, 383755, 326413, 285467, 326428, 318247, 342827, 318251, 375610, 301883, 342846, 416577, 416591, 244569, 375644, 252766, 293729, 351078, 342888, 392057, 211835, 269179, 392065, 260995, 400262, 392071, 424842, 236427, 252812, 400271, 392080, 400282, 7070, 211871, 359332, 359333, 293801, 326571, 252848, 326580, 261045, 261046, 326586, 359365, 211913, 326602, 342990, 252878, 433104, 56270, 359380, 433112, 433116, 359391, 187372, 343020, 383980, 203758, 383994, 171009, 384004, 433166, 384015, 433173, 293911, 326684, 252959, 384031, 375848, 318515, 203829, 261191, 375902, 375903, 392288, 253028, 351343, 187505, 138354, 187508, 384120, 302202, 285819, 392317, 343166, 384127, 392320, 285823, 285833, 285834, 318602, 228492, 253074, 326803, 187539, 359574, 285850, 351389, 302239, 253098, 302251, 367791, 367792, 367798, 64699, 294075, 228541, 343230, 367809, 253124, 113863, 351445, 310496, 195809, 253168, 351475, 351489, 367897, 367898, 245018, 130342, 130344, 130347, 261426, 212282, 294210, 359747, 359748, 146760, 146763, 114022, 253288, 425327, 425331, 163190, 327030, 384379, 253316, 294278, 384391, 318860, 253339, 318876, 253340, 343457, 245160, 359860, 359861, 343480, 310714, 228796, 228804, 425417, 310731, 327122, 425434, 310747, 310758, 253431, 359931, 187900, 343552, 245249, 228868, 409095, 359949, 294413, 253456, 302613, 253462, 146976, 245290, 245291, 343606, 163385, 425534, 138817, 147011, 147020, 179800, 196184, 343646, 212574, 204386, 155238, 204394, 138862, 310896, 188021, 294517, 286351, 188049, 425624, 229021, 245413, 286387, 384693, 376502, 286392, 302778, 409277, 286400, 319176, 409289, 425682, 286419, 294621, 245471, 155360, 294629, 212721, 163575, 286457, 286463, 319232, 360194, 409355, 155408, 417556, 294699, 204600, 319289, 384826, 409404, 360253, 409416, 237397, 376661, 368471, 425820, 368486, 384871, 409446, 368489, 40809, 425832, 417648, 417658, 360315, 253828, 327556, 311183, 425875, 294806, 294808, 253851, 376733, 204702, 319393, 294820, 253868, 204722, 188349, 98240, 212947, 212953, 360416, 294887, 253930, 327666, 385011 ]
c30dafa1bf9dc80d1fa55ebc2522adcc86de6293
64b8d6f8d4b7d3acf4d25b23289067b22b3513ec
/MVP-Example/MVP-Example/CountriesListScene/CountriesListPresenter.swift
86c742f4f61004023c70bab46866a3392c74ea80
[]
no_license
RodrigoMaximo/Architecture-iOS
2b179d4464969493f434cfc350460ff5e2027a48
5915d6cbc5a9dbd1457c059e37cf6a99ac25a1a9
refs/heads/master
2020-08-29T02:29:08.443577
2019-11-12T12:29:14
2019-11-12T12:29:14
217,894,805
1
2
null
2019-11-12T12:29:16
2019-10-27T18:02:38
Swift
UTF-8
Swift
false
false
2,404
swift
// // CountriesListPresenter.swift // MVP-Example // // Created by Rodrigo Máximo on 27/10/19. // Copyright © 2019 Rodrigo Máximo. All rights reserved. // import Foundation protocol CountriesListPresenterProtocol { var numberOfCountries: Int { get } func reloadCountries() func orderCountries(accordingTo segmentedIndex: Int) func segmentedNames() -> [String] func viewModelFor(row: Int, segmentedIndex: Int) -> CountriesListTableViewCell.ViewModel func selectedCountry(for row: Int) -> Country } protocol CountriesListPresenterDelegate: AnyObject { // The necessity of implement these methods is because the `reloadCountries()` and `orderCountries()` could be async. func didReloadCountries() func didOrderCountries() } final class CountriesListPresenter: CountriesListPresenterProtocol { enum Segmented: Int, CaseIterable { case names = 0 case hdi var stringValue: String { switch self { case .names: return "Names" case .hdi: return "HDI" } } } weak var delegate: CountriesListPresenterDelegate? private var countries: [Country] = [] var numberOfCountries: Int { return countries.count } func reloadCountries() { countries = CountriesProvider.provide(10) delegate?.didReloadCountries() } func orderCountries(accordingTo segmentedIndex: Int) { guard let segmented = Segmented(rawValue: segmentedIndex) else { return } if segmented == .names { countries = countries.sorted{ $0.name < $1.name } } else { countries = countries.sorted{ $0.hdi > $1.hdi } } delegate?.didOrderCountries() } func segmentedNames() -> [String] { return Segmented.allCases.map { $0.stringValue } } func viewModelFor(row: Int, segmentedIndex: Int) -> CountriesListTableViewCell.ViewModel { let country = countries[row] let description = Segmented(rawValue: segmentedIndex) == .some(.names) ? country.name : String(country.hdi) return CountriesListTableViewCell.ViewModel(imageName: country.name, description: description) } func selectedCountry(for row: Int) -> Country { return countries[row] } }
[ -1 ]
de610ec08b5e9dca6736bedb23aad9f3cde8bdc9
7b10bc52b1ddd494cc67b0bb24902b7580b4a59f
/DITPDrive/AttachmentDocumentView.swift
8316d056af0eaaff8f525dd7cdc217999a50b33e
[]
no_license
gooddymail/DITPDrive
769bcac41e7594f40318dc315efbd5b69025eca6
2b078fe8c9bdd3a84b853fb9f40f8a6f94db19bb
refs/heads/master
2020-12-30T15:42:45.618565
2017-04-11T08:17:31
2017-04-11T08:17:31
91,170,820
0
0
null
null
null
null
UTF-8
Swift
false
false
1,680
swift
// // AttachmentDocumentView.swift // DITPDrive // // Created by Nuttapon Achachotipong on 4/7/2560 BE. // Copyright © 2560 Katchapon Poolpipat. All rights reserved. // import UIKit class AttachmentDocumentView: UIView { private let attachmentIconImageView: UIImageView = { let imageView = UIImageView(image: UIImage(named: "attachicon")) imageView.contentMode = .scaleAspectFit return imageView }() let attachmentFileButton: UIButton = { let button = UIButton(type: .custom) button.titleLabel?.font = TextStyle.attachmentButton.font button.titleLabel?.textAlignment = .left button.setTitle("1. APPLICATION FORM", for: .normal) button.setTitleColor(TextStyle.attachmentButton.color, for: .normal) button.setTitleColor(UIColor.lightGray, for: .highlighted) button.setTitleColor(UIColor.lightGray, for: .selected) button.contentHorizontalAlignment = .left return button }() init() { super.init(frame: CGRect(x: 0, y: 0, width: 0, height: 18)) backgroundColor = UIColor.clear let views: [String: UIView] = ["attachmentIconImageView": attachmentIconImageView, "attachmentFileButton": attachmentFileButton] addAutoLayoutSubviews(views) addConstraints(withVisualFormat: "V:|-0-[attachmentIconImageView]-0-|", views: views) addConstraints(withVisualFormat: "H:|-0-[attachmentIconImageView(12)]-6-[attachmentFileButton]-0-|", views: views) addConstraints(withVisualFormat: "V:|-0-[attachmentFileButton]-0-|", views: views) } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } }
[ -1 ]
aa8941eb451516b94f66e59705a7ca8f97301a49
5a2c7e6370f82d9720e6a418e3760e89d44fc6ff
/03-CALayer/03-CALayer/CustomView.swift
8c6be7316532a0283c51bec80f8b5a0a13c92570
[]
no_license
LinnierGames/MOB-7
c573a1b8e5b5145f379db1aa942d32484478e271
27923938448e384941788bcfae2584f7683b1636
refs/heads/master
2020-03-15T15:32:13.895947
2018-05-23T02:19:45
2018-05-23T02:19:45
132,214,545
0
0
null
null
null
null
UTF-8
Swift
false
false
2,528
swift
// // CustomView.swift // 03-CALayer // // Created by Erick Sanchez on 5/3/18. // Copyright © 2018 LinnierGames. All rights reserved. // import UIKit @IBDesignable class CustomView: UIView { required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) drawMyself() } override func layoutSubviews() { super.layoutSubviews() drawMyself() } func drawMyself() { let gradient = CAGradientLayer() gradient.colors = [UIColor.red.cgColor, UIColor.blue.cgColor] gradient.frame = bounds layer.addSublayer(gradient) let mountainPath = UIBezierPath() mountainPath.move(to: CGPoint(x: 0, y: bounds.midY)) mountainPath.addCurve( to: CGPoint(x: bounds.midX, y: bounds.midY + bounds.height / 4.0), controlPoint1: CGPoint(x: bounds.width / 4.0, y: bounds.midY), controlPoint2: CGPoint(x: bounds.width / 4.0, y: bounds.midY + bounds.height / 4.0)) mountainPath.addCurve( to: CGPoint(x: bounds.maxX, y: bounds.midY), controlPoint1: CGPoint(x: bounds.width / 2 + bounds.width / 4.0, y: bounds.midY + bounds.height / 4.0), controlPoint2: CGPoint(x: bounds.width / 2 + bounds.width / 4.0, y: bounds.midY)) mountainPath.addLine(to: CGPoint(x: bounds.maxX, y: bounds.maxY)) mountainPath.addLine(to: CGPoint(x: 0, y: bounds.maxY)) mountainPath.close() let mountain = CAShapeLayer() mountain.strokeColor = UIColor.green.cgColor mountain.lineWidth = 5.0 mountain.path = mountainPath.cgPath layer.addSublayer(mountain) let radius: CGFloat = 32.0 let padding: CGFloat = 16.0 let sunCenter = CGPoint(x: bounds.maxX - radius - padding, y: radius + padding) let sunPath = UIBezierPath.circle(with: sunCenter, radius: radius) let sun = CAShapeLayer() sun.path = sunPath.cgPath sun.fillColor = UIColor.yellow.cgColor sun.shadowColor = UIColor.yellow.cgColor sun.shadowRadius = 16.0 layer.addSublayer(sun) } } extension UIBezierPath { static func circle(with center: CGPoint, radius: CGFloat) -> UIBezierPath { let path = UIBezierPath() path.addArc(withCenter: CGPoint(x: center.x, y: center.y), radius: radius, startAngle: 0.0, endAngle: CGFloat.pi * 2.0, clockwise: true) return path } }
[ -1 ]
d5505ed1567c01043f2f3fd5ddb58c8ecb1a4c13
e734f695a2004c721904d1560ac43f5b601a789e
/Glo/ViewController.swift
8cae2b42cd67f635f8a5f6939399b148a468c2a0
[]
no_license
oooseun/Glo
445d0837738a81ec1d2ec411d2c78f287c7d88b1
3adece4a1468507b858d49881cbf5a9a403d142b
refs/heads/master
2020-04-06T07:56:11.781718
2016-08-24T23:11:53
2016-08-24T23:11:53
65,227,706
0
0
null
null
null
null
UTF-8
Swift
false
false
2,652
swift
// // ViewController.swift // Glo // // Created by Ope on 5/15/16. // Copyright © 2016 oooseun. All rights reserved. // import UIKit import Alamofire var swiftRequest = SwiftRequest() var alarmtimeAsString = "20:00" var alarmtime = NSDate() var dateString = "" class ViewController: UIViewController { @IBAction func setButton(sender: AnyObject) { swiftRequest.get("http://10.32.176.104:2015/getalarmtime", callback: {err, response, body in if( err == nil ) { print(body) alarmtimeAsString=body as! String let dateFormatter = NSDateFormatter() dateFormatter.dateFormat = "hh:mm a" if (alarmtimeAsString != ""){ alarmtime = dateFormatter.dateFromString(alarmtimeAsString)! } } }) DatePickerDialog().show("Alarm Time", doneButtonTitle: "Done", cancelButtonTitle: "Cancel", defaultDate: alarmtime , datePickerMode: .Time) { (date) -> Void in //self.textField.text = "\(date)" let dateFormatter = NSDateFormatter() dateFormatter.dateFormat = "hh:mm a" //format style. Browse online to get a format that fits your needs. dateString = dateFormatter.stringFromDate(date) print(dateString) //prints out 10:12 PM print(date) } } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } override func viewDidAppear(animated: Bool) { swiftRequest.get("http://10.32.176.104:2015/getalarmtime", callback: {err, response, body in if( err == nil ) { print(body) alarmtimeAsString=body as! String let dateFormatter = NSDateFormatter() dateFormatter.dateFormat = "hh:mm a" if (alarmtimeAsString != ""){ alarmtime = dateFormatter.dateFromString(alarmtimeAsString)! } } }) } override func viewDidLoad() { swiftRequest.get("http://10.32.176.104:2015/getalarmtime", callback: {err, response, body in if( err == nil ) { print(body) alarmtimeAsString=body as! String let dateFormatter = NSDateFormatter() dateFormatter.dateFormat = "hh:mm a" if (alarmtimeAsString != ""){ alarmtime = dateFormatter.dateFromString(alarmtimeAsString)! } } }) } }
[ -1 ]
5e3fc4f40186bc65d0fe580cd39fede1ce230b10
fac8c764c23057453b06cb346d7e2e649c7e76bd
/PayBack/Cells/ShopVia/ShopClickTVCell.swift
86c27351bb12e723a484fa43dfa651d03c0ce7ed
[]
no_license
bpmaurya3/Demo_PB
7f1323aed4732c920283ecace3bd71a5c6823c3b
6a022dc6f36a4963ea409ecc5f0bf1df827aa20b
refs/heads/master
2020-03-21T10:45:59.180234
2018-06-24T09:42:52
2018-06-24T09:42:52
null
0
0
null
null
null
null
UTF-8
Swift
false
false
6,744
swift
// // ShopClickTVCell.swift // PayBack // // Created by Bhuvanendra Pratap Maurya on 8/31/17. // Copyright © 2017 Valtech. All rights reserved. // import UIKit final internal class ShopClickTVCell: UITableViewCell { var cellTapClosure: (Int) -> Void = { _ in } fileprivate var dataSource: CollectionViewDataSource<PBShopClickCVCell, ShopClickCellViewModel>! var cellModel: [ShopClickCellViewModel] = [] { didSet { self.titleLabel.isHidden = cellModel.isEmpty ? true : false self.underLineView.isHidden = cellModel.isEmpty ? true : false self.viewAllButton.isHidden = cellModel.isEmpty ? true : false guard !cellModel.isEmpty else { return } self.dataSource = CollectionViewDataSource(cellIdentifier: Cells.shopClickCVCell, items: cellModel) {[unowned self] cell, vm in cell.shopClickCellViewModel = vm self.addCellLayer(cell: cell) } self.collectionView.dataSource = self.dataSource self.collectionView.reloadData() } } fileprivate var titleLabel: UILabel = { let label = UILabel() label.text = "Shop.Click.Earn" label.backgroundColor = .clear label.textColor = ColorConstant.rewardScreenTitleColor label.font = UIFont.boldSystemFont(ofSize: 20) label.translatesAutoresizingMaskIntoConstraints = false label.adjustsFontSizeToFitWidth = true return label }() fileprivate var underLineView: UIView = { let view = UIView(frame: .zero) view.backgroundColor = .red view.translatesAutoresizingMaskIntoConstraints = false return view }() fileprivate var viewAllButton: UIButton = { let button = UIButton(type: UIButtonType.custom) button.backgroundColor = ColorConstant.shopNowButtonBGColor button.setTitle("VIEW ALL", for: .normal) button.translatesAutoresizingMaskIntoConstraints = false button.titleLabel?.font = UIFont.systemFont(ofSize: 15) button.layer.cornerRadius = 17 button.layer.masksToBounds = true button.contentEdgeInsets = UIEdgeInsets(top: 8, left: 16, bottom: 8, right: 16) return button }() fileprivate lazy var collectionView: UICollectionView = { let layout = UICollectionViewFlowLayout() layout.scrollDirection = .horizontal let collectionView = UICollectionView(frame: .zero, collectionViewLayout: layout) collectionView.backgroundColor = .white collectionView.delegate = self collectionView.allowsSelection = true collectionView.translatesAutoresizingMaskIntoConstraints = false collectionView.register(UINib(nibName: "PBShopClickCVCell", bundle: nil), forCellWithReuseIdentifier: "PBShopClickCVCell") collectionView.showsHorizontalScrollIndicator = false return collectionView }() override init(style: UITableViewCellStyle, reuseIdentifier: String?) { super.init(style: style, reuseIdentifier: reuseIdentifier) setupViews() } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } private func setupViews() { selectionStyle = .none addSubview(titleLabel) titleLabel.leadingAnchor.constraint(equalTo: self.leadingAnchor, constant: 25).isActive = true titleLabel.topAnchor.constraint(equalTo: self.topAnchor, constant: 20).isActive = true addSubview(underLineView) underLineView.leadingAnchor.constraint(equalTo: self.leadingAnchor, constant: 25).isActive = true underLineView.topAnchor.constraint(equalTo: titleLabel.bottomAnchor, constant: 5).isActive = true underLineView.widthAnchor.constraint(equalToConstant: 50).isActive = true underLineView.heightAnchor.constraint(equalToConstant: 2).isActive = true addSubview(viewAllButton) viewAllButton.addTarget(self, action: .viewAllForShopClickTVCell, for: .touchUpInside) viewAllButton.trailingAnchor.constraint(equalTo: self.trailingAnchor, constant: -10).isActive = true viewAllButton.topAnchor.constraint(equalTo: self.topAnchor, constant: 20).isActive = true viewAllButton.widthAnchor.constraint(equalToConstant: 110).isActive = true titleLabel.trailingAnchor.constraint(equalTo: viewAllButton.leadingAnchor, constant: -5).isActive = true addSubview(collectionView) collectionView.leadingAnchor.constraint(equalTo: self.leadingAnchor, constant: -1).isActive = true collectionView.trailingAnchor.constraint(equalTo: self.trailingAnchor, constant: 1).isActive = true collectionView.topAnchor.constraint(equalTo: viewAllButton.bottomAnchor, constant: 20).isActive = true collectionView.bottomAnchor.constraint(equalTo: self.bottomAnchor).isActive = true addBorderToCollectionView() } deinit { print("ShopClickTVCell: deinit called") } } extension ShopClickTVCell { @objc func viewAllClicked() { print("View all clicked") let parantController = self.parentViewController as? EarnOnlinePartnersVC if let strongSelf = parantController, let vc = OnlinePartnersVC.storyboardInstance(storyBoardName: "Burn") as? OnlinePartnersVC { vc.landingType = .earnProduct strongSelf.navigationController?.pushViewController(vc, animated: true) } } fileprivate func addBorderToCollectionView() { DispatchQueue.main.async { [weak self] in self?.collectionView.layer.addBorderRect(color: .lightGray, thickness: 1) } } fileprivate func addCellLayer(cell: UICollectionViewCell) { cell.layer.addBorder(edge: .left, color: .lightGray, thickness: 1) } } extension ShopClickTVCell: UICollectionViewDelegate, UICollectionViewDelegateFlowLayout { func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { var commonWidth: CGFloat = collectionView.frame.height + 40 let cellCount: CGFloat = CGFloat(cellModel.isEmpty ? 1 : cellModel.count) if (commonWidth * cellCount) < ScreenSize.SCREEN_WIDTH { commonWidth = ScreenSize.SCREEN_WIDTH / cellCount } return CGSize(width: commonWidth, height: collectionView.frame.height) } func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { self.cellTapClosure(indexPath.item) } }
[ -1 ]
c5567882ef68a826c2801e2f393b323eb2a6a563
24db2ea1485bde81c8945bd3b09bd9fb4d2f0ba6
/Pods/Charts/Source/Charts/Renderers/LegendRenderer.swift
ab84b3b9fb13d9574139adbdaf428d72be5708cd
[ "Apache-2.0" ]
permissive
aolu009/MyWorkout
816aa9aa98487ace0e8ad962333be7ad36e1598b
2f3f1a14afd998336d4db6864c93df7d94609deb
refs/heads/master
2018-12-12T02:34:38.462295
2018-10-02T08:03:30
2018-10-02T08:03:30
109,475,083
0
0
null
null
null
null
UTF-8
Swift
false
false
20,502
swift
// // LegendRenderer.swift // Charts // // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda // A port of MPAndroidChart for iOS // Licensed under Apache License 2.0 // // https://github.com/danielgindi/Charts // import Foundation import CoreGraphics #if !os(OSX) import UIKit #endif @objc(ChartLegendRenderer) open class LegendRenderer: Renderer { /// the legend object this renderer renders @objc open var legend: Legend? @objc public init(viewPortHandler: ViewPortHandler?, legend: Legend?) { super.init(viewPortHandler: viewPortHandler) self.legend = legend } /// Prepares the legend and calculates all needed forms, labels and colors. @objc open func computeLegend(data: ChartData) { guard let legend = legend, let viewPortHandler = self.viewPortHandler else { return } if !legend.isLegendCustom { var entries: [LegendEntry] = [] // loop for building up the colors and labels used in the legend for i in 0..<data.dataSetCount { guard let dataSet = data.getDataSetByIndex(i) else { continue } var clrs: [NSUIColor] = dataSet.colors let entryCount = dataSet.entryCount // if we have a barchart with stacked bars if dataSet is IBarChartDataSet && (dataSet as! IBarChartDataSet).isStacked { let bds = dataSet as! IBarChartDataSet var sLabels = bds.stackLabels for j in 0..<min(clrs.count, bds.stackSize) { entries.append( LegendEntry( label: sLabels[j % sLabels.count], form: dataSet.form, formSize: dataSet.formSize, formLineWidth: dataSet.formLineWidth, formLineDashPhase: dataSet.formLineDashPhase, formLineDashLengths: dataSet.formLineDashLengths, formColor: clrs[j] ) ) } if dataSet.label != nil { // add the legend description label entries.append( LegendEntry( label: dataSet.label, form: .none, formSize: CGFloat.nan, formLineWidth: CGFloat.nan, formLineDashPhase: 0.0, formLineDashLengths: nil, formColor: nil ) ) } } else if dataSet is IPieChartDataSet { let pds = dataSet as! IPieChartDataSet for j in 0..<min(clrs.count, entryCount) { entries.append( LegendEntry( label: (pds.entryForIndex(j) as? PieChartDataEntry)?.label, form: dataSet.form, formSize: dataSet.formSize, formLineWidth: dataSet.formLineWidth, formLineDashPhase: dataSet.formLineDashPhase, formLineDashLengths: dataSet.formLineDashLengths, formColor: clrs[j] ) ) } if dataSet.label != nil { // add the legend description label entries.append( LegendEntry( label: dataSet.label, form: .none, formSize: CGFloat.nan, formLineWidth: CGFloat.nan, formLineDashPhase: 0.0, formLineDashLengths: nil, formColor: nil ) ) } } else if dataSet is ICandleChartDataSet && (dataSet as! ICandleChartDataSet).decreasingColor != nil { let candleDataSet = dataSet as! ICandleChartDataSet entries.append( LegendEntry( label: nil, form: dataSet.form, formSize: dataSet.formSize, formLineWidth: dataSet.formLineWidth, formLineDashPhase: dataSet.formLineDashPhase, formLineDashLengths: dataSet.formLineDashLengths, formColor: candleDataSet.decreasingColor ) ) entries.append( LegendEntry( label: dataSet.label, form: dataSet.form, formSize: dataSet.formSize, formLineWidth: dataSet.formLineWidth, formLineDashPhase: dataSet.formLineDashPhase, formLineDashLengths: dataSet.formLineDashLengths, formColor: candleDataSet.increasingColor ) ) } else { // all others for j in 0..<min(clrs.count, entryCount) { let label: String? // if multiple colors are set for a DataSet, group them if j < clrs.count - 1 && j < entryCount - 1 { label = nil } else { // add label to the last entry label = dataSet.label } entries.append( LegendEntry( label: label, form: dataSet.form, formSize: dataSet.formSize, formLineWidth: dataSet.formLineWidth, formLineDashPhase: dataSet.formLineDashPhase, formLineDashLengths: dataSet.formLineDashLengths, formColor: clrs[j] ) ) } } } legend.entries = entries + legend.extraEntries } // calculate all dimensions of the legend legend.calculateDimensions(labelFont: legend.font, viewPortHandler: viewPortHandler) } @objc open func renderLegend(context: CGContext) { guard let legend = legend, let viewPortHandler = self.viewPortHandler else { return } if !legend.enabled { return } let labelFont = legend.font let labelTextColor = legend.textColor let labelLineHeight = labelFont.lineHeight let formYOffset = labelLineHeight / 2.0 var entries = legend.entries let defaultFormSize = legend.formSize let formToTextSpace = legend.formToTextSpace let xEntrySpace = legend.xEntrySpace let yEntrySpace = legend.yEntrySpace let orientation = legend.orientation let horizontalAlignment = legend.horizontalAlignment let verticalAlignment = legend.verticalAlignment let direction = legend.direction // space between the entries let stackSpace = legend.stackSpace let yoffset = legend.yOffset let xoffset = legend.xOffset var originPosX: CGFloat = 0.0 switch horizontalAlignment { case .left: if orientation == .vertical { originPosX = xoffset } else { originPosX = viewPortHandler.contentLeft + xoffset } if direction == .rightToLeft { originPosX += legend.neededWidth } case .right: if orientation == .vertical { originPosX = viewPortHandler.chartWidth - xoffset } else { originPosX = viewPortHandler.contentRight - xoffset } if direction == .leftToRight { originPosX -= legend.neededWidth } case .center: if orientation == .vertical { originPosX = viewPortHandler.chartWidth / 2.0 } else { originPosX = viewPortHandler.contentLeft + viewPortHandler.contentWidth / 2.0 } originPosX += (direction == .leftToRight ? +xoffset : -xoffset) // Horizontally layed out legends do the center offset on a line basis, // So here we offset the vertical ones only. if orientation == .vertical { if direction == .leftToRight { originPosX -= legend.neededWidth / 2.0 - xoffset } else { originPosX += legend.neededWidth / 2.0 - xoffset } } } switch orientation { case .horizontal: var calculatedLineSizes = legend.calculatedLineSizes var calculatedLabelSizes = legend.calculatedLabelSizes var calculatedLabelBreakPoints = legend.calculatedLabelBreakPoints var posX: CGFloat = originPosX var posY: CGFloat switch verticalAlignment { case .top: posY = yoffset case .bottom: posY = viewPortHandler.chartHeight - yoffset - legend.neededHeight case .center: posY = (viewPortHandler.chartHeight - legend.neededHeight) / 2.0 + yoffset } var lineIndex: Int = 0 for i in 0 ..< entries.count { let e = entries[i] let drawingForm = e.form != .none let formSize = e.formSize.isNaN ? defaultFormSize : e.formSize if i < calculatedLabelBreakPoints.count && calculatedLabelBreakPoints[i] { posX = originPosX posY += labelLineHeight + yEntrySpace } if posX == originPosX && horizontalAlignment == .center && lineIndex < calculatedLineSizes.count { posX += (direction == .rightToLeft ? calculatedLineSizes[lineIndex].width : -calculatedLineSizes[lineIndex].width) / 2.0 lineIndex += 1 } let isStacked = e.label == nil // grouped forms have null labels if drawingForm { if direction == .rightToLeft { posX -= formSize } drawForm( context: context, x: posX, y: posY + formYOffset, entry: e, legend: legend) if direction == .leftToRight { posX += formSize } } if !isStacked { if drawingForm { posX += direction == .rightToLeft ? -formToTextSpace : formToTextSpace } if direction == .rightToLeft { posX -= calculatedLabelSizes[i].width } drawLabel( context: context, x: posX, y: posY, label: e.label!, font: labelFont, textColor: labelTextColor) if direction == .leftToRight { posX += calculatedLabelSizes[i].width } posX += direction == .rightToLeft ? -xEntrySpace : xEntrySpace } else { posX += direction == .rightToLeft ? -stackSpace : stackSpace } } case .vertical: // contains the stacked legend size in pixels var stack = CGFloat(0.0) var wasStacked = false var posY: CGFloat = 0.0 switch verticalAlignment { case .top: posY = (horizontalAlignment == .center ? 0.0 : viewPortHandler.contentTop) posY += yoffset case .bottom: posY = (horizontalAlignment == .center ? viewPortHandler.chartHeight : viewPortHandler.contentBottom) posY -= legend.neededHeight + yoffset case .center: posY = viewPortHandler.chartHeight / 2.0 - legend.neededHeight / 2.0 + legend.yOffset } for i in 0 ..< entries.count { let e = entries[i] let drawingForm = e.form != .none let formSize = e.formSize.isNaN ? defaultFormSize : e.formSize var posX = originPosX if drawingForm { if direction == .leftToRight { posX += stack } else { posX -= formSize - stack } drawForm( context: context, x: posX, y: posY + formYOffset, entry: e, legend: legend) if direction == .leftToRight { posX += formSize } } if e.label != nil { if drawingForm && !wasStacked { posX += direction == .leftToRight ? formToTextSpace : -formToTextSpace } else if wasStacked { posX = originPosX } if direction == .rightToLeft { posX -= (e.label! as NSString).size(withAttributes: [NSAttributedStringKey.font: labelFont]).width } if !wasStacked { drawLabel(context: context, x: posX, y: posY, label: e.label!, font: labelFont, textColor: labelTextColor) } else { posY += labelLineHeight + yEntrySpace drawLabel(context: context, x: posX, y: posY, label: e.label!, font: labelFont, textColor: labelTextColor) } // make a step down posY += labelLineHeight + yEntrySpace stack = 0.0 } else { stack += formSize + stackSpace wasStacked = true } } } } fileprivate var _formLineSegmentsBuffer = [CGPoint](repeating: CGPoint(), count: 2) /// Draws the Legend-form at the given position with the color at the given index. @objc open func drawForm( context: CGContext, x: CGFloat, y: CGFloat, entry: LegendEntry, legend: Legend) { guard let formColor = entry.formColor, formColor != NSUIColor.clear else { return } var form = entry.form if form == .default { form = legend.form } let formSize = entry.formSize.isNaN ? legend.formSize : entry.formSize context.saveGState() defer { context.restoreGState() } switch form { case .none: // Do nothing break case .empty: // Do not draw, but keep space for the form break case .default: fallthrough case .circle: context.setFillColor(formColor.cgColor) context.fillEllipse(in: CGRect(x: x, y: y - formSize / 2.0, width: formSize, height: formSize)) case .square: context.setFillColor(formColor.cgColor) context.fill(CGRect(x: x, y: y - formSize / 2.0, width: formSize, height: formSize)) case .line: let formLineWidth = entry.formLineWidth.isNaN ? legend.formLineWidth : entry.formLineWidth let formLineDashPhase = entry.formLineDashPhase.isNaN ? legend.formLineDashPhase : entry.formLineDashPhase let formLineDashLengths = entry.formLineDashLengths == nil ? legend.formLineDashLengths : entry.formLineDashLengths context.setLineWidth(formLineWidth) if formLineDashLengths != nil && formLineDashLengths!.count > 0 { context.setLineDash(phase: formLineDashPhase, lengths: formLineDashLengths!) } else { context.setLineDash(phase: 0.0, lengths: []) } context.setStrokeColor(formColor.cgColor) _formLineSegmentsBuffer[0].x = x _formLineSegmentsBuffer[0].y = y _formLineSegmentsBuffer[1].x = x + formSize _formLineSegmentsBuffer[1].y = y context.strokeLineSegments(between: _formLineSegmentsBuffer) } } /// Draws the provided label at the given position. @objc open func drawLabel(context: CGContext, x: CGFloat, y: CGFloat, label: String, font: NSUIFont, textColor: NSUIColor) { ChartUtils.drawText(context: context, text: label, point: CGPoint(x: x, y: y), align: .left, attributes: [NSAttributedStringKey.font: font, NSAttributedStringKey.foregroundColor: textColor]) } }
[ 54530, 97443, 215268, 184999, 237448, 67497, 302348, 308047, 286066, 208211, 221976 ]
0fa6fae1674164a4054a2f59f37e43536b6c9b0a
53388e49de72c224821086094153e5aed192c6fc
/Finder/Finder/AddBtnCellView.swift
8cfa78798c358df5efc7aaa7d7e5a59ffcc58447
[]
no_license
zzzmobile/HitoBito
81e4a3b971e74d69a1325ab0e416ee4d0f760105
59f58d97ba4f4648a35ec8d424cbac3223bc07eb
refs/heads/main
2023-05-27T23:31:16.420220
2021-06-26T09:25:34
2021-06-26T09:25:34
380,461,558
0
0
null
null
null
null
UTF-8
Swift
false
false
402
swift
// // AddBtnCellView.swift // Finder // // Created by Ying Yu on 5/22/20. // Copyright © 2020 DJay. All rights reserved. // import UIKit class AddBtnCellView: UIView { /* // Only override draw() if you perform custom drawing. // An empty implementation adversely affects performance during animation. override func draw(_ rect: CGRect) { // Drawing code } */ }
[ -1 ]
3871bfc91dfcf3740e2bc75e7f1895163e558b1b
a132d022e1314c3566bd178d867f9f99fa2d4f4d
/Cinema/ViewController.swift
40f86e9ff868beeba18810333b492e5e8b97b6c9
[]
no_license
Anton1003/Cinema
f3cde1cd05a692bf2e2d5214649dc42e37504d62
a86a3c5afd1312157e64887c946186f1f67682e5
refs/heads/main
2023-03-15T04:29:13.655532
2021-03-09T18:14:31
2021-03-09T18:14:31
345,378,365
0
0
null
null
null
null
UTF-8
Swift
false
false
210
swift
// // ViewController.swift // Cinema // // Created by User on 04.03.2021. // import UIKit /// class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() } }
[ -1 ]
40ac1842885e8889d178aa60a633949b4e0c9314
94973495077299bd8fbdadde683fcf78ae942533
/Discount CalculatorUITests/Discount_CalculatorUITests.swift
f7e40d1861072eda7f12d8833911746c2300fa04
[]
no_license
vancemdo/Project-3
f6da7571738aef3b42fdd2a921598e161a9ff7eb
addcf7615ac790fda49e8139d854ccc91e5fb7db
refs/heads/master
2021-01-23T03:54:24.327430
2017-03-25T06:02:29
2017-03-25T06:02:29
86,136,573
0
0
null
null
null
null
UTF-8
Swift
false
false
1,268
swift
// // Discount_CalculatorUITests.swift // Discount CalculatorUITests // // Created by Vance on 2/27/17. // Copyright © 2017 Vance. All rights reserved. // import XCTest class Discount_CalculatorUITests: XCTestCase { override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. // In UI tests it is usually best to stop immediately when a failure occurs. continueAfterFailure = false // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. XCUIApplication().launch() // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. super.tearDown() } func testExample() { // Use recording to get started writing UI tests. // Use XCTAssert and related functions to verify your tests produce the correct results. } }
[ 155665, 237599, 229414, 278571, 229425, 180279, 229431, 319543, 213051, 286787, 237638, 311373, 278607, 196687, 311377, 368732, 180317, 278637, 319599, 278642, 131190, 131199, 278676, 311447, 327834, 278684, 278690, 311459, 278698, 278703, 278707, 278713, 180409, 295099, 139459, 131270, 229591, 147679, 311520, 147680, 319719, 295147, 286957, 319764, 278805, 311582, 278817, 311596, 336177, 98611, 278843, 287040, 319812, 311622, 229716, 278895, 287089, 139641, 311679, 311692, 106893, 156069, 311723, 311739, 319931, 278974, 336319, 311744, 278979, 336323, 278988, 278992, 279000, 279009, 369121, 188899, 279014, 319976, 279017, 311787, 319986, 279030, 311800, 279033, 279042, 287237, 377352, 279053, 303634, 303635, 279060, 279061, 188954, 279066, 279092, 377419, 303693, 115287, 189016, 295518, 287327, 279143, 279150, 287345, 287348, 189054, 287359, 303743, 164487, 311944, 344714, 311950, 311953, 287379, 336531, 295575, 303772, 205469, 221853, 279207, 295591, 295598, 279215, 279218, 287412, 164532, 303802, 287418, 66243, 287434, 287438, 279249, 303826, 279253, 369365, 369366, 230105, 295653, 230120, 312046, 230133, 279293, 205566, 295688, 312076, 295698, 221980, 336678, 262952, 262953, 279337, 262957, 164655, 328495, 303921, 230198, 295745, 222017, 279379, 295769, 230238, 230239, 279393, 303973, 279398, 295797, 295799, 279418, 336765, 287623, 279434, 320394, 189349, 279465, 304050, 189373, 213956, 345030, 213961, 279499, 304086, 304104, 123880, 320492, 320495, 287730, 312313, 214009, 312315, 312317, 328701, 328705, 418819, 230411, 320526, 238611, 140311, 238617, 197658, 336930, 132140, 189487, 312372, 238646, 238650, 320571, 336962, 238663, 296023, 205911, 156763, 214116, 230500, 279659, 238706, 279666, 312435, 230514, 279686, 222344, 337037, 296091, 238764, 148674, 312519, 148687, 189651, 279766, 189656, 279775, 304352, 304353, 279780, 279789, 279803, 320769, 312588, 320795, 320802, 304422, 312628, 345398, 222523, 279872, 181568, 279874, 304457, 230730, 345418, 337228, 296269, 222542, 238928, 296274, 230757, 296304, 312688, 230772, 337280, 296328, 296330, 304523, 9618, 279955, 148899, 279979, 279988, 280003, 370122, 337359, 329168, 312785, 222674, 329170, 280020, 280025, 239069, 320997, 280042, 280043, 329198, 337391, 296434, 288248, 288252, 312830, 230922, 304655, 329231, 230933, 222754, 312879, 230960, 288305, 239159, 157246, 288319, 288322, 280131, 124486, 288328, 230999, 345697, 312937, 312941, 206447, 288377, 337533, 280193, 239238, 288391, 239251, 280217, 198304, 337590, 296636, 280253, 280252, 321217, 280259, 321220, 296649, 239305, 280266, 9935, 313042, 18139, 280285, 321250, 337638, 181992, 288492, 34547, 67316, 313082, 288508, 288515, 280326, 116491, 280333, 124691, 116502, 321308, 321309, 280367, 280377, 321338, 280381, 345918, 280386, 280391, 280396, 18263, 370526, 296807, 296815, 313200, 313204, 280451, 67464, 305032, 214936, 337816, 239515, 214943, 313257, 288698, 214978, 280517, 280518, 214983, 231382, 329696, 190437, 313322, 329707, 174058, 296942, 124912, 239610, 313338, 182277, 313356, 305173, 223269, 354342, 354346, 313388, 124974, 215095, 288829, 288835, 313415, 239689, 354386, 329812, 223317, 321632, 280676, 313446, 215144, 288878, 288890, 215165, 329884, 215204, 280761, 223418, 280767, 338118, 280779, 321744, 280792, 280803, 338151, 182503, 125166, 125170, 395511, 313595, 125184, 125192, 125197, 125200, 338196, 125204, 125215, 338217, 125225, 321839, 125236, 280903, 289109, 239973, 313703, 280938, 321901, 354671, 199030, 223611, 248188, 313726, 158087, 313736, 240020, 190870, 190872, 289185, 305572, 289195, 338359, 289229, 281038, 281039, 281071, 322057, 182802, 322077, 289328, 338491, 322119, 281165, 281170, 281200, 297600, 289435, 248494, 166581, 314043, 363212, 158424, 322269, 338658, 289511, 330473, 330476, 289517, 215790, 125683, 199415, 289534, 322302, 35584, 322312, 346889, 264971, 322320, 166677, 207639, 281378, 289580, 281407, 289599, 281426, 281434, 322396, 281444, 207735, 314240, 158594, 330627, 240517, 289691, 240543, 289699, 289704, 289720, 289723, 281541, 19398, 191445, 183254, 207839, 314343, 183276, 289773, 248815, 240631, 330759, 330766, 281647, 322609, 314437, 207954, 339031, 314458, 281698, 281699, 322664, 314493, 150656, 347286, 339106, 306339, 249003, 208044, 322733, 3243, 339131, 290001, 339167, 298209, 290030, 208123, 322826, 126229, 298290, 208179, 159033, 216387, 372039, 224591, 331091, 314708, 150868, 314711, 314721, 281958, 134504, 306541, 314740, 314742, 290170, 224637, 306558, 290176, 306561, 314752, 314759, 298378, 314771, 306580, 224662, 282008, 314776, 282013, 290206, 314788, 298406, 282023, 314790, 241067, 314797, 306630, 306634, 339403, 191980, 282097, 306678, 191991, 290304, 323083, 323088, 282132, 282135, 175640, 306730, 290359, 323132, 282182, 224848, 224852, 290391, 306777, 224874, 314997, 290425, 339579, 282244, 282248, 323208, 323226, 282272, 282279, 298664, 298666, 306875, 282302, 323262, 323265, 282309, 306891, 241360, 282321, 241366, 282330, 282336, 12009, 282349, 323315, 200444, 282366, 249606, 282375, 323335, 282379, 216844, 118549, 282399, 241440, 282401, 339746, 315172, 216868, 241447, 282418, 282428, 413500, 241471, 315209, 159563, 307024, 307030, 241494, 307038, 282471, 282476, 339840, 315265, 282503, 315272, 315275, 184207, 282517, 298912, 118693, 298921, 126896, 200628, 282573, 323554, 298987, 282634, 241695, 102441, 315433, 102446, 282671, 241717, 307269, 233548, 315468, 315477, 200795, 323678, 315488, 315489, 45154, 233578, 307306, 241809, 323730, 299166, 233635, 299176, 184489, 323761, 184498, 258233, 299197, 299202, 176325, 299208, 233678, 282832, 356575, 307431, 184574, 217352, 282908, 299294, 282912, 233761, 282920, 315698, 332084, 307514, 282938, 127292, 168251, 323914, 201037, 282959, 250196, 168280, 323934, 381286, 242027, 242028, 250227, 315768, 315769, 291194, 291193, 291200, 242059, 315798, 291225, 242079, 299449, 291266, 283088, 283089, 176602, 242138, 291297, 283138, 233987, 324098, 340489, 283154, 291359, 283185, 234037, 340539, 234044, 332379, 111197, 242274, 291455, 316044, 316048, 316050, 340645, 176810, 299698, 291529, 225996, 135888, 242385, 299737, 234216, 234233, 242428, 291584, 299777, 291591, 291605, 283418, 234276, 283431, 242481, 234290, 201534, 283466, 201562, 234330, 275294, 349025, 357219, 177002, 308075, 242540, 201590, 177018, 291713, 340865, 299912, 316299, 234382, 308111, 308113, 209820, 283551, 177074, 127945, 340960, 340967, 324587, 234476, 201721, 234499, 234513, 316441, 300087, 21567, 308288, 160834, 349254, 300109, 234578, 250965, 250982, 234606, 300145, 300147, 234626, 234635, 177297, 308375, 324761, 119965, 234655, 300192, 234662, 300200, 324790, 300215, 283841, 283846, 283849, 316628, 251124, 234741, 316661, 283894, 292092, 234756, 242955, 177420, 292145, 300342, 333114, 333115, 193858, 300355, 300354, 234830, 283990, 357720, 300378, 300379, 316764, 292194, 284015, 234864, 243073, 112019, 234902, 333224, 284086, 259513, 284090, 54719, 415170, 292291, 300488, 300490, 234957, 144862, 300526, 308722, 300539, 210429, 292359, 218632, 316951, 374297, 235069, 349764, 194118, 292424, 292426, 333389, 349780, 128600, 235096, 300643, 300645, 243306, 325246, 333438, 235136, 317102, 300729, 333508, 333522, 325345, 153318, 333543, 284410, 284425, 300810, 300812, 284430, 161553, 284436, 325403, 341791, 325411, 186148, 186149, 333609, 284460, 300849, 325444, 153416, 325449, 317268, 325460, 341846, 284508, 300893, 284515, 276326, 292713, 292719, 325491, 333687, 317305, 317308, 325508, 333700, 243590, 243592, 325514, 350091, 350092, 350102, 333727, 219046, 333734, 284584, 292783, 300983, 153553, 292835, 6116, 292838, 317416, 325620, 333827, 243720, 292901, 325675, 243763, 325695, 333902, 194667, 284789, 284790, 292987, 194692, 235661, 333968, 153752, 284827, 333990, 284840, 284843, 227517, 309443, 227525, 301255, 227536, 301270, 301271, 325857, 334049, 317676, 309504, 194832, 227601, 325904, 334104, 211239, 334121, 317738, 325930, 227655, 383309, 391521, 285031, 416103, 227702, 211327, 227721, 285074, 227730, 293275, 285083, 317851, 293281, 285089, 301482, 375211, 334259, 293309, 317889, 326083, 129484, 326093, 285152, 195044, 334315, 236020, 293368, 317949, 342537, 309770, 334345, 342560, 293420, 236080, 23093, 244279, 244280, 301635, 309831, 55880, 301647, 326229, 309847, 244311, 244326, 301688, 244345, 301702, 334473, 326288, 227991, 285348, 318127, 285360, 293552, 285362, 342705, 154295, 342757, 285419, 170735, 342775, 375552, 228099, 285443, 285450, 326413, 285457, 285467, 326428, 318247, 293673, 318251, 301872, 285493, 285496, 301883, 342846, 293702, 318279, 244569, 301919, 293729, 351078, 310132, 228214, 269179, 228232, 416649, 252812, 293780, 310166, 310177, 293801, 326571, 326580, 326586, 359365, 211913, 56270, 203758, 293894, 293911, 326684, 113710, 318515, 203829, 285795, 228457, 318571, 187508, 302202, 285819, 285823, 285833, 285834, 318602, 228492, 162962, 187539, 326803, 285850, 302239, 302251, 294075, 64699, 228541, 343230, 310496, 228587, 302319, 228608, 318732, 245018, 318746, 130342, 130344, 130347, 286012, 294210, 327030, 310650, 179586, 294278, 368012, 318860, 318876, 343457, 245160, 286128, 286133, 310714, 302523, 228796, 302530, 228804, 310725, 310731, 302539, 310735, 327122, 310747, 286176, 187877, 310758, 40439, 286201, 359931, 245249, 228868, 302602, 294413, 359949, 302613, 302620, 245291, 310853, 196184, 212574, 204386, 204394, 138862, 310896, 294517, 286344, 179853, 286351, 188049, 229011, 179868, 229021, 302751, 245413, 212649, 286387, 286392, 302778, 286400, 212684, 302798, 286419, 294621, 294629, 286457, 286463, 319232, 278292, 278294, 294699, 286507, 319289, 237397, 188250, 237411, 327556, 188293, 311183, 294806, 294808, 319393, 294820, 294824, 343993, 98240, 294849, 24531, 294887, 278507, 311277, 327666, 278515 ]
4262dde62148efbff24fc75797dd0d3279edc053
680042e27880f1adfb02ca69e43341b06604db11
/LonaStudio/Models/CSData.swift
31a2ed70b5049113eb19e7b3917e8b8d358daa8e
[ "MIT" ]
permissive
focusspan/Lona
4063ffecc5ece965380619b868f0fcc63221d76c
276f937e256072b316455dd98f571e7f6851b5aa
refs/heads/master
2021-05-16T14:54:04.021208
2018-01-23T18:24:26
2018-01-23T18:24:26
118,712,301
2
0
null
2018-01-24T04:34:28
2018-01-24T04:34:28
null
UTF-8
Swift
false
false
10,190
swift
// // CSData.swift // ComponentStudio // // Created by devin_abbott on 7/28/17. // Copyright © 2017 Devin Abbott. All rights reserved. // import Foundation // https://stackoverflow.com/questions/30215680/is-there-a-correct-way-to-determine-that-an-nsnumber-is-derived-from-a-bool-usin/30223989#30223989 fileprivate func isBool(number: NSNumber) -> Bool { let boolID = CFBooleanGetTypeID() // the type ID of CFBoolean let numID = CFGetTypeID(number) // the type ID of num return numID == boolID } enum CSData: Equatable, CustomDebugStringConvertible { case Null case Bool(Bool) case Number(Double) case String(String) case Array([CSData]) case Object([String: CSData]) var debugDescription: String { switch self { case .Null: return "null" case .Bool(let value): return "\(value)" case .Number(let value): return "\(value)" case .String(let value): return "\"\(value)\"" case .Array(let value): return "[" + value.map({ $0.debugDescription }).joined(separator: ", ") + "]" case .Object(let value): return "{" + value.map({ "\($0.key): \($0.value)" }).joined(separator: ", ") + "}" } } static func ==(lhs: CSData, rhs: CSData) -> Bool { switch (lhs, rhs) { case (.Null, .Null): return true case (.Bool(let l), .Bool(let r)): return l == r case (.Number(let l), .Number(let r)): return l == r case (.String(let l), .String(let r)): return l == r case (.Array(let l), .Array(let r)): if l.count != r.count { return false } for pair in zip(l, r) { if pair.0 != pair.1 { return false } } return true case (.Object(let l), .Object(let r)): if l.count != r.count { return false } for (key, value) in l { if r[key] != value { return false } } return true default: return false } } var isNull: Bool { get { return self == CSData.Null } } var bool: Bool? { get { guard case CSData.Bool(let value) = self else { return nil } return value } set { if let value = newValue { self = CSData.Bool(value) } } } var boolValue: Bool { return bool ?? false } var number: Double? { get { guard case CSData.Number(let value) = self else { return nil } return value } set { if let value = newValue { self = CSData.Number(value) } } } var numberValue: Double { return number ?? 0 } var string: String? { get { guard case CSData.String(let value) = self else { return nil } return value } set { if let value = newValue { self = CSData.String(value) } } } var stringValue: String { return string ?? "" } var array: [CSData]? { get { guard case CSData.Array(let value) = self else { return nil } return value } set { if let value = newValue { self = CSData.Array(value) } } } var arrayValue: [CSData] { return array ?? [] } var object: [String: CSData]? { get { guard case CSData.Object(let value) = self else { return nil } return value } set { if let value = newValue { self = CSData.Object(value) } } } var objectValue: [String: CSData] { return object ?? [:] } subscript(index: Int) -> CSData? { get { switch self { case .Array(let value): return value[index] default: return nil } } set { switch self { case .Array(var value): if let v = newValue { value[index] = v } else { // This isn't quite right, but it's probably better than making a sparse array value[index] = .Null } self = CSData.Array(value) default: break } } } subscript(index: String) -> CSData? { get { switch self { case .Object(let value): return value[index] default: return nil } } set { switch self { case .Object(var value): if let v = newValue { value[index] = v } else { value.removeValue(forKey: index) } self = CSData.Object(value) default: break } } } func get(key: String) -> CSData { return self[key] ?? .Null } func get(keyPath: [String]) -> CSData { return keyPath.reduce(self, { (result, key) in result.get(key: key) }) } @discardableResult mutating func set(keyPath: [String], to value: CSData) -> CSData { if keyPath.count == 0 { self = value return self } let key = keyPath[0] var object = self[key] ?? CSData.Object([:]) self = merge(.Object([ key: object.set(keyPath: Swift.Array(keyPath[1..<keyPath.count]), to: value) ])) return self } func merge(_ object: CSData) -> CSData { var merged = CSData.Object([:]) if let original = self.object { original.forEach({ (key, value) in merged[key] = value }) } if let extra = object.object { extra.forEach({ (key, value) in merged[key] = value }) } return merged } func toAny() -> Any { switch self { case .Null: return NSNull() case .Bool(let value): return NSNumber(booleanLiteral: value) case .Number(let value): return value case .String(let value): return value case .Array(let value): return value.map({ $0.toAny() }) case .Object(let value): return value.map({ $0.toAny() }) } } func toData() -> Data? { let options: JSONSerialization.WritingOptions if #available(OSX 10.13, *) { options = [ JSONSerialization.WritingOptions.prettyPrinted, JSONSerialization.WritingOptions.sortedKeys ] } else { options = [ JSONSerialization.WritingOptions.prettyPrinted, ] } return try? JSONSerialization.data(withJSONObject: toAny(), options: options) } static func from(data: Data) -> CSData? { guard let json = try? JSONSerialization.jsonObject(with: data) else { return nil } return from(json: json) } static func from(json: Any) -> CSData { if let _ = json as? NSNull { return CSData.Null } else if let value = json as? NSNumber { return isBool(number: value) ? CSData.Bool(value.boolValue) : CSData.Number(Double(truncating: value)) } else if let value = json as? NSString { return CSData.String(value as String) } else if let value = json as? NSArray { return CSData.Array( value.map({ CSData.from(json: $0) }) ) } else if let value = json as? NSDictionary { let object: [String: CSData] = value.map({ $0 }).key { (key: ($0.key as! NSString) as String, value: CSData.from(json: $0.value)) } return CSData.Object(object) } return CSData.Null } static func from(fileAtPath path: String) -> CSData? { if let contents = try? Data(contentsOf: URL(fileURLWithPath: path)) { return CSData.from(data: contents) } else { Swift.print("Failed to read .json file at \(path)") return nil } } } protocol CSDataSerializable { func toData() -> CSData } protocol CSDataDeserializable { init(_ data: CSData) } extension Bool: CSDataSerializable { func toData() -> CSData { return .Bool(self) } } extension Double: CSDataSerializable { func toData() -> CSData { return .Number(self) } } extension Double: CSDataDeserializable { init(_ data: CSData) { self = data.numberValue } } extension CGFloat: CSDataSerializable { func toData() -> CSData { return .Number(Double(self)) } } extension Int: CSDataSerializable { func toData() -> CSData { return .Number(Double(self)) } } extension UInt: CSDataSerializable { func toData() -> CSData { return .Number(Double(self)) } } extension String: CSDataSerializable { func toData() -> CSData { return .String(self) } } extension String: CSDataDeserializable { init(_ data: CSData) { self = data.stringValue } } extension Sequence where Iterator.Element: CSDataSerializable { func toData() -> CSData { let list = map({ $0.toData() }) return .Array(list) } } extension Dictionary where Key: ExpressibleByStringLiteral, Value: CSDataSerializable { func toData() -> CSData { var items: [String: CSData] = [:] for (_, item) in self.enumerated() { items["\(item.key)"] = item.value.toData() } return CSData.Object(items) } } typealias CSDataChangeHandler = (CSData) -> Void let CSDataDefaultChangeHandler: CSDataChangeHandler = {_ in}
[ -1 ]
15471755dee8781b50a59ac1386cd87a4edc2046
0973ca6ff82e49c0a8a3303faceee5a943ff63d2
/FlikrSlideShow/SlideShowViewModel.swift
9919f879b016fa7524f23ec7cd795d86dcece43d
[ "MIT" ]
permissive
jhbae/flikr-publicfeed-slideshow
aeb7c3f66e044189f6580af17a62af2f80a1e85a
f4a96615c0a71d54d2d0292b721b5e0b1134aaf7
refs/heads/master
2020-05-29T11:49:51.768240
2016-09-21T09:28:08
2016-09-21T09:28:08
68,789,731
0
1
null
null
null
null
UTF-8
Swift
false
false
2,269
swift
// // SlideShowViewModel.swift // FlikrSlideShow // // Created by luke.bae on 2016. 9. 21.. // Copyright © 2016년 Luke Bae. All rights reserved. // import Foundation import Alamofire import AlamofireImage import AlamofireRSSParser typealias StopSlide = (Void) -> Void typealias StartSlide = (Void) -> Void typealias UpdateImage = (String) -> Void private let MAX_FEED_LIMIT = 50 private let MIN_FEED_LEFT_LIMIT = 5 class SlideShowViewModel { var updateImage: UpdateImage private var stopped: Bool = true private var feeds: [RSSItem] = [] private var curIndex = 0 init (updateImageView:UpdateImage) { self.updateImage = updateImageView } func isStopped() -> Bool { return stopped } func stopLoading() { self.stopped = true self.curIndex = 0 self.feeds = [] } func startLoading() { self.stopped = false self.loadFeeds() } func doSlideShow() { if self.stopped == false && self.feeds.count - MIN_FEED_LEFT_LIMIT > self.curIndex { self.updateImage(self.feeds[self.curIndex].mediaContent!) self.increaseIndex() } else if self.stopped == false && self.feeds.count - MIN_FEED_LEFT_LIMIT <= self.curIndex { loadFeeds() } } private func increaseIndex() { self.curIndex += 1 } private func loadFeeds() { let flkrRestClient = FlkrRestClient.sharedInstance flkrRestClient.getPublicPhotoFeeds(nil, ids:nil, tags:nil, tagMode:nil, format:nil, lang:nil) .continueOnSuccessWith{ result in if self.feeds.count + result.items.count > MAX_FEED_LIMIT { if self.curIndex >= result.items.count { self.curIndex -= result.items.count self.feeds.removeFirst(result.items.count) } else { self.feeds.removeAll() self.curIndex = 0 } } self.feeds.appendContentsOf(result.items) self.doSlideShow() }.continueOnErrorWith { (error:NSError) in print("\(error)") } } }
[ -1 ]
b03079e1c4f3def19a8acdb10de53339536273e1
6564953f808f78831a6c0e847a72c017e7bbb127
/WordScramble/WordScramble/SceneDelegate.swift
9fd78a4141e7968d384b89373d2aa544deb2de40
[]
no_license
jameswoo88/WordScramble
838f5838d41ff361673883edef7197153d460567
4bb9506ba507f049c8f0ce1609d4db50b17b7380
refs/heads/main
2023-07-09T08:10:36.658534
2021-08-12T16:43:17
2021-08-12T16:43:17
395,365,287
0
0
null
null
null
null
UTF-8
Swift
false
false
2,704
swift
// // SceneDelegate.swift // WordScramble // // Created by James Chun on 8/12/21. // import UIKit import SwiftUI 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). // Create the SwiftUI view that provides the window contents. let contentView = ContentView() // 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 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. } }
[ 372739, 393221, 350214, 219144, 354314, 268299, 393228, 393231, 350225, 186388, 354143, 350241, 374819, 393251, 350245, 344103, 350249, 350252, 393260, 163892, 393269, 213049, 385082, 16444, 393277, 350272, 436290, 217158, 350281, 376906, 421961, 378956, 254032, 436307, 286804, 356440, 368728, 254045, 368736, 342113, 376932, 430181, 100454, 286833, 356467, 374904, 329853, 266365, 192640, 262284, 381069, 225425, 225430, 360598, 356507, 411806, 225439, 286880, 346273, 225442, 438434, 333989, 225445, 362661, 225448, 286889, 356521, 438441, 225451, 377003, 377013, 225462, 379067, 225468, 164029, 387261, 389309, 225472, 372931, 225476, 377030, 389322, 350411, 225485, 377037, 180432, 350417, 225488, 225491, 225494, 350423, 377047, 411862, 350426, 225497, 411865, 225500, 334047, 225503, 225506, 411874, 356580, 379108, 411877, 217319, 225511, 377063, 387303, 225515, 387307, 205037, 395496, 225519, 350449, 393457, 387314, 358645, 393461, 381177, 436474, 321787, 336124, 350459, 350462, 379135, 336129, 350465, 385281, 411905, 350469, 397572, 325895, 262405, 268553, 194829, 350477, 43279, 350481, 262417, 368913, 379154, 387350, 350487, 262423, 432406, 387353, 325915, 350491, 381212, 325918, 182559, 350494, 356638, 356641, 377121, 350500, 356644, 194854, 262437, 356647, 350505, 389417, 356650, 254253, 350510, 391469, 356656, 307507, 264502, 262455, 397623, 358714, 358717, 225599, 332098, 201030, 362823, 262473, 348489, 151884, 190797, 334162, 344404, 430422, 362844, 332126, 258399, 262497, 379234, 383331, 418145, 262501, 383334, 213354, 391531, 262508, 383342, 262512, 213374, 250239, 356734, 389503, 438657, 389507, 356741, 385420, 393613, 420237, 366991, 379279, 262553, 373146, 340380, 373149, 385444, 262567, 354728, 385452, 262574, 373169, 393649, 375220, 342453, 385460, 262587, 336326, 201158, 358857, 272849, 338387, 360917, 195041, 334306, 182755, 162289, 328178, 127473, 217590, 199165, 416255, 254463, 350724, 164362, 199182, 350740, 199189, 393748, 334359, 262679, 420377, 334364, 377372, 188959, 385571, 416294, 377384, 33322, 350762, 356908, 381483, 252463, 334386, 358962, 356917, 352822, 197178, 418364, 358973, 348734, 252483, 356935, 369224, 348745, 381513, 385610, 352844, 385617, 199250, 244309, 399957, 389724, 373344, 346722, 174696, 262761, 381546, 352875, 191085, 346736, 191093, 346743, 352888, 377473, 336517, 385671, 119432, 213642, 330384, 346769, 326291, 184983, 352919, 373399, 260767, 150184, 344745, 361130, 434868, 342711, 336568, 381626, 164539, 350207, 260798, 363198, 260802, 350918, 344777, 372598, 385743, 273109, 385749, 264919, 391895, 416476, 183006, 139998, 338661, 369382, 338665, 332521, 361196, 113389, 264942, 330479, 342769, 203508, 363252, 375541, 418555, 348926, 391938, 207620, 344837, 191240, 344843, 391949, 361231, 326417, 375569, 394002, 375572, 418581, 375575, 418586, 434971, 369436, 375580, 363294, 199455, 418591, 369439, 162592, 418594, 389927, 418600, 336681, 418606, 328498, 152371, 326452, 383794, 348979, 326455, 340792, 348983, 355123, 369464, 361274, 375613, 398141, 326463, 326468, 355141, 127815, 355144, 361289, 326474, 326479, 355151, 357202, 389971, 326486, 213848, 357208, 387929, 342875, 357212, 197469, 326494, 254813, 355167, 357215, 361307, 361310, 389979, 430940, 439138, 326503, 361318, 355176, 433001, 361323, 201580, 326508, 355180, 201583, 326511, 400238, 349041, 330612, 201589, 361335, 211832, 430967, 398202, 119675, 392061, 351105, 252801, 260993, 373635, 400260, 211846, 381834, 361361, 330643, 342931, 430996, 400279, 392092, 400286, 422817, 252838, 359335, 373672, 252846, 222129, 111539, 400307, 412600, 351169, 359362, 170950, 359367, 379849, 340940, 345036, 209874, 386004, 359383, 359389, 431073, 398307, 437219, 209896, 338928, 201712, 209904, 359411, 257009, 435188, 261109, 261112, 201724, 431100, 330750, 383999, 431107, 418822, 261130, 361490, 386070, 261148, 359452, 250915, 357411, 261155, 158759, 261160, 396329, 347178, 357419, 404526, 359471, 361525, 386102, 388155, 209980, 375868, 361537, 347208, 377931, 197708, 209996, 431180, 345172, 189525, 349268, 156762, 210011, 343132, 373853, 402523, 412765, 361568, 257121, 322660, 148580, 384102, 210026, 326764, 367724, 384108, 326767, 210032, 349296, 343155, 210037, 248952, 386168, 420985, 212095, 349313, 351366, 330886, 214150, 210056, 345224, 386187, 384144, 259217, 210068, 337048, 345247, 251045, 44199, 351399, 380071, 361645, 337072, 367795, 337076, 345268, 249015, 402615, 367801, 361657, 210108, 351424, 244934, 367817, 326858, 322763, 333003, 253132, 343246, 402636, 333010, 210132, 351450, 165086, 66783, 210144, 388320, 363757, 386286, 218355, 386292, 218361, 351483, 388348, 275713, 115973, 275717, 343307, 261391, 175376, 359695, 253202, 349460, 333079, 251161, 345377, 253218, 345380, 175397, 353572, 208167, 345383, 384299, 273709, 349486, 372016, 437553, 347442, 251190, 44343, 175416, 396601, 378170, 369979, 415034, 386366, 437567, 175425, 372035, 437571, 384324, 343366, 126279, 337224, 212296, 437576, 251211, 212304, 331089, 437584, 437588, 210261, 331094, 365912, 396634, 175451, 437596, 367966, 259423, 429408, 374113, 365922, 353634, 208228, 197987, 374118, 343399, 345449, 333164, 99692, 367981, 234867, 271731, 390518, 249210, 175484, 175487, 271746, 175491, 181639, 155021, 384398, 136591, 374161, 349591, 230810, 399200, 343453, 175517, 396706, 175523, 155045, 40358, 245163, 114093, 181682, 396723, 210357, 343478, 370105, 359867, 259516, 146878, 388543, 415168, 380353, 361922, 54724, 339401, 327116, 380364, 327118, 359887, 372177, 208338, 359891, 415187, 343509, 181717, 249303, 413143, 155103, 271841, 366057, 343535, 366064, 249329, 116211, 368120, 343545, 69114, 402943, 423424, 409092, 253445, 372229, 339464, 249355, 359948, 419341, 208399, 359951, 419345, 419351, 405017, 419357, 345631, 370208, 134689, 419360, 394787, 419363, 370214, 382503, 349739, 144940, 339504, 359984, 419377, 343610, 419386, 206397, 214594, 349762, 413251, 419401, 333387, 353868, 400977, 419412, 224854, 374359, 400982, 224858, 366173, 403040, 343650, 345702, 333415, 224871, 423529, 327276, 423533, 245358, 333423, 222831, 138865, 257647, 372338, 339572, 210547, 155255, 370298, 415354, 353920, 403073, 403076, 421509, 267910, 339593, 224905, 155274, 198282, 345737, 403085, 339602, 345750, 403321, 126618, 419484, 345758, 333472, 368289, 257705, 419498, 419502, 370351, 257713, 419507, 425652, 224949, 257717, 419510, 257721, 224954, 257725, 425663, 155328, 337601, 403139, 257733, 224966, 333512, 210632, 419528, 224970, 419531, 257740, 259789, 339664, 224976, 257745, 272083, 257748, 155352, 257752, 419545, 345819, 212700, 155356, 181982, 153311, 366301, 419548, 419551, 257762, 155364, 345829, 366308, 419560, 155372, 419564, 399086, 366319, 339696, 370416, 210673, 366322, 212723, 431852, 366326, 245495, 409336, 141052, 337661, 257788, 257791, 155394, 257796, 362249, 257802, 155404, 210700, 395022, 257805, 225039, 257808, 362252, 362256, 210707, 225044, 167701, 372500, 257815, 399129, 257820, 155423, 116512, 210720, 257825, 360224, 362274, 378664, 257837, 413485, 155439, 204592, 366384, 257843, 155444, 372533, 210740, 225077, 257846, 155448, 225080, 358201, 354107, 345916, 399166, 257853, 384829, 397113, 247618, 354112, 397116, 366403, 225094, 155463, 360262, 225097, 341835, 323404, 354124, 345932, 337743, 257869, 370510, 341839, 339795, 354132, 257872, 225105, 155477, 225109, 415574, 370520, 225113, 341852, 376665, 155484, 257884, 261982, 425823, 257887, 413539, 155488, 225120, 350046, 257891, 155492, 376672, 339818, 225128, 257897, 261997, 376686, 345965, 358256, 354157, 268144, 339827, 345968, 341877, 225138, 262003, 182136, 425846, 345971, 257909, 225142, 262006, 345975, 262009, 243584, 257914, 262012, 333699, 155517, 225150, 257922, 155523, 225156, 380803, 155526, 257927, 376715, 155532, 262028, 399244, 262031, 262034, 337814, 380823, 225176, 329625, 262040, 262043, 155550, 253854, 262046, 262049, 155560, 155563, 382891, 155566, 362414, 184245, 333767, 350153, 346059, 311244, 212945, 393170, 155604, 346069, 399318, 372698, 372704, 419810, 354275, 155620, 253924, 155622, 253927, 190440, 372707, 247790, 356336, 350194, 393204, 360439, 253944, 393209, 393215, 350204, 155647 ]
b319312f4c937d2c7cfa986d525c059d599786a1
eabef9ce6f3e81f24c0ceb88e24d92760c81c36a
/AuthApp/Controllers/SearchViewController.swift
42b9b82b3d6fdad3209f7baec75f2a01662ed28d
[]
no_license
ParkhomenkoAlexey/AuthApp
d8db8e93ad503d835d0723870c5a10c1398d9288
3b9673839064669bac7e1683071674edf78def54
refs/heads/master
2022-05-30T09:53:17.340684
2020-05-01T06:55:51
2020-05-01T06:55:51
259,848,788
0
0
null
null
null
null
UTF-8
Swift
false
false
3,175
swift
// // SearchViewController.swift // AuthApp // // Created by Алексей Пархоменко on 01.05.2020. // Copyright © 2020 Алексей Пархоменко. All rights reserved. // import UIKit class SearchViewController: UIViewController { let networkDataFetcher = NetworkDataFetcher() var searchResponse: SearchResponse? = nil private var timer: Timer? let searchController = UISearchController(searchResultsController: nil) let tableView = UITableView(frame: .zero, style: .plain) override func viewDidLoad() { super.viewDidLoad() setupSearchBar() setupElements() setupConstraints() } private func setupSearchBar() { navigationItem.searchController = searchController searchController.searchBar.delegate = self searchController.obscuresBackgroundDuringPresentation = false } } // MARK: - Setup Elements extension SearchViewController { func setupElements() { self.title = "Search" tableView.translatesAutoresizingMaskIntoConstraints = false tableView.register(UITableViewCell.self, forCellReuseIdentifier: "cell") tableView.delegate = self tableView.dataSource = self } } // MARK: - Setup Constraints extension SearchViewController { private func setupConstraints() { view.addSubview(tableView) NSLayoutConstraint.activate([ tableView.topAnchor.constraint(equalTo: view.topAnchor, constant: 0), tableView.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor), tableView.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor), tableView.bottomAnchor.constraint(equalTo: view.bottomAnchor) ]) } } // MARK: - UITableViewDelegate, UITableViewDataSource extension SearchViewController: UITableViewDelegate, UITableViewDataSource { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return searchResponse?.results.count ?? 0 } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) let track = searchResponse?.results[indexPath.row] print("track?.artworkUrl60:", track?.artworkUrl60) cell.textLabel?.text = track?.trackName return cell } } // MARK: - UISearchBarDelegate extension SearchViewController: UISearchBarDelegate { func searchBar(_ searchBar: UISearchBar, textDidChange searchText: String) { print(searchText) let urlString = "https://itunes.apple.com/search?term=\(searchText)&limit=10" timer?.invalidate() timer = Timer.scheduledTimer(withTimeInterval: 0.5, repeats: false, block: { (_) in self.networkDataFetcher.fetchTracks(urlString: urlString) { (searchResponse) in guard let searchResponse = searchResponse else { return } self.searchResponse = searchResponse self.tableView.reloadData() } }) } }
[ -1 ]
cd9a118c7b2eea5ba1158dadaba6ef2b81f3de57
c08dbe88eda703c3bb32f04f3686cc2cbfda8b17
/FinalProject/FinalProject/AppDelegate.swift
5acb51d237e7655e436fa5a45e4cc5e075592dd1
[]
no_license
vldmrkl/map-523
2dedd11b0463cabdef47950533e027be2f7d02cd
0f7d8c5093b071409779e44f1d6352719a2f4cb7
refs/heads/master
2020-04-17T02:38:12.147478
2019-04-23T03:59:47
2019-04-23T03:59:47
166,145,352
1
1
null
null
null
null
UTF-8
Swift
false
false
4,595
swift
// // AppDelegate.swift // CosmoZone // // Created by Volodymyr Klymenko on 2019-03-29. // Copyright © 2019 Volodymyr Klymenko. All rights reserved. // import UIKit import CoreData @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } func applicationWillResignActive(_ application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. } func applicationDidEnterBackground(_ application: UIApplication) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } func applicationWillEnterForeground(_ application: UIApplication) { // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. } func applicationDidBecomeActive(_ application: UIApplication) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. // Saves changes in the application's managed object context before the application terminates. self.saveContext() } // 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: "FinalProject") 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)") } } } }
[ 294405, 243717, 163848, 313353, 320008, 320014, 313360, 288275, 322580, 289300, 290326, 329747, 139803, 103964, 322080, 306721, 229408, 296483, 322083, 229411, 306726, 309287, 308266, 292907, 217132, 322092, 40495, 316465, 288306, 322102, 324663, 164408, 308281, 322109, 286783, 315457, 313409, 313413, 349765, 320582, 309832, 288329, 242250, 215117, 196177, 241746, 344661, 231000, 212571, 300124, 287323, 309342, 325220, 306790, 290409, 310378, 296043, 311914, 152685, 334446, 239726, 307310, 322666, 292466, 314995, 307315, 314487, 291450, 314491, 222846, 288383, 318599, 312970, 239252, 311444, 294038, 311449, 323739, 300194, 298662, 233638, 233644, 313005, 286896, 295600, 300208, 286389, 294070, 125111, 234677, 321212, 309439, 235200, 284352, 296641, 242371, 302787, 284360, 321228, 319181, 298709, 284374, 189654, 182486, 320730, 241371, 311516, 357083, 179420, 322272, 317665, 298210, 165091, 311525, 288489, 290025, 229098, 307436, 304365, 323310, 125167, 313073, 286455, 306424, 322299, 319228, 302332, 319231, 184576, 309505, 241410, 311043, 366339, 309509, 318728, 125194, 234763, 321806, 125201, 296218, 313116, 237858, 326434, 295716, 313125, 300836, 289577, 125226, 133421, 317233, 241971, 316726, 318264, 201530, 313660, 159549, 287038, 292159, 218943, 182079, 288578, 301893, 234828, 292172, 300882, 379218, 321364, 243032, 201051, 230748, 258397, 294238, 298844, 300380, 291169, 199020, 293741, 266606, 319342, 292212, 313205, 244598, 316788, 124796, 196988, 305022, 317821, 243072, 314241, 303999, 313215, 242050, 325509, 293767, 316300, 306576, 322448, 308114, 319900, 298910, 313250, 308132, 316327, 306605, 316334, 324015, 324017, 200625, 300979, 316339, 322998, 67000, 316345, 296888, 300987, 319932, 310718, 292288, 317888, 323520, 312772, 214980, 298950, 306632, 310733, 289744, 310740, 235994, 286174, 315359, 240098, 323555, 236008, 319465, 248299, 311789, 326640, 188913, 203761, 320498, 314357, 288246, 309243, 300540, 310782 ]
e373699558eef04cd65f432edf4082b947d87f6e
1cde6c060b3db476a67294c37c530ef7cde083a1
/Movie List/Models/MovieDescp/MovieDescpData.swift
d86c54134379a81ad70516b5d2ab53e9c3007f50
[]
no_license
fikri220/MovieList
7f4b17d96a2233020742e0ccba66bfbc94c7eacd
5b46019c550f9c6ef68a2c0600de55c21422b067
refs/heads/main
2023-08-05T18:34:37.798939
2021-09-23T03:20:33
2021-09-23T03:20:33
409,427,105
0
0
null
null
null
null
UTF-8
Swift
false
false
1,451
swift
// // MovieDescpData.swift // Movie List // // Created by Fikri Ihsan on 22/09/21. // import Foundation class MoviewDescpData :Codable { let vote_average : Double? let title : String? let release_date : String? let id : Int? let backdrop_path : String? let overview : String? let budget : Int? let revenue : Int? enum CodingKeys: String, CodingKey { case vote_average = "vote_average" case title = "title" case release_date = "release_date" case id = "id" case backdrop_path = "backdrop_path" case overview = "overview" case budget = "budget" case revenue = "revenue" } required init(from decoder: Decoder) throws { let values = try decoder.container(keyedBy: CodingKeys.self) vote_average = try values.decodeIfPresent(Double.self, forKey: .vote_average) title = try values.decodeIfPresent(String.self, forKey: .title) release_date = try values.decodeIfPresent(String.self, forKey: .release_date) id = try values.decodeIfPresent(Int.self, forKey: .id) backdrop_path = try values.decodeIfPresent(String.self, forKey: .backdrop_path) overview = try values.decodeIfPresent(String.self, forKey: .overview) budget = try values.decodeIfPresent(Int.self, forKey: .budget) revenue = try values.decodeIfPresent(Int.self, forKey: .revenue) } }
[ -1 ]
60c3b1881e7413c26f073d15f6db04ae2dc625c3
81f66f801e0bca97dc6897ef144758c0d75c6c6b
/Swift/健康管理H5/健康管理H5/Extensions/ExURL.swift
3a02ff99e22eec5bdbc04cfa8c2b5a0aa7e4fb9b
[]
no_license
chendengwen/iOS
04965c59a9f6bbb292973c1a69661d34b02ec9b3
519f71a5e11ffe9c91993be2c9aa499b0036a600
refs/heads/main
2023-08-28T20:54:20.542632
2021-10-25T02:50:43
2021-10-25T02:50:43
398,257,122
2
0
null
null
null
null
UTF-8
Swift
false
false
545
swift
// // ExURL.swift // 健康管理H5 // // Created by mac on 2019/8/6. // Copyright © 2019 Gary. All rights reserved. // import UIKit extension URL { //获取url中的参数 public var paramsFromQueryString : [String: String]? { guard let components = URLComponents(url: self, resolvingAgainstBaseURL: true), let queryItems = components.queryItems else { return nil } return queryItems.reduce(into: [String: String](), { (result, item) in result[item.name] = item.value }) } }
[ -1 ]
c918cf8114bccf73d62c1b9511f3040dc85436c2
ef9cf7d4b09b4f9df07e8d56bcbead9c71ed7b5a
/QuoteSharing/Common/GetMyDetailWorker.swift
efe38e65db9fddbc0614e8a991f27c44d784b659
[]
no_license
nguyentruongky/QuoteSharing
d93331164f894a5397861b65ba32984b7def691b
139afd4a9826e7818daba1c1c557ec3ec818ea29
refs/heads/master
2020-06-02T23:21:39.833340
2019-06-21T09:10:41
2019-06-21T09:10:41
191,341,674
1
0
null
null
null
null
UTF-8
Swift
false
false
601
swift
// // GetMyDetailWorker.swift // QuoteSharing // // Created by Ky Nguyen on 6/13/19. // Copyright © 2019 Ky Nguyen. All rights reserved. // import Foundation import FirebaseAuth struct GetMyDetailWorker { func execute() { guard let id = Auth.auth().currentUser?.uid else { return } DB().getCollection(.users) .document(id) .getDocument { (snapshot, err) in guard let rawData = snapshot?.data() else { return } let myself = Reader(raw: rawData as AnyObject) appSetting.myself = myself } } }
[ -1 ]
a72fb7786e9fec4cf8e9656270f84aa22a80f42c
649490cccca16e029cdbe821f317eeb8b698fe4b
/SwapcardChallenge/Controller/TableViewController/UserTableViewCell/UsersTableViewCell.swift
48fa64efd0b866bfbcf5776a352225328ab8897a
[]
no_license
Lukas-r8/SwapcardChallenge
186001d42ae87f24bf3489ad485afbd6244e30c6
8fbe2675cd3ff9159148da06589eb8eab93d8206
refs/heads/master
2020-04-28T14:19:58.526307
2019-03-16T04:52:14
2019-03-16T04:52:14
175,336,003
0
0
null
null
null
null
UTF-8
Swift
false
false
2,578
swift
// // UsersTableViewCell.swift // SwapcardChallenge // // Created by Lucas Alves Da Silva on 13/03/2019. // Copyright © 2019 Lucas Alves Da Silva. All rights reserved. // import Foundation import UIKit class UsersTableViewCell: UITableViewCell { var user: User? { didSet{ if var user = user { avatarImageView.getImageFromURL(user.picture, imageSizeType: .large) nameLabel.text = "\(user.name.title) \(user.name.first) \(user.name.last)" emailLabel.text = user.email favouriteButton = user.favouritesHandler favouriteButton.tintColor = user.favouritesHandler.isFavourite ? AppColors.favColor : AppColors.nonFavColor favouriteButton.addTarget(self, action: #selector(handleFavourite), for: .touchUpInside) setUpSubViewsAndConstraints() } } } let imageViewHeight: CGFloat = 100 let containerView: UIView = { let container = UIView() container.backgroundColor = .white container.layer.cornerRadius = 10 container.translatesAutoresizingMaskIntoConstraints = false container.addShadow() return container }() var favouriteButton: FavouriteUsersButton! lazy var avatarImageView: UIImageView = { let image = UIImageView() image.translatesAutoresizingMaskIntoConstraints = false image.backgroundColor = .gray image.contentMode = UIView.ContentMode.scaleAspectFill image.layer.cornerRadius = imageViewHeight / 2 image.clipsToBounds = true return image }() let nameLabel: UILabel = { let label = UILabel() label.font = UIFont(name: AppFonts.bold, size: 25) label.textColor = UIColor.black label.translatesAutoresizingMaskIntoConstraints = false return label }() let emailLabel: UILabel = { let label = UILabel() label.font = UIFont(name: AppFonts.italic, size: 16) label.textColor = UIColor.gray label.translatesAutoresizingMaskIntoConstraints = false return label }() override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { super.init(style: style, reuseIdentifier: reuseIdentifier) selectionStyle = .none backgroundColor = .white } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } }
[ -1 ]
1f8576e9c0fc0150a33221bb31e0abcdf0626146
f824bd9c00d614a8b4ab9bec2f2480bd0a5553ff
/Dizzy/Entities/InputValidator.swift
ddbc820e8aac2d7e1c68ebcc5e0d6e93538df822
[]
no_license
dizzyapp/iOS-Project
8c95d7b23c7987392c2a380f4b77582c172d6685
afa78aed3c0529acdde47c7f1fae79b81961b375
refs/heads/master
2021-07-11T02:03:48.015237
2020-08-10T18:39:46
2020-08-10T18:39:46
178,489,850
0
0
null
2020-08-10T18:39:48
2019-03-29T23:56:06
Swift
UTF-8
Swift
false
false
3,715
swift
// // InputValidator.swift // Dizzy // // Created by stas berkman on 22/06/2019. // Copyright © 2019 Dizzy. All rights reserved. // import UIKit enum InputValidationResult: String { case fullNameTooShort = "Full name is too short, please enter at least 2 characters" case emailAddressTooShort = "Email address is too short, please enter at least 7 characters" case wrongEmail = "Email address is not correct, please enter a valid email address" case passwordTooShort = "Password is too short, please enter at least 6 characters" case passwordsNotEqual = "Passwords are not equal, please try again!" case missingDetails = "Please fill all the fields" case success = "Succeed" } class InputValidator: NSObject { let userNameMinimumLength = 2 let emailMinimumLength = 7 let passwordMinimumLength = 6 func validateSignUpDetails(_ signUpDetails: SignUpDetails) -> InputValidationResult { let fullNameValidation: InputValidationResult = self.validateFullNameField(signUpDetails.fullName) if fullNameValidation != .success { return fullNameValidation } let emailValidation: InputValidationResult = self.validateEmailField(signUpDetails.email) if emailValidation != .success { return emailValidation } let passwordValidation: InputValidationResult = self.validatePasswordField(signUpDetails.password) if passwordValidation != .success { return passwordValidation } let repeatPasswordValidation: InputValidationResult = self.validatePasswordField(signUpDetails.repeatPassword) if repeatPasswordValidation != .success { return repeatPasswordValidation } let passwordEqualityValidation: InputValidationResult = self.validatePasswordEquality(password: signUpDetails.password, repeatPassword: signUpDetails.repeatPassword) if passwordEqualityValidation != .success { return passwordEqualityValidation } return .success } func validateSignInDetails(_ signInDetails: SignInDetails) -> InputValidationResult { let emailValidation: InputValidationResult = self.validateEmailField(signInDetails.email) if emailValidation != .success { return emailValidation } let passwordValidation: InputValidationResult = self.validatePasswordField(signInDetails.password) if passwordValidation != .success { return passwordValidation } return .success } private func validateFullNameField(_ fullName: String) -> InputValidationResult { if !fullName.isEmpty && fullName.count < userNameMinimumLength { return .fullNameTooShort } return .success } private func validateEmailField(_ email: String) -> InputValidationResult { if email.count < emailMinimumLength || !email.isEmail { if email.count < emailMinimumLength { return .emailAddressTooShort } else { return .wrongEmail } } return .success } private func validatePasswordField(_ password: String) -> InputValidationResult { if password.count < passwordMinimumLength { return .passwordTooShort } return .success } private func validatePasswordEquality(password: String, repeatPassword: String) -> InputValidationResult { if password != repeatPassword { return .passwordsNotEqual } return .success } }
[ -1 ]
9b253835eb14510193bb0b4a7c886c8bccc7fc83
be699beea124cfa285b12a88c3441265186a610e
/Sources/Data/DataSources/Remote/CDTTransfersRemoteDataSource.swift
0a3f27e017aa208de43489b5d3fe74ddf9642017
[ "MIT" ]
permissive
Vizir/dock-sdk-ios
2d1feffa25850639e97aaaedef425f0d54db4fe7
740aade2a167252f017d43bc70a6ed24d0c0c13a
refs/heads/master
2022-07-29T12:48:53.923594
2020-04-15T14:35:48
2020-04-15T14:35:48
266,848,589
0
0
null
null
null
null
UTF-8
Swift
false
false
1,138
swift
// // CDTTransfersRemoteDataSource.swift // Mobile2you // // Created by Mobile2you Tecnologia on 27/02/19. // Copyright © 2019 Mobile2You. All rights reserved. // import Foundation import Moya import RxSwift open class CDTTransfersRemoteDataSource { let provider = MoyaProvider<CDTTransferService>() func getBankTransfers(request: AccountIdRequest) -> Single<Response>{ return provider.rx.request(.getBankTransfers(request: request)) } func getP2PTransfers(request: AccountIdRequest) -> Single<Response> { return provider.rx.request(.getP2PTransfers(request: request)) } func createBankTransfer(request: TransferPasswordRequest) -> Single<Response> { return provider.rx.request(.createBankTransfer(request: request)) } func createP2PTransfer(request: TransferPasswordRequest) -> Single<Response> { return provider.rx.request(.createP2PTransfer(request: request)) } func getBankTransferDetail(request: AdjustmentIdRequest) -> Single<Response> { return provider.rx.request(.getBankTransferDetail(request: request)) } }
[ -1 ]
05cbadef068c38c77cd581685f4c0a44a8b618ad
31de7b0c6d0eaa373f50fa20e9aa280825df9332
/SwiftToolBox/Extensions/UIColor/UIColor+Colors.swift
66c41e704e32cccc82087251e3c4cd8e34d1a189
[]
no_license
hackjie/Goldhand
59284c222296b24bb26a13183c08c1d667665038
9ae83b39af7befa5b699294e7bf308efcf0955da
refs/heads/master
2020-04-03T01:29:08.987392
2019-03-20T10:51:28
2019-03-20T10:51:28
154,932,060
0
0
null
null
null
null
UTF-8
Swift
false
false
1,415
swift
// // UIColor+Colors.swift // SwiftToolBox // // Created by 李杰 on 2018/11/14. // Copyright © 2018年 李杰. All rights reserved. // import UIKit extension UIColor { /// Random color --- 随机色 public class var randomColor: UIColor { return UIColor.color(red: CGFloat(arc4random() % 256), green: CGFloat(arc4random() % 256), blue: CGFloat(arc4random() % 256)) } /// Get color with RGB value --- 直接通过 RGBA 值创建 UIColor /// /// - Parameters: /// - red: CGFloat /// - green: CGFloat /// - blue: CGFloat /// - alpha: CGFloat /// - Returns: UIColor public class func color(red: CGFloat, green: CGFloat, blue: CGFloat, alpha: CGFloat = 1.0) -> UIColor { return UIColor(red: CGFloat(red) / 255.0, green: CGFloat(green) / 255.0, blue: CGFloat(blue) / 255.0, alpha: CGFloat(alpha)) } /// Get color with hex value --- 用十六进制数值初始化颜色 /// /// - Parameters: /// - valueRGB: UInt /// - alpha: alpha public convenience init(valueRGB: UInt, alpha: CGFloat = 1.0) { self.init( red: CGFloat((valueRGB & 0xFF0000) >> 16) / 255.0, green: CGFloat((valueRGB & 0x00FF00) >> 8) / 255.0, blue: CGFloat(valueRGB & 0x0000FF) / 255.0, alpha: alpha ) } }
[ -1 ]
9896bd90a8adbe7991a3c8f8afe949bfe7a3ba7d
c82c606da6be0cb65bb511a0f74bbcb47a0effba
/mj/ITEMS OZ/GameSource/Classes/Utils/UIs/ToggleButton.swift
1f36088d43a38d16be0cf06375cab29d91942e4e
[]
no_license
youngcom/young
f0ea87e6c824ed73946d623103f49d1c67cd8f9c
1379ea2469d0a955c6b21d98e7f7268c6612c89d
refs/heads/master
2020-07-21T04:49:53.948675
2019-09-06T09:53:15
2019-09-06T09:53:15
206,757,954
0
0
null
null
null
null
UTF-8
Swift
false
false
2,538
swift
// // ToggleButton.swift // GameSource // // Created by Mr. Joker on 4/7/19. // Copyright © 2019 Mr. Joker. All rights reserved. // import SpriteKit protocol ToggleButtonDelegate { func changeToggleButtonState(_ sender: ToggleButton) } class ToggleButton : Sprite { var currentState = true fileprivate var imageOn: String? fileprivate var imageOff: String? var delegate: ToggleButtonDelegate? /** Initialisation of switch node. - property textureOnState: SKTexture object of texture switch in on state. - property textureOffState: SKTexture object of texture switch in off state. - property size: CGSize object with size of node. - property position: CGPoint object for set position node on scene. - property zPosition: CGFloat value for set position node by z coordinate on scene. */ init(imageOn: String, imageOff: String, size: CGSize, position: CGPoint, zPosition: CGFloat) { super.init(imageNamed: imageOn, size: size, position: position, zPosition: zPosition) self.imageOn = imageOn self.imageOff = imageOff } /** If your custom init function not can run compiler call this function */ required init?(coder aDecoder: NSCoder) { fatalError("ButtonNode init(coder:) has not been implemented")} //MARK: - Switch Logic /** Private function for update texture by current state */ fileprivate func updateSwitchTexture() { if currentState { texture = SKTexture.init(imageNamed: "Images/" + imageOn!)} else { texture = SKTexture.init(imageNamed: "Images/" + imageOff!)} } /** Change switch state. You can use delegate method for realise some action after changing state some atribut. */ func changeSwitchState() { currentState = !currentState updateSwitchTexture() Sounds.sharedInstance().playSound(soundName: SoundConfig.soundButton) //Send message for delegate method. If current switch object have delegate. if delegate != nil { delegate?.changeToggleButtonState(self) } } func changeSwitchState(ifInLocation location: CGPoint) { if contains(location) { changeSwitchState() } } /** Set switch state. It's method for setting start state of switch if you load new scene */ func setSwitchState(_ isOn: Bool) { currentState = isOn updateSwitchTexture() } }
[ -1 ]
ce8ccd72dd64d52be909378957c35d5831c56768
5f49bb2043f8c3152e406f071f3df5ca5835881b
/IRV/Database/DataManager.swift
e83a05b6942b7c917201b28e5cb72a4d46057f34
[]
no_license
IslandJS/irv
2f9aa84da52a988bdadc10a9e5093e9f14201775
ac4e360a36b6c1519d34cb7867abdfee6e024fe8
refs/heads/master
2020-06-10T19:00:31.284408
2016-12-10T19:10:06
2016-12-10T19:10:06
75,904,264
1
0
null
null
null
null
UTF-8
Swift
false
false
1,487
swift
// // DataManager.swift // IRV // // Created by William Anderson on 11/28/16. // Copyright © 2016 Bill Anderson. All rights reserved. // import Foundation import CoreData class DataManager { // MARK: - Type static let singleton = DataManager() // MARK: - Properties typealias voidClosure = () -> () lazy var persistentContainer: NSPersistentContainer = { let container = NSPersistentContainer(name: "IRV") container.loadPersistentStores(completionHandler: { (storeDescription, error) in if let error = error as NSError? { fatalError("Unresolved error \(error), \(error.userInfo)") } }) return container }() // MARK: - Save func saveContext () { let context = persistentContainer.viewContext if context.hasChanges { do { try context.save() } catch { let nserror = error as NSError print("ERROR: saveContext: \(nserror.localizedDescription)") //fatalError("Unresolved error \(nserror), \(nserror.userInfo)") } } } func save(context: NSManagedObjectContext) { if context.hasChanges { do { try context.save() } catch { let nserror = error as NSError print("ERROR: saveContext: \(nserror.localizedDescription)") } } } }
[ 378378 ]
d4de80f6bb0e4bbc240d6fd45adf08d96e7f55ae
ccd19c0345db04448fb036ba7ea0a8a1fdc4f1cf
/Views/DiscoverTopicViewController.swift
19f5158a9d0b4e9f182cdc6b8601f6e8e9b37a23
[]
no_license
OlaaJohnson/lmpodcast
685e850b195a71457b74f8f8a27e0382a84f6234
c0715142980db5da3491d6b5f42fccb11ae534fa
refs/heads/master
2020-06-03T20:15:04.956732
2019-06-13T15:26:13
2019-06-13T15:26:13
191,715,919
0
0
null
null
null
null
UTF-8
Swift
false
false
18,055
swift
// // DiscoverTopicViewController.swift // Lmpodcast // // Created by Shihab Mehboob on 13/08/2018. // Copyright © 2018 Shihab Mehboob. All rights reserved. // import Foundation import UIKit import StatusAlert import SafariServices import NVActivityIndicatorView class DiscoverTopicViewController: UIViewController, UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout, SFSafariViewControllerDelegate, UIViewControllerPreviewingDelegate { var collectionView: UICollectionView! var colcol = 3 var ai = NVActivityIndicatorView(frame: CGRect(x:0,y:0,width:0,height:0), type: .circleStrokeSpin, color: Colours.tabSelected) var isPeeking = false func previewingContext(_ previewingContext: UIViewControllerPreviewing, viewControllerForLocation location: CGPoint) -> UIViewController? { guard let indexPath = self.collectionView.indexPathForItem(at: location) else { return nil } guard let cell = self.collectionView.cellForItem(at: indexPath) else { return nil } StoreStruct.tappedFeedURL = StoreStruct.discoverTopicPodcasts[indexPath.item].feedUrl ?? "" StoreStruct.sendPodcast = [StoreStruct.discoverTopicPodcasts[indexPath.item]] let detailVC = EpisodesViewController() detailVC.isPeeking = true previewingContext.sourceRect = cell.frame return detailVC } func previewingContext(_ previewingContext: UIViewControllerPreviewing, commit viewControllerToCommit: UIViewController) { show(viewControllerToCommit, sender: self) } func removeTabbarItemsText() { if let items = tabBarController?.tabBar.items { for item in items { item.title = "" item.imageInsets = UIEdgeInsets(top: 6, left: 0, bottom: -6, right: 0); } } } @objc func columnLoad() { let layout = ColumnFlowLayout( cellsPerRow: StoreStruct.columns, minimumInteritemSpacing: 5, minimumLineSpacing: 5, sectionInset: UIEdgeInsets(top: 0, left: 5, bottom: 0, right: 5) ) self.collectionView.collectionViewLayout = layout self.collectionView.reloadData() } override func viewDidLoad() { super.viewDidLoad() self.ai.frame = CGRect(x: self.view.bounds.width/2 - 20, y: self.view.bounds.height/2, width: 40, height: 40) self.ai.startAnimating() DispatchQueue.main.async { self.view.addSubview(self.ai) } StoreStruct.discoverTopicPodcasts = [] FetchContent.shared.fetchGenrePodcasts(searchText: StoreStruct.discoverSearchText, country: StoreStruct.country) { podcasts in StoreStruct.discoverTopicPodcasts = podcasts DispatchQueue.main.async { self.ai.alpha = 0 self.ai.removeFromSuperview() } self.collectionView.reloadData() } self.title = StoreStruct.discoverTopicText NotificationCenter.default.addObserver(self, selector: #selector(self.columnLoad), name: NSNotification.Name(rawValue: "column"), object: nil) if UserDefaults.standard.object(forKey: "gridCol") == nil { colcol = 3 } else { colcol = UserDefaults.standard.object(forKey: "gridCol") as! Int } var tabHeight = Int(UITabBarController().tabBar.frame.size.height) + Int(34) var offset = 88 if UIDevice().userInterfaceIdiom == .phone { switch UIScreen.main.nativeBounds.height { case 2688: offset = 88 case 2436: offset = 88 default: offset = 64 tabHeight = Int(UITabBarController().tabBar.frame.size.height) } } let wid = self.view.bounds.width let he = self.view.bounds.height let layout = ColumnFlowLayout( cellsPerRow: colcol, minimumInteritemSpacing: 5, minimumLineSpacing: 5, sectionInset: UIEdgeInsets(top: 0, left: 5, bottom: 0, right: 5) ) if self.isPeeking == true { offset = 5 } self.collectionView = UICollectionView(frame: CGRect(x: 0, y: offset, width: Int(wid), height: Int(he) - offset - tabHeight), collectionViewLayout: layout) self.collectionView.backgroundColor = Colours.white self.collectionView.delegate = self self.collectionView.dataSource = self self.collectionView.register(DiscoverCell.self, forCellWithReuseIdentifier: "Cell") self.view.addSubview(self.collectionView) if (traitCollection.forceTouchCapability == .available) { registerForPreviewing(with: self, sourceView: self.collectionView) } self.loadLoadLoad() } override func viewWillAppear(_ animated: Bool) { self.removeTabbarItemsText() self.collectionView.reloadData() } override func viewDidAppear(_ animated: Bool) { StoreStruct.whichView = 1 self.navigationController?.navigationBar.topItem?.title = StoreStruct.discoverTopicText self.navigationController?.navigationBar.tintColor = Colours.tabUnselected self.navigationController?.navigationBar.barTintColor = Colours.tabUnselected self.navigationController?.navigationItem.backBarButtonItem?.tintColor = Colours.tabUnselected } func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { let x = StoreStruct.columns let y = self.view.bounds.width let z = CGFloat(y)/CGFloat(x) return CGSize(width: z - 7.5, height: z - 7.5) } func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return StoreStruct.discoverTopicPodcasts.count } func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "Cell", for: indexPath) as! DiscoverCell if StoreStruct.discoverTopicPodcasts.isEmpty {} else { cell.configure() let z = StoreStruct.discoverTopicPodcasts[indexPath.item].artworkUrl600 ?? "" let secureImageUrl = URL(string: z)! cell.image.image = UIImage(named: "logo") cell.image.pin_updateWithProgress = true cell.image.pin_setImage(from: secureImageUrl) cell.image.layer.masksToBounds = true } cell.image.frame.size.width = cell.frame.size.width cell.image.frame.size.height = cell.frame.size.height cell.backgroundColor = Colours.clear let longHold = UILongPressGestureRecognizer(target: self, action: #selector(longPressed)) longHold.minimumPressDuration = 0.4 cell.tag = indexPath.item cell.addGestureRecognizer(longHold) return cell } @objc func longPressed(gesture: UILongPressGestureRecognizer) { let index = gesture.view?.tag ?? 0 var bookText = "Subscribe to Podcast".localized let s1: Bool = (StoreStruct.bookmarkedPodcast as [Podcast]).contains(where: { ($0 as Podcast).feedUrl as! String == (StoreStruct.discoverTopicPodcasts[index] as Podcast).feedUrl as! String }) if s1 { bookText = "Remove from Subscriptions".localized } let zz = "episodes by".localized let se = "Share Podcast".localized let theMessage = "\(StoreStruct.discoverTopicPodcasts[index].trackCount ?? 0) \(zz) \(StoreStruct.discoverTopicPodcasts[index].artistName ?? "")" Alertift.actionSheet(title: StoreStruct.discoverTopicPodcasts[index].trackName ?? "", message: theMessage) .backgroundColor(Colours.grayDark2) .titleTextColor(UIColor.white) .messageTextColor(UIColor.white.withAlphaComponent(0.8)) .messageTextAlignment(.left) .titleTextAlignment(.left) .action(.default(bookText), image: UIImage(named: "bookmark")) { (action, ind) in print(action, ind) if s1 { let statusAlert = StatusAlert() statusAlert.image = UIImage(named: "star")?.maskWithColor(color: UIColor.white) statusAlert.title = "Unsubscribed" statusAlert.message = StoreStruct.discoverTopicPodcasts[index].trackName ?? "" //statusAlert.canBePickedOrDismissed = isUserInteractionAllowed statusAlert.show() let impact = UIImpactFeedbackGenerator() impact.impactOccurred() StoreStruct.bookmarkedPodcast = StoreStruct.bookmarkedPodcast.filter { ($0 as Podcast).feedUrl as! String != (StoreStruct.discoverTopicPodcasts[index] as Podcast).feedUrl as! String } NotificationCenter.default.post(name: Notification.Name(rawValue: "column"), object: self) } else { let statusAlert = StatusAlert() statusAlert.image = UIImage(named: "star")?.maskWithColor(color: UIColor.white) statusAlert.title = "Subscribed" statusAlert.message = StoreStruct.discoverTopicPodcasts[index].trackName ?? "" //statusAlert.canBePickedOrDismissed = isUserInteractionAllowed statusAlert.show() let impact = UIImpactFeedbackGenerator() impact.impactOccurred() StoreStruct.bookmarkedPodcast.append(StoreStruct.discoverTopicPodcasts[index]) StoreStruct.bookmarkedPodcast = StoreStruct.bookmarkedPodcast.removeDuplicates() NotificationCenter.default.post(name: Notification.Name(rawValue: "column"), object: self) } } .action(.default("More by the Author".localized), image: UIImage(named: "more")) { (action, ind) in print(action, ind) let artist: String = StoreStruct.discoverTopicPodcasts[index].artistName ?? "" let dict:[String: String] = ["artist": artist] NotificationCenter.default.post(name: Notification.Name(rawValue: "searchOpen"), object: self, userInfo: dict) } .action(.default(" \(se)"), image: UIImage(named: "up")) { (action, ind) in print(action, ind) if let myWebsite = NSURL(string: StoreStruct.discoverTopicPodcasts[index].feedUrl ?? "") { //if let myWebsite = StoreStruct.discoverTopicPodcasts[index].feedUrl { let objectsToShare = [myWebsite] let vc = VisualActivityViewController(activityItems: objectsToShare, applicationActivities: nil) vc.previewNumberOfLines = 5 vc.previewFont = UIFont.systemFont(ofSize: 14) self.present(vc, animated: true, completion: nil) } } .action(.cancel("Dismiss".localized)) .finally { action, index in if action.style == .cancel { return } } .show(on: self) } func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { let selection = UISelectionFeedbackGenerator() selection.selectionChanged() StoreStruct.tappedFeedURL = StoreStruct.discoverTopicPodcasts[indexPath.item].feedUrl ?? "" StoreStruct.sendPodcast = [StoreStruct.discoverTopicPodcasts[indexPath.item]] let controller = EpisodesViewController() self.navigationController?.pushViewController(controller, animated: true) } func loadLoadLoad() { if (UserDefaults.standard.object(forKey: "theme") == nil || UserDefaults.standard.object(forKey: "theme") as! Int == 0) { Colours.white = UIColor.white Colours.grayDark = UIColor(red: 40/250, green: 40/250, blue: 40/250, alpha: 1.0) Colours.cellNorm = Colours.white Colours.cellQuote = UIColor(red: 243/255.0, green: 242/255.0, blue: 246/255.0, alpha: 1.0) Colours.cellSelected = UIColor(red: 240/255.0, green: 240/255.0, blue: 240/255.0, alpha: 1.0) Colours.tabUnselected = UIColor(red: 225/255.0, green: 225/255.0, blue: 225/255.0, alpha: 1.0) Colours.blackUsual = UIColor(red: 40/255.0, green: 40/255.0, blue: 40/255.0, alpha: 1.0) Colours.cellOwn = UIColor(red: 243/255.0, green: 242/255.0, blue: 246/255.0, alpha: 1.0) Colours.cellAlternative = UIColor(red: 243/255.0, green: 242/255.0, blue: 246/255.0, alpha: 1.0) } else if (UserDefaults.standard.object(forKey: "theme") != nil && UserDefaults.standard.object(forKey: "theme") as! Int == 1) { Colours.white = UIColor(red: 53/255.0, green: 53/255.0, blue: 64/255.0, alpha: 1.0) Colours.grayDark = UIColor(red: 250/250, green: 250/250, blue: 250/250, alpha: 1.0) Colours.cellNorm = Colours.white Colours.cellQuote = UIColor(red: 33/255.0, green: 33/255.0, blue: 43/255.0, alpha: 1.0) Colours.cellSelected = UIColor(red: 34/255.0, green: 34/255.0, blue: 44/255.0, alpha: 1.0) Colours.tabUnselected = UIColor(red: 80/255.0, green: 80/255.0, blue: 90/255.0, alpha: 1.0) Colours.blackUsual = UIColor(red: 70/255.0, green: 70/255.0, blue: 80/255.0, alpha: 1.0) Colours.cellOwn = UIColor(red: 55/255.0, green: 55/255.0, blue: 65/255.0, alpha: 1.0) Colours.cellAlternative = UIColor(red: 20/255.0, green: 20/255.0, blue: 30/255.0, alpha: 1.0) } else { Colours.white = UIColor(red: 0/255.0, green: 0/255.0, blue: 0/255.0, alpha: 1.0) Colours.grayDark = UIColor(red: 250/250, green: 250/250, blue: 250/250, alpha: 1.0) Colours.cellNorm = Colours.white Colours.cellQuote = UIColor(red: 30/255.0, green: 30/255.0, blue: 30/255.0, alpha: 1.0) Colours.cellSelected = UIColor(red: 34/255.0, green: 34/255.0, blue: 44/255.0, alpha: 1.0) Colours.tabUnselected = UIColor(red: 70/255.0, green: 70/255.0, blue: 80/255.0, alpha: 1.0) Colours.blackUsual = UIColor(red: 70/255.0, green: 70/255.0, blue: 80/255.0, alpha: 1.0) Colours.cellOwn = UIColor(red: 10/255.0, green: 10/255.0, blue: 20/255.0, alpha: 1.0) Colours.cellAlternative = UIColor(red: 20/255.0, green: 20/255.0, blue: 30/255.0, alpha: 1.0) } self.view.backgroundColor = Colours.white if (UserDefaults.standard.object(forKey: "systemText") == nil) || (UserDefaults.standard.object(forKey: "systemText") as! Int == 0) { if (UserDefaults.standard.object(forKey: "fontSize") == nil) { Colours.fontSize0 = 14 Colours.fontSize2 = 10 Colours.fontSize1 = 14 Colours.fontSize3 = 10 } else if (UserDefaults.standard.object(forKey: "fontSize") as! Int == 0) { Colours.fontSize0 = 12 Colours.fontSize2 = 8 Colours.fontSize1 = 12 Colours.fontSize3 = 8 } else if (UserDefaults.standard.object(forKey: "fontSize") != nil && UserDefaults.standard.object(forKey: "fontSize") as! Int == 1) { Colours.fontSize0 = 13 Colours.fontSize2 = 9 Colours.fontSize1 = 13 Colours.fontSize3 = 9 } else if (UserDefaults.standard.object(forKey: "fontSize") != nil && UserDefaults.standard.object(forKey: "fontSize") as! Int == 2) { Colours.fontSize0 = 14 Colours.fontSize2 = 10 Colours.fontSize1 = 14 Colours.fontSize3 = 10 } else if (UserDefaults.standard.object(forKey: "fontSize") != nil && UserDefaults.standard.object(forKey: "fontSize") as! Int == 3) { Colours.fontSize0 = 15 Colours.fontSize2 = 11 Colours.fontSize1 = 15 Colours.fontSize3 = 11 } else if (UserDefaults.standard.object(forKey: "fontSize") != nil && UserDefaults.standard.object(forKey: "fontSize") as! Int == 4) { Colours.fontSize0 = 16 Colours.fontSize2 = 12 Colours.fontSize1 = 16 Colours.fontSize3 = 12 } else if (UserDefaults.standard.object(forKey: "fontSize") != nil && UserDefaults.standard.object(forKey: "fontSize") as! Int == 5) { Colours.fontSize0 = 17 Colours.fontSize2 = 13 Colours.fontSize1 = 17 Colours.fontSize3 = 13 } else { Colours.fontSize0 = 18 Colours.fontSize2 = 14 Colours.fontSize1 = 18 Colours.fontSize3 = 14 } } else { Colours.fontSize1 = CGFloat(UIFont.systemFontSize) Colours.fontSize3 = CGFloat(UIFont.systemFontSize) } self.navigationController?.navigationBar.titleTextAttributes = [NSAttributedString.Key.foregroundColor : Colours.grayDark] self.collectionView.backgroundColor = Colours.white self.removeTabbarItemsText() } func goToNextFromPrev() { let index = StoreStruct.searchIndex let controller = EpisodesViewController() self.navigationController?.pushViewController(controller, animated: true) } }
[ 187160, 187158 ]
20359c38e4b212f045a74563e75e1ae61545e2b3
7bbc1d0f6cd9ad75b2d8fac1074473020970443a
/Cirk/Misc/BallbearingPlayer.swift
520158a8bd946c6eafcfe15000424bb7f75fbe9a
[ "MIT" ]
permissive
josephbeuysmum/Cirk
e9f033dc8db11ba2c4dbf4ec4f7884c5b980ebbe
762d62740aa82919271f09d1229f767846c5bb21
refs/heads/master
2020-04-16T11:49:27.203790
2019-02-09T10:04:48
2019-02-09T10:04:48
165,552,853
0
0
null
null
null
null
UTF-8
Swift
false
false
1,980
swift
// // BallbearingPlayer.swift // Cirk // // Created by Richard Willis on 14/11/2018. // Copyright © 2018 Rich Text Format Ltd. All rights reserved. // import AVFoundation class BallbearingPlayer: NSObject { private var audioIsOn: Bool, level: Level?, effectPlayer: AVAudioPlayer?, ballbearingPlayer: AVAudioPlayer? override init() { audioIsOn = false super.init() } func play(sound effect: Effects, loops: Bool) { effectPlayer = self.play(effect, 1.0, loops) } func set(audioOn: Bool) { guard audioOn != audioIsOn else { return } audioIsOn = audioOn if audioIsOn { do { try AVAudioSession.sharedInstance().setCategory(.playback, mode: .default) try AVAudioSession.sharedInstance().setActive(true) } catch { audioIsOn = false } } else { stopSoundEffect() stopBallbearingSound() do { try AVAudioSession.sharedInstance().setActive(false) } catch {} } } func set(ballbearingVolume volume: Float) { ballbearingPlayer?.volume = volume } func startBallbearingSound() { ballbearingPlayer = self.play(Effects.ballbearing, 0.0, true) } func stopBallbearingSound() { ballbearingPlayer?.stop() ballbearingPlayer = nil } func stopSoundEffect() { effectPlayer?.stop() effectPlayer = nil } private func play(_ sound: Effects, _ volume: Float, _ loops: Bool) -> AVAudioPlayer? { guard audioIsOn, let url = Bundle.main.url(forResource: sound.rawValue, withExtension: "mp3") else { return nil } do { let player = try AVAudioPlayer(contentsOf: url, fileTypeHint: AVFileType.mp3.rawValue) player.volume = volume player.numberOfLoops = loops ? -1 : 0 player.play() return player } catch {} return nil } } extension BallbearingPlayer: AVAudioPlayerDelegate { func audioPlayerDidFinishPlaying(_ player: AVAudioPlayer, successfully flag: Bool) { player.stop() if player === effectPlayer { effectPlayer = nil } else { ballbearingPlayer = nil } } }
[ -1 ]
7922c274c4c30c4be10b9164a72c6d22c30901a2
a3ddcd9e07b3ea902e1194bf3aa05c9d8998c8ec
/alggorithm/Structure/Graph/AdjacencyList.swift
72ebc5b97d1bae8f801c563cfb2b926217cfb53e
[]
no_license
chaangmeen/Swift_Algorithm_Test
130983b5e1142cd34b3d0ab7868a854e1efd5dd5
22542f59189f2a3f4fd484bf89253a4d873a44e9
refs/heads/master
2022-11-10T11:07:33.917396
2020-06-27T10:53:09
2020-06-27T10:53:09
273,489,732
0
0
null
null
null
null
UTF-8
Swift
false
false
2,376
swift
// // AdjacencyList.swift // alggorithm // // Created by 전창민 on 2020/05/25. // Copyright © 2020 min. All rights reserved. // import Foundation public struct VertexEdgesList<T: Equatable & Hashable> { public let vertex: Vertex<T> public var edges: [Edge<T>] = [] public init(vertex: Vertex<T>) { self.vertex = vertex } public mutating func addEdge(edge: Edge<T>) { if self.edges.count > 0 { let equalEdges = self.edges.filter({ existingEdge in return existingEdge == edge }) if equalEdges.count > 0 { return } } self.edges.append(edge) } } public struct AdjacencyListGraph<T: Equatable & Hashable> { public var adjacencyLists:[VertexEdgesList<T>] = [] public var vertices: [Vertex<T>] { get { var vertices = [Vertex<T>]() for list in adjacencyLists { vertices.append(list.vertex) } return vertices } } public var edges: [Edge<T>] { get { var edges = Set<Edge<T>>() for list in adjacencyLists { for edge in list.edges { edges.insert(edge) } } return Array(edges) } } public init() {} public mutating func addVertex(data: T) -> Vertex<T> { for list in adjacencyLists { if list.vertex.data == data { return list.vertex } } let vertex:Vertex<T> = Vertex(data: data, index: adjacencyLists.count) let adjacencyList = VertexEdgesList(vertex: vertex) adjacencyLists.append(adjacencyList) return vertex } public mutating func addEdge(from:Vertex<T>, to:Vertex<T>) -> Edge<T> { let edge = Edge(from: from, to: to) let list = adjacencyLists[from.index] // Check if the edge already exists if list.edges.count > 0 { for existingEdge in list.edges { if existingEdge == edge { return existingEdge } } adjacencyLists[from.index].edges.append(edge) }else { adjacencyLists[from.index].edges = [edge] } return edge } }
[ -1 ]
a1842ba258cc0b5961035401679b84bd3bcfa746
5be79f79ee2cbadf2a9df585e04ec0fbf47c5e0c
/coreDataDemo/coreDataDemo/AppDelegate.swift
d7d467aca1b0c0f25a960fc36d2022d9f72b79c7
[]
no_license
Now2407/xcode
4318234ce13de57c5958e2a7067a97e468ad864d
afdf7e19dd16e8f3b135b8f35c8b3a0b301f59ce
refs/heads/master
2021-01-19T10:16:47.047394
2017-04-10T19:11:29
2017-04-10T19:11:29
87,847,938
0
1
null
null
null
null
UTF-8
Swift
false
false
2,152
swift
// // AppDelegate.swift // coreDataDemo // // Created by Noah Marriott on 6/28/15. // Copyright (c) 2015 Noah Marriott. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { // Override point for customization after application launch. return true } func applicationWillResignActive(application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. } func applicationDidEnterBackground(application: UIApplication) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } func applicationWillEnterForeground(application: UIApplication) { // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. } func applicationDidBecomeActive(application: UIApplication) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } func applicationWillTerminate(application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } }
[ 229380, 229383, 229385, 278539, 229388, 294924, 278542, 229391, 327695, 278545, 229394, 278548, 229397, 229399, 229402, 278556, 229405, 352284, 278559, 229408, 278564, 294950, 229415, 229417, 237613, 229422, 360496, 229426, 237618, 229428, 286774, 204856, 229432, 286776, 319544, 286791, 237640, 278605, 237646, 311375, 163920, 319573, 311383, 278623, 278626, 319590, 311400, 278635, 303212, 278639, 131192, 278648, 237693, 327814, 131209, 417930, 303241, 311436, 303244, 319633, 286873, 286876, 311460, 311469, 32944, 327862, 286906, 327866, 180413, 286910, 131264, 286916, 286922, 286924, 286926, 319694, 286928, 131281, 278743, 278747, 295133, 155872, 319716, 278760, 237807, 303345, 286962, 131314, 327930, 278781, 278783, 278785, 237826, 319751, 278792, 286987, 319757, 311569, 286999, 287003, 287006, 287009, 287012, 287014, 287016, 287019, 311598, 287023, 262448, 311601, 287032, 155966, 278849, 319809, 319810, 319814, 311623, 319818, 311628, 229709, 287054, 319822, 278865, 229717, 196963, 196969, 139638, 213367, 106872, 319872, 311683, 65943, 319898, 311719, 278952, 139689, 278957, 311728, 278967, 180668, 311741, 278975, 319938, 278980, 98756, 278983, 319945, 278986, 319947, 278990, 278994, 311767, 279003, 279006, 188895, 172512, 279010, 287202, 279015, 172520, 319978, 279020, 172526, 279023, 311791, 279027, 319989, 164343, 180727, 279035, 311804, 287230, 279040, 303617, 287234, 279045, 287238, 320007, 172550, 172552, 303623, 279051, 172558, 279055, 303632, 279058, 303637, 279063, 279067, 172572, 279072, 172577, 295459, 172581, 295461, 279082, 311850, 279084, 172591, 172598, 279095, 172607, 172612, 377413, 172614, 172618, 303690, 33357, 287309, 279124, 172634, 262752, 172644, 311911, 189034, 295533, 189039, 189040, 352880, 295538, 172655, 189044, 287349, 172656, 172660, 287355, 287360, 295553, 287365, 311942, 303751, 352905, 279178, 287371, 311946, 311951, 287377, 172691, 287381, 311957, 221850, 287386, 303773, 164509, 287390, 295583, 172702, 230045, 172705, 287394, 172707, 303780, 287398, 287400, 279208, 172714, 295595, 279212, 189102, 172721, 287409, 303797, 189114, 287419, 303804, 328381, 279231, 287423, 328384, 287427, 312006, 279241, 107212, 172748, 287436, 172751, 295633, 303827, 172755, 279255, 172760, 279258, 287450, 213724, 303835, 189149, 303838, 279267, 312035, 295654, 279272, 230128, 312048, 312050, 230131, 205564, 303871, 230146, 295685, 230154, 33548, 312077, 295695, 295701, 369433, 230169, 295707, 328476, 295710, 303914, 279340, 205613, 279353, 230202, 312124, 222018, 295755, 377676, 148302, 287569, 279383, 303959, 279390, 230241, 279394, 303976, 336744, 303985, 328563, 303987, 279413, 303991, 303997, 295806, 295808, 304005, 295813, 320391, 213895, 304007, 304009, 304011, 230284, 304013, 213902, 279438, 295822, 189329, 304019, 189331, 279445, 58262, 279452, 410526, 279461, 279462, 304042, 213931, 230327, 304055, 287675, 197564, 304063, 238528, 304065, 189378, 213954, 156612, 295873, 213963, 312272, 304084, 304090, 320481, 304106, 320490, 312302, 328687, 320496, 304114, 295928, 320505, 312321, 295945, 197645, 230413, 295949, 320528, 140312, 295961, 238620, 197663, 304164, 189479, 304170, 238641, 312374, 238652, 230465, 238658, 296004, 336964, 205895, 320584, 238666, 296021, 402518, 336987, 230497, 296036, 296040, 361576, 205931, 164973, 205934, 279661, 312432, 279669, 337018, 279679, 279683, 222340, 205968, 296084, 238745, 304285, 238756, 205991, 222377, 165035, 337067, 165038, 238766, 230576, 304311, 230592, 279750, 312518, 230600, 230607, 148690, 320727, 279769, 304348, 279777, 304354, 296163, 320740, 279781, 304360, 279788, 320748, 279790, 296189, 320771, 312585, 296205, 230674, 320786, 230677, 296213, 296215, 320792, 230681, 230679, 230689, 173350, 312622, 296243, 312630, 222522, 222525, 296253, 296255, 312639, 230718, 296259, 378181, 238919, 296264, 320840, 230727, 296267, 296271, 222545, 230739, 312663, 222556, 337244, 230752, 312676, 230760, 173418, 410987, 230763, 230768, 296305, 312692, 230773, 279929, 181626, 304505, 304506, 181631, 312711, 296331, 288140, 230800, 288144, 304533, 288154, 337306, 288160, 288162, 288164, 279975, 304555, 370092, 279983, 288176, 279985, 173488, 312755, 296373, 279991, 312759, 288185, 337335, 222652, 312766, 173507, 296389, 222665, 230860, 312783, 288208, 230865, 288210, 370130, 288212, 280021, 288214, 222676, 239064, 288217, 288218, 280027, 288220, 329177, 239070, 288224, 288226, 370146, 280036, 288229, 280038, 288230, 288232, 280034, 288234, 320998, 288236, 288238, 288240, 288242, 296435, 288244, 296439, 288250, 148990, 296446, 402942, 206336, 296450, 321022, 230916, 230919, 214535, 370187, 304651, 222752, 108066, 296486, 296488, 157229, 230961, 288320, 288325, 124489, 280140, 280145, 288338, 280149, 288344, 280152, 239194, 280158, 403039, 370272, 181854, 239202, 312938, 280183, 280185, 280188, 280191, 280194, 116354, 280208, 280211, 288408, 280218, 280222, 190118, 321195, 296622, 321200, 337585, 296626, 296634, 296637, 280260, 280264, 206536, 206539, 206541, 206543, 280276, 313044, 321239, 280283, 288478, 313055, 321252, 313066, 280302, 288494, 280304, 313073, 419570, 288499, 288502, 280314, 288510, 67330, 280324, 280331, 198416, 280337, 296723, 116503, 321304, 329498, 296731, 321311, 313121, 313123, 321316, 304932, 280363, 141101, 165678, 280375, 321336, 296767, 345921, 280388, 304968, 280393, 280402, 313176, 42842, 280419, 321381, 296812, 313201, 1920, 255873, 305028, 280454, 247688, 280458, 280464, 124817, 280468, 280473, 124827, 214940, 247709, 280487, 313258, 321458, 296883, 124853, 214966, 296890, 10170, 288700, 296894, 280515, 190403, 296900, 337862, 165831, 280521, 231379, 296921, 239586, 313320, 231404, 124913, 165876, 321528, 313340, 288764, 239612, 239617, 313347, 288773, 313358, 305176, 313371, 354338, 305191, 223273, 313386, 354348, 124978, 215090, 124980, 288824, 288826, 321595, 378941, 313406, 288831, 288836, 67654, 223303, 280651, 354382, 288848, 280658, 215123, 354390, 288855, 288859, 280669, 313438, 280671, 223327, 149599, 149601, 149603, 321634, 329830, 280681, 313451, 223341, 280687, 313458, 280691, 215154, 313464, 321659, 280702, 288895, 321670, 215175, 141446, 141455, 141459, 280725, 313498, 288936, 100520, 280747, 288940, 280755, 288947, 321717, 280759, 280764, 280769, 280771, 280774, 280776, 313548, 321740, 280783, 280786, 280788, 313557, 280793, 280796, 280798, 338147, 280804, 280807, 157930, 280811, 280817, 280819, 157940, 125171, 280823, 280825, 280827, 280830, 280831, 280833, 280835, 125187, 125191, 125207, 125209, 321817, 125218, 321842, 223539, 125239, 280888, 280891, 289087, 280897, 280900, 305480, 239944, 280906, 239947, 305485, 305489, 379218, 280919, 354653, 313700, 280937, 280940, 190832, 280946, 223606, 313720, 280956, 280959, 313731, 199051, 240011, 289166, 240017, 190868, 297365, 297368, 297372, 141725, 297377, 289186, 297391, 289201, 240052, 289207, 305594, 289210, 281024, 289221, 289227, 281045, 281047, 215526, 166378, 305647, 281075, 174580, 281084, 240124, 305662, 305664, 240129, 305666, 240132, 223749, 305668, 281095, 223752, 150025, 338440, 223757, 281102, 223763, 223765, 281113, 322074, 281116, 281121, 182819, 281127, 281135, 150066, 158262, 158266, 289342, 281154, 322115, 158283, 281163, 281179, 199262, 338528, 338532, 281190, 199273, 281196, 158317, 19053, 313973, 281210, 297594, 158347, 133776, 314003, 117398, 314007, 289436, 174754, 330404, 289448, 174764, 314029, 314033, 240309, 133817, 314045, 314047, 314051, 199364, 297671, 199367, 158409, 289493, 363234, 289513, 289522, 289525, 289532, 322303, 289537, 322310, 264969, 322314, 322318, 281361, 281372, 322341, 215850, 281388, 207661, 289593, 281401, 289601, 281410, 281413, 281414, 240458, 281420, 240468, 281430, 322393, 297818, 281435, 281438, 281442, 174955, 224110, 207733, 207737, 183172, 158596, 338823, 322440, 314249, 240519, 240535, 289687, 289694, 289696, 289700, 281529, 289724, 52163, 183260, 281567, 289762, 322534, 297961, 281581, 183277, 322550, 134142, 322563, 175134, 322599, 322610, 314421, 281654, 314427, 207937, 314433, 314441, 207949, 322642, 314456, 281691, 314461, 281702, 281704, 314474, 281708, 281711, 289912, 248995, 306341, 306344, 306347, 306354, 142531, 199877, 289991, 306377, 289997, 249045, 363742, 363745, 298216, 330988, 126190, 216303, 322801, 257302, 363802, 199976, 199978, 314671, 298292, 298294, 257334, 298306, 224584, 224587, 224594, 216404, 306517, 150870, 224603, 159068, 265568, 281960, 150890, 306539, 314732, 314736, 290161, 216436, 306549, 298358, 306552, 290171, 306555, 314747, 290174, 298365, 224641, 281987, 298372, 265604, 281990, 298377, 142733, 298381, 224657, 306581, 314779, 282025, 282027, 241068, 241070, 241072, 282034, 241077, 150966, 298424, 306618, 282044, 323015, 306635, 306640, 290263, 290270, 339431, 282089, 191985, 282098, 290291, 282101, 191992, 290298, 151036, 290302, 282111, 290305, 175621, 192008, 323084, 257550, 282127, 290321, 282130, 323090, 282133, 290325, 241175, 290328, 282137, 290332, 241181, 282142, 282144, 290344, 290349, 290351, 290356, 282186, 224849, 282195, 282199, 282201, 306778, 159324, 159330, 314979, 298598, 323176, 224875, 241260, 323181, 257658, 315016, 282249, 290445, 282261, 298651, 323229, 282269, 298655, 323231, 61092, 282277, 306856, 282295, 282300, 323260, 323266, 282310, 323273, 282319, 306897, 241362, 282328, 298714, 52959, 216801, 282337, 241380, 216806, 323304, 282345, 12011, 282356, 323318, 282364, 282367, 306945, 241412, 323333, 282376, 216842, 323345, 282388, 323349, 282392, 184090, 315167, 315169, 282402, 315174, 323367, 241448, 315176, 282410, 241450, 306988, 306991, 315184, 323376, 315190, 241464, 282425, 159545, 307009, 241475, 307012, 148946, 315211, 282446, 307027, 315221, 282454, 315223, 241496, 323414, 241498, 307035, 307040, 282465, 110433, 241509, 110438, 298860, 110445, 282478, 282481, 110450, 315251, 315249, 315253, 315255, 339838, 282499, 315267, 315269, 241544, 282505, 241546, 241548, 298896, 282514, 298898, 241556, 44948, 298901, 282520, 241560, 241563, 241565, 241567, 241569, 282531, 241574, 282537, 298922, 36779, 178273, 241581, 282542, 241583, 323504, 241586, 282547, 241588, 290739, 241590, 241592, 241598, 290751, 241600, 241605, 151495, 241610, 298975, 241632, 298984, 241640, 241643, 298988, 241646, 241649, 241652, 323574, 290807, 299006, 282623, 315396, 241669, 315397, 282632, 282639, 290835, 282645, 241693, 282654, 102438, 217127, 282669, 323630, 282681, 290877, 282687, 159811, 315463, 315466, 192589, 307278, 192596, 176213, 307287, 315482, 315483, 217179, 192605, 233567, 200801, 299105, 217188, 299109, 307303, 315495, 356457, 307307, 45163, 315502, 192624, 307314, 323700, 299126, 233591, 299136, 307329, 307338, 233613, 307352, 299164, 184479, 299167, 184481, 315557, 184486, 307370, 307372, 184492, 307374, 307376, 323763, 176311, 184503, 307386, 258235, 176316, 307388, 307390, 299200, 184512, 307394, 307396, 299204, 184518, 307399, 323784, 307409, 176343, 299225, 233701, 307432, 184572, 282881, 184579, 282893, 291089, 282906, 291104, 233766, 282931, 176435, 315701, 307510, 332086, 151864, 307512, 168245, 307515, 282942, 307518, 151874, 282947, 282957, 323917, 110926, 233808, 323921, 315733, 233815, 315739, 323932, 299357, 242018, 242024, 299373, 315757, 250231, 242043, 315771, 299388, 299391, 299398, 242057, 291212, 299405, 291222, 283033, 291226, 242075, 291231, 61855, 283042, 291238, 291241, 127403, 127405, 291247, 127407, 291254, 283062, 194660, 127417, 291260, 283069, 127421, 127429, 283080, 176592, 315856, 315860, 176597, 283095, 127447, 299481, 176605, 242143, 291299, 127463, 242152, 291305, 176620, 291314, 291317, 135672, 233979, 291323, 291330, 283142, 127497, 135689, 233994, 291341, 233998, 234003, 234006, 127511, 283161, 234010, 135707, 242202, 135710, 242206, 242208, 291361, 242220, 291378, 234038, 152118, 234041, 70213, 111193, 242275, 299620, 242279, 168562, 184952, 135805, 291456, 135808, 299655, 373383, 316051, 225941, 316054, 299672, 135834, 373404, 299677, 225948, 135839, 299680, 225954, 299684, 242343, 209576, 242345, 373421, 135870, 135873, 135876, 135879, 299720, 299723, 225998, 299726, 226002, 226005, 119509, 226008, 242396, 299740, 201444, 299750, 283368, 234219, 283372, 381677, 226037, 283382, 234231, 316151, 234236, 226045, 234239, 242431, 209665, 234242, 242436, 234246, 226056, 234248, 291593, 242443, 234252, 242445, 234254, 291601, 234258, 242450, 242452, 234261, 234264, 201496, 234266, 283421, 234269, 234272, 234274, 152355, 234278, 299814, 283432, 234281, 234284, 234287, 283440, 185138, 242483, 234292, 234296, 234298, 283452, 160572, 234302, 234307, 242499, 234309, 234313, 316233, 316235, 234316, 283468, 234319, 242511, 234321, 234324, 201557, 234329, 234333, 308063, 234336, 234338, 242530, 349027, 234341, 234344, 234347, 177004, 234350, 324464, 234353, 152435, 177011, 234356, 234358, 234362, 226171, 234364, 291711, 234368, 234370, 291714, 291716, 234373, 226182, 234375, 226185, 308105, 234379, 234384, 234388, 234390, 226200, 234393, 209818, 324504, 234396, 324508, 234398, 291742, 308123, 234401, 291748, 234405, 291750, 234407, 324518, 324520, 234410, 291754, 226220, 324522, 234414, 324527, 291760, 234417, 201650, 324531, 291756, 226230, 234422, 275384, 324536, 234428, 291773, 226239, 234431, 242623, 234434, 324544, 324546, 226245, 234437, 234439, 324548, 234443, 291788, 193486, 275406, 193488, 234446, 234449, 234452, 234455, 234459, 234461, 234464, 234467, 234470, 168935, 5096, 324585, 234475, 234478, 316400, 234481, 316403, 234484, 234485, 234487, 234490, 234493, 234496, 316416, 234501, 275462, 308231, 234504, 234507, 234510, 234515, 300054, 234519, 316439, 234520, 234523, 234526, 234528, 300066, 234532, 234535, 234537, 234540, 144430, 234543, 234546, 275508, 234549, 300085, 300088, 234553, 234556, 234558, 316479, 234561, 234563, 316483, 308291, 234568, 234570, 316491, 234572, 300108, 234574, 300115, 234580, 234581, 275545, 234585, 242777, 234590, 234593, 234595, 234597, 300133, 234601, 300139, 234605, 234607, 160879, 275569, 234610, 300148, 234614, 398455, 144506, 275579, 234618, 234620, 234623, 226433, 234627, 275588, 234629, 234634, 234636, 234640, 275602, 234643, 226453, 275606, 308373, 275608, 234647, 234648, 234650, 308379, 283805, 324757, 234653, 300189, 234657, 324766, 324768, 119967, 283813, 234661, 300197, 234664, 242852, 275626, 234667, 316596, 234687, 316610, 300226, 226500, 234692, 283844, 300229, 308420, 283850, 300234, 300238, 300241, 316625, 300243, 300245, 316630, 300248, 300253, 300256, 300258, 300260, 234726, 300263, 300265, 161003, 300267, 300270, 300272, 120053, 300278, 275703, 316663, 300284, 275710, 300287, 283904, 292097, 300289, 300292, 300294, 275719, 300299, 177419, 283917, 242957, 275725, 177424, 349464, 283939, 259367, 283951, 292143, 300344, 226617, 283963, 243003, 226628, 283973, 300357, 177482, 283983, 316758, 357722, 316766, 316768, 218464, 292192, 292197, 316774, 243046, 218473, 284010, 136562, 324978, 275834, 333178, 275836, 275840, 316803, 316806, 226696, 316811, 226699, 226703, 300433, 234899, 226709, 357783, 316824, 316826, 144796, 300448, 144807, 144810, 284076, 144812, 144814, 284084, 144820, 292279, 284087, 144826, 144828, 144830, 144832, 284099, 144835, 144837, 38342, 144839, 144841, 144844, 144847, 144852, 144855, 103899, 300507, 333280, 226787, 218597, 292329, 300523, 259565, 259567, 300527, 308720, 226802, 316917, 308727, 292343, 300537, 316947, 308757, 308762, 284191, 284194, 284196, 235045, 284199, 284204, 284206, 284209, 284211, 284213, 194101, 284215, 194103, 284218, 226877, 284223, 284226, 243268, 284228, 226886, 284231, 128584, 292421, 284234, 366155, 276043, 317004, 284238, 226895, 284241, 194130, 284243, 276052, 276053, 284245, 284247, 300628, 235097, 243290, 284251, 284249, 284253, 317015, 284255, 300638, 243293, 284258, 292452, 177766, 284263, 292454, 284265, 292458, 284267, 292461, 284272, 284274, 276086, 292470, 284278, 292473, 284283, 276093, 284286, 276095, 292479, 284288, 276098, 325250, 284290, 292485, 284292, 284297, 317066, 284299, 317068, 276109, 284301, 284303, 276114, 284306, 284308, 284312, 284314, 284316, 276127, 284320, 284322, 284327, 276137, 284329, 284331, 317098, 284333, 284335, 284337, 284339, 300726, 284343, 284346, 284350, 276160, 358080, 284354, 276166, 284358, 358089, 276170, 284362, 276175, 284368, 276177, 317138, 358098, 284370, 284372, 284377, 276187, 284379, 284381, 284384, 284386, 358116, 276197, 284392, 325353, 284394, 358122, 284397, 276206, 284399, 358126, 358128, 358133, 358135, 276216, 358138, 300795, 358140, 284413, 358142, 284418, 317187, 358146, 317189, 317191, 284428, 300816, 300819, 317207, 284440, 186139, 300828, 300830, 276255, 300832, 284449, 300834, 325408, 227109, 317221, 358183, 186151, 276268, 194351, 243504, 300850, 284469, 276280, 325436, 358206, 276291, 366406, 276295, 300872, 153417, 284499, 276308, 284502, 317271, 178006, 276315, 292700, 284511, 227175, 292715, 284529, 292721, 300915, 284533, 292729, 317306, 284540, 292734, 325512, 169868, 276365, 284564, 358292, 284566, 350106, 284572, 276386, 284579, 276388, 358312, 284585, 317353, 276395, 292776, 276402, 358326, 161718, 276410, 358330, 276411, 276418, 276425, 301009, 301011, 301013, 292823, 301015, 301017, 358360, 292828, 276446, 153568, 276448, 276452, 276455, 292843, 276460, 276464, 276466, 227314, 276472, 325624, 317435, 276476, 276479, 276482, 276485, 276490, 292876, 276496, 317456, 317458, 243733, 243740, 317468, 317472, 325666, 243751, 292904, 276528, 243762, 309298, 325685, 325689, 276539, 235579, 235581, 325692, 178238, 276544, 284739, 276553, 243785, 350293, 350295, 194649, 227418, 309337, 194654, 227423, 350302, 194657, 227426, 276579, 309346, 309348, 227430, 276583, 350308, 309350, 276586, 309352, 350313, 350316, 276590, 301167, 227440, 350321, 284786, 276595, 301163, 350325, 350328, 292985, 301178, 292989, 301185, 292993, 350339, 317573, 350342, 227463, 350345, 350349, 301199, 317584, 325777, 350354, 350357, 350359, 350362, 276638, 350366, 284837, 153765, 350375, 350379, 350381, 350383, 350385, 350387, 350389, 350395, 350397, 350399, 227520, 350402, 227522, 301252, 350406, 227529, 301258, 309450, 276685, 276689, 301272, 276699, 194780, 309468, 301283, 317672, 276713, 317674, 325867, 243948, 194801, 227571, 276725, 309494, 243960, 227583, 276735, 227587, 276739, 211204, 276742, 227593, 227596, 325910, 309530, 342298, 276766, 211232, 276775, 211241, 325937, 276789, 325943, 260421, 285002, 276811, 276816, 235858, 276829, 276833, 391523, 276836, 276843, 293227, 276848, 293232, 186744, 285051, 211324, 227709, 285061, 317833, 178572, 285070, 285077, 178583, 227738, 317853, 276896, 317858, 342434, 285093, 285098, 276907, 276917, 293304, 293307, 293314, 309707, 293325, 317910, 293336, 235996, 317917, 293343, 358880, 276961, 227810, 293346, 276964, 293352, 236013, 293364, 317951, 309764, 121352, 236043, 317963, 342541, 55822, 113167, 277011, 309779, 317971, 309781, 55837, 227877, 227879, 293417, 227882, 293421, 105007, 236082, 285236, 23094, 277054, 244288, 129603, 301636, 318020, 301639, 301643, 285265, 309844, 277080, 309849, 285277, 285282, 326244, 277100, 277106, 121458, 170618, 170619, 309885, 309888, 277122, 227975, 285320, 277128, 301706, 334476, 326285, 318094, 318092, 277136, 277139, 227992, 285340, 318108, 227998, 318110, 383658, 285357, 318128, 277170, 342707, 154292, 277173, 293555, 285368, 277177, 277181, 318144, 277187, 277191, 277194, 277196, 277201, 137946, 113378, 203491, 228069, 277223, 342760, 285417, 56041, 56043, 277232, 228081, 56059, 310015, 285441, 310020, 285448, 310029, 285453, 228113, 285459, 277273, 326430, 228128, 293666, 228135, 318248, 277291, 293677, 318253, 285489, 293685, 285494, 301880, 285499, 301884, 293696, 310080, 277314, 277317, 277322, 277329, 162643, 310100, 301911, 301913, 277337, 301921, 400236, 236397, 162671, 326514, 277368, 236408, 15224, 416639, 416640, 113538, 310147, 416648, 39817, 187274, 277385, 301972, 424853, 277405, 277411, 310179, 293798, 293802, 236460, 277426, 293811, 293817, 293820, 203715, 326603, 293849, 293861, 228327, 228328, 228330, 318442, 228332, 277486, 326638, 318450, 293876, 293877, 285686, 302073, 285690, 244731, 121850, 302075, 293882, 293887, 277504, 277507, 277511, 277519, 293908, 293917, 293939, 318516, 277561, 277564, 7232, 310336, 293956, 277573, 228422, 310344, 277577, 293960, 277583, 203857, 293971, 310355, 310359, 236632, 277594, 138332, 277598, 285792, 203872, 277601, 310374, 203879, 310376, 228460, 318573, 203886, 187509, 285815, 285817, 367737, 285821, 302205, 285824, 392326, 285831, 302218, 285835, 294026, 384148, 162964, 187542, 302231, 285849, 302233, 285852, 302237, 285854, 285856, 285862, 277671, 302248, 64682, 277678, 228526, 294063, 294065, 302258, 277687, 294072, 318651, 277695, 318657, 244930, 302275, 130244, 302277, 228550, 302282, 310476, 302285, 302288, 310481, 302290, 203987, 302292, 302294, 302296, 384222, 310498, 285927, 318698, 302315, 195822, 228592, 294132, 138485, 204023, 228601, 204026, 228606, 204031, 64768, 310531, 285958, 228617, 138505, 318742, 204067, 277798, 130345, 277801, 113964, 285997, 277804, 277807, 285999, 113969, 277811, 318773, 277816, 318776, 286010, 277819, 294204, 417086, 277822, 286016, 294211, 302403, 384328, 277832, 277836, 294221, 294223, 326991, 277839, 277842, 277847, 277850, 179547, 277853, 146784, 277857, 302436, 277860, 294246, 327015, 310632, 327017, 277864, 351594, 277869, 277872, 351607, 310648, 277880, 310651, 277884, 277888, 310657, 310659, 294276, 351619, 277892, 277894, 253320, 310665, 318858, 277898, 327046, 277903, 310672, 351633, 277905, 277908, 277917, 310689, 277921, 277923, 130468, 228776, 277928, 277932, 310703, 277937, 130486, 310710, 310712, 277944, 277947, 310715, 302526, 277950, 277953, 64966, 245191, 163272, 302534, 310727, 277959, 292968, 302541, 277966, 302543, 277963, 310737, 277971, 277975, 286169, 228825, 163290, 277978, 310749, 277981, 277984, 310755, 277989, 277991, 187880, 277995, 286188, 310764, 278000, 278003, 310772, 228851, 278006, 40440, 278009, 212472, 286203, 40443, 228864, 40448, 286214, 228871, 302603, 65038, 302614, 286233, 302617, 302621, 286240, 146977, 187939, 294435, 40484, 40486, 294439, 286248, 294440, 40488, 294443, 286246, 294445, 278057, 40491, 310831, 40499, 40502, 212538, 40507, 40511, 40513, 228933, 40521, 286283, 40525, 40527, 228944, 400976, 212560, 40533, 147032, 40537, 278109, 40541, 40544, 40548, 40550, 286312, 286313, 40552, 40554, 310892, 40557, 40560, 188022, 122488, 294521, 343679, 310925, 286354, 278163, 302740, 122517, 278168, 327333, 229030, 212648, 278188, 302764, 278192, 319153, 278196, 302781, 319171, 302789, 294599, 278216, 294601, 278227, 229076, 286420, 319187, 286425, 319194, 278235, 229086, 278238, 286432, 294625, 294634, 302838, 319226, 286460, 171774, 278274, 302852, 278277, 302854, 294664, 311048, 319243, 311053, 302862, 319251, 294682, 278306, 294701, 278320, 319280, 319290, 229192, 302925, 188247, 237409, 360317, 327554, 40840, 40851, 294803, 188312, 294811, 319390, 294817, 40865, 319394, 294821, 180142, 188340, 40886, 319419, 294844, 294847, 309354, 393177, 294876, 294879, 294883, 294890, 311279, 278513, 237555, 278516, 311283, 278519, 237562 ]
09aa07e649a9c1d04c929caf788b6dfd1c16b3e6
f51ec48649cf1f98ca74f22205f6503a9482de88
/VKFileManager/Routing/Transitions/PushTransition.swift
b52a10c400b38b7c3200cb0a0b6bc073584df1f2
[]
no_license
Decim413/VKFileManager
f57e7af60722c65920c127c6679790301f063f2b
6efbc354a455454bd660a73e6fb1acab00115950
refs/heads/master
2020-03-23T16:59:47.151955
2018-07-21T18:25:20
2018-07-21T18:25:20
141,837,197
0
1
null
null
null
null
UTF-8
Swift
false
false
1,883
swift
// // PushTransition.swift // VKFileManager // // Created by Victor Alekseev on 21/07/2018. // Copyright © 2018 Victor Alekseev. All rights reserved. // import UIKit class PushTransition: NSObject { var animator: Animator? var isAnimated: Bool = true var completionHandler: (() -> Void)? weak var viewController: UIViewController? init(animator: Animator? = nil, isAnimated: Bool = true) { self.animator = animator self.isAnimated = isAnimated } } // MARK: - Transition extension PushTransition: Transition { func open(_ viewController: UIViewController) { self.viewController?.navigationController?.delegate = self self.viewController?.navigationController?.pushViewController(viewController, animated: isAnimated) } func close(_ viewController: UIViewController) { self.viewController?.navigationController?.popViewController(animated: isAnimated) } } // MARK: - UINavigationControllerDelegate extension PushTransition: UINavigationControllerDelegate { func navigationController(_ navigationController: UINavigationController, didShow viewController: UIViewController, animated: Bool) { completionHandler?() } func navigationController(_ navigationController: UINavigationController, animationControllerFor operation: UINavigationControllerOperation, from fromVC: UIViewController, to toVC: UIViewController) -> UIViewControllerAnimatedTransitioning? { guard let animator = animator else { return nil } if operation == .push { animator.isPresenting = true return animator } else { animator.isPresenting = false return animator } } }
[ -1 ]
f57d863781c9efe035df56d2349bf51cf860a274
f7413e9c65f5ceb7a4bab7cd996cfed937a1718f
/SuperHeroes/Views/BarBlockView.swift
8febc92b6f832a5282b76e490f33ca4f15d03a08
[]
no_license
ksloginov/SuperHeroes-StartingKit
ebe911e1fc6b9acaae5ebf41b0432db13532a751
92b60d062dd09bc3a36b1d87e5e468581f4dfa15
refs/heads/master
2023-07-26T15:20:38.424348
2021-09-09T05:52:58
2021-09-09T05:52:58
404,484,763
0
2
null
null
null
null
UTF-8
Swift
false
false
982
swift
// // BarBlockView.swift // SuperHeroes // // Created by Konstantin Loginov on 02.09.2021. // import SwiftUI struct BarBlockView: View { let title: String let value: Int let total: Int let color: Color var body: some View { VStack(alignment: .leading, spacing: 3.0) { Text(title) .font(.title3) .fontWeight(.regular) .multilineTextAlignment(.leading) .lineLimit(1) HStack { BarView(value: value, total: total, color: color) .frame(height: 10.0) Spacer() Text(String(value)) .font(.title3) .fontWeight(.bold) .lineLimit(1) } } } } struct BarBlockView_Previews: PreviewProvider { static var previews: some View { BarBlockView(title: "Attack:", value: 51, total: 80, color: .blue) } }
[ -1 ]
90ee42546b91a152ff55fd6b8d5320fe8848ef0f
b84b27fb27d033291cebb597d34044eaec9b3a9d
/LifeTarget/Source/Scenes/List/ViewModels/ProgressViewModel.swift
7fae1b21b01403f0b9d80c59f20cfd8fde2755c2
[]
no_license
mishamoix/LifeTarget
109df1f6bbdc13c7abd63d3f210351d2d05a1cf7
7f2b29b428722ad6945ce0f5d079f17a0cd80cc3
refs/heads/master
2023-02-26T02:37:25.615698
2021-02-02T07:49:40
2021-02-02T07:49:40
328,710,132
0
0
null
null
null
null
UTF-8
Swift
false
false
227
swift
// // ProgressViewModel.swift // LifeTarget // // Created by Mikhail Malyshev on 18.01.2021. // import UIKit struct ProgressViewModel { let color: UIColor let progress: Float let subtitle: String let showPlus: Bool }
[ -1 ]
8b832d1c81eeb5aa742e4e3cd4e053127e93fbf0
ae76c818d1d4521c9186ca1669ca4f7cfde3bacd
/testAdastra/Todo/viewControllers/TodoTableViewController.swift
b06dc55d9618b55551ef9dfd5f513e0f82cc145d
[]
no_license
bofbof93/Test
abc89be735a432072fd0861ee7caf9620318c245
95680b69c73428c056937d6a367019fb245b1416
refs/heads/master
2021-08-16T10:33:48.211212
2017-11-19T16:09:31
2017-11-19T16:09:31
109,580,620
0
0
null
null
null
null
UTF-8
Swift
false
false
12,860
swift
// // TodoTableViewController.swift // testAdastra // // Created by boufaied youssef on 02/11/2017. // Copyright © 2017 boufaied youssef. All rights reserved. // import UIKit import FoldingCell import CoreData import PopupDialog import UserNotifications class TodoTableViewController: UITableViewController { let requestIdentifier = "SampleRequest" @IBOutlet var buttonAdd: UIBarButtonItem! @IBOutlet var popupMenu: UIView! let kCloseCellHeight: CGFloat = 135 let kOpenCellHeight: CGFloat = 312 let kRowsCount = 100 var cellHeights: [CGFloat] = [] var listTodo : [Todo] = [Todo]() var listTodoDeleted : [Todo] = [Todo]() let accessTodo : AccessTodo = AccessTodo() let accessCategory : AccessCategory = AccessCategory() override func viewDidLoad() { super.viewDidLoad() setup() } @IBAction func addAction(_ sender: Any) { let vc = UIStoryboard(name:"Main",bundle:nil).instantiateViewController(withIdentifier: "AddTodoViewController") as! AddTodoViewController self.navigationController?.pushViewController(vc, animated: true) } func getContext () -> NSManagedObjectContext { let appDelegate = UIApplication.shared.delegate as! AppDelegate return appDelegate.persistentContainer.viewContext } private func setup() { cellHeights = Array(repeating: kCloseCellHeight, count: kRowsCount) tableView.estimatedRowHeight = kCloseCellHeight tableView.rowHeight = UITableViewAutomaticDimension tableView.backgroundColor = UIColor(red: 52/255, green: 73/255, blue: 94/255, alpha: 1.0) } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) self.listTodo.removeAll() self.listTodoDeleted.removeAll() self.listTodo = accessTodo.getAllTodos() var i = 0 for todo in listTodo { if(todo.isdeleted == "true"){ self.listTodoDeleted.append(todo) self.listTodo.remove(at: i) }else{ i = i+1 } } self.tableView.reloadData() UINavigationBar.appearance().barTintColor = UIColor(red: 198/255, green: 218/255, blue: 2/255, alpha: 1.0) } } // MARK: - TableView extension TodoTableViewController { override func numberOfSections(in tableView: UITableView) -> Int { if(listTodo.count > 0 && listTodoDeleted.count > 0){ return 2 }else if (listTodo.count > 0 || listTodoDeleted.count > 0){ return 1 } return 1 } override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { if(listTodo.count == 0 && listTodoDeleted.count == 0){ return 1 } if(listTodo.count > 0 && listTodoDeleted.count > 0){ if(section == 0){ return listTodo.count }else{ return listTodoDeleted.count } }else if (listTodo.count > 0){ return listTodo.count }else{ return listTodoDeleted.count } } override func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) { guard case let cell as TodoCell = cell else { return } cell.backgroundColor = .clear if cellHeights[indexPath.row] == kCloseCellHeight { cell.selectedAnimation(false, animated: false, completion:nil) } else { cell.selectedAnimation(true, animated: false, completion: nil) } } override func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { var view : UIView = UIView() if(self.listTodoDeleted.count == 0 && self.listTodo.count == 0){ return view } view = UIView(frame: CGRect(x:0,y:0,width:tableView.frame.size.width,height:18)) let label : UILabel = UILabel(frame : CGRect(x:10, y:5 , width:tableView.frame.size.width ,height: 18)) label.font = UIFont.boldSystemFont(ofSize: 12) label.textColor = UIColor.white var string : String = "" if(tableView.numberOfSections == 2){ string = "Current" view.backgroundColor = UIColor(red: 198/255, green: 218/255, blue: 2/255, alpha: 0.6) if(section == 1){ string = "Completed" view.backgroundColor = UIColor(red: 245/255, green: 82/255, blue: 45/255, alpha: 0.6) } }else{ if(listTodo.count > 0){ string = "Current" view.backgroundColor = UIColor(red: 198/255, green: 218/255, blue: 2/255, alpha: 0.6) }else{ string = "Completed" view.backgroundColor = UIColor(red: 245/255, green: 82/255, blue: 45/255, alpha: 0.6) } } label.text = string view.addSubview(label) return view } override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { if (self.listTodo.count == 0 && self.listTodoDeleted.count == 0) { let cellEmpty = tableView.dequeueReusableCell(withIdentifier: "EmptyCell", for: indexPath) return cellEmpty } let cell = tableView.dequeueReusableCell(withIdentifier: "FoldingCell", for: indexPath) as! TodoCell var todo = Todo() if(tableView.numberOfSections == 2){ if(indexPath.section == 0){ todo = self.listTodo[indexPath.row] cell.checkedImageView.isHidden = true cell.doneButton.tag = 100+indexPath.row }else{ todo = self.listTodoDeleted[indexPath.row] cell.checkedImageView.isHidden = false cell.doneButton.tag = 200 + indexPath.row cell.doneButton.setTitle("Delete", for: .normal ) } }else{ if(self.listTodo.count > 0){ todo = self.listTodo[indexPath.row] cell.checkedImageView.isHidden = true cell.doneButton.tag = 100+indexPath.row }else{ todo = self.listTodoDeleted[indexPath.row] cell.checkedImageView.isHidden = false cell.doneButton.tag = 200 + indexPath.row cell.doneButton.setTitle("Delete", for: .normal ) } } let durations: [TimeInterval] = [0.26, 0.2, 0.2] // cell.closeNumberLabel.text = todo.category?.name cell.navigationController = self.navigationController! cell.durationsForExpandedState = durations cell.durationsForCollapsedState = durations cell.nameLabel.text = todo.name cell.nameExtendedLabel.text = todo.name cell.dateLabel.text = todo.date //cell.dateBegin.text = todo.date cell.dateEnd.text = todo.date cell.timeLabel.text = todo.time cell.leftView.backgroundColor = Utils.parseColor(string: (todo.category?.color)!) cell.barView.backgroundColor = Utils.parseColor(string: (todo.category?.color)!) cell.categoryMiniatureColor.backgroundColor = Utils.parseColor(string: (todo.category?.color)!) cell.categoryName.text = todo.category?.name cell.categoryExtendedName.text = todo.category?.name cell.timeExtendedLabel.text = todo.time cell.doneButton.addTarget(self, action: #selector(doneAction(sender:)), for: .touchUpInside) cell.todo = todo return cell } @objc func doneAction(sender: UIButton) { if(sender.tag >= 100 && sender.tag < 200){ let index = sender.tag-100 self.listTodoDeleted.append(self.listTodo[index]) self.listTodo[index].isdeleted = "true" self.listTodo.remove(at: index) do { try self.getContext().save() print("updated todo!") } catch let error as NSError { print("Could not save \(error), \(error.userInfo)") } tableView.reloadData() }else{ let index = sender.tag-200 self.accessTodo.deleteTodo(todo: self.listTodoDeleted[index]) self.listTodoDeleted.remove(at: index) self.tableView.reloadData() } } override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { return cellHeights[indexPath.row] } override func tableView(_ tableView: UITableView, editActionsForRowAt indexPath: IndexPath) -> [UITableViewRowAction]? { let complete = UITableViewRowAction(style: .normal, title: "Complete") { (action, indexPath) in self.listTodoDeleted.append(self.listTodo[indexPath.row]) self.listTodo[indexPath.row].isdeleted = "true" self.listTodo.remove(at: indexPath.row) do { try self.getContext().save() print("updated todo!") } catch let error as NSError { print("Could not save \(error), \(error.userInfo)") } tableView.reloadData() } let delete = UITableViewRowAction(style: .destructive, title: "Delete") { (action, indexPath) in self.accessTodo.deleteTodo(todo: self.listTodoDeleted[indexPath.row]) self.listTodoDeleted.remove(at: indexPath.row) tableView.reloadData() } let deleteTask = UITableViewRowAction(style: .destructive, title: "Delete") { (action, indexPath) in self.accessTodo.deleteTodo(todo: self.listTodo[indexPath.row]) self.listTodo.remove(at: indexPath.row) tableView.reloadData() } if(tableView.numberOfSections == 2){ if(indexPath.section == 0) { complete.backgroundColor = Utils.parseColor(string: (self.listTodo[indexPath.row].category?.color)!) return [complete,deleteTask] }else{ delete.backgroundColor = Utils.parseColor(string: (self.listTodoDeleted[indexPath.row].category?.color)!) return [delete] } }else { if(listTodo.count > 0){ complete.backgroundColor = Utils.parseColor(string: (self.listTodo[indexPath.row].category?.color)!) return [complete,deleteTask] }else{ delete.backgroundColor = Utils.parseColor(string: (self.listTodoDeleted[indexPath.row].category?.color)!) return [delete] } } } override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { if(self.listTodo.count == 0 && self.listTodoDeleted.count == 0){ let storyboard:UIStoryboard = UIStoryboard(name: "Main", bundle: nil) let destinationVC : AddTodoViewController = storyboard.instantiateViewController(withIdentifier: "AddTodoViewController") as! AddTodoViewController self.navigationController?.pushViewController(destinationVC, animated: true) return } let cell = tableView.cellForRow(at: indexPath) as! FoldingCell if cell.isAnimating() { return } var duration = 0.0 let cellIsCollapsed = cellHeights[indexPath.row] == kCloseCellHeight if cellIsCollapsed { cellHeights[indexPath.row] = kOpenCellHeight cell.selectedAnimation(true, animated: true, completion: nil) duration = 0.5 } else { cellHeights[indexPath.row] = kCloseCellHeight cell.selectedAnimation(false, animated: true, completion: nil) duration = 0.8 } UIView.animate(withDuration: duration, delay: 0, options: .curveEaseOut, animations: { () -> Void in tableView.beginUpdates() tableView.endUpdates() }, completion: nil) } }
[ -1 ]
4b00839500071d01215b89e34ed2c905fe31f505
f22e287409935590dc58d159fadad1140185094a
/Controller/MainViewController.swift
02d18b5ce9888af7b4a18541d79620ae781df9a2
[]
no_license
sleu/OnTheMap
5e002082ea4f7a6ea88831df1253fb91b6cc0e01
071ef51a8cf2bd04538d1404413c4027b412cd1a
refs/heads/master
2020-04-08T10:02:29.004410
2018-12-14T21:58:46
2018-12-14T21:58:46
157,270,488
0
0
null
null
null
null
UTF-8
Swift
false
false
2,968
swift
// // MainViewController.swift // OnTheMap // // Created by Sean Leu on 11/16/18. // Copyright © 2018 Udacity. All rights reserved. // import UIKit class MainViewController: UITabBarController { let mainView = MainView() let mapTabController = MapsViewController() let tableTabController = TableTabViewController() override func viewDidLoad() { super.viewDidLoad() mapTabController.tabBarItem = UITabBarItem(title: nil, image: UIImage(named: "icon_mapview-deselected"), selectedImage: UIImage(named: "icon_mapview-selected")) tableTabController.tabBarItem = UITabBarItem(title: nil, image: UIImage(named: "icon_listview-deselected"), selectedImage: UIImage(named: "icon_listview-selected")) let viewControllerList = [mapTabController, tableTabController] viewControllers = viewControllerList.map { UINavigationController(rootViewController: $0) } loadNavigationBar() } func loadNavigationBar() { let addButton = mainView.addButton() addButton.addTarget(self, action: #selector(add), for: .touchUpInside) let addButtonItem = UIBarButtonItem(customView: addButton) let refreshButton = mainView.refreshButton() refreshButton.addTarget(self, action: #selector(refresh), for: .touchUpInside) let refreshButtonItem = UIBarButtonItem(customView: refreshButton) let logOutButton = mainView.logOutButton() logOutButton.target = self logOutButton.action = #selector(logout) self.navigationItem.leftBarButtonItem = logOutButton self.navigationItem.rightBarButtonItems = [addButtonItem, refreshButtonItem] self.navigationItem.title = mainView.title } @objc func logout() { UIApplication.shared.isNetworkActivityIndicatorVisible = true UdacClient.sharedInstance.logout() { (success, errorMessage) in if success { DispatchQueue.main.async { UIApplication.shared.isNetworkActivityIndicatorVisible = false self.goToLogin() } } else { UIApplication.shared.isNetworkActivityIndicatorVisible = false self.displayNotification(errorMessage!) } } } @objc func add() { let newVC = PostingViewController() self.navigationController?.pushViewController(newVC, animated: true) } @objc func refresh(){ mapTabController.loadData() tableTabController.update() } func goToLogin() { self.dismiss(animated: true, completion: nil) } func displayNotification(_ error: String){ let alert = UIAlertController(title: "Error", message: error, preferredStyle: .alert) alert.addAction(UIAlertAction(title: "OK", style: .default)) self.present(alert, animated: true) } }
[ -1 ]
71f3ef2bf291a20ed9026edbeb70271dfc7af8d1
2f2eae76ca77559f88a08dc9da891c62be797995
/FlightsNostalgia/AppDelegate.swift
b0420e67329adae1a7ce221dd0c88a4c9860def0
[]
no_license
grisvladko/FlightsNostalgia
2523317705613813370af1d4d61958c32138bea3
9a71f616be1ada03225ba55126390bb50cdbeda0
refs/heads/master
2023-03-07T19:28:17.475765
2021-02-23T17:51:00
2021-02-23T17:51:00
341,609,998
0
0
null
null
null
null
UTF-8
Swift
false
false
1,364
swift
// // AppDelegate.swift // FlightsNostalgia // // Created by hyperactive on 19/01/2021. // import UIKit @main class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } // MARK: UISceneSession Lifecycle func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { // Called when a new scene session is being created. // Use this method to select a configuration to create the new scene with. return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) } func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) { // Called when the user discards a scene session. // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. // Use this method to release any resources that were specific to the discarded scenes, as they will not return. } }
[ 393222, 393224, 393230, 393250, 344102, 393261, 393266, 213048, 385081, 376889, 393275, 376905, 254030, 368727, 180313, 180320, 376931, 368752, 417924, 262283, 377012, 164028, 327871, 377036, 377046, 418007, 418010, 377060, 205036, 393456, 393460, 418043, 336123, 385280, 336128, 262404, 164106, 180490, 368911, 262416, 262422, 377117, 262436, 336180, 262454, 393538, 262472, 344403, 213332, 65880, 262496, 418144, 262499, 213352, 246123, 262507, 262510, 213372, 385419, 393612, 262550, 262552, 385440, 385443, 262566, 385451, 262573, 393647, 385458, 262586, 344511, 262592, 360916, 369118, 328177, 328179, 328182, 328189, 328192, 164361, 410128, 393747, 254490, 188958, 385570, 33316, 377383, 197159, 352821, 197177, 418363, 188987, 369223, 385609, 385616, 352864, 369253, 262760, 352874, 352887, 254587, 377472, 148105, 377484, 352918, 98968, 344744, 361129, 385713, 434867, 164534, 336567, 328378, 164538, 344776, 352968, 352971, 418507, 352973, 385742, 385748, 361179, 189153, 369381, 361195, 418553, 344831, 344835, 336643, 344841, 361230, 336659, 418580, 418585, 434970, 369435, 418589, 262942, 418593, 336675, 418598, 418605, 336696, 361273, 328515, 328519, 361288, 328522, 336714, 426841, 197468, 254812, 361309, 361315, 361322, 377729, 369542, 361360, 222128, 345035, 386003, 345043, 386011, 386018, 386022, 435187, 328714, 361489, 386069, 386073, 336921, 345118, 377887, 345133, 345138, 386101, 361536, 189520, 345169, 156761, 361567, 148578, 345199, 386167, 361593, 410745, 214149, 345222, 386186, 337047, 345246, 214175, 386258, 328924, 66782, 222437, 386285, 328941, 386291, 345376, 353570, 345379, 410917, 345382, 337205, 345399, 378169, 369978, 337222, 337229, 337234, 263508, 402791, 345448, 271730, 378227, 271745, 181638, 353673, 181643, 181654, 230809, 181673, 181681, 181684, 361917, 181696, 337349, 271839, 329191, 361960, 116210, 337398, 329226, 419339, 419343, 419349, 419355, 370205, 419359, 394786, 419362, 370213, 419368, 419376, 206395, 214593, 419400, 419402, 353867, 419406, 419410, 394853, 345701, 222830, 370297, 403075, 345736, 198280, 403091, 345749, 419483, 345757, 345762, 419491, 345765, 419497, 419501, 370350, 419506, 419509, 419512, 419517, 337599, 419527, 419530, 419535, 272081, 394966, 419542, 419544, 181977, 345818, 419547, 419550, 419559, 419563, 370415, 337659, 337668, 362247, 395021, 362255, 116509, 345887, 378663, 345905, 354106, 354111, 247617, 354117, 370503, 329544, 370509, 354130, 247637, 337750, 370519, 313180, 354142, 354150, 354156, 345964, 345967, 345970, 345974, 403320, 354172, 247691, 337808, 247700, 329623, 436126, 436132, 362413, 337844, 346057, 346063, 247759, 329697, 354277, 190439, 247789, 354313, 346139, 436289, 378954, 395339, 338004, 100453, 329855, 329885, 346272, 100524, 387249, 379066, 387260, 256191, 395466, 346316, 411861, 411864, 411868, 411873, 379107, 411876, 387301, 346343, 338152, 387306, 387312, 346355, 436473, 379134, 411903, 411916, 379152, 395538, 387349, 338199, 387352, 182558, 248111, 362822, 436555, 190796, 379233, 354673, 420236, 379278, 272786, 354727, 338352, 338381, 330189, 338386, 338403, 248308, 199164, 330252, 330267, 354855, 10828, 199249, 346721, 174695, 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, 338763, 355150, 330580, 355166, 265055, 265058, 355175, 387944, 355179, 330610, 355218, 330642, 412599, 207808, 379848, 396245, 248792, 257008, 183282, 265207, 330748, 265214, 330760, 330768, 248862, 347176, 396328, 158761, 199728, 396336, 330800, 396339, 339001, 388154, 388161, 347205, 330826, 412764, 339036, 257120, 265320, 248951, 420984, 330889, 347287, 248985, 44197, 380070, 339112, 249014, 126144, 330958, 330965, 265432, 265436, 388319, 388347, 175375, 175396, 208166, 273708, 347437, 372015, 347441, 372018, 199988, 44342, 175415, 396600, 437566, 175423, 437570, 437575, 437583, 331088, 437587, 331093, 396633, 175450, 437595, 208227, 265580, 437620, 249208, 249214, 175486, 175489, 249218, 249227, 175516, 396705, 175522, 355748, 380332, 396722, 208311, 372163, 380360, 216522, 339404, 372176, 208337, 339412, 413141, 339417, 339420, 249308, 339424, 339428, 339434, 249328, 69113, 372228, 208398, 380432, 175635, 265778, 265795, 396872, 265805, 224853, 224857, 257633, 224870, 372327, 257646, 372337, 224884, 224887, 224890, 224894, 372353, 224897, 216707, 421508, 126596, 224904, 11918, 159374, 224913, 126610, 224916, 224919, 126616, 208538, 224922, 224926, 224929, 224932, 257704, 224936, 224942, 257712, 224947, 257716, 257720, 257724, 224959, 257732, 224965, 224969, 339662, 224975, 257747, 224981, 224986, 257761, 224993, 257764, 224999, 339695, 225012, 257787, 225020, 257790, 225025, 257794, 339721, 257801, 257804, 225038, 257807, 225043, 372499, 225048, 257819, 225053, 225058, 257833, 257836, 413484, 225070, 372532, 257845, 225079, 397112, 225082, 397115, 225087, 225092, 225096, 323402, 257868, 225103, 257871, 397139, 225108, 225112, 257883, 257886, 225119, 257890, 225127, 274280, 257896, 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, 266297, 421960, 356439, 421990, 266350, 356466, 266362, 381068, 225423, 250002, 250004, 225429, 356506, 225437, 225441, 438433, 225444, 438436, 225447, 438440, 225450, 258222, 225455, 225458, 225461, 225466, 389307, 225470, 381120, 372929, 430274, 225475, 389320, 225484, 225487, 225490, 225493, 266453, 225496, 225499, 225502, 225505, 356578, 225510, 217318, 225514, 225518, 372976, 381176, 397571, 389380, 356637, 356640, 356643, 356646, 266536, 356649, 356655, 332080, 356660, 397622, 332090, 225597, 348488, 332106, 332117, 348502, 250199, 332125, 332152, 389502, 250238, 332161, 356740, 332172, 373145, 340379, 373148, 389550, 324030, 266687, 127471, 340472, 381436, 324094, 266754, 324111, 340500, 381481, 356907, 324142, 356916, 324149, 324155, 348733, 324164, 348743, 381512, 324173, 324176, 389723, 332380, 381545, 340627, 373398, 184982, 258721, 332453, 332459, 389805, 332463, 381617, 332483, 332486, 373449, 357069, 332493, 357073, 332511, 332520, 340718, 332533, 348924, 373510, 389926, 348978, 152370, 340789, 348982, 398139, 357201, 357206, 389978, 430939, 357211, 357214, 201579, 201582, 349040, 340849, 430965, 381813, 324472, 398201, 119674, 324475, 430972, 340858, 340861, 324478, 373634, 398211, 324484, 381833, 324492, 324495, 430995, 324501, 324510, 422816, 324513, 398245, 324524, 324538, 324541, 398279, 340939, 340941, 209873, 340957, 431072, 398306, 340963, 209895, 201711, 349172, 349180, 439294, 209943, 357410, 250914, 185380, 357418, 209965, 209971, 209975, 209979, 209987, 209990, 209995, 341071, 349267, 250967, 210010, 341091, 210025, 210030, 210036, 210039, 349308, 210044, 349311, 160895, 152703, 210052, 210055, 349319, 218247, 210067, 210077, 210080, 251044, 210084, 185511, 210095, 210098, 210107, 210115, 332997, 210127, 333009, 210131, 333014, 210138, 210143, 218354, 218360, 275712, 275715, 275721, 349459, 333078, 251160, 349484, 349491, 415033, 251210, 357708, 210260, 365911, 259421, 365921, 333154, 333162, 234866, 390516, 333175, 357755, 374160, 112020, 349590, 357792, 259515, 415166, 415185, 366034, 366038, 415191, 415193, 415196, 415199, 423392, 415207, 366056, 366061, 415216, 210420, 415224, 423423, 415257, 415263, 366117, 415270, 415278, 415281, 415285, 415290, 415293, 349761, 415300, 366172, 333413, 423528, 423532, 210544, 415353, 333439, 415361, 267909, 333498, 210631, 333511, 358099, 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, 399215, 358255, 268143, 358259, 341876, 243579, 325504, 333724, 382890, 350146, 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, 260289, 260298, 350416, 350422, 211160, 350425, 334045, 350445, 375026, 358644, 350458, 350461, 350464, 350467, 350475, 375053, 268559, 350480, 432405, 350486, 325914, 350490, 325917, 350493, 325919, 350498, 194852, 350504, 358700, 391468, 350509, 358704, 358713, 358716, 383306, 383321, 383330, 383333, 391530, 383341, 268668, 194941, 391563, 366990, 416157, 268701, 342430, 375208, 375216, 334262, 334275, 326084, 358856, 195039, 334304, 334311, 375277, 350723, 391690, 186897, 334358, 342550, 342554, 334363, 350761, 252461, 334384, 358961, 383536, 334394, 252482, 219718, 334407, 350822, 375400, 334465, 334468, 162445, 342679, 342683, 260766, 342710, 244409, 260797, 260801, 350917, 391894, 416473, 64230, 342766, 375535, 203506, 342776, 391937, 391948, 375568, 375571, 375574, 162591, 383793, 326451, 326454, 260924, 375612, 244540, 326460, 326467, 244551, 326473, 326477, 416597, 326485, 326490, 375656, 433000, 326510, 211831, 351097, 392060, 359295, 351104, 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, 343154, 384114, 212094, 351364, 384135, 384139, 384143, 351381, 384160, 384168, 367794, 384181, 367800, 351423, 326855, 244937, 253130, 343244, 146642, 359649, 343270, 351466, 351479, 343306, 261389, 359694, 384269, 253200, 384275, 245020, 245029, 171302, 351534, 245040, 425276, 212291, 384323, 343365, 212303, 367965, 343393, 343398, 367980, 425328, 343409, 253303, 154999, 343417, 327034, 245127, 384397, 245136, 343450, 245151, 245154, 245157, 245162, 327084, 359865, 384443, 146876, 327107, 384453, 327115, 359886, 359890, 343507, 368092, 343534, 343539, 368119, 343544, 368122, 409091, 359947, 359955, 359983, 343630, 179802, 155239, 327275, 245357, 138864, 155254, 155273, 368288, 425638, 425649, 155322, 425662, 155327, 155351, 155354, 212699, 155363, 155371, 245483, 409335, 155393, 155403, 155422, 360223, 155438, 155442, 155447, 417595, 360261, 155461, 376663, 155482, 261981, 425822, 376671, 155487, 155490, 155491, 327531, 261996, 376685, 261999, 262002, 327539, 425845, 147317, 262005, 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, 253926, 204784, 393203, 360438, 253943, 393206, 393212, 155646 ]
03ab7bb190fa52dce2fe0dee1214de7a449b8223
3445c08dda8e17da28b2b5b42cff0353879832e3
/CallLogManager-Using-Swift/CallLogManager-Using-Swift/MissedCall-TableViewController.swift
915ae8b97bf46e58245f2f1d33afc52538975cb8
[]
no_license
karankadu/Class-Assignments
24d093c534d492ff0938fd470a4d5dfc96829b98
5cdd464b151d25de8ce78fb4a4f54d1f119b1c7f
refs/heads/master
2021-01-12T11:04:54.521461
2016-12-02T15:53:29
2016-12-02T15:53:29
72,814,452
1
0
null
null
null
null
UTF-8
Swift
false
false
4,412
swift
// // MissedCall-TableViewController.swift // CallLogManager-Using-Swift // // Created by Karan on 26/11/16. // Copyright © 2016 Karan. All rights reserved. // import UIKit class MissedCall_TableViewController: UITableViewController { var missedCallArray=[] override func viewDidLoad() { super.viewDidLoad() let u1:userInfo=userInfo() u1.username="Steve Jobs" u1.userimage="user1_70p" u1.date="Today" u1.callimage="missedcall" u1.calltiming="10m 20s" let u2:userInfo=userInfo() u2.username="Deepika" u2.userimage="user2_70p" u2.date="Yesterday 21-11-2016" u2.callimage="missedcall" u2.calltiming="20m 45s " let u3:userInfo=userInfo() u3.username="8888888888" u3.userimage="nophoto" u3.date="Yesterday 5.15 PM" u3.callimage="missedcall" u3.calltiming="5m 10s" let u4:userInfo=userInfo() u4.username="Modi"; u4.userimage="user3_70p"; u4.date="Yesterday 10.30 AM"; u4.callimage="missedcall"; u4.calltiming="15m 30s"; missedCallArray=[u4,u1,u3,u2] tableView.registerNib(UINib(nibName: "customTableViewCell", bundle: nil), forCellReuseIdentifier: "cell") } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } // MARK: - Table view data source override func numberOfSectionsInTableView(tableView: UITableView) -> Int { // #warning Incomplete implementation, return the number of sections return 1 } override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { // #warning Incomplete implementation, return the number of rows return missedCallArray.count } override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let cell:customTableViewCell = tableView.dequeueReusableCellWithIdentifier("cell", forIndexPath: indexPath) as! customTableViewCell let user:userInfo = missedCallArray.objectAtIndex(indexPath.row) as! userInfo // Configure the cell... cell.userNameLbl.text=user.username cell.userImageView.image=UIImage (named: user.userimage) cell.dateLbl.text=user.date cell.callTimingLbl.text=user.calltiming cell.callImageView.image=UIImage (named: user.callimage) return cell } /* // Override to support conditional editing of the table view. override func tableView(tableView: UITableView, canEditRowAtIndexPath indexPath: NSIndexPath) -> Bool { // Return false if you do not want the specified item to be editable. return true } */ /* // Override to support editing the table view. override func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) { if editingStyle == .Delete { // Delete the row from the data source tableView.deleteRowsAtIndexPaths([indexPath], withRowAnimation: .Fade) } else if editingStyle == .Insert { // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view } } */ /* // Override to support rearranging the table view. override func tableView(tableView: UITableView, moveRowAtIndexPath fromIndexPath: NSIndexPath, toIndexPath: NSIndexPath) { } */ /* // Override to support conditional rearranging of the table view. override func tableView(tableView: UITableView, canMoveRowAtIndexPath indexPath: NSIndexPath) -> Bool { // Return false if you do not want the item to be re-orderable. return true } */ /* // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { // Get the new view controller using segue.destinationViewController. // Pass the selected object to the new view controller. } */ }
[ -1 ]
f3207627ac8f99e168d8126cba9c87cfbcf6fa71
cf194d1b2863be0c0dace0393cf66d2e19ec53b1
/Rectangle/Defaults.swift
d751ccbe65540c89c6bd1c037b058141d12fc3db
[ "MIT" ]
permissive
jrthsr700tmax/Rectangle
98b1985ef70219219e5c4270dc2eae1375cd0f4e
4ce8a823d8c037651ca0285e0f61c5dbde55e09f
refs/heads/master
2023-03-10T05:48:43.105588
2020-04-30T09:20:54
2020-04-30T09:20:54
260,135,039
0
0
NOASSERTION
2020-04-30T06:49:39
2020-04-30T06:49:38
null
UTF-8
Swift
false
false
4,322
swift
// // Defaults.swift // Rectangle // // Created by Ryan Hanson on 6/14/19. // Copyright © 2019 Ryan Hanson. All rights reserved. // import Foundation class Defaults { static let launchOnLogin = BoolDefault(key: "launchOnLogin") static let disabledApps = StringDefault(key: "disabledApps") static let hideMenuBarIcon = BoolDefault(key: "hideMenubarIcon") static let alternateDefaultShortcuts = BoolDefault(key: "alternateDefaultShortcuts") // switch to magnet defaults static let subsequentExecutionMode = SubsequentExecutionDefault() static let allowAnyShortcut = BoolDefault(key: "allowAnyShortcut") static let windowSnapping = OptionalBoolDefault(key: "windowSnapping") static let almostMaximizeHeight = FloatDefault(key: "almostMaximizeHeight") static let almostMaximizeWidth = FloatDefault(key: "almostMaximizeWidth") static let gapSize = FloatDefault(key: "gapSize") static let snapEdgeMarginTop = FloatDefault(key: "snapEdgeMarginTop", defaultValue: 5) static let snapEdgeMarginBottom = FloatDefault(key: "snapEdgeMarginBottom", defaultValue: 5) static let snapEdgeMarginLeft = FloatDefault(key: "snapEdgeMarginLeft", defaultValue: 5) static let snapEdgeMarginRight = FloatDefault(key: "snapEdgeMarginRight", defaultValue: 5) static let centeredDirectionalMove = OptionalBoolDefault(key: "centeredDirectionalMove") static let ignoredSnapAreas = IntDefault(key: "ignoredSnapAreas") static let traverseSingleScreen = OptionalBoolDefault(key: "traverseSingleScreen") static let minimumWindowWidth = FloatDefault(key: "minimumWindowWidth") static let minimumWindowHeight = FloatDefault(key: "minimumWindowHeight") static let sizeOffset = FloatDefault(key: "sizeOffset") static let unsnapRestore = OptionalBoolDefault(key: "unsnapRestore") } class BoolDefault { private let key: String private var initialized = false var enabled: Bool { didSet { if initialized { UserDefaults.standard.set(enabled, forKey: key) } } } init(key: String) { self.key = key enabled = UserDefaults.standard.bool(forKey: key) initialized = true } } class OptionalBoolDefault { private let key: String private var initialized = false var enabled: Bool? { didSet { if initialized { if enabled == true { UserDefaults.standard.set(1, forKey: key) } else if enabled == false { UserDefaults.standard.set(2, forKey: key) } else { UserDefaults.standard.set(0, forKey: key) } } } } init(key: String) { self.key = key let intValue = UserDefaults.standard.integer(forKey: key) switch intValue { case 1: enabled = true case 2: enabled = false default: break } initialized = true } } class StringDefault { private let key: String private var initialized = false var value: String? { didSet { if initialized { UserDefaults.standard.set(value, forKey: key) } } } init(key: String) { self.key = key value = UserDefaults.standard.string(forKey: key) initialized = true } } class FloatDefault { private let key: String private var initialized = false var value: Float { didSet { if initialized { UserDefaults.standard.set(value, forKey: key) } } } init(key: String, defaultValue: Float = 0) { self.key = key value = UserDefaults.standard.float(forKey: key) if(defaultValue != 0 && value == 0) { value = defaultValue } initialized = true } } class IntDefault { private let key: String private var initialized = false var value: Int { didSet { if initialized { UserDefaults.standard.set(value, forKey: key) } } } init(key: String) { self.key = key value = UserDefaults.standard.integer(forKey: key) initialized = true } }
[ -1 ]
80a7d73555067e428621f1a753b63f0e53fe2648
7da9d4c99c1bb5b2984fa14697ba5b23cdecfd92
/Weather/SelectLocationView.swift
219560b630156f232302d2a94f17a6a213fb8ea0
[]
no_license
konifer44/Weather_App-SwfitUI
f18ab631a36183ad04ebd3ee23cb9d95753e9ed9
d8d35bca6af1757a765d954a67ada70c960ac4e7
refs/heads/master
2023-04-29T15:51:58.582600
2021-05-14T09:38:54
2021-05-14T09:38:54
292,822,051
0
1
null
null
null
null
UTF-8
Swift
false
false
438
swift
// // SelectLocationView.swift // Weather // // Created by Jan Konieczny on 31/08/2020. // Copyright © 2020 Jan Konieczny. All rights reserved. // import SwiftUI struct SelectLocationView: View { var body: some View { Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) } } struct SelectLocationView_Previews: PreviewProvider { static var previews: some View { SelectLocationView() } }
[ -1 ]
5c74c04fa05ff7388e11e1eee171ed23d5215b8b
902940b829354cb433c0e8bc9e4c0a4bed7c8f30
/unit_tests/json-schema-inference-value-array-tests.swift
92d9d8ce62a01c870c13ec1b7d74069d3caa86c3
[ "MIT" ]
permissive
PycKamil/json2swift
786f5fbf0d5d5b03d86a7bd7edaaa61bc7f48957
be77134ad5b1780d62c241dafeec7969178c89a9
refs/heads/master
2021-01-11T20:24:34.145607
2017-04-19T11:27:43
2017-04-19T11:27:43
79,111,243
2
0
null
2017-04-19T11:27:44
2017-01-16T11:17:24
Swift
UTF-8
Swift
false
false
5,233
swift
// // json-schema-inference-value-array-tests.swift // json2swift // // Created by Joshua Smith on 10/14/16. // Copyright © 2016 iJoshSmith. All rights reserved. // import XCTest private let dummyName = "fake-element" class json_schema_inference_value_array_tests: XCTestCase { func test_array_of_integer() { let valuesArray = [ "integers-attribute": [ 1, 2, 3 ] ] let schema = JSONElementSchema.inferred(from: valuesArray, named: dummyName) if let type = schema.attributes["integers-attribute"] { let arrayOfInteger: JSONType = .valueArray(isRequired: true, valueType: .number(isRequired: true, isFloatingPoint: false)) XCTAssertEqual(type, arrayOfInteger) } else { XCTFail() } } func test_array_of_array_of_integer() { let valuesArray = [ "integer-arrays-attribute": [ [1, 2, 3], [4, 5], [6], ] ] let schema = JSONElementSchema.inferred(from: valuesArray, named: dummyName) if let type = schema.attributes["integer-arrays-attribute"] { let arrayOfArrayOfInteger: JSONType = .valueArray(isRequired: true, valueType: .valueArray(isRequired: true, valueType: .number(isRequired: true, isFloatingPoint: false))) XCTAssertEqual(type, arrayOfArrayOfInteger) } else { XCTFail() } } func test_array_of_array_of_optional_bool() { let valuesArray = [ "boolean-arrays-attribute": [ [true, false, true], [false, NSNull(), false], [false, false, true], ] ] let schema = JSONElementSchema.inferred(from: valuesArray, named: dummyName) if let type = schema.attributes["boolean-arrays-attribute"] { let arrayOfArrayOfOptionalBoolean: JSONType = .valueArray(isRequired: true, valueType: .valueArray(isRequired: true, valueType: .bool(isRequired: false))) XCTAssertEqual(type, arrayOfArrayOfOptionalBoolean) } else { XCTFail() } } func test_array_of_optional_array_of_optional_string() { let valuesArray = [ "string-arrays-attribute": [ NSNull(), ["A", "B"], ["C", "D", NSNull()], ] ] let schema = JSONElementSchema.inferred(from: valuesArray, named: dummyName) if let type = schema.attributes["string-arrays-attribute"] { let arrayOfOptionalArrayOfOptionalString: JSONType = .valueArray(isRequired: true, valueType: .valueArray(isRequired: false, valueType: .string(isRequired: false, value: "A"))) XCTAssertEqual(type, arrayOfOptionalArrayOfOptionalString) } else { XCTFail() } } func test_url_array_and_empty_array() { let jsonArray = [ [ "url-array-attribute": [ "http://fake-url.com" ] ], [ "url-array-attribute": [ // Empty array ] ] ] let schema = JSONElementSchema.inferred(from: jsonArray, named: dummyName) if let type = schema.attributes["url-array-attribute"] { let arrayOfRequiredURL: JSONType = .valueArray(isRequired: true, valueType: .url(isRequired: true)) XCTAssertEqual(type, arrayOfRequiredURL) } else { XCTFail() } } func test_mixed_array() { let jsonArray = [ "mixed-array-attribute": [ "Hello, World!", "http://fake-url.com", 42, NSNull(), 3.14, true ] ] let schema = JSONElementSchema.inferred(from: jsonArray, named: dummyName) if let type = schema.attributes["mixed-array-attribute"] { let arrayOfAnything: JSONType = .valueArray(isRequired: true, valueType: .anything) XCTAssertEqual(type, arrayOfAnything) } else { XCTFail() } } func test_mixed_array_and_empty_array() { let jsonArray = [ [ "mixed-array-attribute": [ "Hello, World!", "http://fake-url.com", 42, NSNull(), 3.14, true ] ], [ "mixed-array-attribute": [ // Empty array ] ], ] let schema = JSONElementSchema.inferred(from: jsonArray, named: dummyName) if let type = schema.attributes["mixed-array-attribute"] { let arrayOfAnything: JSONType = .valueArray(isRequired: true, valueType: .anything) XCTAssertEqual(type, arrayOfAnything) } else { XCTFail() } } }
[ -1 ]
1e411ff8a832e96f23217121cb6ab0903c25b622
ff92f4835de7016278a1604dfed8a472e8e65911
/BaiTap10/DuongNT/AutoLayout/AutoLayout/Views/Ex7/Ex7''/BaiTap73ViewController.swift
29573c8cc7cc1d5c6e615ff9ba5892fec6604731
[]
no_license
blkbrds/intern14-practice
519644148a1ca6a4d68d65afa676b67670a60389
0b826616e4a269f82489cd5efce3ad0df2f94cb6
refs/heads/master
2020-05-30T04:51:36.383715
2019-10-21T02:20:20
2019-10-21T02:20:20
189,543,257
4
0
null
2020-01-10T07:15:45
2019-05-31T06:51:31
Swift
UTF-8
Swift
false
false
320
swift
// // BaiTap73ViewController.swift // AutoLayout // // Created by Nguyen Duong on 8/6/19. // Copyright © 2019 Tien Le P. All rights reserved. // import UIKit class BaiTap73ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() self.title = "Bai Tap 7''" } }
[ -1 ]
0e8deac316ee80b3043eb2855f990065d2f3bd3e
64423ac714ece26582775e7dd0ed43c352dac048
/UtilitiesReport/Application/App/AppDelegateRouter.swift
2d9eee1c2ba83568077bcb5caf23e3fc0a2ed7d4
[]
no_license
devVadimAlbul/UtilitiesReport
a1847c648f0411165b4f5f8259e37ed7e27ab7d5
68ae35e5c19be75124d1856e62bdcba12e9bc66d
refs/heads/master
2020-04-20T22:14:47.739567
2019-09-10T08:45:45
2019-09-10T08:45:45
169,133,460
1
0
null
null
null
null
UTF-8
Swift
false
false
1,622
swift
// // AppDelegateRouter.swift // UtilitiesReport // // Created by Vadim Albul on 2/13/19. // Copyright © 2019 Vadim Albul. All rights reserved. // import Foundation import UIKit.UIWindow import UIKit.UINavigationController import Hero protocol AppDelegateRouter: AnyObject { func showFakeSpleashScreen() func goToMainViewController() func goToWelcomePage() } class AppDelegateRouterImpl: AppDelegateRouter { fileprivate weak var appDelegate: AppDelegate? init(delegate: AppDelegate) { self.appDelegate = delegate } func goToMainViewController() { let mainVC = MainViewController() mainVC.configurator = MainConfiguratorImpl() let navigation = VCLoader<UINavigationController>.loadInitial(storyboardId: .navigation) navigation.viewControllers = [mainVC] goToViewController(navigation) } func goToWelcomePage() { let welcomeVC = WelcomeViewController() welcomeVC.configurator = WelcomeConfiguratorImpl() welcomeVC.view.hero.modifiers = [.translate(y:100)] goToViewController(welcomeVC) } func showFakeSpleashScreen() { let spleash = FakeSpleashViewController() goToViewController(spleash) } fileprivate func goToViewController(_ viewController: UIViewController) { guard let window = appDelegate?.window else { return } viewController.hero.isEnabled = true UIView.transition(with: window, duration: 0.5, options: .showHideTransitionViews, animations: { window.rootViewController = viewController }, completion: { finished in // if finished { window.makeKeyAndVisible() // } }) } }
[ -1 ]
1a6941d038457c23f6c633f1e9adaa93fd7d75b6
809d2c4217cb580cd2b1650e315e32411c7f31cb
/UnitTesting/ViewController.swift
3d4925079985e2ac25e6db28c0ad11fa88e544dc
[]
no_license
gokselkoksal/Presentation-UnitTesting
4b95b05fa3d91053fcc83fad61ed95c03970fec2
4a828f289241135351eda4c8fefa67ec0e6a6a72
refs/heads/master
2020-04-13T11:01:47.233757
2018-12-26T11:05:31
2018-12-26T11:05:31
163,161,495
1
0
null
null
null
null
UTF-8
Swift
false
false
342
swift
// // ViewController.swift // UnitTesting // // Created by Göksel Köksal on 21.12.2018. // Copyright © 2018 GK. 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. } }
[ 317280, 316769, 190120, 241073, 312051, 319574, 316825, 315740 ]
9b00bbbbd0370f74cad02569794232605b7024ad
e3d27f6bc3dfdb4e2b9be2da8cacd3008a1f7c56
/SoundBoard/ViewController.swift
93af80cc7a351ad7ba89768d613d6a7ed24bfac7
[ "MIT" ]
permissive
kanadenipun/ios-udemy-SoundBoard
d26ca32dca9e87f0318166fe51e507e29d75345d
580d936b887bdf5b2f5c2af6aff1faf7e8dd378d
refs/heads/master
2021-01-02T22:37:11.616065
2017-08-06T10:54:19
2017-08-06T10:54:19
99,356,099
0
0
null
null
null
null
UTF-8
Swift
false
false
5,891
swift
// // ViewController.swift // SoundBoard // // Created by NIPUN KANADE on 04/08/17. // Copyright © 2017 ThoughtWorks. All rights reserved. // import UIKit import AVFoundation class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource { var audioRecorder : AVAudioRecorder? var audioPlayer : AVAudioPlayer? var audioFile : URL? var audioSession : AVAudioSession = AVAudioSession.sharedInstance() var sounds : [Sound] = [] @IBOutlet weak var recordButton: UIButton! @IBOutlet weak var playButton: UIButton! @IBOutlet weak var fileNameTextField: UITextField! @IBOutlet weak var saveButton: UIButton! @IBOutlet weak var tableView: UITableView! override func viewDidLoad() { super.viewDidLoad() tableView.dataSource = self tableView.delegate = self getSounds() setupRecorder() saveButton.isEnabled = false; playButton.isEnabled = false; } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell:CustomTableViewCell = tableView.dequeueReusableCell(withIdentifier: "CustomCell", for: indexPath) as! CustomTableViewCell cell.cellLabel.text = sounds[indexPath.row].name return cell } func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return sounds.count } func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { do{ if let sound = sounds[indexPath.row].audioFile as Data? { try audioPlayer = AVAudioPlayer(data: sound) audioPlayer?.play() } }catch let err as NSError{ print("Error in playing the file : " + String(describing: err)) } tableView.deselectRow(at: indexPath, animated: true) } func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) { if editingStyle == .delete{ let sound = sounds[indexPath.row] let context = (UIApplication.shared.delegate as! AppDelegate).persistentContainer.viewContext context.delete(sound) (UIApplication.shared.delegate as! AppDelegate).saveContext() getSounds() DispatchQueue.main.async { self.tableView.reloadData() } } } func getSounds(){ let context = (UIApplication.shared.delegate as! AppDelegate).persistentContainer.viewContext do { sounds = try context.fetch(Sound.fetchRequest()) as! [Sound] }catch let err as NSError{ print("Unable to fetch from core data : " + String(describing: err)) } } func setupRecorder(){ do{ try audioSession.setCategory(AVAudioSessionCategoryPlayAndRecord) try audioSession.overrideOutputAudioPort(.speaker) try audioSession.setActive(true) } catch let err as NSError{ print("Error occured in audio session " + String(describing: err)) } let basePath : String = NSSearchPathForDirectoriesInDomains( .documentDirectory, .userDomainMask, true).first! let pathComponents = [basePath, "recording.m4a"] audioFile = NSURL.fileURL(withPathComponents: pathComponents) let settings = [ AVFormatIDKey: Int(kAudioFormatMPEG4AAC), AVSampleRateKey: 12000, AVNumberOfChannelsKey: 1, AVEncoderAudioQualityKey: AVAudioQuality.high.rawValue ] do { try audioRecorder = AVAudioRecorder(url: audioFile!, settings: settings) audioRecorder!.prepareToRecord() } catch let err as NSError{ print("Error occured in audio recorder " + String(describing: err)) } } @IBAction func recordButtonTapped(_ sender: Any, forEvent event: UIEvent) { print("record button tapped") if(audioRecorder!.isRecording){ recordButton.setTitle("Record", for: .normal) audioRecorder?.stop() print("Recording stopped") playButton.isEnabled = true; saveButton.isEnabled = true; }else{ recordButton.setTitle("Stop", for: .normal) audioRecorder?.record() print("Recording Started") playButton.isEnabled = false; saveButton.isEnabled = false; } } @IBAction func playButtonTapped(_ sender: Any) { do{ try audioPlayer = AVAudioPlayer(contentsOf: audioFile!) audioPlayer!.play() }catch let err as NSError{ print("Error in playing the file : " + String(describing: err)) } } @IBAction func saveButtonTapped(_ sender: Any) { print("Save tapped") saveButton.isEnabled = false playButton.isEnabled = false let context = (UIApplication.shared.delegate as! AppDelegate).persistentContainer.viewContext let sound = Sound(context: context) sound.name = fileNameTextField.text ?? "No Name" sound.audioFile = NSData(contentsOf: audioFile!) (UIApplication.shared.delegate as! AppDelegate).saveContext() getSounds() fileNameTextField.text?.removeAll() DispatchQueue.main.async { self.tableView.reloadData() } } }
[ -1 ]
1b844faec689147437e82ea7f33d846a8b7ee43b
c08fba6dec1105fff4bab30677225eceb27385cd
/csci571-news-app/csci571-news-app/Views/NewsCard.swift
57475f82b3578daf90f8ab53e65583c1fc7cfaa5
[ "MIT" ]
permissive
SinestroEdmonce/iOS-News_App
c3ec8a8d82894723599cba487247edfbcac5a1aa
ca157a23821ef60ea60c12ea4cd862006fcdf584
refs/heads/master
2022-12-04T21:29:45.679494
2020-08-22T23:07:11
2020-08-22T23:07:11
287,804,709
4
0
null
null
null
null
UTF-8
Swift
false
false
2,843
swift
// // NewsCard.swift // csci571-news-app // // Created by sinestro on 2020/4/20. // Copyright © 2020 us.usc. All rights reserved. // import UIKit class NewsCard: UICollectionViewCell { // MARK: - Views layout @IBOutlet weak var newsImageView: UIImageView! @IBOutlet weak var newsTitleLabel: UILabel! @IBOutlet weak var newsDateLabel: UILabel! @IBOutlet weak var newsSectionLabel: UILabel! // MARK: - Data persistence tool private let dataPeTool: DataPersistence = DataPersistence() // MARK: - New data private var articleId: String? // MARK: - Notification private let refreshNotification: Notification.Name = Notification.Name(rawValue: "refresh") @IBAction func clickFavButton(_ sender: Any) { // Set article unfavourite self.dataPeTool.removeArticle(named: self.articleId) // Post notification NotificationCenter.default.post(name: self.refreshNotification, object: nil, userInfo: ["bookmarked": false]) } // MARK: - Setup color constant private let background = UIColor(red: 235/255.0, green: 235/255.0, blue: 235/255.0, alpha: 1.0).cgColor private let border = UIColor(red: 195/255.0, green: 195/255.0, blue: 195/255.0, alpha: 1.0).cgColor // MARK: - View control function override func awakeFromNib() { super.awakeFromNib() // Initialization code } override func layoutSubviews() { super.layoutSubviews() // Set border style self.contentView.layer.borderWidth = 1 self.contentView.layer.backgroundColor = self.background self.contentView.layer.borderColor = self.border self.contentView.layer.cornerRadius = 10 // Set image border self.newsImageView.layer.cornerRadius = 10 self.newsImageView.layer.masksToBounds = true self.newsImageView.clipsToBounds = true } // MARK: - Load data func load(from data: Article?) { if let article = data { let imageURL = article.thumbnail if imageURL == "guardian-default-image" { self.newsImageView.image = UIImage(named: "default-guardian") } else { self.newsImageView.sd_setImage(with: URL(string: imageURL), placeholderImage: UIImage(named: "default-guardian")) } self.newsTitleLabel.text = article.title self.newsDateLabel.text = Array(article.publicationDate.components(separatedBy: " ")[0..<2]).joined(separator: " ") self.newsSectionLabel.text = article.sectionId // Store the article id self.articleId = article.articleId } } }
[ -1 ]
bc8e55c51003346bc136284349acb5ead5278acf
ce516098285713490fb17462183fcca0f0b00e43
/AuenCloud/Auth/Login/ViewModel/LoginViewModel.swift
59a05f21006dfe13179ba9d3e475457f413a29df
[]
no_license
yourbaur/auenCloud-iOS
b203e4b364a5d6cd11642d8d164f91b23d5fd534
238883bf30d23984e5c2247cb1554f7fe67302c0
refs/heads/main
2023-08-04T18:34:22.735854
2021-02-05T11:44:24
2021-02-05T11:44:24
335,370,237
0
0
null
null
null
null
UTF-8
Swift
false
false
100
swift
// // LoginViewModel.swift // AuenCloud // // Created by Admin on 12/4/20. // import Foundation
[ -1 ]
5a7753e8562f3301c150b19df12c2c6ea22602ef
c34458b059e012521552415e70c69c2496a2e2ad
/AC-Tech-TakeHomeProject/Views/LoginTextField.swift
a34793f7be39f5996f84b55c9eba6da051fc923c
[]
no_license
en-asitalov/ACTechTakeHomeProject
7cf930f75af26083b1885623ee8fff6004b62255
c8e52a72f233061f5941e506951df92fb693b891
refs/heads/master
2020-07-27T23:38:37.047625
2019-09-18T12:38:06
2019-09-18T12:38:06
209,245,507
0
0
null
null
null
null
UTF-8
Swift
false
false
1,796
swift
// // LoginTextField.swift // AC-Tech-TakeHomeProject // // Created by Alexei Sitalov on 9/14/19. // Copyright © 2019 Alexei Sitalov. All rights reserved. // import UIKit private struct Constants { static let cornerRadius: CGFloat = 25.0 static let indentViewSide = 20 static let placeholderFontSize: CGFloat = 18 } class LoginTextField: UITextField { override init(frame: CGRect) { super.init(frame: frame) setUpField() } required init?(coder aDecoder: NSCoder) { super.init( coder: aDecoder ) setUpField() } private func setUpField() { textColor = .darkGray font = UIFont(name: "AvenirNextCondensed-DemiBold", size: Constants.placeholderFontSize) backgroundColor = UIColor(white: 1.0, alpha: 0.5) autocorrectionType = .no layer.cornerRadius = Constants.cornerRadius clipsToBounds = true let placeholder = self.placeholder != nil ? self.placeholder! : "" let placeholderFont = UIFont(name: "AvenirNextCondensed-DemiBold", size: Constants.placeholderFontSize)! attributedPlaceholder = NSAttributedString(string: placeholder, attributes: [NSAttributedString.Key.foregroundColor: UIColor.lightGray, NSAttributedString.Key.font: placeholderFont]) let indentView = UIView(frame: CGRect(x: 0, y: 0, width: Constants.indentViewSide, height: Constants.indentViewSide)) leftView = indentView leftViewMode = .always } }
[ -1 ]
346e01998696ffc555da62b6864acabd2371a969
764b05f9596fbd860a49cf19ce4042db75dcf416
/HttpRquest-POP/HttpRquest-POP/Request/HTTPRequest+Load.swift
98f10a67f506b182266b75f6a4b4311946085402
[]
no_license
Zafirzzf/Swift-POP-effective
f36dcea2cd1d1c5443c0f170d41aeeb6992b1591
eee1426c4748d713e5d5ad81d2cf15306489f457
refs/heads/master
2021-06-14T15:40:53.972752
2021-03-01T07:00:33
2021-03-01T07:00:33
148,592,186
1
0
null
null
null
null
UTF-8
Swift
false
false
1,975
swift
// // HTTPRequest+Load.swift // HttpRquest-POP // // Created by 周正飞 on 2018/10/11. // Copyright © 2018年 MIX. All rights reserved. // import Foundation import Alamofire /// 扩展发起请求与回调的方式- 闭包/Observable/Promise extension Request { /// Common load function func load(handler: @escaping (NetResult<ExpectedType>) -> Void) { let path = RequestConfig.host + self.path.rawValue Alamofire.request(path, method: method == .get ? .get : .post, parameters: parameter, headers: headers).responseJSON { (response) in let result = response.result if let _ = result.error { handler(NetResult(value: nil, error: .serviceLost)) return } guard let resultDict = result.value as? [String: Any] else { handler(NetResult(value: nil, error: .rootDataNotDict)) return } guard let targetData = self.parse(resultDict) else { handler(NetResult(value: nil, error: .jsonToModelFailure)) return } /// You can add more error handling based on response handler(NetResult(value: targetData, error: nil)) } } /// 返回Observable序列 // func fetch() -> Observable<ExpectedType> { // return Single<ExpectedType>.create { single in // RequestManager.manager.request(self.pathStr, method: self.method, parameters: self.parameter, encoding: self.encoding, headers: self.headers).responseJSON(completionHandler: { (response) in // let myResult = self.handleResponse(result: response.result) // if let error = myResult.error { // single(.error(error)) // } else { // single(.success(myResult.value!)) // } // }) // return Disposables.create() // }.asObservable() // } }
[ -1 ]
da5b7b56adbb9b042c1e62d611ed29fb2bbc4f1b
d434a23f313dfa0bd9e5adc4443b0b297e38252f
/MyPlayground.playground/Pages/JFFunction.xcplaygroundpage/Contents.swift
b8c2d1e662ec2186233a6ce5ebd7a327da099803
[]
no_license
louwailou/Swift_JF
8b21b8297e0d9eac1baeb3f20178cadf9f81bc93
e56c8184efce99b6d654d122c9b788707b75e2c3
refs/heads/master
2020-04-12T03:54:45.124181
2016-10-18T05:02:10
2016-10-18T05:02:10
63,473,095
0
0
null
null
null
null
UTF-8
Swift
false
false
4,531
swift
//: [Previous](@previous) import Foundation /*******************实例方法是(currying)柯里化函数***************************/ class MyHelloWorldClass: NSObject { func helloworldName(name:String) -> String{ return "hello \(name)"; } func externalFuncName(name:String) -> Void { print("使用外部引用名"); } } let myHelloInstance = MyHelloWorldClass(); let helloFunc = MyHelloWorldClass.helloworldName; helloFunc(myHelloInstance)("sunjianfeng"); /****************optional ********************/ func myFuncWithOptionalType(optionalParameter: String?) { if let unwrappedOptional = optionalParameter { print("The optional has a value! It's \(unwrappedOptional)") } else { print("The optional is nil!") } } myFuncWithOptionalType("someString") // optional has a value! It's someString /** 可变参数 */ func helloWithNames(names: String...) { for name in names { print("Hello, \(name)"); } } // 2 names helloWithNames("Mr. Robot", "Mr. Potato") // Hello, Mr. Robot // Hello, Mr. Potato // 4 names helloWithNames("Batman", "Superman", "Wonder Woman", "Catwoman") // Hello, Batman // Hello, Superman // Hello, Wonder Woman // Hello, Catwoman /***************输入输出参数inout****************/ var name1 = "Mr. Potato" var name2 = "Mr. Roboto" func nameSwap(inout name1: String, inout name2: String) { let oldName1 = name1 name1 = name2 name2 = oldName1 } nameSwap(&name1, name2: &name2) name1 // Mr. Roboto name2 // Mr. Potato /***************使用泛型********************/ func valueSwap<T>(inout value1:T, inout value2:T) -> Void { let old = value1; value1 = value2; value2 = old; } var nameSwap1 = "MR.robot"; var nameSwap2 = "MR.Sun"; valueSwap(&nameSwap1, value2: &nameSwap2); print("1 \(nameSwap1) 2: \(nameSwap2)"); /*****************在函数范围内修改变量*************************/ var Cname = "MR.robot"; func appendNumber(var name:String,maxNumber:Int) ->String { for i in 0...maxNumber { name += String(i+1); } return name; } appendNumber(Cname, maxNumber: 5); //并没有改变Cname 的值 不会修改外部变量的值,只会在函数作用于内修改 print("cname = \(Cname)"); /*******************权限控制************************/ /**************多个可选值******************/ func findRangeFromNumbers(numbers: Int...) -> (min: Int, max: Int)? { if numbers.count > 0 { var min = numbers[0] var max = numbers[0] for number in numbers { if number > max { max = number } if number < min { min = number } } return (min, max) } else { return nil } } if let range = findRangeFromNumbers() { print("Max: \(range.max). Min: \(range.min)") } else { print("No numbers!") } // //如果你决定你元组值中一些值是可选,拆包时候会变得有些复杂,你需要考虑每中单独的可选返回值的组合 func componentsFromUrlString(urlString: String) -> (host: String?, path: String?) { let url = NSURL(string: urlString)! return (url.host, url.path) } let urlComponents = componentsFromUrlString("http://name.com/12345;param?foo=1&baa=2#fragment") switch (urlComponents.host, urlComponents.path) { case let (.Some(host), .Some(path)): print("This url consists of host \(host) and path \(path)") case let (.Some(host), .None): print("This url only has a host \(host)") case let (.None, .Some(path)): print("This url only has path \(path). Make sure to add a host!") case (.None, .None): print("This is not a url!") } // This url consists of host name.com and path /12345 /***********************返回一个函数 Swift 中函数可以返回一个函数: func myFuncThatReturnsAFunc() -> (Int) -> String { return { number in return "The lucky number is \(number)" } } let returnedFunction = myFuncThatReturnsAFunc() returnedFunction(5) */ // The lucky number is 5 //为了更具有可读性,你当然可以为你的返回函数定义一个别名: typealias returnedFunctionType = (Int) -> String func myFuncThatReturnsAFunc() -> returnedFunctionType { return { number in return "The lucky number is \(number)" } } let returnedFunction = myFuncThatReturnsAFunc() returnedFunction(5) // The lucky number is 5
[ -1 ]
9cb0a7046dd656421113862d229e61a0cfe55a33
bd9ba6f2c84c02350420ac3d91ba5ac82bfb271e
/RealmSimpleDemo/SecondViewController.swift
755e7d57f7778b2c5ec8102f56478f5dc49d3dcf
[]
no_license
perwyl/RealmDemo
aeb2ee83054f23356f09739291d2373bcbabcb0c
981573a6d861b49cff41f27fb9beba3d1179a8c4
refs/heads/master
2021-01-23T16:06:23.403474
2017-09-08T07:43:01
2017-09-08T07:43:01
102,723,815
0
0
null
null
null
null
UTF-8
Swift
false
false
1,485
swift
// // SecondViewController.swift // RealmSimpleDemo // // Created by Liu Jinyu on 07.09.17. // Copyright © 2017 Liu Jinyu. All rights reserved. // import UIKit class SecondViewController: UIViewController { lazy var viewModel: FirstViewModel = { return FirstViewModel() }() override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. updateUI() } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) updateUI() } func updateUI() { if let results = viewModel.getColor() { view.backgroundColor = UIColor(red: results.red, green: results.green, blue: results.blue) } } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } } extension SecondViewController: UITableViewDataSource { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return 0 } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { return UITableViewCell() } func numberOfSections(in tableView: UITableView) -> Int { return 1 } } extension SecondViewController: UITableViewDelegate { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { } }
[ -1 ]
75ded3e80083865878a2aa87c38fc6b2d034bcee
22e517cb003391b9c4b762582d6b36d4dc309fed
/SpringRadio/Models/FloatTextViewModel.swift
8cf418548e169a774b11146d1226e99bab9d72d7
[ "Apache-2.0" ]
permissive
749809542/SpringRadio
27e549ebdec2c0da95a63b2d729e46e4b82ee2de
538e7dbb3967c046f7b7967e6fdee5d164a21489
refs/heads/master
2022-04-24T20:40:33.983477
2020-04-22T06:22:46
2020-04-22T06:22:46
null
0
0
null
null
null
null
UTF-8
Swift
false
false
5,174
swift
// // FloatTextViewModel.swift // SpringRadio // // Created by jack on 2020/4/8. // Copyright © 2020 jack. All rights reserved. // import Foundation import Combine import SwiftUI enum FloatTextOrientation: Int { case vertical = 0, horizontal } let floatAnimationDuration = 10.0 var screenWidth = UIApplication.shared.windows[0].bounds.width var screenHeight = UIApplication.shared.windows[0].bounds.height class FloatTextViewModel: ObservableObject { let objectWillChange = ObservableObjectPublisher() let timer = Timer.publish(every: floatAnimationDuration, on: .main, in: .common).autoconnect() let animation = Animation.linear(duration: floatAnimationDuration) var orientation : FloatTextOrientation = .horizontal { willSet { objectWillChange.send() } } private var _titleWidth :CGFloat = 300 var titleWidth: CGFloat { set { if _titleWidth != newValue { _titleWidth = newValue print("titleWidth:\(_titleWidth)") } } get { return _titleWidth } } private var _streamTitleWidth : CGFloat = -300 var streamTitleWidth : CGFloat { set { if _streamTitleWidth != newValue { _streamTitleWidth = newValue print("streamTitleWidth:\(_streamTitleWidth)") self.changeOrientation(orientation: self.orientation) } } get { return _streamTitleWidth } } var titleX: CGFloat = screenWidth { willSet { objectWillChange.send() } } var titleY: CGFloat = 0.0 { willSet { objectWillChange.send() } } var streamTitleX: CGFloat = 0.0 { willSet { objectWillChange.send() } } var streamTitleY: CGFloat = 0.0 { willSet { objectWillChange.send() } } func startAnimation() { self.changeOrientation(orientation: FloatTextOrientation(rawValue: Int.random(in: 0...1)) ?? .horizontal) } func changeOrientation(orientation:FloatTextOrientation) { if self.orientation != orientation { self.orientation = orientation switch orientation { case .horizontal: let distanceTitleX = screenWidth + self.titleWidth let distanceStreamTitleX = screenWidth + self.streamTitleWidth self.titleX = -distanceTitleX self.streamTitleX = distanceStreamTitleX case .vertical: let distanceTitleX = screenHeight + self.titleWidth let distanceStreamTitleX = screenHeight + self.streamTitleWidth self.titleX = -distanceTitleX self.streamTitleX = distanceStreamTitleX } } switch orientation { case .horizontal: self.titleY = CGFloat(Float.random(in: -240.0...240.0)) self.streamTitleY = CGFloat(Float.random(in: -240.0...240.0)) let distanceTitleX = screenWidth + self.titleWidth let distanceStreamTitleX = screenWidth + self.streamTitleWidth withAnimation(Animation.linear(duration: floatAnimationDuration)) { print("old title x:\(self.titleX)") if self.titleX != -distanceTitleX { self.titleX = -distanceTitleX } else { self.titleX = distanceTitleX } if self.streamTitleX != distanceStreamTitleX { self.streamTitleX = distanceStreamTitleX } else { self.streamTitleX = -distanceStreamTitleX } print("new title x:\(self.titleX)") } break case .vertical: self.titleY = CGFloat(Float.random(in: -50.0...50.0)) self.streamTitleY = CGFloat(Float.random(in: -50.0...50.0)) let distanceTitleX = screenHeight + self.titleWidth let distanceStreamTitleX = screenHeight + self.streamTitleWidth withAnimation(Animation.linear(duration: floatAnimationDuration)) { print("old title x:\(self.titleX)") if self.titleX != -distanceTitleX { self.titleX = -distanceTitleX } else { self.titleX = distanceTitleX } if self.streamTitleX != distanceStreamTitleX { self.streamTitleX = distanceStreamTitleX } else { self.streamTitleX = -distanceStreamTitleX } print("new title x:\(self.titleX)") } break } } deinit { } }
[ -1 ]
6dc01d9768efcb07829b5ec92bd42daf57161a6e
f41fe9fd49d31861d79e04b10692eeb5ca157496
/Fraværsføring EO/SplashViewController.swift
ce1ec7088d6a767e79ddd49bc37a9f04d6374e81
[]
no_license
emmernme/Fravaersforing-EO
83a54ac51e991ff6edc3e4ed9838e26efc1f2931
206366eacfa3521ee09e1016cf1b6fbc90273d61
refs/heads/master
2022-07-19T18:23:38.079946
2020-05-27T17:35:35
2020-05-27T17:35:35
267,385,387
0
0
null
null
null
null
UTF-8
Swift
false
false
5,291
swift
// // SplashViewController.swift // Fraværsføring // // Created by Emil Broll on 28/12/14. // Copyright (c) 2014 Emil Broll. All rights reserved. // import UIKit import QuartzCore class SplashViewController : UIViewController { @IBOutlet var bilde: UIImageView! @IBOutlet var veilederButton: UIButton! @IBOutlet var veilederIcon: UIButton! @IBOutlet var skjemaButton: UIButton! @IBOutlet var skjemaIcon: UIButton! @IBAction func veilederPressed(sender: AnyObject) { let colorAnimation = CABasicAnimation(keyPath: "borderColor") colorAnimation.toValue = UIColor.whiteColor().colorWithAlphaComponent(0.1).CGColor colorAnimation.removedOnCompletion = false colorAnimation.fillMode = kCAFillModeForwards colorAnimation.speed = 100 colorAnimation.duration = 0 veilederIcon.layer.addAnimation(colorAnimation, forKey: nil) veilederButton.highlighted = true veilederIcon.highlighted = true } @IBAction func veilederCancelled(sender: AnyObject) { let colorAnimation = CABasicAnimation(keyPath: "borderColor") colorAnimation.toValue = UIColor.whiteColor().CGColor colorAnimation.removedOnCompletion = false colorAnimation.fillMode = kCAFillModeForwards colorAnimation.duration = 0.175 veilederIcon.layer.addAnimation(colorAnimation, forKey: nil) veilederButton.highlighted = false veilederIcon.highlighted = false } @IBAction func pressVeileder(sender: AnyObject) { let colorAnimation = CABasicAnimation(keyPath: "borderColor") colorAnimation.toValue = UIColor.whiteColor().CGColor colorAnimation.removedOnCompletion = false colorAnimation.fillMode = kCAFillModeForwards colorAnimation.duration = 0.175 veilederIcon.layer.addAnimation(colorAnimation, forKey: nil) veilederButton.highlighted = false veilederIcon.highlighted = false if (sender as? UIButton != veilederButton){ self.performSegueWithIdentifier("visVeileder", sender: nil) } } @IBAction func skjemaPressed(sender: AnyObject) { let colorAnimation = CABasicAnimation(keyPath: "borderColor") colorAnimation.toValue = UIColor.whiteColor().colorWithAlphaComponent(0.1).CGColor colorAnimation.removedOnCompletion = false colorAnimation.fillMode = kCAFillModeForwards colorAnimation.duration = 0 colorAnimation.speed = 100 skjemaIcon.layer.addAnimation(colorAnimation, forKey: nil) skjemaButton.highlighted = true skjemaIcon.highlighted = true } @IBAction func skjemaCancelled(sender: AnyObject) { let colorAnimation = CABasicAnimation(keyPath: "borderColor") colorAnimation.toValue = UIColor.whiteColor().CGColor colorAnimation.removedOnCompletion = false colorAnimation.fillMode = kCAFillModeForwards colorAnimation.duration = 0.175 skjemaIcon.layer.addAnimation(colorAnimation, forKey: nil) skjemaButton.highlighted = false skjemaIcon.highlighted = false } @IBAction func pressSkjema(sender: AnyObject) { let colorAnimation = CABasicAnimation(keyPath: "borderColor") colorAnimation.toValue = UIColor.whiteColor().CGColor colorAnimation.removedOnCompletion = false colorAnimation.fillMode = kCAFillModeForwards colorAnimation.duration = 0.175 skjemaIcon.layer.addAnimation(colorAnimation, forKey: nil) skjemaButton.highlighted = false skjemaIcon.highlighted = false if (sender as? UIButton != skjemaButton){ self.performSegueWithIdentifier("visRoot", sender: nil) } } override func viewDidLoad() { veilederIcon.layer.borderWidth = 1.8 veilederIcon.layer.borderColor = UIColor.whiteColor().CGColor veilederIcon.layer.cornerRadius = veilederIcon.frame.size.height / 2 skjemaIcon.layer.borderWidth = 2.0 skjemaIcon.layer.borderColor = UIColor.whiteColor().CGColor skjemaIcon.layer.cornerRadius = skjemaIcon.frame.size.height / 2 navigationController?.setNavigationBarHidden(true, animated:false) self.title = "" if (!NSUserDefaults.standardUserDefaults().boolForKey("terms")){ self.performSegueWithIdentifier("visVeileder", sender: nil) } } @IBAction func hey(sender: AnyObject) { print("Hey") } override func viewWillAppear(animated: Bool) { self.navigationController?.setNavigationBarHidden(true, animated:true) } override func prefersStatusBarHidden() -> Bool { return true } @IBAction func openSafari(sender: AnyObject) { UIApplication.sharedApplication().openURL(NSURL(string: "http://elev.no/Hva-er-EO")!) } override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { print(segue.identifier) if (segue.identifier == "visVeileder"){ } if segue.identifier == "showDetail" { print(segue) let a = segue.sourceViewController as! MasterViewController if let indexPath = a.tableView.indexPathForSelectedRow { let cell = sender as! UITableViewCell var tag = cell.tag.description (segue.destinationViewController as! DetailViewController).detailItem = tag print(cell.tag.description) (segue.destinationViewController as! DetailViewController).title = cell.textLabel?.text } } if segue.identifier == "showShare" { print(segue) let a = segue.sourceViewController as! MasterViewController let destination = (segue.destinationViewController as! ShareViewController) //destination.currentWeek = a.weeks!.objectForKey(a.weekRows!.objectAtIndex(0)) as String } } }
[ -1 ]
43def1a6898b6e9b2d7f6ff61996046dc683190f
8819d967ecef435e128d87f398d6f2b60519164e
/Revert/Sources/DualRowBasicCollectionViewFlowLayout.swift
b2eca8b4a01ba19b0d291a771a5b970043e8016d
[ "BSD-3-Clause" ]
permissive
revealapp/Revert
39d7ba7cb42901b0aea629a19404cb4a614dd5dd
d5bec7a3e04ba8d1be4d34fabf3f9197947f9555
refs/heads/master
2023-07-07T20:14:16.857232
2020-11-09T05:18:27
2020-11-09T05:18:27
46,452,831
413
40
BSD-3-Clause
2022-05-03T03:44:55
2015-11-18T22:53:08
Swift
UTF-8
Swift
false
false
962
swift
// // Copyright © 2015 Itty Bitty Apps. All rights reserved. import UIKit final class DualRowBasicCollectionViewFlowLayout: UICollectionViewFlowLayout { override func prepare() { super.prepare() self.itemSize = self.computedItemSize } override func shouldInvalidateLayout(forBoundsChange newBounds: CGRect) -> Bool { return newBounds.size != self.collectionView?.bounds.size } // MARK: Private private static let noOfItemsInRow = 2 private var availableWidth: CGFloat { guard let collectionView = self.collectionView else { return 0 } return collectionView.bounds.width - self.sectionInset.left - self.sectionInset.right } private var computedItemSize: CGSize { let itemWidth = floor((self.availableWidth - self.minimumInteritemSpacing * (CGFloat(type(of: self).noOfItemsInRow) - 1)) / CGFloat(type(of: self).noOfItemsInRow)) return CGSize(width: itemWidth, height: self.itemSize.height) } }
[ -1 ]
c0c07ece5b80dabf6068b8e85a0de9b01e45dbed
29d1b556f7eae5e57138b24760373f2552b8ec45
/DailyEnglish/Classes/Service/AlipayService.swift
ad0ebfff97d7ae92af332b306cfb1eb8a5da80dd
[]
no_license
qiulingnan/DailyEnglish
cc6d1ab2ee9a99b88d8849dd073b299ac0fdf80e
04c6b2b6d7977353d699fd7159a1c34919752eed
refs/heads/master
2020-04-03T09:24:12.978222
2018-12-14T18:46:22
2018-12-14T18:46:22
155,159,625
0
0
null
null
null
null
UTF-8
Swift
false
false
605
swift
// // AlipayService.swift // ManPlaying // // Created by 邱岭男 on 16/5/21. // Copyright © 2016年 邱岭男. All rights reserved. // import UIKit typealias PayCallBack = (_ dict:NSDictionary)->Void class AlipayService: NSObject { static let alipayService:AlipayService = AlipayService() var callBack:PayCallBack! class func sharedService() ->AlipayService { return alipayService } override init() { } func call(dict:NSDictionary){ if(callBack != nil){ callBack(dict) } } }
[ -1 ]
07d26a5cec60a23a074842b835a025dd16da22ff
8a121eabaa478f81efbe78e644a99baf2212cb9a
/Pitch Perfect/Pitch Perfect/PlaySoundsViewController.swift
35a6f4b9ca20979d3db3071d216d7c1014f9d473
[]
no_license
vr3416/pitch-perfect_3
cf4c3c1723ea26997cff1dedcfbc2dc1a52a00a1
10f3e25382e6f67d2fbdc266c754257a48ca9ea6
refs/heads/master
2021-01-10T22:07:18.411500
2015-04-08T13:03:57
2015-04-08T13:03:57
33,607,284
0
0
null
null
null
null
UTF-8
Swift
false
false
2,845
swift
// // PlaySoundsViewController.swift // Pitch Perfect // // Created by Venus Rita on 3/20/15. // Copyright (c) 2015 Venus Rita. All rights reserved. // import UIKit import AVFoundation class PlaySoundsViewController: UIViewController { var audioPlayer:AVAudioPlayer! var receivedAudio:RecordedAudio! var audioEngine:AVAudioEngine! var audioFile:AVAudioFile! override func viewDidLoad() { super.viewDidLoad() audioPlayer = AVAudioPlayer(contentsOfURL: receivedAudio.filePathUrl, error: nil) audioPlayer.enableRate = true audioEngine = AVAudioEngine() audioFile = AVAudioFile(forReading: receivedAudio.filePathUrl, error: nil) } @IBAction func playSlowAudio(sender: UIButton) { //Play audio sloooowly here.... audioPlayer.stop() audioPlayer.rate = 0.5 audioPlayer.currentTime = 0.0 audioEngine.stop() audioEngine.reset() audioPlayer.play() } @IBAction func playFastAudio(sender: UIButton) { //Play audio fast here.... audioPlayer.stop() audioPlayer.rate = 2.0 audioPlayer.currentTime = 0.0 audioEngine.stop() audioEngine.reset() audioPlayer.play() } @IBAction func playChipmunkAudio(sender: UIButton) { playAudioWithVariablePitch(1000) } func playAudioWithVariablePitch(pitch: Float){ audioPlayer.stop() audioEngine.stop() audioEngine.reset() var audioPlayerNode = AVAudioPlayerNode() audioEngine.attachNode(audioPlayerNode) var changePitchEffect = AVAudioUnitTimePitch() changePitchEffect.pitch = pitch audioEngine.attachNode(changePitchEffect) audioEngine.connect(audioPlayerNode, to: changePitchEffect, format: nil) audioEngine.connect(changePitchEffect, to: audioEngine.outputNode, format: nil) audioPlayerNode.scheduleFile(audioFile, atTime: nil, completionHandler: nil) audioEngine.startAndReturnError(nil) audioPlayerNode.play() } @IBAction func playDarthvaderAudio(sender: UIButton) { playAudioWithVariablePitch(-1000) } @IBAction func audioStop(sender: UIButton) { //Stop playing audio audioPlayer.stop() audioEngine.stop() audioEngine.reset() } /* // 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. } */ }
[ 277199 ]
2ff6ede682accae610899db192aee7d3124babfd
255be395955435158a498bbc6dd962eb8fd2565f
/PhotosInfiniteScrolling/Application Layer/AppCoordinator.swift
81f1bc4d8d75ad1cd6931d85b0b262a28a297e2c
[]
no_license
CharlieNguyen94/PhotosInfiniteScrolling
14276498c8637dcb960e507c41b450e5052470ef
ff463580aa4d60f56e087a03bb7af9de8e240a59
refs/heads/main
2023-06-13T05:27:11.919805
2021-07-07T11:06:20
2021-07-07T11:06:20
380,192,270
0
0
null
null
null
null
UTF-8
Swift
false
false
720
swift
// // AppCoordinator.swift // PhotosInfiniteScrolling // // Created by Charlie Nguyen on 25/06/2021. // import UIKit class AppCoordinator: Coordinator { let window: UIWindow init(window: UIWindow) { self.window = window } func start() { let navigationController = UINavigationController() if #available(iOS 13.0, *) { navigationController.overrideUserInterfaceStyle = .light } window.rootViewController = navigationController window.makeKeyAndVisible() let photosCoordinator = PhotosCoordinatorImplementation(navigationController: navigationController) coordinate(to: photosCoordinator) } }
[ -1 ]
1d657e0c9be8e60ac7ffcbcec475c42f0b0a50fa
464953677d4fa973b76161440bbc3de60ef40c40
/Trular/Utilities/TQExtensions/TQExtentions.swift
d936b1df15cd6f0e87798c37bd0304553fc39a67
[]
no_license
jitendrahome1/TRularDenoV3
61b6771e9df042d405f8fea8120158710b5a8ce1
9e8b16241ec9aa489e5e80bdbb4b7e3c1deda0ac
refs/heads/master
2021-01-19T14:48:53.646891
2017-08-21T07:20:16
2017-08-21T07:20:16
100,923,983
0
0
null
null
null
null
UTF-8
Swift
false
false
22,394
swift
// // Extentions.swift // Trular // // Created by Shivapurapu Mahendra on 30/05/17. // Copyright © 2017 Indus Net Technologies. All rights reserved. // import Foundation import UIKit import WebKit import Charts //MARK:- Subclasses //MARK:- TQButton class TQButton: UIButton { override init(frame: CGRect) { super.init(frame: frame) self.isExclusiveTouch = true } required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) self.isExclusiveTouch = true } override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? { let errorMargin :CGFloat = 30.0 let largerFrame :CGRect? if self.tag == 1001 { largerFrame = CGRect(x: 0 - errorMargin, y: 0 - errorMargin, width: self.frame.width + (errorMargin * 1.5), height: self.frame.height + (errorMargin * 2.0)) } else if self.tag == 1002 { largerFrame = CGRect(x: 0 - errorMargin, y: 0 - errorMargin, width: self.frame.width + (errorMargin * 1.5), height: self.frame.height + (errorMargin * 2.0)) } else if self.tag == 101 { largerFrame = CGRect(x: 0 - errorMargin / 2, y: 0 - errorMargin, width: self.frame.width + (errorMargin * 0.5), height: self.frame.height + (errorMargin * 2.0)) } else if self.tag == 102 { largerFrame = CGRect(x: 0 - errorMargin / 2, y: 0 - errorMargin, width: self.frame.width + (errorMargin * 0.5), height: self.frame.height + (errorMargin * 2.0)) } else { return self } return (largerFrame!.contains(point) == true) ? self : nil; } } class TQSwitchButton: UIButton { override init(frame: CGRect) { super.init(frame: frame) self.setImage(#imageLiteral(resourceName: "green_switch"), for: .selected) self.setImage(#imageLiteral(resourceName: "switchOff"), for: .normal) } required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) } override var isSelected: Bool { willSet { print("changing from \(isSelected) to \(newValue)") } didSet { print("changed from \(oldValue) to \(isSelected)") self.isSelected = !isSelected } } } //MARK:- Extensions //MARK: Label //MARK:- Array extension Array where Element: Comparable { mutating func removeObject(_ object: Element) { if let index = self.index(of: object) { self.remove(at: index) } } mutating func removeObjects(_ objectArray: [Element]) { for object in objectArray { self.removeObject(object) } } } extension Array { func containsObject(_ type: AnyClass) -> (isPresent: Bool, index: Int?) { for (index, item) in self.enumerated() { if (item as AnyObject).isKind(of: type) { return (true, index) } } return (false, nil) } func indexOfObject(_ type: AnyObject) -> Int? { for (index, item) in self.enumerated() { if (item as AnyObject) === type { return index } } return nil } } //MARK:- Dictionary extension Dictionary where Value: Equatable { func allKeysForValue(_ val: Value) -> [Key] { return self.filter { $1 == val }.map { $0.0 } } } //MARK:- UIView extension UIView { func showToastWithMessage(_ message: String) { if message.length > 0 { UIApplication.shared.windows.first?.makeToast(message, duration: 1.0, position: CGPoint(x: SCREEN_WIDTH / 2.0, y: SCREEN_HEIGHT - 75)) } } } //MARK:- UIAlertController extension UIAlertController { public class func showStandardAlertWithOnlyOK(_ title: String, alertText: String, selected_: @escaping (_ index: Int) -> ()) -> UIAlertController { let alert = UIAlertController(title: title, message: alertText, preferredStyle: .alert) alert.view.tintColor = DEFAULT_COLOR let doneAction = UIAlertAction(title: OK, style: .default) { (action) in selected_(0) } alert.addAction(doneAction) return alert } public class func showStandardAlertWith(_ title: String, alertText: String, selected_: @escaping (_ index: Int) -> ()) -> UIAlertController { let alert = UIAlertController(title: title, message: alertText, preferredStyle: .alert) alert.view.tintColor = DEFAULT_COLOR let cancelAction = UIAlertAction(title: CANCEL, style: .cancel) { (action) in selected_(0) } alert.addAction(cancelAction) let doneAction = UIAlertAction(title: OK, style: .default) { (action) in selected_(1) } alert.addAction(doneAction) return alert } public class func showStandardAlertWith(_ title: String, alertText: String, positiveButtonText: String?, negativeButtonText: String?, selected_: @escaping (_ index: Int) -> ()) -> UIAlertController { let alert = UIAlertController(title: title, message: alertText, preferredStyle: .alert) // alert.view.tintColor = DEFAULT_COLOR let cancelAction = UIAlertAction(title: negativeButtonText, style: .cancel) { (action) in selected_(0) } alert.addAction(cancelAction) let doneAction = UIAlertAction(title: positiveButtonText, style: .default) { (action) in selected_(1) } alert.addAction(doneAction) return alert } public class func showStandardActionSheetWith(_ title: String, messageText: String, arrayButtons: [String], cancleButtonTitle: String, selectedIndex: @escaping (_ index: Int) -> ()) -> UIAlertController { let actionSheet = UIAlertController(title: title, message: messageText, preferredStyle: .actionSheet) let cancelAction = UIAlertAction(title: cancleButtonTitle, style: .cancel) { (action) in } actionSheet.addAction(cancelAction) for (index, item) in arrayButtons.enumerated() { let buttonAction = UIAlertAction(title: item, style: .default, handler: { (action) in selectedIndex(index) }) actionSheet.addAction(buttonAction) } return actionSheet } public class func showStandardAlertWithTextField(_ title: String, alertText: String, selected_: @escaping (_ index: Int, _ email: String) -> ()) -> UIAlertController { let alert = UIAlertController(title: title, message: alertText, preferredStyle: .alert) alert.addTextField { (textField) in textField.placeholder = "Enter email" textField.keyboardType = .emailAddress } alert.view.tintColor = DEFAULT_COLOR let cancelAction = UIAlertAction(title: CANCEL, style: .default) { (action) in selected_(0, "") } alert.addAction(cancelAction) let doneAction = UIAlertAction(title: OK, style: .default) { (action) in selected_(1, alert.textFields![0].text!) } alert.addAction(doneAction) return alert } } //MARK:- NSDate extension Date { func dateToStringWithCustomFormat (_ format: String) -> String { let dateFormatter = DateFormatter() dateFormatter.dateFormat = format dateFormatter.timeZone = TimeZone.autoupdatingCurrent return dateFormatter.string(from: self) } static func dateFromTimeInterval(_ timeInterval: Double) -> Date { return Date(timeIntervalSince1970: timeInterval) } func getFormattedStringWithFormat() -> String? { return "\(getDay())\(getDateSuffixForDate(isUppercase: false)!) \(getThreeCharacterMonth()) '\(getTwoDigitYear())" } func getDateSuffixForDate(isUppercase:Bool) -> (String?) { let ones = getDay() % 10 let tens = (getDay() / 10) % 10 if (tens == 1) { return isUppercase ? "TH" : "th" } else if (ones == 1) { return isUppercase ? "ST" : "st" } else if (ones == 2) { return isUppercase ? "ND" : "nd" } else if (ones == 3) { return isUppercase ? "RD" : "rd" } else { return isUppercase ? "TH" : "th" } } func getDay() -> (Int) { let calendar = Calendar(identifier: Calendar.Identifier.gregorian) let components = (calendar as NSCalendar?)?.components(.day, from: self) return components!.day! } func getMonth() -> (String) { let calendar = Calendar(identifier: Calendar.Identifier.gregorian) let components = (calendar as NSCalendar?)?.components(.month, from: self) let dateFormatter = DateFormatter() return dateFormatter.monthSymbols[(components?.month)! - 1] } func getThreeCharacterMonth() -> (String) { return getMonth().substring(to: getMonth().characters.index(getMonth().startIndex, offsetBy: 3)) } func getYear() -> (Int) { let calendar = Calendar(identifier: Calendar.Identifier.gregorian) let components = (calendar as NSCalendar?)?.components(.year, from: self) return components!.year! } func getTwoDigitYear() -> (Int) { return getYear() % 100 } static func convertTimeStampToDate(_ timeInterval: Double) -> String { let date = Date(timeIntervalSince1970: timeInterval) let dayTimePeriodFormatter = DateFormatter() dayTimePeriodFormatter.dateFormat = "dd MMM, YYYY" let dateString = dayTimePeriodFormatter.string(from: date) return dateString } static func getTimeStamp() -> String { return "\(Date().timeIntervalSince1970 * 1000)" } } //MARK:- UIColor extension UIColor { static func changeListColor(_ index: Int) -> UIColor { if index % 2 == 0 { return .white } else { return LIST_LIGHT_GRAY_COLOR } } static func colorWithHexString(_ hexString: String) -> UIColor { var cString: String = hexString.trimmingCharacters(in: .whitespacesAndNewlines).uppercased() if (cString.hasPrefix("#")) { cString = cString.substring(from: cString.characters.index(cString.startIndex, offsetBy: 1)) } if ((cString.characters.count) != 6) { return .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) ) } } //MARK:- String extension String { func index(of string: String, options: CompareOptions = .literal) -> Index? { return range(of: string, options: options)?.lowerBound } public func toFloat() -> Float? { return Float.init(self) } public func toDouble() -> Double? { return Double.init(self) } func stringToDateWithCustomFormat(_ format: String) -> Date { let dateFormatter = DateFormatter() dateFormatter.dateFormat = format dateFormatter.timeZone = TimeZone.autoupdatingCurrent return dateFormatter.date(from: self)! } var length: Int { return characters.count } func getLinkFromHTML() -> String { let types: NSTextCheckingResult.CheckingType = .link let detector = try? NSDataDetector(types: types.rawValue) guard let detect = detector else { return self } let matches = detect.matches(in: self, options: .reportCompletion, range: NSMakeRange(0, self.characters.count)) for match in matches { loggingPrint(match.url!.absoluteString) } return (matches.first?.url!.absoluteString)! } func getHTMLEncodedString() -> String { let htmEncodeString = self.decodingHTMLEntities() let encodePlainText = htmEncodeString?.replacingOccurrences(of: "<[^>]+>", with: "", options: .regularExpression, range: nil) return encodePlainText! } var stringByRemovingCarriageReturnLineFeedCharacterSet: String { return self.replacingOccurrences(of: "\r\n", with: "", options: NSString.CompareOptions.literal, range:nil) } /*func getJustifiedString() -> NSAttributedString { let paragraphStyle = NSMutableParagraphStyle() paragraphStyle.alignment = NSTextAlignment.justified let attributedString = NSAttributedString(string: self, attributes: [ NSParagraphStyleAttributeName: paragraphStyle, NSBaselineOffsetAttributeName: NSNumber(value: 0 as Float), NSFontAttributeName: PRIMARY_FONT(CGFloat(FLOAT_FOR_KEY(kFontSize)!))!]) return attributedString }*/ // Replace space with %20 func urlEncode() -> String { var string = self if string.containsEmoji { let data: Data = string.data(using: String.Encoding.nonLossyASCII)! string = NSString(data: data, encoding: String.Encoding.utf8.rawValue)! as String string = string.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)! } if self.contains(" ") || self.contains("+") { string = string.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)! if string.contains("+") { return string.replacingOccurrences(of: "+", with: "%2B") } return string } return string } var containsEmoji: Bool { for scalar in unicodeScalars { switch scalar.value { case 0x1F600...0x1F64F, // Emoticons 0x1F300...0x1F5FF, // Misc Symbols and Pictographs 0x1F680...0x1F6FF, // Transport and Map 0x2600...0x26FF, // Misc symbols 0x2700...0x27BF, // Dingbats 0xFE00...0xFE0F: // Variation Selectors return true default: continue } } return false } // To check text field or String is blank or not public var isBlank: Bool { get { let trimmed = trimmingCharacters(in: CharacterSet.whitespaces) return trimmed.isEmpty } } // Number Checking func isNumber() -> Bool { let numberCharacters = CharacterSet.decimalDigits.inverted return !self.isEmpty && self.rangeOfCharacter(from: numberCharacters) == nil } // Validate Phone number var isPhoneNumber: Bool { do { let detector = try NSDataDetector(types: NSTextCheckingResult.CheckingType.phoneNumber.rawValue) let matches = detector.matches(in: self, options: [], range: NSMakeRange(0, self.characters.count)) if let res = matches.first { return res.resultType == .phoneNumber && res.range.location == 0 && res.range.length == self.characters.count } else { return false } } catch { return false } } // Validate Email var isValidEmail: Bool { //HapHealth let __firstpart = "[A-Z0-9a-z]([A-Z0-9a-z._%+-]{0,30}[A-Z0-9a-z])?" let __serverpart = "([A-Z0-9a-z]([A-Z0-9a-z-]{0,30}[A-Z0-9a-z])?\\.){1,5}" let __emailRegex = __firstpart+"@"+__serverpart+"[A-Za-z]{2,63}" //CiplaMed let emailRegEx = "^(?:(?:(?:(?: )*(?:(?:(?:\\t| )*\\r\\n)?(?:\\t| )+))+(?: )*)|(?: )+)?(?:(?:(?:[-A-Za-z0-9!#$%&’*+/=?^_'{|}~]+(?:\\.[-A-Za-z0-9!#$%&’*+/=?^_'{|}~]+)*)|(?:\"(?:(?:(?:(?: )*(?:(?:[!#-Z^-~]|\\[|\\])|(?:\\\\(?:\\t|[ -~]))))+(?: )*)|(?: )+)\"))(?:@)(?:(?:(?:[A-Za-z0-9](?:[-A-Za-z0-9]{0,61}[A-Za-z0-9])?)(?:\\.[A-Za-z0-9](?:[-A-Za-z0-9]{0,61}[A-Za-z0-9])?)*)|(?:\\[(?:(?:(?:(?:(?:[0-9]|(?:[1-9][0-9])|(?:1[0-9][0-9])|(?:2[0-4][0-9])|(?:25[0-5]))\\.){3}(?:[0-9]|(?:[1-9][0-9])|(?:1[0-9][0-9])|(?:2[0-4][0-9])|(?:25[0-5]))))|(?:(?:(?: )*[!-Z^-~])*(?: )*)|(?:[Vv][0-9A-Fa-f]+\\.[-A-Za-z0-9._~!$&'()*+,;=:]+))\\])))(?:(?:(?:(?: )*(?:(?:(?:\\t| )*\\r\\n)?(?:\\t| )+))+(?: )*)|(?: )+)?$" let emailTest = NSPredicate(format: "SELF MATCHES %@", __emailRegex) let result = emailTest.evaluate(with: self) return result } func heightWithConstrainedWidth(_ width: CGFloat, font: UIFont) -> CGFloat { return self.getLabelSize(forWidth: width, with: font).height } func returnCroppedString(with width: CGFloat, font: UIFont, constantHeight: CGFloat) -> String { var wordCount = 0 var croppedString = "" let range = self.startIndex..<self.endIndex self.enumerateSubstrings(in: range, options: .byWords) { (substring, substringRange, enclosingRange, stop) in if croppedString.heightWithConstrainedWidth(width, font: font) < constantHeight { croppedString += " " + substring! wordCount += 1 } else { stop = true } } let index: String.Index = croppedString.characters.index(croppedString.startIndex, offsetBy: croppedString.length - Int(width / font.pointSize) - 10) return croppedString.substring(to: index) + "..." } } //MARK:- UIViewController extension UIViewController { func registerForKeyboardWillShowNotification(_ scrollView: UIScrollView, usingBlock block: ((CGSize?) -> Void)? = nil) { NotificationCenter.default.addObserver(forName: NSNotification.Name.UIKeyboardWillShow, object: nil, queue: nil, using: { (notification) -> Void in let userInfo = notification.userInfo! let keyboardSize = (userInfo[UIKeyboardFrameEndUserInfoKey]! as AnyObject).cgRectValue.size let contentInsets = UIEdgeInsetsMake(scrollView.contentInset.top, scrollView.contentInset.left, keyboardSize.height, scrollView.contentInset.right) scrollView.setContentInsetAndScrollIndicatorInsets(contentInsets) block?(keyboardSize) }) } func registerForKeyboardWillHideNotification(_ scrollView: UIScrollView, usingBlock block: ((Void) -> Void)? = nil) { NotificationCenter.default.addObserver(forName: NSNotification.Name.UIKeyboardWillHide, object: nil, queue: nil, using: { (notification) -> Void in let contentInsets = UIEdgeInsetsMake(scrollView.contentInset.top, scrollView.contentInset.left, 0, scrollView.contentInset.right) scrollView.setContentInsetAndScrollIndicatorInsets(contentInsets) block?() }) } } //MARK:- UIScrollView extension UIScrollView { func setContentInsetAndScrollIndicatorInsets(_ edgeInsets: UIEdgeInsets) { self.contentInset = edgeInsets self.scrollIndicatorInsets = edgeInsets } } //MARK:- Int extension Int { var degreesToRadians: Double { return Double(self) * .pi / 180 } } //MARK:- Floating Point extension FloatingPoint { var degreesToRadians: Self { return self * .pi / 180 } var radiansToDegrees: Self { return self * 180 / .pi } } //MARK:- Floating Point extension NSLayoutConstraint { func constraintWithMultiplier(_ multiplier: CGFloat) -> NSLayoutConstraint { return NSLayoutConstraint(item: self.firstItem, attribute: self.firstAttribute, relatedBy: self.relation, toItem: self.secondItem, attribute: self.secondAttribute, multiplier: multiplier, constant: self.constant) } } //MARK:- CGPoint extension CGPoint { func distance(toPoint p:CGPoint) -> CGFloat { return sqrt(pow(x - p.x, 2) + pow(y - p.y, 2)) } } //MARK:- UIButton extension UIButton { func centerVerticallyWithPadding(padding:CGFloat) { let imageSize = self.imageView?.frame.size let titleSize = self.titleLabel?.frame.size let totalHeight = (imageSize!.height + titleSize!.height + padding) self.imageEdgeInsets = UIEdgeInsetsMake(-(totalHeight - imageSize!.height), 0.0, 0.0, -titleSize!.width) self.titleEdgeInsets = UIEdgeInsetsMake(0.0, -imageSize!.width, -(totalHeight - titleSize!.height), 0.0) } func centerVertically() { //Default padding is 6.0 self.centerVerticallyWithPadding(padding: 6.0) } } //MARK:- NumberFormatter extension NumberFormatter { func stringFromDouble(number:Double) -> String { if number <= 0.0 { return "" } else if number > 0.0 && number < 1000.0 { return "\(Int(number))" } else if number >= 1000.0 && number < 10000.0 { return "\(Int(number / 1000.0))K" } else if number >= 10000.0 && number < 1000000.0 { return "\(Int(number / 10000.0))G" } else if number >= 1000000 && number < 1000000000000 { return "\(Int(number / 1000000.0))M" } else { return "\(Int(number / 1000000000000.0))B" } } } //MARK:- Charts public class BarChartYAxisFormatter: NSObject, IAxisValueFormatter { let numFormatter: NumberFormatter override init() { numFormatter = NumberFormatter() } public func stringForValue(_ value: Double, axis: AxisBase?) -> String { return numFormatter.stringFromDouble(number: NSNumber(floatLiteral: value).doubleValue) } } //MARK:- Date extension Date { struct Gregorian { static let calendar = Calendar(identifier: .gregorian) } var startOfWeek: Date? { return Gregorian.calendar.date(from: Gregorian.calendar.dateComponents([.yearForWeekOfYear, .weekOfYear], from: self)) } }
[ -1 ]
1b47da707845fa897764ffd541f0715e595a2575
73ef96245fb0eaa51beb3a4e606903873692587f
/RxSwiftDemo/View/ResultViewController.swift
e7a72c9b4da4f48958cbc855b613e0a30edcf9b3
[]
no_license
akaimo/RxSwift-GitHubRepository-Search
65aa07b0e0d24a4e874845e50c83e9774e5f1eda
3c15be83980f1aac0f682f2584e05f8d06ed63dc
refs/heads/master
2021-01-10T14:22:46.590417
2016-04-03T07:14:20
2016-04-03T07:14:20
55,276,469
5
0
null
null
null
null
UTF-8
Swift
false
false
870
swift
// // ResultViewController.swift // RxSwiftDemo // // Created by Shuhei Kawaguchi on 2016/04/02. // Copyright © 2016年 Shuhei Kawaguchi. All rights reserved. // import UIKit import RxSwift import RxCocoa class ResultViewController: UIViewController { @IBOutlet weak var tableView: UITableView! var viewModel = ResultViewModel() let disposeBag = DisposeBag() override func viewDidLoad() { super.viewDidLoad() viewModel.repository .asObservable() .bindTo(tableView.rx_itemsWithCellIdentifier("Cell")) { _, repository, cell in cell.textLabel?.text = repository.fullName } .addDisposableTo(disposeBag) } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } }
[ -1 ]
8e90492732ea73fd49560489f461448897b205a5
4db7014bf83455bf6049b8be7c3afb921cc44258
/Weather/WeatherApp.swift
19083da3d063bf15bfad677077f5ebcc508f7122
[]
no_license
LBkos/weather
34345fe8bc7a06ee16abf589c472ba8fe12c4b5b
d0bbefef76b368fdabc9850dcf9da362338defda
refs/heads/main
2023-04-16T07:40:55.436446
2021-05-01T04:50:27
2021-05-01T04:50:27
355,437,532
0
0
null
null
null
null
UTF-8
Swift
false
false
604
swift
// // WeatherApp.swift // Weather // // Created by Константин Лопаткин on 06.04.2021. // import SwiftUI @main struct WeatherApp: App { @ObservedObject var weatherVM = WeatherViewModel() let persistenceController = PersistenceController.shared var body: some Scene { WindowGroup { NavigationView { ListWeatherView(weatherVM: weatherVM) .environment(\.managedObjectContext, persistenceController.container.viewContext) .preferredColorScheme(.dark) }.accentColor(Color(.cyan)) } } }
[ -1 ]
2104a6404cbe214062c3bbc75c5dc7d0a08c0017
82a2d2a937ef131424996467a8d4bfb690f1010b
/Sources/VaporGraphQL/Extensions/Map+Codable.swift
040ce6cf2391c69e97d866a82612bd19b5b4d923
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
noahemmet/GraphQLRouteCollection
24bf128aa585ee2341e2f4bee106738fef8c9c2d
afae21bca9d7f61c29acd99eb3fe0c4f0d453425
refs/heads/master
2020-03-29T07:52:37.784919
2019-09-25T19:25:52
2019-09-25T19:25:52
149,683,160
5
3
MIT
2018-10-23T22:00:41
2018-09-20T23:36:51
Swift
UTF-8
Swift
false
false
1,535
swift
/// Implements Codable for Map type. import GraphQL import Vapor extension Map: Codable { public init(from decoder: Decoder) throws { let container = try decoder.singleValueContainer() if let value = try? container.decode(Bool.self) { self = .bool(value) } else if let value = try? container.decode(Int.self) { self = .int(value) } else if let value = try? container.decode(Double.self) { self = .double(value) } else if let value = try? container.decode(String.self) { self = .string(value) } else if let value = try? container.decode([Map].self) { self = .array(value) } else if let value = try? container.decode([String: Map].self) { self = .dictionary(value) } else { self = .null } } public func encode(to encoder: Encoder) throws { switch self { case .null: var container = encoder.singleValueContainer() try container.encodeNil() case .bool(let value): var container = encoder.singleValueContainer() try container.encode(value) case .double(let value): var container = encoder.singleValueContainer() try container.encode(value) case .int(let value): var container = encoder.singleValueContainer() try container.encode(value) case .string(let value): var container = encoder.singleValueContainer() try container.encode(value) case .array(let value): try value.encode(to: encoder) case .dictionary(let value): try value.encode(to: encoder) } } }
[ -1 ]
eff7c92b41696a82f0e9a671daa71df877b74bef
82dcd49eeb508fddb19def651d5a96a1f75eedea
/SASAPIHandler/ViewController.swift
2ff1d8ade857b7c65041a46b15fdd40b74bd2e6f
[]
no_license
iamsasikumar1993/SASAPIHandler
8a456fc321edbf3b90737ca363794b474e5faed1
b1f044874f55a0ea92609a65ceaa93c07a3c8e79
refs/heads/master
2021-09-29T03:06:44.269568
2018-11-23T03:44:12
2018-11-23T03:44:12
120,183,873
0
0
null
null
null
null
UTF-8
Swift
false
false
507
swift
// // ViewController.swift // SASAPIHandler // // Created by Sasikumar on 04/02/18. // Copyright © 2018 Sasikumar. 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, 309264, 281107, 293909, 279064, 286234, 282143, 295460, 286249, 197677, 300086, 286775, 300089, 226878, 277057, 288321, 226887, 293961, 300107, 288332, 158285, 278606, 226896, 212561, 300116, 300629, 276054, 237655, 282202, 200802, 281701, 284261, 286314, 277612, 164974, 312433, 281202, 284275, 284276, 284277, 294518, 314996, 277108, 287350, 281205, 292478, 284287, 292990, 278657, 281218, 284289, 276099, 281221, 284293, 285321, 284298, 303242, 311437, 227984, 303760, 278675, 349332, 226454, 226455, 226456, 117399, 226458, 278686, 282270, 228000, 284323, 225955, 278693, 282275, 326311, 284328, 284336, 300727, 280760, 277180, 282301, 283839, 277696, 285377, 280770, 280772, 228548, 302788, 228551, 280775, 282311, 284361, 230604, 298189, 302286, 230608, 229585, 282320, 290004, 284373, 290006, 302295, 189655, 226009, 298202, 280790, 298204, 280797, 282329, 298207, 278752, 290016, 282338, 298211, 290020, 284391, 280808, 277224, 282346, 237564, 234223, 358127, 312049, 286963, 280821, 226038, 286965, 333048, 288501, 120054, 358139, 280824, 282365, 282368, 280832, 300288, 230147, 358147, 278791, 282377, 300817, 282389, 288251, 278298, 287005, 295711, 228127, 287007, 282403, 281380, 152356, 282917, 315177, 130346, 282922, 289578, 312107, 282926, 282411, 113972, 159541, 285495, 282426, 289596, 283453, 289600, 288577, 288579, 283461, 300358, 238920, 234829, 298830, 296272, 279380, 295766, 279386, 298843, 241499, 308064, 200549, 227688, 313706, 306540, 199024, 216433, 276849, 278897, 277364, 290166, 292730, 333179, 207738, 290175, 224643, 311684, 313733, 183173, 304012, 304015, 300432, 310673, 275358, 289697, 283556, 284580, 284586, 276396, 277420, 277422, 279982, 286126, 297903, 305582, 282035, 230323, 277429, 277430, 277935, 278968, 277432, 277433, 277434, 296374, 278973, 291774, 298951, 280015, 301012, 280029, 286175, 279011, 276965, 231405, 286189, 183278, 298989, 308721, 227315, 237556, 292341, 302580, 236022, 310773, 290299, 286204, 290303 ]
8a2f61f10a11c772c4e6b4c348d2ab0c848bd971
4406a8f43d727dd09f8ff5a561a3c53978f6ff4a
/app-media-notas/AppDelegate.swift
42dd95288f20a3066edf5d89d18e87af0b8f17f4
[]
no_license
IsmaelPires/app-medianotas-ios
bed5078d7847a117e55edf5664be27e7ec01578a
10155401e407ca28ea36de7dd841b43e5ee0340c
refs/heads/master
2021-02-28T11:07:28.126768
2020-03-07T19:17:01
2020-03-07T19:17:01
245,690,849
0
0
null
null
null
null
UTF-8
Swift
false
false
2,187
swift
// // AppDelegate.swift // app-media-notas // // Created by Professor SENAI on 3/7/20. // Copyright © 2020 Faculdade Senai. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } func applicationWillResignActive(_ application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. } func applicationDidEnterBackground(_ application: UIApplication) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } func applicationWillEnterForeground(_ application: UIApplication) { // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. } func applicationDidBecomeActive(_ application: UIApplication) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } }
[ 229380, 229383, 229385, 294924, 229388, 278542, 229391, 327695, 278545, 229394, 278548, 229397, 229399, 229402, 278556, 229405, 278559, 229408, 278564, 294950, 229415, 229417, 327722, 237613, 229422, 360496, 229426, 237618, 229428, 311349, 286774, 286776, 319544, 286778, 229432, 204856, 352318, 286791, 237640, 286797, 278605, 311375, 163920, 237646, 196692, 319573, 311383, 319590, 311400, 278635, 303212, 278639, 131192, 278648, 237693, 303230, 327814, 303241, 131209, 417930, 303244, 311436, 319633, 286873, 286876, 311460, 311469, 32944, 327862, 286906, 327866, 180413, 286910, 131264, 286916, 295110, 286922, 286924, 286926, 319694, 286928, 131281, 278743, 278747, 295133, 155872, 319716, 237807, 303345, 286962, 131314, 229622, 327930, 278781, 278783, 278785, 237826, 319751, 278792, 286987, 319757, 311569, 286999, 319770, 287003, 287006, 287009, 287012, 287014, 287016, 287019, 311598, 287023, 262448, 311601, 295220, 287032, 155966, 319809, 319810, 278849, 319814, 311623, 319818, 311628, 229709, 319822, 287054, 278865, 229717, 196963, 196969, 139638, 213367, 106872, 319872, 311683, 319879, 311693, 65943, 319898, 311719, 278952, 139689, 278957, 311728, 278967, 180668, 311741, 278975, 319938, 278980, 98756, 278983, 319945, 278986, 319947, 278990, 278994, 311767, 279003, 279006, 188895, 172512, 287202, 279010, 279015, 172520, 319978, 279020, 172526, 311791, 279023, 172529, 279027, 319989, 172534, 180727, 164343, 279035, 311804, 287230, 279040, 303617, 287234, 279045, 172550, 303623, 172552, 287238, 320007, 279051, 172558, 279055, 303632, 279058, 303637, 279063, 279067, 172572, 279072, 172577, 295459, 172581, 295461, 279082, 311850, 279084, 172591, 172598, 279095, 172607, 172609, 172612, 377413, 172614, 172618, 303690, 33357, 287309, 303696, 279124, 172634, 262752, 172644, 311911, 189034, 295533, 172655, 172656, 352880, 295538, 189039, 172660, 287349, 189040, 189044, 287355, 287360, 295553, 172675, 295557, 287365, 311942, 303751, 352905, 279178, 287371, 311946, 311951, 287377, 172691, 287381, 311957, 221850, 287386, 230045, 172702, 164509, 303773, 172705, 287394, 172707, 303780, 287390, 287398, 205479, 279208, 287400, 172714, 295595, 279212, 189102, 172721, 287409, 66227, 303797, 189114, 287419, 303804, 328381, 287423, 328384, 172737, 279231, 287427, 312005, 312006, 107208, 172748, 287436, 107212, 172751, 287440, 295633, 172755, 303827, 279255, 172760, 287450, 303835, 279258, 189149, 303838, 213724, 312035, 279267, 295654, 279272, 230128, 312048, 312050, 230131, 205564, 303871, 230146, 328453, 295685, 230154, 33548, 312077, 295695, 295701, 230169, 369433, 295707, 328476, 295710, 230175, 295720, 303914, 279340, 205613, 279353, 230202, 312124, 328508, 222018, 295755, 377676, 148302, 287569, 303959, 230237, 279390, 230241, 279394, 303976, 336744, 303985, 328563, 303987, 279413, 303991, 303997, 295806, 295808, 295813, 304005, 320391, 213895, 304007, 304009, 304011, 230284, 304013, 295822, 279438, 189325, 189329, 295825, 304019, 189331, 58262, 304023, 304027, 279452, 234648, 410526, 279461, 279462, 304042, 213931, 230327, 304055, 287675, 230334, 304063, 238528, 304065, 213954, 189378, 156612, 295873, 213963, 197580, 312272, 304084, 304090, 320481, 304106, 320490, 312302, 328687, 320496, 304114, 295928, 320505, 312321, 295945, 230413, 295949, 197645, 320528, 140312, 295961, 238620, 197663, 304164, 304170, 304175, 238641, 312374, 238652, 238655, 230465, 238658, 336964, 296004, 205895, 320584, 238666, 296021, 402518, 336987, 230497, 296036, 296040, 361576, 205931, 296044, 279661, 205934, 164973, 312432, 279669, 337018, 189562, 279679, 304258, 279683, 222340, 205968, 296084, 238745, 304285, 238756, 205991, 222377, 165035, 337067, 238766, 165038, 230576, 238770, 304311, 230592, 312518, 279750, 230600, 230607, 148690, 320727, 279769, 304348, 279777, 304354, 296163, 320740, 279781, 304360, 320748, 279788, 279790, 304370, 296189, 320771, 312585, 296202, 296205, 230674, 320786, 230677, 296213, 296215, 320792, 230681, 230679, 214294, 304416, 230689, 173350, 312622, 296243, 312630, 222522, 296253, 222525, 296255, 312639, 230718, 296259, 378181, 296262, 230727, 238919, 296264, 320840, 296267, 296271, 222545, 230739, 312663, 222556, 337244, 230752, 312676, 230760, 173418, 148843, 410987, 230763, 230768, 296305, 312692, 230773, 304505, 304506, 181626, 181631, 148865, 312711, 312712, 296331, 288140, 288144, 230800, 304533, 337306, 288154, 288160, 173472, 288162, 288164, 279975, 304555, 370092, 279983, 173488, 288176, 279985, 312755, 296373, 312759, 279991, 288185, 337335, 222652, 312766, 173507, 296389, 222665, 230860, 312783, 288208, 230865, 288210, 370130, 288212, 222676, 288214, 280021, 239064, 288217, 329177, 280027, 288220, 288218, 239070, 288224, 280034, 288226, 280036, 288229, 280038, 288230, 288232, 370146, 320998, 288234, 288236, 288238, 288240, 288242, 296435, 288244, 288250, 296446, 321022, 402942, 206336, 296450, 148990, 230916, 230919, 214535, 230923, 304651, 304653, 370187, 402969, 230940, 222752, 108066, 296486, 296488, 157229, 239152, 230961, 157236, 288320, 288325, 124489, 280140, 280145, 288338, 280149, 288344, 280152, 239194, 280158, 403039, 370272, 181854, 239202, 370279, 312938, 280183, 280185, 280188, 280191, 116354, 280194, 280208, 280211, 288408, 280218, 280222, 419489, 190118, 198310, 321195, 296622, 321200, 337585, 296626, 296634, 296637, 419522, 313027, 280260, 419525, 206536, 280264, 206539, 206541, 206543, 313044, 280276, 321239, 280283, 313052, 18140, 288478, 313055, 321252, 313066, 288494, 280302, 280304, 313073, 321266, 288499, 419570, 288502, 280314, 288510, 124671, 67330, 280324, 198405, 288519, 280331, 198416, 280337, 296723, 116503, 321304, 329498, 296731, 321311, 313121, 313123, 304932, 321316, 280363, 141101, 165678, 280375, 321336, 296767, 288576, 345921, 280388, 337732, 304968, 280393, 280402, 173907, 313171, 313176, 280419, 321381, 296809, 296812, 313201, 1920, 255873, 305028, 280454, 247688, 280464, 124817, 280468, 239510, 280473, 124827, 214940, 247709, 214944, 280487, 313258, 321458, 296883, 124853, 214966, 296890, 10170, 288700, 296894, 190403, 296900, 280515, 337862, 165831, 280521, 231379, 296921, 354265, 354270, 239586, 313320, 354281, 231404, 124913, 165876, 321528, 239612, 313340, 288764, 239617, 313347, 288773, 313358, 305176, 321560, 313371, 354338, 305191, 223273, 313386, 354348, 124978, 215090, 124980, 288824, 288826, 321595, 378941, 313406, 288831, 288836, 67654, 280651, 354382, 288848, 280658, 215123, 354390, 288855, 288859, 280669, 313438, 149599, 280671, 149601, 321634, 149603, 223327, 329830, 280681, 313451, 223341, 280687, 149618, 215154, 313458, 280691, 313464, 329850, 321659, 280702, 288895, 321670, 215175, 141446, 141455, 141459, 280725, 313498, 100520, 288936, 280747, 288940, 288947, 280755, 321717, 280759, 280764, 280769, 280771, 280774, 280776, 313548, 321740, 280783, 280786, 280788, 313557, 280793, 280796, 280798, 338147, 280804, 280807, 157930, 280811, 280817, 125171, 157940, 280819, 182517, 280823, 280825, 280827, 280830, 280831, 280833, 125187, 280835, 125191, 125207, 125209, 321817, 125218, 321842, 223539, 125239, 280888, 280891, 289087, 280897, 280900, 305480, 239944, 280906, 239947, 305485, 305489, 379218, 280919, 248153, 215387, 354653, 313700, 280937, 313705, 190832, 280946, 223606, 313720, 280956, 239997, 280959, 313731, 199051, 240011, 289166, 240017, 297363, 190868, 240021, 297365, 297368, 297372, 141725, 297377, 289186, 297391, 289201, 240052, 289207, 289210, 305594, 281024, 289218, 289221, 289227, 436684, 281045, 281047, 215526, 166378, 305647, 281075, 174580, 240124, 281084, 305662, 305664, 240129, 305666, 305668, 223749, 330244, 281095, 223752, 150025, 338440, 240132, 223757, 281102, 223763, 223765, 281113, 322074, 281116, 281121, 182819, 281127, 150066, 158262, 158266, 289342, 281154, 322115, 158283, 281163, 281179, 338528, 338532, 281190, 199273, 281196, 19053, 158317, 313973, 297594, 281210, 158347, 264845, 182926, 133776, 182929, 314003, 117398, 314007, 289436, 174754, 330404, 289448, 133801, 174764, 314029, 314033, 240309, 133817, 314045, 314047, 314051, 199364, 297671, 158409, 289493, 363234, 289513, 289522, 289525, 289532, 322303, 289537, 322310, 264969, 322314, 322318, 281361, 281372, 322341, 215850, 281388, 289593, 281401, 289601, 281410, 281413, 281414, 240458, 281420, 240468, 281430, 322393, 297818, 281435, 281438, 281442, 174955, 224110, 207733, 207737, 158596, 183172, 240519, 322440, 314249, 338823, 183184, 142226, 289687, 224151, 240535, 297883, 289694, 289696, 289700, 289712, 281529, 289724, 52163, 420829, 281567, 289762, 322534, 297961, 183277, 281581, 322550, 134142, 322563, 314372, 330764, 175134, 322599, 322610, 314421, 281654, 314427, 314433, 207937, 314441, 207949, 322642, 314456, 281691, 314461, 281702, 281704, 314474, 281708, 281711, 289912, 248995, 306341, 306344, 306347, 322734, 306354, 142531, 199877, 289991, 306377, 289997, 249045, 363742, 363745, 298216, 330988, 126190, 216303, 322801, 388350, 257302, 363802, 199976, 199978, 314671, 298292, 298294, 257334, 216376, 380226, 298306, 224584, 224587, 224594, 216404, 306517, 150870, 314714, 224603, 159068, 314718, 265568, 314723, 281960, 150890, 306539, 314732, 314736, 290161, 216436, 306549, 298358, 314743, 306552, 290171, 314747, 298365, 290174, 306555, 224641, 281987, 298372, 314756, 281990, 224647, 265604, 298377, 314763, 142733, 298381, 314768, 224657, 306581, 314773, 314779, 314785, 314793, 282025, 282027, 241068, 241070, 241072, 282034, 241077, 150966, 298424, 306618, 282044, 323015, 306635, 306640, 290263, 290270, 290275, 339431, 282089, 191985, 282098, 290291, 282101, 241142, 191992, 290298, 151036, 290302, 282111, 290305, 175621, 306694, 192008, 323084, 257550, 290321, 282130, 323090, 290325, 282133, 241175, 290328, 282137, 290332, 241181, 282142, 282144, 290344, 306731, 290349, 290351, 290356, 282186, 224849, 282195, 282199, 282201, 306778, 159324, 159330, 314979, 298598, 323176, 224875, 241260, 323181, 257658, 315016, 282249, 290445, 282255, 282261, 175770, 298651, 282269, 323229, 298655, 323231, 61092, 282277, 306856, 196133, 282295, 282300, 323260, 323266, 282310, 323273, 282319, 306897, 241362, 306904, 282328, 298714, 52959, 216801, 282337, 241380, 216806, 323304, 282345, 12011, 282356, 323318, 282364, 282367, 306945, 241412, 323333, 282376, 216842, 323345, 282388, 323349, 282392, 184090, 315167, 315169, 282402, 315174, 323367, 241448, 315176, 241450, 282410, 306988, 306991, 315184, 323376, 315190, 241464, 159545, 282425, 298811, 118593, 307009, 413506, 307012, 241475, 148946, 315211, 282446, 307027, 315221, 323414, 315223, 241496, 241498, 307035, 307040, 110433, 282465, 241509, 110438, 298860, 110445, 282478, 315249, 110450, 315251, 282481, 315253, 315255, 339838, 315267, 282499, 315269, 241544, 282505, 241546, 241548, 298896, 298898, 282514, 241556, 44948, 298901, 241560, 282520, 241563, 241565, 241567, 241569, 282531, 241574, 282537, 298922, 36779, 241581, 282542, 241583, 323504, 241586, 282547, 241588, 290739, 241590, 241592, 241598, 290751, 241600, 241605, 151495, 241610, 298975, 241632, 298984, 241640, 241643, 298988, 241646, 241649, 241652, 323574, 290807, 299003, 241661, 299006, 282623, 315396, 241669, 315397, 282632, 282639, 290835, 282645, 241693, 282654, 241701, 102438, 217127, 282669, 323630, 282681, 290877, 282687, 159811, 315463, 315466, 192589, 307278, 192596, 176213, 307287, 307290, 217179, 315482, 192605, 315483, 233567, 299105, 200801, 217188, 299109, 307303, 315495, 356457, 45163, 307307, 315502, 192624, 307314, 323700, 299126, 233591, 299136, 307329, 307338, 233613, 241813, 307352, 299164, 299167, 315552, 184479, 184481, 315557, 184486, 307370, 307372, 184492, 307374, 307376, 299185, 323763, 184503, 176311, 299191, 307385, 307386, 307388, 258235, 307390, 176316, 299200, 184512, 307394, 299204, 307396, 184518, 307399, 323784, 233679, 307409, 307411, 176343, 299225, 233701, 307432, 184572, 282881, 184579, 282893, 291089, 282906, 291104, 233766, 295583, 176435, 307508, 315701, 332086, 307510, 307512, 168245, 307515, 307518, 282942, 282947, 323917, 110926, 282957, 233808, 323921, 315733, 323926, 233815, 315739, 323932, 299357, 242018, 242024, 299373, 315757, 250231, 242043, 315771, 299388, 299391, 291202, 299398, 242057, 291212, 299405, 291222, 315801, 283033, 242075, 291226, 194654, 61855, 291231, 283042, 291238, 291241, 127403, 127405, 291247, 299440, 127407, 299444, 127413, 283062, 291254, 127417, 291260, 283069, 127421, 127424, 299457, 127429, 127431, 127434, 315856, 176592, 315860, 176597, 127447, 283095, 299481, 176605, 242143, 127457, 291299, 340454, 127463, 242152, 291305, 127466, 176620, 127469, 127474, 291314, 291317, 127480, 135672, 291323, 233979, 127485, 291330, 283142, 127494, 127497, 233994, 135689, 127500, 291341, 233998, 127506, 234003, 234006, 127511, 152087, 283161, 242202, 234010, 135707, 242206, 135710, 242208, 291361, 242220, 291378, 234038, 152118, 234041, 315961, 70213, 242250, 111193, 242275, 299620, 242279, 168562, 184952, 135805, 291456, 135808, 373383, 299655, 135820, 316051, 225941, 316054, 299672, 135834, 373404, 299677, 225948, 135839, 299680, 225954, 299684, 135844, 242343, 209576, 242345, 373421, 135870, 135873, 135876, 135879, 299720, 299723, 299726, 225998, 226002, 119509, 226005, 226008, 299740, 242396, 201444, 299750, 283368, 234219, 283372, 185074, 226037, 283382, 316151, 234231, 234236, 226045, 242431, 234239, 209665, 234242, 299778, 242436, 226053, 234246, 226056, 234248, 291593, 242443, 234252, 242445, 234254, 291601, 234258, 242450, 242452, 234261, 348950, 201496, 234264, 234266, 234269, 283421, 234272, 234274, 152355, 299814, 234278, 283432, 234281, 234284, 234287, 283440, 185138, 242483, 234292, 234296, 234298, 160572, 283452, 234302, 234307, 242499, 234309, 292433, 316233, 234313, 316235, 234316, 283468, 234319, 242511, 234321, 234324, 185173, 201557, 234329, 234333, 308063, 234336, 242530, 349027, 234338, 234341, 234344, 234347, 177004, 234350, 324464, 234353, 152435, 177011, 234356, 234358, 234362, 291711, 234368, 291714, 234370, 291716, 234373, 201603, 226182, 234375, 308105, 324490, 226185, 234379, 234384, 234388, 234390, 324504, 234393, 209818, 308123, 324508, 234396, 291742, 226200, 234398, 234401, 291747, 291748, 234405, 291750, 234407, 324520, 324518, 324522, 234410, 291756, 226220, 291754, 324527, 291760, 234417, 201650, 324531, 234414, 234422, 226230, 275384, 324536, 234428, 291773, 242623, 324544, 234431, 234434, 324546, 324548, 226245, 234437, 234439, 226239, 234443, 291788, 234446, 275406, 193486, 234449, 316370, 193488, 234452, 234455, 234459, 234461, 234464, 234467, 234470, 168935, 5096, 324585, 234475, 234478, 316400, 234481, 316403, 234484, 234485, 234487, 324599, 234490, 234493, 316416, 234496, 308226, 234501, 308231, 234504, 234507, 234510, 234515, 300054, 316439, 234520, 234519, 234523, 234526, 234528, 300066, 234532, 300069, 234535, 234537, 234540, 144430, 234543, 234546, 275508, 300085, 234549, 300088, 234553, 234556, 234558, 316479, 234561, 316483, 160835, 234563, 308291, 234568, 234570, 316491, 234572, 300108, 234574, 300115, 234580, 234581, 242777, 234585, 275545, 234590, 234593, 234595, 234597, 300133, 234601, 300139, 234605, 160879, 234607, 275569, 234610, 316530, 300148, 234614, 398455, 144506, 234618, 234620, 275579, 234623, 226433, 234627, 275588, 234629, 242822, 234634, 234636, 177293, 234640, 275602, 234643, 308373, 226453, 234647, 275606, 275608, 234650, 324757, 308379, 300189, 324766, 119967, 234653, 324768, 234657, 283805, 242852, 300197, 234661, 283813, 234664, 275626, 234667, 316596, 308414, 234687, 300226, 308418, 234692, 300229, 308420, 308422, 226500, 283844, 300234, 283850, 300238, 300241, 316625, 300243, 300245, 316630, 300248, 300253, 300256, 300258, 300260, 234726, 300263, 300265, 300267, 161003, 300270, 300272, 120053, 300278, 275703, 316663, 300284, 275710, 300287, 292097, 300289, 161027, 300292, 300294, 275719, 234760, 177419, 300299, 242957, 300301, 283917, 177424, 349451, 275725, 349464, 415009, 283939, 259367, 292143, 283951, 300344, 226617, 243003, 283963, 226628, 300357, 283973, 177482, 283983, 316758, 357722, 316766, 292192, 316768, 218464, 292197, 316774, 243046, 218473, 284010, 136562, 324978, 275834, 333178, 275836, 275840, 316803, 316806, 226696, 316811, 226699, 316814, 226703, 300433, 234899, 300436, 226709, 357783, 316824, 316826, 144796, 300448, 144807, 144810, 144812, 284076, 144814, 144820, 374196, 284084, 292279, 284087, 144826, 144828, 144830, 144832, 144835, 144837, 38342, 144839, 144841, 144844, 144847, 144852, 144855, 103899, 300507, 333280, 218597, 292329, 300523, 259565, 300527, 308720, 259567, 292338, 226802, 227440, 316917, 308727, 292343, 300537, 316933, 316947, 308757, 308762, 284191, 284194, 284196, 235045, 284199, 284204, 284206, 284209, 284211, 194101, 284213, 316983, 194103, 284215, 308790, 284218, 226877, 292414, 284223, 284226, 284228, 292421, 226886, 284231, 128584, 243268, 284234, 276043, 317004, 366155, 284238, 226895, 284241, 194130, 284243, 300628, 284245, 276053, 284247, 317015, 284249, 243290, 284251, 235097, 284253, 300638, 284255, 243293, 284258, 292452, 292454, 284263, 177766, 284265, 292458, 284267, 292461, 284272, 284274, 284278, 292470, 276086, 292473, 284283, 276093, 284286, 292479, 284288, 292481, 284290, 325250, 284292, 292485, 276095, 276098, 284297, 317066, 284299, 317068, 284301, 276109, 284303, 284306, 276114, 284308, 284312, 284314, 284316, 276127, 284320, 284322, 284327, 284329, 317098, 284331, 276137, 284333, 284335, 276144, 284337, 284339, 300726, 284343, 284346, 284350, 276160, 358080, 284354, 358083, 284358, 276166, 358089, 284362, 276170, 284365, 276175, 284368, 276177, 284370, 358098, 284372, 317138, 284377, 276187, 284379, 284381, 284384, 358114, 284386, 358116, 276197, 317158, 358119, 284392, 325353, 358122, 284394, 284397, 358126, 276206, 358128, 284399, 358133, 358135, 276216, 358138, 300795, 358140, 284413, 358142, 358146, 317187, 284418, 317189, 317191, 284428, 300816, 300819, 317207, 284440, 300828, 300830, 276255, 300832, 325408, 300834, 317221, 227109, 358183, 186151, 276268, 300845, 243504, 300850, 284469, 276280, 325436, 358206, 276291, 366406, 276295, 300872, 292681, 153417, 358224, 284499, 276308, 284502, 317271, 178006, 276315, 292700, 317279, 284511, 227175, 292715, 300912, 292721, 284529, 300915, 284533, 292729, 317306, 284540, 292734, 325512, 169868, 276365, 317332, 358292, 284564, 399252, 284566, 350106, 284572, 276386, 284579, 276388, 358312, 317353, 284585, 276395, 292776, 292784, 276402, 358326, 161718, 358330, 276410, 276411, 276418, 276425, 301009, 301011, 301013, 292823, 358360, 301017, 301015, 292828, 276446, 153568, 276448, 276452, 292839, 276455, 350186, 292843, 276460, 292845, 276464, 178161, 227314, 276466, 325624, 350200, 276472, 317435, 276476, 276479, 276482, 350210, 276485, 317446, 178181, 276490, 350218, 292876, 350222, 317456, 276496, 317458, 178195, 243733, 243740, 317468, 317472, 325666, 243751, 292904, 276528, 178224, 243762, 309298, 325685, 325689, 235579, 325692, 235581, 178238, 276539, 276544, 243779, 325700, 284739, 292934, 243785, 276553, 350293, 350295, 309337, 194649, 227418, 350302, 227423, 350304, 178273, 309346, 194657, 194660, 350308, 309350, 309348, 292968, 309352, 227426, 276579, 227430, 276583, 309354, 301167, 276590, 350321, 350313, 350316, 284786, 350325, 252022, 276595, 350328, 292985, 301178, 350332, 292989, 301185, 292993, 350339, 317570, 317573, 350342, 350345, 350349, 301199, 317584, 325777, 350354, 350357, 350359, 350362, 350366, 276638, 284837, 153765, 350375, 350379, 350381, 350383, 129200, 350385, 350387, 350389, 350395, 350397, 350399, 227520, 350402, 227522, 301252, 350406, 227529, 301258, 309450, 276685, 309455, 276689, 309462, 301272, 276699, 194780, 309468, 309471, 301283, 317672, 317674, 325867, 243948, 194801, 227571, 309491, 309494, 243960, 276735, 227583, 227587, 276739, 211204, 276742, 227593, 227596, 325910, 309530, 342298, 211232, 317729, 276775, 211241, 325937, 325943, 211260, 260421, 276809, 285002, 276811, 235853, 276816, 235858, 276829, 276833, 391523, 276836, 293227, 276843, 293232, 276848, 186744, 211324, 227709, 285061, 366983, 317833, 178572, 285070, 285077, 178583, 227738, 317853, 276896, 317858, 342434, 285093, 317864, 285098, 276907, 235955, 276917, 293304, 293307, 293314, 309707, 293325, 129486, 317910, 293336, 235996, 317917, 293343, 358880, 276961, 227810, 293346, 276964, 293352, 236013, 293364, 301562, 293370, 317951, 309764, 301575, 121352, 293387, 236043, 342541, 317963, 113167, 55822, 309779, 317971, 309781, 277011, 55837, 227877, 227879, 293417, 227882, 309804, 293421, 105007, 236082, 285236, 23094, 277054, 244288, 219714, 129603, 301636, 318020, 301639, 301643, 277071, 285265, 399955, 309844, 277080, 309849, 285277, 285282, 326244, 318055, 277100, 121458, 277106, 170618, 170619, 309885, 309888, 277122, 227975, 277128, 285320, 301706, 318092, 326285, 334476, 318094, 277136, 277139, 227992, 334488, 318108, 285340, 318110, 227998, 137889, 383658, 285357, 318128, 277170, 293555, 342707, 154292, 277173, 318132, 285368, 277177, 277181, 318144, 277187, 277191, 277194, 277196, 277201, 342745, 137946, 342747, 113378, 203491, 228069, 277223, 342760, 285417, 56041, 56043, 56045, 277232, 228081, 56059, 310015, 285441, 310020, 285448, 310029, 228113, 285459, 277273, 293659, 326430, 228128, 285474, 293666, 228135, 318248, 277291, 318253, 293677, 285489, 301876, 293685, 285494, 301880, 285499, 301884, 310080, 293696, 277317, 277322, 277329, 162643, 310100, 301911, 277337, 301913, 301921, 400236, 236397, 162671, 326514, 310134, 236408, 15224, 277368, 416639, 416640, 113538, 310147, 416648, 39817, 187274, 277385, 301972, 424853, 277405, 277411, 310179, 293798, 293802, 236460, 277426, 293811, 293817, 293820, 203715, 326603, 342994, 276586, 293849, 293861, 228327, 228328, 318442, 228330, 228332, 326638, 277486, 351217, 318450, 293876, 293877, 285686, 302073, 121850, 293882, 302075, 285690, 244731, 293887, 277504, 277507, 277511, 293899, 277519, 293908, 302105, 293917, 293939, 318516, 277561, 277564, 310336, 7232, 293956, 277573, 228422, 293960, 310344, 277577, 277583, 203857, 293971, 310355, 310359, 236632, 277594, 138332, 277598, 285792, 277601, 203872, 310374, 203879, 310376, 228460, 318573, 203886, 187509, 285815, 367737, 285817, 302205, 285821, 392326, 285831, 253064, 294026, 285835, 302218, 162964, 384148, 187542, 302231, 285849, 302233, 285852, 302237, 285854, 285856, 302241, 285862, 277671, 302248, 64682, 277678, 294063, 294065, 302258, 277687, 294072, 318651, 294076, 277695, 318657, 244930, 302275, 130244, 302277, 228550, 302282, 310476, 302285, 302288, 310481, 302290, 203987, 302292, 302294, 310486, 302296, 384222, 310498, 285927, 318698, 302315, 195822, 228592, 294132, 138485, 228601, 204026, 228606, 204031, 64768, 310531, 285958, 138505, 228617, 318742, 204067, 277798, 130345, 277801, 113964, 285997, 384302, 285999, 277804, 113969, 277807, 277811, 318773, 318776, 277816, 286010, 277819, 294204, 417086, 277822, 286016, 302403, 294211, 384328, 277832, 277836, 294221, 146765, 294223, 326991, 277839, 277842, 277847, 277850, 179547, 277853, 146784, 277857, 302436, 277860, 294246, 327015, 310632, 327017, 351594, 277864, 277869, 277872, 351607, 310648, 277880, 310651, 277884, 277888, 310657, 351619, 294276, 310659, 327046, 277892, 253320, 310665, 318858, 277894, 277898, 277903, 310672, 351633, 277905, 277908, 277917, 310689, 277921, 130468, 228776, 277928, 277932, 310703, 277937, 310710, 130486, 310712, 277944, 310715, 277947, 302526, 228799, 277950, 277953, 302534, 310727, 64966, 245191, 163272, 277959, 277963, 302541, 277966, 302543, 310737, 277971, 228825, 163290, 277978, 310749, 277981, 277984, 310755, 277989, 277991, 187880, 277995, 310764, 286188, 278000, 228851, 310772, 278003, 278006, 40440, 212472, 278009, 40443, 286203, 40448, 228864, 286214, 228871, 302603, 65038, 302614, 286233, 302617, 302621, 286240, 146977, 187936, 187939, 40484, 294435, 40486, 286246, 294440, 40488, 294439, 294443, 40491, 294445, 278057, 310831, 245288, 286248, 40499, 40502, 212538, 40507, 40511, 40513, 228933, 327240, 40521, 286283, 40525, 40527, 212560, 400976, 228944, 40533, 147032, 40537, 40539, 40541, 278109, 40544, 40548, 40550, 40552, 286313, 40554, 286312, 310892, 40557, 40560, 188022, 122488, 294521, 343679, 294537, 310925, 286354, 278163, 302740, 122517, 278168, 179870, 327333, 229030, 212648, 278188, 302764, 278192, 319153, 278196, 302781, 319171, 302789, 294599, 278216, 294601, 302793, 343757, 212690, 319187, 278227, 286420, 229076, 286425, 319194, 278235, 301163, 278238, 229086, 286432, 294625, 294634, 302838, 319226, 286460, 278274, 302852, 278277, 302854, 294664, 311048, 352008, 319243, 311053, 302862, 319251, 294682, 278306, 188199, 294701, 278320, 319280, 319290, 229192, 302925, 188247, 188252, 237409, 229233, 294776, 360317, 294785, 327554, 360322, 40840, 40851, 294803, 188312, 294811, 237470, 319390, 40865, 319394, 294817, 294821, 311209, 180142, 343983, 294831, 188340, 40886, 319419, 294844, 294847, 393177, 294876, 294879, 294883, 393190, 294890, 311279, 278513, 237555, 278516, 311283, 278519, 237562 ]
bb3602b47472c0d7c82657a0c9c4edda14071d7c
c6d7c4d5b5542dcb842947a003d115821ecf6269
/Fuse/Fuse/UITableViewCell+SelectionView.swift
79d01c0da8dc2eeec0f3835ee00e20b34299900d
[]
no_license
atomikpanda/FuseForSpotify
1533e571a745c819e9a61fb87f3ce83b1b8c09ec
00275fc2d4d4629f5655809f1b2bc8aa5ab21a44
refs/heads/master
2020-04-13T20:18:13.678025
2018-12-28T16:13:04
2018-12-28T16:13:04
163,426,542
0
0
null
null
null
null
UTF-8
Swift
false
false
620
swift
// // UITableViewCell+SelectionView.swift // Fuse // // Created by Bailey Seymour on 11/8/18. // Copyright © 2018 Bailey Seymour. All rights reserved. // // Bailey Seymour // DVP4 1811 import UIKit extension UITableViewCell { func setupSelectionView() { // Use a different level of opacity when the user selects a cell based on theme if UIColor.fuseIsDark { selectedBackgroundView?.backgroundColor = UIColor.fuseTint.withAlphaComponent(0.25) } else { selectedBackgroundView?.backgroundColor = UIColor.fuseTint.withAlphaComponent(0.5) } } }
[ -1 ]
420b7597da92a7db31fdacb441000514587cc24b
0fe4f7da2f5058fd155a38c4dc8b1287969c4e8d
/Practice Manager - Lite/Loaders.swift
37670bf65029f78b96d8a433828c091a371ef1f3
[]
no_license
nikhileshRayapureddy/DocNMe
cbebde2e4473b3fd8ceba8f866f0b0a227842a38
2c068584f34dad692e70b62cd25cf9a762898017
refs/heads/master
2021-09-07T19:48:29.716076
2017-12-22T07:27:24
2017-12-22T07:27:24
115,088,020
0
0
null
2018-02-28T04:29:04
2017-12-22T07:13:03
Swift
UTF-8
Swift
false
false
2,301
swift
// // Created by Sandeep Rana on 14/10/17. // Copyright (c) 2017 DocNMe. All rights reserved. // import Foundation class Loaders { static let listResults = ["ALK. PHOSPHTASE", "AMH (ANTI MULLERIAN HORMONE)", "ANDROSTENEDIONE", "ANTI BETA 2 GLYCOPROTEIN", "ANTI DS DNA", "ANTICARDIOLIPIN AB IGG /IGM", "BETA HCG", "BILIRUBIN", "BLOOD SUGAR FASTING", "BLOOD SUGAR PP", "BLOOD SUGAR Random", "Blood Grouping and Rh Typing", "CBC", "CREATININ", "CUE", "Double Marker", "ECG", "ESTROGEN", "FSH", "Free T3", "Free T4", "GCT", "HCV", "HIV", "HPV", "Hb", "HbA1C", "HbSAg", "Hormonal tests", "Iron", "LDH", "LH", "LUPUS ANTICOAGULANT", "Liver Function Test (LFT)", "OGTT", "PAPP - A", "PH, Urine", "PREIN S", "PROGESTERONE", "PROLACTIN", "PROTEIN C", "Physician opinion", "Rh Antibody (Anti-D)", "SGOT", "SGPT", "SHBG", "Semen Analysis", "T3", "T4", "TESTOSTERONE", "TPO", "TSH", "Triple Marker", "UREA", "URINE C/S", "URINE R/M", "VDRL", "Vitamin B12", "Vitamin D"]; }
[ -1 ]
6f5da4ad86fdc950c9a1e8d96b066b125570b077
34a5c822591bfda63dd260173731c1ad3bdbc24e
/Source/sReto/Core/Connectivity/ReliabilityManager.swift
ea0dbcd65d3772ca6e6badb32b03a7e33b4d43c2
[ "MIT" ]
permissive
ctk0418/sReto
7830b19f12524576c5eaf63805ab7d395ae2a543
0575be91f4c1de03d48404e0b6c45ae82e21f65d
refs/heads/master
2020-03-30T07:10:59.886228
2016-02-13T09:51:47
2016-02-13T09:51:47
null
0
0
null
null
null
null
UTF-8
Swift
false
false
8,809
swift
// // ReliabilityManager.swift // sReto // // Created by Julian Asamer on 13/07/14. // Copyright (c) 2014 - 2016 Chair for Applied Software Engineering // // Licensed under the MIT License // // 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 Foundation var reliabilityManagerDelays = (regularDelay: 1.0, shortDelay: 0.4) /** * The ReliablityManager's delegate protocol. */ protocol ReliabilityManagerDelegate: class { /** Called when the connection connected succesfully. */ func connectionConnected() /** Called when the connection closes expectedly (i.e. when close() was called on the connection) */ func connectionClosedExpectedly() /** Called when the connection failed and could not be reestablished. */ func connectionClosedUnexpectedly(error: AnyObject?) } /** * A ConnectionManager manages PacketConnections. */ protocol ConnectionManager: class { /** * Called when a new underlying connection needs to be established for an packet connection. */ func establishUnderlyingConnection(connection: PacketConnection) /** * Called when a connection closed. */ func notifyConnectionClose(connection: PacketConnection) } /** * The ReliablityManager is responsible for cleanly closing connections and attempting to reconnect failed connections. * * TODO: This class currently assumes that if connecting takes longer than a specific amount of time (1 second), the connection attempt failed and tries to reconnect. This causes issues if establishing the connection takes longer than 1 second, especially with routed/multicast connections, causing the connection establishment process to fail. To fix this, the next attempt should only be started after a generous timeout or if the connection establishment process failed, and not if it is still in progress. */ class ReliabilityManager: NSObject, PacketHandler { /** The PacketConnection thats reliability is managed. */ private let packetConnection: PacketConnection /** The delegate */ weak var delegate: ReliabilityManagerDelegate? /** The connection manager */ weak var connectionManager: ConnectionManager? = nil /** The dispatch queue used to dispatch delegate methods on */ let dispatchQueue: dispatch_queue_t /** The local peer's identifier */ let localIdentifier: UUID /** All of the managed connection's destination's identifiers */ let destinationIdentifiers: Set<UUID> /** Set to true when the underlying connection is expected to close. */ var isExpectingConnectionToClose = false /** Set to true if this ReliabilityManager is expected to attempt to reconnect when a connection fails. */ var isExpectedToReconnect: Bool /** The executor used to repeat reconnect attempts */ var repeatedExecutor: RepeatedExecutor! /** The number of reconnect attempts that have been performed */ var reconnectAttempts: Int = 0 /** The number of close acknowledge packets received. Necessary since acknowledgements need to be received from all destinations before a connection can be closed safely. */ var receivedCloseRequestAcknowledges: Set<UUID> = [] /** If the connection fails, stores the original error so it can be reported in case all reconnect attempts fail. */ var originalError: AnyObject? /** * Constructs a new ReliablityManager. * @param packetConnection The packet connection managed * @param connectionManager The connection manager responsible for the packet connection. * @param isExpectedToReconnect If set to true, this ReliabilityManager will attempt to reconnect the packet connection if its underlying connection fails. * @param localIdentifier The local peer's identifier. * @param dispatchQueue The dispatch queue on which all delegate method calls are dispatched. */ init(packetConnection: PacketConnection, let connectionManager: ConnectionManager, isExpectedToReconnect: Bool, localIdentifier: UUID, dispatchQueue: dispatch_queue_t) { self.packetConnection = packetConnection self.connectionManager = connectionManager self.isExpectedToReconnect = isExpectedToReconnect self.localIdentifier = localIdentifier self.dispatchQueue = dispatchQueue self.destinationIdentifiers = Set(packetConnection.destinations.map { $0.identifier }) super.init() packetConnection.addDelegate(self) self.repeatedExecutor = RepeatedExecutor(regularDelay: reliabilityManagerDelays.regularDelay, shortDelay: reliabilityManagerDelays.shortDelay, dispatchQueue: dispatchQueue) } /** Closes the packet connection cleanly. */ func closeConnection() { if self.isExpectedToReconnect { self.packetConnection.write(CloseAnnounce()) } else { self.packetConnection.write(CloseRequest()) } } /** Attempts to reconnect a PacketConnection with no or a failed underlying connection. */ func attemptReconnect() { if self.packetConnection.isConnected { return } self.reconnectAttempts++ if self.reconnectAttempts > 5 { self.repeatedExecutor.stop() self.connectionManager?.notifyConnectionClose(self.packetConnection) self.delegate?.connectionClosedUnexpectedly(self.originalError) } else { self.repeatedExecutor.start(self.attemptReconnect) self.connectionManager?.establishUnderlyingConnection(self.packetConnection) } } /** Handles a close request. */ private func handleCloseRequest() { self.packetConnection.write(CloseAnnounce()) } /** Handles a close announce. */ private func handleCloseAnnounce() { self.isExpectingConnectionToClose = true self.packetConnection.write(CloseAcknowledge(source: self.localIdentifier)) } /** Handles a close acknowledge. */ private func handleCloseAcknowledge(packet: CloseAcknowledge) { self.receivedCloseRequestAcknowledges += packet.source if self.receivedCloseRequestAcknowledges == self.destinationIdentifiers { self.isExpectingConnectionToClose = true self.receivedCloseRequestAcknowledges = [] self.packetConnection.disconnectUnderlyingConnection() } } // MARK: PacketConnection delegate func underlyingConnectionDidClose(error: AnyObject?) { self.originalError = error if self.isExpectingConnectionToClose { self.repeatedExecutor.stop() self.connectionManager?.notifyConnectionClose(self.packetConnection) self.delegate?.connectionClosedExpectedly() } else { self.repeatedExecutor.start(self.attemptReconnect) } } func willSwapUnderlyingConnection() { } func underlyingConnectionDidConnect() { self.originalError = nil self.reconnectAttempts = 0 self.repeatedExecutor.stop() self.delegate?.connectionConnected() } func didWriteAllPackets() { } let handledPacketTypes = [PacketType.CloseRequest, PacketType.CloseAnnounce, PacketType.CloseAcknowledge] func handlePacket(data: DataReader, type: PacketType) { switch type { case .CloseRequest: handleCloseRequest() break case .CloseAnnounce: handleCloseAnnounce() break case .CloseAcknowledge: if let packet = CloseAcknowledge.deserialize(data) {handleCloseAcknowledge(packet)} break default: log(.Medium, error: "Unknown packet type.") } } }
[ -1 ]
e9c1bd638b16e492dc893b0ffbf79228378f2e17
d843eefd2cffa989eadfad7476c720771d08d675
/CustomLoginandCardGame/CustomLogin/Assets /Code_with_Chris/CWC Learn Swift 2019 Challenges/XCode playground files/Challenge 10 playground.playground/Contents.swift
6249c2f2e5f84a4a79f3d17226328dbb47fabfe1
[]
no_license
MohamedPicault/iOS-Projects
bcf7b767203a6007d128181c1c5f1147e4f10dd1
82370b8fd982003d0004c262937510a6a0b07342
refs/heads/master
2022-12-19T19:35:09.773612
2020-09-26T23:54:26
2020-09-26T23:54:26
292,710,498
0
0
null
null
null
null
UTF-8
Swift
false
false
1,449
swift
import UIKit import Foundation class Pets{ var name:String = "" var age:Int = 0 func feed(){ print("\(name) has been fed"); } func clean(){ print("\(name) has taken a bath"); } func play(){ print("\(name) enjoyed playing with you"); } func sleep(){ print("\(name) went to sleep"); } } class Tamagotchi : Pets{ var hunger:Int = 0 var dirt:Int = 0 var boredom:Int = 0 var drowsiness:Int = 0 override func feed(){ super.feed(); hunger = 0; dirt += 20; boredom += 20; drowsiness += 10; } override func clean(){ super.clean(); dirt = 0; boredom += 20; hunger += 20; drowsiness += 10; } override func play(){ super.play(); boredom = 0; dirt += 20; hunger += 20; drowsiness += 10; } override func sleep(){ super.sleep(); drowsiness = 0; hunger += 20; boredom += 20; dirt += 10; } func check(){ print("hunger: \(hunger)"); print("dirt: \(dirt)"); print("boredom: \(boredom)"); print("drowsiness: \(drowsiness)"); } } var game = Tamagotchi() game.name = "bunny" game.play() game.play() game.check() game.feed() game.check() game.clean() game.check() game.sleep() game.check()
[ -1 ]