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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e574c8f42350fa09cd553985518e4fd30cc59dea
|
aeb85da79afd534c037d0af3bb966ceec3236920
|
/Rock Tracks/ViewController/TrackDetailViewController.swift
|
14570ab1ffcc850dfaab778809893e8d6cef9a02
|
[] |
no_license
|
ShikhaIos/RockTracks
|
8bd96386e3a5718f7693d661306e32bbb47fd866
|
dbc730c81177b35118eb49d2c6fd6bee888850c8
|
refs/heads/master
| 2021-09-08T12:32:15.391689 | 2018-03-09T17:13:02 | 2018-03-09T17:13:02 | 124,567,275 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,992 |
swift
|
//
// TrackDetailViewController.swift
// Rock Tracks
//
// Created by shikha on 09/03/18.
// Copyright © 2018 shikha . All rights reserved.
//
import UIKit
import SafariServices
class TrackDetailViewController: UIViewController {
var objTrackDetail : Track?
@IBOutlet weak var labelReleaseDate: UILabel!
@IBOutlet weak var labelTrackPrice: UILabel!
@IBOutlet weak var labelAristName: UILabel!
@IBOutlet weak var labelTrackName: UILabel!
@IBOutlet weak var selectedImge: UIImageView!
override func viewDidLoad() {
super.viewDidLoad()
if let photo = objTrackDetail
{
let catPictureURL = URL(string: photo.artworkUrl100)!
let session = URLSession(configuration: .default)
let downloadPicTask = session.dataTask(with: catPictureURL) { (data, response, error) in
if let e = error {
print("Error downloading picture: \(e)")
} else {
if let res = response as? HTTPURLResponse {
print("Downloaded picture with response code \(res.statusCode)")
if let imageData = data {
let image = UIImage(data: imageData)
self.selectedImge.image = image
} else {
print("Couldn't get image: Image is nil")
}
} else {
print("Couldn't get response code for some reason")
}
}
}
downloadPicTask.resume()
labelTrackName.text = objTrackDetail?.trackName
labelAristName.text = objTrackDetail?.artistName
if let obj = objTrackDetail?.trackPrice
{
labelTrackPrice.text = String(describing: obj)
}
labelReleaseDate.text = objTrackDetail?.releaseDate
}
// Do any additional setup after loading the view.
}
@IBAction func btnMoreDetailAction(_ sender: Any) {
let url = URL(string: (objTrackDetail?.trackViewUrl)!)
let vc = SFSafariViewController(url: url!)
present(vc, animated: true, completion: nil)
//UIApplication.shared.openURL(URL(string: (objTrackDetail?.trackViewUrl)!)!)
}
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
] |
53290461568b7b9540090bab2abfc90bbebb8520
|
0c91a97a9952809f910e5dcfc495e1378732f572
|
/KitApp/Views/Custom Cells/TextFieldTableViewCell.swift
|
691bfa29086b7ed81a6f9559b96c0a9499b2de37
|
[] |
no_license
|
lengjoy/KitappIOS
|
a4f665d8721906ae1c6e3174264c7a85c155868e
|
20ddb36dfe38f031e124b2f67ee38208377327a7
|
refs/heads/master
| 2022-12-19T01:32:07.785350 | 2020-09-28T09:50:15 | 2020-09-28T09:50:15 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 4,207 |
swift
|
//
// TextFieldTableViewCell.swift
// KitApp
//
// Created by Kenneth Esguerra on 5/25/20.
// Copyright © 2020 Kenneth Esguerra. All rights reserved.
//
import UIKit
enum TextFieldTableViewCellType {
case email
case password
case userType
case storeName
case ownerName
case inputPacks
case inputRewards
}
class TextFieldTableViewCell: UITableViewCell, NibLoadableView, ReusableView, CellConfigurable {
@IBOutlet weak var textField: UITextField!
@IBOutlet weak var headerLabel: UILabel!
@IBOutlet weak var textFieldButton: UIButton!
@IBOutlet weak var dropdownIcon: UIImageView!
var viewModel: TextFieldCellViewModel?
var isCellEnabled = true {
didSet {
isUserInteractionEnabled = isCellEnabled
refresh()
}
}
func setup(viewModel: RowViewModel) {
if let textFieldCellViewModel = viewModel as? TextFieldCellViewModel {
self.viewModel = textFieldCellViewModel
textField.text = self.viewModel?.text.value
textField.placeholder = self.viewModel?.placeholder ?? ""
textField.keyboardType = self.viewModel?.keyboardType ?? .default
textField.isSecureTextEntry = self.viewModel?.isSecure ?? false
headerLabel.text = self.viewModel?.placeholder ?? ""
isCellEnabled = self.viewModel?.enabled.value ?? false
self.viewModel?.enabled.addObserver(fireNow: false, { (enabled) in
self.isCellEnabled = enabled
})
textFieldButton.isHidden = !textFieldCellViewModel.isButtonType
dropdownIcon.isHidden = !textFieldCellViewModel.isButtonType
textFieldCellViewModel.text.addObserver(fireNow: false) { (text) in
self.textField.text = text
}
refresh()
}
}
func refresh() {
textField.alpha = isCellEnabled == true ? 1.0 : 0.50
}
override func awakeFromNib() {
super.awakeFromNib()
setupTextField()
}
fileprivate func setupTextField() {
// Initialization code
textField.isSecureTextEntry = false
textField.keyboardType = .default
textField.delegate = self
textField.clearButtonMode = .whileEditing
textField.addTarget(self, action: #selector(textFieldEditingChanged(_:)), for: UIControl.Event.editingChanged)
textField.addDoneButtonToKeyboard(myAction: #selector(textField.resignFirstResponder))
textField.borderStyle = .none
textField.backgroundColor = Constants.ColorTheme.systemGray6 // Use anycolor that give you a 2d look.
//To apply corner radius
textField.layer.cornerRadius = bounds.height / 2.0
//To apply border
textField.layer.borderWidth = 0.25
textField.layer.borderColor = UIColor.white.cgColor
//To apply Shadow
textField.layer.shadowOpacity = 1
textField.layer.shadowRadius = 4.0
textField.layer.shadowOffset = CGSize.zero // Use any CGSize
textField.layer.shadowColor = UIColor.gray.cgColor
//To apply padding
let paddingView : UIView = UIView(frame: CGRect(x: 0, y: 0, width: 20, height: textField.frame.height))
textField.leftView = paddingView
textField.leftViewMode = UITextField.ViewMode.always
}
@IBAction func buttonPressed(_ sender: UIButton) {
viewModel?.buttonPressed?()
}
}
extension TextFieldTableViewCell: UITextFieldDelegate {
func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
let count = (textField.text?.count ?? 0) + string.count
let max = viewModel?.maxCharLimitCount ?? 0
return max >= count
}
@objc func textFieldEditingChanged(_ textField: UITextField) {
viewModel?.text.value = textField.text ?? ""
}
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
textField.resignFirstResponder()
return true
}
}
|
[
-1
] |
ca2d92aa3eadc7043392d3735fef4d1924744525
|
63a0b85998baadbcfb497df7a0887197d448567e
|
/MovieApp/UI/Home/HomeCollectionViewCell.swift
|
cd304b6806a87d2046f059d4b53415aba5dcc1fc
|
[] |
no_license
|
Bugrayenidunya/MovieApp
|
abd3fa9b65e06ceab28abbd0f799d4f37160f546
|
96183f3fe1820df71129daa1f8f738eae42e0e5b
|
refs/heads/main
| 2022-12-23T13:56:02.510356 | 2020-10-05T15:41:18 | 2020-10-05T15:41:18 | 301,373,380 | 0 | 0 | null | 2020-10-05T10:41:43 | 2020-10-05T10:38:43 | null |
UTF-8
|
Swift
| false | false | 262 |
swift
|
//
// HomeCollectionViewCell.swift
// TMDb-Movie-app
//
// Created by Bugra's Mac on 30.09.2020.
//
import UIKit
class HomeCollectionViewCell: UICollectionViewCell {
// MARK: Outlets
@IBOutlet weak var nowPlayingImage: UIImageView!
}
|
[
-1
] |
3db37437a39651fcb33c12ca91d294ac71daf09d
|
1f4c9d70aab05714b5018ed7c2a11b11133e1ef0
|
/String+Case.swift
|
7b75fdc2724d0e457587d467aa6546dfc7ff87c6
|
[] |
no_license
|
martintjandra/iOS-Libraries
|
14c748782a072f5a657d5e7336dbe6614e636661
|
ec5cd5e704811a5e637a233d87b1e5f87aa7890c
|
refs/heads/master
| 2021-01-11T01:48:45.740911 | 2016-10-12T04:44:13 | 2016-10-12T04:44:13 | 70,662,666 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 509 |
swift
|
//
// String+Case.swift
// iOPS
//
// Created by Martin Tjandra on 9/5/16.
// Copyright © 2016 Martin Darma Kusuma Tjandra. All rights reserved.
//
import Foundation
extension String {
func snakeCase()->String {
var result = "";
for i in 0..<self.characters.count {
let ch = String(self[self.startIndex.advancedBy(i)]);
if ch.lowercaseString != ch { result += " " }
result += ch.lowercaseString;
}
return result;
}
}
|
[
-1
] |
d6488347896df79878b1f4bc654237277510ed69
|
cafc8efe552950fe56edc949d9e06bea12552800
|
/7. 옵셔널.playground/Contents.swift
|
c1f1bd4ec1d93930e8fae57413d8ff427eb0ae93
|
[] |
no_license
|
iAmSomething/SwiftStudy
|
4790f06ab246cb01267ff71cf09e8e897c7dc8c2
|
0b8664afcd42f2718e113f98fba428069613fd71
|
refs/heads/master
| 2023-02-19T05:20:12.976543 | 2021-01-23T07:15:43 | 2021-01-23T07:15:43 | 282,862,684 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 124 |
swift
|
import UIKit
var name : String = "김태훈"
//name = nil // 오류
var myName : String? = "김태훈"
myName = nil
Signal
|
[
-1
] |
42e90c41d7c14b79fde050cbe143623b5911a96a
|
ac561c331757603b951829ccdb05e4bb8a5487b6
|
/Youtube/Model/MenuBar.swift
|
177cc14487ab630f9c9c95f59d05177b26524c0a
|
[] |
no_license
|
TTNguyenDev/Youtube
|
665ad3ef6cf5a5591813d3b98bf4e05dff44d9c5
|
b56c347ba05a69e224d7affd1f3d1be442e55ad6
|
refs/heads/master
| 2020-03-31T07:28:38.006463 | 2018-10-14T13:40:26 | 2018-10-14T13:40:26 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 3,203 |
swift
|
import UIKit
class MenuBar: UIView, UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout {
let cellId = "cellId"
let imageNames = ["home", "trending", "subscriptions", "account"]
var horizontalBarLeftConstraint: NSLayoutConstraint?
var homeController: HomeController?
lazy var collectionView: UICollectionView = {
let layout = UICollectionViewFlowLayout()
let cv = UICollectionView(frame: .zero, collectionViewLayout: layout)
cv.backgroundColor = .white
cv.dataSource = self
cv.delegate = self
return cv
}()
func setupHorizontalBar() {
let horizontalBarView = UIView()
horizontalBarView.backgroundColor = .red
horizontalBarView.translatesAutoresizingMaskIntoConstraints = false
addSubview(horizontalBarView)
horizontalBarLeftConstraint = horizontalBarView.leftAnchor.constraint(equalTo: self.leftAnchor)
horizontalBarLeftConstraint?.isActive = true
horizontalBarView.topAnchor.constraint(equalTo: self.topAnchor).isActive = true
horizontalBarView.widthAnchor.constraint(equalTo: self.widthAnchor, multiplier: 1/4).isActive = true
horizontalBarView.heightAnchor.constraint(equalToConstant: 4).isActive = true
}
override init(frame: CGRect) {
super.init(frame: frame)
collectionView.register(MenuCell.self, forCellWithReuseIdentifier: cellId)
addSubview(collectionView)
addConstraintsWithForMat(format: "H:|[v0]|", views: collectionView)
addConstraintsWithForMat(format: "V:|[v0]|", views: collectionView)
//default selected item in collectionView
let selectedIndexPath = IndexPath(item: 0, section: 0)
collectionView.selectItem(at: selectedIndexPath, animated: false, scrollPosition: .left)
setupHorizontalBar()
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return imageNames.count
}
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: cellId, for: indexPath) as! MenuCell
cell.imageView.image = UIImage(named: imageNames[indexPath.item])?.withRenderingMode(.alwaysTemplate)
return cell
}
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat {
return 0
}
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
return CGSize(width: frame.width/4, height: frame.height)
}
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
homeController?.scrollToMenuIndex(menuIndex: indexPath.item)
}
}
|
[
169382,
140652,
403537,
399186,
418065,
403483,
399358
] |
e6879a5477c5df030ad31a3254ff8f08be61a3f5
|
cd3e25d96d667ad7c2d7fa8f52262b4bc6d70e64
|
/TrackerTests/ProjectTests.swift
|
ced6d6e0c037de48f78d939a0358c9039895fc33
|
[] |
no_license
|
cbata/tracker
|
fd4068d9b4ddf9d94d35eb44509d4235212f0065
|
0911150af78fbece6b96e71e68475bb60798ddd1
|
refs/heads/main
| 2023-03-23T13:44:40.053704 | 2021-03-17T16:18:12 | 2021-03-17T16:18:12 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,153 |
swift
|
//
// ProjectTests.swift
// TrackerTests
//
// Created by Chris Bata on 3/13/21.
//
import CoreData
import XCTest
@testable import Tracker
class ProjectTests: BaseTestCase {
func testCreatingProjectAndItems() {
let targetCount = 10
for _ in 0..<targetCount {
let project = Project(context: managedObjectContext)
for _ in 0..<targetCount {
let item = Item(context: managedObjectContext)
item.project = project
}
}
XCTAssertEqual(dataController.count(for: Project.fetchRequest()), targetCount)
XCTAssertEqual(dataController.count(for: Item.fetchRequest()), targetCount * targetCount)
}
func testDeletingProjectCascadeDeletesItems() throws {
try dataController.createSampleData()
let request = NSFetchRequest<Project>(entityName: "Project")
let projects = try managedObjectContext.fetch(request)
dataController.delete(projects[0])
XCTAssertEqual(dataController.count(for: Project.fetchRequest()), 4)
XCTAssertEqual(dataController.count(for: Item.fetchRequest()), 40)
}
}
|
[
-1
] |
e07f95949e986cfd1413b016521b9a8b4a9fdf29
|
bb28475dae34e6c85b0cb55f10b40c3b66e26ac0
|
/LightProject/Light/ViewController.swift
|
62a48d60e945e5415fdc2ac3f3094f2f782b3798
|
[] |
no_license
|
qtd6055/LightProject
|
608a06bb9e35c36cdb1947fe0008b7c771173f2b
|
a27b5cfc639ff33476fecc2aadfff1caebc3fde9
|
refs/heads/master
| 2020-08-07T11:41:31.180313 | 2019-10-07T16:54:46 | 2019-10-07T16:54:46 | 213,436,249 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 812 |
swift
|
//
// ViewController.swift
// Light
//
// Created by Quinlan Day on 10/2/19.
// Copyright © 2019 Quinlan Day. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
var lightOn = true
@IBOutlet weak var normalColors: UIButton!
@IBOutlet weak var halloweenColors: UIButton!
@IBAction func buttonPressed(_ sender: Any) {
normalColors.setTitle("Normal", for: .normal)
lightOn = !lightOn
updateUI()
}
func updateUI() {
view.backgroundColor = lightOn ? .white : .black
}
@IBAction func colorChanger(_ sender: Any) {
halloweenColors.setTitle("Halloween", for: .normal)
lightOn = !lightOn
newUI()
}
func newUI() {
view.backgroundColor = lightOn ? .orange : .black
}
}
|
[
-1
] |
e2b25771af6ac5c03f00b1ffe9f63117d8d5bf0d
|
5560739e7cff1f27b181eff9806e09d6f02de340
|
/Sources/GuessGameEngine/Command/EngineCommandFactory.swift
|
b3a7e93da0eb098096fc9abdd9d30ff8fd8e1c33
|
[
"Apache-2.0"
] |
permissive
|
nightshiftdev/GuessGameEngine
|
c325a29458c471477cfd74c13ab9fa43825b8de7
|
6b1647a96ad676b1e093a281730fd31d036dd005
|
refs/heads/master
| 2022-11-12T11:27:08.389650 | 2020-06-21T14:13:36 | 2020-06-21T14:13:36 | 262,178,030 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 718 |
swift
|
//
// EngineCommandFactory.swift
// GuessGame
//
// Created by Pawel Kijowski on 3/25/20.
// Copyright © 2020 Pawel Kijowski. All rights reserved.
//
import Foundation
internal struct EngineCommandFactory : CommandFactory {
func makeCommand(params: [String : Any]) -> Command? {
guard let type = params["type"] as? String else { return nil }
switch type {
case PlayerInputCommand.type:
return PlayerInputCommand(params:params)
case ConfigureGameCommand.type:
return ConfigureGameCommand(params:params)
case ResetEngineCommand.type:
return ResetEngineCommand(params:params)
default:
return nil
}
}
}
|
[
-1
] |
711ce6d51a8a832cae7f8ee5e4daf0bd22f1e56e
|
5a3b7862eb0c4a821200b892f3725970bd41971f
|
/Appetite/Extensions/Sequence.swift
|
a7d875682d60365b557a8eee0fc66b3f0719af21
|
[] |
no_license
|
adrianpk/appetite-ios-ib
|
cc8d04352ff7fe04c6f2030ad68d75bdb65f51d7
|
eebd6b2580d669021bfe2b4c0aa0ac31c2c4a2ab
|
refs/heads/master
| 2020-05-20T16:38:45.838852 | 2018-12-23T19:17:40 | 2018-12-23T19:17:40 | 185,670,126 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 446 |
swift
|
//
// Sequence.swift
// Appetite
//
// Created by Adrian on 11/30/16.
// Copyright © 2016 Kuguar. All rights reserved.
//
import Foundation
public extension Sequence {
func categorise<U : Hashable>(_ key: (Iterator.Element) -> U) -> [U:[Iterator.Element]] {
var dict: [U:[Iterator.Element]] = [:]
for el in self {
let key = key(el)
if case nil = dict[key]?.append(el) { dict[key] = [el] }
}
return dict
}
}
|
[
-1
] |
705ef2795a813184530286cacdab42115da01233
|
a3d32e5590c62fd627e0ec9b480e049d8dde7b5b
|
/talento/Model/EntryModel 2.swift
|
154e1fc92598b02b1a3b8bea5cc174b797ab23f0
|
[] |
no_license
|
Julianlrn/talento
|
ae2a4e4eb7997f6872be8006a9e72db6f66561d2
|
586e3bcb3997bffdd182a756329a8ef88dc9621b
|
refs/heads/master
| 2020-09-29T00:20:48.347913 | 2020-02-04T20:00:02 | 2020-02-04T20:00:02 | 226,900,268 | 1 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,393 |
swift
|
//
// EntryModel.swift
// talento
//
// Created by Gökay Inan on 20.01.20.
// Copyright © 2020 JulianLorenz. All rights reserved.
//
import SwiftUI
import Firebase
public class observer: ObservableObject {
@Published var entries = [entry]()
init() {
let db = Firestore.firestore()
db.collection("entries").getDocuments { (snap, err) in
if err != nil {
print((err?.localizedDescription)!)
return
}
for item in snap!.documents {
let id = item.documentID
let author = item.get("author") as! String
let image = item.get("image") as! String
let likes = item.get("likes") as! Double
self.entries.append(entry(id: id, author: author, image: image, likes: likes, swipe: 0, degree: 0))
}
}
}
func update(id : entry, value : CGFloat, degree : Double) {
for i in 0..<self.entries.count {
if self.entries[i].id == id.id {
self.entries[i].swipe = value
self.entries[i].degree = degree
}
}
}
}
struct entry: Identifiable {
var id: String
var author: String
var image: String
var likes: Double
var swipe: CGFloat
var degree : Double
}
|
[
-1
] |
4f4f99e65aa77a5ca5f952073dec0f885ac74c5b
|
d6c8ca74e8faa48b6b537d4dd683c68842f2a0b6
|
/iOS/Gastos/Gastos/AppDelegate.swift
|
25ae5eb2060b5291a8a921e0a298316b292ad1c4
|
[] |
no_license
|
joffilyfe/graduacao
|
3f7bff56a17778fe91ea8ca2ca3ada7e1ef50660
|
f3587964cff8bc9745b882a2ee1f1c4d37afa42c
|
refs/heads/master
| 2021-01-24T10:53:01.937280 | 2017-05-16T11:00:47 | 2017-05-16T11:00:47 | 70,293,205 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,634 |
swift
|
//
// AppDelegate.swift
// Gastos
//
// Created by admin on 28/03/17.
// Copyright © 2017 Joffily. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
var cadastro:Cadastro!
func arquivo() -> String {
return NSSearchPathForDirectoriesInDomains(FileManager.SearchPathDirectory.documentDirectory, FileManager.SearchPathDomainMask.userDomainMask, true)[0] + "/gastos"
}
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
let obj = NSKeyedUnarchiver.unarchiveObject(withFile: self.arquivo())
if (obj != nil){
self.cadastro = obj as! Cadastro
} else {
self.cadastro = Cadastro()
}
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.
NSKeyedArchiver.archiveRootObject(self.cadastro, toFile: self.arquivo())
}
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:.
}
}
|
[
291330,
296450,
229380,
240132,
315396,
229383,
230919,
150025,
229385,
295945,
229388,
230413,
229391,
290321,
229394,
234003,
293908,
290325,
229399,
140312,
234520,
229402,
290328,
290332,
229405,
175134,
234526,
241693,
291361,
289317,
296486,
296446,
290344,
294440,
296488,
294443,
157229,
290349,
294445,
234546,
284211,
157236,
284213,
40502,
234038,
290356,
234553,
293939,
300088,
290877,
313406,
230465,
159811,
160835,
234563,
336964,
300108,
192589,
311375,
212560,
203857,
296021,
111193,
315482,
233567,
200801,
230497,
234593,
292452,
234597,
292454,
299105,
296040,
299109,
45163,
300139,
19053,
292461,
303212,
234610,
295538,
292470,
299126,
292473,
294521,
234620,
292989,
288895,
292479,
292993,
284292,
301706,
290445,
162964,
187542,
302231,
234648,
302233,
284314,
286876,
298655,
299167,
284322,
299684,
300197,
205991,
295595,
288940,
294063,
293555,
303797,
294072,
284346,
296634,
299200,
199364,
234692,
284358,
302075,
299720,
158409,
286922,
206539,
294601,
299723,
299726,
230607,
319694,
131281,
212690,
295633,
317138,
294625,
310498,
296163,
298216,
289513,
294634,
323304,
230128,
302838,
205564,
289532,
310015,
295685,
234760,
138505,
291593,
294664,
300299,
319243,
295695,
177424,
234258,
295701,
296215,
234264,
234266,
294682,
234272,
287009,
233766,
299814,
292143,
298294,
234296,
300344,
230202,
282942,
289087,
293696,
298306,
294211,
307012,
230727,
292681,
295755,
377676,
305485,
234319,
233808,
290807,
233815,
292700,
230241,
196963,
292197,
290302,
310632,
296812,
298860,
162671,
293232,
290161,
136562,
177011,
234356,
230773,
292721,
296305,
290171,
290174,
291711,
292734,
294785,
295808,
299391,
183172,
294276,
298372,
224647,
298377,
291212,
299405,
289166,
304013,
230800,
224657,
234899,
297363,
58262,
289687,
291222,
291226,
337306,
234396,
291742,
61855,
289700,
234405,
291238,
293798,
291241,
293802,
310703,
291247,
241072,
291760,
297391,
293811,
299444,
124853,
291254,
292279,
293304,
298424,
289210,
289724,
291260,
294844,
290751,
296894,
299457,
213954,
234434,
293314,
296900,
337862,
151495,
230860,
306640,
230865,
222676,
292823,
293336,
293849,
299481,
300507,
301015,
176605,
293343,
298975,
289762,
291299,
293346,
127463,
298984,
292329,
339431,
292843,
176620,
183277,
231404,
298988,
300527,
291314,
293364,
291317,
316917,
234487,
127480,
300537,
121850,
291323,
299006
] |
ed4c9dd86c7e66a89d29425cd2b4a5a2f3f9995a
|
9040ee2e94fad87b1d41185b3b1af516861f86da
|
/ImagesGridViewTests/MockData/URLSessionMock.swift
|
614e201018e964144fdf65c86d7bee0ff2c9fc3e
|
[] |
no_license
|
usmaanirfan/ImagesGridView
|
2ca317a1ae94e4adb74cc2b766bb12a5c2991b2c
|
29c3822a391a122e1bec12d62d43acea13ecba81
|
refs/heads/main
| 2023-03-10T14:34:48.140417 | 2021-02-24T00:13:42 | 2021-02-24T00:13:42 | 341,724,957 | 1 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,300 |
swift
|
//
// URLSessionMock.swift
// ImagesGridViewTests
//
// Created by Usman Ansari on 23/02/21.
// Copyright © 2021 Usman Ansari. All rights reserved.
//
import Foundation
@testable import ImagesGridView
class URLSessionMock: URLSessionProtocol {
func dataTask(with reuest: URLRequest, completionHandler: @escaping (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTask {
var filePath : String?
if reuest.url?.absoluteString.contains("search") == true {
if let path = Bundle.main.path(forResource: "SearchDetailData", ofType: "json") {
filePath = path
}
} else {
if let path = Bundle.main.path(forResource: "PhotoDetailData", ofType: "json") {
filePath = path
}
}
if let path = filePath {
do {
let response = HTTPURLResponse(url: reuest.url!, statusCode: 200,
httpVersion: nil, headerFields: nil)!
let data = try Data(contentsOf: URL(fileURLWithPath: path), options: .mappedIfSafe)
defer { completionHandler(data, response, nil) }
} catch {
// handle error
}
}
return URLSessionDataTaskMock()
}
}
|
[
-1
] |
ae977b51910f5422fd9f91712e1411263718dfa4
|
5d2c73943a06ca4c86df0654fb3270a71df2a215
|
/Source/RandomNotification/NotificationDelegate.swift
|
ae9903ef093148577d996359e6e04701f903839a
|
[
"MIT"
] |
permissive
|
CalebeEmerick/RandomNotification
|
bad82d2e97451e9aa9f267145e310e0825f56575
|
008d282e5f2314a22a356afb86c0c1cfb3dd8086
|
refs/heads/master
| 2021-01-12T06:57:55.254092 | 2017-01-21T21:54:06 | 2017-01-21T21:54:06 | 76,876,854 | 0 | 1 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,568 |
swift
|
//
// NotificationDelegate.swift
// RandomNotification
//
// Created by Calebe Emerick on 23/12/16.
// Copyright © 2016 CalebeEmerick. All rights reserved.
//
import UIKit
import UserNotifications
final class NotificationDelegate : NSObject {
weak var controller: UIViewController?
fileprivate var directoryUrl: URL?
deinit {
directoryUrl?.stopAccessingSecurityScopedResource()
}
}
extension NotificationDelegate : UNUserNotificationCenterDelegate {
func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Swift.Void) {
completionHandler([.alert, .badge, .sound])
}
func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Swift.Void) {
guard response.actionIdentifier != NotificationIdentifier.dismiss else {
completionHandler()
return
}
guard let attachment = response.notification.request.content.attachments.first else { return }
guard attachment.url.startAccessingSecurityScopedResource() else { return }
let router = HomeRouter(pass: controller)
let image = RFileManager.shared.currentImage
let title = response.notification.request.content.title
router.showDetail(with: image, title: title)
completionHandler()
}
}
|
[
-1
] |
630cbe88a41c71e20e0804f4563ff4ddfe50a118
|
24b8c258e99e4c3f7a8d97ffe2b1783cc2aa8879
|
/CoreDataTeste2/Models/Shift.swift
|
ee9b0ad0c18819735f3fdf52c58f995174a2cf6d
|
[
"MIT"
] |
permissive
|
frsoares/CoreDataTest
|
07e47fa4a639dd3236641fe9df0c9cac6bcfeca5
|
a9be67996ad05680dae6ebb7f0e4d19c1d20900d
|
refs/heads/main
| 2022-10-07T21:02:19.727622 | 2022-08-24T02:47:44 | 2022-08-24T02:47:44 | 131,215,869 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 304 |
swift
|
//
// Shift.swift
// CoreDataTeste2
//
// Created by Francisco Soares on 26/04/18.
// Copyright © 2018 Francisco Soares. All rights reserved.
//
import Foundation
import CoreData
public class Shift: NSManagedObject {
func myNameIs() -> String {
return self.doctor?.name! ?? ""
}
}
|
[
-1
] |
f328b7d8d3c52614d7348a67d7a892cff798839d
|
d3786daf3a5557fecc228b38c2c9ea91a6434ca1
|
/interviewApp/AppDelegate.swift
|
0cf6c5fa7f610adddf63cac5342b66304c19dcb9
|
[] |
no_license
|
akbapu14/Constraint-Practice
|
5c24012db967ad85356d11364f39a9da25421711
|
39fbd54f971a00576b7eaa81216642534df6a1bb
|
refs/heads/master
| 2021-01-10T14:22:38.518486 | 2016-03-18T06:00:08 | 2016-03-18T06:00:08 | 54,177,734 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,147 |
swift
|
//
// AppDelegate.swift
// interviewApp
//
// Created by Akilesh Bapu on 2/25/16.
// Copyright © 2016 justforfun. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
return true
}
func applicationWillResignActive(application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}
func applicationDidEnterBackground(application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(application: UIApplication) {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}
func applicationDidBecomeActive(application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillTerminate(application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
}
|
[
229380,
229383,
229385,
278539,
229388,
294924,
278542,
229391,
327695,
278545,
229394,
278548,
229397,
229399,
229402,
278556,
229405,
352284,
278559,
229408,
278564,
294950,
229415,
229417,
327722,
237613,
229422,
229426,
237618,
229428,
286774,
229432,
286776,
286778,
319544,
204856,
286791,
237640,
278605,
286797,
311375,
237646,
163920,
196692,
319573,
311383,
278623,
278626,
319590,
311400,
278635,
303212,
278639,
278648,
131192,
237693,
327814,
131209,
417930,
303241,
303244,
311436,
319633,
286873,
286876,
311460,
311469,
32944,
327862,
286906,
327866,
180413,
286910,
131264,
286916,
286922,
286924,
286926,
319694,
286928,
131281,
278743,
278747,
295133,
155872,
319716,
278760,
237807,
303345,
286962,
131314,
229622,
327930,
278781,
278783,
278785,
237826,
319751,
278792,
286987,
319757,
311569,
286999,
319770,
287003,
287006,
287009,
287012,
287014,
287016,
287019,
311598,
287023,
262448,
311601,
287032,
155966,
278849,
319809,
319810,
319814,
311623,
319818,
311628,
229709,
287054,
319822,
278865,
229717,
196963,
196969,
139638,
213367,
106872,
319872,
311683,
319879,
311693,
65943,
319898,
311719,
278952,
139689,
278957,
311728,
278967,
180668,
311741,
278975,
319938,
278980,
98756,
278983,
319945,
278986,
319947,
278990,
278994,
311767,
279003,
279006,
188895,
172512,
279010,
287202,
279015,
172520,
319978,
279020,
172526,
279023,
311791,
172529,
279027,
319989,
164343,
180727,
279035,
311804,
287230,
279040,
303617,
287234,
279045,
172550,
287238,
172552,
303623,
320007,
279051,
172558,
279055,
303632,
279058,
303637,
279063,
279067,
172572,
279072,
172577,
295459,
172581,
295461,
279082,
311850,
279084,
172591,
172598,
279095,
172607,
172609,
172612,
377413,
172614,
172618,
303690,
33357,
287309,
279124,
172634,
262752,
172644,
311911,
189034,
295533,
189039,
189040,
172655,
172656,
295538,
189044,
172660,
287349,
352880,
287355,
287360,
295553,
287365,
311942,
303751,
295557,
352905,
279178,
287371,
311946,
311951,
287377,
172691,
287381,
311957,
221850,
287386,
164509,
303773,
295583,
172702,
230045,
287394,
287390,
303780,
172705,
287398,
172707,
279208,
287400,
172714,
295595,
279212,
189102,
172721,
287409,
66227,
303797,
189114,
287419,
303804,
328381,
279231,
287423,
328384,
287427,
312006,
107208,
279241,
172748,
287436,
107212,
172751,
287440,
295633,
172755,
303827,
279255,
172760,
279258,
303835,
213724,
189149,
303838,
287450,
279267,
312035,
295654,
279272,
230128,
312048,
312050,
230131,
205564,
303871,
230146,
328453,
295685,
230154,
33548,
312077,
295695,
295701,
369433,
230169,
295707,
328476,
295710,
230175,
303914,
279340,
205613,
279353,
230202,
312124,
222018,
295755,
377676,
148302,
287569,
303959,
279383,
230237,
279390,
230241,
279394,
303976,
336744,
303985,
328563,
303987,
279413,
303991,
303997,
295806,
295808,
304005,
295813,
213895,
320391,
304007,
304009,
304011,
230284,
304013,
213902,
279438,
295822,
189329,
295825,
304019,
189331,
279445,
58262,
279452,
410526,
279461,
279462,
304042,
213931,
230327,
304055,
287675,
197564,
304063,
238528,
304065,
189378,
213954,
156612,
295873,
213963,
312272,
304084,
304090,
320481,
304106,
320490,
312302,
328687,
320496,
304114,
295928,
320505,
312321,
295945,
295949,
197645,
230413,
320528,
140312,
295961,
238620,
197663,
304164,
189479,
304170,
238641,
312374,
238652,
238655,
230465,
238658,
336964,
296004,
205895,
320584,
238666,
296021,
402518,
336987,
230497,
296036,
296040,
361576,
205931,
296044,
279661,
164973,
205934,
312432,
279669,
337018,
189562,
279679,
279683,
222340,
205968,
296084,
238745,
304285,
238756,
205991,
222377,
165035,
337067,
238766,
165038,
230576,
238770,
304311,
350308,
230592,
279750,
230600,
230607,
148690,
320727,
279769,
304348,
279777,
304354,
296163,
320740,
279781,
304360,
279788,
320748,
279790,
304370,
296189,
320771,
312585,
296202,
296205,
230674,
320786,
230677,
296213,
296215,
320792,
230681,
214294,
304416,
230689,
173350,
312622,
296243,
312630,
222522,
222525,
296253,
312639,
296255,
230718,
296259,
378181,
230727,
238919,
320840,
296264,
296267,
296271,
222545,
230739,
312663,
337244,
222556,
230752,
312676,
230760,
173418,
410987,
230763,
230768,
296305,
312692,
230773,
279929,
304506,
304505,
181626,
181631,
312711,
312712,
296331,
288140,
288144,
230800,
304533,
337306,
288154,
288160,
173472,
288162,
288164,
279975,
304555,
370092,
279983,
288176,
279985,
173488,
312755,
296373,
279991,
312759,
288185,
337335,
222652,
312766,
173507,
296389,
222665,
230860,
280014,
312783,
288208,
230865,
370130,
288210,
288212,
280021,
288214,
222676,
239064,
288217,
288218,
280027,
329177,
288220,
239070,
288224,
280034,
370146,
280036,
288226,
280038,
288229,
288230,
288232,
288234,
320998,
288236,
288238,
288240,
291754,
288242,
296435,
288244,
296439,
288250,
402942,
148990,
296446,
206336,
296450,
321022,
230916,
230919,
214535,
370187,
304651,
304653,
230940,
222752,
108066,
296486,
296488,
157229,
230961,
288320,
288325,
124489,
280140,
280145,
288338,
280149,
280152,
288344,
239194,
280158,
403039,
370272,
181854,
239202,
312938,
280183,
280185,
280188,
280191,
280194,
116354,
280208,
280211,
288408,
280218,
280222,
190118,
321195,
296622,
321200,
337585,
296626,
296634,
296637,
313027,
280260,
206536,
280264,
206539,
206541,
206543,
280276,
313044,
321239,
280283,
313052,
288478,
313055,
321252,
313066,
280302,
288494,
280304,
313073,
321266,
419570,
288499,
288502,
280314,
288510,
124671,
67330,
280324,
198405,
288519,
280331,
198416,
280337,
296723,
116503,
321304,
329498,
296731,
321311,
313121,
313123,
304932,
321316,
280363,
141101,
165678,
280375,
321336,
296767,
288576,
345921,
280388,
304968,
280393,
280402,
313176,
42842,
280419,
321381,
280426,
296812,
313201,
1920,
255873,
305028,
280454,
247688,
280458,
280464,
124817,
280468,
239510,
280473,
124827,
214940,
247709,
214944,
280487,
313258,
321458,
296883,
124853,
214966,
10170,
296890,
288700,
296894,
280515,
190403,
296900,
337862,
165831,
280521,
231379,
296921,
239586,
313320,
231404,
124913,
165876,
321528,
239612,
313340,
288764,
239617,
313347,
288773,
313358,
321560,
305176,
313371,
354338,
305191,
223273,
313386,
354348,
124978,
215090,
124980,
288824,
288826,
321595,
378941,
313406,
288831,
288836,
67654,
223303,
280651,
354382,
288848,
280658,
215123,
354390,
288855,
288859,
280669,
313438,
223327,
280671,
149599,
321634,
149601,
149603,
329830,
280681,
313451,
223341,
280687,
313458,
280691,
215154,
313464,
329850,
321659,
280702,
288895,
321670,
215175,
141446,
141455,
141459,
280725,
313498,
288936,
100520,
280747,
288940,
280755,
288947,
321717,
280759,
280764,
280769,
280771,
280774,
280776,
313548,
321740,
280783,
280786,
280788,
313557,
280793,
280796,
280798,
338147,
280804,
280807,
157930,
280811,
280817,
280819,
157940,
125171,
182517,
280823,
280825,
280827,
280830,
280831,
280833,
280835,
125187,
125191,
125207,
125209,
321817,
125218,
321842,
223539,
125239,
280888,
280891,
289087,
280897,
280900,
239944,
305480,
280906,
239947,
305485,
305489,
379218,
280919,
354653,
313700,
280937,
313705,
280940,
190832,
280946,
223606,
313720,
280956,
239997,
280959,
313731,
199051,
240011,
289166,
240017,
297363,
190868,
297365,
240021,
297368,
297372,
141725,
297377,
289186,
297391,
289201,
240052,
289207,
305594,
289210,
281024,
289218,
289221,
289227,
281045,
281047,
215526,
166378,
305647,
281075,
174580,
281084,
240124,
305662,
305664,
240129,
305666,
305668,
240132,
223749,
281095,
338440,
150025,
223752,
223757,
281102,
223763,
223765,
281113,
322074,
281116,
281121,
182819,
281127,
281135,
150066,
158262,
158266,
289342,
281154,
322115,
158283,
281163,
281179,
199262,
338528,
338532,
281190,
199273,
281196,
158317,
19053,
313973,
281210,
297594,
158347,
133776,
314003,
117398,
314007,
289436,
174754,
330404,
289448,
133801,
174764,
314029,
314033,
240309,
133817,
314045,
314047,
314051,
199364,
297671,
199367,
158409,
289493,
363234,
289513,
289522,
289525,
289532,
322303,
289537,
322310,
264969,
322314,
322318,
281361,
281372,
322341,
215850,
281388,
281401,
289593,
289601,
281410,
281413,
281414,
240458,
281420,
240468,
281430,
322393,
297818,
281435,
281438,
281442,
174955,
224110,
207733,
207737,
183172,
158596,
240519,
322440,
338823,
314249,
183184,
289687,
240535,
297883,
289694,
289696,
289700,
289712,
281529,
289724,
52163,
183260,
281567,
289762,
322534,
297961,
281581,
183277,
322550,
134142,
322563,
175134,
322599,
322610,
314421,
281654,
314427,
207937,
314433,
314441,
207949,
322642,
314456,
281691,
314461,
281702,
281704,
314474,
281708,
281711,
289912,
248995,
306341,
306344,
306347,
306354,
142531,
199877,
289991,
306377,
289997,
249045,
363742,
363745,
298216,
330988,
126190,
216303,
322801,
388350,
257302,
363802,
199976,
199978,
314671,
298292,
298294,
257334,
216376,
298306,
380226,
281923,
224584,
224587,
224594,
216404,
306517,
150870,
314714,
224603,
159068,
314718,
265568,
314723,
281960,
150890,
306539,
314732,
314736,
290161,
216436,
306549,
298358,
314743,
306552,
290171,
314747,
298365,
290174,
306555,
224641,
281987,
298372,
314756,
281990,
224647,
265604,
298377,
314763,
142733,
298381,
224657,
306581,
314779,
314785,
282025,
314793,
282027,
241068,
241070,
241072,
282034,
241077,
150966,
298424,
306618,
282044,
323015,
306635,
306640,
290263,
290270,
290275,
339431,
282089,
191985,
282098,
290291,
282101,
241142,
191992,
290298,
151036,
290302,
282111,
290305,
175621,
192008,
323084,
257550,
282127,
290321,
282130,
323090,
282133,
290325,
241175,
290328,
282137,
290332,
241181,
282142,
282144,
290344,
306731,
290349,
290351,
290356,
282186,
224849,
282195,
282199,
282201,
306778,
159324,
159330,
314979,
298598,
323176,
224875,
241260,
323181,
257658,
315016,
282249,
290445,
324757,
282261,
298651,
282269,
323229,
298655,
323231,
61092,
282277,
306856,
282295,
282300,
323260,
323266,
282310,
323273,
282319,
306897,
241362,
282328,
298714,
52959,
216801,
282337,
241380,
216806,
323304,
282345,
12011,
282356,
323318,
282364,
282367,
306945,
241412,
323333,
282376,
216842,
323345,
282388,
323349,
282392,
184090,
315167,
315169,
282402,
315174,
323367,
241448,
315176,
282410,
241450,
306988,
306991,
315184,
323376,
315190,
241464,
282425,
159545,
298811,
307009,
413506,
241475,
307012,
148946,
315211,
282446,
307027,
315221,
282454,
315223,
241496,
323414,
241498,
307035,
307040,
282465,
110433,
241509,
110438,
298860,
110445,
282478,
315249,
110450,
315251,
282481,
315253,
315255,
339838,
282499,
315267,
315269,
241544,
282505,
241546,
241548,
298896,
298898,
282514,
44948,
298901,
241556,
282520,
241560,
241563,
241565,
241567,
241569,
282531,
241574,
282537,
298922,
36779,
241581,
282542,
241583,
323504,
241586,
282547,
241588,
290739,
241590,
241592,
241598,
290751,
241600,
241605,
151495,
241610,
298975,
241632,
298984,
241640,
241643,
298988,
241646,
241649,
241652,
323574,
290807,
241661,
299006,
282623,
315396,
241669,
315397,
282632,
282639,
290835,
282645,
241693,
282654,
241701,
102438,
217127,
282669,
323630,
282681,
290877,
282687,
159811,
315463,
315466,
192589,
307278,
192596,
176213,
307287,
315482,
217179,
315483,
192605,
233567,
200801,
299105,
217188,
299109,
307303,
315495,
356457,
45163,
307307,
315502,
192624,
307314,
323700,
299126,
233591,
299136,
307329,
307338,
233613,
241813,
307352,
299164,
184479,
299167,
184481,
315557,
184486,
307370,
307372,
184492,
307374,
307376,
323763,
176311,
299191,
307385,
307386,
258235,
176316,
307388,
307390,
184503,
299200,
184512,
307394,
307396,
299204,
184518,
307399,
323784,
307409,
307411,
176343,
299225,
233701,
307432,
184572,
282881,
184579,
282893,
291089,
282906,
291104,
233766,
282931,
307508,
315701,
307510,
332086,
307512,
151864,
176435,
307515,
168245,
282942,
307518,
151874,
282947,
282957,
323917,
110926,
233808,
323921,
315733,
323926,
233815,
315739,
323932,
299357,
242018,
242024,
299373,
315757,
250231,
242043,
315771,
299388,
299391,
291202,
299398,
242057,
291212,
299405,
291222,
283033,
291226,
242075,
315801,
291231,
61855,
283042,
291238,
291241,
127403,
127405,
291247,
127407,
299440,
299444,
127413,
283062,
291254,
127417,
291260,
283069,
127421,
127424,
299457,
127429,
127431,
283080,
176592,
315856,
315860,
176597,
127447,
283095,
299481,
176605,
242143,
291299,
127463,
242152,
291305,
127466,
176620,
127474,
291314,
291317,
135672,
233979,
291323,
291330,
283142,
127497,
233994,
135689,
291341,
233998,
234003,
234006,
152087,
127511,
283161,
242202,
234010,
135707,
242206,
135710,
242208,
291361,
242220,
291378,
234038,
152118,
234041,
70213,
242250,
111193,
242275,
299620,
242279,
168562,
184952,
135805,
291456,
135808,
373383,
299655,
135820,
316051,
225941,
316054,
299672,
135834,
373404,
299677,
225948,
135839,
299680,
225954,
299684,
242343,
209576,
242345,
373421,
135870,
135873,
135876,
135879,
299720,
299723,
225998,
299726,
226002,
119509,
226005,
226008,
242396,
299740,
201444,
299750,
283368,
234219,
283372,
381677,
226037,
283382,
234231,
316151,
234236,
226045,
234239,
242431,
209665,
234242,
299778,
242436,
226053,
234246,
234248,
226056,
291593,
242443,
234252,
242445,
234254,
291601,
242450,
234258,
242452,
234261,
348950,
201496,
234264,
234266,
234269,
283421,
234272,
234274,
152355,
234278,
299814,
283432,
234281,
234284,
234287,
283440,
185138,
242483,
234292,
234296,
234298,
283452,
160572,
234302,
234307,
242499,
234309,
292433,
234313,
316233,
316235,
234316,
283468,
242511,
234319,
234321,
234324,
185173,
201557,
234329,
234333,
308063,
234336,
234338,
242530,
349027,
234341,
234344,
234347,
177004,
234350,
324464,
234353,
152435,
177011,
234356,
234358,
234362,
226171,
234364,
291711,
234368,
234370,
201603,
291714,
234373,
226182,
234375,
291716,
226185,
308105,
234379,
234384,
234388,
234390,
226200,
234393,
324504,
209818,
308123,
324508,
234398,
234396,
291742,
234401,
291747,
291748,
234405,
291750,
234407,
324518,
324520,
234410,
324522,
226220,
291756,
234414,
324527,
291760,
234417,
201650,
324531,
234422,
226230,
275384,
324536,
234428,
291773,
234431,
242623,
324544,
324546,
226239,
324548,
234437,
226245,
234439,
234434,
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,
324599,
234487,
234490,
234493,
234496,
316416,
234501,
275462,
308231,
234504,
234507,
234510,
234515,
300054,
234519,
316439,
234520,
234523,
234526,
234528,
300066,
234532,
300069,
234535,
234537,
234540,
144430,
234543,
234546,
275508,
234549,
300085,
300088,
234553,
234556,
234558,
316479,
234561,
316483,
234563,
308291,
234568,
234570,
316491,
300108,
234572,
234574,
300115,
234580,
234581,
300628,
234585,
275545,
242777,
234590,
234593,
234595,
300133,
234597,
234601,
300139,
234605,
234607,
160879,
275569,
234610,
300148,
234614,
398455,
234618,
275579,
144506,
234620,
234623,
226433,
234627,
275588,
234629,
242822,
234634,
275594,
234636,
177293,
234640,
275602,
234643,
226453,
275606,
234647,
275608,
308373,
234650,
234648,
308379,
234653,
283805,
324766,
119967,
234657,
300189,
324768,
242852,
283813,
234661,
300197,
234664,
275626,
234667,
316596,
308414,
234687,
300226,
308418,
226500,
234692,
300229,
308420,
283844,
283850,
300234,
300238,
300241,
316625,
300243,
300245,
316630,
300248,
300253,
300256,
300258,
300260,
234726,
300263,
300265,
161003,
300267,
300270,
300272,
120053,
300278,
316663,
275703,
300284,
275710,
300287,
283904,
300289,
292097,
300292,
300294,
275719,
300299,
177419,
283917,
300301,
242957,
177424,
275725,
349464,
283939,
259367,
283951,
292143,
300344,
226617,
283963,
243003,
226628,
283973,
300357,
177482,
283983,
316758,
357722,
316766,
292192,
316768,
218464,
292197,
316774,
243046,
218473,
284010,
136562,
324978,
275834,
333178,
275836,
275840,
316803,
316806,
226696,
316811,
226699,
316814,
226703,
300433,
234899,
226709,
357783,
316824,
316826,
144796,
300448,
144807,
144810,
284076,
144812,
144814,
144820,
284084,
284087,
292279,
144826,
144828,
144830,
144832,
144835,
284099,
144837,
38342,
144839,
144841,
144844,
144847,
144852,
144855,
103899,
300507,
333280,
226787,
218597,
292329,
300523,
259565,
300527,
259567,
308720,
226802,
316917,
308727,
292343,
300537,
316947,
308757,
308762,
284191,
284194,
284196,
235045,
284199,
284204,
284206,
284209,
284211,
284213,
194101,
284215,
194103,
284218,
226877,
284223,
284226,
243268,
292421,
226886,
284231,
128584,
284228,
284234,
276043,
317004,
366155,
284238,
226895,
284241,
194130,
284243,
276052,
276053,
284245,
284247,
317015,
235097,
284249,
284251,
243290,
284253,
300638,
284255,
243293,
284258,
292452,
292454,
284263,
177766,
284265,
292458,
284267,
292461,
284272,
284274,
276086,
284278,
292470,
292473,
284283,
276093,
284286,
276095,
284288,
292481,
276098,
284290,
325250,
284292,
292479,
292485,
284297,
317066,
284299,
317068,
276109,
284301,
284303,
276114,
284306,
284308,
284312,
284314,
284316,
276127,
284320,
284322,
284327,
276137,
284329,
284331,
317098,
284333,
284335,
276144,
284337,
284339,
300726,
284343,
284346,
284350,
276160,
358080,
284354,
358083,
276166,
284358,
358089,
276170,
284362,
276175,
284368,
276177,
284370,
317138,
284372,
358098,
284377,
276187,
284379,
284381,
284384,
284386,
358114,
358116,
276197,
317158,
358119,
284392,
325353,
284394,
358122,
284397,
276206,
284399,
358126,
358128,
358133,
358135,
276216,
358138,
300795,
358140,
284413,
358142,
284418,
358146,
317187,
317189,
317191,
284428,
300816,
300819,
317207,
284440,
300828,
300830,
276255,
325408,
284449,
300834,
300832,
227109,
317221,
358183,
186151,
276268,
300845,
194351,
243504,
284469,
276280,
325436,
358206,
276291,
366406,
276295,
300872,
153417,
284499,
276308,
284502,
317271,
178006,
276315,
292700,
284511,
227175,
292715,
300912,
284529,
292721,
300915,
284533,
292729,
317306,
284540,
292734,
325512,
169868,
276365,
284564,
358292,
284566,
350106,
284572,
276386,
284579,
276388,
358312,
284585,
317353,
276395,
292776,
292784,
276402,
358326,
161718,
276410,
276411,
358330,
276418,
276425,
301009,
301011,
301013,
292823,
301015,
301017,
358360,
292828,
276446,
153568,
276448,
276452,
276455,
292839,
292843,
276460,
276464,
178161,
227314,
276466,
276472,
325624,
317435,
276476,
276479,
276482,
276485,
317446,
276490,
292876,
276496,
317456,
317458,
243733,
243740,
317468,
317472,
325666,
243751,
292904,
276528,
243762,
309298,
325685,
325689,
276539,
235579,
235581,
325692,
178238,
276544,
284739,
292934,
276553,
243785,
350293,
350295,
194649,
227418,
309337,
350302,
227423,
194654,
194657,
178273,
276579,
227426,
194660,
227430,
276583,
309346,
309348,
276586,
309350,
309352,
309354,
276590,
350313,
350316,
350321,
284786,
276595,
227440,
301167,
350325,
350328,
292985,
301178,
292989,
292993,
301185,
350339,
317570,
317573,
350342,
227463,
350345,
350349,
301199,
317584,
325777,
350354,
350357,
350359,
350362,
276638,
350366,
284837,
153765,
350375,
350379,
350381,
350383,
129200,
350385,
350387,
350389,
350395,
350397,
350399,
227520,
350402,
227522,
301252,
350406,
227529,
309450,
301258,
276685,
276689,
309462,
301272,
276699,
309468,
194780,
309471,
301283,
317672,
276713,
317674,
325867,
243948,
194801,
227571,
309491,
276725,
309494,
243960,
276735,
227583,
227587,
276739,
211204,
276742,
227593,
227596,
325910,
309530,
342298,
276766,
211232,
317729,
276775,
211241,
325937,
276789,
325943,
211260,
260421,
276809,
285002,
276811,
235853,
276816,
235858,
276829,
276833,
391523,
276836,
276843,
293227,
276848,
293232,
186744,
285051,
211324,
227709,
285061,
317833,
178572,
285070,
178575,
285077,
178583,
227738,
317853,
276896,
317858,
342434,
285093,
317864,
285098,
276907,
235955,
276917,
293304,
293307,
293314,
309707,
293325,
317910,
293336,
235996,
317917,
293343,
358880,
276961,
227810,
293346,
276964,
293352,
236013,
293364,
301562,
317951,
309764,
301575,
121352,
236043,
317963,
342541,
55822,
113167,
277011,
317971,
309781,
309779,
55837,
227877,
227879,
293417,
227882,
309804,
293421,
105007,
236082,
285236,
23094,
277054,
244288,
129603,
318020,
301636,
301639,
301643,
277071,
285265,
399955,
309844,
277080,
309849,
285277,
285282,
326244,
318055,
277100,
277106,
121458,
170618,
170619,
309885,
309888,
277122,
227975,
277128,
285320,
301706,
318092,
326285,
318094,
334476,
277136,
277139,
227992,
285340,
318108,
227998,
318110,
137889,
383658,
285357,
318128,
277170,
342707,
154292,
277173,
293555,
318132,
285368,
277177,
277181,
318144,
277187,
277191,
277194,
277196,
277201,
137946,
113378,
203491,
228069,
277223,
342760,
285417,
56041,
56043,
277232,
228081,
56059,
310015,
285441,
310020,
285448,
310029,
285453,
228113,
285459,
277273,
293659,
326430,
228128,
285474,
293666,
228135,
318248,
277291,
293677,
318253,
285489,
293685,
285494,
301880,
285499,
301884,
310080,
293696,
277314,
277317,
277322,
277329,
162643,
310100,
301911,
277337,
301913,
301921,
400236,
236397,
162671,
326514,
310134,
277368,
15224,
236408,
416639,
416640,
113538,
310147,
416648,
277385,
39817,
187274,
301972,
424853,
277405,
277411,
310179,
293798,
293802,
236460,
277426,
293811,
293817,
293820,
203715,
326603,
293849,
293861,
228327,
228328,
228330,
318442,
228332,
277486,
326638,
318450,
293876,
293877,
285686,
302073,
285690,
121850,
302075,
244731,
293882,
293887,
277504,
277507,
277511,
277519,
293908,
277526,
293917,
293939,
318516,
277561,
277564,
310336,
7232,
293956,
277573,
228422,
310344,
277577,
293960,
277583,
203857,
310355,
293971,
310359,
236632,
277594,
138332,
277598,
285792,
277601,
203872,
310374,
203879,
277608,
310376,
228460,
318573,
203886,
187509,
285815,
285817,
367737,
285821,
302205,
285824,
392326,
285831,
253064,
302218,
285835,
294026,
384148,
162964,
187542,
302231,
285849,
302233,
285852,
302237,
285854,
285856,
285862,
277671,
302248,
64682,
277678,
294063,
228526,
294065,
302258,
277687,
294072,
318651,
294076,
277695,
318657,
244930,
302275,
130244,
302277,
228550,
302282,
310476,
302285,
302288,
310481,
302290,
203987,
302292,
302294,
302296,
384222,
310498,
285927,
318698,
302315,
195822,
228592,
294132,
138485,
204023,
228601,
204026,
228606,
204031,
64768,
310531,
285958,
228617,
138505,
318742,
204067,
277798,
130345,
277801,
113964,
285997,
277804,
285999,
277807,
113969,
277811,
318773,
318776,
277816,
286010,
277819,
294204,
417086,
277822,
286016,
294211,
302403,
277832,
384328,
277836,
294221,
326991,
294223,
277839,
277842,
277847,
277850,
179547,
277853,
146784,
277857,
302436,
277860,
294246,
327015,
310632,
327017,
351594,
277864,
277869,
277872,
351607,
310648,
277880,
310651,
277884,
277888,
310657,
351619,
294276,
310659,
277892,
327046,
253320,
310665,
318858,
277898,
277894,
277903,
310672,
351633,
277905,
277908,
277917,
310689,
277921,
277923,
130468,
228776,
277928,
277932,
310703,
277937,
310710,
130486,
310712,
277944,
310715,
277947,
302526,
228799,
277950,
277953,
64966,
245191,
163272,
302534,
310727,
277959,
292968,
302541,
277966,
302543,
277963,
310737,
277971,
277975,
228825,
163290,
277978,
310749,
277981,
277984,
310755,
277989,
277991,
187880,
277995,
286188,
310764,
278000,
278003,
310772,
228851,
278006,
212472,
278009,
40440,
40443,
286203,
228864,
40448,
286214,
228871,
302603,
65038,
302614,
286233,
302617,
302621,
286240,
146977,
187939,
294435,
40484,
286246,
294439,
286248,
278057,
294440,
294443,
40486,
294445,
40488,
310831,
40491,
212538,
40507,
40511,
40513,
228933,
40521,
286283,
40525,
40527,
228944,
212560,
400976,
40533,
147032,
40537,
40539,
278109,
40541,
40544,
40548,
40550,
286312,
286313,
40554,
40552,
310892,
40557,
40560,
188022,
122488,
294521,
343679,
278150,
310925,
286354,
278163,
302740,
122517,
278168,
327333,
229030,
212648,
278188,
302764,
278192,
319153,
278196,
302781,
319171,
302789,
294599,
278216,
294601,
302793,
343757,
212690,
278227,
229076,
286420,
319187,
286425,
319194,
278235,
301163,
229086,
278238,
286432,
294625,
294634,
302838,
319226,
286460,
278274,
302852,
278277,
302854,
294664,
311048,
352008,
319243,
311053,
302862,
294682,
278306,
188199,
294701,
278320,
319280,
319290,
229192,
302925,
188247,
237409,
294776,
360317,
294785,
327554,
40840,
40851,
294803,
188312,
294811,
319390,
294817,
319394,
40865,
294821,
311209,
180142,
294831,
188340,
40886,
319419,
294844,
294847,
393177,
294876,
294879,
294883,
294890,
311279,
278513,
237555,
278516,
311283,
278519,
237562
] |
6a706694483af45099760aaccdfc9bda51ca8ecf
|
34e48e0d031e58dfa39a3921f171be52ca894c6a
|
/TASKS/Task-2/Task-2/Protocols/Stack.swift
|
7a79b0f752a7052c436af3dedfcf82e9e382e48a
|
[] |
no_license
|
bertugyilmaz/Data-Structures-Swift
|
651864bb41445eddc2e0b4d3ae52aa2f91bcd30d
|
4089099e6cf54b733f90c110f6bc3523ff3c8230
|
refs/heads/master
| 2021-03-16T05:41:07.639802 | 2018-05-09T07:41:27 | 2018-05-09T07:41:27 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 325 |
swift
|
//
// Stack.swift
// Task-2
//
// Created by Bertuğ Yılmaz on 20.03.2018.
// Copyright © 2018 Bertuğ Yılmaz. All rights reserved.
//
import Foundation
protocol Stack {
var top: Int! { get set }
func push(object: NSObject)
func pop() -> NSObject
func peek() -> NSObject
func isEmpty() -> Bool
}
|
[
-1
] |
cc10cab2449d4e9c7ee253d5311976dd2f051b41
|
22197c0667bfeb45e2520a566b8f42fae5e94ace
|
/Cookies/main.swift
|
d7d15128a7a91e240601a95af82bf4eca34ef636
|
[] |
no_license
|
icodeforlove/BinaryCookies.swift
|
aca411d2b254abed3abbd16d6933ead99d50d0a5
|
74b1b04beadeeb4945179b3c2b21d3b8ba66365e
|
refs/heads/master
| 2021-01-01T05:49:39.021348 | 2015-08-17T18:51:10 | 2015-08-17T18:51:10 | 40,920,083 | 13 | 5 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,199 |
swift
|
import Foundation
var data = NSData(base64EncodedString: "Y29vawAAAAsAAAAMAAABkgAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAQAAAAAAAAAAAAAAAQAEAAAAHAAAAHkAAADcAAAANwEAAAAAAABdAAAAAAAAAAQAAAAAAAAAOAAAAEwAAABVAAAAVwAAAAAAAAAAAAAAAAAAZ3SDu0EAAADnIoK7QXVybGVjaG8uYXBwc3BvdC5jb20AaHR0cE9ubHkALwB2YWx1ZQBjAAAAAAAAAAUAAAAAAAAAOAAAAEwAAABbAAAAXQAAAAAAAAAAAAAAAAAAZ3SDu0EAAADnIoK7QXVybGVjaG8uYXBwc3BvdC5jb20AaHR0cE9ubHlTZWN1cmUALwB2YWx1ZQBbAAAAAAAAAAAAAAAAAAAAOAAAAEwAAABTAAAAVQAAAAAAAAAAAAAAAAAAZ3SDu0EAAADnIoK7QXVybGVjaG8uYXBwc3BvdC5jb20Abm9ybWFsAC8AdmFsdWUAWwAAAAAAAAABAAAAAAAAADgAAABMAAAAUwAAAFUAAAAAAAAAAAAAAAAAAGd0g7tBAAAA5yKCu0F1cmxlY2hvLmFwcHNwb3QuY29tAHNlY3VyZQAvAHZhbHVlAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAFjMHFyAFAAAAS2JwbGlzdDAw0QECXxAYTlNIVFRQQ29va2llQWNjZXB0UG9saWN5EAIICyYAAAAAAAABAQAAAAAAAAADAAAAAAAAAAAAAAAAAAAAKA==", options: NSDataBase64DecodingOptions(rawValue: 0));
BinaryCookies.parse(data!, callback: {
(error:BinaryCookiesError?, cookies) in
if let cookies = cookies {
print(cookies);
} else {
print(error);
}
});
CFRunLoopRun();
|
[
-1
] |
2f533f79877dcbe0cbc935a34c6e6536b481d804
|
e1bbccfc341c2c465115f4c62380bece2b6459c9
|
/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroFriendsDetailsConditionalInclusionQuery.graphql.swift
|
fa3722c5a0d21b4f25ea6c88f5bc04b9a1f3d935
|
[
"MIT"
] |
permissive
|
jabeattie/apollo-ios
|
812a6486e49db84eec6d9b19bea34ea68573875e
|
df4648bb3e83c8509f74aa76f34b023c61ab81cf
|
refs/heads/master
| 2023-07-26T20:21:14.137595 | 2023-07-12T21:24:10 | 2023-07-12T21:24:10 | 179,044,341 | 0 | 0 |
MIT
| 2019-04-02T09:30:24 | 2019-04-02T09:30:23 | null |
UTF-8
|
Swift
| false | false | 5,352 |
swift
|
// @generated
// This file was automatically generated and should not be edited.
@_exported import ApolloAPI
public class HeroFriendsDetailsConditionalInclusionQuery: GraphQLQuery {
public static let operationName: String = "HeroFriendsDetailsConditionalInclusion"
public static let operationDocument: ApolloAPI.OperationDocument = .init(
operationIdentifier: "8cada231691ff2f5a0a07c54b7332114588f11b947795da345c5b054211fbcfd",
definition: .init(
#"""
query HeroFriendsDetailsConditionalInclusion($includeFriendsDetails: Boolean!) {
hero {
__typename
friends @include(if: $includeFriendsDetails) {
__typename
name
... on Droid {
__typename
primaryFunction
}
}
}
}
"""#
))
public var includeFriendsDetails: Bool
public init(includeFriendsDetails: Bool) {
self.includeFriendsDetails = includeFriendsDetails
}
public var __variables: Variables? { ["includeFriendsDetails": includeFriendsDetails] }
public struct Data: StarWarsAPI.SelectionSet {
public let __data: DataDict
public init(_dataDict: DataDict) { __data = _dataDict }
public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Query }
public static var __selections: [ApolloAPI.Selection] { [
.field("hero", Hero?.self),
] }
public var hero: Hero? { __data["hero"] }
public init(
hero: Hero? = nil
) {
self.init(_dataDict: DataDict(
data: [
"__typename": StarWarsAPI.Objects.Query.typename,
"hero": hero._fieldData,
],
fulfilledFragments: [
ObjectIdentifier(HeroFriendsDetailsConditionalInclusionQuery.Data.self)
]
))
}
/// Hero
///
/// Parent Type: `Character`
public struct Hero: StarWarsAPI.SelectionSet {
public let __data: DataDict
public init(_dataDict: DataDict) { __data = _dataDict }
public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character }
public static var __selections: [ApolloAPI.Selection] { [
.field("__typename", String.self),
.include(if: "includeFriendsDetails", .field("friends", [Friend?]?.self)),
] }
/// The friends of the character, or an empty list if they have none
public var friends: [Friend?]? { __data["friends"] }
public init(
__typename: String,
friends: [Friend?]? = nil
) {
self.init(_dataDict: DataDict(
data: [
"__typename": __typename,
"friends": friends._fieldData,
],
fulfilledFragments: [
ObjectIdentifier(HeroFriendsDetailsConditionalInclusionQuery.Data.Hero.self)
]
))
}
/// Hero.Friend
///
/// Parent Type: `Character`
public struct Friend: StarWarsAPI.SelectionSet {
public let __data: DataDict
public init(_dataDict: DataDict) { __data = _dataDict }
public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Interfaces.Character }
public static var __selections: [ApolloAPI.Selection] { [
.field("__typename", String.self),
.field("name", String.self),
.inlineFragment(AsDroid.self),
] }
/// The name of the character
public var name: String { __data["name"] }
public var asDroid: AsDroid? { _asInlineFragment() }
public init(
__typename: String,
name: String
) {
self.init(_dataDict: DataDict(
data: [
"__typename": __typename,
"name": name,
],
fulfilledFragments: [
ObjectIdentifier(HeroFriendsDetailsConditionalInclusionQuery.Data.Hero.Friend.self)
]
))
}
/// Hero.Friend.AsDroid
///
/// Parent Type: `Droid`
public struct AsDroid: StarWarsAPI.InlineFragment {
public let __data: DataDict
public init(_dataDict: DataDict) { __data = _dataDict }
public typealias RootEntityType = HeroFriendsDetailsConditionalInclusionQuery.Data.Hero.Friend
public static var __parentType: ApolloAPI.ParentType { StarWarsAPI.Objects.Droid }
public static var __selections: [ApolloAPI.Selection] { [
.field("primaryFunction", String?.self),
] }
/// This droid's primary function
public var primaryFunction: String? { __data["primaryFunction"] }
/// The name of the character
public var name: String { __data["name"] }
public init(
primaryFunction: String? = nil,
name: String
) {
self.init(_dataDict: DataDict(
data: [
"__typename": StarWarsAPI.Objects.Droid.typename,
"primaryFunction": primaryFunction,
"name": name,
],
fulfilledFragments: [
ObjectIdentifier(HeroFriendsDetailsConditionalInclusionQuery.Data.Hero.Friend.self),
ObjectIdentifier(HeroFriendsDetailsConditionalInclusionQuery.Data.Hero.Friend.AsDroid.self)
]
))
}
}
}
}
}
}
|
[
-1
] |
f6d036a66578a9885c84e7bf28b5741a92610bbd
|
2eeff4b3b8d5d4c95782cacdbaf9818003eb078d
|
/Swipe/ProfileStuff/ProfileView.swift
|
befd926f1f45b4cfcb33d4441d18439d7734c633
|
[] |
no_license
|
faisal-Almubarak/Swipe
|
5aed333233e6735214fb292ab96038188c98306f
|
cb8f2d6a80e5240fc9eeabd277ae16c681bae792
|
refs/heads/main
| 2023-03-07T18:54:54.291806 | 2021-02-16T15:48:10 | 2021-02-16T15:48:10 | 339,447,234 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,232 |
swift
|
//
// ProfileView.swift
// Swipe
//
// Created by FAISAL ALMUBARAK on 2/19/20.
// Copyright © 2020 FAISAL ALMUBARAK. All rights reserved.
//
import Firebase
import FirebaseAuth
import SwiftUI
import SDWebImageSwiftUI
struct ProfileView: View {
var image: String
let user = Auth.auth().currentUser?.displayName as! String
var body: some View {
VStack{
ZStack{
VStack {
Spacer().frame(height: 80)
AnimatedImage(url: URL(string: self.image)!).resizable().aspectRatio(contentMode: .fill).frame(width: 100, height: 100).clipShape(Circle()).shadow(radius: 15)
Text(self.user)
.font(.title)
HStack{
Spacer()
Text("''bio''")
.font(.subheadline)
Spacer()
}
}.padding()
}.background(AnimatedImage(url: URL(string: image)!).blur(radius: 50, opaque: true).cornerRadius(30))
VStack{
PostsView()
}
}.background(Color.black).edgesIgnoringSafeArea(.all)
}
}
|
[
-1
] |
a77cf916060f86f9b096f86fa5f562e063ed9920
|
c6735c5825991f6421b09e8997dac0397ea581c9
|
/test/IRGen/dllimport.swift
|
8fc327a527f707fa95abb1ecf587a49b134e1f49
|
[
"Apache-2.0",
"Swift-exception"
] |
permissive
|
TAIPANBOX/swift
|
6b5ff6a9e8032bef746579914c4999c8ff31540c
|
48e48f22fe59b0aa7a782b01d8df4e4414e12a52
|
refs/heads/master
| 2020-04-20T22:08:36.980111 | 2019-02-04T18:32:55 | 2019-02-04T18:32:55 | 169,129,762 | 3 | 0 |
Apache-2.0
| 2019-02-04T18:49:44 | 2019-02-04T18:49:43 | null |
UTF-8
|
Swift
| false | false | 2,425 |
swift
|
// RUN: %swift -target thumbv7--windows-itanium -emit-ir -parse-as-library -parse-stdlib -module-name dllimport %s -o - -enable-source-import -I %S | %FileCheck %s -check-prefix CHECK -check-prefix CHECK-NO-OPT
// RUN: %swift -target thumbv7--windows-itanium -O -emit-ir -parse-as-library -parse-stdlib -module-name dllimport -primary-file %s -o - -enable-source-import -I %S | %FileCheck %s -check-prefix CHECK -check-prefix CHECK-OPT
// REQUIRES: CODEGENERATOR=ARM
import dllexport
public func get_ci() -> dllexport.c {
return dllexport.ci
}
public func get_c_type() -> dllexport.c.Type {
return dllexport.c.self
}
public class d : c {
override init() {
super.init()
}
@inline(never)
func f(_ : dllexport.c) { }
}
struct s : p {
func f() { }
}
func f(di : d) {
di.f(get_ci())
}
func blackhole<F>(_ : F) { }
public func g() {
blackhole({ () -> () in })
}
// CHECK-NO-OPT-DAG: declare dllimport %swift.refcounted* @swift_allocObject(%swift.type*, i32, i32)
// CHECK-NO-OPT-DAG: declare dllimport void @swift_deallocObject(%swift.refcounted*, i32, i32)
// CHECK-NO-OPT-DAG: declare dllimport void @swift_release(%swift.refcounted*)
// CHECK-NO-OPT-DAG: declare dllimport %swift.refcounted* @swift_retain(%swift.refcounted* returned)
// CHECK-NO-OPT-DAG: @"$s9dllexport1pMp" = external dllimport global %swift.protocol
// CHECK-NO-OPT-DAG: @"$sytN" = external dllimport global %swift.full_type
// CHECK-NO-OPT-DAG: declare dllimport swiftcc i8* @"$s9dllexport2ciAA1cCvau"()
// CHECK-NO-OPT-DAG: declare dllimport swiftcc %swift.refcounted* @"$s9dllexport1cCfd"(%T9dllexport1cC* swiftself)
// CHECK-NO-OPT-DAG: declare dllimport swiftcc %swift.metadata_response @"$s9dllexport1cCMa"(i32)
// CHECK-NO-OPT-DAG: declare dllimport void @swift_deallocClassInstance(%swift.refcounted*, i32, i32)
// CHECK-OPT-DAG: declare dllimport %swift.refcounted* @swift_retain(%swift.refcounted* returned) local_unnamed_addr
// CHECK-OPT-DAG: @"__imp_$s9dllexport1pMp" = external externally_initialized constant %swift.protocol*
// CHECK-OPT-DAG: declare dllimport swiftcc i8* @"$s9dllexport2ciAA1cCvau"()
// CHECK-OPT-DAG: declare dllimport swiftcc %swift.metadata_response @"$s9dllexport1cCMa"(i32)
// CHECK-OPT-DAG: declare dllimport void @swift_deallocClassInstance(%swift.refcounted*, i32, i32)
// CHECK-OPT-DAG: declare dllimport swiftcc %swift.refcounted* @"$s9dllexport1cCfd"(%T9dllexport1cC* swiftself)
|
[
83713
] |
f2ea5a57580163ba629d0e6207538b0e569050c0
|
8fbd7a5dd358b781da81cbc33c08b66f8935dd69
|
/Mock_Up/loginViewController.swift
|
2b0049c75a7ca782ed9e36378b33ccbb6a6981ae
|
[] |
no_license
|
jlai03/ios_mock_up
|
2230094f9739aed45a3f37a7d91da2802c66b0c2
|
3e1ba3dd4cbb759dfa5c6f450bff4d675e1aa79d
|
refs/heads/master
| 2021-04-24T14:03:08.219913 | 2020-04-27T20:38:41 | 2020-04-27T20:38:41 | 250,127,274 | 0 | 0 | null | 2020-04-27T20:38:42 | 2020-03-26T00:59:28 |
Swift
|
UTF-8
|
Swift
| false | false | 1,731 |
swift
|
//
// loginViewController.swift
// Mock_Up
//
// Created by Jonathan Lai on 3/31/20.
// Copyright © 2020 Silk Lab. All rights reserved.
//
import UIKit
class loginViewController: UIViewController, UINavigationControllerDelegate{
// Class texts
var username: String = ""
var password: String = ""
// TextFields - Outlets
@IBOutlet weak var Username: UITextField!
@IBOutlet weak var Password: UITextField!
// Login Button
@IBAction func Login(_ sender: Any) {
// Assign values to class texts
self.username = Username.text!
self.password = Password.text!
// Segue
performSegue(withIdentifier: "loginSegue", sender: self)
}
// Prepare for Segue
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Add code to transfer whatever info you need to attach image to given account
if (self.username != "" && self.password != ""){
let new_viewController = segue.destination as! ViewController
// copy over info
new_viewController.username = self.username
new_viewController.password = self.password
}
}
// viewdidLoad
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
}
*/
}
|
[
-1
] |
2b39b64786c3854f5a6d012a1cbf3489e86cf8a7
|
d5db905605dab8b5137226aee8dc1b458d859d55
|
/Flashcards/ViewController.swift
|
152d4cdcecab75d7cde9b0206ac2fb58041f536a
|
[] |
no_license
|
patrizelaine/StudyTool-Swift1
|
f46647aac2d75f277c085b7c1be4c2750d87b0a8
|
cff1caf349d95b2a52f4a960e3b20501cfe52bbb
|
refs/heads/master
| 2023-01-23T20:09:28.133256 | 2020-12-05T06:15:56 | 2020-12-05T06:15:56 | 312,413,815 | 0 | 0 | null | 2020-12-01T06:05:10 | 2020-11-12T22:44:42 |
Swift
|
UTF-8
|
Swift
| false | false | 7,089 |
swift
|
//
// ViewController.swift
// Flashcards
//
// Copyright © 2020 Patriz Elaine Daroy. All rights reserved.
//
import UIKit
struct Flashcard {
var question: String
var answer: String
}
class ViewController: UIViewController, UITextFieldDelegate {
var flashcardsController: ViewController!
var alert: UIAlertController!
var flashcards = [Flashcard]()
var currentIndex = 0;
var userAttemptAnswer: String = ""
@IBOutlet weak var frontLabel: UILabel!
@IBOutlet weak var backLabel: UILabel!
@IBOutlet weak var answerAttemptField: UITextField!
@IBOutlet weak var prevButton: UIButton!
@IBOutlet weak var nextButton: UIButton!
@IBOutlet weak var card: UIView!
override func viewDidLoad() {
super.viewDidLoad()
frontLabel.layer.cornerRadius = 20.0
frontLabel.clipsToBounds = true
backLabel.layer.cornerRadius = 20.0
backLabel.clipsToBounds = true
if flashcards.count==0
{
updateFlashcard(question: "Who is the best CS professor at CPP?", answer: "Dr. Yang")
}
else
{
updateLabels()
updateNextPrevButtons()
}
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
@IBAction func didTapOnCheck(_ sender: Any) {
userAttemptAnswer = answerAttemptField.text ?? ""
checkAnswer(question: flashcards[currentIndex].question, answer: flashcards[currentIndex].answer)
print (userAttemptAnswer)
}
func checkAnswer(question: String, answer: String)
{
let flashcard = Flashcard (question: question, answer: answer)
if(userAttemptAnswer == flashcard.answer)
{
answerAttemptField.layer.borderColor = UIColor.clear.cgColor
answerAttemptField.layer.borderWidth = 0
if(frontLabel.isHidden == false)
{
frontLabel.isHidden = true;
answerAttemptField.text = "";
answerAttemptField.layer.borderColor = UIColor.gray.cgColor;
}
}
else {
answerAttemptField.text = "";
answerAttemptField.layer.borderColor = UIColor.red.cgColor
answerAttemptField.layer.borderWidth = 1.0
answerAttemptField.layer.cornerRadius = 5.0
}
}
@IBAction func didTapOnFlashcard(_ sender: Any) {
if(frontLabel.isHidden == false)
{
frontLabel.isHidden = true;
}
else
{
frontLabel.isHidden = false;
}
}
func updateFlashcard(question: String, answer: String)
{
let flashcard = Flashcard (question: question, answer: answer)
answerAttemptField.layer.borderColor = UIColor.gray.cgColor;
frontLabel.text = flashcard.question
backLabel.text = flashcard.answer
flashcards.append(flashcard)
print ("Added a new flashcard")
print ("We now have \(flashcards.count) flashcards")
currentIndex = flashcards.count - 1
print ("Our current index is \(currentIndex)")
updateNextPrevButtons()
updateLabels()
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?)
{
//we know the destination of the segue is the navigation controller
let navigationController = segue.destination as! UINavigationController
//we know the navigation controller only contains a creation view controller
let creationController = navigationController.topViewController as! CreationViewController
creationController.flashcardsController = self
if segue.identifier == "EditSegue"{
creationController.initialQuestion = frontLabel.text
creationController.initialAnswer = backLabel.text
}
}
func updateLabels() {
let currentFlashcard = flashcards [currentIndex]
frontLabel.isHidden = false;
frontLabel.text = currentFlashcard.question
backLabel.text = currentFlashcard.answer
}
func updateNextPrevButtons () {
if currentIndex == flashcards.count - 1 {
nextButton.isEnabled = false
}
else {
nextButton.isEnabled = true
}
if currentIndex == 0 {
prevButton.isEnabled = false
}
else {
prevButton.isEnabled = true
}
}
@IBAction func didTapOnPrev(_ sender: Any) {
answerAttemptField.layer.borderColor = UIColor.gray.cgColor;
currentIndex = currentIndex - 1
print("current Index", currentIndex)
updateLabels()
updateNextPrevButtons()
animateCardout2()
}
@IBAction func didTapOnNext(_ sender: Any) {
answerAttemptField.layer.borderColor = UIColor.gray.cgColor;
currentIndex = currentIndex + 1
updateLabels()
updateNextPrevButtons()
animateCardout()
}
func animateCardout() {
UIView.animate(withDuration: 0.1, animations: { self.card.transform = CGAffineTransform.identity.translatedBy(x: -300, y: 0.0)}, completion: {finished in
self.updateLabels()
self.animateCardin()
})
}
func animateCardin() {
card.transform = CGAffineTransform.identity.translatedBy(x: 300.0, y: 0.0)
UIView.animate(withDuration: 0.1) {
self.card.transform = CGAffineTransform.identity
}
}
func animateCardout2(){
UIView.animate(withDuration: 0.1, animations: { self.card.transform = CGAffineTransform.identity.translatedBy(x: 300.0, y: 0.0)}, completion: { finished in
self.updateLabels()
self.animateCardin2()
})
}
func animateCardin2() {
card.transform = CGAffineTransform.identity.translatedBy(x: -300.0, y: 0.0)
UIView.animate(withDuration: 0.1) {
self.card.transform = CGAffineTransform.identity
}
}
func saveAllFlashcardsTodisk (){
let dictionaryArray = flashcards.map { (card) -> [String: String] in
return ["question": card.question, "answer": card.answer]
}
UserDefaults.standard.set(dictionaryArray, forKey: "flashcard")
print("Flashcards saved to UserDefaults")
func readSavedFlashcards () {
if let dictionaryArray = UserDefaults.standard.array (forKey: "flashcards") as? [[String:String]]{
let savedCards = dictionaryArray.map{ dictionary -> Flashcard in return Flashcard(question:dictionary["question"]!, answer:dictionary["answer"]!)
}
flashcards.append(contentsOf: savedCards)
}
}
}
}
|
[
-1
] |
f6d09cf9beff14874d9eabbb336bcce19f316a8e
|
d8215bd6eb5f84f55bd7a78c1e11d8b4919e9aff
|
/Unsplash/Modal/Albums.swift
|
691a6d7eb8f2240b5b6f753d4c895c6f49dd4826
|
[] |
no_license
|
navrozSingh/Test-Unsplash
|
812005e28fb89b1cd5751156eb7a7effb108fbde
|
6bce15ad5b0630b1cd1be87d0c0c65f495d1f6d8
|
refs/heads/master
| 2023-05-03T05:40:08.959998 | 2021-05-15T07:49:03 | 2021-05-15T07:49:03 | 367,485,121 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 479 |
swift
|
//
// Albums.swift
// Unsplash
//
// Created by Navroz on 15/05/21.
//
import Foundation
import Combine
// MARK: - Albums
typealias albums = [Album]
struct Album: Codable {
let userID, id: Int
let title: String
enum CodingKeys: String, CodingKey {
case userID = "userId"
case id, title
}
}
extension Album {
func collaboratedDetails() -> String {
"""
User Id = \(userID)
Album Id = \(id)
"""
}
}
|
[
-1
] |
12f52d104ac467da5fe0355263742b12e1971f16
|
ec4b0a4a89234a00315c8b4de800c45e3302f8da
|
/Busan_Air/AppDelegate.swift
|
5654a8475817f56c24a89fa00616a8c0ecdc92a5
|
[] |
no_license
|
Kimsihwan/Busan_Air
|
b4c2295d38875bebded4a5d09c0ae03a1e799d8f
|
0ad7f1dd6dd1aab1cf29c11f80b868c97230dae0
|
refs/heads/master
| 2020-04-01T08:34:55.987651 | 2018-10-15T02:54:40 | 2018-10-15T02:54:40 | 153,037,534 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,171 |
swift
|
//
// AppDelegate.swift
// Busan_Air
//
// Created by D7702_10 on 2018. 10. 15..
// Copyright © 2018년 ksh. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}
func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
}
|
[
229380,
229383,
229385,
278539,
294924,
229388,
278542,
229391,
327695,
229394,
278548,
229397,
229399,
229402,
352284,
229405,
278556,
278559,
229408,
278564,
294950,
229415,
229417,
327722,
237613,
229422,
360496,
229426,
237618,
229428,
286774,
286776,
319544,
286778,
204856,
229432,
286791,
237640,
286797,
278605,
311375,
163920,
196692,
319573,
311383,
278623,
278626,
319590,
311400,
278635,
303212,
278639,
131192,
278648,
237693,
303230,
327814,
303241,
131209,
417930,
303244,
311436,
319633,
286873,
286876,
311460,
311469,
32944,
327862,
286906,
327866,
180413,
286910,
286916,
295110,
286922,
286924,
286926,
319694,
286928,
131281,
278743,
278747,
295133,
155872,
319716,
237807,
303345,
286962,
303347,
131314,
229622,
327930,
278781,
278783,
278785,
237826,
319751,
286987,
319757,
286999,
319770,
287003,
287006,
287009,
287012,
287014,
287016,
287019,
311598,
287023,
262448,
311601,
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,
311728,
278967,
180668,
311741,
278975,
319938,
278980,
278983,
319945,
278986,
278990,
278994,
311767,
279003,
279006,
188895,
172512,
287202,
279010,
279015,
172520,
319978,
279020,
172526,
311791,
279023,
172529,
279027,
319989,
172534,
180727,
164343,
279035,
311804,
287230,
279040,
303617,
287234,
279045,
172550,
303623,
172552,
320007,
287238,
279051,
172558,
279055,
303632,
279058,
303637,
279063,
279067,
172572,
279072,
172577,
295459,
172581,
295461,
279082,
279084,
172591,
172598,
279095,
172607,
172609,
172612,
377413,
172614,
213575,
172618,
303690,
33357,
303696,
279124,
172634,
262752,
172644,
311911,
189034,
295533,
172655,
172656,
352880,
295538,
189039,
172660,
287349,
189040,
189044,
287355,
287360,
295553,
172675,
295557,
311942,
303751,
287365,
352905,
311946,
279178,
287371,
311951,
287377,
172691,
287381,
311957,
221850,
287386,
230045,
172702,
287390,
303773,
172705,
287394,
172707,
303780,
164509,
287398,
205479,
279208,
287400,
172714,
295595,
279212,
189102,
172721,
287409,
66227,
303797,
189114,
287419,
303804,
328381,
287423,
328384,
172737,
287427,
312005,
312006,
172748,
287436,
107212,
172751,
287440,
295633,
172755,
303827,
279255,
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,
295707,
328476,
295710,
230175,
295720,
303914,
279340,
279353,
230202,
312124,
328508,
222018,
295755,
377676,
148302,
287569,
303959,
230237,
279390,
230241,
279394,
303976,
336744,
303981,
303985,
303987,
328563,
303991,
303997,
295806,
295808,
295813,
304005,
320391,
304007,
213895,
304009,
304011,
304013,
295822,
279438,
213902,
189329,
295825,
304019,
189331,
58262,
304023,
304027,
279452,
279461,
279462,
304042,
213931,
230327,
304055,
287675,
197564,
230334,
304063,
304065,
213954,
189378,
156612,
197580,
312272,
304084,
304090,
320481,
304106,
320490,
312302,
328687,
320496,
304114,
295928,
320505,
295945,
230413,
295949,
197645,
320528,
140312,
295961,
238620,
304164,
304170,
304175,
238641,
312374,
238652,
238655,
230465,
238658,
336964,
132165,
296004,
205895,
320584,
238666,
296021,
402518,
336987,
230497,
296036,
296040,
361576,
205931,
279661,
205934,
312432,
279669,
337018,
189562,
279679,
279683,
222340,
205968,
296084,
238745,
304285,
238756,
222377,
165035,
337067,
238766,
165038,
230576,
238770,
304311,
230592,
312518,
279750,
230600,
230607,
148690,
320727,
279769,
304348,
279777,
304354,
296163,
320740,
279781,
304360,
320748,
279790,
304370,
296189,
320771,
312585,
296202,
296205,
230674,
320786,
230677,
296213,
296215,
320792,
230681,
214294,
230689,
173350,
312622,
296243,
312630,
222522,
296253,
222525,
296255,
312639,
296259,
378181,
296262,
230727,
238919,
296264,
320840,
296267,
296271,
222545,
230739,
312663,
222556,
337244,
230752,
312676,
230760,
173418,
148843,
410987,
230763,
230768,
296305,
312692,
230773,
304505,
304506,
181626,
279929,
181631,
312711,
312712,
296331,
288140,
288144,
304533,
337306,
288154,
288160,
288162,
288164,
279975,
304555,
370092,
279983,
173488,
288176,
279985,
312755,
296373,
312759,
337335,
288185,
279991,
222652,
312766,
173507,
222665,
230860,
312783,
288208,
230865,
288210,
370130,
288212,
222676,
288214,
239064,
329177,
288217,
280027,
288220,
288218,
239070,
288224,
280034,
288226,
280036,
288229,
280038,
288230,
288232,
370146,
288234,
320998,
288236,
288238,
288240,
288242,
296435,
288244,
288250,
296446,
321022,
402942,
148990,
296450,
206336,
230916,
230919,
230923,
304651,
304653,
370187,
230940,
222752,
108066,
296486,
296488,
157229,
239152,
230961,
157236,
288320,
288325,
124489,
280145,
288338,
280149,
288344,
239194,
280158,
403039,
239202,
312938,
280183,
280185,
280191,
116354,
280194,
280208,
280211,
288408,
280222,
190118,
198310,
321195,
296622,
321200,
337585,
296634,
296637,
313027,
206536,
280264,
206539,
206541,
206543,
313044,
280276,
321239,
280283,
313052,
18140,
288478,
313055,
321252,
313066,
288494,
280302,
313073,
321266,
419570,
288499,
288502,
280314,
288510,
124671,
67330,
280324,
198405,
288519,
280331,
198416,
296723,
116503,
321304,
329498,
296731,
321311,
313121,
313123,
304932,
321316,
280363,
141101,
165678,
280375,
321336,
296767,
288576,
345921,
280388,
337732,
304968,
280393,
280402,
173907,
313171,
313176,
42842,
280419,
321381,
296809,
296812,
313201,
1920,
305028,
280454,
247688,
124817,
280468,
239510,
280473,
124827,
214940,
247709,
214944,
321458,
296883,
124853,
214966,
296890,
10170,
288700,
296894,
190403,
296900,
280515,
337862,
165831,
280521,
231379,
296921,
239586,
313320,
124913,
165876,
321528,
239612,
313340,
288764,
239617,
313347,
288773,
313358,
305176,
321560,
313371,
354338,
305191,
223273,
313386,
354348,
124978,
215090,
124980,
288824,
288826,
321595,
313406,
288831,
288836,
67654,
354382,
288848,
280658,
215123,
354390,
288855,
288859,
280669,
313438,
149599,
280671,
149601,
321634,
149603,
280681,
313451,
223341,
280687,
149618,
215154,
313458,
280691,
313464,
329850,
321659,
288895,
321670,
215175,
288909,
141455,
141459,
280725,
313498,
100520,
288936,
280747,
288940,
288947,
280755,
321717,
280759,
280764,
280769,
280771,
280774,
280776,
313548,
321740,
280783,
280786,
280788,
313557,
280793,
280796,
280798,
338147,
280804,
280807,
157930,
280811,
280817,
125171,
157940,
280819,
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,
280919,
354653,
313700,
313705,
280937,
190832,
280946,
223606,
313720,
280956,
239997,
280959,
313731,
199051,
240011,
289166,
240017,
297363,
190868,
240021,
297365,
297368,
297372,
141725,
297377,
289186,
297391,
289201,
240052,
289207,
289210,
305594,
281024,
289218,
289227,
281047,
215526,
166378,
305647,
281075,
174580,
240124,
305662,
305664,
240129,
305666,
305668,
223749,
240132,
281095,
223752,
150025,
338440,
330244,
223757,
281102,
223763,
223765,
281113,
322074,
281116,
281121,
182819,
281127,
281135,
150066,
158262,
158266,
289342,
281154,
322115,
158283,
338528,
338532,
281190,
199273,
281196,
19053,
158317,
313973,
297594,
281210,
158347,
182926,
133776,
314003,
117398,
314007,
289436,
174754,
330404,
289448,
133801,
174764,
314029,
314033,
240309,
133817,
314045,
314047,
314051,
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,
174955,
224110,
207733,
207737,
158596,
183172,
338823,
322440,
314249,
240519,
183184,
142226,
289687,
240535,
297883,
289694,
289696,
289700,
289712,
281529,
289724,
52163,
183260,
281567,
289762,
322534,
297961,
183277,
281581,
322550,
134142,
322563,
314372,
330764,
175134,
322599,
322610,
314421,
281654,
314427,
314433,
207937,
314441,
322642,
314456,
281691,
314461,
281702,
281704,
314474,
281711,
289912,
248995,
306341,
306344,
306347,
322734,
306354,
142531,
199877,
289991,
289997,
249045,
363742,
363745,
298216,
330988,
216303,
322801,
388350,
257302,
363802,
199976,
199978,
314671,
298292,
298294,
216376,
380226,
298306,
224587,
224594,
216404,
306517,
150870,
314714,
224603,
159068,
314718,
265568,
314723,
281960,
150890,
306539,
314732,
314736,
290161,
216436,
306549,
298358,
314743,
306552,
290171,
314747,
306555,
298365,
290174,
224641,
281987,
298372,
314756,
281990,
224647,
298377,
314763,
314768,
224657,
306581,
314773,
314779,
314785,
314793,
282025,
282027,
241068,
241070,
241072,
282034,
150966,
298424,
306618,
282044,
323015,
306635,
306640,
290263,
290270,
290275,
339431,
191985,
290291,
282101,
241142,
191992,
290298,
151036,
290302,
290305,
306694,
192008,
323084,
257550,
282127,
290321,
282130,
290325,
282133,
241175,
290328,
290332,
241181,
282142,
282144,
290344,
306731,
290349,
290351,
290356,
28219,
282186,
224849,
282195,
282201,
306778,
159324,
159330,
314979,
323176,
224875,
241260,
323181,
257658,
315016,
282249,
290445,
324757,
282261,
175770,
298651,
282269,
323229,
298655,
323231,
61092,
282277,
306856,
196133,
282295,
323260,
282300,
323266,
282310,
323273,
282319,
306897,
241362,
306904,
282328,
298714,
52959,
216801,
282337,
241380,
216806,
323304,
282345,
12011,
282356,
323318,
282364,
282367,
306945,
241412,
323333,
282376,
216842,
323345,
282388,
323349,
282392,
184090,
315167,
315169,
282402,
315174,
323367,
241448,
315176,
241450,
282410,
306988,
306991,
315184,
323376,
315190,
241464,
159545,
282425,
298811,
118593,
307009,
413506,
307012,
298822,
315211,
307027,
315221,
315223,
241496,
241498,
307035,
307040,
110433,
282465,
241509,
110438,
298860,
110445,
282478,
315249,
110450,
315251,
315253,
315255,
339838,
315267,
315269,
241544,
282505,
241546,
241548,
298896,
298898,
282514,
241556,
298901,
44948,
241560,
282520,
241563,
241565,
241567,
241569,
282531,
241574,
282537,
241581,
241583,
323504,
241586,
282547,
241588,
290739,
241590,
241592,
241598,
290751,
241600,
241605,
151495,
241610,
298975,
241632,
298984,
241643,
298988,
241646,
241649,
241652,
323574,
290807,
299003,
241661,
299006,
282623,
315396,
241669,
315397,
282632,
282639,
290835,
282645,
241693,
241701,
102438,
217127,
282669,
323630,
282681,
290877,
282687,
159811,
315463,
315466,
192589,
307278,
192596,
307287,
307290,
217179,
315482,
192605,
315483,
233567,
299105,
200801,
217188,
299109,
307303,
315495,
356457,
45163,
307307,
315502,
192624,
307314,
323700,
299126,
233591,
299136,
307329,
315524,
307338,
233613,
241813,
307352,
299164,
299167,
315552,
184479,
184481,
315557,
184486,
307370,
307372,
307374,
307376,
299185,
323763,
184503,
176311,
299191,
307386,
258235,
307388,
307385,
307390,
176316,
299200,
307394,
299204,
307396,
184518,
307399,
323784,
233679,
307409,
307411,
299225,
233701,
307432,
282881,
282893,
323854,
291089,
282906,
291104,
233766,
307508,
315701,
332086,
307510,
307512,
307515,
307518,
282942,
282947,
323917,
110926,
282957,
233808,
323921,
315733,
323926,
233815,
276052,
315739,
323932,
299357,
242018,
242024,
299373,
315757,
250231,
242043,
315771,
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,
127434,
315856,
176592,
315860,
283095,
127447,
299481,
176605,
242143,
291299,
340454,
127463,
242152,
291305,
176620,
127469,
127474,
291314,
291317,
127480,
135672,
291323,
233979,
127485,
291330,
283142,
127497,
233994,
135689,
127500,
233998,
127506,
234003,
234006,
127511,
152087,
283161,
242202,
234010,
135707,
135710,
242206,
242208,
291361,
242220,
291378,
152118,
234038,
234041,
70213,
242250,
111193,
242275,
299620,
242279,
168562,
184952,
135805,
135808,
291456,
373383,
135820,
316051,
225941,
316054,
299672,
135834,
373404,
299677,
135839,
299680,
225954,
299684,
135844,
242343,
209576,
242345,
373421,
135870,
135873,
135876,
135879,
299720,
299723,
299726,
299740,
201444,
299750,
283368,
234219,
283372,
283382,
316151,
234231,
234236,
226045,
242431,
234239,
209665,
234242,
299778,
242436,
226053,
234246,
226056,
234248,
291593,
242443,
234252,
242445,
234254,
291601,
234258,
242450,
242452,
234261,
201496,
234264,
234266,
234269,
283421,
234272,
234274,
152355,
299814,
234278,
283432,
234281,
234284,
234287,
283440,
185138,
242483,
234292,
234296,
234298,
160572,
283452,
234302,
234307,
242499,
234309,
316233,
234313,
316235,
234316,
234319,
242511,
234321,
234324,
185173,
201557,
234329,
234333,
308063,
234336,
242530,
349027,
234338,
234341,
234344,
234347,
177004,
234350,
324464,
234353,
152435,
177011,
234356,
234358,
234362,
226171,
234364,
291711,
234368,
291714,
234370,
291716,
234373,
316294,
201603,
226182,
308105,
234375,
226185,
234379,
234384,
234388,
234390,
324504,
234393,
209818,
308123,
324508,
234396,
291742,
226200,
234398,
234401,
291747,
291748,
234405,
291750,
234407,
324520,
324518,
324522,
234410,
291756,
291754,
226220,
324527,
291760,
234417,
201650,
324531,
234414,
234422,
324536,
275384,
234428,
291773,
242623,
324544,
234431,
234434,
324546,
324548,
234437,
226245,
234439,
226239,
234443,
291788,
234446,
275406,
234449,
316370,
234452,
234455,
234459,
234461,
234464,
234467,
168935,
5096,
324585,
234475,
234478,
316400,
234481,
316403,
234484,
234485,
234487,
324599,
234490,
234493,
316416,
234496,
308226,
234501,
275462,
308231,
234504,
234507,
234515,
300054,
316439,
234520,
234519,
234523,
234526,
234528,
300066,
234532,
300069,
234535,
234537,
234540,
144430,
234543,
234546,
275508,
300085,
234549,
300088,
234553,
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,
300148,
234614,
398455,
144506,
234618,
234620,
275579,
234623,
226433,
234627,
275588,
234629,
242822,
234634,
234636,
177293,
234640,
275602,
234643,
308373,
226453,
234647,
275606,
275608,
234650,
308379,
234648,
300189,
324766,
119967,
234653,
324768,
283805,
234657,
242852,
300197,
234661,
283813,
234664,
275626,
234667,
316596,
308414,
234687,
300223,
300226,
308418,
234692,
300229,
308420,
308422,
283844,
226500,
300234,
283850,
300238,
300241,
316625,
300243,
300245,
316630,
300248,
300253,
300256,
300258,
300260,
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,
275725,
349464,
283939,
259367,
292143,
283951,
300344,
243003,
283963,
226628,
300357,
283973,
283983,
316758,
357722,
316766,
316768,
292192,
292197,
316774,
218473,
284010,
136562,
324978,
275834,
275836,
275840,
316803,
316806,
316811,
316814,
226703,
300433,
234899,
300436,
226709,
357783,
316824,
316826,
144796,
300448,
144807,
144810,
144812,
144814,
227426,
144820,
374196,
284084,
292279,
284087,
144826,
144828,
144830,
144832,
144835,
144837,
38342,
144839,
144841,
144844,
144847,
144852,
144855,
103899,
300507,
333280,
226787,
218597,
292329,
300523,
300527,
308720,
292338,
226802,
316917,
292343,
308727,
300537,
316933,
316947,
308757,
308762,
284191,
284194,
284196,
235045,
284199,
284204,
284206,
284209,
284211,
194101,
284213,
316983,
194103,
284215,
308790,
284218,
226877,
284223,
284226,
284228,
292421,
226886,
284231,
128584,
243268,
284234,
366155,
317004,
276043,
284238,
226895,
284241,
194130,
284243,
300628,
284245,
292433,
284247,
317015,
235097,
243290,
276053,
284249,
284251,
300638,
284253,
284255,
284258,
292452,
292454,
284263,
284265,
292458,
292461,
284272,
284274,
284278,
292470,
276086,
292473,
284283,
276093,
284286,
276095,
284288,
292481,
284290,
325250,
284292,
292485,
292479,
276098,
284297,
317066,
284299,
317068,
284301,
276109,
284303,
284306,
276114,
284308,
284312,
284314,
284316,
276127,
284320,
284322,
284327,
284329,
317098,
284331,
276137,
284333,
284335,
284337,
284339,
300726,
284343,
284346,
284350,
358080,
276160,
284354,
358083,
284358,
276166,
358089,
284362,
276170,
284365,
276175,
284368,
276177,
284370,
358098,
284372,
317138,
284377,
276187,
284379,
284381,
284384,
358114,
284386,
358116,
276197,
317158,
358119,
284392,
325353,
358122,
284394,
284397,
358126,
284399,
358128,
358133,
358135,
276216,
358138,
300795,
358140,
284413,
358142,
358146,
317187,
284418,
317189,
317191,
300816,
300819,
317207,
284440,
300828,
300830,
276255,
300832,
325408,
300834,
317221,
227109,
358183,
276268,
300845,
243504,
300850,
284469,
276280,
325436,
358206,
276291,
366406,
276295,
292681,
153417,
358224,
276308,
178006,
317271,
276315,
292700,
317279,
284511,
227175,
292715,
292721,
284529,
300915,
292729,
317306,
284540,
292734,
325512,
276365,
317332,
358292,
284564,
284566,
350106,
284572,
276386,
284579,
276388,
358312,
317353,
284585,
292784,
358326,
358330,
276410,
276411,
276418,
301009,
301011,
301013,
292823,
358360,
301017,
301015,
292828,
276446,
153568,
276452,
292839,
276455,
292843,
292845,
276464,
178161,
227314,
325624,
317435,
276479,
276482,
276485,
317446,
276490,
292876,
317456,
276496,
317458,
178195,
243733,
243740,
317468,
317472,
325666,
243751,
292904,
276528,
243762,
309298,
325685,
325689,
235579,
325692,
235581,
178238,
276539,
276544,
284739,
325700,
243779,
292934,
243785,
276553,
350293,
350295,
309337,
194649,
227418,
350299,
350302,
227423,
350304,
178273,
309346,
194657,
194660,
350308,
309350,
309348,
292968,
309352,
309354,
301163,
350313,
350316,
227430,
301167,
276583,
350321,
276590,
284786,
276595,
350325,
252022,
350328,
292985,
301178,
350332,
292989,
301185,
292993,
350339,
317570,
317573,
350342,
350345,
350349,
301199,
317584,
325777,
350354,
350357,
350359,
350362,
350366,
276638,
284837,
350375,
350379,
350381,
350383,
350385,
350387,
350389,
350395,
350397,
350399,
227520,
350402,
301252,
350406,
227529,
301258,
309450,
276685,
309455,
276689,
309462,
301272,
194780,
309468,
309471,
301283,
317672,
317674,
325867,
243948,
309491,
309494,
243960,
276735,
227587,
276739,
276742,
227593,
227596,
325910,
309530,
342298,
211232,
317729,
276775,
211241,
325937,
325943,
211260,
260421,
276811,
235853,
235858,
276829,
276833,
391523,
276836,
293227,
276843,
293232,
276848,
186744,
211324,
227709,
285061,
317833,
178572,
285070,
285077,
317853,
276896,
317858,
342434,
285093,
317864,
276907,
235955,
276917,
293304,
293307,
293314,
309707,
293325,
317910,
293336,
235996,
317917,
293343,
358880,
227810,
293346,
293352,
236013,
293364,
301562,
317951,
309764,
301575,
121352,
293387,
236043,
342541,
113167,
309779,
317971,
309781,
227877,
227879,
293417,
227882,
309804,
293421,
105007,
236082,
23094,
277054,
219714,
129603,
301636,
318020,
301639,
301643,
277071,
285265,
309844,
277080,
309849,
285277,
285282,
326244,
318055,
277100,
309871,
121458,
277106,
170619,
309885,
309888,
277122,
277128,
285320,
301706,
318092,
326285,
334476,
318094,
277136,
277139,
227992,
334488,
318108,
285340,
318110,
227998,
137889,
383658,
285357,
318128,
277170,
293555,
318132,
342707,
154292,
277177,
277181,
318144,
277187,
277191,
277194,
277196,
277201,
137946,
113378,
228069,
277223,
342760,
285417,
56043,
277232,
228081,
56059,
310015,
285441,
310020,
285448,
310029,
228113,
285459,
277273,
293659,
326430,
228128,
285474,
228135,
318248,
277291,
318253,
293677,
285489,
301876,
293685,
285494,
301880,
301884,
310080,
293696,
277317,
277322,
293706,
310100,
301911,
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,
276579,
293811,
293817,
293820,
203715,
326603,
293849,
293861,
228327,
228328,
318442,
228330,
228332,
326638,
277486,
318450,
293876,
285686,
302073,
121850,
293882,
302075,
285690,
293887,
277504,
277507,
277511,
293899,
277519,
293908,
293917,
293939,
318516,
277561,
277564,
310336,
293956,
277573,
228422,
293960,
310344,
277577,
277583,
203857,
293971,
310355,
310359,
236632,
277594,
138332,
277598,
203872,
277601,
310374,
203879,
310376,
228460,
318573,
203886,
187509,
285815,
367737,
285817,
302205,
285821,
392326,
285831,
294026,
302218,
162964,
384148,
187542,
302231,
285849,
302233,
285852,
302237,
285854,
285856,
302241,
285862,
277671,
302248,
64682,
277678,
294063,
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,
64768,
310531,
285958,
138505,
228617,
318742,
130345,
113964,
285999,
113969,
318773,
318776,
286010,
417086,
286016,
302403,
294211,
384328,
294221,
294223,
326991,
179547,
302436,
294246,
327015,
310632,
327017,
351594,
351607,
310648,
310651,
310657,
351619,
294276,
310659,
327046,
253320,
310665,
318858,
310672,
351633,
310689,
130468,
277932,
310703,
310710,
130486,
310712,
310715,
302526,
228799,
302534,
310727,
245191,
64966,
163272,
302541,
302543,
310737,
228825,
310749,
310755,
187880,
310764,
286188,
310772,
40440,
212472,
40443,
286203,
310780,
40448,
228864,
286214,
228871,
302603,
65038,
302614,
302617,
286233,
302621,
286240,
146977,
187939,
40484,
294435,
40486,
286246,
294440,
40488,
294439,
294443,
40491,
294445,
278057,
310831,
245288,
40499,
40502,
212538,
40507,
40511,
40513,
228933,
40521,
286283,
40525,
40527,
212560,
400976,
228944,
40533,
147032,
40537,
40539,
40541,
278109,
40544,
40548,
40550,
40552,
286312,
40554,
286313,
310892,
40557,
40560,
294521,
343679,
294537,
310925,
286354,
278163,
302740,
278168,
179870,
327333,
229030,
278188,
302764,
278192,
319153,
278196,
302781,
302789,
294599,
278216,
294601,
302793,
343757,
212690,
319187,
286420,
278227,
286425,
319194,
278235,
278238,
229086,
294625,
294634,
302838,
319226,
286460,
278274,
302852,
278277,
302854,
294664,
311048,
319243,
311053,
302862,
319251,
294682,
278306,
188199,
294701,
319280,
278320,
319290,
229192,
302925,
188247,
188252,
237409,
229233,
294776,
360317,
294785,
327554,
40851,
294811,
237470,
319390,
40865,
319394,
294817,
294821,
311209,
180142,
343983,
188340,
40886,
319419,
294844,
294847,
237508,
393177,
294876,
294879,
294883,
294890,
311279,
278513,
237555,
311283,
278516,
278519,
237562
] |
06de0f630e07368cdbcea5075deed235676004af
|
2546b14872ad9bfc643f009b1f76f53c471cb02f
|
/Package.swift
|
a378c99795b0eecbb2f0520120f3350077e0d720
|
[
"Apache-2.0",
"LicenseRef-scancode-generic-cla"
] |
permissive
|
lm0963/fuzzilli
|
361a566a7a6e0bd4e2b8367c6ea87b6ce1723a9c
|
ee382df9d0fe1bf64e8d6771ae380a9ccc961527
|
refs/heads/master
| 2022-12-24T06:15:46.044632 | 2020-09-22T08:22:37 | 2020-09-22T08:22:37 | 294,587,508 | 0 | 0 |
Apache-2.0
| 2020-09-11T03:46:13 | 2020-09-11T03:46:12 | null |
UTF-8
|
Swift
| false | false | 1,646 |
swift
|
// swift-tools-version:5.0
//
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import PackageDescription
let package = Package(
name: "Fuzzilli",
platforms: [
.macOS(.v10_13),
],
products: [
.library(name: "Fuzzilli", targets: ["Fuzzilli"]),
],
dependencies: [
.package(url: "https://github.com/apple/swift-protobuf.git", from: "1.6.0"),
],
targets: [
.target(name: "libsocket", dependencies: []),
.target(name: "libreprl", dependencies: []),
.target(name: "libcoverage", dependencies: [], linkerSettings: [.linkedLibrary("rt", .when(platforms: [.linux]))]),
.target(name: "Fuzzilli", dependencies: ["SwiftProtobuf", "libsocket", "libreprl", "libcoverage", "JS"]),
.target(name: "REPRLRun", dependencies: ["libreprl"]),
.target(name: "FuzzilliCli", dependencies: ["Fuzzilli"]),
.target(name: "JS", dependencies: []),
.target(name: "FuzzILTool", dependencies: ["Fuzzilli"]),
.testTarget(name: "FuzzilliTests", dependencies: ["Fuzzilli"]),
],
swiftLanguageVersions: [.v5]
)
|
[
-1
] |
e5d2e6c45684920abf8b48e932a192824ee760f1
|
ac5ae624489127acbec64831efbd6ddbe7cf8066
|
/TVOSButtonExample/TVOSButtonExampleTests/TVOSButtonExampleTests.swift
|
359e12cb2d95f77d46eae40b75f3db81c1219b29
|
[
"Apache-2.0"
] |
permissive
|
mohsinalimat/TVOSButton
|
c5ec9dbe4ea25200909f899120f65506f6d3bc8c
|
403c6bf7076ccce08f1f3b9261c8cf527d92499b
|
refs/heads/master
| 2021-01-18T08:51:20.621550 | 2016-03-09T16:25:50 | 2016-03-09T16:25:50 | 61,775,134 | 1 | 0 | null | 2016-06-23T05:04:56 | 2016-06-23T05:04:55 | null |
UTF-8
|
Swift
| false | false | 1,011 |
swift
|
//
// TVOSButtonExampleTests.swift
// TVOSButtonExampleTests
//
// Created by Cem Olcay on 11/02/16.
// Copyright © 2016 MovieLaLa. All rights reserved.
//
import XCTest
@testable import TVOSButtonExample
class TVOSButtonExampleTests: 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.
}
}
}
|
[
313357,
145435,
98333,
278558,
102437,
292902,
204840,
354345,
227370,
223274,
233517,
155694,
229424,
282672,
229430,
180280,
213052,
288834,
286788,
311372,
223316,
280661,
315476,
307289,
237663,
315487,
309345,
280675,
227428,
280677,
307299,
313447,
278634,
194666,
278638,
288879,
284788,
223350,
233590,
280694,
131191,
237689,
215166,
131198,
292992,
194691,
227460,
280712,
215178,
235662,
311438,
278677,
284826,
278685,
311458,
278691,
233636,
299174,
233642,
284842,
278699,
153776,
278708,
184505,
278714,
223419,
227513,
295098,
299198,
280762,
280778,
282831,
280795,
227548,
229597,
301279,
311519,
286958,
184570,
227578,
184575,
278797,
282909,
299293,
278816,
282913,
233762,
217380,
280887,
278842,
315706,
307517,
287041,
287043,
139589,
280902,
319813,
227654,
6481,
289110,
6489,
168281,
323935,
321894,
416104,
280939,
285040,
313713,
199029,
291192,
311681,
227725,
227726,
240016,
190871,
61857,
285090,
61859,
381347,
289189,
299441,
283064,
278970,
293306,
278978,
127427,
127428,
291267,
278989,
281037,
281040,
278993,
326100,
278999,
328152,
176601,
188894,
287198,
279008,
160225,
285150,
279013,
279018,
311786,
291311,
309744,
279029,
233978,
279039,
291333,
287241,
279050,
283153,
303636,
279065,
291358,
180771,
293419,
244269,
283182,
283184,
236081,
234036,
289332,
279094,
70209,
115270,
70215,
293448,
309830,
377418,
281166,
281171,
295519,
66150,
111208,
279146,
313966,
281199,
295536,
287346,
287352,
301689,
279164,
189057,
152203,
117397,
230040,
289434,
303771,
221852,
279206,
295599,
205487,
285361,
303793,
299699,
342706,
166582,
289462,
314040,
287417,
158394,
285371,
285372,
285373,
287422,
285374,
303803,
66242,
287433,
225995,
154316,
287439,
279252,
96984,
289502,
279269,
234217,
342762,
230125,
289518,
299759,
279280,
199414,
154359,
230134,
228088,
299770,
234234,
205568,
242433,
295682,
299776,
285444,
322313,
285458,
291604,
166676,
234277,
283430,
262951,
279336,
289576,
262954,
295724,
312108,
301871,
164656,
303920,
262962,
285487,
234294,
230199,
293693,
281408,
295746,
318278,
201551,
281427,
281433,
230234,
301918,
295776,
279392,
293730,
349026,
303972,
230248,
177001,
308076,
400239,
207732,
295798,
209783,
209785,
279417,
177019,
291712,
113542,
287622,
228233,
228234,
308107,
56208,
308112,
234386,
293781,
324506,
324507,
310176,
310178,
283558,
289703,
279464,
293800,
310182,
236461,
293806,
304051,
189374,
289727,
19399,
213960,
279498,
316364,
50143,
326635,
203757,
289774,
183279,
304110,
287731,
314355,
240630,
295927,
304122,
312314,
234500,
277509,
134150,
322570,
230410,
234514,
277524,
140310,
293910,
197657,
281626,
189474,
300068,
238639,
300084,
238651,
302139,
308287,
234577,
296019,
234587,
277597,
304222,
281697,
230499,
281700,
300135,
322663,
228458,
207979,
279660,
15471,
312434,
300146,
285814,
300151,
279672,
285820,
300158,
150657,
285828,
279685,
285830,
222343,
302216,
302213,
228491,
228493,
234638,
308372,
185493,
296086,
238743,
187544,
119962,
296092,
330913,
306338,
234663,
300201,
300202,
249002,
279728,
238769,
294074,
64700,
228542,
283840,
302274,
279747,
283847,
283852,
279760,
290000,
189652,
279765,
279774,
304351,
310497,
298212,
304356,
290022,
279785,
228588,
234733,
298221,
279792,
298228,
302325,
234742,
228600,
216315,
292091,
234755,
292107,
173334,
339234,
130338,
304421,
130343,
279854,
298291,
286018,
113987,
300359,
304456,
230729,
294218,
234827,
177484,
222541,
296270,
234831,
238927,
314709,
357719,
292195,
294243,
230756,
281957,
163175,
230765,
284014,
306542,
296303,
296307,
111993,
290173,
306559,
148867,
294275,
298374,
142729,
368011,
296335,
318864,
112017,
306579,
282007,
318875,
310692,
282022,
282024,
310701,
279984,
279989,
284089,
415171,
292292,
300487,
306631,
296392,
280010,
300489,
310732,
284107,
312782,
64975,
302540,
306639,
222675,
228827,
286172,
280032,
144867,
187878,
280041,
306673,
296433,
306677,
300535,
280055,
288249,
286202,
300536,
290300,
286205,
302590,
290301,
294400,
296448,
282114,
230913,
306692,
306693,
228861,
300542,
230921,
296461,
282129,
308756,
282136,
282141,
286244,
288309,
290358,
288318,
280130,
288326,
282183,
218696,
288327,
228943,
286288,
290390,
300630,
128599,
235095,
306776,
239198,
286306,
300644,
282213,
317032,
310889,
222832,
314998,
294529,
239237,
286343,
288392,
229001,
290443,
310923,
323217,
282259,
229020,
282271,
282273,
302754,
282276,
40613,
40614,
40615,
282280,
290471,
229029,
298667,
298661,
300714,
286388,
286391,
306874,
280251,
282303,
286399,
280257,
280267,
212688,
9936,
302802,
9937,
280278,
282327,
286423,
278233,
278234,
280280,
67292,
298712,
294622,
278240,
229088,
298720,
153319,
288491,
280300,
239341,
284401,
323316,
313081,
229113,
286459,
194304,
288512,
288516,
280327,
216839,
280329,
282378,
300811,
321295,
278291,
294678,
116505,
284442,
286494,
294700,
280366,
282417,
200498,
296755,
280372,
280380,
345919,
282434,
307011,
282438,
280390,
304977,
307025,
413521,
18262,
216918,
307031,
280410,
284507,
300894,
245599,
237408,
284512,
284514,
302946,
296806,
276327,
282474,
288619,
288620,
280430,
282480,
313203,
300918,
194429,
305026,
67463,
282504,
315273,
315274,
110480,
184208,
282518,
282519,
214937,
214938,
294809,
298909,
294814,
311199,
300963,
294823,
298920,
284587,
292782,
294843,
98239,
280514,
280519,
344013,
231375,
301008,
153554,
194515,
292837,
294886,
296941,
311282,
292858,
290811
] |
1d51cfb50e512f1d5b0e54dd30176949ffdfa866
|
15b8df5a2a515c8119880749cb1e31a8af384ea8
|
/AnimatableStatusBarViewController/AnimatableStatusBarViewController.swift
|
75b1cd5ca3b6ffadc1b066bcaaef2d4d57d5d1dd
|
[] |
no_license
|
ThePowerOfSwift/AnimatableStatusBarViewController
|
b371bb369a1a8c57c27f401d6c7bee7b59948c17
|
38750fe5f500fee53061d1f4d14dbed12ac47855
|
refs/heads/master
| 2020-04-05T09:27:06.147471 | 2018-04-21T09:52:22 | 2018-04-21T09:52:22 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 3,126 |
swift
|
//
// AnimatableStatusBarViewController.swift
// AnimatableStatusBarViewController
//
// Created by Wirawit Rueopas on 21/4/18.
// Copyright © 2018 Wirawit Rueopas. All rights reserved.
//
import UIKit
/// Base View Controller that animates status bar changes. Make your view controller override from this instead of `UIViewController`.
///
/// **To use:**
/// 1. Set `animatedStatusBarPreviouslyHideStatusBar` on creation time.
/// 2. Override `animatedStatusBarPrefersStatusBarHidden` (instead of `prefersStatusBarHidden`)
/// 3. Override `animatedStatusBarAnimationDuration`
class AnimatableStatusBarViewController: UIViewController {
/// For animating status bar when presenting this vc
private var shouldCurrentlyHideStatusBar: Bool = false
/// Set initial stage whether previous view controller hides status bar.
var animatedStatusBarPreviouslyHideStatusBar: Bool = false {
didSet {
shouldCurrentlyHideStatusBar = animatedStatusBarPreviouslyHideStatusBar
}
}
/// Use this instead of the original `prefersStatusBarHidden` to indicate whether this view controller needs status bar hidden or not.
var animatedStatusBarPrefersStatusBarHidden: Bool {
return false
}
var animatedStatusBarAnimationDuration: Double {
return 0.4
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
// If not the same, animate change
if animatedStatusBarPreviouslyHideStatusBar != animatedStatusBarPrefersStatusBarHidden {
shouldCurrentlyHideStatusBar = animatedStatusBarPrefersStatusBarHidden
UIView.animate(withDuration: animatedStatusBarAnimationDuration) {
self.setNeedsStatusBarAppearanceUpdate()
}
}
if shouldCurrentlyHideStatusBar != animatedStatusBarPrefersStatusBarHidden {
shouldCurrentlyHideStatusBar = animatedStatusBarPrefersStatusBarHidden
UIView.animate(withDuration: animatedStatusBarAnimationDuration) {
self.setNeedsStatusBarAppearanceUpdate()
}
}
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
// Will present another animated, set status bar to that style,
// *so that when we dismiss that one, this one will initially has the same style as that one. (then will be animated to current style)
if let presentedVc = presentedViewController as? AnimatableStatusBarViewController {
shouldCurrentlyHideStatusBar = presentedVc.animatedStatusBarPrefersStatusBarHidden
} else if let topOfNavVc = (presentedViewController as? UINavigationController)?.visibleViewController as? AnimatableStatusBarViewController {
shouldCurrentlyHideStatusBar = topOfNavVc.animatedStatusBarPrefersStatusBarHidden
}
}
override var prefersStatusBarHidden: Bool {
return shouldCurrentlyHideStatusBar
}
override var preferredStatusBarUpdateAnimation: UIStatusBarAnimation {
return UIStatusBarAnimation.fade
}
}
|
[
-1
] |
a02b94fbb0c60448812aa703077cd96ffaf25931
|
7be8263323cb261bda796314049cd175183d7c0a
|
/test/ErrorProject/ErrorProject/AppDelegate.swift
|
e94752770e2eee83b281f5d1ee829ba3cea895da
|
[
"MIT"
] |
permissive
|
dral3x/action-stringslint
|
8b2617d580a6bc7e6b2efd43d68ad18d2bf9901b
|
961affa808df383d9204ef8c1f96844d3717d9b2
|
refs/heads/master
| 2021-09-11T05:09:33.724597 | 2021-08-31T08:57:05 | 2021-08-31T08:57:05 | 244,417,764 | 2 | 2 |
MIT
| 2020-03-02T18:25:20 | 2020-03-02T16:22:07 |
Swift
|
UTF-8
|
Swift
| false | false | 1,449 |
swift
|
//
// AppDelegate.swift
// ErrorProject
//
// Created by Alessandro "Sandro" Calzavara on 02/03/2020.
// Copyright © 2020 Alessandro Calzavara. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
// MARK: UISceneSession Lifecycle
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
// Called when a new scene session is being created.
// Use this method to select a configuration to create the new scene with.
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
}
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
// Called when the user discards a scene session.
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
}
}
|
[
350213,
393222,
393230,
350224,
350231,
333850,
346139,
350237,
350240,
393250,
344102,
350248,
178218,
350251,
393261,
350256,
430129,
163891,
350259,
266294,
385081,
350271,
217157,
243781,
421960,
376905,
378954,
395339,
327756,
350285,
254030,
286800,
374864,
338004,
342111,
180320,
368735,
376931,
421990,
266350,
286831,
368752,
342133,
266362,
286844,
262283,
381068,
432271,
250002,
250004,
225429,
329885,
225437,
286879,
346272,
225441,
225444,
225447,
286888,
438440,
225450,
100524,
333997,
258222,
225455,
430256,
387249,
225458,
377012,
225461,
225466,
389307,
387260,
334011,
225470,
256191,
327871,
381120,
260289,
372929,
225475,
430274,
389320,
350410,
260298,
377036,
225484,
346316,
180431,
350416,
225487,
225490,
395466,
266453,
350422,
225493,
225496,
350425,
377046,
268507,
411861,
334045,
411868,
225502,
225505,
356578,
411873,
379107,
377060,
387301,
346343,
338152,
225510,
327914,
411876,
225514,
350445,
387306,
387312,
393456,
375026,
346355,
393460,
321786,
350458,
336123,
350461,
379134,
411903,
350464,
336128,
385280,
325891,
350467,
262404,
389380,
397571,
180490,
350475,
411916,
268559,
350480,
368911,
379152,
395538,
387349,
350486,
338199,
262422,
387352,
350490,
325914,
432405,
325917,
350493,
182558,
356637,
356640,
350498,
338211,
262436,
356643,
377117,
350504,
266536,
356649,
358700,
350509,
391468,
248111,
332080,
356655,
358704,
340275,
336180,
356660,
262454,
397622,
358713,
332090,
358716,
225597,
332097,
201028,
362822,
262472,
348488,
332106,
383306,
190796,
436555,
334161,
213332,
250199,
321879,
65880,
250202,
383321,
332125,
262496,
418144,
250210,
262499,
383330,
383333,
213352,
348522,
246123,
262507,
348525,
391530,
262510,
348527,
354673,
321910,
332152,
248186,
334203,
194941,
250238,
389502,
356740,
385419,
393612,
420236,
366990,
379278,
262550,
262552,
373145,
340379,
416157,
354727,
375208,
385451,
262573,
389550,
393647,
338352,
375216,
385458,
334262,
262586,
262592,
334275,
326084,
358856,
330189,
338381,
338386,
360916,
334304,
338403,
334311,
338409,
160234,
375277,
127471,
328177,
334321,
328179,
328182,
340472,
328189,
324094,
328192,
164361,
328206,
324111,
186897,
342545,
393747,
340500,
324117,
334358,
342554,
334363,
254490,
330267,
188958,
385570,
332324,
33316,
197159,
354855,
350761,
324139,
324142,
334384,
383536,
358961,
356916,
324149,
334394,
324155,
188987,
348733,
418363,
324160,
252482,
324164,
219718,
348743,
356934,
385609,
324173,
324176,
199249,
385616,
352856,
332380,
373343,
352864,
346721,
369253,
174695,
262760,
248425,
381545,
191084,
191092,
346742,
352887,
254587,
377472,
334465,
148105,
377484,
330383,
326290,
340627,
184982,
342679,
98968,
352918,
342683,
258721,
332453,
150183,
344744,
361129,
332459,
389805,
332463,
381617,
434867,
164534,
332471,
336567,
342710,
328378,
350206,
260797,
223934,
334528,
260801,
328386,
332483,
350917,
332486,
352968,
418507,
332493,
357069,
385742,
355024,
273108,
385748,
264918,
391894,
154328,
416473,
361179,
183005,
256734,
189153,
338660,
369381,
332520,
338664,
361195,
342766,
340718,
332533,
344831,
391937,
207619,
336643,
344835,
373510,
344841,
338700,
326416,
256786,
336659,
434970,
369435,
199452,
262942,
162591,
396066,
336675,
346916,
396069,
389926,
326441,
355122,
326451,
340789,
326454,
336696,
361273,
355131,
244540,
326460,
375612,
326467,
328515,
355140,
127814,
244551,
328519,
326473,
328522,
336714,
338763,
326477,
336711,
355143,
355150,
357201,
330580,
326485,
357206,
416597,
326490,
389978,
357211,
197468,
254812,
355166,
265055,
357214,
361309,
265058,
361315,
326502,
375656,
361322,
201579,
326507,
201582,
326510,
211825,
330610,
340849,
201588,
430965,
211831,
351097,
119674,
324475,
398201,
328573,
324478,
359295,
324481,
342915,
324484,
324487,
381833,
324492,
236430,
324495,
330642,
342930,
430995,
252822,
392091,
400285,
324510,
422816,
324513,
398245,
359334,
211884,
324524,
340909,
400306,
5046,
324538,
324541,
207808,
351168,
359361,
359366,
398279,
340939,
345035,
340941,
209873,
345043,
386003,
396245,
330710,
359382,
248792,
386011,
359388,
340957,
248798,
383967,
431072,
386018,
340963,
386022,
343015,
359407,
257008,
183282,
435187,
244726,
330748,
349180,
328702,
439294,
330760,
328714,
330768,
361489,
209943,
336921,
386073,
336925,
345118,
211998,
377887,
250914,
357410,
396328,
158761,
209965,
345133,
359470,
209968,
396336,
209971,
396339,
209975,
339001,
388154,
209979,
361536,
388161,
209987,
209990,
248904,
330826,
341071,
189520,
345169,
248914,
250967,
156761,
210010,
339036,
412764,
257120,
148578,
341091,
384098,
384101,
265320,
210025,
210027,
367723,
384107,
187502,
345199,
210030,
384114,
210039,
248951,
420984,
210044,
349308,
361598,
152703,
160895,
210052,
214149,
345222,
384135,
210055,
330889,
349319,
384139,
351364,
210067,
210071,
337047,
248985,
339097,
384151,
210077,
214175,
210080,
384160,
210084,
251044,
44197,
380070,
210088,
339112,
210095,
337071,
367794,
337075,
244916,
249014,
210107,
384188,
351423,
210115,
332997,
326855,
244937,
384201,
253130,
343244,
210127,
384208,
333009,
146642,
210131,
386258,
330965,
333014,
210138,
265436,
328924,
210143,
384224,
388319,
343270,
351466,
386285,
218354,
386291,
384246,
351479,
251128,
218360,
275706,
275712,
275715,
275721,
261389,
359694,
175375,
384275,
333078,
251160,
384283,
245020,
384288,
345376,
175396,
245029,
208166,
171302,
410917,
351534,
372015,
245040,
372018,
199988,
251189,
396600,
378169,
369978,
415033,
437566,
175423,
437570,
343365,
337222,
437575,
357708,
337229,
212303,
331088,
437583,
337234,
437587,
331093,
396633,
437595,
259421,
343393,
430939,
208227,
251235,
175457,
333154,
175460,
345448,
343398,
333162,
374117,
402791,
425328,
343409,
234866,
378227,
271730,
390516,
175477,
154999,
333175,
249208,
327034,
343417,
175483,
175486,
175489,
249218,
271745,
245127,
249224,
181643,
136590,
245136,
249234,
112020,
181654,
245142,
349590,
245145,
343450,
230809,
245148,
175516,
245151,
245154,
175522,
245157,
181670,
181673,
327084,
380332,
181678,
337329,
396722,
181684,
181690,
259515,
146876,
361917,
415166,
181696,
327107,
372163,
384453,
181703,
380360,
216522,
327115,
339404,
327117,
359886,
208337,
366034,
343507,
359890,
337365,
339412,
413141,
415185,
339417,
415191,
415193,
249308,
368092,
415196,
271839,
249312,
415199,
423392,
333284,
339428,
415207,
361960,
339434,
343534,
343539,
210420,
337398,
368119,
343544,
69113,
368122,
415224,
423423,
372228,
337415,
329226,
419339,
208398,
380432,
175635,
359955,
419349,
345625,
415257,
419355,
415263,
419362,
366117,
370213,
415270,
419368,
144939,
415278,
339503,
359983,
415281,
265778,
415285,
415290,
206395,
415293,
349761,
265795,
415300,
396872,
419400,
333386,
353867,
419402,
419406,
419410,
333399,
366172,
257633,
333413,
345701,
372327,
394853,
327275,
423532,
222830,
257646,
138864,
210544,
224884,
155254,
224887,
370297,
224890,
415353,
224894,
333439,
224897,
372353,
216707,
339588,
403075,
415361,
224904,
155273,
345736,
159374,
11918,
339601,
224913,
224916,
345749,
224919,
208538,
224922,
224926,
368288,
245409,
345762,
224929,
419491,
224932,
345765,
425638,
224936,
257704,
419497,
419501,
224942,
370350,
419506,
257716,
337592,
257720,
155322,
419512,
257724,
425662,
337599,
155327,
257732,
333511,
210631,
419527,
419530,
339662,
419535,
358099,
245460,
394966,
155351,
419542,
181977,
419544,
155354,
345818,
419547,
419550,
224993,
257761,
245475,
155363,
224999,
419559,
337642,
245483,
419563,
337645,
431851,
339695,
210672,
409335,
141051,
225020,
337659,
339710,
225025,
155393,
337668,
210695,
362247,
339721,
268041,
210698,
155403,
395021,
362255,
210706,
321299,
372499,
167700,
399128,
333594,
116509,
155422,
345887,
184094,
210719,
225053,
225058,
360223,
378663,
225066,
257836,
413484,
225070,
358191,
155438,
225073,
345905,
399159,
358200,
397112,
225082,
354106,
397115,
225087,
325440,
354111,
247617,
366401,
341829,
325446,
354117,
46920,
329544,
323402,
341834,
257868,
370509,
257871,
341843,
397139,
415573,
337750,
370519,
358234,
155482,
261981,
257886,
155487,
350045,
399199,
155490,
155491,
257890,
399206,
257896,
274280,
327531,
261996,
376685,
261999,
358255,
399215,
262002,
327539,
341876,
358259,
345970,
262005,
147317,
333689,
345974,
257912,
262008,
262011,
155516,
243579,
325504,
354172,
333698,
155521,
339844,
155531,
262027,
262030,
337808,
262033,
397200,
247700,
262036,
380822,
329623,
262042,
225180,
333724,
155549,
262045,
262048,
436126,
118691,
262051,
327589,
436132,
155559,
337833,
155562,
382890,
184244,
337844,
372664,
393150,
358339,
346057,
247759,
346063,
393169,
155611,
372702,
329697,
372706,
358371,
155619,
354277,
327654,
253926,
190439,
247789,
350189,
204784,
350193,
380918,
350202,
393212,
155646
] |
03e3a7fdd12319b1ca97fa35f8762d5e67c03766
|
09375bc045a0c4b9d343fc3279cf0b524e8f3aff
|
/Sources/DirectToSwiftUI/Views/BasicLook/Rows/PropertyValue.swift
|
7c0370cb46dab9d655eefa2c5f7f74a422b255e4
|
[
"Apache-2.0"
] |
permissive
|
DirectToSwift/DirectToSwiftUI
|
d174ff1fdc0cf041702d80eb3a80ff331899006b
|
52a55024bdba58e5956901258eb653236f690248
|
refs/heads/main
| 2021-06-18T12:10:42.588542 | 2021-05-13T14:44:51 | 2021-05-13T14:44:51 | 209,812,896 | 67 | 2 | null | null | null | null |
UTF-8
|
Swift
| false | false | 390 |
swift
|
//
// D2SPropertyValueRow.swift
// Direct to SwiftUI
//
// Copyright © 2019 ZeeZide GmbH. All rights reserved.
//
import protocol SwiftUI.View
public extension BasicLook.Row {
/**
* A row which just emits the property value component.
*
* E.g. useful in Forms.
*/
struct PropertyValue: View {
public var body: some View {
D2SComponentView()
}
}
}
|
[
-1
] |
203066bb00df9ca04a66afbc394afacc3143fffc
|
fdb86e5cf24a116e5ab0e5385ac11f580efe8ead
|
/MyFirstNote-iOS/DetailViewController.swift
|
b16056a15b6db02c7ce8049cce84ee257727e195
|
[] |
no_license
|
ginpei/MyFirstIosNoteApp
|
7e86891a9f36339c27b198c25ea8574b2d579c62
|
9c136cbbf8f6024ca45b6732c05978802b9bee55
|
refs/heads/master
| 2021-01-25T04:35:45.838225 | 2017-06-05T22:31:07 | 2017-06-05T22:31:07 | 93,452,587 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,409 |
swift
|
//
// DetailViewController.swift
// MyFirstNote-iOS
//
// Created by Ginpei on 2017-06-05.
// Copyright © 2017 Ginpei. All rights reserved.
//
import UIKit
class DetailViewController: UIViewController {
@IBOutlet weak var textView: UITextView!
var text:String = ""
var masterView:ViewController!
override func viewDidLoad() {
print("detail view did load")
super.viewDidLoad()
// in case when set text before
setText(text: text)
textView.becomeFirstResponder()
}
func setText(text: String) {
self.text = text
// update immediately
if isViewLoaded {
textView.text = text
}
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
masterView.newRowText = textView.text
}
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
] |
aaa223317f5ef502a0617d21673fe2b3b7bf7a6e
|
c58d5955488bf94e234de21969373c6f621a574d
|
/LaunchViewController.swift
|
6e5c0fd962f86f7bb18d1f3ba14ede539d4a8d1b
|
[] |
no_license
|
masashi-yamashita/test1
|
f9ef80886f42456bee47e2eb6b82e9fc0e27b872
|
ca21481d9ca009f0b3b0b63898a581dd99774a0b
|
refs/heads/master
| 2022-11-07T00:49:19.075818 | 2020-06-28T18:07:10 | 2020-06-28T18:07:10 | 275,639,424 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 706 |
swift
|
//
// LaunchViewController.swift
// Random-Restaurant
//
// Created by 山下将司 on 5/17/20.
// Copyright © 2020 mashi. All rights reserved.
//
import UIKit
class LaunchViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
}
*/
}
|
[
328514,
361499,
317931,
361495,
327032,
361498,
159355
] |
b4c512a1e12bc320792e05b4ee01b9920e2f1c9b
|
c5d8d9ef176f2dfcf4bd1aa78e9e9306f96698a9
|
/Lab - Strings.playground/Pages/4. Exercise - String Equality and Comparison.xcplaygroundpage/Contents.swift
|
b2bd350ac6806b56559bcabc315836a0da2e415d
|
[] |
no_license
|
Wgclassen/Swift-Fundamentals
|
423a387d7cb4edf8db3785ee13d8f62cdf74e3f2
|
85eee15541d7ba892249ec25faafc895e532e515
|
refs/heads/main
| 2023-03-12T04:28:32.403500 | 2021-02-28T22:03:44 | 2021-02-28T22:03:44 | 340,483,266 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,656 |
swift
|
/*:
## Exercise - String Equality and Comparison
Create two constants, `nameInCaps` and `name`. Assign `nameInCaps` your name as a string literal with proper capitalization. Assign `name` your name as a string literal in all lowercase. Write an if-else statement that checks to see if `nameInCaps` and `name` are the same. If they are, print "The two strings are equal", otherwise print "The two strings are not equal."
*/
let nameInCaps = "Willian Classen"
let name = "willian classen"
if nameInCaps == name {
print("The two strings are equal")
} else {
print("The two strings are not equal")
}
/*:
Write a new if-else statement that also checks to see if `nameInCaps` and `name` are the same. However, this time use the `lowercased()` method on each constant to compare the lowercase version of the strings. If they are equal, print the following statement using string interpolations:
- "<INSERT LOWERCASED VERSION OF `nameInCaps` HERE> and <INSERT LOWERCASED VERSION OF `name` HERE> are the same."
If they are not equal, print the following statement using string interpolation:
- "<INSERT LOWERCASED VERSION OF `nameInCaps` HERE> and <INSERT LOWERCASED VERSION OF `name` HERE> are not the same."
*/
if nameInCaps.lowercased() == name.lowercased() {
print("The two strings are equal")
} else {
print("The two strings are not equal")
}
/*:
Imagine you are looking through a list of names to find any that end in "Jr." Write an if statement below that will check if `junior` has the suffix "Jr.". If it does, print "We found a second generation name!"
*/
let junior = "Cal Ripken Jr."
if junior.hasSuffix("Jr.") {
print("We found a second generation name")
}
/*:
Suppose you are trying to find a document on your computer that contains Hamlet's famous soliloquy written by Shakespeare. You write a simple app that will check every document to see if it contains the phrase "to be, or not to be". You decide to do part of this with the `contains(_:)` method. Write an if statement below that will check if `textToSearchThrough` contains `textToSearchFor`. If it does, print "I found it!" Be sure to make this functionality case insensitive.
*/
import Foundation
let textToSearchThrough = "To be, or not to be--that is the question"
let textToSearchFor = "to be, or not to be"
if textToSearchThrough.lowercased().contains(textToSearchFor.lowercased()) {
print("I found it!")
}
/*:
Print to the console the number of characters in your name by using the `count` property on `name`.
*/
print(name.count)
//: [Previous](@previous) | page 4 of 5 | [Next: App Exercise - Password Entry and User Search](@next)
|
[
-1
] |
1a1650f17aef1f4b18937813070d8be61056eab9
|
02917acdbe62cfc4199ac8655bfedebbe1c63a1e
|
/SwıftUIExample/View/MovieDetailView/VideoView/VideoView.swift
|
ba1a568bad0267952894e58ee14cdae8a0ac8933
|
[] |
no_license
|
sametceviksever/SwiftUIExample
|
710dc817ce597e38a27f4a950896345114b1a768
|
a2773f6ebf26b7262ba9824cb189129c74c22c21
|
refs/heads/master
| 2022-12-18T12:13:23.388489 | 2020-09-17T08:55:09 | 2020-09-17T08:55:09 | 296,271,610 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,979 |
swift
|
//
// VideoView.swift
// SwıftUIExample
//
// Created by Samet Çeviksever on 13.09.2020.
// Copyright © 2020 Samet Çeviksever. All rights reserved.
//
import SwiftUI
import AVKit
struct VideoView: View {
var videoUrl: String
@State var image: UIImage = UIImage(systemName: "captureVideo") ?? UIImage()
@Environment(\.viewController) private var viewControllerHolder: UIViewController?
@State private var loadedImage: UIImage?
init(videoUrl: String) {
self.videoUrl = videoUrl
}
var body: some View {
ZStack(alignment: .center) {
Image(uiImage: image)
Button(action: {
self.showTrailer()
}, label: {
Image(systemName: "play")
.frame(width: 50, height: 50)
.foregroundColor(.white)
.overlay(Circle().stroke(Color.white, lineWidth: 2))
})
}.onAppear {
self.takeSnapshot()
}
.background(Color.clear)
}
private func showTrailer() {
guard let url = URL(string: videoUrl) else {
return
}
let avPlayer = AVPlayer(url: url)
let avController = AVPlayerViewController()
avController.player = avPlayer
viewControllerHolder?.present(avController, animated: true, completion: {
avPlayer.play()
})
}
private func takeSnapshot() {
guard let vidURL = URL(string: videoUrl) else {
return
}
if let loadedImage = loadedImage {
self.image = loadedImage
return
}
let asset = AVURLAsset(url: vidURL)
let generator = AVAssetImageGenerator(asset: asset)
generator.appliesPreferredTrackTransform = true
let timestamp = CMTime(seconds: 3, preferredTimescale: 60)
if let imageRef = try? generator.copyCGImage(at: timestamp, actualTime: nil) {
self.loadedImage = UIImage(cgImage: imageRef)
self.image = UIImage(cgImage: imageRef)
}
}
}
struct VideoView_Previews: PreviewProvider {
static var previews: some View {
VideoView(videoUrl: "")
}
}
|
[
-1
] |
be86f505e1e9dcae4a67aa03819553271a3a5f2f
|
f94865ad8318f6510de215a75fbd5c6c25527d1b
|
/iOSToolkitTests/BRDateUtilsTest_EndOfDay.swift
|
d781972282c4cd33181d619cfe56199fbb9dea09
|
[
"MIT"
] |
permissive
|
madcurious/iOSToolkit
|
9e67c44106701a6a44d1a69bfd4e77dc6555ab2d
|
2fd8481a81a06cd23a01c688a8351f50dfb98d51
|
refs/heads/master
| 2023-03-29T01:23:35.560204 | 2021-04-01T14:31:08 | 2021-04-01T14:31:08 | 52,091,319 | 1 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 805 |
swift
|
//
// BRDateUtilsTest_EndOfDay.swift
// iOSToolkitTests
//
// Created by Matthew Quiros on 03/10/2017.
// Copyright © 2017 Matthew Quiros. All rights reserved.
//
import XCTest
@testable import Bedrock
class BRDateUtilsTest_EndOfDay: BRDateUtilsTest {
func testEndOfDay_leapYearDate_shouldSucceed() {
let date = makeDate(day: 29, month: 2, year: 2016)
let endOfDay = DateUtil.endOfDay(for: date)
let comps = Calendar.current.dateComponents([.day, .month, .year, .hour, .minute, .second], from: endOfDay)
XCTAssertEqual(comps.day, 29)
XCTAssertEqual(comps.month, 2)
XCTAssertEqual(comps.year, 2016)
XCTAssertEqual(comps.hour, 23)
XCTAssertEqual(comps.minute, 59)
XCTAssertEqual(comps.second, 59)
}
}
|
[
-1
] |
e7c75e425def572cb2ea1e38578a7b3b7551ae6e
|
3f6cb9ae2b87771deb38a95a2b68ca3f77f4e90a
|
/WorkoutApp/ViewController/WorkoutCell.swift
|
9f1d8898f59e1e1e41cde3a6e62f555bf1ee1fff
|
[] |
no_license
|
josh43/Workout
|
8e7980109c912e80fb65a3abc838a878aa226ab8
|
3373d3afebd521b5b19c1bea3b3716def9d14a68
|
refs/heads/master
| 2021-06-13T09:22:10.914484 | 2017-02-14T20:56:35 | 2017-02-14T20:56:35 | 81,988,331 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 523 |
swift
|
//
// WorkoutCell.swift
// WorkoutApp
//
// Created by joshua on 2/9/17.
// Copyright © 2017 joshua. All rights reserved.
//
import UIKit
class WorkoutCell: UITableViewCell {
@IBOutlet weak var workoutID: UILabel!
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
}
|
[
172545,
384002,
320001,
337412,
227845,
206342,
206343,
241159,
241160,
333831,
227849,
227852,
327181,
34318,
34319,
34320,
372750,
372753,
372754,
333837,
307218,
196114,
327190,
328214,
287258,
328221,
366111,
370207,
345634,
345635,
281636,
243746,
287266,
356391,
278567,
305202,
292919,
310839,
278583,
289336,
123451,
327224,
66109,
327225,
327241,
307277,
327248,
332882,
235604,
215125,
214104,
235611,
213095,
213097,
213100,
310894,
115311,
115313,
222835,
222836,
213109,
148600,
403068,
356476,
410751,
403072,
300672,
131721,
230545,
329880,
373913,
139419,
148637,
148638,
276639,
131745,
131748,
148647,
148648,
300206,
327344,
313522,
361651,
381622,
166583,
313528,
313529,
313530,
327360,
313546,
278220,
223437,
278231,
290007,
291544,
306907,
337627,
294623,
131808,
131814,
176358,
131817,
375532,
271087,
325874,
228599,
298746,
228602,
338682,
300799,
300801,
300802,
322306,
276746,
298255,
225040,
282897,
298258,
276756,
312598,
320790,
203542,
67356,
336156,
123678,
336159,
336160,
336161,
336158,
123681,
336164,
349477,
261406,
349470,
396065,
111912,
293674,
287022,
313138,
110387,
369458,
369461,
282934,
399679,
200513,
342850,
342851,
300356,
157512,
151881,
302922,
430412,
283471,
283472,
380242,
270679,
287067,
200542,
336737,
350050,
317283,
270691,
257898,
330602,
317296,
179568,
112499,
317302,
177015,
244599,
113529,
244602,
244600,
179578,
233853,
179580,
233857,
281985,
211843,
213891,
36743,
209803,
277904,
334226,
320404,
311704,
283048,
211370,
311211,
288690,
258998,
281014,
306623,
306625,
306626,
306627,
317377,
317378,
317379,
311755,
311756,
311757,
311759,
430546,
430547,
358868,
180695,
180696,
358876,
346078,
196093,
284131,
344039,
196076,
165871,
167415,
310778,
305661,
201727
] |
b6041d90eef2ed81703dad4efc6041ba727cea2f
|
487a71a382f6129c757cbba9871a59cf19096791
|
/#lsd/LoginViewController.swift
|
10fb6023642ab506585776a0611f31aec76dfc5d
|
[] |
no_license
|
manuchopra/Larkin-Silent-Dance
|
7889e85c40f5d248d7b5634a79d3f69a0f7aaa70
|
8f9fe35de21d7e06c33a6900251b0c93dee25ed0
|
refs/heads/master
| 2021-01-10T19:27:09.515202 | 2015-03-14T06:52:10 | 2015-03-14T06:52:10 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,611 |
swift
|
//
// LoginViewController.swift
// #lsd
//
// Created by Manu Chopra on 3/4/15.
// Copyright (c) 2015 Stanford University. All rights reserved.
//
import UIKit
import Foundation
import AVFoundation
class LoginViewController : UIViewController {
@IBOutlet weak var button2: UIButton!
var player : AVAudioPlayer! = nil
var newLSD : Bool = false
@IBOutlet weak var button1: UIButton!
@IBAction func button2clicked(sender: UIButton) {
newLSD = true
}
func isNew() -> Bool {
return newLSD
}
override func viewDidLoad() { //Plays Tequila in the background.
let path = NSBundle.mainBundle().pathForResource("music", ofType:"mp3")
let fileURL = NSURL(fileURLWithPath: path!)
player = AVAudioPlayer(contentsOfURL: fileURL, error: nil)
player.prepareToPlay()
player.play()
var filePath = NSBundle.mainBundle().pathForResource("gif3", ofType: "gif")
var gif = NSData(contentsOfFile: filePath!)
var webViewBG = UIWebView(frame: CGRect(origin:CGPoint(x: 0.0, y: 0.0), size: view.frame.size))
webViewBG.loadData(gif, MIMEType: "image/gif", textEncodingName: nil, baseURL: nil)
webViewBG.userInteractionEnabled = false;
self.view.addSubview(webViewBG)
var filter = UIView()
filter.frame = self.view.frame
filter.backgroundColor = UIColor.blackColor()
filter.alpha = 0.05
self.view.addSubview(filter)
view.bringSubviewToFront(button1)
view.bringSubviewToFront(button2)
}
}
|
[
-1
] |
3b2bafe4a4c05e1744b5f99adccb25bc5029a588
|
1dfdc15711bda6668f5b52f6b76f60c9a96052ab
|
/Movieflex/Code/Services/NetworkManager.swift
|
00b622c1011d09ebbe9e3173257c3ee6bf0bd424
|
[
"MIT"
] |
permissive
|
ptejas26/Movieflex_iOS
|
d2b7805c8c34e316455a51361f399073bab48766
|
f9c1fcecb7b369ebcba5d1cc16a07d7b42a43f80
|
refs/heads/master
| 2022-12-19T12:55:31.253607 | 2020-09-23T04:31:54 | 2020-09-23T04:31:54 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 11,464 |
swift
|
//
// NetworkManager.swift
// Movieflex
//
// Created by Shubham Singh on 15/09/20.
// Copyright © 2020 Shubham Singh. All rights reserved.
//
import Alamofire
import UIKit
enum APIError: String {
case networkError
case apiError
case decodingError
}
// If the API Response is 429 or just doesn't work -> Create a new token with your credentials here -https://rapidapi.com/apidojo/api/imdb8/ . Replace the apiKey and the APIs will work again
enum APIs: URLRequestConvertible {
// MARK:- cases containing APIs
case titleautocomplete(query: String)
case popularTitles(regionCode: String)
case moviesComingSoon
case getTitleMetaData(titleIds: [String])
case getTitleDetails(titleId: String)
case getCastForTitle(titleId: String)
case getFilmsForActor(actorId: String)
// MARK:- variables
static let endpoint = URL(string: "https://imdb8.p.rapidapi.com")!
static let apiKey = "eb1390c44emsh9b810a50aa88407p125d4bjsndb8df9d35feb"
static let apiHost = "imdb8.p.rapidapi.com"
var path: String {
switch self {
case .titleautocomplete(_):
return "/title/auto-complete"
case .popularTitles(_):
return "/title/get-most-popular-movies"
case .moviesComingSoon:
return "/title/get-coming-soon-movies"
case .getTitleMetaData(_):
return "/title/get-meta-data"
case .getTitleDetails(_):
return "/title/get-overview-details"
case.getCastForTitle(_):
return "/title/get-top-cast"
case .getFilmsForActor(_):
return "/actors/get-all-filmography"
}
}
var method: HTTPMethod {
return .get
}
var encoding : URLEncoding {
return URLEncoding.init(destination: .queryString, arrayEncoding: .noBrackets)
}
func addApiHeaders(request: inout URLRequest) {
request.addValue(Self.apiHost, forHTTPHeaderField: "x-rapidapi-host")
request.addValue(Self.apiKey, forHTTPHeaderField: "x-rapidapi-key")
}
func asURLRequest() throws -> URLRequest {
var request = URLRequest(url: Self.endpoint.appendingPathComponent(path))
var parameters = Parameters()
switch self {
case .titleautocomplete(let query):
parameters["q"] = query
case .popularTitles(let regionCode):
parameters["currentCountry"] = regionCode
case .getTitleMetaData(let titleIds):
parameters["ids"] = titleIds
case .getTitleDetails(let titleId):
parameters["tconst"] = titleId
case .getCastForTitle(let titleId):
parameters["tconst"] = titleId
case .getFilmsForActor(let actorId):
parameters["nconst"] = actorId
default: break
}
addApiHeaders(request: &request)
request.addValue("iphone", forHTTPHeaderField: "User-Agent")
request = try encoding.encode(request, with: parameters)
return request
}
}
struct NetworkManager {
let jsonDecoder = JSONDecoder()
let fileHandler = FileHandler()
let imageCompressionScale: CGFloat = 0.25
// functions to call the APIs
func downloadMoviePoster(url: URL, id: String, completion: @escaping(URL?, APIError?) -> ()) {
Alamofire.request(URLRequest(url: url)).validate().responseData { res in
switch res.result {
case .failure:
completion(nil, .apiError)
case .success(let imageData):
guard let image = UIImage(data: imageData), let compressedData = image.jpegData(compressionQuality: imageCompressionScale) else { return }
do {
try compressedData.write(to: fileHandler.getPathForImage(id: id))
completion(fileHandler.getPathForImage(id: id), nil)
} catch {
print(error)
completion(nil, .decodingError)
}
}
}
}
func getTitlesFromSearch(query: String, completion: @escaping([String]?, APIError? ) -> ()) {
Alamofire.request(APIs.titleautocomplete(query: query)).validate().responseJSON { json in
switch json.result {
case .failure:
print("The API limit has expired, create a new free account. Sadly the API only supports 500 calls, you need to create a new Account and replace the apiKey variable above")
completion(nil, .apiError)
case .success(let jsonData):
if let payload = jsonData as? [String:Any], let arrayData = payload["d"], let jsonData = try? JSONSerialization.data(withJSONObject: arrayData, options: .sortedKeys) {
do {
let titles = try jsonDecoder.decode([SearchIds].self, from: jsonData)
let titleIds = titles.map { $0.id }
completion(titleIds, nil)
} catch {
print(error)
completion(nil, .decodingError)
}
} else {
completion(nil, .networkError)
}
}
}
}
func getPopularTitles(completion: @escaping([String]?, APIError?) -> ()) {
Alamofire.request(APIs.popularTitles(regionCode: "IN")).validate().responseJSON { json in
switch json.result {
case .failure:
print("The API limit has expired, create a new free account. Sadly the API only supports 500 calls, you need to create a new Account and replace the apiKey variable above")
completion(nil, .apiError)
break
case .success(let jsonData):
if let jsonData = try? JSONSerialization.data(withJSONObject: jsonData, options: .sortedKeys) {
do {
let popularTitles = try jsonDecoder.decode([String].self, from: jsonData)
completion(popularTitles.map { $0.components(separatedBy: "/")[2] }, nil)
} catch {
print(error)
completion(nil, .decodingError)
}
} else {
completion(nil, .networkError)
}
}
}
}
func getComingSoonTitles(completion: @escaping([String]?, APIError?) -> ()) {
Alamofire.request(APIs.moviesComingSoon).validate().responseJSON { json in
switch json.result {
case .failure:
completion(nil, .apiError)
break
case .success(let jsonData):
if let jsonData = try? JSONSerialization.data(withJSONObject: jsonData, options: .sortedKeys) {
do {
let popularTitles = try jsonDecoder.decode([String].self, from: jsonData)
completion(popularTitles.map { $0.components(separatedBy: "/")[2] }, nil)
} catch {
print(error)
completion(nil, .decodingError)
}
} else {
completion(nil, .networkError)
}
}
}
}
func getTitlesMetaData(titleIds: [String], completion: @escaping([TitleMetaData]?, APIError?) -> ()) {
Alamofire.request(APIs.getTitleMetaData(titleIds: titleIds)).validate().responseJSON { json in
switch json.result {
case .failure:
print("The API limit has expired, create a new free account. Sadly the API only supports 500 calls, you need to create a new Account and replace the apiKey variable above")
completion(nil, .apiError)
case .success(let jsonData):
if let payload = try? JSONSerialization.data(withJSONObject: jsonData, options: .sortedKeys) {
do {
let decodedData = try jsonDecoder.decode(DecodedTitleMetaData.self, from: payload)
completion(decodedData.titlesMetaData, nil)
} catch {
print(error)
completion(nil, .decodingError)
}
} else {
completion(nil, .networkError)
}
}
}
}
func getTitleDetails(titleId: String, completion: @escaping(TitleDetail?, APIError?) -> ()) {
Alamofire.request(APIs.getTitleDetails(titleId: titleId)).validate().responseJSON { json in
switch json.result {
case .failure:
completion(nil, .apiError)
case .success(let jsonData):
if let payload = try? JSONSerialization.data(withJSONObject: jsonData, options: .sortedKeys) {
do {
let titleDetails = try jsonDecoder.decode(TitleDetail.self, from: payload)
completion(titleDetails, nil)
} catch {
print(error)
completion(nil, .decodingError)
}
} else {
completion(nil, .networkError)
}
}
}
}
func getCastForTitle(titleId: String, completion: @escaping([String]?, APIError?) -> ()) {
Alamofire.request(APIs.getCastForTitle(titleId: titleId)).validate().responseJSON { json in
switch json.result {
case .failure:
print("The API limit has expired, create a new free account. Sadly the API only supports 500 calls, you need to create a new Account and replace the apiKey variable in the APIs enum")
completion(nil, .apiError)
break
case .success(let jsonData):
if let jsonData = try? JSONSerialization.data(withJSONObject: jsonData, options: .sortedKeys) {
do {
let titleCast = try jsonDecoder.decode([String].self, from: jsonData)
completion(titleCast.map { $0.components(separatedBy: "/")[2] }, nil)
} catch {
print(error)
completion(nil, .decodingError)
}
} else {
completion(nil, .networkError)
}
}
}
}
func getMoviesForActor(actorId: String, completion: @escaping(ActorFilms?, APIError?) -> ()) {
Alamofire.request(APIs.getFilmsForActor(actorId: actorId)).validate().responseJSON { json in
switch json.result {
case .failure:
completion(nil, .apiError)
case .success(let jsonData):
if let payload = try? JSONSerialization.data(withJSONObject: jsonData, options: .sortedKeys) {
do {
let actorFilms = try jsonDecoder.decode(ActorFilms.self, from: payload)
completion(actorFilms, nil)
} catch {
print(error)
completion(nil, .decodingError)
}
} else {
completion(nil, .networkError)
}
}
}
}
}
|
[
-1
] |
b496c61f317b8f1cf10baaba158d678970ba1b36
|
4ec01f16c9b5a6e81ea3bb1818a37b4d94ac6014
|
/JSONHelperTests/DictionaryTests.swift
|
b18df8986f2f89444ecdc8b62406d90b3107087d
|
[
"Zlib"
] |
permissive
|
nirzaf/JSONHelper
|
77c4f78db58b97a48e46cb9b4a99b499f1777d80
|
5d32705e37ebc00370f8617920da9d0325c6333a
|
refs/heads/master
| 2020-09-24T20:54:01.335288 | 2019-01-30T04:58:55 | 2019-02-08T10:11:12 | 225,841,231 | 21 | 0 |
NOASSERTION
| 2019-12-04T10:32:57 | 2019-12-04T10:32:57 | null |
UTF-8
|
Swift
| false | false | 1,596 |
swift
|
//
// Copyright © 2016 Baris Sencan. All rights reserved.
//
import Foundation
import XCTest
import JSONHelper
class DictionaryTests: XCTestCase {
// MARK: - Convertible Tests
let dateStringDictionary = ["one" : "2014-11-02", "two" : "2015-04-24"]
override func setUp() {
JSONHelper.dateFormatter.dateFormat = "yyyy-MM-dd"
}
func testDictionaryToConvertibleDictionary() {
var value = [String : Date]()
value <-- dateStringDictionary
XCTAssertEqual(JSONHelper.dateFormatter.string(from: value["one"]!), dateStringDictionary["one"])
}
func testDictionaryAsAnyToConvertibleDictionary() {
var value = [String : Date]()
value <-- (dateStringDictionary as Any)
XCTAssertEqual(JSONHelper.dateFormatter.string(from: value["one"]!), dateStringDictionary["one"])
}
// MARK: - Deserializable Tests
let dictionary = [
"one" : ["name" : "a"],
"two" : ["name" : "b"]
]
struct Item: Deserializable {
static let nameKey = "name"
var name = ""
init(dictionary: [String : Any]) {
name <-- dictionary["name"]
}
}
func testDictionaryToMappableDictionary() {
var value = [String : Item]()
value <-- dictionary
XCTAssertEqual(value["one"]?.name, dictionary["one"]?["name"])
XCTAssertEqual(value["two"]?.name, dictionary["two"]?["name"])
}
func testDictionaryAsAnyToMappableDictionary() {
var value = [String : Item]()
value <-- (dictionary as Any)
XCTAssertEqual(value["one"]?.name, dictionary["one"]?["name"])
XCTAssertEqual(value["two"]?.name, dictionary["two"]?["name"])
}
}
|
[
-1
] |
62665e57247a43787cf4e28ed694cb9cd3437228
|
18c41af2d6b4940938afba4dbb83390817eafffd
|
/factory/Home/SendOrders/CateOfxgy.swift
|
a3ad3a323a37a5a805dd3b339cdba19c1e1d75f4
|
[] |
no_license
|
youlai/factory
|
a74ee47b1941d861d36d2ba9bc9e40f58b023fcf
|
97986a7a5b4e73fba014a0046a2496932563df7d
|
refs/heads/master
| 2021-05-21T07:30:11.280439 | 2020-07-06T09:25:51 | 2020-07-06T09:25:51 | 252,601,477 | 2 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 3,402 |
swift
|
//
// CateOfxgy.swift
// ShopIOS
//
// Created by Apple on 2019/8/15.
// Copyright © 2019 Apple. All rights reserved.
//
import Foundation
import SwiftyJSON
struct CateOfxgy1 {
var InstallPrice: Int = 0
var IsUse: String?
var Level1ID: Int = 0
var Level1Name: String?
var Level: Int = 0
var Version: Int = 0
var GeInstallPrice: Int = 0
var BrandName: String?
var InitPrice: Int = 0
var ParentName: String?
var ParentID: Int = 0
var GeInitPrice: Int = 0
var page: Int = 0
var limit: Int = 0
var BrandID: Int = 0
var FCategoryName: String?
var Id: Int = 0
var FCategoryID: Int = 0
init(json: JSON) {
InstallPrice = json["InstallPrice"].intValue
IsUse = json["IsUse"].stringValue
Level1ID = json["Level1ID"].intValue
Level1Name = json["Level1Name"].stringValue
Level = json["Level"].intValue
Version = json["Version"].intValue
GeInstallPrice = json["GeInstallPrice"].intValue
BrandName = json["BrandName"].stringValue
InitPrice = json["InitPrice"].intValue
ParentName = json["ParentName"].stringValue
ParentID = json["ParentID"].intValue
GeInitPrice = json["GeInitPrice"].intValue
page = json["page"].intValue
limit = json["limit"].intValue
BrandID = json["BrandID"].intValue
FCategoryName = json["FCategoryName"].stringValue
Id = json["Id"].intValue
FCategoryID = json["FCategoryID"].intValue
}
}
struct CateOfxgy {
var CategoryID: Int = 0
var CourseCount: String?
var SubCategoryName: String?
var IsUse: String?
var page: Int = 0
var BrandCategoryID: Int = 0
var Imge: String?
var Id: Int = 0
var ProductTypeID: Int = 0
var CategoryName: String?
var BrandName: String?
var ProductTypeName: String?
var SubCategoryID: Int = 0
var BrandID: Int = 0
var UserID: String?
var limit: Int = 0
var Version: Int = 0
init(json: JSON) {
CategoryID = json["CategoryID"].intValue
CourseCount = json["CourseCount"].stringValue
SubCategoryName = json["SubCategoryName"].stringValue
IsUse = json["IsUse"].stringValue
page = json["page"].intValue
BrandCategoryID = json["BrandCategoryID"].intValue
Imge = json["Imge"].stringValue
Id = json["Id"].intValue
ProductTypeID = json["ProductTypeID"].intValue
CategoryName = json["CategoryName"].stringValue
BrandName = json["BrandName"].stringValue
ProductTypeName = json["ProductTypeName"].stringValue
SubCategoryID = json["SubCategoryID"].intValue
BrandID = json["BrandID"].intValue
UserID = json["UserID"].stringValue
limit = json["limit"].intValue
Version = json["Version"].intValue
}
}
struct BrandOfxgy {
var Categorys: String?
var IsUse: String?
var Id: Int = 0
var Version: Int = 0
var UserID: String?
var FBrandName: String?
var FBrandID: Int = 0
init(json: JSON) {
Categorys = json["Categorys"].stringValue
IsUse = json["IsUse"].stringValue
Id = json["Id"].intValue
Version = json["Version"].intValue
UserID = json["UserID"].stringValue
FBrandName = json["FBrandName"].stringValue
FBrandID = json["FBrandID"].intValue
}
}
|
[
-1
] |
84893eb02791fd488acf9ea60788c30d1b94d7b5
|
0b626204c8f32ae3535374ce39cffaa121df5d22
|
/SportDemo/SportDemo/Shared/view/TableViewCell/ZPTableEntity.swift
|
a1fc50ce6d056fa3bc88efcb775cb544fcf181fc
|
[
"MIT"
] |
permissive
|
xu6148152/binea_project_for_ios
|
3205b2edf99abb40f880152da3a82277917c9f10
|
1ee00d93a864c6e64af199a310abf8051567000f
|
refs/heads/master
| 2021-01-09T21:52:15.674070 | 2015-11-06T08:13:47 | 2015-11-06T08:13:47 | 36,546,406 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,461 |
swift
|
//
// ZPTableEntity.swift
// SportDemo
//
// Created by Binea Xu on 8/22/15.
// Copyright (c) 2015 Binea Xu. All rights reserved.
//
import Foundation
import UIKit
class ZPTableEntity {
var sections: NSMutableArray = []
init(){
sections = NSArray().mutableCopy() as! NSMutableArray
}
static func tableEntityFromPlist(pListFile: String) -> ZPTableEntity{
var array: NSArray = NSArray()
if let path = NSBundle.mainBundle().pathForResource(pListFile, ofType: "plist"){
array = NSMutableArray(contentsOfFile: path)!
// dictory = NSDictionary(contentsOfFile: path)
}
let entity = ZPTableEntity()
entity.initWithArray(array)
return entity
}
func initWithArray(array: NSArray){
for dict in array{
if let di = dict as? NSDictionary{
if di["ZPSectionType"] as! String == "ZPSingleSelectionTableSectionEntity"{
sections.addObject(di)
}
}
}
}
func cellAtIndexPath(indexPath: NSIndexPath, tableView: UITableView, widthDelegate: AnyObject) -> ZPTableBaseCell{
let section: ZPTableSectionEntity = sections[indexPath.section] as! ZPTableSectionEntity
return section.cellForRow(indexPath.row, tableView: tableView, withDelegate: widthDelegate)
}
}
|
[
-1
] |
ffab7fa13558b9b03ee666d7da2e58084430b429
|
78d9bb8b1e6e4dd80235ebeffcc299d7c71101c3
|
/Sources/Tesseract/Core/Extension.swift
|
e4665636c39d49d6d8e5ba853d154d073a6e0393
|
[
"Apache-2.0"
] |
permissive
|
lemonclik/Tesseract.swift
|
e1cee034dbc10697689d3ee3a8b47ee83f46ca95
|
d80a18b257dfd88acf5145510320731cf85d9098
|
refs/heads/master
| 2020-07-29T13:55:36.511097 | 2019-05-10T20:40:18 | 2019-05-10T20:40:18 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 979 |
swift
|
//
// Extension.swift
// Tesseract
//
// Created by Yehor Popovych on 5/3/19.
// Copyright © 2019 Tesseract Systems, Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
import Foundation
public struct TesseractExtension: RawRepresentable, Hashable, Equatable, Codable {
public typealias RawValue = String
public let rawValue: RawValue
public init(rawValue: RawValue) {
self.rawValue = rawValue
}
}
|
[
313024,
174946,
250854,
272327,
136007,
115465,
360838,
115467,
124849,
135825,
318194,
431124,
279835,
169695
] |
73c572c83457b1753fcb48bfe013ad6e13632817
|
b46be161f57b36198bcb9e65c0fdbe0778372806
|
/NewsAppSwiftMVVM/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxSearchBarDelegateProxy.swift
|
749c1ea071c847165c8f58031f8a692481674877
|
[
"MIT"
] |
permissive
|
masakiki-take/NewsAppSwiftMVVM
|
94fc20f015837b29f8c0ff2a15c98e8f321ccf4a
|
49420cce245fc6d1755bd0a3e12872981945c14d
|
refs/heads/master
| 2020-04-20T23:38:01.649645 | 2016-10-06T13:56:44 | 2016-10-06T13:56:44 | 169,173,359 | 1 | 0 |
MIT
| 2019-02-05T00:58:36 | 2019-02-05T00:58:36 | null |
UTF-8
|
Swift
| false | false | 1,365 |
swift
|
//
// RxSearchBarDelegateProxy.swift
// RxCocoa
//
// Created by Krunoslav Zaher on 7/4/15.
// Copyright © 2015 Krunoslav Zaher. All rights reserved.
//
#if os(iOS) || os(tvOS)
import Foundation
import UIKit
#if !RX_NO_MODULE
import RxSwift
#endif
/**
For more information take a look at `DelegateProxyType`.
*/
public class RxSearchBarDelegateProxy
: DelegateProxy
, UISearchBarDelegate
, DelegateProxyType {
/**
For more information take a look at `DelegateProxyType`.
*/
public class func currentDelegateFor(object: AnyObject) -> AnyObject? {
let searchBar: UISearchBar = castOrFatalError(object)
return searchBar.delegate
}
/**
For more information take a look at `DelegateProxyType`.
*/
public class func setCurrentDelegate(delegate: AnyObject?, toObject object: AnyObject) {
let searchBar: UISearchBar = castOrFatalError(object)
searchBar.delegate = castOptionalOrFatalError(delegate)
}
// MARK: Delegate proxy methods
#if os(iOS)
/**
For more information take a look at `DelegateProxyType`.
*/
public override class func createProxyForObject(object: AnyObject) -> AnyObject {
let searchBar = (object as! UISearchBar)
return castOrFatalError(searchBar.rx_createDelegateProxy())
}
#endif
}
#endif
|
[
281824,
283011,
278388,
61963
] |
d1d48153b7c3ad06313309d4e9dab465c814fa68
|
17673126a859b1a0927e8f4a4245c2dbd10c4897
|
/TableCollectionManager/TableCollectionManager/TableManager/Row/TableRowActionResult.swift
|
449b2af400c022402d34d6e6c7ecc9704c44c649
|
[
"MIT"
] |
permissive
|
mevansjr/TableCollectionManager
|
05d415476c039ab4a2343a3e61c892c415d25e8e
|
5b7fd2cc686ca2ef521c771ae1da9a3477f2ee6a
|
refs/heads/master
| 2022-09-29T20:00:26.488128 | 2020-06-02T20:10:20 | 2020-06-02T20:10:20 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,554 |
swift
|
//
// TableRowActionResult.swift
//
// Copyright (c) 2020 Dmytro Mishchenko (https://github.com/DimaMishchenko)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
import UIKit
public final class TableRowActionResult<Cell: UITableViewCell & TableConfigurable> {
public let model: Cell.Model
public let cell: Cell?
public let indexPath: IndexPath
public init(model: Cell.Model, cell: Cell?, indexPath: IndexPath) {
self.model = model
self.cell = cell
self.indexPath = indexPath
}
}
|
[
142083,
142087,
142089,
437387,
229524,
54678,
437273,
197018,
197019,
191007,
54692,
241959,
60328,
54698,
289068,
241846,
437441,
292041,
437451,
142078,
127698,
141272,
34531,
334563,
334564,
141290,
174063,
174066,
222581,
244469,
334590
] |
38acc6380a6e6de57a926e94dbf2aea6214b30fd
|
6684fc348a5e14660942d20c1c4280ed8b945717
|
/Something/ViewControllers/Cells/ChatListCell.swift
|
ca2b43be248bdf4af01e8aee5c5667f3bde98445
|
[] |
no_license
|
ksmks0921/something_ios
|
97707ac791fb5fa730ca0071cc96d9165c88a6ef
|
12b05a347a6c8077087832c9069f81941f5c5a53
|
refs/heads/master
| 2022-04-03T08:31:07.460934 | 2020-02-17T22:32:59 | 2020-02-17T22:32:59 | 228,249,529 | 1 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 823 |
swift
|
//
// ChatListCell.swift
// Something
//
// Created by Maninder Singh on 11/03/18.
// Copyright © 2018 Maninder Singh. All rights reserved.
//
import UIKit
class ChatListCell: UITableViewCell {
@IBOutlet weak var userImageView: MSBImageView!
@IBOutlet weak var lastMessageLabel: UILabel!
@IBOutlet weak var nameLabel: UILabel!
@IBOutlet weak var dateLabel: UILabel!
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
override func prepareForReuse() {
userImageView.image = #imageLiteral(resourceName: "user")
sd_cancelCurrentImageLoad()
}
}
|
[
-1
] |
452bcffbab1304ee90cc7229220c0ff62a048345
|
2b907dc990ee12cab7e3727189f48ebc2c473dc6
|
/Sources/AndeaKit/macos/CALayer.swift
|
ef162d24e7918ba0020febc262d4e22efb2790e3
|
[
"Apache-2.0"
] |
permissive
|
dpostigo/andea
|
183ea173fd9419ea2364976775473a2ef921afc3
|
bd32ae0753c772ed5418187855b2ad759ba37683
|
refs/heads/master
| 2021-01-25T14:04:41.237636 | 2018-04-03T23:04:49 | 2018-04-03T23:11:56 | 123,651,015 | 0 | 0 |
Apache-2.0
| 2018-03-27T01:48:39 | 2018-03-03T02:13:31 |
Swift
|
UTF-8
|
Swift
| false | false | 3,324 |
swift
|
//
// Created by Daniela Postigo on 7/17/17.
//
import Cocoa
import QuartzCore
open class Background: NSView {
private let maskLayer: CAShapeLayer = CAShapeLayer()
private static let layerHeight: CGFloat = 5
// MARK: Init
public override init(frame frameRect: NSRect) {
super.init(frame: frameRect)
self.wantsLayer = true
self.layer!.backgroundColor = NSColor.clear.cgColor
self.maskLayer.fillColor = NSColor.clear.cgColor
self.maskLayer.backgroundColor = NSColor.clear.cgColor
self.layer!.addSublayer(self.maskLayer)
self.shadowOpacity = 0.5
self.shadowColor = NSColor.black.cgColor
self.shadowRadius = 1
self.shadowOffset = CGSize(width: 0, height: 1)
}
required public init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
// MARK: Layout
override open var isFlipped: Bool {
return true
}
override open func layout() {
super.layout()
guard self.maskLayer.frame != self.bounds else { return }
self.maskLayer.shadowPath = CGPath(rect: self.layerRect, transform: nil)
self.maskLayer.frame = self.bounds
}
// MARK: Private
private var layerRect: NSRect {
var rect = self.bounds.offsetBy(dx: 0, dy: -type(of: self).layerHeight)
rect.size.height = type(of: self).layerHeight
return rect
}
// MARK: Helpers
func update(shadow: NSShadow) {
self.maskLayer.shadowRadius = shadow.shadowBlurRadius
self.maskLayer.shadowOffset = shadow.shadowOffset
self.maskLayer.shadowColor = shadow.shadowColor?.cgColor
}
// MARK: Getters
open var shadowColor: CGColor? {
set { self.maskLayer.shadowColor = newValue }
get { return self.maskLayer.shadowColor }
}
open var shadowRadius: CGFloat {
set { self.maskLayer.shadowRadius = newValue }
get { return self.maskLayer.shadowRadius }
}
open var shadowOffset: CGSize {
set { self.maskLayer.shadowOffset = newValue }
get { return self.maskLayer.shadowOffset }
}
open var shadowOpacity: Float {
set { self.maskLayer.shadowOpacity = newValue }
get { return self.maskLayer.shadowOpacity }
}
}
class ShadowLayer: CALayer {
private let shadowLayer = CAShapeLayer()
override open var backgroundColor: CGColor? {
didSet {
}
}
override var shadowColor: CGColor? {
set {
self.shadowLayer.strokeColor = self.shadowColor
self.shadowLayer.shadowColor = self.shadowColor
}
get { return self.shadowLayer.shadowColor }
}
override var shadowRadius: CGFloat {
didSet {
self.shadowLayer.shadowRadius = self.shadowRadius
self.shadowLayer.shadowOffset = CGSize(width: 0, height: self.shadowRadius * 2)
}
}
override init(layer: Any) {
super.init(layer: layer)
Log.print("\(type(of: self)).\(#function)")
self.masksToBounds = true
self.shadowLayer.shadowOpacity = 1
self.shadowLayer.fillColor = NSColor.clear.cgColor
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
|
[
-1
] |
22064567152dadac7a0a047e2508dc9c2a5f8797
|
43a7371e8b3974fc3d551cefc7ea93752eaed401
|
/BestSwiftRepositories/Extension/URLRequest+Log.swift
|
97847afb95e7db28fa545bc5f3452efbbbc9e8ce
|
[] |
no_license
|
lucascesarnf/BestSwiftRepositories
|
687a947d74e77e5175c779c88a2af6106d0202f5
|
65821039f2cda1c91f27bb6575d160c2271f5d4b
|
refs/heads/main
| 2023-07-14T16:20:08.930342 | 2021-08-23T19:54:30 | 2021-08-23T19:54:30 | 302,176,414 | 2 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 447 |
swift
|
//
// URLRequest+Log.swift
// ChuckNorrisFacts
//
// Created by Lucas César Nogueira Fonseca on 06/10/20.
// Copyright © 2020 Lucas César Nogueira Fonseca. All rights reserved.
//
import Foundation
extension URLRequest {
func log() {
print("\(httpMethod ?? "") \(self)")
print("BODY \n \(String(describing: httpBody?.toString()))")
print("HEADERS \n \(String(describing: allHTTPHeaderFields))")
}
}
|
[
-1
] |
4fb3556a5c411975d26b379d093e270b0bbe450f
|
b5a3df9227901ae358925a5bfe614ab00cbc2a83
|
/Messenger/Source/Chat Items/Photo Messages/DemoPhotoMessageViewModel.swift
|
c03179679bf3c105fa9b54d5d6ee57e0c3f72f19
|
[] |
no_license
|
makskovalko/MessengerUI
|
3387d7c18947d4be6dc634d468c09b6b2126a5ae
|
6ec7ecccf1435ce6e11ad4207d8d0a9234a55ae2
|
refs/heads/master
| 2020-07-03T07:28:55.841113 | 2019-08-12T01:48:45 | 2019-08-12T01:48:45 | 201,838,107 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,814 |
swift
|
import Foundation
import ChattoAdditions
final class DemoPhotoMessageViewModel: PhotoMessageViewModel<DemoPhotoMessageModel> {
private let fakeImage: UIImage
override init(
photoMessage: DemoPhotoMessageModel,
messageViewModel: MessageViewModelProtocol
) {
fakeImage = photoMessage.image
super.init(
photoMessage: photoMessage,
messageViewModel: messageViewModel
)
guard !photoMessage.isIncoming else { return }
image.value = nil
}
override func willBeShown() { fakeProgress() }
func fakeProgress() {
let statuses = [.success, .failed] as [TransferStatus]
if statuses.contains(transferStatus.value) { return }
if self.transferProgress.value >= 1.0 {
if arc4random_uniform(100) % 2 == 0 {
transferStatus.value = .success
image.value = fakeImage
} else {
transferStatus.value = .failed
}
return
}
transferStatus.value = .transfering
let delaySeconds: Double = Double(arc4random_uniform(600)) / 1000.0
let delayTime = DispatchTime.now() + Double(Int64(delaySeconds * Double(NSEC_PER_SEC))) / Double(NSEC_PER_SEC)
DispatchQueue.main.asyncAfter(deadline: delayTime) { [weak self] in
guard let sSelf = self else { return }
let deltaProgress = Double(arc4random_uniform(15)) / 100.0
sSelf.transferProgress.value = min(sSelf.transferProgress.value + deltaProgress, 1)
sSelf.fakeProgress()
}
}
}
extension DemoPhotoMessageViewModel: DemoMessageViewModelProtocol {
var messageModel: DemoMessageModelProtocol { return _photoMessage }
}
|
[
-1
] |
28681bfe9f8ebe520113b4637677ae62442d7169
|
7882e3ce911b725bffbc347879550504881a8e36
|
/UserSwiftUIUITests/UserSwiftUIUITests.swift
|
396bac8d1ae7a21bdec34af326f9606ad4566c58
|
[] |
no_license
|
mvpscottjon/User-SwiftUI
|
9a7401d3a6304a220c2bcfb81a29bdaab3fe2eea
|
e10525754da6c58f91f08a36bd74f05f52d53c9f
|
refs/heads/master
| 2023-08-26T02:41:31.638469 | 2021-09-24T07:25:41 | 2021-09-24T07:25:41 | 407,756,798 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,433 |
swift
|
//
// UserSwiftUIUITests.swift
// UserSwiftUIUITests
//
// Created by Seven on 2021/9/18.
//
import XCTest
class UserSwiftUIUITests: 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,
352314,
213051,
376892,
32829,
286787,
352324,
237638,
352327,
385095,
393291,
163916,
368717,
311373,
196687,
278607,
311377,
254039,
426074,
368732,
180317,
32871,
352359,
221292,
278637,
385135,
319599,
376945,
131190,
385147,
131199,
426124,
196758,
49308,
65698,
311459,
49317,
377008,
377010,
180409,
295099,
377025,
377033,
164043,
417996,
254157,
368849,
368850,
139478,
229591,
385240,
254171,
147679,
147680,
311520,
205034,
254189,
286957,
254193,
344312,
336121,
262403,
147716,
385291,
368908,
180494,
262419,
368915,
254228,
319764,
278805,
377116,
254250,
311596,
131374,
418095,
336177,
368949,
180534,
155968,
287040,
311622,
270663,
368969,
254285,
180559,
377168,
344402,
229716,
368982,
270703,
139641,
385407,
385409,
270733,
106893,
385423,
385433,
213402,
385437,
254373,
156069,
385448,
385449,
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,
377352,
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,
336531,
287379,
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,
328495,
197424,
164655,
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,
377754,
337226,
172971,
140203,
377778,
304050,
189362,
189365,
377789,
189373,
345030,
345034,
279499,
418774,
386007,
386009,
418781,
386016,
123880,
418793,
320495,
222193,
435185,
271351,
214009,
312313,
435195,
312317,
328701,
386049,
328705,
418819,
410629,
377863,
189448,
230411,
361487,
435216,
386068,
254997,
336928,
336930,
410665,
345137,
361522,
312372,
238646,
238650,
320571,
386108,
410687,
336962,
377927,
238663,
361547,
205911,
156763,
361570,
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,
369929,
419097,
320795,
115997,
222496,
320802,
304422,
369964,
353581,
116014,
66863,
312628,
345397,
345398,
386363,
222523,
230730,
353611,
337228,
353612,
345418,
296269,
222542,
353617,
238928,
296274,
378201,
230757,
296304,
312688,
337280,
353672,
263561,
296328,
296330,
370066,
9618,
411028,
279955,
370072,
148899,
148900,
361928,
337359,
329168,
312785,
222674,
329170,
353751,
280025,
239069,
361958,
271850,
280042,
280043,
271853,
329198,
411119,
337391,
116209,
296434,
386551,
288252,
271880,
198155,
304655,
329231,
370200,
222754,
157219,
157220,
394793,
312879,
288305,
288319,
288322,
280131,
288328,
353875,
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,
345817,
337638,
345832,
181992,
345835,
288492,
141037,
313082,
288508,
288515,
173828,
395018,
395019,
116491,
395026,
116502,
435993,
345882,
411417,
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,
182145,
280451,
67464,
305032,
337816,
239515,
329627,
436130,
354210,
436135,
10153,
313257,
362411,
370604,
362418,
411587,
280517,
362442,
346066,
231382,
354268,
436189,
403421,
329696,
354273,
403425,
354279,
436199,
174058,
337899,
354283,
247787,
296942,
436209,
239610,
182277,
346117,
403463,
43016,
354312,
354311,
354310,
313356,
436235,
419857,
305173,
436248,
223269,
346153,
354346,
313388,
272432,
403507,
378933,
378934,
436283,
288835,
403524,
436293,
313415,
239689,
436304,
223317,
411738,
272477,
280676,
313446,
395373,
288878,
346237,
215165,
436372,
329884,
378186,
362658,
436388,
215204,
133313,
395458,
338118,
436429,
346319,
379102,
387299,
18661,
379110,
338151,
149743,
379120,
436466,
411892,
436471,
395511,
313595,
436480,
272644,
338187,
338188,
395536,
338196,
272661,
379157,
157973,
338217,
321839,
362809,
379193,
395591,
289109,
272730,
436570,
215395,
239973,
280938,
321901,
354671,
362864,
272755,
354678,
199030,
223611,
436609,
436613,
395653,
395660,
264591,
272784,
420241,
240020,
190870,
43416,
190872,
289185,
436644,
289195,
272815,
436659,
338359,
436677,
289229,
281038,
281039,
256476,
420326,
166403,
420374,
322077,
289328,
330291,
322119,
191065,
436831,
117350,
420461,
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,
166677,
207639,
363295,
355117,
191285,
273209,
355129,
273211,
355136,
355138,
420680,
355147,
355148,
355153,
281426,
387927,
363353,
363354,
281434,
420702,
363361,
363362,
412516,
355173,
355174,
281444,
207724,
355182,
207728,
420722,
314240,
158594,
330627,
240517,
265094,
387977,
396171,
355216,
224146,
224149,
256918,
256919,
256920,
240543,
256934,
273336,
289720,
289723,
273341,
330688,
379845,
363462,
19398,
273353,
191445,
207839,
347104,
314343,
134124,
412653,
248815,
257007,
347122,
183291,
437245,
257023,
125953,
396292,
330759,
347150,
330766,
412692,
330789,
248871,
281647,
412725,
257093,
404550,
207954,
339031,
404582,
257126,
265318,
322664,
265323,
396395,
404589,
273523,
363643,
248960,
363658,
404622,
224400,
265366,
347286,
429209,
339101,
429216,
380069,
265381,
3243,
208044,
322733,
421050,
339131,
265410,
183492,
273616,
421081,
339167,
298209,
421102,
363769,
52473,
208123,
52476,
412926,
437504,
322826,
388369,
380178,
429332,
126229,
412963,
257323,
437550,
273713,
298290,
208179,
159033,
347451,
372039,
257353,
257354,
109899,
437585,
331091,
150868,
314708,
372064,
429410,
437602,
281958,
388458,
265579,
306541,
421240,
224637,
388488,
298378,
306580,
282008,
396697,
282013,
290206,
396709,
298406,
241067,
380331,
314797,
380335,
355761,
421302,
134586,
380348,
216510,
380350,
216511,
306630,
200136,
273865,
306634,
339403,
372172,
413138,
421338,
437726,
429540,
3557,
3559,
191980,
282097,
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,
388712,
388713,
314997,
290425,
339579,
396927,
282248,
224907,
396942,
405140,
274071,
323226,
208547,
208548,
405157,
388775,
282279,
364202,
421556,
224951,
224952,
306875,
282302,
323262,
241366,
224985,
282330,
159462,
372458,
397040,
12017,
323315,
274170,
200444,
175874,
249606,
282379,
216844,
372497,
397076,
421657,
339746,
216868,
257831,
167720,
241447,
421680,
282418,
421686,
274234,
339782,
315209,
159563,
323405,
339799,
307038,
274276,
282471,
274288,
372592,
274296,
339840,
372625,
282517,
298912,
118693,
438186,
126896,
151492,
380874,
372699,
323554,
380910,
380922,
380923,
274432,
372736,
241695,
430120,
102441,
315433,
430127,
405552,
282671,
241717,
249912,
225347,
307269,
421958,
233548,
176209,
381013,
53334,
315477,
356446,
323678,
438374,
176231,
438378,
233578,
422000,
249976,
266361,
422020,
168069,
381061,
168070,
381071,
241809,
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,
282908,
389406,
282912,
233761,
438575,
315698,
266547,
397620,
332084,
438583,
127292,
438592,
323914,
201037,
397650,
348499,
250196,
348501,
389465,
110955,
242027,
242028,
160111,
250227,
315768,
291193,
438653,
291200,
266628,
340356,
242059,
225684,
373141,
373144,
291225,
389534,
397732,
373196,
176602,
242138,
184799,
291297,
201195,
324098,
233987,
340489,
397841,
283154,
258584,
397855,
291359,
348709,
348710,
397872,
283185,
234037,
340539,
266812,
438850,
348741,
381515,
348748,
430681,
332379,
242274,
184938,
373357,
184942,
176751,
389744,
356983,
356984,
209529,
356990,
291455,
373377,
422529,
201348,
152196,
356998,
348807,
356999,
316044,
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,
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,
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,
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,
415369,
431754,
210569,
267916,
415376,
259741,
153252,
399014,
210601,
202413,
415419,
259780,
267978,
333522,
325345,
333543,
431861,
284410,
161539,
284425,
300812,
284430,
366358,
169751,
431901,
341791,
186148,
186149,
399148,
202541,
431918,
284460,
153392,
431935,
415555,
325444,
153416,
325449,
341837,
415566,
431955,
325460,
341846,
300893,
259937,
382820,
276326,
415592,
292713,
292719,
325491,
341878,
276343,
350072,
333687,
112510,
325508,
333700,
243590,
325514,
350091,
350092,
350102,
350108,
333727,
219046,
284584,
292783,
300983,
128955,
219102,
292835,
6116,
317416,
432114,
325620,
415740,
268286,
415744,
243720,
399372,
153618,
358418,
178215,
325675,
243763,
358455,
399433,
104534,
194667,
260206,
432241,
284789,
374913,
374914,
415883,
333968,
153752,
333990,
104633,
260285,
227517,
268479,
374984,
301270,
301271,
325857,
334049,
268515,
383208,
317676,
260337,
260338,
432373,
375040,
309504,
260355,
432387,
375052,
194832,
325904,
391448,
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,
416206,
326093,
432608,
285152,
391654,
432616,
334315,
375281,
293368,
317949,
334345,
309770,
342537,
432650,
342549,
342560,
416288,
350758,
350759,
358951,
358952,
293420,
219694,
219695,
375345,
432694,
244279,
309831,
375369,
375373,
416334,
301647,
416340,
244311,
416353,
260705,
375396,
268901,
244345,
334473,
375438,
326288,
285348,
293552,
342705,
285362,
383668,
342714,
39616,
383708,
342757,
269036,
432883,
203511,
342775,
383740,
416509,
359166,
162559,
375552,
432894,
228099,
285443,
285450,
383755,
326413,
285467,
318247,
342827,
391980,
318251,
375610,
301883,
342846,
416577,
416591,
244569,
375644,
252766,
293729,
351078,
342888,
392057,
211835,
392065,
260995,
400262,
392071,
424842,
252812,
400271,
392080,
400282,
7070,
211871,
359332,
359333,
293801,
326571,
252848,
326580,
261045,
261046,
326586,
359365,
211913,
342990,
252878,
433104,
56270,
359380,
433112,
433116,
359391,
187372,
343020,
383980,
203758,
383994,
171009,
384004,
433166,
384015,
433173,
293911,
326684,
252959,
384031,
375848,
318515,
203829,
261191,
375902,
375903,
392288,
253028,
351343,
187505,
138354,
187508,
384120,
302202,
285819,
392317,
343166,
384127,
392320,
285823,
285833,
285834,
318602,
228492,
187539,
359574,
285850,
351389,
302239,
253098,
302251,
367791,
367792,
367798,
64699,
294075,
228541,
343230,
367809,
253124,
113863,
351445,
310496,
195809,
253168,
351475,
351489,
367897,
367898,
130342,
130344,
130347,
261426,
212282,
294210,
359747,
359748,
146760,
146763,
114022,
253288,
425327,
425331,
163190,
327030,
384379,
253316,
294278,
384391,
318860,
253339,
253340,
318876,
343457,
245160,
359860,
359861,
343480,
310714,
228796,
228804,
425417,
310731,
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,
409289,
425682,
286419,
294621,
245471,
155360,
294629,
212721,
163575,
286457,
286463,
319232,
360194,
409355,
155408,
417556,
294699,
204600,
319289,
384826,
409404,
360253,
409416,
376661,
237397,
368471,
425820,
368486,
384871,
425832,
368489,
40809,
409446,
417648,
417658,
360315,
253828,
327556,
311183,
425875,
294806,
294808,
253851,
376733,
204702,
319393,
294820,
253868,
204722,
188349,
98240,
212947,
212953,
360416,
294887,
253930,
327666,
385011
] |
98007a61a044a2b168cfdb635be54bc6414748af
|
1ea427a421c55f808f4cf07fe0c85f4e752877cb
|
/Test/ContentView.swift
|
763acef8006fd44459e9095031c8f4389adf1693
|
[] |
no_license
|
althurzard/swiftui-calculator-demo
|
ae3b8fe6acf625cc69375f01d945a918713b4127
|
9da6f8ddb3b4f6d4e49631c56224ece47164001c
|
refs/heads/main
| 2023-02-07T08:29:42.604599 | 2020-12-29T04:04:16 | 2020-12-29T04:04:16 | 325,181,634 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 320 |
swift
|
//
// ContentView.swift
// Test
//
// Created by Vuong on 12/23/20.
//
import SwiftUI
struct ContentView: View {
var body: some View {
Text("Hello, world!")
.padding()
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
|
[
338688,
336515,
369287,
391944,
24462,
108815,
108816,
108814,
108818,
256912,
263442,
419473,
370198,
386582,
350104,
345880,
356504,
157851,
182556,
347284,
208544,
357409,
274083,
369958,
153638,
158760,
153644,
372654,
223152,
353585,
340787,
375348,
343100,
418108,
372030,
374977,
147012,
333510,
420678,
272204,
345165,
353614,
357838,
409936,
207441,
420816,
386510,
212948,
356437,
425429,
378198,
370394,
194525,
359645,
260702,
397150,
397151,
243042,
98787,
357220,
345188,
379103,
168045,
213357,
219117,
66799,
359928,
360956,
351103
] |
4a814824bf7f7e88754dbdfbb70215452ac9ec0f
|
6baa8281c82abfe3b6dea41bfe8c77eedff3aa2b
|
/hamstech/ViewControllers/ChatViewController/ChatViewController.swift
|
f8a9de6a39fa3a75934bb2b9fe16724854b4afcb
|
[] |
no_license
|
hamstechonline/hamstech-ios
|
ccea46535c922e8a1958485364ebd9ec3389fdd5
|
fe2ea50cdac901d5ab2411c98463f315ee004b02
|
refs/heads/master
| 2023-02-16T06:50:18.860449 | 2021-01-17T16:03:34 | 2021-01-17T16:03:34 | 311,568,375 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,374 |
swift
|
//
// ChatViewController.swift
// hamstech
//
// Created by Priyanka on 29/04/20.
//
import UIKit
class ChatViewController: UIViewController {
var checking : Bool!
override func viewDidLoad() {
super.viewDidLoad()
}
override func viewWillAppear(_ animated: Bool) {
self.navigationController?.navigationBar.isHidden = true
UserDefaults.standard.set(true, forKey: "checked")
self.openWhatsapp()
}
//Whats app
func openWhatsapp(){
let phoneNumber = "+919010100240"
let appURL = URL(string: "https://api.whatsapp.com/send?phone=\(phoneNumber)")!
if UIApplication.shared.canOpenURL(appURL) {
if #available(iOS 10.0, *) {
UIApplication.shared.open(appURL, options: [:], completionHandler: nil)
}
else {
UIApplication.shared.openURL(appURL)
}
} else {
self.view.window?.makeToast("Whatsapp is not Installed", duration: 2.0, position: CSToastPositionCenter)
}
}
override func viewWillDisappear(_ animated: Bool) {
UserDefaults.standard.set(false, forKey: "checked")
}
}
|
[
-1
] |
90d7f1481de094556263871f8aa8339b2dcda555
|
405f7024a0484a3de20800e6a5ae3fc1ee6a954d
|
/Tests/BowTests/Transformers/WriterTTest.swift
|
1ba4edb8af83b1fc2e8899f9454edf5890498d5b
|
[
"Apache-2.0"
] |
permissive
|
bkase/bow
|
435384a3f7d0ea2cdef04fbdb2d7291cc810be11
|
07b98ec1328bdf909c774623ceb1c65194234ed2
|
refs/heads/master
| 2020-09-02T11:46:22.867705 | 2019-10-24T07:27:27 | 2019-10-24T07:27:27 | 219,213,733 | 2 | 0 |
NOASSERTION
| 2019-11-02T21:04:13 | 2019-11-02T21:04:13 | null |
UTF-8
|
Swift
| false | false | 1,649 |
swift
|
import XCTest
@testable import BowLaws
import Bow
class WriterTTest: XCTestCase {
func testEquatableLaws() {
EquatableKLaws<WriterTPartial<ForId, Int>, Int>.check()
}
func testFunctorLaws() {
FunctorLaws<WriterTPartial<ForId, Int>>.check()
}
func testApplicativeLaws() {
ApplicativeLaws<WriterTPartial<ForId, Int>>.check()
}
func testSelectiveLaws() {
SelectiveLaws<WriterTPartial<ForId, Int>>.check()
}
func testMonadLaws() {
MonadLaws<WriterTPartial<ForId, Int>>.check()
}
func testSemigroupKLaws() {
SemigroupKLaws<WriterTPartial<ForArrayK, Int>>.check()
}
func testMonoidKLaws() {
MonoidKLaws<WriterTPartial<ForArrayK, Int>>.check()
}
func testFunctorFilterLaws() {
FunctorFilterLaws<WriterTPartial<ForOption, Int>>.check()
}
func testMonadFilterLaws() {
MonadFilterLaws<WriterTPartial<ForOption, Int>>.check()
}
func testMonadWriterLaws() {
MonadWriterLaws<WriterTPartial<ForId, Int>>.check()
}
func testApplicativeErrorLaws() {
ApplicativeErrorLaws<WriterTPartial<EitherPartial<CategoryError>, Int>>.check()
}
func testMonadErrorLaws() {
MonadErrorLaws<WriterTPartial<EitherPartial<CategoryError>, Int>>.check()
}
func testCensor() {
let x = Writer.writer(("A", 1))
let result = x.censor { x in x.lowercased() }
let expected = Writer.writer(("a", 1))
print(result^.run)
print(expected^.run)
XCTAssertEqual(result, expected)
}
}
|
[
-1
] |
bfa1d70a964ac76bb6ba5721d50e94326a7c867c
|
83c4292bec8a34f87d89c69023fbbdb8b72842d1
|
/CollectionViewCompositionalLayout/BubbleViewCollectionView/BubbleViewCollectionView/AppDelegate.swift
|
33719d4303279e9c0d7cd4f56091112d93c905ff
|
[] |
no_license
|
nbnitin/CollectionView
|
e72a61c51db5c75d7d95058a3e050cdbe89edb83
|
4ca089706dcc4b3fa4846040cfccca06f34e1268
|
refs/heads/master
| 2023-04-28T07:30:27.842113 | 2023-04-22T07:12:25 | 2023-04-22T07:12:25 | 101,870,881 | 3 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,364 |
swift
|
//
// AppDelegate.swift
// BubbleViewCollectionView
//
// Created by Nitin Bhatia on 20/04/23.
//
import UIKit
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
// MARK: UISceneSession Lifecycle
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
// Called when a new scene session is being created.
// Use this method to select a configuration to create the new scene with.
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
}
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
// Called when the user discards a scene session.
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
}
}
|
[
393222,
393224,
393230,
393250,
344102,
393261,
393266,
213048,
385081,
376889,
393275,
376905,
327756,
254030,
286800,
368727,
180313,
368735,
180320,
376931,
286831,
368752,
286844,
417924,
262283,
286879,
286888,
377012,
327871,
377036,
180431,
377046,
418010,
377060,
327914,
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,
262507,
246123,
262510,
213372,
385419,
393612,
262550,
262552,
385440,
385443,
385451,
262573,
393647,
385458,
262586,
344511,
262592,
360916,
369118,
328177,
328179,
328182,
328189,
328192,
164361,
410128,
393747,
254490,
188958,
385570,
33316,
377383,
197159,
352821,
197177,
418363,
188987,
369223,
385609,
385616,
352864,
369253,
262760,
352874,
352887,
254587,
377472,
148105,
377484,
352918,
98968,
344744,
361129,
336555,
385713,
434867,
164534,
336567,
164538,
328378,
328386,
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,
328484,
418598,
418605,
336696,
361273,
328515,
336708,
328519,
361288,
336711,
328522,
426841,
197468,
254812,
361309,
361315,
361322,
328573,
377729,
369542,
361360,
222128,
345035,
386003,
345043,
386011,
386018,
386022,
435187,
328702,
328714,
361489,
386069,
386073,
336921,
336925,
345118,
377887,
345133,
345138,
386101,
361536,
197707,
189520,
345169,
156761,
361567,
148578,
345199,
386167,
361593,
410745,
361598,
214149,
345222,
386186,
337047,
345246,
214175,
337071,
337075,
386258,
328924,
66782,
222437,
386285,
328941,
386291,
345376,
353570,
345379,
410917,
345382,
345399,
378169,
369978,
337222,
337229,
337234,
263508,
402791,
345448,
271730,
378227,
271745,
181638,
353673,
181643,
181649,
181654,
230809,
181670,
181673,
181678,
181681,
337329,
181684,
181690,
361917,
181696,
337349,
181703,
337365,
271839,
329191,
361960,
329194,
116210,
337398,
337415,
329226,
419339,
419343,
419349,
345625,
419355,
370205,
419359,
394786,
419362,
370213,
419368,
419376,
206395,
214593,
419400,
419402,
353867,
419406,
419410,
394853,
345701,
222830,
370297,
403070,
403075,
345736,
198280,
403091,
345749,
419483,
345757,
345762,
419491,
345765,
419497,
419501,
370350,
419506,
419509,
419512,
337592,
337599,
419527,
419530,
419535,
272081,
394966,
419542,
419544,
181977,
345818,
419547,
419550,
419559,
337642,
419563,
337645,
370415,
337659,
141051,
337668,
362247,
395021,
362255,
116509,
345887,
378663,
345905,
354106,
354111,
247617,
354117,
370503,
329544,
345930,
370509,
354130,
247637,
337750,
370519,
313180,
354142,
354150,
354156,
345967,
345970,
345974,
403320,
354172,
247691,
337808,
247700,
329623,
436126,
436132,
337833,
362413,
337844,
346057,
346063,
247759,
329697,
354277,
190439,
247789,
354313,
346139,
436289,
378954,
395339,
338004,
100453,
329832,
329855,
329885,
411805,
346272,
362660,
100524,
387249,
379066,
387260,
256191,
395466,
346316,
411861,
411864,
411868,
411873,
379107,
411876,
387301,
346343,
338152,
387306,
387312,
346355,
436473,
321786,
379134,
411903,
411916,
379152,
395538,
387349,
338199,
387352,
182558,
338211,
395566,
248111,
362822,
436555,
190796,
379233,
354673,
321910,
248186,
420236,
379278,
272786,
354727,
338352,
338381,
330189,
338386,
264660,
338403,
338409,
199164,
330252,
199186,
420376,
330267,
354855,
10828,
199249,
346721,
174695,
248425,
191084,
338543,
191092,
346742,
330383,
354974,
150183,
174774,
248504,
174777,
223934,
355024,
273108,
355028,
264918,
183005,
256734,
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,
330710,
248792,
248798,
347105,
257008,
183282,
265207,
330748,
265214,
330760,
330768,
248862,
396328,
158761,
347176,
199728,
396336,
330800,
396339,
339001,
388154,
388161,
347205,
248904,
330826,
248914,
412764,
339036,
257120,
265320,
248951,
420984,
330889,
347287,
339097,
248985,
44197,
380070,
339112,
330958,
330965,
265432,
265436,
388319,
388347,
175375,
159005,
175396,
208166,
273708,
347437,
372015,
347441,
372018,
199988,
44342,
175415,
396600,
437566,
175423,
437570,
437575,
437583,
331088,
437587,
331093,
396633,
175450,
437595,
175457,
208227,
175460,
175463,
265580,
437620,
175477,
249208,
175483,
175486,
249214,
175489,
249218,
249224,
249227,
249234,
175513,
175516,
396705,
175522,
355748,
380332,
396722,
208311,
388542,
372163,
216517,
380360,
216522,
339404,
372176,
208337,
339412,
413141,
339417,
339420,
249308,
339424,
249312,
339428,
339434,
249328,
69113,
372228,
208398,
380432,
175635,
265795,
396872,
265805,
224853,
224857,
257633,
224870,
372327,
257646,
372337,
224884,
224887,
224890,
224894,
372353,
224897,
216707,
421508,
126596,
224904,
224909,
11918,
159374,
224913,
126610,
224916,
224919,
126616,
208538,
224922,
224926,
224929,
224932,
257704,
224936,
224942,
257712,
224947,
257716,
257720,
224953,
257724,
224959,
257732,
224965,
224969,
339662,
224975,
257747,
224981,
224986,
257761,
224993,
257764,
224999,
339695,
225012,
257787,
225020,
257790,
339710,
225025,
257794,
339721,
257801,
257804,
225038,
257807,
225043,
372499,
167700,
225048,
257819,
225053,
184094,
225058,
257833,
225066,
257836,
413484,
225070,
225073,
372532,
257845,
225079,
397112,
225082,
397115,
225087,
225092,
225096,
323402,
257868,
225103,
257871,
397139,
225108,
225112,
257883,
257886,
225119,
257890,
339814,
225127,
274280,
257896,
257901,
225137,
339826,
257908,
225141,
257912,
225148,
257916,
257920,
225155,
339844,
225165,
397200,
225170,
380822,
225175,
225180,
118691,
184244,
372664,
372702,
372706,
356335,
380918,
372738,
405533,
430129,
266294,
421960,
356439,
430180,
421990,
266350,
356466,
266362,
381068,
225423,
250002,
250004,
225429,
356506,
225437,
135327,
225441,
438433,
225444,
438436,
225447,
438440,
225450,
258222,
225455,
430256,
225458,
225461,
225466,
389307,
225470,
381120,
372929,
430274,
225475,
389320,
225484,
225487,
225490,
266453,
225493,
225496,
225499,
225502,
225505,
356578,
225510,
217318,
225514,
225518,
372976,
381176,
397571,
389380,
356637,
356640,
356643,
356646,
266536,
356649,
356655,
332080,
340275,
356660,
397622,
332090,
225597,
332097,
201028,
348488,
332117,
348502,
250199,
250202,
332125,
250210,
348522,
348525,
348527,
332152,
389502,
250238,
332161,
356740,
332172,
373145,
340379,
389550,
324030,
266687,
160234,
127471,
340472,
324094,
266754,
324099,
324102,
324111,
340500,
324117,
324131,
332324,
381481,
356907,
324139,
324142,
356916,
324149,
324155,
348733,
324164,
356934,
348743,
381512,
324170,
324173,
324176,
389723,
332380,
373343,
381545,
340627,
373398,
184982,
258721,
332453,
332459,
389805,
332463,
381617,
332471,
332483,
332486,
373449,
357069,
332493,
357073,
332511,
332520,
340718,
332533,
348924,
373510,
389926,
348978,
152370,
340789,
348982,
398139,
127814,
357201,
357206,
389978,
430939,
357211,
357214,
201579,
201582,
349040,
340849,
201588,
430965,
381813,
324472,
398201,
119674,
324475,
430972,
340861,
324478,
340858,
324481,
373634,
398211,
324484,
324487,
381833,
324492,
324495,
324498,
430995,
324501,
324510,
422816,
324513,
398245,
201637,
324524,
340909,
324533,
324538,
324541,
398279,
340939,
340941,
209873,
340957,
431072,
398306,
340963,
209895,
201711,
349172,
381946,
349180,
439294,
431106,
357410,
250914,
185380,
357418,
209965,
209968,
209975,
209979,
209987,
209995,
341071,
349267,
250967,
210010,
341091,
210025,
210027,
210030,
210036,
210039,
349308,
349311,
160895,
152703,
210052,
210055,
349319,
218247,
210067,
210071,
210077,
210080,
251044,
210084,
185511,
210088,
210098,
210107,
210115,
332997,
210127,
333009,
210131,
333014,
210138,
210143,
218354,
218360,
251128,
275706,
275712,
275715,
275721,
349459,
333078,
251160,
349484,
349491,
251189,
415033,
251210,
357708,
210260,
365911,
259421,
365921,
333154,
251235,
374117,
333162,
234866,
390516,
333175,
357755,
251271,
136590,
374160,
112020,
349590,
357792,
259515,
415166,
415185,
366034,
366038,
415191,
415193,
415196,
415199,
423392,
333284,
415207,
366056,
366061,
415216,
210420,
415224,
423423,
415257,
415263,
366117,
415270,
144939,
415278,
415281,
415285,
210487,
415290,
415293,
349761,
415300,
333386,
366172,
333413,
423528,
423532,
210544,
415353,
333439,
415361,
267909,
210631,
333511,
358099,
153302,
333534,
366307,
366311,
431851,
366318,
210672,
366321,
366325,
210695,
268041,
210698,
366348,
210706,
399128,
333594,
210719,
358191,
210739,
366387,
399159,
358200,
325440,
366401,
341829,
325446,
46920,
341834,
341838,
341843,
415573,
358234,
341851,
350045,
399199,
259938,
399206,
399215,
358255,
268143,
358259,
341876,
243579,
325504,
333698,
333708,
333724,
382890,
350146,
333774,
358371,
350189,
350193,
333818,
350202,
350206,
350213,
268298,
350224,
350231,
333850,
350237,
350240,
350244,
350248,
178218,
350251,
350256,
350259,
350271,
243781,
350285,
374864,
342111,
342133,
374902,
432271,
333997,
334011,
260289,
260298,
350410,
350416,
350422,
211160,
350425,
268507,
334045,
350445,
375026,
358644,
350458,
350461,
350464,
350467,
325891,
350475,
375053,
268559,
350480,
432405,
350486,
325914,
350490,
325917,
350493,
350498,
194852,
350504,
358700,
391468,
350509,
358704,
358713,
358716,
383306,
334161,
383321,
383330,
383333,
391530,
383341,
334203,
268668,
194941,
391563,
366990,
416157,
342430,
268701,
375208,
326058,
375216,
334262,
334275,
358856,
334304,
334311,
375277,
334321,
350723,
391690,
186897,
342545,
334358,
342550,
342554,
334363,
350761,
252461,
383536,
358961,
334384,
334394,
252482,
219718,
334407,
334420,
350822,
375400,
334465,
162445,
326290,
342679,
342683,
260766,
342710,
244409,
260797,
260801,
350917,
154317,
391894,
154328,
416473,
64230,
113388,
342766,
375535,
203506,
342776,
391937,
391948,
375568,
326416,
375571,
375574,
162591,
326441,
383793,
326451,
326454,
260924,
375612,
244540,
326460,
326467,
244551,
326473,
326477,
416597,
326485,
342874,
326490,
326502,
375656,
433000,
326507,
326510,
211825,
211831,
351097,
392060,
359295,
351104,
342915,
400259,
236430,
342930,
252822,
392091,
400285,
252836,
359334,
211884,
400306,
351168,
359361,
359366,
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,
384143,
351381,
367794,
384181,
367800,
351423,
326855,
244937,
253130,
343244,
146642,
359649,
343270,
351466,
351479,
343306,
261389,
359694,
253200,
261393,
245020,
245029,
171302,
351534,
376110,
245040,
425276,
212291,
384323,
343365,
212303,
367965,
343393,
343398,
367980,
425328,
343409,
253303,
154999,
343417,
327034,
245127,
384397,
245136,
245142,
245145,
343450,
245148,
245151,
245154,
245157,
245162,
327084,
359865,
384443,
146876,
327107,
384453,
327110,
327115,
327117,
359886,
359890,
343507,
368092,
343534,
343539,
368119,
343544,
368122,
409091,
359947,
359955,
359983,
343630,
179802,
155239,
327275,
245357,
138864,
155254,
155273,
368288,
245409,
425638,
425649,
155322,
425662,
155327,
155351,
155354,
212699,
155363,
245475,
155371,
245483,
409335,
155393,
155403,
155422,
360223,
155438,
155442,
155447,
417595,
360261,
155461,
376663,
155482,
261981,
425822,
376671,
155487,
155490,
155491,
327531,
261996,
376685,
261999,
262002,
327539,
425845,
147317,
262005,
262008,
262011,
155516,
155521,
155525,
360326,
376714,
155531,
262027,
262030,
262033,
262036,
262039,
262042,
155549,
262045,
262048,
262051,
327589,
155559,
155562,
155565,
393150,
393169,
384977,
155611,
155619,
253923,
155621,
253926,
327654,
204784,
393203,
360438,
253943,
393206,
393212,
155646
] |
c6309ac438f9df7b40586b4ead1d0f340dd53c87
|
c6200f061397b43e164eb122459d71aba35bfdff
|
/Craigslist/ListingViewController.swift
|
57892846497bc11b3cfc277e39de9ad2fb1f302e
|
[
"MIT"
] |
permissive
|
dgolman/craiglist
|
37fe6effa16bea06951d641bcc1220b9e2b7a10a
|
70ab0cad44ee0febf00039562a16877f06a0d2e8
|
refs/heads/master
| 2020-07-01T22:25:42.540691 | 2015-02-08T13:23:40 | 2015-02-08T13:23:40 | 30,471,626 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 5,156 |
swift
|
//
// ListingViewController.swift
// FireChat-Swift
//
// Created by Daniel Golman on 2/7/15.
// Copyright (c) 2015 Firebase. All rights reserved.
//
import UIKit
import SwiftHTTP
import SwiftyJSON
import CoreLocation
class ListingViewController: UIViewController, CLLocationManagerDelegate {
var locationManager = CLLocationManager()
var link: String!
var listing: JSON!
var phone: String!
var email: String!
@IBOutlet var callButton: UIBarButtonItem!
@IBOutlet var emailButton: UIBarButtonItem!
@IBOutlet var make: UILabel!
@IBOutlet var model: UILabel!
@IBOutlet var size: UILabel!
@IBOutlet var condition: UILabel!
@IBOutlet var descript: UITextView!
@IBOutlet var listingTitle: UILabel!
@IBOutlet var listingImage: UIImageView!
override func viewDidLoad() {
super.viewDidLoad()
var request = HTTPTask()
let params: Dictionary<String,AnyObject> = ["link": self.link]
request.GET("http://bikescraper.herokuapp.com/scrape2", parameters: params, success: {(response: HTTPResponse) in
dispatch_async(dispatch_get_main_queue()) {
if let data = response.responseObject as? NSData {
let json: AnyObject! = NSJSONSerialization.JSONObjectWithData(data, options: NSJSONReadingOptions.MutableContainers, error: nil)
var listing = JSON(json)
self.listingImage.image = UIImage(data: NSData(contentsOfURL: NSURL(string: listing["image"].string!)!)!)
self.listingTitle.text = listing["title"].string
self.make.text = listing["make"].string
self.model.text = listing["model"].string
self.size.text = listing["size"].string
self.condition.text = listing["condition"].string
self.descript.text = listing["desc"].string
self.phone = listing["phone"].string
self.email = listing["email"].string
if self.phone == "" {
self.callButton.enabled = false
self.callButton.title = ""
}
if self.email == "" {
self.emailButton.enabled = false
self.emailButton.title = ""
}
}
return
}
},failure: {(error: NSError, response: HTTPResponse?) in
})
}
@IBAction func callButtonPressed(sender: UIButton) {
if let url = NSURL(string: "tel://\(phone)") {
UIApplication.sharedApplication().openURL(url)
}
}
@IBAction func emailButtonPressed(sender: UIButton) {
if let url = NSURL(string: "mailto:\(email)") {
UIApplication.sharedApplication().openURL(url)
}
}
@IBAction func findExpert(sender: UIBarButtonItem) {
locationManager.requestWhenInUseAuthorization()
locationManager.delegate = self
locationManager.desiredAccuracy = kCLLocationAccuracyBest
locationManager.startUpdatingLocation()
println("hey")
}
func locationManager(manager:CLLocationManager, didUpdateLocations locations:[AnyObject]) {
var locationArray = locations as NSArray
var locationObj = locationArray.lastObject as CLLocation
var coord = locationObj.coordinate
manager.stopUpdatingLocation()
println("hey")
let geofireRef = Firebase(url: "https://craigslist-vthacks.firebaseio.com/experts")
let geoFire = GeoFire(firebaseRef: geofireRef)
let center = CLLocation(latitude: coord.latitude, longitude: coord.longitude)
var circleQuery = geoFire.queryAtLocation(center, withRadius: 0.6)
let helpRef = Firebase(url:"https://craigslist-vthacks.firebaseio.com/simplelogin:3/help-wanted")
let ref = Firebase(url:"https://craigslist-vthacks.firebaseio.com")
helpRef.setValue(ref.authData.uid)
// var queryHandle = circleQuery.observeEventType(GFEventTypeKeyEntered, withBlock: { (key: String!, location: CLLocation!) in
// let helpRef = Firebase(url:"https://craigslist-vthacks.firebaseio.com/" + key + "/help-wanted")
// let ref = Firebase(url:"https://craigslist-vthacks.firebaseio.com")
// helpRef.setValue(ref.authData.uid)
// })
}
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 prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
// Get the new view controller using segue.destinationViewController.
// Pass the selected object to the new view controller.
}
*/
}
|
[
-1
] |
ceb0bec58472108ec8d10a6a799bc0aa0f1f5195
|
fcc107feb514f652c83813881d927a36780be81c
|
/CVCalendar/CVCalendarViewDelegate.swift
|
14b6c72a52fb2ec40ca9b5b4176c095399c63bcc
|
[
"MIT"
] |
permissive
|
JackieQi/CVCalendar
|
cdfeb0859f258913b47f8cab782873c8ce92867e
|
cbd17965f58493ac78e4cce1429e63d59d3fc67d
|
refs/heads/master
| 2020-05-29T08:40:29.694214 | 2016-10-24T20:08:02 | 2016-10-24T20:08:02 | 69,049,813 | 0 | 1 | null | 2016-09-23T18:16:22 | 2016-09-23T18:16:22 | null |
UTF-8
|
Swift
| false | false | 2,237 |
swift
|
//
// CVCalendarViewDelegate.swift
// CVCalendar
//
// Created by E. Mozharovsky on 12/27/14.
// Copyright (c) 2014 GameApp. All rights reserved.
//
import UIKit
@objc
public protocol CVCalendarViewDelegate {
func presentationMode() -> CalendarMode
func firstWeekday() -> Weekday
/*
Determines whether resizing should cause related views' animation.
*/
@objc optional func shouldAnimateResizing() -> Bool
@objc optional func toggleDateAnimationDuration() -> Double
@objc optional func shouldScrollOnOutDayViewSelection() -> Bool
@objc optional func shouldAutoSelectDayOnWeekChange() -> Bool
@objc optional func shouldAutoSelectDayOnMonthChange() -> Bool
@objc optional func shouldShowWeekdaysOut() -> Bool
@objc optional func shouldSelectDayView(_ dayView: DayView) -> Bool
@objc optional func didSelectDayView(_ dayView: DayView, animationDidFinish: Bool)
@objc optional func presentedDateUpdated(_ date: CVDate)
@objc optional func topMarker(shouldDisplayOnDayView dayView: DayView) -> Bool
@objc optional func dotMarker(shouldMoveOnHighlightingOnDayView dayView: DayView) -> Bool
@objc optional func dotMarker(shouldShowOnDayView dayView: DayView) -> Bool
@objc optional func dotMarker(colorOnDayView dayView: DayView) -> [UIColor]
@objc optional func dotMarker(moveOffsetOnDayView dayView: DayView) -> CGFloat
@objc optional func dotMarker(sizeOnDayView dayView: DayView) -> CGFloat
@objc optional func selectionViewPath() -> ((CGRect) -> (UIBezierPath))
@objc optional func shouldShowCustomSingleSelection() -> Bool
@objc optional func preliminaryView(viewOnDayView dayView: DayView) -> UIView
@objc optional func preliminaryView(shouldDisplayOnDayView dayView: DayView) -> Bool
@objc optional func supplementaryView(viewOnDayView dayView: DayView) -> UIView
@objc optional func supplementaryView(shouldDisplayOnDayView dayView: DayView) -> Bool
@objc optional func didShowNextMonthView(_ date: Foundation.Date)
@objc optional func didShowPreviousMonthView(_ date: Foundation.Date)
@objc optional func didShowNextWeekView(date: Date)
@objc optional func didShowPreviousWeekView(date: Date)
}
|
[
317052
] |
45ed379750ae0f8b96d0cc6ed2a02586a5bb1ae6
|
e218d6fb05a2dcc68ca8a4ec896ca32c1b6705d7
|
/HackerRank - Picking Numbers.swift
|
01b5b1569544a30618750dd8c70be21ab634e32d
|
[] |
no_license
|
smhemel/Swift-Programming
|
0790ddafeef9d4a5cb2374287dab0a09afc56f99
|
99476e10e2567c4088c5a0ad8f82d6e211c3fd2d
|
refs/heads/master
| 2020-04-13T02:47:53.400683 | 2018-12-23T17:52:33 | 2018-12-23T17:52:33 | 162,912,490 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 735 |
swift
|
import Foundation
func inputNumber() -> Int { return Int(readLine()!)! }
func inputArray() -> [Int] { return readLine()!.components(separatedBy: " ").map{ Int($0)! } }
func solve( x: Int, arr: [Int] ) -> Int {
var brr = [Int](repeating: 0, count: 10000)
for i in 0 ..< x {
for j in 0 ..< x {
var k = 2*i
if arr[i] == arr[j] || arr[i]==arr[j]+1 {
brr[k] += 1
}
if arr[i] == arr[j] || arr[i] == arr[j]-1 {
brr[k+1] += 1
}
}
}
for i in 0 ..< 200 {
if brr[i] > brr[0] {
brr[0] = brr[i]
}
}
return brr[0]
}
var n = inputNumber()
var ar = inputArray()
print(solve(x: n, arr: ar))
|
[
-1
] |
f2baec8e260c33ef0b6a3f1befa48a43204ff397
|
b4581e5a8a87dd9bc5bf7591098f79580b6ebb6d
|
/TaskWHO/Model/DataModel.swift
|
77a68b553aae8164f0b8b35a942395464e98ba1a
|
[] |
no_license
|
GayathriVenkatesan93/COVID19IOSTask
|
c78a43f72b80ae27dfbd4146648827226889b1a4
|
db96eb6caa40a5bbcd6383aba2c1c1fcd5aaafd1
|
refs/heads/master
| 2023-01-23T10:49:38.357852 | 2020-12-03T10:46:15 | 2020-12-03T10:46:15 | 316,186,739 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 234 |
swift
|
//
// DataModel.swift
// TaskWHO
//
// Created by Gayathri on 25/11/20.
// Copyright © 2020 Gayathri. All rights reserved.
//
import UIKit
class DataModel: NSObject {
var confirmedCase : Int!
var confirmDeath : Int!
}
|
[
-1
] |
b69b9a467ed3aab264db2da3964746a358e3b3c2
|
5d69164497c470290217c2a3da08617e5e60b49c
|
/RRSReader/DetailViewController.swift
|
79ed65ef065e9e8abbeb71e0c07e6a94ebc8b5ce
|
[] |
no_license
|
SergeiShvakel/RSSReader
|
f5d4ca1630b165bee872e5af47577ab8e8a984eb
|
5fc921fbc556a253d2873b79995e52b7c1e9d518
|
refs/heads/master
| 2021-09-06T23:43:47.070644 | 2018-02-13T14:16:26 | 2018-02-13T14:16:26 | 104,670,489 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,820 |
swift
|
//
// DetailViewController.swift
// RRSReader
//
// Created by Сергей Швакель on 24.09.17.
// Copyright © 2017 Сергей Швакель. All rights reserved.
//
import UIKit
class DetailViewController: UIViewController {
@IBOutlet weak var dateLabel: UILabel!
@IBOutlet weak var titleLabel: UILabel!
@IBOutlet weak var descLabel: UILabel!
@IBOutlet weak var imageNews: UIImageView!
var index : IndexPath?
var model : RSSModel?
override func viewDidLoad() {
super.viewDidLoad()
if let oneNews = model?.newsList[(model?.newsList.count)! - (index?.row)! - 1]
{
let dateFormat : DateFormatter = DateFormatter()
dateFormat.dateFormat = "dd MMM yyyy HH:mm:ss"
dateLabel.text = dateFormat.string(from: (oneNews.pubDateNews))
titleLabel.text = oneNews.titleNews
descLabel.text = oneNews.descNews
imageNews.layer.cornerRadius = 8.0
imageNews.clipsToBounds = true
imageNews.image = model?.getImageByIndex(index!)
}
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
override func viewDidLayoutSubviews() {
descLabel.numberOfLines = 0
descLabel.sizeToFit()
}
/*
// 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
] |
5552362edbcbff34fdfc6080274ae913ddd1c3d4
|
aac032e6208ba910cd8b2de2b2e4dffcd8239644
|
/PhobosSwift/UIComponent/Classes/Privatized+third+party+code/Charts/Utils/Platform+Accessibility.swift
|
ee62891df546a40da6a9c3b81f4a8e73d50655f8
|
[
"MIT"
] |
permissive
|
ttttfix/phobos-swift
|
24bb5641c2aace4b96d966d0cca2bb0503ea1964
|
01fb7f835decf5b64a8754bbf2d191f22efd230f
|
refs/heads/master
| 2023-09-02T08:19:57.095106 | 2021-11-01T16:07:34 | 2021-11-01T16:07:34 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 5,343 |
swift
|
//
// Platform+Accessibility.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
#if os(iOS) || os(tvOS)
#if canImport(UIKit)
import UIKit
#endif
internal func accessibilityPostLayoutChangedNotification(withElement element: Any? = nil) {
UIAccessibility.post(notification: UIAccessibility.Notification.layoutChanged, argument: element)
}
internal func accessibilityPostScreenChangedNotification(withElement element: Any? = nil) {
UIAccessibility.post(notification: UIAccessibility.Notification.screenChanged, argument: element)
}
/// A simple abstraction over UIAccessibilityElement and NSAccessibilityElement.
open class NSUIAccessibilityElement: UIAccessibilityElement {
private weak var containerView: UIView?
final var isHeader: Bool = false {
didSet {
accessibilityTraits = isHeader ? UIAccessibilityTraits.header : UIAccessibilityTraits.none
}
}
final var isSelected: Bool = false {
didSet {
accessibilityTraits = isSelected ? UIAccessibilityTraits.selected : UIAccessibilityTraits.none
}
}
override public init(accessibilityContainer container: Any) {
// We can force unwrap since all chart views are subclasses of UIView
containerView = (container as! UIView)
super.init(accessibilityContainer: container)
}
override open var accessibilityFrame: CGRect {
get {
super.accessibilityFrame
}
set {
guard let containerView = containerView else { return }
super.accessibilityFrame = containerView.convert(newValue, to: UIScreen.main.coordinateSpace)
}
}
}
extension NSUIView {
/// An array of accessibilityElements that is used to implement UIAccessibilityContainer internally.
/// Subclasses **MUST** override this with an array of such elements.
@objc open func accessibilityChildren() -> [Any]? {
nil
}
override public final var isAccessibilityElement: Bool {
get { false } // Return false here, so we can make individual elements accessible
set {}
}
override open func accessibilityElementCount() -> Int {
accessibilityChildren()?.count ?? 0
}
override open func accessibilityElement(at index: Int) -> Any? {
accessibilityChildren()?[index]
}
override open func index(ofAccessibilityElement element: Any) -> Int {
guard let axElement = element as? NSUIAccessibilityElement else { return NSNotFound }
return (accessibilityChildren() as? [NSUIAccessibilityElement])?
.firstIndex(of: axElement) ?? NSNotFound
}
}
#endif
#if os(OSX)
#if canImport(AppKit)
import AppKit
#endif
internal func accessibilityPostLayoutChangedNotification(withElement element: Any? = nil) {
guard let validElement = element else { return }
NSAccessibility.post(element: validElement, notification: .layoutChanged)
}
internal func accessibilityPostScreenChangedNotification(withElement element: Any? = nil) {
// Placeholder
}
/// A simple abstraction over UIAccessibilityElement and NSAccessibilityElement.
open class NSUIAccessibilityElement: NSAccessibilityElement {
private weak var containerView: NSView?
final var isHeader: Bool = false {
didSet {
setAccessibilityRole(isHeader ? .staticText : .none)
}
}
final var isSelected: Bool = false {
didSet {
setAccessibilitySelected(isSelected)
}
}
open var accessibilityLabel: String {
get {
accessibilityLabel() ?? ""
}
set {
setAccessibilityLabel(newValue)
}
}
open var accessibilityFrame: NSRect {
get {
accessibilityFrame()
}
set {
guard let containerView = containerView else { return }
let bounds = NSAccessibility.screenRect(fromView: containerView, rect: newValue)
// This works, but won't auto update if the window is resized or moved.
// setAccessibilityFrame(bounds)
// using FrameInParentSpace allows for automatic updating of frame when windows are moved and resized.
// However, there seems to be a bug right now where using it causes an offset in the frame.
// This is a slightly hacky workaround that calculates the offset and removes it from frame calculation.
setAccessibilityFrameInParentSpace(bounds)
let axFrame = accessibilityFrame()
let widthOffset = abs(axFrame.origin.x - bounds.origin.x)
let heightOffset = abs(axFrame.origin.y - bounds.origin.y)
let rect = NSRect(x: bounds.origin.x - widthOffset,
y: bounds.origin.y - heightOffset,
width: bounds.width,
height: bounds.height)
setAccessibilityFrameInParentSpace(rect)
}
}
public init(accessibilityContainer container: Any) {
// We can force unwrap since all chart views are subclasses of NSView
containerView = (container as! NSView)
super.init()
setAccessibilityParent(containerView)
setAccessibilityRole(.row)
}
}
/// - Note: setAccessibilityRole(.list) is called at init. See Platform.swift.
extension NSUIView: NSAccessibilityGroup {
override open func accessibilityLabel() -> String? {
"Chart View"
}
override open func accessibilityRows() -> [Any]? {
accessibilityChildren()
}
}
#endif
|
[
54625,
208225,
185059,
97473,
237467,
317886
] |
b665cb7a805f0c26b714e91737fcd2d04a7aa740
|
ba22ae5c64b969305722778bf3a4d101d210b23b
|
/Job/Controllers/LoginView/LoginOberverDelegate.swift
|
29b6dad9f3942aae541cb3bea84e0049003116a1
|
[] |
no_license
|
ssultan/Job
|
6ee9d423e5c43ff4fa97242109ae6eeeadde4724
|
0cad6025c2d7e6fa334e456676917becf78e24dc
|
refs/heads/master
| 2023-06-02T13:34:58.254547 | 2021-06-25T20:56:10 | 2021-06-25T20:56:10 | 380,345,685 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,059 |
swift
|
//
// LoginOberverDelegate.swift
// Job V2
//
// Created by Saleh Sultan on 5/24/19.
// Copyright © 2019 Clearthread. All rights reserved.
//
import Foundation
@objc protocol LoginOberverDelegate {
var templateDownloaded:Bool { get set }
var locationDownloaded:Bool { get set }
var inCompleteJobStatusChecked:Bool { get set }
func versionUpdateRequired(manifestModel: ManifestMapping)
func loginSuccess(isOfflineLogin: Bool)
func startDLTempLocInJobs(forJobTemplates templateList:NSMutableArray, forProjectIdList projectList:NSMutableArray, forIncompleteJobList jobInsList: [JobInstanceModel])
func loginFailureWithError(_ errorJson: NSDictionary?, reqStatusCode: Int)
func noTemplateAssignedError()
func increaseProgressbar()
func verifyEULAAcceptedForUser(_ userId: String, continueBlock: @escaping () -> ())
func eulaPanelViewControllerAcceptedEULA()
func eulaPanelViewControllerDeclinedEULA()
func showOlderOSWarning(continueBlock: @escaping () -> ())
func registerBioAuth()
}
|
[
-1
] |
7f341c4fef7399dfc63d171d154d092850f4937d
|
14aa6e88bef7c8d32908f526195a920cf9bbd3ac
|
/siblings/Sources/App/Controllers/TILController.swift
|
6ab59d0b96611e5c30cc75b7be10309f706094ff
|
[
"MIT"
] |
permissive
|
iuliandavid/vapor_rw
|
b6a41e4a9918ef074a49c3ac2e8bac352a9b2588
|
8390ec143793a6c9e8ca19c8a5f41afd5e5b99b6
|
refs/heads/master
| 2021-01-19T12:44:10.465160 | 2017-08-19T15:36:15 | 2017-08-19T15:36:15 | 100,804,021 | 1 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,165 |
swift
|
import Vapor
import HTTP
final class TILController {
private let droplet: Droplet
init(droplet: Droplet) {
self.droplet = droplet
}
func addRoutes() {
droplet.get("til", handler: index)
droplet.post("til", handler: addNew)
droplet.post("til", Acronym.self, "delete", handler: delete)
}
func index(request: Request) throws -> ResponseRepresentable {
let acronyms = try Acronym.all().makeNode()
let parameters = try Node(node: [
"acronyms" : acronyms,
])
return try droplet.view.make("index", parameters)
}
func addNew(request: Request) throws -> ResponseRepresentable {
guard let short = request.data["short"]?.string, let long = request.data["long"]?.string else {
throw Abort.badRequest
}
var acronym = Acronym(short: short, long: long)
try acronym.save()
return Response(redirect: "/til")
}
// Delete with ID path parameter
func delete(request: Request, acronym: Acronym) throws -> ResponseRepresentable {
try acronym.delete()
return Response(redirect: "/til")
}
}
|
[
-1
] |
702694329a21215c3594a98849bc101b966cc00d
|
f159a11399bd49a63e5d041c4be01eaec1f3206c
|
/OtusHomeWork/OtusHomeWork/ServiceLocator.swift
|
50c520724e0f1d3fa625d185f7eb2ede603bb0b7
|
[] |
no_license
|
kravik/otus-ios-pro
|
95d4ff90edbece604f90b4c415dfae30c426fb87
|
07c38d396559a57a896c0f8f493d1752698a4067
|
refs/heads/main
| 2023-03-14T23:31:03.348973 | 2021-02-24T19:19:07 | 2021-02-24T19:19:07 | 321,779,135 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 425 |
swift
|
import UIKit
final class ServiceLocator: ObservableObject {
private var services: [String: Any] = [:]
func register<T>(_ service: T) {
let key = serviceKey(T.self)
services[key] = service
}
func service<T>() -> T {
let key = serviceKey(T.self)
return services[key] as! T
}
private func serviceKey(_ service: Any) -> String {
"\(type(of: service))"
}
}
|
[
-1
] |
b35f112802a7051997e2f08781202eeb31825389
|
fd18e1aa827a990309595770835e5ae9d4820488
|
/Sources/NFCMRTDReader/BACHandler.swift
|
d4aa14f3cd755384da29b36d273732877a1b6b9f
|
[
"MIT"
] |
permissive
|
ViktorSimko/NFCPassportReader
|
efe9a92bb214e33a6a0acefe3aaa45cf2cb63586
|
aff4b9a884ff94721d66b611c35b12a0f087d219
|
refs/heads/master
| 2023-04-05T04:03:49.206373 | 2021-01-09T09:37:09 | 2021-01-09T09:37:09 | 278,399,747 | 1 | 0 |
MIT
| 2020-07-09T15:18:51 | 2020-07-09T15:18:50 | null |
UTF-8
|
Swift
| false | false | 9,911 |
swift
|
//
// BACHandler.swift
// NFCTest
//
// Created by Andy Qua on 07/06/2019.
// Copyright © 2019 Andy Qua. All rights reserved.
//
import Foundation
import CoreNFC
@available(iOS 13, *)
public class BACHandler {
let KENC : [UInt8] = [0,0,0,1]
let KMAC : [UInt8] = [0,0,0,2]
public var ksenc : [UInt8] = []
public var ksmac : [UInt8] = []
var rnd_icc : [UInt8] = []
var rnd_ifd : [UInt8] = []
public var kifd : [UInt8] = []
var tagReader : TagReader?
public init() {
// For testing only
}
public init(tagReader: TagReader) {
self.tagReader = tagReader
}
public func performBACAndGetSessionKeys( mrzKey : String, completed: @escaping (_ error : TagError?)->() ) {
guard let tagReader = self.tagReader else {
completed( TagError.NoConnectedTag)
return
}
_ = self.deriveDocumentBasicAccessKeys(mrz: mrzKey)
// Make sure we clear secure messaging (could happen if we read an invalid DG or we hit a secure error
tagReader.secureMessaging = nil
// get Challenge
tagReader.getChallenge() { [unowned self] (response, error) in
guard let response = response else {
Log.debug( "ERROR - \(error?.localizedDescription ?? "")" )
completed( error )
return
}
Log.debug( "DATA - \(response.data)" )
let cmd_data = self.authentication(rnd_icc: [UInt8](response.data))
tagReader.doMutualAuthentication(cmdData: Data(cmd_data)) { [unowned self] (response, error) in
guard let response = response else {
Log.debug( "ERROR - \(error?.localizedDescription ?? "")" )
completed( error )
return
}
Log.debug( "DATA - \(response.data)" )
let (KSenc, KSmac, ssc) = self.sessionKeys(data: [UInt8](response.data))
tagReader.secureMessaging = SecureMessaging(ksenc: KSenc, ksmac: KSmac, ssc: ssc)
completed( nil)
}
}
}
func deriveDocumentBasicAccessKeys(mrz: String) -> ([UInt8], [UInt8]) {
let kmrz = getMRZInfo(mrz: mrz)
let kseed = generateInitialKseed(kmrz:kmrz)
Log.debug("Calculate the Basic Acces Keys (Kenc and Kmac) using Appendix 5.1")
let (kenc, kmac) = computeKeysFromKseed(Kseed: kseed)
self.ksenc = kenc
self.ksmac = kmac
return (kenc, kmac)
}
/// - Parameter mrz:
func getMRZInfo( mrz : String ) -> String {
let kmrz = mrz
// kmrz = docNumber + docNumberChecksum + \
// mrz.dateOfBirth + mrz.dateOfBirthCheckSum + \
// mrz.dateOfExpiry + mrz.dateOfExpiryChecksum
return kmrz
}
///
/// Calculate the kseed from the kmrz:
/// - Calculate a SHA-1 hash of the kmrz
/// - Take the most significant 16 bytes to form the Kseed.
/// @param kmrz: The MRZ information
/// @type kmrz: a string
/// @return: a 16 bytes string
///
/// - Parameter kmrz: <#kmrz description#>
/// - Returns: first 16 bytes of the mrz SHA1 hash
///
func generateInitialKseed(kmrz : String ) -> [UInt8] {
Log.debug("Calculate the SHA-1 hash of MRZ_information")
let hash = calcSHA1Hash( [UInt8](kmrz.data(using:.utf8)!) )
Log.debug("\tHsha1(MRZ_information): \(binToHexRep(hash))")
let subHash = Array(hash[0..<16])
Log.debug("Take the most significant 16 bytes to form the Kseed")
Log.debug("\tKseed: \(binToHexRep(subHash))" )
return Array(subHash)
}
func computeKeysFromKseed(Kseed : [UInt8] ) -> ([UInt8], [UInt8]) {
Log.debug("Compute Encryption key (c: \(binToHexRep(KENC))")
let kenc = self.keyDerivation(kseed: Kseed, c: KENC)
Log.debug("Compute MAC Computation key (c: \(binToHexRep(KMAC))")
let kmac = self.keyDerivation(kseed: Kseed, c: KMAC)
// return (kenc, kmac)
return (kenc, kmac)
}
/// Key derivation from the kseed:
/// - Concatenate Kseed and c (c=0 for KENC or c=1 for KMAC)
/// - Calculate the hash of the concatenation of kseed and c (h = (sha1(kseed + c)))
/// - Adjust the parity bits
/// - return the key (The first 8 bytes are Ka and the next 8 bytes are Kb)
/// @param kseed: The Kseed
/// @type kseed: a 16 bytes string
/// @param c: specify if it derives KENC (c=0) of KMAC (c=1)
/// @type c: a byte
/// @return: Return a 16 bytes key
func keyDerivation( kseed : [UInt8], c: [UInt8] ) -> [UInt8] {
// if c not in (BAC.KENC,BAC.KMAC):
// raise BACException, "Bad parameter (c=0 or c=1)"
let d = kseed + c
Log.debug("\tConcatenate Kseed and c")
Log.debug("\t\tD: \(binToHexRep(d))" )
let h = calcSHA1Hash(d)
// h = sha1(str(d)).digest()
Log.debug("\tCalculate the SHA-1 hash of D")
Log.debug("\t\tHsha1(D): \(binToHexRep(h))")
var Ka = Array(h[0..<8])
var Kb = Array(h[8..<16])
Log.debug("\tForm keys Ka and Kb")
Log.debug("\t\tKa: \(binToHexRep(Ka))")
Log.debug("\t\tKb: \(binToHexRep(Kb))")
Ka = self.DESParity(Ka)
Kb = self.DESParity(Kb)
Log.debug("\tAdjust parity bits")
Log.debug("\t\tKa: \(binToHexRep(Ka))")
Log.debug("\t\tKb: \(binToHexRep(Kb))")
return Ka+Kb
}
func DESParity(_ data : [UInt8] ) -> [UInt8] {
var adjusted = [UInt8]()
for x in data {
let y = x & 0xfe
var parity :UInt8 = 0
for z in 0 ..< 8 {
parity += y >> z & 1
}
let s = y + (parity % 2 == 0 ? 1 : 0)
adjusted.append(s) // chr(y + (not parity % 2))
}
return adjusted
}
/// Construct the command data for the mutual authentication.
/// - Request an 8 byte random number from the MRTD's chip (rnd.icc)
/// - Generate an 8 byte random (rnd.ifd) and a 16 byte random (kifd)
/// - Concatenate rnd.ifd, rnd.icc and kifd (s = rnd.ifd + rnd.icc + kifd)
/// - Encrypt it with TDES and the Kenc key (eifd = TDES(s, Kenc))
/// - Compute the MAC over eifd with TDES and the Kmax key (mifd = mac(pad(eifd))
/// - Construct the APDU data for the mutualAuthenticate command (cmd_data = eifd + mifd)
///
/// @param rnd_icc: The challenge received from the ICC.
/// @type rnd_icc: A 8 bytes binary string
/// @return: The APDU binary data for the mutual authenticate command
func authentication( rnd_icc : [UInt8]) -> [UInt8] {
self.rnd_icc = rnd_icc
Log.debug("Request an 8 byte random number from the MRTD's chip")
Log.debug("\tRND.ICC: " + binToHexRep(self.rnd_icc))
self.rnd_icc = rnd_icc
let rnd_ifd = generateRandomUInt8Array(8)
let kifd = generateRandomUInt8Array(16)
Log.debug("Generate an 8 byte random and a 16 byte random")
Log.debug("\tRND.IFD: \(binToHexRep(rnd_ifd))" )
Log.debug("\tRND.Kifd: \(binToHexRep(kifd))")
let s = rnd_ifd + rnd_icc + kifd
Log.debug("Concatenate RND.IFD, RND.ICC and Kifd")
Log.debug("\tS: \(binToHexRep(s))")
let iv : [UInt8] = [0, 0, 0, 0, 0, 0, 0, 0]
let eifd = tripleDESEncrypt(key: ksenc,message: s, iv: iv)
Log.debug("Encrypt S with TDES key Kenc as calculated in Appendix 5.2")
Log.debug("\tEifd: \(binToHexRep(eifd))")
let mifd = mac(key: ksmac, msg: pad(eifd))
Log.debug("Compute MAC over eifd with TDES key Kmac as calculated in-Appendix 5.2")
Log.debug("\tMifd: \(binToHexRep(mifd))")
// Construct APDU
let cmd_data = eifd + mifd
Log.debug("Construct command data for MUTUAL AUTHENTICATE")
Log.debug("\tcmd_data: \(binToHexRep(cmd_data))")
self.rnd_ifd = rnd_ifd
self.kifd = kifd
return cmd_data
}
/// Calculate the session keys (KSenc, KSmac) and the SSC from the data
/// received by the mutual authenticate command.
/// @param data: the data received from the mutual authenticate command send to the chip.
/// @type data: a binary string
/// @return: A set of two 16 bytes keys (KSenc, KSmac) and the SSC
public func sessionKeys(data : [UInt8] ) -> ([UInt8], [UInt8], [UInt8]) {
Log.debug("Decrypt and verify received data and compare received RND.IFD with generated RND.IFD \(binToHexRep(self.ksmac))" )
let response = tripleDESDecrypt(key: self.ksenc, message: [UInt8](data[0..<32]), iv: [0,0,0,0,0,0,0,0] )
let response_kicc = [UInt8](response[16..<32])
let Kseed = xor(self.kifd, response_kicc)
Log.debug("Calculate XOR of Kifd and Kicc")
Log.debug("\tKseed: \(binToHexRep(Kseed))" )
let KSenc = self.keyDerivation(kseed: Kseed,c: KENC)
let KSmac = self.keyDerivation(kseed: Kseed,c: KMAC)
Log.debug("Calculate Session Keys (KSenc and KSmac) using Appendix 5.1")
Log.debug("\tKSenc: \(binToHexRep(KSenc))" )
Log.debug("\tKSmac: \(binToHexRep(KSmac))" )
let ssc = [UInt8](self.rnd_icc.suffix(4) + self.rnd_ifd.suffix(4))
Log.debug("Calculate Send Sequence Counter")
Log.debug("\tSSC: \(binToHexRep(ssc))" )
return (KSenc, KSmac, ssc)
}
}
|
[
327524
] |
e434cd67b077416c03ea8afdee89efe5d4aca8c8
|
a6758b1d58540b4f7d0795916d135a898d7bc953
|
/Pods/ExtensionX/Sources/StringExt.swift
|
1b420c47212f81c4235b063d6741ab0fd56cf4f5
|
[] |
no_license
|
Pircate/RxSwiftDemo
|
b4a6b6c481141c34eb958641e95f1d25ef7fe799
|
c4a915b726d1b0e174c2342d9fc004ce166e9610
|
refs/heads/master
| 2021-09-08T16:12:31.613424 | 2021-09-02T02:22:57 | 2021-09-02T02:22:57 | 133,928,706 | 18 | 2 | null | null | null | null |
UTF-8
|
Swift
| false | false | 869 |
swift
|
//
// StringExt.swift
// ExtensionX
//
// Created by GorXion on 2018/5/2.
//
public extension String {
var asNSString: NSString {
return self as NSString
}
var asURL: URL? {
return URL(string: self)
}
var asImage: UIImage? {
return UIImage(named: self)
}
}
public extension String {
var isBlank: Bool {
return isEmpty || trimmingCharacters(in: .whitespacesAndNewlines).isEmpty
}
var isEmail: Bool {
return range(of: "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}", options: .regularExpression) != nil
}
}
public extension String {
func substring(from: Int, to: Int) -> String {
let fromIndex = index(startIndex, offsetBy: from)
let toIndex = index(startIndex, offsetBy: to)
return String(self[fromIndex..<toIndex])
}
}
|
[
-1
] |
143fd71cc3d88a92133a8003602842fe30cf6622
|
67a8bd3d387daf3357506dfa107100a2dabc8c3b
|
/Example/Configurables/TextInputConfigurable.swift
|
4396afffee4092461f9bf8c277df1ebde3472d91
|
[
"MIT"
] |
permissive
|
KoCMoHaBTa/MHDependencyKit
|
92ce5fdd8afb56307a248645d4d407a36a974102
|
70fade58f85881fb3c675353004591d170637358
|
refs/heads/master
| 2022-10-06T00:10:30.727321 | 2022-09-14T06:44:44 | 2022-09-14T06:44:44 | 154,321,643 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 262 |
swift
|
//
// TextInputConfigurable.swift
// Example
//
// Created by Milen Halachev on 23.01.19.
// Copyright © 2019 KoCMoHaBTa. All rights reserved.
//
import Foundation
protocol TextInputConfigurable: class {
var textInputValue: String? { get set }
}
|
[
-1
] |
4d4d5a09040c60191119ba8814b6a95d56c0fa66
|
bc6fd76163f7c9c7329ae4f075d9a1d6da21b1d4
|
/Strangers/SceneDelegate.swift
|
e0a0082f2737dc4e206da9e4d06d2fd4ea90d0f9
|
[
"MIT"
] |
permissive
|
Robihamanto/githubuser
|
3c41888204fb37154a450175860dc2ed6239da08
|
188b3b616deb4714426667c30130d2bb27061090
|
refs/heads/master
| 2022-12-08T07:28:18.667938 | 2020-09-05T03:06:09 | 2020-09-05T03:06:09 | 289,833,331 | 1 | 2 | null | 2020-08-27T03:28:09 | 2020-08-24T05:08:47 |
Swift
|
UTF-8
|
Swift
| false | false | 369 |
swift
|
//
// SceneDelegate.swift
// Strangers
//
// Created by Robihamanto on 20/07/20.
// Copyright © 2020 Robihamanto. All rights reserved.
//
import UIKit
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
}
}
|
[
-1
] |
b7978e52da5db581b35c522931fb3af2c6e53eeb
|
7f7ec945ae366c6831570273a26fcdbbece1473f
|
/MovieDB/Model/Movie.swift
|
ff8c1bae33c32b9ffe0518e7f766ab82b423be67
|
[] |
no_license
|
rasika-punde/MovieDB
|
71eb09327eb1ad632c8235c7d7403da10497dec8
|
b8fc9c3a008a107890f595a335496cc3bb26993e
|
refs/heads/master
| 2023-01-11T15:27:15.895109 | 2020-11-03T16:25:35 | 2020-11-03T16:25:35 | 309,109,775 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,383 |
swift
|
//
// Model.swift
// MovieDB
//
// Created by Punde, Rasika Nanasaheb on 01/11/20.
// Copyright © 2020 Rasika Punde. All rights reserved.
//
import Foundation
struct MovieApiResponse {
let page: Int
let numberOfResults: Int
let numberOfPages: Int
let movies: [Movie]
}
extension MovieApiResponse: Decodable {
private enum MovieApiResponseCodingKeys: String, CodingKey {
case page
case numberOfResults = "total_results"
case numberOfPages = "total_pages"
case movies = "results"
}
init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: MovieApiResponseCodingKeys.self)
page = try container.decode(Int.self, forKey: .page)
numberOfResults = try container.decode(Int.self, forKey: .numberOfResults)
numberOfPages = try container.decode(Int.self, forKey: .numberOfPages)
movies = try container.decode([Movie].self, forKey: .movies)
}
}
struct Movie {
let id: Int
let posterPath: String
let backdrop: String
let title: String
let releaseDate: String
let rating: Double
let overview: String
let genres: [Genres]
let isAdultMovie: Bool
}
extension Movie: Decodable {
enum MovieCodingKeys: String, CodingKey {
case id
case posterPath = "poster_path"
case backdrop = "backdrop_path"
case title
case releaseDate = "release_date"
case rating = "vote_average"
case genres = "genre_ids"
case adult = "adult"
case overview
}
init(from decoder: Decoder) throws {
let movieContainer = try decoder.container(keyedBy: MovieCodingKeys.self)
id = try movieContainer.decode(Int.self, forKey: .id)
posterPath = try movieContainer.decode(String.self, forKey: .posterPath)
backdrop = try movieContainer.decode(String.self, forKey: .backdrop)
title = try movieContainer.decode(String.self, forKey: .title)
releaseDate = try movieContainer.decode(String.self, forKey: .releaseDate)
rating = try movieContainer.decode(Double.self, forKey: .rating)
overview = try movieContainer.decode(String.self, forKey: .overview)
genres = try movieContainer.decode([Genres].self, forKey: .genres)
isAdultMovie = try movieContainer.decode(Bool.self, forKey: .adult)
}
}
|
[
-1
] |
e73a18de7557d6bd83aa23a133ab64bbfe319c6e
|
ae6033e6ed986163ef300d9f2439e215cf134eaf
|
/On The Map/Controllers/InformationPostingViewController.swift
|
a291291ad700a2ce53998d2f24cbd2b19eb5b2f0
|
[] |
no_license
|
samou1544/On-The-Map
|
da826c6055335b335b9b524b747532fd7bfac2fd
|
0e94304e7a5a53f92b4942cbb317270f1a9a0411
|
refs/heads/main
| 2023-03-05T23:14:25.486600 | 2021-02-08T13:44:51 | 2021-02-08T13:44:51 | 337,089,076 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,528 |
swift
|
//
// InformationPostingViewController.swift
// On The Map
//
// Created by Asma on 1/14/21.
//
import UIKit
import CoreLocation
class InformationPostingViewController: BaseViewController {
@IBOutlet weak var locationTextField: UITextField!
@IBOutlet weak var urlTextField: UITextField!
@IBOutlet weak var findLocatioButton: UIButton!
@IBOutlet weak var indicatiorView: UIActivityIndicatorView!
var address:String?
var location:CLLocation?
var mediaUrl:String?
let segueID="showLocationOnMap"
override func viewDidLoad() {
super.viewDidLoad()
let cancelButton=UIBarButtonItem(title:"Cancel" ,style: .plain, target: self, action: #selector(cancel))
navigationItem.leftBarButtonItem=cancelButton
}
@objc func cancel(){
dismiss(animated: true, completion: nil)
}
@IBAction func findLocation(_ sender: Any) {
self.address = locationTextField.text!
self.mediaUrl=urlTextField.text!
let geoCoder = CLGeocoder()
isDecodingAddress(isDecoding:true)
geoCoder.geocodeAddressString(address!) { (placemarks, error) in
guard
let placemarks = placemarks,
let location = placemarks.first?.location
else {
self.isDecodingAddress(isDecoding:false)
self.showAlert(kind:.present,title:"Couldn't decode provided address ", message: error?.localizedDescription ?? "",action:"OK")
return
}
self.isDecodingAddress(isDecoding:false)
self.location=location
self.performSegue(withIdentifier: self.segueID, sender: nil)
}
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == segueID {
let addLocationVC = segue.destination as! AddLocationViewController
addLocationVC.address=self.address
addLocationVC.lat=self.location?.coordinate.latitude
addLocationVC.long=self.location?.coordinate.longitude
addLocationVC.link=self.mediaUrl!
}
}
func isDecodingAddress(isDecoding:Bool){
if(isDecoding){
indicatiorView.startAnimating()
}else{
indicatiorView.stopAnimating()
}
locationTextField.isEnabled = !isDecoding
urlTextField.isEnabled = !isDecoding
findLocatioButton.isEnabled = !isDecoding
}
}
|
[
-1
] |
545fb6a68be75d66a5b4e8eec1bdc5a037e0ee86
|
b57de6b5a5f2da8bea0a638b6f0440847cf583ee
|
/qichehui/qichehui/Classes/Home/PagerViewController/ShortVideo-小视频/View/YCHomeShortVideoTagsView.swift
|
9788eb8c2617743aa16a4a4a7b8cd2e6bf4687c1
|
[
"Apache-2.0"
] |
permissive
|
SeekForSunny/YiChe
|
89fe272a224b7c47d6f14eeb42321f1ac54ed0e4
|
62007898c7b53acb33101484a3983507ecb6862a
|
refs/heads/master
| 2022-12-13T10:50:40.528655 | 2020-09-12T04:04:01 | 2020-09-12T04:04:01 | 275,496,381 | 1 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,342 |
swift
|
//
// YCHomeShortVideoTagsView.swift
// qichehui
//
// Created by SMART on 2020/1/15.
// Copyright © 2020 SMART. All rights reserved.
//
import UIKit
class YCHomeShortVideoTagsView: UIScrollView {
private let itemWidth = 100*APP_SCALE
private lazy var tags = [YCHomeShortVideoTagsModel]()
private lazy var cardViewArr:[YCHomeShortVideoTagView] = [YCHomeShortVideoTagView]()
private var tagsBackgoundImageArr:[String] {
return ["xspsy_ico_ht_01","xspsy_ico_ht_02","xspsy_ico_ht_03","xspsy_ico_ht_04","xspsy_ico_ht_05","xspsy_ico_ht_qb"]
}
override init(frame: CGRect) {
super.init(frame: frame)
initUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func initUI(){
self.showsHorizontalScrollIndicator = false
}
func bindData(tags:[YCHomeShortVideoTagsModel]){
self.tags = Array(tags[0..<5])
let more = YCHomeShortVideoTagsModel()
self.tags.append(more)
if cardViewArr.count < self.tags.count{
for index in cardViewArr.count ..< self.tags.count{
let cardView = YCHomeShortVideoTagView()
cardViewArr.append(cardView)
self.addSubview(cardView)
cardView.snp.makeConstraints { (make) in
make.left.equalToSuperview().offset(MARGIN_15 + CGFloat(index)*(itemWidth + MARGIN_10))
make.top.equalToSuperview()
make.height.equalToSuperview()
make.width.equalTo(itemWidth)
}
}
}else{
if cardViewArr.count > self.tags.count{
for index in self.tags.count..<cardViewArr.count{
let cardView = cardViewArr[index]
cardView.isHidden = true
}
}
}
for (index,model) in self.tags.enumerated() {
let cardView = cardViewArr[index]
cardView.isHidden = false
cardView.bindData(model:model,backgoundImageName:self.tagsBackgoundImageArr[index])
}
self.contentSize = CGSize(width: 2*MARGIN_15 + CGFloat(self.tags.count)*itemWidth + CGFloat(self.tags.count-1) * MARGIN_10, height: 0)
}
}
|
[
-1
] |
c0ed97a9c7e642b713aafdd54b6bd46a417904c0
|
66e3f5c366392aeaa03bc38815889982f3d20706
|
/MovieDbApp/ViewController.swift
|
e6fe07225fd07466b91f1be00b5eed9deb987aa6
|
[] |
no_license
|
wahidcloudly/movieDbApp
|
91a99637dde76407b6f56442823a321b2bd395cc
|
c5c3e97b6164a92c013ed510a955beadf8bb0267
|
refs/heads/master
| 2021-01-23T19:34:35.374638 | 2017-09-08T07:36:00 | 2017-09-08T07:36:00 | 102,831,279 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,197 |
swift
|
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// navigationController?.navigationBar.barTintColor = hexStringToUIColor(hex: "2D0C5C")
navigationController?.navigationBar.barTintColor = UIColor(hex: "2D0C5C")
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
func hexStringToUIColor (hex:String) -> UIColor {
var cString:String = hex.trimmingCharacters(in: .whitespacesAndNewlines).uppercased()
if (cString.hasPrefix("#")) {
cString.remove(at: cString.startIndex)
}
if ((cString.characters.count) != 6) {
return UIColor.gray
}
var rgbValue:UInt32 = 0
Scanner(string: cString).scanHexInt32(&rgbValue)
return UIColor(
red: CGFloat((rgbValue & 0xFF0000) >> 16) / 255.0,
green: CGFloat((rgbValue & 0x00FF00) >> 8) / 255.0,
blue: CGFloat(rgbValue & 0x0000FF) / 255.0,
alpha: CGFloat(1.0)
)
}
}
|
[
-1
] |
8d482de3c2fe3f794d9a07e12eff9e646685213e
|
ac4217c15f1b9e056066aa7ac462249396e344e3
|
/VIPER-Instagram/Modules/MainTabModule/Feed/FeedRouter.swift
|
cf1cf8addef6deb81f858b79c0d6dff4e6960c10
|
[] |
no_license
|
lamhoangx/iOS-VIPER-Instagram-Skeleton
|
45e5ebbdb155ef5e5094b695d3684d57152eb54c
|
0a12ec71c561659df0577388bb66903b83ab542d
|
refs/heads/master
| 2022-12-31T12:11:11.711721 | 2020-10-25T15:51:49 | 2020-10-25T15:51:49 | 302,873,382 | 1 | 0 | null | 2020-10-15T08:54:02 | 2020-10-10T10:13:19 |
Swift
|
UTF-8
|
Swift
| false | false | 1,097 |
swift
|
//
// FeedRouter.swift
// VIPER-Instagram
//
// Created by LamHX on 10/10/20.
//
import Foundation
import UIKit
class FeedRouter: FeedRouterProtocol {
class func buildFeedView() -> UICollectionViewController? {
let navController = getFeedView()
if let view = navController as? (FeedViewProtocol & FeedPresenterDelegate) {
let presenter = FeedPresenter()
let interactor = FeedInteractor()
let router = FeedRouter()
let dataManager = FeedDataManager()
// view
view.presenter = presenter
// presenter
presenter.view = view
presenter.router = router
presenter.interactor = interactor
// interactor
interactor.presenter = presenter
interactor.dataManager = dataManager
return navController
}
return nil
}
static private func getFeedView() -> UICollectionViewController? {
// Change $view if necessary
return FeedView()
}
}
|
[
-1
] |
db3c8934bdfc8611cd9bebfee1efec68df80993d
|
513d2ff2d9a9432c76afb31d94e6dc6ea6e13b1d
|
/ListApp/Magaza.swift
|
6f7a5fdbc46219c0524f1fc480f7773815b7edf6
|
[] |
no_license
|
ogi-98/ListApp
|
3e67772fbac0e81e90c05c8cac3f2c1d4980f4d8
|
5e5d43dbb66d1de292688887387ac172a989e2d7
|
refs/heads/main
| 2023-05-12T21:52:34.525410 | 2021-05-22T13:27:41 | 2021-05-22T13:27:41 | 367,418,178 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,627 |
swift
|
//
// Magaza.swift
// ListApp
//
// Created by Oğuz Kaya on 2.05.2021.
//
import Foundation
class Magaza {
var name: String
var category: String
var floor: String
var imageUrl: String
var detailImageUrl: String
var detailText: String
var phoneNumber: String
var webSite: String
var id: String
init(name: String, category: String, floor: String, imageUrl:String, detailImageUrl:String, detailText: String, phoneNumber: String, webSite: String, id:String ) {
self.name = name
self.category = category
self.floor = floor
self.imageUrl = imageUrl
self.detailImageUrl = detailImageUrl
self.detailText = detailText
self.phoneNumber = phoneNumber
self.webSite = webSite
self.id = id
}
static func transformMagaza(dict: [String:Any], keyId:String) -> Magaza? {
guard let name = dict["name"] as? String,
let category = dict["category"] as? String,
let floor = dict["floor"] as? String,
let imageUrl = dict["imageUrl"] as? String,
let detailImageUrl = dict["detailImageUrl"] as? String,
let detailText = dict["detailText"] as? String,
let phoneNumber = dict["phoneNumber"] as? String,
let webSite = dict["webSite"] as? String else { return nil }
let magaza = Magaza(name: name, category: category, floor: floor, imageUrl: imageUrl, detailImageUrl: detailImageUrl, detailText: detailText, phoneNumber: phoneNumber, webSite: webSite, id: keyId)
return magaza
}
}
|
[
-1
] |
17aa7e51f7b32a02c85ac181c949c66e5b64820c
|
3b8a30c1053c47909ba2fbb31a6ebc5fa5035dd9
|
/Vandelay/Classes/Export/ExportResult.swift
|
f986164fb9ec16d5ba326f12b314825286d76d52
|
[
"MIT"
] |
permissive
|
carabina/Vandelay
|
70b5ac475d8fb83d477bc96e6d4fe82bdd64781e
|
07a35a6229871dfca6d43eabb52867fe8a1aa3bd
|
refs/heads/master
| 2021-01-12T11:47:00.752854 | 2016-10-01T12:34:14 | 2016-10-01T12:34:14 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 417 |
swift
|
//
// ExportResult.swift
// Vandelay
//
// Created by Daniel Saidi on 2016-05-30.
// Copyright © 2016 Daniel Saidi. All rights reserved.
//
import Foundation
public class ExportResult: NSObject {
public init(state: ExportState) {
self.state = state
}
public var exportMethod = ""
public var error: NSError?
public var filePath: String?
public var state: ExportState
}
|
[
-1
] |
6a98beec6dd6c45d3c4f4910f4d669257c4f4302
|
8fa4e9385dc3c9392875fa4302b7671077723558
|
/HFIOS/example/rlterm5/rlterm5/ViewController.swift
|
ccbebf7b425c79ae2f337bc8cbc472e1de18eb7b
|
[] |
no_license
|
houfeng88/HFIOS
|
841039a3084bc5a06e7be4dc44aa973471600c20
|
4b47f8c10d615388ea4623bc9de01a484711adca
|
refs/heads/master
| 2021-01-19T13:59:59.926305 | 2016-02-24T03:31:52 | 2016-02-24T03:31:52 | 52,411,443 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 497 |
swift
|
//
// ViewController.swift
// rlterm5
//
// Created by houfeng on 3/24/15.
// Copyright (c) 2015 houfeng. 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.
}
}
|
[
293888,
215562,
287243,
275466,
295460,
284197,
286249,
237616,
360501,
286775,
238653,
226878,
293961,
226896,
212561,
284240,
284242,
292435,
276054,
237655,
307288,
277602,
276580,
281701,
284261,
281703,
306791,
309353,
311913,
286314,
277612,
276597,
276087,
284289,
280710,
284298,
311437,
226447,
282262,
280219,
299165,
285855,
228000,
225955,
282275,
326311,
280231,
209577,
284328,
287399,
302256,
284336,
277171,
286390,
280760,
299709,
283839,
277696,
285377,
280770,
228548,
280772,
276167,
277192,
280775,
284361,
307410,
284373,
226009,
280797,
278752,
290020,
291556,
284391,
280808,
312049,
120054,
226038,
204027,
286462,
280832,
278786,
230147,
358147,
226055,
369434,
329499,
276256,
278304,
315170,
304933,
289578,
312107,
278845,
289600,
288579,
293700,
300358,
238920,
276309,
307029,
298842,
241499,
298843,
311645,
188253,
323933,
303977,
306540,
296813,
276849,
315250,
278897,
310649,
207738,
275842,
224643,
313733,
324491,
306577,
279442,
306578,
275358,
288165,
284586,
289196,
370093,
277935,
324528,
230323,
289204,
337336,
298936,
276412,
299973,
306633,
286158,
280015,
301012,
301016,
280028,
280029,
280030,
276959,
286175,
276965,
294889,
286189,
277487,
308721,
227315,
296436,
310773,
286204,
287231
] |
86611b5804eea2bc66964c8327ab77eaaae14529
|
501e2cae8c137b259eb496f95f1ee492c9cb8be9
|
/EnumDemo/EnumDemo/AppDelegate.swift
|
4f3ba520183c158c1570f786e6ef043f42d87287
|
[] |
no_license
|
iversonwool/FunctionalSwift
|
2ad6814b8736cc69202ef06fa2c13a810c879bca
|
117cb4fa030ce356bb4d9798c80410f034b76172
|
refs/heads/master
| 2020-04-24T02:12:59.582366 | 2019-03-04T06:58:01 | 2019-03-04T06:58:01 | 171,629,109 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,164 |
swift
|
//
// AppDelegate.swift
// EnumDemo
//
// Created by LeeHow on 2019/3/4.
// Copyright © 2019 LeeHow. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}
func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
}
|
[
229380,
229383,
229385,
278539,
294924,
229388,
278542,
229391,
327695,
278545,
229394,
278548,
229397,
229399,
229402,
352284,
229405,
278556,
278559,
229408,
278564,
294950,
229415,
229417,
327722,
237613,
229422,
360496,
229426,
237618,
229428,
311349,
286774,
286776,
319544,
286778,
204856,
229432,
286791,
237640,
286797,
278605,
311375,
163920,
237646,
196692,
319573,
311383,
278623,
278626,
319590,
311400,
278635,
303212,
278639,
131192,
278648,
237693,
303230,
327814,
303241,
131209,
417930,
303244,
311436,
319633,
286873,
286876,
311460,
311469,
32944,
327862,
286906,
327866,
180413,
286910,
131264,
286916,
295110,
286922,
286924,
286926,
319694,
286928,
131281,
278743,
278747,
295133,
155872,
319716,
237807,
303345,
286962,
131314,
229622,
327930,
278781,
278783,
278785,
237826,
319751,
278792,
286987,
319757,
311569,
286999,
319770,
287003,
287006,
287009,
287012,
287014,
287016,
287019,
311598,
287023,
262448,
311601,
295220,
287032,
155966,
319809,
319810,
278849,
319814,
311623,
319818,
311628,
229709,
319822,
287054,
278865,
229717,
196963,
196969,
139638,
213367,
106872,
319872,
311683,
319879,
311693,
65943,
319898,
311719,
278952,
139689,
278957,
311728,
278967,
180668,
311741,
278975,
319938,
278980,
98756,
278983,
319945,
278986,
319947,
278990,
278994,
311767,
279003,
279006,
188895,
172512,
287202,
279010,
279015,
172520,
319978,
279020,
172526,
311791,
279023,
172529,
279027,
319989,
172534,
180727,
164343,
279035,
311804,
287230,
279040,
303617,
287234,
279045,
172550,
303623,
172552,
320007,
287238,
279051,
172558,
279055,
303632,
279058,
303637,
279063,
279067,
172572,
279072,
172577,
295459,
172581,
295461,
279082,
311850,
279084,
172591,
172598,
279095,
172607,
172609,
172612,
377413,
172614,
172618,
303690,
33357,
287309,
303696,
279124,
172634,
262752,
172644,
311911,
189034,
295533,
172655,
172656,
352880,
295538,
189039,
172660,
287349,
189040,
189044,
287355,
287360,
295553,
172675,
295557,
311942,
303751,
287365,
352905,
311946,
279178,
287371,
311951,
287377,
172691,
287381,
311957,
221850,
287386,
230045,
172702,
287390,
303773,
172705,
287394,
172707,
303780,
164509,
287398,
205479,
279208,
287400,
172714,
295595,
279212,
189102,
172721,
287409,
66227,
303797,
189114,
287419,
303804,
328381,
287423,
328384,
172737,
279231,
287427,
312005,
312006,
107208,
172748,
287436,
107212,
172751,
287440,
295633,
172755,
303827,
279255,
172760,
287450,
303835,
279258,
189149,
303838,
213724,
312035,
279267,
295654,
279272,
230128,
312048,
312050,
230131,
205564,
303871,
230146,
328453,
295685,
230154,
33548,
312077,
295695,
295701,
230169,
369433,
295707,
328476,
295710,
230175,
295720,
303914,
279340,
205613,
279353,
230202,
312124,
328508,
222018,
295755,
377676,
148302,
287569,
303959,
230237,
279390,
230241,
279394,
303976,
336744,
303985,
303987,
328563,
279413,
303991,
303997,
295806,
295808,
295813,
304005,
320391,
304007,
213895,
304009,
304011,
230284,
304013,
295822,
279438,
213902,
189329,
295825,
304019,
189331,
58262,
304023,
304027,
279452,
410526,
279461,
279462,
304042,
213931,
230327,
304055,
287675,
230334,
304063,
238528,
304065,
213954,
189378,
156612,
295873,
213963,
197580,
312272,
304084,
304090,
320481,
304106,
320490,
312302,
328687,
320496,
304114,
295928,
320505,
312321,
295945,
230413,
295949,
197645,
320528,
140312,
295961,
238620,
197663,
304164,
304170,
304175,
238641,
312374,
238652,
238655,
230465,
238658,
336964,
132165,
296004,
205895,
320584,
238666,
296021,
402518,
336987,
230497,
296036,
296040,
361576,
205931,
296044,
279661,
205934,
164973,
312432,
279669,
337018,
189562,
279679,
304258,
279683,
222340,
205968,
296084,
238745,
304285,
238756,
205991,
222377,
165035,
337067,
238766,
165038,
230576,
238770,
304311,
230592,
312518,
279750,
230600,
230607,
148690,
320727,
279769,
304348,
279777,
304354,
296163,
320740,
279781,
304360,
320748,
279788,
279790,
304370,
296189,
320771,
312585,
296202,
296205,
230674,
320786,
230677,
296213,
296215,
320792,
230681,
230679,
214294,
304416,
230689,
173350,
312622,
296243,
312630,
222522,
296253,
222525,
296255,
312639,
230718,
296259,
378181,
296262,
230727,
238919,
296264,
320840,
296267,
296271,
222545,
230739,
312663,
222556,
337244,
230752,
312676,
230760,
173418,
148843,
410987,
230763,
230768,
296305,
312692,
230773,
304505,
304506,
181626,
279929,
181631,
148865,
312711,
312712,
296331,
288140,
288144,
230800,
304533,
337306,
288154,
288160,
173472,
288162,
288164,
279975,
304555,
370092,
279983,
173488,
288176,
279985,
312755,
296373,
312759,
337335,
288185,
279991,
222652,
312766,
173507,
296389,
222665,
230860,
312783,
288208,
230865,
288210,
370130,
288212,
222676,
148946,
288214,
239064,
329177,
288217,
280027,
288220,
288218,
239070,
288224,
280034,
288226,
280036,
288229,
280038,
288230,
288232,
370146,
288234,
320998,
288236,
288238,
288240,
288242,
296435,
288244,
288250,
296446,
321022,
402942,
148990,
296450,
206336,
230916,
230919,
214535,
230923,
304651,
304653,
370187,
230940,
222752,
108066,
296486,
296488,
157229,
239152,
230961,
157236,
288320,
288325,
124489,
280140,
280145,
288338,
280149,
288344,
280152,
239194,
280158,
403039,
370272,
181854,
239202,
312938,
280183,
280185,
280188,
280191,
116354,
280194,
280208,
280211,
288408,
280218,
280222,
190118,
198310,
321195,
296622,
321200,
337585,
296626,
296634,
296637,
313027,
280260,
206536,
280264,
206539,
206541,
206543,
313044,
280276,
321239,
280283,
313052,
18140,
288478,
313055,
321252,
313066,
288494,
280302,
280304,
313073,
321266,
419570,
288499,
288502,
280314,
288510,
124671,
67330,
280324,
198405,
288519,
280331,
198416,
280337,
296723,
116503,
321304,
329498,
296731,
321311,
313121,
313123,
304932,
321316,
280363,
141101,
165678,
280375,
321336,
296767,
288576,
345921,
280388,
337732,
304968,
280393,
280402,
173907,
313171,
313176,
42842,
280419,
321381,
296809,
296812,
313201,
1920,
255873,
305028,
280454,
247688,
280464,
124817,
280468,
239510,
280473,
124827,
214940,
247709,
214944,
280487,
313258,
321458,
296883,
124853,
214966,
296890,
10170,
288700,
296894,
190403,
296900,
280515,
337862,
165831,
280521,
231379,
296921,
239586,
313320,
231404,
124913,
165876,
321528,
239612,
313340,
288764,
239617,
313347,
288773,
313358,
305176,
321560,
313371,
354338,
305191,
223273,
313386,
354348,
124978,
215090,
124980,
288824,
288826,
321595,
378941,
313406,
288831,
288836,
67654,
280651,
354382,
288848,
280658,
215123,
354390,
288855,
288859,
280669,
313438,
149599,
280671,
149601,
321634,
149603,
223327,
329830,
280681,
313451,
223341,
280687,
149618,
215154,
313458,
280691,
313464,
329850,
321659,
280702,
288895,
321670,
215175,
141446,
288909,
141455,
141459,
280725,
313498,
100520,
288936,
280747,
288940,
288947,
280755,
321717,
280759,
280764,
280769,
280771,
280774,
280776,
313548,
321740,
280783,
280786,
280788,
313557,
280793,
280796,
280798,
338147,
280804,
280807,
157930,
280811,
280817,
125171,
157940,
280819,
182517,
280823,
280825,
280827,
280830,
280831,
280833,
125187,
280835,
125191,
125207,
125209,
321817,
125218,
321842,
223539,
125239,
280888,
280891,
289087,
280897,
280900,
305480,
239944,
280906,
239947,
305485,
305489,
379218,
280919,
354653,
354656,
313700,
313705,
280937,
190832,
280946,
223606,
313720,
280956,
239997,
280959,
313731,
199051,
240011,
289166,
240017,
297363,
190868,
240021,
297365,
297368,
297372,
141725,
297377,
289186,
297391,
289201,
240052,
289207,
289210,
305594,
281024,
289218,
289221,
289227,
281045,
281047,
215526,
166378,
305647,
281075,
174580,
240124,
281084,
305662,
305664,
240129,
305666,
305668,
223749,
240132,
281095,
223752,
150025,
338440,
330244,
223757,
281102,
223763,
223765,
281113,
322074,
281116,
281121,
182819,
281127,
281135,
150066,
158262,
158266,
289342,
281154,
322115,
158283,
281163,
281179,
338528,
338532,
281190,
199273,
281196,
19053,
158317,
313973,
297594,
281210,
158347,
182926,
133776,
314003,
117398,
314007,
289436,
174754,
330404,
289448,
133801,
174764,
314029,
314033,
240309,
133817,
314045,
314047,
314051,
199364,
297671,
158409,
289493,
363234,
289513,
289522,
289525,
289532,
322303,
289537,
322310,
264969,
322314,
322318,
281361,
281372,
322341,
215850,
281388,
289593,
281401,
289601,
281410,
281413,
281414,
240458,
281420,
240468,
281430,
322393,
297818,
281435,
281438,
281442,
174955,
224110,
207733,
207737,
158596,
183172,
338823,
322440,
314249,
240519,
183184,
142226,
289687,
240535,
297883,
289694,
289696,
289700,
289712,
281529,
289724,
52163,
183260,
281567,
289762,
322534,
297961,
183277,
281581,
322550,
134142,
322563,
314372,
330764,
175134,
322599,
322610,
314421,
281654,
314427,
314433,
207937,
314441,
207949,
322642,
314456,
281691,
314461,
281702,
281704,
314474,
281708,
281711,
289912,
248995,
306341,
306344,
306347,
322734,
306354,
142531,
199877,
289991,
306377,
289997,
249045,
363742,
363745,
298216,
330988,
126190,
216303,
322801,
388350,
257302,
363802,
199976,
199978,
314671,
298292,
298294,
257334,
216376,
380226,
298306,
224584,
224587,
224594,
216404,
306517,
150870,
314714,
224603,
159068,
314718,
265568,
314723,
281960,
150890,
306539,
314732,
314736,
290161,
216436,
306549,
298358,
314743,
306552,
290171,
314747,
306555,
298365,
290174,
224641,
281987,
298372,
314756,
281990,
224647,
265604,
298377,
314763,
142733,
298381,
314768,
224657,
306581,
314773,
314779,
314785,
314793,
282025,
282027,
241068,
241070,
241072,
282034,
241077,
150966,
298424,
306618,
282044,
323015,
306635,
306640,
290263,
290270,
290275,
339431,
282089,
191985,
282098,
290291,
282101,
241142,
191992,
290298,
151036,
290302,
282111,
290305,
175621,
306694,
192008,
323084,
257550,
282127,
290321,
282130,
323090,
290325,
282133,
241175,
290328,
282137,
290332,
241181,
282142,
282144,
290344,
306731,
290349,
290351,
290356,
28219,
282186,
224849,
282195,
282199,
282201,
306778,
159324,
159330,
314979,
298598,
323176,
224875,
241260,
323181,
257658,
315016,
282249,
290445,
324757,
282261,
175770,
298651,
282269,
323229,
298655,
323231,
61092,
282277,
306856,
196133,
282295,
323260,
282300,
323266,
282310,
323273,
282319,
306897,
241362,
306904,
282328,
298714,
52959,
216801,
282337,
241380,
216806,
323304,
282345,
12011,
282356,
323318,
282364,
282367,
306945,
241412,
323333,
282376,
216842,
323345,
282388,
323349,
282392,
184090,
315167,
315169,
282402,
315174,
323367,
241448,
315176,
241450,
282410,
306988,
306991,
315184,
323376,
315190,
241464,
159545,
282425,
298811,
118593,
307009,
413506,
307012,
241475,
298822,
315211,
282446,
307027,
315221,
323414,
315223,
241496,
241498,
307035,
307040,
110433,
282465,
241509,
110438,
298860,
110445,
282478,
315249,
110450,
315251,
282481,
315253,
315255,
339838,
315267,
282499,
315269,
241544,
282505,
241546,
241548,
298896,
298898,
282514,
241556,
298901,
44948,
241560,
282520,
241563,
241565,
241567,
241569,
282531,
241574,
282537,
298922,
36779,
241581,
282542,
241583,
323504,
241586,
282547,
241588,
290739,
241590,
241592,
241598,
290751,
241600,
241605,
151495,
241610,
298975,
241632,
298984,
241640,
241643,
298988,
241646,
241649,
241652,
323574,
290807,
299003,
241661,
299006,
282623,
315396,
241669,
315397,
282632,
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,
307386,
258235,
307388,
307385,
307390,
176316,
299200,
184512,
307394,
299204,
307396,
184518,
307399,
323784,
233679,
307409,
307411,
176343,
299225,
233701,
307432,
184572,
282881,
184579,
282893,
291089,
282906,
291104,
233766,
295583,
176435,
307508,
315701,
332086,
307510,
307512,
168245,
307515,
307518,
282942,
282947,
323917,
110926,
282957,
233808,
323921,
315733,
323926,
233815,
276052,
315739,
323932,
299357,
242018,
242024,
299373,
315757,
250231,
242043,
315771,
299388,
299391,
291202,
299398,
242057,
291212,
299405,
291222,
315801,
283033,
242075,
291226,
194654,
61855,
291231,
283042,
291238,
291241,
127403,
127405,
291247,
299440,
127407,
299444,
127413,
283062,
291254,
127417,
291260,
283069,
127421,
127424,
299457,
127429,
127431,
127434,
315856,
176592,
127440,
315860,
176597,
283095,
127447,
299481,
127449,
176605,
242143,
127455,
127457,
291299,
340454,
127463,
242152,
291305,
127466,
176620,
127469,
127474,
291314,
291317,
127480,
135672,
291323,
233979,
127485,
291330,
283142,
127494,
135689,
233994,
127497,
127500,
291341,
233998,
127506,
234003,
234006,
127511,
152087,
283161,
242202,
234010,
135707,
135710,
242206,
242208,
291361,
242220,
291378,
152118,
234038,
234041,
315961,
70213,
242250,
111193,
242275,
299620,
242279,
168562,
184952,
135805,
135808,
291456,
373383,
299655,
135820,
316051,
225941,
316054,
299672,
135834,
373404,
299677,
225948,
135839,
299680,
225954,
299684,
135844,
242343,
209576,
242345,
373421,
135870,
135873,
135876,
135879,
299720,
299723,
299726,
225998,
226002,
119509,
226005,
226008,
299740,
242396,
201444,
299750,
283368,
234219,
283372,
226037,
283382,
316151,
234231,
234236,
226045,
242431,
234239,
209665,
234242,
299778,
242436,
226053,
234246,
226056,
234248,
291593,
242443,
234252,
242445,
234254,
291601,
234258,
242450,
242452,
234261,
348950,
201496,
234264,
234266,
234269,
283421,
234272,
234274,
152355,
299814,
234278,
283432,
234281,
234284,
234287,
283440,
185138,
242483,
234292,
234296,
234298,
160572,
283452,
234302,
234307,
242499,
234309,
316233,
234313,
316235,
234316,
283468,
234319,
242511,
234321,
234324,
185173,
201557,
234329,
234333,
308063,
234336,
242530,
349027,
234338,
234341,
234344,
234347,
177004,
234350,
324464,
234353,
152435,
177011,
234356,
234358,
234362,
226171,
234364,
291711,
234368,
291714,
234370,
291716,
234373,
316294,
201603,
226182,
308105,
234375,
226185,
234379,
324490,
234384,
234388,
234390,
324504,
234393,
209818,
308123,
324508,
234396,
291742,
226200,
234398,
234401,
291747,
291748,
234405,
291750,
234407,
324520,
324518,
324522,
234410,
291756,
291754,
226220,
324527,
291760,
234417,
201650,
324531,
234414,
234422,
226230,
324536,
275384,
234428,
291773,
242623,
324544,
234431,
234434,
324546,
324548,
234437,
226245,
234439,
226239,
234443,
291788,
234446,
275406,
193486,
234449,
316370,
193488,
234452,
234455,
234459,
234461,
234464,
234467,
234470,
168935,
5096,
324585,
234475,
234478,
316400,
234481,
316403,
234484,
234485,
234487,
324599,
234490,
234493,
316416,
234496,
308226,
234501,
275462,
308231,
234504,
234507,
234510,
234515,
300054,
316439,
234520,
234519,
234523,
234526,
234528,
300066,
234532,
300069,
234535,
234537,
234540,
144430,
234543,
234546,
275508,
300085,
234549,
300088,
234553,
234556,
234558,
316479,
234561,
316483,
160835,
234563,
308291,
234568,
234570,
316491,
234572,
300108,
234574,
300115,
234580,
234581,
242777,
234585,
275545,
234590,
234593,
234595,
234597,
300133,
234601,
300139,
234605,
160879,
234607,
275569,
234610,
316530,
300148,
234614,
398455,
144506,
234618,
234620,
275579,
234623,
226433,
234627,
275588,
234629,
242822,
234634,
234636,
177293,
234640,
275602,
234643,
308373,
226453,
234647,
275606,
275608,
234650,
308379,
234648,
300189,
324766,
119967,
234653,
324768,
283805,
234657,
242852,
300197,
234661,
283813,
234664,
275626,
234667,
316596,
308414,
234687,
300223,
300226,
308418,
234692,
300229,
308420,
308422,
283844,
226500,
300234,
283850,
300238,
300241,
316625,
300243,
300245,
316630,
300248,
300253,
300256,
300258,
300260,
234726,
300263,
300265,
300267,
161003,
300270,
300272,
120053,
300278,
275703,
316663,
300284,
275710,
300287,
292097,
300289,
161027,
300292,
300294,
275719,
234760,
177419,
300299,
242957,
300301,
283917,
177424,
275725,
349464,
283939,
259367,
292143,
283951,
300344,
226617,
243003,
283963,
226628,
300357,
283973,
177482,
283983,
316758,
357722,
316766,
316768,
292192,
218464,
292197,
316774,
243046,
218473,
284010,
136562,
324978,
275834,
333178,
275836,
275840,
316803,
316806,
226696,
316811,
226699,
316814,
226703,
300433,
234899,
300436,
226709,
357783,
316824,
316826,
144796,
300448,
144807,
144810,
144812,
284076,
144814,
227426,
144820,
374196,
284084,
292279,
284087,
144826,
144828,
144830,
144832,
144835,
144837,
38342,
144839,
144841,
144844,
144847,
144852,
144855,
103899,
300507,
333280,
226787,
218597,
292329,
300523,
259565,
300527,
308720,
259567,
292338,
226802,
316917,
292343,
308727,
300537,
316933,
316947,
308757,
308762,
284191,
284194,
284196,
235045,
284199,
284204,
284206,
284209,
284211,
194101,
284213,
316983,
194103,
284215,
308790,
284218,
226877,
292414,
284223,
284226,
284228,
292421,
226886,
284231,
128584,
243268,
284234,
366155,
317004,
276043,
284238,
226895,
284241,
194130,
284243,
300628,
284245,
292433,
284247,
317015,
235097,
243290,
276053,
284249,
284251,
300638,
284253,
284255,
243293,
284258,
292452,
292454,
284263,
177766,
284265,
292458,
284267,
292461,
284272,
284274,
284278,
292470,
276086,
292473,
284283,
276093,
284286,
292479,
284288,
292481,
284290,
325250,
284292,
292485,
325251,
276095,
276098,
284297,
317066,
284299,
317068,
284301,
276109,
284303,
284306,
276114,
284308,
284312,
284314,
284316,
276127,
284320,
284322,
284327,
284329,
317098,
284331,
276137,
284333,
284335,
276144,
284337,
284339,
300726,
284343,
284346,
284350,
358080,
276160,
284354,
358083,
284358,
276166,
358089,
284362,
276170,
284365,
276175,
284368,
276177,
284370,
358098,
284372,
317138,
284377,
276187,
284379,
284381,
284384,
358114,
284386,
358116,
276197,
317158,
358119,
284392,
325353,
358122,
284394,
284397,
358126,
284399,
358128,
276206,
358133,
358135,
276216,
358138,
300795,
358140,
284413,
358142,
358146,
317187,
284418,
317189,
317191,
284428,
300816,
300819,
317207,
284440,
300828,
300830,
276255,
300832,
325408,
300834,
317221,
227109,
358183,
186151,
276268,
300845,
243504,
300850,
284469,
276280,
325436,
358206,
276291,
366406,
276295,
300872,
292681,
153417,
358224,
284499,
276308,
284502,
317271,
178006,
276315,
292700,
317279,
284511,
227175,
292715,
300912,
292721,
284529,
300915,
284533,
292729,
317306,
284540,
292734,
325512,
169868,
276365,
317332,
358292,
284564,
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,
292843,
276460,
292845,
276464,
178161,
227314,
276466,
325624,
276472,
317435,
276476,
276479,
276482,
276485,
317446,
276490,
292876,
317456,
276496,
317458,
178195,
243733,
243740,
317468,
317472,
325666,
243751,
292904,
276528,
243762,
309298,
325685,
325689,
235579,
325692,
235581,
178238,
276539,
276544,
284739,
325700,
243779,
292934,
243785,
276553,
350293,
350295,
309337,
194649,
227418,
350302,
227423,
350304,
178273,
309346,
194657,
194660,
350308,
309350,
309348,
292968,
309352,
309354,
301163,
350313,
350316,
227430,
301167,
276583,
350321,
276590,
284786,
276595,
350325,
252022,
227440,
350328,
292985,
301178,
350332,
292989,
301185,
292993,
350339,
317570,
317573,
350342,
350345,
350349,
301199,
317584,
325777,
350354,
350357,
350359,
350362,
350366,
276638,
284837,
153765,
350375,
350379,
350381,
350383,
129200,
350385,
350387,
350389,
350395,
350397,
350399,
227520,
350402,
227522,
301252,
350406,
227529,
301258,
309450,
276685,
309455,
276689,
309462,
301272,
276699,
194780,
309468,
309471,
301283,
317672,
317674,
325867,
243948,
194801,
227571,
309491,
309494,
243960,
276735,
227583,
227587,
276739,
211204,
276742,
227593,
227596,
325910,
309530,
342298,
211232,
317729,
276775,
211241,
325937,
325943,
211260,
260421,
276809,
285002,
276811,
235853,
276816,
235858,
276829,
276833,
391523,
276836,
293227,
276843,
293232,
276848,
186744,
211324,
227709,
285061,
317833,
178572,
285070,
285077,
178583,
227738,
317853,
276896,
317858,
342434,
285093,
317864,
285098,
276907,
235955,
276917,
293304,
293307,
293314,
309707,
293325,
317910,
293336,
235996,
317917,
293343,
358880,
276961,
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,
129603,
301636,
318020,
301639,
301643,
277071,
285265,
399955,
309844,
277080,
309849,
285277,
285282,
326244,
318055,
277100,
309871,
121458,
277106,
170618,
170619,
309885,
309888,
277122,
227975,
277128,
285320,
301706,
318092,
326285,
334476,
318094,
277136,
277139,
227992,
334488,
318108,
285340,
318110,
227998,
137889,
383658,
285357,
318128,
277170,
293555,
318132,
342707,
154292,
277173,
285368,
277177,
277181,
318144,
277187,
277191,
277194,
277196,
277201,
137946,
113378,
203491,
228069,
277223,
342760,
285417,
56041,
56043,
277232,
228081,
56059,
310015,
285441,
310020,
285448,
310029,
228113,
285459,
277273,
293659,
326430,
228128,
285474,
293666,
228135,
318248,
277291,
318253,
293677,
285489,
301876,
293685,
285494,
301880,
285499,
301884,
310080,
293696,
277317,
277322,
277329,
162643,
310100,
301911,
301913,
277337,
301921,
400236,
236397,
162671,
326514,
310134,
236408,
15224,
277368,
416639,
416640,
113538,
310147,
416648,
39817,
187274,
277385,
301972,
424853,
277405,
277411,
310179,
293798,
293802,
236460,
277426,
276579,
293811,
293817,
293820,
203715,
326603,
276586,
293849,
293861,
228327,
228328,
318442,
228330,
228332,
326638,
277486,
318450,
293876,
293877,
285686,
302073,
121850,
293882,
302075,
285690,
244731,
293887,
277504,
277507,
277511,
293899,
277519,
293908,
302105,
293917,
293939,
318516,
277561,
277564,
310336,
7232,
293956,
277573,
228422,
293960,
310344,
277577,
277583,
203857,
293971,
310355,
310359,
236632,
277594,
138332,
277598,
203872,
277601,
285792,
310374,
203879,
310376,
228460,
318573,
203886,
187509,
285815,
367737,
285817,
302205,
285821,
392326,
285831,
253064,
294026,
302218,
285835,
162964,
384148,
187542,
302231,
285849,
302233,
285852,
302237,
285854,
285856,
302241,
285862,
277671,
302248,
64682,
277678,
294063,
294065,
302258,
277687,
294072,
318651,
294076,
277695,
318657,
244930,
302275,
130244,
302277,
228550,
302282,
310476,
302285,
302288,
310481,
302290,
203987,
302292,
302294,
310486,
302296,
384222,
310498,
285927,
318698,
302315,
195822,
228592,
294132,
138485,
228601,
204026,
228606,
204031,
64768,
310531,
285958,
138505,
228617,
318742,
204067,
277798,
130345,
277801,
113964,
285997,
277804,
285999,
277807,
113969,
277811,
318773,
318776,
277816,
286010,
277819,
294204,
417086,
277822,
286016,
302403,
294211,
384328,
277832,
277836,
294221,
294223,
326991,
277839,
277842,
277847,
277850,
179547,
277853,
146784,
277857,
302436,
277860,
294246,
327015,
310632,
327017,
351594,
277864,
277869,
277872,
351607,
310648,
277880,
310651,
277884,
277888,
310657,
351619,
294276,
310659,
327046,
277892,
253320,
310665,
318858,
277894,
277898,
277903,
310672,
351633,
277905,
277908,
277917,
310689,
277921,
130468,
228776,
277928,
277932,
310703,
277937,
310710,
130486,
310712,
277944,
310715,
277947,
302526,
228799,
277950,
277953,
302534,
310727,
245191,
64966,
163272,
277959,
277963,
302541,
277966,
302543,
310737,
277971,
228825,
163290,
277978,
310749,
277981,
277984,
310755,
277989,
277991,
187880,
277995,
310764,
286188,
278000,
228851,
310772,
278003,
278006,
40440,
212472,
278009,
40443,
286203,
310780,
40448,
228864,
286214,
228871,
302603,
65038,
302614,
302617,
286233,
302621,
286240,
146977,
187939,
40484,
294435,
40486,
286246,
294440,
40488,
294439,
294443,
40491,
294445,
278057,
310831,
245288,
286248,
40499,
40502,
212538,
40507,
40511,
40513,
228933,
327240,
40521,
286283,
40525,
40527,
212560,
400976,
228944,
40533,
147032,
40537,
40539,
40541,
278109,
40544,
40548,
40550,
40552,
286312,
40554,
286313,
310892,
40557,
40560,
188022,
122488,
294521,
343679,
294537,
310925,
286354,
278163,
302740,
122517,
278168,
179870,
327333,
229030,
212648,
278188,
302764,
278192,
319153,
278196,
302781,
319171,
302789,
294599,
278216,
294601,
302793,
343757,
212690,
319187,
286420,
278227,
229076,
286425,
319194,
278235,
278238,
229086,
286432,
294625,
294634,
302838,
319226,
286460,
278274,
302852,
278277,
302854,
294664,
311048,
352008,
319243,
311053,
302862,
319251,
294682,
278306,
188199,
294701,
319280,
278320,
319290,
229192,
302925,
188247,
280021,
188252,
237409,
229233,
294776,
360317,
294785,
327554,
40840,
40851,
294803,
188312,
294811,
237470,
319390,
40865,
319394,
294817,
294821,
311209,
180142,
343983,
294831,
188340,
40886,
319419,
294844,
294847,
237508,
393177,
294876,
294879,
294883,
294890,
311279,
278513,
237555,
311283,
278516,
278519,
237562
] |
c2d54ee620c0ed118a92f54610b27e6156cf6a16
|
11aca429a2341b8708d808bac197d1649740e823
|
/MetalDay5/MetalDay5/Renderer.swift
|
43a1ea8586d81092800b568891ecbbca0b17d1da
|
[
"MIT"
] |
permissive
|
whisky-shusuky/MetalAdventCalendar
|
0a90829b359690bc6e53477f96a1a66d5c00aaf1
|
fce53d4438ce212fa21a0d02ee5878ea932857aa
|
refs/heads/master
| 2021-10-07T20:43:55.428937 | 2018-12-05T09:11:16 | 2018-12-05T09:11:16 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 6,725 |
swift
|
//
// Renderer.swift
// MetalDay5
//
// Created by MikiTakahashi on 2018/12/05.
// Copyright © 2018 MikiTakahashi. All rights reserved.
//
import Foundation
/*
The MIT License (MIT)
Copyright (c) 2018 MikiTakahashi
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
import Metal
import MetalKit
class Renderer:NSObject {
// local datas
private var vertices: [Vertex]!
private var vertexBuffer: MTLBuffer!
private var indices: [UInt16]!
private var indexBuffer: MTLBuffer!
// for MetalAPI
private var mtlDevice: MTLDevice!
private var mtkview: MTKView!
private var commandQueue: MTLCommandQueue!
private var pipelineState: MTLRenderPipelineState!
private var uniforms: Uniforms!
private var preferredFramesTime: Float!
// Textures
private var koaraTexture: MTLTexture!
init(metalKitView mtkView: MTKView) {
super.init()
self.mtkview = mtkView
guard let device = mtkView.device else {
print("mtkview doesn't have mtlDevice")
return
}
self.mtlDevice = device
commandQueue = device.makeCommandQueue()
vertices = [Vertex]()
indices = [UInt16]()
uniforms = Uniforms(time: Float(0.0), aspectRatio: Float(0.0), touch: float2())
uniforms.aspectRatio = Float(mtkView.frame.size.width / mtkView.frame.size.height)
preferredFramesTime = 1.0 / Float(mtkView.preferredFramesPerSecond)
}
private func buildPipeline() {
let library = mtlDevice.makeDefaultLibrary()
let vertexFunction = library?.makeFunction(name: "vertexDay5")
let fragmentFunction = library?.makeFunction(name: "fragmentDay5")
let pipelineDescriptor = MTLRenderPipelineDescriptor()
pipelineDescriptor.vertexFunction = vertexFunction
pipelineDescriptor.fragmentFunction = fragmentFunction
pipelineDescriptor.colorAttachments[0].pixelFormat = .bgra8Unorm
do {
try pipelineState = mtlDevice.makeRenderPipelineState(descriptor: pipelineDescriptor)
} catch let error {
print("Failed to create pipeline state, error: ", error)
}
}
private func buildBuffer() {
vertexBuffer = mtlDevice.makeBuffer(bytes: vertices, length: vertices.count*MemoryLayout<Vertex>.stride, options: [])
}
}
extension Renderer: MTKViewDelegate{
public func draw(in view: MTKView) {
uniforms.time += preferredFramesTime
guard let drawable = view.currentDrawable,
let renderPassDescriptor = view.currentRenderPassDescriptor else {
print("cannot get drawable or renderPassDescriptor")
return
}
let commandBuffer = commandQueue.makeCommandBuffer()
let commandEncoder = commandBuffer?.makeRenderCommandEncoder(descriptor: renderPassDescriptor)
commandEncoder?.setRenderPipelineState(pipelineState)
commandEncoder?.setVertexBuffer(vertexBuffer, offset: 0, index: 0)
commandEncoder?.setVertexBytes(&uniforms, length: MemoryLayout<Uniforms>.stride, index: 1)
commandEncoder?.setFragmentTexture(koaraTexture, index: 0)
commandEncoder?.drawPrimitives(type: .triangle, vertexStart: 0, vertexCount: vertices.count)
commandEncoder?.endEncoding()
commandBuffer?.present(drawable)
commandBuffer?.commit()
}
public func mtkView(_ view: MTKView, drawableSizeWillChange size: CGSize) {
}
}
// for use Texture
extension Renderer {
private func buildTexture() {
koaraTexture = imageTexture(imageName: "koara.jpg", device: mtlDevice)
}
private func imageTexture(imageName: String, device: MTLDevice) -> MTLTexture? {
guard let image = UIImage(named: imageName)?.cgImage else {
return nil
}
let (w,h) = (image.width, image.height)
let colorSpace = CGColorSpaceCreateDeviceRGB()
let rawData = calloc(h*w*4, MemoryLayout<UInt8>.size)
let bytesPerPixel = 4
let bytesPerRow = bytesPerPixel * w
let bitsPerComponent = 8
let options = CGImageAlphaInfo.premultipliedLast.rawValue | CGBitmapInfo.byteOrder32Big.rawValue
let context = CGContext(data: rawData, width: w, height: h,
bitsPerComponent: bitsPerComponent, bytesPerRow: bytesPerRow,
space: colorSpace, bitmapInfo: options)
context?.draw(image, in: CGRect(x: 0, y: 0, width: CGFloat(w), height: CGFloat(h)))
let textureDescriptor = MTLTextureDescriptor.texture2DDescriptor(pixelFormat: .rgba8Unorm, width: w, height: h, mipmapped: false)
let texture = device.makeTexture(descriptor: textureDescriptor)
let region = MTLRegionMake2D(0, 0, w, h)
texture?.replace(region: region, mipmapLevel: 0, slice: 0, withBytes: rawData!, bytesPerRow: bytesPerRow, bytesPerImage: bytesPerRow*h)
free(rawData)
return texture
}
}
extension Renderer {
public func setVertices(_ vertices: [Vertex]) {
self.vertices += vertices
}
public func setIndices(_ indices: [Int]) {
self.indices += indices.map({ (n) -> UInt16 in
return UInt16(n)
})
}
public func start () {
buildBuffer()
buildPipeline()
buildTexture()
mtkview.delegate = self
}
public func rebuildGame() {
}
public func applyTouch(touch: float2) {
uniforms.touch = touch
}
}
|
[
-1
] |
a9efad54e8976ebb4be1266689c177c5fe04bb06
|
7a24f3c2835773115941d2778ac92ae6933c5055
|
/twitter_alamofire_demo/ProfileViewController.swift
|
5da8ca64792f81c7f8ef170ccfe5b56e4f12a436
|
[
"Apache-2.0"
] |
permissive
|
RaquelFigueroa/newTwitterApp
|
5ecdf65b8586686d98b30977e4f53b5939e08b2b
|
f8bcf6bfae4475f7d32939ab06295b0f7d00e735
|
refs/heads/master
| 2020-04-10T23:48:02.401458 | 2018-03-10T22:38:46 | 2018-03-10T22:38:46 | 124,302,704 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,219 |
swift
|
//
// ProfileViewController.swift
// twitter_alamofire_demo
//
// Created by Raquel Figueroa-Opperman on 3/10/18.
// Copyright © 2018 Charles Hieger. All rights reserved.
//
import UIKit
class ProfileViewController: UIViewController {
@IBOutlet weak var userImage: UIImageView!
@IBOutlet weak var userName: UILabel!
@IBOutlet weak var userHandle: UILabel!
@IBOutlet weak var numTweets: UILabel!
@IBOutlet weak var numFollowing: UILabel!
@IBOutlet weak var numFollowers: UILabel!
@IBOutlet weak var profileTagline: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
userImage.af_setImage(withURL: (User.current?.image)!)
userName.text = User.current?.name
userHandle.text = User.current?.screenName
numTweets.text = String(describing: User.current!.tweets!)
numFollowers.text = String(describing: User.current!.followers!)
numFollowing.text = String(describing: User.current!.following!)
profileTagline.text = User.current?.tagline
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
|
[
-1
] |
6a217f77c81068f6f9d13971ebd0935a4a99638b
|
a004c7bcc00563928865fa6794f30444d6855002
|
/Procyon/Pixiv/Pixiv/Pixiv_UI/PixivUgoiraView.swift
|
06667eb239c4326ec1f543ccc73e3a482cad77dd
|
[] |
no_license
|
ObuchiYuki/Procyon
|
5c4aad57b20efad3e3f7393629d8b7822896e4b9
|
2d4a3d2aa708b647d7bc61189248f2790a69fe56
|
refs/heads/master
| 2020-08-27T01:43:03.959330 | 2019-10-24T04:05:44 | 2019-10-24T04:05:44 | 217,208,391 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 518 |
swift
|
import UIKit
class PixivUgoiraView: RMView {
let label = RMLabel()
override func setup(){
super.setup()
self.backgroundColor = UIColor(white: 0, alpha: 0.6)
self.size = Size(20, 20)
self.noCorner()
label.textColor = UIColor.white
label.size = self.size
label.center = self.center
label.text = "play_arrow"
label.textAlignment = .center
label.font = Font.MaterialIcons.font(13)
addSubview(label)
}
}
|
[
-1
] |
771b84851f9e2a81d57bf8cd23b1051d96691ab5
|
c1e11793048f4b709d9c73dc79919e0d8f139528
|
/viewFinder/PhotoDetailViewController.swift
|
815a90df51c8c55b04ad07029097ea03099cc5ae
|
[] |
no_license
|
sydneyJ17/viewFinder2
|
28fbdc77c9ecb4efeb60b46267c6b548acb48450
|
73c20ea4dfb798e891b715bb45df2ccf48f69d9c
|
refs/heads/master
| 2020-06-20T21:13:02.483542 | 2019-07-16T19:01:35 | 2019-07-16T19:01:35 | 197,251,682 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 723 |
swift
|
//
// PhotoDetailViewController.swift
// viewFinder
//
// Created by Apple on 7/16/19.
// Copyright © 2019 Apple. All rights reserved.
//
import UIKit
class PhotoDetailViewController: UIViewController {
@IBOutlet weak var detailImage: UIImageView!
var photo : Photos? = nil
override func viewDidLoad() {
super.viewDidLoad()
if let realPhoto = photo {
title = realPhoto.caption
if let cellPhotoImageData = realPhoto.imageData {
if let cellPhotoImage = UIImage(data: cellPhotoImageData) {
detailImage.image = cellPhotoImage
}
}
}
}
}
|
[
-1
] |
bf44b24c5c769b777d1cdff850f3e725446e66a5
|
eb45a257e6246e00fb5b3b845d1d205e3fde57b6
|
/SwiftMaps/ViewController.swift
|
63643dda18fe5891337660b18bc1c52e0c3e0643
|
[
"Apache-2.0"
] |
permissive
|
BigGGG/swift-google-map
|
7a2947c7987a0dffff6f539a1d477a057d014085
|
214e8a8cf0c6b12ed03e4319209c7337074c2df5
|
refs/heads/master
| 2021-01-24T20:02:54.909950 | 2015-09-17T06:28:05 | 2015-09-17T06:28:05 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 263 |
swift
|
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let mapView = self.view as! GMSMapView
mapView.camera = GMSCameraPosition.cameraWithLatitude(-33.8600, longitude: 151.2094, zoom: 10)
}
}
|
[
-1
] |
37aef9353b8b17ecef5f3a665eef48f3a3694300
|
d2b9d66baf37d1443f79083868c826253ece2c4f
|
/QRCodeScan/CreatQRcodeViewController.swift
|
4a8d906acc6aae1c13c3418bd8b3f1a542c09e0a
|
[] |
no_license
|
sandsn123/LSQRCodeScan
|
8ba03e400cd45d8c658cb51baeec96ec1d0b7226
|
9a44d4872f17074948500fa1de5374b18c3f6ec5
|
refs/heads/master
| 2023-06-13T02:05:52.200991 | 2021-06-29T04:34:15 | 2021-06-29T04:34:15 | 181,387,772 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 3,905 |
swift
|
//
// CreatQRcodeViewController.swift
// QRCodeScan
//
// Created by sai on 2019/4/9.
// Copyright © 2019 sai. All rights reserved.
//
import UIKit
import Photos
import QRCodeScanTool
import RSKImageCropper
class CreatQRcodeViewController: UIViewController {
@IBOutlet weak var contentTextView: UITextField!
@IBOutlet weak var qrcodeImageView: UIImageView!
private lazy var photoLibraryVC: UIImagePickerController = {
let libraryVC = UIImagePickerController()
libraryVC.sourceType = .photoLibrary
libraryVC.delegate = self
libraryVC.allowsEditing = false
return libraryVC
}()
override func viewDidLoad() {
super.viewDidLoad()
self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: "相册", style: .plain, target: self, action: #selector(openAlbum))
}
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
self.view.endEditing(true)
}
@IBAction func creatQRcode(_ sender: UIButton) {
guard let codeString = contentTextView.text, !codeString.isEmpty else {
return
}
let image = UIImage.generateQRCode(codeString, qrcodeImageView.frame.size.width)
qrcodeImageView.image = image
}
}
// 监听item点击
private extension CreatQRcodeViewController {
@objc func openAlbum() {
if UIImagePickerController.isSourceTypeAvailable(.photoLibrary) {
switch PHPhotoLibrary.authorizationStatus() {
case .authorized: // 允许
self.present(self.photoLibraryVC, animated: true, completion: nil)
case .notDetermined: // 不确定
PHPhotoLibrary.requestAuthorization { [weak self] (state) in
guard let self = self else { return }
self.present(self.photoLibraryVC, animated: true, completion: nil)
}
case .restricted: // 访问受限
()
case .denied: // 拒绝访问
let alertVC = UIAlertController(title: "访问失败", message: "当前设备不能访问相册", preferredStyle: .alert)
self.present(alertVC, animated: true, completion: nil)
@unknown default:
()
}
}
}
}
// MARK: UIImagePickerControllerDelegate
extension CreatQRcodeViewController: UIImagePickerControllerDelegate, UINavigationControllerDelegate {
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {
if let image = info[UIImagePickerControllerOriginalImage] as? UIImage {
let viewController = RSKImageCropViewController(image: image, cropMode: .square)
viewController.delegate = self
viewController.alwaysBounceHorizontal = true
viewController.alwaysBounceVertical = true
self.navigationController?.pushViewController(viewController, animated: true)
picker.dismiss(animated: false, completion: nil)
} else {
picker.dismiss(animated: true, completion: nil)
}
}
func imagePickerControllerDidCancel(_ picker: UIImagePickerController) {
picker.dismiss(animated: true, completion: nil)
}
}
// MARK: - RSKImageCropViewControllerDelegate
extension CreatQRcodeViewController: RSKImageCropViewControllerDelegate {
func imageCropViewController(_ controller: RSKImageCropViewController, didCropImage croppedImage: UIImage, usingCropRect cropRect: CGRect, rotationAngle: CGFloat) {
controller.navigationController?.popViewController(animated: true)
self.qrcodeImageView.image = croppedImage
}
func imageCropViewControllerDidCancelCrop(_ controller: RSKImageCropViewController) {
controller.navigationController?.popViewController(animated: true)
}
}
|
[
-1
] |
6686831fe5c0c98b7b176535a49fe0085def75d7
|
9a03584869ab7121ab434fdd0a63b01d58bb4a17
|
/Snapchat Camera/ImagePickerViewController.swift
|
bdac3537e1bd469b8524d0c4a080d3069d811e60
|
[] |
no_license
|
danielphiri/ios-decal-lab5
|
3dbd408c7948c3c569acf303eb75d011b07dacb7
|
0f7b333d824e59790f8cd0f40b0b4e29419a1185
|
refs/heads/master
| 2021-01-22T19:55:08.976290 | 2017-03-20T04:23:04 | 2017-03-20T04:23:04 | 85,262,475 | 0 | 0 | null | 2017-03-17T02:31:06 | 2017-03-17T02:31:06 | null |
UTF-8
|
Swift
| false | false | 9,533 |
swift
|
//
// ImagePickerViewController.swift
// Snapchat Camera Lab
//
// Created by Paige Plander on 3/11/17.
// Copyright © 2017 org.iosdecal. All rights reserved.
//
// TODO: you'll need to import a library here
import AVFoundation
import UIKit
// TODO: you'll need to edit this line to make your class conform to the AVCapturePhotoCaptureDelegate protocol
class ImagePickerViewController: UIViewController, AVCapturePhotoCaptureDelegate {
@IBOutlet weak var imageViewOverlay: UIImageView!
@IBOutlet weak var flipCameraButton: UIButton!
@IBOutlet weak var takePhotoButton: UIButton!
@IBOutlet weak var sendImageButton: UIButton!
@IBOutlet weak var cancelButton: UIButton!
// manages real time capture activity from input devices to create output media (photo/video)
let captureSession = AVCaptureSession()
// the device we are capturing media from (i.e. front camera of an iPhone 7)
var captureDevice : AVCaptureDevice?
// view that will let us preview what is being captured from the captureSession
var previewLayer : AVCaptureVideoPreviewLayer?
// Object used to capture a single photo from our capture device
let photoOutput = AVCapturePhotoOutput()
var deviceInput: AVCaptureInput?
// The image to send as a Snap
var selectedImage = UIImage()
//let sets = AVCapturePhotoSettings()
var photoSettings = AVCapturePhotoSettings()
// TODO: add your instance methods for photo taking here
override func viewDidLoad() {
super.viewDidLoad()
// TODO: call captureNewSession here
captureNewSession(devicePostion: nil)
toggleUI(isInPreviewMode: false)
}
override func viewWillAppear(_ animated: Bool) {
// hide the navigation bar while we are in this view
navigationController?.navigationBar.isHidden = true
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
func selectImage(_ image: UIImage) {
//The image being selected is passed in as "image".
selectedImage = image
}
@IBAction func takePhoto(_ sender: UIButton) {
// TODO: Replace the following code as per instructions in the spec.
// Instead of sending a squirrel pic every time, here we will want
// to start the process of creating a photo from our photoOutput
// if let squirrelImage = UIImage(named: "squirrel") {
// selectedImage = squirrelImage
// toggleUI(isInPreviewMode: true)
// }
//photoSettings.use
photoSettings = AVCapturePhotoSettings()
photoOutput.capturePhoto(with: photoSettings, delegate: self)
}
/// If the front camera is being used, switches to the back camera,
/// and vice versa
///
/// - Parameter sender: The flip camera button in the top left of the view
@IBAction func flipCamera(_ sender: UIButton) {
// TODO: allow user to switch between front and back camera
// you will need to create a new session using 'captureNewSession'
}
/// Toggles the UI depending on whether or not the user is
/// viewing a photo they took, or is currently taking a photo.
///
/// - Parameter isInPreviewMode: true if they just took a photo (and are viewing it)
func toggleUI(isInPreviewMode: Bool) {
if isInPreviewMode {
imageViewOverlay.image = selectedImage
takePhotoButton.isHidden = true
sendImageButton.isHidden = false
cancelButton.isHidden = false
flipCameraButton.isHidden = true
}
else {
takePhotoButton.isHidden = false
sendImageButton.isHidden = true
cancelButton.isHidden = true
imageViewOverlay.image = nil
flipCameraButton.isHidden = false
}
// Makes sure that all of the buttons appear in front of the previewLayer
view.bringSubview(toFront: imageViewOverlay)
view.bringSubview(toFront: sendImageButton)
view.bringSubview(toFront: takePhotoButton)
view.bringSubview(toFront: flipCameraButton)
view.bringSubview(toFront: cancelButton)
}
@IBAction func cancelButtonWasPressed(_ sender: UIButton) {
selectedImage = UIImage()
toggleUI(isInPreviewMode: false)
}
@IBAction func sendImage(_ sender: UIButton) {
performSegue(withIdentifier: "imagePickerToChooseThread", sender: nil)
}
// Called when we unwind from the ChooseThreadViewController
@IBAction func unwindToImagePicker(segue: UIStoryboardSegue) {
toggleUI(isInPreviewMode: false)
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
navigationController?.navigationBar.isHidden = false
let destination = segue.destination as! ChooseThreadViewController
destination.chosenImage = selectedImage
toggleUI(isInPreviewMode: false)
}
/// Creates a new capture session, and starts updating it using the user's
/// input device
///
/// - Parameter devicePostion: location of user's camera - you'll need to figure out how to use this
func captureNewSession(devicePostion: AVCaptureDevicePosition?) {
// specifies that we want high quality video captured from the device
captureSession.sessionPreset = AVCaptureSessionPresetHigh
if let deviceDiscoverySession = AVCaptureDeviceDiscoverySession(deviceTypes: [AVCaptureDeviceType.builtInWideAngleCamera],
mediaType: AVMediaTypeVideo, position: AVCaptureDevicePosition.unspecified) {
// Iterate through available devices until we find one that works
for device in deviceDiscoverySession.devices {
// only use device if it supports video
if (device.hasMediaType(AVMediaTypeVideo)) {
if (device.position == AVCaptureDevicePosition.front) {
captureDevice = device
if captureDevice != nil {
// Now we can begin capturing the session using the user's device!
do {
// TODO: uncomment this line, and add a parameter to `addInput`
// deviceInput.ports.append(contentsOf: captureDevice)
// let pots = [captureDevice]
// deviceInput = captureDevice
try captureSession.addInput(AVCaptureDeviceInput(device: captureDevice))
if captureSession.canAddOutput(photoOutput) {
captureSession.addOutput(photoOutput)
}
}
catch {
print(error.localizedDescription)
}
if let previewLayer = AVCaptureVideoPreviewLayer(session: captureSession) { /* TODO: replace this line by creating preview layer from session */
view.layer.addSublayer(previewLayer)
previewLayer.frame = view.layer.frame
previewLayer.accessibilityActivate()
//previewLayer.session.startRunning()
// TODO: start running your session
captureSession.startRunning()
}
}
}
}
}
}
}
/// Provides the delegate a captured image in a processed format (such as JPEG).
func capture(_ captureOutput: AVCapturePhotoOutput, didFinishProcessingPhotoSampleBuffer photoSampleBuffer: CMSampleBuffer?, previewPhotoSampleBuffer: CMSampleBuffer?, resolvedSettings: AVCaptureResolvedPhotoSettings, bracketSettings: AVCaptureBracketedStillImageSettings?, error: Error?) {
if let photoSampleBuffer = photoSampleBuffer {
// First, get the photo data using the parameters above
let photoData = AVCapturePhotoOutput.jpegPhotoDataRepresentation(forJPEGSampleBuffer: photoSampleBuffer, previewPhotoSampleBuffer: previewPhotoSampleBuffer)
// Then use this data to create a UIImage, and set it equal to `selectedImage`
selectedImage = UIImage.init(data: photoData!)!
// This method updates the UI so the send button appears (no need to edit it)
toggleUI(isInPreviewMode: true)
}
}
// public func capturePhoto(_ blockCompletion: @escaping blockCompletionCapturePhoto) {
// let uniqueSettings = AVCapturePhotoSettings.init(from: self.capturePhotoSettings)
// self.cameraOutput.capturePhoto(settings: uniqueSettings, blockCompletion)
// }
}
|
[
-1
] |
92e85424e66520e6f9224191cf12fe2990fa2c26
|
b4279cd7596ae2fe7513de26ffa8a9c5a64b75de
|
/Recipe-CICCC/Controller/DiscoveryViewController.swift
|
8167c45d68245991e153973d6855e66f9a844ca9
|
[] |
no_license
|
ligang0817/Recipe-CICCC
|
d58dca97a34c0006f9dfcbcd8bab1d2a870c762c
|
ec8ebee75dfa904bc51be683b6f57fe028ec779c
|
refs/heads/master
| 2020-12-14T07:07:43.606820 | 2020-03-03T04:30:43 | 2020-03-03T04:30:43 | 234,675,888 | 0 | 0 | null | 2020-01-18T03:29:33 | 2020-01-18T03:29:32 | null |
UTF-8
|
Swift
| false | false | 8,961 |
swift
|
//
// DiscoveryViewController.swift
// RecipeDiscovery
//
// Created by fangyilai on 2019-10-24.
// Copyright © 2019 fangyilai. All rights reserved.
//
import UIKit
import Firebase
import FirebaseAuth
class DiscoveryViewController: UIViewController {
@IBOutlet weak var MonthlyContainerView: UIView!
@IBOutlet weak var PopularContainerView: UIView!
@IBOutlet weak var SubscribedContainerView: UIView!
@IBOutlet weak var IngredientsContainerView: UIView!
@IBOutlet weak var EditorContainerView: UIView!
@IBOutlet weak var VIPContainerVIew: UIView!
@IBOutlet weak var MenuCollectionVIew: UICollectionView!
@IBAction func SideMenuTapped(){
print("Toggle side Menu")
NotificationCenter.default.post(name: NSNotification.Name("ToggleSideMenu"), object: nil)
}
@IBOutlet weak var SideMenuConstraint: NSLayoutConstraint!
@IBAction func SearchBarItem() {
print("Tab search Button")
NotificationCenter.default.post(name: NSNotification.Name("ShowSearch"), object: nil)
}
@IBAction func AddNewRecipe(_ sender: Any) {
print("Tab Add Button")
NotificationCenter.default.post(name: NSNotification.Name("AddRecipe"), object: nil)
}
var arrayMenu = [String]()
var sideMenuOpen = false
override func viewDidLoad() {
super.viewDidLoad()
self.title = "Discovery"
self.navigationController?.navigationBar.titleTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor.orange ]
CreateMenuLabel()
let width = (MenuCollectionVIew.frame.size.width - 5) / 2
let layout = MenuCollectionVIew.collectionViewLayout as! UICollectionViewFlowLayout
layout.itemSize = CGSize(width: width, height: width)
initialContentView()
EditorContainerView.isHidden = false
NotificationCenter.default.addObserver(self, selector: #selector(toggleSideMenu), name: NSNotification.Name("ToggleSideMenu"), object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(showSearch), name: NSNotification.Name("ShowSearch"), object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(showProfile), name: NSNotification.Name("ShowProfile"), object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(AddRecipe), name: NSNotification.Name("AddRecipe"), object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(showSetting), name: NSNotification.Name("ShowSetting"), object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(showContact), name: NSNotification.Name("ShowContact"), object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(showAbout), name: NSNotification.Name("ShowAbout"), object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(showLogout), name: NSNotification.Name("ShowLogout"), object: nil)
}
func initialContentView(){
self.SubscribedContainerView.isHidden = true
self.MonthlyContainerView.isHidden = true
self.PopularContainerView.isHidden = true
self.IngredientsContainerView.isHidden = true
self.EditorContainerView.isHidden = true
self.VIPContainerVIew.isHidden = true
}
func CreateMenuLabel() {
let label1 = "Subscribed Creator"
let label2 = "Your Ingredients Recipe"
let label3 = "Most Popular"
let label4 = "Editor Choice"
let label5 = "Monthly Choice"
let label6 = "VIP Only"
arrayMenu.append(label1)
arrayMenu.append(label2)
arrayMenu.append(label3)
arrayMenu.append(label4)
arrayMenu.append(label5)
arrayMenu.append(label6)
}
@objc func toggleSideMenu() {
if sideMenuOpen{
sideMenuOpen = false
SideMenuConstraint.constant = -160
}else{
sideMenuOpen = true
SideMenuConstraint.constant = 0
}
UIView.animate(withDuration: 0.3) {
self.view.layoutIfNeeded()
}
}
@objc func showProfile(){
print("show Profile")
performSegue(withIdentifier: "userProfile", sender: nil)
}
@objc func showSearch(){
print("show Search")
performSegue(withIdentifier: "searchPage", sender: nil)
}
@objc func AddRecipe(){
print("Add Recipe")
performSegue(withIdentifier: "addRecipe", sender: nil)
}
@objc func showSetting(){
print("show Setting")
performSegue(withIdentifier: "setting", sender: nil)
}
@objc func showContact(){
print("show Contact")
performSegue(withIdentifier: "contact", sender: nil)
}
@objc func showAbout(){
print("show About")
performSegue(withIdentifier: "about", sender: nil)
}
@objc func showLogout(){
print("show Logout")
if Auth.auth().currentUser != nil{
do{
try Auth.auth().signOut()
let vc = UIStoryboard(name: "Login", bundle: nil).instantiateViewController(withIdentifier: "loginPage")
navigationController?.pushViewController(vc, animated: true)
}catch let error as NSError{
print(error.localizedDescription)
}
}
// let loginStoryboard: UIStoryboard = UIStoryboard(name: "Login", bundle: nil)
// if let vc = loginStoryboard.instantiateViewController(withIdentifier: "LoginMain") as? LoginMainpageViewController {
// self.navigationController?.pushViewController(vc, animated: true)
// }
}
}
extension DiscoveryViewController: UICollectionViewDelegate, UICollectionViewDataSource{
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return arrayMenu.count
}
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = MenuCollectionVIew.dequeueReusableCell(withReuseIdentifier: "MenuCell", for: indexPath) as! MenuCollectionViewCell
cell.MenuLabel.text = arrayMenu[indexPath.row]
return cell
}
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
// 0 = "Subscribed Creator"
// 1 = "Your Ingredients Recipe"
// 2 = "Most Popular"
// 3 = "Editor Choice"
// 4 = "Monthly Choice"
// 5 = "VIP Only"
switch indexPath.row{
case 0:
UIView.animate(withDuration: 0.5, animations: {
self.initialContentView()
self.SubscribedContainerView.isHidden = false
})
case 1:
UIView.animate(withDuration: 0.5, animations: {
self.initialContentView()
self.IngredientsContainerView.isHidden = false
})
case 2:
UIView.animate(withDuration: 0.5, animations: {
self.initialContentView()
self.PopularContainerView.isHidden = false
})
case 3:
UIView.animate(withDuration: 0.5, animations: {
self.initialContentView()
self.EditorContainerView.isHidden = false
})
case 4:
UIView.animate(withDuration: 0.7, animations: {
self.initialContentView()
self.MonthlyContainerView.isHidden = false
})
case 5:
UIView.animate(withDuration: 0.5, animations: {
self.initialContentView()
self.VIPContainerVIew.isHidden = false
})
default:
initialContentView()
self.EditorContainerView.isHidden = false
}
return
}
}
class MenuCollectionViewCell: UICollectionViewCell{
@IBOutlet weak var MenuLabel: UILabel!
//test
// override var isSelected: Bool{
// didSet(newValue){
// contentView.backgroundColor = UIColor.brown
// MenuLabel.tintColor = UIColor.white
// }
// }
override func awakeFromNib() {
super.awakeFromNib()
let OriginalView = UIView()
let ChangeView = UIView()
if OriginalView.isEqual(ChangeView){
ChangeView.backgroundColor = #colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)
self.selectedBackgroundView = ChangeView
}else{
ChangeView.backgroundColor = #colorLiteral(red: 0.9998212457, green: 0.9867780805, blue: 0.7689660192, alpha: 1)
self.backgroundView = ChangeView
}
}
}
|
[
-1
] |
bc5dcbbd7cb0e1f293d1dadb02be5318749b7698
|
d5931fa8e177e5854f59eee699d76be234af70f2
|
/Xcode_Tut/SceneDelegate.swift
|
d17b9fc4e302d96298c150346c50320ed2bfd864
|
[] |
no_license
|
Gowthamirepute/CollectionOfCollectionView
|
d18b418b61ac2ef771a4706de9b24a1fae202a25
|
0a68929cc8893aa671a1e5432ebb8421604ad1a2
|
refs/heads/master
| 2021-03-29T12:24:41.446469 | 2020-03-17T11:37:01 | 2020-03-17T11:37:01 | 247,953,579 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,340 |
swift
|
//
// SceneDelegate.swift
// Xcode_Tut
//
// Created by Hxtreme on 17/03/20.
// Copyright © 2020 Hxtreme. All rights reserved.
//
import UIKit
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
guard let _ = (scene as? UIWindowScene) else { return }
}
func sceneDidDisconnect(_ scene: UIScene) {
// Called as the scene is being released by the system.
// This occurs shortly after the scene enters the background, or when its session is discarded.
// Release any resources associated with this scene that can be re-created the next time the scene connects.
// The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead).
}
func sceneDidBecomeActive(_ scene: UIScene) {
// Called when the scene has moved from an inactive state to an active state.
// Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
}
func sceneWillResignActive(_ scene: UIScene) {
// Called when the scene will move from an active state to an inactive state.
// This may occur due to temporary interruptions (ex. an incoming phone call).
}
func sceneWillEnterForeground(_ scene: UIScene) {
// Called as the scene transitions from the background to the foreground.
// Use this method to undo the changes made on entering the background.
}
func sceneDidEnterBackground(_ scene: UIScene) {
// Called as the scene transitions from the foreground to the background.
// Use this method to save data, release shared resources, and store enough scene-specific state information
// to restore the scene back to its current state.
}
}
|
[
393221,
163849,
393228,
393231,
393251,
352294,
344103,
393260,
393269,
213049,
376890,
385082,
16444,
393277,
376906,
327757,
254032,
286804,
368728,
254045,
368736,
180322,
376932,
286833,
286845,
286851,
417925,
262284,
360598,
286880,
286889,
377003,
377013,
164029,
327872,
180418,
377030,
377037,
180432,
377047,
418008,
385243,
418012,
377063,
327915,
205037,
393457,
393461,
393466,
418044,
336124,
385281,
336129,
262405,
180491,
336140,
164107,
262417,
368913,
262423,
377118,
377121,
262437,
254253,
336181,
262455,
393539,
262473,
344404,
213333,
418135,
270687,
262497,
418145,
262501,
213354,
246124,
262508,
262512,
213374,
385420,
262551,
262553,
385441,
385444,
262567,
385452,
262574,
393649,
385460,
262587,
344512,
262593,
336326,
360917,
369119,
328178,
328180,
328183,
328190,
254463,
328193,
98819,
164362,
328207,
410129,
393748,
377372,
188959,
385571,
377384,
197160,
33322,
352822,
270905,
197178,
418364,
188990,
369224,
385610,
270922,
352844,
385617,
352865,
262761,
352875,
344694,
352888,
336513,
377473,
336517,
344710,
385671,
148106,
377485,
352919,
98969,
336549,
344745,
361130,
336556,
385714,
434868,
164535,
336568,
164539,
328379,
328387,
352969,
418508,
385743,
385749,
189154,
369382,
361196,
418555,
344832,
336644,
344837,
344843,
328462,
361231,
394002,
336660,
418581,
418586,
434971,
369436,
262943,
369439,
418591,
418594,
336676,
418600,
418606,
271154,
328498,
369464,
361274,
328516,
336709,
328520,
336712,
361289,
328523,
336715,
361300,
213848,
426842,
361307,
197469,
361310,
254813,
361318,
344936,
361323,
361335,
328574,
369544,
361361,
222129,
345036,
115661,
386004,
345046,
386012,
386019,
386023,
328690,
435188,
328703,
328710,
418822,
377867,
328715,
361490,
386070,
271382,
336922,
345119,
377888,
328747,
214060,
345134,
345139,
361525,
361537,
377931,
197708,
189525,
156762,
402523,
361568,
148580,
345200,
361591,
386168,
361594,
410746,
214150,
345224,
386187,
337048,
345247,
361645,
337072,
345268,
337076,
402615,
361657,
402636,
328925,
165086,
165092,
328933,
222438,
328942,
386286,
386292,
206084,
115973,
328967,
345377,
345380,
353572,
345383,
263464,
337207,
345400,
378170,
369979,
386366,
337224,
337230,
337235,
263509,
353634,
337252,
402792,
345449,
99692,
271731,
378232,
337278,
271746,
181639,
353674,
181644,
361869,
181650,
181655,
230810,
181671,
181674,
181679,
181682,
337330,
181687,
370105,
181691,
181697,
361922,
337350,
181704,
337366,
271841,
329192,
361961,
329195,
116211,
337399,
402943,
337416,
329227,
419341,
419345,
329234,
419351,
345626,
419357,
345631,
419360,
370208,
394787,
419363,
370214,
419369,
394796,
419377,
419386,
206397,
214594,
419401,
353868,
419404,
173648,
419408,
214611,
419412,
403040,
345702,
222831,
370298,
353920,
403073,
403076,
345737,
198282,
403085,
403092,
345750,
419484,
345758,
345763,
419492,
345766,
419498,
419502,
370351,
419507,
337588,
419510,
419513,
403139,
337607,
419528,
419531,
272083,
394967,
419543,
419545,
345819,
419548,
181982,
419551,
345829,
419560,
337643,
419564,
337647,
370416,
141052,
337661,
337671,
362249,
362252,
395022,
362256,
321300,
345888,
116512,
362274,
378664,
354107,
345916,
354112,
247618,
370504,
329545,
345932,
354124,
370510,
247639,
337751,
370520,
313181,
182110,
354143,
354157,
345965,
345968,
345971,
345975,
182136,
403321,
1914,
354173,
395148,
247692,
337809,
247701,
329625,
436127,
436133,
247720,
337834,
362414,
337845,
190393,
247760,
346064,
346069,
329699,
354275,
190440,
247790,
354314,
346140,
337980,
436290,
395340,
378956,
436307,
338005,
329816,
100454,
329833,
329853,
329857,
329868,
411806,
329886,
346273,
362661,
100525,
387250,
379067,
387261,
256193,
395467,
346317,
411862,
256214,
411865,
411869,
411874,
379108,
411877,
387303,
346344,
395496,
338154,
387307,
346350,
338161,
436474,
321787,
379135,
411905,
411917,
43279,
379154,
395539,
387350,
387353,
338201,
182559,
338212,
395567,
248112,
362823,
436556,
321880,
362844,
379234,
354674,
182642,
321911,
420237,
379279,
272787,
354728,
338353,
338363,
338382,
272849,
248279,
256474,
182755,
338404,
338411,
330225,
248309,
199165,
248332,
330254,
199182,
199189,
420377,
330268,
191012,
330320,
199250,
191069,
346722,
248427,
191085,
338544,
191093,
346743,
330384,
346769,
150184,
174775,
248505,
174778,
363198,
223936,
355025,
273109,
264919,
256735,
338661,
338665,
264942,
330479,
363252,
338680,
207620,
264965,
191240,
338701,
256787,
363294,
199455,
396067,
346917,
396070,
215854,
355123,
355141,
355144,
338764,
330581,
330585,
387929,
355167,
265056,
265059,
355176,
355180,
355185,
330612,
330643,
412600,
207809,
379849,
347082,
396246,
330711,
248794,
248799,
347106,
437219,
257009,
265208,
330750,
199681,
338951,
330761,
330769,
330775,
248863,
158759,
396329,
347178,
404526,
396337,
330803,
396340,
339002,
388155,
339010,
347208,
248905,
330827,
330830,
248915,
183384,
339037,
412765,
257121,
322660,
265321,
330869,
248952,
420985,
330886,
330890,
347288,
248986,
44199,
380071,
339118,
249018,
339133,
126148,
322763,
330959,
330966,
265433,
265438,
388320,
363757,
388348,
339199,
396552,
175376,
175397,
208167,
273709,
372016,
437553,
347442,
199989,
175416,
396601,
208189,
437567,
175425,
437571,
437576,
437584,
331089,
437588,
396634,
175451,
437596,
429408,
175458,
208228,
175461,
175464,
265581,
331124,
175478,
249210,
175484,
175487,
249215,
175491,
249219,
249225,
249228,
249235,
175514,
175517,
396703,
396706,
175523,
355749,
396723,
388543,
380353,
216518,
339401,
380364,
339406,
372177,
339414,
249303,
413143,
339418,
339421,
249310,
339425,
249313,
339429,
339435,
249329,
69114,
372229,
339464,
249355,
208399,
380433,
175637,
405017,
134689,
339504,
265779,
421442,
413251,
265796,
265806,
224854,
224858,
339553,
257636,
224871,
372328,
257647,
372338,
339572,
224885,
224888,
224891,
224895,
372354,
126597,
421509,
224905,
11919,
224911,
224914,
126611,
224917,
224920,
126618,
208539,
224923,
224927,
224930,
224933,
257705,
224939,
224943,
257713,
224949,
257717,
257721,
224954,
257725,
224960,
257733,
224966,
224970,
257740,
224976,
257745,
257748,
224982,
257752,
224987,
257762,
224996,
225000,
339696,
225013,
257788,
225021,
339711,
257791,
225027,
257796,
339722,
257802,
257805,
225039,
257808,
249617,
225044,
167701,
372500,
257815,
225049,
257820,
225054,
184096,
397089,
257825,
225059,
339748,
225068,
257837,
413485,
225071,
225074,
257843,
225077,
257846,
225080,
397113,
225083,
397116,
257853,
225088,
225094,
225097,
323404,
257869,
257872,
225105,
339795,
397140,
225109,
225113,
257881,
257884,
257887,
225120,
257891,
413539,
225128,
257897,
225138,
339827,
257909,
225142,
372598,
257914,
257917,
225150,
257922,
380803,
225156,
339845,
257927,
225166,
397201,
225171,
380823,
225176,
225183,
184245,
372698,
372704,
372707,
356336,
380919,
393215,
372739,
405534,
266295,
266298,
217158,
421961,
200786,
356440,
217180,
430181,
266351,
356467,
266365,
192640,
266375,
381069,
225425,
250003,
225430,
250008,
356507,
250012,
225439,
135328,
192674,
225442,
438434,
225445,
438438,
225448,
438441,
225451,
258223,
225456,
430257,
225459,
225462,
225468,
389309,
225472,
372931,
225476,
430275,
389322,
225485,
225488,
225491,
266454,
225494,
225497,
225500,
225503,
225506,
356580,
225511,
217319,
225515,
225519,
381177,
397572,
389381,
356631,
356638,
356641,
356644,
356647,
266537,
389417,
356650,
356656,
332081,
307507,
340276,
356662,
397623,
332091,
225599,
332098,
201030,
348489,
332107,
151884,
430422,
348503,
332118,
250201,
250203,
332130,
250211,
340328,
250217,
348523,
348528,
332153,
356734,
389503,
332158,
438657,
332162,
389507,
348548,
356741,
250239,
332175,
160152,
373146,
373149,
70048,
356783,
266688,
324032,
201158,
340452,
127473,
217590,
340473,
324095,
324100,
324103,
324112,
340501,
324118,
324122,
340512,
332325,
324134,
381483,
356908,
324141,
324143,
356917,
324150,
324156,
168509,
348734,
324161,
324165,
356935,
348745,
381513,
324171,
324174,
324177,
389724,
332381,
373344,
340580,
348777,
381546,
119432,
340628,
184983,
373399,
340639,
258723,
332455,
332460,
389806,
332464,
332473,
381626,
332484,
332487,
332494,
357070,
357074,
332512,
332521,
340724,
332534,
373499,
348926,
389927,
348979,
152371,
398141,
127815,
357202,
389971,
357208,
136024,
389979,
430940,
357212,
357215,
439138,
201580,
201583,
349041,
340850,
201589,
381815,
430967,
324473,
398202,
340859,
324476,
430973,
119675,
324479,
340863,
324482,
324485,
324488,
185226,
381834,
324493,
324496,
324499,
430996,
324502,
324511,
422817,
324514,
201638,
398246,
373672,
324525,
5040,
111539,
324534,
5047,
324539,
324542,
398280,
349129,
340940,
340942,
209874,
340958,
431073,
398307,
340964,
209896,
201712,
209904,
349173,
381947,
201724,
349181,
431100,
431107,
349203,
209944,
209948,
250915,
250917,
169002,
357419,
209966,
209969,
209973,
209976,
209980,
209988,
209991,
431180,
209996,
349268,
177238,
250968,
210011,
373853,
341094,
210026,
210028,
210032,
349296,
210037,
210042,
210045,
349309,
160896,
349313,
152704,
210053,
210056,
349320,
259217,
373905,
210068,
210072,
210078,
210081,
210085,
210089,
210096,
210100,
324792,
210108,
357571,
210116,
210128,
333010,
210132,
333016,
210139,
210144,
218355,
251123,
218361,
275709,
128254,
275713,
242947,
275717,
275723,
333075,
349460,
333079,
251161,
349486,
349492,
415034,
251211,
210261,
365912,
259423,
374113,
251236,
374118,
234867,
390518,
357756,
374161,
112021,
349591,
357793,
333222,
210357,
259516,
415168,
366035,
415187,
366039,
415192,
415194,
415197,
415200,
333285,
415208,
366057,
366064,
415217,
415225,
423424,
415258,
415264,
366118,
415271,
382503,
349739,
144940,
415279,
415282,
415286,
210488,
415291,
415295,
333387,
333396,
333400,
366173,
333415,
423529,
423533,
333423,
210547,
415354,
333440,
267910,
267929,
333472,
333512,
259789,
358100,
366301,
333535,
366308,
366312,
431852,
399086,
366319,
210673,
366322,
399092,
366326,
333566,
268042,
210700,
366349,
210707,
399129,
333593,
333595,
210720,
366384,
358192,
210740,
366388,
358201,
399166,
325441,
366403,
325447,
341831,
341835,
341839,
341844,
415574,
358235,
341852,
350046,
399200,
399208,
268144,
358256,
358260,
399222,
325494,
186233,
333690,
243584,
325505,
333699,
399244,
333709,
333725,
333737,
382891,
382898,
333767,
358348,
333777,
219094,
399318,
358372,
350190,
350194,
333819,
350204,
350207,
325633,
325637,
350214,
268299,
333838,
350225,
350232,
333851,
350238,
350241,
374819,
350245,
350249,
350252,
178221,
350257,
350260,
350272,
243782,
350281,
350286,
374865,
252021,
342134,
374904,
268435,
333989,
333998,
334012,
260299,
350411,
350417,
350423,
211161,
350426,
334047,
350449,
375027,
358645,
350454,
350459,
350462,
350465,
350469,
325895,
268553,
194829,
350477,
268560,
350481,
432406,
350487,
350491,
350494,
325920,
350500,
350505,
358701,
391469,
350510,
358705,
358714,
358717,
383307,
358738,
334162,
383331,
383334,
391531,
383342,
334204,
268669,
194942,
391564,
366991,
334224,
342431,
375209,
326059,
375220,
342453,
334263,
326087,
358857,
195041,
334306,
334312,
104940,
375279,
162289,
350724,
186898,
342546,
350740,
342551,
334359,
342555,
334364,
416294,
350762,
252463,
358962,
334386,
334397,
358973,
252483,
219719,
399957,
244309,
334425,
326240,
375401,
334466,
334469,
162446,
326291,
342680,
342685,
260767,
342711,
244410,
260798,
334530,
260802,
350918,
154318,
342737,
391895,
154329,
416476,
64231,
113389,
342769,
203508,
375541,
342777,
391938,
391949,
375569,
375572,
375575,
375580,
162592,
334633,
326444,
383794,
326452,
326455,
375613,
244542,
260925,
375616,
326468,
244552,
342857,
326474,
326479,
326486,
416599,
342875,
244572,
326494,
326503,
433001,
326508,
400238,
326511,
211826,
211832,
392061,
351102,
252801,
260993,
400260,
211846,
342921,
342931,
252823,
400279,
392092,
400286,
359335,
211885,
400307,
351169,
359362,
351172,
170950,
187335,
326599,
359367,
359383,
359389,
383968,
343018,
359411,
261109,
261112,
244728,
383999,
261130,
261148,
359452,
211999,
261155,
261160,
261166,
359471,
375868,
384099,
384102,
384108,
367724,
326764,
187503,
343155,
384115,
212095,
384136,
384140,
384144,
351382,
384152,
384158,
384161,
351399,
384169,
367795,
244917,
384182,
384189,
384192,
351424,
343232,
244934,
367817,
244938,
384202,
253132,
326858,
343246,
384209,
146644,
351450,
384225,
359650,
343272,
351467,
359660,
384247,
351480,
384250,
351483,
351492,
343307,
384270,
359695,
261391,
253202,
261395,
384276,
384284,
245021,
384290,
253218,
245032,
171304,
384299,
351535,
245042,
326970,
384324,
343366,
212296,
212304,
367966,
343394,
343399,
367981,
343410,
155000,
327035,
245121,
245128,
253321,
155021,
384398,
245137,
245143,
245146,
245149,
343453,
245152,
245155,
155045,
245158,
40358,
245163,
114093,
327090,
343478,
359867,
384444,
146878,
327108,
327112,
384457,
327118,
359887,
359891,
343509,
368093,
155103,
343535,
343540,
368120,
343545,
409092,
359948,
359951,
245295,
359984,
400977,
400982,
179803,
155241,
138865,
155255,
155274,
368289,
245410,
425639,
245415,
425652,
425663,
155328,
245463,
155352,
155356,
212700,
155364,
245477,
155372,
245487,
212723,
245495,
409336,
155394,
155404,
245528,
155423,
360224,
155439,
204592,
155444,
155448,
417596,
384829,
360262,
155463,
155477,
376665,
155484,
261982,
425823,
155488,
376672,
155492,
327532,
261997,
376686,
262000,
262003,
425846,
262006,
147319,
262009,
327542,
262012,
155517,
155523,
155526,
360327,
376715,
155532,
262028,
262031,
262034,
262037,
262040,
262043,
155550,
253854,
262046,
262049,
262052,
327590,
155560,
155563,
155566,
327613,
393152,
311244,
212945,
393170,
155604,
155620,
253924,
155622,
253927,
327655,
360432,
393204,
360439,
253944,
393209,
155647
] |
8cc4bc30f38b744f0d1d1c00a9b783e81cce1803
|
eae6703dfe2f58ee8bdad8be6d4b237ed56c1548
|
/Apps/TCIOKCApp/Final/ChurchApp/TCIOKC/Controller/AudioTableViewController.swift
|
17e49a603b553493a9f90e88308ccaafd4ccef6d
|
[] |
no_license
|
berryxchange/Swift
|
57103f7cae08ee65c7bc075ceffcf5d9c772af78
|
0e8d83bd07effaf8e375a2c1ba553c21b88a8252
|
refs/heads/main
| 2023-03-26T15:07:56.125248 | 2021-03-26T07:13:37 | 2021-03-26T07:13:37 | 331,164,059 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 9,349 |
swift
|
//
// AudioTableViewController.swift
// ChurchAppOne
//
// Created by Quinton Quaye on 11/7/18.
// Copyright © 2018 Transformation Church International. All rights reserved.
//
import UIKit
import AVFoundation
import FirebaseStorage
import FirebaseDatabase
class AudioTableViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
@IBOutlet weak var audioPlayerView: UIView!
@IBOutlet weak var songTableView: UITableView!
@IBOutlet weak var toolbar: UIToolbar!
@IBOutlet weak var rewind: UIBarButtonItem!
@IBOutlet weak var play: UIBarButtonItem!
@IBOutlet weak var pause: UIBarButtonItem!
@IBOutlet weak var currentAudioTime: UILabel!
@IBOutlet weak var totalAudioTime: UILabel!
@IBOutlet weak var audioTimeBar: UIProgressView!
@IBOutlet weak var currentAudioImage: UIImageView!
@IBOutlet weak var currentAudioTitle: UILabel!
@IBOutlet weak var audioPlayerViewBottomConstraint: NSLayoutConstraint!
var audioFiles: [ChurchAudioTrack] = []
var songPlayer = AVAudioPlayer()
var hasBeenPaused = false
var isPlaying = false
override func viewDidLoad() {
super.viewDidLoad()
currentAudioImage.layer.masksToBounds = true
audioPlayerViewBottomConstraint.constant = -130
totalAudioTime.text = "0.00"
currentAudioTime.text = "0.00"
audioTimeBar.progress = 0.0
// download tracks
let audioTrackRef = FIRDatabase.database().reference(withPath: "ChurchAudioFiles")
// for main database
audioTrackRef.observe(.value, with: {snapshot in
//2 new items are an empty array
var newTracks: [ChurchAudioTrack] = []
for track in snapshot.children{
let trackItem = ChurchAudioTrack(snapshot: track as! FIRDataSnapshot)
print(trackItem)
newTracks.insert(trackItem, at: 0)
}
self.audioFiles = newTracks.sorted(by: { $0.trackTitle! < $1.trackTitle! })
self.songTableView.reloadData()
})
//
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return audioFiles.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath) as? AudioListTableViewCell
let thisCell = audioFiles[indexPath.row]
cell?.getAudio(audio: thisCell)
cell?.trackImage.layer.masksToBounds = true
return cell!
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
audioPlayerViewBottomConstraint.constant = 5
// Downloading a song from FB
let audioPath = audioFiles[indexPath.row]
let pathString = "\(audioPath.trackTitle!).mp3" //"SongsPath.mp3"
let storageReference = FIRStorage.storage().reference().child("Audio").child(audioPath.trackTitle!).child("Audio").child(pathString)
let fileUrls = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)
guard let fileUrl = fileUrls.first?.appendingPathComponent(pathString) else {
return
}
let downloadTask = storageReference.write(toFile: fileUrl)
downloadTask.observe(.success) { _ in
do {
self.currentAudioImage.loadImageUsingCacheWithURLString(urlString: audioPath.trackImage!)
self.currentAudioTitle.text = audioPath.trackTitle
self.songPlayer = try AVAudioPlayer(contentsOf: fileUrl)
self.songPlayer.prepareToPlay()
self.songPlayer.play()
let totalDuration: TimeInterval = self.songPlayer.duration
let totalTimeformatter = DateComponentsFormatter()
totalTimeformatter.unitsStyle = .positional
totalTimeformatter.allowedUnits = [ .minute, .second ]
totalTimeformatter.zeroFormattingBehavior = [ .pad ]
let totalFormattedDuration = totalTimeformatter.string(from: totalDuration)
self.totalAudioTime.text = totalFormattedDuration
Timer.scheduledTimer(timeInterval: 1.0, target: self, selector: #selector(self.updateAudioProgressView), userInfo: nil, repeats: true)
self.audioTimeBar.setProgress(Float(self.songPlayer.currentTime/self.songPlayer.duration), animated: false)
} catch let error {
print(error.localizedDescription)
}
}
}
@IBAction func rewind(_ sender: Any) {
if songPlayer.isPlaying || hasBeenPaused{
songPlayer.stop()
songPlayer.currentTime = 0
songPlayer.play()
}else{
songPlayer.play()
}
}
@IBAction func play(_ sender: Any) {
songPlayer.play()
isPlaying = true
let totalDuration: TimeInterval = songPlayer.duration
let totalTimeformatter = DateComponentsFormatter()
totalTimeformatter.unitsStyle = .positional
totalTimeformatter.allowedUnits = [ .minute, .second ]
totalTimeformatter.zeroFormattingBehavior = [ .pad ]
let totalFormattedDuration = totalTimeformatter.string(from: totalDuration)
totalAudioTime.text = totalFormattedDuration
Timer.scheduledTimer(timeInterval: 1.0, target: self, selector: #selector(updateAudioProgressView), userInfo: nil, repeats: true)
audioTimeBar.setProgress(Float(songPlayer.currentTime/songPlayer.duration), animated: false)
}
@objc func updateAudioProgressView(){
if songPlayer.isPlaying{
audioTimeBar.setProgress(Float(songPlayer.currentTime/songPlayer.duration), animated: true)
let duration: TimeInterval = songPlayer.currentTime
let currentTimeformatter = DateComponentsFormatter()
currentTimeformatter.unitsStyle = .positional
currentTimeformatter.allowedUnits = [ .minute, .second ]
currentTimeformatter.zeroFormattingBehavior = [ .pad ]
let formattedDuration = currentTimeformatter.string(from: duration)
currentAudioTime.text = "\(formattedDuration!)"
}
}
@IBAction func pause(_ sender: Any) {
if songPlayer.isPlaying{
songPlayer.pause()
hasBeenPaused = true
}else {
hasBeenPaused = false
}
}
override func viewWillDisappear(_ animated: Bool) {
if isPlaying == true{
if songPlayer.isPlaying{
songPlayer.pause()
hasBeenPaused = true
} else {
}
}
}
/*
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "reuseIdentifier", for: indexPath)
// Configure the cell...
return cell
}
*/
/*
// Override to support conditional editing of the table view.
override func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool {
// Return false if you do not want the specified item to be editable.
return true
}
*/
/*
// Override to support editing the table view.
override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) {
if editingStyle == .delete {
// Delete the row from the data source
tableView.deleteRows(at: [indexPath], with: .fade)
} else if editingStyle == .insert {
// Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
}
}
*/
/*
// Override to support rearranging the table view.
override func tableView(_ tableView: UITableView, moveRowAt fromIndexPath: IndexPath, to: IndexPath) {
}
*/
/*
// Override to support conditional rearranging of the table view.
override func tableView(_ tableView: UITableView, canMoveRowAt indexPath: IndexPath) -> Bool {
// Return false if you do not want the item to be re-orderable.
return true
}
*/
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destinationViewController.
// Pass the selected object to the new view controller.
}
*/
}
|
[
-1
] |
f9d9ee557f62dfbf746c232a854c1c217dccb625
|
e5303ecdf1da33249614dd1a96dc275786410188
|
/UPort/Third Party/Bivrost/Protocols/StaticType.swift
|
f8759f800b337b98d63811fdc8c61f0d16d2080c
|
[
"Apache-2.0"
] |
permissive
|
uport-project/uport-ios-sdk
|
205e7fc37cc61b01d8522e815b5b161a0b948188
|
63cb2af54f8c4b36edacea968138bac768eb3976
|
refs/heads/develop
| 2021-04-09T10:52:15.043632 | 2021-02-01T14:37:51 | 2021-02-01T14:37:51 | 125,446,970 | 9 | 5 |
Apache-2.0
| 2019-09-17T17:44:42 | 2018-03-16T01:28:07 |
Swift
|
UTF-8
|
Swift
| false | false | 405 |
swift
|
//
// StaticType.swift
// BivrostHelper
//
// Created by Luis Reisewitz on 10.10.17.
// Copyright © 2017 Gnosis. All rights reserved.
//
/// To be used as a marker protocol as to not always have to add the `isDynamic` var.
/// Can only be used if the type is always static.
protocol StaticType: SolidityCodable {}
extension StaticType {
static var isDynamic: Bool {
return false
}
}
|
[
-1
] |
2ce3732697ac0974a4c5bd67cd9ea2ae86ff28f5
|
5b28e56a0aba5eca0922ad86da81b0a0ac517b59
|
/HomeFurniture/HouseFurniture/FurnitureDetailViewController.swift
|
26fcae9f6bedee27befb3e98320a724da1403354
|
[] |
no_license
|
konotori/ios-app-development
|
1919e53db7a6ff3e255ff1dd2bdaaaab1d573f2b
|
b41111f4a5f0e71bf16863fbdbb21ab2713c38c6
|
refs/heads/master
| 2022-03-22T03:36:56.368818 | 2019-12-12T07:32:30 | 2019-12-12T07:32:30 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 3,458 |
swift
|
import UIKit
class FurnitureDetailViewController: UIViewController, UINavigationControllerDelegate, UIImagePickerControllerDelegate {
var furniture: Furniture?
@IBOutlet weak var choosePhotoButton: UIButton!
@IBOutlet weak var furnitureTitleLabel: UILabel!
@IBOutlet weak var furnitureDescriptionLabel: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
updateView()
}
func updateView() {
guard let furniture = furniture else { return }
if let imageData = furniture.imageData,
let image = UIImage(data: imageData) {
choosePhotoButton.setTitle("", for: .normal)
choosePhotoButton.setImage(image.withRenderingMode(.alwaysOriginal), for: .normal)
} else {
choosePhotoButton.setTitle("Choose Image", for: .normal)
choosePhotoButton.setImage(nil, for: .normal)
}
furnitureTitleLabel.text = furniture.name
furnitureDescriptionLabel.text = furniture.description
}
@IBAction func choosePhotoButtonTapped(_ sender: Any) {
let imagePicker = UIImagePickerController()
imagePicker.delegate = self
let alertController = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet)
let cancelAction = UIAlertAction(title: "Cancel", style: .cancel, handler: nil)
alertController.addAction(cancelAction)
if UIImagePickerController.isSourceTypeAvailable(.camera) {
let cameraAction = UIAlertAction(title: "Camera", style: .default, handler: { (_) in
imagePicker.sourceType = .camera
self.present(imagePicker, animated: true, completion: nil)
})
alertController.addAction(cameraAction)
}
if UIImagePickerController.isSourceTypeAvailable(.photoLibrary) {
let photoLibraryAction = UIAlertAction(title: "Photo Library", style: .default, handler: { (_) in
imagePicker.sourceType = .photoLibrary
self.present(imagePicker, animated: true, completion: nil)
})
alertController.addAction(photoLibraryAction)
}
present(alertController, animated: true, completion: nil)
}
@IBAction func actionButtonTapped(_ sender: Any) {
guard let furniture = furniture else { return }
var activityItems: [Any] = [furniture.description]
if let imageData = furniture.imageData,
let image = UIImage(data: imageData) {
activityItems.append(image)
}
let activityController = UIActivityViewController(activityItems: activityItems, applicationActivities: nil)
present(activityController, animated: true, completion: nil)
}
// MARK: - UIImagePickerControllerDelegate
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {
if let selectedImage = info[UIImagePickerControllerOriginalImage] as? UIImage {
print("selected")
furniture?.imageData = UIImagePNGRepresentation(selectedImage)
dismiss(animated: true, completion: nil)
updateView()
}
}
func imagePickerControllerDidCancel(_ picker: UIImagePickerController) {
dismiss(animated: true, completion: nil)
}
}
|
[
-1
] |
51de7e51665105022e6b5bc62e9c3487423659fa
|
3d9c0478dec5f80784365e669af13c3b464f3790
|
/MovieTop/Views/Spinner.swift
|
54661c2212ca765046c8b84cbd5887b70453aebc
|
[] |
no_license
|
GenuineMas/MovieTop
|
4fc2163ee549b071770110c4c3b5b9ce46f58fab
|
d541703b1a864ee218dbbae1cfc67ac5149b8d5d
|
refs/heads/master
| 2022-12-07T09:16:09.919340 | 2020-08-24T00:59:22 | 2020-08-24T00:59:22 | 289,217,599 | 1 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 563 |
swift
|
//
// Spinner.swift
// MovieTop
//
// Created by Genuine on 21.08.2020.
// Copyright © 2020 Genuine. All rights reserved.
//
import SwiftUI
import UIKit
struct Spinner: UIViewRepresentable {
let style: UIActivityIndicatorView.Style
func makeUIView(context: Context) -> UIActivityIndicatorView {
let spinner = UIActivityIndicatorView(style: style)
spinner.hidesWhenStopped = true
spinner.startAnimating()
return spinner
}
func updateUIView(_ uiView: UIActivityIndicatorView, context: Context) {}
}
|
[
-1
] |
58830a88412d81c5dd5f1218de50aa1b344e7a5f
|
e5f886aefd0a00331188f36c9eb3b5257c7f0eef
|
/UITestExample/UITextField.swift
|
a31a25d4a9c307b55dce11f785659f07ce000e28
|
[] |
no_license
|
federicomazzini/UITestingExample
|
be5686dc9acd7ecde6d426d8d2e5464dea39ca83
|
ed9aab592066abe359e1dbf3756a4bf19bf851ed
|
refs/heads/master
| 2020-12-30T16:46:57.770617 | 2017-05-16T14:14:53 | 2017-05-16T14:14:53 | 91,026,735 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 535 |
swift
|
//
// UITextField.swift
// UITestExample
//
// Created by federico mazzini on 5/5/17.
// Copyright © 2017 Lateral View. All rights reserved.
//
import UIKit
extension UITextField{
@IBInspectable var placeHolderColor: UIColor?
{
get {
return self.placeHolderColor
}
set {
self.attributedPlaceholder = NSAttributedString(string:self.placeholder != nil ? self.placeholder! : "", attributes:[NSForegroundColorAttributeName: newValue!])
}
}
}
|
[
-1
] |
825662e0032e6ab86260e77aecf316005372b8d0
|
539e5eaf64d3b6bab3a929662fb258c22643e607
|
/towalition/towalition/GeoMapOfCarsWithListViewController.swift
|
53afa4288ec2b18811a0454ffb2bff713a6057e9
|
[] |
no_license
|
Nakanz/towalition_iOS
|
a04fcade4a492e88630f3b3f2bd33f2ffb8a366d
|
106cb59487a99b76e64f2146f3cf9cddbda2f5b4
|
refs/heads/main
| 2023-03-22T21:29:35.748903 | 2021-03-19T21:55:56 | 2021-03-19T21:55:56 | 349,564,245 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 4,061 |
swift
|
//
// GeoMapOfCarsWithListViewController.swift
// towalition
//
// Created by Nathan Hester on 3/11/21.
//
import UIKit
import MapKit
var carsNearYouGlobal: [Car] = []
class GeoMapOfCarsWithListViewController: UIViewController {
@IBOutlet private var mapView: MKMapView!
@IBOutlet weak var leadingC: NSLayoutConstraint!
@IBOutlet weak var trailingC: NSLayoutConstraint!
@IBOutlet weak var mainView: UIView!
@IBOutlet weak var viewNearJobsButton: UIButton!
@IBOutlet weak var driverJobs: UILabel!
var closeToDriverJobs: [Car]?
var driver: Driver?
var hamburgerMenuIsVisible = false
// menu functionality
@IBAction func menuPressed(_ sender: Any) {
if !hamburgerMenuIsVisible {
leadingC.constant = 150
trailingC.constant = 150
hamburgerMenuIsVisible = true
} else {
leadingC.constant = 0
trailingC.constant = 0
hamburgerMenuIsVisible = false
}
UIView.animate(withDuration: 0.2, delay: 0.0, options: .curveEaseIn, animations: {
self.view.layoutIfNeeded()
})
}
@IBAction func logOut(_ sender: Any) {
UserDefaults.standard.setLoggedIn(value: false)
}
// unwind for "Profile"
@IBAction func unwind(_ seg: UIStoryboardSegue) {
}
override func viewDidLoad() {
super.viewDidLoad()
var jobs = 0
let dID = UserDefaults.standard.getDriverID()
driver = getDriverById(id: dID)
let latitude = driver!.latitude
let longitude = driver!.longitude
// Set initial location by the driver
let initialLocation = CLLocation(latitude: latitude, longitude: longitude)
mapView.centerToLocation(initialLocation)
let oahuCenter = CLLocation(latitude: 21.4765, longitude: -157.8647)
let region = MKCoordinateRegion(
center: oahuCenter.coordinate,
latitudinalMeters: 50000,
longitudinalMeters: 60000)
mapView.setCameraBoundary(
MKMapView.CameraBoundary(coordinateRegion: region),
animated: true)
let zoomRange = MKMapView.CameraZoomRange(maxCenterCoordinateDistance: 5000)
mapView.setCameraZoomRange(zoomRange, animated: true)
// initialize the array of jobs close to this driver
closeToDriverJobs = carsTemp.filter({(value:Car) -> Bool in return value.district.rawValue == driver!.district.rawValue})
carsNearYouGlobal = carsTemp.filter({(value:Car) -> Bool in return value.district.rawValue == driver!.district.rawValue})
jobs = closeToDriverJobs!.count
viewNearJobsButton.setTitle("VIEW \(jobs) JOBS", for: .normal)
// map annotations for available jobs
for i in 0..<closeToDriverJobs!.count {
let geoAndReasonCarInfo = GeoCar(title: closeToDriverJobs![i].licensePlate, locationName: closeToDriverJobs![i].reason.rawValue, discipline: closeToDriverJobs![i].make.rawValue, coordinate: closeToDriverJobs![i].location)
mapView.addAnnotation(geoAndReasonCarInfo)
}
// add driver annotation
let geoDriver = GeoCar(title: driver!.username, locationName: "You are here", discipline: "Driver", coordinate: CLLocationCoordinate2D(latitude: latitude, longitude: longitude))
mapView.addAnnotation(geoDriver)
driverJobs.text = "Aloha \(driver!.firstname) \(driver!.lastname), there are \(jobs) available jobs with a max ETA of 10 minutes in your vicinity."
}
// MARK: - Navigation
}
// map configuration
private extension MKMapView {
func centerToLocation(
_ location: CLLocation,
regionRadius: CLLocationDistance = 45000
) {
let coordinateRegion = MKCoordinateRegion(
center: location.coordinate,
latitudinalMeters: regionRadius,
longitudinalMeters: regionRadius)
setRegion(coordinateRegion, animated: true)
}
}
|
[
-1
] |
d72deaa4d9c0a8e2364de10a01d8a6bbd60fa9c8
|
97e24fc597fada85c50a6cf6989eaff4814dc58b
|
/LockConfigurationTool/Network/NetworkDiskCache/NetworkMetaDb.swift
|
1aa3f23234aa0c7925d07b31675f3cfc73236561
|
[] |
no_license
|
lforme/LockConfigurationTool
|
df6a587c7b217d9d6e7a54ebf18bde49a5097b9c
|
b16fa677ac60832aae9c0d5d3e6b637048ce115f
|
refs/heads/master
| 2022-10-12T00:21:31.932150 | 2020-06-16T06:34:16 | 2020-06-16T06:34:16 | 267,528,131 | 0 | 1 | null | null | null | null |
UTF-8
|
Swift
| false | false | 6,443 |
swift
|
//
// NetworkMetaDb.swift
// LightSmartLock
//
// Created by mugua on 2019/11/20.
// Copyright © 2019 mugua. All rights reserved.
//
import Foundation
import SQLite
import SwiftDate
final class NetworkMetaDb {
let path: String
var db: Connection?
var table: Table
let id = Expression<Int64>("id")
let key = Expression<String>("key")
let value = Expression<Data>("value")
let accessTime = Expression<Date>("accessTime")
let expirationTime = Expression<Date>("expirationTime")
let userId = Expression<String?>("userId")
private var lock = pthread_rwlock_t()
private let queue = DispatchQueue(label: "com.networkMetaDb.rw", qos: .default, attributes: .concurrent, autoreleaseFrequency: .workItem)
private let kDatabaseName = "cachedb.sqlite3"
private let kTableName = "networkcacheLC"
deinit {
pthread_rwlock_destroy(&lock)
}
init(path: String) {
self.path = path.appending(kDatabaseName)
self.table = Table(kTableName)
initDb()
}
fileprivate func initDb() {
do {
self.db = try Connection(self.path)
print("db path: \(self.path)")
} catch {
print(error.localizedDescription)
}
assert(self.db != nil)
createTable()
}
fileprivate func createTable() {
try! self.checkDb().run(self.table.create(ifNotExists: true) { t in
t.column(id, primaryKey: .autoincrement)
t.column(key, unique: true)
t.column(value)
t.column(accessTime)
t.column(expirationTime)
t.column(userId)
})
}
fileprivate func checkDb() -> Connection {
guard let _db = self.db else {
fatalError("db can not open")
}
return _db
}
}
extension NetworkMetaDb {
func save(_ value: Data, key: String) {
around {
queue.async(flags: .barrier) {[weak self] in
guard let this = self else { return }
do {
var result = false
try this.db?.transaction {
let filterTable = this.table.filter(this.key == key)
if try this.checkDb().run(filterTable.update(
this.key <- key,
this.value <- value,
this.userId <- LCUser.current().token?.userId
)) > 0 {
result = true
print("写入成功: \(result)")
} else {
let rowid = try this.checkDb().run(this.table.insert(
this.key <- key,
this.value <- value,
this.accessTime <- Date(),
this.expirationTime <- Date() + 7.days,
this.userId <- LCUser.current().token?.userId
))
result = (rowid > Int64(0)) ? true : false
print("写入成功: \(result)")
}
}
} catch {
print(error.localizedDescription)
}
}
}
}
@discardableResult
func value(forKey key: String) -> Data? {
around {
var result: Data?
queue.sync {[weak self] in
guard let this = self else { return }
let query = this.table.select(this.table[*])
.filter(this.key == key)
.filter(this.userId == LCUser.current().token?.userId)
.limit(1)
do {
let rows = try this.checkDb().prepare(query)
try this.db?.run(query.update(this.accessTime <- Date()))
if let row = Array(rows).last {
result = row[this.value]
} else {
}
} catch {
print(error.localizedDescription)
}
}
return result
}
}
@discardableResult
func deleteExpiredData() -> Bool {
around {
var result = -1
queue.sync(flags: .barrier) {[weak self] in
guard let this = self else { return }
let expired = this.table.select(this.table[*])
.filter(this.accessTime > this.expirationTime)
do {
result = try this.checkDb().run(expired.delete())
} catch {
print("delete expiredData failed: \(error)")
result = -1
}
}
return result > 0
}
}
@discardableResult
func deleteValueBy(_ userId: String?) -> Bool {
around {
var result = -1
queue.sync(flags: .barrier) {[weak self] in
guard let this = self else { return }
let target = this.table.select(this.table[*])
.filter(this.userId == userId)
do {
result = try this.checkDb().run(target.delete())
} catch {
print("delete failed: \(error)")
result = -1
}
}
return result > 0
}
}
@discardableResult
func deleteAll() -> Bool {
return around {
var result = -1
queue.sync(flags: .barrier) {[weak self] in
guard let this = self else { return }
do {
result = try this.checkDb().run(this.table.delete())
} catch {
print("delete failed: \(error)")
result = -1
}
}
return result > 0
}
}
}
extension NetworkMetaDb {
func around<T>(_ closure: () -> T) -> T {
pthread_rwlock_trywrlock(&lock)
defer { pthread_rwlock_unlock(&lock) }
return closure()
}
}
|
[
-1
] |
c798f7d205926c03850a4257f0defdc6457d99ec
|
97da73c56eebf6daa95be0f65cae37abd4a92095
|
/Sources/LeetCode/21. Merge Two Sorted Lists.swift
|
652519767998272c83186463c10c9f559bb75c62
|
[] |
no_license
|
lugeke/LeetCode
|
89a8181b6a4b0f33a1ffd33fbdd61e689c24cf2e
|
8bee9da18ae109ab85dafe053eb4be1afde12663
|
refs/heads/main
| 2022-12-16T17:24:25.192787 | 2020-09-17T05:22:20 | 2020-09-17T05:22:20 | 286,017,578 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 416 |
swift
|
//
// File.swift
//
//
// Created by lujiaheng on 2020/8/8.
//
import Foundation
func mergeTwoLists(_ l1: ListNode?, _ l2: ListNode?) -> ListNode? {
guard let l1 = l1 else { return l2 }
guard let l2 = l2 else { return l1 }
if l1.val < l2.val {
l1.next = mergeTwoLists(l1.next, l2)
return l1
} else {
l2.next = mergeTwoLists(l1, l2.next)
return l2
}
}
|
[
-1
] |
5b0aafe1481fcc8d62b51d52a6ef0047d9627b72
|
084c005544e479157c9e3ed0ab9c40644294c13f
|
/TakipCL.swift
|
884b30e584b28135e2cc6944ff7c7302a092a781
|
[] |
no_license
|
bmkaraduman/selectmultiimage
|
2a0bf3392d5ba618e38a148d8f85fd6660c7107f
|
93c114eea42146e470f9be165ca4cdfdc5a56f37
|
refs/heads/master
| 2020-03-28T12:59:50.121242 | 2019-09-01T18:14:25 | 2019-09-01T18:14:25 | 148,356,197 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 537 |
swift
|
//
// TakipCL.swift
// FirebaseDemo
//
// Created by macbookpro on 9.01.2019.
// Copyright © 2019 AppCoda. All rights reserved.
//
import Foundation
class Takipci
{
var Adi : String
var Resim : String
var Durum : String
var User_ID : String
var Gizlimi : String
init(adi : String, resim: String, durum: String, userID : String, gizlimi : String) {
self.Adi = adi
self.Resim = resim
self.Durum = durum
self.User_ID = userID
self.Gizlimi = gizlimi
}
}
|
[
-1
] |
e2203776e0a09199f63404fdbfea367e2b2807da
|
04d5ab8cb0af5ffdb80f7ac3c624644b39944d3e
|
/StandardAlgorithms/Unknown.swift
|
74697a76ad6b84b4fafc227ff7f8e7cca0b864dd
|
[] |
no_license
|
anishkochhar16/swift-algorithms
|
13f23b35b14938907cf82e4bcf92d56980148f54
|
d3ace708bfc34cd7f6829470071bde9371f1dc27
|
refs/heads/master
| 2020-09-04T11:35:34.794336 | 2019-12-01T11:20:19 | 2019-12-01T11:20:19 | 219,721,814 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,462 |
swift
|
//
// Unknown.swift
// StandardAlgorithms
//
// Created by Kochhar, Anish (EJNR) on 14/11/2019.
// Copyright © 2019 Kochhar, Anish (EJNR). All rights reserved.
//
import Foundation
class Unknown {
func problemOne (array: [Int]) -> Int {
if array.count == 0 {
return 0
} else if array.count == 1 {
return array[0] * 2
} else {
return (array[0] + array[array.count - 1])
}
}
func problemTwo (array: [Int]) -> Int {
var mode = 0
var biggestChain = 0
var currentChain = 0
for i in 0 ..< array.count - 1 {
if array[i] == array[i + 1] {
currentChain += 1
} else {
if currentChain > biggestChain {
biggestChain = currentChain
mode = array[i]
}
currentChain = 0
}
}
return mode
}
func problemThree (array: [Int]) -> Int? {
if array.count < 2 {
return nil
} else {
var smallest = 100000000000000
var secondSmallest = 100000000000000
for i in 0..<array.count {
if array[i] < smallest {
if secondSmallest > smallest {
secondSmallest = smallest
}
smallest = array[i]
} else if array[i] < secondSmallest {
secondSmallest = array[i]
}
}
return secondSmallest
}
}
func problemFour (array: [Int]) -> Int {
let sorting = Sorting()
let array = sorting.quickSort(array: array)
return problemTwo(array: array)
}
func problemFive (url: String) -> String? {
let domainRegEx = "(?<=.com|.au|.co.uk|.net|.org)"
do {
let regex = try NSRegularExpression(pattern: domainRegEx)
let nsString = url as NSString
let results = regex.matches(in: url, range: NSRange(location: 0, length: nsString.length))
print("Found:",results)
return "hi"
}
catch let error as NSError {
let error = "Invalid RegEx"
return error
}
}
// Could not work out how to use RegEx in XCode
}
|
[
-1
] |
9689a87df55db5a0a2fea97d93f93d5e70bdd558
|
0585913a0f628adab32a4caac042892d44c551e4
|
/pickerView2rowsUITests/pickerView2rowsUITests.swift
|
ea1854142f17153e981c4f222eda65d900c07944
|
[] |
no_license
|
dmorenoar/pickerView2rows
|
868337ff838bc256e76952b0075c7c1cdec79e84
|
88e5325909ef787451d8a63fd162e814ead959a4
|
refs/heads/master
| 2020-04-02T09:50:58.390848 | 2018-10-22T13:51:12 | 2018-10-22T13:51:12 | 154,312,477 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,182 |
swift
|
//
// pickerView2rowsUITests.swift
// pickerView2rowsUITests
//
// Created by dmorenoar on 22/10/18.
// Copyright © 2018 dmorenoar. All rights reserved.
//
import XCTest
class pickerView2rowsUITests: XCTestCase {
override func setUp() {
// Put setup code here. This method is called before the invocation of each test method in the class.
// In UI tests it is usually best to stop immediately when a failure occurs.
continueAfterFailure = false
// 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.
}
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,
344106,
278571,
229425,
180279,
229431,
319543,
352314,
376892,
32829,
286787,
237638,
311373,
196687,
278607,
311377,
368732,
278637,
319599,
278642,
131190,
131199,
278669,
278676,
311447,
327834,
278684,
278690,
311459,
278698,
278703,
278707,
180409,
278713,
295099,
139459,
131270,
229591,
385240,
311520,
319719,
295147,
286957,
262403,
180494,
319764,
278805,
311582,
278817,
311596,
98611,
368949,
278843,
287040,
319812,
311622,
319816,
254285,
344402,
229716,
278895,
287089,
139641,
311679,
311692,
106893,
156069,
254373,
311723,
377265,
319931,
311739,
278974,
336319,
311744,
278979,
278988,
278992,
279000,
369121,
279009,
188899,
279014,
319976,
279017,
311787,
360945,
319986,
279030,
311800,
279042,
287237,
377352,
279053,
303634,
303635,
279061,
254487,
279066,
188954,
279092,
352831,
377419,
303693,
369236,
115287,
189016,
295518,
287327,
279150,
287345,
287348,
344697,
189054,
287359,
303743,
164487,
279176,
311944,
311948,
311950,
311953,
336531,
287379,
180886,
295575,
352921,
303772,
221853,
205469,
279207,
295591,
295598,
279215,
279218,
164532,
287412,
287418,
303802,
66243,
287434,
287438,
164561,
303826,
279253,
230105,
361178,
295653,
369383,
230120,
361194,
312046,
279278,
230133,
279293,
205566,
295688,
312076,
295698,
221980,
262952,
262953,
279337,
262957,
164655,
328495,
303921,
336693,
230198,
222017,
295745,
279379,
295769,
230238,
230239,
435038,
279393,
303973,
279398,
295797,
279418,
287623,
279434,
320394,
189327,
189349,
279465,
140203,
304050,
189373,
213956,
345030,
213961,
279499,
304086,
304104,
123880,
320492,
320495,
287730,
320504,
312313,
214009,
312317,
328701,
328705,
418819,
320520,
230411,
320526,
361487,
238611,
140311,
238617,
197658,
132140,
189487,
345137,
361522,
312372,
238646,
238650,
320571,
336962,
238663,
361547,
205911,
296023,
156763,
361570,
230500,
214116,
214119,
279659,
279666,
312435,
230514,
238706,
279686,
222344,
140426,
337037,
296091,
238764,
148674,
312519,
279752,
148687,
189651,
279766,
189656,
279775,
304352,
304353,
279780,
279789,
279803,
320769,
312588,
320795,
320802,
304422,
353581,
116014,
312628,
345397,
345398,
222523,
181568,
279872,
279874,
304457,
345418,
230730,
337226,
296269,
238928,
296274,
230757,
312688,
296304,
230772,
296328,
296330,
304523,
9618,
279955,
148899,
148900,
279979,
279980,
173492,
279988,
280003,
370122,
280011,
337359,
329168,
312785,
222674,
329170,
280020,
353751,
280025,
239069,
329181,
320997,
280042,
280043,
329198,
337391,
296434,
288248,
288252,
312830,
230922,
329231,
304655,
230933,
222754,
312879,
230960,
288305,
239159,
157246,
288319,
280131,
124486,
288328,
239192,
99937,
345697,
312937,
312941,
206447,
288377,
337533,
280193,
239238,
288391,
239251,
280217,
345753,
198304,
255651,
337590,
280252,
280253,
296636,
321217,
280259,
321220,
296649,
239305,
280266,
9935,
313042,
345813,
280279,
18139,
280285,
321250,
337638,
181992,
345832,
288492,
141037,
34547,
67316,
288508,
288515,
280326,
116491,
280333,
124691,
116502,
321308,
321309,
255781,
280367,
280373,
280377,
321338,
280381,
345918,
280386,
280391,
280396,
337746,
362326,
18263,
345942,
345950,
370526,
362336,
296815,
362351,
313200,
313204,
124795,
182145,
280451,
67464,
305032,
214936,
337816,
124826,
329627,
239515,
214943,
354210,
313257,
288698,
214978,
280517,
280518,
214983,
362442,
346066,
231382,
354268,
329696,
190437,
313322,
337899,
354283,
329707,
296942,
247786,
124912,
313338,
239610,
354312,
313356,
305173,
223269,
354342,
346153,
354346,
313388,
124974,
321589,
215095,
288829,
288835,
313415,
239689,
354386,
329812,
223317,
321632,
280676,
313446,
215144,
288878,
288890,
215165,
329884,
215204,
125108,
280761,
223418,
280767,
280779,
346319,
321744,
280792,
280803,
182503,
338151,
125166,
125170,
313595,
125184,
125192,
125197,
125200,
125204,
272661,
125215,
125216,
125225,
338217,
321839,
125236,
362809,
280903,
289109,
379224,
272730,
215395,
239973,
313703,
280938,
321901,
354671,
354672,
199030,
223611,
248188,
313726,
240003,
158087,
313736,
240020,
190870,
289185,
436644,
305572,
289195,
338359,
289229,
281038,
281039,
256476,
281071,
322057,
182802,
322077,
289328,
330291,
338491,
322119,
281165,
281170,
436831,
281200,
313970,
297600,
346771,
363155,
289435,
314020,
248494,
166581,
314043,
355006,
363212,
158424,
322269,
338658,
289511,
330473,
330476,
289517,
215790,
125683,
199415,
322302,
289534,
322312,
346889,
264971,
322320,
166677,
207639,
281378,
289580,
355129,
281407,
289599,
355136,
355138,
355147,
355148,
355153,
281426,
281434,
322396,
281444,
355173,
355174,
207735,
314240,
158594,
330627,
240517,
355216,
256920,
289691,
240543,
289699,
256934,
289704,
289720,
289723,
330688,
281541,
19398,
191445,
183254,
314343,
183276,
289773,
248815,
347122,
240631,
330759,
330766,
347150,
330789,
248871,
281647,
322609,
314437,
257093,
207954,
314458,
281698,
281699,
257126,
322664,
363643,
314493,
150656,
248960,
347286,
339101,
330912,
339106,
306339,
249003,
208044,
322733,
3243,
339131,
290001,
339167,
298209,
290030,
208123,
322826,
126229,
257323,
298290,
208179,
159033,
216387,
372039,
109899,
224591,
331091,
150868,
314708,
314711,
314721,
281958,
314727,
134504,
306541,
314734,
314740,
314742,
314745,
290170,
224637,
306558,
314752,
306561,
290176,
314759,
388488,
298378,
314765,
314771,
306580,
224662,
282008,
314776,
282013,
290206,
314788,
314790,
282023,
298406,
241067,
314797,
134586,
380350,
306630,
200136,
306634,
339403,
3559,
191980,
282097,
306678,
191991,
290304,
323079,
323083,
208397,
323088,
282132,
282135,
372261,
306730,
290359,
134715,
323132,
282182,
224848,
224852,
290391,
306777,
323171,
282214,
224874,
314997,
290425,
282244,
323208,
282248,
224907,
323226,
282272,
282279,
298664,
298666,
224951,
224952,
306875,
282302,
323262,
323265,
282309,
306891,
241360,
282321,
241366,
224985,
282330,
282336,
12009,
282347,
282349,
323315,
200444,
282366,
175874,
282375,
323335,
282379,
216844,
118549,
282390,
282399,
241440,
282401,
315172,
241447,
282418,
282424,
282428,
413500,
241471,
339782,
315209,
159563,
307024,
307030,
241494,
339799,
307038,
282471,
282476,
339840,
315265,
282503,
315272,
315275,
184207,
282517,
298912,
118693,
298921,
126896,
200628,
282573,
323554,
298987,
282634,
241695,
315431,
315433,
102441,
102446,
282671,
241717,
249912,
307269,
233548,
315468,
176209,
315477,
53334,
200795,
323678,
356446,
315488,
315489,
45154,
217194,
233578,
307306,
249976,
381071,
241809,
323730,
299166,
233635,
299176,
184489,
323761,
184498,
258233,
299197,
299202,
176325,
299208,
233678,
282832,
356575,
356603,
184574,
61720,
315674,
282908,
299294,
282912,
233761,
282920,
315698,
332084,
282938,
168251,
307514,
332100,
323914,
282959,
348499,
348501,
168280,
323934,
332128,
381286,
242027,
242028,
160111,
315768,
315769,
291194,
291193,
291200,
340356,
242059,
315798,
291225,
242079,
299449,
291266,
373196,
283088,
283089,
242138,
176602,
291297,
242150,
283138,
324098,
283154,
291359,
348709,
348710,
283185,
234037,
234044,
332379,
111197,
242274,
176751,
356990,
291455,
152196,
316044,
184974,
316048,
316050,
176810,
299698,
291529,
242385,
299737,
234216,
234233,
242428,
299777,
291591,
291605,
283418,
283431,
234290,
201534,
348999,
283466,
234330,
275294,
127840,
349025,
177002,
308075,
242540,
242542,
201590,
177018,
308093,
291713,
340865,
299912,
349066,
316299,
234382,
308111,
308113,
209820,
283551,
177074,
127945,
340960,
340967,
324587,
201721,
234499,
357380,
234513,
316441,
300087,
21567,
308288,
160834,
349254,
250955,
300109,
234578,
234606,
300145,
300147,
349317,
177297,
324761,
119965,
234655,
300192,
234662,
300200,
373937,
300215,
283846,
283849,
259275,
316628,
259285,
357594,
251124,
234741,
316661,
283894,
292092,
234756,
242955,
177420,
292145,
300342,
333114,
333115,
193858,
300354,
300355,
234830,
259408,
283990,
357720,
300378,
300379,
316764,
292194,
284015,
234864,
316786,
243073,
112019,
234902,
333224,
374189,
284086,
284090,
54719,
415170,
292291,
300488,
300490,
144862,
300526,
259569,
308722,
251379,
210429,
366081,
292359,
218632,
316951,
374297,
349727,
374327,
210489,
235069,
349764,
194118,
292426,
333389,
128589,
333394,
128600,
235096,
300643,
300645,
415334,
243306,
54895,
325246,
333438,
235136,
317102,
300729,
333508,
259780,
333522,
325345,
153318,
333543,
284410,
284425,
300810,
300812,
284430,
161553,
284436,
169751,
325403,
341791,
325411,
186148,
186149,
333609,
284460,
300849,
325444,
153416,
325449,
317268,
325460,
341846,
284508,
300893,
259937,
284515,
276326,
292713,
292719,
325491,
333687,
350072,
317305,
317308,
325508,
333700,
243590,
243592,
350102,
333727,
219046,
333734,
284584,
292783,
300983,
153553,
292835,
6116,
292838,
317416,
325620,
333827,
243720,
292901,
178215,
325675,
243763,
325695,
333902,
194667,
284789,
284790,
292987,
194692,
235661,
153752,
284827,
284840,
284843,
227517,
309443,
227525,
301255,
227536,
301271,
325857,
334049,
317676,
309504,
194832,
227601,
325904,
334104,
211239,
317738,
325930,
227655,
383309,
391521,
366948,
285031,
416103,
227702,
211327,
227721,
285074,
227730,
285083,
293275,
39323,
317851,
285089,
293281,
301482,
342454,
293309,
317889,
326083,
326093,
285152,
195044,
236020,
317949,
342537,
309770,
334345,
342560,
227881,
293420,
236080,
23093,
244279,
244280,
301635,
309831,
55880,
326229,
309847,
375396,
244326,
301688,
244345,
301702,
334473,
326288,
227991,
285348,
318127,
293552,
342705,
285362,
154295,
342714,
342757,
285419,
170735,
359166,
228099,
285443,
285450,
326413,
285457,
285467,
326428,
318247,
293673,
318251,
301872,
285493,
285496,
301883,
342846,
293702,
318279,
244569,
252766,
301919,
293729,
351078,
342888,
310132,
228214,
269179,
211835,
228232,
416649,
236427,
252812,
293780,
310166,
400282,
310177,
359332,
359333,
293801,
326571,
252848,
326580,
326586,
326602,
56270,
252878,
359380,
343020,
203758,
293894,
384015,
293911,
326684,
384031,
113710,
203829,
285795,
253028,
228457,
318571,
187508,
302202,
285819,
285823,
318602,
228492,
162962,
187539,
326803,
359574,
285850,
351389,
253098,
302251,
294069,
367798,
294075,
64699,
228541,
343230,
310496,
228587,
302319,
351475,
228608,
318732,
245018,
318746,
130342,
130344,
130347,
286012,
294210,
359747,
359748,
318804,
294236,
327023,
327030,
310650,
179586,
294278,
368012,
318860,
318876,
245160,
286128,
286133,
310714,
302523,
228796,
302530,
228804,
310725,
310731,
302539,
310735,
327122,
310747,
286176,
187877,
310758,
40439,
253431,
286201,
245249,
228868,
302602,
294413,
359949,
253456,
302613,
302620,
146976,
245291,
425534,
310853,
286281,
196184,
212574,
204386,
204394,
138862,
310896,
294517,
286344,
188049,
229011,
229021,
302751,
245413,
212649,
286387,
286392,
302778,
286400,
319176,
212684,
302798,
286419,
294621,
294629,
286457,
286463,
319232,
360194,
278292,
278294,
294699,
286507,
319289,
237397,
188250,
237411,
327556,
188293,
311183,
294806,
294808,
253851,
319393,
294824,
253868,
343993,
188349,
98240,
294849,
24531,
212953,
360416,
294887,
253930,
278507,
311277,
327666,
278515
] |
aded4d4f6b76f902969b619e8c4de4742101699f
|
66f86e955fc5dbe3c5df40c9676b8bffb47a7a26
|
/GiphyTests/GiphyTests.swift
|
504a912b5061dd90bb053394a82bbacefb6f7186
|
[] |
no_license
|
wh1pch81n/Giphy
|
c2c07ced988295cb1900e19eb61b0e6ec3a29d42
|
4d79a32bf6e063aabc4802b03eb4207e752cc087
|
refs/heads/master
| 2021-01-19T05:01:26.312969 | 2015-06-22T21:37:35 | 2015-06-22T21:37:35 | 37,880,654 | 1 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 893 |
swift
|
//
// GiphyTests.swift
// GiphyTests
//
// Created by Derrick Ho on 5/1/15.
// Copyright (c) 2015 Derrick Ho. All rights reserved.
//
import UIKit
import XCTest
class GiphyTests: 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,
276484,
276489,
276492,
278541,
278550,
305179,
276509,
278558,
307231,
313375,
278561,
102437,
227370,
360491,
276534,
241720,
276543,
159807,
286788,
280649,
276555,
223316,
315476,
223318,
288857,
227417,
278618,
194652,
194653,
278624,
276577,
194656,
309345,
227428,
276581,
276582,
43109,
276585,
223340,
276589,
278638,
227439,
276592,
131189,
227446,
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,
276687,
278742,
278746,
155867,
278753,
196834,
280802,
276709,
276710,
276715,
233715,
157944,
211193,
227576,
168188,
227585,
276737,
276744,
227592,
276748,
276753,
157970,
129301,
276760,
309529,
278810,
276764,
299293,
276774,
282919,
262450,
276787,
276792,
315706,
278846,
164162,
311621,
280902,
278856,
227658,
276813,
278862,
278863,
6481,
6482,
276821,
276822,
6489,
276831,
323935,
276835,
321894,
276839,
416104,
276847,
285040,
278898,
278908,
280961,
178571,
227725,
178578,
190871,
293274,
276891,
61857,
61859,
276900,
278954,
278961,
278965,
276919,
276920,
278969,
293303,
33211,
276925,
278978,
278985,
281037,
278993,
279002,
276958,
287198,
227809,
358882,
276962,
276963,
227813,
279013,
279019,
279022,
281072,
279039,
276998,
287241,
279050,
186893,
279054,
303631,
223767,
277017,
223769,
291358,
277029,
293419,
281138,
277048,
301634,
369220,
238651,
277066,
277083,
295519,
66150,
277094,
166507,
189036,
189037,
277101,
295535,
287346,
189043,
189042,
277111,
279164,
277118,
291454,
184962,
303746,
152203,
225933,
133774,
277133,
225936,
277138,
277141,
277142,
225943,
230040,
164512,
225956,
285353,
225962,
209581,
205487,
285361,
303793,
154291,
277172,
299699,
154294,
277175,
293556,
342706,
277176,
285371,
285372,
277182,
285374,
277190,
199366,
225997,
277198,
226001,
164563,
277204,
203477,
277203,
226004,
279252,
119513,
226007,
203478,
201442,
226019,
279269,
285415,
342762,
277227,
226033,
226035,
226036,
230134,
234234,
226043,
209660,
279294,
234241,
226051,
277254,
209670,
203529,
226058,
234250,
234253,
234256,
285463,
234263,
369432,
234268,
105246,
228129,
234277,
234280,
279336,
289576,
234283,
277289,
277294,
234286,
226097,
234289,
234294,
230199,
234301,
162621,
289598,
277312,
234304,
162626,
281408,
277316,
293693,
234311,
234312,
299849,
234317,
277325,
277327,
293711,
234323,
234326,
277339,
234331,
297822,
234335,
301918,
279392,
297826,
349026,
234340,
174949,
234343,
277354,
234346,
234349,
277360,
234355,
213876,
277366,
234360,
234361,
277370,
279417,
209785,
177019,
234366,
234367,
226170,
158593,
234372,
226181,
213894,
113542,
226184,
234377,
277381,
228234,
226189,
234381,
295824,
226194,
234387,
234386,
234392,
324507,
279456,
234400,
277410,
234404,
226214,
289703,
256937,
234409,
275371,
234412,
236461,
226222,
234419,
226227,
234425,
277435,
234427,
287677,
234430,
226241,
234436,
275397,
234438,
226249,
52172,
234444,
234445,
183248,
275410,
234450,
234451,
234454,
234457,
275418,
234463,
234466,
277479,
277480,
179176,
234472,
234473,
234477,
234482,
287731,
277492,
314355,
234492,
277505,
234498,
234500,
277509,
277510,
234503,
277513,
234506,
230410,
277517,
275469,
277518,
234509,
295953,
197647,
277523,
234517,
230423,
281625,
197657,
281626,
175132,
234530,
234531,
234534,
275495,
234539,
275500,
310317,
277550,
234542,
275505,
275506,
234548,
277563,
234555,
156733,
277566,
230463,
7230,
7229,
207938,
7231,
234560,
234565,
277574,
234569,
277579,
300111,
207953,
277585,
296018,
234577,
296019,
234583,
234584,
275547,
277596,
234594,
277603,
230499,
281700,
300135,
234603,
281707,
275565,
156785,
312434,
275571,
234612,
300151,
234616,
398457,
234622,
300158,
275585,
285828,
302213,
275590,
275591,
234631,
253063,
277640,
302217,
234632,
234642,
226451,
226452,
308372,
275607,
119963,
234652,
234656,
277665,
330913,
306338,
275620,
234659,
234663,
275625,
300201,
208043,
275628,
226476,
226479,
238769,
226481,
277690,
208058,
230588,
277694,
283840,
279747,
279760,
290000,
189652,
203989,
275671,
363744,
195811,
298212,
304356,
285929,
279792,
298228,
204022,
120055,
120056,
234742,
228600,
208124,
204041,
292107,
277792,
339234,
259363,
199971,
304421,
277800,
113962,
277803,
277806,
113966,
226608,
277809,
226609,
277814,
277815,
300343,
277821,
277824,
277825,
226624,
15686,
277831,
226632,
277834,
294218,
177484,
142669,
277838,
222541,
277841,
296273,
222548,
277845,
277844,
314709,
283991,
357719,
277852,
224605,
218462,
224606,
277856,
142689,
230756,
302438,
277862,
163175,
277866,
281962,
173420,
277868,
284014,
277871,
279919,
226675,
277878,
275831,
275832,
181625,
277882,
277883,
142716,
275838,
275839,
277890,
277891,
226694,
275847,
277896,
277897,
281992,
277900,
230799,
318864,
112017,
296338,
277907,
206228,
306579,
277911,
226712,
226711,
277919,
277920,
310692,
277925,
279974,
277927,
282024,
370091,
277936,
277939,
277940,
279989,
296375,
277943,
277946,
277949,
277952,
296387,
415171,
163269,
277957,
296391,
300487,
277962,
282060,
277965,
280013,
312782,
277969,
284116,
277974,
228823,
228824,
277977,
277980,
226781,
277983,
277988,
310757,
316902,
277993,
296425,
277994,
277997,
278002,
278005,
226805,
306677,
278008,
300542,
306693,
153095,
278023,
175625,
192010,
280077,
149007,
65041,
282136,
204313,
278056,
278060,
286254,
228917,
226875,
194110,
128583,
226888,
276040,
366154,
276045,
276046,
286288,
276050,
280147,
300630,
226906,
243292,
147036,
226910,
282213,
317032,
222832,
276085,
276088,
278140,
276092,
188031,
276097,
192131,
276100,
276101,
229001,
310923,
312972,
278160,
282259,
276116,
276117,
276120,
278170,
280220,
276126,
282273,
276129,
282276,
278191,
276146,
278195,
296628,
276148,
198324,
286388,
278201,
276156,
276165,
278214,
323276,
276173,
302797,
276172,
212688,
302802,
276179,
276180,
286423,
216795,
216796,
276195,
153319,
313065,
280300,
419569,
276210,
276211,
276219,
194303,
171776,
288512,
311042,
288516,
278285,
276238,
227091,
184086,
294678,
284442,
278299,
276253,
276257,
278307,
288547,
159533,
276279,
276282,
276283,
276287,
345919,
276294,
282438,
276298,
296779,
216918,
276311,
307031,
276318,
237408,
276325,
227177,
282474,
288619,
276332,
173936,
110452,
276344,
194429,
276350,
227199,
1923,
40853,
44952,
247712,
294823,
276394,
276400,
276401,
276408,
161722,
290746,
276413,
276421,
276422,
276430,
231375,
153552,
153554,
276444,
280541,
153566,
276450,
276451,
276454,
276459,
296941,
276462,
276463,
276468,
276469,
278518,
276475,
276478
] |
42abfbbca33bf9cc1c5b53211cf5d42ff8eb80d8
|
81ad53d6cf0178bb7060d1570a34bce0fce68ed5
|
/bitcorewallet/src/Wallet/WalletCoordinator.swift
|
6e816021aa6eb248d65e6e8f144c582c8bdcdf97
|
[
"MIT"
] |
permissive
|
bitcore-btx/breadwallet-bitcore-ios
|
29bb0412d3fae6b123a369d81676e050364912e3
|
a525be194774657a1a0bc00ff5e4cd0313442210
|
refs/heads/master
| 2021-09-28T16:46:15.362837 | 2018-11-18T16:12:30 | 2018-11-18T16:12:30 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 3,768 |
swift
|
//
// WalletCoordinator.swift
// bitcorewallet
//
// Created by Adrian Corscadden on 2017-01-07.
// Copyright © 2018 Bitcorewallet Team. All rights reserved.
//
import Foundation
import UIKit
//Coordinates the sync state of all wallet managers to
//display the activity indicator and control backtround tasks
class WalletCoordinator : Subscriber, Trackable {
private var backgroundTaskId: UIBackgroundTaskIdentifier?
private var reachability = ReachabilityMonitor()
private var walletManagers: [String: WalletManager]
init(walletManagers: [String: WalletManager]) {
self.walletManagers = walletManagers
addSubscriptions()
}
private func addSubscriptions() {
reachability.didChange = { [weak self] isReachable in
self?.reachabilityDidChange(isReachable: isReachable)
}
//Listen for sync state changes in all wallets
Store.subscribe(self, selector: {
for (key, val) in $0.wallets {
if val.syncState != $1.wallets[key]!.syncState {
return true
}
}
return false
}, callback: { [weak self] state in
self?.syncStateDidChange(state: state)
})
Store.state.currencies.forEach { currency in
Store.subscribe(self, name: .retrySync(currency), callback: { _ in
DispatchQueue.walletQueue.async {
self.walletManagers[currency.code]?.peerManager?.connect()
}
})
Store.subscribe(self, name: .rescan(currency), callback: { _ in
Store.perform(action: WalletChange(currency).setRecommendScan(false))
Store.perform(action: WalletChange(currency).setIsRescanning(true))
DispatchQueue.walletQueue.async {
self.walletManagers[currency.code]?.peerManager?.rescan()
}
})
}
}
private func syncStateDidChange(state: State) {
let allWalletsFinishedSyncing = state.wallets.values.filter { $0.syncState == .success}.count == state.wallets.values.count
if allWalletsFinishedSyncing {
endActivity()
endBackgroundTask()
} else {
startActivity()
startBackgroundTask()
}
}
private func endBackgroundTask() {
if let taskId = backgroundTaskId {
UIApplication.shared.endBackgroundTask(taskId)
backgroundTaskId = nil
}
}
private func startBackgroundTask() {
guard backgroundTaskId == nil else { return }
backgroundTaskId = UIApplication.shared.beginBackgroundTask(expirationHandler: {
DispatchQueue.walletQueue.async {
self.walletManagers.values.forEach {
$0.peerManager?.disconnect()
}
}
})
}
private func reachabilityDidChange(isReachable: Bool) {
if !isReachable {
DispatchQueue.walletQueue.async {
self.walletManagers.values.forEach {
$0.peerManager?.disconnect()
}
DispatchQueue.main.async {
Store.state.currencies.forEach {
Store.perform(action: WalletChange($0).setSyncingState(.connecting))
}
}
}
}
}
private func startActivity() {
UIApplication.shared.isIdleTimerDisabled = true
UIApplication.shared.isNetworkActivityIndicatorVisible = true
}
private func endActivity() {
UIApplication.shared.isIdleTimerDisabled = false
UIApplication.shared.isNetworkActivityIndicatorVisible = false
}
}
|
[
-1
] |
77ad2d8b48c49700293d6ea6b3ef7dc5b3fdc0c9
|
410eba4cd22ee933703a84933aad9ede1d8d525f
|
/RNG Puzzle/LevelParser.swift
|
be933a4b0d257c76393b0688ae0409822dc019c3
|
[] |
no_license
|
dmaulikr/RNG-Puzzle
|
e251aef0a6f2d951d922cabd9fcc71057370e8d1
|
efd57d7192fc536ef776ae85de6c199162bac45e
|
refs/heads/master
| 2021-01-15T22:39:22.551462 | 2017-01-08T23:47:09 | 2017-01-08T23:47:09 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,394 |
swift
|
//
// LevelParser.swift
// AI Puzzle
//
// Created by Jonathan Noyola on 4/8/16.
// Copyright © 2016 iNoyola. All rights reserved.
//
import Foundation
class LevelParser: NSObject {
static func parse(code: String, allowGenerated: Bool = false, allowCustom: Bool = false) -> LevelProtocol? {
var level: LevelProtocol? = nil
let tokens = code.components(separatedBy: ".")
// Check for non-digits
let badCharacters = NSCharacterSet.decimalDigits.inverted
if !tokens[0].isEmpty && tokens[0].rangeOfCharacter(from: badCharacters) == nil {
// Parse level
let levelNum = (tokens[0] as NSString).integerValue
if levelNum > 0 {
// Parse seed
var seed: String? = nil
if tokens.count > 1 && !tokens[1].isEmpty {
seed = tokens[1]
}
if allowGenerated && (seed == nil || seed!.characters.count < 5) {
level = Level(level: levelNum, seed: seed)
} else if allowCustom {
level = CustomLevel(level: levelNum, seed: seed)
}
}
}
if level == nil {
AlertManager.defaultManager().alert("Invalid level code")
}
return level
}
}
|
[
-1
] |
13edae7377801f951955fa07fc8bf8d0b893cbbb
|
a6957a7a0382f0ac7181e230f086dea843ffca66
|
/Clearry/AppDelegate.swift
|
d33106cf9ff6ff836f9fb3a79ad8c84590811573
|
[
"MIT"
] |
permissive
|
sunlinjin/Clearry
|
fe88fbf30c5ed590776fcf455385715173e4268f
|
e6edc12639ad64bdf2bd2988841c3f843bd9e30d
|
refs/heads/master
| 2021-06-26T19:50:15.225076 | 2017-07-17T19:31:39 | 2017-07-17T19:31:39 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,167 |
swift
|
//
// AppDelegate.swift
// Clearry
//
// Created by Dmytro Vorobiov on 20.04.16.
// Copyright © 2016 dvor. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and 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,
294924,
229388,
278542,
229391,
327695,
278545,
229394,
278548,
229397,
229399,
229402,
352284,
278556,
229405,
278559,
229408,
278564,
294950,
229415,
229417,
237613,
229422,
360496,
229426,
237618,
229428,
286774,
286776,
319544,
204856,
229432,
286778,
286791,
237640,
278605,
286797,
311375,
163920,
237646,
196692,
319573,
311383,
278623,
278626,
319590,
311400,
278635,
303212,
278639,
131192,
278648,
237693,
303230,
327814,
131209,
303241,
417930,
303244,
311436,
319633,
286873,
286876,
311460,
311469,
32944,
327862,
286906,
327866,
180413,
286910,
131264,
286916,
286922,
286924,
286926,
319694,
286928,
131281,
278743,
278747,
295133,
155872,
319716,
278760,
237807,
303345,
286962,
303347,
131314,
229622,
327930,
278781,
278783,
278785,
237826,
319751,
278792,
286987,
319757,
311569,
286999,
319770,
287003,
287006,
287009,
287012,
287014,
287016,
287019,
311598,
287023,
262448,
311601,
287032,
155966,
319809,
278849,
319810,
319814,
311623,
319818,
311628,
229709,
319822,
287054,
278865,
229717,
196963,
196969,
139638,
213367,
106872,
319872,
311683,
311693,
65943,
319898,
311719,
278952,
139689,
278957,
311728,
278967,
180668,
311741,
278975,
319938,
278980,
98756,
278983,
319945,
278986,
319947,
278990,
278994,
311767,
279003,
279006,
188895,
172512,
287202,
279010,
279015,
172520,
319978,
279020,
172526,
311791,
279023,
172529,
279027,
319989,
180727,
164343,
279035,
311804,
287230,
279040,
303617,
287234,
279045,
172550,
303623,
320007,
287238,
172552,
279051,
172558,
279055,
303632,
279058,
303637,
279063,
279067,
172572,
279072,
172577,
295459,
172581,
295461,
279082,
311850,
279084,
172591,
172598,
279095,
172607,
172609,
172612,
377413,
172614,
213575,
172618,
303690,
33357,
287309,
279124,
172634,
262752,
172644,
311911,
189034,
295533,
172655,
172656,
352880,
189040,
295538,
172660,
189044,
287349,
189039,
287355,
287360,
295553,
295557,
311942,
303751,
287365,
352905,
311946,
287371,
279178,
311951,
287377,
172691,
287381,
311957,
221850,
287386,
230045,
287390,
303773,
164509,
172705,
287394,
172702,
172707,
303780,
287398,
295583,
287400,
279208,
172714,
295595,
279212,
189102,
172721,
287409,
66227,
303797,
189114,
287419,
303804,
328381,
287423,
328384,
279231,
287427,
312006,
107208,
107212,
172748,
287436,
172751,
287440,
295633,
172755,
303827,
279255,
172760,
287450,
303835,
279258,
189149,
303838,
213724,
279267,
312035,
295654,
279272,
312048,
230128,
312050,
230131,
205564,
303871,
230146,
295685,
328453,
230154,
33548,
312077,
295695,
295701,
230169,
369433,
295707,
328476,
295710,
230175,
303914,
279340,
205613,
279353,
230202,
312124,
328508,
222018,
295755,
377676,
148302,
287569,
303959,
230237,
279390,
230241,
279394,
303976,
336744,
303981,
303985,
303987,
328563,
279413,
303991,
303997,
295806,
295808,
304005,
295813,
304007,
320391,
213895,
304009,
304011,
230284,
304013,
213902,
279438,
295822,
189329,
295825,
189331,
304019,
58262,
304023,
279452,
410526,
279461,
279462,
304042,
213931,
304055,
230327,
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,
304170,
304175,
238641,
312374,
238652,
238655,
230465,
238658,
296004,
132165,
336964,
205895,
320584,
238666,
296021,
402518,
336987,
230497,
296036,
361576,
296040,
205931,
296044,
164973,
205934,
279661,
312432,
279669,
337018,
189562,
279679,
279683,
222340,
205968,
296084,
238745,
304285,
238756,
205991,
222377,
165035,
337067,
165038,
238766,
230576,
238770,
304311,
230592,
312518,
279750,
230600,
230607,
148690,
320727,
279769,
304348,
279777,
304354,
296163,
320740,
279781,
304360,
320748,
279788,
279790,
304370,
296189,
320771,
312585,
296202,
296205,
230674,
320786,
230677,
214294,
296215,
320792,
230681,
230679,
296213,
304416,
230689,
173350,
312622,
296243,
312630,
222522,
296253,
222525,
296255,
312639,
230718,
296259,
378181,
296262,
238919,
296264,
320840,
230727,
296267,
296271,
222545,
230739,
312663,
222556,
337244,
230752,
312676,
230760,
173418,
410987,
230763,
230768,
296305,
312692,
230773,
304505,
181626,
304506,
279929,
181631,
312711,
312712,
296331,
288140,
288144,
230800,
304533,
337306,
288154,
288160,
173472,
288162,
288164,
279975,
304555,
370092,
279983,
173488,
288176,
279985,
312755,
296373,
312759,
337335,
288185,
279991,
222652,
312766,
173507,
296389,
222665,
230860,
312783,
288208,
230865,
288210,
370130,
222676,
288212,
288214,
280021,
239064,
329177,
288217,
288218,
280027,
288220,
239070,
288224,
280034,
288226,
280036,
288229,
280038,
288230,
288232,
370146,
288234,
320998,
288236,
288238,
288240,
288242,
296435,
288244,
288250,
148990,
321022,
206336,
402942,
296446,
296450,
230916,
230919,
214535,
304651,
370187,
304653,
230940,
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,
116354,
280194,
280208,
280211,
288408,
280218,
280222,
190118,
321195,
296622,
321200,
337585,
296626,
296634,
296637,
313027,
280260,
206536,
280264,
206539,
206541,
206543,
280276,
313044,
321239,
280283,
18140,
288478,
313055,
321252,
313066,
280302,
288494,
280304,
313073,
419570,
288499,
321266,
288502,
280314,
288510,
124671,
67330,
280324,
280331,
198416,
280337,
296723,
116503,
321304,
329498,
296731,
321311,
313121,
313123,
304932,
321316,
280363,
141101,
165678,
280375,
321336,
296767,
288576,
345921,
280388,
304968,
280393,
280402,
173907,
313176,
42842,
280419,
321381,
296812,
313201,
1920,
255873,
305028,
280454,
247688,
280464,
124817,
280468,
239510,
280473,
124827,
214940,
247709,
214944,
280487,
313258,
321458,
296883,
124853,
214966,
10170,
296890,
288700,
296894,
190403,
280515,
296900,
337862,
165831,
280521,
231379,
296921,
239586,
313320,
231404,
124913,
165876,
321528,
313340,
239612,
288764,
239617,
313347,
288773,
313358,
305176,
313371,
354338,
305191,
223273,
313386,
354348,
124978,
215090,
124980,
288824,
288826,
321595,
378941,
313406,
288831,
288836,
67654,
280651,
354382,
288848,
280658,
215123,
354390,
288855,
288859,
280669,
313438,
149599,
280671,
149601,
321634,
149603,
223327,
329830,
280681,
313451,
223341,
280687,
215154,
313458,
280691,
313464,
321659,
280702,
288895,
321670,
215175,
141446,
288909,
141455,
141459,
275606,
280725,
313498,
100520,
288936,
280747,
288940,
280755,
288947,
321717,
280759,
280764,
280769,
280771,
280774,
280776,
321740,
313548,
280783,
280786,
280788,
313557,
280793,
280796,
280798,
338147,
280804,
280807,
157930,
280811,
280817,
125171,
280819,
157940,
182517,
280823,
280825,
280827,
280830,
280831,
280833,
125187,
280835,
125191,
125207,
125209,
321817,
125218,
321842,
223539,
125239,
280888,
280891,
289087,
280897,
280900,
239944,
305480,
280906,
239947,
305485,
305489,
379218,
280919,
354653,
313700,
313705,
280937,
190832,
280946,
223606,
313720,
280956,
280959,
313731,
240011,
199051,
289166,
240017,
297363,
190868,
297365,
240021,
297368,
297372,
141725,
297377,
289186,
297391,
289201,
240052,
289207,
305594,
289210,
281024,
289218,
289221,
289227,
281045,
281047,
166378,
305647,
281075,
174580,
240124,
281084,
305662,
305664,
240129,
305666,
240132,
223749,
305668,
281095,
223752,
150025,
338440,
223757,
281102,
223763,
223765,
281113,
322074,
281116,
281121,
182819,
281127,
281135,
150066,
158262,
158266,
289342,
281154,
322115,
158283,
281163,
281179,
338528,
338532,
281190,
199273,
281196,
158317,
19053,
313973,
297594,
281210,
158347,
133776,
314003,
117398,
314007,
289436,
174754,
330404,
289448,
133801,
174764,
314029,
314033,
240309,
133817,
314045,
314047,
314051,
199364,
297671,
158409,
289493,
363234,
289513,
289522,
289525,
289532,
322303,
289537,
322310,
264969,
322314,
322318,
281361,
281372,
322341,
215850,
281388,
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,
183184,
240535,
289687,
297883,
289694,
289696,
289700,
289712,
281529,
289724,
52163,
183260,
281567,
289762,
322534,
297961,
183277,
322550,
134142,
322563,
314372,
175134,
322599,
322610,
314421,
281654,
314427,
314433,
207937,
314441,
207949,
322642,
314456,
281691,
314461,
281702,
281704,
314474,
281708,
281711,
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,
298306,
380226,
224584,
224587,
224594,
216404,
306517,
150870,
314714,
224603,
159068,
314718,
265568,
314723,
281960,
150890,
306539,
314732,
314736,
290161,
216436,
306549,
298358,
314743,
306552,
306555,
314747,
298365,
290171,
290174,
224641,
281987,
314756,
298372,
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,
192008,
323084,
257550,
282127,
290321,
282130,
323090,
282133,
290325,
241175,
290328,
282137,
290332,
241181,
282142,
282144,
290344,
306731,
290349,
290351,
290356,
28219,
282186,
224849,
282195,
282199,
282201,
306778,
159324,
159330,
314979,
298598,
323176,
224875,
241260,
323181,
257658,
315016,
282249,
290445,
282261,
298651,
323229,
282269,
298655,
323231,
61092,
282277,
306856,
282295,
323260,
282300,
323266,
282310,
323273,
282319,
306897,
241362,
306904,
282328,
298714,
52959,
216801,
282337,
241380,
216806,
323304,
282345,
12011,
282356,
323318,
282364,
282367,
306945,
241412,
323333,
282376,
216842,
323345,
282388,
323349,
282392,
184090,
315167,
315169,
282402,
315174,
323367,
241448,
315176,
241450,
282410,
306988,
306991,
315184,
323376,
315190,
241464,
282425,
159545,
298811,
307009,
413506,
241475,
307012,
298822,
148946,
315211,
282446,
307027,
315221,
282454,
315223,
241496,
323414,
241498,
307035,
307040,
110433,
282465,
241509,
110438,
298860,
110445,
282478,
315249,
110450,
315251,
282481,
315253,
315255,
339838,
315267,
282499,
315269,
241544,
282505,
241546,
241548,
298896,
298898,
282514,
241556,
298901,
44948,
241560,
282520,
241563,
241565,
241567,
241569,
282531,
241574,
282537,
298922,
36779,
241581,
282542,
241583,
323504,
241586,
282547,
241588,
290739,
241590,
241592,
241598,
290751,
241600,
241605,
151495,
241610,
298975,
241632,
241640,
298984,
241643,
298988,
241646,
241649,
241652,
323574,
290807,
241661,
299006,
282623,
315396,
241669,
315397,
282632,
282639,
290835,
282645,
241693,
282654,
241701,
102438,
217127,
282669,
323630,
282681,
290877,
282687,
159811,
315463,
315466,
192589,
307278,
192596,
176213,
307287,
315482,
315483,
217179,
192605,
233567,
200801,
299105,
217188,
299109,
307303,
315495,
356457,
307307,
45163,
315502,
192624,
307314,
323700,
299126,
233591,
299136,
307329,
315524,
307338,
233613,
241813,
307352,
299164,
184479,
299167,
184481,
315557,
184486,
307370,
307372,
184492,
307374,
307376,
323763,
176311,
184503,
307385,
307386,
258235,
307388,
176316,
307390,
299200,
184512,
307394,
307396,
299204,
184518,
307399,
323784,
307409,
307411,
176343,
299225,
233701,
307432,
184572,
282881,
184579,
282893,
323854,
291089,
282906,
291104,
233766,
282931,
307508,
315701,
332086,
307510,
307512,
176435,
168245,
307515,
307518,
282942,
282947,
323917,
282957,
110926,
233808,
323921,
315733,
323926,
233815,
315739,
323932,
299357,
242018,
242024,
299373,
315757,
250231,
315771,
242043,
299388,
299391,
291202,
299398,
242057,
291212,
299405,
291222,
315801,
283033,
242075,
291226,
291231,
61855,
283042,
291238,
291241,
127403,
127405,
127407,
291247,
299440,
299444,
127413,
291254,
283062,
194660,
127417,
291260,
127421,
283069,
127424,
299457,
127429,
127431,
315856,
176592,
315860,
176597,
283095,
127447,
299481,
176605,
242143,
291299,
127463,
242152,
291305,
127466,
176620,
291314,
127474,
291317,
135672,
233979,
291323,
291330,
283142,
127497,
233994,
135689,
291341,
233998,
127506,
234003,
234006,
127511,
152087,
283161,
234010,
135707,
242202,
135710,
242206,
242208,
291361,
242220,
291378,
152118,
234038,
234041,
70213,
242250,
111193,
242275,
299620,
242279,
168562,
184952,
135805,
135808,
291456,
373383,
299655,
135820,
316051,
225941,
316054,
299672,
135834,
373404,
225948,
299677,
135839,
299680,
225954,
135844,
299684,
242343,
209576,
242345,
373421,
135870,
135873,
135876,
135879,
299720,
299723,
299726,
225998,
226002,
119509,
226005,
226008,
242396,
299740,
201444,
299750,
283368,
234219,
283372,
381677,
226037,
283382,
316151,
234231,
234236,
226045,
242431,
234239,
209665,
234242,
299778,
242436,
234246,
226056,
234248,
291593,
242443,
234252,
242445,
234254,
291601,
242450,
234258,
242452,
234261,
348950,
201496,
291608,
234264,
234266,
234269,
283421,
234272,
234274,
152355,
234278,
299814,
283432,
234281,
234284,
234287,
283440,
185138,
242483,
234292,
234296,
234298,
160572,
283452,
234302,
234307,
242499,
234309,
316233,
234313,
316235,
234316,
283468,
242511,
234319,
234321,
234324,
201557,
234329,
234333,
308063,
234336,
234338,
349027,
242530,
234341,
234344,
234347,
177004,
234350,
324464,
234353,
152435,
177011,
234356,
234358,
234362,
226171,
234364,
291711,
234368,
234370,
291714,
291716,
234373,
316294,
226182,
234375,
226185,
308105,
234379,
234384,
234388,
234390,
226200,
234393,
209818,
308123,
324504,
234396,
324508,
234398,
291742,
234401,
291747,
291748,
234405,
291750,
324518,
324520,
234407,
234410,
291754,
291756,
324522,
226220,
324527,
234414,
234417,
201650,
324531,
291760,
234422,
226230,
324536,
275384,
234428,
291773,
234431,
242623,
324544,
324546,
226239,
324548,
234437,
234434,
226245,
234439,
234443,
291788,
234446,
275406,
193486,
234449,
193488,
234452,
234455,
234459,
234461,
234464,
234467,
234470,
168935,
5096,
324585,
234475,
234478,
316400,
234481,
316403,
234484,
234485,
324599,
234487,
234490,
234493,
234496,
316416,
234501,
275462,
308231,
234504,
234507,
234510,
234515,
300054,
234519,
316439,
234520,
234523,
234526,
234528,
300066,
234532,
300069,
234535,
234537,
234540,
144430,
234543,
234546,
275508,
234549,
300085,
300088,
234553,
234556,
234558,
316479,
234561,
308291,
316483,
234563,
234568,
234570,
316491,
234572,
300108,
234574,
300115,
234580,
234581,
234585,
275545,
242777,
234590,
234593,
234595,
234597,
300133,
234601,
300139,
234605,
160879,
234607,
275569,
234610,
300148,
234614,
398455,
144506,
234618,
234620,
275579,
234623,
226433,
234627,
275588,
234629,
234634,
234636,
177293,
234640,
275602,
234643,
308373,
226453,
234647,
234648,
275608,
234650,
308379,
324757,
234653,
300189,
119967,
324766,
324768,
283805,
234657,
242852,
234661,
283813,
300197,
234664,
275626,
234667,
316596,
308414,
300223,
234687,
300226,
308418,
283844,
300229,
308420,
308422,
234692,
283850,
300234,
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,
300292,
300294,
275719,
300299,
177419,
242957,
275725,
283917,
177424,
300301,
349464,
283939,
259367,
283951,
292143,
300344,
226617,
283963,
243003,
226628,
283973,
300357,
177482,
283983,
316758,
357722,
316766,
316768,
292192,
218464,
292197,
316774,
243046,
218473,
284010,
324978,
136562,
275834,
333178,
275836,
275840,
316803,
316806,
226696,
316811,
226699,
316814,
226703,
300433,
234899,
226709,
357783,
316824,
316826,
300448,
144807,
144810,
144812,
284076,
144814,
144820,
284084,
292279,
284087,
144826,
144828,
144830,
144832,
144835,
144837,
38342,
144839,
144841,
144844,
144847,
144852,
144855,
103899,
300507,
333280,
226787,
218597,
292329,
300523,
259565,
259567,
308720,
300527,
292338,
226802,
316917,
292343,
308727,
300537,
316933,
316947,
308757,
308762,
284191,
284194,
284196,
235045,
284199,
284204,
284206,
284209,
284211,
284213,
308790,
284215,
316983,
194103,
284218,
194101,
226877,
284223,
284226,
284228,
243268,
226886,
284231,
128584,
292421,
284234,
366155,
317004,
276043,
284238,
226895,
284241,
292433,
284243,
300628,
284245,
194130,
284247,
317015,
235097,
243290,
276052,
276053,
284249,
300638,
284251,
284253,
284255,
284258,
243293,
292452,
292454,
284263,
177766,
284265,
292458,
284267,
292461,
284272,
284274,
276086,
292470,
284278,
292473,
284283,
276093,
284286,
276095,
284288,
292479,
284290,
325250,
276098,
292485,
284292,
292481,
284297,
317066,
284299,
317068,
276109,
284301,
284303,
284306,
276114,
284308,
284312,
284314,
284316,
276127,
284320,
284322,
284327,
284329,
317098,
284331,
276137,
284333,
284335,
276144,
284337,
284339,
300726,
284343,
284346,
284350,
358080,
276160,
284354,
358083,
284358,
276166,
358089,
284362,
276170,
276175,
284368,
276177,
284370,
358098,
284372,
317138,
284377,
284379,
284381,
284384,
358114,
284386,
358116,
276197,
317158,
358119,
284392,
325353,
358122,
284394,
284397,
358126,
284399,
358128,
276206,
358133,
358135,
276216,
358138,
300795,
358140,
284413,
358142,
358146,
317187,
284418,
317189,
317191,
284428,
300816,
300819,
317207,
284440,
300828,
300830,
276255,
325408,
300832,
300834,
284449,
317221,
227109,
358183,
186151,
276268,
300845,
243504,
300850,
284469,
276280,
325436,
358206,
276291,
366406,
276295,
300872,
153417,
358224,
284499,
276308,
284502,
317271,
178006,
276315,
292700,
284511,
317279,
227175,
292715,
300912,
284529,
292721,
300915,
284533,
292729,
317306,
284540,
292734,
325512,
169868,
276365,
358292,
284564,
317332,
284566,
350106,
284572,
276386,
284579,
276388,
358312,
284585,
317353,
276395,
292776,
292784,
276402,
358326,
161718,
358330,
276411,
276418,
276425,
301009,
301011,
301013,
292823,
358360,
301015,
301017,
292828,
276446,
153568,
276448,
276452,
292839,
276455,
292843,
276460,
276464,
178161,
227314,
276466,
276472,
325624,
317435,
276476,
276479,
276482,
276485,
276490,
292876,
317456,
276496,
317458,
243733,
317468,
243740,
317472,
325666,
243751,
292904,
276528,
243762,
309298,
325685,
325689,
235579,
276539,
235581,
178238,
325692,
276544,
284739,
325700,
292934,
243785,
276553,
350293,
350295,
309337,
227418,
350299,
194649,
350302,
194654,
227423,
178273,
309346,
227426,
309348,
350308,
309350,
227430,
309352,
350313,
309354,
301163,
350316,
276583,
276590,
301167,
292968,
350321,
284786,
276595,
227440,
350325,
350328,
292985,
301178,
292989,
301185,
317570,
350339,
292993,
317573,
350342,
350345,
350349,
301199,
317584,
325777,
350354,
350357,
350359,
350362,
350366,
276638,
153765,
284837,
350375,
350379,
350381,
350383,
129200,
350385,
350387,
350389,
350395,
350397,
350399,
227520,
350402,
227522,
301252,
350406,
227529,
301258,
309450,
276685,
309455,
276689,
309462,
301272,
276699,
309468,
194780,
309471,
301283,
317672,
317674,
325867,
243948,
194801,
309491,
227571,
309494,
243960,
227583,
276735,
227587,
276739,
211204,
276742,
227596,
325910,
309530,
342298,
211232,
317729,
276775,
211241,
325937,
276789,
325943,
211260,
260421,
276809,
285002,
276811,
235853,
276816,
235858,
276829,
276833,
391523,
276836,
293227,
276843,
276848,
293232,
186744,
211324,
227709,
285061,
317833,
178572,
285070,
285077,
178583,
227738,
317853,
276896,
317858,
342434,
285093,
317864,
285098,
276907,
235955,
276917,
293304,
293307,
293314,
309707,
293325,
317910,
293336,
235996,
317917,
293343,
358880,
276961,
227810,
293346,
276964,
293352,
236013,
293364,
301562,
317951,
309764,
301575,
121352,
236043,
317963,
342541,
55822,
113167,
277011,
309779,
317971,
309781,
55837,
227877,
227879,
293417,
227882,
309804,
293421,
105007,
236082,
285236,
23094,
277054,
244288,
219714,
129603,
318020,
301636,
301639,
301643,
285265,
399955,
309844,
277080,
309849,
285277,
285282,
326244,
318055,
277100,
309871,
121458,
277106,
170618,
170619,
309885,
309888,
277122,
227975,
277128,
285320,
301706,
318092,
326285,
334476,
318094,
277136,
277139,
227992,
318108,
285340,
318110,
227998,
137889,
383658,
285357,
318128,
277170,
342707,
318132,
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,
228113,
285459,
277273,
293659,
326430,
228128,
293666,
285474,
228135,
318248,
277291,
318253,
293677,
285489,
301876,
293685,
285494,
301880,
285499,
301884,
293696,
310080,
277317,
293706,
277322,
277329,
162643,
310100,
301911,
277337,
301913,
301921,
400236,
236397,
162671,
326514,
310134,
15224,
236408,
277368,
416639,
416640,
113538,
310147,
416648,
39817,
187274,
277385,
301972,
424853,
277405,
277411,
310179,
293798,
293802,
236460,
277426,
293811,
276579,
293817,
293820,
203715,
326603,
276586,
293849,
293861,
228327,
228328,
228330,
318442,
228332,
326638,
277486,
318450,
293876,
293877,
285686,
302073,
121850,
285690,
302075,
244731,
293882,
293887,
277504,
277507,
277511,
277519,
293908,
293917,
293939,
318516,
277561,
277564,
310336,
7232,
293956,
277573,
228422,
310344,
293960,
277577,
277583,
203857,
293971,
310355,
310359,
236632,
277594,
138332,
277598,
203872,
277601,
285792,
310374,
203879,
310376,
228460,
318573,
203886,
187509,
285815,
285817,
367737,
302205,
285821,
392326,
285831,
253064,
302218,
285835,
294026,
384148,
162964,
187542,
302231,
285849,
302233,
285852,
302237,
285854,
285856,
302241,
285862,
277671,
302248,
64682,
277678,
294063,
294065,
302258,
277687,
294072,
318651,
294076,
277695,
318657,
244930,
302275,
130244,
302277,
228550,
302282,
310476,
302285,
302288,
310481,
302290,
203987,
302292,
302294,
302296,
384222,
310498,
285927,
318698,
302315,
195822,
228592,
294132,
138485,
204023,
228601,
204026,
228606,
204031,
64768,
310531,
138505,
228617,
318742,
204067,
277798,
130345,
277801,
113964,
285997,
277804,
285999,
277807,
113969,
277811,
318773,
318776,
277816,
286010,
277819,
294204,
417086,
277822,
286016,
302403,
294211,
384328,
277832,
277836,
294221,
326991,
294223,
277839,
277842,
277847,
277850,
179547,
277853,
146784,
277857,
302436,
277860,
294246,
327015,
310632,
327017,
351594,
277864,
277869,
277872,
351607,
310648,
277880,
310651,
277884,
277888,
310657,
310659,
351619,
294276,
327046,
277892,
253320,
310665,
318858,
277894,
277898,
277903,
310672,
351633,
277905,
277908,
277917,
310689,
277921,
130468,
228776,
277928,
277932,
310703,
277937,
130486,
310710,
310712,
277944,
310715,
277947,
302526,
228799,
277950,
277953,
302534,
245191,
310727,
64966,
277959,
277963,
302541,
277966,
302543,
310737,
277971,
228825,
163290,
277978,
310749,
277981,
277984,
310755,
277989,
277991,
187880,
277995,
286188,
310764,
278000,
228851,
310772,
278003,
278006,
40440,
212472,
278009,
40443,
286203,
310780,
40448,
228864,
286214,
228871,
302603,
302614,
302617,
286233,
302621,
286240,
146977,
187939,
294435,
40484,
40486,
286246,
40488,
294439,
294440,
40491,
294443,
294445,
286248,
310831,
40499,
40502,
212538,
40507,
40511,
40513,
228933,
40521,
286283,
40525,
40527,
400976,
228944,
212560,
40533,
147032,
40537,
40539,
40541,
278109,
40544,
40548,
40550,
40552,
286312,
40554,
286313,
310892,
40557,
40560,
188022,
122488,
294521,
343679,
294537,
310925,
286354,
278163,
302740,
122517,
278168,
179870,
327333,
229030,
212648,
278188,
302764,
278192,
319153,
278196,
302781,
319171,
302789,
294599,
278216,
302793,
294601,
278227,
286420,
319187,
229076,
286425,
319194,
278235,
229086,
278238,
286432,
294625,
294634,
302838,
319226,
286460,
278274,
302852,
278277,
302854,
311048,
294664,
352008,
319243,
311053,
302862,
319251,
302872,
294682,
278306,
188199,
294701,
319280,
278320,
319290,
229192,
302925,
188247,
188252,
237409,
294776,
360317,
294785,
327554,
40840,
40851,
294803,
188312,
294811,
319390,
237470,
40865,
319394,
294817,
294821,
311209,
180142,
294831,
188340,
40886,
319419,
294844,
294847,
237508,
393177,
294876,
294879,
294883,
294890,
311279,
278513,
237555,
311283,
278516,
278519,
237562
] |
f5d9764a78b5967e221a33c2789c35405a75c7f8
|
3a318eb5a6c42c6c2b1780a1c5e3e433134eef28
|
/mowine/Scenes/MyAccount/EditProfileViewModel.swift
|
3ab9fcc43b567e072b02f96b1011939ee42d2d2f
|
[] |
no_license
|
joshfreed/mowine
|
e4808491e332d8a4becc4ef125a8d390824f933e
|
83a45aedff7b20e5648dfd983e5951390f37aa5e
|
refs/heads/main
| 2022-08-18T12:19:13.455232 | 2022-07-26T16:10:56 | 2022-07-26T16:10:56 | 83,926,999 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,945 |
swift
|
//
// EditProfileViewModel.swift
// mowine
//
// Created by Josh Freed on 11/25/20.
// Copyright © 2020 Josh Freed. All rights reserved.
//
import Foundation
import UIKit.UIImage
import Combine
import SwiftyBeaver
import JFLib_Mediator
import MoWine_Application
@MainActor
class EditProfileViewModel: ObservableObject {
@Published var fullName: String = "" {
didSet {
if oldValue != fullName {
profileDidChange()
}
}
}
@Published var emailAddress: String = "" {
didSet {
if oldValue != emailAddress {
profileDidChange()
}
}
}
@Published var profilePicture: UserPhoto = .url(nil) {
didSet {
profileDidChange()
}
}
@Published var isSaving = false
@Published var showErrorAlert = false
@Published var saveErrorMessage: String = ""
@Published var isReauthenticating = false
@Injected private var mediator: Mediator
@Injected private var updateProfileCommandHandler: UpdateProfileCommandHandler
private var hasChanges = false
private var newProfilePicture: UIImage? {
if case let .uiImage(image) = profilePicture {
return image
} else {
return nil
}
}
init() {
SwiftyBeaver.debug("init")
}
deinit {
SwiftyBeaver.debug("deinit")
}
func loadProfile() async {
do {
guard let profile: GetMyAccountQueryResponse = try await mediator.send(GetMyAccountQuery()) else {
return
}
setProfile(profile)
hasChanges = false
} catch {
CrashReporter.shared.record(error: error)
}
}
private func setProfile(_ profile: GetMyAccountQueryResponse) {
fullName = profile.fullName
emailAddress = profile.emailAddress
profilePicture = .url(profile.profilePictureUrl)
}
private func profileDidChange() {
hasChanges = true
}
func saveProfile() async {
guard hasChanges else {
return
}
isSaving = true
do {
let command = UpdateProfileCommand(email: emailAddress, fullName: fullName, image: newProfilePicture?.pngData())
try await updateProfileCommandHandler.handle(command)
isSaving = false
} catch {
isSaving = false
if case SessionError.requiresRecentLogin = error {
reauthenticate()
} else {
CrashReporter.shared.record(error: error)
showErrorAlert = true
saveErrorMessage = error.localizedDescription
}
}
}
func reauthenticate() {
isReauthenticating = true
}
func reauthenticationSuccess() async {
isReauthenticating = false
await saveProfile()
}
}
|
[
-1
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.