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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2f6f8c586414ac84ca67ccdcde15e68339a85c16
|
976114966ce4775eb6ea3f74771fa2289dd9f64a
|
/Movies/ContentView.swift
|
ecd0d79e31e6d787fe40fdaa0f631c8708677b02
|
[] |
no_license
|
nicolasmarchal/Movies
|
f8254af8e79c788d7d3371366f2367f69aebe29e
|
e0f15d9d6d24bcc809d05f474cc549babfda9a58
|
refs/heads/main
| 2023-06-10T16:23:44.582197 | 2020-11-08T16:19:28 | 2020-11-08T16:19:28 | 383,152,942 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,944 |
swift
|
//
// ContentView.swift
// Movies
//
// Created by Nicolas Marchal on 03/11/2020.
//
import SwiftUI
import Combine
struct ContentView: View {
@StateObject private var viewModel = HomeViewModel()
@State private var selectedTab: String = ""
@State private var selectedFilters = [String]()
@State private var selectedMovie: Movie? = nil
var body: some View {
VStack {
HStack {
Image("menu")
.onClick {
}
Spacer()
Image("search")
.onClick {
}
}
.padding(.vertical, 16)
.padding(.horizontal, 20)
TopBarView2(titles: ["In Theater", "Box office", "Coming soon"], selectedTitle: $selectedTab)
.padding(.top, 6)
FiltersView(filters: viewModel.filters, filterSelected: { filters in
viewModel.filterMovies(filters)
})
.padding(.vertical, 12)
.zIndex(1)
CarouselView(movies: viewModel.moviesDisplayed, selectedMovie: $selectedMovie)
Spacer()
}.background(Color.white)
//Bug 06.11.2020: https://stackoverflow.com/questions/58720495/why-isnt-onpreferencechange-being-called-if-its-inside-a-scrollview-in-swiftui?noredirect=1&lq=1
.navigate(item: $selectedMovie, content: { selectedMovie in
MovieDetailsView(movie: selectedMovie).onDisappear {
self.selectedMovie = nil
}
}).background(viewModel.moviesDisplayed.count > 0 ? NImage(viewModel.moviesDisplayed[0].image).opacity(0.3) : NImage("").opacity(0))
.onAppear {
viewModel.fetchMovies()
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
|
[
-1
] |
55c19bbec39d026456475cb3a61709ba3e428302
|
0bed679cab5aee6fb2d6d65b9764dbf03e775867
|
/SignatureMountain/Controller/SettingsVC.swift
|
9a4e0b14983561e485f0d69449642485b0142bac
|
[] |
no_license
|
fhafez/SignatureMountain
|
104a7e8f85f0d2364819695240eef4fe5a67934d
|
22aab394e93ebcc0e055d0c9041ef48e7886b255
|
refs/heads/master
| 2020-04-13T16:42:29.847294 | 2019-10-17T02:25:41 | 2019-10-17T02:25:41 | 163,328,299 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 3,160 |
swift
|
//
// Settings.swift
// SignatureMountain
//
// Created by Fadi Hafez on 2018-12-27.
// Copyright © 2018 Fadi Hafez. All rights reserved.
//
import Foundation
import UIKit
@IBDesignable class PaddingLabel: UILabel {
@IBInspectable var topInset: CGFloat = 5.0
@IBInspectable var bottomInset: CGFloat = 5.0
@IBInspectable var leftInset: CGFloat = 7.0
@IBInspectable var rightInset: CGFloat = 7.0
override func drawText(in rect: CGRect) {
let insets = UIEdgeInsets.init(top: topInset, left: leftInset, bottom: bottomInset, right: rightInset)
super.drawText(in: rect.inset(by: insets))
}
override var intrinsicContentSize: CGSize {
let size = super.intrinsicContentSize
return CGSize(width: size.width + leftInset + rightInset,
height: size.height + topInset + bottomInset)
}
}
class SettingsVC: UIViewController {
let defaults = UserDefaults.standard
@IBOutlet weak var baseURL: UITextField!
@IBOutlet weak var username: UITextField!
@IBOutlet weak var password: UITextField!
@IBOutlet weak var signoutEnabledSwitch: UISwitch!
@IBAction func backBtnPressed(_ sender: Any) {
// save the data to UserDefaults
if let baseURLValue = self.baseURL.text {
settings["baseURL"] = baseURLValue
settings["user"] = self.username.text
settings["password"] = self.password.text
// settings["commitSigninURL"] = "\(baseURLValue)php/signinJS.php/"
settings["commitSigninURL"] = "\(baseURLValue)createAppointment"
// settings["matchPatientsURL"] = "\(baseURLValue)php/matchPatients.php/"
settings["matchPatientsURL"] = "\(baseURLValue)getPatients"
settings["registerPatientURL"] = "\(baseURLValue)php/registerJS.php/"
settings["todaysAppointmentsURL"] = "\(baseURLValue)listAppointments"
settings["signoutAppointmentURL"] = "\(baseURLValue)signout"
if signoutEnabledSwitch.isOn {
settings["signoutDisabled"] = "true"
} else {
settings["signoutDisabled"] = "false"
}
print(settings)
defaults.set(settings, forKey: "settings")
}
//defaults.setValue(settings, forKey: "settings")
dismiss(animated: true, completion: nil)
}
override func viewDidLoad() {
// nothing yet
super.viewDidLoad()
print("viewdidload")
if let settingsDict = defaults.dictionary(forKey: "settings") {
baseURL.text = settingsDict["baseURL"] as? String
username.text = settingsDict["user"] as? String
password.text = settingsDict["password"] as? String
let signoutDisabled = settingsDict["signoutDisabled"] as? String
if signoutDisabled == "true" {
signoutEnabledSwitch.isOn = true
} else {
signoutEnabledSwitch.isOn = false
}
}
}
}
|
[
-1
] |
70603be4468efce6cb803ea21df9af6c52d8b596
|
8f0d72f56a7fa07c2411297084ab0b4c87a331fd
|
/Watch Extension/NotificationController.swift
|
291ebfddf4c8c415913be183bfe35edb21ad6728
|
[] |
no_license
|
mobiosolutions/apple-watch-connectivity-swift
|
37008bfecb9ff4eac84e4c09024bf2e8db36d55d
|
7ff7ee06ff004d6bb063545364785017890f8534
|
refs/heads/master
| 2020-05-26T10:03:13.011669 | 2019-05-23T09:01:42 | 2019-05-23T09:01:42 | 188,196,706 | 6 | 1 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,053 |
swift
|
//
// NotificationController.swift
// Watch Extension
//
// Created by Harshad Pipaliya on 05/01/19.
// Copyright © 2019 MobioSolutions. All rights reserved.
//
import WatchKit
import Foundation
import UserNotifications
class NotificationController: WKUserNotificationInterfaceController {
override init() {
// Initialize variables here.
super.init()
// Configure interface objects here.
}
override func willActivate() {
// This method is called when watch view controller is about to be visible to user
super.willActivate()
}
override func didDeactivate() {
// This method is called when watch view controller is no longer visible
super.didDeactivate()
}
override func didReceive(_ notification: UNNotification) {
// This method is called when a notification needs to be presented.
// Implement it if you use a dynamic notification interface.
// Populate your dynamic notification interface as quickly as possible.
}
}
|
[
282371,
302728,
177290,
324762,
320538,
36767,
168101,
282405,
61868,
282413,
219696,
282420,
159034,
312892,
180044,
196688,
377682,
241500,
282332,
229221,
318445,
108910,
282351,
240116,
144501,
282360,
153082
] |
994cfac906ee2da21c567f891f5882444dc090d0
|
39157923e8938b2d8f0753ff79be2d9a0ba61459
|
/Sources/NotAutoLayout/LayoutInfoStorable/ViewInfo.swift
|
54ddfba1f1e975ef188cd00c84464a698fda7145
|
[
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
sanengineer/NotAutoLayout
|
ae243fe19b868ab313b686415df6ac3e4631a77b
|
e66916d048d75b5f56aa3ea407e833a4e9d59dad
|
refs/heads/master
| 2023-08-14T06:23:23.397733 | 2020-05-06T23:11:17 | 2020-05-06T23:11:17 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,849 |
swift
|
//
// ViewInfo.swift
// NotAutoLayout
//
// Created by 史翔新 on 2017/03/02.
// Copyright © 2017年 史翔新. All rights reserved.
//
import UIKit
public struct ViewInfo<InfoType> {
typealias InfoValue = [UIView.NAL.Hash: () -> InfoType]
typealias ViewClosureInfoValue = [UIView: () -> InfoType]
typealias HashInfoTypeInfoValue = [UIView.NAL.Hash: InfoType]
typealias SimplifiedInfoValue = [UIView: InfoType]
private var value: InfoValue
}
extension ViewInfo {
subscript (_ viewHash: UIView.NAL.Hash) -> InfoType? {
guard let result = self.value[viewHash] else {
return nil
}
return result()
}
public subscript (_ view: UIView) -> InfoType? {
return self[view.nal.hash]
}
subscript (_ viewHash: UIView.NAL.Hash, `default` defaultValue: InfoType) -> InfoType {
return self[viewHash] ?? defaultValue
}
public subscript (_ view: UIView, `default` defaultValue: InfoType) -> InfoType {
return self[view] ?? defaultValue
}
}
extension ViewInfo {
mutating func set(_ info: InfoType, for view: UIView) {
self.value[view.nal.hash] = { info }
}
mutating func set(_ info: @escaping () -> InfoType, for view: UIView) {
self.value[view.nal.hash] = info
}
}
extension ViewInfo {
func containsInfo(for view: UIView) -> Bool {
return self.value.containsKey(view.nal.hash)
}
}
extension ViewInfo: ExpressibleByDictionaryLiteral {
public init(dictionaryLiteral elements: (UIView, InfoType)...) {
self.value = [UIView.NAL.Hash: () -> InfoType].init(minimumCapacity: elements.count)
for element in elements {
self.value[element.0.nal.hash] = { element.1 }
}
}
}
public typealias LayoutInfo = ViewInfo<IndividualProperty.Layout>
public typealias OrderInfo = ViewInfo<Int>
public typealias ZIndexInfo = ViewInfo<Int>
|
[
-1
] |
fee8c6284ed45509d90e8f4e52ef30fbb92be2d7
|
2cd1076f375f0ee6a1571ea5487154f3a2e02b01
|
/Pomotivate/CalendarCell.swift
|
f1051eada1c63aab96e5b34d6e164dfc7725d880
|
[] |
no_license
|
anvij03/Pomotivate
|
16c7b422b7fdd88bebb741b18bf6f9739496af09
|
baf0460e056b3910445e3b342ec16a8ae5369603
|
refs/heads/main
| 2023-06-10T00:47:35.115614 | 2021-07-02T18:07:40 | 2021-07-02T18:07:40 | 381,495,317 | 4 | 2 | null | null | null | null |
UTF-8
|
Swift
| false | false | 192 |
swift
|
//
// CalendarCell.swift
// Pomotivate
//
// Created by Scholar on 6/30/21.
//
import UIKit
class CalendarCell: UICollectionViewCell
{
@IBOutlet weak var dayOfMonth: UILabel!
}
|
[
-1
] |
08281e4d85c678ee8518545fb5c9e8a329364175
|
230001f3d1f4d0b276b0663b5cb2c97d8d620ba8
|
/OS X/FinalProject2/AppDelegate.swift
|
a26772eab8ba967e3d85d37b268842ec309dbc48
|
[] |
no_license
|
hadziq/MapXplorer-Swift
|
6a7dcee92aa9e38085d95de1de54d2240a13ea72
|
8d9180a1e1328ae846daa7ff32b4c9c7c3ca7554
|
refs/heads/master
| 2016-09-06T06:07:57.489472 | 2015-05-07T07:32:25 | 2015-05-07T07:32:25 | 33,129,388 | 1 | 3 | null | 2015-05-07T07:33:03 | 2015-03-30T14:52:42 | null |
UTF-8
|
Swift
| false | false | 13,943 |
swift
|
//
// AppDelegate.swift
// FinalProject2
//
// Created by Huang Ying-Kai on 2015/3/8.
// Copyright (c) 2015年 Huang Ying-Kai. All rights reserved.
//
import WebKit
import Cocoa
@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate, NSTableViewDelegate, NSTableViewDataSource, ServerDelegate {
@IBOutlet weak var bonjourWindow: NSWindow!
@IBOutlet weak var streetrWindow: NSWindow!
@IBOutlet weak var streetWebView: WebView!
@IBOutlet var notificationView: NotificationView!
@IBOutlet var notificationWindow: NotificationWindow!
@IBOutlet var notificationText: NSTextField!
@IBOutlet weak var window: NSWindow!
var server: Server!
var services = NSMutableArray()
var message: NSString?
var isConnectedToService: Bool = false
var longitude: NSString!
var latitude: NSString!
var heading: NSString!
var pitch: NSString!
var resetPitchFloat: Float = 0.0
var resetPitchTimer: NSTimer!
var textToSend: NSString!
var selectedRow, connectedRow: NSInteger!
//var tableView: NSTableView!
@IBOutlet weak var tableView: NSTableView!
var lastMessageHeader: NSString!
func applicationDidFinishLaunching(aNotification: NSNotification) {
// Insert code here to initialize your application
self.streetrWindow.collectionBehavior = NSWindowCollectionBehavior.FullScreenPrimary
self.message = "Message"
connectedRow = -1
//self.services = NSMutableArray()
var type = "mapXplorer"
self.server = Server(protocols: type)
self.server.delegate = self
var error: NSError? = nil
if (!self.server.start(&error)){
NSLog("Error = %@", error!)
}
}
func applicationWillTerminate(aNotification: NSNotification) {
// Insert code here to tear down your application
}
override func awakeFromNib() {
self.streetWebView.UIDelegate = self
self.streetWebView.resourceLoadDelegate = self
self.streetWebView.frameLoadDelegate = self
}
// pragma mark Bonjour Interface Methods
@IBAction func connectToService(sender: AnyObject) {
self.server.connectToRemoteService(self.services.objectAtIndex(selectedRow) as NSNetService)
}
func sendMessage(sender: AnyObject){
var data: NSData = textToSend.dataUsingEncoding(NSUTF8StringEncoding)!
var error: NSErrorPointer? = nil
self.server.sendData(data, error: error!)
}
// pragma mark Street View PHP JS Method Call
func loadStreetViewWithLatitude(latitudeString: NSString, longitudeString: NSString, headingString: NSString){
self.latitude = latitudeString
self.longitude = longitudeString
self.heading = headingString
var url = NSURL(string: "http://nrlab.csie.ntust.edu.tw/MapXplorer_Service/streetview.php?latitude=\(latitudeString)&longitude=\(longitudeString)&heading=\(headingString)")
var request = NSURLRequest(URL: url!)
self.streetWebView.mainFrame.loadRequest(request)
}
func adjustBearing(bearingString: NSString){
var numberFormatter = NSNumberFormatter()
numberFormatter.numberStyle = .DecimalStyle
var headingNumber: NSNumber! = numberFormatter.numberFromString(bearingString)
print("heading: ")
println(headingNumber)
var jsCallerObject = self.streetWebView.windowScriptObject
if headingNumber != nil{
var args = NSArray(object: headingNumber)
jsCallerObject.callWebScriptMethod("turnHeading",withArguments: args)
}
}
func adjustPitch(pitchString: NSString){
// Call JavaScript function on PHP pitch the street view camera
var numberFormatter = NSNumberFormatter()
numberFormatter.numberStyle = .DecimalStyle
var pitchNumber: NSNumber = numberFormatter.numberFromString(pitchString)!
// Save the latest pitch float value for later use.
// when we need to reset the pitch view
self.resetPitchFloat = pitchNumber.floatValue
var jsCallerObject = self.streetWebView.windowScriptObject
var args = NSArray(object: pitchNumber)
jsCallerObject.callWebScriptMethod("turnPitch", withArguments: args)
}
func resetPitch(){
var jsCallerObject = self.streetWebView.windowScriptObject
// ***
var args = NSArray(object: NSNumber(float: self.resetPitchFloat))
jsCallerObject.callWebScriptMethod("turnPitch", withArguments: args)
if self.resetPitchFloat == 0{
return
}else if fabs(self.resetPitchFloat) < 1{
self.resetPitchFloat = 0
}else {
self.resetPitchFloat /= 2
}
self.resetPitchTimer = NSTimer(timeInterval: 0.05, target: self, selector: "resetPitch", userInfo: nil, repeats: false)
}
func moveForward(){
NSLog("windowscript")
var jsCallerObject = self.streetWebView.windowScriptObject
jsCallerObject.callWebScriptMethod("moveForward", withArguments: nil)
}
func moveBackward(){
NSLog("windowscript")
var jsCallerObject = self.streetWebView.windowScriptObject
jsCallerObject.callWebScriptMethod("moveBackward", withArguments: nil)
}
func fastForward(){
var jsCallerObject = self.streetWebView.windowScriptObject
jsCallerObject.callWebScriptMethod("fastForward", withArguments: nil)
}
// Server & Client Delegate
func serverRemoteConnectionComplete(server: Server!) {
self.isConnectedToService = true
connectedRow = selectedRow
tableView.reloadData()
}
func serverStopped(server: Server!) {
self.isConnectedToService = false
connectedRow = -1
tableView.reloadData()
}
func server(server: Server!, didNotStart errorDict: [NSObject : AnyObject]!) {
}
func server(server: Server!, didAcceptData data: NSData!) {
var localMessage = NSString(data: data, encoding: NSUTF8StringEncoding)
if localMessage != nil && localMessage?.length > 0{
self.message = localMessage
}else{
self.message = "No data is received"
}
var messageComponents = self.message?.componentsSeparatedByString(",")
var messageHeader = messageComponents?[0] as NSString
if messageHeader.isEqualToString("Location"){
NSLog("On Long Press For LOCATION")
self.latitude = messageComponents?[1] as NSString
self.longitude = messageComponents?[2] as NSString
self.heading = messageComponents?[3] as NSString
println(self.latitude)
println(self.longitude)
println(self.heading)
// change location of street view
self.loadStreetViewWithLatitude(self.latitude, longitudeString: self.longitude, headingString: self.heading)
}else if messageHeader.isEqualToString("Bearing"){
if !lastMessageHeader.isEqualToString("Bearing"){
NSLog("On Acceleration or On Map Touch For ROTATION")
}
self.heading = messageComponents?[1] as NSString
// adjust street view bearing
self.adjustBearing(self.heading)
}else if messageHeader.isEqualToString("Pitch"){
if !lastMessageHeader.isEqualToString("Pitch"){
NSLog("On Pan For PITCH")
}
self.pitch = messageComponents?[1] as NSString
self.adjustPitch(self.pitch)
}else if messageHeader.isEqualToString("ResetPitch"){
self.resetPitch()
}else if messageHeader.isEqualToString("Forward"){
NSLog("On Pan For MOVING FORWARD")
self.moveForward()
}else if messageHeader.isEqualToString("Backward"){
NSLog("On Pan For MOVING BACKWARD")
self.moveBackward()
}else if messageHeader.isEqualToString("Jump"){
NSLog("On Shake For JUMP TO NEXT INTERSECTION")
self.fastForward()
}else if messageHeader.isEqualToString("OnMapTouchBegan"){
NSLog("On Map Touch Began")
}else if messageHeader.isEqualToString("OnPanTouchBegan"){
NSLog("On Pan Touch Began")
}else if messageHeader.isEqualToString("OnMapTouchEnd"){
NSLog("On Map Touch End")
}else if messageHeader.isEqualToString("OnPanTouchEnd"){
NSLog("On Pan Touch End")
}else if messageHeader.isEqualToString("Notification"){
NSLog("Notification: %@", messageComponents?[1] as String)
self.displayHUDNotification(messageComponents?[1]as NSString)
}
else{
NSLog("Go Fuck Yourself\n\n")
}
self.lastMessageHeader = messageHeader
}
func server(server: Server!, lostConnection errorDict: [NSObject : AnyObject]!) {
self.isConnectedToService = false
self.connectedRow = -1
tableView.reloadData()
}
func serviceAdded(service: NSNetService!, moreComing more: Bool) {
self.services.addObject(service)
if !more{
tableView.reloadData()
}
}
func serviceRemoved(service: NSNetService!, moreComing more: Bool) {
self.services.removeObject(service)
if !more{
tableView.reloadData()
}
}
// tableView
/* func tableView(TableView: NSTableView,
willDisplayCell Cell: AnyObject,
forTableColumn TableColumn: NSTableColumn?,
row rowIndex: Int){
if(rowIndex == self.connectedRow){
Cell.setTextColor(NSColor.redColor(), range: 1)
}else{
}
}
*/
func tableView(tableView: NSTableView!, objectValueForTableColumn tableColumn: NSTableColumn!, row: Int) -> AnyObject!
{
// var string:String = "row " + String(row) + ", Col" + String(tableColumn.identifier)
// return string
return self.services.objectAtIndex(row).name
//return "!!!"
}
func numberOfRowsInTableView(aTableView: NSTableView!) -> Int
{
return self.services.count
}
func tableViewSelectionDidChange(notification: NSNotification){
selectedRow = notification.object?.selectedRow
}
// pragma mark JavaScript bridge
override func webView(sender: WebView!, didClearWindowObject windowObject: WebScriptObject!, forFrame frame: WebFrame!){
windowObject.setValue(self, forKey: "mapXplorer")
}
override func webView(sender: WebView!, runJavaScriptAlertPanelWithMessage message: String!, initiatedByFrame frame: WebFrame!) {
}
override class func isKeyExcludedFromWebScript(name: UnsafePointer<Int8>) -> Bool{
if strcasecmp(name, "sharedValue") == 0{
return false
}
return true
}
override class func isSelectorExcludedFromWebScript(aSelector: Selector) -> Bool{
if aSelector == Selector("doOutputToLog") || aSelector == Selector("sendLatitude:longitude:movingHeading:pathLinks")
|| aSelector == Selector("sendNotification:withType"){
return false
}
return true
}
override class func webScriptNameForSelector(aSelector: Selector) -> String!{
if (aSelector == Selector("doOutputToLog")) {
return "log"
} else if (aSelector == Selector("sendLatitude:longitude:movingHeading:pathLinks")) {
return "syncLatitudeLongitudeHeadingPathlinks";
} else if (aSelector == Selector("sendNotification:withType")) {
return "notification";
} else {
return nil;
}
}
func doOutputToLog(log: NSString){
NSLog("EXTERNAL LOG: %@",log)
}
func sendLatitude(latitudeNumber:NSNumber, longitude longitudeNumber:NSNumber, movingHeading movingHeadingNumber:NSNumber, pathLinks numberOfPathLinks: NSNumber){
var locationMessage = NSString(format: "Location,%@,%@,%@,%@", latitudeNumber, longitudeNumber, movingHeadingNumber, numberOfPathLinks)
var data = locationMessage.dataUsingEncoding(NSUTF8StringEncoding)
var error: NSError? = nil
self.server?.sendData(data, error:&error)
}
// Extra function for notification
func endNotification(notification: NSString, type: NSString){
var notificationMessage = NSString(format: "Notification,%@,%@", notification, type)
var data = notificationMessage.dataUsingEncoding(NSUTF8StringEncoding)
var error: NSError? = nil
self.server?.sendData(data, error:&error)
}
func displayHUDNotification(notification: NSString){
self.notificationText.stringValue = notification
self.notificationWindow.setIsVisible(true)
self.notificationWindow.alphaValue = 1.0
NSTimer.scheduledTimerWithTimeInterval(3, target: self, selector: "fadeOutHUDNotification", userInfo: nil, repeats: false)
}
func fadeOutHUDNotification(){
self.notificationWindow.animator().alphaValue = 0.0
}
}
|
[
-1
] |
0bff57f1aca3d7bd584dd981e0fae2f531ccccf5
|
d9efd638d71179416932431a90634862d4915075
|
/CoolNotes/CoolNotes/CoreDataStack.swift
|
10009bb25ef90394d2909d3fc8d74499541ba96e
|
[] |
no_license
|
Rcwlol/IOS
|
69a5a60b1f94b8fc354e29d73f5eda9f39e86623
|
41551052d2e5f03a8cf5b01c0dcb10ff466f92a2
|
refs/heads/master
| 2020-04-02T05:46:16.300295 | 2016-07-15T22:56:27 | 2016-07-15T22:56:27 | 61,695,205 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 3,716 |
swift
|
//
// CoreDataStack.swift
// CoolNotes
//
// Created by Wong, Ryan C on 7/14/16.
// Copyright © 2016 Wong, Ryan C. All rights reserved.
//
import CoreData
struct CoreDataStack {
// MARK: - Properties
private let model : NSManagedObjectModel
private let coordinator : NSPersistentStoreCoordinator
private let modelURL : NSURL
private let dbURL : NSURL
let context : NSManagedObjectContext
// MARK: - Initializers
init?(modelName: String){
// Assumes the model is in the main bundle
guard let modelURL = NSBundle.mainBundle().URLForResource(modelName, withExtension: "momd") else {
print("Unable to find \(modelName)in the main bundle")
return nil}
self.modelURL = modelURL
// Try to create the model from the URL
guard let model = NSManagedObjectModel(contentsOfURL: modelURL) else{
print("unable to create a model from \(modelURL)")
return nil
}
self.model = model
// Create the store coordinator
coordinator = NSPersistentStoreCoordinator(managedObjectModel: model)
// create a context and add connect it to the coordinator
context = NSManagedObjectContext(concurrencyType: .MainQueueConcurrencyType)
context.persistentStoreCoordinator = coordinator
// Add a SQLite store located in the documents folder
let fm = NSFileManager.defaultManager()
guard let docUrl = fm.URLsForDirectory(.DocumentDirectory, inDomains: .UserDomainMask).first else{
print("Unable to reach the documents folder")
return nil
}
self.dbURL = docUrl.URLByAppendingPathComponent("model.sqlite")
do{
try addStoreCoordinator(NSSQLiteStoreType, configuration: nil, storeURL: dbURL, options: nil)
}catch{
print("unable to add store at \(dbURL)")
}
}
// MARK: - Utils
func addStoreCoordinator(storeType: String,
configuration: String?,
storeURL: NSURL,
options : [NSObject : AnyObject]?) throws{
try coordinator.addPersistentStoreWithType(NSSQLiteStoreType, configuration: nil, URL: dbURL, options: nil)
}
}
// MARK: - Removing data
extension CoreDataStack {
func dropAllData() throws{
// delete all the objects in the db. This won't delete the files, it will
// just leave empty tables.
try coordinator.destroyPersistentStoreAtURL(dbURL, withType:NSSQLiteStoreType , options: nil)
try addStoreCoordinator(NSSQLiteStoreType, configuration: nil, storeURL: dbURL, options: nil)
}
}
// MARK: - Save
extension CoreDataStack {
func saveContext() throws{
if context.hasChanges {
try context.save()
}
}
func autoSave(delayInSeconds : Int){
if delayInSeconds > 0 {
do{
try saveContext()
print("Autosaving")
}catch{
print("Error while autosaving")
}
let delayInNanoSeconds = UInt64(delayInSeconds) * NSEC_PER_SEC
let time = dispatch_time(DISPATCH_TIME_NOW, Int64(delayInNanoSeconds))
dispatch_after(time, dispatch_get_main_queue(), {
self.autoSave(delayInSeconds)
})
}
}
}
|
[
-1
] |
1b229d0cc40491292b6f3026472be4faa4348981
|
578d6f821db632471e06491e4bf55bfff521a767
|
/Shared/Models/ApiRequestArgs.swift
|
c39b649caec74b95e30a1e51346ef11ada25d277
|
[] |
no_license
|
veld-chat/ios-client
|
862deb8921884d5486359786459e57edc4a4bd82
|
37673e9dfdb46d9bc7e33adc33c8b0dd02c22978
|
refs/heads/main
| 2023-02-05T07:22:09.141980 | 2020-12-28T00:08:56 | 2020-12-28T00:08:56 | 324,460,467 | 2 | 1 | null | null | null | null |
UTF-8
|
Swift
| false | false | 204 |
swift
|
//
// ApiRequestArgs.swift
// chat (iOS)
//
// Created by Mike Veldsink on 26/12/2020.
//
import Foundation
struct SendMessageRequest: Encodable {
var content: String?;
var embed: Embed?;
}
|
[
-1
] |
74bd4f3dc0340ca43282e2e35d17f3c20e84a0aa
|
97421c48cdc2089299c3b04e3122cfc9c7333fb0
|
/Myweibo/Classes/Module/Home/View/Cell/YHStatusPictureView.swift
|
0e83838189b9f94d65692a3622c1df1a30873edd
|
[] |
no_license
|
lyhczz/swiftmyweibo
|
f8531b454364b48cf2a4637e8a79aea1b1358475
|
50d5f9535452e9f2fb55d8faeb1cddbd0ff2b781
|
refs/heads/master
| 2021-01-10T07:41:43.573361 | 2015-11-13T10:26:07 | 2015-11-13T10:26:07 | 45,247,854 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 7,301 |
swift
|
//
// YHStatusPictureView.swift
// Myweibo
//
// Created by mposthh on 15/11/2.
// Copyright © 2015年 mposhh. All rights reserved.
//
import UIKit
import SDWebImage
let YHStatusPictureViewCellSelectedPictureNotification = "YHStatusPictureViewCellSelectedPictureNotification"
let YHStatusPictureViewCellSelectedPictureURLKey = "YHStatusPictureViewCellSelectedPictureURLKey"
let YHStatusPictureViewCellSelectedPictureIndexPathKey = "YHStatusPictureViewCellSelectedPictureIndexKey"
let YHStatusPictureViewCellSelectedPictureModelKey = "YHStatusPictureViewCellSelectedPictureModelKey"
class YHStatusPictureView: UICollectionView {
// MARK: - 属性
// collectionView的布局
private var pictureLayout = UICollectionViewFlowLayout()
/// 微博模型
var status: YHStatus? {
didSet {
// 刷新数据
reloadData()
}
}
/// cellID
let pictrueViewCellReuseIdentifier = "pictrueViewCellReuseIdentifier"
// MARK: - 构造函数
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override init(frame: CGRect, collectionViewLayout layout: UICollectionViewLayout) {
super.init(frame: frame, collectionViewLayout: pictureLayout)
// 注册cell
registerClass(YHStatusPictureViewCell.self, forCellWithReuseIdentifier: pictrueViewCellReuseIdentifier)
// 设置数据源
dataSource = self
// 设置代理
delegate = self
// 设置颜色
backgroundColor = UIColor(white: 0.96, alpha: 0.9)
}
/// 计算配图宽高
func calcViewSize() -> CGSize {
// 每个item的size
let itemSize = CGSize(width: 90, height: 90)
// 设置布局的size
pictureLayout.itemSize = itemSize
pictureLayout.minimumLineSpacing = 0
pictureLayout.minimumInteritemSpacing = 0
// item之间的间距
let margin: CGFloat = 10
// 最大列数
let column = 3
// 获得配图的数量
let count = status?.pictureURLs?.count ?? 0
// 根据配图数量计算尺寸
// 没有图片
if count == 0 {
return CGSizeZero
}
// 只有一张图片
if count == 1 {
var size = CGSize(width: 150, height: 120)
// pictureLayout.itemSize = size
// return size
// 获取图片url地址
let urlSring = status!.pictureURLs![0].absoluteString
// 获取图片,根据图片返回size
if let image = SDWebImageManager.sharedManager().imageCache.imageFromDiskCacheForKey(urlSring) {
size = image.size
}
// 有些图片宽度很小
if size.width < 40 {
size.width = 40
}
pictureLayout.itemSize = size
return size
}
// 超过一张图片,设置间距
pictureLayout.minimumInteritemSpacing = margin
pictureLayout.minimumLineSpacing = margin
// 4张图片
if count == 4 {
let width = itemSize.width * 2 + margin
return CGSize(width: width, height: width)
}
// 其他
// 计算行数
let row = (count + column - 1) / column
// 宽度
let width = itemSize.width * CGFloat(column) + margin * (CGFloat(column) - 1)
// 高度
let height = itemSize.width * CGFloat(row) + margin * (CGFloat(row) - 1)
return CGSize(width: width, height: height)
}
}
// MARK: - 扩展,实现数据源
extension YHStatusPictureView: UICollectionViewDataSource, UICollectionViewDelegate {
func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return status?.pictureURLs?.count ?? 0
}
func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCellWithReuseIdentifier(pictrueViewCellReuseIdentifier, forIndexPath: indexPath) as! YHStatusPictureViewCell
// cell.backgroundColor = UIColor.redColor()
cell.imageUrl = status?.pictureURLs?[indexPath.item]
return cell
}
func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) {
let count = status?.largePictureURLs?.count ?? 0
// 创建模型数组
var models = [YHPhotoBrowserModel]()
// 遍历,创建模型
for index in 0..<count {
let model = YHPhotoBrowserModel()
// 设置url
model.imageUrl = status?.largePictureURLs![index]
// 获取对应的cell
let cell = collectionView.cellForItemAtIndexPath(NSIndexPath(forItem: index, inSection: 0)) as! YHStatusPictureViewCell
// 设置imageView
model.imageView = cell.iconView
// 添加到数组
models.append(model)
}
let userInfo: [String: AnyObject] = [
YHStatusPictureViewCellSelectedPictureModelKey: models,
YHStatusPictureViewCellSelectedPictureIndexPathKey: indexPath
]
// 需要将cell的点击事件传递给控制器,通过通知的方法
NSNotificationCenter.defaultCenter().postNotificationName(YHStatusPictureViewCellSelectedPictureNotification, object: self, userInfo: userInfo)
}
}
// MARK: - 自定义cell
class YHStatusPictureViewCell: UICollectionViewCell {
// MARK: - 属性
var imageUrl: NSURL? {
didSet {
// 加载图片
iconView.sd_setImageWithURL(imageUrl)
// 判断是否是gif
let gif = (imageUrl!.absoluteString as NSString).pathExtension.lowercaseString == "gif"
gifImageView.hidden = !gif
}
}
// MARK: - 构造函数
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override init(frame: CGRect) {
super.init(frame: frame)
// 准备UI
prepareUI()
}
// MARK: - 准备UI
private func prepareUI() {
// 添加子控件
contentView.addSubview(iconView)
contentView.addSubview(gifImageView)
// 添加约束
iconView.ff_Fill(iconView)
gifImageView.ff_AlignInner(type: ff_AlignType.BottomRight, referView: contentView, size: nil)
}
// MARK: - 懒加载控件
private lazy var iconView: UIImageView = {
let imageView = UIImageView()
imageView.contentMode = UIViewContentMode.ScaleAspectFill
imageView.clipsToBounds = true
return imageView
}()
/// git 图标
private lazy var gifImageView: UIImageView = UIImageView(image: UIImage(named: "timeline_image_gif"))
}
|
[
-1
] |
a4b16a7337cb8289b20958e0c9987d0c8ac03a62
|
5a02bdd9d9cd5294e34c1bda7d5c2ca1a9825e99
|
/Build/Intermediates/SwiftMigration/CoreDataSampleApp/Intermediates.noindex/CoreDataSampleApp.build/Debug-iphonesimulator/CoreDataSampleApp.build/DerivedSources/CoreDataGenerated/CoreDataSampleApp/Person+CoreDataClass.swift
|
08d7b4c7a640a4235869b64e0117a9c1a3c9fe6f
|
[] |
no_license
|
imdinesh58/Dynamic-TEXTSVIEW
|
7c399462b5e1abc5ecc42978d95b03c1908d305f
|
7c21a6c57a761f4bdb6d2a86e5491334e4a7c5cf
|
refs/heads/master
| 2021-01-24T04:28:45.254289 | 2018-02-26T08:29:33 | 2018-02-26T08:29:33 | 122,937,767 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 244 |
swift
|
//
// Person+CoreDataClass.swift
//
//
// Created by Apple-1 on 22/01/18.
//
// This file was automatically generated and should not be edited.
//
import Foundation
import CoreData
@objc(Person)
public class Person: NSManagedObject {
}
|
[
-1
] |
3c44f3952594981f5b408d75fb10dbf9ed0359a8
|
06b22d59170e03aaa633a393ff4c2694415aaf48
|
/20180927-TurzoEsfar-NYCSchools/ViewModel/DetailsViewModel.swift
|
f368a5434c6fb6edbe93bd338f41ff8dd9412773
|
[] |
no_license
|
turzoalam/20180927-TurzoEsfar-NYCSchools
|
14d39c1ff61c7010daca703eda66443dd14db03d
|
c618c83aa88ee11877fd808b82db47887e3837bb
|
refs/heads/master
| 2020-03-30T04:50:27.495115 | 2018-09-28T17:01:30 | 2018-09-28T17:01:30 | 150,764,821 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,094 |
swift
|
//
// DetailsViewModel.swift
// 20180927-TurzoEsfar-NYCSchools
//
// Created by AM Esfar-E-Alam on 9/27/18.
// Copyright © 2018 AM Esfar-E-Alam. All rights reserved.
//
import Foundation
//Viewmodel to communicate with DetailsViewController
class DetailsViewModel {
var satData:NYCSchoolSATModel!
//provide NYC school SAT data to DetailViewController
func getDetailsSATViewData(dbn:String, completionHandler:@escaping (NYCSchoolSATModel?, Error?)-> Void) {
var desiredResult:NYCSchoolSATModel?
guard let url = URL(string: "https://data.cityofnewyork.us/resource/734v-jeq5.json") else {
return
}
DataLoader().loadNYCSATData(from: url) { (result, error) in
if let error = error {
completionHandler(desiredResult, error)
}
let filteredObj = result.filter({$0.dbn == dbn})
if filteredObj.count == 1 {
desiredResult = filteredObj.first
}
completionHandler(desiredResult,error)
}
}
}
|
[
-1
] |
90c55a62b7c2c27b0e4a070586af76653fa6b959
|
33360091253f796ada2224541959c47ef47e3e9e
|
/AppDelegate.swift
|
7a2005a806b570c92577430a64de4a3e61bb2690
|
[] |
no_license
|
natashkela/Sci-Facts
|
e8af64c337687a9bf274fe2edbd0dcfb33015e42
|
555ce9c56e5a1e46b989e3946f084b392e102012
|
refs/heads/master
| 2021-01-22T04:27:47.696522 | 2017-05-26T02:38:17 | 2017-05-26T02:38:17 | 92,464,019 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,185 |
swift
|
//
// AppDelegate.swift
// Sci-Fact
//
// Created by Nata Vacheishvili on 5/26/17.
// Copyright © 2017 Web Technology LTD. 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,
294950,
229415,
229417,
327722,
237613,
229422,
229426,
237618,
229428,
311349,
286774,
286776,
319544,
286778,
229432,
204856,
352318,
286791,
237640,
286797,
278605,
311375,
163920,
196692,
319573,
311383,
278623,
278626,
319590,
311400,
278635,
303212,
278639,
131192,
237693,
303230,
327814,
303241,
131209,
417930,
303244,
311436,
319633,
286873,
286876,
311460,
311469,
32944,
327862,
286906,
327866,
180413,
286910,
286916,
295110,
286922,
286924,
286926,
319694,
286928,
131281,
131278,
278743,
278747,
295133,
131299,
319716,
237807,
303345,
286962,
131314,
229622,
327930,
278781,
278783,
278785,
237826,
319751,
286987,
319757,
311569,
286999,
319770,
287003,
287006,
287009,
287012,
287014,
287016,
287019,
311598,
287023,
311601,
295220,
155966,
319809,
319810,
278849,
319814,
311623,
319818,
311628,
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,
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,
287238,
320007,
279051,
172558,
279055,
303632,
279058,
303637,
279063,
279067,
172572,
279072,
172577,
295459,
172581,
295461,
279082,
279084,
172591,
172598,
172607,
172609,
172612,
377413,
172614,
172618,
303690,
33357,
303696,
279124,
172634,
262752,
172644,
311911,
189034,
295533,
172655,
172656,
352880,
295538,
189040,
172660,
287349,
189044,
189039,
287355,
287360,
295553,
172675,
295557,
311942,
303751,
287365,
352905,
311946,
287371,
279178,
311951,
287377,
172691,
287381,
311957,
221850,
287386,
230045,
172702,
287390,
303773,
172705,
287394,
172707,
303780,
164509,
287398,
205479,
287400,
279208,
172714,
295595,
279212,
189102,
172721,
287409,
66227,
303797,
189114,
287419,
328381,
287423,
328384,
172737,
279231,
287427,
312005,
107208,
172748,
287436,
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,
369433,
295707,
328476,
295710,
230175,
295720,
303914,
279340,
279353,
230202,
312124,
328508,
222018,
295755,
377676,
148302,
287569,
303959,
230237,
279390,
230241,
303976,
336744,
303985,
303987,
328563,
303991,
303997,
295806,
295808,
295813,
304005,
320391,
304007,
304009,
213895,
304011,
304013,
295822,
189325,
213902,
189329,
295825,
304019,
279438,
58262,
304023,
304027,
279452,
279461,
279462,
304042,
213931,
230327,
304055,
287675,
230334,
304063,
238528,
304065,
213954,
189378,
156612,
197580,
312272,
304090,
320481,
304106,
320490,
312302,
328687,
320496,
304114,
295928,
320505,
295945,
230413,
197645,
295949,
320528,
140312,
295961,
238620,
304164,
304170,
304175,
238641,
238652,
238655,
230465,
238658,
336964,
296004,
205895,
320584,
238666,
296021,
402518,
336987,
230497,
296036,
296040,
361576,
205931,
296044,
164973,
205934,
312432,
337018,
189562,
279679,
304258,
279683,
205968,
296084,
238745,
304285,
238756,
205991,
222377,
165035,
337067,
238766,
165038,
230576,
238770,
304311,
230592,
312518,
279750,
230600,
230607,
148690,
320727,
304348,
304354,
296163,
320740,
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,
296259,
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,
296331,
288140,
288144,
230800,
337306,
288154,
288160,
173472,
288162,
288164,
279975,
304555,
370092,
279983,
173488,
288176,
279985,
312755,
296373,
312759,
279991,
288185,
337335,
222652,
312766,
173507,
296389,
222665,
230860,
312783,
288208,
230865,
288210,
148946,
222676,
288212,
288214,
370130,
280021,
329177,
288217,
288218,
280027,
288220,
239070,
239064,
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,
402969,
230940,
222752,
108066,
296486,
296488,
157229,
239152,
230961,
157236,
288320,
288325,
124489,
280145,
288338,
280149,
288344,
280152,
239194,
280158,
403039,
370272,
239202,
370279,
312938,
280183,
280191,
116354,
280194,
280208,
280211,
288408,
280222,
419489,
190118,
198310,
321195,
296622,
321200,
337585,
296626,
296634,
296637,
419522,
280260,
419525,
206536,
280264,
206539,
206541,
206543,
313044,
280276,
321239,
280283,
313052,
18140,
288478,
313055,
321252,
313066,
288494,
280302,
321266,
288499,
419570,
288502,
280314,
288510,
124671,
280324,
198405,
280331,
198416,
296723,
116503,
321304,
329498,
296731,
321311,
313121,
313123,
304932,
321316,
280363,
141101,
165678,
280375,
321336,
296767,
288576,
345921,
337732,
280388,
304968,
280402,
173907,
313171,
313176,
42842,
280419,
321381,
296809,
296812,
313201,
1920,
255873,
305028,
280454,
247688,
124817,
280468,
239510,
280473,
124827,
247709,
214944,
313258,
321458,
296883,
124853,
214966,
296890,
10170,
288700,
296894,
190403,
296900,
280515,
337862,
165831,
280521,
231379,
296921,
354265,
354270,
239586,
313320,
354281,
231404,
124913,
165876,
321528,
239612,
313340,
288764,
239617,
313347,
288773,
313358,
305176,
313371,
354338,
305191,
223273,
313386,
354348,
124978,
215090,
124980,
288824,
288826,
321595,
378941,
313406,
288831,
288836,
67654,
280651,
354382,
288848,
280658,
215123,
354390,
288855,
288859,
280669,
313438,
149599,
280671,
149601,
321634,
149603,
223327,
280681,
313451,
223341,
280687,
149618,
215154,
313458,
280691,
313464,
329850,
321659,
288895,
321670,
215175,
141455,
275606,
280725,
313498,
100520,
280747,
288940,
288947,
280755,
321717,
280759,
280764,
280769,
280771,
280774,
280776,
313548,
321740,
280783,
280786,
280788,
313557,
280793,
280796,
280798,
338147,
280804,
280807,
280811,
280817,
125171,
280819,
157940,
182517,
280823,
280825,
280827,
280830,
280831,
280833,
125187,
280835,
125191,
125207,
125209,
321817,
125218,
321842,
223539,
125239,
305464,
280888,
280891,
289087,
108865,
280897,
280900,
305480,
239944,
280906,
239947,
305485,
305489,
280919,
248153,
215387,
354653,
313700,
280937,
313705,
190832,
280946,
223606,
313720,
280956,
239997,
280959,
313731,
199051,
240011,
289166,
240017,
297363,
190868,
240021,
297365,
297368,
297372,
141725,
297377,
289186,
297391,
289201,
240052,
289207,
289210,
305594,
281024,
289218,
289227,
436684,
281047,
166378,
305647,
281075,
174580,
240124,
281084,
305662,
305664,
240129,
305666,
305668,
223749,
240132,
330244,
223752,
150025,
338440,
281095,
223757,
281102,
223763,
223765,
322074,
281116,
182819,
289317,
281127,
281135,
150066,
158262,
158266,
289342,
281154,
322115,
158283,
338528,
338532,
199273,
281196,
19053,
158317,
313973,
297594,
281210,
158347,
264845,
182926,
133776,
182929,
314003,
117398,
314007,
289436,
174754,
330404,
289448,
133801,
174764,
314029,
314033,
240309,
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,
174955,
224110,
207733,
207737,
158596,
183172,
338823,
322440,
314249,
183184,
142226,
289687,
224151,
240535,
289694,
289696,
289700,
289712,
281529,
289724,
183260,
420829,
289762,
322534,
297961,
183277,
322550,
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,
306377,
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,
314723,
281960,
150890,
306539,
314732,
314736,
290161,
216436,
306549,
298358,
314743,
306552,
290171,
314747,
298365,
290174,
306555,
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,
282089,
191985,
282098,
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,
282186,
224849,
282195,
282201,
306778,
159324,
159330,
314979,
298598,
323176,
224875,
241260,
323181,
257658,
315016,
282249,
290445,
282255,
282261,
175770,
298651,
282269,
323229,
298655,
323231,
282277,
306856,
196133,
282295,
323260,
282300,
323266,
282310,
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,
315211,
307027,
315221,
315223,
241496,
241498,
307035,
307040,
110433,
282465,
241509,
110438,
298860,
110445,
282478,
315249,
315253,
315255,
339838,
315267,
315269,
241544,
282505,
241546,
241548,
298896,
298898,
282514,
241556,
44948,
298901,
241560,
282520,
241563,
241565,
241567,
241569,
282531,
241574,
282537,
298922,
241581,
241583,
323504,
241586,
290739,
241588,
282547,
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,
102438,
217127,
282669,
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,
307338,
233613,
241813,
307352,
299164,
299167,
315552,
184479,
184481,
184486,
307370,
307372,
307374,
307376,
299185,
323763,
184503,
299191,
307385,
176311,
258235,
307388,
176316,
307390,
299200,
307394,
299204,
307396,
184518,
307399,
323784,
233679,
307409,
307411,
299225,
233701,
307432,
282881,
184586,
282893,
291089,
282906,
291104,
233766,
299304,
295583,
307508,
315701,
332086,
307510,
307512,
307515,
307518,
282942,
282947,
323917,
282957,
233808,
323921,
315733,
323926,
233815,
315739,
299357,
242018,
242024,
299373,
315757,
250231,
242043,
315771,
299391,
291202,
299398,
242057,
291212,
299405,
291222,
315801,
291226,
242075,
283033,
61855,
291231,
283042,
291238,
291241,
127403,
127405,
291247,
299440,
127407,
299444,
127413,
291254,
283062,
127417,
291260,
127421,
127424,
299457,
127429,
127431,
127434,
315856,
127440,
176592,
315860,
176597,
127447,
283095,
299481,
127449,
176605,
242143,
127455,
127457,
291299,
127460,
340454,
127463,
242152,
291305,
127466,
176620,
127469,
127474,
291314,
291317,
127480,
135672,
291323,
233979,
127485,
291330,
127490,
127494,
283142,
127497,
233994,
135689,
127500,
233998,
127506,
234003,
127509,
234006,
127511,
152087,
283161,
242202,
234010,
135707,
135710,
242206,
242208,
291361,
242220,
291378,
234038,
152118,
234041,
315961,
70213,
111193,
242275,
299620,
242279,
168562,
184952,
135805,
135808,
291456,
135820,
316051,
225941,
316054,
299672,
135834,
373404,
299677,
135839,
299680,
225954,
299684,
135844,
242343,
209576,
242345,
373421,
299706,
135870,
135873,
135876,
135879,
299720,
299723,
299726,
225998,
226002,
119509,
226005,
299740,
201444,
299750,
283368,
234219,
283372,
185074,
226037,
283382,
316151,
234231,
234236,
226045,
242431,
234239,
209665,
234242,
299778,
242436,
234246,
226056,
291593,
234248,
242443,
234252,
242445,
234254,
291601,
234258,
242450,
242452,
234261,
348950,
201496,
234264,
234266,
234269,
283421,
234272,
234274,
152355,
299814,
234278,
283432,
234281,
234284,
234287,
283440,
185138,
242483,
234292,
234296,
234298,
160572,
283452,
234302,
234307,
242499,
234309,
316233,
234313,
316235,
234316,
283468,
234319,
242511,
234321,
234324,
185173,
201557,
234329,
234333,
308063,
234336,
242530,
349027,
234338,
234341,
234344,
234347,
177004,
234350,
324464,
234353,
152435,
177011,
234356,
234358,
234362,
226171,
291711,
234368,
291714,
234370,
291716,
234373,
226182,
234375,
201603,
308105,
226185,
234379,
324490,
234384,
234390,
226200,
234393,
209818,
308123,
234396,
324508,
291742,
324504,
234398,
234401,
291747,
291748,
234405,
291750,
324518,
324520,
234407,
324522,
234410,
291756,
291754,
226220,
324527,
291760,
234417,
234414,
324531,
201650,
234422,
226230,
324536,
234428,
291773,
242623,
324544,
234431,
234434,
324546,
226239,
226245,
234437,
234439,
324548,
234443,
291788,
193486,
234446,
193488,
234449,
316370,
275406,
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,
234546,
275508,
300085,
234549,
300088,
234553,
234556,
234558,
316479,
234561,
316483,
160835,
234563,
308291,
234568,
234570,
316491,
234572,
300108,
234574,
300115,
234580,
234581,
234585,
275545,
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,
324757,
234647,
234648,
226453,
234650,
308379,
275608,
300189,
324766,
119967,
234653,
283805,
234657,
324768,
242852,
300197,
234661,
283813,
234664,
275626,
234667,
316596,
308414,
234687,
300226,
308418,
234692,
300229,
308420,
308422,
283844,
300234,
283850,
300238,
300241,
316625,
300243,
300245,
316630,
300248,
300253,
300256,
300258,
300260,
234726,
300263,
300265,
300267,
300270,
300272,
120053,
300278,
275703,
316663,
300284,
275710,
300287,
292097,
300289,
161027,
300292,
300294,
275719,
234760,
177419,
300299,
242957,
300301,
349451,
177424,
275725,
283917,
349464,
415009,
283939,
259367,
292143,
283951,
300344,
243003,
283963,
226628,
300357,
283973,
177482,
283983,
316758,
357722,
316766,
292192,
316768,
218464,
292197,
316774,
218473,
136562,
324978,
333178,
275834,
275840,
316803,
316806,
316811,
316814,
226703,
300433,
234899,
300436,
226709,
357783,
316824,
316826,
300448,
144807,
144810,
144812,
284076,
144814,
227426,
144820,
374196,
284084,
292279,
284087,
144826,
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,
243268,
284231,
226886,
128584,
284234,
276043,
317004,
366155,
284238,
226895,
284241,
194130,
284243,
300628,
284245,
292433,
284247,
317015,
235097,
243290,
284249,
276052,
276053,
300638,
284251,
284253,
284255,
284258,
292452,
292454,
284263,
284265,
292458,
284267,
292461,
284272,
284274,
284278,
292470,
276086,
292473,
284283,
276093,
284286,
292479,
284288,
292481,
284290,
325250,
284292,
292485,
276095,
276098,
284297,
317066,
284299,
317068,
284301,
276109,
284303,
284306,
276114,
284308,
284312,
284314,
284316,
276127,
284320,
284322,
284327,
284329,
317098,
284331,
276137,
284333,
284335,
276144,
284337,
284339,
300726,
284343,
284346,
284350,
358080,
276160,
284354,
358083,
284358,
276166,
358089,
284362,
284365,
276175,
284368,
276177,
284370,
358098,
284372,
317138,
284377,
284379,
284381,
284384,
358114,
284386,
358116,
317158,
358119,
284392,
325353,
358122,
284394,
284397,
358126,
284399,
358128,
276206,
358133,
358135,
276216,
358138,
300795,
358140,
284413,
358142,
358146,
317187,
284418,
317189,
317191,
284428,
300816,
300819,
317207,
300828,
300830,
276255,
300832,
325408,
300834,
317221,
227109,
358183,
276268,
300845,
243504,
300850,
284469,
276280,
325436,
358206,
366406,
276295,
292681,
153417,
358224,
276308,
284502,
317271,
276315,
292700,
317279,
284511,
292715,
300912,
292721,
284529,
300915,
292729,
317306,
284540,
292734,
325512,
317332,
358292,
399252,
284564,
284566,
350106,
284572,
276386,
284579,
276388,
358312,
317353,
292776,
284585,
276395,
292784,
358326,
161718,
358330,
276411,
276418,
301009,
301011,
301013,
292823,
358360,
301017,
301015,
292828,
276446,
153568,
276448,
292839,
276455,
350186,
292843,
276460,
292845,
178161,
227314,
276466,
325624,
350200,
276472,
317435,
276476,
276479,
350210,
276482,
178181,
317446,
276485,
350218,
276490,
292876,
350222,
317456,
276496,
317458,
178195,
243733,
243740,
317468,
317472,
325666,
243751,
292904,
178224,
276528,
243762,
309298,
325685,
325689,
235579,
325692,
276539,
178238,
235581,
276544,
243779,
325700,
284739,
292934,
243785,
276553,
350293,
350295,
309337,
227418,
194649,
350302,
194654,
350304,
178273,
309346,
227423,
194660,
350308,
309350,
309348,
292968,
309352,
350313,
309354,
350316,
227430,
276583,
301167,
276590,
350321,
284786,
276595,
301163,
350325,
252022,
227440,
350328,
292985,
301178,
350332,
292989,
301185,
292993,
350339,
317570,
317573,
350342,
350345,
350349,
301199,
317584,
325777,
350354,
350357,
350359,
350362,
350366,
350375,
350379,
350381,
350383,
129200,
350385,
350387,
350389,
350395,
350397,
350399,
227520,
350402,
227522,
301252,
350406,
227529,
301258,
309450,
276685,
309455,
276689,
309462,
301272,
194780,
309468,
309471,
301283,
317672,
317674,
325867,
227571,
309491,
309494,
243960,
227583,
276735,
227587,
276739,
227596,
325910,
309530,
342298,
211232,
317729,
276775,
211241,
325937,
325943,
211260,
260421,
276809,
285002,
276811,
235853,
235858,
276829,
276833,
391523,
276836,
293227,
293232,
276848,
186744,
211324,
227709,
285061,
366983,
317833,
178572,
285070,
285077,
227738,
317853,
276896,
317858,
342434,
317864,
276907,
235955,
276917,
293304,
293307,
293314,
309707,
293325,
129486,
317910,
293336,
235996,
317917,
293343,
358880,
276961,
293346,
227810,
276964,
293352,
236013,
293364,
301562,
293370,
317951,
309764,
301575,
121352,
293387,
236043,
342541,
113167,
309779,
317971,
309781,
277011,
55837,
227877,
227879,
293417,
227882,
309804,
293421,
105007,
236082,
23094,
277054,
219714,
129603,
301636,
318020,
301639,
301643,
285265,
399955,
309844,
277080,
309849,
285282,
326244,
318055,
277100,
121458,
170619,
309885,
309888,
277122,
277128,
301706,
318092,
326285,
334476,
318094,
277136,
277139,
227992,
334488,
318108,
285340,
318110,
227998,
137889,
383658,
285357,
318128,
277170,
293555,
342707,
154292,
277173,
318132,
277177,
277181,
318144,
277187,
277194,
277196,
277201,
342745,
137946,
342747,
113378,
228069,
277223,
342760,
285417,
56043,
56045,
277232,
228081,
56059,
310015,
285441,
310020,
285448,
310029,
228113,
285459,
277273,
293659,
326430,
228128,
285474,
293666,
228135,
318248,
277291,
318253,
293677,
285489,
301876,
293685,
285494,
301880,
301884,
293696,
310080,
277317,
277322,
162643,
310100,
301911,
301913,
277337,
301921,
236397,
162671,
326514,
310134,
236408,
277368,
416639,
416640,
113538,
310147,
416648,
277385,
39817,
187274,
301972,
424853,
277405,
277411,
310179,
293798,
293802,
236460,
277426,
293811,
276579,
293817,
293820,
203715,
326603,
342994,
276586,
293849,
293861,
228327,
228328,
318442,
228330,
228332,
326638,
277486,
351217,
318450,
293876,
293877,
285686,
302073,
121850,
293882,
302075,
244731,
285690,
293887,
277504,
277507,
277511,
293899,
293908,
302105,
293917,
293939,
318516,
277561,
277564,
310336,
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,
277671,
302248,
64682,
277678,
294063,
294065,
302258,
277687,
294072,
318651,
294076,
277695,
318657,
244930,
130244,
302277,
228550,
302282,
310476,
302285,
302288,
310481,
302290,
203987,
302292,
302294,
310486,
302296,
384222,
310498,
285927,
318698,
302315,
228592,
294132,
138485,
228601,
204026,
228606,
64768,
310531,
138505,
228617,
318742,
277798,
130345,
113964,
285997,
384302,
285999,
113969,
318773,
318776,
286010,
417086,
286016,
302403,
294211,
384328,
294221,
146765,
294223,
326991,
179547,
146784,
302436,
294246,
327015,
310632,
327017,
351594,
351607,
310648,
310651,
310657,
351619,
294276,
310659,
327046,
253320,
310665,
318858,
310672,
351633,
310689,
130468,
228776,
277932,
310703,
310710,
130486,
310712,
310715,
302526,
228799,
302534,
310727,
245191,
64966,
302541,
302543,
310737,
228825,
163290,
310749,
310755,
187880,
310764,
286188,
310772,
40440,
212472,
40443,
286203,
40448,
228864,
286214,
228871,
302603,
302614,
302617,
286233,
302621,
286240,
187936,
146977,
187939,
40484,
294435,
40486,
286246,
294440,
40488,
294439,
294443,
40491,
294445,
245288,
310831,
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,
294521,
343679,
294537,
310925,
286354,
278163,
302740,
122517,
278168,
179870,
327333,
229030,
302764,
278188,
278192,
319153,
278196,
302781,
319171,
302789,
294599,
278216,
294601,
302793,
343757,
212690,
319187,
286420,
278227,
229076,
286425,
319194,
278235,
229086,
278238,
294625,
294634,
302838,
319226,
286460,
278274,
302852,
278277,
302854,
294664,
311048,
352008,
319243,
311053,
302862,
319251,
294682,
278306,
188199,
294701,
319280,
278320,
319290,
229192,
302925,
188247,
188252,
237409,
229233,
294776,
294785,
327554,
360322,
294803,
40851,
294811,
237470,
319390,
40865,
319394,
294817,
294821,
311209,
343983,
294831,
188340,
40886,
319419,
294844,
294847,
393177,
294876,
294879,
294883,
393190,
311279,
278513,
237555,
311283,
278519,
237562
] |
e2d76a0e75ddfd88666b6079feea92c342064b31
|
51d7df42ce65aa43da1a46a5cb8f92a3f78b3d25
|
/SpotsTests/iOS/TestListComposite.swift
|
a26789106d6eb7bc4cd4eb91518e044f9a9450b2
|
[
"MIT"
] |
permissive
|
orta/Spots
|
aab7fbd4105ef0a987ddfc562809522a967f4eef
|
ee2f9f3af37d1720313ecba8d1a4b57700136d77
|
refs/heads/master
| 2021-01-19T13:20:18.156101 | 2017-02-09T10:09:01 | 2017-02-09T10:09:01 | 82,387,933 | 2 | 0 | null | 2017-02-18T13:16:55 | 2017-02-18T13:16:55 | null |
UTF-8
|
Swift
| false | false | 1,525 |
swift
|
@testable import Spots
import Brick
import Foundation
import XCTest
class ListCompositeTests: XCTestCase {
func testListComposite() {
let view = ListComposite()
var item = Item()
let gridSpot = CompositeSpot(spot: GridSpot(component: Component(span: 1)), itemIndex: 0)
view.configure(&item, compositeSpots: [gridSpot])
XCTAssertTrue(view.contentView.subviews.count == 1)
let carouselSpot = CompositeSpot(spot: CarouselSpot(component: Component(span: 1)), itemIndex: 0)
let listSpot = CompositeSpot(spot: ListSpot(component: Component(span: 1)), itemIndex: 0)
view.configure(&item, compositeSpots: [carouselSpot, listSpot])
XCTAssertTrue(view.contentView.subviews.count == 3)
XCTAssertTrue(view.contentView.subviews[0] is UICollectionView)
XCTAssertTrue(view.contentView.subviews[1] is UICollectionView)
XCTAssertTrue(view.contentView.subviews[2] is UITableView)
view.prepareForReuse()
XCTAssertTrue(view.contentView.subviews.count == 0)
view.configure(&item, compositeSpots: nil)
XCTAssertTrue(view.contentView.subviews.count == 0)
view.configure(&item, compositeSpots: [carouselSpot, listSpot])
XCTAssertTrue(view.contentView.subviews.count == 2)
XCTAssertTrue(view.contentView.subviews[0] is UICollectionView)
XCTAssertTrue(view.contentView.subviews[1] is UITableView)
let customView = UIView()
view.contentView.addSubview(customView)
view.prepareForReuse()
XCTAssertTrue(view.contentView.subviews.count == 1)
}
}
|
[
-1
] |
8bffadb476029c37d74da4b25c890d051874ef0a
|
23544c06b4047aab2eaaa14b3d12b1c04ea934e6
|
/mobilecv/Model/CategoryModel.swift
|
d277f14d8f8c711fa434ae853b1ef43bb664fb2e
|
[] |
no_license
|
toandk/MobileCV
|
e8d517b99325e89c0aa40b673b00a480622f9877
|
e83d2182e91150c97df7fa3d5df5b6b4757afca9
|
refs/heads/master
| 2020-03-27T10:35:00.377945 | 2018-08-30T09:53:49 | 2018-08-30T09:53:49 | 146,430,275 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 583 |
swift
|
//
// CategoryModel.swift
// mobilecv
//
// Created by Do Toan on 8/26/18.
// Copyright © 2018 Do Toan. All rights reserved.
//
import UIKit
import ObjectMapper
class CategoryModel: Mappable {
var name: String?
var cover: String?
var categoryId: String?
var listResume: [ResumeModel]?
required init?(map: Map) {
}
// Mappable
func mapping(map: Map) {
name <- map["name"]
cover <- map["cover"]
categoryId <- map["categoryId"]
// listUser <- map["users"]
}
}
|
[
-1
] |
fb247390981a968e617f47f96b65c6ccc0ce9037
|
1f3e3485e2d6c3379c3cbf0f547d6a902edcceef
|
/Tests/ISDBTibsTests/TibsCompilationDatabaseTests.swift
|
a26a983f48a0c31d2adab31726a9f1ee9e1b86be
|
[
"Apache-2.0",
"Swift-exception"
] |
permissive
|
FYI-Apple/indexstore-db
|
e2ce4a4069dd0ea807e2e7e9670a0702f575b3f1
|
602a31573239a594cddd6e97d226c917928a8974
|
refs/heads/master
| 2022-04-23T07:39:00.253881 | 2020-04-23T18:20:11 | 2020-04-23T18:20:11 | 259,194,811 | 1 | 0 |
Apache-2.0
| 2020-04-27T03:27:25 | 2020-04-27T03:27:25 | null |
UTF-8
|
Swift
| false | false | 5,385 |
swift
|
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2019 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
import ISDBTibs
import Foundation
import XCTest
final class TibsCompilationDatabaseTests: XCTestCase {
static let fakeToolchain: TibsToolchain = TibsToolchain(
swiftc: URL(fileURLWithPath: "/swiftc"),
clang: URL(fileURLWithPath: "/clang"),
tibs: URL(fileURLWithPath: "/tibs"),
ninja: URL(fileURLWithPath: "/ninja"))
typealias Command = JSONCompilationDatabase.Command
public func testCompilationDatabaseSwiftModule() throws {
let dir = projectDir("SwiftModules")
let m = try TibsManifest.load(projectRoot: dir)
let tc = TibsCompilationDatabaseTests.fakeToolchain
let src = URL(fileURLWithPath: "/src", isDirectory: true)
let build = URL(fileURLWithPath: "/build", isDirectory: true)
let builder = try TibsBuilder(manifest: m, sourceRoot: src, buildRoot: build, toolchain: tc)
let sdkargs = TibsBuilder.defaultSDKPath.map { ["-sdk", $0] } ?? []
let expected = JSONCompilationDatabase(commands: [
Command(
directory: "/build",
file: "/src/a.swift",
arguments: [
"/swiftc", "/src/a.swift",
"-module-name", "A",
"-index-store-path", "/build/index", "-index-ignore-system-modules",
"-output-file-map", "A-output-file-map.json",
"-emit-module", "-emit-module-path", "A.swiftmodule",
"-emit-dependencies",
"-pch-output-dir", "pch",
"-module-cache-path", "ModuleCache"
] + sdkargs + [
"-working-directory", "/build"
]),
Command(
directory: "/build",
file: "/src/b.swift",
arguments: [
"/swiftc", "/src/b.swift",
"-I", ".",
"-module-name", "B",
"-index-store-path", "/build/index", "-index-ignore-system-modules",
"-output-file-map", "B-output-file-map.json",
"-emit-module", "-emit-module-path", "B.swiftmodule",
"-emit-dependencies",
"-pch-output-dir", "pch",
"-module-cache-path", "ModuleCache"
] + sdkargs + [
"-working-directory", "/build"
]),
Command(
directory: "/build",
file: "/src/c.swift",
arguments: [
"/swiftc", "/src/c.swift",
"-I", ".", "-module-name", "C",
"-index-store-path", "/build/index", "-index-ignore-system-modules",
"-output-file-map", "C-output-file-map.json",
"-emit-module", "-emit-module-path", "C.swiftmodule",
"-emit-dependencies",
"-pch-output-dir", "pch",
"-module-cache-path", "ModuleCache"
] + sdkargs + [
"-working-directory", "/build"
]),
])
XCTAssertEqual(builder.compilationDatabase, expected)
}
public func testCompilationDatabaseMixedLangTarget() throws {
let dir = projectDir("MixedLangTarget")
let m = try TibsManifest.load(projectRoot: dir)
let tc = TibsCompilationDatabaseTests.fakeToolchain
let src = URL(fileURLWithPath: "/src", isDirectory: true)
let build = URL(fileURLWithPath: "/build", isDirectory: true)
let builder = try TibsBuilder(manifest: m, sourceRoot: src, buildRoot: build, toolchain: tc)
let sdkargs = TibsBuilder.defaultSDKPath.map { ["-sdk", $0] } ?? []
let swiftArgs = [
"/swiftc", "/src/a.swift", "/src/b.swift",
"-module-name", "main",
"-index-store-path", "/build/index", "-index-ignore-system-modules",
"-output-file-map", "main-output-file-map.json",
"-emit-module", "-emit-module-path",
"main.swiftmodule", "-emit-dependencies",
"-pch-output-dir", "pch",
"-module-cache-path", "ModuleCache",
"-emit-objc-header", "-emit-objc-header-path", "main-Swift.h",
"-import-objc-header", "/src/bridging-header.h",
] + sdkargs + [
"-Xcc", "-Wno-objc-root-class",
"-working-directory", "/build"
]
let clangArgs = { (src: String) -> [String] in
return ["/clang", "-fsyntax-only", "/src/\(src)",
"-I", ".", "-I", "/src",
"-index-store-path", "index", "-index-ignore-system-symbols",
"-fmodules", "-fmodules-cache-path=ModuleCache",
"-MMD", "-MF", "main-\(src).o.d",
"-o", "main-\(src).o",
"-Wno-objc-root-class"
]
}
let expected = JSONCompilationDatabase(commands: [
Command(directory: "/build", file: "/src/a.swift", arguments: swiftArgs),
Command(directory: "/build", file: "/src/b.swift", arguments: swiftArgs),
Command(directory: "/build", file: "/src/b.c", arguments: clangArgs("b.c")),
Command(directory: "/build", file: "/src/c.m", arguments: clangArgs("c.m")),
Command(directory: "/build", file: "/src/d.cpp", arguments: clangArgs("d.cpp")),
Command(directory: "/build", file: "/src/e.mm", arguments: clangArgs("e.mm")),
])
XCTAssertEqual(builder.compilationDatabase, expected)
}
}
|
[
-1
] |
35d25af4694b972fca8ac01b9f9c861701326bf6
|
98a8132a5d60304a3e11fa52540917f2ac321e8d
|
/LinearProgressBarSwiftUITests/CircularProgressSwiftUITests.swift
|
ad6a30315895255ca8a3127723a48aa498667f46
|
[] |
no_license
|
jams032/LinearProgressBarSwift
|
b3fa65d07932435dcfa7c8f63f6c23f793e2b8ba
|
f28464db29421b087b3ead9ce4e1123b045b0280
|
refs/heads/master
| 2020-06-20T20:56:14.259706 | 2019-07-24T03:14:49 | 2019-07-24T03:14:49 | 197,245,866 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,205 |
swift
|
//
// CircularProgressSwiftUITests.swift
// CircularProgressSwiftUITests
//
// Created by Jamshed Alam on 17/7/19.
// Copyright © 2019 Jamshed Alam. All rights reserved.
//
import XCTest
class CircularProgressSwiftUITests: 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.
}
}
|
[
333827,
182277,
243720,
282634,
313356,
155665,
305173,
237599,
241695,
223269,
354342,
229414,
315431,
102441,
354346,
278571,
315433,
325675,
102446,
282671,
313388,
229425,
124974,
243763,
241717,
321589,
229431,
180279,
215095,
319543,
213051,
288829,
325695,
288835,
286787,
307269,
237638,
313415,
239689,
315468,
311373,
333902,
196687,
278607,
311377,
354386,
233548,
329812,
315477,
223317,
200795,
368732,
180317,
323678,
315488,
315489,
45154,
321632,
280676,
313446,
215144,
233578,
194667,
278637,
288878,
319599,
278642,
284789,
131190,
284790,
288890,
215165,
131199,
194692,
235661,
333968,
241809,
323730,
278676,
311447,
153752,
327834,
284827,
278684,
329884,
299166,
278690,
311459,
215204,
333990,
299176,
284840,
278698,
284843,
323761,
184498,
278707,
125108,
258233,
278713,
280761,
180409,
295099,
227517,
280767,
223418,
299197,
299202,
139459,
309443,
176325,
131270,
301255,
338118,
299208,
227525,
280779,
282832,
321744,
227536,
301270,
229591,
280792,
301271,
147679,
311520,
325857,
334049,
147680,
356575,
307431,
338151,
182503,
319719,
317676,
286957,
125166,
125170,
395511,
313595,
184574,
309504,
125184,
217352,
125192,
125197,
194832,
227601,
325904,
125200,
319764,
278805,
338196,
125204,
334104,
315674,
282908,
311582,
125215,
282912,
278817,
233761,
299294,
211239,
282920,
334121,
317738,
325930,
311596,
338217,
125225,
321839,
336177,
315698,
98611,
332084,
125236,
282938,
168251,
127292,
278843,
287040,
319812,
311622,
227655,
280903,
319816,
323914,
201037,
383309,
282959,
229716,
289109,
250196,
168280,
323934,
391521,
239973,
381286,
285031,
416103,
313703,
280938,
242027,
242028,
321901,
354671,
278895,
287089,
250227,
199030,
227702,
315768,
315769,
291194,
223611,
248188,
139641,
291193,
211327,
291200,
311679,
313726,
240003,
158087,
313736,
227721,
242059,
311692,
106893,
227730,
285074,
240020,
190870,
315798,
190872,
291225,
317851,
293275,
285083,
242079,
289185,
293281,
285089,
305572,
156069,
301482,
311723,
289195,
375211,
334259,
338359,
299449,
311739,
319931,
293309,
278974,
336319,
311744,
317889,
291266,
278979,
326083,
336323,
129484,
289229,
278988,
281039,
278992,
283088,
283089,
281038,
326093,
279000,
242138,
176602,
285152,
279009,
369121,
188899,
195044,
291297,
279014,
319976,
279017,
311787,
334315,
281071,
319986,
236020,
279030,
311800,
293368,
279033,
317949,
279042,
283138,
233987,
287237,
324098,
377352,
322057,
309770,
342537,
334345,
279053,
340489,
182802,
283154,
303634,
303635,
279061,
279060,
279066,
322077,
291359,
342560,
227881,
293420,
236080,
283185,
289328,
234037,
23093,
244279,
244280,
338491,
340539,
301635,
309831,
55880,
322119,
377419,
303693,
281165,
301647,
281170,
326229,
309847,
115287,
189016,
244311,
332379,
111197,
295518,
287327,
242274,
244326,
279143,
279150,
287345,
301688,
244345,
189054,
287359,
297600,
303743,
291455,
301702,
164487,
311944,
334473,
344714,
316044,
311950,
184974,
316048,
311953,
316050,
326288,
287379,
336531,
227991,
295575,
289435,
303772,
205469,
221853,
285348,
340645,
279207,
295591,
176810,
295598,
248494,
279215,
293552,
299698,
318127,
164532,
166581,
342705,
154295,
279218,
285362,
287418,
314043,
303802,
287412,
66243,
291529,
287434,
225996,
363212,
287438,
135888,
242385,
279249,
303826,
369365,
369366,
279253,
230105,
299737,
322269,
338658,
342757,
295653,
289511,
230120,
330473,
234216,
285419,
330476,
289517,
312046,
170735,
215790,
125683,
230133,
199415,
342775,
234233,
242428,
279293,
289534,
205566,
291584,
322302,
299777,
228099,
285443,
35584,
375552,
291591,
322312,
346889,
285450,
264971,
312076,
326413,
295688,
322320,
285457,
295698,
166677,
291605,
207639,
283418,
285467,
326428,
221980,
281378,
234276,
336678,
283431,
318247,
279337,
293673,
318251,
289580,
262952,
262957,
164655,
301872,
303921,
234290,
328495,
285493,
230198,
285496,
301883,
201534,
281407,
289599,
295745,
342846,
222017,
293702,
318279,
283466,
281426,
279379,
244569,
201562,
281434,
322396,
234330,
230238,
230239,
275294,
279393,
293729,
349025,
281444,
303973,
279398,
351078,
301919,
357219,
177002,
308075,
242540,
243592,
242542,
310132,
295797,
201590,
228214,
295799,
177018,
269179,
279418,
336765,
314240,
291713,
158594,
330627,
340865,
240517,
228232,
299912,
416649,
279434,
316299,
252812,
320394,
308111,
234382,
308113,
293780,
310166,
289691,
209820,
240543,
283551,
289699,
189349,
289704,
293801,
279465,
326571,
177074,
304050,
326580,
289720,
326586,
289723,
189373,
213956,
281541,
19398,
359365,
345030,
213961,
127945,
279499,
211913,
56270,
191445,
183254,
304086,
207839,
340960,
314343,
304104,
123880,
340967,
324587,
320492,
183276,
234476,
320495,
203758,
248815,
287730,
289773,
240631,
320504,
214009,
201721,
312313,
312317,
328701,
328705,
234499,
418819,
293894,
330759,
320520,
230411,
320526,
330766,
234513,
238611,
140311,
293911,
238617,
197658,
316441,
326684,
336930,
132140,
113710,
281647,
189487,
322609,
318515,
312372,
203829,
238646,
300087,
238650,
320571,
21567,
308288,
160834,
336962,
314437,
349254,
238663,
300109,
207954,
234578,
250965,
205911,
296023,
339031,
314458,
156763,
281698,
285795,
214116,
230500,
250982,
281699,
322664,
228457,
279659,
318571,
234606,
300145,
238706,
279666,
312435,
187508,
230514,
300147,
302202,
285819,
292901,
314493,
285823,
234626,
279686,
222344,
285833,
318602,
285834,
228492,
337037,
234635,
177297,
162962,
187539,
326803,
347286,
324761,
285850,
296091,
119965,
234655,
300192,
302239,
339106,
306339,
234662,
300200,
3243,
249003,
208044,
238764,
322733,
302251,
324790,
300215,
64699,
294075,
228541,
339131,
343230,
283841,
148674,
283846,
312519,
148687,
290001,
189651,
316628,
279766,
189656,
295769,
279775,
304352,
298209,
310496,
339167,
279780,
304353,
228587,
279789,
290030,
302319,
251124,
234741,
316661,
283894,
208123,
292092,
279803,
228608,
320769,
322826,
242955,
177420,
312588,
318732,
126229,
245018,
320795,
318746,
320802,
239610,
130342,
304422,
130344,
130347,
292145,
298290,
208179,
312628,
345398,
300342,
159033,
333114,
333115,
286012,
222523,
279872,
181568,
193858,
216387,
279874,
300354,
300355,
372039,
294210,
304457,
230730,
345418,
337228,
296269,
222542,
224591,
238928,
234830,
296274,
331091,
314708,
150868,
283990,
314711,
357720,
318804,
300378,
300379,
294236,
316764,
314721,
230757,
281958,
314727,
134504,
306541,
314734,
327023,
296304,
234864,
312688,
316786,
314740,
284015,
327030,
314742,
314745,
310650,
224637,
306558,
337280,
243073,
314752,
179586,
306561,
294278,
314759,
296328,
296330,
304523,
368012,
298378,
318860,
314765,
9618,
112019,
306580,
279955,
224662,
234902,
282008,
314776,
314771,
318876,
282013,
290206,
282375,
343457,
148899,
314788,
298406,
314790,
245160,
333224,
282023,
241067,
279979,
314797,
286128,
279988,
286133,
284086,
259513,
310714,
302523,
228796,
284090,
54719,
302530,
292291,
228804,
415170,
306630,
280003,
310725,
300488,
370122,
302539,
339403,
300490,
306634,
310731,
329168,
337359,
222674,
327122,
280020,
329170,
312785,
310735,
280025,
310747,
239069,
144862,
286176,
296636,
187877,
320997,
310758,
280042,
280043,
191980,
329198,
337391,
300526,
282097,
296434,
308722,
306678,
40439,
191991,
288248,
286201,
300539,
288252,
210429,
312830,
359931,
290304,
245249,
228868,
292359,
218632,
230922,
302602,
323083,
294413,
359949,
304655,
329231,
323088,
282132,
230933,
302613,
282135,
316951,
374297,
175640,
302620,
222754,
306730,
245291,
312879,
230960,
288305,
290359,
239159,
323132,
235069,
157246,
288319,
288322,
280131,
349764,
310853,
282182,
124486,
288328,
292424,
292426,
194118,
333389,
224848,
224852,
349780,
290391,
128600,
196184,
235096,
306777,
212574,
99937,
204386,
300643,
345697,
300645,
312937,
204394,
243306,
224874,
312941,
138862,
206447,
310896,
294517,
314997,
288377,
290425,
339579,
337533,
325246,
333438,
235136,
280193,
282244,
239238,
288391,
282248,
286344,
323208,
179853,
286351,
188049,
229011,
239251,
280217,
323226,
179868,
229021,
302751,
198304,
282272,
245413,
282279,
298664,
212649,
317102,
286387,
337590,
286392,
300729,
302778,
306875,
280252,
280253,
282302,
323262,
286400,
321217,
323265,
280259,
321220,
333508,
239305,
280266,
296649,
212684,
9935,
241360,
313042,
286419,
333522,
241366,
282330,
18139,
294621,
282336,
325345,
321250,
294629,
153318,
333543,
181992,
337638,
12009,
282347,
288492,
323315,
67316,
34547,
286457,
284410,
313082,
288508,
200444,
282366,
286463,
319232,
288515,
280326,
323335,
249606,
284425,
300810,
116491,
300812,
216844,
280333,
282379,
284430,
161553,
124691,
284436,
278292,
118549,
116502,
278294,
325403,
321308,
321309,
341791,
241440,
282399,
339746,
325411,
315172,
186149,
186148,
241447,
216868,
333609,
282401,
286507,
294699,
284460,
280367,
300849,
282418,
319289,
321338,
280377,
413500,
280381,
345918,
241471,
280386,
325444,
280391,
153416,
315209,
325449,
159563,
280396,
307024,
317268,
237397,
241494,
18263,
307030,
325460,
188250,
341846,
284508,
300893,
307038,
370526,
237411,
284515,
276326,
282471,
296807,
292713,
282476,
292719,
313200,
296815,
325491,
313204,
333687,
317305,
317308,
339840,
315265,
280451,
325508,
188293,
243590,
282503,
67464,
305032,
315272,
315275,
327556,
333700,
325514,
350091,
350092,
311183,
282517,
294806,
350102,
337816,
294808,
214936,
239515,
214943,
298912,
319393,
333727,
294820,
118693,
219046,
333734,
284584,
294824,
313257,
292783,
126896,
200628,
300983,
343993,
288698,
98240,
294849,
214978,
280517,
280518,
214983,
282573,
153553,
231382,
329696,
323554,
292835,
6116,
190437,
292838,
294887,
317416,
313322,
329707,
174058,
278507,
296942,
311277,
124912,
327666,
278515,
325620,
313338
] |
4faa17e772d2d07103cb367317c6ad7fc6e8dfae
|
0db1d2b6e2ad3c5a36ed3d8f239a9d12598f6ef0
|
/Clerkie Project/Message.swift
|
9f92e75bba31f4c815f8fc3ce379b94fcd4afa96
|
[] |
no_license
|
Ivy36/Clerkie-Project
|
dfd1ac30efbff49fd875c9f0acc8adee1bf36c37
|
4cbd88c8c7760fb38fd71d4966ec6703a78faa24
|
refs/heads/master
| 2021-08-26T09:45:31.137891 | 2017-11-23T04:39:00 | 2017-11-23T04:39:00 | 110,042,514 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 256 |
swift
|
//
// Message.swift
// Clerkie Project
//
// Created by Jing on 2017/11/12.
// Copyright © 2017年 Jing. All rights reserved.
//
import Foundation
import CoreData
/* Definition for CoreData entity Message
*/
class Message: NSManagedObject {
}
|
[
-1
] |
5b148543dd2ef33003366d949c5a690c87e5eef0
|
28251eb4eb075394b1235a19ab37855158614ef7
|
/TDDSampleTests/ArticleListViewControllerTests.swift
|
ce440233eaa2ef684c3434f2011eac71074c0fd1
|
[] |
no_license
|
taise-hikawa/TDDSample
|
ea474c2439c3de4242b425fc6a51798937733620
|
6209fba4968c7bc595de2084cac42c5703c33246
|
refs/heads/main
| 2023-04-19T19:38:25.670407 | 2021-05-19T08:28:43 | 2021-05-19T08:28:43 | 368,783,094 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,578 |
swift
|
//
// ArticleListViewControllerTests.swift
// TDDSampleTests
//
// Created by 樋川大聖 on 2021/05/17.
//
import XCTest
import SafariServices
@testable import TDDSample
class ArticleListViewControllerTests: XCTestCase {
private var vc: ArticleListViewController!
override func setUp() {
super.setUp()
let article = Article(title: "記事タイトル", url: "http://test")
let client = FakeArticleListAPIClient(fakeResponse: [article])
vc = ArticleListViewController(client: client)
let window = UIWindow()
window.rootViewController = vc
window.makeKeyAndVisible()
}
func test_タイトルの一覧が表示されていること() {
guard let cell = vc.tableView.dataSource?
.tableView(vc.tableView,
cellForRowAt: IndexPath(row: 0, section: 0))
as? ArticleListCell
else {
XCTFail()
return
}
XCTAssertEqual(cell.titleLabel.text, "記事タイトル")
}
func test_記事をタップして詳細画面が表示されること() {
vc.tableView(vc.tableView, didSelectRowAt: IndexPath(row: 0, section: 0))
XCTAssertTrue(vc.presentedViewController is SFSafariViewController)
}
}
class FakeArticleListAPIClient: ArticleListAPIClientProtocol {
let fakeResponse: [Article]
init(fakeResponse: [Article]) {
self.fakeResponse = fakeResponse
}
func fetch(completion: @escaping (([Article]?) -> Void)) {
completion(fakeResponse)
}
}
|
[
-1
] |
d3e109f32a7cbde3690624dcd70a05265467bebb
|
78bc27072f5753f87c3db9c99253d4a5693bc9cf
|
/CollectionViewCells/PopularNearby/PopularNearbyCarpoolCollectionViewCell.swift
|
6ad7b9026739356fbdc1b884db69a87cd375e758
|
[] |
no_license
|
Pointy-hair/collegeHubb
|
35d56c9a1a4db19a650d8bf03005dff5b46de5a5
|
ed77090e6469a5befe2dbc6ba1a5f1bf28c386b1
|
refs/heads/master
| 2020-04-19T16:34:18.730478 | 2017-04-20T03:23:39 | 2017-04-20T03:23:39 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 594 |
swift
|
//
// PopularNearbyCarpoolCollectionViewCell.swift
// CollegeHub
//
// Created by Sierra 4 on 07/04/17.
// Copyright © 2017 Sumanpreet. All rights reserved.
//
import UIKit
class PopularNearbyCarpoolCollectionViewCell: UICollectionViewCell {
@IBOutlet var imgProfileImage: UIImageView!
@IBOutlet var lblPrice: UILabel!
@IBOutlet var lblDayAndDate: UILabel!
@IBOutlet var lblDestinationName: UILabel!
let HomeStoryBoard: UIStoryboard = UIStoryboard(name: "Home", bundle: nil)
@IBAction func btnBookNowAction(_ sender: Any) {
}
}
|
[
-1
] |
263917f87d2ee98ad780416424dd07f7f80afd78
|
0d4a32f46e9a08e71301ac44bbc900812a9ab74a
|
/Autonomy/Modules/Onboarding/Onboarding Steps/OnboardingStep2ViewController.swift
|
7438d3df7e9e16a0cc0527dea7030f0ecee494cf
|
[] |
no_license
|
bitmark-inc/autonomy-health-ios
|
a7f23ea5ecca6d2324be5d3bb6e033f77d4515ac
|
edb3ff283a6d9122fc1bce910b2974d2d81cda71
|
refs/heads/master
| 2022-11-10T12:15:19.027496 | 2020-06-30T05:38:01 | 2020-06-30T05:56:39 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 3,644 |
swift
|
//
// OnboardingStep2ViewController.swift
// Autonomy
//
// Created by Thuyen Truong on 3/26/20.
// Copyright © 2020 Bitmark Inc. All rights reserved.
//
import UIKit
import RxSwift
import RxCocoa
import SnapKit
import SwifterSwift
class OnboardingStep2ViewController: ViewController, BackNavigator, OnboardingViewLayout {
// MARK: - Properties
lazy var headerScreen: UIView = {
HeaderView(header: "1 <b>2</b> 3")
}()
lazy var titleScreen = makeTitleScreen(title: R.string.phrase.onboarding2Description())
lazy var talkingImageView = makeTalkingImageView()
lazy var backButton = makeLightBackItem()
lazy var nextButton = RightIconButton(title: R.string.localizable.next().localizedUppercase,
icon: R.image.nextCircleArrow()!)
lazy var groupsButton: UIView = {
ButtonGroupView(button1: backButton, button2: nextButton, hasGradient: true)
}()
lazy var sampleSymptomsTagView = makeSampleSymptomTagListView()
override func viewWillLayoutSubviews() {
super.viewWillLayoutSubviews()
sampleSymptomsTagView.rearrangeViews()
}
// MARK: bindViewModel
override func bindViewModel() {
super.bindViewModel()
nextButton.rx.tap.bind { [weak self] in
self?.gotoOnboardingStep3Screen()
}.disposed(by: disposeBag)
}
// MARK: Setup views
override func setupViews() {
super.setupViews()
let paddingContentView = makePaddingContentView()
contentView.addSubview(paddingContentView)
contentView.addSubview(groupsButton)
paddingContentView.snp.makeConstraints { (make) in
make.edges.equalToSuperview().inset(OurTheme.paddingInset)
}
groupsButton.snp.makeConstraints { (make) in
make.leading.trailing.bottom.equalTo(contentView)
}
}
}
// MARK: - Navigator
extension OnboardingStep2ViewController {
fileprivate func gotoOnboardingStep3Screen() {
navigator.show(segue: .onboardingStep3, sender: self)
}
}
extension OnboardingStep2ViewController {
func makeContentTalkingView() -> UIView {
let titleLabel = Label()
titleLabel.numberOfLines = 0
titleLabel.textAlignment = .center
titleLabel.apply(
text: R.string.phrase.onboardingSymptomsTitle(),
font: R.font.atlasGroteskLight(size: Size.ds(24)),
themeStyle: .lightTextColor, lineHeight: 1.2)
let titleLabelCover = UIView()
titleLabelCover.addSubview(titleLabel)
titleLabel.snp.makeConstraints { (make) in
make.width.equalToSuperview().multipliedBy(0.85)
make.top.bottom.centerX.equalToSuperview()
}
return LinearView(
items: [
(titleLabelCover , 0),
(SeparateLine(height: 1), Size.dh(35)),
(sampleSymptomsTagView , Size.dh(25))
])
}
fileprivate func makeSampleSymptomTagListView() -> TagListView {
let tagListView = TagListView()
let sampleSymptomTexts = [
R.string.phrase.sampleSymtomDryCough(),
R.string.phrase.sampleSymptomFever(),
R.string.phrase.sampleSymptomChills(),
R.string.phrase.sampleSymptomFatigue(),
R.string.phrase.sampleSymptomShortnessOfBreath(),
R.string.phrase.sampleSymptomDifficultyBreathing(),
R.string.phrase.sampleSymptomLossOfSenseOfTasteOrSmell()
].map { (id: "", value: $0) }
tagListView.addTags(sampleSymptomTexts)
return tagListView
}
}
|
[
-1
] |
7e91bbfc81345589af6d1fc95ef091b1ec77d1d4
|
5d6399046db29d8d3daea22bcbee761f40c9729e
|
/swift-ui-study-case/presentation/list/ContentViewModel.swift
|
2655129a752c31f2444ce45fc43feef27b1decc2
|
[] |
no_license
|
eric-ampire/swift-ui-study-case
|
6969fab84f75eb99f0d75c89c87874c1f3cf8241
|
986ef98ee96e55db88b108282d0f66109e4aa903
|
refs/heads/main
| 2023-07-21T01:23:16.415158 | 2021-09-01T09:09:10 | 2021-09-01T09:09:10 | 400,868,021 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 115 |
swift
|
//
// ContentViewModel.swift
// swift-ui-study-case
//
// Created by Guest on 28/08/2021.
//
import Foundation
|
[
-1
] |
39d4d5df7c3fa84e413768b229621c9b6547bd0d
|
048f5fde75ceafe1d6714051e458f700c6649fb8
|
/Radar/Controllers/SideMenu/Setting/ChangePasswordVC.swift
|
26768a2eaff51d231d37df8d06e92c430839d2a3
|
[] |
no_license
|
happyguleria1234/Radar
|
c6c80beb03822268c1f716d6f7b55361efbf2577
|
b834c6612566adfcee209a235497b5fabd9121ab
|
refs/heads/main
| 2023-01-06T09:00:17.108518 | 2020-11-04T13:26:43 | 2020-11-04T13:26:43 | 306,268,827 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 639 |
swift
|
//
// ChangePasswordVC.swift
// Radar
//
// Created by Vivek Dharmani on 29/10/20.
//
import UIKit
class ChangePasswordVC: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
}
*/
}
|
[
-1
] |
bfc2e74f1a8adca86f86f7fedf164dc74e23d8a1
|
2f39d4141376e0aa8479f1bca5247031b46d9785
|
/QuizApp/Model/QuestionEntity.swift
|
0b324a785be5d3751ff1958b3c8e4b9e600a7b82
|
[] |
no_license
|
puhalovicm/iOSVjestina2020
|
19dbdf7848ce7eb074f6c80d8e94132a036b80d2
|
fda9a3224cb70f6d77b465f22373f7d909e43a65
|
refs/heads/master
| 2022-10-09T13:07:19.309350 | 2020-06-11T01:40:09 | 2020-06-11T01:40:09 | 262,634,016 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 672 |
swift
|
//
// QuestionEntity.swift
// QuizApp
//
// Created by Mateo Puhalović on 10/06/2020.
//
import Foundation
import CoreData
@objc(QuestionEntity)
class QuestionEntity: NSManagedObject {
@NSManaged var id: Int32
@NSManaged var question: String
@NSManaged var correct_answer: Int32
@NSManaged var answers: [NSString]
@NSManaged var quiz_id: Int32
func update(with question: Question, quizId: Int) {
self.id = Int32(question.id)
self.question = question.question
self.correct_answer = Int32(question.correctAnswer)
self.answers = question.answers as [NSString]
self.quiz_id = Int32(quizId)
}
}
|
[
-1
] |
26c4bf338b2f3918896f036d4a6fd4d18e8f5fd4
|
0286f3acd565fe3c327b17e21395f0711af37043
|
/Sources/App/Routers/Coverage/CoverageRouteController.swift
|
78eba190a3c88eb2a2b9608607ec91f89dcd4641
|
[
"Apache-2.0"
] |
permissive
|
BottleRocketStudios/Server-ProjectHealth
|
229f44c1b0f79895060e5cd102c21f146450c352
|
58f25648962e7b4386cc2dce5c5234a19445444c
|
refs/heads/master
| 2021-09-08T23:16:24.931148 | 2021-08-31T21:49:26 | 2021-08-31T21:49:26 | 128,985,590 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 3,625 |
swift
|
//
// CoverageRouteController.swift
// App
//
// Created by William McGinty on 4/26/18.
//
import Foundation
import Vapor
import Authentication
import Crypto
import Fluent
class CoverageRouteController: RouteCollection {
func boot(router: Router) throws {
let group = router.grouped("api", "coverage")
group.get(Project.parameter, use: getCoverageReportHandler)
group.get("complete", Project.parameter, use: getCompleteCoverageReportHandler)
group.get("targets", CoverageReport.parameter, use: getTargetReportsHandler)
group.get("files", TargetReport.parameter, use: getFileReportsHandler)
group.get("functions", FileReport.parameter, use: getFunctionReportsHandler)
let basicAuthMiddleware = User.basicAuthMiddleware(using: BCrypt)
let basicAuthGroup = group.grouped(basicAuthMiddleware)
basicAuthGroup.post(CompleteCoverageReport.self, at: Project.parameter, use: addCoverageReportHandler)
}
}
//MARK: Helper
private extension CoverageRouteController {
//MARK: Retrieve
func getCoverageReportHandler(_ request: Request) throws -> Future<[CoverageReport]> {
let page = request.getPageInformation()
let direction = request.getSortDirection()
return try request.parameters.next(Project.self).flatMap { project in
return try CoverageReport.query(on: request).whereParent(has: project.id).sortedByCreation(in: direction).paged(to: page).all()
}
}
func getCompleteCoverageReportHandler(_ request: Request) throws -> Future<[CompleteCoverageReport]> {
return try getCoverageReportHandler(request).flatMap { coverageReports in
return try coverageReports.map { try CoverageRecordController.completeReport(for: $0, on: request) }.flatten(on: request)
}
}
func getTargetReportsHandler(_ request: Request) throws -> Future<[TargetReport]> {
let page = request.getPageInformation()
return try request.parameters.next(CoverageReport.self).flatMap { report in
return try TargetReport.query(on: request).whereParent(has: report.id).paged(to: page).all()
}
}
func getFileReportsHandler(_ request: Request) throws -> Future<[FileReport]> {
let page = request.getPageInformation()
return try request.parameters.next(TargetReport.self).flatMap { report in
return try FileReport.query(on: request).whereParent(has: report.id).paged(to: page).all()
}
}
func getFunctionReportsHandler(_ request: Request) throws -> Future<[FunctionReport]> {
let page = request.getPageInformation()
return try request.parameters.next(FileReport.self).flatMap { report in
return try FunctionReport.query(on: request).whereParent(has: report.id).paged(to: page).all()
}
}
//MARK: Add New
func addCoverageReportHandler(_ request: Request, completeReport: CompleteCoverageReport) throws -> Future<HTTPResponseStatus> {
return try request.parameters.next(Project.self).flatMap { project in
return completeReport.report.associating(with: project).save(on: request).then { coverageReport -> Future<[[[FunctionReport]]]> in
let targetsFuture: Future<[TargetReport]> = completeReport.targets.map { $0.report.associating(with: coverageReport).save(on: request) }.flatten(on: request)
return CoverageRecordController.createFunctionRecords(for: targetsFuture, with: completeReport, on: request)
}.transform(to: HTTPResponseStatus.created)
}
}
}
|
[
-1
] |
3d742fb1fef26e7cb5f490a78464ebd04ea963d8
|
2ebf98c5a948b07458ed4e35c5c746b081cfa30a
|
/born-dayTests/born_dayTests.swift
|
de5da5a548ef3c940aafba9881e9a30c00057f2a
|
[] |
no_license
|
philippelamny/IOS-Fun-Astro
|
8c8092ed874bb7ed663304e5b277b4c54cec3b2b
|
8831c8849a4ad90223ca06442af0274983352cfd
|
refs/heads/master
| 2020-03-17T11:30:11.022538 | 2018-05-17T18:58:56 | 2018-05-17T18:58:56 | 133,554,286 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 978 |
swift
|
//
// born_dayTests.swift
// born-dayTests
//
// Created by philippe lam on 21/01/2018.
// Copyright © 2018 philippe lam. All rights reserved.
//
import XCTest
@testable import born_day
class born_dayTests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}
func testExample() {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct results.
}
func testPerformanceExample() {
// This is an example of a performance test case.
self.measure {
// Put the code you want to measure the time of here.
}
}
}
|
[
313357,
229413,
354343,
204840,
354345,
227370,
278570,
233517,
155694,
321583,
229424,
309295,
282672,
237620,
229430,
288833,
288834,
286788,
311372,
223316,
280661,
315476,
307289,
354393,
315487,
237663,
309345,
45153,
280675,
227428,
307301,
280677,
313447,
315497,
278634,
315498,
288879,
284788,
223350,
233590,
280694,
237689,
131191,
131198,
215166,
292992,
194691,
227460,
280712,
215178,
235662,
311438,
317587,
278677,
284825,
284826,
311458,
278691,
233636,
233642,
284842,
239793,
299187,
278714,
223419,
280762,
299198,
280768,
227524,
309444,
280778,
282831,
280795,
227548,
229597,
301279,
311519,
280802,
176362,
286958,
184575,
278797,
309529,
315673,
282909,
278816,
237857,
211235,
217380,
211238,
280887,
278842,
315706,
282939,
307517,
260418,
319813,
139589,
280902,
311621,
319821,
6481,
6489,
379225,
323935,
416104,
280939,
285040,
313713,
242033,
311681,
227725,
285084,
61857,
285090,
61859,
289189,
299441,
293303,
283064,
278970,
278978,
127427,
127428,
291267,
283075,
278989,
281040,
326100,
278999,
328152,
176601,
188894,
287198,
279008,
160225,
358882,
279013,
279018,
291311,
309744,
281072,
279029,
279032,
279039,
301571,
291333,
287241,
279050,
303631,
283153,
279057,
279062,
279065,
291358,
180771,
244269,
283182,
283184,
236081,
234036,
23092,
279094,
338489,
70209,
301638,
70215,
309830,
55881,
281166,
281171,
309846,
287318,
297560,
295519,
66150,
111208,
279146,
313966,
281199,
295536,
287346,
287352,
301689,
279164,
152203,
287374,
314009,
303771,
221852,
279210,
287404,
285361,
303793,
299699,
342706,
166582,
314040,
287417,
158394,
303803,
285373,
287422,
287433,
225995,
154316,
287439,
279252,
96984,
287452,
289502,
285415,
342762,
293612,
289518,
312047,
279280,
199414,
154359,
230134,
299770,
234234,
221948,
205568,
242433,
295682,
299776,
285444,
322313,
291604,
293664,
234277,
283430,
279336,
289576,
262954,
295724,
312108,
301871,
164656,
303920,
262962,
285497,
289598,
160575,
281408,
318278,
201551,
281427,
281433,
301918,
295776,
293730,
303972,
230248,
177001,
308076,
400239,
310131,
207732,
174963,
228215,
209783,
209785,
279417,
308092,
158593,
113542,
287622,
228233,
228234,
308107,
56208,
308112,
234386,
293781,
324506,
324507,
310176,
310178,
283558,
289703,
279464,
293800,
236461,
293806,
304051,
189374,
213960,
316364,
183248,
50143,
314342,
234472,
234473,
289774,
183279,
287731,
314355,
316405,
304122,
320507,
234500,
322570,
238610,
234514,
140310,
197657,
175132,
300084,
238651,
308287,
238664,
234577,
296019,
234587,
277597,
304222,
281697,
302177,
281700,
300135,
228458,
207979,
279660,
15471,
144496,
234609,
312434,
285814,
300151,
279672,
160891,
300158,
150657,
187521,
234625,
285828,
302213,
279685,
222343,
302216,
285830,
228491,
234638,
308372,
185493,
238743,
119962,
285851,
296092,
283802,
300187,
306338,
234663,
249002,
238765,
279728,
238769,
208058,
64700,
228540,
228542,
283840,
302274,
279747,
283847,
283852,
279760,
290000,
189652,
279765,
279774,
304351,
298212,
304356,
279785,
228588,
234733,
298228,
302325,
234742,
216315,
292091,
208124,
228609,
292107,
312587,
173334,
339234,
109861,
286013,
286018,
279875,
300359,
294218,
234827,
224586,
222541,
296270,
234831,
238927,
283991,
357719,
292195,
294243,
281957,
230756,
163175,
284014,
279920,
296307,
181625,
290173,
306559,
306560,
224640,
298374,
142729,
368011,
112017,
306579,
282007,
318875,
282022,
282024,
173491,
304564,
279989,
228795,
292283,
302529,
302531,
415171,
300487,
306631,
296392,
280010,
310732,
302540,
312782,
64975,
310736,
280013,
306639,
228827,
286172,
239068,
280032,
144867,
187878,
316902,
280041,
306673,
308723,
306677,
300535,
280055,
288249,
286202,
290300,
286205,
302590,
294400,
282114,
306692,
306693,
296461,
304656,
282129,
308756,
282136,
282141,
302623,
286244,
288309,
288318,
280130,
196164,
282183,
218696,
288327,
292425,
228943,
286288,
290390,
300630,
306776,
239198,
286306,
282213,
317032,
222832,
314998,
288378,
239237,
282245,
286343,
323207,
229001,
282246,
290443,
288392,
323217,
239250,
282259,
229020,
282271,
282273,
302754,
282276,
40613,
40614,
40615,
282280,
290471,
229029,
298667,
300714,
286388,
286391,
370363,
282303,
286399,
280257,
218819,
306890,
280267,
302797,
302802,
280278,
282327,
298712,
278233,
278234,
67292,
278240,
282339,
282348,
239341,
67315,
282355,
313081,
300794,
229113,
194304,
288512,
278272,
311042,
288516,
280327,
216839,
280329,
300811,
284431,
278291,
278293,
284442,
286494,
282400,
313120,
315171,
284459,
294700,
280366,
282417,
200498,
280372,
282427,
315202,
282434,
280390,
282438,
307025,
304977,
413521,
18262,
216918,
307031,
280410,
284507,
188251,
237408,
284512,
284514,
276327,
292712,
288619,
288620,
280430,
282480,
313203,
300918,
194429,
305026,
67463,
282504,
243597,
110480,
184208,
282518,
282519,
214937,
214938,
294809,
239514,
294814,
300963,
294823,
298920,
284587,
292782,
288697,
98239,
237504,
280514,
294850,
280519,
301008,
194515,
292837,
294886,
296941,
311281,
311282,
292858
] |
e87d1d49f33b2ae0cbfb289ec1f06523a0f98e3a
|
97bf930a5ea42119b8c23fde48e4fcf8635d9db0
|
/VenueExplorer/NetworkProcessing.swift
|
f0714080245e3a87678d73ecb1f2044c837bff98
|
[] |
no_license
|
iciwim3/VenueExplorer
|
79375169400a8bf76ab04ad707155be355793d38
|
b2791f0e2fba537f3ff4523a0885989b35973ceb
|
refs/heads/master
| 2021-06-27T03:18:03.896326 | 2017-09-15T20:54:02 | 2017-09-15T20:54:02 | 103,592,407 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,590 |
swift
|
//
// NetworkProcessing.swift
// VenueExplorer
//
// Created by Sain-R Edwards Jr. on 9/14/17.
// Copyright © 2017 Appybuildmore. All rights reserved.
//
import Foundation
// Input: URLRequest (it has a URL)
// Output: returns JSON, or raw data
// Algo: Make a request to server, download the data, return the data
public let DANetworkErrorDomain = "\(Bundle.main.bundleIdentifier!).NetworkingError"
public let MissingHTTPResponseError: Int = 14
class NetworkProcessing {
let request: URLRequest
lazy var configuration: URLSessionConfiguration = URLSessionConfiguration.default
lazy var session: URLSession = URLSession(configuration: self.configuration)
init(request: URLRequest) {
self.request = request
}
/* The method constructs a URLSession, then download data
from the Internet (which takes time). */
// Returns the data
// Multithreading
typealias JSON = [String : Any]
typealias JSONHandler = (JSON?, HTTPURLResponse?, Error?) -> Void
func downloadJSON(completion: @escaping JSONHandler) {
let dataTask = session.dataTask(with: self.request) { (data, response, error) in
// Off of the Main Thread
// Error: missing http response
guard let httpResponse = response as? HTTPURLResponse else {
let userInfo = [NSLocalizedDescriptionKey : NSLocalizedString("Missing HTTP Response", comment: "")]
let error = NSError(domain: DANetworkErrorDomain, code: MissingHTTPResponseError, userInfo: userInfo)
completion(nil, nil, error as Error)
return
}
if data == nil {
if let error = error {
completion(nil, httpResponse, error)
}
} else {
switch httpResponse.statusCode {
case 200:
// OK pasrse JSON into Foundation objects (array, dictionary...)
do {
let json = try JSONSerialization.jsonObject(with: data!, options: []) as? [String : Any]
completion(json, httpResponse, nil)
} catch let error as NSError {
completion(nil, httpResponse, error)
}
default:
print("Received HTTP response code: \(httpResponse.statusCode) - was not handled in NetworkProcessing.swift")
}
}
}
}
}
|
[
-1
] |
7d44aae9a8e7911a73c410d70c97bacb54a00325
|
c0e29235fcfbfdfc77e0b43f59942ce9121344e4
|
/Insta/Controllers/Other/Onboarding/RegistrationViewController.swift
|
45aaa510def4fc4f572e75ead9ede073171b1ee2
|
[] |
no_license
|
TomaszStevens/Instagram
|
2c4a0b4dc00b357ee8822ac8ff18bb35da5f9d45
|
001bad336274d8f817050c319ea88b6f580acc4d
|
refs/heads/master
| 2022-12-11T16:13:58.143386 | 2020-08-29T10:43:57 | 2020-08-29T10:43:57 | 290,598,477 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 5,113 |
swift
|
//
// RegistrationViewController.swift
// Insta
//
// Created by Tomasz Stevens on 26/08/2020.
// Copyright © 2020 Tomasz Stevens. All rights reserved.
//
import UIKit
class RegistrationViewController: UIViewController {
struct Constants {
static let cornerRadius: CGFloat = 10
}
private let usernameField: UITextField = {
let field = UITextField()
field.placeholder = "Username"
field.returnKeyType = .next
field.leftViewMode = .always
field.leftView = UIView(frame: CGRect(x: 0, y: 0, width: 10, height: 0))
field.autocapitalizationType = .none
field.autocorrectionType = .no
field.layer.masksToBounds = true
field.layer.cornerRadius = Constants.cornerRadius
field.backgroundColor = .secondarySystemBackground
field.layer.borderWidth = 1.0
field.layer.borderColor = UIColor.secondaryLabel.cgColor
return field
}()
private let emailField: UITextField = {
let field = UITextField()
field.placeholder = "Email"
field.returnKeyType = .next
field.leftViewMode = .always
field.leftView = UIView(frame: CGRect(x: 0, y: 0, width: 10, height: 0))
field.autocapitalizationType = .none
field.autocorrectionType = .no
field.layer.masksToBounds = true
field.layer.cornerRadius = Constants.cornerRadius
field.backgroundColor = .secondarySystemBackground
field.layer.borderWidth = 1.0
field.layer.borderColor = UIColor.secondaryLabel.cgColor
return field
}()
private let passwordField: UITextField = {
let field = UITextField()
field.isSecureTextEntry = true
field.placeholder = "Password"
field.returnKeyType = .continue
field.leftViewMode = .always
field.leftView = UIView(frame: CGRect(x: 0, y: 0, width: 10, height: 0))
field.autocapitalizationType = .none
field.autocorrectionType = .no
field.layer.masksToBounds = true
field.layer.cornerRadius = Constants.cornerRadius
field.backgroundColor = .secondarySystemBackground
field.layer.borderWidth = 1.0
field.layer.borderColor = UIColor.secondaryLabel.cgColor
return field
}()
private let registerButton: UIButton = {
let button = UIButton()
button.setTitle("Register", for: .normal)
button.layer.masksToBounds = true
button.layer.cornerRadius = Constants.cornerRadius
button.backgroundColor = UIColor(named: "deepGreen")
button.setTitleColor(.white, for: .normal)
return button
}()
override func viewDidLoad() {
super.viewDidLoad()
addSubviews()
registerButton.addTarget(self, action: #selector(didTapRegister), for: .touchUpInside)
usernameField.delegate = self
passwordField.delegate = self
passwordField.delegate = self
view.backgroundColor = .systemBackground
}
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
usernameField.frame = CGRect(x: 20, y: view.safeAreaInsets.top+100, width: view.width-40, height: 52)
emailField.frame = CGRect(x: 20, y: usernameField.bottom+10, width: view.width-40, height: 52)
passwordField.frame = CGRect(x: 20, y: emailField.bottom+10, width: view.width-40, height: 52)
registerButton.frame = CGRect(x: 20, y: passwordField.bottom+10, width: view.width-40, height: 52)
}
private func addSubviews() {
view.addSubview(usernameField)
view.addSubview(emailField)
view.addSubview(passwordField)
view.addSubview(registerButton)
}
@objc private func didTapRegister() {
usernameField.resignFirstResponder()
emailField.resignFirstResponder()
passwordField.resignFirstResponder()
guard let username = usernameField.text, !username.isEmpty,
let email = emailField.text, !email.isEmpty,
let password = passwordField.text, !password.isEmpty, password.count >= 8 else {
return
}
AuthManager.shared.registerNewUser(username: username, email: email, password: password) { registered in
DispatchQueue.main.async {
if registered {
print("registered")
// good to go
}
else {
// failed
}
}
}
}
}
extension RegistrationViewController: UITextFieldDelegate {
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
if textField == usernameField {
emailField.becomeFirstResponder()
}
else if textField == emailField {
passwordField.becomeFirstResponder()
}
else {
didTapRegister()
}
return true
}
}
|
[
-1
] |
b51428ef16cc8b6e1b4028c4bc1213201d5af949
|
3eb022598ff921d7e88a85a692318052d09a819b
|
/InfoPortal/Identifier.swift
|
1d188b92b22fe6a1e06d78346b35891366a91113
|
[] |
no_license
|
TSRSM/infoportal
|
437e222c17923bf22adc03beafc95a8ce957284f
|
d30898c0253832766015c3f42abc0cc5b35d8dde
|
refs/heads/master
| 2021-01-11T10:50:15.962804 | 2017-07-20T16:15:05 | 2017-07-20T16:15:05 | 76,158,110 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 565 |
swift
|
//
// Identifier.swift
// InfoPortal
//
// Created by Kabir Oberai on 13/12/16.
// Copyright © 2016 Kabir Oberai. All rights reserved.
//
import SwiftyJSON
struct Identifier {
let type: String
let title: String
let ref: String
let description: String
init?(json: JSON) {
guard let type = json["type"].string,
let title = json["title"].string,
let ref = json["ref"].string,
let description = json["description"].string
else { return nil }
self.type = type
self.title = title
self.ref = ref
self.description = description
}
}
|
[
-1
] |
d35ed7e41e3fb48b46c2a2a0d743eaf1c7691393
|
c0b75e55f32f08501addf4f0d5d7aa08346c93ef
|
/docs/examples/5/test-main.swift
|
4614f38c706ca0ab5f02845b6fafb6cbed8e7dee
|
[] |
no_license
|
swift-lang/exm-stc
|
d09b7f91b02f7dd62ec5872eb72098f01bf0d8cc
|
5dc9928132006957e2267c19c7ec4989d22e75bb
|
refs/heads/master
| 2021-01-01T06:33:59.000513 | 2015-04-22T17:30:58 | 2015-04-22T17:30:58 | 20,723,426 | 1 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 131 |
swift
|
import io;
mainapp;
printf("Swift...");
string A[] = [ "arg1", "arg2", "arg3" ];
rc = main_leaf(A);
printf("exit code: %i", rc);
|
[
-1
] |
2678fe16f2ee3dd32c569b65ca7d9063ad98b1ab
|
cab9dc549670a12b87527eb5af16687208f5a85c
|
/minTimeTable/LecturesViewController.swift
|
4fc821d5c216d2c4bb2c49cd1239ad9babd8e684
|
[] |
no_license
|
jxxnnee/minTimeTable
|
5760bb36d044116968ccf2e4bd809ca470a3fe60
|
306654a0750c764b3017c0a7aa6b295ccafc55c3
|
refs/heads/master
| 2022-03-09T12:55:56.931252 | 2019-11-03T12:16:38 | 2019-11-03T12:16:38 | 218,821,498 | 7 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 5,510 |
swift
|
//
// LecturesViewController.swift
// minTimeTable
//
// Created by 민경준 on 31/10/2019.
// Copyright © 2019 민경준. All rights reserved.
//
import UIKit
import RxSwift
import RxCocoa
import Alamofire
class LecturesViewController: UIViewController {
let bag = DisposeBag()
let datamodel = DataModel()
let lectures: BehaviorRelay<[Lecture]> = BehaviorRelay(value: [])
@IBOutlet weak var tableView: UITableView!
@IBOutlet weak var searchBar: UISearchBar!
override func viewDidLoad() {
super.viewDidLoad()
self.tableView.rowHeight = 160
bindTableView()
observeSearchBar()
// Do any additional setup after loading the view.
}
override func viewDidAppear(_ animated: Bool) {
getLectures()
self.tableView.reloadData()
self.tableView.tableFooterView = UIView(frame: CGRect.zero)
}
private func bindTableView() {
lectures.bind(to: self.tableView.rx.items(cellIdentifier: "ListCell", cellType: LecturesViewCell.self)) { (row, element, cell) in
cell.separatorInset = UIEdgeInsets.zero
cell.lectureName.text = element.lecture
cell.lectureCode.text = element.code
cell.professor.text = element.professor
cell.location.text = element.location
cell.startTime.text = element.start_time
cell.endTime.text = element.end_time
cell.dayOfWeek.text = "(" + element.dayofweek.reversed().joined(separator: "), (") + ")"
}.disposed(by: bag)
}
private func observeSearchBar() {
self.searchBar
.rx.text
.orEmpty
.debounce(.milliseconds(500), scheduler: MainScheduler.instance)
.distinctUntilChanged()
.filter({ !$0.isEmpty })
.subscribe(onNext: {
self.getLecturesByName($0)
DispatchQueue.main.async {
self.tableView.reloadSections(IndexSet.init(integersIn: 0...0), with: UITableView.RowAnimation.automatic)
}
})
.disposed(by: bag)
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
}
*/
}
extension LecturesViewController: UITableViewDelegate, UISearchBarDelegate {
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
//let code: String
if let cell = self.tableView.cellForRow(at: indexPath) as? LecturesViewCell {
if let name = cell.lectureName.text {
performSegue(withIdentifier: "showLectureDetail", sender: name)
}
}
}
func searchBarTextDidBeginEditing(_ searchBar: UISearchBar) {
searchBar.showsCancelButton = true
}
func searchBarCancelButtonClicked(_ searchBar: UISearchBar) {
getLectures()
self.searchBar.text = nil
self.searchBar.showsCancelButton = false
self.searchBar.endEditing(true)
}
//뷰 이동을 도와주는 함수
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
let DetailVC = segue.destination as! LectureDetailViewController
DetailVC.name = sender as! String
}
}
extension LecturesViewController {
// 모든 강좌를 가져오는 함수
func getLectures() {
guard let url = URL(string: DataModel.strURL + "/lectures")
else {return}
Alamofire.request(url, method: .get, parameters: nil, encoding: JSONEncoding.default, headers: DataModel.headers).responseJSON {
(response) in
if response.result.isSuccess {
guard let data = response.data else {return}
do {
let lecture = try JSONDecoder().decode(Lectures.self, from: data)
self.lectures.accept(lecture.Items)
}
catch let error {
print("ERROR: \(error)")
}
}
}
}
// 이름을 기준으로 모든 강좌를 가져오는 함수
func getLecturesByName(_ name: String) {
let urlString = DataModel.strURL + "/lectures?lecture=" + name
let encodingURL = urlString.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!
guard let url = URL(string: encodingURL)
else {return}
Alamofire.request(url, method: .get, parameters: nil, encoding: JSONEncoding.default, headers: DataModel.headers).responseJSON {
(response) in
if response.result.isSuccess {
guard let data = response.data else {return}
do {
let lecture = try JSONDecoder().decode(Lectures.self, from: data)
/* 처리 할 내용 */
self.lectures.accept(lecture.Items)
}
catch let error {
print("ERROR: \(error)")
}
}
}
}
}
|
[
-1
] |
ae2803e6140c5e80ac95e04142b90bcb672f1176
|
a99624e8fbca25f57e7fb05002fc8fba22f711ac
|
/CoEpi/ui/onboarding/OnboardingViewController.swift
|
cbdddd0fc6a1be193d5de4a18ace87ecaf353741
|
[
"MIT"
] |
permissive
|
thymetech/app-ios
|
f3c39de181de240c0e89bde53ba7fb35554f5999
|
cd92748172e59d475670bd3c43a376faff7f0ff3
|
refs/heads/master
| 2022-11-13T17:48:24.658450 | 2020-06-06T07:04:02 | 2020-06-06T07:04:02 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 3,086 |
swift
|
import UIKit
import SafariServices
class OnboardingViewController: UIViewController {
@IBOutlet weak var trackLabel: UILabel!
@IBOutlet weak var monitorLabel: UILabel!
@IBOutlet weak var alertsLabel: UILabel!
@IBOutlet weak var tagLineLabel: UILabel!
@IBOutlet weak var getStartedButton: OnboardingButton!
@IBOutlet weak var privacyButton: UIButton!
private let viewModel: OnboardingViewModel
init(viewModel: OnboardingViewModel) {
self.viewModel = viewModel
super.init(nibName: String(describing: Self.self), bundle: nil)
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func viewDidLoad() {
super.viewDidLoad()
setupGradient()
setupButtons()
setupLabels()
}
func setupGradient() {
guard let view = view as? GradientView else { return }
view.startColor = Theme.color.coepiBlue
view.endColor = Theme.color.coepiAqua
view.endLocation = 0.4
}
func setupButtons() {
privacyButton.setAttributedTitle(privacyButtonTitle, for: .normal)
getStartedButton.setAttributedTitle(getStartedButtonTitle, for: .normal)
}
func setupLabels() {
trackLabel.attributedText = OnboardingStrings.makeAttributedTrack() //.markupAttributed(pointSize: pointSize, color: color)
monitorLabel.attributedText = OnboardingStrings.makeAttributedMonitor() //.markupAttributed(pointSize: pointSize, color: color)
alertsLabel.attributedText = OnboardingStrings.makeAttributedAlerts() //.markupAttributed(pointSize: pointSize, color: color)
tagLineLabel.text = OnboardingStrings.collaborate
}
@IBAction func onCloseClick(_ sender: UIButton) {
viewModel.onCloseClick()
}
@IBAction func howDataUsedClick(_ sender: UIButton) {
if let url = URL(string: "https://www.coepi.org/privacy/") {
let config = SFSafariViewController.Configuration()
config.entersReaderIfAvailable = false
let vc = SFSafariViewController(url: url, configuration: config)
present(vc, animated: true)
}
}
}
private extension OnboardingViewController {
var privacyButtonTitle: NSAttributedString {
let attrs: FontAttributes = [
.foregroundColor: Theme.color.coepiUnderlineButton,
.underlineStyle: NSUnderlineStyle.single.rawValue
]
return NSAttributedString(string: OnboardingStrings.howYourDataIsUsed,
attributes: attrs)
}
var getStartedButtonTitle: NSAttributedString {
let attrs: FontAttributes = [
.foregroundColor: UIColor.white,
.kern: 5,
.font: Fonts.robotoBold14
]
return NSAttributedString(string: OnboardingStrings.getStarted.uppercased(),
attributes: attrs)
}
}
|
[
-1
] |
bc3c58d8724c92853f5a65ae497fa02fa9539979
|
6bdbd7190d1413d8c959d5f7d9f1c2927214857f
|
/Source/RXCEntityListViewController.swift
|
cf744c809da9c308443e6873f02e12c67d69a1ba
|
[
"MIT"
] |
permissive
|
ruixingchen/RXCEntityListViewController
|
6c5b21e8ce718bcec59730a670b1be09f5548386
|
3d830210bd7a26e9c16930f4e6a7858a2a071974
|
refs/heads/master
| 2020-06-22T03:04:19.151085 | 2019-09-15T17:15:43 | 2019-09-15T17:15:43 | 197,616,669 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 15,671 |
swift
|
//
// RXCEntityListViewController.swift
// CoolMarket
//
// Created by ruixingchen on 9/5/19.
// Copyright © 2019 CoolApk. All rights reserved.
//
import UIKit
#if canImport(AsyncDisplayKit)
import AsyncDisplayKit
#endif
#if canImport(RXCDiffArray)
import RXCDiffArray
#endif
#if !(CanUseASDK || canImport(AsyncDisplayKit))
private protocol ASTableDataSource {}
private protocol ASTableDelegate {}
private protocol ASCollectionDataSource {}
private protocol ASCollectionDelegate {}
#endif
public extension RXCEntityListViewController {
enum ListStructure {
///one entity for one row, just 1 section
case entityForRow
///one entity for one section, every section only has 1 row
case entityForSection
///2D structure
case cardForSection
}
enum HeaderRefreshMode {
///new data will be inserted at the head
case insert
///will reload all content, set page to 1
case reload
}
enum RequestType {
//case `init`
case headerRefresh
case footerRefresh
}
}
open class RXCEntityListViewController: UIViewController, ASTableDataSource,ASTableDelegate,ASCollectionDataSource,ASCollectionDelegate, UITableViewDataSource, UITableViewDelegate, UICollectionViewDataSource, UICollectionViewDelegate, RXCDiffArrayDelegate {
public typealias DataList = RXCDiffArray<[RELCard], RELEntity>
//下面的别名是为了方便我们整合代码, 当需要修改的时候直接改这里就好, 降低复杂度, 为了通用性考虑, 默认直接采用AnyObject也是极好的
public typealias ListRequestTask = AnyObject
public typealias ListRequestResponse = AnyObject
open var listViewObject:RELListViewProtocol!
#if (CanUseASDK || canImport(AsyncDisplayKit))
open var tableNode:ASTableNode! {return self.listViewObject as? ASTableNode}
open var collectionNode:ASCollectionNode! {return self.listViewObject as? ASCollectionNode}
#endif
open var tableView:UITableView! {
if let tv = self.listViewObject as? UITableView {return tv}
#if canImport(AsyncDisplayKit)
if let tn = self.listViewObject as? ASTableNode {return tn.view}
#endif
return nil
}
open var collectionView:UICollectionView! {
if let cv = self.listViewObject as? UICollectionView {return cv}
#if canImport(AsyncDisplayKit)
if let cn = self.listViewObject as? ASCollectionNode {return cn.view}
#endif
return nil
}
//MARK: - UI
#if (CanUseASDK || canImport(AsyncDisplayKit))
open var useASDK:Bool
#endif
open var useCollectionView:Bool
//MARK: - 数据 / Data
open var dataList:DataList!
///当请求到数据后, 按照顺序让数据处理器对新请求到的数据进行处理或者过滤
open var dataProcessors:[AnyObject] = []
///当前列表数据的最大页码, 为0表示当前没有进行请求
open var page:Int = 0
//MARK: - 标记 / MARK
///自动内容控制,当数据源发生变化的时候自动更新ListView
open var autoContentControl:Bool = true
//MARK: - 请求相关
open var lastHeaderRequest:ListRequestTask?
open var lastFooterRequest:ListRequestTask?
///列表还有更多内容
open var hasMoreData:Bool = true
///头部刷新组件指针, 用于确定是否安装了头部刷新组件
open var headerRefreshComponent:AnyObject?
///底部刷新组件指针, 用于确定是否安装了底部刷新组件
open var footerRefreshComponent:AnyObject?
//MARK: - 性能
#if (CanUseASDK || canImport(AsyncDisplayKit))
///添加或者更新Cell的时候可能会引起闪烁, 每次更新之前, 将要更新的Cell的位置加入这个数组, TableNode在返回Cell的时候会将这个Cell的neverShowPlaceholder设置为true, 一段时间后再改回falsse, 之后将该indexPath从本数组删除, 解决办法来自贝聊科技的文章
open var neverShowPlaceholderIndexPathes:[IndexPath] = []
#endif
//MARK: - 初始化 / INIT
#if (CanUseASDK || canImport(AsyncDisplayKit))
public init(style:UITableView.Style, useCollectionView:Bool, useASDK:Bool) {
self.useASDK = useASDK
self.useCollectionView = useCollectionView
super.init(nibName: nil, bundle: nil)
self.initListView()
self.initDataList()
}
#else
public init(style:UITableView.Style, useCollectionView:Bool) {
self.useCollectionView = useCollectionView
super.init(nibName: nil, bundle: nil)
self.initListView()
self.initDataList()
}
#endif
required public init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
open func initDataList() {
//默认没有数据
self.dataList = DataList()
self.dataList.delegate = self
}
open func initListView() {
#if (CanUseASDK || canImport(AsyncDisplayKit))
if self.useASDK {
if self.useCollectionView {
let flow = UICollectionViewFlowLayout()
flow.scrollDirection = .vertical
let cn = ASCollectionNode(collectionViewLayout: flow)
cn.dataSource = self
cn.delegate = self
self.listViewObject = cn
}else {
let tn = ASTableNode()
tn.dataSource = self
tn.delegate = self
self.listViewObject = tn
}
return
}
#endif
if self.useCollectionView {
let flow = UICollectionViewFlowLayout()
flow.scrollDirection = .vertical
let cv = UICollectionView(frame: UIScreen.main.bounds, collectionViewLayout: flow)
cv.dataSource = self
cv.delegate = self
self.listViewObject = cv
}else {
let tv = UITableView()
tv.dataSource = self
tv.delegate = self
self.listViewObject = tv
}
}
//MARK: - 生命周期 / LifeCycle
open override func viewDidLoad() {
super.viewDidLoad()
self.setupListViewOnViewDidLoad()
#if (CanUseASDK || canImport(AsyncDisplayKit))
if let node = self.listViewObject as? ASDisplayNode {
self.view.addSubnode(node)
}
#endif
if let _view = self.listViewObject as? UIView {
self.view.addSubview(_view)
}
}
open func setupListViewOnViewDidLoad() {
}
open override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
//第一次出现的时候请求数据
}
open override func viewWillLayoutSubviews() {
super.viewWillLayoutSubviews()
if let likeView = self.listViewObject as? RXCViewLikeObjectProtocol {
likeView.frame = self.view.bounds
}
}
//MARK: - 操作 ListView
///安装顶部刷新控件
open func installHeaderRefreshComponent() {
//默认安装系统的刷新组件
guard self.headerRefreshComponent == nil else {return}
let refresh = UIRefreshControl()
refresh.addTarget(self, action: #selector(headerRefreshAction(sender:)), for: .valueChanged)
if let obj = self.listViewObject as? UITableView {
obj.refreshControl = refresh
}else if let obj = self.listViewObject as? UICollectionView {
obj.refreshControl = refresh
}else {
#if (CanUseASDK || canImport(AsyncDisplayKit))
if let obj = self.listViewObject as? ASTableNode {
obj.view.refreshControl = refresh
}else if let obj = self.listViewObject as? ASCollectionNode {
obj.view.refreshControl = refresh
}else {
assertionFailure("无法找到合适的ListViewObject类型来安装头部刷新组件:\(String(describing: self.listViewObject))")
}
#else
assertionFailure("无法找到合适的ListViewObject类型来安装头部刷新组件:\(String(describing: self.listViewObject))")
#endif
}
self.headerRefreshComponent = refresh
}
///卸载顶部刷新控件
open func uninstallHeaderRefreshComponent() {
guard self.headerRefreshComponent != nil else {return}
//这里由于ASDK也可以获取到指针, 直接用??一起获取了
if let obj = self.listViewObject as? UITableView ?? self.tableView, obj.refreshControl != nil {
obj.refreshControl = nil
}else if let obj = self.listViewObject as? UICollectionView ?? self.collectionView, obj.refreshControl != nil {
obj.refreshControl = nil
}else {
assertionFailure("无法找到合适的类型来卸载头部刷新组件:\(String(describing: self.listViewObject))")
}
self.headerRefreshComponent = nil
}
///安装底部刷新控件
open func installFooterRefreshComponent() {
}
///卸载底部刷新控件
open func uninstallFooterRefreshComponent() {
}
open func stopHeaderRefreshComponent() {
if let refresh = self.headerRefreshComponent as? UIRefreshControl {
refresh.endRefreshing()
}
}
open func stopFooterRefreshComponent() {
}
//MARK: - TableView
public func numberOfSections(in tableView: UITableView) -> Int {
return self.dataList.count
}
public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return self.dataList[section].rda_elements.count
}
public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
return UITableViewCell()
}
//MARK: - CollectionView
public func numberOfSections(in collectionView: UICollectionView) -> Int {
return self.dataList.count
}
public func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return self.dataList[section].rda_elements.count
}
public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
return UICollectionViewCell()
}
//MARK: - ASTableNode
#if (CanUseASDK || canImport(AsyncDisplayKit))
public func numberOfSections(in tableNode: ASTableNode) -> Int {
return self.dataList.count
}
public func tableNode(_ tableNode: ASTableNode, numberOfRowsInSection section: Int) -> Int {
return self.dataList[section].rda_elements.count
}
public func tableNode(_ tableNode: ASTableNode, nodeBlockForRowAt indexPath: IndexPath) -> ASCellNodeBlock {
return {
return ASCellNode()
}
}
//MARK: - ASCollectionNode
public func numberOfSections(in collectionNode: ASCollectionNode) -> Int {
return self.dataList.count
}
public func collectionNode(_ collectionNode: ASCollectionNode, numberOfItemsInSection section: Int) -> Int {
return self.dataList[section].rda_elements.count
}
public func collectionNode(_ collectionNode: ASCollectionNode, nodeBlockForItemAt indexPath: IndexPath) -> ASCellNodeBlock {
return {
return ASCellNode()
}
}
#endif
//MARK: - RXCDiffArrayDelegate
public func diffArray<SectionContainer, RowElement>(array: RXCDiffArray<SectionContainer, RowElement>, didChange difference: RDADifference<SectionContainer.Element, RowElement>) where SectionContainer : RangeReplaceableCollection {
if let object = self.listViewObject as? UITableView {
object.reload(with: difference, animations: RDATableViewAnimations.automatic(), completion: nil)
}else if let object = self.listViewObject as? UICollectionView {
object.reload(with: difference, completion: nil)
}else {
#if (CanUseASDK || canImport(AsyncDisplayKit))
if let object = self.listViewObject as? ASTableNode {
object.reload(with: difference, animations: RDATableViewAnimations.automatic(), completion: nil)
}else if let object = self.listViewObject as? ASCollectionNode {
object.reload(with: difference, completion: nil)
}else {
assertionFailure("无法找到合适的ListView类型:\(String(describing: self.listViewObject))")
}
#else
assertionFailure("无法找到合适的ListView类型:\(String(describing: self.listViewObject))")
#endif
}
}
//MARK: - 请求状态
func isHeaderRequesting()->Bool {
return self.lastHeaderRequest != nil
}
func isFooterRequesting()->Bool {
return self.lastFooterRequest != nil
}
func cancelHeaderRefreshRequest() {
if let req = self.lastHeaderRequest as? URLSessionTask {
req.cancel()
return
}
#if canImport(Alamofire)
if let req = self.lastHeaderRequest as? AnyObject {
return
}
#endif
fatalError("子类需要重写来实现功能")
}
func cancelFooterRefreshRequest() {
if let req = self.lastHeaderRequest as? URLSessionTask {
req.cancel()
return
}
#if canImport(Alamofire)
if let req = self.lastHeaderRequest as? AnyObject {
return
}
#endif
fatalError("子类需要重写来实现功能")
}
///此时是否可以发起头部刷新请求
open func canTakeHeaderRefreshRequest()->Bool {
//一般情况下, 头部刷新优先级高于底部刷新, 头部刷新进行的时候, 直接取消底部刷新
return true
}
///此时是否可以发起底部刷新请求
open func canTakeFooterRefreshRequest()->Bool {
if self.isHeaderRequesting() {
return false
}
if !self.hasMoreData {
return false
}
return true
}
//MARK: - 请求逻辑
///这个函数可以接收头部刷新传来的事件
@objc func headerRefreshAction(sender:Any?) {
//当执行头部刷新的时候, 先取消底部刷新, 防止干扰
guard self.canTakeHeaderRefreshRequest() else {return}
self.cancelFooterRefreshRequest()
self.stopFooterRefreshComponent()
}
open func listRequestUrl(requestType:RequestType, page:Int, userInfo:[AnyHashable:Any]?)->URL {
fatalError("本功能应由子类提供")
}
// open func listRequestSpec(requestType:RequestType, page:Int, userInfo:[AnyHashable:Any]?) -> RELRequestSpec {
//
// }
//开始请求
open func startListRequest(requestSpec:RELRequestSpec, userInfo:[AnyHashable:Any]?) {
}
///请求接收到回应
open func onListRequestResponse() {
}
///请求的回应是错误信息
open func onListRequestResponseError() {
}
///根据服务器的返回结果判断列表后面是否还有数据
open func hasMoreDataAfter(response:AnyObject)->Bool {
//由于很多时候判断后面是否还有数据的方法不尽相同, 这里采用一个函数来处理
fatalError("子类必须实现本方法")
}
///列表请求成功
open func onListRequestSuccess() {
//进入数据处理流程
}
}
|
[
-1
] |
32e0c539d25c74d418b2108d31538dc347c3df93
|
6a1ea5aa05875adb2062426e663f64aba901b9a9
|
/Story/AppDelegate.swift
|
36f0f8e8a0913ce0c3bd7cadfc116258e73ae167
|
[] |
no_license
|
hezhibo/Story
|
9eba10c292d1e64d6e3c70a694b8f6832ca494c4
|
af7a9960e5f886a8b80ac83f142ae2a93dfa82a0
|
refs/heads/master
| 2020-08-20T01:41:49.471065 | 2019-10-18T07:55:59 | 2019-10-18T07:55:59 | 215,972,505 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,163 |
swift
|
//
// AppDelegate.swift
// Story
//
// Created by apple on 2019/10/18.
// Copyright © 2019 HeZhiBo. 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,
229388,
294924,
229391,
327695,
229394,
229397,
229399,
229402,
278556,
229405,
229408,
278564,
294950,
229415,
229417,
327722,
237613,
229422,
360496,
229426,
237618,
229428,
311349,
286774,
286776,
319544,
204856,
229432,
286778,
352318,
286791,
237640,
278605,
286797,
311375,
163920,
237646,
196692,
319573,
311383,
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,
295110,
286922,
286924,
286926,
319694,
286928,
131281,
278743,
278747,
295133,
155872,
319716,
237807,
303345,
286962,
303347,
131314,
229622,
327930,
278781,
278783,
278785,
237826,
319751,
278792,
286987,
319757,
311569,
286999,
319770,
287003,
287006,
287009,
287012,
287014,
287016,
287019,
311598,
287023,
262448,
311601,
295220,
287032,
155966,
319809,
319810,
278849,
319814,
311623,
319818,
311628,
229709,
319822,
287054,
278865,
229717,
196963,
196969,
139638,
213367,
106872,
319872,
311683,
319879,
311693,
65943,
319898,
311719,
278952,
139689,
278957,
311728,
278967,
180668,
311741,
278975,
319938,
278980,
98756,
278983,
319945,
278986,
319947,
278990,
278994,
311767,
279003,
279006,
188895,
172512,
287202,
279010,
279015,
172520,
319978,
279020,
172526,
311791,
279023,
172529,
279027,
319989,
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,
303696,
279124,
172634,
262752,
254563,
172644,
311911,
189034,
295533,
172655,
172656,
352880,
189039,
295538,
172660,
189040,
189044,
287349,
287355,
287360,
295553,
172675,
295557,
311942,
303751,
287365,
352905,
311946,
279178,
287371,
311951,
287377,
172691,
287381,
311957,
221850,
287386,
230045,
287390,
303773,
164509,
172705,
287394,
172702,
303780,
172707,
287398,
205479,
279208,
287400,
172714,
295595,
279212,
189102,
172721,
287409,
66227,
303797,
189114,
287419,
303804,
328381,
287423,
328384,
279231,
287427,
312005,
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,
189169,
205564,
303871,
230146,
295685,
328453,
230154,
33548,
312077,
295695,
295701,
230169,
369433,
295707,
328476,
295710,
230175,
295720,
303914,
279340,
205613,
279353,
230202,
312124,
328508,
222018,
295755,
377676,
148302,
287569,
303959,
230237,
279390,
230241,
279394,
303976,
336744,
303981,
303985,
303987,
328563,
279413,
303991,
303997,
295806,
295808,
304005,
295813,
304007,
320391,
213895,
304009,
304011,
230284,
304013,
279438,
295822,
189329,
295825,
189331,
304019,
58262,
304023,
279452,
234648,
410526,
279461,
279462,
304042,
213931,
304055,
230327,
287675,
197564,
230334,
304063,
238528,
304065,
213954,
189378,
156612,
295873,
213963,
312272,
304084,
304090,
320481,
304106,
320490,
312302,
328687,
320496,
304114,
295928,
320505,
312321,
295945,
295949,
230413,
197645,
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,
279661,
205934,
164973,
312432,
279669,
337018,
189562,
279679,
304258,
279683,
222340,
66690,
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,
296213,
296215,
320792,
230681,
214294,
304416,
230689,
173350,
312622,
296243,
312630,
222522,
296253,
222525,
296255,
312639,
230718,
296259,
378181,
296262,
230727,
296264,
238919,
320840,
296267,
296271,
222545,
230739,
312663,
337244,
222556,
230752,
312676,
230760,
173418,
410987,
148843,
230763,
230768,
296305,
312692,
230773,
304505,
181626,
304506,
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,
280021,
288214,
239064,
329177,
288217,
280027,
288220,
288218,
239070,
288224,
280034,
288226,
280036,
288229,
280038,
288230,
288232,
370146,
320998,
288234,
288236,
288238,
288240,
288242,
296435,
288244,
288250,
148990,
321022,
206336,
402942,
296450,
296446,
230916,
230919,
214535,
304651,
370187,
304653,
230923,
230940,
222752,
108066,
296486,
296488,
157229,
239152,
230961,
157236,
288320,
288325,
124489,
280140,
280145,
288338,
280149,
288344,
280152,
239194,
280158,
403039,
370272,
181854,
239202,
312938,
280183,
280185,
280188,
280191,
116354,
280194,
280208,
280211,
288408,
280218,
280222,
419489,
190118,
198310,
321195,
296622,
321200,
337585,
296626,
296634,
296637,
419522,
313027,
280260,
419525,
206536,
280264,
206539,
206541,
206543,
263888,
280276,
313044,
321239,
280283,
18140,
313052,
288478,
313055,
419555,
321252,
313066,
280302,
288494,
280304,
313073,
419570,
288499,
321266,
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,
313176,
280419,
321381,
296809,
296812,
313201,
1920,
255873,
305028,
280454,
247688,
280464,
124817,
280468,
239510,
280473,
124827,
214940,
247709,
214944,
280487,
313258,
321458,
296883,
124853,
214966,
10170,
296890,
288700,
296894,
190403,
296900,
280515,
337862,
165831,
280521,
231379,
296921,
354265,
354270,
239586,
313320,
354281,
231404,
124913,
165876,
321528,
313340,
239612,
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,
215154,
313458,
280691,
149618,
313464,
329850,
321659,
280702,
288895,
321670,
215175,
141446,
288909,
141455,
141459,
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,
157940,
280819,
182517,
280823,
280825,
280827,
280830,
280831,
280833,
125187,
280835,
125191,
125207,
125209,
321817,
125218,
321842,
223539,
125239,
280888,
305464,
280891,
289087,
280897,
280900,
239944,
305480,
280906,
239947,
305485,
305489,
379218,
280919,
248153,
354653,
313700,
313705,
280937,
190832,
280946,
223606,
313720,
280956,
239997,
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,
215526,
166378,
305647,
281075,
174580,
240124,
281084,
305662,
305664,
240129,
305666,
305668,
223749,
240132,
281095,
223752,
338440,
150025,
330244,
223757,
281102,
223763,
223765,
281113,
322074,
281116,
281121,
182819,
281127,
150066,
158262,
158266,
289342,
281154,
322115,
158283,
281163,
281179,
338528,
338532,
281190,
199273,
281196,
158317,
19053,
313973,
297594,
281210,
158347,
264845,
182926,
133776,
314003,
117398,
314007,
289436,
174754,
330404,
289448,
133801,
174764,
314029,
314033,
240309,
133817,
314045,
314047,
314051,
199364,
297671,
158409,
256716,
289493,
363234,
289513,
289522,
289525,
289532,
322303,
289537,
322310,
264969,
322314,
322318,
281361,
281372,
322341,
215850,
281388,
289593,
281401,
289601,
281410,
281413,
281414,
240458,
281420,
240468,
281430,
322393,
297818,
281435,
281438,
281442,
174955,
224110,
207733,
207737,
183172,
158596,
338823,
322440,
314249,
240519,
183184,
142226,
240535,
289687,
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,
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,
306694,
192008,
323084,
257550,
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,
175770,
298651,
323229,
282269,
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,
307009,
413506,
241475,
307012,
298822,
148946,
315211,
282446,
307027,
315221,
323414,
315223,
241496,
241498,
307035,
307040,
110433,
282465,
241509,
110438,
298860,
110445,
282478,
315249,
110450,
315251,
282481,
315253,
315255,
339838,
315267,
282499,
315269,
241544,
282505,
241546,
241548,
298896,
298898,
282514,
241556,
298901,
44948,
241560,
282520,
241563,
241565,
241567,
241569,
282531,
241574,
282537,
298922,
36779,
241581,
282542,
241583,
323504,
241586,
282547,
290739,
241588,
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,
307211,
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,
241821,
184479,
299167,
184481,
315557,
184486,
307370,
307372,
184492,
307374,
307376,
299185,
323763,
176311,
299191,
307385,
307386,
258235,
307388,
176316,
307390,
184503,
299200,
184512,
307394,
307396,
299204,
184518,
307399,
323784,
233679,
307409,
307411,
176343,
299225,
233701,
307432,
184572,
282881,
184579,
282893,
323854,
291089,
282906,
291104,
233766,
295583,
176435,
307508,
315701,
332086,
307510,
307512,
168245,
307515,
307518,
282942,
282947,
323917,
110926,
282957,
233808,
323921,
315733,
323926,
233815,
315739,
323932,
299357,
242018,
242024,
299373,
315757,
250231,
242043,
315771,
299388,
299391,
291202,
299398,
242057,
291212,
299405,
291222,
315801,
283033,
242075,
291226,
291231,
61855,
283042,
291238,
291241,
127403,
127405,
127407,
291247,
299440,
299444,
127413,
283062,
291254,
127417,
291260,
283069,
127421,
127424,
299457,
127429,
127431,
315856,
176592,
315860,
176597,
283095,
127447,
299481,
176605,
242143,
127457,
291299,
340454,
127463,
242152,
291305,
127466,
176620,
127469,
127474,
291314,
291317,
135672,
233979,
291323,
127485,
291330,
127490,
283142,
127494,
127497,
233994,
135689,
127500,
291341,
233998,
127506,
234003,
127509,
234006,
127511,
152087,
283161,
234010,
242202,
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,
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,
226037,
283382,
316151,
234231,
234236,
226045,
242431,
234239,
209665,
234242,
299778,
242436,
226053,
234246,
226056,
234248,
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,
160572,
283452,
234302,
234307,
242499,
234309,
316233,
234313,
316235,
234316,
283468,
242511,
234319,
234321,
234324,
201557,
185173,
234329,
234333,
308063,
234336,
234338,
349027,
242530,
234341,
234344,
234347,
177004,
234350,
324464,
234353,
152435,
177011,
234356,
234358,
234362,
234364,
291711,
234368,
234370,
201603,
291714,
234373,
316294,
226182,
234375,
308105,
291716,
324490,
226185,
234379,
234384,
234388,
234390,
324504,
234393,
209818,
308123,
324508,
234396,
291742,
226200,
234401,
291747,
291748,
234405,
291750,
234407,
324520,
324518,
234410,
291754,
291756,
324522,
226220,
324527,
291760,
234417,
201650,
324531,
234414,
234422,
226230,
324536,
275384,
234428,
291773,
234431,
242623,
324544,
324546,
234434,
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,
324599,
234487,
234490,
234493,
234496,
316416,
308226,
234501,
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,
160835,
234563,
234568,
234570,
316491,
300108,
234572,
234574,
300115,
234580,
234581,
242777,
234585,
275545,
234590,
234593,
234595,
300133,
234597,
234601,
300139,
234605,
160879,
234607,
275569,
234610,
316530,
300148,
234614,
398455,
144506,
234618,
275579,
234620,
234623,
226433,
234627,
275588,
234629,
242822,
234634,
234636,
177293,
234640,
275602,
234643,
308373,
226453,
234647,
275606,
275608,
234650,
308379,
324757,
234653,
300189,
119967,
324766,
324768,
283805,
234657,
242852,
234661,
283813,
300197,
234664,
177318,
275626,
234667,
316596,
308414,
300223,
234687,
300226,
308418,
283844,
300229,
308420,
308422,
226500,
234692,
283850,
300234,
300238,
300241,
316625,
300243,
300245,
316630,
300248,
300253,
300256,
300258,
300260,
234726,
300263,
300265,
300267,
161003,
300270,
300272,
120053,
300278,
316663,
275703,
300284,
275710,
300287,
300289,
292097,
161027,
300292,
300294,
275719,
234760,
300299,
177419,
242957,
283917,
300301,
177424,
275725,
349451,
349464,
415009,
283939,
259367,
292143,
283951,
300344,
226617,
243003,
283963,
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,
144796,
300448,
144807,
144810,
144812,
284076,
144814,
144820,
284084,
284087,
292279,
144826,
144828,
144830,
144832,
144835,
144837,
38342,
144839,
144841,
144844,
144847,
144852,
144855,
103899,
300507,
333280,
218597,
292329,
300523,
259565,
300527,
308720,
259567,
226802,
292338,
316917,
292343,
308727,
300537,
316933,
316947,
308757,
308762,
284191,
316959,
284194,
284196,
235045,
284199,
284204,
284206,
284209,
284211,
284213,
308790,
284215,
316983,
194103,
284218,
194101,
226877,
292414,
284223,
284226,
284228,
292421,
226886,
284231,
128584,
243268,
284234,
366155,
317004,
276043,
284238,
226895,
284241,
292433,
284243,
300628,
284245,
194130,
284247,
317015,
235097,
243290,
276053,
284249,
284251,
300638,
284253,
284255,
243293,
284258,
292452,
292454,
284263,
177766,
284265,
292458,
284267,
292461,
284272,
284274,
276086,
284278,
292470,
292473,
284283,
276093,
284286,
292479,
284288,
292481,
284290,
325250,
284292,
292485,
276095,
276098,
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,
276166,
284358,
358089,
284362,
276170,
276175,
284368,
276177,
284370,
358098,
284372,
317138,
284377,
276187,
284379,
284381,
284384,
358114,
284386,
358116,
276197,
317158,
358119,
284392,
325353,
358122,
284394,
284397,
358126,
276206,
358128,
284399,
358133,
358135,
276216,
358138,
300795,
358140,
284413,
358142,
358146,
317187,
284418,
317189,
317191,
284428,
300816,
300819,
317207,
284440,
300828,
300830,
276255,
325408,
300832,
300834,
317221,
227109,
358183,
186151,
276268,
300845,
243504,
300850,
284469,
276280,
325436,
358206,
276291,
366406,
276295,
300872,
153417,
292681,
358224,
284499,
276308,
178006,
317271,
284502,
276315,
292700,
284511,
317279,
227175,
292715,
300912,
284529,
292721,
300915,
284533,
292729,
317306,
284540,
292734,
325512,
169868,
276365,
358292,
284564,
317332,
284566,
399252,
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,
292839,
276455,
292843,
276460,
292845,
276464,
178161,
227314,
276466,
325624,
276472,
317435,
276476,
276479,
276482,
276485,
317446,
276490,
350218,
292876,
350222,
317456,
276496,
317458,
178195,
243733,
317468,
243740,
317472,
325666,
243751,
292904,
276528,
243762,
309298,
325685,
325689,
235579,
325692,
235581,
178238,
276539,
276544,
243779,
325700,
284739,
292934,
243785,
350293,
350295,
309337,
194649,
227418,
350299,
350302,
227423,
194654,
178273,
309346,
194657,
309348,
350308,
309350,
227426,
309352,
350313,
309354,
301163,
350316,
194660,
227430,
276583,
276590,
350321,
284786,
276595,
301167,
350325,
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,
309450,
301258,
276685,
309455,
276689,
309462,
301272,
276699,
309468,
194780,
309471,
301283,
317672,
317674,
325867,
243948,
194801,
309491,
227571,
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,
276843,
293227,
276848,
293232,
186744,
211324,
227709,
285061,
366983,
317833,
178572,
285070,
285077,
178583,
227738,
317853,
276896,
317858,
342434,
285093,
317864,
285098,
276907,
235955,
276917,
293304,
293307,
293314,
309707,
293325,
317910,
293336,
235996,
317917,
293343,
358880,
276961,
227810,
293346,
276964,
293352,
236013,
293364,
301562,
293370,
317951,
309764,
301575,
121352,
236043,
317963,
342541,
55822,
113167,
309779,
317971,
309781,
277011,
55837,
227877,
227879,
293417,
227882,
309804,
293421,
105007,
236082,
285236,
23094,
277054,
244288,
219714,
129603,
318020,
301636,
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,
342707,
318132,
154292,
293555,
277173,
277177,
277181,
318144,
277187,
277191,
277194,
277196,
277201,
342745,
137946,
342747,
342749,
113378,
203491,
228069,
277223,
342760,
285417,
56041,
56043,
277232,
228081,
56059,
310015,
285441,
310020,
285448,
310029,
228113,
285459,
277273,
293659,
326430,
228128,
293666,
285474,
228135,
318248,
277291,
318253,
293677,
285489,
301876,
293685,
285494,
301880,
285499,
301884,
310080,
293696,
277317,
277322,
293706,
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,
276579,
293811,
293817,
293820,
203715,
326603,
342994,
276586,
293849,
293861,
228327,
228328,
228330,
318442,
228332,
326638,
277486,
351217,
318450,
293876,
293877,
285686,
302073,
285690,
293882,
302075,
121850,
244731,
293887,
277504,
277507,
277511,
293899,
277519,
293908,
302105,
293917,
293939,
318516,
277561,
277564,
310336,
7232,
293956,
277573,
228422,
310344,
277577,
293960,
277583,
203857,
310355,
293971,
310359,
236632,
277594,
138332,
277598,
203872,
277601,
285792,
310374,
203879,
310376,
228460,
318573,
203886,
187509,
285815,
285817,
367737,
302205,
285821,
392326,
285831,
253064,
302218,
294026,
285835,
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,
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,
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,
310710,
130486,
310712,
277944,
310715,
277947,
302526,
228799,
277950,
277953,
302534,
245191,
310727,
64966,
163272,
277959,
292968,
302541,
277963,
302543,
277966,
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,
40488,
278057,
294439,
40491,
294440,
294443,
294445,
310831,
245288,
286248,
40499,
40502,
212538,
40507,
40511,
40513,
228933,
327240,
40521,
286283,
40525,
40527,
400976,
212560,
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,
302793,
294601,
343757,
212690,
278227,
286420,
319187,
229076,
286425,
319194,
278235,
278238,
229086,
286432,
294625,
294634,
302838,
319226,
286460,
278274,
302852,
278277,
302854,
311048,
294664,
352008,
319243,
311053,
302862,
319251,
294682,
278306,
188199,
294701,
319280,
278320,
319290,
229192,
302925,
188247,
188252,
237409,
229233,
294776,
360317,
294785,
327554,
360322,
40840,
40851,
294803,
188312,
294811,
319390,
237470,
40865,
319394,
294817,
294821,
311209,
180142,
294831,
188340,
40886,
319419,
294844,
294847,
237508,
393177,
294876,
294879,
294883,
393190,
294890,
311279,
278513,
237555,
311283,
278516,
237562
] |
f9035cf8abb18dffa8fa1110229b33f97667d1a4
|
3e444b855333063f7d64208d5f5d709efbd514fa
|
/MyLocations/Functions.swift
|
e3c851478507944d2e755601bace3d84af1f377b
|
[] |
no_license
|
thcho80/MyLocations
|
3d0e28e22da3e2ac1e6f2466090724f217d6e67c
|
d3fd21b4f6bee3f724a923eecfe0e976fec43464
|
refs/heads/master
| 2020-04-10T03:56:19.211584 | 2019-01-03T03:24:41 | 2019-01-03T03:24:41 | 160,783,356 | 0 | 0 | null | 2018-12-11T01:42:51 | 2018-12-07T06:49:41 |
Swift
|
UTF-8
|
Swift
| false | false | 371 |
swift
|
//
// Functions.swift
// MyLocations
//
// Created by human on 2019. 1. 2..
// Copyright © 2019년 com.humantrion. All rights reserved.
//
import Foundation
let applicationDocumentsDirectory: URL = {
let urls = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)
let documentDirectory = urls[0]
return documentDirectory
}()
|
[
-1
] |
caf905717cae591f7e481b41393c9fce65c09530
|
54ef3541135de347faad5085e00001347549f066
|
/DisplayNetworkEmptyView/UIViewController+EmptyView.swift
|
576e436698f10cc752d4cb302f8745b67eb35919
|
[
"MIT"
] |
permissive
|
zoeyzhong520/LearnNetworkEmptyView
|
249f0cc79901ae98674bad455684b2d68871f856
|
0797bb2b9da2a59fbca50cf5af4bd2ffc4cc9c75
|
refs/heads/master
| 2020-08-24T05:42:10.624987 | 2019-10-22T09:16:37 | 2019-10-22T09:19:17 | 216,770,821 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 638 |
swift
|
//
// UIViewController+EmptyView.swift
// DisplayNetworkEmptyView
//
// Created by 仲召俊 on 2019/10/22.
// Copyright © 2019 zhongzj. All rights reserved.
//
import UIKit
extension UIViewController {
///检查网络状态
func checkNetworkReachbality(baseView: UIView) {
if !NetworkReachbilityHandle.default.currentNetStatus {
let emptyView = EmptyView()
baseView.addSubview(emptyView)
} else {
for v in baseView.subviews {
if v.isKind(of: EmptyView.self) {
v.removeFromSuperview()
}
}
}
}
}
|
[
-1
] |
e6d1a27f140b82de947e6da7fd82ab57093947d0
|
527dfef18dd3835f8f9fa40b8152ad485e5bd322
|
/TacoPop/Taco.swift
|
69d113f85a5ddcc0f648d7dddf189ee6887e346f
|
[] |
no_license
|
JasonShepherd/TacoPop
|
7662911c20f5e2039f342a6da5b9e4b3a897c572
|
8cb04666c836e2435332d81bf6dcbb0a40ed19ca
|
refs/heads/master
| 2021-01-25T00:56:31.936864 | 2017-06-24T16:02:56 | 2017-06-24T16:02:56 | 94,701,985 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,793 |
swift
|
//
// Taco.swift
// TacoPop
//
// Created by Jason Shepherd on 6/18/17.
// Copyright © 2017 Jason Shepherd. All rights reserved.
//
import Foundation
enum TacoShell: Int{
case Flour = 1
case Corn = 2
}
enum Protein: String{
case Beef = "Beef"
case Chicken = "Chicken"
case Fish = "Fish"
case Brisket = "Brisket"
}
enum Condiment: Int {
case Loaded = 1
case Plain = 2
}
struct Taco {
private var _id :Int!
private var _productName: String!
private var _shellId: TacoShell!
private var _proteinId: Protein!
private var _condimentId: Condiment!
var id: Int{
return _id
}
var productName: String{
return _productName
}
var shellId: TacoShell{
return _shellId
}
var proteinId: Protein{
return _proteinId
}
var condimentId: Condiment{
return _condimentId
}
init(id:Int, productName:String,shellId:Int,proteinId:String, condimentId:Int) {
_id = id
_productName = productName
switch shellId {
case 2:
self._shellId = TacoShell.Corn
default:
self._shellId = TacoShell.Flour
}
switch proteinId{
case "Chicken":
self._proteinId = Protein.Chicken
case "Brisket":
self._proteinId = Protein.Brisket
case "Fish":
self._proteinId = Protein.Fish
default:
self._proteinId = Protein.Beef
}
switch condimentId{
case 2:
self._condimentId = Condiment.Loaded
default:
self._condimentId = Condiment.Plain
}
}
}
|
[
-1
] |
7640a660d36ad63f18236a7d16c110ff93d9d4e3
|
3c94926a31e7eeb3aeeda694da3965bdc3083267
|
/MasterCardHack/MasterCardHack/AppDelegate.swift
|
0a4c174c8c9a17ec43be2f1452cd643e67ac9eb3
|
[] |
no_license
|
chrissimusokwe/PopPay
|
e0d108369b80708475037821119743d994c267d6
|
8dee152ff7686afff1d1043ca340bfd558582517
|
refs/heads/master
| 2021-05-31T15:50:54.143307 | 2016-06-12T16:10:56 | 2016-06-12T16:10:56 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,156 |
swift
|
//
// AppDelegate.swift
// MasterCardHack
//
// Created by Davi Rodrigues on 11/06/16.
// Copyright © 2016 Davi Rodrigues. 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,
278559,
229408,
278564,
294950,
229415,
229417,
237613,
229422,
229426,
237618,
229428,
286774,
286776,
319544,
204856,
229432,
286791,
237640,
278605,
286797,
311375,
237646,
163920,
196692,
319573,
311383,
278623,
278626,
319590,
311400,
278635,
303212,
278639,
131192,
237693,
327814,
131209,
417930,
303241,
311436,
303244,
319633,
286873,
286876,
311460,
311469,
32944,
327862,
286906,
327866,
180413,
286910,
131264,
286916,
286922,
286924,
286926,
319694,
286928,
131281,
278743,
278747,
295133,
155872,
319716,
278760,
237807,
303345,
286962,
131314,
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,
319818,
311628,
229709,
287054,
319822,
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,
279010,
287202,
279015,
172520,
319978,
279020,
172526,
279023,
311791,
172529,
279027,
319989,
164343,
180727,
279035,
311804,
287230,
279040,
303617,
287234,
279045,
287238,
320007,
172550,
172552,
303623,
279051,
172558,
279055,
303632,
279058,
303637,
279063,
279067,
172572,
279072,
172577,
295459,
172581,
295461,
279082,
311850,
279084,
172591,
172598,
279095,
172607,
172609,
172612,
377413,
172614,
172618,
303690,
33357,
287309,
279124,
172634,
262752,
311911,
189034,
295533,
189039,
189040,
172655,
172656,
295538,
189044,
172660,
287349,
352880,
287355,
287360,
295553,
287365,
295557,
303751,
311942,
352905,
279178,
287371,
311946,
311951,
287377,
287381,
311957,
221850,
287386,
164509,
287390,
295583,
230045,
303773,
287394,
172707,
303780,
172702,
287398,
172705,
287400,
279208,
172714,
295595,
279212,
189102,
172721,
287409,
66227,
303797,
189114,
287419,
303804,
328381,
279231,
287423,
328384,
287427,
312006,
107208,
107212,
287436,
172748,
172751,
287440,
295633,
172755,
303827,
279255,
172760,
279258,
303835,
213724,
189149,
303838,
287450,
279267,
312035,
295654,
279272,
230128,
312048,
312050,
230131,
205564,
303871,
230146,
295685,
230154,
33548,
312077,
295695,
295701,
369433,
230169,
295707,
328476,
295710,
230175,
303914,
279340,
205613,
279353,
230202,
312124,
222018,
295755,
377676,
148302,
287569,
279383,
303959,
230237,
279390,
230241,
279394,
303976,
336744,
303985,
328563,
303987,
279413,
303991,
303997,
295806,
295808,
304005,
295813,
320391,
213895,
304009,
304007,
304011,
230284,
304013,
213902,
279438,
295822,
295825,
189329,
304019,
189331,
279445,
58262,
279452,
410526,
279461,
279462,
304042,
213931,
230327,
304055,
287675,
304063,
238528,
304065,
189378,
213954,
156612,
295873,
213963,
312272,
304084,
304090,
320481,
320490,
304106,
312302,
328687,
320496,
304114,
295928,
320505,
312321,
295945,
197645,
295949,
230413,
320528,
140312,
238620,
197663,
304164,
189479,
304170,
238641,
312374,
238652,
238655,
230465,
238658,
296004,
336964,
205895,
320584,
238666,
296021,
402518,
336987,
230497,
296036,
361576,
296040,
205931,
296044,
164973,
205934,
279661,
312432,
279669,
189562,
337018,
279679,
279683,
222340,
205968,
296084,
238745,
304285,
238756,
205991,
222377,
165035,
337067,
165038,
238766,
230576,
304311,
230592,
279750,
230600,
230607,
148690,
279769,
304348,
279777,
304354,
296163,
279781,
304360,
279788,
320748,
279790,
304370,
320771,
312585,
296202,
296205,
320786,
230674,
296213,
214294,
296215,
320792,
230677,
230681,
304416,
230689,
173350,
312622,
296243,
312630,
222522,
222525,
230718,
296255,
312639,
296259,
378181,
230727,
238919,
320840,
222545,
230739,
312663,
222556,
337244,
230752,
312676,
230760,
173418,
230763,
410987,
230768,
296305,
230773,
279929,
181626,
304506,
304505,
181631,
312711,
296331,
288140,
230800,
288144,
304533,
337306,
288154,
288160,
173472,
288162,
288164,
279975,
304555,
370092,
279983,
173488,
279985,
312755,
296373,
279991,
312759,
288185,
337335,
222652,
173507,
296389,
222665,
230860,
280014,
312783,
230865,
288210,
370130,
288212,
280021,
288214,
148946,
239064,
288217,
288218,
280027,
288220,
222676,
329177,
239070,
288224,
288226,
370146,
280036,
288229,
280038,
288230,
288232,
280034,
288234,
320998,
288236,
288238,
288240,
288242,
296435,
288244,
288250,
402942,
148990,
206336,
296446,
296450,
321022,
230916,
230919,
214535,
370187,
304651,
304653,
230940,
222752,
108066,
296488,
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,
280260,
280264,
206536,
206539,
206541,
280276,
313044,
321239,
280283,
288478,
313055,
321252,
313066,
280302,
288494,
280304,
313073,
419570,
288499,
288502,
280314,
288510,
124671,
67330,
280324,
280331,
198416,
280337,
296723,
116503,
321304,
329498,
296731,
313121,
313123,
304932,
321316,
280363,
141101,
165678,
280375,
321336,
296767,
288576,
345921,
280388,
304968,
280393,
280402,
313176,
280419,
321381,
296812,
313201,
1920,
255873,
305028,
280454,
247688,
280464,
124817,
280468,
239510,
280473,
124827,
214940,
247709,
280487,
313258,
321458,
296883,
124853,
214966,
10170,
296890,
288700,
296894,
280515,
190403,
296900,
337862,
165831,
280521,
231379,
296921,
239586,
313320,
231404,
124913,
165876,
321528,
288764,
239612,
239617,
313347,
288773,
313358,
305176,
313371,
354338,
305191,
223273,
313386,
354348,
124978,
215090,
124980,
288824,
288826,
378941,
313406,
288831,
288836,
67654,
280651,
354382,
288848,
280658,
215123,
354390,
288855,
288859,
280669,
313438,
280671,
223327,
149599,
321634,
149603,
329830,
280681,
313451,
223341,
280687,
215154,
280691,
313458,
313464,
321659,
280702,
288895,
321670,
215175,
141446,
141455,
141459,
280725,
313498,
288936,
100520,
280747,
288940,
280755,
288947,
321717,
280759,
280764,
280769,
280771,
280774,
280776,
313548,
321740,
280783,
280786,
280788,
313557,
280793,
280796,
280798,
338147,
280804,
280807,
157930,
280811,
280817,
280819,
157940,
182517,
125171,
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,
280959,
313731,
240011,
199051,
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,
281084,
240124,
305662,
305664,
240129,
305666,
240132,
223749,
305668,
281095,
223752,
338440,
150025,
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,
199367,
297671,
158409,
289493,
363234,
289513,
289522,
289525,
289532,
322303,
289537,
322310,
264969,
322314,
322318,
281361,
281372,
322341,
215850,
281388,
207661,
289593,
281401,
289601,
281410,
281413,
281414,
240458,
281420,
240468,
281430,
322393,
297818,
281435,
281438,
281442,
174955,
224110,
207733,
207737,
183172,
158596,
338823,
322440,
314249,
240519,
183184,
240535,
289687,
289694,
289696,
289700,
289712,
281529,
289724,
52163,
281567,
289762,
322534,
297961,
281581,
183277,
322550,
134142,
322563,
175134,
322599,
322610,
314421,
281654,
314427,
207937,
314433,
314441,
207949,
322642,
281691,
314461,
281702,
281704,
314474,
281708,
281711,
289912,
308373,
248995,
306341,
306344,
306347,
306354,
142531,
199877,
289991,
306377,
289997,
249045,
363742,
363745,
298216,
126190,
216303,
322801,
388350,
257302,
363802,
199976,
199978,
314671,
298292,
298294,
257334,
216376,
380226,
281923,
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,
306555,
314747,
290174,
298365,
224641,
281987,
298372,
314756,
281990,
224647,
265604,
298377,
314763,
142733,
298381,
224657,
306581,
314779,
314785,
282025,
314793,
282027,
241068,
241070,
241072,
282034,
241077,
150966,
298424,
306618,
282044,
323015,
306635,
306640,
290263,
290270,
290275,
339431,
282089,
191985,
282098,
290291,
282101,
241142,
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,
224875,
241260,
323181,
257658,
315016,
282249,
290445,
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,
241448,
315176,
282410,
241450,
306988,
306991,
315184,
323376,
315190,
241464,
282425,
159545,
298811,
307009,
413506,
241475,
307012,
315211,
282446,
307027,
315221,
282454,
323414,
241496,
315223,
241498,
307035,
307040,
282465,
110433,
241509,
110438,
298860,
110445,
282478,
282481,
110450,
315251,
315249,
315253,
315255,
339838,
282499,
315267,
315269,
241544,
282505,
241546,
241548,
298896,
282514,
298898,
241556,
298901,
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,
299006,
282623,
241669,
315397,
282632,
282639,
290835,
282645,
241693,
282654,
102438,
217127,
282669,
323630,
282681,
290877,
282687,
159811,
315463,
315466,
192589,
307278,
192596,
176213,
307287,
315482,
217179,
315483,
192605,
233567,
200801,
217188,
299109,
315495,
307303,
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,
184503,
307385,
307386,
258235,
176316,
307388,
307390,
299200,
184512,
307394,
307396,
299204,
184518,
323784,
307409,
307411,
176343,
299225,
233701,
307432,
184572,
282881,
184579,
282893,
291089,
282906,
233766,
176435,
307508,
168245,
307510,
332086,
151864,
307512,
315701,
307515,
282942,
307518,
151874,
282947,
282957,
110926,
323917,
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,
291231,
61855,
283042,
291238,
291241,
127403,
127405,
127407,
291247,
299440,
299444,
127413,
283062,
291254,
127417,
291260,
283069,
127421,
127424,
127429,
127431,
283080,
176592,
315856,
315860,
176597,
283095,
127447,
299481,
176605,
242143,
291299,
242152,
291305,
127466,
176620,
291314,
291317,
135672,
291323,
233979,
291330,
283142,
127497,
135689,
233994,
291341,
233998,
234003,
234006,
127511,
152087,
283161,
242202,
234010,
135707,
242206,
135710,
242208,
291361,
242220,
291378,
152118,
234038,
70213,
284243,
111193,
242275,
299620,
242279,
168562,
184952,
135805,
291456,
135808,
299655,
373383,
135820,
316051,
225941,
316054,
299672,
135834,
373404,
299677,
225948,
135839,
299680,
225954,
299684,
242343,
209576,
242345,
373421,
135870,
135873,
135876,
135879,
299720,
299723,
225998,
299726,
226002,
226005,
119509,
226008,
242396,
299740,
201444,
299750,
283368,
234219,
283372,
226037,
283382,
234231,
316151,
234236,
226045,
234239,
242431,
209665,
234242,
242436,
234246,
226056,
234248,
291593,
242443,
234252,
242445,
234254,
291601,
234258,
242450,
242452,
234261,
348950,
201496,
234264,
234266,
283421,
234269,
234272,
234274,
152355,
234278,
299814,
283432,
234281,
234284,
234287,
283440,
185138,
242483,
234292,
234296,
234298,
283452,
160572,
234302,
234307,
242499,
234309,
234313,
316233,
316235,
234316,
283468,
234319,
242511,
234321,
234324,
201557,
234329,
234333,
308063,
234336,
234338,
242530,
349027,
234341,
234344,
234347,
177004,
234350,
324464,
234353,
152435,
234356,
177011,
234358,
234362,
226171,
291711,
234368,
234370,
291714,
291716,
234373,
226182,
234375,
226185,
308105,
234379,
234384,
234388,
234390,
226200,
234393,
209818,
308123,
234396,
324504,
234398,
291742,
324508,
234401,
291747,
291748,
234405,
291750,
234407,
324518,
324520,
291754,
324522,
226220,
291756,
234414,
324527,
291760,
234417,
201650,
324531,
226230,
234422,
275384,
324536,
234428,
291773,
226239,
242623,
234431,
324544,
234434,
324546,
226245,
234437,
234439,
324548,
234443,
291788,
193486,
275406,
193488,
234446,
234449,
234452,
234455,
234459,
234461,
234464,
234467,
234470,
168935,
5096,
324585,
234475,
234478,
316400,
234481,
316403,
234484,
234485,
234487,
324599,
234490,
234493,
234496,
316416,
234501,
275462,
308231,
234504,
234507,
234510,
234515,
300054,
234519,
234520,
316439,
234523,
234528,
300066,
234532,
300069,
234535,
234537,
234540,
144430,
234543,
234546,
275508,
234549,
300085,
300088,
234556,
234558,
316479,
234561,
234563,
308291,
316483,
234568,
234570,
316491,
234572,
300108,
234574,
300115,
234580,
234581,
275545,
234585,
242777,
234590,
234593,
234595,
234597,
300133,
234601,
300139,
234605,
160879,
234607,
275569,
234610,
300148,
234614,
398455,
234618,
275579,
144506,
234620,
234623,
226433,
234627,
275588,
275594,
234634,
234636,
177293,
234640,
275602,
234643,
226453,
275606,
234647,
275608,
234648,
234650,
308379,
324757,
283805,
234653,
119967,
300189,
234657,
324768,
324766,
242852,
283813,
234661,
300197,
234664,
275626,
234667,
316596,
308414,
234687,
316610,
300226,
226500,
308418,
283844,
300229,
308420,
234692,
283850,
300234,
300238,
300241,
316625,
300243,
300245,
316630,
300248,
300253,
300256,
300258,
300260,
234726,
300263,
300265,
161003,
300267,
300270,
300272,
120053,
300278,
275703,
316663,
300284,
275710,
300287,
283904,
292097,
300289,
300292,
300294,
275719,
177419,
300299,
283917,
242957,
275725,
177424,
300301,
349464,
283939,
259367,
283951,
292143,
300344,
226617,
283963,
243003,
226628,
283973,
300357,
177482,
283983,
316758,
357722,
316766,
218464,
316768,
292197,
316774,
243046,
218473,
284010,
136562,
324978,
275834,
333178,
275836,
275840,
316803,
316806,
226696,
226699,
316811,
316814,
226703,
300433,
234899,
226709,
357783,
316824,
316826,
144796,
300448,
144807,
144810,
284076,
144812,
144814,
284084,
144820,
284087,
292279,
144826,
144828,
144830,
144832,
284099,
144835,
144837,
38342,
144839,
144841,
144844,
144847,
144852,
144855,
103899,
300507,
333280,
218597,
292329,
300523,
259565,
259567,
300527,
308720,
226802,
316917,
308727,
300537,
316947,
308757,
308762,
284191,
284194,
284196,
235045,
284199,
284204,
284206,
284209,
284211,
284213,
194101,
194103,
284215,
284218,
226877,
284223,
284226,
243268,
284228,
226886,
284231,
128584,
292421,
284234,
366155,
276043,
317004,
284238,
226895,
284241,
194130,
292433,
276052,
276053,
284245,
300628,
284247,
235097,
243290,
284251,
284249,
284253,
300638,
284255,
317015,
243293,
284258,
292452,
292454,
284263,
177766,
284265,
292458,
284267,
292461,
284272,
284274,
276086,
284278,
292470,
292473,
284283,
276093,
284286,
276095,
284288,
292479,
276098,
284290,
284292,
292481,
292485,
325250,
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,
358098,
284370,
317138,
284372,
284377,
276187,
284379,
284381,
284384,
284386,
358116,
276197,
317158,
284392,
325353,
284394,
358122,
284397,
276206,
284399,
358128,
358126,
358133,
358135,
276216,
358138,
300795,
358140,
284413,
358142,
284418,
317187,
358146,
317191,
284428,
300816,
300819,
317207,
284440,
186139,
300828,
300830,
276255,
300832,
284449,
300834,
325408,
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,
161718,
358326,
276410,
276411,
358330,
276418,
276425,
301009,
301011,
301013,
301015,
358360,
301017,
292828,
276446,
153568,
276448,
276452,
276455,
292839,
292843,
276460,
276464,
178161,
276466,
227314,
276472,
325624,
317435,
276476,
276479,
276482,
276485,
276490,
292876,
276496,
317456,
317458,
243733,
243740,
317468,
317472,
325666,
243751,
292904,
276528,
243762,
309298,
325685,
325689,
276539,
235579,
235581,
178238,
325692,
276544,
284739,
292934,
276553,
243785,
350293,
350295,
194649,
227418,
309337,
194654,
227423,
350302,
194657,
227426,
276579,
178273,
194660,
227430,
276583,
309346,
309348,
276586,
309350,
350308,
309354,
276590,
350313,
227440,
350316,
284786,
276595,
301167,
350321,
350325,
350328,
292985,
301178,
292989,
292993,
317570,
350339,
301185,
317573,
350342,
350345,
350349,
301199,
317584,
325777,
350354,
194708,
350357,
350359,
350362,
276638,
350366,
284837,
153765,
350375,
350379,
350381,
350383,
129200,
350385,
350387,
350389,
350395,
350397,
350399,
227520,
227522,
350402,
301252,
350406,
227529,
301258,
309450,
276685,
276689,
227540,
309462,
301272,
276699,
309468,
194780,
309471,
301283,
317672,
276713,
325867,
243948,
194801,
227571,
309491,
309494,
243960,
227583,
276735,
227587,
276739,
211204,
276742,
227593,
227596,
325910,
342298,
309530,
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,
211324,
227709,
317833,
178572,
285070,
178575,
285077,
178583,
227738,
317853,
276896,
317858,
342434,
285093,
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,
309781,
317971,
55837,
227877,
227879,
293417,
227882,
293421,
105007,
236082,
285236,
23094,
277054,
244288,
129603,
318020,
301636,
301639,
301643,
277071,
285265,
399955,
277080,
309849,
285277,
285282,
326244,
318055,
277100,
277106,
121458,
170618,
170619,
309885,
309888,
277122,
227975,
285320,
277128,
301706,
318092,
326285,
318094,
334476,
277136,
277139,
227992,
285340,
318108,
227998,
318110,
137889,
383658,
285357,
318128,
277170,
342707,
154292,
277173,
293555,
318132,
285368,
277177,
277181,
318144,
277187,
277191,
277194,
277196,
277201,
137946,
113378,
203491,
228069,
277223,
342760,
285417,
56041,
56043,
277232,
228081,
56059,
310015,
285441,
310020,
285448,
310029,
228113,
285459,
277273,
293659,
326430,
228128,
285474,
293666,
228135,
318248,
277291,
293677,
318253,
285489,
293685,
285494,
301880,
285499,
301884,
293696,
310080,
277314,
277317,
277322,
277329,
162643,
310100,
301911,
301913,
277337,
301921,
400236,
236397,
162671,
326514,
310134,
277368,
236408,
15224,
416639,
416640,
113538,
310147,
416648,
39817,
187274,
277385,
301972,
424853,
277405,
310179,
293798,
293802,
236460,
277426,
293811,
293817,
293820,
203715,
326603,
293849,
293861,
228327,
228328,
228330,
318442,
228332,
277486,
326638,
318450,
293877,
285686,
302073,
285690,
244731,
293882,
302075,
121850,
293887,
277504,
277507,
277511,
277519,
293908,
277526,
293917,
293939,
318516,
277561,
277564,
7232,
310336,
293956,
277573,
228422,
310344,
277577,
293960,
277583,
203857,
293971,
310359,
236632,
277594,
138332,
277598,
285792,
277601,
203872,
310374,
203879,
277608,
310376,
228460,
318573,
203886,
187509,
285815,
285817,
367737,
285821,
302205,
285824,
285831,
253064,
302218,
285835,
294026,
162964,
384148,
187542,
302231,
285849,
302233,
285852,
302237,
285854,
285856,
285862,
277671,
302248,
64682,
277678,
228526,
294063,
294065,
302258,
277687,
294072,
318651,
294076,
277695,
318657,
244930,
302275,
130244,
302277,
228550,
302282,
310476,
302285,
302288,
310481,
302290,
203987,
302292,
302294,
302296,
384222,
310498,
285927,
318698,
302315,
195822,
228592,
294132,
138485,
228601,
204026,
228606,
204031,
64768,
310531,
285958,
228617,
138505,
318742,
204067,
277798,
130345,
277801,
113964,
285997,
277804,
277807,
285999,
113969,
277811,
318773,
318776,
277816,
286010,
277819,
294204,
417086,
277822,
286016,
294211,
302403,
384328,
277832,
277836,
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,
310659,
294276,
277892,
327046,
277894,
253320,
310665,
318858,
277898,
351619,
277903,
310672,
351633,
277905,
277908,
277917,
277921,
310689,
130468,
228776,
277928,
277932,
310703,
277937,
130486,
310710,
310712,
277944,
310715,
277947,
302526,
228799,
277950,
277953,
64966,
245191,
163272,
302534,
310727,
277959,
292968,
302541,
277963,
302543,
277966,
310737,
277971,
286169,
228825,
163290,
277978,
310749,
277981,
277984,
310755,
277989,
277991,
187880,
277995,
286188,
310764,
278000,
228851,
310772,
278003,
278006,
212472,
40440,
278009,
286203,
40443,
228864,
286214,
228871,
302603,
65038,
302614,
286233,
302617,
286240,
146977,
187939,
294435,
40484,
286246,
294439,
286248,
278057,
294440,
294443,
40486,
294445,
40488,
40491,
310831,
212538,
40507,
40511,
40513,
228933,
40521,
286283,
40525,
40527,
228944,
212560,
400976,
40533,
147032,
40537,
278109,
40541,
40544,
40548,
40550,
286312,
286313,
40552,
40554,
310892,
40557,
40560,
188022,
122488,
294521,
343679,
278150,
310925,
286354,
278163,
302740,
122517,
278168,
327333,
229030,
212648,
278188,
302764,
278192,
319153,
278196,
319171,
302789,
294599,
278216,
294601,
302793,
278227,
229076,
286420,
319187,
286425,
319194,
278235,
301163,
229086,
278238,
286432,
294625,
294634,
302838,
319226,
286460,
171774,
278274,
302852,
278277,
302854,
311048,
352008,
294664,
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,
40865,
319394,
294821,
180142,
294831,
188340,
40886,
319419,
294844,
294847,
309352,
393177,
294876,
294879,
294883,
294890,
311279,
278513,
237555,
278516,
311283,
278519,
237562
] |
5f3a37079e61dd253a628d43562febf6d0c31a51
|
e614c89bcd93a3f8ddd1fcd156eed75a5219b99d
|
/VueFluxExample-GitHub/Models/HeaderXRateLimit.swift
|
bb90ef728049605e95e60f55a609542b9fbce616
|
[
"MIT"
] |
permissive
|
ra1028/VueFluxExample-GitHub
|
04d72a8154591c960d280e9712d5384ca250b23f
|
22d06b07d2bc6872d2c38c791cc3e573a0a4074e
|
refs/heads/master
| 2023-06-12T08:08:45.329086 | 2018-04-18T17:55:11 | 2018-04-18T17:55:11 | 124,860,926 | 7 | 1 |
MIT
| 2018-03-13T18:31:11 | 2018-03-12T08:57:46 |
Swift
|
UTF-8
|
Swift
| false | false | 428 |
swift
|
import Alembic
struct HeaderXRateLimit: Parsable {
let limit: String
let remaining: String
let reset: String
static func value(from json: JSON) throws -> HeaderXRateLimit {
return try HeaderXRateLimit(
limit: json.value(for: "X-RateLimit-Limit"),
remaining: json.value(for: "X-RateLimit-Remaining"),
reset: json.value(for: "X-RateLimit-Reset")
)
}
}
|
[
-1
] |
56ee2ae5efc1d9d2a70cdac88e43ba3314afaf37
|
1daada53d6b1db5cb1c80d9690f70b05ef6ba7d3
|
/project2/project2/AppDelegate.swift
|
e712006a666a63e88399426b34bc84a9a1e7ca5b
|
[] |
no_license
|
8bitJunk/hackingwithswift
|
e6e40354c75f7dafa12351fc76727be6c953d07a
|
d83929adc2fef9a5780a43d9f91eaf2e92ae7926
|
refs/heads/master
| 2021-01-10T20:19:18.152211 | 2015-07-17T13:24:53 | 2015-07-17T13:24:53 | 39,186,243 | 0 | 1 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,144 |
swift
|
//
// AppDelegate.swift
// project2
//
// Created by Ryan Gibbs on 16/07/2015.
// Copyright © 2015 Ryan Gibbs. 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,
278559,
229408,
278564,
294950,
229415,
229417,
327722,
237613,
229422,
360496,
229426,
237618,
229428,
286774,
229432,
286776,
286778,
319544,
204856,
286791,
237640,
278605,
286797,
311375,
163920,
237646,
196692,
319573,
311383,
278623,
278626,
319590,
311400,
278635,
303212,
278639,
278648,
131192,
237693,
327814,
131209,
417930,
303241,
311436,
303244,
319633,
286873,
286876,
311460,
311469,
32944,
327862,
286906,
327866,
180413,
286910,
131264,
286916,
286922,
286924,
286926,
319694,
286928,
131281,
278743,
278747,
295133,
155872,
319716,
278760,
237807,
303345,
286962,
131314,
229622,
327930,
278781,
278783,
278785,
237826,
319751,
278792,
286987,
319757,
311569,
286999,
319770,
287003,
287006,
287009,
287012,
287014,
287016,
287019,
311598,
287023,
262448,
311601,
287032,
155966,
278849,
319809,
319810,
319814,
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,
311911,
189034,
295533,
189039,
189040,
172655,
172656,
295538,
189044,
172660,
287349,
352880,
287355,
287360,
295553,
287365,
311942,
303751,
295557,
352905,
279178,
287371,
311946,
311951,
287377,
287381,
311957,
221850,
287386,
164509,
303773,
295583,
230045,
287390,
287394,
172705,
303780,
172702,
287398,
172707,
279208,
287400,
172714,
295595,
279212,
189102,
172721,
287409,
66227,
303797,
189114,
287419,
303804,
328381,
279231,
287423,
328384,
287427,
312006,
107208,
172748,
287436,
107212,
172751,
287440,
295633,
172755,
303827,
279255,
172760,
279258,
303835,
213724,
189149,
303838,
287450,
279267,
312035,
295654,
279272,
312048,
230128,
312050,
230131,
205564,
303871,
230146,
328453,
295685,
230154,
33548,
312077,
295695,
295701,
230169,
369433,
295707,
328476,
295710,
230175,
303914,
279340,
205613,
279353,
230202,
312124,
222018,
295755,
377676,
148302,
287569,
279383,
303959,
230237,
279390,
230241,
279394,
303976,
336744,
303985,
328563,
303987,
279413,
303991,
303997,
295806,
295808,
304005,
295813,
213895,
320391,
304007,
304009,
304011,
230284,
304013,
213902,
279438,
295822,
295825,
189329,
304019,
189331,
279445,
58262,
279452,
410526,
279461,
279462,
304042,
213931,
230327,
304055,
287675,
197564,
304063,
238528,
304065,
189378,
213954,
156612,
295873,
213963,
312272,
304084,
304090,
320481,
304106,
320490,
312302,
328687,
320496,
304114,
295928,
320505,
312321,
295945,
197645,
295949,
230413,
320528,
140312,
295961,
238620,
197663,
304164,
189479,
304170,
238641,
312374,
238652,
238655,
230465,
238658,
336964,
296004,
205895,
320584,
238666,
296021,
402518,
336987,
230497,
296036,
296040,
361576,
205931,
296044,
164973,
279661,
205934,
312432,
279669,
337018,
189562,
279679,
279683,
222340,
205968,
296084,
238745,
304285,
238756,
205991,
222377,
165035,
337067,
238766,
165038,
230576,
238770,
304311,
350308,
230592,
279750,
312518,
230600,
230607,
148690,
320727,
279769,
304348,
279777,
304354,
296163,
320740,
279781,
304360,
279788,
320748,
279790,
304370,
296189,
320771,
312585,
296202,
296205,
230674,
320786,
230677,
296213,
296215,
230679,
230681,
320792,
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,
230800,
288144,
304533,
337306,
288154,
288160,
173472,
288162,
288164,
279975,
304555,
370092,
279983,
288176,
279985,
173488,
312755,
296373,
279991,
312759,
288185,
337335,
222652,
312766,
173507,
296389,
222665,
230860,
280014,
312783,
288208,
230865,
370130,
288210,
288212,
280021,
288214,
222676,
239064,
288217,
288218,
280027,
329177,
288220,
239070,
288224,
370146,
280034,
280036,
288226,
280038,
288229,
288230,
288232,
288234,
320998,
288236,
288238,
288240,
291754,
288242,
296435,
288244,
296439,
288250,
402942,
148990,
206336,
296446,
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,
288499,
419570,
288502,
280314,
288510,
124671,
67330,
280324,
198405,
288519,
280331,
198416,
280337,
296723,
116503,
321304,
329498,
296731,
321311,
313121,
313123,
304932,
321316,
280363,
141101,
165678,
280375,
321336,
296767,
288576,
345921,
280388,
304968,
280393,
280402,
313176,
280419,
321381,
296812,
313201,
1920,
255873,
305028,
280454,
247688,
280458,
280464,
124817,
280468,
239510,
280473,
124827,
214940,
247709,
214944,
280487,
313258,
321458,
296883,
124853,
214966,
10170,
296890,
288700,
296894,
280515,
190403,
296900,
337862,
165831,
280521,
231379,
296921,
239586,
313320,
231404,
124913,
165876,
321528,
239612,
313340,
288764,
239617,
313347,
288773,
313358,
321560,
305176,
313371,
354338,
305191,
223273,
313386,
354348,
124978,
215090,
124980,
288824,
288826,
321595,
378941,
313406,
288831,
288836,
67654,
223303,
280651,
354382,
288848,
280658,
215123,
354390,
288855,
288859,
280669,
313438,
223327,
280671,
149601,
321634,
149603,
149599,
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,
314249,
338823,
183184,
289687,
240535,
297883,
289694,
289696,
289700,
289712,
281529,
289724,
52163,
281567,
289762,
322534,
297961,
281581,
183277,
322550,
134142,
322563,
175134,
322599,
322610,
314421,
281654,
314427,
207937,
314433,
314441,
207949,
322642,
281691,
314461,
281702,
281704,
314474,
281708,
281711,
289912,
248995,
306341,
306344,
306347,
306354,
142531,
199877,
289991,
306377,
249045,
363742,
363745,
298216,
330988,
126190,
216303,
322801,
388350,
257302,
363802,
199976,
199978,
314671,
298292,
298294,
257334,
216376,
298306,
380226,
281923,
224584,
224587,
224594,
216404,
306517,
150870,
314714,
224603,
159068,
314718,
265568,
314723,
281960,
150890,
306539,
314732,
314736,
290161,
216436,
306549,
298358,
314743,
306552,
290171,
314747,
306555,
290174,
298365,
224641,
281987,
298372,
314756,
281990,
224647,
265604,
298377,
314763,
142733,
298381,
224657,
306581,
314779,
314785,
282025,
314793,
282027,
241068,
241070,
241072,
282034,
241077,
150966,
298424,
306618,
282044,
323015,
306635,
306640,
290263,
290270,
290275,
339431,
282089,
191985,
282098,
290291,
282101,
241142,
191992,
290298,
151036,
290302,
282111,
290305,
175621,
192008,
323084,
257550,
282127,
290321,
282130,
323090,
282133,
290325,
241175,
290328,
282137,
290332,
241181,
282142,
282144,
290344,
306731,
290349,
290351,
290356,
282186,
224849,
282195,
282199,
282201,
306778,
159324,
159330,
314979,
298598,
224875,
241260,
323181,
257658,
315016,
282249,
290445,
324757,
282261,
298651,
282269,
323229,
298655,
323231,
61092,
282277,
306856,
282295,
282300,
323260,
323266,
282310,
323273,
282319,
306897,
241362,
282328,
298714,
52959,
216801,
282337,
241380,
216806,
323304,
282345,
12011,
282356,
323318,
282364,
282367,
306945,
241412,
323333,
282376,
216842,
323345,
282388,
323349,
282392,
184090,
315167,
315169,
282402,
315174,
323367,
241448,
315176,
282410,
241450,
306988,
306991,
315184,
323376,
315190,
241464,
282425,
159545,
298811,
307009,
413506,
241475,
307012,
148946,
315211,
282446,
307027,
315221,
282454,
315223,
241496,
323414,
241498,
307035,
307040,
282465,
110433,
241509,
110438,
298860,
110445,
282478,
315249,
110450,
315251,
282481,
315253,
315255,
339838,
282499,
315267,
315269,
241544,
282505,
241546,
241548,
298896,
298898,
282514,
44948,
298901,
241556,
282520,
241560,
241563,
241565,
241567,
241569,
282531,
241574,
282537,
298922,
36779,
241581,
282542,
241583,
323504,
241586,
282547,
241588,
290739,
241590,
241592,
241598,
290751,
241600,
241605,
151495,
241610,
298975,
241632,
298984,
241640,
241643,
298988,
241646,
241649,
241652,
323574,
290807,
241661,
299006,
282623,
315396,
241669,
315397,
282632,
282639,
290835,
282645,
241693,
282654,
241701,
102438,
217127,
282669,
323630,
282681,
290877,
282687,
159811,
315463,
315466,
192589,
307278,
192596,
176213,
307287,
315482,
315483,
217179,
192605,
233567,
200801,
299105,
217188,
299109,
307303,
315495,
356457,
45163,
307307,
315502,
192624,
307314,
323700,
299126,
233591,
299136,
307329,
307338,
233613,
241813,
307352,
299164,
184479,
299167,
184481,
315557,
184486,
307370,
307372,
184492,
307374,
307376,
323763,
176311,
299191,
307385,
307386,
258235,
176316,
307388,
307390,
184503,
299200,
184512,
307394,
307396,
299204,
184518,
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,
276052,
315739,
323932,
299357,
242018,
242024,
299373,
315757,
250231,
242043,
315771,
299388,
299391,
291202,
299398,
242057,
291212,
299405,
291222,
283033,
291226,
242075,
315801,
291231,
61855,
283042,
291238,
291241,
127403,
127405,
291247,
127407,
299440,
299444,
127413,
283062,
291254,
127417,
291260,
283069,
127421,
127424,
299457,
127429,
127431,
283080,
176592,
315856,
315860,
176597,
283095,
127447,
299481,
176605,
242143,
291299,
242152,
291305,
127466,
176620,
127474,
291314,
291317,
135672,
233979,
291323,
291330,
283142,
135689,
233994,
127497,
291341,
233998,
234003,
234006,
152087,
127511,
283161,
242202,
234010,
135707,
242206,
135710,
242208,
291361,
242220,
291378,
234038,
152118,
234041,
70213,
242250,
111193,
242275,
299620,
242279,
168562,
184952,
135805,
291456,
135808,
373383,
299655,
135820,
316051,
225941,
316054,
299672,
135834,
373404,
299677,
225948,
135839,
299680,
225954,
299684,
242343,
209576,
242345,
373421,
135870,
135873,
135876,
135879,
299720,
299723,
225998,
299726,
226002,
226005,
119509,
226008,
242396,
299740,
201444,
299750,
283368,
234219,
283372,
381677,
226037,
283382,
234231,
316151,
234236,
226045,
234239,
242431,
209665,
234242,
299778,
242436,
226053,
234246,
226056,
234248,
291593,
242443,
234252,
242445,
234254,
291601,
234258,
242450,
242452,
234261,
348950,
201496,
234264,
234266,
234269,
283421,
234272,
234274,
152355,
234278,
299814,
283432,
234281,
234284,
234287,
283440,
185138,
242483,
234292,
234296,
234298,
283452,
160572,
234302,
234307,
242499,
234309,
292433,
234313,
316233,
316235,
234316,
283468,
242511,
234319,
234321,
234324,
185173,
201557,
234329,
234333,
308063,
234336,
234338,
242530,
349027,
234341,
234344,
234347,
177004,
234350,
324464,
234353,
152435,
234356,
177011,
234358,
234362,
226171,
234364,
291711,
234368,
234370,
201603,
291714,
234373,
226182,
234375,
291716,
226185,
308105,
234379,
234384,
234388,
234390,
226200,
324504,
234393,
209818,
308123,
324508,
234398,
234396,
291742,
234401,
291747,
291748,
234405,
291750,
234407,
324518,
324520,
234410,
324522,
226220,
291756,
234414,
324527,
291760,
234417,
201650,
324531,
226230,
234422,
275384,
324536,
234428,
291773,
234431,
242623,
324544,
324546,
226239,
324548,
226245,
234437,
234439,
234434,
234443,
291788,
275406,
234446,
193486,
234449,
316370,
193488,
234452,
234455,
234459,
234461,
234464,
234467,
234470,
168935,
5096,
324585,
234475,
234478,
316400,
234481,
316403,
234484,
234485,
324599,
234487,
234490,
234493,
234496,
316416,
234501,
275462,
308231,
234504,
234507,
234510,
234515,
300054,
234519,
316439,
234520,
234523,
234526,
234528,
300066,
234532,
300069,
234535,
234537,
234540,
144430,
234543,
234546,
275508,
234549,
300085,
300088,
234556,
234558,
316479,
234561,
316483,
234563,
308291,
234568,
234570,
316491,
300108,
234572,
234574,
300115,
234580,
234581,
275545,
242777,
234585,
234590,
234593,
234595,
300133,
234597,
234601,
300139,
234605,
234607,
160879,
275569,
234610,
300148,
234614,
398455,
144506,
275579,
234618,
234620,
234623,
226433,
234627,
275588,
234629,
242822,
234634,
275594,
234636,
177293,
234640,
275602,
234643,
226453,
275606,
234647,
275608,
308373,
234650,
234648,
308379,
283805,
234653,
324766,
119967,
234657,
300189,
324768,
242852,
283813,
234661,
300197,
234664,
275626,
234667,
316596,
308414,
234687,
300226,
308418,
226500,
234692,
300229,
308420,
283844,
283850,
300234,
300238,
300241,
316625,
300243,
300245,
316630,
300248,
300253,
300256,
300258,
300260,
234726,
300263,
300265,
161003,
300267,
300270,
300272,
120053,
300278,
316663,
275703,
300284,
275710,
300287,
283904,
300289,
292097,
300292,
300294,
275719,
177419,
300299,
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,
218597,
292329,
300523,
259565,
300527,
308720,
259567,
226802,
316917,
308727,
292343,
300537,
316947,
308757,
308762,
284191,
284194,
284196,
235045,
284199,
284204,
284206,
284209,
284211,
284213,
194101,
284215,
194103,
284218,
226877,
284223,
284226,
243268,
292421,
226886,
284231,
128584,
284228,
284234,
276043,
366155,
317004,
284238,
226895,
284241,
194130,
284243,
300628,
276053,
284245,
284247,
317015,
284249,
243290,
284251,
235097,
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,
292485,
292479,
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,
317191,
284428,
300816,
300819,
317207,
284440,
300828,
300830,
276255,
325408,
284449,
300834,
300832,
227109,
317221,
358183,
186151,
276268,
300845,
194351,
243504,
300850,
284469,
276280,
325436,
358206,
276291,
366406,
276295,
300872,
153417,
284499,
276308,
284502,
317271,
178006,
276315,
292700,
284511,
227175,
292715,
300912,
284529,
292721,
300915,
284533,
292729,
317306,
284540,
292734,
325512,
169868,
276365,
284564,
358292,
284566,
350106,
284572,
276386,
284579,
276388,
358312,
284585,
317353,
276395,
292776,
292784,
276402,
358326,
161718,
276410,
276411,
358330,
276418,
276425,
301009,
301011,
301013,
292823,
301015,
301017,
358360,
292828,
276446,
153568,
276448,
276452,
276455,
292839,
292843,
276460,
276464,
178161,
227314,
276466,
276472,
325624,
317435,
276476,
276479,
276482,
276485,
317446,
276490,
292876,
276496,
317456,
317458,
243733,
243740,
317468,
317472,
325666,
243751,
292904,
276528,
243762,
309298,
325685,
325689,
276539,
235579,
235581,
325692,
178238,
276544,
284739,
292934,
276553,
243785,
350293,
350295,
194649,
227418,
309337,
350302,
227423,
194654,
194657,
178273,
276579,
227426,
194660,
227430,
276583,
309346,
309348,
276586,
309350,
309352,
309354,
276590,
350313,
350316,
350321,
284786,
276595,
227440,
301167,
350325,
350328,
292985,
301178,
292989,
292993,
301185,
350339,
317570,
317573,
350342,
227463,
350345,
350349,
301199,
317584,
325777,
350354,
350357,
350359,
350362,
276638,
350366,
284837,
153765,
350375,
350379,
350381,
350383,
129200,
350385,
350387,
350389,
350395,
350397,
350399,
227520,
350402,
227522,
301252,
350406,
227529,
309450,
301258,
276685,
276689,
309462,
301272,
276699,
309468,
194780,
309471,
301283,
317672,
276713,
317674,
325867,
243948,
194801,
227571,
309491,
276725,
309494,
243960,
276735,
227583,
227587,
276739,
211204,
276742,
227593,
227596,
325910,
309530,
342298,
276766,
211232,
317729,
276775,
211241,
325937,
276789,
325943,
211260,
260421,
276809,
285002,
276811,
235853,
276816,
235858,
276829,
276833,
391523,
276836,
276843,
293227,
276848,
293232,
186744,
285051,
211324,
227709,
285061,
317833,
178572,
285070,
178575,
285077,
178583,
227738,
317853,
276896,
317858,
342434,
285093,
317864,
285098,
276907,
235955,
276917,
293304,
293307,
293314,
309707,
293325,
317910,
293336,
235996,
317917,
293343,
358880,
276961,
227810,
293346,
276964,
293352,
236013,
293364,
301562,
317951,
309764,
301575,
121352,
236043,
317963,
342541,
55822,
113167,
277011,
317971,
309781,
309779,
55837,
227877,
227879,
293417,
227882,
309804,
293421,
105007,
236082,
285236,
23094,
277054,
244288,
129603,
318020,
301636,
301639,
301643,
277071,
285265,
399955,
309844,
277080,
309849,
285277,
285282,
326244,
318055,
277100,
277106,
121458,
170618,
170619,
309885,
309888,
277122,
227975,
277128,
285320,
301706,
318092,
326285,
318094,
334476,
277136,
277139,
227992,
285340,
318108,
227998,
318110,
137889,
383658,
285357,
318128,
277170,
342707,
154292,
277173,
293555,
318132,
285368,
277177,
277181,
318144,
277187,
277191,
277194,
277196,
277201,
137946,
113378,
203491,
228069,
277223,
342760,
285417,
56041,
56043,
277232,
228081,
56059,
310015,
285441,
310020,
285448,
310029,
228113,
285459,
277273,
293659,
326430,
228128,
293666,
285474,
228135,
318248,
277291,
293677,
318253,
285489,
293685,
285494,
301880,
285499,
301884,
310080,
293696,
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,
244731,
293882,
302075,
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,
162964,
384148,
187542,
302231,
285849,
302233,
285852,
302237,
285854,
285856,
285862,
277671,
302248,
64682,
277678,
228526,
294063,
294065,
302258,
277687,
294072,
318651,
294076,
277695,
318657,
244930,
302275,
130244,
302277,
228550,
302282,
310476,
302285,
302288,
310481,
302290,
203987,
302292,
302294,
302296,
384222,
310498,
285927,
318698,
302315,
195822,
228592,
294132,
138485,
204023,
228601,
204026,
228606,
204031,
64768,
310531,
285958,
228617,
138505,
318742,
204067,
277798,
130345,
277801,
113964,
285997,
277804,
285999,
277807,
113969,
277811,
318773,
318776,
277816,
286010,
277819,
294204,
277822,
417086,
286016,
294211,
302403,
384328,
277832,
277836,
294221,
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,
277892,
310659,
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,
310727,
277959,
302534,
292968,
302541,
277966,
302543,
277963,
310737,
277971,
277975,
228825,
163290,
277978,
310749,
277981,
277984,
310755,
277989,
277991,
187880,
277995,
286188,
310764,
278000,
278003,
310772,
228851,
278006,
40440,
278009,
212472,
40443,
286203,
228864,
40448,
286214,
228871,
302603,
65038,
302614,
286233,
302617,
286240,
146977,
294435,
187939,
40484,
286246,
40486,
286248,
278057,
294439,
40488,
294440,
294443,
294445,
310831,
40491,
40499,
40502,
212538,
40507,
40511,
40513,
228933,
40521,
286283,
40525,
40527,
228944,
212560,
400976,
40533,
147032,
40537,
40539,
278109,
40541,
40544,
40548,
40550,
40552,
286313,
40554,
286312,
310892,
40557,
40560,
188022,
122488,
294521,
343679,
278150,
310925,
286354,
278163,
302740,
122517,
278168,
327333,
229030,
212648,
278188,
302764,
278192,
319153,
278196,
319171,
302789,
294599,
278216,
294601,
302793,
343757,
212690,
278227,
229076,
286420,
319187,
286425,
319194,
278235,
301163,
229086,
278238,
286432,
294625,
294634,
302838,
319226,
286460,
278274,
302852,
278277,
302854,
294664,
311048,
352008,
319243,
311053,
302862,
319251,
294682,
278306,
188199,
294701,
278320,
319280,
319290,
229192,
302925,
188247,
237409,
294776,
360317,
294785,
327554,
40840,
40851,
294803,
188312,
294811,
319390,
294817,
319394,
40865,
294821,
311209,
180142,
294831,
188340,
40886,
319419,
294844,
294847,
393177,
294876,
294879,
294883,
294890,
278508,
311279,
278513,
237555,
278516,
311283,
278519,
237562
] |
ab11a39ea1dd61da46445b23e5f1a420b2a139a3
|
73aefbad7143a3d2293fe31b919720c4eac1ce38
|
/lab_6/Adapter/Adapter/ObjectAdapter/libs/modern_graphics_lib.swift
|
90bcdd93f0f721e3af3df0ab88ea4cab395d8e05
|
[] |
no_license
|
voronindim/OOD
|
2d65e7e7bcb3696d54dd9fe7388a2ff253d5b4bb
|
864417fbe53c2f1c97abc76b6f078357a29ebe86
|
refs/heads/master
| 2023-02-26T14:26:43.161176 | 2021-02-01T19:44:06 | 2021-02-01T19:44:06 | 293,309,903 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,757 |
swift
|
//
// modern_graphics_lib.swift
// Adapter
//
// Created by Dmitrii Voronin on 14.10.2020.
//
import Foundation
struct Point {
let x: Double
let y: Double
}
class CRGBAColor {
let r: Float
let g: Float
let b: Float
let a: Float
init(_ r: Float, _ g: Float, _ b: Float, _ a: Float) {
self.a = a
self.g = g
self.b = b
self.r = r
}
}
class ModernGraphicsRenderer {
private var drawing = false
private let stream: Stream
init(stream: Stream) {
self.stream = stream
}
func beginDraw() throws {
guard !drawing else {
throw Errors.logicError("Drawing has already begun!")
}
stream.write(string: "<draw>")
drawing = true
}
func drawLine(start: Point, end: Point, color: CRGBAColor) throws {
guard drawing else {
throw Errors.logicError("DrawLine is allowed between beginDraw()/endDraw() only")
}
stream.write(string: "\t<line> fromX=\"\(start.x)\" fromY=\"\(start.y)\" toX=\"\(end.x)\" toY=\"\(end.y)\"")
stream.write(string: "\t\t<color> r=\"\(roundColorValue(color.r))\" g=\"\(roundColorValue(color.g))\" b=\"\(roundColorValue(color.b))\" a=\"\(roundColorValue(color.a))\" </color>")
}
func endDraw() throws {
guard drawing else {
throw Errors.logicError("DrawLine is allowed between beginDraw()/endDraw() only")
}
stream.write(string: "</draw>")
drawing = false
}
private func roundColorValue(_ value: Float) -> Float {
round(value * 100) / 100
}
deinit {
if drawing {
do {
try! endDraw()
}
}
}
}
|
[
-1
] |
e8aacfa2126ab56971d527122aca5a187aa01b35
|
9412111559f20ca575b11b395534ca3417a24805
|
/Tests/TuistGeneratorTests/Generator/SchemesGeneratorTests.swift
|
373282a0b26839628f6678643442e805302bd9c9
|
[
"MIT"
] |
permissive
|
Rag0n/tuist
|
eed40aa40cd67bee3b46fe0ee1a769827fbb6453
|
216028befa429a326b18aeb605228c119980b63e
|
refs/heads/master
| 2020-05-23T09:28:38.558401 | 2019-05-11T15:16:30 | 2019-05-11T15:16:30 | 186,705,797 | 0 | 0 |
MIT
| 2019-05-14T21:52:10 | 2019-05-14T21:52:10 | null |
UTF-8
|
Swift
| false | false | 17,735 |
swift
|
import Basic
import Foundation
import TuistCore
import XcodeProj
import XCTest
@testable import TuistCoreTesting
@testable import TuistGenerator
final class SchemeGeneratorTests: XCTestCase {
var subject: SchemesGenerator!
override func setUp() {
super.setUp()
subject = SchemesGenerator()
}
func test_projectBuildAction() {
let app = Target.test(name: "App", product: .app)
let appTests = Target.test(name: "AppTests", product: .unitTests)
let appUITests = Target.test(name: "AppUITests", product: .uiTests)
let targets = [app, appTests, appUITests]
let project = Project.test(targets: targets)
let graphCache = GraphLoaderCache()
let graph = Graph.test(cache: graphCache)
let got = subject.projectBuildAction(project: project,
generatedProject: generatedProject(targets: targets),
graph: graph)
XCTAssertTrue(got.parallelizeBuild)
XCTAssertTrue(got.buildImplicitDependencies)
XCTAssertEqual(got.buildActionEntries.count, 3)
let appEntry = got.buildActionEntries[0]
let testsEntry = got.buildActionEntries[1]
let uiTestsEntry = got.buildActionEntries[2]
XCTAssertEqual(appEntry.buildFor, [.analyzing, .archiving, .profiling, .running, .testing])
XCTAssertEqual(appEntry.buildableReference.referencedContainer, "container:project.xcodeproj")
XCTAssertEqual(appEntry.buildableReference.buildableName, app.productNameWithExtension)
XCTAssertEqual(appEntry.buildableReference.blueprintName, app.name)
XCTAssertEqual(appEntry.buildableReference.buildableIdentifier, "primary")
XCTAssertEqual(testsEntry.buildFor, [.testing])
XCTAssertEqual(testsEntry.buildableReference.referencedContainer, "container:project.xcodeproj")
XCTAssertEqual(testsEntry.buildableReference.buildableName, appTests.productNameWithExtension)
XCTAssertEqual(testsEntry.buildableReference.blueprintName, appTests.name)
XCTAssertEqual(testsEntry.buildableReference.buildableIdentifier, "primary")
XCTAssertEqual(uiTestsEntry.buildFor, [.testing])
XCTAssertEqual(uiTestsEntry.buildableReference.referencedContainer, "container:project.xcodeproj")
XCTAssertEqual(uiTestsEntry.buildableReference.buildableName, appUITests.productNameWithExtension)
XCTAssertEqual(uiTestsEntry.buildableReference.blueprintName, appUITests.name)
XCTAssertEqual(uiTestsEntry.buildableReference.buildableIdentifier, "primary")
}
func test_projectTestAction() {
let app = Target.test(name: "App", product: .app)
let appTests = Target.test(name: "AppTests", product: .unitTests)
let targets = [app, appTests]
let project = Project.test(targets: targets)
let got = subject.projectTestAction(project: project,
generatedProject: generatedProject(targets: targets))
XCTAssertEqual(got.buildConfiguration, "Debug")
XCTAssertNil(got.macroExpansion)
XCTAssertEqual(got.testables.count, 1)
let testable = got.testables.first
XCTAssertEqual(testable?.skipped, false)
XCTAssertEqual(testable?.buildableReference.referencedContainer, "container:project.xcodeproj")
XCTAssertEqual(testable?.buildableReference.buildableName, appTests.productNameWithExtension)
XCTAssertEqual(testable?.buildableReference.blueprintName, appTests.name)
XCTAssertEqual(testable?.buildableReference.buildableIdentifier, "primary")
}
func test_schemeTestAction_when_notTestsTarget() {
let scheme = Scheme.test()
let project = Project.test()
let generatedProject = GeneratedProject.test()
let got = subject.schemeTestAction(scheme: scheme, project: project, generatedProject: generatedProject)
XCTAssertEqual(got?.buildConfiguration, "Debug")
XCTAssertEqual(got?.shouldUseLaunchSchemeArgsEnv, false)
XCTAssertNil(got?.macroExpansion)
XCTAssertEqual(got?.testables.count, 0)
}
func test_schemeTestAction_when_testsTarget() {
let target = Target.test(name: "App", product: .app)
let testTarget = Target.test(name: "AppTests", product: .unitTests)
let testAction = TestAction.test(arguments: nil)
let scheme = Scheme.test(name: "AppTests", testAction: testAction)
let project = Project.test(targets: [target, testTarget])
let pbxTarget = PBXNativeTarget(name: "App")
let pbxTestTarget = PBXNativeTarget(name: "AppTests", productType: .unitTestBundle)
let generatedProject = GeneratedProject.test(targets: ["App": pbxTarget, "AppTests": pbxTestTarget])
let got = subject.schemeTestAction(scheme: scheme, project: project, generatedProject: generatedProject)
XCTAssertEqual(got?.buildConfiguration, "Debug")
XCTAssertEqual(got?.shouldUseLaunchSchemeArgsEnv, true)
XCTAssertNil(got?.macroExpansion)
let testable = got?.testables.first
let buildableReference = testable?.buildableReference
XCTAssertEqual(testable?.skipped, false)
XCTAssertEqual(buildableReference?.referencedContainer, "container:project.xcodeproj")
XCTAssertEqual(buildableReference?.buildableName, "AppTests.xctest")
XCTAssertEqual(buildableReference?.blueprintName, "AppTests")
XCTAssertEqual(buildableReference?.buildableIdentifier, "primary")
}
func test_schemeTestAction_with_executionAction() {
let testTarget = Target.test(name: "AppTests", product: .unitTests)
let preAction = ExecutionAction(title: "Pre Action", scriptText: "echo Pre Actions", target: "AppTests")
let postAction = ExecutionAction(title: "Post Action", scriptText: "echo Post Actions", target: "AppTests")
let testAction = TestAction.test(targets: ["AppTests"], preActions: [preAction], postActions: [postAction])
let scheme = Scheme.test(name: "AppTests", shared: true, testAction: testAction)
let project = Project.test(targets: [testTarget])
let pbxTestTarget = PBXNativeTarget(name: "AppTests", productType: .unitTestBundle)
let generatedProject = GeneratedProject.test(targets: ["AppTests": pbxTestTarget])
let got = subject.schemeTestAction(scheme: scheme, project: project, generatedProject: generatedProject)
// Pre Action
XCTAssertEqual(got?.preActions.first?.title, "Pre Action")
XCTAssertEqual(got?.preActions.first?.scriptText, "echo Pre Actions")
let preBuildableReference = got?.preActions.first?.environmentBuildable
XCTAssertEqual(preBuildableReference?.referencedContainer, "container:project.xcodeproj")
XCTAssertEqual(preBuildableReference?.buildableName, "AppTests.xctest")
XCTAssertEqual(preBuildableReference?.blueprintName, "AppTests")
XCTAssertEqual(preBuildableReference?.buildableIdentifier, "primary")
// Post Action
XCTAssertEqual(got?.postActions.first?.title, "Post Action")
XCTAssertEqual(got?.postActions.first?.scriptText, "echo Post Actions")
let postBuildableReference = got?.postActions.first?.environmentBuildable
XCTAssertEqual(postBuildableReference?.referencedContainer, "container:project.xcodeproj")
XCTAssertEqual(postBuildableReference?.buildableName, "AppTests.xctest")
XCTAssertEqual(postBuildableReference?.blueprintName, "AppTests")
XCTAssertEqual(postBuildableReference?.buildableIdentifier, "primary")
}
func test_schemeBuildAction() {
let target = Target.test(name: "App", product: .app)
let pbxTarget = PBXNativeTarget(name: "App")
let scheme = Scheme.test(name: "App")
let project = Project.test(targets: [target])
let generatedProject = GeneratedProject.test(targets: ["App": pbxTarget])
let got = subject.schemeBuildAction(scheme: scheme, project: project, generatedProject: generatedProject)
XCTAssertEqual(got?.buildActionEntries.count, 1)
let entry = got?.buildActionEntries.first
let buildableReference = entry?.buildableReference
XCTAssertEqual(entry?.buildFor, [.analyzing, .archiving, .profiling, .running, .testing])
XCTAssertEqual(buildableReference?.referencedContainer, "container:project.xcodeproj")
XCTAssertEqual(buildableReference?.buildableName, "App.app")
XCTAssertEqual(buildableReference?.blueprintName, "App")
XCTAssertEqual(buildableReference?.buildableIdentifier, "primary")
XCTAssertEqual(got?.parallelizeBuild, true)
XCTAssertEqual(got?.buildImplicitDependencies, true)
}
func test_schemeBuildAction_with_executionAction() {
let target = Target.test(name: "App", product: .app)
let pbxTarget = PBXNativeTarget(name: "App")
let preAction = ExecutionAction(title: "Pre Action", scriptText: "echo Pre Actions", target: "App")
let postAction = ExecutionAction(title: "Post Action", scriptText: "echo Post Actions", target: "App")
let buildAction = BuildAction.test(targets: ["Library"], preActions: [preAction], postActions: [postAction])
let scheme = Scheme.test(name: "App", shared: true, buildAction: buildAction)
let project = Project.test(targets: [target])
let generatedProject = GeneratedProject.test(targets: ["App": pbxTarget])
let got = subject.schemeBuildAction(scheme: scheme, project: project, generatedProject: generatedProject)
// Pre Action
XCTAssertEqual(got?.preActions.first?.title, "Pre Action")
XCTAssertEqual(got?.preActions.first?.scriptText, "echo Pre Actions")
let preBuildableReference = got?.preActions.first?.environmentBuildable
XCTAssertEqual(preBuildableReference?.referencedContainer, "container:project.xcodeproj")
XCTAssertEqual(preBuildableReference?.buildableName, "App.app")
XCTAssertEqual(preBuildableReference?.blueprintName, "App")
XCTAssertEqual(preBuildableReference?.buildableIdentifier, "primary")
// Post Action
XCTAssertEqual(got?.postActions.first?.title, "Post Action")
XCTAssertEqual(got?.postActions.first?.scriptText, "echo Post Actions")
let postBuildableReference = got?.postActions.first?.environmentBuildable
XCTAssertEqual(postBuildableReference?.referencedContainer, "container:project.xcodeproj")
XCTAssertEqual(postBuildableReference?.buildableName, "App.app")
XCTAssertEqual(postBuildableReference?.blueprintName, "App")
XCTAssertEqual(postBuildableReference?.buildableIdentifier, "primary")
}
func test_schemeLaunchAction_when_runnableTarget() {
let target = Target.test(name: "App", product: .app, environment: ["a": "b"])
let pbxTarget = PBXNativeTarget(name: "App")
let scheme = Scheme.test(runAction: RunAction.test(arguments: Arguments.test(environment: ["a": "b"])))
let project = Project.test(path: AbsolutePath("/project.xcodeproj"), targets: [target])
let generatedProject = GeneratedProject.test(targets: ["App": pbxTarget])
let got = subject.schemeLaunchAction(scheme: scheme, project: project, generatedProject: generatedProject)
XCTAssertNil(got?.macroExpansion)
let buildableReference = got?.buildableProductRunnable?.buildableReference
XCTAssertEqual(got?.buildConfiguration, "Debug")
XCTAssertEqual(got?.environmentVariables, [XCScheme.EnvironmentVariable(variable: "a", value: "b", enabled: true)])
XCTAssertEqual(buildableReference?.referencedContainer, "container:project.xcodeproj")
XCTAssertEqual(buildableReference?.buildableName, "App.app")
XCTAssertEqual(buildableReference?.blueprintName, "App")
XCTAssertEqual(buildableReference?.buildableIdentifier, "primary")
}
func test_schemeLaunchAction_when_notRunnableTarget() {
let target = Target.test(name: "Library", platform: .iOS, product: .dynamicLibrary)
let pbxTarget = PBXNativeTarget(name: "App")
let buildAction = BuildAction.test(targets: ["Library"])
let testAction = TestAction.test(targets: ["Library"])
let scheme = Scheme.test(name: "Library", buildAction: buildAction, testAction: testAction, runAction: nil)
let project = Project.test(path: AbsolutePath("/project.xcodeproj"), targets: [target])
let generatedProject = GeneratedProject.test(targets: ["Library": pbxTarget])
let got = subject.schemeLaunchAction(scheme: scheme, project: project, generatedProject: generatedProject)
XCTAssertNil(got?.buildableProductRunnable?.buildableReference)
XCTAssertEqual(got?.buildConfiguration, "Debug")
XCTAssertEqual(got?.macroExpansion?.referencedContainer, "container:project.xcodeproj")
XCTAssertEqual(got?.macroExpansion?.buildableName, "libLibrary.dylib")
XCTAssertEqual(got?.macroExpansion?.blueprintName, "Library")
XCTAssertEqual(got?.macroExpansion?.buildableIdentifier, "primary")
}
func test_schemeProfileAction_when_runnableTarget() {
let target = Target.test(name: "App", platform: .iOS, product: .app)
let scheme = Scheme.test()
let pbxTarget = PBXNativeTarget(name: "App")
let project = Project.test(path: AbsolutePath("/project.xcodeproj"), targets: [target])
let generatedProject = GeneratedProject.test(targets: ["App": pbxTarget])
let got = subject.schemeProfileAction(scheme: scheme, project: project, generatedProject: generatedProject)
let buildable = got?.buildableProductRunnable?.buildableReference
XCTAssertNil(got?.macroExpansion)
XCTAssertEqual(got?.buildableProductRunnable?.runnableDebuggingMode, "0")
XCTAssertEqual(buildable?.referencedContainer, "container:project.xcodeproj")
XCTAssertEqual(buildable?.buildableName, target.productNameWithExtension)
XCTAssertEqual(buildable?.blueprintName, target.name)
XCTAssertEqual(buildable?.buildableIdentifier, "primary")
XCTAssertEqual(got?.buildConfiguration, "Release")
XCTAssertEqual(got?.preActions, [])
XCTAssertEqual(got?.postActions, [])
XCTAssertEqual(got?.shouldUseLaunchSchemeArgsEnv, true)
XCTAssertEqual(got?.savedToolIdentifier, "")
XCTAssertEqual(got?.ignoresPersistentStateOnLaunch, false)
XCTAssertEqual(got?.useCustomWorkingDirectory, false)
XCTAssertEqual(got?.debugDocumentVersioning, true)
XCTAssertNil(got?.commandlineArguments)
XCTAssertNil(got?.environmentVariables)
XCTAssertEqual(got?.enableTestabilityWhenProfilingTests, true)
}
func test_schemeProfileAction_when_notRunnableTarget() {
let target = Target.test(name: "Library", platform: .iOS, product: .dynamicLibrary)
let buildAction = BuildAction.test(targets: ["Library"])
let testAction = TestAction.test(targets: ["Library"])
let scheme = Scheme.test(name: "Library", buildAction: buildAction, testAction: testAction, runAction: nil)
let project = Project.test(path: AbsolutePath("/project.xcodeproj"), targets: [target])
let pbxTarget = PBXNativeTarget(name: "Library")
let generatedProject = GeneratedProject.test(targets: ["Library": pbxTarget])
let got = subject.schemeProfileAction(scheme: scheme, project: project, generatedProject: generatedProject)
let buildable = got?.buildableProductRunnable?.buildableReference
XCTAssertNil(buildable)
XCTAssertEqual(got?.buildConfiguration, "Release")
XCTAssertEqual(got?.preActions, [])
XCTAssertEqual(got?.postActions, [])
XCTAssertEqual(got?.shouldUseLaunchSchemeArgsEnv, true)
XCTAssertEqual(got?.savedToolIdentifier, "")
XCTAssertEqual(got?.ignoresPersistentStateOnLaunch, false)
XCTAssertEqual(got?.useCustomWorkingDirectory, false)
XCTAssertEqual(got?.debugDocumentVersioning, true)
XCTAssertNil(got?.commandlineArguments)
XCTAssertNil(got?.environmentVariables)
XCTAssertEqual(got?.enableTestabilityWhenProfilingTests, true)
XCTAssertEqual(got?.buildConfiguration, "Release")
XCTAssertEqual(got?.macroExpansion?.referencedContainer, "container:project.xcodeproj")
XCTAssertEqual(got?.macroExpansion?.buildableName, "libLibrary.dylib")
XCTAssertEqual(got?.macroExpansion?.blueprintName, "Library")
XCTAssertEqual(got?.macroExpansion?.buildableIdentifier, "primary")
}
func test_schemeAnalyzeAction() {
let got = subject.schemeAnalyzeAction()
XCTAssertEqual(got.buildConfiguration, "Debug")
}
func test_schemeArchiveAction() {
let got = subject.schemeArchiveAction()
XCTAssertEqual(got.buildConfiguration, "Release")
XCTAssertEqual(got.revealArchiveInOrganizer, true)
}
// MARK: - Private
private func generatedProject(targets: [Target]) -> GeneratedProject {
var pbxTargets: [String: PBXNativeTarget] = [:]
targets.forEach { pbxTargets[$0.name] = PBXNativeTarget(name: $0.name) }
return GeneratedProject(pbxproj: .init(), path: AbsolutePath("/project.xcodeproj"), targets: pbxTargets, name: "project.xcodeproj")
}
}
|
[
-1
] |
db600a9c719b2cb3d8e9b60a3dd95e074caa1b84
|
12e47415cb11f34ef7bdbeab7bf8908b37c5a28c
|
/Approval/Common/Components/JLToast/JLToastView.swift
|
a3379b7471a3e126ab4144f8410c428e2b31aa5e
|
[] |
no_license
|
vichhai/Testing
|
3aafe8a2929c5540e9a04be0d7a922ee524ba68c
|
4a60d4dfe78a036a074b00a3ddc8a12959c6c8ce
|
refs/heads/master
| 2021-01-01T18:07:19.720925 | 2015-05-07T07:33:17 | 2015-05-07T07:33:17 | 35,204,984 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 3,598 |
swift
|
/*
* JLToastView.swift
*
* DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
* Version 2, December 2004
*
* Copyright (C) 2013-2014 Su Yeol Jeon
*
* Everyone is permitted to copy and distribute verbatim or modified
* copies of this license document, and changing it is allowed as long
* as the name is changed.
*
* DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
* TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
*
* 0. You just DO WHAT THE FUCK YOU WANT TO.
*
*/
import UIKit
@objc public class JLToastView: UIView {
var _backgroundView: UIView?
var _textLabel: UILabel?
var _textInsets: UIEdgeInsets?
init() {
super.init(frame: CGRectMake(0, 0, 64, 64))
_backgroundView = UIView(frame: self.bounds)
_backgroundView!.backgroundColor = UIColor(white: 0, alpha: 0.6)
_backgroundView!.layer.cornerRadius = 5
_backgroundView!.clipsToBounds = true
self.addSubview(_backgroundView!)
_textLabel = UILabel(frame: CGRectMake(0, 0, 64, 64))
_textLabel!.textColor = UIColor.whiteColor()
_textLabel!.backgroundColor = UIColor.clearColor()
_textLabel!.font = UIFont.systemFontOfSize(JLToastViewValue.FontSize)
_textLabel!.numberOfLines = 0
_textLabel!.textAlignment = NSTextAlignment.Center;
self.addSubview(_textLabel!)
_textInsets = UIEdgeInsetsMake(6, 10, 6, 10)
}
required convenience public init(coder aDecoder: NSCoder) {
self.init()
}
func updateView() {
let deviceWidth = CGRectGetWidth(UIScreen.mainScreen().bounds)
let font = self._textLabel!.font
let constraintSize = CGSizeMake(deviceWidth * (280.0 / 320.0), CGFloat.max)
var textLabelSize = self._textLabel!.sizeThatFits(constraintSize)
self._textLabel!.frame = CGRect(
x: self._textInsets!.left,
y: self._textInsets!.top,
width: textLabelSize.width,
height: textLabelSize.height
)
self._backgroundView!.frame = CGRect(
x: 0,
y: 0,
width: self._textLabel!.frame.size.width + self._textInsets!.left + self._textInsets!.right,
height: self._textLabel!.frame.size.height + self._textInsets!.top + self._textInsets!.bottom
)
var x: CGFloat
var y: CGFloat
var width:CGFloat
var height:CGFloat
let screenSize = UIScreen.mainScreen().bounds.size
let backgroundViewSize = self._backgroundView!.frame.size
let orientation = UIApplication.sharedApplication().statusBarOrientation
let systemVersion = (UIDevice.currentDevice().systemVersion as NSString).floatValue
if UIInterfaceOrientationIsLandscape(orientation) && systemVersion < 8.0 {
width = screenSize.height
height = screenSize.width
y = JLToastViewValue.LandscapeOffsetY
} else {
width = screenSize.width
height = screenSize.height
if UIInterfaceOrientationIsLandscape(orientation) {
y = JLToastViewValue.LandscapeOffsetY
} else {
y = JLToastViewValue.PortraitOffsetY
}
}
x = (width - backgroundViewSize.width) * 0.5
y = height - (backgroundViewSize.height + y)
self.frame = CGRectMake(x, y, width, height);
}
override public func hitTest(point: CGPoint, withEvent event: UIEvent!) -> UIView? {
return nil
}
}
|
[
-1
] |
d967d340eddb4225ffc47415f53e3ac32ceb0e5d
|
01790bc4ce434ef14d9efde669b3823a450f3bac
|
/mtrckrTests/Transactions/TransactionTableViewControllerTests.swift
|
2b6523b743ef47ef5b3afef72c250722311f821d
|
[] |
no_license
|
nicolettemanas/mtrckr
|
b122586fa577f68b9ac19e86771f348528e12ef8
|
b9d60b322d35c47de585400f9ff975510c2aeeae
|
refs/heads/master
| 2021-01-19T07:41:25.874142 | 2018-03-06T08:51:00 | 2018-03-06T08:51:00 | 87,562,656 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 4,366 |
swift
|
//
// TransactionTableViewControllerTests.swift
// mtrckrTests
//
// Created by User on 8/6/17.
//
import UIKit
import Quick
import Nimble
import RealmSwift
import SwipeCellKit
@testable import mtrckr
class TransactionTableViewControllerTests: QuickSpec {
var storyboard: UIStoryboard?
var transactionsTVC: TransactionsTableViewController?
var mockPresenter: MockTransactionsPresenter?
var mockInteractor: MockTransactionsInteractor?
var mockNewTransPresenter: MockNewTransactionPresenter?
var mockDeleteTransactionSheetPresenter: MockDeleteTransactionSheetPresenter?
var identifier = "AccountsTableViewControllerTests"
override func spec() {
beforeEach {
self.storyboard = UIStoryboard(name: "Today", bundle: Bundle.main)
}
describe("TransactionTableViewControllerTests") {
var realm: Realm?
beforeEach {
var config = Realm.Configuration()
config.inMemoryIdentifier = self.identifier
realm = try? Realm(configuration: config)
try! realm?.write {
realm!.deleteAll()
}
self.mockInteractor = MockTransactionsInteractor(with: RealmAuthConfig())
self.mockPresenter = MockTransactionsPresenter(with: self.mockInteractor!)
self.mockNewTransPresenter = MockNewTransactionPresenter()
self.mockDeleteTransactionSheetPresenter = MockDeleteTransactionSheetPresenter()
self.transactionsTVC = StubMTResolvers.shared.container
.resolve(TransactionsTableViewController.self,
name: "stub",
argument: TransactionsFilter.byDate)
expect(self.transactionsTVC?.view).toNot(beNil())
self.transactionsTVC?.transactionsPresenter = self.mockPresenter
self.transactionsTVC?.deleteTransactionSheetPresenter = self.mockDeleteTransactionSheetPresenter
self.transactionsTVC?.newTransPresenter = self.mockNewTransPresenter
}
context("swipe left a cell to display actions", {
it("displays two options: Edit and Delete", closure: {
let actions = self.transactionsTVC?.tableView(self.transactionsTVC!.tableView,
editActionsForRowAt: IndexPath(item: 0, section: 0),
for: SwipeActionsOrientation.right)
expect(actions?.first?.accessibilityLabel) == "Delete"
expect(actions?.last?.accessibilityLabel) == "Edit"
})
context("taps edit transaction", {
it("presents a viewcontroller to edit transaction", closure: {
let actions = self.transactionsTVC?
.tableView(self.transactionsTVC!.tableView,
editActionsForRowAt: IndexPath(item: 0, section: 0),
for: SwipeActionsOrientation.right)
let edit = actions?.last
edit?.handler?(edit!, IndexPath(item: 0, section: 0))
expect(self.mockNewTransPresenter?.didPresent) == true
})
})
context("taps delete transaction", {
it("tells the presenter to display sheet confirming whether to delete transaction", closure: {
let actions = self.transactionsTVC?
.tableView(self.transactionsTVC!.tableView,
editActionsForRowAt: IndexPath(item: 0, section: 0),
for: SwipeActionsOrientation.right)
let delete = actions?.first
delete?.handler?(delete!, IndexPath(item: 0, section: 0))
expect(self.mockDeleteTransactionSheetPresenter?.didPresentDeletSheet) == true
})
})
})
}
}
}
|
[
-1
] |
edb30a05a65f7dd13b0c370ab9c170924a548b2a
|
75a4bb51ba051b1731bd93ab0b983e6693844eb2
|
/mandiri-test-option-two/API/Base/HTTPClient.swift
|
e04de07d954b468e6b1e236cd5324a3d33371471
|
[] |
no_license
|
flozaholic/mandiri-test-option-two
|
42a685d507f8efc6c782fde233c485f72d5d3fa0
|
a5f6d74cc42a74df9d182d90756a2b894dafa401
|
refs/heads/main
| 2023-03-26T23:41:52.171802 | 2021-03-25T06:02:03 | 2021-03-25T06:02:03 | 351,322,136 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 538 |
swift
|
//
// HTTPClient.swift
// mandiri-test-option-two
//
// Created by Admin on 24/3/21.
//
import Foundation
import RxSwift
protocol ClientAPI {
var httpClient: HTTPClient { get }
}
protocol HTTPClient {
func send<T: Codable>(request apiRequest: HTTPRequest) -> Single<T>
}
protocol HTTPIdentifier {
var baseUrl: URL { get }
}
class BaseIdentifier: HTTPIdentifier {
#if DEBUG
var baseUrl = URL(string: "https://newsapi.org/")!
#else
var baseUrl = URL(string: "https://newsapi.org/")!
#endif
}
|
[
-1
] |
0c975d3bdd31d1cef93b7567935434af348662c1
|
e13542dd5d7dca81e5b02325000924ca66fe0ebe
|
/SimpleRTApp/SimpleRTApp/PushNotificationsActionsHandler.swift
|
13b106053daa70970e5aeeb0729a4e16ff605a4f
|
[] |
no_license
|
morad/SimpleRTApp
|
4232dd1f95eaad5a79da6eb6c20118f65e6fc48d
|
f821b9007793e85c774253941625b536e2c7ab41
|
refs/heads/master
| 2021-09-09T17:50:53.538769 | 2018-03-18T18:15:10 | 2018-03-18T18:15:10 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,220 |
swift
|
//
// PushNotificationsActionsHandler.swift
// SimpleRTApp
//
// Created by Federico Jordán on 18/3/18.
// Copyright © 2018 Federico Jordán. All rights reserved.
//
import UIKit
import UserNotifications
enum PushNotificationActionIdentifier: String {
case retweetActionIdentifier = "retweet_action_identifier"
}
class PushNotificationsActionsHandler: NSObject {
let window: UIWindow
init(withWindow window: UIWindow) {
self.window = window
super.init()
}
}
extension PushNotificationsActionsHandler: UNUserNotificationCenterDelegate {
func userNotificationCenter(_ center: UNUserNotificationCenter,
didReceive response: UNNotificationResponse,
withCompletionHandler completionHandler: @escaping () -> Void) {
let userInfo = response.notification.request.content.userInfo
if response.actionIdentifier == PushNotificationActionIdentifier.retweetActionIdentifier.rawValue {
guard let tweetId = userInfo["tweetId"] as? String else { return }
openViewAndRetweet(fromTweetId: tweetId)
}
completionHandler()
}
private func openViewAndRetweet(fromTweetId tweetId: String) {
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let retweetViewController = storyboard.instantiateViewController(withIdentifier: "retweetViewController") as? RetweetViewController
if let retweetViewController = retweetViewController {
retweetViewController.setupAutomaticRetweet(withTweetId: tweetId)
let hashtagsViewController = window.rootViewController?.presentedViewController
if let presentedRetweetViewController = hashtagsViewController?.presentedViewController {
presentedRetweetViewController.dismiss(animated: false, completion: {
hashtagsViewController?.present(retweetViewController, animated: true)
})
} else {
hashtagsViewController?.present(retweetViewController, animated: true)
}
}
}
}
|
[
-1
] |
e882f47d03c08e26feb99d988612c5e298fc0b00
|
5b688a75d112bb9ef477500696ab9e59db91bb86
|
/extention.swift
|
cfcd86524700e147b7a99fc720be4fc837d8e56f
|
[] |
no_license
|
liudhzhyym/J64-Ninja-Jump
|
6141cfbce6556e49d9bf91e33af906edc4801b09
|
9d7a7d28c58a7bed67ea0ee49308907b34e7fb6b
|
refs/heads/master
| 2021-09-15T13:50:25.744867 | 2018-06-03T11:51:36 | 2018-06-03T11:51:36 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 7,673 |
swift
|
//
// extention.swift
// jack64
//
// Created by ABD on 07/08/2017.
// Copyright © 2017 ABD. All rights reserved.
//
import Foundation
import StoreKit
//import SwiftyStoreKit
extension Purchase : SKProductsRequestDelegate, SKPaymentTransactionObserver {
func paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) {
print("add payment")
for transaction: AnyObject in transactions {
let trans = transaction as! SKPaymentTransaction
print(trans.error)
switch trans.transactionState {
case .purchased:
print("buy ok, unlock IAP HERE")
print(p.productIdentifier)
let prodID = p.productIdentifier
switch prodID {
case "com.abdm64.jack64.RemoveAds":
print("remove ads")
UserDefaults.standard.set(true, forKey: id)
case "seemu.iap.addcoins":
print("add coins to account")
default:
print("IAP not found")
}
queue.finishTransaction(trans)
case .failed:
print("buy error")
queue.finishTransaction(trans)
break
default:
print("Default")
break
}
}
}
func productsRequest(_ request: SKProductsRequest, didReceive response: SKProductsResponse) {
print("product request")
let myProduct = response.products
for product in myProduct {
print("product added")
print(product.productIdentifier)
print(product.localizedTitle)
print(product.localizedDescription)
print(product.price)
list.append(product)
}
}
func paymentQueueRestoreCompletedTransactionsFinished(_ queue: SKPaymentQueue) {
print("transactions restored")
for transaction in queue.transactions {
let t: SKPaymentTransaction = transaction
let prodID = t.payment.productIdentifier as String
switch prodID {
case "com.abdm64.jack64.RemoveAds":
print("remove ads")
UserDefaults.standard.set(true, forKey: id)
case "seemu.iap.addcoins":
print("add coins to account")
default:
print("IAP not found")
}
}
}
/*
func alertWitTitle (title : String , message : String) -> UIAlertController{
let alert = UIAlertController(title: title, message: message, preferredStyle: .alert)
alert.addAction(UIAlertAction(title: "OK", style: .cancel, handler: nil))
return alert
}
func showAlert(alert : UIAlertController){
guard let _ = self.view?.window?.rootViewController?.presentedViewController else {
self.view?.window?.rootViewController?.present(alert, animated: true, completion: nil)
return
}
}
func alertForProductRetriveInfo(result : RetrieveResults) -> UIAlertController{
if let product = result.retrievedProducts.first {
let priceString = product.localizedPrice!
return alertWitTitle(title: product.localizedTitle, message: "\(product.localizedDescription)- \(priceString)")
} else if let invalidProductID = result.invalidProductIDs.first {
return alertWitTitle(title: "Error", message: "Invalid Product ID\(invalidProductID)")
} else {
let error = result.error?.localizedDescription ?? "Conact Support"
return alertWitTitle(title: "Error", message: error)
}
}
func alertPurchaseResult(result : PurchaseResult) -> UIAlertController{
switch result {
case .success(let product):
print("Purchase Succesful: \(product.productId)")
return alertWitTitle(title: "Thank You", message: "Purchase completed")
case .error(let error):
print("Purchase Failed: \(error)")
return alertWitTitle(title: "Error", message: "Purchase Failed: \(error)")
}
}
func alertForRestorePurchases(result : RestoreResults) -> UIAlertController{
if result.restoreFailedProducts.count > 0 {
print ("Failed Restore \(result.restoreFailedProducts)")
return alertWitTitle(title: "Restore Failed", message: "Please Contact Support")
} else if result.restoredProducts.count > 0 {
let save = UserDefaults.standard
save.set(true, forKey: "Purchase")
save.synchronize()
self.iCloudSetUp()
return alertWitTitle(title: "Purchases Restored", message: "All purchases have been restored.")
} else {
print("Nothing to restore")
return alertWitTitle(title: "Nothing To Restore", message: "No previous purchases were made.")
}
}
func alertVerfyReceipt(result : VerifyReceiptResult) -> UIAlertController{
switch result {
case .success(let receipt) :
return alertWitTitle(title:"Receipt is Verfid" , message:"Receipt Verfied Remotly" )
case .error(let error) :
switch error {
case .noReceiptData :
return alertWitTitle(title:"Receipt Verfication" , message:"No Receipt Data Found Application will try to get new one Try Again" )
default :
return alertWitTitle(title:"Receipt Verfication" , message:"Receipt Verfication Failed" )
}
}
}
func alertForVerfiySubscription(result : VerifySubscriptionResult)-> UIAlertController {
switch result {
case .purchased(let expiryDate) :
return alertWitTitle(title: "Product is Puchased", message: "Product will be valide until\(expiryDate) ")
case .notPurchased :
return alertWitTitle(title: "Not Puchased" , message: "This Product has never Puchased")
case .expired(let expiryDate) :
return alertWitTitle(title: "Subscription has expired", message: "date of expiration : \(expiryDate)")
}
}
func alertForVerfiyPurchase(result : VerifyPurchaseResult) -> UIAlertController {
switch result {
case .purchased:
return alertWitTitle(title: "Product is Purchased", message:"Product will not expire")
case .notPurchased:
return alertWitTitle(title: "Product is not Purchased", message:"Product has never been Purchased")
}
}
func alertForRefrashReceipt(result : RefreshReceiptResult) -> UIAlertController {
switch result {
case .success(let receiptData):
return alertWitTitle(title: "Receipt Refreshed", message: "Receipt Refresh succcefully")
case .error(let error) :
return alertWitTitle(title: "Receipt Refresh Failed", message: "Receipt Refresh Failed")
}
}
*/
} // extention
|
[
-1
] |
2bfb44c3a82a8807f6ed2fc4fd420b0b9dd8396d
|
f68f772566aa8e25a58a893b97f48d067c9fc59f
|
/MXScroll/Classes/MXViewController.swift
|
10b9c3b35284e437307526e61765bad3bd0420c6
|
[
"MIT"
] |
permissive
|
cillyfly/MXScroll
|
9c1502c6ac9f2837d0f10018d44deac2f6efa338
|
ca18840c446fb717724200f596a1e7945aa17af3
|
refs/heads/master
| 2021-06-18T17:46:14.117964 | 2020-12-31T03:33:39 | 2020-12-31T03:33:39 | 141,395,078 | 168 | 19 |
MIT
| 2020-09-29T01:11:34 | 2018-07-18T07:05:04 |
Swift
|
UTF-8
|
Swift
| false | false | 8,560 |
swift
|
//
// MXViewController.swift
// WebViewHeight
//
// Created by cc x on 2018/7/17.
// Copyright © 2018 cillyfly. All rights reserved.
//
import EasyPeasy
import UIKit
/**
* Public protocol of MXViewController for content changes and makes the scroll effect.
*/
@objc public protocol MXViewControllerViewSource {
/// By default, MXScrollView will observe the default view of viewcontroller for content
/// changes and makes the scroll effect. If you want to change the default view, implement
/// MXViewControllerViewSource and pass your custom view.
///
/// - Returns: observe view
@objc optional func viewForMixToObserveContentOffsetChange() -> UIView
/// By default MXScrollView will not observe the default view of HeaderViewController for content changes.
/// if you want to change the headerview's content height implement MXViewControllerViewSource and pass your autochange heigth view.
@objc optional func headerViewForMixObserveContentOffsetChange() -> UIView?
}
public class MXViewController<T: MXSegmentProtocol>: UIViewController where T: UIView {
/// settting segment from outside
open var segmentView: T!
var segmentedScrollView = MXScrollView<T>(frame: CGRect.zero)
open var scrollView :UIScrollView{
get{
return segmentedScrollView
}
}
/**
* Set ViewController for header view.
*/
open var headerViewController: UIViewController? {
didSet {
setDefaultValuesToSegmentedScrollView()
}
}
/**
* Array of ViewControllers for segments.
*/
open var segmentControllers = [UIViewController]() {
didSet {
setDefaultValuesToSegmentedScrollView()
}
}
/**
* Set headerview offset height.
*
* By default the height is 0.0
*
* segmentedViewController. headerViewOffsetHeight = 10.0
*/
open var headerViewOffsetHeight: CGFloat = 0.0 {
didSet {
segmentedScrollView.headerViewOffsetHeight = headerViewOffsetHeight
}
}
/**
* Set height for segment view.
*
* By default the height is 40.0
*
* segmentedViewController.segmentViewHeight = 60.0
*/
open var segmentViewHeight: CGFloat = 40.0 {
didSet {
segmentedScrollView.segmentViewHeight = segmentViewHeight
}
}
/**
* Set vertical scroll indicator.
*
* By default true.
*
* segmentedScrollView.showsVerticalScrollIndicator = false
*/
open var showsVerticalScrollIndicator = true {
didSet {
segmentedScrollView.mxShowsVerticalScrollIndicator = showsVerticalScrollIndicator
}
}
/**
* Set horizontal scroll indicator.
*
* By default true.
*
* segmentedScrollView.showsHorizontalScrollIndicator = false
*/
open var showsHorizontalScrollIndicator = true {
didSet {
segmentedScrollView.mxShowsHorizontalScrollIndicator = showsHorizontalScrollIndicator
}
}
open var shouldScrollToBottomAtFirstTime: Bool = true {
didSet {
segmentedScrollView.shouldScrollToBottomAtFirstTime = shouldScrollToBottomAtFirstTime
}
}
override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
}
public required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
/**
Custom initializer for SJSegmentedViewController.
- parameter headerViewController: A UIViewController
- parameter segmentControllers: Array of UIViewControllers for segments.
*/
public convenience init(headerViewController: UIViewController?,
segmentControllers: [UIViewController]) {
self.init(nibName: nil, bundle: nil)
self.headerViewController = headerViewController
self.segmentControllers = segmentControllers
setDefaultValuesToSegmentedScrollView()
}
public convenience init(headerViewController: UIViewController?,
segmentControllers: [UIViewController],
segmentView: T?) {
self.init(nibName: nil, bundle: nil)
self.headerViewController = headerViewController
self.segmentControllers = segmentControllers
self.segmentView = segmentView
setDefaultValuesToSegmentedScrollView()
}
/**
* Set the default values for the segmented scroll view.
*/
func setDefaultValuesToSegmentedScrollView() {
}
public override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
if shouldScrollToBottomAtFirstTime {
scrollToBottom()
}
}
public override func loadView() {
super.loadView()
}
public override func viewDidLoad() {
super.viewDidLoad()
print("viewDidLoad")
view.backgroundColor = #colorLiteral(red: 1, green: 1, blue: 1, alpha: 1)
setupSegmentScrollView()
loadControllers()
}
public override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
print("viewDidLayoutSubviews")
let topSpacing = MXUtil.getTopSpacing(self)
segmentedScrollView.topSpacing = topSpacing
segmentedScrollView.bottomSpacing = MXUtil.getBottomSpacing(self)
segmentedScrollView.easy.layout(Top(topSpacing).to(view))
segmentedScrollView.updateSubview(view.bounds)
}
func setupSegmentScrollView() {
let topSpacing = MXUtil.getTopSpacing(self)
segmentedScrollView.topSpacing = topSpacing
let bottomSpacing = MXUtil.getBottomSpacing(self)
segmentedScrollView.bottomSpacing = bottomSpacing
view.addSubview(segmentedScrollView)
segmentedScrollView.easy.layout(Left(0),
Right(0),
Top(topSpacing).to(view),
Bottom(bottomSpacing))
segmentedScrollView.setContainerView()
}
/**
Method for adding the HeaderViewController into the container
- parameter headerViewController: Header ViewController.
*/
func addHeaderViewController(_ headerViewController: UIViewController) {
addChild(headerViewController)
segmentedScrollView.addHeaderView(view: headerViewController.view)
if let delegate = headerViewController as? MXViewControllerViewSource, let v = delegate.headerViewForMixObserveContentOffsetChange?() {
segmentedScrollView.setListenHeaderView(view: v)
} else {
headerViewController.view.layoutIfNeeded()
segmentedScrollView.headerViewHeight = headerViewController.view.frame.height
segmentedScrollView.updateHeaderHeight()
}
headerViewController.didMove(toParent: self)
}
/**
Method for adding the array of content ViewControllers into the container
- parameter contentControllers: array of ViewControllers
*/
func addContentControllers(_ contentControllers: [UIViewController]) {
for controller in contentControllers {
addChild(controller)
segmentedScrollView.addContentView(controller.view, frame: view.bounds)
controller.didMove(toParent: self)
if let delegate = controller as? MXViewControllerViewSource {
let v = delegate.viewForMixToObserveContentOffsetChange!()
segmentedScrollView.contentViews.append(v)
} else {
segmentedScrollView.contentViews.append(controller.view)
}
}
segmentedScrollView.listenContentOffset()
segmentedScrollView.addSegmentView(segmentView, frame: view.bounds)
}
/**
* Method for loading content ViewControllers and header ViewController
*/
func loadControllers() {
if headerViewController == nil {
headerViewController = UIViewController()
}
addHeaderViewController(headerViewController!)
addContentControllers(segmentControllers)
}
}
extension MXViewController {
public func scrollToBottom() {
segmentedScrollView.scrollToBottom(animated: false)
}
}
|
[
-1
] |
28e417b9d40aadd6adee1570d0a6db20146135a9
|
e34c122bec4ffa9c5d78319059b4801bd0bc04d7
|
/CreditCardStorage/CreditCardList/CreditCardListRouter/CreditCardListRouter.swift
|
fbdc54df65bdf069997e40194ff89685ff36fce5
|
[] |
no_license
|
GrizverG/creditCardStorage
|
a500b7edfc80dce29f88670acddc33280c81c78b
|
cd0b604d9564cbd78bdb85cb5e531eb52a7ce280
|
refs/heads/master
| 2022-12-08T14:06:22.762569 | 2020-08-31T08:32:40 | 2020-08-31T08:32:40 | 288,688,364 | 0 | 1 | null | 2020-08-31T09:36:14 | 2020-08-19T09:22:31 |
Swift
|
UTF-8
|
Swift
| false | false | 670 |
swift
|
//
// CreditCardListRouter.swift
// CreditCardStorage
//
// Created by Nick Chekmazov on 19.08.2020.
// Copyright © 2020 Gregory Pinetree. All rights reserved.
//
import UIKit
protocol RouterCreditCardListInput {
func navigateToAddCardScreen()
}
final class CreditCardListRouter {
unowned let view: UIViewController
init(view: UIViewController) {
self.view = view
}
}
extension CreditCardListRouter: RouterCreditCardListInput {
func navigateToAddCardScreen() {
view.navigationController?.pushViewController(AddCreditCardAssembly.assembly(),
animated: true)
}
}
|
[
-1
] |
92a9731e33a7758aa4d9e3e94559fa21da005a25
|
293c0308c6db7681fe48268ec20b2a5e6d268a76
|
/RouteComposer/Classes/Finders/ClassFinder.swift
|
b1fac83e98f4758baeb1ffb969577db64774b6f7
|
[
"MIT"
] |
permissive
|
TrendingTechnology/route-composer
|
72878c94a1f54c18badbb506c3f3eaa0f06cf58b
|
12839428b680a9b2d1d1a3e7237c67fcb24288ed
|
refs/heads/master
| 2021-09-21T17:56:54.693385 | 2018-08-29T21:43:11 | 2018-08-30T00:30:05 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,012 |
swift
|
//
// Created by Eugene Kazaev on 15/01/2018.
// Copyright (c) 2018 HBC Tech. All rights reserved.
//
import Foundation
import UIKit
/// A default implementation of the unique view controller finder, where view controller can be found by name.
/// (Example: Home, account, log in, etc supposed to be in the view stack just once)
public struct ClassFinder<VC: UIViewController, C>: StackIteratingFinder {
/// `UIViewController` type associated with this `ClassFinder`
public typealias ViewController = VC
/// The context type associated with this `ClassFinder`
public typealias Context = C
/// `SearchOptions` to be used by `ClassFinder`
public let options: SearchOptions
/// Constructor
///
/// - Parameter options: A combination of the `SearchOptions`
public init(options: SearchOptions = .currentAndUp) {
self.options = options
}
public func isTarget(_ viewController: ViewController, with context: Context) -> Bool {
return true
}
}
|
[
-1
] |
ce9bcafab70abe9abf95827a841a1c40966595d4
|
a7b1bf4ff8998a7b8a851db7ef2c1d983a5586c9
|
/Sources/SFSafeSymbols/Initializers/UIKit/UIApplicationShortcutIconExtension.swift
|
c094fc16e583d74bd4692b7fdb62f50972b7109b
|
[
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
wayni208/SFSafeSymbols
|
e5e9b97602533fb61262c6314c20d953e7fa053b
|
4fe3f8d13e09ef0a324c67a12d9cfcccf2d6989c
|
refs/heads/stable
| 2023-02-22T02:19:01.911606 | 2023-02-09T07:39:46 | 2023-02-09T07:39:46 | 191,413,598 | 1 | 0 |
MIT
| 2023-02-09T14:15:21 | 2019-06-11T16:52:52 |
Swift
|
UTF-8
|
Swift
| false | false | 431 |
swift
|
#if canImport(UIKit) && (os(iOS) || targetEnvironment(macCatalyst))
import UIKit
@available(iOS 13.0, *)
public extension UIApplicationShortcutIcon {
/// Creates a Home screen quick action icon using a system symbol image.
///
/// - Parameter systemSymbol: The `SFSymbol` describing this image.
convenience init(systemSymbol: SFSymbol) {
self.init(systemImageName: systemSymbol.rawValue)
}
}
#endif
|
[
-1
] |
a7a9a11ebfd4456509a7180d0d8a67d4ee83f392
|
b9b9db35eab3e33c4ec4ede79aa9eb4ee88f4367
|
/CHUGGR/Views/Friends Tab/Custom Cells/FriendCell.swift
|
59e854afc50254d9a3b3efdd78556a334167c056
|
[] |
no_license
|
bolderkat/CHUGGR
|
eab2e2fcc1009783b3d93c121f0be1ed8306fb8e
|
d429105da0c3a4ae2607520a8663caca89305abd
|
refs/heads/main
| 2023-03-21T10:55:14.915223 | 2021-03-17T21:26:20 | 2021-03-17T21:26:20 | 302,472,518 | 0 | 1 | null | null | null | null |
UTF-8
|
Swift
| false | false | 624 |
swift
|
//
// FriendCell.swift
// CHUGGR
//
// Created by Daniel Luo on 12/15/20.
//
import UIKit
class FriendCell: UITableViewCell {
@IBOutlet weak var nameLabel: UILabel!
@IBOutlet weak var userNameLabel: UILabel!
@IBOutlet weak var profPicView: UIImageView!
override func awakeFromNib() {
super.awakeFromNib()
}
func configure(withVM vm: FriendCellViewModel) {
nameLabel.text = vm.fullName
userNameLabel.text = vm.userName
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
}
}
|
[
-1
] |
318ed0d3a0fc06fadd9b3f58739056fe4ebbe950
|
6a0d01942e5f289d5f8db16b15f3832d1f0c3899
|
/Go-JekContactApp/CustomViews/ToastView.swift
|
3c79e404bcc548339f6fbd4318395080aa57ad5e
|
[] |
no_license
|
shohbitgupta/ContactApp
|
61e29610563528fc81befcbdf08cf2df036c393c
|
4cfa18cb8d5c5eefcb6483349dca2d72e629344a
|
refs/heads/master
| 2021-06-25T07:54:41.351557 | 2021-06-13T07:43:59 | 2021-06-13T07:43:59 | 195,162,580 | 0 | 0 | null | 2021-06-13T07:44:39 | 2019-07-04T03:27:20 |
Swift
|
UTF-8
|
Swift
| false | false | 5,217 |
swift
|
//
// ToastView.swift
// Go-JekContactApp
//
// Created by B0203470 on 04/07/19.
// Copyright © 2019 BSB. All rights reserved.
//
import Foundation
import UIKit
final class Toast : NSObject {
let autoHideDuration : Double
var queue = [String]()
fileprivate var toastView : ToastView?
private static let sharedVar: Toast = {
var shared = Toast()
return shared
}()
class func shared() -> Toast {
return sharedVar
}
private override init() {
autoHideDuration = 2.5
}
func showToastMessage(_ message: String?) {
guard let msg = message, msg.count > 0 else {
return
}
queue.append(msg)
if let _ = toastView {
return
}
processQueue()
}
}
//Private Method Extension
extension Toast {
@objc private func processQueue() {
if queue.count == 0 {
hide()
return
}
let current = queue[0]
queue.remove(at: 0)
showCurrentMessage(current)
}
@objc private func handleToastTap(_ gesture: UIGestureRecognizer?) {
if gesture?.state == .recognized {
queue.removeAll()
hide()
NSObject.cancelPreviousPerformRequests(withTarget: self)
}
}
private func dismissToast() {
queue.removeAll()
hide()
NSObject.cancelPreviousPerformRequests(withTarget: self)
}
private func showCurrentMessage(_ message: String?) {
if let _ = toastView {
}
else {
toastView = ToastView(frame: CGRect.zero)
let tap = UITapGestureRecognizer(target: self, action: #selector(self.handleToastTap(_:)))
toastView?.addGestureRecognizer(tap)
}
toastView?.setMessage(message ?? "")
toastView?.alpha = 0.0
UIView.animate(withDuration: 0.2, delay: 0.0, options: .beginFromCurrentState, animations: { [weak self] in
self?.toastView?.alpha = 1.0
})
perform(#selector(processQueue), with: nil, afterDelay: autoHideDuration)
}
private func hide() {
let toast: UIView? = toastView
toastView = nil
UIView.animate(withDuration: 0.2, animations: {
toast?.alpha = 0.0
}) { finished in
toast?.removeFromSuperview()
}
}
}
private struct ToastContacts {
static let contentWidth : CGFloat = 280.0
}
fileprivate class ToastView: UIView {
var margin: CGFloat = 0.0
var offset: CGFloat = 0.0
var message = ""
let label: UILabel
override init(frame: CGRect) {
label = UILabel(frame: CGRect.zero)
label.numberOfLines = 0
label.font = UIFont.regular(14.0)
label.textAlignment = .center
label.textColor = UIColor.white
label.autoresizingMask = [.flexibleWidth, .flexibleHeight]
super.init(frame: frame)
margin = 12.0
offset = 2.0
clipsToBounds = true
layer.cornerRadius = 8.0
backgroundColor = UIColor.clear
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func setMessage(_ message: String?) {
label.text = message
let font: UIFont? = label.font
let y: Float = 0.8
let size: CGSize = message?.size(for: font, width: ToastContacts.contentWidth - 2.0 * margin) ?? CGSize.zero
let w = CGFloat(size.width + 2.0 * margin)
let h = CGFloat(size.height + 2.0 * margin)
frame = CGRect(x: CGFloat(0.0), y: CGFloat(0.0), width: w, height: h)
if label.superview == nil {
setupBlurView()
}
if let wind = UIApplication.shared.delegate?.window, let windowWidth = wind?.bounds.size.width, let windowHeight = wind?.bounds.size.height {
wind?.addSubview(self)
let position = CGFloat(round(Double(CGFloat(y) * (windowHeight))))
center = CGPoint(x: windowWidth/2, y: position)
}
}
}
//Private Method Extension
extension ToastView {
private func setupBlurView() {
let blurEffect = UIBlurEffect(style: .dark)
let blurEffectView = UIVisualEffectView(effect: blurEffect)
blurEffectView.frame = bounds
blurEffectView.autoresizingMask = [.flexibleHeight, .flexibleWidth]
addSubview(blurEffectView)
let vibrancyEffect = UIVibrancyEffect(blurEffect: blurEffect)
let vibrancyEffectView = UIVisualEffectView(effect: vibrancyEffect)
vibrancyEffectView.autoresizingMask = [.flexibleHeight, .flexibleWidth]
vibrancyEffectView.frame = bounds
var rect: CGRect = bounds
rect = rect.insetBy(dx: margin, dy: margin)
rect.origin.y -= offset
label.frame = rect
vibrancyEffectView.contentView.addSubview(label)
blurEffectView.contentView.addSubview(label)
}
}
|
[
-1
] |
486c96941d4f0f66e9c26c3284c6a5f87ef2c9a7
|
91f8704f1fc5a042acd1eca95f9579fa32b1de61
|
/GameOfThrones/GameOfThrones/SecondCustomTableViewCell.swift
|
ec82b4e72a7133c3242f9d3febc60d8f57dfdfb9
|
[
"MIT"
] |
permissive
|
CameronRivera/Pursuit-Core-iOS-Unit2-Assignment2
|
003493a75bc159db5ad2402f742b92c6697e918d
|
8e4f2a945e4bcd1caeeb65aec0c67bcb69c65444
|
refs/heads/master
| 2020-09-11T08:15:31.107949 | 2019-11-19T20:03:48 | 2019-11-19T20:03:48 | 222,002,110 | 0 | 0 |
MIT
| 2019-11-15T20:58:23 | 2019-11-15T20:58:22 | null |
UTF-8
|
Swift
| false | false | 723 |
swift
|
//
// SecondCustomTableViewCell.swift
// GameOfThrones
//
// Created by Cameron Rivera on 11/18/19.
// Copyright © 2019 Pursuit. All rights reserved.
//
import UIKit
class SecondCustomTableViewCell: UITableViewCell {
// MARK: TableViewCell Outlets
@IBOutlet weak var leftImage: UIImageView!
@IBOutlet weak var titleDisplayLabel: UILabel!
@IBOutlet weak var episodeDisplayLabel: UILabel!
// MARK: Helper Methods
func setUp(_ episode: GOTEpisode){
titleDisplayLabel.text = episode.name
episodeDisplayLabel.text = "S:\(episode.season) E:\(episode.number)"
leftImage.clipsToBounds = true
leftImage?.image = UIImage(named:episode.mediumImageID)
}
}
|
[
-1
] |
24864fa97c90bcb1fa6274e60411c8c62c4acafe
|
1d46b89102849c3dde290373b7e642637f1078fc
|
/Splan/Controllers/My Profile/EditProfileViewController.swift
|
7309a8fa9ba1602d13fbbe52bc82cabcb31d3022
|
[
"MIT"
] |
permissive
|
wbgIOS2021/Splan-WireFrame
|
8a0185da665a8f4767081f78d1bb8a6f6a3851b0
|
207254b5b58af217a506e26af78f87d177a88085
|
refs/heads/main
| 2023-09-02T06:41:33.090894 | 2021-11-20T13:25:46 | 2021-11-20T13:25:46 | 420,970,855 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 5,775 |
swift
|
//
// EditProfileViewController.swift
// Splan
//
// Created by Adarsh Raj on 02/11/21.
//
import UIKit
import AVFoundation
class EditProfileViewController: UIViewController, UIImagePickerControllerDelegate & UINavigationControllerDelegate {
@IBOutlet weak var firstNameTextField: TextFieldDesign!
@IBOutlet weak var lastNameTextField: TextFieldDesign!
@IBOutlet weak var userProfileImage: RoundImage!
@IBOutlet weak var emailTextField: TextFieldDesign!
@IBOutlet weak var submitBtn: RoundButton!
@IBOutlet weak var cameraBtn: RoundButton!
var image = UIImage(named:"no-image")
override func viewDidLoad() {
super.viewDidLoad()
submitBtn.dropShadow()
cameraBtn.dropShadow()
}
override func viewWillAppear(_ animated: Bool) {
navigationController?.navigationBar.isHidden = false
}
@IBAction func cameraActionBtn(_ sender: Any) {
checkCameraAccess()
alertsheet(title: "Upload", txt: "Please select Image")
}
@IBAction func submitActionBtn(_ sender: Any) {
}
@IBAction func backBtn(_ sender: Any) {
self.backBtn()
}
}
//MARK:- Gallery and Camera Access
extension EditProfileViewController
{
// For Checking Camera Access:
func checkCameraAccess() {
switch AVCaptureDevice.authorizationStatus(for: .video) {
case .denied:
print("Denied, request permission from settings")
presentCameraSettings()
case .restricted:
print("Restricted, device owner must approve")
case .authorized:
print("Authorized, proceed")
case .notDetermined:
AVCaptureDevice.requestAccess(for: .video) { success in
if success {
print("Permission granted, proceed")
} else {
print("Permission denied")
}
}
default:
print("-----")
}
}
//For Camera Settings:
func presentCameraSettings() {
// let alertController = UIAlertController(title: "Error",
// message: "Camera access is denied",
// preferredStyle: .alert)
// alertController.addAction(UIAlertAction(title: "Cancel", style: .default))
// alertController.addAction(UIAlertAction(title: "Settings", style: .cancel,handler: {
// (UIAlertAction) in
// if let url = URL(string: UIApplication.openSettingsURLString) {
// UIApplication.shared.open(url, options: [:], completionHandler: { _ in
// // Handle
// })
// }
// }))
showCustomAlert(title: "Error", message: "Camera access is denied", view: self, btn_title: "Settings", actionHandler: {
if let url = URL(string: UIApplication.openSettingsURLString) {
UIApplication.shared.open(url, options: [:], completionHandler: { _ in
// Handle
})
}
})
//present(alertController, animated: true)
}
//For Opening Camera:
func camera()
{
if UIImagePickerController.isSourceTypeAvailable(.camera){
let myPickerController = UIImagePickerController()
myPickerController.delegate = self
myPickerController.sourceType = .camera
present(myPickerController, animated: true, completion: nil)
}else{
showSimpleAlert(title: "Warning", message: "No camera found", view: self)
}
}
//For Opening Gallery:
func photoLibrary()
{
if UIImagePickerController.isSourceTypeAvailable(.photoLibrary){
let myPickerController = UIImagePickerController()
myPickerController.delegate = self
myPickerController.sourceType = .photoLibrary
present(myPickerController, animated: true, completion: nil)
}else{
showSimpleAlert(title: "Warning", message: "No PhotoLibrary found", view: self)
}
}
// For event on cancel:
//Delegate
func imagePickerControllerDidCancel(_ picker: UIImagePickerController) {
self.dismiss(animated: true, completion: nil)
}
//For set Image on image view:
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {
let img = info[UIImagePickerController.InfoKey.originalImage] as? UIImage
//image = img
userProfileImage.image = img
self.dismiss(animated: true, completion: nil)
}
func alertsheet(title:String,txt:String){
let alert = UIAlertController(title: title, message: txt, preferredStyle: .actionSheet)
let Gallary = UIAlertAction(title: "Open Gallery", style: .destructive, handler: {
(UIAlertAction) in
self.photoLibrary()
})
let camera = UIAlertAction(title: "Open Camera", style: .destructive, handler:{
(UIAlertAction) in
self.camera()
})
let cancel = UIAlertAction(title: "Cancel", style: .destructive, handler:nil)
alert.addAction(Gallary)
alert.addAction(camera)
alert.addAction(cancel)
present(alert, animated: true, completion: nil)
}
}
|
[
-1
] |
5e720667159ed01ad193a1767600567056c12bb5
|
46fad6c7717e8f74da2ac888c66c1696ff4c8c58
|
/08_Multimedia/HelloAudioPlayer/HelloAudioPlayer/AppDelegate.swift
|
e9ba56e0b443e003d29512dd1d7ad3938f24447f
|
[] |
no_license
|
cyrsis/iOS-Swift-Cookbook-2AU040
|
3e7a4dde27f93acbc92c8a57914d8ba7163798b8
|
940584866f82274e843551a440b1aeb1c3dbaa7d
|
refs/heads/master
| 2020-06-19T22:24:06.560624 | 2016-11-27T03:04:27 | 2016-11-27T03:04:27 | 74,828,977 | 0 | 0 | null | 2016-11-26T13:59:29 | 2016-11-26T13:59:28 | null |
UTF-8
|
Swift
| false | false | 2,151 |
swift
|
//
// AppDelegate.swift
// HelloAudioPlayer
//
// Created by appsgaga on 2015/5/13.
// Copyright (c) 2015年 appsgaga. 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,
278564,
229415,
229417,
327722,
237613,
229426,
237618,
229428,
286774,
229432,
286776,
286778,
319544,
204856,
286791,
237640,
278605,
286797,
311375,
196692,
319573,
311383,
278623,
278626,
319590,
311400,
278635,
303212,
278639,
278648,
131192,
237693,
327814,
131209,
303241,
417930,
303244,
319633,
286873,
286876,
311460,
311469,
32944,
327862,
286906,
327866,
180413,
286910,
286916,
286922,
286924,
286926,
286928,
131281,
278743,
278747,
295133,
155872,
319716,
278760,
237807,
303345,
286962,
229622,
327930,
278781,
278783,
278785,
237826,
286987,
319757,
311569,
286999,
319770,
287003,
287006,
287009,
287012,
287014,
287016,
287019,
311598,
287023,
262448,
311601,
155966,
319809,
319810,
278849,
319814,
311623,
319818,
311628,
287054,
319822,
278865,
196963,
196969,
139638,
213367,
106872,
319872,
311683,
319879,
311693,
65943,
319898,
311719,
278952,
139689,
278957,
311728,
278967,
180668,
311741,
278975,
319938,
278980,
278983,
319945,
278986,
278990,
278994,
311767,
279003,
279006,
188895,
279010,
287202,
279015,
172520,
279020,
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,
279084,
172591,
172598,
279095,
172607,
172609,
172612,
377413,
172614,
172618,
303690,
33357,
279124,
172634,
262752,
172644,
311911,
189034,
295533,
172655,
172656,
189039,
295538,
189040,
172660,
287349,
352880,
189044,
287355,
287360,
295553,
287365,
311942,
303751,
295557,
352905,
279178,
287371,
311946,
311951,
287377,
172691,
287381,
311957,
221850,
287386,
164509,
303773,
172702,
230045,
287390,
287394,
172705,
303780,
172707,
287398,
295583,
279208,
287400,
172714,
295595,
279212,
189102,
172721,
287409,
66227,
303797,
189114,
287419,
328381,
287423,
328384,
279231,
287427,
107208,
279241,
172748,
287436,
287440,
295633,
172755,
303827,
279255,
279258,
303835,
213724,
189149,
303838,
287450,
279267,
295654,
279272,
230128,
312048,
312050,
230131,
205564,
303871,
230146,
328453,
295685,
230154,
33548,
312077,
295695,
295701,
369433,
230169,
295707,
328476,
295710,
230175,
303914,
279340,
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,
213895,
320391,
304007,
304009,
304011,
304013,
279438,
213902,
295822,
189329,
295825,
304019,
279445,
58262,
279452,
279461,
279462,
304042,
213931,
230327,
304055,
287675,
197564,
304063,
238528,
304065,
213954,
189378,
156612,
312272,
304084,
304090,
320481,
304106,
320490,
312302,
328687,
320496,
304114,
295928,
320505,
295945,
295949,
197645,
230413,
320528,
140312,
295961,
238620,
304164,
189479,
304170,
238641,
238652,
238655,
230465,
238658,
336964,
296004,
205895,
320584,
238666,
296021,
402518,
336987,
230497,
296036,
296040,
361576,
205931,
296044,
279661,
205934,
164973,
312432,
279669,
337018,
189562,
279679,
279683,
222340,
205968,
296084,
238745,
304285,
238756,
205991,
222377,
165035,
337067,
238766,
165038,
230576,
238770,
304311,
230592,
279750,
230600,
230607,
148690,
320727,
279769,
304348,
279777,
304354,
296163,
320740,
279781,
304360,
320748,
279788,
279790,
304370,
296189,
320771,
312585,
296202,
296205,
230674,
320786,
230677,
296213,
296215,
320792,
230681,
214294,
304416,
230689,
173350,
312622,
296243,
312630,
222522,
222525,
296253,
312639,
296255,
296259,
378181,
230727,
238919,
320840,
296264,
296267,
296271,
222545,
230739,
337244,
222556,
230752,
312676,
230760,
173418,
410987,
230763,
230768,
296305,
312692,
230773,
279929,
304506,
304505,
181626,
181631,
312711,
312712,
296331,
288140,
288144,
230800,
337306,
288160,
173472,
288162,
288164,
279975,
304555,
370092,
279983,
288176,
279985,
312755,
296373,
279991,
312759,
288185,
337335,
222652,
312766,
173507,
296389,
222665,
230860,
280014,
312783,
288208,
230865,
288210,
370130,
288212,
280021,
288214,
222676,
239064,
288217,
329177,
280027,
288220,
288218,
239070,
288224,
280034,
288226,
280036,
288229,
280038,
288230,
288232,
370146,
288234,
288236,
288238,
288240,
291754,
288242,
296435,
288244,
296439,
288250,
402942,
148990,
296446,
206336,
296450,
230916,
230919,
304651,
370187,
304653,
230940,
222752,
108066,
296486,
296488,
157229,
230961,
288320,
288325,
124489,
280140,
280145,
288338,
280149,
280152,
288344,
239194,
280158,
403039,
370272,
312938,
280183,
280185,
280188,
280191,
116354,
280194,
280208,
280211,
288408,
280218,
280222,
321195,
296622,
321200,
337585,
296626,
296634,
296637,
313027,
280260,
206536,
280264,
206539,
206541,
206543,
280276,
321239,
280283,
313052,
288478,
313055,
321252,
313066,
280302,
288494,
321266,
419570,
288499,
288502,
280314,
288510,
124671,
67330,
280324,
198405,
288519,
280331,
198416,
296723,
116503,
321304,
329498,
296731,
321311,
313121,
313123,
304932,
321316,
280363,
141101,
165678,
280375,
321336,
288576,
345921,
280388,
304968,
280393,
280402,
313176,
42842,
280419,
321381,
280426,
296812,
313201,
1920,
255873,
305028,
280454,
247688,
280458,
280464,
124817,
280468,
239510,
280473,
124827,
247709,
214944,
280487,
313258,
296883,
124853,
10170,
296890,
288700,
296894,
190403,
296900,
280515,
337862,
165831,
280521,
231379,
296921,
239586,
313320,
231404,
124913,
165876,
321528,
239612,
313340,
288764,
239617,
313347,
288773,
313358,
321560,
305176,
313371,
354338,
305191,
223273,
313386,
354348,
124978,
124980,
288824,
288826,
321595,
378941,
313406,
288831,
288836,
67654,
223303,
280651,
354382,
288848,
280658,
215123,
354390,
288855,
288859,
280669,
313438,
223327,
280671,
149599,
321634,
149601,
149603,
313451,
223341,
280687,
313458,
280691,
313464,
329850,
321659,
280702,
288895,
321670,
215175,
141455,
141459,
313498,
100520,
288936,
288940,
280755,
288947,
321717,
280759,
280764,
280769,
280771,
280774,
280776,
313548,
321740,
280783,
280786,
280788,
313557,
280793,
280796,
280798,
338147,
280804,
280807,
157930,
280811,
280817,
125171,
157940,
280819,
182517,
280823,
280825,
280827,
280830,
280831,
280833,
125187,
280835,
125191,
125207,
125209,
321817,
125218,
321842,
223539,
125239,
280888,
280891,
289087,
280897,
280900,
239944,
305480,
280906,
239947,
305485,
305489,
280919,
354653,
313700,
280937,
313705,
280940,
190832,
280946,
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,
240124,
281084,
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,
338532,
281190,
199273,
281196,
158317,
313973,
281210,
158347,
133776,
314003,
117398,
314007,
289436,
174754,
330404,
289448,
133801,
314029,
314033,
240309,
133817,
314047,
314051,
199364,
297671,
199367,
158409,
289493,
363234,
289513,
289522,
289525,
289532,
322303,
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,
207737,
183172,
240519,
322440,
338823,
314249,
183184,
289687,
240535,
297883,
289694,
289696,
289700,
289712,
281529,
289724,
52163,
183260,
281567,
289762,
322534,
183277,
281581,
322550,
175134,
322599,
322610,
314421,
281654,
314427,
207937,
314433,
207949,
322642,
314456,
281691,
314461,
281702,
281704,
281708,
281711,
289912,
248995,
306341,
306347,
306354,
142531,
199877,
289991,
306377,
289997,
363742,
363745,
298216,
330988,
216303,
322801,
388350,
363802,
199976,
199978,
314671,
298292,
298294,
216376,
298306,
380226,
281923,
224587,
224594,
216404,
306517,
314714,
224603,
159068,
314718,
314723,
281960,
150890,
306539,
314732,
314736,
290161,
216436,
306549,
298358,
314743,
306552,
290171,
314747,
298365,
290174,
306555,
224641,
281987,
298372,
314756,
281990,
224647,
298377,
314763,
224657,
306581,
314779,
314785,
282025,
314793,
282027,
241068,
241070,
241072,
282034,
150966,
298424,
306618,
282044,
323015,
306635,
306640,
290263,
290270,
290275,
339431,
282089,
191985,
282098,
282101,
241142,
191992,
290298,
151036,
290302,
282111,
290305,
175621,
192008,
323084,
282127,
290321,
282130,
282133,
290325,
241175,
290328,
282137,
290332,
241181,
282142,
282144,
290344,
306731,
290349,
290351,
290356,
282186,
224849,
282195,
282201,
306778,
159324,
159330,
314979,
298598,
323176,
224875,
241260,
257658,
315016,
282249,
290445,
324757,
282261,
298651,
282269,
323229,
298655,
323231,
61092,
282277,
282295,
282300,
323260,
323266,
282310,
323273,
282319,
306897,
241362,
282328,
306904,
298714,
52959,
216801,
282337,
241380,
216806,
323304,
282345,
12011,
282356,
323318,
282364,
282367,
306945,
241412,
323333,
282376,
216842,
323345,
282388,
282392,
184090,
315167,
315169,
282402,
315174,
323367,
241448,
315176,
241450,
282410,
306988,
306991,
315184,
315190,
241464,
159545,
282425,
298811,
307009,
413506,
307012,
315211,
307027,
315221,
282454,
315223,
241496,
241498,
307035,
307040,
282465,
241509,
110438,
298860,
110445,
282478,
315249,
110450,
315251,
282481,
315253,
315255,
339838,
282499,
315267,
315269,
241544,
282505,
241546,
241548,
298896,
298898,
282514,
44948,
298901,
241556,
282520,
241560,
241563,
241565,
241567,
241569,
282531,
241574,
282537,
298922,
241581,
241583,
323504,
241586,
282547,
241588,
241590,
241592,
241598,
290751,
241600,
241605,
151495,
241610,
298975,
241632,
298984,
241643,
298988,
241646,
241649,
241652,
323574,
290807,
241661,
299006,
282623,
315396,
241669,
315397,
282632,
282639,
282645,
241693,
241701,
102438,
217127,
282669,
323630,
282681,
290877,
282687,
159811,
315463,
315466,
192589,
307278,
307287,
315482,
217179,
315483,
192605,
200801,
299105,
217188,
299109,
307303,
315495,
356457,
45163,
307307,
315502,
192624,
307314,
323700,
299126,
233591,
307329,
307338,
233613,
241813,
307352,
299164,
184479,
299167,
184481,
184486,
307370,
307372,
307374,
307376,
323763,
176311,
299191,
307385,
307386,
258235,
176316,
307388,
307390,
184503,
299200,
307394,
307396,
184518,
307399,
323784,
307409,
307411,
176343,
299225,
233701,
307432,
282881,
282893,
291089,
282906,
291104,
233766,
282931,
307508,
315701,
307510,
332086,
307512,
151864,
307515,
282942,
307518,
151874,
282947,
323917,
110926,
282957,
233808,
323921,
315733,
323926,
233815,
315739,
299357,
242018,
242024,
299373,
315757,
250231,
242043,
315771,
299391,
291202,
299398,
242057,
291212,
299405,
291222,
283033,
291226,
242075,
315801,
291231,
283042,
291238,
291241,
127403,
127405,
291247,
127407,
299440,
299444,
127413,
283062,
291254,
127417,
291260,
283069,
127421,
127424,
299457,
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,
233998,
234003,
234006,
152087,
127511,
283161,
242202,
234010,
135707,
242206,
135710,
242208,
291361,
291378,
234038,
152118,
234041,
70213,
242250,
111193,
242275,
299620,
242279,
168562,
184952,
135805,
291456,
135808,
373383,
135820,
316051,
225941,
316054,
299672,
135834,
373404,
299677,
135839,
299680,
225954,
299684,
242343,
209576,
242345,
373421,
135870,
135873,
135876,
135879,
299720,
299723,
225998,
299726,
226002,
119509,
226005,
226008,
201444,
299750,
283368,
234219,
283372,
381677,
226037,
283382,
234231,
316151,
234236,
226045,
234239,
242431,
209665,
234242,
299778,
242436,
226053,
234246,
226056,
234248,
291593,
242443,
234252,
242445,
234254,
291601,
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,
234373,
226182,
234375,
226185,
308105,
234379,
234384,
234388,
234390,
324504,
234393,
209818,
308123,
324508,
226200,
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,
234446,
275406,
234449,
316370,
234452,
234455,
234459,
234461,
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,
242777,
275545,
234590,
234593,
234595,
300133,
234597,
234601,
300139,
234605,
234607,
160879,
275569,
234610,
300148,
234614,
398455,
234618,
144506,
275579,
234620,
234623,
226433,
234627,
275588,
234629,
242822,
234634,
275594,
234636,
177293,
234640,
275602,
234643,
226453,
275606,
234647,
275608,
308373,
234650,
234648,
308379,
234653,
324766,
119967,
283805,
234657,
300189,
324768,
242852,
234661,
283813,
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,
243003,
283963,
226628,
283973,
300357,
283983,
316758,
357722,
316766,
292192,
316768,
218464,
292197,
316774,
284010,
136562,
324978,
275834,
275836,
275840,
316803,
316806,
316811,
316814,
226703,
300433,
234899,
226709,
357783,
316824,
316826,
144796,
300448,
144807,
144810,
144812,
284076,
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,
284191,
284194,
284196,
235045,
284199,
284204,
284206,
284209,
284211,
284213,
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,
243290,
284251,
284253,
300638,
284255,
284258,
292452,
292454,
284263,
284265,
292458,
284267,
292461,
284272,
284274,
276086,
284278,
292470,
292473,
284283,
276093,
284286,
276095,
284288,
292481,
284290,
325250,
284292,
276098,
292479,
292485,
284297,
317066,
284299,
317068,
276109,
284301,
284303,
276114,
284306,
284308,
284312,
284314,
276122,
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,
358126,
276206,
358128,
284399,
358133,
358135,
276216,
358140,
284413,
358142,
358146,
317187,
284418,
317189,
317191,
284428,
300816,
300819,
317207,
284440,
300828,
300830,
276255,
325408,
284449,
300834,
300832,
317221,
227109,
358183,
276268,
300845,
194351,
243504,
284469,
276280,
325436,
276291,
366406,
276295,
153417,
276308,
284502,
317271,
276315,
292700,
284511,
227175,
292715,
300912,
284529,
292721,
300915,
292729,
317306,
284540,
292734,
325512,
276365,
284564,
358292,
284566,
350106,
284572,
276386,
284579,
276388,
358312,
284585,
317353,
276395,
292784,
276402,
161718,
358326,
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,
317435,
276476,
276479,
276482,
276485,
317446,
276490,
292876,
276496,
317456,
317458,
243733,
243740,
317468,
317472,
325666,
243751,
292904,
276528,
243762,
309298,
325685,
325689,
235579,
325692,
235581,
276539,
178238,
276544,
284739,
292934,
243785,
276553,
350293,
350295,
194649,
227418,
309337,
350302,
227423,
194654,
178273,
194657,
276579,
227426,
194660,
227430,
276583,
309346,
309348,
309350,
309352,
309354,
350308,
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,
350375,
350379,
350381,
350383,
129200,
350385,
350387,
350389,
350395,
350397,
350399,
227520,
350402,
227522,
301252,
350406,
227529,
309450,
301258,
276685,
276689,
309462,
301272,
309468,
309471,
301283,
317672,
276713,
317674,
325867,
227571,
309491,
276725,
309494,
243960,
276735,
227583,
227587,
276739,
276742,
227593,
227596,
325910,
309530,
342298,
276766,
211232,
317729,
276775,
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,
227738,
317853,
276896,
317858,
342434,
285093,
317864,
285098,
276907,
235955,
276917,
293304,
293307,
293314,
309707,
317910,
293336,
235996,
317917,
293343,
358880,
276961,
227810,
293346,
276964,
293352,
236013,
293364,
301562,
317951,
309764,
301575,
121352,
236043,
342541,
113167,
317971,
309779,
309781,
277011,
227877,
227879,
293417,
227882,
309804,
293421,
105007,
236082,
277054,
129603,
318020,
301636,
301639,
301643,
277071,
285265,
399955,
309844,
277080,
309849,
285277,
285282,
326244,
318055,
277100,
121458,
277106,
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,
277187,
277191,
277194,
277196,
277201,
137946,
113378,
228069,
277223,
342760,
285417,
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,
301884,
310080,
293696,
277314,
277317,
277322,
277329,
301911,
277337,
301913,
301921,
400236,
236397,
162671,
310134,
15224,
236408,
277368,
416639,
416640,
113538,
416648,
39817,
187274,
277385,
301972,
424853,
277405,
277411,
310179,
293798,
293802,
236460,
277426,
293811,
293820,
203715,
276586,
293849,
293861,
228327,
228328,
228330,
318442,
228332,
277486,
326638,
318450,
293876,
293877,
285686,
302073,
285690,
121850,
302075,
244731,
293882,
293887,
277504,
277507,
138246,
277511,
277519,
293908,
277526,
293917,
293939,
277561,
277564,
310336,
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,
384148,
162964,
187542,
302231,
285849,
302233,
285852,
302237,
285854,
285856,
302241,
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,
228606,
64768,
310531,
285958,
138505,
228617,
318742,
277798,
130345,
113964,
285997,
285999,
113969,
277811,
318773,
318776,
277816,
286010,
417086,
277822,
286016,
294211,
302403,
277832,
384328,
277836,
294221,
326991,
294223,
277839,
277850,
179547,
277853,
146784,
277857,
302436,
294246,
327015,
310632,
327017,
351594,
351607,
310648,
310651,
277888,
310657,
351619,
294276,
310659,
277892,
327046,
253320,
310665,
318858,
277898,
277903,
310672,
351633,
277905,
277908,
277917,
310689,
277921,
277923,
130468,
228776,
277932,
310703,
277937,
310710,
130486,
310712,
310715,
302526,
228799,
277953,
64966,
245191,
163272,
302534,
310727,
277959,
302541,
277966,
302543,
310737,
277975,
228825,
163290,
310749,
277981,
310755,
277989,
187880,
310764,
286188,
278003,
310772,
212472,
278009,
40443,
286203,
40448,
228864,
286214,
228871,
302603,
65038,
302614,
286233,
302617,
302621,
146977,
187939,
294435,
286246,
294439,
286248,
278057,
294440,
294443,
294445,
310831,
40499,
212538,
40507,
228933,
286283,
40525,
212560,
228944,
400976,
147032,
40537,
40539,
278109,
40550,
286312,
286313,
40554,
310892,
40557,
188022,
294521,
343679,
278150,
310925,
286354,
278163,
122517,
278168,
327333,
229030,
278188,
278192,
319153,
278196,
302781,
319171,
302789,
294599,
278216,
294601,
302793,
343757,
212690,
278227,
286420,
319187,
229076,
286425,
319194,
278235,
278238,
229086,
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,
188252,
237409,
294776,
294785,
327554,
40851,
294811,
319390,
237470,
294817,
319394,
40865,
311209,
180142,
294831,
188340,
40886,
294844,
294847,
393177,
294876,
294879,
294883,
311279,
278513,
237555,
278516,
311283,
278519,
237562
] |
de05f28fe06a3df446fba66604017c7627e0c391
|
5d4e4c8349524742af906a26976577dbf67f5e6e
|
/TacoPOP/ReusableView.swift
|
efa8803cc07b5c4b78eb97fbc0a9c6d094b730c6
|
[] |
no_license
|
winedarksea1/TacoPop
|
c10f44c76cbcbf5ccb7451fd7264ec63e725db21
|
8adc4861de0d497d101f7471e9047bbf216faee0
|
refs/heads/master
| 2021-08-23T17:33:09.327565 | 2017-12-05T22:30:15 | 2017-12-05T22:30:15 | 113,240,007 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 328 |
swift
|
//
// ReusableView.swift
// TacoPOP
//
// Created by Andrew McGovern on 12/5/17.
// Copyright © 2017 Andrew McGovern. All rights reserved.
//
import UIKit
protocol ReusableView: class {}
extension ReusableView where Self: UIView {
static var reuseIdentifier: String {
return String(describing: self)
}
}
|
[
-1
] |
c2998a9e22e8bf68984b34e9f8f8ec329471a7d2
|
42df66d2d380438b3a5164d4d0e00bb270a94a9d
|
/StripeFinancialConnections/StripeFinancialConnections/Source/Native/Success/SuccessAccountListView.swift
|
eb173e531f47bb55b22c7626224de236471290a9
|
[
"MIT"
] |
permissive
|
stripe/stripe-ios
|
2472a3a693a144d934e165058c07593630439c9e
|
dd9e4b4c4bf7cceffc8ba661cbe2ec2430b3ce4a
|
refs/heads/master
| 2023-08-31T20:29:56.708961 | 2023-08-31T17:53:57 | 2023-08-31T17:53:57 | 6,656,911 | 1,824 | 1,005 |
MIT
| 2023-09-14T21:39:48 | 2012-11-12T16:55:08 |
Swift
|
UTF-8
|
Swift
| false | false | 4,538 |
swift
|
//
// SuccessAccountListView.swift
// StripeFinancialConnections
//
// Created by Krisjanis Gaidis on 8/16/22.
//
import Foundation
@_spi(STP) import StripeUICore
import UIKit
final class SuccessAccountListView: UIView {
private let maxNumberOfAccountsListedBeforeShowingOnlyAccountCount = 4
init(institution: FinancialConnectionsInstitution, linkedAccounts: [FinancialConnectionsPartnerAccount]) {
super.init(frame: .zero)
let accountListView: UIView
if linkedAccounts.count > maxNumberOfAccountsListedBeforeShowingOnlyAccountCount {
accountListView = CreateAccountCountView(institution: institution, numberOfAccounts: linkedAccounts.count)
} else {
accountListView = CreateAccountListView(institution: institution, accounts: linkedAccounts)
}
addAndPinSubview(accountListView)
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
private func CreateAccountCountView(institution: FinancialConnectionsInstitution, numberOfAccounts: Int) -> UIView {
let numberOfAccountsLabel = AttributedLabel(
font: .label(.mediumEmphasized),
textColor: .textSecondary
)
numberOfAccountsLabel.textAlignment = .right
numberOfAccountsLabel.text = String(
format: STPLocalizedString(
"%d accounts",
"An textual description of how many bank accounts user has successfully connected (or linked). Once the bank accounts are connected (or linked), the user will be able to use those bank accounts for payments. %d will be replaced by the number of accounts connected (or linked)."
),
numberOfAccounts
)
let horizontalStackView = UIStackView(
arrangedSubviews: [
CreateIconWithLabelView(institution: institution, text: institution.name),
numberOfAccountsLabel,
]
)
horizontalStackView.axis = .horizontal
horizontalStackView.distribution = .fillProportionally
horizontalStackView.spacing = 8
return horizontalStackView
}
private func CreateAccountListView(
institution: FinancialConnectionsInstitution,
accounts: [FinancialConnectionsPartnerAccount]
) -> UIView {
let accountRowVerticalStackView = UIStackView(
arrangedSubviews: accounts.map { account in
CreateAccountRowView(institution: institution, account: account)
}
)
accountRowVerticalStackView.axis = .vertical
accountRowVerticalStackView.spacing = 16
return accountRowVerticalStackView
}
private func CreateAccountRowView(
institution: FinancialConnectionsInstitution,
account: FinancialConnectionsPartnerAccount
) -> UIView {
let horizontalStackView = UIStackView()
horizontalStackView.axis = .horizontal
horizontalStackView.spacing = 8
horizontalStackView.addArrangedSubview(
CreateIconWithLabelView(
institution: institution,
text: account.name
)
)
if let displayableAccountNumbers = account.displayableAccountNumbers {
let displayableAccountNumberLabel = AttributedLabel(
font: .label(.mediumEmphasized),
textColor: .textSecondary
)
displayableAccountNumberLabel.text = "••••\(displayableAccountNumbers)"
// compress `account.name` instead of account number if text is long
displayableAccountNumberLabel.setContentCompressionResistancePriority(.defaultHigh, for: .horizontal)
horizontalStackView.addArrangedSubview(displayableAccountNumberLabel)
}
return horizontalStackView
}
private func CreateIconWithLabelView(institution: FinancialConnectionsInstitution, text: String) -> UIView {
let institutionIconView = InstitutionIconView(size: .small)
institutionIconView.setImageUrl(institution.icon?.default)
let label = AttributedLabel(
font: .label(.mediumEmphasized),
textColor: .textPrimary
)
label.text = text
label.translatesAutoresizingMaskIntoConstraints = false
label.setContentHuggingPriority(.defaultHigh, for: .horizontal)
// compress `account.name` instead of account number if text is long
label.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
let horizontalStackView = UIStackView(
arrangedSubviews: [
institutionIconView,
label,
]
)
horizontalStackView.axis = .horizontal
horizontalStackView.spacing = 8
return horizontalStackView
}
|
[
-1
] |
cc7db56d3458b7ade1bf28dfc164073d2d54d7ce
|
529097116f0a3db1ca90a87d7249fd6677552760
|
/BrainGain5/BrainGain5/TaskController.swift
|
6919aabc0eb5aa2091e3fbe028aaa33ed4f56a39
|
[] |
no_license
|
pateld38/coursework-7241707
|
88098cf0d4dc4c2a232d33e42b58d5abba7201ba
|
91549cbe4b4077724cb13d75d21f79adec369ebf
|
refs/heads/master
| 2020-04-11T09:59:23.239131 | 2018-12-13T21:54:49 | 2018-12-13T21:54:49 | 161,698,873 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,685 |
swift
|
//
// TaskController.swift
// BrainGain5
//
// Created by Dhruv Patel on 13/12/2018.
// Copyright © 2018 Dhruv Patel. All rights reserved.
//
import UIKit
class TaskController: UITableViewController {
var items:[String] = []
@IBAction func editM(_ sender: UIBarButtonItem) {
self.isEditing = !self.isEditing
print("editmode: \(self.isEditing)")
if self.isEditing {
sender.title = "Done"
} else {
sender.title = "Edit"
}
}
@IBAction func Add(_ sender: UIBarButtonItem) {
print("Add")
let alert = UIAlertController(title: "New Task", message: "Enter Task Below", preferredStyle: .alert)
alert.addTextField(configurationHandler: nil)
alert.addAction(UIAlertAction(title: "Add", style: .default,handler: { action in
if let textFields = alert.textFields {
if let item = textFields[0].text {
print(item)
self.items.append(item)
print(self.items)
DispatchQueue.main.async {
self.tableView.reloadData()
}
}
}
}))
alert.addAction(UIAlertAction(title: "Cancel", style: .cancel, handler: nil))
self.present(alert, animated: true, completion: nil)
}
override func viewDidLoad() {
super.viewDidLoad()
}
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return self.items.count
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "TaskItem", for: indexPath)
if let label = cell.textLabel {
label.text = self.items[indexPath.row]
}
return cell
}
override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath) {
items.remove(at: indexPath.row)
tableView.reloadData()
}
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath)
{
if tableView.cellForRow(at: indexPath)?.accessoryType == UITableViewCell.AccessoryType.checkmark
{
tableView.cellForRow(at: indexPath)?.accessoryType = UITableViewCell.AccessoryType.none
}
else
{
tableView.cellForRow(at: indexPath)?.accessoryType = UITableViewCell.AccessoryType.checkmark
}
}
}
|
[
-1
] |
ef46747f8f46726a67253cee585cec7560b796d5
|
0b325017944af3d6192893c3da04c9f96a4f6e76
|
/SnapchatClone/Controllers/LoginVC/LoginVC.swift
|
556fef5ab4ae42b7ba18eb42186565b8fc11adc5
|
[] |
no_license
|
tylerreinecke/SnapchatClone-MDB
|
aaf2367353f68c370bce1087ed9ac9c4e7f7646a
|
de96a59eb0495a803bbb9da177aadea921c081c3
|
refs/heads/master
| 2020-04-24T20:59:10.351313 | 2019-02-23T20:48:50 | 2019-02-23T20:48:50 | 172,262,371 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 6,735 |
swift
|
//
// LoginVC.swift
// SnapchatClone
//
// Created by Max Miranda on 9/18/18.
// Copyright © 2018 ___MaxAMiranda___. All rights reserved.
//
import UIKit
import Firebase
import FirebaseAuth
class LoginVC: UIViewController {
var logoImageView: UIImageView!
var loginRegisterSegControl: UISegmentedControl!
var nameTextField: UITextField!
var phoneNumberTextField: UITextField!
var emailTextField: UITextField!
var passwordTextField: UITextField!
var loginRegisterButton: UIButton!
var ourUserID: String!
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = UIColor(r: 255, g: 254, b: 0)
setupLogo()
setupSegControl()
setupLoginRegisterButton()
setupTextFields()
}
override func viewWillAppear(_ animated: Bool) {
navigationController?.navigationBar.isHidden = true
loginRegisterButton.isUserInteractionEnabled = true
}
override func viewWillDisappear(_ animated: Bool) {
navigationController?.navigationBar.isHidden = false
}
@objc func handleLoginOrRegister() {
loginRegisterButton.isUserInteractionEnabled = false
if loginRegisterSegControl.selectedSegmentIndex == 0 {
handleLogin()
} else {
handleRegister()
}
}
func handleLogin() {
var email = "[email protected]"
var password = "ImMrMeeseeks"
/* PART 1A START*/
if emailTextField.text == "" {
self.loginRegisterButton.isUserInteractionEnabled = true
displayAlert(title: "Information Missing", message: "No Email Entered")
return
}
if passwordTextField.text == "" {
self.loginRegisterButton.isUserInteractionEnabled = true
displayAlert(title: "Information Missing", message: "No Password Entered")
return
}
if let tempEmail = emailTextField.text {
email = tempEmail
}
if let tempPass = passwordTextField.text {
password = tempPass
}
/* PART 1A FINISH*/
Auth.auth().signIn(withEmail: email, password: password, completion: { (user, error) in
if let error = error {
self.loginRegisterButton.isUserInteractionEnabled = true
print(error)
self.displayAlert(title: "There was an error", message: "Trying to sign you in")
return
} else {
self.ourUserID = user?.uid
self.performSegue(withIdentifier: "toMainFeed", sender: self)
}
})
}
func handleRegister() {
var name = "Rick Morty"
var number = "6969696969"
var email = "[email protected]"
var password = "ImMrMeeseeks"
/* PART 1B START*/
if nameTextField.text == "" {
self.loginRegisterButton.isUserInteractionEnabled = true
displayAlert(title: "Information Missing", message: "No Name Entered")
return
}
if phoneNumberTextField.text == "" {
self.loginRegisterButton.isUserInteractionEnabled = true
displayAlert(title: "Information Missing", message: "No Phone Number Entered")
return
}
if emailTextField.text == "" {
self.loginRegisterButton.isUserInteractionEnabled = true
displayAlert(title: "Information Missing", message: "No Email Entered")
return
}
if passwordTextField.text == "" {
self.loginRegisterButton.isUserInteractionEnabled = true
displayAlert(title: "Information Missing", message: "No Password Entered")
return
}
if let tempName = nameTextField.text {
name = tempName
}
if let tempNum = phoneNumberTextField.text {
number = tempNum
}
if let tempEmail = emailTextField.text {
email = tempEmail
}
if let tempPass = passwordTextField.text {
password = tempPass
}
/* PART 1B FINISH*/
Auth.auth().createUser(withEmail: email, password: password, completion: { (user, error) in
if let error = error {
self.loginRegisterButton.isUserInteractionEnabled = true
print(error)
self.displayAlert(title: "There was an error", message: "Trying to make you")
return
} else {
guard let uid = user?.uid else {
return
}
let ref = Database.database().reference()
let userRef = ref.child("users").child(uid)
let values = ["name": name, "number": number, "email": email]
userRef.updateChildValues(values, withCompletionBlock: { (error, ref) in
if error != nil {
print(error)
return
} else {
self.ourUserID = user?.uid
self.performSegue(withIdentifier: "toMainFeed", sender: self)
}
})
}
})
}
func displayAlert(title: String, message: String) {
let alert = UIAlertController(title: title, message: message, preferredStyle: .alert)
let defaultAction = UIAlertAction(title: "OK", style: .default, handler: nil)
alert.addAction(defaultAction)
self.present(alert, animated: true, completion: nil)
}
@objc func handleLoginRegisterChange() {
let index = loginRegisterSegControl.selectedSegmentIndex
let title = loginRegisterSegControl.titleForSegment(at: index)
loginRegisterButton.setTitle(title, for: UIControlState())
if title == "Login" {
nameTextField.isHidden = true
phoneNumberTextField.isHidden = true
} else {
nameTextField.isHidden = false
phoneNumberTextField.isHidden = false
}
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
/* PART 1C START*/
if segue.identifier == "toMainFeed" {
let destination = segue.destination as! FeedVC
destination.userID = ourUserID
}
/* PART 1C FINISH*/
}
}
extension UIColor {
convenience init(r: CGFloat, g: CGFloat, b: CGFloat) {
self.init(red: r/255, green: g/255, blue: b/255, alpha: 1)
}
}
|
[
-1
] |
055b5354572ab5018101fa6ad965e95b89022c9a
|
ebf534ac11e4f3fd4c0916a62b4254ce225f2895
|
/Sources/ArgumentParser/ArgumentProtocol.swift
|
2c7604414cbb305f912888780381a0dba81645ec
|
[] |
no_license
|
kojirou1994/ArgumentParser
|
558bcf8963315f26af677f135c6214deff3de4db
|
276cd93847a0a3dd1d36281ad61aec0c8892b798
|
refs/heads/master
| 2020-05-06T13:47:38.502732 | 2019-10-30T10:21:47 | 2019-10-30T10:21:47 | 180,156,446 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 48 |
swift
|
public protocol ArgumentProtocol {
init()
}
|
[
-1
] |
783bc3917e3ad6cd147ad1aabcb7f0b15b17bc55
|
ca4ad611419c50205f2953534276e15fe08c3ad8
|
/Magical Grid/AppDelegate.swift
|
cfa4ef3c13b8e9164d50a6d8c83a272c7f55a4bd
|
[] |
no_license
|
zkkn/MagicalGrid
|
745e27a5071fa1d102cc64d47ea124f5a35bb437
|
d06869e093617928275f3167b4f359abe6420345
|
refs/heads/master
| 2021-07-04T16:09:43.469361 | 2017-09-28T16:04:04 | 2017-09-28T16:04:04 | 105,018,680 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,405 |
swift
|
//
// AppDelegate.swift
// Magical Grid
//
// Created by Shoichi Kanzaki on 2017/09/27.
// Copyright © 2017年 mycompany. 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.
window = UIWindow(frame: UIScreen.main.bounds)
window?.makeKeyAndVisible()
let initialViewController = ViewController()
window?.rootViewController = initialViewController
return true
}
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}
func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
}
|
[
229380,
229383,
229385,
294924,
229388,
229391,
327695,
229394,
229397,
229399,
229402,
278556,
229405,
229408,
294950,
229415,
229417,
327722,
237613,
229422,
360496,
229426,
237618,
229428,
311349,
286774,
286776,
319544,
286778,
229432,
204856,
286791,
237640,
286797,
278605,
311375,
163920,
237646,
196692,
319573,
311383,
319590,
311400,
278635,
303212,
278639,
131192,
237693,
303230,
327814,
303241,
131209,
417930,
303244,
311436,
319633,
286873,
286876,
311460,
311469,
32944,
327862,
286906,
327866,
180413,
286910,
131264,
286916,
286922,
286924,
286926,
319694,
286928,
131281,
278743,
278747,
295133,
155872,
319716,
237807,
303345,
286962,
303347,
131314,
229622,
327930,
278781,
278783,
278785,
237826,
319751,
278792,
286987,
319757,
311569,
286999,
319770,
287003,
287006,
287009,
287012,
287014,
287016,
287019,
311598,
287023,
270640,
311601,
262448,
295220,
287032,
155966,
319809,
319810,
278849,
319814,
311623,
319818,
311628,
229709,
319822,
287054,
278865,
229717,
196963,
196969,
139638,
213367,
106872,
319872,
311683,
319879,
311693,
65938,
65943,
319898,
311719,
278952,
139689,
278957,
311728,
278967,
180668,
311741,
278975,
319938,
278980,
98756,
278983,
319945,
278986,
319947,
278990,
278994,
311767,
279003,
279006,
188895,
172512,
287202,
279010,
279015,
172520,
319978,
279020,
172526,
311791,
279023,
172529,
279027,
319989,
172534,
180727,
164343,
279035,
311804,
287230,
279040,
303617,
287234,
279045,
172550,
303623,
172552,
320007,
287238,
279051,
172558,
279055,
303632,
279058,
303637,
279063,
279067,
172572,
279072,
172577,
295459,
172581,
295461,
279082,
311850,
279084,
172591,
172598,
279095,
172607,
172609,
172612,
377413,
172614,
213575,
172618,
303690,
33357,
287309,
303696,
279124,
172634,
262752,
172644,
311911,
189034,
295533,
172655,
172656,
352880,
295538,
189039,
172660,
287349,
189040,
189044,
287355,
287360,
295553,
172675,
295557,
311942,
303751,
287365,
352905,
311946,
287371,
279178,
311951,
287377,
172691,
287381,
311957,
221850,
287386,
230045,
172702,
303773,
164509,
172705,
287394,
172707,
303780,
287390,
287398,
205479,
287400,
279208,
172714,
295595,
279212,
189102,
172721,
287409,
66227,
303797,
189114,
287419,
303804,
328381,
287423,
328384,
172737,
279231,
287427,
312006,
107208,
172748,
287436,
107212,
172751,
287440,
295633,
172755,
303827,
279255,
172760,
287450,
303835,
418523,
189149,
303838,
279258,
213724,
312035,
279267,
295654,
279272,
230128,
312048,
312050,
230131,
205564,
303871,
230146,
328453,
295685,
230154,
33548,
312077,
295695,
295701,
230169,
369433,
295707,
328476,
295710,
230175,
295720,
303914,
279340,
205613,
279353,
230202,
312124,
328508,
222018,
295755,
377676,
148302,
287569,
303959,
230237,
279390,
230241,
279394,
303976,
336744,
303981,
303985,
303987,
328563,
279413,
303991,
303997,
295806,
295808,
295813,
304005,
320391,
304007,
304009,
213895,
304011,
230284,
304013,
295822,
279438,
189329,
295825,
304019,
189331,
58262,
304023,
304027,
279452,
410526,
279461,
279462,
140202,
213931,
304042,
230327,
304055,
287675,
197564,
230334,
304063,
238528,
304065,
213954,
295873,
156612,
189378,
213963,
197580,
312272,
304084,
304090,
320481,
304106,
320490,
312302,
328687,
320496,
304114,
295928,
320505,
312321,
295945,
230413,
197645,
295949,
320528,
140312,
295961,
238620,
197663,
304164,
304170,
304175,
238641,
312374,
238652,
238655,
230465,
238658,
336964,
296004,
205895,
320584,
238666,
296021,
402518,
336987,
230497,
296036,
296040,
361576,
205931,
296044,
164973,
205934,
312432,
279669,
304249,
337018,
189562,
279679,
304258,
279683,
222340,
205968,
296084,
238745,
304285,
238756,
205991,
222377,
337067,
165035,
238766,
165038,
230576,
238770,
304311,
230592,
312518,
279750,
230600,
230607,
148690,
320727,
279769,
304348,
279777,
304354,
296163,
320740,
279781,
304360,
320748,
279788,
279790,
304370,
296189,
320771,
312585,
296202,
296205,
230674,
320786,
230677,
296213,
296215,
320792,
230681,
214294,
304416,
230689,
173350,
312622,
296243,
312630,
222522,
296253,
230718,
296255,
312639,
222525,
296259,
378181,
230727,
238919,
296264,
320840,
296267,
296271,
222545,
230739,
312663,
222556,
337244,
230752,
312676,
230760,
173418,
148843,
230763,
410987,
230768,
296305,
312692,
230773,
304505,
304506,
181626,
181631,
148865,
312711,
312712,
296331,
288140,
288144,
230800,
304533,
337306,
288154,
173472,
288160,
288162,
288164,
279975,
304555,
370092,
279983,
173488,
288176,
279985,
312755,
296373,
312759,
279991,
288185,
337335,
222652,
312766,
173507,
296389,
222665,
230860,
312783,
288208,
230865,
288210,
370130,
222676,
280021,
288212,
288214,
239064,
329177,
288217,
288218,
280027,
288220,
239070,
288224,
288226,
370146,
280036,
288229,
280038,
288230,
288232,
280034,
288234,
320998,
288236,
288238,
288240,
288242,
296435,
288244,
288250,
296446,
321022,
402942,
206336,
296450,
148990,
230916,
230919,
214535,
230923,
304651,
304653,
370187,
230940,
222752,
108066,
296486,
296488,
157229,
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,
321195,
296622,
321200,
337585,
296626,
296634,
296637,
313027,
280260,
206536,
280264,
206539,
206541,
206543,
313044,
280276,
321239,
280283,
313052,
288478,
313055,
321252,
313066,
288494,
280302,
280304,
313073,
321266,
288499,
419570,
288502,
288510,
124671,
67330,
280324,
198405,
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,
313171,
313176,
280419,
321381,
296809,
296812,
313201,
1920,
255873,
305028,
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,
411601,
231379,
296921,
239586,
313320,
231404,
124913,
165876,
321528,
239612,
313340,
288764,
239617,
313347,
288773,
313358,
305176,
313371,
354338,
305191,
223273,
313386,
354348,
124978,
215090,
124980,
288824,
288826,
321595,
378941,
313406,
288831,
288836,
67654,
280651,
354382,
288848,
280658,
215123,
354390,
288855,
288859,
280669,
313438,
149599,
280671,
149601,
321634,
149603,
223327,
329830,
280681,
313451,
223341,
280687,
149618,
215154,
313458,
280691,
313464,
329850,
321659,
280702,
288895,
321670,
215175,
141446,
141455,
141459,
280725,
313498,
275608,
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,
182517,
280823,
280825,
280827,
280830,
280831,
280833,
125187,
280835,
125191,
125207,
125209,
321817,
125218,
321842,
223539,
125239,
305464,
280888,
280891,
289087,
108865,
280897,
280900,
305480,
239944,
280906,
239947,
305485,
305489,
379218,
280919,
354653,
313700,
313705,
280937,
190832,
280946,
223606,
313720,
280956,
280959,
313731,
199051,
240011,
289166,
240017,
297363,
190868,
240021,
297365,
297368,
297372,
141725,
297377,
289186,
297391,
289201,
240052,
289207,
289210,
305594,
281024,
289218,
289221,
289227,
281045,
281047,
166378,
305647,
281075,
174580,
240124,
281084,
305662,
305664,
240129,
305666,
305668,
223749,
240132,
281095,
223752,
150025,
338440,
223757,
281102,
223763,
223765,
281113,
322074,
281116,
281121,
182819,
281127,
150066,
158262,
158266,
289342,
281154,
322115,
158283,
281163,
281179,
338528,
338532,
281190,
199273,
281196,
19053,
158317,
313973,
297594,
281210,
158347,
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,
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,
289687,
240535,
297883,
289694,
289696,
289700,
289712,
281529,
289724,
52163,
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,
248995,
306341,
306344,
306347,
322734,
306354,
142531,
199877,
289991,
306377,
289997,
249045,
290008,
363742,
363745,
298216,
330988,
126190,
216303,
322801,
388350,
257302,
363802,
199976,
199978,
314671,
298292,
298294,
257334,
216376,
380226,
298306,
224584,
224587,
224594,
216404,
306517,
150870,
314714,
224603,
159068,
314718,
265568,
314723,
281960,
150890,
306539,
314732,
314736,
290161,
216436,
306549,
298358,
314743,
306552,
290171,
314747,
306555,
290174,
298365,
224641,
281987,
298372,
314756,
265604,
224647,
281990,
298377,
314763,
298381,
142733,
314768,
224657,
306581,
314773,
314779,
314785,
314793,
282025,
282027,
241068,
241070,
241072,
282034,
241077,
150966,
298424,
306618,
282044,
323015,
306635,
306640,
290263,
290270,
290275,
339431,
282089,
191985,
282098,
290291,
282101,
241142,
191992,
290298,
151036,
290302,
282111,
290305,
175621,
306694,
192008,
323084,
257550,
290321,
323090,
282130,
290325,
282133,
241175,
290328,
282137,
290332,
241181,
282142,
282144,
290344,
306731,
290349,
290351,
290356,
282186,
224849,
282195,
282199,
282201,
306778,
159324,
159330,
314979,
298598,
323176,
224875,
241260,
323181,
257658,
315016,
282249,
290445,
282261,
298651,
282269,
323229,
298655,
323231,
61092,
282277,
306856,
282295,
282300,
323260,
323266,
282310,
323273,
282319,
306897,
241362,
306904,
282328,
298714,
52959,
282337,
216801,
241380,
216806,
323304,
282345,
12011,
282356,
323318,
282364,
282367,
306945,
241412,
323333,
282376,
216842,
323345,
282388,
323349,
282392,
184090,
315167,
315169,
282402,
315174,
323367,
241448,
315176,
241450,
282410,
306988,
306991,
315184,
323376,
315190,
241464,
159545,
282425,
298811,
118593,
307009,
413506,
307012,
241475,
298822,
148946,
315211,
282446,
307027,
315221,
323414,
315223,
241496,
241498,
307035,
307040,
110433,
282465,
241509,
110438,
298860,
110445,
282478,
315249,
282481,
110450,
315251,
315253,
315255,
339838,
315267,
282499,
315269,
241544,
282505,
241546,
241548,
298896,
298898,
282514,
241556,
298901,
241560,
282520,
241563,
241565,
241567,
241569,
241574,
282537,
298922,
36779,
241581,
282542,
241583,
323504,
241586,
290739,
241588,
282547,
241590,
241592,
241598,
290751,
241600,
241605,
151495,
241610,
298975,
241632,
298984,
241640,
241643,
298988,
241646,
241649,
241652,
323574,
290807,
299003,
241661,
299006,
282623,
315396,
241669,
315397,
282632,
282639,
290835,
282645,
241693,
282654,
241701,
102438,
217127,
282669,
323630,
282681,
290877,
282687,
159811,
315463,
315466,
192589,
307278,
192596,
176213,
307287,
307290,
217179,
315482,
192605,
315483,
233567,
299105,
200801,
217188,
299109,
307303,
315495,
356457,
45163,
307307,
315502,
192624,
307314,
323700,
299126,
233591,
299136,
307329,
315524,
307338,
233613,
241813,
307352,
299164,
299167,
315552,
184479,
184481,
315557,
184486,
307370,
307372,
184492,
307374,
307376,
323763,
184503,
299191,
307385,
176311,
258235,
307388,
176316,
307390,
307386,
299200,
184512,
307394,
299204,
307396,
184518,
307399,
323784,
233679,
307409,
307411,
176343,
299225,
233701,
307432,
184572,
282881,
184579,
184586,
282893,
323854,
291089,
282906,
291104,
233766,
299304,
295583,
176435,
307508,
315701,
332086,
307510,
307512,
168245,
307515,
307518,
282942,
282947,
323917,
110926,
282957,
233808,
323921,
315733,
323926,
233815,
315739,
323932,
299357,
242018,
242024,
299373,
315757,
250231,
242043,
315771,
299388,
299391,
291202,
299398,
242057,
291212,
299405,
291222,
315801,
291226,
242075,
283033,
61855,
291231,
283042,
291238,
291241,
127403,
127405,
291247,
299440,
127407,
299444,
127413,
291254,
283062,
127417,
291260,
127421,
127424,
299457,
127429,
127431,
127434,
315856,
127440,
176592,
315860,
176597,
127447,
283095,
299481,
127449,
176605,
242143,
127455,
127457,
291299,
127463,
242152,
291305,
127466,
176620,
127469,
127474,
291314,
291317,
127480,
135672,
291323,
233979,
127485,
291330,
127490,
127494,
283142,
127497,
233994,
135689,
127500,
291341,
233998,
127506,
234003,
127509,
234006,
127511,
152087,
283161,
242202,
135707,
234010,
135710,
242206,
242208,
291361,
242220,
291378,
234038,
152118,
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,
299706,
135870,
135873,
135876,
135879,
299720,
299723,
299726,
225998,
226002,
119509,
226005,
226008,
299740,
242396,
201444,
299750,
283368,
234219,
283372,
226037,
283382,
316151,
234231,
234236,
226045,
242431,
234239,
209665,
299778,
234242,
242436,
234246,
226056,
291593,
234248,
242443,
234252,
242445,
234254,
291601,
234258,
242450,
242452,
234261,
348950,
201496,
234264,
234266,
234269,
283421,
234272,
234274,
152355,
299814,
234278,
283432,
234281,
234284,
234287,
283440,
185138,
242483,
234292,
234296,
234298,
160572,
283452,
234302,
234307,
242499,
234309,
316233,
234313,
316235,
234316,
283468,
234319,
242511,
234321,
234324,
185173,
201557,
234329,
185180,
234333,
308063,
234336,
242530,
349027,
234338,
234341,
234344,
234347,
177004,
234350,
324464,
234353,
152435,
177011,
234356,
234358,
234362,
234364,
291711,
234368,
291714,
201603,
291716,
234373,
234370,
226182,
234375,
308105,
324490,
226185,
234379,
234384,
234388,
234390,
324504,
234393,
209818,
308123,
234396,
324508,
291742,
226200,
234401,
291747,
291748,
234405,
291750,
324518,
324520,
234407,
324522,
291754,
291756,
226220,
234414,
324527,
291760,
234417,
201650,
324531,
234422,
226230,
324536,
275384,
234428,
291773,
242623,
324544,
234431,
234434,
324546,
324548,
234437,
226245,
226239,
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,
234487,
324599,
234490,
234493,
316416,
234496,
308226,
234501,
308231,
234504,
234507,
234510,
234515,
300054,
316439,
234520,
234519,
234523,
234526,
234528,
300066,
234532,
300069,
234535,
234537,
234540,
234543,
234546,
275508,
300085,
234549,
300088,
234553,
234556,
234558,
316479,
234561,
316483,
160835,
234563,
308291,
234568,
234570,
316491,
234572,
300108,
234574,
300115,
234580,
234581,
234585,
275545,
242777,
234590,
234593,
234595,
234597,
300133,
234601,
300139,
234605,
160879,
234607,
275569,
234610,
316530,
300148,
234614,
398455,
144506,
234618,
234620,
275579,
234623,
226433,
234627,
275588,
234634,
234636,
177293,
234640,
275602,
234643,
308373,
324757,
234647,
234648,
226453,
234650,
308379,
275606,
300189,
324766,
119967,
324768,
234653,
283805,
234657,
242852,
300197,
283813,
234661,
234664,
275626,
234667,
316596,
308414,
234687,
300223,
300226,
308418,
234692,
300229,
308420,
308422,
316610,
283844,
300234,
283850,
300238,
300241,
316625,
300243,
300245,
316630,
300248,
300253,
300256,
300258,
300260,
234726,
300263,
300265,
300267,
161003,
300270,
300272,
120053,
300278,
275703,
316663,
300284,
275710,
300287,
292097,
300289,
300292,
300294,
275719,
234760,
177419,
300299,
242957,
300301,
275725,
177424,
283917,
349464,
283939,
259367,
292143,
283951,
300344,
226617,
243003,
283963,
226628,
300357,
283973,
177482,
283983,
316758,
357722,
316766,
292192,
316768,
218464,
292197,
316774,
243046,
218473,
136562,
324978,
275834,
333178,
275836,
275840,
316803,
316806,
226696,
316811,
226699,
316814,
226703,
300433,
234899,
300436,
226709,
357783,
316824,
316826,
300448,
144807,
144810,
144812,
284076,
144814,
227426,
144820,
374196,
284084,
292279,
284087,
144826,
144828,
144830,
144832,
227430,
144835,
144837,
38342,
144839,
144841,
144844,
144847,
144852,
144855,
103899,
300507,
333280,
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,
243268,
284231,
226886,
128584,
284234,
366155,
317004,
276043,
284238,
226895,
284241,
194130,
284243,
300628,
284245,
292433,
284247,
276053,
284249,
235097,
243290,
284251,
284253,
300638,
284255,
317015,
243293,
284258,
292452,
292454,
284263,
177766,
284265,
292458,
284267,
292461,
284272,
284274,
284278,
292470,
276086,
292473,
284283,
276093,
284286,
292479,
284288,
292481,
284290,
325250,
284292,
292485,
276095,
276098,
284297,
317066,
284299,
317068,
284301,
276109,
284303,
284306,
276114,
284308,
284312,
284314,
284316,
276127,
284320,
284322,
284327,
284329,
317098,
284331,
276137,
284333,
284335,
276144,
284337,
284339,
300726,
284343,
284346,
284350,
358080,
276160,
284354,
358083,
284358,
276166,
358089,
284362,
276170,
284365,
276175,
284368,
276177,
284370,
358098,
284372,
317138,
284377,
284379,
284381,
284384,
358114,
284386,
358116,
276197,
317158,
358119,
284392,
325353,
358122,
284394,
284397,
358126,
276206,
358128,
284399,
358133,
358135,
276216,
358138,
300795,
358140,
284413,
358142,
358146,
317187,
284418,
317189,
317191,
284428,
300816,
300819,
317207,
300828,
300830,
276255,
300832,
325408,
300834,
317221,
227109,
358183,
186151,
276268,
300845,
243504,
300850,
284469,
276280,
325436,
358206,
276291,
366406,
276295,
300872,
292681,
153417,
358224,
284499,
276308,
178006,
317271,
284502,
276315,
292700,
317279,
284511,
227175,
292715,
300912,
292721,
284529,
300915,
284533,
292729,
317306,
284540,
292734,
325512,
169868,
317332,
358292,
284564,
284566,
350106,
284572,
276386,
284579,
276388,
358312,
317353,
292776,
284585,
276395,
292784,
276402,
358326,
161718,
358330,
276411,
276418,
276425,
301009,
301011,
301013,
292823,
358360,
301017,
301015,
292828,
276446,
153568,
276448,
292839,
276455,
292843,
276460,
292845,
178161,
227314,
276466,
325624,
276472,
317435,
276476,
276479,
276482,
276485,
317446,
276490,
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,
292934,
243785,
350293,
350295,
309337,
194649,
350299,
227418,
350302,
194654,
350304,
178273,
309346,
227423,
194660,
350308,
309350,
309348,
292968,
309352,
350313,
309354,
301163,
350316,
276583,
301167,
276586,
350321,
276590,
227440,
284786,
350325,
252022,
276595,
350328,
292985,
301178,
350332,
292989,
301185,
292993,
350339,
317570,
317573,
350342,
350345,
350349,
301199,
317584,
325777,
350354,
350357,
350359,
350362,
350366,
276638,
153765,
284837,
350375,
350379,
350381,
350383,
129200,
350385,
350387,
350389,
350395,
350397,
350399,
227520,
350402,
227522,
301252,
350406,
227529,
301258,
309450,
276685,
309455,
276689,
309462,
301272,
276699,
194780,
309468,
309471,
301283,
317672,
317674,
325867,
243948,
194801,
309491,
227571,
309494,
243960,
227583,
276735,
276739,
211204,
276742,
227596,
325910,
309530,
342298,
211232,
317729,
211241,
325937,
325943,
211260,
260421,
276809,
285002,
276811,
235853,
276816,
235858,
276829,
276833,
391523,
276836,
293227,
276843,
293232,
276848,
186744,
211324,
227709,
317833,
178572,
285070,
293263,
285077,
178583,
227738,
317853,
276896,
317858,
342434,
285093,
317864,
285098,
276907,
235955,
276917,
293304,
293307,
293314,
309707,
293325,
317910,
293336,
235996,
317917,
293343,
358880,
276961,
293346,
276964,
293352,
236013,
293364,
301562,
293370,
317951,
309764,
301575,
121352,
293387,
236043,
342541,
317963,
113167,
55822,
309779,
317971,
309781,
277011,
55837,
227877,
227879,
293417,
227882,
309804,
293421,
105007,
236082,
285236,
23094,
277054,
244288,
219714,
129603,
301636,
318020,
301639,
301643,
285265,
399955,
309844,
277080,
309849,
285277,
285282,
326244,
318055,
277100,
121458,
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,
293555,
318132,
154292,
277173,
342707,
277177,
277181,
318144,
277187,
277191,
277194,
277196,
277201,
342744,
137946,
113378,
203491,
228069,
277223,
342760,
285417,
56041,
56043,
277232,
228081,
56059,
310015,
285441,
310020,
310029,
228113,
285459,
277273,
293659,
326430,
228128,
285474,
293666,
228135,
318248,
277291,
318253,
293677,
285489,
301876,
293685,
375606,
285494,
301880,
285499,
301884,
293696,
310080,
277317,
293706,
277322,
277329,
162643,
310100,
301911,
277337,
301913,
301921,
400236,
236397,
162671,
326514,
310134,
236408,
15224,
277368,
416639,
416640,
113538,
310147,
416648,
39817,
187274,
277385,
301972,
424853,
277405,
310179,
277411,
293798,
293802,
236460,
277426,
293811,
276579,
293817,
293820,
203715,
326603,
293849,
293861,
228327,
228328,
318442,
228332,
326638,
277486,
318450,
293876,
293877,
285686,
302073,
121850,
293882,
302075,
244731,
285690,
293887,
277504,
277507,
277511,
293899,
277519,
293908,
302105,
293917,
293939,
318516,
277561,
277564,
310336,
7232,
293956,
277573,
228422,
293960,
310344,
277577,
277583,
203857,
293971,
310355,
310359,
236632,
277594,
138332,
277598,
285792,
277601,
203872,
310374,
203879,
310376,
228460,
318573,
203886,
187509,
285815,
367737,
285817,
302205,
285821,
392326,
253064,
294026,
302218,
285835,
162964,
384148,
187542,
302231,
285849,
302233,
285852,
302237,
285854,
285856,
302241,
285862,
277671,
302248,
64682,
277678,
294063,
294065,
302258,
277687,
294072,
318651,
294076,
277695,
318657,
244930,
302275,
130244,
302277,
228550,
302282,
310476,
302285,
302288,
310481,
302290,
203987,
302292,
302294,
310486,
302296,
384222,
310498,
285927,
318698,
302315,
228592,
294132,
138485,
228601,
204026,
228606,
204031,
64768,
310531,
138505,
228617,
318742,
204067,
277798,
130345,
277801,
113964,
285997,
277804,
285999,
277807,
113969,
277811,
318773,
261430,
318776,
277816,
286010,
277819,
294204,
417086,
277822,
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,
277905,
351633,
277908,
277917,
310689,
277921,
130468,
228776,
277928,
277932,
310703,
277937,
310710,
130486,
310712,
277944,
310715,
277947,
302526,
228799,
277950,
277953,
302534,
310727,
245191,
64966,
277959,
277963,
302541,
277966,
302543,
310737,
277971,
228825,
163290,
277978,
310749,
277981,
277984,
310755,
277989,
277991,
187880,
277995,
310764,
286188,
278000,
228851,
310772,
278003,
278006,
40440,
212472,
278009,
40443,
286203,
40448,
228864,
286214,
228871,
302603,
302614,
286233,
302617,
302621,
286240,
146977,
187939,
40484,
294435,
40486,
286246,
294440,
40488,
294439,
294443,
40491,
294445,
286248,
310831,
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,
343666,
188022,
122488,
294521,
343679,
294537,
310925,
286354,
278163,
302740,
122517,
278168,
179870,
327333,
229030,
212648,
302764,
278188,
278192,
319153,
278196,
302781,
319171,
302789,
294599,
278216,
294601,
302793,
343757,
212690,
319187,
278227,
229076,
286420,
286425,
319194,
278235,
229086,
278238,
286432,
294625,
294634,
302838,
319226,
286460,
278274,
302852,
278277,
302854,
294664,
311048,
352008,
319243,
311053,
302862,
319251,
294682,
278306,
188199,
294701,
319280,
278320,
319290,
229192,
302925,
188247,
188252,
237409,
294776,
360317,
294785,
327554,
40840,
40851,
294803,
188312,
294811,
237470,
319390,
40865,
319394,
294817,
294821,
311209,
180142,
343983,
294831,
188340,
40886,
319419,
294844,
294847,
393177,
294876,
294879,
294883,
294890,
311279,
278513,
237555,
311283,
278516,
237562
] |
12fcd56d0d64f96b1f578c91200ecd3c6cfe1b8f
|
233e085aead3b2da1798f2af6a7676fbb3f89304
|
/Tests/BowLiteCoreTests/Instances/BoolInstancesTest.swift
|
e1867928d26b4022ca46b66d31a800a2b7b89e88
|
[
"Apache-2.0"
] |
permissive
|
Spencerx/bow-lite
|
d3a5f36a2a95bd5163d02b654d794e47122529d7
|
520042b1fdc1c09855a5eb8cafff3b9a791952b6
|
refs/heads/main
| 2023-08-25T07:49:31.626648 | 2021-10-31T09:48:32 | 2021-10-31T09:48:32 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 244 |
swift
|
import XCTest
import BowLiteCore
import BowLiteLaws
class BoolInstancesTest: XCTestCase {
func testBoolEqLaws() {
EquatableLaws<Bool>.check()
}
func testBoolSemiringLaws() {
SemiringLaws<Bool>.check()
}
}
|
[
-1
] |
25b416c03850ccdc79b04d622c04d58159467a8b
|
1c8cbeef49d1ca84461e7f15ff10ed2f01738e9d
|
/1115-tu/TicTacToe-starter/Pods/RxSwift/RxSwift/Disposables/Disposables.swift
|
9cc9ee79d2c1ecff25439bc203170d8f1f14c025
|
[
"MIT"
] |
permissive
|
nkhaja/iOS-FRP
|
049173b0e3cbc22df080cfb1dec8ef2e0fd18462
|
5747a3e1bff7be29ea3b03b908b24c933e16e9d2
|
refs/heads/master
| 2020-07-28T14:22:41.237631 | 2016-12-15T17:54:45 | 2016-12-15T17:54:45 | 73,410,581 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,029 |
swift
|
//
// Disposables.swift
<<<<<<< HEAD
// RxSwift
//
// Created by Mohsen Ramezanpoor on 01/08/2016.
// Copyright © 2016 Krunoslav Zaher. All rights reserved.
=======
// Rx
//
// Created by Mohsen Ramezanpoor on 01/08/2016.
// Copyright © 2016 Mohsen Ramezanpoor. All rights reserved.
>>>>>>> 3cd23538aef0a97d0cb9d6a6347598c5f2cd57e5
//
import Foundation
<<<<<<< HEAD
/// A collection of utility methods for common disposable operations.
public struct Disposables {
private init() {}
}
=======
/**
A collection of utility methods for common disposable operations.
*/
public struct Disposables {
private init() {}
}
public extension Disposables {
private static let noOp: Disposable = NopDisposable()
/**
Creates a disposable that does nothing on disposal.
*/
static func create() -> Disposable {
return noOp
}
/**
Creates a disposable with the given disposables.
*/
static func create(_ disposable1: Disposable, _ disposable2: Disposable, _ disposable3: Disposable) -> Cancelable {
return CompositeDisposable(disposable1, disposable2, disposable3)
}
/**
Creates a disposable with the given disposables.
*/
static func create(_ disposable1: Disposable, _ disposable2: Disposable, _ disposable3: Disposable, _ disposables: Disposable ...) -> Cancelable {
var disposables = disposables
disposables.append(disposable1)
disposables.append(disposable2)
disposables.append(disposable3)
return CompositeDisposable(disposables: disposables)
}
/**
Creates a disposable with the given disposables.
*/
static func create(_ disposables: [Disposable]) -> Cancelable {
switch disposables.count {
case 2:
return Disposables.create(disposables[0], disposables[1])
default:
return CompositeDisposable(disposables: disposables)
}
}
}
>>>>>>> 3cd23538aef0a97d0cb9d6a6347598c5f2cd57e5
|
[
-1
] |
6d45f8688dec7d9b6f6914a03335860be8c88339
|
21b820217bb2fcb0cbbd95f7e8f9c71d8481036e
|
/PlantDiscover/Navigation/Router.swift
|
89c4e331e678f62d180e0f64ab216cebcacf0ebb
|
[] |
no_license
|
DmitryApollo/PlantDiscovery_MVP
|
e510406f93beee1327f2a3f3c8bab834541e3817
|
c9ba71cf16f286b6fcc9917a557cf7510ed8557e
|
refs/heads/master
| 2023-02-24T22:53:48.520858 | 2021-02-04T22:18:24 | 2021-02-04T22:18:24 | 334,495,610 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,715 |
swift
|
//
// Router.swift
// PlantDiscover
//
// Created by Дмитрий on 28/01/2021.
// Copyright © 2021 Дмитрий. All rights reserved.
//
import UIKit
protocol RouterMain {
var navigationController: UINavigationController? { get set }
var assemblyBuilder: AssemblyBuilderProtocol? { get set }
}
protocol RouterProtocol: RouterMain {
func initialViewController()
func showDetail(plant: Plant)
func favouritesViewController()
}
class Router: RouterProtocol {
var navigationController: UINavigationController?
var assemblyBuilder: AssemblyBuilderProtocol?
init(navigationController: UINavigationController, assemblyBuilder: AssemblyBuilderProtocol) {
self.navigationController = navigationController
self.assemblyBuilder = assemblyBuilder
}
func initialViewController() {
if let navController = navigationController {
guard let repoVC = assemblyBuilder?.createRepoModule(router: self) else { return }
navController.viewControllers = [repoVC]
}
}
func showDetail(plant: Plant) {
if let navController = navigationController {
guard let detailVC = assemblyBuilder?.createDetailModule(plant: plant, router: self) else { return }
detailVC.modalPresentationCapturesStatusBarAppearance = true
navController.pushViewController(detailVC, animated: true)
}
}
func favouritesViewController() {
if let navController = navigationController {
guard let favouritesVC = assemblyBuilder?.createFavoritesModule(router: self) else { return }
navController.viewControllers = [favouritesVC]
}
}
}
|
[
-1
] |
ef9bae693693d99eec163f252958cf5a947337a9
|
b4528827503f6e6617657d269ebde4c32818a670
|
/CurrencyApp/BalanceModel.swift
|
275821a3f98b8def43bea3114245b95933d89238
|
[] |
no_license
|
JustinasBa/CurrencyApp
|
6916f520987958a8179510d61bec39e4b33624e4
|
5e35a6db64749dad77a57591caf209e6e95c0f0d
|
refs/heads/master
| 2021-01-02T08:38:00.608961 | 2017-08-04T12:10:28 | 2017-08-04T12:10:28 | 99,036,148 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 5,635 |
swift
|
//
// MainViewModel.swift
// CurrencyApp
//
// Created by Justinas Baronas on 2017-07-21.
// Copyright © 2017 Justinas Baronas. All rights reserved.
//
import Foundation
import SwiftyJSON
enum CurrencySymbol: String {
case EUR
case USD
case JPY
var symbol : String {
switch self {
case .EUR:
return "€"
case .USD:
return "$"
case .JPY:
return "¥"
}
}
}
enum Currency: String {
case EUR = "EUR"
case USD = "USD"
case JPY = "JPY"
}
struct CurrencyBalance: Any {
var moneyAmount: Double
var currency: String
var currencySymbol: String?
var commissionFee: Double
init(currency: String, amount: Double, commissionFee: Double) {
self.moneyAmount = amount
self.currency = currency
self.commissionFee = commissionFee
if let _currencySymbol = CurrencySymbol(rawValue: currency)?.symbol {
self.currencySymbol = _currencySymbol
}
}
}
class BalanceModel: NSObject {
private let freeExhanges = 5
private let commisionFeeRate = 0.007
public var numberOfExchange = 0
public var commissionFee: Double?
public var holdingCurrency: [CurrencyBalance]?
public var isFreeOfCommisionFee: Bool {
return numberOfExchange <= freeExhanges
}
override init() {
self.holdingCurrency = [ CurrencyBalance(currency: "EUR", amount: 1000.00, commissionFee: 0.00),
CurrencyBalance(currency: "USD", amount: 0.00, commissionFee: 0.00),
CurrencyBalance(currency: "JPY", amount: 0.00, commissionFee: 0.00) ]
super.init()
}
private func exhange(fromAmount: Double, fromCurrency: String, toAmount: Double, toCurrency: String) {
guard let fromCurr = Currency(rawValue: fromCurrency) else { return }
guard let toCurr = Currency(rawValue: toCurrency) else { return }
guard let fromWithAmount = holdingCurrency?[fromCurr.hashValue].moneyAmount else { return }
guard let toWithAmount = holdingCurrency?[toCurr.hashValue].moneyAmount else { return }
holdingCurrency?[fromCurr.hashValue].moneyAmount = fromWithAmount - fromAmount
holdingCurrency?[toCurr.hashValue].moneyAmount = toWithAmount + toAmount
numberOfExchange += 1
guard !isFreeOfCommisionFee else { return }
holdingCurrency?[fromCurr.hashValue].commissionFee += fromAmount * commisionFeeRate
self.commissionFee = fromAmount * commisionFeeRate
}
public func exhangeCurrency(fromAmount: String, fromCurrency: String, toCurrency: String, callback: @escaping (Double) -> ()) {
guard let _fromAmount = Double(fromAmount) else { return }
API(APIRouter.exhangeCurrency(fromAmount, fromCurrency, toCurrency)) { json in
guard json != JSON.null else { return }
var toAmount: Double = 0
if let amount = json["amount"].string {
toAmount = Double(amount)!
}
self.exhange(fromAmount: _fromAmount, fromCurrency: fromCurrency, toAmount: toAmount, toCurrency: toCurrency)
callback(toAmount)
}
}
public func getExchangeRate(fromCurrency: String, toCurrency: String, callback: @escaping (String) -> ()) {
API(APIRouter.exhangeRate(fromCurrency, toCurrency)) { json in
guard json != JSON.null else {
print("Failed to fetch Exchange Rate"); return }
var toAmount = ""
if let amount = json["amount"].string {
toAmount = amount
}
callback(toAmount)
}
}
public func getAmountOfMoney(item: Int) -> String {
guard let currency = holdingCurrency?[item],
let symbol = currency.currencySymbol else { return "" }
let currencyString = "\(String(describing: symbol)) \(currency.moneyAmount)"
return currencyString
}
public func getCurrencyWithAmount(forCurrency currency: Currency) -> CurrencyBalance {
guard let currency = holdingCurrency?[currency.hashValue] else {
return CurrencyBalance(currency: "EUR", amount: 0.00, commissionFee: 0.00)
}
return currency
}
public func commissionFeeText(ofCurrency item: Int) -> String {
guard let fee = holdingCurrency?[item].commissionFee, !isFreeOfCommisionFee else {
return "Kom. mokestis: 0.00"
}
return "Kom. mokestis: \(String(describing: fee))"
}
public func exchangeText(fromAmount: String, fromCurrency:String, toAmount: String, toCurrency: String) -> String {
guard let fee = commissionFee, !isFreeOfCommisionFee else {
return "Jūs konvertavote \(fromAmount) \(fromCurrency) į \(toAmount) \(toCurrency). Komisinis mokestis - 0.00 \(fromCurrency). (nemokamai)"
}
return "Jūs konvertavote \(fromAmount) \(fromCurrency) į \(toAmount) \(toCurrency). Komisinis mokestis - \(fee) \(fromCurrency). 0.7% komisinis mokestis"
}
public func currencyLabelText(currency item: Int) -> String {
guard let currency = holdingCurrency?[item],
let symbol = currency.currencySymbol else {
return "Balance: 0.00" }
let labelText = "Balance: \(String(describing: symbol))\(currency.moneyAmount)"
return labelText
}
}
|
[
-1
] |
356d056a26ad8851fa33af368d905ec4d72286d5
|
da8e7a89376d451f0771a27bb44cd832bae3a899
|
/UserList/SceneDelegate.swift
|
6e8b1d396d2958da71727c7e8ad0d05827d46ebf
|
[
"MIT"
] |
permissive
|
Zainrax/UserList-iOS
|
6b5b061aefd2ae7ffa08f5668d3d441d56579168
|
ca564d4124006249b779d788401c1d6b0e1bec9d
|
refs/heads/master
| 2022-09-22T21:03:01.275460 | 2020-06-05T21:09:07 | 2020-06-05T21:09:07 | 268,934,479 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,553 |
swift
|
//
// SceneDelegate.swift
// UserList
//
// Created by abra on 3/06/20.
// Copyright © 2020 LogosEros. All rights reserved.
//
import UIKit
@available(iOS 13.0, *)
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
guard let _ = (scene as? UIWindowScene) else { return }
}
func sceneDidDisconnect(_ scene: UIScene) {
// Called as the scene is being released by the system.
// This occurs shortly after the scene enters the background, or when its session is discarded.
// Release any resources associated with this scene that can be re-created the next time the scene connects.
// The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead).
}
func sceneDidBecomeActive(_ scene: UIScene) {
// Called when the scene has moved from an inactive state to an active state.
// Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
}
func sceneWillResignActive(_ scene: UIScene) {
// Called when the scene will move from an active state to an inactive state.
// This may occur due to temporary interruptions (ex. an incoming phone call).
}
func sceneWillEnterForeground(_ scene: UIScene) {
// Called as the scene transitions from the background to the foreground.
// Use this method to undo the changes made on entering the background.
}
func sceneDidEnterBackground(_ scene: UIScene) {
// Called as the scene transitions from the foreground to the background.
// Use this method to save data, release shared resources, and store enough scene-specific state information
// to restore the scene back to its current state.
// Save changes in the application's managed object context when the application transitions to the background.
(UIApplication.shared.delegate as? AppDelegate)?.saveContext()
}
}
|
[
393221,
163849,
393228,
393231,
393251,
344103,
393260,
393269,
213049,
376890,
16444,
393277,
376906,
327757,
254032,
286804,
368728,
254045,
368736,
180322,
376932,
286833,
286845,
286851,
417925,
262284,
360598,
286880,
286889,
377003,
327872,
180418,
377037,
180432,
377047,
418008,
385243,
377063,
327915,
205037,
393457,
393461,
393466,
418044,
336124,
336129,
262405,
336140,
368913,
262417,
262423,
377118,
377121,
262437,
254253,
336181,
262455,
262473,
344404,
213333,
270687,
262497,
418145,
262501,
213354,
246124,
262508,
262512,
213374,
385420,
262551,
262553,
262567,
262574,
393649,
262587,
344512,
262593,
336326,
360917,
369119,
328178,
328180,
328183,
328190,
254463,
328193,
98819,
164362,
328204,
328207,
410129,
393748,
377372,
188959,
385571,
197160,
377384,
33322,
352822,
418364,
188990,
270922,
352844,
352865,
262761,
344694,
352888,
377473,
336513,
336517,
344710,
385671,
148106,
377485,
352919,
98969,
336549,
344745,
336556,
385714,
164535,
336568,
164539,
328379,
328387,
352969,
189154,
369382,
361196,
344832,
336644,
344843,
328462,
361231,
394002,
336660,
418581,
418586,
369436,
418591,
262943,
369439,
418594,
336676,
418600,
418606,
271154,
328498,
369464,
361274,
328516,
336709,
336712,
361289,
328520,
336715,
328523,
361300,
213848,
426842,
361307,
361310,
361318,
344936,
361323,
361335,
328574,
369544,
222129,
345036,
345046,
328690,
435188,
328703,
418822,
328710,
377867,
328715,
336922,
345119,
328747,
345134,
345139,
361525,
361537,
377931,
197708,
189525,
156762,
402523,
148580,
345200,
361591,
361594,
410746,
214150,
345224,
337048,
345247,
361645,
337072,
337076,
402615,
361657,
402636,
328925,
165086,
165092,
328933,
222438,
328942,
206084,
115973,
328967,
345377,
353572,
345380,
345383,
345400,
378170,
369979,
386366,
337224,
337230,
337235,
263509,
353634,
337252,
402792,
345449,
99692,
378232,
337278,
181639,
353674,
181644,
181650,
181655,
230810,
181671,
181674,
181679,
181682,
337330,
181687,
370105,
181691,
181697,
337350,
181704,
337366,
271841,
329192,
361961,
329195,
116211,
402943,
337416,
329227,
419341,
419345,
329234,
419351,
345626,
419357,
345631,
370208,
419360,
394787,
419363,
370214,
419369,
394796,
419377,
419386,
206397,
419401,
353868,
419404,
419408,
214611,
419412,
403040,
345702,
222831,
353920,
403076,
345737,
198282,
403085,
403092,
345750,
419484,
345758,
345763,
419492,
419498,
419502,
370351,
419507,
337588,
419510,
419513,
403139,
337607,
419528,
419531,
272083,
394967,
419545,
345819,
419548,
181982,
419551,
345829,
419560,
337643,
419564,
337647,
370416,
141052,
337661,
337671,
362249,
362252,
395022,
362256,
321300,
345888,
116512,
378664,
354107,
354112,
247618,
370504,
329545,
345932,
354124,
370510,
247639,
337751,
370520,
313181,
182110,
354143,
345965,
354157,
345968,
345971,
345975,
182136,
403321,
1914,
354173,
395148,
247692,
247701,
329625,
436127,
436133,
247720,
337834,
362414,
337845,
190393,
247760,
346064,
329699,
190440,
247790,
354314,
346140,
337980,
436290,
378956,
395340,
436307,
338005,
329816,
100454,
329833,
329857,
329868,
411806,
329886,
346273,
362661,
100525,
379067,
387261,
256193,
395467,
256214,
411862,
411865,
411869,
411874,
379108,
411877,
387303,
395496,
346344,
387307,
346350,
338161,
436474,
321787,
379135,
411905,
43279,
379154,
387350,
338201,
387353,
182559,
338212,
248112,
362823,
436556,
321880,
362844,
379234,
354674,
182642,
321911,
420237,
379279,
354728,
338363,
338382,
272849,
248279,
256474,
182755,
338404,
338411,
330225,
248309,
199165,
248332,
330254,
199182,
199189,
420377,
330268,
191012,
330320,
199250,
191069,
346722,
248427,
191085,
338544,
191093,
346743,
330384,
346769,
150184,
174775,
248505,
174778,
363198,
223936,
355025,
273109,
264919,
338661,
338665,
264942,
330479,
363252,
338680,
207620,
264965,
191240,
338701,
199455,
396067,
346917,
396070,
215854,
330581,
330585,
265056,
265059,
355180,
355185,
330612,
330643,
412600,
207809,
379849,
347082,
330711,
248794,
248799,
437219,
257009,
265208,
330750,
199681,
338951,
330761,
330769,
330775,
248863,
158759,
347178,
404526,
396337,
330803,
396340,
339002,
388155,
339010,
248905,
330827,
330830,
248915,
183384,
412765,
339037,
257121,
322660,
265321,
330869,
248952,
420985,
330886,
330890,
347288,
248986,
44199,
380071,
339118,
249018,
339133,
322763,
330959,
330966,
265433,
265438,
388320,
363757,
396552,
175376,
175397,
208167,
273709,
372016,
437553,
347442,
199989,
208189,
437567,
175425,
437571,
437576,
331089,
396634,
175451,
437596,
429408,
175458,
208228,
175461,
175464,
265581,
331124,
175478,
249210,
175484,
175487,
249215,
249219,
175491,
249225,
249228,
249235,
175514,
175517,
396703,
175523,
355749,
396723,
380353,
339401,
380364,
339406,
372177,
339414,
249303,
413143,
339418,
249310,
249313,
339425,
339435,
69114,
372229,
339464,
249355,
208399,
175637,
134689,
339504,
265779,
421442,
413251,
265796,
265806,
224854,
224858,
339553,
257636,
224871,
372328,
257647,
339572,
224885,
224888,
224891,
224895,
421509,
126597,
224905,
11919,
224914,
126611,
224917,
224920,
208539,
224923,
224927,
224933,
257705,
224939,
224943,
257713,
224949,
257717,
257721,
224954,
257725,
224960,
257733,
224966,
224970,
257740,
224976,
257745,
257748,
224982,
257752,
257762,
224996,
225000,
339696,
225013,
257788,
225021,
257791,
339711,
225027,
257796,
257802,
339722,
257805,
225039,
257808,
249617,
225044,
167701,
257815,
225049,
225054,
184096,
257825,
397089,
225059,
339748,
225068,
225074,
257843,
225077,
257846,
225080,
397113,
225083,
397116,
257853,
225088,
225097,
323404,
257869,
257872,
339795,
397140,
225109,
257881,
257884,
257887,
257891,
413539,
225128,
257897,
339827,
257909,
372598,
257914,
257917,
225150,
257922,
380803,
225156,
339845,
257927,
225166,
397201,
225171,
380823,
225176,
225183,
184245,
372698,
372704,
372707,
356336,
380919,
393215,
405534,
266298,
217158,
421961,
200786,
356440,
217180,
430181,
266351,
356467,
266365,
192640,
266375,
381069,
225425,
250003,
225430,
250008,
356507,
250012,
225439,
135328,
192674,
225442,
438434,
225445,
225448,
225451,
225456,
430257,
225459,
225462,
225468,
389309,
225472,
225476,
389322,
225491,
225494,
266454,
225497,
225500,
225503,
225506,
356580,
217319,
225511,
225515,
225519,
381177,
356631,
356638,
356644,
356647,
389417,
266537,
356650,
356656,
332081,
307507,
340276,
356662,
397623,
332091,
225599,
332098,
201030,
348489,
332107,
151884,
332118,
430422,
348503,
332130,
250211,
340328,
250217,
348523,
348528,
332153,
332158,
389503,
250239,
438657,
332162,
348548,
356741,
332175,
160152,
373146,
373149,
70048,
356783,
324032,
201158,
127473,
340473,
324095,
324100,
266757,
324103,
324112,
340501,
324118,
324122,
340512,
332325,
324134,
356908,
324141,
324143,
356917,
324150,
324156,
348734,
324161,
324165,
356935,
381513,
324171,
324174,
324177,
389724,
373344,
340580,
348777,
381546,
119432,
340628,
184983,
373399,
340639,
258723,
332460,
332464,
332473,
381626,
332484,
332487,
373450,
332494,
357070,
357074,
332512,
332521,
340724,
332534,
389927,
348979,
152371,
398141,
127815,
357202,
357208,
136024,
389979,
357212,
430940,
357215,
201580,
201583,
349041,
340850,
201589,
430967,
324473,
398202,
119675,
324476,
340859,
430973,
324479,
340863,
324482,
324485,
324488,
185226,
381834,
324493,
324496,
324499,
430996,
324502,
324511,
422817,
324514,
201638,
373672,
324525,
5040,
324534,
5047,
324539,
324542,
349129,
340940,
340942,
209874,
340958,
431073,
398307,
340964,
209896,
209904,
381947,
201724,
431100,
431107,
209944,
209948,
250915,
250917,
169002,
209966,
209969,
209973,
209976,
209980,
209988,
209991,
431180,
209996,
349268,
250968,
210011,
373853,
341094,
210026,
210028,
349296,
210037,
210042,
349309,
210045,
160896,
152704,
349313,
210053,
210056,
349320,
373905,
210068,
210072,
210078,
210081,
210085,
210089,
210096,
210100,
324792,
210108,
357571,
210116,
210128,
333010,
210132,
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,
333222,
210357,
259516,
415168,
366035,
415187,
415192,
415197,
415200,
333285,
415208,
366057,
366064,
415217,
415225,
415264,
366118,
382503,
415271,
349739,
144940,
415279,
415282,
349748,
415286,
210488,
415291,
415295,
333387,
333396,
374359,
333400,
333415,
423529,
333423,
415354,
333440,
267910,
267929,
333472,
333512,
259789,
358100,
366301,
333535,
366308,
366312,
431852,
399086,
366319,
210673,
366322,
399092,
366326,
333566,
268042,
210700,
210707,
399129,
333593,
333595,
366384,
358192,
210740,
366388,
358201,
399166,
325441,
366403,
325447,
341831,
341835,
341839,
341844,
415574,
358235,
341852,
350046,
399200,
358256,
268144,
358260,
325494,
186233,
333690,
243584,
325505,
333699,
399244,
333709,
333725,
333737,
382891,
333767,
358348,
333777,
219094,
153572,
358372,
350190,
350194,
333819,
350204,
350207,
325633,
325637,
350214,
268299,
333838,
350225,
350232,
333851,
350238,
350241,
374819,
350245,
350249,
350252,
350257,
350260,
350272,
243782,
350281,
350286,
374865,
252021,
342134,
374904,
333989,
333998,
334012,
260299,
350411,
350417,
350423,
350426,
334047,
350449,
358645,
350454,
350459,
350462,
350465,
350469,
325895,
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,
391564,
366991,
342431,
375209,
326059,
342453,
334263,
358857,
195041,
334306,
334312,
104940,
375279,
162289,
350724,
186898,
342546,
350740,
342551,
334359,
342555,
334364,
416294,
350762,
252463,
358962,
334386,
334397,
252483,
219719,
399957,
244309,
334425,
326240,
334466,
162446,
326291,
342680,
342685,
260767,
342711,
244410,
260802,
350918,
154318,
342737,
154329,
416476,
64231,
342769,
203508,
375541,
342777,
375569,
375575,
375580,
334633,
326444,
383794,
326452,
326455,
375613,
244542,
375616,
326468,
244552,
342857,
326474,
326479,
326486,
416599,
342875,
244572,
326494,
326503,
433001,
326508,
400238,
326511,
211826,
211832,
392061,
351102,
260993,
400260,
211846,
342931,
400279,
252823,
392092,
400286,
359335,
211885,
400307,
351169,
170950,
326599,
359367,
359383,
383968,
359411,
261109,
244728,
261112,
383999,
261130,
326669,
261148,
359452,
261155,
261160,
261166,
359471,
375868,
384099,
367724,
384108,
326764,
343155,
384115,
212095,
384136,
384140,
384144,
384152,
384158,
384161,
351399,
384169,
367795,
384182,
384189,
343232,
351424,
384192,
244934,
367817,
244938,
384202,
253132,
326858,
343246,
384209,
146644,
351450,
384225,
359650,
343272,
351467,
384247,
351480,
384250,
351483,
343307,
384270,
261391,
253202,
261395,
384276,
384284,
245021,
253218,
384290,
171304,
245032,
384299,
351535,
245042,
326970,
384324,
343366,
367966,
343394,
343399,
367981,
343410,
155000,
327035,
245121,
245128,
253321,
155021,
384398,
245137,
245143,
245146,
245149,
343453,
245152,
245155,
245158,
40358,
245163,
114093,
327090,
343478,
384444,
146878,
327108,
327112,
384457,
327118,
359887,
359891,
343509,
155103,
343535,
343540,
368120,
343545,
359951,
400977,
400982,
179803,
138865,
155255,
155274,
368289,
245410,
245415,
425663,
155328,
245463,
155352,
212700,
155364,
245477,
155372,
245487,
212723,
245495,
409336,
155394,
155404,
245528,
155423,
360224,
155439,
204592,
155444,
155448,
417596,
384829,
384831,
360262,
155463,
155477,
376665,
155484,
261982,
425823,
155488,
376672,
155492,
327532,
261997,
376686,
262000,
262003,
327542,
425846,
262006,
147319,
262009,
262012,
155517,
155523,
155526,
360327,
155532,
262028,
262031,
262034,
262037,
262040,
262043,
253854,
155550,
262046,
262049,
262052,
327590,
155560,
155563,
155566,
327613,
393152,
311244,
212945,
393170,
155604,
155620,
253924,
155622,
327655,
360432,
393204,
360439,
253944,
393209,
155647
] |
aded4a585a706e929b3abd5af2038f0203ab9644
|
486a8b7d4df7fa1e80ec39a27b9f2690963ff876
|
/Source/SwiftLintFramework/Rules/Idiomatic/LegacyHashingRule.swift
|
5b3aa45e7523fb6e7104ba4ec3022054bd3325d1
|
[
"MIT"
] |
permissive
|
mikelrob/SwiftLint
|
7b680c65e14401afa979c96e7026d28cde86e4b6
|
686b577d2a8f10d1a5baa17832e1e3437e40117c
|
refs/heads/master
| 2023-07-12T00:45:41.647909 | 2021-08-17T08:19:07 | 2021-08-17T08:19:07 | 396,822,294 | 0 | 1 |
MIT
| 2021-08-16T14:06:53 | 2021-08-16T14:06:52 | null |
UTF-8
|
Swift
| false | false | 2,778 |
swift
|
import SourceKittenFramework
public struct LegacyHashingRule: ASTRule, ConfigurationProviderRule, AutomaticTestableRule {
public var configuration = SeverityConfiguration(.warning)
public init() {}
public static let description = RuleDescription(
identifier: "legacy_hashing",
name: "Legacy Hashing",
description: "Prefer using the `hash(into:)` function instead of overriding `hashValue`",
kind: .idiomatic,
minSwiftVersion: .fourDotTwo,
nonTriggeringExamples: [
Example("""
struct Foo: Hashable {
let bar: Int = 10
func hash(into hasher: inout Hasher) {
hasher.combine(bar)
}
}
"""),
Example("""
class Foo: Hashable {
let bar: Int = 10
func hash(into hasher: inout Hasher) {
hasher.combine(bar)
}
}
"""),
Example("""
var hashValue: Int { return 1 }
class Foo: Hashable { \n }
"""),
Example("""
class Foo: Hashable {
let bar: String = "Foo"
public var hashValue: String {
return bar
}
}
"""),
Example("""
class Foo: Hashable {
let bar: String = "Foo"
public var hashValue: String {
get { return bar }
set { bar = newValue }
}
}
""")
],
triggeringExamples: [
Example("""
struct Foo: Hashable {
let bar: Int = 10
public ↓var hashValue: Int {
return bar
}
}
"""),
Example("""
class Foo: Hashable {
let bar: Int = 10
public ↓var hashValue: Int {
return bar
}
}
""")
]
)
// MARK: - ASTRule
public func validate(file: SwiftLintFile,
kind: SwiftDeclarationKind,
dictionary: SourceKittenDictionary) -> [StyleViolation] {
guard kind == .varInstance,
dictionary.setterAccessibility == nil,
dictionary.typeName == "Int",
dictionary.name == "hashValue",
let offset = dictionary.offset else {
return []
}
return [StyleViolation(ruleDescription: Self.description,
severity: configuration.severity,
location: Location(file: file, byteOffset: offset))]
}
}
|
[
170206
] |
1864724931fbb88e9b0a32ae77c2d27ee4056bb0
|
57a9fd449249981412c82fbd7dfbe76f92085a96
|
/Mr-Ride-iOS/Mr-Ride-iOS/CustomPointAnnotation.swift
|
cad6e77c2560996d12181226a4f88a65349d692a
|
[
"MIT"
] |
permissive
|
Derek-Chiu/Mr-Ride-iOS
|
420e3e8f3855dfbc5f5b2d6dc6bbc4500a3fa0c8
|
4305a74ea3d66d0ecc9ca1373e94953a82979d98
|
refs/heads/master
| 2021-01-21T15:04:38.325570 | 2016-07-15T05:23:13 | 2016-07-15T05:23:13 | 59,446,249 | 0 | 0 | null | 2016-07-15T05:23:15 | 2016-05-23T02:25:59 |
Objective-C
|
UTF-8
|
Swift
| false | false | 355 |
swift
|
//
// CustomPointAnnotation.swift
// Mr-Ride-iOS
//
// Created by Derek on 6/25/16.
// Copyright © 2016 AppWorks School Derek. All rights reserved.
//
import Foundation
import MapKit
class CustomPointAnnotation: MKPointAnnotation {
var name: String = ""
var location: String = ""
var category: String = ""
var isAvaliable = true
}
|
[
-1
] |
c91e99a55466b0e73bd9b31bcd2bced6b3602261
|
7ca4c6af3884fa148251f6902cb45a97a44bf2b0
|
/Pierre Penguin Escapes the AntarcticTests/Pierre_Penguin_Escapes_the_AntarcticTests.swift
|
b6d0e847433a440d15a5f97b93723da30ffa4006
|
[] |
no_license
|
philism/Pierre-Penguin-Escapes-the-Antarctic
|
62816b80955bda5128bcd5a074ef29494bac429c
|
679efff85a38e25064971606379b57d7a0cdf6e1
|
refs/heads/master
| 2021-01-10T05:31:59.658792 | 2016-02-18T23:35:15 | 2016-02-18T23:35:15 | 52,045,127 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 988 |
swift
|
//
// Pierre_Penguin_Escapes_the_AntarcticTests.swift
// Pierre Penguin Escapes the AntarcticTests
//
// Created by Philip Smith on 9/8/15.
// Copyright (c) 2015 Philip Smith. All rights reserved.
//
import UIKit
import XCTest
class Pierre_Penguin_Escapes_the_AntarcticTests: 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,
278541,
278544,
278550,
305179,
276509,
278558,
307231,
313375,
278561,
102437,
227370,
360491,
276534,
276543,
159807,
286788,
280649,
223316,
315476,
223318,
227417,
288857,
194653,
278624,
194656,
309345,
227428,
276581,
276582,
276589,
278638,
227439,
276592,
131189,
227446,
223350,
292992,
141450,
215178,
311435,
311438,
276627,
276632,
227492,
196773,
129203,
299187,
131256,
280762,
223419,
176314,
299198,
309444,
276682,
278753,
280802,
276709,
276710,
276715,
233715,
157944,
211193,
168188,
227585,
227592,
276748,
276753,
157970,
309529,
278810,
276764,
299293,
282919,
262450,
276787,
276792,
315706,
278846,
164162,
311621,
280902,
278856,
227658,
276813,
278863,
6481,
6482,
276821,
6489,
276831,
323935,
276835,
321894,
276839,
416104,
276847,
285040,
278898,
278908,
280961,
227725,
178578,
190871,
293274,
276891,
61857,
61859,
278954,
278961,
278965,
293303,
276920,
278969,
33211,
276925,
278978,
278985,
278993,
276958,
287198,
227809,
358882,
276962,
279013,
227813,
279022,
281072,
279039,
276998,
287241,
279050,
186893,
303631,
223767,
277017,
223769,
291358,
293419,
277048,
301634,
277066,
295519,
66150,
277094,
277101,
287346,
277111,
279164,
277118,
291454,
184962,
303746,
152203,
277133,
133774,
225936,
225944,
230040,
164512,
225956,
285353,
205487,
285361,
303793,
299699,
293556,
342706,
154294,
277175,
277176,
285371,
277182,
199366,
277190,
225997,
277198,
277203,
226004,
203477,
279252,
226007,
277204,
277219,
226019,
285415,
342762,
277227,
230134,
234234,
226043,
234238,
279294,
234241,
234245,
277254,
209670,
226058,
234250,
234253,
234256,
234263,
234268,
105246,
228129,
234277,
234280,
279336,
289576,
234283,
234286,
277294,
234289,
234294,
230199,
234301,
162621,
289598,
277312,
234304,
234305,
281408,
293693,
162626,
277316,
234311,
234312,
299849,
234317,
277325,
293711,
234323,
234326,
277339,
234331,
301918,
234335,
279392,
349026,
234340,
174949,
234343,
277354,
234346,
234349,
234355,
277366,
234360,
279417,
209785,
177019,
234361,
277370,
234366,
234367,
158593,
234372,
226181,
113542,
213894,
226184,
277381,
228234,
226189,
234381,
295824,
234386,
234387,
234392,
234395,
324507,
234400,
279456,
277410,
234404,
289703,
234409,
275371,
236461,
234419,
226227,
234425,
234427,
287677,
234430,
226241,
234436,
234438,
52172,
234445,
234444,
183248,
275410,
234451,
234454,
234457,
275418,
234463,
234466,
277479,
277480,
234472,
234473,
179176,
234477,
234482,
287731,
277492,
314355,
234492,
234495,
234498,
234500,
277509,
277510,
230410,
234506,
275469,
277518,
234509,
295953,
277523,
230423,
197657,
234522,
281625,
281626,
175132,
234531,
234534,
275495,
310317,
234542,
275505,
275506,
234548,
234555,
238651,
277563,
230463,
234560,
207938,
234565,
234569,
277579,
300111,
207953,
234577,
296019,
277585,
234583,
234584,
230499,
281700,
277603,
300135,
275565,
156785,
312434,
275571,
300151,
234616,
398457,
234622,
300158,
285828,
302213,
253063,
234632,
277640,
275591,
234642,
226451,
226452,
308372,
119963,
234656,
277665,
330913,
234659,
306338,
234663,
275625,
300201,
238769,
226481,
277686,
208058,
277690,
230588,
277694,
283840,
279747,
279760,
290000,
189652,
275671,
363744,
195811,
298212,
304356,
285929,
279792,
298228,
204022,
120055,
234742,
228600,
208124,
204041,
292107,
277792,
339234,
259363,
199971,
304421,
277800,
277803,
113966,
226608,
226609,
277815,
300343,
277821,
226624,
277824,
277825,
15686,
277831,
226632,
277834,
294218,
177484,
222541,
277841,
296273,
222548,
277845,
314709,
283991,
357719,
218462,
224606,
277856,
142689,
230756,
163175,
277866,
281962,
284014,
277871,
279919,
275831,
181625,
277890,
277891,
226694,
277896,
277897,
281992,
230799,
112017,
306579,
206228,
226711,
277919,
277920,
310692,
279974,
282024,
277936,
277939,
279989,
296375,
277949,
296387,
415171,
277957,
163269,
296391,
300487,
277965,
280013,
312782,
284116,
228823,
228824,
226781,
277988,
310757,
316902,
277993,
277994,
296425,
278002,
278005,
306677,
226805,
278008,
300542,
306693,
192010,
149007,
65041,
282136,
204313,
278060,
286254,
228917,
226875,
194110,
128583,
276040,
366154,
276045,
276046,
286288,
276050,
280147,
300630,
226906,
147036,
243292,
226910,
282213,
317032,
222832,
276084,
276085,
276088,
188031,
276097,
192131,
276100,
276101,
229001,
310923,
312972,
282259,
276120,
278170,
276126,
282273,
282276,
278191,
276146,
276148,
198324,
286388,
296628,
276173,
302797,
212688,
302802,
276180,
286423,
216795,
276195,
153319,
313065,
280300,
419569,
276210,
276211,
276219,
194303,
171776,
288512,
311042,
288516,
278285,
276238,
227091,
184086,
294678,
284442,
278299,
276253,
278307,
288547,
159533,
165677,
276279,
276282,
276283,
276287,
345919,
276294,
282438,
276298,
296779,
216918,
276311,
307031,
237408,
276325,
282474,
288619,
276332,
276344,
194429,
227199,
40853,
44952,
247712,
227238,
294823,
276400,
276401,
276408,
290746,
276421,
276422,
276430,
231375,
153554,
276444,
280541,
276450,
276451,
276454,
276459,
296941,
276462,
276468,
276469,
278518,
276478
] |
1cace815f6b0dd7b108e657596e3207a65bbe01f
|
725fa94feb4429357cbb693e48d2b43670839352
|
/SignatureView/ViewController.swift
|
286791e2f2963a2209fe7f0c9f94485854fc0beb
|
[] |
no_license
|
PrashantGaikwad-iOS/SignatureView
|
c59fbd79567d5765eb0236e84cc9b8289eb141d4
|
801bf9ba1daff8cf42052804d5791641094f59c4
|
refs/heads/master
| 2020-04-18T22:20:50.337698 | 2019-01-25T09:27:05 | 2019-01-25T09:27:05 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 356 |
swift
|
//
// ViewController.swift
// SignatureView
//
// Created by Prashant G on 1/25/19.
// Copyright © 2019 Prashant G. 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.
}
}
|
[
325510,
324104,
329869,
312078,
245530,
318109,
324512,
316331,
324018,
316346,
244411,
294845,
323268,
323016,
326600,
325448,
316626,
146645,
313182,
354654,
326241,
321253
] |
d3367030092924ec49cecd7fd1638297b5b51126
|
1eba231a402093817f68dc96d72c7d47cd542f55
|
/ViperSampleGenerambaTests/Modules/Confirmation/View/ConfirmationViewControllerTests.swift
|
c0505b4b0dcc6dcca02a59b6ba567fb9a94d4664
|
[
"Apache-2.0"
] |
permissive
|
faith-hidaka/ViperSampleGeneramba
|
8a881d134c36c3792021ea1910f1bb1cf3ce873d
|
9dd3961aba15010011c7ac1724fb6299f1888a14
|
refs/heads/master
| 2021-03-30T23:12:22.540308 | 2018-02-17T23:46:52 | 2018-02-17T23:46:52 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 440 |
swift
|
import XCTest
@testable import ViperSampleGeneramba
class ConfirmationViewTests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}
}
|
[
69732,
398824,
306601,
194513,
258707,
194484,
125684,
228862
] |
3acce8a75c97d39e274552a1b540038829cf520e
|
95c4fa2a63106d343d9bbc60858c8a0d34bfa466
|
/Healthy/Healthy/Module/Healthy Circle/LSpaceScriptCell.swift
|
2678f8000f17ad8751a9833a5fc524d89a50071c
|
[] |
no_license
|
LieonShelly/Healthy
|
b3d5734a605d3dbd1a7ff2aadd7d83c332039221
|
7343b10a65de3eb3a3d6d349751d37c1b96e2493
|
refs/heads/master
| 2021-06-21T03:49:47.491924 | 2017-07-21T15:58:42 | 2017-07-21T15:58:42 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,809 |
swift
|
//
// LSpaceScriptCell.swift
// Healthy
//
// Created by Liang on 17/6/5.
// Copyright © 2017年 Healthy. All rights reserved.
//
import UIKit
class LSpaceScriptCell: UITableViewCell {
@IBOutlet weak var dateLabel: UILabel!
@IBOutlet weak var contentLabel: UILabel!
var model: LSpaceModel! {
didSet {
self.reloadViews()
}
}
func reloadViews() {
let formater = DateFormatter.init()
formater.dateFormat = "yyyy/MM/dd HH:mm:ss"
let date = formater.date(from: model.SaveTime)
let formater2 = DateFormatter.init()
formater2.dateFormat = "yyyy年MM月dd日 HH:mm:ss"
let dateString = formater2.string(from: date!)
let month = dateString.substring(with: (dateString.range(of: "年")?.upperBound)! ..< (dateString.range(of: "月")?.lowerBound)!)
let day = dateString.substring(with: (dateString.range(of: "月")?.upperBound)! ..< (dateString.range(of: "日")?.lowerBound)!)
let attriString = NSMutableAttributedString.init(string: String.init(format: "%02d%02d月",Int(day)!, Int(month)!))
attriString.addAttribute(NSFontAttributeName, value: UIFont.boldSystemFont(ofSize: 19), range: NSMakeRange(0, 2))
attriString.addAttribute(NSFontAttributeName, value: UIFont.systemFont(ofSize: 15), range: NSMakeRange(2, 3))
dateLabel.attributedText = attriString
contentLabel.text = self.model.Note
}
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
}
}
|
[
-1
] |
4c23e5a2bfb5900a6f6bbd2bec685f55827cbc27
|
37cab0e018fd91085cc630e28b27d04a586dfc49
|
/GraphFramework/Source/Models/GraphModel/InitialGraphModel.swift
|
9c247cc1ee9364d7069ee11f720023794d4bf7f1
|
[] |
no_license
|
HYTLee/GraphFramework
|
556e7d9a17314bfdb151bf949d43e4e5f9d0f6d6
|
c41e120c394a143c78e7368490dd195f7fa1883d
|
refs/heads/master
| 2023-05-05T23:44:13.193482 | 2021-05-27T11:58:17 | 2021-05-27T11:58:17 | 370,833,669 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 266 |
swift
|
//
// ChartModel.swift
// GraphicsTestApp
//
// Created by AP Yauheni Hramiashkevich on 5/8/21.
//
import Foundation
public struct GraphModel {
public init(dataSets: [DataSet]) {
self.dataSets = dataSets
}
public var dataSets: [DataSet]
}
|
[
-1
] |
71d4bc789b675c22ce301d30ea210248b2f2888a
|
6291eb6f2f2043a2ea0ad534f666a40d0bce1eed
|
/Calculator2/Calculator2/ViewController.swift
|
e4989e6f7ede1b3e5391055ba5355c442c422360
|
[] |
no_license
|
forestjae/StanfordiOS
|
8aad623ea248a332ef0fc9f2eb8e7a785b6f3e79
|
9937f4fa7bccf9b6dc85614256ec96630ed8ea70
|
refs/heads/master
| 2023-03-16T13:36:59.831515 | 2021-03-06T02:21:45 | 2021-03-06T02:21:45 | 344,985,637 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 200 |
swift
|
//
// ViewController.swift
// Calculator2
//
// Created by 이승재 on 2020/07/27.
// Copyright © 2020 SJ. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
}
|
[
-1
] |
fa8fa5878b7bf3dda066cf72d6c3b6918d2d9f71
|
c488e0c0da2861d7d01cf2251626fc11b25d35f1
|
/imei/ViewController.swift
|
6f16386157854b0ac49a00e17dfd5d983b78b62a
|
[] |
no_license
|
lundahuang/imei
|
6f7adf991f74bb381aac569920d26494f6c5b0cd
|
527474101dc4deb966a87a353035566d5845d0a5
|
refs/heads/master
| 2021-01-19T07:20:53.374218 | 2017-04-07T11:18:29 | 2017-04-07T11:18:29 | 87,538,142 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 497 |
swift
|
//
// ViewController.swift
// imei
//
// Created by user_17 on 2017/4/7.
// Copyright © 2017年 user_17. 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.
}
}
|
[
278543,
309264,
317473,
237616,
360501,
286775,
288827,
286786,
159812,
286796,
278606,
237655,
307288,
200802,
309347,
276580,
309349,
309351,
309353,
307311,
276597,
278657,
276612,
280710,
303242,
311437,
278675,
299165,
278686,
278693,
100521,
307379,
280760,
280770,
227523,
280772,
280775,
280777,
276686,
229585,
307410,
280797,
278749,
278752,
301284,
280808,
280810,
286963,
280821,
286965,
280824,
280826,
280832,
276736,
278786,
278791,
287004,
287005,
287007,
282917,
233767,
282922,
282926,
307516,
278845,
289088,
289112,
311645,
323933,
289120,
227688,
313706,
299374,
199024,
276849,
278897,
311684,
313733,
233869,
227740,
285087,
289187,
289190,
289191,
305577,
289196,
305582,
278968,
127418,
293308,
278973,
289224,
281042,
276959,
279011,
276965,
281078,
236022,
233980,
287231,
279041,
279046,
215562,
277006,
281107,
279064,
281118,
295460,
289318,
309807,
281142,
279096,
234043,
277057,
129604,
301637,
158285,
311913,
281202,
277108,
287350,
281218,
281221,
285321,
227984,
303760,
117399,
228000,
225955,
287399,
326311,
277171,
277180,
285377,
226009,
277224,
199402,
234223,
312049,
289524,
226038,
234232,
230147,
226055,
299786,
281373,
295711,
228127,
281380,
283433,
289578,
312107,
293682,
289596,
283453,
289600,
279360,
293700,
283461,
279380,
295766,
279386,
308064,
303977,
162672,
277364,
207738,
291709,
303998,
183173,
304008,
324491,
304012,
304015,
226196,
275358,
277406,
289697,
234402,
291755,
277420,
277422,
297903,
324528,
230323,
277429,
277430,
234423,
277432,
277433,
277434,
293816,
281530,
291774,
295874,
299973,
234465,
168936,
289771,
183278,
277487,
293874,
277502,
293888,
277512,
275466,
300057,
197677,
304174,
300086,
234551,
300089,
238653,
293961,
203858,
300116,
281701,
281703,
296042,
277612,
164974,
312433,
300149,
234619,
226447,
234641,
349332,
226454,
226455,
226456,
226458,
285855,
283839,
277696,
228548,
228551,
279751,
279754,
230604,
298189,
302286,
230608,
290004,
290006,
189655,
302295,
298202,
298204,
298206,
298207,
290016,
363743,
298211,
290020,
228585,
120054,
333048,
204027,
300288,
312586,
277797,
130346,
113972,
300358,
238920,
234829,
296272,
306540,
216433,
290166,
310649,
333179,
290175,
275842,
224643,
300432,
310673,
226705,
306578,
370093,
279982,
286126,
277935,
282035,
292277,
296374,
130487,
306633,
286158,
280015,
310734,
163289,
280029,
280030,
286175,
286189,
282095,
296436,
292341,
302580,
310773,
290299,
286204,
288251,
290303,
282128,
286234,
282143,
284197,
296487,
286249,
296489,
286257,
226878,
288321,
228932,
226887,
288331,
288332,
226896,
212561,
284242,
292435,
228945,
300629,
276054,
280146,
284240,
282202,
212573,
40545,
292451,
284261,
306791,
286314,
284275,
284276,
284277,
294518,
314996,
276087,
284279,
292478,
284287,
284289,
276099,
284293,
284298,
278157,
282262,
280219,
284315,
284317,
282270,
284323,
282275,
280231,
284328,
313007,
284336,
284341,
286390,
300727,
276150,
282301,
296638,
302788,
282311,
276167,
284361,
282320,
317137,
284373,
282329,
282338,
284391,
282346,
294636,
358127,
288501,
282357,
358137,
358139,
282365,
286462,
282368,
358147,
282377,
300817,
282389,
282393,
278298,
329499,
276256,
278304,
315170,
282403,
315177,
282411,
159541,
282426,
288577,
298830,
307029,
276309,
298843,
241499,
188253,
292701,
200549,
292730,
284570,
294812,
284574,
284577,
284580,
284586,
276396,
282548,
298951,
165832,
301012,
301016,
294889,
298989,
231405,
227315,
237556,
237564
] |
16ddd75613f702acf09a9acdb844eea4505dd13c
|
09223bd4b7c427a762ff5faab0d4341c8c5e7adc
|
/GCD/clousuresLearning.playground/Contents.swift
|
54c9b2530e4a23fbe03ec4778496368e05db140d
|
[] |
no_license
|
Wilsonilo/60daysofcodeiosudacity
|
357417653e23c58bf702339f79a8b672a889efa3
|
d2b70e000af16f8bbe9b7070ee0bbeaf2131452d
|
refs/heads/master
| 2021-01-23T08:43:57.491624 | 2017-10-04T17:59:43 | 2017-10-04T17:59:43 | 102,539,860 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,057 |
swift
|
import UIKit
import PlaygroundSupport
//With vars
let f = { (x:Int) -> Int in
return x + 42
}
f(42)
var filteredHouses : (String, [String], String) -> String = {
print("running")
if $1.contains($0) {
return $2 + " Contained!"
} else {
return $2 + " NOT contained"
}
}
//func
func greaterThanPredicateClosure(numbers: [Int], closure: (Int) -> Bool) -> [Int]{
var result = [Int]()
for number in numbers{
if closure(number){
result.append(number)
}
}
return result
}
print(greaterThanPredicateClosure(numbers: [1,2,3,4,5]) { (num) -> Bool in
return num > 3
})
////
let gameScoresTop3 = [45,18,250,3,7854,123,10524,345,25004]
let top3Scores = gameScoresTop3.filter {
(score: Int) -> Bool in
var sorted = gameScoresTop3.sorted()
return score > sorted[3]
}
top3Scores
var sayThis = ["Swift", "With", "Shani", "is", "fun!"]
let string = sayThis.reduce("") {
if $0 == "" {
return $1
} else {
return $0 + " " + $1
}
}
string
|
[
-1
] |
66902670cda3bf9342bd02dec3f3f8abff89bea0
|
dadcbbe586a840e6170069058d4b176e16ad7bf8
|
/Garrtech/Garrtech/Service/ScorBiz.swift
|
c263eed8b9c9d066f39da0c707d303c574928deb
|
[] |
no_license
|
arisinfotech/Garrtech
|
4b41f3ec89a9b821dc346f063ecc7d47c2308ea3
|
f5d8672c0edcbc6379d2c1053ff8f0c23e8fa7c0
|
refs/heads/master
| 2020-07-22T07:23:47.658392 | 2017-02-10T16:28:43 | 2017-02-10T16:28:43 | 73,557,345 | 0 | 0 | null | 2016-11-12T16:52:35 | 2016-11-12T14:28:17 | null |
UTF-8
|
Swift
| false | false | 2,995 |
swift
|
//
// ScorBiz.swift
// Garrtech
//
// Created by Ankit on 25/12/16.
// Copyright © 2016 Ankit. All rights reserved.
//
import Foundation
class ScorBiz {
var annualRevenue: ScorBizDetail?
var businessTime: ScorBizDetail?
var craditScrore: ScorBizDetail?
var totalMonthlySale: ScorBizDetail?
var propertyOwnerShip: ScorBizDetail?
func populateWithJson(dict: JSONDictionary) {
if let annualRevenue = dict[kAnnual_revenue] as? JSONDictionary {
let annualRevenuTemo = ScorBizDetail()
annualRevenuTemo.populateWithJSON(dict: annualRevenue)
self.businessTime = annualRevenuTemo
}
if let businessTime = dict[kBusiness_time] as? JSONDictionary {
let annualRevenuTemo = ScorBizDetail()
annualRevenuTemo.populateWithJSON(dict: businessTime)
self.annualRevenue = annualRevenuTemo
}
if let totalMonthlySale = dict[kCreadit_score] as? JSONDictionary {
let annualRevenuTemo = ScorBizDetail()
annualRevenuTemo.populateWithJSON(dict: totalMonthlySale)
self.craditScrore = annualRevenuTemo
}
if let propertyOwnerShip = dict[kStep2total_monthly_sale] as? JSONDictionary {
let annualRevenuTemo = ScorBizDetail()
annualRevenuTemo.populateWithJSON(dict: propertyOwnerShip)
self.totalMonthlySale = annualRevenuTemo
}
if let propertyOwnerShip = dict[kStep1property_ownership] as? JSONDictionary {
let annualRevenuTemo = ScorBizDetail()
annualRevenuTemo.populateWithJSON(dict: propertyOwnerShip)
self.propertyOwnerShip = annualRevenuTemo
}
}
/*
{
"status": "1",
"message": "Scorebiz Data.",
"data": {
"annual_revenue": {
"taken_score": "2",
"disp_name": "Less than $50,000",
"total_sore": "20"
},
"business_time": {
"taken_score": "2",
"disp_name": "0 - 6 months",
"total_sore": "10"
},
"creadit_score": {
"taken_score": "12",
"disp_name": "Good(660-720)",
"total_sore": "30"
},
"total_monthly_sale": {
"disp_name": "12312",
"total_sore": "20",
"taken_score": "10"
},
"property_ownership": {
"disp_name": "own",
"total_sore": "20",
"taken_score": "20"
}
}
}
*/
}
class ScorBizDetail {
var displayName: String?
var totalScore: String?
var takenScore: String?
func populateWithJSON(dict: JSONDictionary) {
if let displayName = dict[kDisp_Name] as? String {
self.displayName = displayName
}
if let totalScore = dict[kTotal_sore] as? String {
self.totalScore = totalScore
}
if let takenScore = dict[kTaken_score] as? String {
self.takenScore = takenScore
}
}
}
|
[
-1
] |
13d76ef26f36e5725d1e781f4becdce419249bfb
|
729a1767cbbfb93648ead937f72fb97349a78af5
|
/Examples/StarChartExample/SceneDelegate.swift
|
e10dd1667f4c573d303bdf2db89f8fa214f280d3
|
[
"MIT"
] |
permissive
|
vovnit/StarChart
|
103677540e2bd4b1890873e5cf960add2c589301
|
fab72ffbacd440cd825251afaaa5b76c5500b38c
|
refs/heads/main
| 2023-02-15T01:56:37.505745 | 2021-01-02T21:25:30 | 2021-01-02T21:25:30 | 308,123,281 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,331 |
swift
|
//
// SceneDelegate.swift
// StarChartExample
//
// Created by Vladimir Nitochkin on 27.10.2020.
//
import UIKit
@available(iOS 13.0, *)
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
guard let _ = (scene as? UIWindowScene) else { return }
}
func sceneDidDisconnect(_ scene: UIScene) {
// Called as the scene is being released by the system.
// This occurs shortly after the scene enters the background, or when its session is discarded.
// Release any resources associated with this scene that can be re-created the next time the scene connects.
// The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead).
}
func sceneDidBecomeActive(_ scene: UIScene) {
// Called when the scene has moved from an inactive state to an active state.
// Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
}
func sceneWillResignActive(_ scene: UIScene) {
// Called when the scene will move from an active state to an inactive state.
// This may occur due to temporary interruptions (ex. an incoming phone call).
}
func sceneWillEnterForeground(_ scene: UIScene) {
// Called as the scene transitions from the background to the foreground.
// Use this method to undo the changes made on entering the background.
}
func sceneDidEnterBackground(_ scene: UIScene) {
// Called as the scene transitions from the foreground to the background.
// Use this method to save data, release shared resources, and store enough scene-specific state information
// to restore the scene back to its current state.
}
}
|
[
393221,
163849,
393228,
393231,
393251,
352294,
344103,
393260,
393269,
213049,
376890,
385082,
393277,
254020,
376906,
327757,
254032,
368728,
254045,
180322,
376932,
286845,
286851,
417925,
262284,
360598,
377003,
377013,
164029,
327872,
180418,
377030,
377037,
377047,
418008,
418012,
377063,
327915,
205037,
393457,
393461,
393466,
418044,
385281,
262405,
180491,
336140,
262417,
368913,
262423,
377118,
377121,
262437,
254253,
336181,
262455,
393539,
262473,
344404,
213333,
418135,
270687,
262497,
418145,
262501,
213354,
246124,
262508,
262512,
213374,
385420,
393613,
262551,
262553,
385441,
385444,
262567,
385452,
262574,
393649,
385460,
262587,
344512,
262593,
360917,
369119,
328180,
328183,
328190,
254463,
328193,
328207,
410129,
393748,
262679,
377372,
188959,
385571,
377384,
197160,
33322,
352822,
270905,
197178,
418364,
188990,
369224,
385610,
270922,
352844,
385617,
352865,
262761,
352875,
344694,
352888,
336513,
377473,
385671,
148106,
213642,
377485,
352919,
98969,
344745,
361130,
336556,
385714,
434868,
164535,
164539,
328379,
328387,
352969,
344777,
418508,
385743,
385749,
139998,
189154,
369382,
361196,
418555,
344832,
336644,
344837,
344843,
328462,
361231,
394002,
336660,
418581,
418586,
434971,
369436,
262943,
369439,
418591,
418594,
336676,
418600,
418606,
369464,
361274,
328516,
336709,
328520,
336712,
361289,
328523,
336715,
361300,
213848,
426842,
361307,
197469,
361310,
254813,
361318,
344936,
361323,
361335,
328574,
369544,
361361,
222129,
345036,
386004,
345046,
386012,
386019,
386023,
328690,
435188,
328703,
328710,
418822,
377867,
328715,
361490,
386070,
336922,
345119,
377888,
214060,
345134,
345139,
361525,
386102,
361537,
377931,
345172,
189525,
402523,
361568,
148580,
345200,
361591,
386168,
361594,
410746,
214150,
345224,
386187,
345247,
361645,
345268,
402615,
361657,
402636,
328925,
165086,
66783,
165092,
328933,
222438,
328942,
386286,
386292,
206084,
328967,
345377,
345380,
353572,
345383,
263464,
337207,
345400,
378170,
369979,
386366,
337230,
337235,
263509,
353634,
337252,
402792,
271731,
378232,
337278,
271746,
181639,
353674,
181644,
361869,
181650,
181655,
230810,
181671,
181674,
181679,
181682,
337330,
181687,
370105,
181691,
181697,
361922,
337350,
181704,
337366,
271841,
329192,
361961,
329195,
116211,
337399,
402943,
337416,
329227,
419341,
419345,
329234,
419351,
345626,
419357,
345631,
419360,
370208,
394787,
419363,
370214,
419369,
394796,
419377,
419386,
214594,
419401,
353868,
419404,
173648,
419408,
214611,
419412,
403040,
345702,
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,
419551,
345829,
419560,
337643,
419564,
337647,
370416,
337671,
362249,
362252,
395022,
362256,
321300,
345888,
362274,
378664,
354107,
345916,
354112,
370504,
329545,
345932,
370510,
354132,
247639,
337751,
370520,
313181,
182110,
354143,
354157,
345965,
345968,
345971,
345975,
403321,
1914,
354173,
395148,
247692,
337809,
247701,
436127,
436133,
247720,
337834,
362414,
337845,
190393,
247760,
346064,
346069,
419810,
329699,
354275,
190440,
354314,
346140,
436290,
395340,
378956,
436307,
338005,
100454,
329833,
329853,
329857,
329868,
411806,
346273,
362661,
100525,
387250,
379067,
387261,
256193,
395467,
346317,
411862,
256214,
411865,
411869,
411874,
379108,
411877,
387303,
346344,
395496,
338154,
387307,
346350,
338161,
387314,
436474,
379135,
411905,
411917,
379154,
395539,
387350,
387353,
338201,
338212,
395567,
248112,
362823,
436556,
321880,
362844,
379234,
354674,
321911,
420237,
379279,
272787,
354728,
338353,
338382,
272849,
248279,
256474,
182755,
338404,
248309,
248332,
330254,
199189,
420377,
330268,
191012,
330320,
199250,
191069,
346722,
248427,
338544,
346736,
191093,
346743,
346769,
150184,
174775,
248505,
174778,
363198,
223936,
355025,
273109,
355029,
264919,
264942,
363252,
338680,
264965,
338701,
256787,
363294,
396067,
346917,
396070,
215854,
355123,
355141,
355144,
338764,
355151,
330581,
330585,
387929,
355167,
265056,
265059,
355176,
355180,
355185,
412600,
207809,
379849,
347082,
396246,
330711,
248794,
248799,
347106,
437219,
257009,
265208,
199681,
338951,
330761,
330769,
330775,
248863,
396329,
347178,
404526,
396337,
330803,
396340,
339002,
388155,
339010,
347208,
248905,
330827,
330830,
248915,
183384,
339037,
412765,
257121,
265321,
248952,
420985,
330890,
347288,
248986,
44199,
380071,
339118,
249018,
339133,
126148,
330959,
330966,
265433,
265438,
388320,
363757,
388348,
339199,
396552,
175376,
175397,
273709,
372016,
437553,
347442,
199989,
175416,
396601,
208189,
437567,
175425,
437571,
437576,
437584,
437588,
396634,
175451,
437596,
429408,
175458,
175461,
175464,
265581,
331124,
175478,
175487,
249215,
175491,
249219,
249225,
249228,
249235,
175514,
175517,
396703,
396706,
175523,
355749,
396723,
388543,
380353,
216518,
380364,
339406,
372177,
339414,
249303,
413143,
339418,
339421,
249310,
339425,
249313,
339429,
339435,
249329,
69114,
372229,
208399,
175637,
405017,
134689,
265779,
421442,
413251,
265796,
265806,
224854,
224858,
339553,
257636,
224871,
372328,
257647,
372338,
224885,
224888,
224891,
224895,
372354,
126597,
421509,
224905,
11919,
224911,
224914,
126611,
224917,
224920,
126618,
208539,
224923,
224927,
224930,
224933,
257705,
224939,
224943,
257713,
224949,
257717,
257721,
224954,
257725,
224960,
257733,
224966,
224970,
257740,
224976,
257745,
339664,
257748,
224982,
257752,
224987,
257762,
224996,
225000,
225013,
257788,
225021,
339711,
257791,
225027,
257796,
339722,
257802,
257805,
225039,
257808,
249617,
225044,
167701,
372500,
257815,
225049,
257820,
225054,
184096,
397089,
257825,
225059,
339748,
225068,
257837,
413485,
225071,
225074,
257843,
225077,
257846,
225080,
397113,
225083,
397116,
257853,
225088,
225094,
225097,
257869,
257872,
225105,
397140,
225109,
225113,
257881,
257884,
257887,
225120,
257891,
225128,
257897,
225138,
257909,
225142,
372598,
257914,
257917,
225150,
257922,
380803,
225156,
339845,
257927,
225166,
397201,
225171,
380823,
225176,
225183,
372698,
372704,
372707,
356336,
380919,
393215,
372739,
405534,
266295,
266298,
421961,
200786,
356440,
217180,
430181,
266351,
356467,
266365,
192640,
266375,
381069,
225425,
250003,
225430,
250008,
356507,
250012,
225439,
135328,
192674,
225442,
438434,
225445,
225448,
438441,
356521,
225451,
258223,
225456,
430257,
225459,
225462,
225468,
389309,
225472,
372931,
225476,
389322,
225485,
225488,
225491,
266454,
225494,
225497,
225500,
225503,
225506,
225511,
217319,
225515,
225519,
381177,
397572,
389381,
381212,
356638,
356641,
356644,
356647,
266537,
389417,
356650,
356656,
332081,
340276,
356662,
397623,
332091,
225599,
348489,
332107,
151884,
430422,
348503,
332118,
250211,
340328,
250217,
348523,
348528,
332153,
356734,
389503,
332158,
438657,
332162,
389507,
348548,
356741,
332175,
160152,
373146,
340380,
373149,
70048,
356783,
266688,
324032,
201158,
127473,
217590,
340473,
324095,
324100,
324103,
324112,
340501,
324118,
324122,
340512,
332325,
324134,
381483,
356908,
324141,
324143,
356917,
324150,
324156,
168509,
348734,
324161,
324165,
356935,
348745,
381513,
324171,
324174,
324177,
389724,
332381,
373344,
340580,
348777,
381546,
340628,
184983,
373399,
258723,
332455,
332460,
332464,
332473,
381626,
332484,
332487,
332494,
357070,
357074,
332512,
340724,
332534,
348926,
389927,
348979,
348983,
398141,
357202,
389971,
357208,
389979,
430940,
357212,
357215,
439138,
349041,
340850,
381815,
430967,
324473,
398202,
119675,
340859,
324476,
430973,
324479,
340863,
324482,
373635,
324485,
324488,
185226,
381834,
324493,
324496,
324499,
430996,
324502,
324511,
422817,
324514,
201638,
398246,
373672,
324525,
111539,
324534,
324539,
324542,
398280,
349129,
340942,
209874,
340958,
431073,
398307,
340964,
209896,
201712,
209904,
349173,
381947,
201724,
349181,
431100,
431107,
349203,
209944,
209948,
357411,
250917,
169002,
357419,
209966,
209969,
209973,
209976,
209980,
209988,
209991,
431180,
209996,
349268,
177238,
250968,
210011,
373853,
341094,
210026,
210028,
210032,
349296,
210037,
210042,
210045,
349309,
152704,
349313,
160896,
210053,
210056,
349320,
259217,
373905,
210068,
210072,
210078,
210081,
210085,
210089,
210096,
210100,
324792,
210108,
357571,
210116,
210128,
210132,
333016,
210139,
210144,
218355,
218361,
275709,
128254,
275713,
242947,
275717,
275723,
333075,
349460,
349486,
349492,
415034,
210261,
365912,
259423,
374113,
251236,
374118,
390518,
357756,
374161,
112021,
349591,
357793,
333222,
259516,
415168,
366035,
415187,
366039,
415192,
415194,
415197,
415200,
333285,
415208,
366057,
366064,
415217,
210422,
415225,
423424,
415258,
415264,
366118,
415271,
382503,
349739,
144940,
415279,
415282,
415286,
210488,
415291,
415295,
349762,
333396,
374359,
333400,
366173,
423529,
423533,
210547,
415354,
333440,
267910,
267929,
259789,
366301,
333535,
153311,
366308,
366312,
431852,
399086,
366319,
210673,
366322,
399092,
366326,
333566,
268042,
210700,
366349,
210707,
399129,
333595,
210720,
366384,
358192,
210740,
366388,
358201,
325441,
366403,
325447,
341831,
341839,
341844,
415574,
358235,
350046,
399200,
399208,
268144,
358256,
358260,
399222,
325494,
186233,
333690,
325505,
399244,
333709,
333725,
333737,
382891,
382898,
350153,
358348,
333777,
219094,
399318,
358372,
350190,
350194,
333819,
350204,
350207,
325633,
325637,
350214,
219144,
268299,
333838,
350225,
186388,
350232,
333851,
350238,
350241,
374819,
350245,
350249,
350252,
178221,
350257,
350260,
350272,
243782,
350281,
350286,
374865,
252021,
342134,
374904,
268435,
333998,
334012,
260299,
211161,
375027,
358645,
268553,
268560,
432406,
325920,
194854,
358701,
391469,
358705,
358714,
358717,
383307,
358738,
383331,
383334,
391531,
383342,
334204,
268669,
194942,
391564,
366991,
334224,
342431,
375209,
375220,
334263,
326087,
358857,
195041,
334312,
104940,
375279,
416255,
350724,
186898,
342546,
350740,
342551,
342555,
416294,
350762,
252463,
358962,
334386,
334397,
358973,
252483,
219719,
399957,
334425,
326240,
375401,
334466,
334469,
162446,
342680,
342685,
260767,
342711,
244410,
260798,
334530,
260802,
350918,
154318,
342737,
391895,
154329,
416476,
64231,
113389,
203508,
375541,
342777,
391938,
391949,
375569,
326417,
375572,
375575,
375580,
162592,
334633,
326444,
383794,
375613,
244542,
375616,
342857,
416599,
342875,
244572,
433001,
400238,
211826,
211832,
392061,
351102,
252801,
260993,
351105,
400260,
211846,
342921,
342931,
252823,
400279,
392092,
400286,
252838,
359335,
211885,
252846,
400307,
351169,
359362,
351172,
170950,
187335,
326599,
359367,
359383,
359389,
383968,
343018,
261109,
261112,
244728,
383999,
261130,
261148,
359452,
211999,
261155,
261160,
261166,
359471,
375868,
343132,
384099,
384102,
384108,
367724,
187503,
343155,
384115,
212095,
351366,
384136,
384140,
384144,
351382,
384152,
384158,
384161,
351399,
384169,
367795,
384182,
367801,
384189,
384192,
351424,
343232,
367817,
244938,
384202,
253132,
384209,
146644,
351450,
384225,
359650,
343272,
351467,
359660,
384247,
351480,
384250,
351483,
351492,
384270,
359695,
261391,
253202,
261395,
384276,
384284,
245021,
384290,
253218,
245032,
171304,
384299,
351535,
245042,
326970,
384324,
212296,
212304,
367966,
367981,
343410,
155000,
327035,
245121,
245128,
253321,
155021,
384398,
245137,
245143,
245146,
245149,
245152,
245155,
155045,
245158,
114093,
327090,
343478,
359867,
384444,
327108,
327112,
384457,
359887,
359891,
368093,
155103,
343535,
343540,
368120,
409092,
253445,
359948,
359951,
245295,
359984,
343610,
400977,
400982,
179803,
155255,
155274,
368289,
245410,
425639,
425652,
425663,
155328,
245463,
155352,
155356,
155364,
245477,
155372,
245487,
212723,
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,
393170,
155604,
155620,
253924,
155622,
253927,
327655,
360432,
393204,
360439,
253944,
393209,
155647
] |
d55957e6fda803d1082ddb7e2841d7f36b76f3f1
|
1886e6e2647fcd1c4394f9fbf4bc9a5833d4a9d3
|
/Calm Cloud/Animation/AnimationManager.swift
|
4f0e3f08e8a1c2d45b6117c54dd88fd24babccd5
|
[] |
no_license
|
kduncanwelke/Calm-Cloud
|
7cc47d06168a1508e30e0dc09ca2271331feae9e
|
73724de439887cf8fb8da5f1270ad480fa52278b
|
refs/heads/master
| 2023-04-08T00:11:12.854485 | 2023-04-03T22:12:37 | 2023-04-03T22:12:37 | 250,662,541 | 1 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 10,999 |
swift
|
//
// AnimationManager.swift
// Calm Cloud
//
// Created by Kate Duncan-Welke on 3/24/20.
// Copyright © 2020 Kate Duncan-Welke. All rights reserved.
//
import Foundation
import UIKit
// manage cloud kitty animations
struct AnimationManager {
static var movingLeftAnimation: [UIImage] {
get {
switch AnimationManager.mood {
case .happy:
return [#imageLiteral(resourceName: "cloudkitty.png"),#imageLiteral(resourceName: "cloudkitty2.png")]
case .unhappy:
return [#imageLiteral(resourceName: "unhappy.png"),#imageLiteral(resourceName: "unhappy2.png")]
case .sad:
return [#imageLiteral(resourceName: "sad.png"),#imageLiteral(resourceName: "sad2.png")]
case .thirsty:
return [#imageLiteral(resourceName: "thirsty.png"),#imageLiteral(resourceName: "thirsty2.png")]
case .hungry:
return [#imageLiteral(resourceName: "hungry.png"),#imageLiteral(resourceName: "hungry2.png")]
case .embarrassed:
return [#imageLiteral(resourceName: "embarrassed.png"),#imageLiteral(resourceName: "embarrassed2.png")]
}
}
}
static var movingRightAnimation: [UIImage] {
get {
switch AnimationManager.mood {
case .happy:
return [#imageLiteral(resourceName: "cloudkittyright.png"),#imageLiteral(resourceName: "cloudkittyright2.png")]
case .unhappy:
return [#imageLiteral(resourceName: "unhappyright.png"),#imageLiteral(resourceName: "unhappyright2.png")]
case .sad:
return [#imageLiteral(resourceName: "sadright.png"),#imageLiteral(resourceName: "sadright2.png")]
case .thirsty:
return [#imageLiteral(resourceName: "thirstyright.png"),#imageLiteral(resourceName: "thirstyright2.png")]
case .hungry:
return [#imageLiteral(resourceName: "hungryright.png"),#imageLiteral(resourceName: "hungryright2.png")]
case .embarrassed:
return [#imageLiteral(resourceName: "embarrassedright1.png"),#imageLiteral(resourceName: "embarrassedright2.png")]
}
}
}
static var lingerAnimation: [UIImage] {
get {
switch AnimationManager.mood {
case .happy:
return [#imageLiteral(resourceName: "cloudkitty.png"),#imageLiteral(resourceName: "cloudkittyright.png")]
case .unhappy:
return [#imageLiteral(resourceName: "unhappy.png"),#imageLiteral(resourceName: "unhappyright.png")]
case .sad:
return [#imageLiteral(resourceName: "sad.png"),#imageLiteral(resourceName: "sadright.png")]
case .thirsty:
return [#imageLiteral(resourceName: "thirsty.png"),#imageLiteral(resourceName: "thirstyright.png")]
case .hungry:
return [#imageLiteral(resourceName: "hungry.png"),#imageLiteral(resourceName: "hungryright.png")]
case .embarrassed:
return [#imageLiteral(resourceName: "embarrassed.png"),#imageLiteral(resourceName: "embarrassedright1.png")]
}
}
}
static var bouncingAnimation: [UIImage] {
get {
let range = [1,2]
let animation = range.randomElement()
switch AnimationManager.mood {
case .happy:
if animation == 1 {
if AnimationManager.location == .ceiling {
return [#imageLiteral(resourceName: "upsidedownbounce1.png"),#imageLiteral(resourceName: "upsidedownbounce2.png")]
} else {
return [#imageLiteral(resourceName: "bounce1.png"),#imageLiteral(resourceName: "bounce2.png")]
}
} else {
if AnimationManager.location == .ceiling {
return [#imageLiteral(resourceName: "upsidedownbounceright1.png"),#imageLiteral(resourceName: "upsidedownbounceright2.png")]
} else {
return [#imageLiteral(resourceName: "bounceright1.png"),#imageLiteral(resourceName: "bounceright2.png")]
}
}
case .unhappy:
if animation == 1 {
return [#imageLiteral(resourceName: "unhappybounce.png"),#imageLiteral(resourceName: "unhappybounce2.png")]
} else {
return [#imageLiteral(resourceName: "unhappybounceright1.png"),#imageLiteral(resourceName: "unhappybounceright2.png")]
}
case .sad:
if animation == 1 {
return [#imageLiteral(resourceName: "sadbounce.png"),#imageLiteral(resourceName: "sadbounce2.png")]
} else {
return [#imageLiteral(resourceName: "sadbounceright1.png"),#imageLiteral(resourceName: "sadbounceright2.png")]
}
case .thirsty:
if animation == 1 {
return [#imageLiteral(resourceName: "thirstybounce.png"),#imageLiteral(resourceName: "thirstybounce2.png")]
} else {
return [#imageLiteral(resourceName: "thirstybounceright1.png"),#imageLiteral(resourceName: "thirstybounceright2.png")]
}
case .hungry:
if animation == 1 {
return [#imageLiteral(resourceName: "hungrybounce.png"),#imageLiteral(resourceName: "hungrybounce2.png")]
} else {
return [#imageLiteral(resourceName: "hungrybounceright1.png"),#imageLiteral(resourceName: "hungrybounceright2.png")]
}
case .embarrassed:
if animation == 1 {
return [#imageLiteral(resourceName: "embarrassedbounce1.png"),#imageLiteral(resourceName: "embarrassedbounce2.png")]
} else {
return [#imageLiteral(resourceName: "embarrassedbounceright1.png"),#imageLiteral(resourceName: "embarrassedbounceright2.png")]
}
}
}
}
static let eatAnimation: [UIImage] = [#imageLiteral(resourceName: "eat1.png"),#imageLiteral(resourceName: "eat2.png")]
static let drinkAnimation: [UIImage] = [#imageLiteral(resourceName: "drink1.png"),#imageLiteral(resourceName: "drink2.png")]
static let playAnimation: [UIImage] = [#imageLiteral(resourceName: "play1.png"),#imageLiteral(resourceName: "play2.png")]
static let digAnimation: [UIImage] = [#imageLiteral(resourceName: "dig.png"),#imageLiteral(resourceName: "dig2.png"),#imageLiteral(resourceName: "dig3.png"),#imageLiteral(resourceName: "dig4.png")]
static let petAnimation: [UIImage] = [#imageLiteral(resourceName: "purr.png"),#imageLiteral(resourceName: "purr2.png")]
static let upsideDownLeft: [UIImage] = [#imageLiteral(resourceName: "upsidedown1.png"),#imageLiteral(resourceName: "upsidedown2.png")]
static let upsideDownRight: [UIImage] = [#imageLiteral(resourceName: "upsidedownright1.png"),#imageLiteral(resourceName: "upsidedownright2.png")]
static var sleepAnimation: [UIImage] {
get {
let range = [1,2]
let animation = range.randomElement()
if animation == 1 {
return [#imageLiteral(resourceName: "sleep.png"),#imageLiteral(resourceName: "sleep2.png")]
} else {
return [#imageLiteral(resourceName: "sleepright.png"),#imageLiteral(resourceName: "sleepright2.png")]
}
}
}
static let playGameAnimation: [UIImage] = [#imageLiteral(resourceName: "playleft.png"),#imageLiteral(resourceName: "cloudkitty.png")]
static var movement: Movement = .staying
static var location: Location = .middle
static var outsideLocation: OutsideLocation = .gate
static var mood: Mood = .happy
static var startImage: UIImage {
get {
switch AnimationManager.mood {
case .happy:
return #imageLiteral(resourceName: "cloudkitty.png")
case .unhappy:
return #imageLiteral(resourceName: "unhappy.png")
case .sad:
return #imageLiteral(resourceName: "sad.png")
case .thirsty:
return #imageLiteral(resourceName: "thirsty.png")
case .hungry:
return #imageLiteral(resourceName: "hungry.png")
case .embarrassed:
return #imageLiteral(resourceName: "embarrassed.png")
}
}
}
static let toyAnimation: [UIImage] = [#imageLiteral(resourceName: "toy.png"),#imageLiteral(resourceName: "toy2.png")]
static let revealAnimation: [UIImage] = [#imageLiteral(resourceName: "cloudkittyright.png"),#imageLiteral(resourceName: "reveal.png")]
static let gameAnimation: [UIImage] = [#imageLiteral(resourceName: "game1.png"),#imageLiteral(resourceName: "game5.png"),#imageLiteral(resourceName: "game4.png"),#imageLiteral(resourceName: "game3.png"),#imageLiteral(resourceName: "game2.png")]
static let fireAnimation : [UIImage] = [#imageLiteral(resourceName: "fire1.png"),#imageLiteral(resourceName: "fire3.png"),#imageLiteral(resourceName: "fire2.png")]
static let fireAnimationColor : [UIImage] = [#imageLiteral(resourceName: "colorfulfire1.png"),#imageLiteral(resourceName: "colorfulfire3.png"),#imageLiteral(resourceName: "colorfulfire2.png")]
}
enum Movement {
case moving
case staying
}
enum Mood {
case happy
case unhappy
case sad
case thirsty
case hungry
case embarrassed
}
enum Location {
case middle
case food
case water
case bed
case toy
case potty
case ceiling
case game
case pillow
}
enum OutsideLocation {
case ceiling
case planter
case front
case back
case gate
case path
case pot
case pots
}
enum Animation {
case moveLeftToBed
case moveLeftToCenter
case moveLeftToFood
case moveLeftToGame
case moveLeftToPotty
case moveLeftToToy
case moveLeftToWater
case moveRightToCenter
case moveRightToFood
case moveRightToPillow
case moveRightToPotty
case moveRightToToy
case moveRightToWater
case floatUp
case eat
case drink
case sleep
case bounce
case linger
case play
case playGame
case moveIntoPotty
case floatLeft
case floatRight
case floatSleep
case pause
}
enum OutsideAnimation {
case moveLeftToBack
case moveLeftToCenter
case moveLeftToPlanter
case moveLeftToWidePot
case moveRightToBack
case moveRightToCenter
case moveRightToGate
case moveRightToPath
case moveRightToPots
case floatUp
case floatLeft
case floatRight
case sleep
case floatSleep
case bounce
case pause
}
|
[
-1
] |
5d012a45798bcb3b627376114fbe72f4419e1061
|
847cc492cb8461bfa76deeb44712c070c26d4887
|
/CavistaiosCodeChallenge/ViewCotrollers/ListViewController.swift
|
44c9205ffb4fad4464316d90fb61bef031cd5966
|
[] |
no_license
|
sourabhwork/CavistaCodeChallenge
|
cd94cb01bed6810dcf86c55129eaf5e260e9a7fc
|
a15566f2a5daf4d8086763e24799cb423ee13cca
|
refs/heads/master
| 2022-11-29T23:12:07.410300 | 2020-08-16T16:18:49 | 2020-08-16T16:18:49 | 287,963,907 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 5,456 |
swift
|
//
// ListViewController.swift
// CavistaiosCodeChallenge
//
// Created by Sourabh Kumbhar on 12/08/20.
// Copyright © 2020 Sourabh Kumbhar. All rights reserved.
//
import UIKit
import SnapKit
class ListViewController: UIViewController {
// Variables
private let tableView = UITableView()
private var progreeView : ProgressHUD?
private var responseModelArray = Array<ResponseDataModel>()
override func loadView() {
super.loadView()
setupUI()
}
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = UIColor.white
self.callFetchData()
}
private func setupUI() {
setupTableView()
setupProgressView()
}
private func setupTableView() {
// Add view to superView
self.view.addSubview(tableView)
// Add constraint to view
tableView.snp.makeConstraints{ (make) in
make.edges.equalToSuperview().inset(UIEdgeInsets(top: 40, left: 0, bottom: 0, right: 0))
}
// Add appearance to view
self.tableView.delegate = self
self.tableView.dataSource = self
self.tableView.tableFooterView = UIView()
self.tableView.register(ListTableViewCell.self, forCellReuseIdentifier: TableCellIdentifire.listTableViewCell)
tableView.separatorColor = .clear
tableView.backgroundView = getTableViewBackgroundLabel()
}
private func setupProgressView() {
progreeView = ProgressHUD(text: ConstantHelper.fetchingData)
self.view.addSubview(progreeView!)
progreeView?.backgroundColor = UIColor.lightGray
progreeView?.hide()
}
}
extension ListViewController {
// Network request
private func callFetchData() {
// Check if internet connection is there if yes then get data from webservice and no then get data from database
if Connectivity.isConnectedToInternet() {
let networkServices = NetworkSerives()
networkServices.fetchData()
networkServices.delegate = self
progreeView?.show()
} else {
responseModelArray = RealmHelper.getResponseData()
}
}
private func filterArray(dataModelArray: Array<ResponseDataModel>) {
// filter according to empty data
self.responseModelArray = dataModelArray.filter({
datamodel in
!(datamodel.data?.isEmpty ?? false)
})
// filter according valid image url
self.responseModelArray = responseModelArray.filter({
datamodel in
if datamodel.type == ConstantHelper.image {
let status = datamodel.data?.isValidURL ?? false ? true : false
return status
} else {
return true
}
})
}
}
// MARK:- Custom delegate
extension ListViewController: NetworkServicesDelegate {
// Here got the data from webservice and store into database
func didGetData(dataModelArray: Array<ResponseDataModel>) {
self.progreeView?.hide()
// Filter array and assign to tableView array
filterArray(dataModelArray: dataModelArray)
tableView.backgroundView?.isHidden = true
RealmHelper.storeResponseData(responseDataArray: responseModelArray)
self.tableView.reloadData()
}
// Error from webservice
func didGetError(error: String) {
self.progreeView?.hide()
tableView.backgroundView?.isHidden = false
self.showAlert(title: ConstantHelper.error, message: error)
}
}
// MARK:- UITableView delegates and datasource
extension ListViewController: UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return 1
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if responseModelArray.count == 0 {
tableView.backgroundView?.isHidden = false
} else {
tableView.backgroundView?.isHidden = true
}
return responseModelArray.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: TableCellIdentifire.listTableViewCell, for: indexPath) as! ListTableViewCell
// check condition for indexPath out of bound then assign data to the cell
if responseModelArray.count > indexPath.row {
let responseModel = responseModelArray[indexPath.row]
cell.configurCell(responseData: responseModel)
}
cell.separatorInset = .zero
return cell
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
self.tableView.deselectRow(at: indexPath, animated: true)
// Navigate to details view controller
let detailsVC = DetailsViewController()
detailsVC.responseDataModel = responseModelArray[indexPath.row]
self.navigationController?.pushViewController(detailsVC, animated: true)
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return UITableView.automaticDimension
}
func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat {
return 140
}
}
|
[
-1
] |
c3d894f94d8f4212edd9b3770909eb7351460175
|
f921307c46bd3b81cc065f76d72e53a85fe1ebea
|
/Tests/bytesTests/Dictionary+DiffTests.swift
|
dd15e725b4fbf2cf589f4f9d2f8758e2772cf3ac
|
[
"MIT"
] |
permissive
|
tbointeractive/bytes
|
5c01f31d41355c9737e43dd4edd8bd5dacc7dc06
|
9444dab5f7e3c40c099ea34beb0fa4761dfb908a
|
refs/heads/develop
| 2022-07-29T17:46:18.868246 | 2022-07-11T16:12:29 | 2022-07-11T16:12:29 | 107,095,227 | 6 | 2 |
MIT
| 2022-07-22T00:57:56 | 2017-10-16T07:49:54 |
Swift
|
UTF-8
|
Swift
| false | false | 909 |
swift
|
//
// Dictionary+DiffTests.swift
//
//
// Created by Thorsten Stark on 27.05.22.
//
import bytes
import XCTest
class DictionaryDiffTests: XCTestCase {
func testDiffShouldContainUnchangedValues() {
let source = ["a":"b"]
let diff = source.diff(to: ["a":"b"])
XCTAssertNil(diff["a"] as Any?)
}
func testDiffShouldReturnNilForValuesNotPresentInDestination() {
let source = ["a":"b"]
let diff = source.diff(to: [:])
XCTAssertNil(diff["a"]!)
}
func testDiffShouldContainChangedValuesComparedToSource() {
let source = ["a":"b"]
let diff = source.diff(to: ["a":"c"])
XCTAssertEqual(diff["a"], "c")
}
func testDiffShouldContainAddedValuesFromDestination() {
let source: [String:String] = [:]
let diff = source.diff(to: ["a":"c"])
XCTAssertEqual(diff["a"], "c")
}
}
|
[
-1
] |
7f8da8177602e6b484d94a6713be70015c3acc01
|
887886c24bcc369f503045944beca2ba184d7cc8
|
/RandomUserKit/UserProvider.swift
|
86657c98bb60be36345cb78c48bee2a08b2c064f
|
[
"MIT"
] |
permissive
|
iOSTestApps/RandomUserKit
|
2f2ec37f38180f1ec8a7b2728e45a9c9365d063d
|
107b5417659ae1196c91cf2240132729305d52d1
|
refs/heads/master
| 2021-05-07T05:46:16.362851 | 2017-11-22T15:18:20 | 2017-11-22T15:18:20 | 111,602,345 | 0 | 0 | null | 2017-11-21T21:38:41 | 2017-11-21T21:17:41 |
Swift
|
UTF-8
|
Swift
| false | false | 2,215 |
swift
|
//
// UserProvider.swift
// RandomUserKit
//
// Created by Romain Pouclet on 2017-11-21.
// Copyright © 2017 Buddybuild. All rights reserved.
//
import Foundation
public struct Response<T: Decodable & Equatable>: Decodable, Equatable {
let results: [T]
public static func ==(lhs: Response<T>, rhs: Response<T>) -> Bool {
return lhs.results == rhs.results
}
}
public struct User: Decodable {
public struct Name: Decodable {
public let first: String
public let last: String
}
public let name: Name
public let email: String
}
extension User.Name: Equatable {
public static func ==(lhs: User.Name, rhs: User.Name) -> Bool {
return lhs.first == rhs.first && lhs.last == rhs.last
}
}
extension User: Equatable {
public static func ==(lhs: User, rhs: User) -> Bool {
return lhs.name == rhs.name && lhs.email == rhs.email
}
}
public enum Result<T, E: Error> {
case success(T)
case failure(E)
}
final public class UserProvider {
public enum ProviderError: Error {
case networkError(Error)
case noResult
case decodingError(Error)
}
public func fetchOne(completion: @escaping (Result<User, ProviderError>) -> Void) -> URLSessionTask {
let request = URLRequest(url: URL(string: "https://randomuser.me/api/?results=1")!)
let task = URLSession.shared.dataTask(with: request) { (data, _, error) in
if let error = error {
completion(.failure(.networkError(error)))
return
}
guard let data = data else {
completion(.failure(.noResult))
return
}
let decoder = JSONDecoder()
do {
let response = try decoder.decode(Response<User>.self, from: data)
if let user = response.results.first {
completion(.success(user))
} else {
completion(.failure(.noResult))
}
} catch let error {
completion(.failure(.decodingError(error)))
}
}
task.resume()
return task
}
}
|
[
-1
] |
1cd203e121bcd2b32420caf9520047b32802720a
|
6ca5b56344404ba63e62cb527ae8014f301f34ba
|
/WZYSwift/Root/循环引用,GCD/XunHuanYInYongVC.swift
|
565b180ce5ed4a13322620db04a44924e20b5840
|
[] |
no_license
|
yuaiyang/WZYSwift
|
f7118710b29316d1f0f8eddac9c79280e8a636d6
|
710cf4cdfd3c66d6441ef899c736c3af1b483e11
|
refs/heads/master
| 2021-08-23T08:36:16.875898 | 2017-12-04T09:59:37 | 2017-12-04T09:59:37 | 113,026,047 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 4,304 |
swift
|
//
// XunHuanYInYongVC.swift
// WZYSwift
//
// Created by ylcf on 17/1/11.
// Copyright © 2017年 wzy. All rights reserved.
//
import UIKit
class XunHuanYInYongVC: UIViewController {
// 声明一个属性
var completionCallBack:(() ->())?
override func viewDidLoad() {
super.viewDidLoad()
// 当闭包对self进行了copy,同时self对闭包引用 才会造成循环引用
demo {
print("看看")
// 这句话应该就进行了循环引用1111111111
// print(self.view)
}
//MARK: -解除循环引用,需要打断链条
// 方法一: weak可能在bei
weak var weakSelf = self
demo1 {
// weakSelf?.view 有延时不会崩溃 只是单纯发送方法
// weakSelf!.view 有延时会崩溃
// !解包用于需要计算,可选项不能直接参与计算
print(weakSelf?.view ?? self)
print(weakSelf!.view ?? self)
}
// 方法二:推荐使用 [weak self]表示{}内所有self都是弱引用,注意需要解包
demo2 {[weak self] in
print(self?.view ?? XunHuanYInYongVC())
}
// 方法三:知道就好 别用
// [unowned self]表示{}中所有self都是assign的,不会强引用,如果对象释放,指针地址不会变化
// 如果对象呗释放,继续调用会出现野指针问题
// 测试 进来马上出去就会崩溃 进来一会在出去就不会崩溃
demo2 {[unowned self] in
print(self.view)
}
}
func demo(completion:@escaping () ->()) -> () {
// 使用属性记录闭包 ->self对闭包进行了引用
completionCallBack = completion;
DispatchQueue.global().async {
for _ in 0...1000 {
print("耗时操作")
}
DispatchQueue.main.async {
// 回调
completion();
}
}
}
func demo1(completion:@escaping () ->()) -> () {
// 使用属性记录闭包 ->self对闭包进行了引用
completionCallBack = completion;
DispatchQueue.global().async {
for _ in 0...1000 {
print("耗时操作")
}
DispatchQueue.main.async {
// 回调
completion();
}
}
}
func demo2(completion:@escaping () ->()) -> () {
// 使用属性记录闭包 ->self对闭包进行了引用
completionCallBack = completion;
DispatchQueue.global().async {
for _ in 0...1000 {
print("耗时操作")
}
DispatchQueue.main.async {
// 回调
completion();
}
}
}
func demo3(completion:@escaping () ->()) -> () {
// 使用属性记录闭包 ->self对闭包进行了引用
completionCallBack = completion;
DispatchQueue.global().async {
for _ in 0...1000 {
print("耗时操作")
}
DispatchQueue.main.async {
// 回调
completion();
}
}
}
// MARK: -用于调试,看是否进行了循环引用,如果循环引用那么就不会调用这个方法 类似于OC dealloc方法
// 如果页面没有调用这个方法,那么就进行了循环引用
deinit {
print("销毁自身")
}
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
] |
745f5ab66b6a13ef99d228143f6e615003e5de93
|
3650c516e9292eaf55d6a5bd18e6ee7ee73c0c11
|
/Sources/DequeModule/Deque._UnsafeHandle.swift
|
ffa633d697a2cca0f23a28b6acb762ee5a9d59a1
|
[
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0",
"Swift-exception"
] |
permissive
|
s3cur3/swift-collections
|
d57ed2df62046ae705c334dd10145778d342ea31
|
dbf193928dc04e0f7c1776b39e24f841100c8f70
|
refs/heads/main
| 2023-05-05T17:46:08.011281 | 2021-06-02T14:54:25 | 2021-06-02T14:54:25 | 360,864,814 | 0 | 0 |
Apache-2.0
| 2021-04-23T11:43:29 | 2021-04-23T11:43:28 | null |
UTF-8
|
Swift
| false | false | 28,829 |
swift
|
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Collections open source project
//
// Copyright (c) 2021 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
//
//===----------------------------------------------------------------------===//
extension Deque {
@usableFromInline
internal struct _UnsafeHandle {
@usableFromInline
let _header: UnsafeMutablePointer<_DequeBufferHeader>
@usableFromInline
let _elements: UnsafeMutablePointer<Element>
#if DEBUG
@usableFromInline
let _isMutable: Bool
#endif
@inlinable
@inline(__always)
init(
header: UnsafeMutablePointer<_DequeBufferHeader>,
elements: UnsafeMutablePointer<Element>,
isMutable: Bool
) {
self._header = header
self._elements = elements
#if DEBUG
self._isMutable = isMutable
#endif
}
}
}
extension Deque._UnsafeHandle {
@inlinable
@inline(__always)
func assertMutable() {
#if DEBUG
assert(_isMutable)
#endif
}
}
extension Deque._UnsafeHandle {
@usableFromInline
internal typealias Slot = _DequeSlot
@inlinable
@inline(__always)
var header: _DequeBufferHeader {
_header.pointee
}
@inlinable
@inline(__always)
var capacity: Int {
_header.pointee.capacity
}
@inlinable
@inline(__always)
var count: Int {
get { _header.pointee.count }
nonmutating set { _header.pointee.count = newValue }
}
@inlinable
@inline(__always)
var startSlot: Slot {
get { _header.pointee.startSlot }
nonmutating set { _header.pointee.startSlot = newValue }
}
@inlinable
@inline(__always)
func ptr(at slot: Slot) -> UnsafeMutablePointer<Element> {
assert(slot.position >= 0 && slot.position <= capacity)
return _elements + slot.position
}
}
extension Deque._UnsafeHandle {
@inlinable
@inline(__always)
var mutableBuffer: UnsafeMutableBufferPointer<Element> {
assertMutable()
return .init(start: _elements, count: _header.pointee.capacity)
}
@inlinable
internal func buffer(for range: Range<Slot>) -> UnsafeBufferPointer<Element> {
assert(range.upperBound.position <= capacity)
return .init(start: _elements + range.lowerBound.position, count: range._count)
}
@inlinable
@inline(__always)
internal func mutableBuffer(for range: Range<Slot>) -> UnsafeMutableBufferPointer<Element> {
assertMutable()
return .init(mutating: buffer(for: range))
}
}
extension Deque._UnsafeHandle {
/// The slot immediately following the last valid one. (`endSlot` refers to
/// the valid slot corresponding to `endIndex`, which is a different thing
/// entirely.)
@inlinable
@inline(__always)
internal var limSlot: Slot {
Slot(at: capacity)
}
@inlinable
internal func slot(after slot: Slot) -> Slot {
assert(slot.position < capacity)
let position = slot.position + 1
if position >= capacity {
return Slot(at: 0)
}
return Slot(at: position)
}
@inlinable
internal func slot(before slot: Slot) -> Slot {
assert(slot.position < capacity)
if slot.position == 0 { return Slot(at: capacity - 1) }
return Slot(at: slot.position - 1)
}
@inlinable
internal func slot(_ slot: Slot, offsetBy delta: Int) -> Slot {
assert(slot.position <= capacity)
let position = slot.position + delta
if delta >= 0 {
if position >= capacity { return Slot(at: position - capacity) }
} else {
if position < 0 { return Slot(at: position + capacity) }
}
return Slot(at: position)
}
@inlinable
@inline(__always)
internal var endSlot: Slot {
slot(startSlot, offsetBy: count)
}
/// Return the storage slot corresponding to the specified offset, which may
/// or may not address an existing element.
@inlinable
internal func slot(forOffset offset: Int) -> Slot {
assert(offset >= 0)
assert(offset <= capacity) // Not `count`!
// Note: The use of wrapping addition/subscription is justified here by the
// fact that `offset` is guaranteed to fall in the range `0 ..< capacity`.
// Eliminating the overflow checks leads to a measurable speedup for
// random-access subscript operations. (Up to 2x on some microbenchmarks.)
let position = startSlot.position &+ offset
guard position < capacity else { return Slot(at: position &- capacity) }
return Slot(at: position)
}
}
extension Deque._UnsafeHandle {
@inlinable
internal func segments() -> _UnsafeWrappedBuffer<Element> {
let wrap = capacity - startSlot.position
if count <= wrap {
return .init(start: ptr(at: startSlot), count: count)
}
return .init(first: ptr(at: startSlot), count: wrap,
second: ptr(at: .zero), count: count - wrap)
}
@inlinable
internal func segments(
forOffsets offsets: Range<Int>
) -> _UnsafeWrappedBuffer<Element> {
assert(offsets.lowerBound >= 0 && offsets.upperBound <= count)
let lower = slot(forOffset: offsets.lowerBound)
let upper = slot(forOffset: offsets.upperBound)
if offsets.count == 0 || lower < upper {
return .init(start: ptr(at: lower), count: offsets.count)
}
return .init(first: ptr(at: lower), count: capacity - lower.position,
second: ptr(at: .zero), count: upper.position)
}
@inlinable
@inline(__always)
internal func mutableSegments() -> _UnsafeMutableWrappedBuffer<Element> {
assertMutable()
return .init(mutating: segments())
}
@inlinable
@inline(__always)
internal func mutableSegments(
forOffsets range: Range<Int>
) -> _UnsafeMutableWrappedBuffer<Element> {
assertMutable()
return .init(mutating: segments(forOffsets: range))
}
}
extension Deque._UnsafeHandle {
@inlinable
internal func availableSegments() -> _UnsafeMutableWrappedBuffer<Element> {
assertMutable()
let endSlot = self.endSlot
guard count < capacity else { return .init(start: ptr(at: endSlot), count: 0) }
if endSlot < startSlot { return .init(mutableBuffer(for: endSlot ..< startSlot)) }
return .init(mutableBuffer(for: endSlot ..< limSlot),
mutableBuffer(for: .zero ..< startSlot))
}
}
extension Deque._UnsafeHandle {
@inlinable
@discardableResult
func initialize(
at start: Slot,
from source: UnsafeBufferPointer<Element>
) -> Slot {
assert(start.position + source.count <= capacity)
guard source.count > 0 else { return start }
ptr(at: start).initialize(from: source.baseAddress!, count: source.count)
return Slot(at: start.position + source.count)
}
@inlinable
@inline(__always)
@discardableResult
func moveInitialize(
at start: Slot,
from source: UnsafeMutableBufferPointer<Element>
) -> Slot {
assert(start.position + source.count <= capacity)
guard source.count > 0 else { return start }
ptr(at: start).moveInitialize(from: source.baseAddress!, count: source.count)
return Slot(at: start.position + source.count)
}
@inlinable
@inline(__always)
@discardableResult
public func move(
from source: Slot,
to target: Slot,
count: Int
) -> (source: Slot, target: Slot) {
assert(count >= 0)
assert(source.position + count <= self.capacity)
assert(target.position + count <= self.capacity)
guard count > 0 else { return (source, target) }
ptr(at: target).moveInitialize(from: ptr(at: source), count: count)
return (slot(source, offsetBy: count), slot(target, offsetBy: count))
}
}
extension Deque._UnsafeHandle {
/// Copy elements into a new storage instance without changing capacity or
/// layout.
@inlinable
internal func copyElements() -> Deque._Storage {
let object = _DequeBuffer<Element>.create(
minimumCapacity: capacity,
makingHeaderWith: { _ in header })
let result = Deque._Storage(_buffer: ManagedBufferPointer(unsafeBufferObject: object))
guard self.count > 0 else { return result }
result.update { target in
let source = self.segments()
target.initialize(at: startSlot, from: source.first)
if let second = source.second {
target.initialize(at: .zero, from: second)
}
}
return result
}
/// Copy elements into a new storage instance with the specified minimum
/// capacity.
@inlinable
internal func copyElements(minimumCapacity: Int) -> Deque._Storage {
assert(minimumCapacity >= count)
let object = _DequeBuffer<Element>.create(
minimumCapacity: minimumCapacity,
makingHeaderWith: {
_DequeBufferHeader(
capacity: $0.capacity,
count: count,
startSlot: .zero)
})
let result = Deque._Storage(_buffer: ManagedBufferPointer(unsafeBufferObject: object))
guard count > 0 else { return result }
result.update { target in
assert(target.count == count && target.startSlot.position == 0)
let source = self.segments()
let next = target.initialize(at: .zero, from: source.first)
if let second = source.second {
target.initialize(at: next, from: second)
}
}
return result
}
/// Move elements into a new storage instance with the specified minimum
/// capacity. Existing indices in `self` won't necessarily be valid in the
/// result. `self` is left empty.
@inlinable
internal func moveElements(minimumCapacity: Int) -> Deque._Storage {
assertMutable()
let count = self.count
assert(minimumCapacity >= count)
let object = _DequeBuffer<Element>.create(
minimumCapacity: minimumCapacity,
makingHeaderWith: {
_DequeBufferHeader(
capacity: $0.capacity,
count: count,
startSlot: .zero)
})
let result = Deque._Storage(_buffer: ManagedBufferPointer(unsafeBufferObject: object))
guard count > 0 else { return result }
result.update { target in
let source = self.mutableSegments()
let next = target.moveInitialize(at: .zero, from: source.first)
if let second = source.second {
target.moveInitialize(at: next, from: second)
}
}
self.count = 0
return result
}
}
extension Deque._UnsafeHandle {
@inlinable
internal func withUnsafeSegment<R>(
startingAt start: Int,
maximumCount: Int?,
_ body: (UnsafeBufferPointer<Element>) throws -> R
) rethrows -> (end: Int, result: R) {
assert(start <= count)
guard start < count else {
return try (count, body(UnsafeBufferPointer(start: nil, count: 0)))
}
let endSlot = self.endSlot
let segmentStart = self.slot(forOffset: start)
let segmentEnd = segmentStart < endSlot ? endSlot : limSlot
let count = Swift.min(maximumCount ?? Int.max, segmentEnd.position - segmentStart.position)
let result = try body(UnsafeBufferPointer(start: ptr(at: segmentStart), count: count))
return (start + count, result)
}
}
// MARK: Replacement
extension Deque._UnsafeHandle {
/// Replace the elements in `range` with `newElements`. The deque's count must
/// not change as a result of calling this function.
///
/// This function does not validate its input arguments in release builds. Nor
/// does it ensure that the storage buffer is uniquely referenced.
@inlinable
internal func uncheckedReplaceInPlace<C: Collection>(
inOffsets range: Range<Int>,
with newElements: C
) where C.Element == Element {
assertMutable()
assert(range.upperBound <= count)
assert(newElements.count == range.count)
guard !range.isEmpty else { return }
let target = mutableSegments(forOffsets: range)
target.assign(from: newElements)
}
}
// MARK: Appending
extension Deque._UnsafeHandle {
/// Append `element` to this buffer. The buffer must have enough free capacity
/// to insert one new element.
///
/// This function does not validate its input arguments in release builds. Nor
/// does it ensure that the storage buffer is uniquely referenced.
@inlinable
internal func uncheckedAppend(_ element: Element) {
assertMutable()
assert(count < capacity)
ptr(at: endSlot).initialize(to: element)
count += 1
}
/// Append the contents of `source` to this buffer. The buffer must have
/// enough free capacity to insert the new elements.
///
/// This function does not validate its input arguments in release builds. Nor
/// does it ensure that the storage buffer is uniquely referenced.
@inlinable
internal func uncheckedAppend(contentsOf source: UnsafeBufferPointer<Element>) {
assertMutable()
assert(count + source.count <= capacity)
guard source.count > 0 else { return }
let c = self.count
count += source.count
let gap = mutableSegments(forOffsets: c ..< count)
gap.initialize(from: source)
}
}
// MARK: Prepending
extension Deque._UnsafeHandle {
@inlinable
internal func uncheckedPrepend(_ element: Element) {
assertMutable()
assert(count < capacity)
let slot = self.slot(before: startSlot)
ptr(at: slot).initialize(to: element)
startSlot = slot
count += 1
}
/// Prepend the contents of `source` to this buffer. The buffer must have
/// enough free capacity to insert the new elements.
///
/// This function does not validate its input arguments in release builds. Nor
/// does it ensure that the storage buffer is uniquely referenced.
@inlinable
internal func uncheckedPrepend(contentsOf source: UnsafeBufferPointer<Element>) {
assertMutable()
assert(count + source.count <= capacity)
guard source.count > 0 else { return }
let oldStart = startSlot
let newStart = self.slot(startSlot, offsetBy: -source.count)
startSlot = newStart
count += source.count
let gap = mutableWrappedBuffer(between: newStart, and: oldStart)
gap.initialize(from: source)
}
}
// MARK: Insertion
extension Deque._UnsafeHandle {
/// Insert all elements from `newElements` into this deque, starting at
/// `offset`.
///
/// This function does not validate its input arguments in release builds. Nor
/// does it ensure that the storage buffer is uniquely referenced.
///
/// - Parameter newElements: The elements to insert.
/// - Parameter newCount: Must be equal to `newElements.count`. Used to
/// prevent calling `count` more than once.
/// - Parameter offset: The desired offset from the start at which to place
/// the first element.
@inlinable
internal func uncheckedInsert<C: Collection>(
contentsOf newElements: __owned C,
count newCount: Int,
atOffset offset: Int
) where C.Element == Element {
assertMutable()
assert(offset <= count)
assert(newElements.count == newCount)
guard newCount > 0 else { return }
let gap = openGap(ofSize: newCount, atOffset: offset)
gap.initialize(from: newElements)
}
@inlinable
internal func mutableWrappedBuffer(
between start: Slot,
and end: Slot
) -> _UnsafeMutableWrappedBuffer<Element> {
assert(start.position <= capacity)
assert(end.position <= capacity)
if start < end {
return .init(start: ptr(at: start), count: end.position - start.position)
}
return .init(
first: ptr(at: start), count: capacity - start.position,
second: ptr(at: .zero), count: end.position)
}
/// Slide elements around so that there is a gap of uninitialized slots of
/// size `gapSize` starting at `offset`, and return a (potentially wrapped)
/// buffer holding the newly inserted slots.
///
/// This function does not validate its input arguments in release builds. Nor
/// does it ensure that the storage buffer is uniquely referenced.
///
/// - Parameter gapSize: The number of uninitialized slots to create.
/// - Parameter offset: The offset from the start at which the uninitialized
/// slots should start.
@inlinable
internal func openGap(
ofSize gapSize: Int,
atOffset offset: Int
) -> _UnsafeMutableWrappedBuffer<Element> {
assertMutable()
assert(offset >= 0 && offset <= self.count)
assert(self.count + gapSize <= capacity)
assert(gapSize > 0)
let headCount = offset
let tailCount = count - offset
if tailCount <= headCount {
// Open the gap by sliding elements to the right.
let originalEnd = self.slot(startSlot, offsetBy: count)
let newEnd = self.slot(startSlot, offsetBy: count + gapSize)
let gapStart = self.slot(forOffset: offset)
let gapEnd = self.slot(gapStart, offsetBy: gapSize)
let sourceIsContiguous = gapStart <= originalEnd.orIfZero(capacity)
let targetIsContiguous = gapEnd <= newEnd.orIfZero(capacity)
if sourceIsContiguous && targetIsContiguous {
// No need to deal with wrapping; we just need to slide
// elements after the gap.
// Illustrated steps: (underscores mark eventual gap position)
//
// 0) ....ABCDE̲F̲G̲H..... EFG̲H̲.̲........ABCD .̲.......ABCDEFGH̲.̲
// 1) ....ABCD.̲.̲.̲EFGH.. EF.̲.̲.̲GH......ABCD .̲H......ABCDEFG.̲.̲
move(from: gapStart, to: gapEnd, count: tailCount)
} else if targetIsContiguous {
// The gap itself will be wrapped.
// Illustrated steps: (underscores mark eventual gap position)
//
// 0) E̲FGH.........ABC̲D̲
// 1) .̲..EFGH......ABC̲D̲
// 2) .̲CDEFGH......AB.̲.̲
assert(startSlot > originalEnd.orIfZero(capacity))
move(from: .zero, to: Slot.zero.advanced(by: gapSize), count: originalEnd.position)
move(from: gapStart, to: gapEnd, count: capacity - gapStart.position)
} else if sourceIsContiguous {
// Opening the gap pushes subsequent elements across the wrap.
// Illustrated steps: (underscores mark eventual gap position)
//
// 0) ........ABC̲D̲E̲FGH.
// 1) GH......ABC̲D̲E̲F...
// 2) GH......AB.̲.̲.̲CDEF
move(from: limSlot.advanced(by: -gapSize), to: .zero, count: newEnd.position)
move(from: gapStart, to: gapEnd, count: tailCount - newEnd.position)
} else {
// The rest of the items are wrapped, and will remain so.
// Illustrated steps: (underscores mark eventual gap position)
//
// 0) GH.........AB̲C̲D̲EF
// 1) ...GH......AB̲C̲D̲EF
// 2) DEFGH......AB̲C̲.̲..
// 3) DEFGH......A.̲.̲.̲BC
move(from: .zero, to: Slot.zero.advanced(by: gapSize), count: originalEnd.position)
move(from: limSlot.advanced(by: -gapSize), to: .zero, count: gapSize)
move(from: gapStart, to: gapEnd, count: tailCount - gapSize - originalEnd.position)
}
count += gapSize
return mutableWrappedBuffer(between: gapStart, and: gapEnd.orIfZero(capacity))
}
// Open the gap by sliding elements to the left.
let originalStart = self.startSlot
let newStart = self.slot(originalStart, offsetBy: -gapSize)
let gapEnd = self.slot(forOffset: offset)
let gapStart = self.slot(gapEnd, offsetBy: -gapSize)
let sourceIsContiguous = originalStart <= gapEnd.orIfZero(capacity)
let targetIsContiguous = newStart <= gapStart.orIfZero(capacity)
if sourceIsContiguous && targetIsContiguous {
// No need to deal with any wrapping.
// Illustrated steps: (underscores mark eventual gap position)
//
// 0) ....A̲B̲C̲DEFGH... GH.........̲A̲B̲CDEF .̲A̲B̲CDEFGH.......̲.̲
// 1) .ABC.̲.̲.̲DEFGH... GH......AB.̲.̲.̲CDEF .̲.̲.̲CDEFGH....AB.̲.̲
move(from: originalStart, to: newStart, count: headCount)
} else if targetIsContiguous {
// The gap itself will be wrapped.
// Illustrated steps: (underscores mark eventual gap position)
//
// 0) C̲D̲EFGH.........A̲B̲
// 1) C̲D̲EFGH.....AB...̲.̲
// 2) .̲.̲EFGH.....ABCD.̲.̲
assert(originalStart >= newStart)
move(from: originalStart, to: newStart, count: capacity - originalStart.position)
move(from: .zero, to: limSlot.advanced(by: -gapSize), count: gapEnd.position)
} else if sourceIsContiguous {
// Opening the gap pushes preceding elements across the wrap.
// Illustrated steps: (underscores mark eventual gap position)
//
// 0) .AB̲C̲D̲EFGH.........
// 1) ...̲C̲D̲EFGH.......AB
// 2) CD.̲.̲.̲EFGH.......AB
move(from: originalStart, to: newStart, count: capacity - newStart.position)
move(from: Slot.zero.advanced(by: gapSize), to: .zero, count: gapStart.position)
} else {
// The preceding of the items are wrapped, and will remain so.
// Illustrated steps: (underscores mark eventual gap position)
// 0) CD̲E̲F̲GHIJKL.........AB
// 1) CD̲E̲F̲GHIJKL......AB...
// 2) ..̲.̲F̲GHIJKL......ABCDE
// 3) F.̲.̲.̲GHIJKL......ABCDE
move(from: originalStart, to: newStart, count: capacity - originalStart.position)
move(from: .zero, to: limSlot.advanced(by: -gapSize), count: gapSize)
move(from: Slot.zero.advanced(by: gapSize), to: .zero, count: gapStart.position)
}
startSlot = newStart
count += gapSize
return mutableWrappedBuffer(between: gapStart, and: gapEnd.orIfZero(capacity))
}
}
// MARK: Removal
extension Deque._UnsafeHandle {
@inlinable
internal func uncheckedRemoveFirst() -> Element {
assertMutable()
assert(count > 0)
let result = ptr(at: startSlot).move()
startSlot = slot(after: startSlot)
count -= 1
return result
}
@inlinable
internal func uncheckedRemoveLast() -> Element {
assertMutable()
assert(count > 0)
let slot = self.slot(forOffset: count - 1)
let result = ptr(at: slot).move()
count -= 1
return result
}
@inlinable
internal func uncheckedRemoveFirst(_ n: Int) {
assertMutable()
assert(count >= n)
guard n > 0 else { return }
let target = mutableSegments(forOffsets: 0 ..< n)
target.deinitialize()
startSlot = slot(startSlot, offsetBy: n)
count -= n
}
@inlinable
internal func uncheckedRemoveLast(_ n: Int) {
assertMutable()
assert(count >= n)
guard n > 0 else { return }
let target = mutableSegments(forOffsets: count - n ..< count)
target.deinitialize()
count -= n
}
/// Remove all elements stored in this instance, deinitializing their storage.
///
/// This method does not ensure that the storage buffer is uniquely
/// referenced.
@inlinable
internal func uncheckedRemoveAll() {
assertMutable()
guard count > 0 else { return }
let target = mutableSegments()
target.deinitialize()
count = 0
startSlot = .zero
}
/// Remove all elements in `bounds`, deinitializing their storage and sliding
/// remaining elements to close the resulting gap.
///
/// This function does not validate its input arguments in release builds. Nor
/// does it ensure that the storage buffer is uniquely referenced.
@inlinable
internal func uncheckedRemove(offsets bounds: Range<Int>) {
assertMutable()
assert(bounds.lowerBound >= 0 && bounds.upperBound <= self.count)
// Deinitialize elements in `bounds`.
mutableSegments(forOffsets: bounds).deinitialize()
closeGap(offsets: bounds)
}
/// Close the gap of already uninitialized elements in `bounds`, sliding
/// elements outside of the gap to eliminate it.
///
/// This function does not validate its input arguments in release builds. Nor
/// does it ensure that the storage buffer is uniquely referenced.
@inlinable
internal func closeGap(offsets bounds: Range<Int>) {
assertMutable()
assert(bounds.lowerBound >= 0 && bounds.upperBound <= self.count)
let gapSize = bounds.count
guard gapSize > 0 else { return }
let gapStart = self.slot(forOffset: bounds.lowerBound)
let gapEnd = self.slot(forOffset: bounds.upperBound)
let headCount = bounds.lowerBound
let tailCount = count - bounds.upperBound
if headCount >= tailCount {
// Close the gap by sliding elements to the left.
let originalEnd = endSlot
let newEnd = self.slot(forOffset: count - gapSize)
let sourceIsContiguous = gapEnd < originalEnd.orIfZero(capacity)
let targetIsContiguous = gapStart <= newEnd.orIfZero(capacity)
if tailCount == 0 {
// No need to move any elements.
} else if sourceIsContiguous && targetIsContiguous {
// No need to deal with wrapping.
// 0) ....ABCD.̲.̲.̲EFGH.. EF.̲.̲.̲GH........ABCD .̲.̲.̲E..........ABCD.̲.̲ .̲.̲.̲EF........ABCD .̲.̲.̲DE.......ABC
// 1) ....ABCDE̲F̲G̲H..... EFG̲H̲.̲..........ABCD .̲.̲.̲...........ABCDE̲.̲ E̲F̲.̲..........ABCD D̲E̲.̲.........ABC
move(from: gapEnd, to: gapStart, count: tailCount)
} else if sourceIsContiguous {
// The gap lies across the wrap from the subsequent elements.
// 0) .̲.̲.̲EFGH.......ABCD.̲.̲ EFGH.......ABCD.̲.̲.̲
// 1) .̲.̲.̲..GH.......ABCDE̲F̲ ..GH.......ABCDE̲F̲G̲
// 2) G̲H̲.̲...........ABCDE̲F̲ GH.........ABCDE̲F̲G̲
let c = capacity - gapStart.position
assert(tailCount > c)
let next = move(from: gapEnd, to: gapStart, count: c)
move(from: next.source, to: .zero, count: tailCount - c)
} else if targetIsContiguous {
// We need to move elements across a wrap, but the wrap will
// disappear when we're done.
// 0) HI....ABCDE.̲.̲.̲FG
// 1) HI....ABCDEF̲G̲.̲..
// 2) ......ABCDEF̲G̲H̲I.
let next = move(from: gapEnd, to: gapStart, count: capacity - gapEnd.position)
move(from: .zero, to: next.target, count: originalEnd.position)
} else {
// We need to move elements across a wrap that won't go away.
// 0) HIJKL....ABCDE.̲.̲.̲FG
// 1) HIJKL....ABCDEF̲G̲.̲..
// 2) ...KL....ABCDEF̲G̲H̲IJ
// 3) KL.......ABCDEF̲G̲H̲IJ
var next = move(from: gapEnd, to: gapStart, count: capacity - gapEnd.position)
next = move(from: .zero, to: next.target, count: gapSize)
move(from: next.source, to: .zero, count: newEnd.position)
}
count -= gapSize
} else {
// Close the gap by sliding elements to the right.
let originalStart = startSlot
let newStart = slot(startSlot, offsetBy: gapSize)
let sourceIsContiguous = originalStart < gapStart.orIfZero(capacity)
let targetIsContiguous = newStart <= gapEnd.orIfZero(capacity)
if headCount == 0 {
// No need to move any elements.
} else if sourceIsContiguous && targetIsContiguous {
// No need to deal with wrapping.
// 0) ....ABCD.̲.̲.̲EFGH..... EFGH........AB.̲.̲.̲CD .̲.̲.̲CDEFGH.......AB.̲.̲ DEFGH.......ABC.̲.̲
// 1) .......AB̲C̲D̲EFGH..... EFGH...........̲A̲B̲CD .̲A̲B̲CDEFGH..........̲.̲ DEFGH.........AB̲C̲ ABCDEFGH........̲.̲.̲
move(from: originalStart, to: newStart, count: headCount)
} else if sourceIsContiguous {
// The gap lies across the wrap from the preceding elements.
// 0) .̲.̲DEFGH.......ABC.̲.̲ .̲.̲.̲EFGH.......ABCD
// 1) B̲C̲DEFGH.......A...̲.̲ B̲C̲D̲DEFGH......A...
// 2) B̲C̲DEFGH...........̲A̲ B̲C̲D̲DEFGH.........A
move(from: limSlot.advanced(by: -gapSize), to: .zero, count: gapEnd.position)
move(from: startSlot, to: newStart, count: headCount - gapEnd.position)
} else if targetIsContiguous {
// We need to move elements across a wrap, but the wrap will
// disappear when we're done.
// 0) CD.̲.̲.̲EFGHI.....AB
// 1) ...̲C̲D̲EFGHI.....AB
// 1) .AB̲C̲D̲EFGHI.......
move(from: .zero, to: gapEnd.advanced(by: -gapStart.position), count: gapStart.position)
move(from: startSlot, to: newStart, count: headCount - gapStart.position)
} else {
// We need to move elements across a wrap that won't go away.
// 0) FG.̲.̲.̲HIJKLMNO....ABCDE
// 1) ...̲F̲G̲HIJKLMNO....ABCDE
// 2) CDE̲F̲G̲HIJKLMNO....AB...
// 3) CDE̲F̲G̲HIJKLMNO.......AB
move(from: .zero, to: Slot.zero.advanced(by: gapSize), count: gapStart.position)
move(from: limSlot.advanced(by: -gapSize), to: .zero, count: gapSize)
move(from: startSlot, to: newStart, count: headCount - gapEnd.position)
}
startSlot = newStart
count -= gapSize
}
}
}
|
[
145800
] |
6b99fc3d7e5df37afbe7f7d9c96bd57536f6961c
|
51d2e55d1aa89cd86ddc99677c0cae88abc512f0
|
/iOS/Labs8-MealHelper/Labs8-MealHelper/Networking/GenericAPIClient.swift
|
6afcd53c55a87039bb1212ab82e85fed69fd95ac
|
[] |
no_license
|
PatrickTheCodeGuy/Labs8-MealHelper
|
b22bf1069f76fa1972a201773dfcd4508a273e52
|
a6a64d37d7dd5c17ca2e0e2a735f593542ab0b38
|
refs/heads/master
| 2020-04-12T02:06:36.473517 | 2019-03-03T01:50:53 | 2019-03-03T01:50:53 | 162,238,325 | 0 | 0 | null | 2018-12-18T06:04:06 | 2018-12-18T06:04:05 | null |
UTF-8
|
Swift
| false | false | 6,373 |
swift
|
//
// GenericAPIClient.swift
// Labs8-MealHelper
//
// Created by Simon Elhoej Steinmejer on 05/12/18.
// Copyright © 2018 De MicheliStefano. All rights reserved.
//
import UIKit
class GenericAPIClient {
func url(with baseUrl: URL, pathComponents: [String]) -> URL {
var url = baseUrl
pathComponents.forEach { url.appendPathComponent($0) }
return url
}
func fetch<Resource: Codable>(from url: URL, using session: URLSession = URLSession.shared, completion: @escaping ((Response<Resource>) -> ())) {
session.dataTask(with: url) { (data, res, error) in
if let error = error {
NSLog("Error with FETCH urlRequest: \(error)")
completion(Response.error(error))
return
}
guard let data = data else {
NSLog("No data returned")
completion(Response.error(NSError(domain: "com.stefano.Labs8-MealHelper.ErrorDomain", code: -1, userInfo: nil)))
return
}
if let httpResponse = res as? HTTPURLResponse {
if httpResponse.statusCode != 200 {
NSLog("An error code was returned from the http request: \(httpResponse.statusCode)")
completion(Response.error(NSError()))
return
}
}
do {
let ressource = try JSONDecoder().decode(Resource.self, from: data)
completion(Response.success(ressource))
} catch {
NSLog("Error decoding data: \(error)")
completion(Response.error(error))
return
}
}.resume()
}
func put(with url: URL, requestBody: Dictionary<String, Any>, completion: @escaping (Response<String>) -> ()) {
var urlRequest = URLRequest(url: url)
urlRequest.httpMethod = HTTPMethod.put.rawValue
urlRequest.addValue("application/json", forHTTPHeaderField: "Content-Type")
do {
let requestBody = requestBody
let encoder = JSONEncoder()
encoder.outputFormatting = .prettyPrinted
let jsonData = try JSONSerialization.data(withJSONObject: requestBody, options: .prettyPrinted) //encoder.encode(requestBody)
urlRequest.httpBody = jsonData
} catch {
NSLog("Failed to encode foods: \(error)")
completion(Response.error(error))
return
}
URLSession.shared.dataTask(with: urlRequest) { (data, res, error) in
if let error = error {
NSLog("Error with PUT urlRequest: \(error)")
completion(Response.error(error))
return
}
if let httpResponse = res as? HTTPURLResponse {
if httpResponse.statusCode != 200 {
NSLog("An error code was returned from the http request: \(httpResponse.statusCode)")
completion(Response.error(NSError()))
return
}
}
completion(Response.success("Success"))
}.resume()
}
func post<Resource: Codable>(with url: URL, requestBody: Dictionary<String, Any>, using session: URLSession = URLSession.shared, completion: @escaping ((Response<Resource>) -> ())) {
var urlRequest = URLRequest(url: url)
urlRequest.httpMethod = HTTPMethod.post.rawValue
urlRequest.addValue("application/json", forHTTPHeaderField: "Content-Type")
do {
let requestBody = requestBody
let encoder = JSONEncoder()
encoder.outputFormatting = .prettyPrinted
let jsonData = try JSONSerialization.data(withJSONObject: requestBody, options: .prettyPrinted) //encoder.encode(requestBody)
urlRequest.httpBody = jsonData
} catch {
NSLog("Failed to encode foods: \(error)")
completion(Response.error(error))
return
}
URLSession.shared.dataTask(with: urlRequest) { (data, res, error) in
if let error = error {
NSLog("Error with POST urlRequest: \(error)")
completion(Response.error(error))
return
}
guard let data = data else {
NSLog("No data returned")
completion(Response.error(NSError(domain: "com.stefano.Labs8-MealHelper.ErrorDomain", code: -1, userInfo: nil)))
return
}
if let httpResponse = res as? HTTPURLResponse {
if httpResponse.statusCode != 200 {
NSLog("An error code was returned from the http request: \(httpResponse.statusCode)")
completion(Response.error(NSError()))
return
}
}
do {
let response = try JSONDecoder().decode(Resource.self, from: data)
completion(Response.success(response))
} catch {
NSLog("Error decoding data: \(error)")
completion(Response.error(error))
return
}
}.resume()
}
func delete(with url: URL, using session: URLSession = URLSession.shared, completion: @escaping ((Response<String>) -> ())) {
var urlRequest = URLRequest(url: url)
urlRequest.httpMethod = HTTPMethod.delete.rawValue
URLSession.shared.dataTask(with: urlRequest) { (data, res, error) in
if let error = error {
NSLog("Error with DELETE urlRequest: \(error)")
completion(Response.error(error))
return
}
if let httpResponse = res as? HTTPURLResponse {
if httpResponse.statusCode != 200 {
NSLog("An error code was returned from the http request: \(httpResponse.statusCode)")
completion(Response.error(NSError()))
return
}
}
completion(Response.success("Success"))
}.resume()
}
}
|
[
-1
] |
7019ec82827147697a674a18f05784cf73b5176a
|
e152a94e646e1b24dcf3ba9eb97b70bbb5537b48
|
/SwiftUIMVVMUnitDemo/ViewModel/RepositoryDetailViewModel.swift
|
af0b502d5fb82ef4935c0474d57a466100986d56
|
[] |
no_license
|
Ashwini1Sapre/SwiftUIMVVMUnitDemo
|
ee35aa14b851ffe7e79df74b753dc7f70d6ce894
|
be9155b7531ee67a0a273a257f4ad90fd714561a
|
refs/heads/main
| 2023-02-08T08:36:33.696688 | 2020-12-30T13:33:06 | 2020-12-30T13:33:06 | 325,558,885 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 577 |
swift
|
//
// RepositoryDetailViewModel.swift
// SwiftUIMVVMUnitDemo
//
// Created by Knoxpo MacBook Pro on 30/12/20.
//
import Foundation
import SwiftUI
import Combine
final class RepositoryDetailViewModel: ObservableObject {
let objectWillChange: AnyPublisher<RepositoryListViewModel, Never>
let objectWillChangeSubject = PassthroughSubject<RepositoryListViewModel, Never>()
let repository: Repository
init(repository: Repository) {
objectWillChange = objectWillChangeSubject.eraseToAnyPublisher()
self.repository = repository
}
}
|
[
-1
] |
fe3f1e0c3fac257cb53d825b6a61c6caa8b3bc5e
|
23aa7fbb5d2c29744bc1a54c0cc0b83550d0aac1
|
/HyVal/Application/AppDelegate.swift
|
af6324b10c7107c1bd635782806fe588988eeec0
|
[] |
no_license
|
Puriscope/Cogniteq_HyVal
|
3b7ce935265ad8728301f6b387252533e1fde38d
|
5a9d83f9a46049bd14fa7499a4ae52eea038cace
|
refs/heads/master
| 2023-06-02T05:55:37.370789 | 2021-06-29T08:40:33 | 2021-06-29T08:40:33 | 381,260,161 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,344 |
swift
|
//
// AppDelegate.swift
// HyVal
//
// Created by Egor Syrtcov on 4/28/21.
//
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,
418007,
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,
246123,
262507,
262510,
213372,
385419,
393612,
262550,
262552,
385440,
385443,
262566,
385451,
262573,
393647,
385458,
262586,
344511,
262592,
360916,
369118,
328177,
328179,
328182,
328189,
328192,
164361,
410128,
393747,
254490,
188958,
385570,
33316,
377383,
197159,
352821,
197177,
418363,
188987,
369223,
385609,
385616,
352864,
369253,
262760,
352874,
352887,
254587,
377472,
148105,
377484,
352918,
98968,
344744,
361129,
336555,
385713,
434867,
164534,
336567,
328378,
164538,
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,
328519,
361288,
336711,
328522,
336714,
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,
337205,
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,
403075,
345736,
198280,
403091,
345749,
419483,
345757,
345762,
419491,
345765,
419497,
419501,
370350,
419506,
419509,
419512,
337592,
419517,
337599,
419527,
419530,
419535,
272081,
394966,
419542,
419544,
181977,
345818,
419547,
419550,
419559,
337642,
419563,
337645,
370415,
337659,
141051,
337668,
362247,
395021,
362255,
116509,
345887,
378663,
345905,
354106,
354111,
247617,
354117,
370503,
329544,
370509,
354130,
247637,
337750,
370519,
313180,
354142,
354150,
354156,
345967,
345970,
345974,
403320,
354172,
247691,
337808,
247700,
329623,
436126,
436132,
337833,
362413,
337844,
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,
338403,
338409,
248308,
199164,
330252,
199186,
330267,
354855,
10828,
199249,
346721,
174695,
248425,
191084,
191092,
346742,
330383,
354974,
150183,
174774,
248504,
174777,
223934,
355024,
355028,
273108,
264918,
183005,
256734,
436962,
338660,
338664,
264941,
363251,
207619,
264964,
338700,
256786,
199452,
363293,
396066,
346916,
396069,
215853,
355122,
355131,
355140,
355143,
338763,
355150,
330580,
355166,
265055,
265058,
355175,
387944,
355179,
330610,
355218,
330642,
412599,
207808,
379848,
396245,
330710,
248792,
248798,
347105,
257008,
183282,
265207,
330748,
265214,
330760,
330768,
248862,
347176,
396328,
158761,
199728,
396336,
330800,
396339,
339001,
388154,
388161,
347205,
330826,
412764,
339036,
257120,
265320,
248951,
420984,
330889,
347287,
248985,
339097,
44197,
380070,
339112,
126144,
330958,
330965,
265432,
265436,
388319,
388347,
175375,
159005,
175396,
208166,
273708,
347437,
372015,
347441,
372018,
199988,
44342,
175415,
396600,
437566,
175423,
437570,
437575,
437583,
331088,
437587,
331093,
396633,
175450,
437595,
175457,
208227,
175460,
175463,
265580,
437620,
175477,
249208,
175483,
249214,
175486,
175489,
249218,
249224,
249227,
249234,
175513,
175516,
396705,
175522,
355748,
380332,
396722,
208311,
372163,
216517,
380360,
216522,
339404,
372176,
208337,
339412,
413141,
339417,
339420,
249308,
339424,
249312,
339428,
339434,
249328,
69113,
372228,
208398,
380432,
175635,
265778,
265795,
396872,
265805,
224853,
224857,
257633,
224870,
372327,
257646,
372337,
224884,
224887,
224890,
224894,
372353,
224897,
216707,
421508,
126596,
224904,
224909,
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,
372664,
372702,
372706,
356335,
380918,
372738,
405533,
430129,
266294,
266297,
421960,
356439,
430180,
421990,
266350,
356466,
266362,
381068,
225423,
250002,
250004,
225429,
356506,
225437,
135327,
225441,
438433,
225444,
438436,
225447,
438440,
225450,
258222,
225455,
430256,
225458,
225461,
225466,
389307,
225470,
381120,
372929,
430274,
225475,
389320,
225484,
225487,
225490,
225493,
266453,
225496,
225499,
225502,
225505,
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,
332106,
332117,
348502,
250199,
250202,
332125,
250210,
348522,
348525,
348527,
332152,
389502,
250238,
332161,
356740,
332172,
373145,
340379,
389550,
324030,
266687,
160234,
127471,
340472,
381436,
324094,
266754,
324099,
324102,
324111,
340500,
324117,
324131,
332324,
381481,
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,
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,
340858,
340861,
324478,
324481,
373634,
398211,
324484,
324487,
381833,
324492,
324495,
430995,
324501,
324510,
422816,
324513,
398245,
201637,
324524,
340909,
324533,
324538,
324541,
398279,
340939,
340941,
209873,
340957,
431072,
398306,
340963,
209895,
201711,
349172,
349180,
439294,
431106,
357410,
250914,
185380,
357418,
209965,
209968,
209975,
209979,
209987,
209995,
341071,
349267,
250967,
210010,
341091,
210025,
210027,
210030,
210036,
210039,
349308,
210044,
349311,
160895,
152703,
210052,
210055,
349319,
218247,
210067,
210071,
210077,
210080,
251044,
210084,
185511,
210088,
210095,
210098,
210107,
210115,
332997,
210127,
333009,
210131,
333014,
210138,
210143,
218354,
218360,
251128,
275706,
275712,
275715,
275721,
349459,
333078,
251160,
349484,
349491,
251189,
415033,
251210,
357708,
210260,
365911,
259421,
365921,
333154,
251235,
374117,
333162,
234866,
390516,
333175,
357755,
251271,
136590,
374160,
112020,
349590,
357792,
259515,
415166,
415185,
366034,
366038,
415191,
415193,
415196,
415199,
423392,
333284,
415207,
366056,
366061,
415216,
210420,
415224,
423423,
415257,
415263,
366117,
415270,
144939,
415278,
415281,
415285,
210487,
415290,
415293,
349761,
415300,
333386,
366172,
333413,
423528,
423532,
210544,
415353,
333439,
415361,
267909,
333498,
210631,
333511,
358099,
333534,
366307,
366311,
431851,
366318,
210672,
366321,
366325,
210695,
268041,
210698,
366348,
210706,
399128,
333594,
210719,
358191,
366387,
210739,
399159,
358200,
325440,
366401,
341829,
325446,
46920,
341834,
341838,
341843,
415573,
358234,
341851,
350045,
399199,
259938,
399206,
358255,
268143,
399215,
358259,
243579,
325504,
333698,
333708,
333724,
382890,
350146,
333774,
358371,
350189,
350193,
350202,
333818,
350206,
350213,
268298,
350224,
350231,
333850,
350237,
350240,
350244,
350248,
178218,
350251,
350256,
350259,
350271,
243781,
350285,
374864,
342111,
342133,
374902,
432271,
333997,
334011,
260289,
260298,
350410,
350416,
350422,
211160,
350425,
334045,
350445,
375026,
358644,
350458,
350461,
350464,
350467,
325891,
350475,
375053,
268559,
350480,
432405,
350486,
325914,
350490,
350493,
325917,
325919,
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,
326084,
358856,
334304,
334311,
375277,
334321,
350723,
391690,
186897,
342545,
334358,
342554,
334363,
350761,
252461,
334384,
358961,
383536,
334394,
252482,
219718,
334407,
334420,
350822,
375400,
334465,
334468,
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,
326490,
342874,
326502,
433000,
375656,
326507,
326510,
211825,
211831,
351097,
392060,
359295,
351104,
342915,
400259,
236430,
342930,
252822,
392091,
400285,
252836,
359334,
211884,
400306,
351168,
359361,
359366,
326598,
359382,
359388,
383967,
343015,
359407,
261108,
244726,
261111,
383997,
261129,
261147,
359451,
211998,
261153,
261159,
359470,
359476,
343131,
384098,
384101,
367723,
384107,
187502,
343154,
384114,
212094,
351364,
384135,
384139,
384143,
351381,
384160,
384168,
367794,
384181,
367800,
351423,
326855,
244937,
253130,
343244,
146642,
359649,
343270,
351466,
351479,
343306,
261389,
359694,
384269,
253200,
261393,
384275,
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,
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,
147317,
262005,
425845,
262008,
262011,
155516,
155521,
155525,
360326,
155531,
262027,
262030,
262033,
262036,
262039,
262042,
155549,
262045,
262048,
262051,
327589,
155559,
155562,
155565,
393150,
393169,
384977,
155611,
155619,
253923,
155621,
253926,
327654,
204784,
393203,
360438,
253943,
393206,
393212,
155646
] |
d7ad0936b76ec05da02595913cd624a654883f49
|
d0f0e860f67ea5550bba41c19017a91ae19e638f
|
/UIMaster/Base/Vendor(第三方)/PopMenu/Classes/Helpers/UIView+Shadows.swift
|
bc166811c28ee70703d42bee6e2ebd1f6ff9c465
|
[] |
no_license
|
HobsonCheng/uimaster_iOS
|
71c4c2744c414c892f9b11a0e53b6e8fa8453f0f
|
22a74641bcd04f4a4eda0ba46cd694405db518e5
|
refs/heads/master
| 2020-06-24T18:18:20.129428 | 2020-05-18T10:30:28 | 2020-05-18T10:30:28 | 199,043,388 | 1 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 536 |
swift
|
//
// UIView+Shadows.swift
// PopMenu
//
// Created by Cali Castle on 4/14/18.
// Copyright © 2018 PopMenu. All rights reserved.
//
import UIKit
extension UIView {
/// Quick configuration to give the view shadows.
func addShadow(offset: CGSize = .zero, opacity: Float = 0.65, radius: CGFloat = 20, color: UIColor = .black) {
layer.shadowOffset = offset
layer.shadowOpacity = opacity
layer.shadowRadius = radius
layer.shadowColor = color.cgColor
layer.masksToBounds = false
}
}
|
[
340622
] |
d4ef7702b19e2430b80587df0d0e601f66f9aaa8
|
025aaaff8ebd88c7964a7c80f1f151708051220b
|
/IPA/ForwardingView.swift
|
755295a35c6efd53259a977d685fb5c16b198d04
|
[] |
no_license
|
esimonian/IPAKeyboard
|
3adabafefda7fbc105c71ddbde0e8921f2aded8a
|
76fc9fceafcb0f39eeb0fc50ac8519223cd505bf
|
refs/heads/master
| 2021-01-12T16:27:38.436381 | 2016-09-27T19:18:24 | 2016-09-27T19:18:24 | 69,277,402 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 11,903 |
swift
|
//
// ForwardingView.swift
// TransliteratingKeyboard
//
// Created by Alexei Baboulevitch on 7/19/14.
// Copyright (c) 2014 Alexei Baboulevitch ("Archagon"). All rights reserved.
//
import UIKit
class ForwardingView: UIView, UIGestureRecognizerDelegate {
var touchToView: [UITouch:UIView]
var gesture = UILongPressGestureRecognizer()
var isLongPressEnable = false
var isLongPressKeyPress = false
var currentMode: Int = 0
override init(frame: CGRect) {
self.touchToView = [:]
super.init(frame: frame)
self.contentMode = UIViewContentMode.redraw
self.isMultipleTouchEnabled = true
self.isUserInteractionEnabled = true
self.isOpaque = false
gesture = UILongPressGestureRecognizer(target: self, action: Selector(("handleLongGesture:")))
gesture.minimumPressDuration = 0.5
gesture.delegate = self
gesture.cancelsTouchesInView = false
self.addGestureRecognizer(gesture)
}
required init?(coder: NSCoder) {
fatalError("NSCoding not supported")
}
// Why have this useless drawRect? Well, if we just set the backgroundColor to clearColor,
// then some weird optimization happens on UIKit's side where tapping down on a transparent pixel will
// not actually recognize the touch. Having a manual drawRect fixes this behavior, even though it doesn't
// actually do anything.
override func draw(_ rect: CGRect) {}
override func hitTest(_ point: CGPoint, with event: UIEvent!) -> UIView? {
if self.isHidden || self.alpha == 0 || !self.isUserInteractionEnabled {
return nil
}
else {
return (self.bounds.contains(point) ? self : nil)
}
}
func handleControl(_ view: UIView?, controlEvent: UIControlEvents) {
if let control = view as? UIControl {
let targets = control.allTargets
for target in targets {
if let actions = control.actions(forTarget: target, forControlEvent: controlEvent) {
for action in actions {
let selectorString = action
let selector = Selector(selectorString)
control.sendAction(selector, to: target, for: nil)
}
}
}
}
}
@IBAction func handleLongGesture(longPress: UIGestureRecognizer) {
if (longPress.state == UIGestureRecognizerState.ended) {
let position = longPress.location(in: self)
let view = findNearestView(position)
if view is KeyboardKey {
NotificationCenter.default.post(name: NSNotification.Name(rawValue: "hideExpandViewNotification"), object: nil)
}
isLongPressEnable = false
isLongPressKeyPress = true
if UIDevice.current.userInterfaceIdiom == UIUserInterfaceIdiom.pad {
let keyboardKey = view as! KeyboardKey
keyboardKey.isHighlighted = false
}
}
else if (longPress.state == UIGestureRecognizerState.began) {
if (longPress.state == UIGestureRecognizerState.began) {
isLongPressEnable = true
let position = longPress.location(in: self)
var view = findNearestView(position)
var viewChangedOwnership = false
if !viewChangedOwnership {
if view is KeyboardKey {
var v = view as! KeyboardKey
if self.isLongPressEnableKey(text: v.text as NSString) {
view!.tag = 888
self.handleControl(view, controlEvent: .touchDownRepeat)
}
}
}
}
}
}
func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldReceive touch: UITouch) -> Bool {
if gestureRecognizer is UILongPressGestureRecognizer {
if (gestureRecognizer.state == UIGestureRecognizerState.possible) {
let position = touch.location(in: self)
var view = findNearestView(position)
var viewChangedOwnership = false
if !viewChangedOwnership {
if view is KeyboardKey {
var v = view as! KeyboardKey
if self.isLongPressEnableKey(text: v.text as NSString) {
return true
}
}
}
return false
}
}
else {
return true
}
return false
}
// TODO: there's a bit of "stickiness" to Apple's implementation
func findNearestView(_ position: CGPoint) -> UIView? {
if !self.bounds.contains(position) {
return nil
}
var closest: (UIView, CGFloat)? = nil
for anyView in self.subviews {
let view = anyView
if view.isHidden {
continue
}
view.alpha = 1
let distance = distanceBetween(view.frame, point: position)
if closest != nil {
if distance < closest!.1 {
closest = (view, distance)
}
}
else {
closest = (view, distance)
}
}
if closest != nil {
return closest!.0
}
else {
return nil
}
}
// http://stackoverflow.com/questions/3552108/finding-closest-object-to-cgpoint b/c I'm lazy
func distanceBetween(_ rect: CGRect, point: CGPoint) -> CGFloat {
if rect.contains(point) {
return 0
}
var closest = rect.origin
if (rect.origin.x + rect.size.width < point.x) {
closest.x += rect.size.width
}
else if (point.x > rect.origin.x) {
closest.x = point.x
}
if (rect.origin.y + rect.size.height < point.y) {
closest.y += rect.size.height
}
else if (point.y > rect.origin.y) {
closest.y = point.y
}
let a = pow(Double(closest.y - point.y), 2)
let b = pow(Double(closest.x - point.x), 2)
return CGFloat(sqrt(a + b));
}
// reset tracked views without cancelling current touch
func resetTrackedViews() {
for view in self.touchToView.values {
self.handleControl(view, controlEvent: .touchCancel)
}
self.touchToView.removeAll(keepingCapacity: true)
}
func ownView(_ newTouch: UITouch, viewToOwn: UIView?) -> Bool {
var foundView = false
if viewToOwn != nil {
for (touch, view) in self.touchToView {
if viewToOwn == view {
if touch == newTouch {
break
}
else {
self.touchToView[touch] = nil
foundView = true
}
break
}
}
}
self.touchToView[newTouch] = viewToOwn
return foundView
}
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
for touch in touches {
let position = touch.location(in: self)
let view = findNearestView(position)
let viewChangedOwnership = self.ownView(touch, viewToOwn: view)
if !viewChangedOwnership {
self.handleControl(view, controlEvent: .touchDown)
if touch.tapCount > 1 {
// two events, I think this is the correct behavior but I have not tested with an actual UIControl
self.handleControl(view, controlEvent: .touchDownRepeat)
}
}
}
}
override func touchesMoved(_ touches: Set<UITouch>, with event: UIEvent?) {
for touch in touches {
let position = touch.location(in: self)
let oldView = self.touchToView[touch]
let newView = findNearestView(position)
if oldView != newView {
self.handleControl(oldView, controlEvent: .touchDragExit)
let viewChangedOwnership = self.ownView(touch, viewToOwn: newView)
if !viewChangedOwnership {
self.handleControl(newView, controlEvent: .touchDragEnter)
}
else {
self.handleControl(newView, controlEvent: .touchDragInside)
}
}
else {
self.handleControl(oldView, controlEvent: .touchDragInside)
}
}
}
override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) {
for touch in touches {
let view = self.touchToView[touch]
let touchPosition = touch.location(in: self)
if self.bounds.contains(touchPosition) {
self.handleControl(view, controlEvent: .touchUpInside)
}
else {
self.handleControl(view, controlEvent: .touchCancel)
}
self.touchToView[touch] = nil
}
}
override func touchesCancelled(_ touches: Set<UITouch>?, with event: UIEvent?) {
if let touches = touches {
for touch in touches {
let view = self.touchToView[touch]
self.handleControl(view, controlEvent: .touchCancel)
self.touchToView[touch] = nil
}
}
}
func isLongPressEnableKey(text:NSString) -> Bool
{
let alphabet_lengh = text.length
if(alphabet_lengh > 1)
{
return false
}
let alphaBets = NSCharacterSet(charactersIn: "AEUIOSDCNaeuiosdcn.")
if text.rangeOfCharacter(from: alphaBets as CharacterSet).location != NSNotFound
{
return true
}
return false
}
func isSubViewContainsCYRView() -> Bool
{
for anyView in self.superview!.subviews
{
if anyView is CYRKeyboardButtonView
{
return true
}
}
return false
}
func getCYRView() -> CYRKeyboardButtonView!
{
if isSubViewContainsCYRView()
{
for anyView in self.superview!.subviews
{
if anyView is CYRKeyboardButtonView
{
return anyView as! CYRKeyboardButtonView
}
}
}
return nil
}
func isSubViewContainsCYRButton() -> Bool
{
for anyView in self.superview!.subviews
{
if anyView is CYRKeyboardButton
{
return true
}
}
return false
}
func getCYRButton() -> CYRKeyboardButton!
{
if isSubViewContainsCYRButton()
{
for anyView in self.superview!.subviews
{
if anyView is CYRKeyboardButton
{
return anyView as! CYRKeyboardButton
}
}
}
return nil
}
}
|
[
285324
] |
ce3895a9f7e464bcf9a2756daf7dbe2e0b10f1f4
|
984e262988d0c666a219e169ac1e716addb09d1b
|
/InfectionControl/Controllers/ReportTableView/ReportRow.swift
|
0b9216265b6604319321e7674cf2d29f3e226c5b
|
[] |
no_license
|
NLCaceres/iOS-Records
|
fb057bf688a1b9bb6376b0b55465793b496d88cb
|
78b166f1ea1a2c47ae0d133a75989ec1b56ac271
|
refs/heads/master
| 2023-03-26T12:44:34.891386 | 2023-03-18T03:47:10 | 2023-03-18T03:47:10 | 190,695,594 | 1 | 0 | null | 2019-06-08T18:57:46 | 2019-06-07T06:02:09 |
Swift
|
UTF-8
|
Swift
| false | false | 1,399 |
swift
|
//
// ReportRow.swift
// InfectionControl
//
// Copyright © 2022 Nick Caceres. All rights reserved.
import SwiftUI
struct ReportRow: View {
var report: Report
var violationString: String { "\(self.report.healthPractice.name) Violation" }
var employeeString: String { "Committed by \(self.report.employee.fullName)" }
var employeeProfessionString: String { self.report.location.description }
var body: some View {
CommonRowSubtitled(imageName: "report_placeholder_icon") {
Text(violationString).font(.headline)
Text(employeeString).font(.body).padding(.leading, 7)
Text(employeeProfessionString).font(.body).padding(.leading, 7)
}
}
}
struct ReportRow_Previews: PreviewProvider {
static var previews: some View {
ReportRow(report: makeReport()).previewLayout(.fixed(width: 350, height: 100))
}
static func makeReport() -> Report {
let employee = Employee(firstName: "John", surname: "Smith", profession: Profession(observedOccupation: "Clinic", serviceDiscipline: "Physician"))
let healthPractice = HealthPractice(name: "Hand Hygiene", precautionType: Precaution(name: "Violation"))
let location = Location(facilityName: "USC", unitNum: "1", roomNum: "2")
return Report(employee: employee, healthPractice: healthPractice, location: location, date: Date())
}
}
|
[
-1
] |
77943fc3a2a0ab1116bb413009d6b866f45db6e3
|
01fdb3c96d42fc8e80cfc7857859037100de4b7e
|
/EoKoe/UsersList/UsersListInteractor.swift
|
27c4c82b692575f801f2253cbbe2e3e3b216b83b
|
[
"Apache-2.0"
] |
permissive
|
jaikme/eokoe
|
3c75922fdc4e1e6691071d139ee77cb98e4967ce
|
bd31084c7dd299c75ca3f886c87309194bb22b72
|
refs/heads/master
| 2020-03-14T21:30:42.454936 | 2018-05-04T19:15:48 | 2018-05-04T19:15:48 | 131,776,835 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 525 |
swift
|
//
// UsersListInteractor.swift
// EoKoe
//
// Created by Jaime Costa Marques on 04/05/18.
// Copyright © 2018 Jaime Costa Marques. All rights reserved.
//
import UIKit
final class UsersListInteractor {
// MARK: - Properties
var presenter: UsersListView?
}
// MARK: Methods
extension UsersListInteractor {
@objc func loadUsers() {
DataService.usersList(with: OffsetModel(start: 0, limit: 10)) { (users) in
self.presenter?.showLoadedUsers(with: users)
}
}
}
|
[
-1
] |
8ab36a01757f1268069e7799e19f0b3e7b37da35
|
097d1d5c982c54a788d5df39c39c6b23e5f13bf0
|
/ios/Classes/Shared/TransactionOptions/TransactionOptionsScreen.swift
|
b8e4ee40e50e864450ed77cb71ddb37dbe585c30
|
[
"Apache-2.0"
] |
permissive
|
perawallet/pera-wallet
|
d12435020ded4705b4a7929ab2611b29dd85810e
|
115f85f2d897817276eca9090933f6b0c020f1ab
|
refs/heads/master
| 2023-08-16T21:27:27.885005 | 2023-08-15T21:38:03 | 2023-08-15T21:38:03 | 364,359,642 | 67 | 26 |
NOASSERTION
| 2023-06-02T16:51:55 | 2021-05-04T19:08:11 |
Swift
|
UTF-8
|
Swift
| false | false | 6,796 |
swift
|
// Copyright 2022 Pera Wallet, LDA
// 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.
// TransactionOptionsScreen.swift
import Foundation
import MacaroonBottomSheet
import UIKit
final class TransactionOptionsScreen:
BaseScrollViewController,
BottomSheetScrollPresentable {
weak var delegate: TransactionOptionsScreenDelegate?
override var shouldShowNavigationBar: Bool {
return false
}
private lazy var contextView = TransactionOptionsContextView(actions: makeActions())
private let account: Account
private let theme: TransactionOptionsScreenTheme
init(
account: Account,
theme: TransactionOptionsScreenTheme = .init(),
configuration: ViewControllerConfiguration
) {
self.account = account
self.theme = theme
super.init(configuration: configuration)
}
override func viewDidLoad() {
super.viewDidLoad()
addContext()
}
}
extension TransactionOptionsScreen {
private func addContext() {
contextView.customize(theme.context)
contentView.addSubview(contextView)
contextView.snp.makeConstraints {
$0.setPaddings()
}
}
}
extension TransactionOptionsScreen {
private func makeActions() -> [TransactionOptionListAction] {
return account.authorization.isWatch
? makeActionsForWatchAccount()
: makeActionsForNonWatchAccount()
}
private func makeActionsForNonWatchAccount() -> [TransactionOptionListAction] {
let buySellAction = makeBuySellAction()
let swapAction = makeSwapAction()
let sendAction = makeSendAction()
let receiveAction = makeReceiveAction()
let addAssetAction = makeAddAssetAction()
let moreAction = makeMoreAction()
return [
buySellAction,
swapAction,
sendAction,
receiveAction,
addAssetAction,
moreAction
]
}
}
extension TransactionOptionsScreen {
private func makeActionsForWatchAccount() -> [TransactionOptionListAction] {
let copyAddressAction = makeCopyAddressAction()
let showAddressAction = makeShowAddressAction()
let moreAction = makeMoreAction()
return [
copyAddressAction,
showAddressAction,
moreAction
]
}
private func makeCopyAddressAction() -> TransactionOptionListAction {
return TransactionOptionListAction(
viewModel: CopyAddressTransactionOptionListItemButtonViewModel(account)
) {
[unowned self] _ in
self.delegate?.transactionOptionsScreenDidTapCopyAddress(self)
}
}
private func makeShowAddressAction() -> TransactionOptionListAction {
return TransactionOptionListAction(
viewModel: ShowAddressTransactionOptionListItemButtonViewModel()
) {
[unowned self] _ in
self.delegate?.transactionOptionsScreenDidTapShowAddress(self)
}
}
private func makeBuySellAction() -> TransactionOptionListAction {
return TransactionOptionListAction(
viewModel: BuySellTransactionOptionListItemButtonViewModel()
) {
[unowned self] _ in
self.delegate?.transactionOptionsScreenDidTapBuySell(self)
}
}
private func makeSwapAction() -> TransactionOptionListAction {
let swapDisplayStore = SwapDisplayStore()
let isOnboardedToSwap = swapDisplayStore.isOnboardedToSwap
var swapActionViewModel = SwapTransactionOptionListItemButtonViewModel(isBadgeVisible: !isOnboardedToSwap)
return TransactionOptionListAction(
viewModel: swapActionViewModel
) {
[unowned self] actionView in
if !isOnboardedToSwap {
swapActionViewModel.bindIsBadgeVisible(false)
actionView.bindData(swapActionViewModel)
}
self.delegate?.transactionOptionsScreenDidTapSwap(self)
}
}
private func makeSendAction() -> TransactionOptionListAction {
return TransactionOptionListAction(
viewModel: SendTransactionOptionListItemButtonViewModel()
) {
[unowned self] _ in
self.delegate?.transactionOptionsScreenDidTapSend(self)
}
}
private func makeReceiveAction() -> TransactionOptionListAction {
return TransactionOptionListAction(
viewModel: ReceiveTransactionOptionListItemButtonViewModel()
) {
[unowned self] _ in
self.delegate?.transactionOptionsScreenDidTapReceive(self)
}
}
private func makeAddAssetAction() -> TransactionOptionListAction {
return TransactionOptionListAction(
viewModel: AddAssetTransactionOptionListActionViewModel()
) {
[unowned self] _ in
self.delegate?.transactionOptionsScreenDidTapAddAsset(self)
}
}
private func makeMoreAction() -> TransactionOptionListAction {
return TransactionOptionListAction(
viewModel: MoreTransactionOptionListItemButtonViewModel()
) {
[unowned self] _ in
self.delegate?.transactionOptionsScreenDidTapMore(self)
}
}
}
protocol TransactionOptionsScreenDelegate: AnyObject {
func transactionOptionsScreenDidTapCopyAddress(
_ transactionOptionsScreen: TransactionOptionsScreen
)
func transactionOptionsScreenDidTapShowAddress(
_ transactionOptionsScreen: TransactionOptionsScreen
)
func transactionOptionsScreenDidTapBuySell(
_ transactionOptionsScreen: TransactionOptionsScreen
)
func transactionOptionsScreenDidTapSwap(
_ transactionOptionsScreen: TransactionOptionsScreen
)
func transactionOptionsScreenDidTapSend(
_ transactionOptionsScreen: TransactionOptionsScreen
)
func transactionOptionsScreenDidTapReceive(
_ transactionOptionsScreen: TransactionOptionsScreen
)
func transactionOptionsScreenDidTapAddAsset(
_ transactionOptionsScreen: TransactionOptionsScreen
)
func transactionOptionsScreenDidTapMore(
_ transactionOptionsScreen: TransactionOptionsScreen
)
}
|
[
-1
] |
4031ffed254cf8f0ef641564cb642392914a1c88
|
b3d7489cb34cabe6c360599dc75d217c99dd7333
|
/WLAssignmentTests/Testing+Rx.swift
|
e9034e59222d3e37204cfeb6ac463475f68df37e
|
[] |
no_license
|
nyekimov/WLAssignment
|
7be4ce4fd67108a2e066e718f71297a1053fdbb9
|
ede5d79f9e8b953104aa07c9407616eb51c133e8
|
refs/heads/master
| 2021-04-18T22:32:41.815440 | 2018-03-26T02:12:45 | 2018-03-26T02:12:45 | 126,759,849 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 749 |
swift
|
//
// Testing+Rx.swift
// WLAssignmentTests
//
// Created by Nick Yekimov on 3/25/18.
// Copyright © 2018 Nick Yekimov. All rights reserved.
//
import Foundation
import RxSwift
import RxCocoa
import RxTest
extension Observable {
var firstEvent: Element? {
return (try? self.toBlocking().first()).flatMap { $0 }
}
}
extension Driver {
var firstEvent: Element? {
return (try? self.toBlocking().first()).flatMap { $0 }
}
}
extension TestableObserver {
var eventArray: [ElementType] {
return events.flatMap { $0.value.element }
}
var firstEvent: ElementType? {
return events.first?.value.element
}
var lastEvent: ElementType? {
return events.last?.value.element
}
}
|
[
-1
] |
682905dee2fca0075bbb305d21bacdc1f75c88b7
|
55b57d90ef0182b1d60c8a291f436058e3412d9f
|
/Verkoop/Manager/Location Manager/LocationManager.swift
|
1b1cc8bba0dd05051b1c470582d41c2ffa797720
|
[] |
no_license
|
VERKOOPAPP1/verkoop-ios
|
a9a93f04aab45b9a89164d4cc8abbb65907312fa
|
4f892c3147d9fb6c7eb2fc37b484e96628ed5dfc
|
refs/heads/master
| 2023-01-18T17:28:08.610973 | 2020-11-25T16:18:21 | 2020-11-25T16:18:21 | 315,988,498 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,321 |
swift
|
//
// LocationManager.swift
// Verkoop
//
// Created by Vijay's Macbook on 15/11/18.
// Copyright © 2018 MobileCoderz. All rights reserved.
//
import CoreLocation
protocol CustomLocationManagerDelegate {
func accessDenied()
func accessRestricted()
func fetchLocation(location:CLLocation)
}
class LocationManager:NSObject {
static var shairedInstance = LocationManager()
var locationManager = CLLocationManager()
var currentLocation:CLLocation?
var delegate:CustomLocationManagerDelegate?
var isLocaitonSent = false
var isFirstAttemp = true
func locationRequest() {
isLocaitonSent = false
locationManager.delegate = self
locationManager.desiredAccuracy = kCLLocationAccuracyBest
if CLLocationManager.locationServicesEnabled() {
let status = CLLocationManager.authorizationStatus()
checkLocationStatus(status: status)
}
}
func checkLocationStatus(status:CLAuthorizationStatus) {
switch status {
case .authorizedAlways,.authorizedWhenInUse :
locationManager.startUpdatingLocation()
case .denied:
isFirstAttemp = false
delegate?.accessDenied()
case .notDetermined:
isFirstAttemp = true
locationManager.requestWhenInUseAuthorization()
case .restricted:
delegate?.accessRestricted()
@unknown default:
Console.log("Do Nothing")
}
}
}
extension LocationManager: CLLocationManagerDelegate {
func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) {
checkLocationStatus(status: status)
}
func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
locationManager.stopUpdatingLocation()
let userLocation = locations.last
Console.log(userLocation?.coordinate)
currentLocation = userLocation
if let location = currentLocation , !isLocaitonSent {
isLocaitonSent = true
delegate?.fetchLocation(location:location)
}
}
func locationManager(_ manager: CLLocationManager, didFailWithError error: Error) {
locationManager.stopUpdatingLocation()
}
}
|
[
-1
] |
020685ad521cee936e2b328a12ba11815971507f
|
af4b09dc1b1e7988c89cacc90325bb62bcd8b7c3
|
/ComicCrush/line.swift
|
69e6a98612e85bbe0d959ef29e5f73843f79cb65
|
[] |
no_license
|
mahmoudelfeel/-
|
e173a1d163361cfc157cc7cc944f39f0620dab69
|
b3d1bf74cec31a5faef67951039cd5376db7a873
|
refs/heads/master
| 2021-01-19T04:51:03.226546 | 2016-07-13T21:30:31 | 2016-07-13T21:30:31 | 63,279,041 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 145 |
swift
|
//
// line.swift
// ComicCrush
//
// Created by mahmoud on 6/28/16.
// Copyright © 2016 mahmoud. All rights reserved.
//
import Foundation
|
[
-1
] |
4189c5647fa247d04bcbf05589069496c2772dc6
|
4a9f8d29c48fdf91b94bf3a87c1d96c70466b8f4
|
/MarioKartTests/MarioKartTests.swift
|
bcfa8c620d3113292b6b36c0573174c4e5a818ba
|
[] |
no_license
|
itonic23/MarioKart
|
949a2e926a003973d9ab4c74103595359a3bd950
|
9fda62c793f5056cb0d37ae8889f19268e4e5f50
|
refs/heads/master
| 2020-04-27T19:40:19.830970 | 2019-03-09T00:19:50 | 2019-03-09T00:19:50 | 174,628,926 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 908 |
swift
|
//
// MarioKartTests.swift
// MarioKartTests
//
// Created by Kanav Gupta on 3/8/19.
// Copyright © 2019 trishi2002. All rights reserved.
//
import XCTest
@testable import MarioKart
class MarioKartTests: XCTestCase {
override func setUp() {
// Put setup code here. This method is called before the invocation of each test method in the class.
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
}
func testExample() {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct results.
}
func testPerformanceExample() {
// This is an example of a performance test case.
self.measure {
// Put the code you want to measure the time of here.
}
}
}
|
[
320516,
333828,
323080,
329225,
323087,
323089,
316946,
175639,
320536,
374296,
317467,
333343,
315432,
325674,
315434,
345132,
243759,
241716,
319542,
242237,
325694,
21569,
214086,
313416,
254027,
163917,
333393,
196691,
329814,
353367,
200794,
242273,
345700,
242277,
321637,
244327,
319591,
329829,
315497,
243307,
312940,
318572,
319598,
315498,
204397,
316526,
325231,
313971,
353397,
337017,
244347,
323196,
325245,
337535,
187521,
333955,
311941,
312965,
323207,
330888,
184973,
326287,
177296,
241808,
311954,
316049,
323729,
326804,
324760,
111258,
111259,
339102,
332446,
61101,
318639,
318130,
241843,
109241,
339130,
319162,
322749,
327358,
323264,
333509,
353479,
353480,
319177,
353482,
244940,
283853,
333520,
333011,
333523,
241365,
334042,
318173,
321247,
325346,
330984,
330474,
342763,
328940,
322291,
312052,
353524,
353523,
327929,
316669,
319233,
323331,
194820,
313608,
321800,
242954,
322316,
117517,
318733,
312079,
325905,
323346,
338197,
334103,
207640,
315673,
325912,
245019,
325404,
326429,
241441,
241442,
325410,
208164,
325931,
353069,
317232,
332083,
171317,
318775,
345402,
319292,
325439,
216386,
193859,
241986,
325445,
182598,
153415,
312648,
345415,
353095,
315202,
323916,
319821,
325968,
120148,
244568,
244570,
332123,
391520,
109409,
351077,
242023,
201577,
326505,
313199,
327024,
246127,
243056,
316787,
116084,
314741,
249204,
249205,
317304,
333688,
241528,
246137,
269178,
211326,
313727,
325503,
318848,
240002,
339841,
248194,
327557,
240518,
109447,
332167,
188292,
243591,
311691,
236428,
304524,
325515,
325518,
316298,
317323,
337815,
326553,
318364,
118685,
127902,
121245,
240544,
315810,
333220,
313254,
333735,
316842,
353195,
108972,
311727,
338356,
150965,
243637,
326581,
326587,
353216,
330689,
324039,
326601,
373197,
242139,
369116,
310748,
242148,
242149,
313319,
412651,
54765,
320494,
329712,
109042,
333300,
333303,
320507
] |
bcdc1633c4add9d9296eca2f4a8a7346927b3da3
|
257d8b522f22488a198965fb3907ed90e4651aae
|
/Ride-Foodv02/Addresses/Managers/PersistanceManager.swift
|
f1bba5b4273f646ae6a770ed3cded40fd4738566
|
[] |
no_license
|
APxScabber/Ride-Foodv02
|
2bfb70a27f11e2164143d541e84de6b032064a1b
|
6ce38a309ddbc5c01a6288b8234093afa8dbb9da
|
refs/heads/main
| 2023-08-14T16:07:37.434822 | 2021-10-06T14:31:00 | 2021-10-06T14:31:00 | 374,765,709 | 1 | 1 | null | 2021-10-06T12:17:13 | 2021-06-07T18:36:26 |
Swift
|
UTF-8
|
Swift
| false | false | 1,981 |
swift
|
//
// PersistanceManager.swift
// Ride-Foodv02
//
// Created by Владислав Белов on 21.07.2021.
//
import UIKit
import CoreData
class PersistanceManager {
static let shared = PersistanceManager()
private init() {
}
let context = CoreDataManager.shared.persistentContainer.viewContext
func fetchAddresses(completion: @escaping (Result<[UserAddressMO], Error>) -> Void){
do {
let addresses = try! context.fetch(UserAddressMO.fetchRequest()) as [UserAddressMO]
completion(.success(addresses))
}
}
func addNewAddress(address: UserAddressMO){
do {
try self.context.save()
} catch let error {
print(error)
}
}
func createCoreDataInstance(addressesToCopy: [AddressData]?, view: UIViewController){
SignOutHelper.shared.resetCoreDataEntity(with: "UserAddressMO")
guard let data = addressesToCopy else {
return
}
for i in data{
let localAddress = UserAddressMO(context: PersistanceManager.shared.context)
localAddress.id = view.placeIntIntoString(int: i.id ?? 0)
localAddress.title = i.name
localAddress.fullAddress = i.address
localAddress.driverCommentary = i.commentDriver
localAddress.delivApartNumber = view.placeIntIntoString(int: i.flat ?? 0)
localAddress.delivIntercomNumber = view.placeIntIntoString(int: i.intercom ?? 0)
localAddress.delivEntranceNumber = view.placeIntIntoString(int: i.entrance ?? 0)
localAddress.delivFloorNumber = view.placeIntIntoString(int: i.floor ?? 0)
localAddress.deliveryCommentary = i.commentCourier
localAddress.isDestination = i.destination ?? false
PersistanceManager.shared.addNewAddress(address: localAddress)
}
}
}
|
[
-1
] |
cb4f29567c7335210df10b9f7173811dc2ee1353
|
760fea5407fd8e81da2cbfb77af4260a481061e3
|
/tinder-swiftui/App/ContentView.swift
|
c9697bf122e5a7a857dcf80859b514462348f1af
|
[] |
no_license
|
irisida/tinder-swiftui
|
3eb4751b9a24d974e179aaab83d1f9fd0c1af832
|
2a323aeb4499f364310aae8d9db15af57e9bdf00
|
refs/heads/main
| 2023-04-29T06:03:32.342317 | 2021-05-25T14:52:50 | 2021-05-25T14:52:50 | 369,836,188 | 1 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 784 |
swift
|
//
// ContentView.swift
// tinder-swiftui
//
// Created by ed on 22/05/2021.
//
import SwiftUI
struct ContentView: View {
// Largely transient file that simply instantiates the
// managers for our state and users. Calls the MainView
// which presents our app TabBar and passes the mgr as
// an env object which will be used to control tabBar
// switching and UI views responding
@ObservedObject var mgr: AppStateManager = AppStateManager()
@ObservedObject var userMgr: UserManager = UserManager()
var body: some View {
MainView()
.environmentObject(mgr)
.environmentObject(userMgr)
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
|
[
-1
] |
5fcb2a39defaadace7bcce4ab75e3fd2a4f5f255
|
271eb35212149c1a1e58114d3f6c4897a02f028b
|
/TestMD/TestMD/MasterViewController.swift
|
407161a379ffd4a485b922cf83f857959e3a12bc
|
[] |
no_license
|
anfgy001/testSwiftAssignment2
|
cf7e35c3fc0ec5bbc877b05cb4d1bb3a8946e794
|
aea81a4c67d010502ff1f6b3a3b867c7a56c1cbf
|
refs/heads/master
| 2021-07-13T11:37:17.903984 | 2017-10-14T07:08:08 | 2017-10-14T07:08:08 | 106,903,406 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 3,534 |
swift
|
//
// MasterViewController.swift
// TestMD
//
// Created by Adam Jenkins on 11/9/17.
// Copyright © 2017 Adam Jenkins. All rights reserved.
//
import UIKit
class MasterViewController: UITableViewController {
var detailViewController: DetailViewController? = nil
var objects = [Any]()
var segueArray = [String]()
var segueDictionary = Dictionary<String, UIImage>();
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
self.navigationItem.leftBarButtonItem = self.editButtonItem
if let split = self.splitViewController {
let controllers = split.viewControllers
self.detailViewController = (controllers[controllers.count-1] as! UINavigationController).topViewController as? DetailViewController
}
segueArray.append("Home")
segueArray.append("Search")
segueArray.append("Product List");
segueArray.append("Finder");
segueArray.append("Cart");
segueArray.append("Checkout");
segueDictionary["Home"] = UIImage(named: "home")
segueDictionary["Search"] = UIImage(named: "search")
segueDictionary["Product List"] = UIImage(named: "listOfProducts");
segueDictionary["Finder"] = UIImage(named: "finder");
segueDictionary["Cart"] = UIImage(named: "cart");
segueDictionary["Checkout"] = UIImage(named: "checkout");
}
override func viewWillAppear(_ animated: Bool) {
self.clearsSelectionOnViewWillAppear = self.splitViewController!.isCollapsed
super.viewWillAppear(animated)
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
// MARK: - Segues
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath)
{
self.performSegue(withIdentifier: segueArray[indexPath.row], sender: self)
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if let indexPath = self.tableView.indexPathForSelectedRow {
let object = segueDictionary[segueArray[indexPath.row]]
let controller = (segue.destination as! UINavigationController).topViewController as! DetailViewController
controller.detailItem = object
controller.navigationItem.leftBarButtonItem = self.splitViewController?.displayModeButtonItem
controller.navigationItem.leftItemsSupplementBackButton = true
}
}
// MARK: - Table View
override func numberOfSections(in tableView: UITableView) -> Int {
return 1
}
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return segueArray.count
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath)
cell.textLabel!.text = segueArray[indexPath.row] // the label text (Home or Menu)
cell.imageView!.image = segueDictionary[segueArray[indexPath.row]] // the image itself (UIImage: 0x6974728427582.....)
return cell
}
override func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool {
// Return false if you do not want the specified item to be editable.
return true
}
}
|
[
-1
] |
c2253aa99c36b307f53086ba3aacac9ce6e9d88e
|
ab3f0355ca29b975a9075387dabfe23754dd9087
|
/FlintCore/Core/ActionsBuilder.swift
|
89a4f0fe8c9c5d070766d9eb9d476c0b46d46f21
|
[
"MIT"
] |
permissive
|
EdwardBetts/Flint
|
831782c6281a97422863daae4fdfd08b60c304e9
|
6fb1fae96a6e2a4dd82123784ee6a04b6babce33
|
refs/heads/master
| 2020-03-18T14:37:26.343205 | 2018-05-21T21:08:18 | 2018-05-21T21:08:18 | 134,857,563 | 0 | 0 | null | 2018-05-25T13:08:59 | 2018-05-25T13:08:59 | null |
UTF-8
|
Swift
| false | false | 1,198 |
swift
|
//
// ActionsBuilder.swift
// FlintCore
//
// Created by Marc Palmer on 22/04/2018.
// Copyright © 2018 Montana Floss Co. Ltd. All rights reserved.
//
import Foundation
/// The builder used to take action bindings register them with Flint internals so that the
/// static action definitions get evaluated and they can be prepared fully.
class ActionsBuilder: FeatureActionsBuilder {
let feature: FeatureDefinition.Type
init(feature: FeatureDefinition.Type) {
self.feature = feature
}
public func declare<FeatureType, ActionType>(_ binding: StaticActionBinding<FeatureType, ActionType>) {
Flint.bind(binding.action, to: feature)
}
public func declare<FeatureType, ActionType>(_ binding: ConditionalActionBinding<FeatureType, ActionType>) {
Flint.bind(binding.action, to: feature)
}
public func publish<FeatureType, ActionType>(_ binding: StaticActionBinding<FeatureType, ActionType>) {
Flint.publish(binding.action, to: feature)
}
public func publish<FeatureType, ActionType>(_ binding: ConditionalActionBinding<FeatureType, ActionType>) {
Flint.publish(binding.action, to: feature)
}
}
|
[
-1
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.