blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 2
625
| content_id
stringlengths 40
40
| detected_licenses
sequencelengths 0
47
| license_type
stringclasses 2
values | repo_name
stringlengths 5
116
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringclasses 643
values | visit_date
timestamp[ns] | revision_date
timestamp[ns] | committer_date
timestamp[ns] | github_id
int64 80.4k
689M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 16
values | gha_event_created_at
timestamp[ns] | gha_created_at
timestamp[ns] | gha_language
stringclasses 85
values | src_encoding
stringclasses 7
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 1
class | length_bytes
int64 4
6.44M
| extension
stringclasses 17
values | content
stringlengths 4
6.44M
| duplicates
sequencelengths 1
9.02k
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7310d6cc3d4435561f88f7331647e18f922e531c | c224a1cee50e6b52704999a568ce9c3bbd1a24bc | /Axxent Farms/Controller/Custom Cells/adminAuditorCell.swift | 99662cbeaa7098067c9b1560f7d837bef52fe6a5 | [] | no_license | DhrubojyotiBis1/Farm | d4727a9bcf3ee74e1f5bc102f20531c54574350c | 9c9571c7de6be215389ebc3d315188a24d30b0a3 | refs/heads/master | 2020-04-21T15:15:17.684923 | 2019-03-15T15:15:49 | 2019-03-15T15:15:49 | 169,662,895 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,008 | swift | //
// adminAuditorCell.swift
// Farm
//
// Created by Dhrubojyoti on 28/02/19.
// Copyright © 2019 Dhrubojyoti. All rights reserved.
//
import UIKit
class adminAuditorCell: UITableViewCell {
@IBOutlet weak var view: UIView!
@IBOutlet weak var contactNumber: UILabel!
@IBOutlet weak var email: UILabel!
@IBOutlet weak var managerId: UILabel!
@IBOutlet weak var userName: UILabel!
@IBOutlet weak var name: UILabel!
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
override func layoutSubviews() {
view.layer.cornerRadius = 5
view.layer.masksToBounds = false
view.layer.shadowColor = UIColor.gray.cgColor
view.layer.shadowOffset = CGSize(width: 0, height: 3)
view.layer.shadowOpacity = 0.8
}
}
| [
-1
] |
8e1a2feb23513f634287d531946e937e1a712e63 | 449558008e4d8af5ebe8445c5ac919f824766b48 | /CopyPasteSwift/Modules/CoreDataWrapper/CoreDataIO.swift | 2ccb6e5eeb0f27336479a0448d57e0a8af0e2562 | [] | no_license | abozaid-ibrahim/CopyPaste | 505f168d955314f9e6b06f51b6c610e9e61bae15 | 23d76d92d5244087d46a79c5207f50daf4fe1dd4 | refs/heads/master | 2022-12-31T06:34:36.914957 | 2020-10-23T20:23:48 | 2020-10-23T20:23:48 | null | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,964 | swift | //
// CoreDataManager.swift
// CoreDataTut
//
// Created by abuzeid on 28.09.20.
// Copyright © 2020 abuzeid. All rights reserved.
//
import CoreData
import Foundation
final class CoreDataIO: CoreDataIOType {
let dataModelName = "Marvel"
static let shared = CoreDataIO()
private init() {}
lazy var backgroundContext: NSManagedObjectContext = {
let contxt = self.persistentContainer.newBackgroundContext()
contxt.automaticallyMergesChangesFromParent = true
return contxt
}()
lazy var persistentContainer: NSPersistentContainer = {
let container = NSPersistentContainer(name: CoreDataIO.shared.dataModelName)
container.loadPersistentStores(completionHandler: { [weak self] _, error in
self?.handle(error: error)
})
return container
}()
func printDBPath() {
let path = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).last
log("DB Directory: ", path, level: .info)
}
private func handle(error: Error?) {
if let error = error as NSError? {
#if DEBUG
fatalError("Unresolved error \(error), \(error.userInfo)")
#endif
}
}
func saveContext() {
let context = persistentContainer.viewContext
guard context.hasChanges else { return }
do {
try context.save()
} catch {
handle(error: error)
}
}
func clearCache(for entity: TableName, where predicate: NSPredicate? = nil) {
let fetchRequest = NSFetchRequest<NSFetchRequestResult>(entityName: entity.rawValue)
fetchRequest.predicate = predicate
let batchDeleteRequest = NSBatchDeleteRequest(fetchRequest: fetchRequest)
do {
try backgroundContext.execute(batchDeleteRequest)
} catch {
log("Detele all data in \(entity) error :", error, level: .error)
}
}
}
| [
-1
] |
5502a7fcfefa6dd05c179db4e55a71aae1212c0c | 289d48242473cdf9a48b474ce22c64608df4cd24 | /AppStoreJSONApis/Views/Apps/Details/ReviewRowCell.swift | 3f30533b085cc5549e7a7932467adf7a17590d48 | [] | no_license | alexbeattie/diffableios | 4eb679f12aef51310b4d1316a2b810ed4adfc271 | 1ab719920f652d47e4c6fbdb01660975fd46cdb8 | refs/heads/master | 2022-04-23T00:53:29.716537 | 2020-04-23T00:00:14 | 2020-04-23T00:00:14 | 258,023,597 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,010 | swift | //
// ReviewRowCell.swift
// AppStoreJSONApis
//
// Created by Brian Voong on 2/22/19.
// Copyright © 2019 Brian Voong. All rights reserved.
//
import UIKit
class ReviewRowCell: UICollectionViewCell {
let reviewsRatingsLabel = UILabel(text: "Reviews & Ratings", font: .boldSystemFont(ofSize: 20))
let reviewsController = ReviewsController()
override init(frame: CGRect) {
super.init(frame: frame)
addSubview(reviewsRatingsLabel)
addSubview(reviewsController.view)
reviewsRatingsLabel.anchor(top: topAnchor, leading: leadingAnchor, bottom: nil, trailing: trailingAnchor, padding: .init(top: 20, left: 20, bottom: 0, right: 20))
reviewsController.view.anchor(top: reviewsRatingsLabel.bottomAnchor, leading: leadingAnchor, bottom: bottomAnchor, trailing: trailingAnchor, padding: .init(top: 20, left: 0, bottom: 0, right: 0))
}
required init?(coder aDecoder: NSCoder) {
fatalError()
}
}
| [
-1
] |
b701952d4d0c92bb0bc0c7a4d78f082fe2e245aa | 07659113e0bf53901ced1d560f5f7ede6f2dd509 | /CavyGame/ThirdParty/LIJWebImage/WebImageManager.swift | 73e5fbc5208c248a965892f4bb7cd5c79925a048 | [] | no_license | NNMMbaby/CavyGame | 13381d22dd680048b40d6d84441a1ed4dca27951 | 9b8128a9e80a1e5ea7fe31b89a2cf9972b8a490b | refs/heads/master | 2021-01-17T23:44:57.588837 | 2016-02-03T07:23:41 | 2016-02-03T07:23:41 | 49,945,078 | 0 | 1 | null | 2016-01-19T10:27:24 | 2016-01-19T10:27:24 | null | UTF-8 | Swift | false | false | 3,674 | swift | //
// WebImageManager.swift
// LIJWebImage
//
// Created by 李俊 on 15/7/15.
// Copyright (c) 2015年 李俊. All rights reserved.
//
import UIKit
class WebImageManager: NSObject {
let queue = NSOperationQueue()
var imageCache = NSMutableDictionary()
var operationCache = NSMutableDictionary()
var waitimageCache = NSMutableDictionary()
class var sharedInstance: WebImageManager {
struct Static {
static var onceToken: dispatch_once_t = 0
static var instance: WebImageManager? = nil
}
dispatch_once(&Static.onceToken) {
Static.instance = WebImageManager()
}
return Static.instance!
}
private override init() {
super.init()
NSNotificationCenter.defaultCenter().addObserver(self, selector: "receviMomeryWorning", name: UIApplicationDidReceiveMemoryWarningNotification, object: nil)
}
func cancelOperation(path: String){
if let op = self.operationCache[path] as? NSOperation{
op.cancel()
operationCache.removeObjectForKey(path)
print("取消下载")
}
}
func isDownloading(path: String)->Bool{
if let _ = self.operationCache[path] as? NSOperation {
return true
}
return false
}
func isDownloaded(path: String)->Bool{
if let ime = self.imageCache[path] as? UIImage {
return true
}
return false
}
func getImg(path: String)->UIImage{
return self.imageCache[path] as! UIImage
}
func downloadWebImage(path: String, network needfromNetwork : Bool, complition: (image: UIImage) -> ()){
if let ime = self.imageCache[path] as? UIImage {
// print("从内存中加载")
complition(image: ime)
return
}
if !needfromNetwork {
let imagePath = path.cachesPath()
if let ime = UIImage(contentsOfFile: imagePath) {
complition(image: ime)
imageCache.setValue(ime, forKey: path)
// print("从沙盒中加载")
return
}
}
if let _ = self.operationCache[path] as? NSOperation {
var waitImage = Array<(image: UIImage) -> ()> ()
if let imeArray = self.waitimageCache[path] as? Array<(image: UIImage) -> ()> {
waitImage = imeArray
}
waitImage.append(complition)
waitimageCache.setValue((waitImage as? AnyObject), forKey: path)
// print("正在玩命下载中")
return
}
// print("开始下载")
let op = LIJOperation.operationWith(path, complition: { (image) -> () in
// print("下载完成")
self.operationCache.removeObjectForKey(path)
self.imageCache.setValue(image, forKey: path)
complition(image: image)
})
operationCache.setValue(op, forKey: path)
queue.addOperation(op)
}
func receviMomeryWorning() {
imageCache.removeAllObjects()
operationCache.removeAllObjects()
}
}
| [
-1
] |
13a6793727d57c2769ec182d6c706b90a98f272a | c62c9b0ad6ef70588bbd5176407301ab954b2191 | /P3-AppleWallet/P3-AppleWallet/View/ContentView.swift | 9b29b024ee0c282437895833df71ad5582521e51 | [] | no_license | mrmaug/swiftui13 | b4e9c3fc4e49a1159608c5d2808d5d9704763cae | f01bb2d974028b051e5424854ee3f05e1f542ade | refs/heads/master | 2022-10-30T23:59:54.606360 | 2020-06-19T01:20:57 | 2020-06-19T01:20:57 | 269,273,177 | 1 | 0 | null | 2020-06-04T05:57:39 | 2020-06-04T05:57:38 | null | UTF-8 | Swift | false | false | 7,887 | swift | //
// ContentView.swift
// P3-AppleWallet
//
// Created by Juan Gabriel Gomila Salas on 06/03/2020.
// Copyright © 2020 Frogames. All rights reserved.
//
import SwiftUI
struct ContentView: View {
@State var cards: [Card] = tempCards
@State var cardPresented = false
@State var cardPressed = false
@State var cardSelected: Card?
@GestureState private var dragState = DragState.none
private let offset: CGFloat = 75.0
private func offset(for card: Card) -> CGSize{
guard let idx = index(for: card) else {
return CGSize() //(0,0)
}
if cardPressed{
guard let cardSelected = self.cardSelected,
let cardSelectedIdx = cards.firstIndex(where: {$0.id == cardSelected.id}) else{
return CGSize()
}
if cardSelectedIdx <= idx {
return CGSize()
}else{
return CGSize(width: 0, height: 3000)
}
}
var pressedOffset = CGSize.zero
var dragOffset : CGFloat = 0
if let dragIdx = dragState.idx, dragIdx == idx {
pressedOffset.height = dragState.isPressing ? -20 : 0
switch dragState.translation.width {
case let width where width < -15:
pressedOffset.width = -25
case let width where width > 15:
pressedOffset.width = 25
default:
break
}
dragOffset = dragState.translation.height
}
return CGSize(width: 0 + pressedOffset.width,
height: -offset * CGFloat(idx) + pressedOffset.height + dragOffset)
}
private func zIndex(for card: Card) -> Double{
guard let idx = index(for: card) else{
return 0.0
}
let defaultIndex = -Double(idx)
if let dragIdx = dragState.idx,
dragIdx == idx {
return defaultIndex + Double(dragState.translation.height / offset)
}
return defaultIndex
}
private func index(for card: Card) -> Int? {
guard let idx = cards.firstIndex(where: {$0.id == card.id}) else{
return nil
}
return idx
}
private func orderCards(for card: Card, dragOffset: CGSize){
guard let oldIdx = index(for: card) else{
return
}
var newIdx = oldIdx - Int(dragOffset.height / offset)
if(newIdx >= cards.count){
newIdx = cards.count - 1
}
if(newIdx < 0){
newIdx = 0
}
let removedCard = cards.remove(at: oldIdx)
cards.insert(removedCard, at: newIdx)
}
var body: some View {
VStack{
TopBar()
//.padding(.bottom, 50)
Spacer()
ZStack{
if cardPresented{
ForEach(cards){ c in
CardView(card: c)
.offset(self.offset(for: c))
.animation(.default)
.scaleEffect(1.0)
.padding(.horizontal, 30)
.zIndex(self.zIndex(for: c))
.shadow(color: .gray, radius: 1.5, x: 1.0, y: 1.0)
.transition(AnyTransition.slide.combined(with: .move(edge: .leading)).combined(with: .opacity))
.animation(self.animation(for: c))
.gesture(TapGesture()
.onEnded({ _ in
withAnimation{
self.cardPressed.toggle()
self.cardSelected = self.cardPressed ? c : nil
}
})
.exclusively(before: LongPressGesture(minimumDuration: 0.1)
//SOLO DEBE EJECUTARSE DESPUES DE UNA PULSACION LARGA
.sequenced(before: DragGesture())
.updating(self.$dragState, body: { (value, state, transaction) in
switch value{
case .first(true):
state = .pressing(idx: self.index(for: c))
case .second(true, let drag):
state = .dragging(idx: self.index(for: c), translation: drag?.translation ?? .zero)
default:
break
}
})
.onEnded({ (value) in
guard case .second(true, let drag?) = value else{
return
}
self.orderCards(for: c, dragOffset: drag.translation)
})
)
)
}
}
}.onAppear{
self.cardPresented.toggle()
}
if cardPressed{
TransactionHistoryView()
.padding(.top, 20)
.transition(.move(edge: .bottom))
.animation(Animation.linear(duration: 0.2).delay(0.1))
}
Spacer()
}
}
private func animation(for card: Card) -> Animation{
var delay = 0.0
if let idx = index(for: card){
delay = Double(cards.count - idx)*0.2
}
return Animation.spring(response: 0.2, dampingFraction: 1, blendDuration: 0.2).delay(delay)
}
}
struct CardView: View {
var card: Card
var body: some View{
Image(card.image)
.resizable()
.scaledToFit()
.overlay(
VStack(alignment: .leading){
Text(card.number)
.bold()
Text(card.clientName)
.bold()
HStack{
Text("Válida hasta:")
.font(.caption)
Text(card.expirationDate)
.font(.caption)
}
}
.foregroundColor(.white)
.padding(.leading, 55)
.padding(.bottom, 45)
.shadow(color: .black, radius: 1.5, x: 0.0, y: 1.0)
, alignment: .bottomLeading
)
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
Group{
ContentView()
TopBar().previewLayout(.sizeThatFits)
ForEach(tempCards){c in
CardView(card: c).previewLayout(.sizeThatFits)
}
}
}
}
struct TopBar: View {
var body: some View{
HStack{
Text("Cartera")
.font(.system(.largeTitle, design: .rounded))
.fontWeight(.heavy)
Spacer()
Image(systemName: "plus.circle")
.font(.system(.largeTitle))
}
.padding(.horizontal, 20)
.padding(.vertical, 30)
}
}
| [
-1
] |
808fcded5dfa6f167bb814c38f7dfb83b71136b0 | b24349b55bd2a1833f05bd19dec89c083f645ea3 | /SwiftAudioAdditions/AudioFileFormats.swift | 5daac9aab4c4472d2a223d2a0fc7907ac684d7aa | [
"Zlib"
] | permissive | MaddTheSane/SwiftMacTypes | 1082f8c06923b72bce7c0ab87d7345836fffc672 | 12e2b389587d6c29fb84ae0785ad278e9687614d | refs/heads/master | 2023-06-21T18:38:25.414598 | 2023-06-08T00:14:08 | 2023-06-08T00:14:08 | 22,735,997 | 25 | 10 | null | null | null | null | UTF-8 | Swift | false | false | 9,825 | swift | //
// AudioFileFormats.swift
// PlaySequenceSwift
//
// Created by C.W. Betts on 2/5/18.
//
import Foundation
import AudioToolbox
import SwiftAdditions
private func OSTypeToStr(_ val: OSType) -> String {
var toRet = ""
toRet.reserveCapacity(16)
var str = [Int8](repeating: 0, count: 4)
do {
var tmpStr = val.bigEndian
memcpy(&str, &tmpStr, MemoryLayout<OSType>.size)
}
for p in str {
if isprint(Int32(p)) != 0 && p != ASCIICharacter.backSlashCharacter.rawValue {
toRet += String(Character(Unicode.Scalar(UInt8(p))))
} else {
toRet += String(format: "\\x%02x", p)
}
}
return toRet
}
extension AudioStreamBasicDescription: Hashable {
public func hash(into hasher: inout Hasher) {
mSampleRate.hash(into: &hasher)
mFormatID.hash(into: &hasher)
mFormatFlags.hash(into: &hasher)
mBytesPerPacket.hash(into: &hasher)
mFramesPerPacket.hash(into: &hasher)
mBytesPerFrame.hash(into: &hasher)
mChannelsPerFrame.hash(into: &hasher)
mBitsPerChannel.hash(into: &hasher)
//mReserved.hash(into: &hasher)
}
}
public class AudioFileFormats {
public static let shared = AudioFileFormats()
public struct DataFormatInfo: CustomDebugStringConvertible, Hashable {
public internal(set) var formatID: OSType = 0
public internal(set) var variants = [AudioStreamBasicDescription]()
public internal(set) var readable = false
public internal(set) var writable = false
public internal(set) var eitherEndianPCM = false
public var debugDescription: String {
func ny(_ val: Bool) -> String {
if val {
return ""
} else {
return " not"
}
}
var toRet = " '\(OSTypeToStr(formatID))':\(ny(readable)) readable\(ny(writable)) writable\n"
for variant in variants {
toRet += " \(variant.description)\n"
}
return toRet
}
}
public struct FileFormatInfo: CustomDebugStringConvertible {
public var fileTypeID = AudioFileTypeID()
public var fileTypeName = ""
public var extensions = [String]()
public var dataFormats = [DataFormatInfo]()
public func `extension`(at index: Int) -> String {
return extensions[index]
}
public func matchExtension(_ testExt: String) -> Bool {
for ext in extensions {
if ext.compare(testExt, options: [.caseInsensitive]) == .orderedSame {
return true
}
}
return false
}
public var anyWritableFormats: Bool {
for dfi in dataFormats {
if dfi.writable {
return true
}
}
return false
}
public mutating func loadDataFormats() {
guard dataFormats.isEmpty else {
return
}
var size: UInt32 = 0
// get all writable formats
var err = AudioFormatGetPropertyInfo(kAudioFormatProperty_EncodeFormatIDs, 0, nil, &size)
guard err == noErr else {
return
}
var writableFormats = [UInt32](repeating: 0, count: Int(size) / MemoryLayout<UInt32>.size)
err = AudioFormatGetProperty(kAudioFormatProperty_EncodeFormatIDs, 0, nil, &size, &writableFormats)
guard err == noErr else {
return
}
// get all readable formats
err = AudioFormatGetPropertyInfo(kAudioFormatProperty_DecodeFormatIDs, 0, nil, &size);
guard err == noErr else {
return
}
var readableFormats = [UInt32](repeating: 0, count: Int(size) / MemoryLayout<UInt32>.size)
err = AudioFormatGetProperty(kAudioFormatProperty_DecodeFormatIDs, 0, nil, &size, &readableFormats)
guard err == noErr else {
return
}
err = AudioFileGetGlobalInfoSize(kAudioFileGlobalInfo_AvailableFormatIDs, UInt32(MemoryLayout<UInt32>.size), &fileTypeID, &size);
guard err == noErr else {
return
}
let numDataFormats = Int(size) / MemoryLayout<OSType>.size
var formatIDs = [OSType](repeating: 0, count: numDataFormats)
err = AudioFileGetGlobalInfo(kAudioFileGlobalInfo_AvailableFormatIDs,
UInt32(MemoryLayout<UInt32>.size), &fileTypeID, &size, &formatIDs)
guard err == noErr else {
return
}
for fid in formatIDs {
var anyBigEndian = false, anyLittleEndian = false;
var dfi = DataFormatInfo()
dfi.formatID = fid
dfi.readable = fid == kAudioFormatLinearPCM
dfi.writable = fid == kAudioFormatLinearPCM
for readFor in readableFormats {
if readFor == fid {
dfi.readable = true
break
}
}
for writeFor in writableFormats {
if writeFor == fid {
dfi.writable = true
break
}
}
var tf = AudioFileTypeAndFormatID(mFileType: fileTypeID, mFormatID: fid)
err = AudioFileGetGlobalInfoSize(kAudioFileGlobalInfo_AvailableStreamDescriptionsForFormat,
UInt32(MemoryLayout<AudioFileTypeAndFormatID>.size), &tf, &size);
if err == noErr {
let variantsCount = Int(size) / MemoryLayout<AudioStreamBasicDescription>.size
var variants = [AudioStreamBasicDescription](repeating: AudioStreamBasicDescription(), count: variantsCount)
err = AudioFileGetGlobalInfo(kAudioFileGlobalInfo_AvailableStreamDescriptionsForFormat,
UInt32(MemoryLayout<AudioFileTypeAndFormatID>.size), &tf, &size, &variants);
if err == noErr {
dfi.variants = variants
for desc in variants {
if desc.mBitsPerChannel > 8 {
if (desc.mFormatFlags & kAudioFormatFlagIsBigEndian) == kAudioFormatFlagIsBigEndian {
anyBigEndian = true
} else {
anyLittleEndian = true
}
}
}
}
dfi.eitherEndianPCM = (anyBigEndian && anyLittleEndian);
dataFormats.append(dfi)
}
}
}
public var debugDescription: String {
var toRet = "File type: '\(OSTypeToStr(fileTypeID))' = \(fileTypeName)\n Extensions:"
for ext in extensions {
toRet += " .\(ext)"
}
var tmp = self
tmp.loadDataFormats()
toRet += "\n Formats:\n"
for df in dataFormats {
toRet += df.debugDescription
toRet += "\n"
}
return toRet
}
}
public private(set) var fileFormats = [FileFormatInfo]()
private init(loadFormats: Bool = true) {
var size: UInt32 = 0
var err = AudioFileGetGlobalInfoSize(kAudioFileGlobalInfo_WritableTypes, 0, nil, &size);
guard err == noErr else {
return
}
let mNumFileFormats = Int(size) / MemoryLayout<UInt32>.size
var fileTypes = [UInt32](repeating: 0, count: mNumFileFormats)
err = AudioFileGetGlobalInfo(kAudioFileGlobalInfo_WritableTypes, 0, nil, &size, &fileTypes);
guard err == noErr else {
return
}
for fileType in fileTypes {
var ffi = FileFormatInfo()
var filetype = fileType
ffi.fileTypeID = fileType
// file type name
do {
size = UInt32(MemoryLayout<CFString>.size)
var fileName: CFString? = nil
err = AudioFileGetGlobalInfo(kAudioFileGlobalInfo_FileTypeName, UInt32(MemoryLayout<UInt32>.size), &filetype, &size, &fileName)
if let fileName2 = fileName as String? {
ffi.fileTypeName = fileName2
}
}
// file extensions
do {
size = UInt32(MemoryLayout<CFArray>.size)
var extensions: CFArray? = nil
err = AudioFileGetGlobalInfo(kAudioFileGlobalInfo_ExtensionsForType, UInt32(MemoryLayout<UInt32>.size), &filetype, &size, &extensions)
if let ext2 = extensions as? [String] {
ffi.extensions = ext2
}
}
if loadFormats {
ffi.loadDataFormats()
}
fileFormats.append(ffi)
}
fileFormats.sort { (a, b) -> Bool in
return a.fileTypeName.localizedCaseInsensitiveCompare(b.fileTypeName) == .orderedAscending
}
}
/// Note that the returning format will have zero for the sample rate, channels per frame, bytesPerPacket, bytesPerFrame
public func inferDataFormat(fromFileFormat filetype: AudioFileTypeID) -> AudioStreamBasicDescription? {
var fmt = AudioStreamBasicDescription()
// if the file format only supports one data format
for var ffi in fileFormats {
ffi.loadDataFormats()
if ffi.fileTypeID == filetype && ffi.dataFormats.count > 0 {
var dfi = ffi.dataFormats[0]
if ffi.dataFormats.count > 1 {
// file can contain multiple data formats. Take PCM if it's there.
for datForm in ffi.dataFormats {
if datForm.formatID == kAudioFormatLinearPCM {
dfi = datForm
break
}
}
}
memset(&fmt, 0, MemoryLayout<AudioStreamBasicDescription>.size);
fmt.mFormatID = dfi.formatID
if dfi.variants.count > 0 {
// take the first variant as a default
fmt = dfi.variants[0]
if dfi.variants.count > 1 && dfi.formatID == kAudioFormatLinearPCM {
// look for a 16-bit variant as a better default
for desc in dfi.variants {
if (desc.mBitsPerChannel == 16) {
fmt = desc
break
}
}
}
}
return fmt
}
}
return nil
}
public func inferFileFormat(from url: URL) -> AudioFileTypeID? {
let ext = url.pathExtension
guard ext.count > 0 else {
return nil
}
for ffi in fileFormats {
if ffi.matchExtension(ext) {
return ffi.fileTypeID
}
}
return nil
}
public func inferFileFormat(from fmt: AudioStreamBasicDescription) -> AudioFileTypeID? {
var theFileFormat: FileFormatInfo? = nil
for var ffi in fileFormats {
ffi.loadDataFormats()
for dfi in ffi.dataFormats {
if dfi.formatID == fmt.mFormatID {
if theFileFormat != nil {
return nil // ambiguous
}
theFileFormat = ffi // got a candidate
}
}
}
if let theFileFormat = theFileFormat {
return theFileFormat.fileTypeID
}
return nil
}
public func isKnownDataFormat(_ dataFormat: OSType) -> Bool {
for var ffi in fileFormats {
ffi.loadDataFormats()
for dfi in ffi.dataFormats {
if dfi.formatID == dataFormat {
return true
}
}
}
return false
}
public func findFileFormat(_ formatID: UInt32) -> FileFormatInfo? {
for ffi in fileFormats {
if ffi.fileTypeID == formatID {
return ffi
}
}
return nil
}
}
| [
-1
] |
65ede56ad31434ce0bf63386d8b83a459ba29967 | 6f5a559a6ac2e6c85c1acc5c862f7802292aeca4 | /ETHModule/ETHModule/Classes/PresentationLayer/Modules/AuthFlow/AuthRoot/Presenter/AuthRootPresenter.swift | 85b93d45a01e8388204f0bdb9bbedfd99093850a | [] | no_license | T1DEe/MAGWalletDP | 3157fa3cc6d7457619015f863610336198f7f60d | 037b7d023db74171351073b08b6e89914eea5b1f | refs/heads/master | 2023-05-23T06:29:27.973659 | 2021-06-09T23:27:54 | 2021-06-09T23:27:54 | 357,493,097 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,690 | swift | //
// AuthRootAuthRootPresenter.swift
// ETHModule
//
// Created by Artemy Markovsky on 08/04/2021.
// Copyright © 2021. All rights reserved.
//
import SharedFilesModule
import UIKit
enum AuthRootDismissReason {
case completed
case canceledByButton
case canceled
}
class AuthRootPresenter {
weak var view: AuthRootViewInput!
weak var output: AuthRootModuleOutput?
var needShowBack: Bool = false
var interactor: AuthRootInteractorInput!
var router: AuthRootRouterInput!
var dismissReason: AuthRootDismissReason = .canceled
}
// MARK: - AuthRootModuleInput
extension AuthRootPresenter: AuthRootModuleInput {
var viewController: UIViewController {
return view.viewController
}
}
// MARK: - AuthRootViewOutput
extension AuthRootPresenter: AuthRootViewOutput {
func viewIsReady() {
interactor.bindToEvents()
router.presentAuthFlowSelection(output: self, needShowBack: needShowBack)
}
func viewDismissed(isMovingFromParent: Bool) {
guard isMovingFromParent else {
return
}
switch dismissReason {
case .completed, .canceledByButton:
return
case .canceled:
output?.cancelAuthFlow(autoCanceled: true)
}
}
}
extension AuthRootPresenter: AuthFlowSelectionModuleOutput {
func actionBack() {
dismissReason = .canceledByButton
output?.cancelAuthFlow(autoCanceled: false)
}
}
// MARK: - AuthRootInteractorOutput
extension AuthRootPresenter: AuthRootInteractorOutput {
func didAuthComplete() {
dismissReason = .completed
output?.completeAuthFlow()
}
}
| [
-1
] |
c873b31a8734c923409a62cd0f0c282b87407c75 | 7ca999dfcd4e97c567cb7e6986c52be906328912 | /AttendenceReport/Group.swift | 4cd65b48a517dc3f5dc3f258c2642ff41979dd09 | [
"MIT"
] | permissive | sldennis/attendencereport | 2eeca33948a23c86e3a3172260450a2804923970 | 124964364a15063610b8265ad1b5f263010ca519 | refs/heads/master | 2021-01-22T05:00:47.550605 | 2014-10-06T06:00:27 | 2014-10-06T06:00:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 312 | swift | //
// Group.swift
// AttendenceReport
//
// Created by Dennis on 6/10/14.
// Copyright (c) 2014 Practical-Limits. All rights reserved.
//
import Foundation
import CoreData
class Group: NSManagedObject {
@NSManaged var name: String
@NSManaged var members: NSSet
@NSManaged var events: NSSet
}
| [
-1
] |
0a279b20e9bef1ba82de6387bbb8041455a34137 | 3f5eaf8fffcabce6ba4837b97f1720e315b41523 | /FlappyBirdSwift/Player.swift | 41db449bcdf8cd0d82b25b0a6c9674984dc845ca | [
"MIT"
] | permissive | xiaoxiaosu0613/FlappybirdSwift | 34f53008e7a5213731a12e10739a2fb7b37b62da | 713bc2bbdead1d84766cc16cca114486b7f6eec1 | refs/heads/master | 2021-01-19T22:36:16.393506 | 2017-03-07T03:39:52 | 2017-03-07T03:39:52 | 83,775,969 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 576 | swift | //
// Player.swift
// FlappyBirdSwift
//
// Created by jamesSU on 2017/3/1.
// Copyright © 2017年 Arp77. All rights reserved.
//
import UIKit
import SpriteKit
class Player: SKSpriteNode {
let categoryBitMask = 0x1 << 0
let density = 1.15
convenience init() {
self.init(imageNamed: "bird")
self.size = CGSize(width: 32, height: 25)
self.physicsBody = SKPhysicsBody(rectangleOf: self.size)
self.physicsBody?.density = CGFloat(density)
self.physicsBody?.categoryBitMask = UInt32(categoryBitMask)
}
}
| [
-1
] |
638893849b2997421d837657bb0af3c5fbdb20e0 | 265238b160a33fc985e21074b54b460456137b76 | /RenderKit/Geometry/MetalCapsuleGeometry.swift | d7b0a3d6c44914b985904fcfe2c50e7b13e8a7ef | [
"MIT"
] | permissive | iRASPA/iRASPA-COCOA | 30855c91e013fd976f89ad9904115d76225fa64e | db366056eef31831d6f760d05cbdc2d772d5081a | refs/heads/master | 2022-02-07T18:44:33.894063 | 2022-01-25T08:53:41 | 2022-01-25T08:53:41 | 164,219,814 | 6 | 2 | null | null | null | null | UTF-8 | Swift | false | false | 3,824 | swift | //
// MetalCapsuleGeometry.swift
// RenderKit
//
// Created by David Dubbeldam on 05/08/2021.
// Copyright © 2021 David Dubbeldam. All rights reserved.
//
import Foundation
import simd
/// Geometry data for a capsule
/// - note:
/// The orientation (0,1,0) is along the y-axis.
/// Draw using 'drawIndexedPrimitives' with type '.triangle' and setCullMode(MTLCullMode.back).
/// More information:
///
/// Paul Borke: http://paulbourke.net/geometry/spherical/capsule.c
///
/// Texture coordinates untested
public class MetalCapsuleGeometry
{
public var numberOfVertexes: Int
public var vertices: [RKVertex]
public var numberOfIndices: Int
public var indices: [UInt16]
public convenience init()
{
self.init(radius: 1.0, height: 2.0, slices: 42)
}
/// Geometry data for a capsule
///
/// - parameter radius: the radius of the capsule
/// - parameter height: the height of the capsule
/// - parameter slices: the number of slices
public init(radius: Double = 1.0, height: Double = 2.0, slices: Int = 42)
{
numberOfVertexes = (slices + 1) * (slices/2 + 2)
vertices = []
indices = []
for j in 0...slices/4
{
// bottom side
for i in 0...slices
{
let theta: Double = Double(i) * 2.0 * Double.pi / Double(slices);
let phi: Double = -0.5*Double.pi + Double.pi * Double(j) / (Double(slices)/2)
let pos: SIMD3<Double> = SIMD3<Double>(x: radius * cos(phi) * cos(theta), y: radius * sin(phi), z: radius * cos(phi) * sin(theta))
let length: Double = length(pos)
let position: SIMD4<Float> = SIMD4<Float>(x: pos.x, y: pos.y - 0.5 * height, z: pos.z, w: 0.0)
let normal: SIMD4<Float> = SIMD4<Float>(x: pos.x/length, y: pos.y/length, z: pos.z/length, w: 0.0)
var st: SIMD2<Float> = SIMD2<Float>()
st.x = atan2(position.z,position.x) / (2.0 * Float.pi);
if (st.x < 0.0)
{
st.x = 1.0 + st.x;
}
st.y = 0.5 + atan2(position.y,sqrt(position.x*position.x+position.z*position.z)) / Float.pi
vertices.append(RKVertex(position: position, normal: normal, st: st))
}
}
// top side
for j in slices/4...slices/2
{
for i in 0...slices
{
let theta: Double = Double(i) * 2.0 * Double.pi / Double(slices)
let phi: Double = -0.5*Double.pi + Double.pi * Double(j) / (Double(slices)/2)
let pos: SIMD3<Double> = SIMD3<Double>(x: radius * cos(phi) * cos(theta), y: radius * sin(phi), z: radius * cos(phi) * sin(theta))
let length: Double = length(pos)
let position: SIMD4<Float> = SIMD4<Float>(x: pos.x, y: pos.y + 0.5 * height, z: pos.z , w: 0.0)
let normal: SIMD4<Float> = SIMD4<Float>(x: pos.x/length, y: pos.y/length, z: pos.z/length, w: 0.0)
var st: SIMD2<Float> = SIMD2<Float>()
st.x = atan2(position.z,position.x) / (2.0 * Float.pi);
if (st.x < 0.0)
{
st.x = 1.0 + st.x;
}
st.y = 0.5 + atan2(position.y,sqrt(position.x*position.x+position.z*position.z)) / Float.pi;
vertices.append(RKVertex(position: position, normal: normal, st: SIMD2<Float>()))
}
}
for j in 0...slices/2
{
for i in 0...slices
{
let i1 = j * (slices+1) + i
let i2 = j * (slices+1) + (i + 1)
let i3 = (j+1) * (slices+1) + (i + 1)
let i4 = (j+1) * (slices+1) + i
indices.append(UInt16(i1))
indices.append(UInt16(i2))
indices.append(UInt16(i3))
indices.append(UInt16(i1))
indices.append(UInt16(i3))
indices.append(UInt16(i4))
}
}
numberOfIndices = indices.count
assert(vertices.count == (slices+1)*(slices/2+2))
}
}
| [
-1
] |
cd58055361cc8c5ce12578367c39eaa92147f324 | c0c0274686f423b4f2064b2d8c749adbfaf42475 | /SeguesUITests/SeguesUITests.swift | 22dd96b06279d27c6b0248973dc04679adb561d0 | [] | no_license | andrelinces/Segues | 7c9cf7546818c3cd85de02f35b8a4c4b5813d9d4 | 816f2b40f5d9a01139908f84582bd8aeeaf0471f | refs/heads/main | 2023-07-15T01:03:37.454792 | 2021-08-22T16:25:14 | 2021-08-22T16:25:14 | 398,841,978 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,424 | swift | //
// SeguesUITests.swift
// SeguesUITests
//
// Created by Andre Linces on 22/08/21.
//
import XCTest
class SeguesUITests: XCTestCase {
override func setUpWithError() throws {
// Put setup code here. This method is called before the invocation of each test method in the class.
// In UI tests it is usually best to stop immediately when a failure occurs.
continueAfterFailure = false
// In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
}
override func tearDownWithError() throws {
// Put teardown code here. This method is called after the invocation of each test method in the class.
}
func testExample() throws {
// UI tests must launch the application that they test.
let app = XCUIApplication()
app.launch()
// Use recording to get started writing UI tests.
// Use XCTAssert and related functions to verify your tests produce the correct results.
}
func testLaunchPerformance() throws {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 7.0, *) {
// This measures how long it takes to launch your application.
measure(metrics: [XCTApplicationLaunchMetric()]) {
XCUIApplication().launch()
}
}
}
}
| [
360463,
155665,
376853,
344106,
253996,
163894,
180279,
385078,
319543,
352314,
213051,
376892,
32829,
286787,
352324,
237638,
352327,
385095,
393291,
163916,
368717,
311373,
196687,
278607,
311377,
254039,
426074,
368732,
180317,
32871,
352359,
221292,
278637,
385135,
319599,
376945,
131190,
385147,
131199,
426124,
196758,
49308,
65698,
311459,
49317,
377008,
377010,
180409,
295099,
377025,
377033,
164043,
417996,
254157,
368849,
368850,
139478,
229591,
385240,
254171,
147679,
147680,
311520,
205034,
254189,
286957,
254193,
344312,
336121,
262403,
147716,
368908,
180494,
368915,
254228,
319764,
278805,
262419,
377116,
254250,
311596,
131374,
418095,
336177,
368949,
180534,
155968,
287040,
311622,
270663,
319816,
368969,
254285,
180559,
377168,
344402,
229716,
368982,
270703,
139641,
385407,
385409,
270733,
106893,
385423,
385433,
213402,
385437,
254373,
156069,
385448,
385449,
311723,
115116,
385463,
319931,
278974,
336319,
336323,
188870,
278988,
278992,
262619,
377309,
377310,
369121,
369124,
279014,
270823,
279017,
311787,
213486,
360945,
139766,
279030,
393719,
377337,
279033,
254459,
410108,
410109,
262657,
377346,
279042,
279053,
410126,
393745,
385554,
303635,
279060,
279061,
262673,
254487,
410138,
279066,
188957,
377374,
385569,
385578,
377388,
197166,
393775,
418352,
33339,
352831,
33344,
385603,
377419,
303693,
426575,
369236,
385620,
115287,
189016,
270938,
287327,
279143,
279150,
287345,
352885,
352886,
344697,
189054,
287359,
369285,
385669,
311944,
344714,
311950,
377487,
311953,
287379,
336531,
180886,
426646,
352921,
377499,
221853,
344737,
295591,
352938,
295598,
418479,
279215,
279218,
164532,
336565,
287418,
377531,
303802,
377534,
377536,
66243,
385737,
287434,
279249,
303826,
385745,
369365,
369366,
385751,
230105,
361178,
352989,
352990,
418529,
295649,
385763,
295653,
369383,
230120,
361194,
312046,
418550,
279293,
344829,
205566,
197377,
434956,
312076,
295698,
418579,
426772,
197398,
426777,
221980,
344864,
197412,
336678,
262952,
262957,
189229,
164655,
197424,
328495,
197428,
336693,
230198,
377656,
426809,
197433,
222017,
295745,
377669,
197451,
369488,
279379,
385878,
385880,
295769,
197467,
435038,
230238,
279393,
303973,
279398,
385895,
197479,
385901,
197489,
295799,
164730,
336765,
254851,
369541,
172936,
320394,
426894,
189327,
377754,
172971,
140203,
377778,
304050,
189362,
189365,
377789,
189373,
345030,
345034,
279499,
418774,
386007,
418781,
386016,
123880,
418793,
320495,
222193,
435185,
271351,
214009,
312313,
435195,
312317,
328701,
328705,
386049,
418819,
410629,
377863,
189448,
230411,
320526,
361487,
435216,
386068,
254997,
336928,
336930,
410665,
345137,
361522,
312372,
238646,
238650,
320571,
386108,
410687,
336962,
238663,
377927,
361547,
205911,
156763,
361570,
230500,
214116,
214119,
402538,
279659,
173168,
230514,
238706,
279666,
312435,
377974,
66684,
279686,
402568,
222344,
140426,
337037,
386191,
410772,
222364,
418975,
124073,
402618,
148674,
402632,
148687,
402641,
189651,
419028,
279766,
189656,
304353,
279780,
222441,
279789,
386288,
66802,
271607,
369912,
369913,
419066,
279803,
386300,
386296,
386304,
320769,
369929,
419097,
320795,
115997,
222496,
320802,
304422,
369964,
353581,
116014,
312628,
345397,
345398,
222523,
386363,
230730,
353611,
337228,
353612,
345418,
296269,
222542,
238928,
296274,
337226,
353617,
378201,
230757,
296304,
312688,
337280,
296328,
263561,
296330,
304523,
353672,
9618,
279955,
411028,
370066,
370072,
148899,
148900,
361928,
337359,
329168,
312785,
222674,
329170,
353751,
280025,
239069,
329181,
320997,
361958,
271850,
280042,
280043,
271853,
329198,
411119,
337391,
116209,
296434,
386551,
288252,
312830,
271880,
198155,
304655,
329231,
370200,
222754,
157219,
157220,
394793,
312879,
288305,
288319,
288322,
280131,
288328,
353875,
99937,
345697,
312937,
271980,
206447,
403057,
42616,
337533,
280193,
370307,
419462,
149127,
419464,
149128,
288391,
214667,
411275,
239251,
345753,
198304,
255651,
337590,
370359,
280252,
280253,
321217,
239305,
296649,
403149,
313042,
345813,
370390,
272087,
345817,
337638,
345832,
181992,
345835,
288492,
141037,
313082,
288508,
288515,
173828,
395018,
395019,
116491,
395026,
124691,
116502,
435993,
411417,
345882,
321308,
255781,
362281,
378666,
403248,
378673,
345910,
182070,
182071,
436029,
345918,
337734,
280396,
272207,
272208,
337746,
395092,
362326,
345942,
345950,
370526,
362336,
255844,
296807,
214894,
362351,
214896,
313200,
313204,
124795,
182145,
280451,
67464,
305032,
337816,
124826,
239515,
329627,
436130,
354210,
436135,
10153,
313257,
362411,
370604,
362418,
411587,
280517,
362442,
346066,
231382,
354268,
436189,
403421,
329696,
354273,
403425,
190437,
436199,
354279,
174058,
337899,
247787,
247786,
296942,
313322,
354283,
436209,
124912,
239610,
346117,
182277,
403463,
43016,
354310,
354311,
354312,
313356,
436235,
419857,
305173,
436248,
223269,
346153,
354346,
313388,
124974,
272432,
403507,
378933,
378934,
436283,
288835,
403524,
436293,
313415,
239689,
436304,
223317,
411738,
272477,
280676,
313446,
395373,
288878,
346237,
215165,
436372,
329884,
378186,
362658,
436388,
215204,
125108,
133313,
395458,
338118,
436429,
346319,
321744,
379102,
387299,
18661,
379110,
338151,
125166,
149743,
379120,
436466,
125170,
411892,
395511,
436471,
313595,
436480,
125184,
272644,
125192,
338187,
338188,
125197,
395536,
125200,
338196,
379157,
272661,
125204,
157973,
125215,
125216,
338217,
125225,
321839,
125236,
362809,
379193,
395591,
289109,
272730,
436570,
215395,
239973,
280938,
321901,
354671,
362864,
354672,
272755,
354678,
199030,
223611,
248188,
313726,
436609,
240003,
436613,
395653,
395660,
264591,
272784,
420241,
240020,
190870,
190872,
289185,
436644,
289195,
272815,
436659,
338359,
436677,
289229,
281038,
281039,
256476,
420326,
166403,
322057,
420374,
322077,
289328,
330291,
322119,
191065,
436831,
117350,
420461,
313970,
346739,
346741,
420473,
297600,
166533,
346771,
363155,
264855,
363161,
289435,
436897,
248494,
166581,
355006,
363212,
363228,
436957,
322269,
436960,
264929,
338658,
289511,
330473,
346859,
330476,
289517,
215790,
199415,
289534,
322302,
35584,
133889,
322312,
346889,
264971,
322320,
166677,
207639,
363295,
355117,
191285,
273209,
355129,
273211,
355136,
355138,
420680,
355147,
355148,
355153,
281426,
387927,
363353,
363354,
281434,
322396,
420702,
363361,
363362,
412516,
281444,
355174,
355173,
207724,
355182,
207728,
420722,
314240,
158594,
330627,
240517,
265094,
387977,
396171,
355216,
224146,
224149,
256918,
256919,
256920,
240543,
256934,
273336,
289720,
289723,
273341,
330688,
379845,
19398,
363462,
273353,
191445,
207839,
347104,
314343,
134124,
412653,
248815,
257007,
347122,
437245,
257023,
125953,
396292,
330759,
347150,
330766,
412692,
330789,
248871,
281647,
412725,
257093,
404550,
314437,
207954,
339031,
265318,
404582,
257126,
322664,
265323,
396395,
404589,
273523,
363643,
248960,
150656,
363658,
404622,
224400,
265366,
347286,
339101,
429216,
339106,
380069,
265381,
3243,
208044,
322733,
421050,
339131,
265410,
183492,
273616,
339167,
298209,
421102,
52473,
363769,
265467,
52476,
208123,
412926,
437504,
322826,
388369,
380178,
429332,
126229,
412963,
257323,
273713,
298290,
208179,
159033,
347451,
216387,
372039,
257353,
257354,
109899,
437585,
331091,
150868,
314708,
372064,
429410,
437602,
281958,
388458,
265579,
306541,
314734,
314740,
314742,
421240,
314745,
224637,
388488,
298378,
306580,
282008,
396697,
314776,
282013,
290206,
396709,
298406,
241067,
314797,
380335,
355761,
421302,
134586,
380348,
380350,
216510,
216511,
306630,
200136,
273865,
306634,
339403,
372172,
413138,
437726,
429540,
3557,
3559,
191980,
282097,
191991,
265720,
216575,
290304,
372226,
437766,
323083,
208397,
323088,
413202,
388630,
413206,
175640,
372261,
347693,
323120,
396850,
200245,
323126,
290359,
134715,
323132,
421437,
396865,
282182,
413255,
265800,
273992,
421452,
265809,
396885,
290391,
265816,
396889,
306777,
388699,
396896,
323171,
388712,
388713,
314997,
290425,
339579,
396927,
282248,
224907,
396942,
405140,
274071,
323226,
208547,
208548,
405157,
388775,
282279,
364202,
421556,
224951,
224952,
306875,
282302,
323262,
323265,
241360,
241366,
224985,
282330,
159462,
372458,
397040,
12017,
323315,
274170,
200444,
175874,
249606,
323335,
282379,
216844,
372497,
397076,
421657,
339746,
216868,
257831,
167720,
241447,
421680,
282418,
421686,
274234,
241471,
339782,
315209,
159563,
241494,
339799,
307038,
274276,
282471,
274288,
372592,
274296,
339840,
315265,
372625,
282517,
298912,
118693,
438186,
126896,
151492,
380874,
372699,
323554,
380910,
380922,
380923,
274432,
372736,
241695,
315431,
430120,
102441,
315433,
430127,
405552,
282671,
241717,
249912,
225347,
307269,
421958,
233548,
176209,
381013,
53334,
315477,
323678,
356446,
438374,
176231,
438378,
233578,
217194,
422000,
249976,
266361,
422020,
168069,
168070,
381061,
381071,
241809,
323730,
430231,
200856,
422044,
192670,
192671,
299166,
258213,
299176,
323761,
184498,
430263,
266427,
299208,
372943,
266447,
258263,
356575,
307431,
438512,
372979,
389364,
381173,
135416,
356603,
184574,
266504,
217352,
61720,
381210,
315674,
282908,
389406,
282912,
233761,
438575,
315698,
266547,
397620,
332084,
438583,
127292,
438592,
332100,
323914,
201037,
397650,
348499,
250196,
348501,
389465,
332128,
110955,
242027,
242028,
160111,
250227,
315768,
291193,
438653,
291200,
266628,
340356,
242059,
225684,
373141,
373144,
291225,
389534,
397732,
373196,
176602,
242138,
184799,
291297,
201195,
324098,
233987,
340489,
397841,
283154,
258584,
397855,
291359,
348709,
348710,
397872,
283185,
234037,
340539,
266812,
438850,
348741,
381515,
348748,
430681,
332379,
242274,
184938,
373357,
184942,
176751,
389744,
356983,
356984,
209529,
356990,
291455,
373377,
422529,
201348,
152196,
356998,
348807,
356999,
316044,
316050,
275102,
176805,
340645,
422567,
176810,
160441,
422591,
291529,
225996,
135888,
242385,
234216,
373485,
373486,
21239,
275193,
348921,
234233,
242428,
299777,
430853,
430860,
62222,
430880,
234276,
234290,
152372,
160569,
430909,
160576,
348999,
283466,
439118,
234330,
275294,
381791,
127840,
357219,
439145,
177002,
308075,
242540,
242542,
381811,
201590,
177018,
398205,
340865,
291713,
349066,
316299,
349068,
234382,
308111,
381840,
308113,
390034,
373653,
430999,
209820,
381856,
185252,
398244,
422825,
381872,
177074,
398268,
349122,
398275,
127945,
373705,
340960,
398305,
340967,
398313,
234476,
127990,
349176,
201721,
349179,
234499,
357380,
398370,
357413,
357420,
300087,
21567,
308288,
398405,
349254,
218187,
250955,
300109,
234578,
250965,
439391,
250982,
398444,
62574,
357487,
300147,
119925,
349304,
234626,
349315,
349317,
234635,
373902,
177297,
324761,
234655,
234662,
373937,
373939,
324790,
300215,
218301,
283841,
283846,
259275,
316628,
259285,
357594,
414956,
251124,
316661,
292092,
439550,
439563,
242955,
414989,
259346,
349458,
259347,
382243,
382246,
382257,
292145,
382264,
333115,
193853,
193858,
251212,
234830,
406862,
259408,
283990,
357720,
300378,
300379,
316764,
374110,
234864,
259449,
382329,
357758,
243073,
357763,
112019,
398740,
234902,
374189,
251314,
284086,
259513,
54719,
292291,
300490,
300526,
259569,
251379,
300539,
398844,
210429,
366081,
316951,
374297,
153115,
431646,
349727,
431662,
374327,
210489,
235069,
349764,
292424,
292426,
128589,
333389,
333394,
349780,
128600,
235096,
300643,
300645,
415334,
54895,
366198,
210558,
210559,
415360,
325246,
333438,
210569,
431754,
415369,
267916,
415376,
259741,
153252,
399014,
210601,
202413,
317102,
415419,
259780,
333508,
267978,
333522,
325345,
333543,
431861,
284410,
284425,
300812,
284430,
366358,
169751,
431901,
341791,
325411,
186148,
186149,
333609,
399148,
284460,
431918,
202541,
153392,
431935,
415555,
325444,
153416,
325449,
341837,
415566,
431955,
325460,
317268,
341846,
300893,
259937,
382820,
276326,
415592,
292713,
292719,
325491,
341878,
276343,
350072,
333687,
317305,
112510,
325508,
333700,
243590,
325514,
350091,
350092,
350102,
350108,
333727,
219046,
284584,
292783,
300983,
128955,
219102,
292835,
6116,
317416,
432114,
325620,
415740,
268286,
415744,
333827,
243720,
399372,
358418,
153618,
178215,
325675,
243763,
358455,
325695,
399433,
104534,
194667,
260206,
432241,
284789,
374913,
374914,
415883,
333968,
153752,
333990,
104633,
260285,
227517,
268479,
374984,
301270,
301271,
325857,
334049,
268515,
383208,
317676,
260337,
260338,
432373,
375040,
309504,
260355,
432387,
375052,
194832,
325904,
391448,
334104,
268570,
178459,
186660,
268581,
334121,
358698,
317738,
325930,
260396,
358707,
432435,
178485,
358710,
14654,
268609,
227655,
383309,
383327,
391521,
366948,
416101,
416103,
383338,
432503,
432511,
211327,
227721,
285074,
252309,
39323,
285083,
317851,
285089,
375211,
334259,
129461,
342454,
358844,
293309,
317889,
326083,
416201,
129484,
154061,
416206,
326093,
432608,
285152,
195044,
391654,
432616,
334315,
375281,
293368,
317949,
334345,
309770,
342537,
432650,
342549,
416288,
342560,
350758,
350759,
358951,
358952,
293420,
219694,
219695,
432694,
244279,
309831,
375369,
375373,
416334,
301647,
416340,
244311,
416353,
260705,
375396,
268901,
244326,
244345,
334473,
375438,
326288,
285348,
293552,
342705,
285362,
383668,
342714,
39616,
383708,
342757,
269036,
432883,
342775,
203511,
383740,
416509,
359166,
162559,
375552,
432894,
228099,
285443,
285450,
383755,
326413,
285467,
318247,
342827,
391980,
318251,
375610,
301883,
342846,
416577,
244569,
375644,
252766,
293729,
351078,
342888,
392057,
211835,
269179,
392065,
260995,
400262,
392071,
424842,
252812,
400271,
392080,
400282,
7070,
211871,
359332,
359333,
293801,
326571,
252848,
326580,
261045,
261046,
326586,
359365,
211913,
252878,
342990,
433104,
56270,
359380,
433112,
433116,
359391,
187372,
343020,
383980,
203758,
383994,
171009,
384004,
433166,
384015,
433173,
293911,
326684,
252959,
384031,
375848,
318515,
203829,
261191,
375902,
375903,
392288,
253028,
351343,
187505,
138354,
187508,
384120,
302202,
285819,
392317,
343166,
285823,
392320,
384127,
285833,
285834,
318602,
228492,
187539,
359574,
285850,
351389,
302239,
253098,
302251,
367791,
367792,
367798,
64699,
294075,
228541,
343230,
367809,
253124,
113863,
351445,
310496,
195809,
253168,
351475,
351489,
367897,
367898,
245018,
130342,
130344,
130347,
261426,
212282,
294210,
359747,
359748,
146760,
146763,
114022,
253288,
425327,
425331,
163190,
327030,
384379,
253316,
294278,
384391,
318860,
253339,
253340,
318876,
343457,
245160,
359860,
359861,
343480,
310714,
228796,
228804,
425417,
310731,
327122,
425434,
310747,
310758,
253431,
359931,
187900,
343552,
245249,
228868,
409095,
359949,
294413,
253456,
302613,
253462,
146976,
245290,
245291,
343606,
163385,
425534,
138817,
147011,
147020,
179800,
196184,
343646,
212574,
204386,
155238,
204394,
138862,
310896,
188021,
294517,
286351,
188049,
425624,
229021,
245413,
286387,
384693,
376502,
286392,
302778,
409277,
286400,
319176,
409289,
425682,
286419,
294621,
245471,
155360,
294629,
212721,
163575,
286457,
286463,
319232,
360194,
409355,
155408,
417556,
294699,
204600,
319289,
384826,
409404,
360253,
409416,
376661,
237397,
368471,
425820,
409446,
368486,
425832,
40809,
368489,
384871,
417648,
417658,
360315,
327556,
253828,
311183,
425875,
294806,
294808,
253851,
376733,
319393,
294820,
253868,
188349,
98240,
212947,
212953,
360416,
294887,
253930,
327666,
385011
] |
62c79c9e5008ea668ca972e58a4bbd80ed7232e9 | e08a2a2aa6e0ae903573314f02e85ef959e5c75c | /Api/AppDelegate.swift | 73c80ea603a422360db53455c07d232184f2d176 | [] | no_license | atilsamancioglu/api | f48cbbf54ac630a4da9c06ea486e7049165895de | 99e5e66fe9eb8b96d0b13b05f772241affc47f9d | refs/heads/master | 2021-01-21T21:15:29.937122 | 2017-06-19T17:12:01 | 2017-06-19T17:12:01 | 94,801,287 | 1 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 2,180 | swift | //
// AppDelegate.swift
// Api
//
// Created by Atil Samancioglu on 19/06/2017.
// Copyright © 2017 Atil Samancioglu. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}
func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
}
| [
229380,
229383,
229385,
278539,
294924,
229388,
278542,
229391,
327695,
229394,
278548,
229397,
229399,
229402,
352284,
229405,
278556,
278559,
229408,
294950,
229415,
229417,
327722,
237613,
229422,
229426,
237618,
229428,
286774,
286776,
319544,
286778,
229432,
204856,
352318,
286791,
237640,
286797,
278605,
311375,
163920,
237646,
196692,
319573,
311383,
278623,
278626,
319590,
311400,
278635,
303212,
278639,
131192,
237693,
303230,
327814,
303241,
131209,
417930,
303244,
311436,
319633,
286873,
286876,
311460,
311469,
32944,
327862,
286906,
327866,
180413,
286910,
131264,
286916,
295110,
286922,
286924,
286926,
319694,
286928,
131281,
131278,
278743,
278747,
295133,
155872,
131299,
319716,
237807,
303345,
286962,
131314,
229622,
327930,
278781,
278783,
278785,
237826,
319751,
278792,
286987,
319757,
311569,
286999,
319770,
287003,
287006,
287009,
287012,
287014,
287016,
287019,
311598,
287023,
311601,
287032,
155966,
319809,
319810,
278849,
319814,
311623,
319818,
311628,
229709,
319822,
287054,
278865,
229717,
196963,
196969,
139638,
213367,
106872,
319872,
311683,
311693,
65943,
319898,
311719,
278952,
139689,
278957,
311728,
278967,
180668,
311741,
278975,
319938,
278980,
98756,
278983,
319945,
278986,
319947,
278990,
278994,
311767,
279003,
279006,
188895,
172512,
287202,
279010,
279015,
172520,
319978,
279020,
172526,
311791,
279023,
172529,
279027,
319989,
172534,
180727,
164343,
279035,
311804,
287230,
279040,
303617,
287234,
279045,
172550,
303623,
172552,
287238,
320007,
279051,
172558,
279055,
303632,
279058,
303637,
279063,
279067,
172572,
279072,
172577,
295459,
172581,
295461,
279082,
311850,
279084,
172591,
172598,
279095,
172607,
172609,
172612,
377413,
172614,
172618,
303690,
33357,
287309,
303696,
279124,
172634,
262752,
254563,
172644,
311911,
189034,
295533,
172655,
172656,
352880,
295538,
189040,
172660,
287349,
189044,
189039,
287355,
287360,
295553,
172675,
295557,
287365,
311942,
303751,
352905,
311946,
287371,
279178,
311951,
287377,
172691,
287381,
311957,
221850,
287386,
230045,
172702,
287390,
164509,
172705,
287394,
172707,
303780,
303773,
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,
279258,
189149,
303838,
213724,
312035,
279267,
295654,
279272,
230128,
312048,
312050,
230131,
189169,
205564,
303871,
230146,
328453,
295685,
230154,
33548,
312077,
295695,
295701,
230169,
369433,
295707,
328476,
295710,
230175,
295720,
303914,
279340,
205613,
279353,
230202,
312124,
328508,
222018,
295755,
377676,
148302,
287569,
303959,
230237,
279390,
230241,
279394,
303976,
336744,
303985,
303987,
328563,
279413,
303991,
303997,
295806,
295808,
295813,
304005,
320391,
304007,
304009,
213895,
304011,
230284,
304013,
295822,
189325,
213902,
189329,
295825,
304019,
279438,
189331,
58262,
304023,
304027,
279452,
410526,
279461,
279462,
304042,
213931,
230327,
304055,
287675,
230334,
304063,
238528,
304065,
213954,
189378,
156612,
295873,
213963,
197580,
312272,
304084,
304090,
320481,
304106,
320490,
312302,
328687,
320496,
304114,
295928,
320505,
312321,
295945,
230413,
197645,
295949,
320528,
140312,
295961,
238620,
197663,
304164,
304170,
238641,
312374,
238652,
238655,
230465,
238658,
336964,
296004,
205895,
320584,
238666,
296021,
402518,
336987,
230497,
296036,
296040,
361576,
205931,
296044,
164973,
205934,
312432,
279669,
337018,
189562,
279679,
66690,
279683,
222340,
205968,
296084,
238745,
304285,
238756,
205991,
222377,
165035,
337067,
238766,
165038,
230576,
238770,
304311,
230592,
312518,
279750,
230600,
230607,
148690,
320727,
279769,
304348,
279777,
304354,
296163,
320740,
279781,
304360,
320748,
279788,
279790,
304370,
296189,
320771,
312585,
296202,
296205,
230674,
320786,
230677,
296213,
296215,
320792,
230681,
230679,
214294,
304416,
230689,
173350,
312622,
296243,
312630,
222522,
296253,
222525,
296255,
312639,
230718,
296259,
378181,
296262,
230727,
238919,
296264,
320840,
296267,
296271,
222545,
230739,
312663,
222556,
337244,
230752,
312676,
230760,
173418,
148843,
410987,
230763,
230768,
296305,
312692,
230773,
304505,
304506,
181626,
279929,
181631,
312711,
296331,
288140,
288144,
230800,
304533,
337306,
288154,
288160,
173472,
288162,
288164,
279975,
304555,
370092,
279983,
173488,
288176,
279985,
312755,
296373,
312759,
279991,
288185,
337335,
222652,
312766,
173507,
296389,
222665,
230860,
312783,
288208,
230865,
288210,
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,
214535,
230923,
304651,
304653,
370187,
402969,
230940,
222752,
108066,
296486,
296488,
157229,
239152,
230961,
157236,
288320,
288325,
124489,
280140,
280145,
288338,
280149,
288344,
280152,
239194,
280158,
403039,
370272,
181854,
239202,
370279,
312938,
280183,
280185,
280188,
280191,
116354,
280194,
280208,
280211,
288408,
280218,
280222,
419489,
190118,
321195,
296622,
321200,
337585,
296626,
296634,
296637,
419522,
280260,
419525,
206536,
280264,
206539,
206541,
206543,
263888,
313044,
280276,
321239,
280283,
313052,
288478,
313055,
419555,
321252,
313066,
288494,
280302,
280304,
313073,
321266,
419570,
288499,
288502,
280314,
288510,
124671,
67330,
280324,
198405,
288519,
280331,
198416,
280337,
296723,
116503,
321304,
329498,
296731,
321311,
313121,
313123,
304932,
321316,
280363,
141101,
165678,
280375,
321336,
296767,
288576,
345921,
337732,
280388,
304968,
280393,
280402,
173907,
313171,
313176,
42842,
280419,
321381,
296809,
296812,
313201,
1920,
255873,
305028,
280454,
247688,
280464,
124817,
280468,
239510,
280473,
124827,
214940,
247709,
214944,
280487,
313258,
321458,
296883,
124853,
214966,
296890,
10170,
288700,
296894,
190403,
296900,
280515,
337862,
165831,
280521,
231379,
296921,
354265,
354270,
239586,
313320,
354281,
231404,
124913,
165876,
321528,
239612,
313340,
288764,
239617,
313347,
288773,
313358,
305176,
313371,
354338,
305191,
223273,
313386,
354348,
124978,
215090,
124980,
288824,
288826,
321595,
378941,
313406,
288831,
288836,
67654,
280651,
354382,
288848,
280658,
215123,
354390,
288855,
288859,
280669,
313438,
149599,
280671,
149601,
321634,
149603,
223327,
329830,
280681,
313451,
223341,
280687,
149618,
215154,
313458,
280691,
313464,
329850,
321659,
280702,
288895,
321670,
215175,
141446,
141455,
275606,
141459,
280725,
313498,
100520,
288936,
280747,
288940,
288947,
280755,
321717,
280759,
280764,
280769,
280771,
280774,
280776,
313548,
321740,
280783,
280786,
280788,
313557,
280793,
280796,
280798,
338147,
280804,
280807,
157930,
280811,
280817,
125171,
280819,
157940,
182517,
280823,
280825,
280827,
280830,
280831,
280833,
125187,
280835,
125191,
125207,
125209,
321817,
125218,
321842,
223539,
125239,
305464,
280888,
280891,
289087,
108865,
280897,
280900,
305480,
239944,
280906,
239947,
305485,
305489,
379218,
280919,
248153,
215387,
354653,
313700,
280937,
313705,
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,
436684,
281045,
281047,
166378,
305647,
281075,
174580,
240124,
281084,
305662,
305664,
240129,
305666,
305668,
223749,
240132,
330244,
223752,
150025,
338440,
281095,
223757,
281102,
223763,
223765,
281113,
322074,
281116,
281121,
182819,
289317,
281127,
281135,
150066,
158262,
158266,
289342,
281154,
322115,
158283,
281163,
281179,
338528,
338532,
281190,
199273,
281196,
19053,
158317,
313973,
297594,
281210,
158347,
264845,
182926,
133776,
182929,
314003,
117398,
314007,
289436,
174754,
330404,
289448,
133801,
174764,
314029,
314033,
240309,
133817,
314045,
314047,
314051,
199364,
297671,
158409,
256716,
289493,
363234,
289513,
289522,
289525,
289532,
322303,
289537,
322310,
264969,
322314,
322318,
281361,
281372,
322341,
215850,
281388,
289593,
281401,
289601,
281410,
281413,
281414,
240458,
281420,
240468,
281430,
322393,
297818,
281435,
281438,
281442,
174955,
224110,
207733,
207737,
158596,
183172,
338823,
322440,
314249,
240519,
183184,
142226,
289687,
224151,
240535,
289694,
289696,
289700,
289712,
281529,
289724,
52163,
183260,
420829,
281567,
289762,
322534,
297961,
183277,
322550,
134142,
322563,
330764,
175134,
322599,
322610,
314421,
281654,
314427,
314433,
207937,
314441,
207949,
322642,
314456,
281691,
314461,
281702,
281704,
314474,
281708,
281711,
289912,
248995,
306341,
306344,
306347,
322734,
306354,
142531,
199877,
289991,
306377,
289997,
249045,
363742,
363745,
298216,
330988,
126190,
216303,
322801,
388350,
257302,
363802,
199976,
199978,
314671,
298292,
298294,
257334,
216376,
380226,
298306,
224584,
224587,
224594,
216404,
306517,
150870,
314714,
224603,
159068,
314718,
265568,
314723,
281960,
150890,
306539,
314732,
314736,
290161,
216436,
306549,
298358,
314743,
306552,
290171,
314747,
298365,
290174,
306555,
224641,
281987,
298372,
314756,
281990,
224647,
265604,
298377,
314763,
142733,
298381,
314768,
224657,
306581,
314773,
314779,
314785,
314793,
282025,
282027,
241068,
241070,
241072,
282034,
241077,
150966,
298424,
306618,
282044,
323015,
306635,
306640,
290263,
290270,
290275,
339431,
282089,
191985,
282098,
290291,
282101,
241142,
191992,
290298,
151036,
290302,
282111,
290305,
175621,
306694,
192008,
323084,
257550,
282127,
290321,
282130,
323090,
290325,
282133,
241175,
290328,
282137,
290332,
241181,
282142,
282144,
290344,
306731,
290349,
290351,
290356,
282186,
224849,
282195,
282199,
282201,
306778,
159324,
159330,
314979,
298598,
323176,
224875,
241260,
323181,
257658,
315016,
282249,
290445,
282255,
282261,
175770,
298651,
282269,
323229,
298655,
323231,
61092,
282277,
306856,
196133,
282295,
323260,
282300,
323266,
282310,
323273,
282319,
306897,
241362,
306904,
282328,
298714,
52959,
216801,
282337,
241380,
216806,
323304,
282345,
12011,
282356,
323318,
282364,
282367,
306945,
241412,
323333,
282376,
216842,
323345,
282388,
323349,
282392,
184090,
315167,
315169,
282402,
315174,
323367,
241448,
315176,
241450,
282410,
306988,
306991,
315184,
323376,
315190,
241464,
159545,
282425,
298811,
118593,
307009,
413506,
307012,
241475,
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,
44948,
298901,
241560,
282520,
241563,
241565,
241567,
241569,
282531,
241574,
282537,
298922,
36779,
241581,
282542,
241583,
323504,
241586,
290739,
241588,
282547,
241590,
241592,
241598,
290751,
241600,
241605,
151495,
241610,
298975,
241632,
298984,
241640,
241643,
298988,
241646,
241649,
241652,
323574,
290807,
299003,
241661,
299006,
282623,
315396,
241669,
315397,
282632,
282639,
290835,
282645,
241693,
282654,
102438,
217127,
282669,
323630,
282681,
290877,
282687,
159811,
315463,
315466,
192589,
307278,
192596,
176213,
307287,
307290,
217179,
315482,
192605,
315483,
233567,
299105,
200801,
217188,
299109,
307303,
315495,
356457,
45163,
307307,
315502,
192624,
307314,
323700,
299126,
233591,
299136,
307329,
307338,
233613,
241813,
307352,
299164,
241821,
299167,
315552,
184479,
184481,
315557,
184486,
307370,
307372,
184492,
307374,
307376,
299185,
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,
291089,
282906,
291104,
233766,
299304,
295583,
176435,
307508,
315701,
332086,
307510,
307512,
168245,
307515,
307518,
282942,
282947,
323917,
282957,
110926,
233808,
323921,
315733,
323926,
233815,
315739,
323932,
299357,
242018,
242024,
299373,
315757,
250231,
242043,
315771,
299388,
299391,
291202,
299398,
242057,
291212,
299405,
291222,
315801,
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,
291341,
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,
299655,
373383,
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,
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,
292433,
316233,
234313,
316235,
234316,
283468,
234319,
242511,
234321,
234324,
185173,
201557,
234329,
234333,
308063,
234336,
242530,
349027,
234338,
234341,
234344,
234347,
177004,
234350,
324464,
234353,
152435,
177011,
234356,
234358,
234362,
226171,
291711,
234368,
291714,
234370,
291716,
234373,
201603,
226182,
234375,
226185,
308105,
234379,
234384,
234388,
234390,
226200,
234393,
209818,
308123,
234396,
324504,
291742,
324508,
234398,
234401,
291747,
291748,
234405,
291750,
234407,
324520,
324518,
324522,
234410,
291756,
291754,
226220,
324527,
291760,
234417,
234414,
324531,
201650,
234422,
226230,
324536,
275384,
234428,
291773,
242623,
324544,
234431,
234434,
324546,
226239,
226245,
234437,
234439,
324548,
234443,
291788,
193486,
234446,
193488,
234449,
275406,
234452,
234455,
234459,
234461,
234464,
234467,
234470,
168935,
5096,
324585,
234475,
234478,
316400,
234481,
316403,
234484,
234485,
234487,
324599,
234490,
234493,
316416,
234496,
234501,
275462,
308231,
234504,
234507,
234510,
234515,
300054,
316439,
234520,
234519,
234523,
234526,
234528,
300066,
234532,
300069,
234535,
234537,
234540,
234543,
234546,
275508,
300085,
234549,
300088,
234553,
234556,
234558,
316479,
234561,
316483,
160835,
234563,
308291,
234568,
234570,
316491,
234572,
300108,
234574,
300115,
234580,
234581,
234585,
275545,
242777,
234590,
234593,
234595,
234597,
300133,
234601,
300139,
234605,
160879,
234607,
275569,
234610,
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,
177318,
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,
161003,
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,
226617,
243003,
283963,
226628,
300357,
283973,
177482,
283983,
316758,
357722,
316766,
292192,
316768,
218464,
292197,
316774,
243046,
218473,
136562,
324978,
333178,
275834,
275836,
275840,
316803,
316806,
226696,
316811,
226699,
316814,
226703,
300433,
234899,
300436,
226709,
357783,
316824,
316826,
300448,
144807,
144810,
144812,
284076,
144814,
227426,
144820,
374196,
284084,
292279,
284087,
144826,
144828,
144830,
144832,
144835,
144837,
38342,
144839,
144841,
144844,
144847,
144852,
144855,
103899,
300507,
333280,
226787,
218597,
292329,
300523,
259565,
300527,
308720,
259567,
292338,
226802,
316917,
292343,
308727,
300537,
316933,
316947,
308757,
308762,
284191,
316959,
284194,
284196,
235045,
284199,
284204,
284206,
284209,
284211,
194101,
284213,
316983,
194103,
284215,
308790,
284218,
226877,
284223,
284226,
284228,
292421,
243268,
284231,
226886,
128584,
284234,
276043,
317004,
366155,
284238,
226895,
284241,
194130,
284243,
300628,
284245,
276052,
284247,
276053,
235097,
243290,
284249,
284251,
317015,
300638,
284253,
284255,
243293,
284258,
292452,
292454,
284263,
177766,
284265,
292458,
284267,
292461,
284272,
284274,
284278,
292470,
276086,
292473,
284283,
276093,
284286,
292479,
276095,
292481,
284290,
325250,
284292,
292485,
276098,
284288,
284297,
317066,
284299,
317068,
284301,
276109,
284303,
284306,
276114,
284308,
284312,
284314,
284316,
276127,
284320,
284322,
284327,
284329,
317098,
284331,
276137,
284333,
284335,
276144,
284337,
284339,
300726,
284343,
284346,
284350,
358080,
276160,
284354,
358083,
284358,
276166,
358089,
284362,
276170,
284365,
276175,
284368,
276177,
284370,
358098,
284372,
317138,
284377,
284379,
284381,
284384,
358114,
284386,
358116,
276197,
317158,
358119,
284392,
325353,
358122,
284394,
284397,
358126,
284399,
358128,
276206,
358133,
358135,
276216,
358138,
300795,
358140,
284413,
358142,
358146,
317187,
284418,
317189,
317191,
284428,
300816,
300819,
317207,
300828,
300830,
276255,
300832,
325408,
300834,
317221,
227109,
358183,
186151,
276268,
300845,
243504,
300850,
284469,
276280,
325436,
358206,
276291,
366406,
276295,
300872,
292681,
153417,
358224,
284499,
276308,
284502,
317271,
178006,
276315,
292700,
317279,
284511,
227175,
292715,
300912,
292721,
284529,
300915,
284533,
292729,
317306,
284540,
292734,
325512,
169868,
317332,
358292,
399252,
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,
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,
227440,
350325,
252022,
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,
227571,
309491,
309494,
243960,
227583,
276735,
227587,
276739,
211204,
276742,
227596,
325910,
309530,
342298,
211232,
317729,
276775,
211241,
325937,
325943,
211260,
260421,
276809,
285002,
276811,
235853,
276816,
235858,
276829,
276833,
391523,
276836,
293227,
276843,
293232,
276848,
186744,
211324,
227709,
285061,
366983,
317833,
178572,
285070,
285077,
178583,
227738,
317853,
276896,
317858,
342434,
285093,
317864,
285098,
276907,
235955,
276917,
293304,
293307,
293314,
309707,
293325,
129486,
317910,
293336,
235996,
317917,
293343,
358880,
276961,
293346,
227810,
276964,
293352,
236013,
293364,
301562,
293370,
317951,
309764,
301575,
121352,
293387,
236043,
342541,
317963,
113167,
55822,
309779,
317971,
309781,
277011,
55837,
227877,
227879,
293417,
227882,
309804,
293421,
105007,
236082,
285236,
23094,
277054,
244288,
219714,
129603,
301636,
318020,
301639,
301643,
285265,
399955,
309844,
277080,
309849,
285277,
285282,
326244,
318055,
277100,
309871,
121458,
170618,
170619,
309885,
309888,
277122,
227975,
277128,
285320,
301706,
318092,
326285,
334476,
318094,
277136,
277139,
227992,
334488,
318108,
285340,
318110,
227998,
137889,
383658,
285357,
318128,
277170,
293555,
342707,
154292,
277173,
318132,
277177,
277181,
318144,
277187,
277191,
277194,
277196,
277201,
342745,
137946,
342747,
342749,
113378,
203491,
228069,
277223,
342760,
285417,
56041,
56043,
56045,
277232,
228081,
56059,
310015,
285441,
310020,
285448,
310029,
228113,
285459,
277273,
293659,
326430,
228128,
285474,
293666,
228135,
318248,
277291,
318253,
293677,
285489,
301876,
293685,
285494,
301880,
285499,
301884,
293696,
310080,
277317,
277322,
277329,
162643,
310100,
301911,
301913,
277337,
301921,
400236,
236397,
162671,
326514,
310134,
236408,
277368,
15224,
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,
277519,
293908,
302105,
293917,
293939,
318516,
277561,
277564,
310336,
7232,
293956,
277573,
228422,
293960,
310344,
277577,
277583,
203857,
293971,
310355,
310359,
236632,
277594,
138332,
277598,
203872,
277601,
285792,
310374,
203879,
310376,
228460,
318573,
203886,
187509,
285815,
367737,
285817,
302205,
285821,
392326,
285831,
253064,
294026,
302218,
285835,
162964,
384148,
187542,
302231,
285849,
302233,
285852,
302237,
285854,
285856,
302241,
285862,
277671,
302248,
64682,
277678,
294063,
294065,
302258,
277687,
294072,
318651,
294076,
277695,
318657,
244930,
302275,
130244,
302277,
228550,
302282,
310476,
302285,
302288,
310481,
302290,
203987,
302292,
302294,
310486,
302296,
384222,
310498,
285927,
318698,
302315,
228592,
294132,
138485,
228601,
204026,
228606,
204031,
64768,
310531,
138505,
228617,
318742,
204067,
277798,
130345,
277801,
113964,
285997,
384302,
285999,
277804,
113969,
277807,
277811,
318773,
318776,
277816,
286010,
277819,
294204,
417086,
277822,
286016,
302403,
294211,
384328,
277832,
277836,
294221,
146765,
294223,
326991,
277839,
277842,
277847,
277850,
179547,
277853,
146784,
277857,
302436,
277860,
294246,
327015,
310632,
327017,
351594,
277864,
277869,
277872,
351607,
310648,
277880,
310651,
277884,
277888,
310657,
351619,
294276,
310659,
327046,
277892,
253320,
310665,
318858,
277894,
277898,
277903,
310672,
351633,
277905,
277908,
277917,
310689,
277921,
130468,
228776,
277928,
277932,
310703,
277937,
310710,
130486,
310712,
277944,
310715,
277947,
302526,
228799,
277950,
277953,
302534,
310727,
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,
302617,
286233,
302621,
286240,
187936,
146977,
187939,
40484,
294435,
40486,
286246,
294440,
40488,
294439,
294443,
40491,
294445,
245288,
310831,
286248,
40499,
40502,
212538,
40507,
40511,
40513,
228933,
40521,
286283,
40525,
40527,
212560,
400976,
228944,
40533,
147032,
40537,
40539,
40541,
278109,
40544,
40548,
40550,
40552,
286312,
40554,
286313,
310892,
40557,
40560,
188022,
122488,
294521,
343679,
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,
286420,
278227,
229076,
286425,
319194,
278235,
301163,
229086,
278238,
286432,
294625,
294634,
302838,
319226,
286460,
278274,
302852,
278277,
302854,
294664,
311048,
352008,
319243,
311053,
302862,
319251,
294682,
278306,
188199,
294701,
319280,
278320,
319290,
229192,
302925,
188247,
237409,
229233,
294776,
360317,
294785,
327554,
360322,
40840,
294803,
40851,
188312,
294811,
237470,
319390,
40865,
319394,
294817,
294821,
311209,
180142,
343983,
294831,
188340,
40886,
319419,
294844,
294847,
393177,
294876,
294879,
294883,
393190,
294890,
311279,
278513,
237555,
311283,
278516,
278519,
237562
] |
ad0faf9f8d72387e7cae19cd3d5f4383927b4630 | 08f9c6ae0e5db3672add9414b867b7366f13a166 | /Flash Chat/LogInViewController.swift | 8572daf841a8d0cfa3ad782d6fb943c9e0563448 | [] | no_license | adityaOC/ChatApp_iOS | 8d32847456f530d8ed450c8e25e6f1e564e30767 | de6849a603eb5ba02047e7c017e811679546724a | refs/heads/master | 2021-04-28T16:00:29.102808 | 2018-03-04T03:47:21 | 2018-03-04T03:47:21 | 122,002,922 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 999 | swift | //
// LogInViewController.swift
// Flash Chat
//
// This is the view controller where users login
import UIKit
import Firebase
class LogInViewController: UIViewController {
//Textfields pre-linked with IBOutlets
@IBOutlet var emailTextfield: UITextField!
@IBOutlet var passwordTextfield: UITextField!
override func viewDidLoad() {
super.viewDidLoad()
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
}
@IBAction func logInPressed(_ sender: AnyObject) {
//TODO: Log in the user
Auth.auth().signIn(withEmail: emailTextfield.text!, password: passwordTextfield.text!) { (user, error) in
if error != nil{
print(error!)
}
else{
print("Log in succesfull")
self.performSegue(withIdentifier: "goToChat", sender: self)
}
}
}
}
| [
300825,
323359
] |
9a7b3ba0dd0e0356dcbf91895e2d720f990e5c51 | 20160802da7c16718881b16ec858f5ed8ed3e351 | /old/Plock/AppStart/AppComponent.swift | 30dd8643dcf5205a1152735320860850ea42bce2 | [] | no_license | Nexters/Plock-iOS | 13983987da172ef2ce332d74e97b861ba23fef89 | efe92a7f0e1afb0a32ab4906978a08e0ed0ba888 | refs/heads/master | 2020-06-19T10:53:28.350309 | 2019-11-02T07:25:57 | 2019-11-02T07:25:57 | 196,682,567 | 4 | 1 | null | 2019-08-07T14:58:10 | 2019-07-13T05:32:33 | Swift | UTF-8 | Swift | false | false | 310 | swift | //
// AppComponent.swift
// Plock
//
// Created by Haehyeon Jeong on 2019/07/29.
// Copyright © 2019 Zedd. All rights reserved.
//
import Foundation
import RIBs
final class AppComponent: Component<EmptyDependency>, RootDependency {
init() {
super.init(dependency: EmptyComponent())
}
}
| [
-1
] |
52ad830cd8c865d139a636dc514705116941cf9e | f813b6272ee92888ac04dec194d8eee3f599f1cc | /SpiewnikWedrowca/SongView/SongViewModel.swift | b1f08f598b69785d4c14b21dee69de76a3bb29b7 | [] | no_license | timothyjoel/SpiewnikWedrowca | 87a51d7f3b1f903b545dd637c1fdae358ffa1b3d | e0318b24f0f1732779dee93154150bcba650c84a | refs/heads/master | 2023-08-15T02:54:21.162142 | 2021-09-19T08:51:05 | 2021-09-19T08:51:05 | 261,704,785 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,082 | swift | //
// SongViewModel.swift
// SpiewnikWedrowca
//
// Created by Timothy Stokarski on 06/05/2020.
// Copyright © 2020 Timothy Stokarski. All rights reserved.
//
import Foundation
struct SongPart: Hashable {
var title: String
var text: String
}
class SongViewModel: ObservableObject {
var song: Song
init(_ song: Song) {
self.song = song
}
var songParts: [SongPart] {
var parts = [SongPart]()
let array = formattedSongLyrics().components(separatedBy: "\n\n")
var songPart = 0
for _ in 0..<array.count - 1 {
if songPart < array.count {
parts.append(SongPart(title: array[songPart], text: array[songPart+1]))
songPart += 2
}
}
return parts
}
private func formattedSongLyrics() -> String {
var lyrics = song.lyrics
lyrics = lyrics.replacingOccurrences(of: "\n ", with: "\n")
return lyrics
}
var title: String {
return String(song.number) + ". \(song.title)"
}
}
| [
-1
] |
26a48b5b0abb1ad90b0fea810772a9ca14dc31d9 | ff5af9078b5716215ed6ae247c57e3e9f0a139c3 | /FoodVision/Views/MarkerNode.swift | 27ec5e120b0cf9a92f2a8b372d2fabbb7a739710 | [] | no_license | geoffrys/food-vision | e4fe54886090919425dba5ac4937214126137c46 | b11dd2ba44900f43cbcc4f920281630d8bb67614 | refs/heads/master | 2020-04-10T03:38:04.832871 | 2018-12-07T05:37:09 | 2018-12-07T05:37:09 | 160,775,937 | 11 | 1 | null | null | null | null | UTF-8 | Swift | false | false | 19,766 | swift | import SpriteKit
import ARKit
enum TouchState {
case touchIn
case touchOut
}
enum HeightState {
case tall
case short
}
enum DetailState {
case expanded
case collapsed
}
/// Parent node for markers which handles touch events.
class Markers: SKShapeNode {
private static let maxDistance: CGFloat = 50
private var touchedNode: Marker?
private var expandedNode: Marker?
init(frame: CGRect) {
super.init()
// Expand our touch receiving area to cover view
self.path = CGPath.init(rect: frame, transform: nil)
self.strokeColor = .clear
isUserInteractionEnabled = true
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func addChild(_ node: SKNode) {
super.addChild(node)
guard let marker = node as? Marker else { return }
// If another node is showing details, we need to start minimized
if expandedNode != nil {
marker.update(to: .short, animate: false)
marker.update(to: .collapsed, animate: false)
}
}
override func removeChildren(in nodes: [SKNode]) {
super.removeChildren(in: nodes)
for node in nodes {
guard let marker = node as? Marker else { return }
if marker == touchedNode {
touchedNode = nil
}
if marker == expandedNode {
expandedNode = nil
}
}
}
override func removeAllChildren() {
super.removeAllChildren()
touchedNode = nil
expandedNode = nil
}
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
guard let touch = touches.first else { return }
touching(touch)
}
override func touchesMoved(_ touches: Set<UITouch>, with event: UIEvent?) {
guard let touch = touches.first else { return }
touching(touch)
}
override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) {
guard let touch = touches.first else { return }
let point = touch.location(in: self)
touchedNode?.update(to: .touchOut)
touchedNode = nil
if let marker = closestMarker(to: point) {
// Touch up inside a node
expand(marker)
return
}
// Touch up outside
expand(nil)
}
/// Visualizes when a touch hits a node.
private func touching(_ touch: UITouch) {
let point = touch.location(in: self)
// Touching a node at all
if let marker = closestMarker(to: point) {
// Already animating this node
if marker == touchedNode {
return
}
// Start animating this node
touchedNode?.update(to: .touchOut)
marker.update(to: .touchIn)
touchedNode = marker
} else {
// Touching nothing
touchedNode?.update(to: .touchOut)
touchedNode = nil
}
}
/// Expands a node to show its details, emphasizing the node by minimizing others.
private func expand(_ marker: Marker?) {
let markers = (children as? [Marker]) ?? []
guard let target = marker, target != expandedNode else {
// Not highlighting any particular pin
expandedNode = nil
for child in markers {
child.update(to: .tall)
child.update(to: .collapsed)
}
return
}
// Highlight a single pin
expandedNode = target
for child in markers.filter({ $0 != target }) {
child.update(to: .short)
child.update(to: .collapsed)
}
target.update(to: .tall)
target.update(to: .expanded)
}
/// Returns the closest marker, measured from center, with a max distance
/// (Markers.maxDistance).
private func closestMarker(`to` point: CGPoint) -> Marker? {
var bestDistance: CGFloat?
var bestMarker: Marker?
for child in (children as? [Marker]) ?? [] {
// The origins are center points in parent's coord
let circleCenter = child.topGroup.frame.origin
let distance = point.distance(to: circleCenter)
guard distance < Markers.maxDistance else { continue }
guard let lastDistance = bestDistance else {
bestDistance = distance
bestMarker = child
continue
}
if distance < lastDistance {
bestDistance = distance
bestMarker = child
}
}
return bestMarker
}
}
/// Marks where in a scene food clusters were detected.
///
/// Can expand to show mass and calories in addition to the always visible count.
class Marker: SKNode {
static private let duration: Double = 0.200
static private let diameter: CGFloat = 30
static private let expandedWidth: CGFloat = 118
static private let expandedRadius: CGFloat = 3
static private let padding: CGFloat = 6
static private let hoverUp: Float = 0.025
static private let shadowColor = UIColor.black.withAlphaComponent(0.50)
static private let shadowBlur: CGFloat = 13
static private let lineColor = UIColor.white.withAlphaComponent(0.70)
static private let fontSize: CGFloat = 12
static private let countColor = UIColor.white
static private let detailColor = UIColor.black.withAlphaComponent(0.54)
static private let font = UIFont.systemFont(ofSize: Marker.fontSize,
weight: UIFont.Weight.medium)
let foodEstimate: FoodEstimate
let anchor: ARAnchor
let line: SKShapeNode
var background: SKShapeNode
var shadow: SKShapeNode
var foodIcon: SKSpriteNode
var massLabel: SKLabelNode
var calorieLabel: SKLabelNode
let topGroup: SKNode
var touchState = TouchState.touchOut
var heightState = HeightState.tall
var lineFactor: Float = 1.0
var detailState = DetailState.collapsed
var expandedFactor: Float = 0.0
init(for foodEstimate: FoodEstimate, anchor: ARAnchor) {
self.foodEstimate = foodEstimate
self.anchor = anchor
self.line = SKShapeNode(rect: CGRect(origin: CGPoint.zero, size: CGSize.zero))
let size = CGSize(width: Marker.diameter / 2, height: Marker.diameter / 2)
let origin = CGPoint(x: -size.width / 2, y: -size.height / 2)
self.shadow = SKShapeNode(rect: CGRect(origin: origin, size: size))
self.background = SKShapeNode(rect: CGRect(origin: origin, size: size))
self.foodIcon = SKSpriteNode(texture: nil)
self.massLabel = SKLabelNode(fontNamed: Marker.font.fontName)
self.calorieLabel = SKLabelNode(fontNamed: Marker.font.fontName)
self.topGroup = SKNode()
super.init()
makeLine()
self.addChild(line)
makeTopGroup()
makeDetail()
topGroup.zPosition = 1
self.addChild(topGroup)
self.alpha = 0
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
private func makeLine() {
line.fillColor = Marker.lineColor
line.strokeColor = .clear
line.zPosition = 0
}
private func makeTopGroup() {
let shadowEffect = SKEffectNode()
shadow.position.y -= Marker.shadowBlur / 2.3
shadow.fillColor = Marker.shadowColor
shadow.strokeColor = .clear
shadow.zPosition = 1
shadowEffect.filter = CIFilter(name: "CIGaussianBlur",
parameters: ["inputRadius": Marker.shadowBlur])
shadowEffect.addChild(shadow)
topGroup.addChild(shadowEffect)
background.fillColor = .white
background.strokeColor = .clear
background.zPosition = 2
topGroup.addChild(background)
let filename = "\(foodEstimate.observation.food.rawValue)_number"
foodIcon.texture = SKTexture(imageNamed: filename)
foodIcon.size = CGSize(width: Marker.diameter - Marker.padding,
height: Marker.diameter - Marker.padding)
foodIcon.zPosition = 3
let countLabel = SKLabelNode(fontNamed: Marker.font.fontName)
countLabel.fontColor = Marker.countColor
countLabel.fontSize = Marker.fontSize
if let count = foodEstimate.count() {
countLabel.text = "\(count)"
}
countLabel.horizontalAlignmentMode = .center
countLabel.verticalAlignmentMode = .center
countLabel.zPosition = 4
foodIcon.addChild(countLabel)
topGroup.addChild(foodIcon)
}
private func makeDetail() {
massLabel.fontColor = Marker.detailColor
massLabel.fontSize = Marker.fontSize
if let mass = foodEstimate.mass() {
massLabel.text = "\(Int(mass))g"
}
massLabel.horizontalAlignmentMode = .center
massLabel.verticalAlignmentMode = .center
massLabel.zPosition = 4
massLabel.alpha = 0
topGroup.addChild(massLabel)
calorieLabel.fontColor = Marker.detailColor
calorieLabel.fontSize = Marker.fontSize
if let calories = foodEstimate.calories() {
calorieLabel.text = "\(Int(calories))cal"
}
calorieLabel.horizontalAlignmentMode = .center
calorieLabel.verticalAlignmentMode = .center
calorieLabel.zPosition = 4
calorieLabel.alpha = 0
topGroup.addChild(calorieLabel)
}
// MARK: - Stateful updates
private let touchKey = "touch"
private let heightKey = "height"
private let detailKey = "detail"
/// Animates in response to user touch.
func update(to state: TouchState) {
DispatchQueue.main.async {
guard self.touchState != state else { return }
self.topGroup.removeAction(forKey: self.touchKey)
let growth: CGFloat = (self.detailState == .expanded) ? 1.2 : 1.4
switch state {
case .touchIn:
let grow = SKAction.scale(to: growth, duration: Marker.duration)
grow.timingMode = .easeIn
self.topGroup.run(grow, withKey: self.touchKey)
case .touchOut:
let shrink = SKAction.scale(to: 1, duration: Marker.duration)
shrink.timingMode = .easeOut
self.topGroup.run(shrink, withKey: self.touchKey)
}
self.touchState = state
}
}
/// Raises or lowers the pin to emphasize one when expanded.
func update(to state: HeightState, animate: Bool = true) {
DispatchQueue.main.async {
guard self.heightState != state else { return }
self.removeAction(forKey: self.heightKey)
let setter: (SKNode, Float) -> () = { node, value in
(node as? Marker)?.lineFactor = value
}
switch state {
case .tall:
if animate {
let maximizePin = SKAction.transition(to: 1,
from: self.lineFactor,
duration: Marker.duration,
setter: setter)
maximizePin.timingMode = .easeIn
self.run(maximizePin, withKey: self.heightKey)
} else {
self.lineFactor = 1
}
case .short:
if animate {
let minimizePin = SKAction.transition(to: 0,
from: self.lineFactor,
duration: Marker.duration,
setter: setter)
minimizePin.timingMode = .easeOut
self.run(minimizePin, withKey: self.heightKey)
} else {
self.lineFactor = 0
}
}
self.heightState = state
}
}
/// Shows either just the count or the count, mass, and calories.
func update(to state: DetailState, animate: Bool = true) {
DispatchQueue.main.async {
guard self.detailState != state else { return }
self.removeAction(forKey: self.detailKey)
let setter: (SKNode, Float) -> () = { node, value in
(node as? Marker)?.expandedFactor = value
}
switch state {
case .expanded:
if animate {
let expand = SKAction.transition(to: 1,
from: self.expandedFactor,
duration: Marker.duration,
setter: setter)
expand.timingMode = .easeIn
self.run(expand, withKey: self.detailKey)
} else {
self.expandedFactor = 1
}
case .collapsed:
if animate {
let collapse = SKAction.transition(to: 0,
from: self.expandedFactor,
duration: Marker.duration,
setter: setter)
collapse.timingMode = .easeOut
self.run(collapse, withKey: self.detailKey)
} else {
self.expandedFactor = 0
}
}
self.detailState = state
}
}
/// Draws pin line: a 2D projection of a line between two 3D points.
///
/// The bottom point is the center of the object while the top is a fixed
/// (Marker.hoverUp) world sapce height above it.
func update(with frame: ARFrame, viewFrame: CGRect) {
let worldBottom = anchor.transform.position()
let sceneBottom = scenePoint(at: worldBottom, frame: frame, viewSize: viewFrame.size)
let offset = lineFactor * Marker.hoverUp
let worldTop = float3(x: worldBottom.x, y: worldBottom.y + offset, z: worldBottom.z)
let sceneTop = scenePoint(at: worldTop, frame: frame, viewSize: viewFrame.size)
DispatchQueue.main.async {
self.updateLine(sceneBottom: sceneBottom, sceneTop: sceneTop, viewFrame: viewFrame)
self.updateTop(sceneTop: sceneTop)
self.alpha = 1
}
}
/// - Parameter sceneBottom: The scene-space bottom of the line
/// - Parameter sceneTop: The scene-space top of the line
private func updateLine(sceneBottom: CGPoint, sceneTop: CGPoint, viewFrame: CGRect) {
// Hide line for equal top and bottom points
self.line.alpha = 0
if sceneBottom != sceneTop {
// Get unit vector perpendicular in screen space to vector bottom->top
let vector = sceneBottom - sceneTop
let perpendicular = randomPerpendicular(to: vector)
let perpendicularUnit = perpendicular.normed()
// The line is 2 units wide
let points: [CGPoint] = [sceneBottom - perpendicularUnit,
sceneTop - perpendicularUnit,
sceneTop + perpendicularUnit,
sceneBottom + perpendicularUnit]
// Check that bottom and top of the pin are visible.
// Projecting off screen points to screen space can result in coordinates
// that cross the screen when drawing a line between them, which no longer
// allows us to rely on SpriteKit visibility culling.
if points.allSatisfy({ $0.visible(in: viewFrame) }) {
let path = CGMutablePath()
path.addLines(between: points)
path.closeSubpath()
self.line.path = path
self.line.alpha = 1
}
}
}
/// - Parameter sceneTop: The scene-space top of the line where content is placed
private func updateTop(sceneTop: CGPoint) {
// Calculate top background and shadow shape
let width = CGFloat(expandedFactor).lerp(Marker.diameter, Marker.expandedWidth)
let radius = CGFloat(1 - expandedFactor).lerp(Marker.expandedRadius, Marker.diameter / 2)
let size = CGSize(width: width, height: Marker.diameter)
let origin = CGPoint(x: -size.width / 2, y: -size.height / 2)
background.path = SKShapeNode.init(rect: CGRect(origin: origin, size: size),
cornerRadius: radius).path
shadow.path = background.path
// Update contents with equal spacing
let iconPadding: CGFloat = 5
let spacing = width - Marker.diameter + iconPadding - massLabel.frame.width - calorieLabel.frame.width
let leftEdge = -(width / 2)
let foodX = leftEdge + (Marker.diameter / 2)
let visualFoodX = foodX + (Marker.diameter / 2) - iconPadding
let massX = visualFoodX + (spacing / 3) + (massLabel.frame.width / 2)
let calorieX = massX + (massLabel.frame.width / 2) + (spacing / 3) + (calorieLabel.frame.width / 2)
foodIcon.position = CGPoint(x: foodX, y: 0)
massLabel.position = CGPoint(x: massX, y: 0)
calorieLabel.position = CGPoint(x: calorieX, y: 0)
// Stagger the alpha transitions of mass and calories
let massStart: Float = 0.5
let massFactor = (expandedFactor < massStart) ? 0 : (expandedFactor - massStart) / (1 - massStart)
massLabel.alpha = CGFloat(massFactor)
let calorieStart: Float = 0.75
let calorieFactor = (expandedFactor < calorieStart) ? 0 : (expandedFactor - calorieStart) / (1 - calorieStart)
calorieLabel.alpha = CGFloat(calorieFactor)
// Position top group in space
topGroup.position = sceneTop
switch detailState {
case .expanded: topGroup.zPosition = 100
case .collapsed: topGroup.zPosition = 1
}
}
// MARK: - Helpers
private func scenePoint(at worldPosition: float3, frame: ARFrame, viewSize: CGSize) -> CGPoint {
let viewPoint = frame.camera.projectPoint(worldPosition,
orientation: .portrait,
viewportSize: viewSize)
return CGPoint(x: viewPoint.x, y: viewSize.height - viewPoint.y)
}
/// Returns a random perpendicular line.
private func randomPerpendicular(to vector: CGPoint) -> CGPoint {
// The dot product of two lines is equal to 0 when perpendicular
// For original vector A: (xa, ya), and new perpendicular vector: B: (xb, yb)
// The perpendicular plane is defined as 0 = xa*xb + ya*yb
// If we pick a non-zero xb, we can solve for a random vector on the plane
let randomX: CGFloat = 2
let solvedY = (randomX * vector.x) / vector.y
return CGPoint(x: randomX, y: solvedY)
}
}
| [
-1
] |
bb948d6e1bd866d67b3ecbb3db37a6a09c169dd2 | 43e2923de34a9e2ba834029e78947f86ef3c87c1 | /KataSuperHeroes/AppDelegate.swift | 54a923cde31e5121c206a832b8237e456469f4ea | [
"Apache-2.0"
] | permissive | Karumi/KataSuperHeroesIOS | c8484b78f2cbfb7407854ecc5cc8791a99a541e7 | b8572ee5d6a09fe3313cffb92c89e55d8d15aedc | refs/heads/master | 2021-12-23T02:30:50.997177 | 2021-09-13T05:29:47 | 2021-09-13T05:29:47 | 49,489,836 | 81 | 85 | Apache-2.0 | 2021-09-13T05:29:48 | 2016-01-12T09:38:01 | Swift | UTF-8 | Swift | false | false | 1,313 | swift | import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
window = UIWindow(frame: UIScreen.main.bounds)
installRootViewControllerIntoWindow(window)
configureWindow()
configureNavigationBarStyle()
window?.makeKeyAndVisible()
return true
}
private func installRootViewControllerIntoWindow(_ window: UIWindow?) {
let viewController = ServiceLocator().provideRootViewController()
window?.rootViewController = viewController
}
private func configureWindow() {
window?.backgroundColor = UIColor.windowBackgroundColor
}
private func configureNavigationBarStyle() {
let navigationBarAppearance = UINavigationBar.appearance()
navigationBarAppearance.barTintColor = UIColor.navigationBarColor
navigationBarAppearance.tintColor = UIColor.navigationBarTitleColor
navigationBarAppearance.isTranslucent = false
navigationBarAppearance.titleTextAttributes = [
NSAttributedString.Key.foregroundColor: UIColor.navigationBarTitleColor
]
}
}
| [
-1
] |
d7817a549ff0ba182cd7bec1acf893f2af0c7dac | ce3763d16631113c291564e007f3b3ef6e9523cd | /Tamazuj/Controller/Account/Advisor/AdvisorSginUpViewController.swift | c4152f9c7179b664aea31cb6054175d070f6129f | [] | no_license | zef0599/Tamazuj- | 9643a0737db3fc1fa8a58418e51c5ad196e4e961 | 4a6fb1f4c9508f474ccee43f40faf38349b540dc | refs/heads/master | 2021-01-04T21:45:48.065292 | 2020-02-21T21:38:42 | 2020-02-21T21:38:42 | 240,770,694 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 3,468 | swift | //
// AdvisorSginUpViewController.swift
// Tamazuj
//
// Created by osama abu dahi on 02/10/2019.
// Copyright © 2019 Tamazuj. All rights reserved.
//
import UIKit
class AdvisorSginUpViewController: UIViewController {
@IBOutlet weak var textName: UITextField!
@IBOutlet weak var textEmail: UITextField!
@IBOutlet weak var passText: UITextField!
@IBOutlet weak var passTextagin: UITextField!
@IBOutlet weak var textNumber: UITextField!
@IBOutlet weak var signUpButton: UIButton!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
signUpButton.layer.cornerRadius = 15
}
/*
// 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.
}
*/
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
signUpButton.setGradientBackground(colorOne: #colorLiteral(red: 0.3333333333, green: 0.768627451, blue: 0.8117647059, alpha: 1), colorTwo: #colorLiteral(red: 0.3333333333, green: 0.6392156863, blue: 0.8117647059, alpha: 1))
signUpButton.layer.cornerRadius = 15
}
@IBAction func submit(_ sender: Any) {
}
@IBAction func Register(_ sender: Any) {
guard let name = textName.text ,
let email = textEmail.text ,
let passwored = passText.text,
let phone = textNumber .text ,
let pssagine = passTextagin.text
else {
return
}
showIndeterminateHUD()
ConsultantAth.Register(name: name, email: email, phone: phone, password: passwored) { (Ath, error) in
let massege = Ath?.message
let code = Ath?.code
self.hideHUD(animated: true)
print("\(massege ?? "error massege")")
// print("\(code ?? 0000)")
if Ath?.status ?? 0 == 0 {
self.showHUD(title: "", details: massege! ?? "يرجى التاكد من البيانات ", hideAfter: 3)
}
else
{
let alert = UIAlertController(title: massege ?? "" , message: " \(code ?? 0000) \n يرجى حفظ الكود لكتابته الان ", preferredStyle: .alert)
alert.addAction(UIAlertAction(title: "موافق", style: .cancel, handler: { (UIAlertAction) in
let stprybord = UIStoryboard(name: "AdvisorAccount", bundle: nil)
let vc = stprybord.instantiateViewController(withIdentifier: "ActivatCode") as! ActivatCodeViewController
vc.phoneNumber = phone
self.present(vc, animated: true, completion: nil)
}))
if passwored == pssagine {
self.present(alert, animated: true, completion: nil)
}
else
{
self.showHUD(title: "", details: "الرجاء التاكد من تطابق كلمة المرور ", hideAfter: 3)
}
}
}
}
}
| [
-1
] |
987de2a1de43069990e0fc2fdb6840290a4db854 | 5066757a1d856f121b7c18f121ae33b0f9b544ec | /PercolationUITests/PercolationUITests.swift | 7342923ea21c0af2178c7487e96e798dcbcc310e | [] | no_license | mansonjones/Percolation | 3f69ea4bf102c0e97c7644177aada98e8de223f7 | 14a363cc373bf21f69dbd4bba2d25ccf40396524 | refs/heads/main | 2023-01-04T16:16:01.068269 | 2020-10-25T22:09:57 | 2020-10-25T22:09:57 | 306,528,958 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,426 | swift | //
// PercolationUITests.swift
// PercolationUITests
//
// Created by Manson Jones on 10/22/20.
//
import XCTest
class PercolationUITests: XCTestCase {
override func setUpWithError() throws {
// Put setup code here. This method is called before the invocation of each test method in the class.
// In UI tests it is usually best to stop immediately when a failure occurs.
continueAfterFailure = false
// In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
}
override func tearDownWithError() throws {
// Put teardown code here. This method is called after the invocation of each test method in the class.
}
func testExample() throws {
// UI tests must launch the application that they test.
let app = XCUIApplication()
app.launch()
// Use recording to get started writing UI tests.
// Use XCTAssert and related functions to verify your tests produce the correct results.
}
func testLaunchPerformance() throws {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, *) {
// This measures how long it takes to launch your application.
measure(metrics: [XCTApplicationLaunchMetric()]) {
XCUIApplication().launch()
}
}
}
}
| [
360463,
376853,
344106,
253996,
163894,
385078,
352314,
376892,
32829,
352324,
352327,
385095,
163916,
368717,
254039,
426074,
368732,
180317,
32871,
352359,
221292,
385135,
376945,
385147,
426124,
196758,
49308,
65698,
49317,
377008,
377010,
377025,
377033,
164043,
417996,
254157,
368849,
368850,
139478,
385240,
254171,
147679,
147680,
205034,
254189,
254193,
344312,
336121,
262403,
147716,
385291,
368908,
180494,
262419,
254228,
368915,
377116,
254250,
131374,
418095,
336177,
368949,
180534,
155968,
270663,
368969,
254285,
180559,
377168,
344402,
368982,
270703,
385407,
385409,
106893,
270733,
385423,
385433,
213402,
385437,
254373,
385448,
385449,
115116,
385463,
336319,
336323,
188870,
262619,
377309,
377310,
369121,
369124,
270823,
213486,
360945,
139766,
393719,
377337,
254459,
410108,
410109,
262657,
377346,
410126,
393745,
385554,
262673,
254487,
410138,
188957,
377374,
385569,
385578,
377388,
197166,
393775,
418352,
33339,
352831,
33344,
385603,
385612,
426575,
385620,
369236,
270938,
352885,
352886,
344697,
369285,
385669,
344714,
377487,
426646,
180886,
352921,
377499,
344737,
352938,
418479,
164532,
336565,
377531,
377534,
377536,
385737,
385745,
369365,
369366,
385751,
361178,
352989,
352990,
418529,
295649,
385763,
369383,
361194,
418550,
344829,
197377,
434956,
418579,
426772,
197398,
426777,
344864,
197412,
336678,
189229,
197424,
197428,
336693,
377656,
426809,
197433,
377669,
197451,
369488,
385878,
385880,
197467,
435038,
385895,
197479,
385901,
197489,
164730,
254851,
369541,
172936,
426894,
377754,
140203,
172971,
377778,
189362,
189365,
377789,
345034,
418774,
386007,
418781,
386016,
123880,
418793,
435185,
222193,
271351,
435195,
328701,
386049,
328705,
418819,
410629,
377863,
189448,
361487,
435216,
386068,
254997,
336928,
336930,
410665,
345137,
361522,
386108,
410687,
377927,
361547,
156763,
361570,
214116,
214119,
402538,
173168,
377974,
66684,
377986,
402568,
140426,
386191,
410772,
222364,
418975,
124073,
402618,
402632,
402641,
419028,
222441,
386288,
66802,
271607,
386296,
369913,
419066,
369912,
386300,
386304,
369929,
419097,
115997,
222496,
369964,
353581,
116014,
66863,
345397,
345398,
386363,
345418,
337226,
337228,
353611,
353612,
378186,
353617,
378201,
337280,
353672,
263561,
370066,
9618,
411028,
370072,
148900,
361928,
337359,
329168,
329170,
353751,
361958,
271850,
271853,
329198,
411119,
116209,
386551,
271880,
198155,
329231,
370200,
157219,
157220,
394793,
353875,
271980,
206447,
403057,
42616,
337533,
370307,
419462,
149127,
149128,
419464,
214667,
411275,
345753,
255651,
337590,
370359,
403149,
345813,
370390,
272087,
345817,
337638,
181992,
345832,
345835,
141037,
173828,
395018,
395019,
395026,
435993,
345882,
411417,
255781,
362281,
378666,
403248,
378673,
345910,
182070,
182071,
436029,
337734,
272207,
272208,
337746,
395092,
345942,
362326,
345950,
370526,
362336,
255844,
214894,
362351,
214896,
182145,
337816,
329627,
354210,
436130,
436135,
10153,
362411,
370604,
362418,
411587,
362442,
346066,
354268,
436189,
403421,
329696,
354273,
403425,
354279,
436199,
174058,
354283,
247787,
329707,
337899,
436209,
346117,
182277,
354311,
403463,
354312,
43016,
354310,
436235,
419857,
436248,
346153,
272432,
403507,
378933,
378934,
436283,
403524,
436293,
436304,
329812,
411738,
272477,
395373,
346237,
436372,
362658,
436388,
133313,
395458,
338118,
436429,
346319,
379102,
387299,
18661,
379110,
149743,
379120,
436466,
411892,
395511,
436471,
436480,
272644,
338187,
338188,
395536,
338196,
272661,
379157,
157973,
338217,
362809,
379193,
395591,
272730,
436570,
215395,
362864,
272755,
354678,
436609,
395653,
436613,
395660,
264591,
272784,
420241,
436644,
272815,
436659,
338359,
436677,
256476,
420326,
166403,
420374,
330291,
191065,
436831,
420461,
346739,
346741,
420473,
166533,
346771,
363155,
264855,
363161,
436897,
355006,
363228,
436957,
436960,
264929,
338658,
346859,
330476,
35584,
133889,
346889,
207639,
363295,
355117,
191285,
355129,
273209,
273211,
355136,
355138,
420680,
355147,
355148,
355153,
387927,
363353,
363354,
420702,
363361,
363362,
412516,
355173,
355174,
207724,
355182,
207728,
420722,
330627,
265094,
387977,
396171,
355216,
224146,
224149,
256918,
256919,
256920,
256934,
273336,
273341,
330688,
379845,
363462,
273353,
207839,
347104,
134124,
412653,
257007,
248815,
347122,
437245,
257023,
125953,
396292,
330759,
347150,
330766,
412692,
330789,
248871,
412725,
257093,
404550,
339031,
257126,
404582,
265318,
396395,
265323,
404589,
273523,
363643,
248960,
363658,
404622,
224400,
347286,
265366,
429209,
339101,
429216,
265381,
380069,
421050,
339131,
265410,
183492,
273616,
339167,
421102,
363769,
52473,
52476,
412926,
437504,
388369,
380178,
429332,
412963,
257323,
273713,
208179,
159033,
347451,
257353,
257354,
109899,
437585,
331091,
150868,
372064,
429410,
437602,
388458,
265579,
421240,
388488,
396697,
396709,
380335,
355761,
421302,
134586,
380348,
380350,
216511,
216510,
200136,
273865,
339403,
372172,
413138,
437726,
429540,
3557,
3559,
265720,
216575,
372226,
437766,
208397,
413202,
388630,
413206,
175640,
216610,
372261,
347693,
323120,
396850,
200245,
323126,
134715,
421437,
396865,
413255,
265800,
273992,
421452,
265809,
396885,
265816,
396889,
388699,
396896,
388712,
388713,
339579,
396927,
224907,
396942,
405140,
274071,
208547,
208548,
405157,
388775,
364202,
421556,
224951,
224952,
224985,
159462,
372458,
397040,
12017,
274170,
175874,
249606,
372497,
397076,
421657,
339746,
257831,
167720,
421680,
421686,
274234,
339782,
339799,
274276,
274288,
372592,
274296,
372625,
118693,
438186,
151492,
380874,
372699,
380910,
380922,
380923,
274432,
372736,
430120,
430127,
405552,
249912,
225347,
421958,
176209,
381013,
53334,
200795,
356446,
438374,
176231,
438378,
422000,
249976,
266361,
422020,
381061,
168070,
168069,
381071,
430231,
200856,
422044,
192670,
192671,
258213,
430263,
266427,
356550,
372943,
266447,
258263,
356575,
438512,
372979,
389364,
381173,
135416,
356603,
266504,
61720,
381210,
389406,
438575,
266547,
332084,
397620,
438583,
127292,
438592,
397650,
348499,
250196,
348501,
389465,
332128,
110955,
160111,
250227,
438653,
266628,
340356,
225684,
373141,
373144,
389534,
397732,
373196,
184799,
201195,
324098,
340489,
397841,
258584,
397855,
348709,
348710,
397872,
340539,
266812,
438850,
348741,
381515,
348748,
430681,
332379,
184938,
373357,
184942,
176751,
389744,
356983,
356984,
209529,
356990,
422529,
373377,
152196,
201348,
356998,
348807,
356999,
275102,
340645,
176805,
422567,
176810,
160441,
422591,
135888,
373485,
373486,
21239,
275193,
348921,
430853,
430860,
62222,
430880,
152372,
160569,
430909,
160576,
348999,
439118,
381791,
127840,
357219,
439145,
381811,
201590,
398205,
340865,
349066,
349068,
381840,
390034,
373653,
430999,
381856,
185252,
398244,
422825,
381872,
398268,
349122,
398275,
373705,
127945,
340960,
398305,
340967,
398313,
127990,
349176,
201721,
349179,
357380,
398370,
357413,
357420,
398405,
218187,
250955,
250965,
439391,
250982,
398444,
62574,
357487,
119925,
349304,
349315,
349317,
373902,
373937,
373939,
324790,
218301,
259275,
259285,
357594,
414956,
251124,
439550,
439563,
414989,
349458,
259346,
259347,
382243,
382246,
382257,
382264,
333115,
193853,
251212,
406862,
259408,
374110,
382329,
259449,
357758,
357763,
112019,
398740,
374189,
251314,
259513,
54719,
259569,
251379,
398844,
210429,
366081,
153115,
431646,
349727,
431662,
374327,
210489,
235069,
128589,
333389,
333394,
349780,
415334,
54895,
366198,
210558,
210559,
415360,
415369,
431754,
210569,
267916,
415376,
259741,
153252,
399014,
210601,
202413,
415419,
259780,
333508,
267978,
333522,
325345,
333543,
431861,
161539,
366358,
169751,
431901,
341791,
399148,
202541,
431918,
153392,
431935,
415555,
325444,
325449,
341837,
415566,
431955,
325460,
341846,
259937,
382820,
415592,
325491,
341878,
276343,
333687,
350072,
112510,
325508,
333700,
243590,
350091,
350092,
350102,
350108,
333727,
128955,
219102,
6116,
432114,
415740,
268286,
415744,
399372,
153618,
358418,
178215,
358455,
399433,
333902,
104534,
260206,
432241,
374913,
374914,
415883,
333968,
333990,
104633,
260285,
268479,
374984,
334049,
268515,
383208,
260337,
260338,
432373,
375040,
432387,
260355,
375052,
194832,
325904,
391448,
268570,
178459,
186660,
268581,
334121,
358698,
325930,
260396,
358707,
432435,
178485,
358710,
14654,
268609,
383309,
383327,
366948,
416101,
383338,
432503,
432511,
252309,
39323,
375211,
334259,
129461,
342454,
358844,
326083,
416201,
129484,
154061,
416206,
432608,
391654,
432616,
334315,
375281,
334345,
432650,
342549,
416288,
342560,
350758,
350759,
358951,
358952,
219694,
219695,
432694,
375369,
375373,
416334,
416340,
244311,
416353,
260705,
375396,
268901,
244345,
375438,
326288,
383668,
342714,
39616,
383708,
269036,
432883,
203511,
342775,
383740,
416509,
359166,
162559,
375552,
432894,
383755,
326413,
326428,
342827,
391980,
375610,
416577,
244569,
375644,
252766,
342888,
392057,
211835,
392065,
260995,
400262,
392071,
424842,
236427,
252812,
400271,
392080,
400282,
7070,
211871,
359332,
359333,
326571,
252848,
326580,
261045,
261046,
326586,
359365,
211913,
326602,
342990,
252878,
433104,
359380,
433112,
433116,
359391,
187372,
343020,
383980,
383994,
171009,
384004,
433166,
384015,
433173,
326684,
252959,
384031,
375848,
261191,
375902,
375903,
392288,
253028,
351343,
187505,
138354,
384120,
392317,
343166,
384127,
392320,
253074,
326803,
359574,
351389,
253098,
367791,
367792,
367798,
343230,
367809,
253124,
113863,
351445,
195809,
253168,
351475,
351489,
367897,
367898,
130347,
261426,
212282,
359747,
359748,
146763,
114022,
253288,
425327,
425331,
163190,
327030,
384379,
253316,
384391,
253339,
253340,
343457,
245160,
359860,
359861,
343480,
425417,
327122,
425434,
253431,
359931,
187900,
343552,
409095,
359949,
253456,
253462,
146976,
245290,
245291,
343606,
163385,
425534,
138817,
147011,
147020,
196184,
179800,
343646,
155238,
204394,
138862,
188021,
425624,
245413,
384693,
376502,
409277,
409289,
425682,
245471,
155360,
212721,
163575,
360194,
409355,
155408,
417556,
204600,
384826,
409404,
360253,
409416,
376661,
368471,
425820,
368486,
384871,
409446,
40809,
368489,
425832,
417648,
417658,
360315,
253828,
425875,
253851,
376733,
253868,
188349,
212947,
212953,
360416,
253930,
385011
] |
1b648f948d4e0aa54caf8099b709fe586f7d993c | 23224b96521f55e5261f7883e25b6715a1e63bfb | /BasicAnimationTutorial/CustomTransitionDelegate.swift | b8638f840e37c6aa8719b6eafd75e08fb550503d | [
"MIT"
] | permissive | dsrijan/sampleAnimation | 9f26d1809062b07cfb50a445ec803c6801670657 | cf353fe25ac8524ebcedaec49c9120fe0b949563 | refs/heads/master | 2021-09-10T17:40:26.222508 | 2018-03-30T08:26:26 | 2018-03-30T08:26:26 | 109,826,465 | 2 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 842 | swift | //
// CustomTransitionDelegate.swift
// BasicAnimationTutorial
//
// Created by dsrijan on 16/06/17.
// Copyright © 2017 Srijan. All rights reserved.
//
import UIKit
class CustomTransitionDelegate: NSObject, UIViewControllerTransitioningDelegate {
func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -> UIViewControllerAnimatedTransitioning? {
print("presenting")
let presenting = PresentingTransitionAnimator()
return presenting
}
func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? {
print("dismissing")
let dismissing = DismissionTransitionAnimator()
return dismissing
}
}
| [
-1
] |
7b131d599163213c6dc9c6e4ad1b9290a3f10bdf | 1bf71ca2fe58af519e23e1c2ba32712124284dee | /Sources/AudioKit/MIDI/Packets/MIDIPacketList+SequenceType.swift | 32dd160a18644b945419ed731a97a1e891db41a9 | [
"MIT"
] | permissive | ryanfrancesconi/AudioKit | 2382ce7f237dbfc229112d8f9a3193bf79d3ab93 | 418b61fa0cc1c9752f79eb608479412f6cc3c2d3 | refs/heads/v5-main | 2022-09-26T11:06:28.143449 | 2022-08-04T09:42:51 | 2022-08-04T09:42:51 | 251,693,954 | 1 | 0 | MIT | 2020-03-31T18:21:54 | 2020-03-31T18:21:53 | null | UTF-8 | Swift | false | false | 830 | swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
#if !os(tvOS)
import CoreMIDI
extension MIDIPacketList: Sequence {
/// The element is a packet list sequence is a MIDI Packet
public typealias Element = MIDIPacket
/// Number of packets
public var count: UInt32 {
return self.numPackets
}
/// Create the sequence
/// - Returns: Iterator of elements
public func makeIterator() -> AnyIterator<Element> {
var p: MIDIPacket = packet
var idx: UInt32 = 0
return AnyIterator {
guard idx < self.numPackets else {
return nil
}
defer {
p = MIDIPacketNext(&p).pointee
idx += 1
}
return p
}
}
}
#endif
| [
-1
] |
9accb521c6d7c9551ebe5a73bdb33faa05f46184 | 6432ea7a083ff6ba21ea17af9ee47b9c371760f7 | /tests/bench/rbmap.swift | eb869423f6eb778c282ee53618204cea169def45 | [
"Apache-2.0",
"LLVM-exception",
"NCSA",
"LGPL-3.0-only",
"LicenseRef-scancode-inner-net-2.0",
"BSD-3-Clause",
"LGPL-2.0-or-later",
"Spencer-94",
"LGPL-2.1-or-later",
"HPND",
"LicenseRef-scancode-pcre",
"ISC",
"LGPL-2.1-only",
"LicenseRef-scancode-other-permissive",
"SunPro",
"CMU-Mach"
] | permissive | leanprover/lean4 | 4bdf9790294964627eb9be79f5e8f6157780b4cc | f1f9dc0f2f531af3312398999d8b8303fa5f096b | refs/heads/master | 2023-08-30T01:57:45.786981 | 2023-08-29T23:14:28 | 2023-08-29T23:14:28 | 129,571,436 | 2,827 | 311 | Apache-2.0 | 2023-09-14T18:29:16 | 2018-04-15T02:49:20 | Lean | UTF-8 | Swift | false | false | 3,125 | swift | enum Color {
case Red
case Black
}
indirect enum Tree {
case Leaf
case Node(Color, Tree, UInt64, Bool, Tree)
}
func balance1(_ kv : UInt64, _ vv : Bool, _ t : Tree, _ n : Tree) -> Tree {
switch n {
case let .Node(_, .Node(.Red, l, kx, vx, r1), ky, vy, r2):
return .Node(.Red, .Node(.Black, l, kx, vx, r1), ky, vy, .Node(.Black, r2, kv, vv, t))
case let .Node(_, l1, ky, vy, .Node(.Red, l2, kx, vx, r)):
return .Node(.Red, .Node(.Black, l1, ky, vy, l2), kx, vx, .Node(.Black, r, kv, vv, t))
case let .Node(_, l, ky, vy, r):
return .Node(.Black, .Node(.Red, l, ky, vy, r), kv, vv, t)
default:
return .Leaf
}
}
func balance2(_ t : Tree, _ kv : UInt64, _ vv : Bool, _ n : Tree) -> Tree {
switch n {
case let .Node(_, .Node(.Red, l, kx1, vx1, r1), ky, vy, r2):
return .Node(.Red, .Node(.Black, t, kv, vv, l), kx1, vx1, .Node(.Black, r1, ky, vy, r2))
case let .Node(_, l1, ky, vy, .Node(.Red, l2, kx2, vx2, r2)):
return .Node(.Red, .Node(.Black, t, kv, vv, l1), ky, vy, .Node(.Black, l2, kx2, vx2, r2))
case let .Node (_, l, ky, vy, r):
return .Node(.Black, t, kv, vv, .Node(.Red, l, ky, vy, r))
default:
return .Leaf
}
}
func is_red (_ t : Tree) -> Bool {
switch t {
case .Node(.Red, _, _, _, _):
return true
default:
return false
}
}
func ins(_ t : Tree, _ kx : UInt64, _ vx : Bool) -> Tree {
switch t {
case .Leaf:
return .Node(.Red, .Leaf, kx, vx, .Leaf)
case let .Node(.Red, a, ky, vy, b):
if kx < ky {
return .Node(.Red, ins(a, kx, vx), ky, vy, b)
} else if ky == kx {
return .Node(.Red, a, kx, vx, b)
} else {
return .Node(.Red, a, ky, vy, ins(b, kx, vx))
}
case let .Node(.Black, a, ky, vy, b):
if kx < ky {
if is_red(a) {
return balance1(ky, vy, b, ins(a, kx, vx))
} else {
return .Node(.Black, ins(a, kx, vx), ky, vy, b)
}
} else if kx == ky {
return .Node(.Black, a, kx, vx, b)
} else {
if is_red(b) {
return balance2(a, ky, vy, ins(b, kx, vx))
} else {
return .Node(.Black, a, ky, vy, ins(b, kx, vx))
}
}
}
}
func set_black (_ n : Tree) -> Tree {
switch n {
case let .Node (_, l, k, v, r):
return .Node (.Black, l, k, v, r)
default:
return n
}
}
func insert (_ t : Tree, _ k : UInt64, _ v : Bool) -> Tree {
if is_red(t) {
return set_black(ins(t, k, v))
} else {
return ins(t, k, v)
}
}
func fold (_ f : (_ k : UInt64, _ v : Bool, _ d : UInt64) -> UInt64, _ n : Tree, _ d : UInt64) -> UInt64 {
switch n {
case .Leaf:
return d
case let .Node(_, l, k, v, r):
return fold(f, r, f(k, v, fold(f, l, d)))
}
}
func mk_map (_ n : UInt64) -> Tree {
var i = n
var m : Tree = .Leaf
while i > 0 {
i = i - 1
m = insert(m, i, (i%10 == 0))
}
return m
}
func aux (_ k : UInt64, _ v : Bool, _ r : UInt64) -> UInt64 {
if v {
return r + 1
} else {
return r
}
}
if CommandLine.arguments.count != 2 {
print("Incorrect number of arguments")
} else {
let num = UInt64(CommandLine.arguments[1])
let m = mk_map(num!)
let v = fold(aux, m, 0)
print(v)
}
| [
-1
] |
8b77c19b907142d4fefc58ca45d9474e24761022 | 4d2dc109595d6ff59d1491d59dabfde8c5cd3d3b | /CalendarTest/AppDelegate.swift | 0448fd68c1cce20e4685c59e44e856a48e52564f | [] | no_license | MilanistaDev/SDT_AdventCalendar2015_day25 | 00eca4ccc63a19037e96fcaacb88fa7e4951f2eb | 7b53046c531d7ebcaf5f6ee2b53c294d4fa8bf41 | refs/heads/master | 2021-01-10T16:23:20.260409 | 2015-12-25T17:25:29 | 2015-12-25T17:29:30 | 48,175,365 | 2 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 2,208 | swift | //
// AppDelegate.swift
// CalendarTest
//
// Created by 麻生 拓弥 on 2015/12/14.
// Copyright © 2015年 麻生 拓弥. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// NavigationBar のテキスト色変更
UINavigationBar.appearance().tintColor = UIColor.whiteColor()
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,
229426,
237618,
229428,
286774,
229432,
286776,
286778,
319544,
286791,
237640,
278605,
237646,
311375,
163920,
196692,
311383,
278623,
278626,
319590,
311400,
278635,
303212,
278639,
278648,
131192,
237693,
327814,
131209,
303241,
417930,
311436,
319633,
286873,
286876,
311460,
311469,
32944,
327862,
286906,
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,
287003,
287006,
287009,
287012,
287014,
287016,
287019,
311598,
262448,
287032,
155966,
278849,
319809,
319810,
319814,
319818,
311628,
229709,
287054,
319822,
278865,
229717,
196963,
196969,
139638,
213367,
106872,
319872,
311683,
319879,
65943,
319898,
311719,
278952,
139689,
278957,
311728,
278967,
180668,
311741,
278975,
319938,
278980,
98756,
278983,
319945,
278986,
319947,
278990,
278994,
279003,
279006,
188895,
172512,
279010,
287202,
279015,
172520,
319978,
279020,
172526,
279023,
311791,
172529,
279027,
319989,
164343,
180727,
279035,
311804,
287230,
279040,
303617,
287234,
279045,
287238,
172550,
172552,
303623,
320007,
279051,
172558,
279055,
303632,
279058,
303637,
279063,
279067,
172572,
279072,
172577,
295459,
172581,
295461,
279082,
311850,
279084,
172591,
172598,
279095,
172607,
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,
352905,
279178,
287371,
311946,
311951,
287377,
287381,
311957,
221850,
287386,
164509,
287390,
295583,
303773,
172702,
287394,
230045,
303780,
172705,
287398,
172707,
287400,
279208,
172714,
295595,
279212,
189102,
172721,
287409,
66227,
303797,
189114,
287419,
303804,
328381,
279231,
287423,
328384,
287427,
312006,
107212,
172748,
287436,
172751,
295633,
172755,
303827,
279255,
172760,
279258,
303835,
213724,
189149,
303838,
287450,
279267,
312035,
295654,
279272,
312048,
312050,
230131,
205564,
230146,
328453,
295685,
230154,
33548,
312077,
295695,
369433,
295707,
328476,
295710,
303914,
279340,
205613,
279353,
230202,
222018,
295755,
377676,
148302,
287569,
279390,
230241,
279394,
303976,
336744,
303985,
328563,
303987,
279413,
303991,
303997,
295806,
295808,
295813,
304005,
213895,
320391,
304007,
304009,
304011,
230284,
304013,
213902,
279438,
295822,
189329,
189331,
279445,
58262,
279452,
410526,
279461,
279462,
304042,
213931,
230327,
304055,
287675,
304063,
238528,
304065,
189378,
213954,
156612,
295873,
213963,
312272,
304084,
304090,
320481,
304106,
320490,
312302,
328687,
320496,
295928,
320505,
312321,
295945,
295949,
197645,
230413,
320528,
140312,
295961,
238620,
197663,
304164,
189479,
304170,
238641,
312374,
238652,
238655,
230465,
238658,
296004,
336964,
205895,
320584,
238666,
296021,
402518,
336987,
230497,
296036,
296040,
361576,
205931,
164973,
205934,
279661,
279669,
337018,
279679,
279683,
222340,
205968,
296084,
238745,
304285,
238756,
205991,
165035,
337067,
165038,
238766,
238770,
304311,
230592,
279750,
230600,
230607,
148690,
279769,
304348,
279777,
304354,
296163,
320740,
279781,
304360,
320748,
279788,
279790,
296189,
320771,
312585,
296205,
230674,
320786,
230677,
296213,
296215,
320792,
230681,
173350,
312622,
296243,
312630,
222522,
222525,
230718,
312639,
296255,
378181,
230727,
238919,
320840,
222545,
230739,
312663,
337244,
222556,
230752,
312676,
230760,
173418,
410987,
230763,
230768,
296305,
312692,
230773,
304505,
181626,
304506,
181631,
312711,
312712,
296331,
288140,
230800,
288144,
304533,
337306,
288154,
288160,
288162,
288164,
279975,
304555,
370092,
279983,
288176,
173488,
312755,
296373,
279991,
312759,
288185,
337335,
222652,
312766,
173507,
296389,
222665,
230860,
280014,
230865,
288210,
370130,
288212,
280021,
288214,
148946,
239064,
288217,
288218,
280027,
288220,
329177,
239070,
288224,
288226,
370146,
280036,
288229,
280038,
288230,
288232,
280034,
288234,
320998,
288236,
288238,
288240,
288242,
296435,
288244,
288250,
402942,
148990,
296446,
206336,
321022,
296450,
230916,
214535,
230919,
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,
280232,
321195,
321200,
337585,
296626,
296634,
313027,
280260,
280264,
206536,
206539,
206541,
206543,
280276,
313044,
321239,
280283,
313052,
288478,
313055,
321252,
313066,
280302,
288494,
280304,
313073,
419570,
321266,
288499,
288502,
280314,
288510,
67330,
280324,
198405,
288519,
280331,
198416,
280337,
296723,
116503,
321304,
329498,
296731,
321311,
313121,
313123,
304932,
321316,
280363,
141101,
165678,
280375,
321336,
296767,
345921,
280388,
304968,
280393,
280402,
313176,
280419,
321381,
296812,
313201,
1920,
255873,
305028,
280454,
247688,
280464,
124817,
280468,
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,
288826,
321595,
313406,
288831,
67654,
280651,
354382,
288848,
280658,
215123,
354390,
288855,
288859,
280669,
313438,
280671,
223327,
321634,
149603,
329830,
280681,
313451,
223341,
280687,
313458,
280691,
215154,
313464,
329850,
321659,
280702,
288895,
321670,
215175,
141446,
141455,
141459,
280725,
313498,
100520,
288936,
280747,
288940,
280755,
288947,
321717,
280759,
280764,
280769,
280771,
280774,
280776,
313548,
321740,
280783,
280786,
280788,
313557,
280793,
280796,
280798,
338147,
280804,
280807,
157930,
280811,
280817,
125171,
157940,
280819,
280823,
280825,
280827,
280830,
280831,
280833,
125187,
280835,
125191,
125207,
125209,
321817,
125218,
321842,
223539,
125239,
280888,
280891,
289087,
280897,
280900,
239944,
305480,
280906,
239947,
305485,
305489,
379218,
280919,
354653,
313700,
280937,
190832,
280946,
223606,
313720,
280956,
239997,
280959,
313731,
199051,
240011,
240017,
190868,
297365,
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,
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,
281196,
158317,
19053,
313973,
281210,
297594,
158347,
133776,
314003,
117398,
314007,
289436,
174754,
330404,
289448,
133801,
174764,
314029,
314033,
240309,
133817,
314045,
314047,
314051,
199364,
297671,
199367,
158409,
289493,
363234,
289513,
289522,
289525,
289532,
322303,
289537,
322310,
264969,
322314,
322318,
281361,
281372,
322341,
215850,
281388,
207661,
289593,
281401,
289601,
281410,
281413,
281414,
240458,
281420,
240468,
281430,
322393,
297818,
281435,
281438,
281442,
174955,
224110,
207733,
207737,
183172,
158596,
240519,
322440,
314249,
289687,
240535,
297883,
289694,
289696,
289700,
289724,
52163,
281567,
289762,
322534,
297961,
183277,
281581,
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,
363745,
298216,
330988,
126190,
216303,
322801,
257302,
363802,
199976,
199978,
314671,
298292,
298294,
257334,
298306,
380226,
281923,
224584,
224587,
224594,
216404,
306517,
150870,
314714,
224603,
159068,
265568,
314723,
281960,
150890,
306539,
314732,
314736,
290161,
216436,
306549,
298358,
314743,
306552,
290171,
314747,
298365,
290174,
224641,
281987,
265604,
298372,
281990,
298377,
314763,
142733,
298381,
224657,
306581,
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,
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,
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,
323367,
241448,
241450,
282410,
306988,
306991,
315184,
323376,
315190,
241464,
159545,
282425,
307009,
241475,
307012,
315211,
282446,
307027,
315221,
282454,
315223,
241496,
323414,
241498,
307035,
307040,
282465,
110433,
241509,
110438,
110445,
282478,
282481,
110450,
315251,
315249,
315253,
315255,
339838,
282499,
315267,
315269,
241544,
282505,
241546,
241548,
298896,
282514,
298898,
44948,
298901,
241556,
282520,
241560,
241563,
241565,
241567,
241569,
282531,
241574,
282537,
298922,
36779,
241581,
282542,
241583,
323504,
241586,
282547,
241588,
290739,
241590,
241592,
241598,
290751,
241600,
241605,
151495,
241610,
298975,
241632,
241640,
298984,
241643,
298988,
241646,
241649,
241652,
323574,
290807,
241661,
299006,
282623,
315396,
241669,
315397,
282632,
282639,
290835,
282645,
241693,
282654,
241701,
217127,
282669,
323630,
282681,
290877,
282687,
159811,
315463,
315466,
192589,
307278,
192596,
176213,
307287,
315482,
217179,
315483,
192605,
233567,
200801,
299105,
217188,
299109,
307303,
45163,
307307,
315502,
192624,
307314,
323700,
299126,
233591,
299136,
307329,
307338,
233613,
241813,
307352,
299164,
184479,
184481,
315557,
184486,
307370,
184492,
307372,
307374,
307376,
323763,
176311,
299191,
307385,
307386,
258235,
176316,
307388,
307390,
184503,
299200,
184512,
307394,
307396,
299204,
184518,
323784,
307409,
307411,
176343,
299225,
233701,
184572,
282881,
184579,
282893,
291089,
282906,
291104,
233766,
176435,
307508,
315701,
307510,
168245,
151864,
307512,
332086,
307515,
282942,
307518,
151874,
282947,
323917,
110926,
282957,
233808,
323921,
315733,
323926,
233815,
315739,
323932,
299357,
242018,
242024,
299373,
315757,
250231,
242043,
315771,
299388,
291202,
299398,
242057,
291212,
299405,
291222,
283033,
291226,
242075,
315801,
291231,
61855,
283042,
291238,
291241,
127403,
127405,
291247,
127407,
299444,
127413,
283062,
291254,
127417,
291260,
283069,
127421,
127424,
299457,
127429,
283080,
176592,
315856,
315860,
176597,
283095,
127447,
299481,
176605,
242143,
291299,
242152,
291305,
176620,
127474,
291314,
291317,
135672,
233979,
291323,
291330,
283142,
127497,
233994,
135689,
291341,
233998,
234003,
234006,
152087,
242202,
234010,
135707,
242206,
135710,
242208,
291361,
242220,
291378,
234038,
152118,
70213,
242250,
111193,
242275,
299620,
242279,
168562,
184952,
135805,
291456,
135808,
373383,
299655,
316051,
225941,
316054,
299672,
135834,
373404,
299677,
225948,
135839,
299680,
225954,
299684,
242343,
209576,
242345,
373421,
135870,
135873,
135876,
135879,
299720,
299723,
225998,
226002,
226005,
226008,
242396,
299740,
201444,
299750,
283368,
234219,
283372,
226037,
283382,
234231,
234236,
226045,
234239,
242431,
209665,
234242,
299778,
242436,
226053,
234246,
226056,
234248,
291593,
242443,
242445,
234254,
291601,
234258,
242450,
242452,
234261,
201496,
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,
242511,
234319,
234321,
234324,
185173,
201557,
234329,
234333,
308063,
234336,
234338,
242530,
349027,
234341,
234344,
234347,
177004,
234350,
324464,
234353,
152435,
177011,
234356,
234358,
234362,
226171,
291711,
234368,
234370,
201603,
291714,
291716,
226182,
234375,
234373,
226185,
308105,
234379,
234384,
234388,
234390,
226200,
324504,
234393,
209818,
308123,
324508,
234398,
234396,
291742,
234401,
291748,
234405,
291750,
234407,
324518,
324520,
234410,
324522,
226220,
291756,
291754,
324527,
291760,
234417,
201650,
324531,
234414,
226230,
234422,
275384,
234428,
291773,
234431,
242623,
324544,
324546,
226239,
324548,
226245,
234437,
234439,
234434,
234443,
291788,
193486,
234446,
193488,
275406,
234449,
316370,
234452,
234455,
234459,
234461,
234464,
234467,
234470,
168935,
5096,
324585,
234475,
234478,
316400,
234481,
316403,
234484,
234485,
324599,
234487,
234490,
234493,
234496,
316416,
234501,
308231,
234504,
234507,
234510,
234515,
300054,
234519,
316439,
234520,
234523,
234528,
300066,
234532,
234535,
234537,
234540,
144430,
234543,
275508,
234549,
300085,
300088,
234556,
234558,
316479,
234561,
316483,
234563,
234568,
234570,
316491,
300108,
234572,
300115,
234580,
234581,
242777,
234585,
275545,
234590,
234595,
300133,
234597,
234601,
300139,
234605,
160879,
234607,
275569,
234610,
234614,
398455,
144506,
234618,
275579,
234620,
234623,
226433,
234627,
275588,
234629,
242822,
234634,
275594,
234636,
177293,
234640,
275602,
234643,
226453,
275606,
234647,
275608,
308373,
234650,
324757,
234648,
283805,
234653,
324766,
119967,
234657,
308379,
300189,
242852,
283813,
234661,
300197,
234664,
275626,
316596,
234687,
316610,
300226,
226500,
234692,
300229,
308420,
283844,
283850,
300234,
300238,
300241,
316625,
300243,
300245,
300248,
300253,
300256,
300258,
300260,
234726,
300263,
300265,
161003,
300267,
300270,
300272,
120053,
300278,
316663,
300284,
275710,
300287,
300289,
300292,
300294,
275719,
177419,
300299,
283917,
300301,
242957,
177424,
275725,
349464,
283939,
259367,
283951,
300344,
226617,
243003,
283963,
226628,
283973,
300357,
177482,
283983,
316758,
357722,
316766,
292192,
316768,
218464,
292197,
316774,
243046,
218473,
284010,
136562,
275834,
333178,
275836,
275840,
316803,
316806,
226696,
316811,
226699,
226703,
300433,
234899,
226709,
357783,
316824,
316826,
144796,
300448,
144810,
144812,
284076,
144814,
144820,
284084,
284087,
292279,
144826,
144828,
144830,
144832,
284099,
144835,
144837,
38342,
144839,
144841,
144844,
144847,
144852,
144855,
103899,
300507,
333280,
292329,
300523,
259565,
259567,
300527,
226802,
316917,
308727,
300537,
316947,
308757,
308762,
284191,
284194,
284196,
235045,
284199,
284204,
284206,
284209,
284211,
284213,
194101,
194103,
284215,
284218,
226877,
284223,
284226,
284228,
292421,
226886,
284231,
128584,
284234,
366155,
276043,
317004,
284238,
226895,
284241,
194130,
284243,
276052,
284245,
276053,
284247,
317015,
284249,
243290,
284251,
284253,
243293,
284255,
300638,
284258,
292452,
177766,
284263,
292454,
284265,
292458,
284267,
292461,
284272,
284274,
276086,
284278,
292470,
292473,
284283,
276093,
284286,
276095,
284288,
292481,
284290,
325250,
284292,
276098,
292479,
292485,
284297,
317066,
284299,
317068,
276109,
284301,
284303,
276114,
284306,
284308,
284312,
284314,
284316,
276127,
284320,
284322,
284327,
276137,
284329,
284331,
317098,
284333,
284335,
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,
358119,
284392,
325353,
284394,
358122,
284397,
276206,
284399,
358126,
358128,
358133,
358135,
276216,
358138,
300795,
358140,
284413,
358142,
284418,
358146,
317187,
317191,
284428,
300816,
317207,
284440,
186139,
300828,
300830,
276255,
325408,
284449,
300834,
300832,
317221,
227109,
358183,
186151,
276268,
194351,
243504,
284469,
276280,
325436,
358206,
276291,
366406,
276295,
300872,
153417,
284499,
276308,
284502,
317271,
178006,
276315,
292700,
284511,
227175,
292715,
284529,
292721,
300915,
284533,
292729,
317306,
284540,
292734,
325512,
169868,
276365,
284564,
284566,
350106,
284572,
276386,
284579,
276388,
358312,
284585,
292776,
276395,
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,
276466,
227314,
276472,
325624,
317435,
276476,
276479,
276482,
276485,
317446,
276490,
292876,
276496,
317456,
317458,
243733,
243740,
317468,
317472,
325666,
243751,
292904,
276528,
243762,
309298,
325685,
325689,
235579,
276539,
235581,
325692,
178238,
276544,
284739,
243785,
276553,
222676,
350295,
194649,
227418,
309337,
194654,
227423,
350302,
178273,
227426,
194657,
194660,
276579,
227430,
276583,
309346,
309348,
309350,
309352,
309354,
350308,
276590,
350313,
227440,
350316,
284786,
350321,
276595,
350328,
292985,
301178,
292989,
292993,
301185,
350339,
350342,
350345,
301199,
325777,
350354,
350359,
276638,
350366,
284837,
153765,
350375,
350379,
350381,
350385,
350387,
350389,
350395,
350399,
227520,
227522,
301252,
350406,
227529,
309450,
301258,
276685,
276689,
309462,
301272,
276699,
309468,
194780,
301283,
317672,
276713,
243948,
194801,
227571,
309494,
243960,
227583,
276735,
227587,
276739,
211204,
276742,
227593,
227596,
325910,
309530,
342298,
276766,
211232,
276775,
211241,
325937,
276789,
325943,
260421,
276809,
285002,
276811,
235853,
276816,
235858,
276829,
276833,
391523,
276836,
276843,
293227,
276848,
293232,
186744,
211324,
227709,
285061,
317833,
178572,
285070,
178575,
285077,
178583,
227738,
317853,
276896,
317858,
342434,
285093,
317864,
285098,
276907,
276917,
293304,
293314,
293325,
317910,
293336,
235996,
317917,
293343,
358880,
276961,
227810,
293346,
276964,
293352,
236013,
293364,
317951,
309764,
121352,
236043,
317963,
342541,
55822,
113167,
317971,
277011,
309781,
55837,
227877,
227879,
227882,
309804,
293421,
105007,
236082,
285236,
23094,
277054,
244288,
129603,
318020,
301636,
277071,
285265,
309844,
277080,
309849,
285277,
285282,
326244,
277100,
121458,
277106,
170618,
170619,
309885,
309888,
277122,
227975,
285320,
277128,
301706,
318092,
326285,
318094,
334476,
277136,
277139,
227992,
285340,
318108,
227998,
318110,
383658,
285357,
318128,
277170,
342707,
154292,
277173,
293555,
285368,
277177,
277181,
318144,
277187,
277191,
277194,
277196,
277201,
137946,
113378,
203491,
228069,
277223,
342760,
285417,
56041,
56043,
277232,
228081,
56059,
310015,
285441,
310020,
285448,
310029,
228113,
285459,
277273,
326430,
228128,
228135,
318248,
277291,
293677,
318253,
285489,
293685,
285494,
285499,
301884,
310080,
277314,
277317,
277322,
277329,
162643,
310100,
301911,
301913,
277337,
301921,
400236,
236397,
162671,
326514,
310134,
277368,
15224,
236408,
416639,
416640,
113538,
310147,
416648,
39817,
187274,
277385,
301972,
424853,
277405,
277411,
310179,
293798,
293802,
236460,
277426,
293811,
293817,
293820,
203715,
326603,
276586,
293849,
293861,
228327,
228328,
228330,
318442,
228332,
277486,
326638,
318450,
293876,
293877,
285686,
302073,
285690,
244731,
121850,
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,
294026,
285835,
302218,
162964,
384148,
187542,
302231,
302233,
285852,
302237,
285854,
285856,
285862,
277671,
302248,
64682,
277678,
228526,
294063,
294065,
302258,
277687,
294072,
318651,
277695,
318657,
244930,
302275,
302277,
228550,
302282,
310476,
302285,
302288,
310481,
302290,
203987,
302292,
302294,
302296,
384222,
310498,
285927,
318698,
302315,
195822,
228592,
294132,
138485,
228601,
204026,
228606,
204031,
64768,
310531,
285958,
228617,
138505,
318742,
204067,
277798,
130345,
277801,
113964,
285997,
277804,
285999,
277807,
113969,
277811,
318773,
318776,
277816,
286010,
277819,
294204,
277822,
417086,
286016,
294211,
302403,
277832,
277836,
326991,
277839,
277842,
277847,
277850,
179547,
277853,
277857,
302436,
277860,
294246,
327015,
310632,
327017,
351594,
277864,
277869,
277872,
351607,
310648,
277880,
310651,
277884,
277888,
310657,
351619,
294276,
310659,
327046,
277892,
253320,
310665,
318858,
277894,
277898,
277903,
310672,
351633,
277905,
277908,
277917,
310689,
277921,
130468,
277928,
277932,
310703,
277937,
310710,
130486,
277944,
310712,
310715,
277947,
277950,
228799,
277953,
64966,
245191,
163272,
277959,
302534,
310727,
292968,
277963,
277966,
302543,
310737,
277971,
286169,
228825,
277978,
310749,
277981,
277984,
310755,
277989,
277991,
187880,
277995,
310764,
286188,
278000,
228851,
278003,
278006,
40440,
212472,
278009,
40443,
286203,
40448,
228864,
286214,
228871,
302603,
65038,
302614,
286233,
286240,
146977,
187939,
40484,
294435,
286246,
40486,
286248,
278057,
40488,
294439,
40491,
294440,
294443,
310831,
294445,
212538,
40507,
40511,
40513,
228933,
40521,
286283,
40525,
40527,
212560,
228944,
400976,
40533,
147032,
40537,
40539,
278109,
40541,
40544,
40548,
40550,
286312,
286313,
40554,
40552,
310892,
40557,
40560,
188022,
122488,
294521,
343679,
278150,
310925,
286354,
278163,
302740,
278168,
327333,
229030,
212648,
278188,
302764,
278192,
319153,
278196,
319171,
302789,
294599,
278216,
294601,
343757,
212690,
278227,
286420,
319187,
229076,
286425,
319194,
278235,
301163,
229086,
278238,
286432,
294625,
294634,
302838,
319226,
286460,
171774,
278274,
302852,
278277,
302854,
294664,
311048,
319243,
311053,
302862,
294682,
278306,
294701,
278320,
319280,
319290,
229192,
302925,
237409,
360317,
327554,
40840,
40851,
294803,
188312,
294811,
319390,
294817,
319394,
40865,
294821,
311209,
180142,
188340,
40886,
319419,
294844,
294847,
393177,
294876,
294879,
294883,
294890,
311279,
278513,
237555,
278516,
311283,
278519,
237562
] |
ca68e5aa2b49f762191ad2b6af226e1ede61b6e3 | c2ef1a45c510f62431c3b203693a0b208dde5149 | /1 - Getting Started/2 - Constants, Variables, and Data Types/lab/Lab - Constants and Variables.playground/Pages/4. App Exercise - Step Count.xcplaygroundpage/Contents.swift | 10ce4911c6024fd67bfb4638bb61a949cf13fd90 | [] | no_license | TylerAverette/App-Development-with-swift-Otaku-Heaven | 0cd465b0fc5f20a73c3b1aacb6f5161fcace482a | d72191022b906d6f773bb614269f1a868a75106e | refs/heads/master | 2020-08-31T05:05:32.836320 | 2019-12-09T20:54:29 | 2019-12-09T20:54:29 | 218,598,845 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 823 | swift | /*:
## App Exercise - Step Count
>These exercises reinforce Swift concepts in the context of a fitness tracking app.
Create a variable called `steps` that will keep track of the number of steps you take throughout the day. Set its initial value to 0 to represent the step count first thing in the morning. Print `steps` to the console.
*/
var steps = 0
print("\(steps)")
/*:
Now assume the tracker has been keeping track of steps all morning, and you want to show the user the latest step count. Update `steps` to be 2000. Print `steps` to the console. Then print "Good job! You're well on your way to your daily goal."
*/
steps = 2_000
print("\(steps) steps. Good Job! You're wewll on your way to your daily goal.")
//: [Previous](@previous) | page 4 of 10 | [Next: Exercise - Constant or Variable?](@next)
| [
-1
] |
7d175ca2ade90e775bc94efa055d788837220df9 | b8e03f59e75246d46a770d0951c9ede5f030d594 | /SwiftOpenCV/AppDelegate.swift | dcbb0f2d9a1c58e4cd3574b35a3e758084598e94 | [
"MIT"
] | permissive | starbadboy/TotoScanner | 50c17840a29aabae2473b1ac7476548079925763 | c97bcf1f475b8c6da2664b6e2df817860864445a | refs/heads/master | 2020-05-27T13:30:38.764185 | 2017-02-20T12:13:10 | 2017-02-20T12:13:10 | 82,553,662 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 2,230 | swift | //
// AppDelegate.swift
// SwiftOpenCV
//
// Created by Lee Whitney on 10/28/14.
// Copyright (c) 2014 WhitneyLand. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
//FIRApp.configure()
// 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,
229388,
294924,
278542,
229391,
327695,
278545,
229394,
278548,
229397,
229399,
229402,
352284,
229405,
278556,
278559,
278564,
294950,
229415,
229417,
327722,
237613,
229422,
360496,
229426,
237618,
229428,
311349,
286774,
229432,
286776,
286778,
319544,
204856,
352318,
286791,
237640,
278605,
286797,
311375,
163920,
196692,
319573,
311383,
278623,
278626,
319590,
311400,
278635,
303212,
278639,
131192,
278648,
237693,
303230,
327814,
131209,
303241,
417930,
311436,
303244,
319633,
286873,
286876,
311460,
311469,
32944,
327862,
286906,
327866,
180413,
286910,
286916,
295110,
286922,
286924,
286926,
319694,
286928,
131281,
278743,
278747,
295133,
155872,
319716,
237807,
303345,
286962,
303347,
131314,
229622,
327930,
278781,
278783,
278785,
237826,
319751,
286987,
319757,
311569,
286999,
319770,
287003,
287006,
287009,
287012,
287014,
287016,
287019,
311598,
287023,
262448,
311601,
295220,
155966,
319809,
319810,
278849,
319814,
311623,
319818,
311628,
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,
278983,
319945,
278986,
278990,
278994,
311767,
279003,
279006,
188895,
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,
279084,
172591,
172598,
279095,
172607,
172609,
172612,
377413,
172614,
213575,
172618,
303690,
33357,
279124,
172634,
262752,
172644,
311911,
189034,
295533,
172655,
172656,
189039,
295538,
189040,
172660,
189044,
287349,
352880,
287355,
287360,
295553,
287365,
311942,
303751,
295557,
352905,
279178,
287371,
311946,
311951,
287377,
172691,
287381,
311957,
221850,
287386,
164509,
303773,
172702,
230045,
172705,
287394,
172707,
303780,
287390,
287398,
205479,
279208,
287400,
172714,
295595,
279212,
189102,
172721,
287409,
66227,
303797,
189114,
287419,
303804,
328381,
287423,
328384,
279231,
287427,
312005,
312006,
107208,
172748,
287436,
172751,
287440,
295633,
172755,
303827,
279255,
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,
295720,
303914,
279340,
279353,
230202,
312124,
328508,
222018,
295755,
377676,
148302,
287569,
303959,
230237,
279390,
230241,
279394,
303976,
336744,
303981,
303985,
328563,
303987,
303991,
303997,
295806,
295808,
304005,
295813,
213895,
320391,
304007,
304009,
304011,
304013,
279438,
189325,
295822,
189329,
295825,
304019,
213902,
189331,
58262,
304023,
279452,
279461,
279462,
304042,
213931,
230327,
304055,
287675,
197564,
230334,
304063,
238528,
304065,
213954,
189378,
156612,
312272,
304084,
304090,
320481,
304106,
320490,
312302,
328687,
320496,
304114,
295928,
320505,
295945,
295949,
230413,
197645,
320528,
140312,
295961,
238620,
304164,
304170,
304175,
238641,
312374,
238652,
238655,
230465,
238658,
336964,
296004,
205895,
320584,
238666,
296021,
402518,
336987,
230497,
296036,
296040,
361576,
205931,
296044,
279661,
205934,
164973,
312432,
279669,
337018,
189562,
279679,
304258,
279683,
222340,
205968,
296084,
238745,
304285,
238756,
205991,
222377,
165035,
337067,
238766,
165038,
230576,
238770,
304311,
230592,
279750,
312518,
230600,
230607,
148690,
320727,
279769,
304348,
279777,
304354,
296163,
320740,
279781,
304360,
320748,
279788,
279790,
304370,
296189,
320771,
312585,
296202,
296205,
230674,
320786,
230677,
296213,
296215,
230679,
320792,
230681,
214294,
304416,
230689,
173350,
312622,
296243,
312630,
222522,
222525,
296253,
312639,
296255,
296259,
378181,
296262,
230727,
238919,
320840,
296264,
296267,
296271,
222545,
230739,
312663,
337244,
222556,
230752,
312676,
230760,
173418,
410987,
148843,
230763,
230768,
296305,
312692,
230773,
304505,
304506,
181626,
279929,
181631,
148865,
312711,
312712,
296331,
288140,
230800,
288144,
337306,
288154,
288160,
173472,
288162,
288164,
279975,
304555,
370092,
279983,
288176,
173488,
279985,
312755,
296373,
279991,
312759,
288185,
337335,
222652,
312766,
173507,
296389,
222665,
230860,
312783,
288208,
230865,
288210,
370130,
288212,
222676,
288214,
280021,
239064,
288217,
329177,
280027,
288220,
288218,
239070,
288224,
280034,
288226,
280036,
288229,
280038,
288230,
288232,
370146,
288234,
320998,
288236,
288238,
288240,
288242,
296435,
288244,
288250,
402942,
296446,
148990,
321022,
296450,
206336,
230916,
230919,
304651,
370187,
304653,
230923,
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,
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,
280276,
321239,
280283,
313052,
18140,
288478,
313055,
321252,
313066,
280302,
288494,
321266,
288499,
419570,
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,
337732,
304968,
280393,
280402,
173907,
313176,
42842,
280419,
321381,
296809,
296812,
313201,
1920,
255873,
305028,
280454,
247688,
124817,
280468,
239510,
280473,
124827,
214940,
247709,
214944,
313258,
321458,
296883,
124853,
10170,
296890,
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,
321560,
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,
280671,
149599,
149601,
321634,
149603,
223327,
280681,
313451,
223341,
280687,
313458,
280691,
215154,
313464,
329850,
321659,
288895,
321670,
215175,
141455,
141459,
280725,
313498,
100520,
288936,
280747,
288940,
280755,
288947,
321717,
280759,
280764,
280769,
280771,
280774,
280776,
313548,
321740,
280783,
280786,
280788,
313557,
280793,
280796,
280798,
338147,
280804,
280807,
157930,
280811,
280817,
125171,
157940,
280819,
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,
248153,
215387,
354653,
313700,
280937,
313705,
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,
436684,
281047,
215526,
166378,
305647,
281075,
174580,
240124,
281084,
305662,
305664,
240129,
305666,
305668,
330244,
240132,
281095,
338440,
150025,
223752,
223749,
223757,
281102,
223763,
223765,
281113,
322074,
281116,
281121,
182819,
281127,
281135,
150066,
158262,
158266,
289342,
281154,
322115,
158283,
281163,
338528,
338532,
281190,
199273,
281196,
158317,
19053,
313973,
281210,
297594,
158347,
264845,
182926,
133776,
182929,
314003,
117398,
314007,
289436,
174754,
330404,
289448,
133801,
174764,
314029,
314033,
240309,
314047,
314051,
199364,
297671,
158409,
289493,
363234,
289513,
289522,
289525,
289532,
322303,
289537,
322310,
264969,
322314,
322318,
281361,
281372,
322341,
215850,
281388,
289593,
281401,
289601,
281410,
281413,
281414,
240458,
281420,
240468,
281430,
322393,
297818,
281435,
281438,
281442,
174955,
224110,
207733,
207737,
183172,
158596,
240519,
322440,
314249,
338823,
183184,
142226,
289687,
240535,
224151,
297883,
289694,
289696,
289700,
289712,
281529,
289724,
52163,
183260,
420829,
281567,
289762,
322534,
297961,
183277,
281581,
322550,
134142,
322563,
314372,
330764,
175134,
322599,
322610,
314421,
281654,
314427,
314433,
207937,
322642,
314456,
281691,
314461,
281702,
281704,
314474,
281711,
289912,
248995,
306341,
306347,
322734,
306354,
142531,
199877,
289991,
306377,
289997,
249045,
363742,
363745,
298216,
330988,
216303,
322801,
388350,
257302,
363802,
199976,
199978,
314671,
298292,
298294,
216376,
298306,
380226,
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,
298377,
314763,
314768,
224657,
306581,
314773,
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,
290305,
306694,
192008,
323084,
257550,
282127,
290321,
282130,
282133,
290325,
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,
61092,
282277,
196133,
282295,
282300,
323260,
323266,
282310,
324768,
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,
307012,
298822,
315211,
307027,
315221,
315223,
241496,
241498,
307035,
307040,
110433,
282465,
241509,
110438,
298860,
110445,
282478,
315249,
110450,
315251,
315253,
315255,
339838,
315267,
282499,
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,
290739,
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,
233567,
200801,
299105,
217188,
299109,
307303,
315495,
356457,
45163,
307307,
315502,
192624,
307314,
323700,
299126,
233591,
307329,
315524,
307338,
233613,
241813,
307352,
299164,
184479,
299167,
184481,
315557,
184486,
307370,
307372,
307374,
307376,
299185,
323763,
176311,
299191,
307385,
307386,
258235,
176316,
307388,
307390,
184503,
299200,
307394,
307396,
299204,
184518,
307399,
323784,
233679,
307409,
307411,
299225,
233701,
307432,
282881,
282893,
323854,
291089,
282906,
291104,
233766,
295583,
307508,
315701,
307510,
332086,
307512,
307515,
282942,
307518,
282947,
323917,
110926,
282957,
233808,
323921,
315733,
323926,
233815,
276052,
315739,
299357,
242018,
242024,
299373,
315757,
250231,
242043,
315771,
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,
176592,
315856,
315860,
176597,
127447,
283095,
299481,
176605,
242143,
127457,
291299,
340454,
127463,
242152,
291305,
127466,
176620,
127469,
127474,
291314,
291317,
135672,
233979,
291323,
127485,
291330,
283142,
127494,
127497,
233994,
135689,
233998,
127506,
234003,
234006,
152087,
127511,
283161,
242202,
234010,
135707,
242206,
135710,
242208,
291361,
242220,
291378,
234038,
152118,
234041,
315961,
70213,
242250,
111193,
242275,
299620,
242279,
168562,
184952,
135805,
291456,
135808,
373383,
135820,
316051,
225941,
316054,
299672,
135834,
373404,
299677,
135839,
299680,
225954,
135844,
299684,
242343,
209576,
242345,
373421,
135870,
135873,
135876,
135879,
299720,
299723,
299726,
225998,
226002,
119509,
226005,
226008,
201444,
299750,
283368,
234219,
283372,
185074,
226037,
283382,
316151,
234231,
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,
291714,
234373,
226182,
234375,
291716,
308105,
226185,
234379,
324490,
234384,
234388,
234390,
324504,
234393,
209818,
308123,
324508,
234396,
291742,
226200,
234398,
234401,
291747,
291748,
234405,
291750,
234407,
324518,
324520,
234410,
324522,
226220,
291756,
291754,
324527,
291760,
234417,
201650,
324531,
234414,
234422,
226230,
275384,
324536,
234428,
291773,
234431,
242623,
324544,
324546,
234434,
324548,
226245,
234437,
234439,
226239,
234443,
291788,
234446,
275406,
193486,
234449,
316370,
193488,
234452,
234455,
234459,
234461,
234464,
234467,
234470,
168935,
5096,
324585,
234475,
234478,
316400,
234481,
316403,
234484,
234485,
324599,
234487,
234490,
234493,
234496,
316416,
308226,
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,
160835,
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,
226453,
275606,
234647,
275608,
308373,
234650,
324757,
308379,
234653,
324766,
119967,
300189,
234648,
283805,
234657,
242852,
234661,
283813,
177318,
234664,
300197,
275626,
234667,
316596,
308414,
234687,
300223,
300226,
308418,
226500,
234692,
300229,
308420,
283844,
308422,
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,
300289,
292097,
161027,
300292,
300294,
275719,
234760,
177419,
300299,
283917,
300301,
349451,
177424,
242957,
275725,
349464,
415009,
283939,
259367,
292143,
283951,
300344,
243003,
283963,
226628,
283973,
300357,
177482,
283983,
316758,
357722,
316766,
292192,
316768,
218464,
292197,
316774,
218473,
284010,
136562,
324978,
275834,
333178,
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,
144837,
38342,
144839,
144841,
144844,
144847,
144852,
144855,
103899,
300507,
333280,
226787,
218597,
292329,
300523,
259565,
300527,
308720,
259567,
226802,
292338,
316917,
308727,
292343,
300537,
316933,
316947,
308757,
308762,
284191,
284194,
284196,
235045,
284199,
284204,
284206,
284209,
284211,
284213,
308790,
284215,
316983,
194103,
284218,
226877,
292414,
284223,
284226,
243268,
292421,
226886,
284231,
128584,
284228,
284234,
276043,
317004,
366155,
284238,
226895,
284241,
194130,
284243,
300628,
284245,
276053,
284247,
317015,
284249,
243290,
284251,
235097,
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,
292485,
292479,
276098,
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,
358126,
284399,
358128,
276206,
358133,
358135,
276216,
358138,
300795,
358140,
284413,
358142,
358146,
317187,
284418,
317189,
317191,
284428,
300816,
300819,
317207,
284440,
300828,
300830,
276255,
325408,
300832,
300834,
317221,
227109,
358183,
276268,
300845,
243504,
300850,
284469,
276280,
325436,
358206,
276291,
366406,
276295,
153417,
292681,
358224,
276308,
284502,
317271,
178006,
276315,
292700,
284511,
317279,
227175,
292715,
300912,
284529,
292721,
300915,
292729,
317306,
284540,
292734,
325512,
276365,
284564,
358292,
399252,
317332,
284566,
350106,
284572,
276386,
284579,
276388,
358312,
284585,
317353,
276395,
292784,
358326,
161718,
276410,
276411,
358330,
276418,
301009,
301011,
301013,
292823,
301015,
301017,
358360,
292828,
276446,
153568,
276448,
276452,
276455,
292839,
350186,
292843,
276460,
292845,
276464,
178161,
227314,
276466,
325624,
350200,
276472,
317435,
276476,
276479,
276482,
350210,
276485,
317446,
178181,
276490,
350218,
292876,
350222,
276496,
317456,
317458,
178195,
243733,
317468,
243740,
317472,
325666,
243751,
292904,
276528,
178224,
243762,
309298,
325685,
325689,
235579,
325692,
235581,
178238,
276539,
276544,
243779,
284739,
325700,
292934,
243785,
276553,
350293,
350295,
194649,
227418,
309337,
350299,
350302,
227423,
194654,
178273,
194657,
227426,
194660,
276579,
227430,
276583,
309346,
309348,
309350,
309352,
309354,
350308,
276590,
350313,
350316,
350321,
284786,
276595,
301167,
350325,
227440,
350328,
292985,
301178,
350332,
292989,
292993,
301185,
350339,
317570,
317573,
350342,
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,
309455,
276689,
309462,
301272,
309468,
194780,
309471,
301283,
317672,
317674,
325867,
309491,
227571,
309494,
243960,
276735,
227583,
227587,
276739,
276742,
227593,
227596,
325910,
309530,
342298,
211232,
317729,
276775,
211241,
325937,
325943,
211260,
260421,
276809,
285002,
276811,
235853,
235858,
276829,
276833,
391523,
276836,
276843,
293227,
276848,
293232,
186744,
211324,
227709,
285061,
366983,
317833,
178572,
285070,
285077,
227738,
317853,
276896,
317858,
342434,
285093,
317864,
285098,
276907,
235955,
276917,
293304,
293307,
293314,
309707,
293325,
129486,
317910,
293336,
235996,
317917,
293343,
358880,
276961,
227810,
293346,
276964,
293352,
236013,
293364,
293370,
301562,
317951,
309764,
301575,
121352,
236043,
342541,
113167,
317971,
309779,
309781,
277011,
227877,
227879,
293417,
227882,
309804,
293421,
105007,
236082,
23094,
277054,
219714,
129603,
318020,
301636,
301639,
301643,
277071,
285265,
399955,
309844,
277080,
309849,
285277,
285282,
326244,
318055,
277100,
121458,
277106,
170619,
309885,
309888,
277122,
277128,
285320,
301706,
318092,
326285,
318094,
334476,
277136,
277139,
227992,
334488,
285340,
318108,
227998,
318110,
137889,
383658,
285357,
318128,
277170,
342707,
154292,
293555,
318132,
277173,
285368,
277177,
277181,
318144,
277187,
277191,
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,
293666,
285474,
228135,
318248,
277291,
293677,
318253,
285489,
301876,
293685,
285494,
301880,
301884,
310080,
293696,
277317,
277322,
293706,
162643,
310100,
301911,
301913,
277337,
301921,
400236,
236397,
162671,
310134,
15224,
236408,
277368,
416639,
416640,
113538,
310147,
416648,
39817,
187274,
277385,
301972,
424853,
277405,
277411,
310179,
293798,
293802,
236460,
277426,
293811,
293817,
293820,
203715,
326603,
342994,
276586,
293849,
293861,
228327,
228328,
228330,
318442,
228332,
277486,
326638,
351217,
318450,
293876,
293877,
285686,
302073,
285690,
121850,
293882,
302075,
244731,
293887,
277504,
277507,
277511,
293899,
277519,
293908,
302105,
293917,
293939,
318516,
277561,
277564,
310336,
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,
285821,
302205,
392326,
285831,
253064,
294026,
302218,
285835,
384148,
162964,
187542,
302231,
285849,
302233,
285852,
302237,
285854,
285856,
302241,
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,
64768,
310531,
285958,
138505,
228617,
318742,
204067,
277798,
130345,
113964,
285997,
384302,
285999,
113969,
318773,
318776,
286010,
417086,
286016,
294211,
302403,
384328,
146765,
294221,
326991,
294223,
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,
64966,
245191,
163272,
302534,
310727,
292968,
302541,
302543,
310737,
228825,
163290,
310749,
310755,
187880,
310764,
286188,
310772,
40440,
212472,
40443,
286203,
40448,
228864,
286214,
228871,
302603,
65038,
302614,
286233,
302617,
302621,
187936,
146977,
187939,
40484,
294435,
286246,
40486,
245288,
278057,
40488,
294439,
40491,
294440,
294443,
310831,
294445,
40499,
40502,
212538,
40507,
40511,
40513,
228933,
327240,
40521,
286283,
40525,
40527,
212560,
228944,
400976,
40533,
147032,
40537,
40539,
40541,
278109,
40544,
40548,
40550,
40552,
286313,
40554,
286312,
310892,
40557,
40560,
294521,
343679,
294537,
310925,
286354,
278163,
302740,
122517,
278168,
179870,
327333,
229030,
278188,
302764,
278192,
319153,
278196,
302781,
319171,
302789,
294599,
278216,
294601,
302793,
343757,
212690,
278227,
286420,
319187,
229076,
286425,
319194,
278235,
301163,
278238,
229086,
294625,
294634,
302838,
319226,
286460,
278274,
302852,
278277,
302854,
294664,
311048,
352008,
319243,
311053,
302862,
319251,
294682,
278306,
188199,
294701,
278320,
319280,
319290,
229192,
302925,
188247,
188252,
237409,
229233,
294776,
360317,
294785,
327554,
360322,
40851,
294811,
319390,
237470,
294817,
319394,
40865,
294821,
311209,
180142,
294831,
188340,
40886,
319419,
294844,
294847,
393177,
294876,
294879,
294883,
393190,
311279,
278513,
237555,
278516,
311283,
278519,
237562
] |
cb33dfb0a66e13aab845d0370d28bf7a47e1deb1 | 304f6826a1feebfcbfd598674f3a93eea1c3fb2c | /iOS/DesignPatternsSample/DesignPatternsSample/WebService.swift | 0faeb9b3042fff9b26a2bca75da87fe3d7cf79e2 | [] | no_license | stcalica/design-patterns-sample | efa08ca9aefe756c3ab1b2da74b435f5fd772511 | e519bd6a35bdeeccded73d4d119000bbddb961df | refs/heads/master | 2020-04-12T00:56:05.572920 | 2015-10-03T16:39:51 | 2015-10-03T16:39:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 2,338 | swift | //
// WebService.swift
// DesignPatternsSample
//
// Created by Metova on ___DATE___.
// Copyright (c) 2015 Metova. All rights reserved.
//
import Foundation
// Pattern Example: Singleton
/*
Check list from https://sourcemaking.com/design_patterns/singleton
1. Define a private static attribute in the "single instance" class.
2. Define a public static accessor function in the class.
These two steps are achieved in Swift using a single static `let` constant for "sharedInstance". It has the default access level of "internal" which makes it available to any class in the module. If we were writing a framework, we would want to declare sharedInstance as public as well as the ModelParser class itself.
3. Do "lazy initialization" (creation on first use) in the accessor function.
Swift lazily initializes class constants (and variables) in a dispatch_once block. The dispatch_once block also makes it thread safe which, along with the use of the `let` keyword, ensures that one and only one instance of the class will exist.
4. Define all constructors to be protected or private.
The default init constructor is declared as private.
5. Clients may only use the accessor function to manipulate the Singleton.
sharedInstance is declared as a let constant. It's value can never be changed.
*/
class WebService {
// MARK: Singleton
static let sharedInstance = WebService()
private init() {}
// MARK: Properties
private let sessionManager = AFHTTPSessionManager(baseURL: NSURL(string: kBaseURL))
// MARK: Methods
func retrieveRestaurants(completion: (json: [String: AnyObject]) -> ()) {
// We're just mocking a network request for this example:
let delayTime = dispatch_time(DISPATCH_TIME_NOW, Int64(2.0 * Double(NSEC_PER_SEC)))
dispatch_after(delayTime, dispatch_get_main_queue(), {
if let filePath = NSBundle.mainBundle().pathForResource("hot_chicken", ofType: "json"),
let data = NSData(contentsOfFile: filePath) {
let json = try! NSJSONSerialization.JSONObjectWithData(data, options: NSJSONReadingOptions.AllowFragments)
completion(json: (json as! [String: AnyObject]))
}
})
}
}
| [
-1
] |
970085335429fb42d7263245725a340279c1da84 | 4580d4efcd7d01cb4318e0816e06a380c605f65a | /GoogleSignInTest/Classes/Controllers/RootViewControllers/TabbarVC.swift | c382c560ddf05ad15e794329dd748dd60111328b | [] | no_license | rybachenko2206/GoogleSignInTest | ee3508ca3faad4c703fffa93db6a8722d38a7438 | 990cbabbad99b689a0c370c1d0a0074210d73488 | refs/heads/master | 2021-01-08T18:17:59.304233 | 2020-02-26T13:04:09 | 2020-02-26T13:04:09 | 242,105,222 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 432 | swift | //
// TabbarVC.swift
// GoogleSignInTest
//
// Created by Roman Rybachenko on 21.02.2020.
// Copyright © 2020 Roman Rybachenko. All rights reserved.
//
import UIKit
class TabbarVC: UITabBarController, Storyboardable {
enum TabbarItems: Int {
case points, map, profile
}
static var storyboardName: Storyboard {
return .tabbar
}
var userDidSignOut: (() -> Void)?
}
| [
-1
] |
0e20e8fd2f707179101be8e0adbb5a0dfdb155cc | 23032cd71a0717cb5100672c91c0141f3e46ee11 | /UIAnimation/ViewController.swift | 604ed9d118fbb7d3c8cbebcbef784eb7d3fec496 | [] | no_license | EmmettH1136/UIAnimation | f19c198f433d11bbc7aa28eb2a3a210f8d88c6db | 9bde2ac8b0d59b75dfdd03cf4e970be8ecb8c8c6 | refs/heads/master | 2020-04-29T18:29:50.143438 | 2019-03-18T16:24:17 | 2019-03-18T16:24:17 | 176,325,727 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 535 | swift | //
// ViewController.swift
// UIAnimation
//
// Created by Emmett Hasley on 3/18/19.
// Copyright © 2019 John Heresy High School. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
var square1: UIView?
var square2: UIView?
var animator: UIDynamicAnimator?
override func viewDidLoad() {
super.viewDidLoad()
var colors = [UIColor.red, .blue, .green, .yellow, .purple, .orange, .cyan, .magenta, .brown, .black]
// Creating Random Shapes
}
}
| [
-1
] |
bffeee6676c0ce8a16d16e3a22da3510db4b5ebf | 353560ef513ca784efc3f78b29581f44f52a160a | /DarkSlide/ManagedObject.swift | b13b239472f7e9a8a4739dcedef4d31a12e490d7 | [] | no_license | Cal-um/DarkSlide | 3d0dca48b05e105d4b345495f6988694687c37c6 | 77f339e3dbf647558efc24e85f7e7b66b6cdf8a4 | refs/heads/master | 2020-12-28T23:24:00.692699 | 2016-12-17T11:19:01 | 2016-12-17T11:19:01 | 68,396,938 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,161 | swift | //
// ManagedObject.swift
// DarkSlide
//
// Created by Calum Harris on 16/09/2016.
// Copyright © 2016 Calum Harris. All rights reserved.
//
import Foundation
import CoreData
public class ManagedObject: NSManagedObject {
}
public protocol ManagedObjectType: class {
static var entityName: String { get }
}
// swiftlint:disable force_try
extension ManagedObjectType where Self: ManagedObject {
static public func findInContext(_ moc: NSManagedObjectContext, matchingPredicate predicate: NSCompoundPredicate) -> Self? {
for obj in moc.registeredObjects where !obj.isFault {
print("checking")
print(obj)
guard let res = obj as? Self, predicate.evaluate(with: res) else { continue }
print(res)
return res
}
return nil
}
public static func fetchInContext(_ context: NSManagedObjectContext, configurationBlock: (NSFetchRequest<NSFetchRequestResult>) -> () = { _ in }) -> [Self] {
let request = NSFetchRequest<NSFetchRequestResult>(entityName: Self.entityName)
configurationBlock(request)
guard let result = try! context.fetch(request) as? [Self] else { fatalError("Fetched objects have wrong type") }
return result
}
}
| [
-1
] |
2ea05bcdefe3db172c2c056a3d37f162e982ffa6 | 89e2c8c212d18f5f4e8833f5b30370eef332f037 | /Structify/Classes/Structify.swift | 044eed5b947aa681608cfe4b630b3693cc016aa8 | [
"MIT"
] | permissive | capecrawler/Structify | 97686481e642986417ee6ff931146dadfa761bff | bc8ef635cb3fbff24dee5200d2979386aa450dea | refs/heads/master | 2023-06-17T18:49:36.482133 | 2019-06-09T11:08:26 | 2019-06-09T11:08:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 7,177 | swift | //
// Structify.swift
// StrVsObj
//
// Created by Artur Mkrtchyan on 1/31/19.
// Copyright © 2019 arturdev. All rights reserved.
//
import Foundation
import Reflection
#if canImport(RealmSwift)
import RealmSwift
import Realm
#endif
public protocol SelfAware: class {
static func awake()
}
@objc open class Structify: NSObject {
@objc public static func go() {
if !classNames.isEmpty {
return
}
let typeCount = Int(objc_getClassList(nil, 0))
let types = UnsafeMutablePointer<AnyClass?>.allocate(capacity: typeCount)
let safeTypes = AutoreleasingUnsafeMutablePointer<AnyClass>(types)
objc_getClassList(safeTypes, Int32(typeCount))
for index in 0 ..< typeCount {
if let C = (types[index] as? SelfAware.Type) {
C.awake()
classNames.append(NSStringFromClass(C))
}
}
types.deallocate()
}
static func convert<T: NSObject>(val: Any, to objectType: T.Type) -> AnyObject {
let mirror = Mirror(reflecting: val)
let children = mirror.children
let obj = objectType.init()
children.filter({$0.label != nil}).forEach({
let label = $0.label!
let value = $0.value
if value is ObjectConvertibleBase {
guard let className = propertyClassName(label, objectType) else {return}
let fullClassName = classNames.first(where: {$0.contains(className)}) ?? className
guard let c = NSClassFromString(fullClassName) as? NSObject.Type else {return}
let o = convert(val: value, to: c)
if obj.responds(to: NSSelectorFromString(label)) {
obj.setValue(o, forKey: label)
}
} else {
if obj.responds(to: NSSelectorFromString(label)) {
if let values = value as? [Any] {
#if canImport(RealmSwift)
let realmArray = obj.value(forKey: label) as? RLMArray<AnyObject>
values.forEach({value in
if value is ObjectConvertibleBase {
guard let className = realmArray?.objectClassName else {return}
let fullClassName = classNames.first(where: {$0.contains(className)}) ?? className
guard let c = NSClassFromString(fullClassName) as? NSObject.Type else {return}
let o = convert(val: value, to: c)
realmArray?.add(o)
} else {
realmArray?.add(value as AnyObject)
}
})
#else
obj.setValue(value, forKey: label)
#endif
} else {
obj.setValue(value, forKey: label)
}
}
}
})
return obj
}
private override init() {}
fileprivate static var classNames: [String] = []
}
public protocol ObjectConvertibleBase {
func getType() -> String
func objectType() -> StructConvertibleBase.Type
init()
mutating func readValues(from object: StructConvertibleBase)
static func ignoredProperties() -> [String]
}
public extension ObjectConvertibleBase {
public static func ignoredProperties() -> [String] {
return []
}
}
public protocol ObjectConvertible:ObjectConvertibleBase {
associatedtype ClassType: NSObject, StructConvertible
}
public extension ObjectConvertible {
public func toObject() -> ClassType {
let obj = Structify.convert(val: self, to: ClassType.self) as! ClassType //ClassType()
return obj
}
func getType() -> String {
return String(describing: ClassType.self)
}
func objectType() -> StructConvertibleBase.Type {
return ClassType.self
}
mutating func readValues(from object: StructConvertibleBase) {
let obj = object as! NSObject
let mirror = Mirror(reflecting: self)
let children = mirror.children
for child in children {
guard let propertyName = child.label else {continue}
guard obj.responds(to: NSSelectorFromString(propertyName)) else {continue}
guard let value = obj.value(forKey: propertyName) else {continue}
if let value = value as? StructConvertibleBase {
var childValue = child.value as? ObjectConvertibleBase
if childValue == nil {
childValue = (type(of: child.value) as! ObjectConvertibleBase.Type).init()
}
childValue!.readValues(from: value)
do {
try set(childValue!, key: propertyName, for: &self)
}
catch {
print(error)
}
} else {
do {
if value is NSFastEnumeration {
#if canImport(RealmSwift)
var selfArray: [Any] = (try? get(propertyName, from: self)) ?? []
let realmArray = value as! RLMArray<AnyObject>
for i in 0..<realmArray.count {
let o = realmArray[i]
if let sc = o as? StructConvertibleBase {
var scVal = sc.structType().init()
scVal.readValues(from: sc)
selfArray.append(scVal)
print(sc)
} else {
selfArray.append(o)
}
}
try set(selfArray, key: propertyName, for: &self)
#else
try set(value, key: propertyName, for: &self)
#endif
} else {
try set(value, key: propertyName, for: &self)
}
}
catch {
print(error)
}
}
}
}
}
public protocol StructConvertibleBase: SelfAware {
func structType() -> ObjectConvertibleBase.Type
}
public protocol StructConvertible: StructConvertibleBase {
associatedtype StructType: ObjectConvertible
}
public extension StructConvertible where Self: NSObject {
static func awake() {
let obj = StructType()
mirrorProperties(of: obj, to: self, ignoreProperties: StructType.ignoredProperties())
}
public func toStruct() -> StructType {
var val = StructType()
val.readValues(from: self)
return val
}
func structType() -> ObjectConvertibleBase.Type {
return StructType.self
}
}
| [
-1
] |
5b97244e85f2a5d836bd995b9d3e9e9082e67844 | fdaddf3a2fbc7ad5890ca8113a0ca2fa2a281869 | /Sources/Model/admissionregistration/v1/MutatingWebhook+admissionregistration.v1.swift | 47ff0152eca6bca04bd61648b2773c722adc751f | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | ydataai/SwiftKubeModel | de71c678385818042455f9e12706c20feb629f44 | 9377c53f7b9378168b6d7f07179cf72165239511 | refs/heads/main | 2023-08-18T10:24:27.665359 | 2021-08-02T23:53:56 | 2021-08-03T12:58:20 | 409,396,420 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 11,273 | swift | //
// Copyright 2020 Swiftkube Project
//
// 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.
//
///
/// Generated by Swiftkube:ModelGen
/// Kubernetes v1.20.9
/// admissionregistration.v1.MutatingWebhook
///
import Foundation
public extension admissionregistration.v1 {
///
/// MutatingWebhook describes an admission webhook and the resources and operations it applies to.
///
struct MutatingWebhook: KubernetesResource {
///
/// AdmissionReviewVersions is an ordered list of preferred `AdmissionReview` versions the Webhook expects. API server will try to use first version in the list which it supports. If none of the versions specified in this list supported by API server, validation will fail for this object. If a persisted webhook configuration specifies allowed versions and does not include any versions known to the API Server, calls to the webhook will fail and be subject to the failure policy.
///
public var admissionReviewVersions: [String]
///
/// ClientConfig defines how to communicate with the hook. Required
///
public var clientConfig: admissionregistration.v1.WebhookClientConfig
///
/// FailurePolicy defines how unrecognized errors from the admission endpoint are handled - allowed values are Ignore or Fail. Defaults to Fail.
///
public var failurePolicy: String?
///
/// matchPolicy defines how the "rules" list is used to match incoming requests. Allowed values are "Exact" or "Equivalent".
///
/// - Exact: match a request only if it exactly matches a specified rule. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, but "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`, a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the webhook.
///
/// - Equivalent: match a request if modifies a resource listed in rules, even via another API group or version. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, and "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`, a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the webhook.
///
/// Defaults to "Equivalent"
///
public var matchPolicy: String?
///
/// The name of the admission webhook. Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where "imagepolicy" is the name of the webhook, and kubernetes.io is the name of the organization. Required.
///
public var name: String
///
/// NamespaceSelector decides whether to run the webhook on an object based on whether the namespace for that object matches the selector. If the object itself is a namespace, the matching is performed on object.metadata.labels. If the object is another cluster scoped resource, it never skips the webhook.
///
/// For example, to run the webhook on any objects whose namespace is not associated with "runlevel" of "0" or "1"; you will set the selector as follows: "namespaceSelector": {
/// "matchExpressions": [
/// {
/// "key": "runlevel",
/// "operator": "NotIn",
/// "values": [
/// "0",
/// "1"
/// ]
/// }
/// ]
/// }
///
/// If instead you want to only run the webhook on any objects whose namespace is associated with the "environment" of "prod" or "staging"; you will set the selector as follows: "namespaceSelector": {
/// "matchExpressions": [
/// {
/// "key": "environment",
/// "operator": "In",
/// "values": [
/// "prod",
/// "staging"
/// ]
/// }
/// ]
/// }
///
/// See https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ for more examples of label selectors.
///
/// Default to the empty LabelSelector, which matches everything.
///
public var namespaceSelector: meta.v1.LabelSelector?
///
/// ObjectSelector decides whether to run the webhook based on if the object has matching labels. objectSelector is evaluated against both the oldObject and newObject that would be sent to the webhook, and is considered to match if either object matches the selector. A null object (oldObject in the case of create, or newObject in the case of delete) or an object that cannot have labels (like a DeploymentRollback or a PodProxyOptions object) is not considered to match. Use the object selector only if the webhook is opt-in, because end users may skip the admission webhook by setting the labels. Default to the empty LabelSelector, which matches everything.
///
public var objectSelector: meta.v1.LabelSelector?
///
/// reinvocationPolicy indicates whether this webhook should be called multiple times as part of a single admission evaluation. Allowed values are "Never" and "IfNeeded".
///
/// Never: the webhook will not be called more than once in a single admission evaluation.
///
/// IfNeeded: the webhook will be called at least one additional time as part of the admission evaluation if the object being admitted is modified by other admission plugins after the initial webhook call. Webhooks that specify this option *must* be idempotent, able to process objects they previously admitted. Note: * the number of additional invocations is not guaranteed to be exactly one. * if additional invocations result in further modifications to the object, webhooks are not guaranteed to be invoked again. * webhooks that use this option may be reordered to minimize the number of additional invocations. * to validate an object after all mutations are guaranteed complete, use a validating admission webhook instead.
///
/// Defaults to "Never".
///
public var reinvocationPolicy: String?
///
/// Rules describes what operations on what resources/subresources the webhook cares about. The webhook cares about an operation if it matches _any_ Rule. However, in order to prevent ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks from putting the cluster in a state which cannot be recovered from without completely disabling the plugin, ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks are never called on admission requests for ValidatingWebhookConfiguration and MutatingWebhookConfiguration objects.
///
public var rules: [admissionregistration.v1.RuleWithOperations]?
///
/// SideEffects states whether this webhook has side effects. Acceptable values are: None, NoneOnDryRun (webhooks created via v1beta1 may also specify Some or Unknown). Webhooks with side effects MUST implement a reconciliation system, since a request may be rejected by a future step in the admission change and the side effects therefore need to be undone. Requests with the dryRun attribute will be auto-rejected if they match a webhook with sideEffects == Unknown or Some.
///
public var sideEffects: String
///
/// TimeoutSeconds specifies the timeout for this webhook. After the timeout passes, the webhook call will be ignored or the API call will fail based on the failure policy. The timeout value must be between 1 and 30 seconds. Default to 10 seconds.
///
public var timeoutSeconds: Int32?
///
/// Default memberwise initializer
///
public init(
admissionReviewVersions: [String],
clientConfig: admissionregistration.v1.WebhookClientConfig,
failurePolicy: String? = nil,
matchPolicy: String? = nil,
name: String,
namespaceSelector: meta.v1.LabelSelector? = nil,
objectSelector: meta.v1.LabelSelector? = nil,
reinvocationPolicy: String? = nil,
rules: [admissionregistration.v1.RuleWithOperations]? = nil,
sideEffects: String,
timeoutSeconds: Int32? = nil
) {
self.admissionReviewVersions = admissionReviewVersions
self.clientConfig = clientConfig
self.failurePolicy = failurePolicy
self.matchPolicy = matchPolicy
self.name = name
self.namespaceSelector = namespaceSelector
self.objectSelector = objectSelector
self.reinvocationPolicy = reinvocationPolicy
self.rules = rules
self.sideEffects = sideEffects
self.timeoutSeconds = timeoutSeconds
}
}
}
///
/// Codable conformance
///
public extension admissionregistration.v1.MutatingWebhook {
private enum CodingKeys: String, CodingKey {
case admissionReviewVersions = "admissionReviewVersions"
case clientConfig = "clientConfig"
case failurePolicy = "failurePolicy"
case matchPolicy = "matchPolicy"
case name = "name"
case namespaceSelector = "namespaceSelector"
case objectSelector = "objectSelector"
case reinvocationPolicy = "reinvocationPolicy"
case rules = "rules"
case sideEffects = "sideEffects"
case timeoutSeconds = "timeoutSeconds"
}
init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
self.admissionReviewVersions = try container.decode([String].self, forKey: .admissionReviewVersions)
self.clientConfig = try container.decode(admissionregistration.v1.WebhookClientConfig.self, forKey: .clientConfig)
self.failurePolicy = try container.decodeIfPresent(String.self, forKey: .failurePolicy)
self.matchPolicy = try container.decodeIfPresent(String.self, forKey: .matchPolicy)
self.name = try container.decode(String.self, forKey: .name)
self.namespaceSelector = try container.decodeIfPresent(meta.v1.LabelSelector.self, forKey: .namespaceSelector)
self.objectSelector = try container.decodeIfPresent(meta.v1.LabelSelector.self, forKey: .objectSelector)
self.reinvocationPolicy = try container.decodeIfPresent(String.self, forKey: .reinvocationPolicy)
self.rules = try container.decodeIfPresent([admissionregistration.v1.RuleWithOperations].self, forKey: .rules)
self.sideEffects = try container.decode(String.self, forKey: .sideEffects)
self.timeoutSeconds = try container.decodeIfPresent(Int32.self, forKey: .timeoutSeconds)
}
func encode(to encoder: Encoder) throws {
var encodingContainer = encoder.container(keyedBy: CodingKeys.self)
try encodingContainer.encode(admissionReviewVersions, forKey: .admissionReviewVersions)
try encodingContainer.encode(clientConfig, forKey: .clientConfig)
try encodingContainer.encode(failurePolicy, forKey: .failurePolicy)
try encodingContainer.encode(matchPolicy, forKey: .matchPolicy)
try encodingContainer.encode(name, forKey: .name)
try encodingContainer.encode(namespaceSelector, forKey: .namespaceSelector)
try encodingContainer.encode(objectSelector, forKey: .objectSelector)
try encodingContainer.encode(reinvocationPolicy, forKey: .reinvocationPolicy)
try encodingContainer.encode(rules, forKey: .rules)
try encodingContainer.encode(sideEffects, forKey: .sideEffects)
try encodingContainer.encode(timeoutSeconds, forKey: .timeoutSeconds)
}
}
| [
-1
] |
b065d16128d8fa9f6039ca2fa57890e7c999ed3a | 0a0170f8a9e2113743289bbe46ebe06b5b48e733 | /SMART Planning/Screens/EditNotificationsView/NotificationSettingsViewModel.swift | 4b22a58226ce1d846f0012e4817fa1c65fe28889 | [] | no_license | MrRonanX/SMART-Planning | 88d05930926ea67b5270a6a6e6e98363897738b9 | 51abd85ed93fd94dbc6b82525299027de73d4b6d | refs/heads/main | 2023-08-25T05:49:27.781752 | 2021-09-26T13:59:58 | 2021-09-26T13:59:58 | 381,253,450 | 1 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,710 | swift | //
// NotificationSettingViewModel.swift
// SMART Planning
//
// Created by Roman Kavinskyi on 9/22/21.
//
import Foundation
extension NotificationSettings {
final class NotificationSettingsViewModel: ObservableObject {
@Published var notificationTime = Date()
@Published var goal: GoalModel
@Published var notificationIsOn: Bool {
didSet {
goal.goal.allowNotifications = notificationIsOn
if notificationIsOn { setNotificationTime(notificationTime) }
}
}
var status: String {
notificationIsOn ? "on" : "off"
}
init(goal: GoalModel) {
self.goal = goal
notificationIsOn = goal.goal.allowNotifications
guard notificationIsOn else { return }
notificationTime = Calendar.current.date(from: DateComponents(hour: goal.goal.notification?.wrappedHour, minute: goal.goal.notification?.wrappedMinute)) ?? Date()
}
func setNotificationTime(_ time: Date) {
let hour = Calendar.current.component(.hour, from: time)
let minute = Calendar.current.component(.minute, from: time)
var notification = goal.goal.notification
if notification == nil {
notification = NotificationTime(context: PersistenceManager.shared.viewContext)
}
notification?.hour = Int16(hour)
notification?.minute = Int16(minute)
if notification?.goal == nil {
goal.goal.notification = notification
}
}
}
}
| [
-1
] |
85d921e8472367119b2ca085fb3493234f138a77 | 86fa3a0afa6a9e5720de09df36a4085261f003ab | /Salsette/API.swift | 4448451bfa559c431644842d2cf5315bd1f15ca0 | [] | no_license | wahello/Salsette | 5f6f0750e548199a179f1e8704de6cb010474208 | 77cf1cac1c91031e2cf16ff4218631680f0fb06d | refs/heads/master | 2020-03-23T03:36:02.721525 | 2017-11-08T16:19:28 | 2017-11-08T16:19:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 93,679 | swift | // This file was automatically generated and should not be edited.
import Apollo
public struct LoginUserWithAuth0SocialInput: GraphQLMapConvertible {
public var graphQLMap: GraphQLMap
public init(accessToken: String, connection: ConnectionType, clientMutationId: Optional<String?> = nil) {
graphQLMap = ["access_token": accessToken, "connection": connection, "clientMutationId": clientMutationId]
}
/// The access token of the the social authentication connection. This should be
/// obtained via an SDK through connections like Facebook, Twitter, or Google.
public var accessToken: String {
get {
return graphQLMap["accessToken"] as! String
}
set {
graphQLMap.updateValue(newValue, forKey: "accessToken")
}
}
/// The social connection name (i.e. Facebook, Google, Twitter, etc...).
public var connection: ConnectionType {
get {
return graphQLMap["connection"] as! ConnectionType
}
set {
graphQLMap.updateValue(newValue, forKey: "connection")
}
}
/// An opaque string used by frontend frameworks like relay to track requests and responses.
public var clientMutationId: Optional<String?> {
get {
return graphQLMap["clientMutationId"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "clientMutationId")
}
}
}
/// Values for the ConnectionType enum
public enum ConnectionType: String, Apollo.JSONDecodable, Apollo.JSONEncodable {
case ad = "ad"
case adfs = "adfs"
case amazon = "amazon"
case dropbox = "dropbox"
case bitbucket = "bitbucket"
case aol = "aol"
case auth0Adldap = "auth0_adldap"
case auth0Oidc = "auth0_oidc"
case auth0 = "auth0"
case baidu = "baidu"
case bitly = "bitly"
case box = "box"
case custom = "custom"
case dwolla = "dwolla"
case email = "email"
case evernoteSandbox = "evernote_sandbox"
case evernote = "evernote"
case exact = "exact"
case facebook = "facebook"
case fitbit = "fitbit"
case flickr = "flickr"
case github = "github"
case googleApps = "google_apps"
case googleOauth2 = "google_oauth2"
case guardian = "guardian"
case instagram = "instagram"
case ip = "ip"
case linkedin = "linkedin"
case miicard = "miicard"
case oauth1 = "oauth1"
case oauth2 = "oauth2"
case office365 = "office365"
case paypal = "paypal"
case pingfederate = "pingfederate"
case planningcenter = "planningcenter"
case renren = "renren"
case salesforceCommunity = "salesforce_community"
case salesforceSandbox = "salesforce_sandbox"
case salesforce = "salesforce"
case samlp = "samlp"
case sharepoint = "sharepoint"
case shopify = "shopify"
case sms = "sms"
case soundcloud = "soundcloud"
case thecitySandbox = "thecity_sandbox"
case thecity = "thecity"
case thirtysevensignals = "thirtysevensignals"
case twitter = "twitter"
case untappd = "untappd"
case vkontakte = "vkontakte"
case waad = "waad"
case weibo = "weibo"
case windowslive = "windowslive"
case wordpress = "wordpress"
case yahoo = "yahoo"
case yammer = "yammer"
case yandex = "yandex"
}
public struct LoginUserWithAuth0Input: GraphQLMapConvertible {
public var graphQLMap: GraphQLMap
public init(idToken: String, clientMutationId: Optional<String?> = nil) {
graphQLMap = ["idToken": idToken, "clientMutationId": clientMutationId]
}
public var idToken: String {
get {
return graphQLMap["idToken"] as! String
}
set {
graphQLMap.updateValue(newValue, forKey: "idToken")
}
}
/// An opaque string used by frontend frameworks like relay to track requests and responses.
public var clientMutationId: Optional<String?> {
get {
return graphQLMap["clientMutationId"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "clientMutationId")
}
}
}
public struct CreateEventInput: GraphQLMapConvertible {
public var graphQLMap: GraphQLMap
public init(fbId: Optional<String?> = nil, type: Dance, clientMutationId: Optional<GraphQLID?> = nil) {
graphQLMap = ["fbID": fbId, "type": type, "clientMutationId": clientMutationId]
}
public var fbId: Optional<String?> {
get {
return graphQLMap["fbId"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "fbId")
}
}
public var type: Dance {
get {
return graphQLMap["type"] as! Dance
}
set {
graphQLMap.updateValue(newValue, forKey: "type")
}
}
public var clientMutationId: Optional<GraphQLID?> {
get {
return graphQLMap["clientMutationId"] as! Optional<GraphQLID?>
}
set {
graphQLMap.updateValue(newValue, forKey: "clientMutationId")
}
}
}
/// Values for the Dance enum
public enum Dance: String, Apollo.JSONDecodable, Apollo.JSONEncodable {
case salsa = "Salsa"
case bachata = "Bachata"
case kizomba = "Kizomba"
case tango = "Tango"
case dance = "Dance"
}
/// Where filter arguments for the Event type
public struct EventWhereArgs: GraphQLMapConvertible {
public var graphQLMap: GraphQLMap
public init(modifiedAt: Optional<EventModifiedAtWhereArgs?> = nil, fbId: Optional<EventFbIdWhereArgs?> = nil, id: Optional<EventIdWhereArgs?> = nil, createdAt: Optional<EventCreatedAtWhereArgs?> = nil, workshops: Optional<WorkshopWhereArgs?> = nil, type: Optional<EventTypeWhereArgs?> = nil, or: Optional<[EventWhereArgs?]?> = nil, and: Optional<[EventWhereArgs?]?> = nil) {
graphQLMap = ["modifiedAt": modifiedAt, "fbID": fbId, "id": id, "createdAt": createdAt, "workshops": workshops, "type": type, "OR": or, "AND": and]
}
/// Filter results for on the modifiedAt field.
public var modifiedAt: Optional<EventModifiedAtWhereArgs?> {
get {
return graphQLMap["modifiedAt"] as! Optional<EventModifiedAtWhereArgs?>
}
set {
graphQLMap.updateValue(newValue, forKey: "modifiedAt")
}
}
/// Filter results for on the fbID field.
public var fbId: Optional<EventFbIdWhereArgs?> {
get {
return graphQLMap["fbId"] as! Optional<EventFbIdWhereArgs?>
}
set {
graphQLMap.updateValue(newValue, forKey: "fbId")
}
}
/// Filter results for on the id field.
public var id: Optional<EventIdWhereArgs?> {
get {
return graphQLMap["id"] as! Optional<EventIdWhereArgs?>
}
set {
graphQLMap.updateValue(newValue, forKey: "id")
}
}
/// Filter results for on the createdAt field.
public var createdAt: Optional<EventCreatedAtWhereArgs?> {
get {
return graphQLMap["createdAt"] as! Optional<EventCreatedAtWhereArgs?>
}
set {
graphQLMap.updateValue(newValue, forKey: "createdAt")
}
}
/// Filter results based on a related object via the workshops connection
public var workshops: Optional<WorkshopWhereArgs?> {
get {
return graphQLMap["workshops"] as! Optional<WorkshopWhereArgs?>
}
set {
graphQLMap.updateValue(newValue, forKey: "workshops")
}
}
/// Filter results for on the type field.
public var type: Optional<EventTypeWhereArgs?> {
get {
return graphQLMap["type"] as! Optional<EventTypeWhereArgs?>
}
set {
graphQLMap.updateValue(newValue, forKey: "type")
}
}
/// Combine mutiple where expressions using the OR operator.
public var or: Optional<[EventWhereArgs?]?> {
get {
return graphQLMap["or"] as! Optional<[EventWhereArgs?]?>
}
set {
graphQLMap.updateValue(newValue, forKey: "or")
}
}
/// Combine mutiple where expressions using the AND operator.
public var and: Optional<[EventWhereArgs?]?> {
get {
return graphQLMap["and"] as! Optional<[EventWhereArgs?]?>
}
set {
graphQLMap.updateValue(newValue, forKey: "and")
}
}
}
public struct EventModifiedAtWhereArgs: GraphQLMapConvertible {
public var graphQLMap: GraphQLMap
public init(eq: Optional<String?> = nil, ne: Optional<String?> = nil, gt: Optional<String?> = nil, gte: Optional<String?> = nil, lt: Optional<String?> = nil, lte: Optional<String?> = nil, between: Optional<[String?]?> = nil, notBetween: Optional<[String?]?> = nil, `in`: Optional<[String?]?> = nil, notIn: Optional<[String?]?> = nil, like: Optional<String?> = nil, notLike: Optional<String?> = nil, isNull: Optional<Bool?> = nil) {
graphQLMap = ["eq": eq, "ne": ne, "gt": gt, "gte": gte, "lt": lt, "lte": lte, "between": between, "notBetween": notBetween, "in": `in`, "notIn": notIn, "like": like, "notLike": notLike, "isNull": isNull]
}
/// Equal to. This takes a higher precedence than the other operators.
public var eq: Optional<String?> {
get {
return graphQLMap["eq"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "eq")
}
}
/// Not equal to.
public var ne: Optional<String?> {
get {
return graphQLMap["ne"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "ne")
}
}
/// Greater than.
public var gt: Optional<String?> {
get {
return graphQLMap["gt"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "gt")
}
}
/// Greater than or equal to.
public var gte: Optional<String?> {
get {
return graphQLMap["gte"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "gte")
}
}
/// Less than.
public var lt: Optional<String?> {
get {
return graphQLMap["lt"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "lt")
}
}
/// Less than or equal to.
public var lte: Optional<String?> {
get {
return graphQLMap["lte"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "lte")
}
}
/// A two element tuple describing a range of values.
public var between: Optional<[String?]?> {
get {
return graphQLMap["between"] as! Optional<[String?]?>
}
set {
graphQLMap.updateValue(newValue, forKey: "between")
}
}
/// A two element tuple describing an excluded range of values.
public var notBetween: Optional<[String?]?> {
get {
return graphQLMap["notBetween"] as! Optional<[String?]?>
}
set {
graphQLMap.updateValue(newValue, forKey: "notBetween")
}
}
/// A list of values to include.
public var `in`: Optional<[String?]?> {
get {
return graphQLMap["in"] as! Optional<[String?]?>
}
set {
graphQLMap.updateValue(newValue, forKey: "in")
}
}
/// A list of values to exclude.
public var notIn: Optional<[String?]?> {
get {
return graphQLMap["notIn"] as! Optional<[String?]?>
}
set {
graphQLMap.updateValue(newValue, forKey: "notIn")
}
}
/// A pattern to match for likeness.
public var like: Optional<String?> {
get {
return graphQLMap["like"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "like")
}
}
/// A pattern to match for likeness and exclude.
public var notLike: Optional<String?> {
get {
return graphQLMap["notLike"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "notLike")
}
}
/// Filters for null values. This takes precedence after 'eq' but before all other fields
public var isNull: Optional<Bool?> {
get {
return graphQLMap["isNull"] as! Optional<Bool?>
}
set {
graphQLMap.updateValue(newValue, forKey: "isNull")
}
}
}
public struct EventFbIdWhereArgs: GraphQLMapConvertible {
public var graphQLMap: GraphQLMap
public init(eq: Optional<String?> = nil, ne: Optional<String?> = nil, gt: Optional<String?> = nil, gte: Optional<String?> = nil, lt: Optional<String?> = nil, lte: Optional<String?> = nil, between: Optional<[String?]?> = nil, notBetween: Optional<[String?]?> = nil, `in`: Optional<[String?]?> = nil, notIn: Optional<[String?]?> = nil, like: Optional<String?> = nil, notLike: Optional<String?> = nil, isNull: Optional<Bool?> = nil) {
graphQLMap = ["eq": eq, "ne": ne, "gt": gt, "gte": gte, "lt": lt, "lte": lte, "between": between, "notBetween": notBetween, "in": `in`, "notIn": notIn, "like": like, "notLike": notLike, "isNull": isNull]
}
/// Equal to. This takes a higher precedence than the other operators.
public var eq: Optional<String?> {
get {
return graphQLMap["eq"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "eq")
}
}
/// Not equal to.
public var ne: Optional<String?> {
get {
return graphQLMap["ne"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "ne")
}
}
/// Greater than.
public var gt: Optional<String?> {
get {
return graphQLMap["gt"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "gt")
}
}
/// Greater than or equal to.
public var gte: Optional<String?> {
get {
return graphQLMap["gte"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "gte")
}
}
/// Less than.
public var lt: Optional<String?> {
get {
return graphQLMap["lt"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "lt")
}
}
/// Less than or equal to.
public var lte: Optional<String?> {
get {
return graphQLMap["lte"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "lte")
}
}
/// A two element tuple describing a range of values.
public var between: Optional<[String?]?> {
get {
return graphQLMap["between"] as! Optional<[String?]?>
}
set {
graphQLMap.updateValue(newValue, forKey: "between")
}
}
/// A two element tuple describing an excluded range of values.
public var notBetween: Optional<[String?]?> {
get {
return graphQLMap["notBetween"] as! Optional<[String?]?>
}
set {
graphQLMap.updateValue(newValue, forKey: "notBetween")
}
}
/// A list of values to include.
public var `in`: Optional<[String?]?> {
get {
return graphQLMap["in"] as! Optional<[String?]?>
}
set {
graphQLMap.updateValue(newValue, forKey: "in")
}
}
/// A list of values to exclude.
public var notIn: Optional<[String?]?> {
get {
return graphQLMap["notIn"] as! Optional<[String?]?>
}
set {
graphQLMap.updateValue(newValue, forKey: "notIn")
}
}
/// A pattern to match for likeness.
public var like: Optional<String?> {
get {
return graphQLMap["like"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "like")
}
}
/// A pattern to match for likeness and exclude.
public var notLike: Optional<String?> {
get {
return graphQLMap["notLike"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "notLike")
}
}
/// Filters for null values. This takes precedence after 'eq' but before all other fields
public var isNull: Optional<Bool?> {
get {
return graphQLMap["isNull"] as! Optional<Bool?>
}
set {
graphQLMap.updateValue(newValue, forKey: "isNull")
}
}
}
public struct EventIdWhereArgs: GraphQLMapConvertible {
public var graphQLMap: GraphQLMap
public init(eq: Optional<GraphQLID?> = nil, ne: Optional<GraphQLID?> = nil, `in`: Optional<[GraphQLID?]?> = nil, notIn: Optional<[GraphQLID?]?> = nil, isNull: Optional<Bool?> = nil) {
graphQLMap = ["eq": eq, "ne": ne, "in": `in`, "notIn": notIn, "isNull": isNull]
}
/// Equal to. This takes a higher precedence than the other operators.
public var eq: Optional<GraphQLID?> {
get {
return graphQLMap["eq"] as! Optional<GraphQLID?>
}
set {
graphQLMap.updateValue(newValue, forKey: "eq")
}
}
/// Not equal to.
public var ne: Optional<GraphQLID?> {
get {
return graphQLMap["ne"] as! Optional<GraphQLID?>
}
set {
graphQLMap.updateValue(newValue, forKey: "ne")
}
}
/// A list of values to include.
public var `in`: Optional<[GraphQLID?]?> {
get {
return graphQLMap["in"] as! Optional<[GraphQLID?]?>
}
set {
graphQLMap.updateValue(newValue, forKey: "in")
}
}
/// A list of values to exclude.
public var notIn: Optional<[GraphQLID?]?> {
get {
return graphQLMap["notIn"] as! Optional<[GraphQLID?]?>
}
set {
graphQLMap.updateValue(newValue, forKey: "notIn")
}
}
/// Filters for null values. This takes precedence after 'eq' but before all other fields
public var isNull: Optional<Bool?> {
get {
return graphQLMap["isNull"] as! Optional<Bool?>
}
set {
graphQLMap.updateValue(newValue, forKey: "isNull")
}
}
}
public struct EventCreatedAtWhereArgs: GraphQLMapConvertible {
public var graphQLMap: GraphQLMap
public init(eq: Optional<String?> = nil, ne: Optional<String?> = nil, gt: Optional<String?> = nil, gte: Optional<String?> = nil, lt: Optional<String?> = nil, lte: Optional<String?> = nil, between: Optional<[String?]?> = nil, notBetween: Optional<[String?]?> = nil, `in`: Optional<[String?]?> = nil, notIn: Optional<[String?]?> = nil, like: Optional<String?> = nil, notLike: Optional<String?> = nil, isNull: Optional<Bool?> = nil) {
graphQLMap = ["eq": eq, "ne": ne, "gt": gt, "gte": gte, "lt": lt, "lte": lte, "between": between, "notBetween": notBetween, "in": `in`, "notIn": notIn, "like": like, "notLike": notLike, "isNull": isNull]
}
/// Equal to. This takes a higher precedence than the other operators.
public var eq: Optional<String?> {
get {
return graphQLMap["eq"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "eq")
}
}
/// Not equal to.
public var ne: Optional<String?> {
get {
return graphQLMap["ne"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "ne")
}
}
/// Greater than.
public var gt: Optional<String?> {
get {
return graphQLMap["gt"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "gt")
}
}
/// Greater than or equal to.
public var gte: Optional<String?> {
get {
return graphQLMap["gte"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "gte")
}
}
/// Less than.
public var lt: Optional<String?> {
get {
return graphQLMap["lt"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "lt")
}
}
/// Less than or equal to.
public var lte: Optional<String?> {
get {
return graphQLMap["lte"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "lte")
}
}
/// A two element tuple describing a range of values.
public var between: Optional<[String?]?> {
get {
return graphQLMap["between"] as! Optional<[String?]?>
}
set {
graphQLMap.updateValue(newValue, forKey: "between")
}
}
/// A two element tuple describing an excluded range of values.
public var notBetween: Optional<[String?]?> {
get {
return graphQLMap["notBetween"] as! Optional<[String?]?>
}
set {
graphQLMap.updateValue(newValue, forKey: "notBetween")
}
}
/// A list of values to include.
public var `in`: Optional<[String?]?> {
get {
return graphQLMap["in"] as! Optional<[String?]?>
}
set {
graphQLMap.updateValue(newValue, forKey: "in")
}
}
/// A list of values to exclude.
public var notIn: Optional<[String?]?> {
get {
return graphQLMap["notIn"] as! Optional<[String?]?>
}
set {
graphQLMap.updateValue(newValue, forKey: "notIn")
}
}
/// A pattern to match for likeness.
public var like: Optional<String?> {
get {
return graphQLMap["like"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "like")
}
}
/// A pattern to match for likeness and exclude.
public var notLike: Optional<String?> {
get {
return graphQLMap["notLike"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "notLike")
}
}
/// Filters for null values. This takes precedence after 'eq' but before all other fields
public var isNull: Optional<Bool?> {
get {
return graphQLMap["isNull"] as! Optional<Bool?>
}
set {
graphQLMap.updateValue(newValue, forKey: "isNull")
}
}
}
/// Where filter arguments for the Workshop type
public struct WorkshopWhereArgs: GraphQLMapConvertible {
public var graphQLMap: GraphQLMap
public init(id: Optional<WorkshopIdWhereArgs?> = nil, modifiedAt: Optional<WorkshopModifiedAtWhereArgs?> = nil, room: Optional<WorkshopRoomWhereArgs?> = nil, startTime: Optional<WorkshopStartTimeWhereArgs?> = nil, artist: Optional<WorkshopArtistWhereArgs?> = nil, createdAt: Optional<WorkshopCreatedAtWhereArgs?> = nil, name: Optional<WorkshopNameWhereArgs?> = nil, event: Optional<EventWhereArgs?> = nil, eventId: Optional<WorkshopEventIdWhereArgs?> = nil, or: Optional<[WorkshopWhereArgs?]?> = nil, and: Optional<[WorkshopWhereArgs?]?> = nil) {
graphQLMap = ["id": id, "modifiedAt": modifiedAt, "room": room, "startTime": startTime, "artist": artist, "createdAt": createdAt, "name": name, "event": event, "eventId": eventId, "OR": or, "AND": and]
}
/// Filter results for on the id field.
public var id: Optional<WorkshopIdWhereArgs?> {
get {
return graphQLMap["id"] as! Optional<WorkshopIdWhereArgs?>
}
set {
graphQLMap.updateValue(newValue, forKey: "id")
}
}
/// Filter results for on the modifiedAt field.
public var modifiedAt: Optional<WorkshopModifiedAtWhereArgs?> {
get {
return graphQLMap["modifiedAt"] as! Optional<WorkshopModifiedAtWhereArgs?>
}
set {
graphQLMap.updateValue(newValue, forKey: "modifiedAt")
}
}
/// Filter results for on the room field.
public var room: Optional<WorkshopRoomWhereArgs?> {
get {
return graphQLMap["room"] as! Optional<WorkshopRoomWhereArgs?>
}
set {
graphQLMap.updateValue(newValue, forKey: "room")
}
}
/// Filter results for on the startTime field.
public var startTime: Optional<WorkshopStartTimeWhereArgs?> {
get {
return graphQLMap["startTime"] as! Optional<WorkshopStartTimeWhereArgs?>
}
set {
graphQLMap.updateValue(newValue, forKey: "startTime")
}
}
/// Filter results for on the artist field.
public var artist: Optional<WorkshopArtistWhereArgs?> {
get {
return graphQLMap["artist"] as! Optional<WorkshopArtistWhereArgs?>
}
set {
graphQLMap.updateValue(newValue, forKey: "artist")
}
}
/// Filter results for on the createdAt field.
public var createdAt: Optional<WorkshopCreatedAtWhereArgs?> {
get {
return graphQLMap["createdAt"] as! Optional<WorkshopCreatedAtWhereArgs?>
}
set {
graphQLMap.updateValue(newValue, forKey: "createdAt")
}
}
/// Filter results for on the name field.
public var name: Optional<WorkshopNameWhereArgs?> {
get {
return graphQLMap["name"] as! Optional<WorkshopNameWhereArgs?>
}
set {
graphQLMap.updateValue(newValue, forKey: "name")
}
}
/// Filter results based on a related object via the event connection
public var event: Optional<EventWhereArgs?> {
get {
return graphQLMap["event"] as! Optional<EventWhereArgs?>
}
set {
graphQLMap.updateValue(newValue, forKey: "event")
}
}
/// Filter results for on the eventId field.
public var eventId: Optional<WorkshopEventIdWhereArgs?> {
get {
return graphQLMap["eventId"] as! Optional<WorkshopEventIdWhereArgs?>
}
set {
graphQLMap.updateValue(newValue, forKey: "eventId")
}
}
/// Combine mutiple where expressions using the OR operator.
public var or: Optional<[WorkshopWhereArgs?]?> {
get {
return graphQLMap["or"] as! Optional<[WorkshopWhereArgs?]?>
}
set {
graphQLMap.updateValue(newValue, forKey: "or")
}
}
/// Combine mutiple where expressions using the AND operator.
public var and: Optional<[WorkshopWhereArgs?]?> {
get {
return graphQLMap["and"] as! Optional<[WorkshopWhereArgs?]?>
}
set {
graphQLMap.updateValue(newValue, forKey: "and")
}
}
}
public struct WorkshopIdWhereArgs: GraphQLMapConvertible {
public var graphQLMap: GraphQLMap
public init(eq: Optional<GraphQLID?> = nil, ne: Optional<GraphQLID?> = nil, `in`: Optional<[GraphQLID?]?> = nil, notIn: Optional<[GraphQLID?]?> = nil, isNull: Optional<Bool?> = nil) {
graphQLMap = ["eq": eq, "ne": ne, "in": `in`, "notIn": notIn, "isNull": isNull]
}
/// Equal to. This takes a higher precedence than the other operators.
public var eq: Optional<GraphQLID?> {
get {
return graphQLMap["eq"] as! Optional<GraphQLID?>
}
set {
graphQLMap.updateValue(newValue, forKey: "eq")
}
}
/// Not equal to.
public var ne: Optional<GraphQLID?> {
get {
return graphQLMap["ne"] as! Optional<GraphQLID?>
}
set {
graphQLMap.updateValue(newValue, forKey: "ne")
}
}
/// A list of values to include.
public var `in`: Optional<[GraphQLID?]?> {
get {
return graphQLMap["in"] as! Optional<[GraphQLID?]?>
}
set {
graphQLMap.updateValue(newValue, forKey: "in")
}
}
/// A list of values to exclude.
public var notIn: Optional<[GraphQLID?]?> {
get {
return graphQLMap["notIn"] as! Optional<[GraphQLID?]?>
}
set {
graphQLMap.updateValue(newValue, forKey: "notIn")
}
}
/// Filters for null values. This takes precedence after 'eq' but before all other fields
public var isNull: Optional<Bool?> {
get {
return graphQLMap["isNull"] as! Optional<Bool?>
}
set {
graphQLMap.updateValue(newValue, forKey: "isNull")
}
}
}
public struct WorkshopModifiedAtWhereArgs: GraphQLMapConvertible {
public var graphQLMap: GraphQLMap
public init(eq: Optional<String?> = nil, ne: Optional<String?> = nil, gt: Optional<String?> = nil, gte: Optional<String?> = nil, lt: Optional<String?> = nil, lte: Optional<String?> = nil, between: Optional<[String?]?> = nil, notBetween: Optional<[String?]?> = nil, `in`: Optional<[String?]?> = nil, notIn: Optional<[String?]?> = nil, like: Optional<String?> = nil, notLike: Optional<String?> = nil, isNull: Optional<Bool?> = nil) {
graphQLMap = ["eq": eq, "ne": ne, "gt": gt, "gte": gte, "lt": lt, "lte": lte, "between": between, "notBetween": notBetween, "in": `in`, "notIn": notIn, "like": like, "notLike": notLike, "isNull": isNull]
}
/// Equal to. This takes a higher precedence than the other operators.
public var eq: Optional<String?> {
get {
return graphQLMap["eq"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "eq")
}
}
/// Not equal to.
public var ne: Optional<String?> {
get {
return graphQLMap["ne"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "ne")
}
}
/// Greater than.
public var gt: Optional<String?> {
get {
return graphQLMap["gt"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "gt")
}
}
/// Greater than or equal to.
public var gte: Optional<String?> {
get {
return graphQLMap["gte"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "gte")
}
}
/// Less than.
public var lt: Optional<String?> {
get {
return graphQLMap["lt"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "lt")
}
}
/// Less than or equal to.
public var lte: Optional<String?> {
get {
return graphQLMap["lte"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "lte")
}
}
/// A two element tuple describing a range of values.
public var between: Optional<[String?]?> {
get {
return graphQLMap["between"] as! Optional<[String?]?>
}
set {
graphQLMap.updateValue(newValue, forKey: "between")
}
}
/// A two element tuple describing an excluded range of values.
public var notBetween: Optional<[String?]?> {
get {
return graphQLMap["notBetween"] as! Optional<[String?]?>
}
set {
graphQLMap.updateValue(newValue, forKey: "notBetween")
}
}
/// A list of values to include.
public var `in`: Optional<[String?]?> {
get {
return graphQLMap["in"] as! Optional<[String?]?>
}
set {
graphQLMap.updateValue(newValue, forKey: "in")
}
}
/// A list of values to exclude.
public var notIn: Optional<[String?]?> {
get {
return graphQLMap["notIn"] as! Optional<[String?]?>
}
set {
graphQLMap.updateValue(newValue, forKey: "notIn")
}
}
/// A pattern to match for likeness.
public var like: Optional<String?> {
get {
return graphQLMap["like"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "like")
}
}
/// A pattern to match for likeness and exclude.
public var notLike: Optional<String?> {
get {
return graphQLMap["notLike"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "notLike")
}
}
/// Filters for null values. This takes precedence after 'eq' but before all other fields
public var isNull: Optional<Bool?> {
get {
return graphQLMap["isNull"] as! Optional<Bool?>
}
set {
graphQLMap.updateValue(newValue, forKey: "isNull")
}
}
}
public struct WorkshopRoomWhereArgs: GraphQLMapConvertible {
public var graphQLMap: GraphQLMap
public init(eq: Optional<String?> = nil, ne: Optional<String?> = nil, gt: Optional<String?> = nil, gte: Optional<String?> = nil, lt: Optional<String?> = nil, lte: Optional<String?> = nil, between: Optional<[String?]?> = nil, notBetween: Optional<[String?]?> = nil, `in`: Optional<[String?]?> = nil, notIn: Optional<[String?]?> = nil, like: Optional<String?> = nil, notLike: Optional<String?> = nil, isNull: Optional<Bool?> = nil) {
graphQLMap = ["eq": eq, "ne": ne, "gt": gt, "gte": gte, "lt": lt, "lte": lte, "between": between, "notBetween": notBetween, "in": `in`, "notIn": notIn, "like": like, "notLike": notLike, "isNull": isNull]
}
/// Equal to. This takes a higher precedence than the other operators.
public var eq: Optional<String?> {
get {
return graphQLMap["eq"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "eq")
}
}
/// Not equal to.
public var ne: Optional<String?> {
get {
return graphQLMap["ne"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "ne")
}
}
/// Greater than.
public var gt: Optional<String?> {
get {
return graphQLMap["gt"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "gt")
}
}
/// Greater than or equal to.
public var gte: Optional<String?> {
get {
return graphQLMap["gte"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "gte")
}
}
/// Less than.
public var lt: Optional<String?> {
get {
return graphQLMap["lt"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "lt")
}
}
/// Less than or equal to.
public var lte: Optional<String?> {
get {
return graphQLMap["lte"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "lte")
}
}
/// A two element tuple describing a range of values.
public var between: Optional<[String?]?> {
get {
return graphQLMap["between"] as! Optional<[String?]?>
}
set {
graphQLMap.updateValue(newValue, forKey: "between")
}
}
/// A two element tuple describing an excluded range of values.
public var notBetween: Optional<[String?]?> {
get {
return graphQLMap["notBetween"] as! Optional<[String?]?>
}
set {
graphQLMap.updateValue(newValue, forKey: "notBetween")
}
}
/// A list of values to include.
public var `in`: Optional<[String?]?> {
get {
return graphQLMap["in"] as! Optional<[String?]?>
}
set {
graphQLMap.updateValue(newValue, forKey: "in")
}
}
/// A list of values to exclude.
public var notIn: Optional<[String?]?> {
get {
return graphQLMap["notIn"] as! Optional<[String?]?>
}
set {
graphQLMap.updateValue(newValue, forKey: "notIn")
}
}
/// A pattern to match for likeness.
public var like: Optional<String?> {
get {
return graphQLMap["like"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "like")
}
}
/// A pattern to match for likeness and exclude.
public var notLike: Optional<String?> {
get {
return graphQLMap["notLike"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "notLike")
}
}
/// Filters for null values. This takes precedence after 'eq' but before all other fields
public var isNull: Optional<Bool?> {
get {
return graphQLMap["isNull"] as! Optional<Bool?>
}
set {
graphQLMap.updateValue(newValue, forKey: "isNull")
}
}
}
public struct WorkshopStartTimeWhereArgs: GraphQLMapConvertible {
public var graphQLMap: GraphQLMap
public init(eq: Optional<String?> = nil, ne: Optional<String?> = nil, gt: Optional<String?> = nil, gte: Optional<String?> = nil, lt: Optional<String?> = nil, lte: Optional<String?> = nil, between: Optional<[String?]?> = nil, notBetween: Optional<[String?]?> = nil, `in`: Optional<[String?]?> = nil, notIn: Optional<[String?]?> = nil, like: Optional<String?> = nil, notLike: Optional<String?> = nil, isNull: Optional<Bool?> = nil) {
graphQLMap = ["eq": eq, "ne": ne, "gt": gt, "gte": gte, "lt": lt, "lte": lte, "between": between, "notBetween": notBetween, "in": `in`, "notIn": notIn, "like": like, "notLike": notLike, "isNull": isNull]
}
/// Equal to. This takes a higher precedence than the other operators.
public var eq: Optional<String?> {
get {
return graphQLMap["eq"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "eq")
}
}
/// Not equal to.
public var ne: Optional<String?> {
get {
return graphQLMap["ne"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "ne")
}
}
/// Greater than.
public var gt: Optional<String?> {
get {
return graphQLMap["gt"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "gt")
}
}
/// Greater than or equal to.
public var gte: Optional<String?> {
get {
return graphQLMap["gte"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "gte")
}
}
/// Less than.
public var lt: Optional<String?> {
get {
return graphQLMap["lt"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "lt")
}
}
/// Less than or equal to.
public var lte: Optional<String?> {
get {
return graphQLMap["lte"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "lte")
}
}
/// A two element tuple describing a range of values.
public var between: Optional<[String?]?> {
get {
return graphQLMap["between"] as! Optional<[String?]?>
}
set {
graphQLMap.updateValue(newValue, forKey: "between")
}
}
/// A two element tuple describing an excluded range of values.
public var notBetween: Optional<[String?]?> {
get {
return graphQLMap["notBetween"] as! Optional<[String?]?>
}
set {
graphQLMap.updateValue(newValue, forKey: "notBetween")
}
}
/// A list of values to include.
public var `in`: Optional<[String?]?> {
get {
return graphQLMap["in"] as! Optional<[String?]?>
}
set {
graphQLMap.updateValue(newValue, forKey: "in")
}
}
/// A list of values to exclude.
public var notIn: Optional<[String?]?> {
get {
return graphQLMap["notIn"] as! Optional<[String?]?>
}
set {
graphQLMap.updateValue(newValue, forKey: "notIn")
}
}
/// A pattern to match for likeness.
public var like: Optional<String?> {
get {
return graphQLMap["like"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "like")
}
}
/// A pattern to match for likeness and exclude.
public var notLike: Optional<String?> {
get {
return graphQLMap["notLike"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "notLike")
}
}
/// Filters for null values. This takes precedence after 'eq' but before all other fields
public var isNull: Optional<Bool?> {
get {
return graphQLMap["isNull"] as! Optional<Bool?>
}
set {
graphQLMap.updateValue(newValue, forKey: "isNull")
}
}
}
public struct WorkshopArtistWhereArgs: GraphQLMapConvertible {
public var graphQLMap: GraphQLMap
public init(eq: Optional<String?> = nil, ne: Optional<String?> = nil, gt: Optional<String?> = nil, gte: Optional<String?> = nil, lt: Optional<String?> = nil, lte: Optional<String?> = nil, between: Optional<[String?]?> = nil, notBetween: Optional<[String?]?> = nil, `in`: Optional<[String?]?> = nil, notIn: Optional<[String?]?> = nil, like: Optional<String?> = nil, notLike: Optional<String?> = nil, isNull: Optional<Bool?> = nil) {
graphQLMap = ["eq": eq, "ne": ne, "gt": gt, "gte": gte, "lt": lt, "lte": lte, "between": between, "notBetween": notBetween, "in": `in`, "notIn": notIn, "like": like, "notLike": notLike, "isNull": isNull]
}
/// Equal to. This takes a higher precedence than the other operators.
public var eq: Optional<String?> {
get {
return graphQLMap["eq"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "eq")
}
}
/// Not equal to.
public var ne: Optional<String?> {
get {
return graphQLMap["ne"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "ne")
}
}
/// Greater than.
public var gt: Optional<String?> {
get {
return graphQLMap["gt"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "gt")
}
}
/// Greater than or equal to.
public var gte: Optional<String?> {
get {
return graphQLMap["gte"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "gte")
}
}
/// Less than.
public var lt: Optional<String?> {
get {
return graphQLMap["lt"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "lt")
}
}
/// Less than or equal to.
public var lte: Optional<String?> {
get {
return graphQLMap["lte"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "lte")
}
}
/// A two element tuple describing a range of values.
public var between: Optional<[String?]?> {
get {
return graphQLMap["between"] as! Optional<[String?]?>
}
set {
graphQLMap.updateValue(newValue, forKey: "between")
}
}
/// A two element tuple describing an excluded range of values.
public var notBetween: Optional<[String?]?> {
get {
return graphQLMap["notBetween"] as! Optional<[String?]?>
}
set {
graphQLMap.updateValue(newValue, forKey: "notBetween")
}
}
/// A list of values to include.
public var `in`: Optional<[String?]?> {
get {
return graphQLMap["in"] as! Optional<[String?]?>
}
set {
graphQLMap.updateValue(newValue, forKey: "in")
}
}
/// A list of values to exclude.
public var notIn: Optional<[String?]?> {
get {
return graphQLMap["notIn"] as! Optional<[String?]?>
}
set {
graphQLMap.updateValue(newValue, forKey: "notIn")
}
}
/// A pattern to match for likeness.
public var like: Optional<String?> {
get {
return graphQLMap["like"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "like")
}
}
/// A pattern to match for likeness and exclude.
public var notLike: Optional<String?> {
get {
return graphQLMap["notLike"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "notLike")
}
}
/// Filters for null values. This takes precedence after 'eq' but before all other fields
public var isNull: Optional<Bool?> {
get {
return graphQLMap["isNull"] as! Optional<Bool?>
}
set {
graphQLMap.updateValue(newValue, forKey: "isNull")
}
}
}
public struct WorkshopCreatedAtWhereArgs: GraphQLMapConvertible {
public var graphQLMap: GraphQLMap
public init(eq: Optional<String?> = nil, ne: Optional<String?> = nil, gt: Optional<String?> = nil, gte: Optional<String?> = nil, lt: Optional<String?> = nil, lte: Optional<String?> = nil, between: Optional<[String?]?> = nil, notBetween: Optional<[String?]?> = nil, `in`: Optional<[String?]?> = nil, notIn: Optional<[String?]?> = nil, like: Optional<String?> = nil, notLike: Optional<String?> = nil, isNull: Optional<Bool?> = nil) {
graphQLMap = ["eq": eq, "ne": ne, "gt": gt, "gte": gte, "lt": lt, "lte": lte, "between": between, "notBetween": notBetween, "in": `in`, "notIn": notIn, "like": like, "notLike": notLike, "isNull": isNull]
}
/// Equal to. This takes a higher precedence than the other operators.
public var eq: Optional<String?> {
get {
return graphQLMap["eq"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "eq")
}
}
/// Not equal to.
public var ne: Optional<String?> {
get {
return graphQLMap["ne"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "ne")
}
}
/// Greater than.
public var gt: Optional<String?> {
get {
return graphQLMap["gt"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "gt")
}
}
/// Greater than or equal to.
public var gte: Optional<String?> {
get {
return graphQLMap["gte"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "gte")
}
}
/// Less than.
public var lt: Optional<String?> {
get {
return graphQLMap["lt"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "lt")
}
}
/// Less than or equal to.
public var lte: Optional<String?> {
get {
return graphQLMap["lte"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "lte")
}
}
/// A two element tuple describing a range of values.
public var between: Optional<[String?]?> {
get {
return graphQLMap["between"] as! Optional<[String?]?>
}
set {
graphQLMap.updateValue(newValue, forKey: "between")
}
}
/// A two element tuple describing an excluded range of values.
public var notBetween: Optional<[String?]?> {
get {
return graphQLMap["notBetween"] as! Optional<[String?]?>
}
set {
graphQLMap.updateValue(newValue, forKey: "notBetween")
}
}
/// A list of values to include.
public var `in`: Optional<[String?]?> {
get {
return graphQLMap["in"] as! Optional<[String?]?>
}
set {
graphQLMap.updateValue(newValue, forKey: "in")
}
}
/// A list of values to exclude.
public var notIn: Optional<[String?]?> {
get {
return graphQLMap["notIn"] as! Optional<[String?]?>
}
set {
graphQLMap.updateValue(newValue, forKey: "notIn")
}
}
/// A pattern to match for likeness.
public var like: Optional<String?> {
get {
return graphQLMap["like"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "like")
}
}
/// A pattern to match for likeness and exclude.
public var notLike: Optional<String?> {
get {
return graphQLMap["notLike"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "notLike")
}
}
/// Filters for null values. This takes precedence after 'eq' but before all other fields
public var isNull: Optional<Bool?> {
get {
return graphQLMap["isNull"] as! Optional<Bool?>
}
set {
graphQLMap.updateValue(newValue, forKey: "isNull")
}
}
}
public struct WorkshopNameWhereArgs: GraphQLMapConvertible {
public var graphQLMap: GraphQLMap
public init(eq: Optional<String?> = nil, ne: Optional<String?> = nil, gt: Optional<String?> = nil, gte: Optional<String?> = nil, lt: Optional<String?> = nil, lte: Optional<String?> = nil, between: Optional<[String?]?> = nil, notBetween: Optional<[String?]?> = nil, `in`: Optional<[String?]?> = nil, notIn: Optional<[String?]?> = nil, like: Optional<String?> = nil, notLike: Optional<String?> = nil, isNull: Optional<Bool?> = nil) {
graphQLMap = ["eq": eq, "ne": ne, "gt": gt, "gte": gte, "lt": lt, "lte": lte, "between": between, "notBetween": notBetween, "in": `in`, "notIn": notIn, "like": like, "notLike": notLike, "isNull": isNull]
}
/// Equal to. This takes a higher precedence than the other operators.
public var eq: Optional<String?> {
get {
return graphQLMap["eq"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "eq")
}
}
/// Not equal to.
public var ne: Optional<String?> {
get {
return graphQLMap["ne"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "ne")
}
}
/// Greater than.
public var gt: Optional<String?> {
get {
return graphQLMap["gt"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "gt")
}
}
/// Greater than or equal to.
public var gte: Optional<String?> {
get {
return graphQLMap["gte"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "gte")
}
}
/// Less than.
public var lt: Optional<String?> {
get {
return graphQLMap["lt"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "lt")
}
}
/// Less than or equal to.
public var lte: Optional<String?> {
get {
return graphQLMap["lte"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "lte")
}
}
/// A two element tuple describing a range of values.
public var between: Optional<[String?]?> {
get {
return graphQLMap["between"] as! Optional<[String?]?>
}
set {
graphQLMap.updateValue(newValue, forKey: "between")
}
}
/// A two element tuple describing an excluded range of values.
public var notBetween: Optional<[String?]?> {
get {
return graphQLMap["notBetween"] as! Optional<[String?]?>
}
set {
graphQLMap.updateValue(newValue, forKey: "notBetween")
}
}
/// A list of values to include.
public var `in`: Optional<[String?]?> {
get {
return graphQLMap["in"] as! Optional<[String?]?>
}
set {
graphQLMap.updateValue(newValue, forKey: "in")
}
}
/// A list of values to exclude.
public var notIn: Optional<[String?]?> {
get {
return graphQLMap["notIn"] as! Optional<[String?]?>
}
set {
graphQLMap.updateValue(newValue, forKey: "notIn")
}
}
/// A pattern to match for likeness.
public var like: Optional<String?> {
get {
return graphQLMap["like"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "like")
}
}
/// A pattern to match for likeness and exclude.
public var notLike: Optional<String?> {
get {
return graphQLMap["notLike"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "notLike")
}
}
/// Filters for null values. This takes precedence after 'eq' but before all other fields
public var isNull: Optional<Bool?> {
get {
return graphQLMap["isNull"] as! Optional<Bool?>
}
set {
graphQLMap.updateValue(newValue, forKey: "isNull")
}
}
}
public struct WorkshopEventIdWhereArgs: GraphQLMapConvertible {
public var graphQLMap: GraphQLMap
public init(eq: Optional<GraphQLID?> = nil, ne: Optional<GraphQLID?> = nil, `in`: Optional<[GraphQLID?]?> = nil, notIn: Optional<[GraphQLID?]?> = nil, isNull: Optional<Bool?> = nil) {
graphQLMap = ["eq": eq, "ne": ne, "in": `in`, "notIn": notIn, "isNull": isNull]
}
/// Equal to. This takes a higher precedence than the other operators.
public var eq: Optional<GraphQLID?> {
get {
return graphQLMap["eq"] as! Optional<GraphQLID?>
}
set {
graphQLMap.updateValue(newValue, forKey: "eq")
}
}
/// Not equal to.
public var ne: Optional<GraphQLID?> {
get {
return graphQLMap["ne"] as! Optional<GraphQLID?>
}
set {
graphQLMap.updateValue(newValue, forKey: "ne")
}
}
/// A list of values to include.
public var `in`: Optional<[GraphQLID?]?> {
get {
return graphQLMap["in"] as! Optional<[GraphQLID?]?>
}
set {
graphQLMap.updateValue(newValue, forKey: "in")
}
}
/// A list of values to exclude.
public var notIn: Optional<[GraphQLID?]?> {
get {
return graphQLMap["notIn"] as! Optional<[GraphQLID?]?>
}
set {
graphQLMap.updateValue(newValue, forKey: "notIn")
}
}
/// Filters for null values. This takes precedence after 'eq' but before all other fields
public var isNull: Optional<Bool?> {
get {
return graphQLMap["isNull"] as! Optional<Bool?>
}
set {
graphQLMap.updateValue(newValue, forKey: "isNull")
}
}
}
public struct EventTypeWhereArgs: GraphQLMapConvertible {
public var graphQLMap: GraphQLMap
public init(eq: Optional<Dance?> = nil, ne: Optional<Dance?> = nil, gt: Optional<Dance?> = nil, gte: Optional<Dance?> = nil, lt: Optional<Dance?> = nil, lte: Optional<Dance?> = nil, between: Optional<[Dance?]?> = nil, notBetween: Optional<[Dance?]?> = nil, `in`: Optional<[Dance?]?> = nil, notIn: Optional<[Dance?]?> = nil, like: Optional<String?> = nil, notLike: Optional<String?> = nil, isNull: Optional<Bool?> = nil) {
graphQLMap = ["eq": eq, "ne": ne, "gt": gt, "gte": gte, "lt": lt, "lte": lte, "between": between, "notBetween": notBetween, "in": `in`, "notIn": notIn, "like": like, "notLike": notLike, "isNull": isNull]
}
/// Equal to. This takes a higher precedence than the other operators.
public var eq: Optional<Dance?> {
get {
return graphQLMap["eq"] as! Optional<Dance?>
}
set {
graphQLMap.updateValue(newValue, forKey: "eq")
}
}
/// Not equal to.
public var ne: Optional<Dance?> {
get {
return graphQLMap["ne"] as! Optional<Dance?>
}
set {
graphQLMap.updateValue(newValue, forKey: "ne")
}
}
/// Greater than.
public var gt: Optional<Dance?> {
get {
return graphQLMap["gt"] as! Optional<Dance?>
}
set {
graphQLMap.updateValue(newValue, forKey: "gt")
}
}
/// Greater than or equal to.
public var gte: Optional<Dance?> {
get {
return graphQLMap["gte"] as! Optional<Dance?>
}
set {
graphQLMap.updateValue(newValue, forKey: "gte")
}
}
/// Less than.
public var lt: Optional<Dance?> {
get {
return graphQLMap["lt"] as! Optional<Dance?>
}
set {
graphQLMap.updateValue(newValue, forKey: "lt")
}
}
/// Less than or equal to.
public var lte: Optional<Dance?> {
get {
return graphQLMap["lte"] as! Optional<Dance?>
}
set {
graphQLMap.updateValue(newValue, forKey: "lte")
}
}
/// A two element tuple describing a range of values.
public var between: Optional<[Dance?]?> {
get {
return graphQLMap["between"] as! Optional<[Dance?]?>
}
set {
graphQLMap.updateValue(newValue, forKey: "between")
}
}
/// A two element tuple describing an excluded range of values.
public var notBetween: Optional<[Dance?]?> {
get {
return graphQLMap["notBetween"] as! Optional<[Dance?]?>
}
set {
graphQLMap.updateValue(newValue, forKey: "notBetween")
}
}
/// A list of values to include.
public var `in`: Optional<[Dance?]?> {
get {
return graphQLMap["in"] as! Optional<[Dance?]?>
}
set {
graphQLMap.updateValue(newValue, forKey: "in")
}
}
/// A list of values to exclude.
public var notIn: Optional<[Dance?]?> {
get {
return graphQLMap["notIn"] as! Optional<[Dance?]?>
}
set {
graphQLMap.updateValue(newValue, forKey: "notIn")
}
}
/// A pattern to match for likeness.
public var like: Optional<String?> {
get {
return graphQLMap["like"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "like")
}
}
/// A pattern to match for likeness and exclude.
public var notLike: Optional<String?> {
get {
return graphQLMap["notLike"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "notLike")
}
}
/// Filters for null values. This takes precedence after 'eq' but before all other fields
public var isNull: Optional<Bool?> {
get {
return graphQLMap["isNull"] as! Optional<Bool?>
}
set {
graphQLMap.updateValue(newValue, forKey: "isNull")
}
}
}
public struct CreateWorkshopInput: GraphQLMapConvertible {
public var graphQLMap: GraphQLMap
public init(room: String, startTime: String, artist: Optional<String?> = nil, name: String, event: Optional<CreateEventInput?> = nil, eventId: Optional<GraphQLID?> = nil, clientMutationId: Optional<GraphQLID?> = nil) {
graphQLMap = ["room": room, "startTime": startTime, "artist": artist, "name": name, "event": event, "eventId": eventId, "clientMutationId": clientMutationId]
}
public var room: String {
get {
return graphQLMap["room"] as! String
}
set {
graphQLMap.updateValue(newValue, forKey: "room")
}
}
public var startTime: String {
get {
return graphQLMap["startTime"] as! String
}
set {
graphQLMap.updateValue(newValue, forKey: "startTime")
}
}
public var artist: Optional<String?> {
get {
return graphQLMap["artist"] as! Optional<String?>
}
set {
graphQLMap.updateValue(newValue, forKey: "artist")
}
}
public var name: String {
get {
return graphQLMap["name"] as! String
}
set {
graphQLMap.updateValue(newValue, forKey: "name")
}
}
public var event: Optional<CreateEventInput?> {
get {
return graphQLMap["event"] as! Optional<CreateEventInput?>
}
set {
graphQLMap.updateValue(newValue, forKey: "event")
}
}
public var eventId: Optional<GraphQLID?> {
get {
return graphQLMap["eventId"] as! Optional<GraphQLID?>
}
set {
graphQLMap.updateValue(newValue, forKey: "eventId")
}
}
public var clientMutationId: Optional<GraphQLID?> {
get {
return graphQLMap["clientMutationId"] as! Optional<GraphQLID?>
}
set {
graphQLMap.updateValue(newValue, forKey: "clientMutationId")
}
}
}
public final class LoginMutation: GraphQLMutation {
public static let operationString =
"mutation Login($token: LoginUserWithAuth0SocialInput!) {\n loginUserWithAuth0Social(input: $token) {\n __typename\n token\n user {\n __typename\n id\n username\n }\n }\n}"
public var token: LoginUserWithAuth0SocialInput
public init(token: LoginUserWithAuth0SocialInput) {
self.token = token
}
public var variables: GraphQLMap? {
return ["token": token]
}
public struct Data: GraphQLSelectionSet {
public static let possibleTypes = ["Mutation"]
public static let selections: [GraphQLSelection] = [
GraphQLField("loginUserWithAuth0Social", arguments: ["input": GraphQLVariable("token")], type: .object(LoginUserWithAuth0Social.selections)),
]
public var snapshot: Snapshot
public init(snapshot: Snapshot) {
self.snapshot = snapshot
}
public init(loginUserWithAuth0Social: LoginUserWithAuth0Social? = nil) {
self.init(snapshot: ["__typename": "Mutation", "loginUserWithAuth0Social": loginUserWithAuth0Social.flatMap { $0.snapshot }])
}
/// The input object type used to log in a user with Auth0 Social
public var loginUserWithAuth0Social: LoginUserWithAuth0Social? {
get {
return (snapshot["loginUserWithAuth0Social"] as? Snapshot).flatMap { LoginUserWithAuth0Social(snapshot: $0) }
}
set {
snapshot.updateValue(newValue?.snapshot, forKey: "loginUserWithAuth0Social")
}
}
public struct LoginUserWithAuth0Social: GraphQLSelectionSet {
public static let possibleTypes = ["LoginUserWithAuth0SocialPayload"]
public static let selections: [GraphQLSelection] = [
GraphQLField("__typename", type: .nonNull(.scalar(String.self))),
GraphQLField("token", type: .scalar(String.self)),
GraphQLField("user", type: .object(User.selections)),
]
public var snapshot: Snapshot
public init(snapshot: Snapshot) {
self.snapshot = snapshot
}
public init(token: String? = nil, user: User? = nil) {
self.init(snapshot: ["__typename": "LoginUserWithAuth0SocialPayload", "token": token, "user": user.flatMap { $0.snapshot }])
}
public var __typename: String {
get {
return snapshot["__typename"]! as! String
}
set {
snapshot.updateValue(newValue, forKey: "__typename")
}
}
/// The id token of the logged in user issued from the
/// social authentication connection.
public var token: String? {
get {
return snapshot["token"] as? String
}
set {
snapshot.updateValue(newValue, forKey: "token")
}
}
/// The mutated User.
public var user: User? {
get {
return (snapshot["user"] as? Snapshot).flatMap { User(snapshot: $0) }
}
set {
snapshot.updateValue(newValue?.snapshot, forKey: "user")
}
}
public struct User: GraphQLSelectionSet {
public static let possibleTypes = ["User"]
public static let selections: [GraphQLSelection] = [
GraphQLField("__typename", type: .nonNull(.scalar(String.self))),
GraphQLField("id", type: .nonNull(.scalar(GraphQLID.self))),
GraphQLField("username", type: .nonNull(.scalar(String.self))),
]
public var snapshot: Snapshot
public init(snapshot: Snapshot) {
self.snapshot = snapshot
}
public init(id: GraphQLID, username: String) {
self.init(snapshot: ["__typename": "User", "id": id, "username": username])
}
public var __typename: String {
get {
return snapshot["__typename"]! as! String
}
set {
snapshot.updateValue(newValue, forKey: "__typename")
}
}
/// A globally unique ID.
public var id: GraphQLID {
get {
return snapshot["id"]! as! GraphQLID
}
set {
snapshot.updateValue(newValue, forKey: "id")
}
}
/// The user's username.
public var username: String {
get {
return snapshot["username"]! as! String
}
set {
snapshot.updateValue(newValue, forKey: "username")
}
}
}
}
}
}
public final class Auth0LoginMutation: GraphQLMutation {
public static let operationString =
"mutation Auth0Login($token: LoginUserWithAuth0Input!) {\n loginUserWithAuth0(input: $token) {\n __typename\n user {\n __typename\n id\n username\n }\n }\n}"
public var token: LoginUserWithAuth0Input
public init(token: LoginUserWithAuth0Input) {
self.token = token
}
public var variables: GraphQLMap? {
return ["token": token]
}
public struct Data: GraphQLSelectionSet {
public static let possibleTypes = ["Mutation"]
public static let selections: [GraphQLSelection] = [
GraphQLField("loginUserWithAuth0", arguments: ["input": GraphQLVariable("token")], type: .object(LoginUserWithAuth0.selections)),
]
public var snapshot: Snapshot
public init(snapshot: Snapshot) {
self.snapshot = snapshot
}
public init(loginUserWithAuth0: LoginUserWithAuth0? = nil) {
self.init(snapshot: ["__typename": "Mutation", "loginUserWithAuth0": loginUserWithAuth0.flatMap { $0.snapshot }])
}
public var loginUserWithAuth0: LoginUserWithAuth0? {
get {
return (snapshot["loginUserWithAuth0"] as? Snapshot).flatMap { LoginUserWithAuth0(snapshot: $0) }
}
set {
snapshot.updateValue(newValue?.snapshot, forKey: "loginUserWithAuth0")
}
}
public struct LoginUserWithAuth0: GraphQLSelectionSet {
public static let possibleTypes = ["LoginUserWithAuth0Payload"]
public static let selections: [GraphQLSelection] = [
GraphQLField("__typename", type: .nonNull(.scalar(String.self))),
GraphQLField("user", type: .object(User.selections)),
]
public var snapshot: Snapshot
public init(snapshot: Snapshot) {
self.snapshot = snapshot
}
public init(user: User? = nil) {
self.init(snapshot: ["__typename": "LoginUserWithAuth0Payload", "user": user.flatMap { $0.snapshot }])
}
public var __typename: String {
get {
return snapshot["__typename"]! as! String
}
set {
snapshot.updateValue(newValue, forKey: "__typename")
}
}
/// The mutated User.
public var user: User? {
get {
return (snapshot["user"] as? Snapshot).flatMap { User(snapshot: $0) }
}
set {
snapshot.updateValue(newValue?.snapshot, forKey: "user")
}
}
public struct User: GraphQLSelectionSet {
public static let possibleTypes = ["User"]
public static let selections: [GraphQLSelection] = [
GraphQLField("__typename", type: .nonNull(.scalar(String.self))),
GraphQLField("id", type: .nonNull(.scalar(GraphQLID.self))),
GraphQLField("username", type: .nonNull(.scalar(String.self))),
]
public var snapshot: Snapshot
public init(snapshot: Snapshot) {
self.snapshot = snapshot
}
public init(id: GraphQLID, username: String) {
self.init(snapshot: ["__typename": "User", "id": id, "username": username])
}
public var __typename: String {
get {
return snapshot["__typename"]! as! String
}
set {
snapshot.updateValue(newValue, forKey: "__typename")
}
}
/// A globally unique ID.
public var id: GraphQLID {
get {
return snapshot["id"]! as! GraphQLID
}
set {
snapshot.updateValue(newValue, forKey: "id")
}
}
/// The user's username.
public var username: String {
get {
return snapshot["username"]! as! String
}
set {
snapshot.updateValue(newValue, forKey: "username")
}
}
}
}
}
}
public final class CreateEventMutation: GraphQLMutation {
public static let operationString =
"mutation CreateEvent($event: CreateEventInput!) {\n createEvent(input: $event) {\n __typename\n changedEvent {\n __typename\n type\n fbID\n id\n }\n }\n}"
public var event: CreateEventInput
public init(event: CreateEventInput) {
self.event = event
}
public var variables: GraphQLMap? {
return ["event": event]
}
public struct Data: GraphQLSelectionSet {
public static let possibleTypes = ["Mutation"]
public static let selections: [GraphQLSelection] = [
GraphQLField("createEvent", arguments: ["input": GraphQLVariable("event")], type: .object(CreateEvent.selections)),
]
public var snapshot: Snapshot
public init(snapshot: Snapshot) {
self.snapshot = snapshot
}
public init(createEvent: CreateEvent? = nil) {
self.init(snapshot: ["__typename": "Mutation", "createEvent": createEvent.flatMap { $0.snapshot }])
}
/// Create objects of type Event.
public var createEvent: CreateEvent? {
get {
return (snapshot["createEvent"] as? Snapshot).flatMap { CreateEvent(snapshot: $0) }
}
set {
snapshot.updateValue(newValue?.snapshot, forKey: "createEvent")
}
}
public struct CreateEvent: GraphQLSelectionSet {
public static let possibleTypes = ["CreateEventPayload"]
public static let selections: [GraphQLSelection] = [
GraphQLField("__typename", type: .nonNull(.scalar(String.self))),
GraphQLField("changedEvent", type: .object(ChangedEvent.selections)),
]
public var snapshot: Snapshot
public init(snapshot: Snapshot) {
self.snapshot = snapshot
}
public init(changedEvent: ChangedEvent? = nil) {
self.init(snapshot: ["__typename": "CreateEventPayload", "changedEvent": changedEvent.flatMap { $0.snapshot }])
}
public var __typename: String {
get {
return snapshot["__typename"]! as! String
}
set {
snapshot.updateValue(newValue, forKey: "__typename")
}
}
/// The mutated Event.
public var changedEvent: ChangedEvent? {
get {
return (snapshot["changedEvent"] as? Snapshot).flatMap { ChangedEvent(snapshot: $0) }
}
set {
snapshot.updateValue(newValue?.snapshot, forKey: "changedEvent")
}
}
public struct ChangedEvent: GraphQLSelectionSet {
public static let possibleTypes = ["Event"]
public static let selections: [GraphQLSelection] = [
GraphQLField("__typename", type: .nonNull(.scalar(String.self))),
GraphQLField("type", type: .nonNull(.scalar(Dance.self))),
GraphQLField("fbID", type: .scalar(String.self)),
GraphQLField("id", type: .nonNull(.scalar(GraphQLID.self))),
]
public var snapshot: Snapshot
public init(snapshot: Snapshot) {
self.snapshot = snapshot
}
public init(type: Dance, fbId: String? = nil, id: GraphQLID) {
self.init(snapshot: ["__typename": "Event", "type": type, "fbID": fbId, "id": id])
}
public var __typename: String {
get {
return snapshot["__typename"]! as! String
}
set {
snapshot.updateValue(newValue, forKey: "__typename")
}
}
public var type: Dance {
get {
return snapshot["type"]! as! Dance
}
set {
snapshot.updateValue(newValue, forKey: "type")
}
}
public var fbId: String? {
get {
return snapshot["fbID"] as? String
}
set {
snapshot.updateValue(newValue, forKey: "fbID")
}
}
/// A globally unique ID.
public var id: GraphQLID {
get {
return snapshot["id"]! as! GraphQLID
}
set {
snapshot.updateValue(newValue, forKey: "id")
}
}
}
}
}
}
public final class FetchEventQuery: GraphQLQuery {
public static let operationString =
"query FetchEvent($where: EventWhereArgs!) {\n viewer {\n __typename\n allEvents(where: $where) {\n __typename\n edges {\n __typename\n node {\n __typename\n type\n fbID\n id\n workshops {\n __typename\n edges {\n __typename\n node {\n __typename\n name\n startTime\n artist\n room\n id\n }\n }\n }\n }\n }\n }\n }\n}"
public var `where`: EventWhereArgs
public init(`where`: EventWhereArgs) {
self.where = `where`
}
public var variables: GraphQLMap? {
return ["where": `where`]
}
public struct Data: GraphQLSelectionSet {
public static let possibleTypes = ["Query"]
public static let selections: [GraphQLSelection] = [
GraphQLField("viewer", type: .object(Viewer.selections)),
]
public var snapshot: Snapshot
public init(snapshot: Snapshot) {
self.snapshot = snapshot
}
public init(viewer: Viewer? = nil) {
self.init(snapshot: ["__typename": "Query", "viewer": viewer.flatMap { $0.snapshot }])
}
public var viewer: Viewer? {
get {
return (snapshot["viewer"] as? Snapshot).flatMap { Viewer(snapshot: $0) }
}
set {
snapshot.updateValue(newValue?.snapshot, forKey: "viewer")
}
}
public struct Viewer: GraphQLSelectionSet {
public static let possibleTypes = ["Viewer"]
public static let selections: [GraphQLSelection] = [
GraphQLField("__typename", type: .nonNull(.scalar(String.self))),
GraphQLField("allEvents", arguments: ["where": GraphQLVariable("where")], type: .object(AllEvent.selections)),
]
public var snapshot: Snapshot
public init(snapshot: Snapshot) {
self.snapshot = snapshot
}
public init(allEvents: AllEvent? = nil) {
self.init(snapshot: ["__typename": "Viewer", "allEvents": allEvents.flatMap { $0.snapshot }])
}
public var __typename: String {
get {
return snapshot["__typename"]! as! String
}
set {
snapshot.updateValue(newValue, forKey: "__typename")
}
}
/// Sift through all objects of type 'Event'.
public var allEvents: AllEvent? {
get {
return (snapshot["allEvents"] as? Snapshot).flatMap { AllEvent(snapshot: $0) }
}
set {
snapshot.updateValue(newValue?.snapshot, forKey: "allEvents")
}
}
public struct AllEvent: GraphQLSelectionSet {
public static let possibleTypes = ["EventConnection"]
public static let selections: [GraphQLSelection] = [
GraphQLField("__typename", type: .nonNull(.scalar(String.self))),
GraphQLField("edges", type: .list(.object(Edge.selections))),
]
public var snapshot: Snapshot
public init(snapshot: Snapshot) {
self.snapshot = snapshot
}
public init(edges: [Edge?]? = nil) {
self.init(snapshot: ["__typename": "EventConnection", "edges": edges.flatMap { $0.map { $0.flatMap { $0.snapshot } } }])
}
public var __typename: String {
get {
return snapshot["__typename"]! as! String
}
set {
snapshot.updateValue(newValue, forKey: "__typename")
}
}
/// The set of edges in this page.
public var edges: [Edge?]? {
get {
return (snapshot["edges"] as? [Snapshot?]).flatMap { $0.map { $0.flatMap { Edge(snapshot: $0) } } }
}
set {
snapshot.updateValue(newValue.flatMap { $0.map { $0.flatMap { $0.snapshot } } }, forKey: "edges")
}
}
public struct Edge: GraphQLSelectionSet {
public static let possibleTypes = ["EventEdge"]
public static let selections: [GraphQLSelection] = [
GraphQLField("__typename", type: .nonNull(.scalar(String.self))),
GraphQLField("node", type: .nonNull(.object(Node.selections))),
]
public var snapshot: Snapshot
public init(snapshot: Snapshot) {
self.snapshot = snapshot
}
public init(node: Node) {
self.init(snapshot: ["__typename": "EventEdge", "node": node.snapshot])
}
public var __typename: String {
get {
return snapshot["__typename"]! as! String
}
set {
snapshot.updateValue(newValue, forKey: "__typename")
}
}
/// The node value for the edge.
public var node: Node {
get {
return Node(snapshot: snapshot["node"]! as! Snapshot)
}
set {
snapshot.updateValue(newValue.snapshot, forKey: "node")
}
}
public struct Node: GraphQLSelectionSet {
public static let possibleTypes = ["Event"]
public static let selections: [GraphQLSelection] = [
GraphQLField("__typename", type: .nonNull(.scalar(String.self))),
GraphQLField("type", type: .nonNull(.scalar(Dance.self))),
GraphQLField("fbID", type: .scalar(String.self)),
GraphQLField("id", type: .nonNull(.scalar(GraphQLID.self))),
GraphQLField("workshops", type: .object(Workshop.selections)),
]
public var snapshot: Snapshot
public init(snapshot: Snapshot) {
self.snapshot = snapshot
}
public init(type: Dance, fbId: String? = nil, id: GraphQLID, workshops: Workshop? = nil) {
self.init(snapshot: ["__typename": "Event", "type": type, "fbID": fbId, "id": id, "workshops": workshops.flatMap { $0.snapshot }])
}
public var __typename: String {
get {
return snapshot["__typename"]! as! String
}
set {
snapshot.updateValue(newValue, forKey: "__typename")
}
}
public var type: Dance {
get {
return snapshot["type"]! as! Dance
}
set {
snapshot.updateValue(newValue, forKey: "type")
}
}
public var fbId: String? {
get {
return snapshot["fbID"] as? String
}
set {
snapshot.updateValue(newValue, forKey: "fbID")
}
}
/// A globally unique ID.
public var id: GraphQLID {
get {
return snapshot["id"]! as! GraphQLID
}
set {
snapshot.updateValue(newValue, forKey: "id")
}
}
public var workshops: Workshop? {
get {
return (snapshot["workshops"] as? Snapshot).flatMap { Workshop(snapshot: $0) }
}
set {
snapshot.updateValue(newValue?.snapshot, forKey: "workshops")
}
}
public struct Workshop: GraphQLSelectionSet {
public static let possibleTypes = ["WorkshopConnection"]
public static let selections: [GraphQLSelection] = [
GraphQLField("__typename", type: .nonNull(.scalar(String.self))),
GraphQLField("edges", type: .list(.object(Edge.selections))),
]
public var snapshot: Snapshot
public init(snapshot: Snapshot) {
self.snapshot = snapshot
}
public init(edges: [Edge?]? = nil) {
self.init(snapshot: ["__typename": "WorkshopConnection", "edges": edges.flatMap { $0.map { $0.flatMap { $0.snapshot } } }])
}
public var __typename: String {
get {
return snapshot["__typename"]! as! String
}
set {
snapshot.updateValue(newValue, forKey: "__typename")
}
}
/// The set of edges in this page.
public var edges: [Edge?]? {
get {
return (snapshot["edges"] as? [Snapshot?]).flatMap { $0.map { $0.flatMap { Edge(snapshot: $0) } } }
}
set {
snapshot.updateValue(newValue.flatMap { $0.map { $0.flatMap { $0.snapshot } } }, forKey: "edges")
}
}
public struct Edge: GraphQLSelectionSet {
public static let possibleTypes = ["WorkshopEdge"]
public static let selections: [GraphQLSelection] = [
GraphQLField("__typename", type: .nonNull(.scalar(String.self))),
GraphQLField("node", type: .nonNull(.object(Node.selections))),
]
public var snapshot: Snapshot
public init(snapshot: Snapshot) {
self.snapshot = snapshot
}
public init(node: Node) {
self.init(snapshot: ["__typename": "WorkshopEdge", "node": node.snapshot])
}
public var __typename: String {
get {
return snapshot["__typename"]! as! String
}
set {
snapshot.updateValue(newValue, forKey: "__typename")
}
}
/// The node value for the edge.
public var node: Node {
get {
return Node(snapshot: snapshot["node"]! as! Snapshot)
}
set {
snapshot.updateValue(newValue.snapshot, forKey: "node")
}
}
public struct Node: GraphQLSelectionSet {
public static let possibleTypes = ["Workshop"]
public static let selections: [GraphQLSelection] = [
GraphQLField("__typename", type: .nonNull(.scalar(String.self))),
GraphQLField("name", type: .nonNull(.scalar(String.self))),
GraphQLField("startTime", type: .nonNull(.scalar(String.self))),
GraphQLField("artist", type: .scalar(String.self)),
GraphQLField("room", type: .nonNull(.scalar(String.self))),
GraphQLField("id", type: .nonNull(.scalar(GraphQLID.self))),
]
public var snapshot: Snapshot
public init(snapshot: Snapshot) {
self.snapshot = snapshot
}
public init(name: String, startTime: String, artist: String? = nil, room: String, id: GraphQLID) {
self.init(snapshot: ["__typename": "Workshop", "name": name, "startTime": startTime, "artist": artist, "room": room, "id": id])
}
public var __typename: String {
get {
return snapshot["__typename"]! as! String
}
set {
snapshot.updateValue(newValue, forKey: "__typename")
}
}
public var name: String {
get {
return snapshot["name"]! as! String
}
set {
snapshot.updateValue(newValue, forKey: "name")
}
}
public var startTime: String {
get {
return snapshot["startTime"]! as! String
}
set {
snapshot.updateValue(newValue, forKey: "startTime")
}
}
public var artist: String? {
get {
return snapshot["artist"] as? String
}
set {
snapshot.updateValue(newValue, forKey: "artist")
}
}
public var room: String {
get {
return snapshot["room"]! as! String
}
set {
snapshot.updateValue(newValue, forKey: "room")
}
}
/// A globally unique ID.
public var id: GraphQLID {
get {
return snapshot["id"]! as! GraphQLID
}
set {
snapshot.updateValue(newValue, forKey: "id")
}
}
}
}
}
}
}
}
}
}
}
public final class FetchAllEventsQuery: GraphQLQuery {
public static let operationString =
"query FetchAllEvents {\n viewer {\n __typename\n allEvents {\n __typename\n edges {\n __typename\n node {\n __typename\n type\n fbID\n id\n }\n }\n }\n }\n}"
public init() {
}
public struct Data: GraphQLSelectionSet {
public static let possibleTypes = ["Query"]
public static let selections: [GraphQLSelection] = [
GraphQLField("viewer", type: .object(Viewer.selections)),
]
public var snapshot: Snapshot
public init(snapshot: Snapshot) {
self.snapshot = snapshot
}
public init(viewer: Viewer? = nil) {
self.init(snapshot: ["__typename": "Query", "viewer": viewer.flatMap { $0.snapshot }])
}
public var viewer: Viewer? {
get {
return (snapshot["viewer"] as? Snapshot).flatMap { Viewer(snapshot: $0) }
}
set {
snapshot.updateValue(newValue?.snapshot, forKey: "viewer")
}
}
public struct Viewer: GraphQLSelectionSet {
public static let possibleTypes = ["Viewer"]
public static let selections: [GraphQLSelection] = [
GraphQLField("__typename", type: .nonNull(.scalar(String.self))),
GraphQLField("allEvents", type: .object(AllEvent.selections)),
]
public var snapshot: Snapshot
public init(snapshot: Snapshot) {
self.snapshot = snapshot
}
public init(allEvents: AllEvent? = nil) {
self.init(snapshot: ["__typename": "Viewer", "allEvents": allEvents.flatMap { $0.snapshot }])
}
public var __typename: String {
get {
return snapshot["__typename"]! as! String
}
set {
snapshot.updateValue(newValue, forKey: "__typename")
}
}
/// Sift through all objects of type 'Event'.
public var allEvents: AllEvent? {
get {
return (snapshot["allEvents"] as? Snapshot).flatMap { AllEvent(snapshot: $0) }
}
set {
snapshot.updateValue(newValue?.snapshot, forKey: "allEvents")
}
}
public struct AllEvent: GraphQLSelectionSet {
public static let possibleTypes = ["EventConnection"]
public static let selections: [GraphQLSelection] = [
GraphQLField("__typename", type: .nonNull(.scalar(String.self))),
GraphQLField("edges", type: .list(.object(Edge.selections))),
]
public var snapshot: Snapshot
public init(snapshot: Snapshot) {
self.snapshot = snapshot
}
public init(edges: [Edge?]? = nil) {
self.init(snapshot: ["__typename": "EventConnection", "edges": edges.flatMap { $0.map { $0.flatMap { $0.snapshot } } }])
}
public var __typename: String {
get {
return snapshot["__typename"]! as! String
}
set {
snapshot.updateValue(newValue, forKey: "__typename")
}
}
/// The set of edges in this page.
public var edges: [Edge?]? {
get {
return (snapshot["edges"] as? [Snapshot?]).flatMap { $0.map { $0.flatMap { Edge(snapshot: $0) } } }
}
set {
snapshot.updateValue(newValue.flatMap { $0.map { $0.flatMap { $0.snapshot } } }, forKey: "edges")
}
}
public struct Edge: GraphQLSelectionSet {
public static let possibleTypes = ["EventEdge"]
public static let selections: [GraphQLSelection] = [
GraphQLField("__typename", type: .nonNull(.scalar(String.self))),
GraphQLField("node", type: .nonNull(.object(Node.selections))),
]
public var snapshot: Snapshot
public init(snapshot: Snapshot) {
self.snapshot = snapshot
}
public init(node: Node) {
self.init(snapshot: ["__typename": "EventEdge", "node": node.snapshot])
}
public var __typename: String {
get {
return snapshot["__typename"]! as! String
}
set {
snapshot.updateValue(newValue, forKey: "__typename")
}
}
/// The node value for the edge.
public var node: Node {
get {
return Node(snapshot: snapshot["node"]! as! Snapshot)
}
set {
snapshot.updateValue(newValue.snapshot, forKey: "node")
}
}
public struct Node: GraphQLSelectionSet {
public static let possibleTypes = ["Event"]
public static let selections: [GraphQLSelection] = [
GraphQLField("__typename", type: .nonNull(.scalar(String.self))),
GraphQLField("type", type: .nonNull(.scalar(Dance.self))),
GraphQLField("fbID", type: .scalar(String.self)),
GraphQLField("id", type: .nonNull(.scalar(GraphQLID.self))),
]
public var snapshot: Snapshot
public init(snapshot: Snapshot) {
self.snapshot = snapshot
}
public init(type: Dance, fbId: String? = nil, id: GraphQLID) {
self.init(snapshot: ["__typename": "Event", "type": type, "fbID": fbId, "id": id])
}
public var __typename: String {
get {
return snapshot["__typename"]! as! String
}
set {
snapshot.updateValue(newValue, forKey: "__typename")
}
}
public var type: Dance {
get {
return snapshot["type"]! as! Dance
}
set {
snapshot.updateValue(newValue, forKey: "type")
}
}
public var fbId: String? {
get {
return snapshot["fbID"] as? String
}
set {
snapshot.updateValue(newValue, forKey: "fbID")
}
}
/// A globally unique ID.
public var id: GraphQLID {
get {
return snapshot["id"]! as! GraphQLID
}
set {
snapshot.updateValue(newValue, forKey: "id")
}
}
}
}
}
}
}
}
public final class CreateWorkshopMutation: GraphQLMutation {
public static let operationString =
"mutation CreateWorkshop($workshop: CreateWorkshopInput!) {\n createWorkshop(input: $workshop) {\n __typename\n changedWorkshop {\n __typename\n name\n event {\n __typename\n id\n }\n startTime\n room\n }\n }\n}"
public var workshop: CreateWorkshopInput
public init(workshop: CreateWorkshopInput) {
self.workshop = workshop
}
public var variables: GraphQLMap? {
return ["workshop": workshop]
}
public struct Data: GraphQLSelectionSet {
public static let possibleTypes = ["Mutation"]
public static let selections: [GraphQLSelection] = [
GraphQLField("createWorkshop", arguments: ["input": GraphQLVariable("workshop")], type: .object(CreateWorkshop.selections)),
]
public var snapshot: Snapshot
public init(snapshot: Snapshot) {
self.snapshot = snapshot
}
public init(createWorkshop: CreateWorkshop? = nil) {
self.init(snapshot: ["__typename": "Mutation", "createWorkshop": createWorkshop.flatMap { $0.snapshot }])
}
/// Create objects of type Workshop.
public var createWorkshop: CreateWorkshop? {
get {
return (snapshot["createWorkshop"] as? Snapshot).flatMap { CreateWorkshop(snapshot: $0) }
}
set {
snapshot.updateValue(newValue?.snapshot, forKey: "createWorkshop")
}
}
public struct CreateWorkshop: GraphQLSelectionSet {
public static let possibleTypes = ["CreateWorkshopPayload"]
public static let selections: [GraphQLSelection] = [
GraphQLField("__typename", type: .nonNull(.scalar(String.self))),
GraphQLField("changedWorkshop", type: .object(ChangedWorkshop.selections)),
]
public var snapshot: Snapshot
public init(snapshot: Snapshot) {
self.snapshot = snapshot
}
public init(changedWorkshop: ChangedWorkshop? = nil) {
self.init(snapshot: ["__typename": "CreateWorkshopPayload", "changedWorkshop": changedWorkshop.flatMap { $0.snapshot }])
}
public var __typename: String {
get {
return snapshot["__typename"]! as! String
}
set {
snapshot.updateValue(newValue, forKey: "__typename")
}
}
/// The mutated Workshop.
public var changedWorkshop: ChangedWorkshop? {
get {
return (snapshot["changedWorkshop"] as? Snapshot).flatMap { ChangedWorkshop(snapshot: $0) }
}
set {
snapshot.updateValue(newValue?.snapshot, forKey: "changedWorkshop")
}
}
public struct ChangedWorkshop: GraphQLSelectionSet {
public static let possibleTypes = ["Workshop"]
public static let selections: [GraphQLSelection] = [
GraphQLField("__typename", type: .nonNull(.scalar(String.self))),
GraphQLField("name", type: .nonNull(.scalar(String.self))),
GraphQLField("event", type: .object(Event.selections)),
GraphQLField("startTime", type: .nonNull(.scalar(String.self))),
GraphQLField("room", type: .nonNull(.scalar(String.self))),
]
public var snapshot: Snapshot
public init(snapshot: Snapshot) {
self.snapshot = snapshot
}
public init(name: String, event: Event? = nil, startTime: String, room: String) {
self.init(snapshot: ["__typename": "Workshop", "name": name, "event": event.flatMap { $0.snapshot }, "startTime": startTime, "room": room])
}
public var __typename: String {
get {
return snapshot["__typename"]! as! String
}
set {
snapshot.updateValue(newValue, forKey: "__typename")
}
}
public var name: String {
get {
return snapshot["name"]! as! String
}
set {
snapshot.updateValue(newValue, forKey: "name")
}
}
/// The reverse field of 'workshops' in M:1 connection
/// with type 'Workshop'.
public var event: Event? {
get {
return (snapshot["event"] as? Snapshot).flatMap { Event(snapshot: $0) }
}
set {
snapshot.updateValue(newValue?.snapshot, forKey: "event")
}
}
public var startTime: String {
get {
return snapshot["startTime"]! as! String
}
set {
snapshot.updateValue(newValue, forKey: "startTime")
}
}
public var room: String {
get {
return snapshot["room"]! as! String
}
set {
snapshot.updateValue(newValue, forKey: "room")
}
}
public struct Event: GraphQLSelectionSet {
public static let possibleTypes = ["Event"]
public static let selections: [GraphQLSelection] = [
GraphQLField("__typename", type: .nonNull(.scalar(String.self))),
GraphQLField("id", type: .nonNull(.scalar(GraphQLID.self))),
]
public var snapshot: Snapshot
public init(snapshot: Snapshot) {
self.snapshot = snapshot
}
public init(id: GraphQLID) {
self.init(snapshot: ["__typename": "Event", "id": id])
}
public var __typename: String {
get {
return snapshot["__typename"]! as! String
}
set {
snapshot.updateValue(newValue, forKey: "__typename")
}
}
/// A globally unique ID.
public var id: GraphQLID {
get {
return snapshot["id"]! as! GraphQLID
}
set {
snapshot.updateValue(newValue, forKey: "id")
}
}
}
}
}
}
} | [
-1
] |
155e7387abe1b51738995cc6fdd366f8cb8b9fc4 | 5a85747d4a2792f62d279c721c2f4e71e2ddbb21 | /CaskCompanion1/WhiskyModel.swift | 4908fcafaa79f8bab6448d91b4f1ff9aa22f0b93 | [] | no_license | CasualJon/CaskCompanion | 2d5e59844f7291af1eb727df03cdbec920e214bf | b0311606b80f221ec1e6d2fcdbc86d87dfa899ff | refs/heads/master | 2021-09-10T18:18:21.867038 | 2018-03-30T20:20:24 | 2018-03-30T20:20:24 | 111,229,851 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 2,093 | swift | //
// WhiskyModel.swift
// CaskCompanion1
//
// Created by Jonathan Cyrus on 7/17/17.
// Copyright © 2018 Jon Cyrus. All rights reserved.
//
import Foundation
import AVFoundation
class WhiskyDo: NSObject {
/////////////////////////////////////////////////////////////////////////////////////
// Making DBManager class a Singleton (lol)
/////////////////////////////////////////////////////////////////////////////////////
static let shared: WhiskyDo = WhiskyDo()
/////////////////////////////////////////////////////////////////////////////////////
// Class Fields
/////////////////////////////////////////////////////////////////////////////////////
// Bool to enable/disable Debug Mode (mainly print to Console)
private var debugMode = true
private var player: AVAudioPlayer?
/////////////////////////////////////////////////////////////////////////////////////
// Methods
/////////////////////////////////////////////////////////////////////////////////////
// NAME: detailToConsole()
// PARAMS: option/detailToShow: String
// USAGE: Function takes a string passed from caller and prints data to the Console iff
// debugMode field = true
// RETURN: Void
func detailToConsole(option detailToShow: String) {
if debugMode {
print("Option Selected: \(detailToShow)")
}
return
}
// NAME: palySound()
// PARAMS: proAudioName: String!, audioType: String!
// USAGE: Function takes a string passed from caller and plays the associated audio file
// RETURN: Void
func playSound(proAudioName: String) {
let resourcePath = Bundle.main.resourceURL!
let audioURL = resourcePath.appendingPathComponent(proAudioName)
do {
let sound = try AVAudioPlayer(contentsOf: audioURL)
self.player = sound
sound.prepareToPlay()
sound.play()
} catch {
print("Error Playing the Audio File")
}
}
}
| [
-1
] |
01f7742ec6b620ea39ca34e62a1ec0ffdfa179a9 | b511453c8747e3379e1b9ada906d2053ca2bbdbd | /lemonios/SceneDelegate.swift | 9cec76a599b43b22234f93f34015857af47a1917 | [] | no_license | laosb/lemonios | ce2e4190dbd19b6445a299114890360e3bbf2d26 | b3555b78f789c0b2358d1312adb8d4064640abd3 | refs/heads/master | 2023-07-07T22:11:50.535246 | 2020-09-23T13:45:14 | 2020-09-23T13:45:14 | 191,941,492 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 4,243 | swift | //
// SceneDelegate.swift
// lemonios
//
// Created by Shibo Lyu on 2019/11/22.
// Copyright © 2019 Inkwire Tech (Hangzhou) Co., Ltd. All rights reserved.
//
//https://fleetingpixels.com/blog/2019/6/7/customising-nstoolbar-in-uikit-for-mac-marzipancatalyst
import UIKit
import os.log
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
var fired = false
let app = UIApplication.shared.delegate as! AppDelegate
func routeUrl(urlContexts: Set<UIOpenURLContext>) {
if let url = urlContexts.first?.url {
routeUrl(url: url)
} else {
fire(nativeLogin: false, route: nil)
}
}
func fire(nativeLogin: Bool, route: String?) {
if fired { return }
fired = true
let _ = Timer.scheduledTimer(withTimeInterval: 0.1, repeats: false) { _ in
self.fired = false
}
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let vc = storyboard.instantiateInitialViewController() as? UINavigationController
window?.rootViewController = vc
window?.makeKeyAndVisible()
let innerVc = vc?.viewControllers[0] as? ViewController
innerVc?.loadViewIfNeeded()
innerVc?.shortcutFired(nativeLogin: nativeLogin, route: route)
}
func routeUrl(url: URL) {
// MARK: URL Routing
guard
let components = NSURLComponents(url: url, resolvingAgainstBaseURL: true)
else {
fire(nativeLogin: false, route: nil)
return
}
let scheme = components.scheme
let host = components.host
let path = components.path
let params = components.queryItems
let hash = components.fragment
if scheme != "hduhelplemon" && (host?.hasSuffix("hduhelp.com") ?? true) {
UIApplication.shared.open(url)
}
if path == "/login", let auth = params?.first(where: { $0.name == "auth" }) {
app.token = auth.value
fire(nativeLogin: false, route: nil)
} else {
fire(nativeLogin: false, route: hash)
}
}
func routeShortcut(_ shortcut: String) {
let activities = ["schedule", "card"]
let sc = String(shortcut.split(separator: ".").last ?? "")
if activities.contains(sc) {
fire(nativeLogin: false, route: "/app/\(sc)")
}
}
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 doesn't imply the connecting scene or session are new
// (see `application:configurationForConnectingSceneSession` instead).
guard let _ = (scene as? UIWindowScene) else { return }
#if targetEnvironment(macCatalyst)
if let windowScene = scene as? UIWindowScene {
windowScene.sizeRestrictions?.minimumSize = CGSize(width: 700, height: 400)
if let titlebar = windowScene.titlebar {
titlebar.toolbar?.isVisible = false
titlebar.titleVisibility = .hidden
}
}
#endif
os_log("sh item %@", connectionOptions.shortcutItem?.type ?? "")
if let shortcutItem = connectionOptions.shortcutItem {
routeShortcut(shortcutItem.type)
}
routeUrl(urlContexts: connectionOptions.urlContexts)
}
func scene(_ scene: UIScene, continue userActivity: NSUserActivity) {
if userActivity.activityType == NSUserActivityTypeBrowsingWeb {
if let url = userActivity.webpageURL {
routeUrl(url: url)
}
} else {
fire(nativeLogin: false, route: nil)
}
}
func windowScene(
_ windowScene: UIWindowScene,
performActionFor shortcutItem: UIApplicationShortcutItem,
completionHandler: @escaping (Bool) -> Void
) {
routeShortcut(shortcutItem.type)
}
func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
routeUrl(urlContexts: URLContexts)
}
func sceneDidDisconnect(_ scene: UIScene) {}
func sceneDidBecomeActive(_ scene: UIScene) {}
func sceneWillResignActive(_ scene: UIScene) {}
func sceneWillEnterForeground(_ scene: UIScene) {}
func sceneDidEnterBackground(_ scene: UIScene) {}
}
| [
-1
] |
2b802c9155b2597f95c80574d610116ee8c4c467 | 95216db6174911f12ec8eedeae3d959032c5131b | /VideoAnalyz/AddViewController.swift | 20b56f331e93c1e1871f58a13cb940d6a9f08413 | [] | no_license | BigKingQY/VideoAnalyz | 8314c28921a8c70f6987d16691269412fe827968 | 41a8b3dd22ab4ff65b2873461b20f67eee63d6e2 | refs/heads/master | 2021-05-12T13:48:27.608986 | 2018-01-23T06:54:57 | 2018-01-23T06:54:57 | 116,940,164 | 1 | 1 | null | null | null | null | UTF-8 | Swift | false | false | 768 | swift | //
// AddViewController.swift
// VideoAnalyz
//
// Created by Administrator on 2017/12/8.
// Copyright © 2017年 Administrator. All rights reserved.
//
import UIKit
class AddViewController: UIViewController {
var segment: UISegmentedControl?
let backView = UIView()
var nameTextField:UITextField?
var urlTextField:UITextField?
var urlIdTextField:UITextField?
override func viewDidLoad() {
super.viewDidLoad()
}
override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
| [
-1
] |
1eb6e4e6845864f29dcad75061377a88449f725b | d110b331e56fa6f918ab77819f7c3bdb2ec5fe18 | /Sources/Utils/RoundGroupView/RoundGroupView.swift | b1c40db53f64e0948dc81f8629f3148083b84d27 | [] | no_license | haivato/vatoDriver | 16ab1fc36a555d4a4577006fd929fc042c425515 | 5b3661f426dfba94b1be2f3158af309695217bee | refs/heads/master | 2022-12-19T10:25:38.463063 | 2020-09-17T16:09:02 | 2020-09-17T16:09:02 | 295,749,102 | 1 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 2,558 | swift | // File name : RoundGroupView.swift
//
// Author : Dung Vu
// Created date: 2/20/20
// Version : 1.00
// --------------------------------------------------------------
// Copyright © 2020 Vato. All rights reserved.
// --------------------------------------------------------------
import UIKit
import FwiCore
import SnapKit
final class RoundGroupView: UIView {
/// Class's public properties.
private lazy var stackView: UIStackView = UIStackView()
private let edges: UIEdgeInsets
/// Class's private properties.
init(frame: CGRect, edges: UIEdgeInsets) {
self.edges = edges
super.init(frame: frame)
visualize()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
private func visualize() {
backgroundColor = #colorLiteral(red: 0.968627451, green: 0.968627451, blue: 0.968627451, alpha: 1)
layer.cornerRadius = 8
stackView >>> self >>> {
$0.distribution = .fill
$0.axis = .vertical
$0.spacing = 10
$0.snp.makeConstraints { (make) in
make.edges.equalTo(edges)
}
}
}
func update(sources: [String]) {
let views = stackView.arrangedSubviews
if !views.isEmpty {
views.forEach { (v) in
stackView.removeArrangedSubview(v)
v.removeFromSuperview()
}
}
guard !sources.isEmpty else {
return
}
sources.enumerated().forEach { (s) in
let label = UILabel(frame: .zero)
let style = NSMutableParagraphStyle()
style.lineSpacing = 8
let att = s.element.attribute >>> .color(c: #colorLiteral(red: 0.2901960784, green: 0.2901960784, blue: 0.2901960784, alpha: 1)) >>> .font(f: UIFont.systemFont(ofSize: 15, weight: .regular)) >>> .paragraph(p: style)
label.attributedText = att
label.numberOfLines = 0
label.setContentHuggingPriority(.defaultLow, for: .horizontal)
stackView.addArrangedSubview(label)
if s.offset > 0 {
let sperator = self.addSeperator(with: .zero, position: .bottom)
sperator.snp.remakeConstraints { (make) in
make.left.right.equalToSuperview()
make.top.equalTo(label.snp.top).offset(-4)
make.height.equalTo(0.5)
}
}
}
}
}
| [
-1
] |
e95c0d10101e0ae1644ae304d82a53a4c47b9598 | a77eeb7caaf5df4f4f4de3da77db1d4ebcdfccb6 | /Postcard/AppDelegate.swift | 3f613bd582bbcc525ade449638c1b5445a075308 | [] | no_license | majorcranky/Postcard | e8063da352cfe90707378fbdbb3bac91301d2fa3 | 42b5a604b5ff655385bacecdbf8ad8e20e6d5d42 | refs/heads/master | 2016-09-06T16:35:40.524795 | 2014-10-01T23:10:06 | 2014-10-01T23:10:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 2,144 | swift | //
// AppDelegate.swift
// Postcard
//
// Created by Rick Cormier on 9/29/14.
// Copyright (c) 2014 ShiftRight. 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,
294924,
229388,
278542,
229391,
327695,
278545,
229394,
278548,
229397,
229399,
229402,
278556,
229405,
278559,
229408,
278564,
294950,
229415,
229417,
237613,
229422,
229426,
237618,
229428,
286774,
229432,
286776,
319544,
286791,
237640,
278605,
237646,
311375,
163920,
311383,
278623,
278626,
319590,
311400,
278635,
303212,
278639,
278648,
131192,
237693,
327814,
303241,
417930,
311436,
319633,
286873,
286876,
311460,
32944,
327862,
286906,
180413,
286910,
131264,
286922,
286924,
286926,
319694,
286928,
131281,
278743,
278747,
295133,
155872,
319716,
278760,
237807,
303345,
131314,
286962,
327930,
278781,
278783,
278785,
237826,
319751,
278792,
286987,
319757,
311569,
286999,
287003,
287006,
287009,
287012,
287014,
287019,
311598,
287032,
155966,
278849,
319809,
319810,
319814,
311628,
229709,
287054,
319822,
278865,
229717,
196963,
196969,
139638,
213367,
106872,
319872,
311683,
65943,
311719,
278952,
139689,
278957,
311728,
278967,
180668,
311741,
278975,
319938,
278980,
98756,
278983,
319945,
278986,
319947,
278990,
278994,
279003,
279006,
172512,
279010,
279015,
172520,
319978,
279020,
172526,
279023,
311791,
279027,
319989,
164343,
180727,
279035,
311804,
287230,
279040,
303617,
287234,
279045,
287238,
172550,
172552,
303623,
320007,
279051,
172558,
279055,
303632,
279058,
303637,
279063,
279067,
172572,
279072,
172577,
295459,
172581,
295461,
279082,
311850,
279084,
172591,
172598,
279095,
172607,
172612,
377413,
172614,
172618,
303690,
33357,
287309,
279124,
172634,
262752,
311911,
189034,
295533,
189039,
189040,
172655,
172656,
352880,
189044,
295538,
172660,
287349,
287355,
287360,
295553,
287365,
311942,
303751,
352905,
279178,
287371,
311946,
287377,
311957,
221850,
287386,
303773,
164509,
295583,
172702,
230045,
287390,
172705,
287394,
172707,
303780,
287398,
279208,
287400,
172714,
295595,
279212,
189102,
172721,
287409,
303797,
189114,
287419,
303804,
328381,
279231,
287423,
287427,
312006,
279241,
107212,
172748,
287436,
172751,
295633,
172755,
303827,
279255,
172760,
279258,
287450,
213724,
189149,
303835,
303838,
279267,
312035,
295654,
279272,
312048,
312050,
230131,
205564,
295685,
230154,
33548,
312077,
295695,
369433,
295707,
328476,
295710,
303914,
279340,
205613,
279353,
230202,
222018,
295755,
377676,
287569,
279383,
279390,
230241,
279394,
303976,
336744,
303985,
303987,
328563,
279413,
303991,
303997,
295806,
295808,
295813,
304005,
320391,
213895,
304007,
304009,
304011,
230284,
304013,
279438,
213902,
295822,
189329,
189331,
279445,
58262,
279452,
410526,
279461,
279462,
304042,
213931,
230327,
304055,
304063,
295873,
189378,
213954,
304065,
213963,
304084,
304090,
320481,
304106,
320490,
312302,
328687,
320496,
312321,
295945,
295949,
197645,
230413,
140312,
238620,
197663,
304164,
189479,
304170,
238641,
312374,
238652,
230465,
238658,
296004,
336964,
238666,
296021,
402518,
336987,
230497,
296036,
361576,
296040,
164973,
279661,
279669,
337018,
279679,
279683,
222340,
296084,
238745,
304285,
238756,
205991,
165035,
337067,
165038,
238766,
304311,
230592,
279750,
230600,
230607,
148690,
279769,
304348,
279777,
304354,
296163,
279781,
304360,
279788,
320748,
279790,
320771,
312585,
230674,
320786,
230677,
296213,
296215,
320792,
230681,
173350,
312622,
296243,
312630,
222522,
222525,
230718,
296255,
378181,
230727,
222545,
230739,
312663,
222556,
337244,
312676,
230760,
173418,
230763,
230768,
296305,
230773,
279929,
304505,
304506,
181631,
312711,
288140,
230800,
288144,
304533,
288154,
337306,
288160,
288162,
279975,
304555,
370092,
279983,
173488,
279985,
312755,
296373,
279991,
312759,
337335,
173507,
296389,
222665,
230860,
280014,
230865,
288210,
370130,
222676,
288212,
280021,
288214,
239064,
288217,
288218,
280027,
288220,
329177,
239070,
288224,
280034,
288226,
280036,
288229,
320998,
370146,
280038,
288230,
288234,
288232,
288236,
288238,
288240,
288242,
296435,
288244,
296439,
288250,
148990,
296446,
206336,
321022,
296450,
402942,
230916,
214535,
230919,
370187,
304651,
222752,
108066,
296488,
230961,
288320,
288325,
124489,
280140,
280145,
288338,
280149,
288344,
280152,
239194,
280158,
181854,
370272,
403039,
239202,
312938,
280183,
280185,
280188,
280191,
280194,
116354,
280208,
280211,
288408,
280218,
280222,
190118,
321195,
321200,
296626,
296634,
280260,
280264,
280276,
313044,
321239,
280283,
288478,
321252,
313066,
280302,
288494,
280304,
313073,
419570,
288499,
288502,
280314,
288510,
67330,
280324,
280331,
198416,
280337,
296723,
116503,
321304,
329498,
296731,
313121,
313123,
304932,
321316,
280363,
141101,
165678,
280375,
321336,
296767,
345921,
280388,
304968,
280393,
280402,
313176,
280419,
321381,
296812,
313201,
1920,
255873,
305028,
280454,
247688,
280458,
280464,
124817,
280468,
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,
313386,
354348,
124978,
215090,
124980,
288826,
313406,
288831,
67654,
223303,
280651,
354382,
288848,
280658,
354390,
280669,
313438,
223327,
280671,
321634,
149603,
329830,
280681,
313451,
223341,
280687,
215154,
280691,
313458,
313464,
321659,
280702,
288895,
141446,
215175,
321670,
141455,
141459,
280725,
313498,
288936,
100520,
280747,
288940,
280755,
321717,
280759,
280764,
280769,
280771,
280774,
280776,
280783,
280786,
280788,
280793,
280796,
280798,
338147,
280804,
280807,
157930,
280811,
280817,
280819,
157940,
125171,
280823,
280825,
280827,
280830,
280831,
280833,
280835,
125187,
125191,
125207,
125209,
321817,
321842,
223539,
280888,
289087,
280897,
280900,
239944,
305480,
280906,
239947,
305485,
305489,
379218,
280919,
354653,
313700,
280937,
280940,
280946,
223606,
313720,
280956,
280959,
313731,
199051,
240011,
240017,
190868,
297365,
297368,
297372,
141725,
297377,
289186,
297391,
289201,
240052,
289207,
289210,
305594,
281024,
289221,
289227,
281045,
281047,
166378,
305647,
281075,
174580,
281084,
240124,
305662,
305664,
240129,
305666,
240132,
305668,
281095,
223752,
338440,
150025,
223757,
281102,
223765,
281113,
322074,
281116,
281121,
182819,
281127,
281135,
150066,
158262,
158266,
281154,
322115,
158283,
281163,
281179,
199262,
338528,
281190,
281196,
19053,
158317,
313973,
281210,
297594,
158347,
133776,
117398,
314007,
289436,
174754,
330404,
174764,
240309,
133817,
314045,
314047,
199364,
199367,
297671,
158409,
289493,
363234,
289513,
289522,
289525,
289532,
322303,
289537,
322310,
264969,
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,
240519,
322440,
314249,
240535,
289687,
297883,
289694,
289696,
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,
289991,
249045,
363745,
298216,
126190,
216303,
322801,
257302,
363802,
199976,
199978,
298292,
257334,
298306,
281923,
224584,
224587,
224594,
216404,
150870,
224603,
265568,
281960,
306539,
290161,
216436,
306549,
298358,
306552,
290171,
298365,
290174,
224641,
281987,
265604,
298372,
281990,
298377,
142733,
298381,
224657,
306581,
282025,
282027,
241068,
241070,
241072,
282034,
241077,
298424,
306618,
282044,
323015,
306635,
306640,
290263,
290270,
339431,
282089,
191985,
282098,
290291,
282101,
151036,
290302,
282111,
290305,
175621,
192008,
323084,
257550,
282127,
290321,
282130,
323090,
282133,
290325,
241175,
290328,
282137,
290332,
241181,
282142,
282144,
290344,
290349,
290351,
290356,
282186,
224849,
282195,
282199,
282201,
306778,
159324,
159330,
314979,
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,
282337,
216801,
241380,
216806,
323304,
282345,
12011,
282356,
323318,
282364,
282367,
306945,
241412,
323333,
282376,
216842,
323345,
282388,
323349,
282392,
184090,
315167,
282402,
315174,
282410,
241450,
306991,
315184,
323376,
315190,
241464,
282425,
307009,
241475,
307012,
148946,
315211,
282446,
315221,
282454,
323414,
315223,
241496,
241498,
307035,
307040,
282465,
110433,
241509,
110438,
110445,
282478,
282481,
110450,
315249,
315251,
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,
241640,
298984,
241643,
298988,
241646,
241649,
241652,
323574,
290807,
299006,
282623,
241669,
315397,
282632,
282639,
290835,
282645,
241693,
282654,
217127,
282669,
323630,
282681,
290877,
282687,
159811,
315463,
315466,
192589,
192596,
176213,
307287,
315482,
315483,
192605,
233567,
200801,
217188,
299109,
307303,
45163,
307307,
315502,
307314,
323700,
299126,
233591,
299136,
307329,
307338,
233613,
307352,
299164,
184479,
184481,
315557,
184486,
307370,
184492,
307372,
307374,
307376,
176311,
184503,
307386,
258235,
176316,
307388,
307390,
184512,
307394,
299204,
184518,
323784,
307409,
176343,
299225,
233701,
184572,
282881,
184579,
282893,
291089,
282906,
233766,
176435,
168245,
307510,
315701,
151864,
332086,
307515,
282942,
307518,
151874,
282947,
282957,
110926,
323917,
233808,
323921,
315733,
315739,
323932,
299357,
242018,
242024,
299373,
315757,
250231,
315771,
299388,
299398,
242057,
291212,
299405,
291222,
283033,
242075,
61855,
283042,
291238,
291241,
127403,
127405,
127407,
291247,
283062,
291254,
127417,
291260,
283069,
127421,
127429,
283080,
176592,
315856,
315860,
176597,
127447,
299481,
176605,
242143,
291299,
242152,
291305,
176620,
291314,
291317,
135672,
233979,
291323,
291330,
283142,
127497,
135689,
233994,
291341,
233998,
234003,
234006,
283161,
234010,
135707,
242206,
135710,
291361,
242220,
291378,
152118,
234038,
70213,
111193,
242275,
299620,
168562,
184952,
135805,
291456,
135808,
299655,
373383,
316051,
225941,
316054,
299672,
135834,
225948,
299677,
373404,
135839,
299680,
225954,
299684,
242343,
209576,
373421,
135870,
135873,
135876,
135879,
299720,
299723,
225998,
226002,
226005,
226008,
242396,
299740,
201444,
299750,
283368,
234219,
283372,
226037,
283382,
234231,
234236,
226045,
234239,
242431,
209665,
234242,
242436,
234246,
226056,
234248,
291593,
242443,
242445,
234254,
234258,
242450,
242452,
234261,
201496,
283421,
234269,
234272,
234274,
152355,
234278,
299814,
283432,
234281,
234284,
234287,
283440,
185138,
242483,
234292,
234296,
234298,
283452,
160572,
234302,
234307,
242499,
234309,
234313,
316235,
283468,
234316,
234319,
242511,
234321,
234324,
201557,
234329,
234333,
308063,
234336,
234338,
242530,
349027,
234344,
177004,
234350,
324464,
234353,
152435,
177011,
234356,
234358,
234362,
226171,
291711,
234368,
234370,
291714,
291716,
234373,
226182,
234375,
226185,
308105,
234379,
234384,
234388,
234390,
226200,
234393,
308123,
234396,
324508,
234398,
291742,
234401,
291748,
234405,
291750,
234407,
324518,
324520,
291754,
226220,
291756,
234414,
291760,
201650,
226230,
234422,
275384,
234428,
291773,
226239,
234431,
242623,
234434,
324548,
226245,
234437,
234439,
234443,
291788,
275406,
193486,
234446,
193488,
234449,
234452,
234455,
234459,
234461,
234464,
234467,
234470,
168935,
5096,
324585,
234475,
234478,
234481,
234484,
234485,
234487,
234490,
234493,
234496,
316416,
234501,
275462,
308231,
234504,
234507,
234510,
234515,
300054,
234519,
234520,
316439,
234523,
234528,
300066,
234532,
234535,
234537,
234540,
144430,
234543,
275508,
234549,
300085,
300088,
234556,
234558,
316479,
234561,
234563,
316483,
234568,
234570,
316491,
234572,
300108,
300115,
234580,
234581,
234585,
242777,
275545,
234590,
234595,
234597,
300133,
234601,
300139,
234605,
234607,
160879,
275569,
234610,
234614,
234618,
275579,
144506,
234620,
234623,
226433,
234627,
275588,
275594,
234634,
234636,
234640,
275602,
234643,
226453,
324757,
275606,
275608,
234647,
234648,
234650,
308373,
283805,
308379,
234653,
119967,
234657,
300189,
324766,
242852,
283813,
300197,
234664,
275626,
316596,
234687,
300226,
226500,
234692,
283844,
300229,
308420,
283850,
300234,
300238,
300241,
316625,
300243,
300245,
300248,
300253,
300256,
300258,
300260,
234726,
300263,
300265,
161003,
300267,
300270,
300272,
120053,
300278,
316663,
300284,
275710,
300287,
283904,
300289,
300292,
300294,
275719,
177419,
300299,
283917,
242957,
275725,
177424,
349464,
283939,
259367,
283951,
300344,
226617,
283963,
243003,
226628,
300357,
177482,
283983,
316758,
357722,
316766,
218464,
316768,
292197,
243046,
316774,
218473,
284010,
136562,
275834,
333178,
275836,
275840,
316806,
226696,
226699,
316811,
226703,
300433,
234899,
226709,
357783,
316826,
144796,
300448,
144810,
284076,
144812,
144814,
284084,
144820,
284087,
292279,
144826,
144828,
144830,
144832,
284099,
144835,
38342,
144839,
144841,
144844,
144847,
144852,
144855,
103899,
300507,
333280,
292329,
300523,
259565,
259567,
300527,
226802,
316917,
308727,
300537,
308757,
308762,
284191,
284194,
284196,
235045,
284199,
284206,
284209,
284211,
194101,
284213,
194103,
284215,
284218,
226877,
284223,
284226,
284228,
292421,
226886,
284231,
128584,
284234,
276043,
317004,
366155,
284238,
226895,
284241,
194130,
284243,
276052,
276053,
284245,
284247,
317015,
284249,
243290,
284251,
284253,
243293,
284255,
300638,
284258,
292452,
177766,
284263,
292454,
284265,
292458,
284267,
292461,
284274,
276086,
284278,
292470,
292473,
284283,
276093,
284286,
276095,
292479,
284288,
276098,
284290,
284292,
292485,
325250,
284297,
317066,
284299,
317068,
284301,
284303,
276114,
284306,
284308,
284312,
284314,
284316,
276127,
284322,
284327,
276137,
284329,
284331,
317098,
284333,
284335,
284337,
284339,
300726,
284343,
284346,
284350,
276160,
358080,
284354,
276166,
284358,
358089,
276170,
284362,
276175,
284368,
276177,
284370,
317138,
284372,
358098,
284377,
276187,
284379,
284381,
284384,
284386,
358116,
276197,
284392,
325353,
284394,
358122,
284397,
276206,
284399,
358126,
358128,
358133,
358135,
276216,
358138,
300795,
358140,
284413,
358142,
284418,
317187,
358146,
317191,
284428,
300816,
317207,
284440,
186139,
300828,
300830,
276255,
300832,
284449,
227109,
317221,
186151,
358183,
276268,
194351,
243504,
284469,
276280,
325436,
358206,
276291,
366406,
276295,
300872,
153417,
284499,
276308,
284502,
178006,
317271,
276315,
292700,
284511,
227175,
292715,
284529,
292721,
300915,
284533,
317306,
284540,
292734,
325512,
169868,
276365,
284566,
350106,
284572,
276386,
284579,
276388,
292776,
284585,
358312,
276395,
276402,
161718,
358326,
276410,
276411,
358330,
276418,
276425,
301009,
301011,
301013,
301015,
358360,
301017,
292828,
276446,
153568,
276448,
276452,
276455,
292843,
276460,
276464,
227314,
276466,
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,
325692,
178238,
276544,
284739,
276553,
194649,
227418,
309337,
194654,
227423,
178273,
227426,
276579,
194660,
227430,
276583,
292968,
309352,
276586,
301163,
309354,
276590,
227440,
284786,
276595,
292985,
301178,
292989,
292993,
301185,
227463,
301199,
350354,
350359,
276638,
284837,
153765,
227520,
227522,
301252,
227529,
301258,
276685,
276689,
301272,
276699,
194780,
309468,
301283,
317672,
276713,
243948,
194801,
227571,
276725,
309494,
243960,
276735,
227583,
227587,
276739,
211204,
276742,
227593,
227596,
325910,
309530,
342298,
276766,
211232,
276775,
211241,
325937,
276789,
325943,
260421,
276809,
285002,
276811,
276816,
235858,
276829,
276833,
276836,
276843,
293227,
276848,
293232,
186744,
285051,
211324,
227709,
317833,
178572,
285070,
178575,
285077,
178583,
227738,
317853,
276896,
317858,
342434,
285093,
285098,
276907,
276917,
293304,
293314,
293325,
317910,
293336,
235996,
317917,
293343,
358880,
276961,
227810,
293346,
276964,
293352,
236013,
293364,
317951,
309764,
236043,
317963,
342541,
55822,
113167,
277011,
317971,
309781,
55837,
227877,
227879,
227882,
293421,
105007,
236082,
285236,
23094,
277054,
244288,
129603,
301636,
277071,
285265,
277080,
309849,
285277,
285282,
326244,
277100,
277106,
121458,
170618,
170619,
309885,
309888,
277122,
227975,
277128,
285320,
301706,
318092,
326285,
318094,
334476,
277136,
277139,
227992,
285340,
318108,
227998,
318110,
285357,
318128,
277170,
342707,
154292,
277173,
293555,
285368,
277177,
277181,
318144,
277187,
277191,
277194,
277196,
277201,
137946,
113378,
203491,
228069,
277223,
342760,
285417,
56041,
277232,
228081,
56059,
310015,
285441,
310020,
285448,
285453,
310029,
228113,
285459,
277273,
326430,
228128,
228135,
318248,
277291,
318253,
285489,
293685,
285494,
285499,
301884,
310080,
277314,
277317,
277322,
277329,
162643,
310100,
301911,
277337,
301913,
301921,
400236,
236397,
162671,
326514,
277368,
15224,
236408,
416639,
416640,
113538,
310147,
416648,
277385,
39817,
187274,
301972,
424853,
277405,
310179,
293798,
293802,
236460,
277426,
293811,
293817,
293820,
203715,
326603,
293849,
293861,
228327,
228328,
228330,
318442,
277486,
326638,
318450,
293877,
285686,
302073,
285690,
121850,
293882,
302075,
293887,
277504,
277507,
277511,
277519,
293908,
277526,
293917,
293939,
318516,
277561,
277564,
7232,
310336,
293956,
277573,
228422,
293960,
277577,
310344,
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,
294026,
285835,
302218,
162964,
384148,
187542,
302231,
302233,
285852,
302237,
285854,
285862,
277671,
302248,
64682,
277678,
228526,
294063,
294065,
302258,
277687,
294072,
318651,
277695,
318657,
302275,
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,
228617,
138505,
318742,
204067,
277798,
277801,
113964,
285997,
277804,
277807,
285999,
113969,
277811,
318773,
277816,
318776,
286010,
277819,
294204,
277822,
417086,
286016,
294211,
302403,
277832,
277836,
277839,
326991,
277842,
277847,
277850,
179547,
277853,
277857,
302436,
277860,
294246,
327015,
277864,
310632,
327017,
351594,
277869,
277872,
351607,
277880,
310648,
310651,
277884,
277888,
310657,
310659,
277892,
294276,
277894,
327046,
253320,
310665,
277898,
318858,
351619,
277903,
310672,
277905,
351633,
277908,
277917,
277921,
310689,
277923,
130468,
228776,
277928,
277932,
310703,
277937,
130486,
310710,
277944,
310712,
277947,
310715,
277950,
277953,
64966,
277959,
163272,
245191,
302534,
310727,
277963,
277966,
302543,
277971,
277975,
228825,
163290,
277978,
277981,
310749,
277984,
310755,
277989,
277991,
187880,
277995,
286188,
310764,
278000,
278003,
228851,
278006,
40440,
278009,
212472,
40443,
286203,
228864,
286214,
228871,
302603,
65038,
302614,
286233,
286240,
146977,
187939,
40484,
294435,
40486,
286246,
286248,
278057,
40488,
294439,
40491,
294440,
294443,
294445,
310831,
212538,
40507,
40511,
40513,
228933,
40521,
286283,
40525,
40527,
228944,
212560,
400976,
40533,
147032,
40537,
278109,
40541,
40544,
40548,
40550,
40552,
286313,
40554,
310892,
40557,
40560,
188022,
122488,
294521,
343679,
278150,
310925,
286354,
278163,
302740,
278168,
327333,
229030,
212648,
278188,
302764,
278192,
319153,
278196,
319171,
302789,
294599,
278216,
294601,
278227,
229076,
319187,
286425,
319194,
278235,
229086,
278238,
286432,
294625,
294634,
302838,
319226,
286460,
171774,
278274,
302852,
302854,
294664,
311048,
319243,
311053,
294682,
278306,
294701,
278320,
319280,
319290,
229192,
302925,
237409,
360317,
327554,
40840,
40851,
294803,
188312,
294811,
319390,
294817,
40865,
319394,
294821,
180142,
188340,
40886,
319419,
294844,
294847,
393177,
294876,
294879,
294883,
294890,
311279,
278513,
237555,
278516,
278519,
237562
] |
99263d9ce77db08e4640de54aa892fcb5ef59509 | 6346563855f45d4aef90e2323b581aed9fedbc32 | /ImgurImagesVIPER/Service/ImagesBrowser/ImgurRequest.swift | 570267415dfcb702144e10f70d13a0efafd442a8 | [
"MIT"
] | permissive | IsaacSchz/ImgurBrowserVIPER | 30ddefd75d77932a1b5a9883e21cf95c2eb41b4a | 52e7a4ecd15417f5b056e71cad5ecdcfdd3c623a | refs/heads/master | 2022-12-09T22:34:03.125281 | 2020-08-28T16:05:34 | 2020-08-28T16:05:34 | 284,186,674 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 656 | swift | //
// ImgurRequest.swift
// ImgurImagesVIPER
//
// Created by Isaac Sanchez on 04/08/20.
// Copyright © 2020 Isaac Sanchez. All rights reserved.
//
struct ImgurRequest {
let baseUrlString: String
var pageNumber: String
let searchParameter: String
var searchQuery: String
var urlString: String
init(_ searchParameter: String) {
self.baseUrlString = ServiceConstants.baseURL
self.pageNumber = "0"
self.searchParameter = searchParameter
self.searchQuery = "?q=\(self.searchParameter)"
self.urlString = self.baseUrlString + "search/" + self.pageNumber + self.searchQuery
}
}
| [
-1
] |
f29f2974a7c86c844f42536d92db3a15169d5556 | 7e9ca9bff9ed95d667add1237acd18e9cc31e18e | /SnapchatClonePt3/CurrentUser.swift | dd200c4ca25b1539ac1bc6fa0c3ef5b853bc9e25 | [] | no_license | nmamoon/ios-decal-proj2-part2 | 47ac5a8df51948f45c02bf4d1817ad791a8b5b7e | 3e8e90671ad722cea5249944d66bf7a0bab995b7 | refs/heads/master | 2021-01-23T02:40:11.679169 | 2017-04-12T04:05:00 | 2017-04-12T04:05:00 | 86,015,193 | 0 | 0 | null | 2017-03-24T01:43:09 | 2017-03-24T01:43:09 | null | UTF-8 | Swift | false | false | 2,477 | swift | //
// CurrentUser.swift
// SnapchatClonePt3
//
// Created by SAMEER SURESH on 3/19/17.
// Copyright © 2017 iOS Decal. All rights reserved.
//
import Foundation
import FirebaseDatabase
import FirebaseAuth
class CurrentUser {
var username: String!
var id: String!
var readPostIDs: [String]?
let dbRef = FIRDatabase.database().reference()
init() {
let currentUser = FIRAuth.auth()?.currentUser
username = currentUser?.displayName
id = currentUser?.uid
}
/*
TODO:
Retrieve a list of post ID's that the user has already opened and return them as an array of strings.
Note that our database is set up to store a set of ID's under the readPosts node for each user.
Make a query to Firebase using the 'observeSingleEvent' function (with 'of' parameter set to .value) and retrieve the snapshot that is returned. If the snapshot exists, store its value as a [String:AnyObject] dictionary and iterate through its keys, appending the value corresponding to that key to postArray each time. Finally, call completion(postArray).
*/
func getReadPostIDs(completion: @escaping ([String]) -> Void) {
var postArray: [String] = []
// TODO
//Fireb
let refHandle = dbRef.child(id).observeSingleEvent(of: .value, with: {
(snapshot) in
if snapshot.exists() {
if let userDict = snapshot.value as? [String: AnyObject] {
for (key, value) in userDict {
postArray.append(value as! String)
}
completion(postArray)
} else {
completion(postArray)
}
} else {
completion(postArray)
}
})
}
/*
TODO:
Adds a new post ID to the list of post ID's under the user's readPosts node.
This should be fairly simple - just create a new child by auto ID under the readPosts node and set its value to the postID (string).
Remember to be very careful about following the structure of the User node before writing any data!
*/
func addNewReadPost(postID: String) {
// TODO
readPostIDs?.append(postID)
dbRef.child(firUsersNode).child(id).child(firReadPostsNode).childByAutoId().setValue(postID)
}
}
| [
-1
] |
0855345114789a8085219d1e20124890e5985ade | 45122baae4d51ebdf359f9c7ef045ceb3df29298 | /HomeGohan/HomeGohan/NewGroupViewController.swift | d9c66ca44976433e19739c48ec907c3c9e47e74e | [] | no_license | HomeGohan/HomeGohan-iOS | 4acdf270616d962977d0edcc659879ffaddb6a92 | 58e16cb500037fe9716ef05ec655c712e9b5e818 | refs/heads/master | 2020-05-20T06:06:14.584581 | 2016-09-16T06:14:17 | 2016-09-16T06:14:17 | 68,193,404 | 0 | 1 | null | null | null | null | UTF-8 | Swift | false | false | 4,747 | swift | //
// NewGroupViewController.swift
// HomeGohan
//
// Created by 松下慶大 on 2016/09/15.
// Copyright © 2016年 matsushita keita. All rights reserved.
//
import UIKit
class NewGroupViewController: UIViewController, UITableViewDelegate, UITableViewDataSource, UITextFieldDelegate {
@IBOutlet weak var textField: UITextField!
@IBOutlet weak var tableView: UITableView!
let searchUsers = SearchUsers.sharedInstance
var checkUserIds: [Int] = []
override func viewDidLoad() {
super.viewDidLoad()
title = "大切な人を探そう"
tableView.delegate = self
tableView.dataSource = self
tableView.registerCell("SearchUserCell")
tableView.registerCell("NoUserCell")
textField.delegate = self
searchUsers.users = []
navigationItem.leftBarButtonItem = UIBarButtonItem(image: UIImage(named: "hed_close"), style: .Done, target: self, action: #selector(NewGroupViewController.closeVC(_:)))
//MARK Keyboard Accessary
let keyboardCloseButton = UIButton(frame: CGRect(x: 0, y: 0, width: self.view.frame.width, height: 40))
keyboardCloseButton.backgroundColor = UIColor.mainColor()
keyboardCloseButton.setTitle("O K", forState: .Normal)
keyboardCloseButton.setTitleColor(UIColor.whiteColor(), forState: .Normal)
keyboardCloseButton.addTarget(self, action: #selector(NewGroupViewController.closeKeyboad(_:)), forControlEvents: .TouchUpInside)
textField.inputAccessoryView = keyboardCloseButton
textField.layer.borderWidth = 2
textField.layer.cornerRadius = 5
textField.layer.borderColor = UIColor.mainColor().CGColor
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
func closeKeyboad(sender: UIButton) {
textField.endEditing(true)
}
@IBAction func tapSearchButton(sender: UIButton) {
tableView.userInteractionEnabled = false
searchUsers.requestGetAllUsers(textField.text!) {
self.tableView.reloadData()
self.tableView.userInteractionEnabled = true
self.textField.endEditing(true)
}
}
@IBAction func tapCreateGroupButton(sender: UIButton) {
sender.enabled = false
Group.requestCreateGroup(checkUserIds) {
sender.enabled = true
self.dismissViewControllerAnimated(true, completion: nil)
}
}
func closeVC(sender: UIBarButtonItem) {
self.dismissViewControllerAnimated(true, completion: nil)
}
//MARK: Table View Delegate
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if searchUsers.users.isEmpty {
return 1
} else {
return searchUsers.users.count
}
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
if searchUsers.users.isEmpty {
let cell = tableView.dequeueReusableCellWithIdentifier("NoUserCell", forIndexPath: indexPath) as! NoUserCell
return cell
} else {
let cell = tableView.dequeueReusableCellWithIdentifier("SearchUserCell", forIndexPath: indexPath) as! SearchUserCell
let user = searchUsers.users[indexPath.row]
if checkUserIds.contains(user.id) {
cell.checkBoxImageView.highlighted = true
}
cell.fillWith(user)
return cell
}
}
//MARK: Table View Datasouce
func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
if searchUsers.users.isEmpty {
return 178
} else {
return 91
}
}
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
if searchUsers.users.isEmpty {
return
}
let selectUser = searchUsers.users[indexPath.row]
let cell = tableView.cellForRowAtIndexPath(indexPath) as! SearchUserCell
if checkUserIds.contains(selectUser.id) {
let index = checkUserIds.indexOf(selectUser.id)
checkUserIds.removeAtIndex(index!)
cell.checkBoxImageView.highlighted = false
return
}
checkUserIds.append(selectUser.id)
cell.checkBoxImageView.highlighted = true
}
func textFieldShouldReturn(textField: UITextField) -> Bool {
textField.endEditing(true)
return true
}
}
| [
-1
] |
372013a6de39cd0a7dcfaa14a6ae9c590548a9eb | b1a4273868308715827972e25c8d2518cfdf379c | /Swift/Do_it_Swift/190118_ImageView/190118_ImageView/ViewController.swift | 604f0db68bfb32b64ef3b8248036289876fddeaf | [] | no_license | HOEINNKIM/Self_Study_From_My_Mac | 0ee984963bfea57b19d4cd63253822d266effbfd | 569b874f15e32cd6a9bc400982080302db057074 | refs/heads/master | 2020-04-08T04:52:37.045106 | 2019-01-23T22:32:28 | 2019-01-23T22:32:28 | 159,035,856 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,468 | swift | //
// ViewController.swift
// 190118_ImageView
//
// Created by 김회인 on 18/01/2019.
// Copyright © 2019 HOEINN. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
var isZoom = false
var imgOn: UIImage?
var imgOff: UIImage?
@IBOutlet var imgView: UIImageView!
@IBOutlet var btnResize: UIButton!
override func viewDidLoad() {
super.viewDidLoad()
imgOn = UIImage(named: "lamp_on.png")
imgOff = UIImage(named: "lamp_off.png")
imgView.image = imgOn
}
@IBAction func btnResizeImage(_ sender: UIButton) {
let scale: CGFloat = 2.0
var newWidth: CGFloat, newHeight: CGFloat
if(isZoom){
newWidth = imgView.frame.width/scale
newHeight = imgView.frame.height/scale
btnResize.setTitle("확대", for: .normal)
} else {
newWidth = imgView.frame.width*scale
newHeight = imgView.frame.height*scale
btnResize.setTitle("축소", for: .normal)
}
imgView.frame.size = CGSize(width: newWidth, height: newHeight)
//boolean type을 반전
isZoom = !isZoom
}
@IBAction func switchImageOnOff(_ sender: UISwitch) {
if sender.isOn{
imgView.image = imgOn
} else {
imgView.image = imgOff
}
}
}
| [
-1
] |
b47981835ba14114cc8658ab8dd912baddb4b6f1 | f94cd70dcd5f0fa0a3866eb0bed533535c9b3745 | /Twitter-iOS/TweetCell.swift | ce9c63e04cea967c2d8de1adfda2711701f5f5dd | [
"Apache-2.0"
] | permissive | Naim08/iOS-Twitter | 2a73c9e38e7e8f818c9b65e10e2cc8acca4d05e0 | ce53fc331fd0dc7ba39dfff6d66e0b98c2f4f26f | refs/heads/master | 2021-01-10T15:52:03.577138 | 2016-03-05T18:31:30 | 2016-03-05T18:31:30 | 51,729,178 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 6,399 | swift | //
// TweetCell.swift
// Twitter-iOS
//
// Created by Md Miah on 2/22/16.
// Copyright © 2016 Naim. All rights reserved.
//
import UIKit
import RelativeFormatter
import AFNetworking
class TweetCell: UITableViewCell {
@IBOutlet weak var likeLabel: UILabel!
@IBOutlet weak var retweetlabel: UILabel!
@IBOutlet weak var favoriteButton: UIButton!
@IBOutlet weak var retweetButton: UIButton!
@IBOutlet weak var profileImage: UIImageView!
@IBOutlet weak var timeLabel: UILabel!
@IBOutlet weak var tweetLabel: UILabel!
@IBOutlet weak var usernameLabel: UILabel!
@IBOutlet weak var nameLabel: UILabel!
@IBOutlet weak var retweetLabel: UILabel!
let profileTap = UITapGestureRecognizer()
var tweetID: String?
var tweet: Tweet! {
didSet {
nameLabel.text = tweet.user?.name
usernameLabel.text = "@\((tweet.user?.screenname)!)"
tweetLabel.text = tweet.text
timeLabel.text = tweet.timeAgo
profileImage.setImageWithURL((tweet.user?.imageURL)!)
likeLabel.text = "\(tweet.favoritesCount!)"
retweetlabel.text = "\(tweet.retweetsCount!)"
retweetlabel.text! == "0" ? (retweetlabel.hidden = true) : (retweetlabel.hidden = false)
likeLabel.text! == "0" ? (likeLabel.hidden = true) : (likeLabel.hidden = false)
if tweet.favorited == true {
favoriteButton.setImage(UIImage(named: "like-action-on.png"), forState: UIControlState.Normal)
} else {
favoriteButton.setImage(UIImage(named: "like-action.png"), forState: UIControlState.Normal)
}
if tweet.retweeted == true {
retweetButton.setImage(UIImage(named: "retweet-action-on.png"), forState: UIControlState.Normal)
} else {
retweetButton.setImage(UIImage(named: "retweet-action.png"), forState: UIControlState.Normal)
}
tweetID = tweet.idStr!
}
}
override func awakeFromNib() {
super.awakeFromNib()
profileImage.layer.cornerRadius = 3
profileImage.clipsToBounds = true
profileTap.addTarget(self, action: Selector("onProfileImageTap:"))
profileImage.addGestureRecognizer(profileTap)
profileImage.userInteractionEnabled = true
nameLabel.preferredMaxLayoutWidth = nameLabel.frame.size.width
}
override func setSelected(selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
@IBAction func onReply(sender: AnyObject) {
NSNotificationCenter.defaultCenter().postNotificationName("replied", object: nil, userInfo: ["repliedToTweet": tweet])
}
@IBAction func onRetweet(sender: AnyObject) {
if tweet.retweeted == false {
TwitterClient.sharedInstance.retweetWithParams(self.tweetID!, params: nil, completion: { (error) -> ()in
self.retweetButton.setImage(UIImage(named: "retweet-action-on-pressed_green.png"), forState: UIControlState.Selected)
self.retweetButton.setImage(UIImage(named: "retweet-action-on.png"), forState: UIControlState.Normal)
self.tweet.retweeted = true
if self.retweetlabel.text! > "0" {
self.retweetlabel.text = String(self.tweet!.retweetsCount! + 1)
} else {
self.retweetlabel.hidden = false
self.retweetlabel.text = String(self.tweet!.retweetsCount! + 1)
}
})
} else {
TwitterClient.sharedInstance.unretweetWithParams(self.tweetID!, tweet: tweet, params: nil, completion: { (error) -> () in
self.retweetButton.setImage(UIImage(named: "retweet-action-on-pressed_green.png"), forState: UIControlState.Selected)
self.retweetButton.setImage(UIImage(named: "retweet-action.png"), forState: UIControlState.Normal)
self.tweet.retweeted = false
if self.retweetlabel.text! > "0" {
self.retweetlabel.text = String(self.tweet!.retweetsCount!)
} else {
self.retweetlabel.hidden = false
self.retweetlabel.text = String(self.tweet!.retweetsCount!)
}
})
}
}
@IBAction func onLike(sender: AnyObject) {
if tweet.favorited == false {
TwitterClient.sharedInstance.favoriteWithParams(self.tweetID!, params: nil, completion: { (error) -> ()in
self.favoriteButton.setImage(UIImage(named: "like-action-on-pressed-red.png"), forState: UIControlState.Selected)
self.favoriteButton.setImage(UIImage(named: "like-action-on.png"), forState: UIControlState.Normal)
self.tweet.favorited = true
if self.likeLabel.text! > "0" {
self.likeLabel.text = String(self.tweet!.favoritesCount! + 1)
} else {
self.likeLabel.hidden = false
self.likeLabel.text = String(self.tweet!.favoritesCount! + 1)
}
})
} else {
TwitterClient.sharedInstance.unfavoriteWithParams(self.tweetID!, params: nil, completion: { (error) -> () in
self.favoriteButton.setImage(UIImage(named: "like-action-on-pressed-red.png"), forState: UIControlState.Selected)
self.favoriteButton.setImage(UIImage(named: "like-action.png"), forState: UIControlState.Normal)
self.tweet.favorited = false
if self.likeLabel.text! > "0" {
self.likeLabel.text = String(self.tweet!.favoritesCount!)
} else {
self.likeLabel.hidden = false
self.likeLabel.text = String(self.tweet!.favoritesCount!)
}
})
}
}
func onProfileImageTap(recognizer: UITapGestureRecognizer) {
print(tweet.user!)
NSNotificationCenter.defaultCenter().postNotificationName("profileTapNotification", object: nil, userInfo: ["user" : tweet.user!])
}
}
| [
-1
] |
c460b5e5e0de1baaf26900bfc2898377a5715e1a | d8febb662a8214f433a44139994bb992c537a86f | /Creativity - Ep.1/Classes/tableCell.swift | 6b7f28387e33756909dd77e631485b7816bde30f | [] | no_license | julianmino/Creativity-Ep.1 | 320d4ed525687d3fad6cad04e53dc551bb408216 | aef075bc9a7042d5ad8b1d6cb2d0de805f906980 | refs/heads/master | 2021-01-04T05:07:19.362130 | 2020-02-14T00:51:20 | 2020-02-14T00:51:20 | 240,400,103 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 487 | swift | //
// tableCell.swift
// Creativity - Ep.1
//
// Created by Julian Mino on 03/12/2019.
// Copyright © 2019 Julian Mino. All rights reserved.
//
import UIKit
class tableCell: UITableViewCell {
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
}
}
| [
148640,
37218,
37219,
148644,
351386,
245522,
307218,
177014,
358875,
148634,
305659
] |
d9628db25cf28fb1f60ab059574f0559970bc3fb | 29e219c30ac2734f830e99e2c3c4f92bd6c3267a | /Swift Chat/Models/MKMessage.swift | 2301169dc3266612f94cb209b679432af1d0b6e7 | [] | no_license | mq162/Swift-Chat | 724d070aa48bdb72edf3b89d360a0e8007454a7b | def2bf1e4357b2f2da0fe0adf36619e01b94ae56 | refs/heads/master | 2022-08-30T07:31:02.606237 | 2020-05-27T09:03:18 | 2020-05-27T09:03:18 | 267,270,045 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 2,337 | swift | //
// Message.swift
// Swift Chat
//
// Created by apple on 5/10/20.
// Copyright © 2020 Minh Quang. All rights reserved.
//
import Foundation
import MessageKit
import CoreLocation
struct MKUser: SenderType, Equatable {
var senderId: String
var displayName: String
}
struct MKPhotoItem: MediaItem {
var url: URL?
var image: UIImage?
var placeholderImage: UIImage
var size: CGSize
init(image: UIImage) {
self.image = image
self.size = CGSize(width: 240, height: 240)
self.placeholderImage = UIImage()
}
}
struct MKLocationItem: LocationItem {
var location: CLLocation
var size: CGSize
init(location: CLLocation) {
self.location = location
self.size = CGSize(width: 240, height: 240)
}
}
struct MKMessage: MessageType {
var messageId: String
var sender: SenderType {
return user
}
var sentDate: Date
var kind: MessageKind
var user: MKUser
var senderLink: String
var locationItem: MKLocationItem?
var photoItem: MKPhotoItem?
private init(kind: MessageKind, user: MKUser, messageId: String, date: Date, senderLink: String) {
self.kind = kind
self.user = user
self.messageId = messageId
self.sentDate = date
self.senderLink = senderLink
}
init(custom: Any?, user: MKUser, messageId: String, date: Date, senderLink: String) {
self.init(kind: .custom(custom), user: user, messageId: messageId, date: date, senderLink: senderLink)
}
init(text: String, user: MKUser, messageId: String, date: Date, senderLink: String) {
self.init(kind: .text(text), user: user, messageId: messageId, date: date, senderLink: senderLink)
}
init(image: UIImage, user: MKUser, messageId: String, date: Date, senderLink: String) {
let mediaItem = MKPhotoItem(image: image)
self.init(kind: .photo(mediaItem), user: user, messageId: messageId, date: date, senderLink: senderLink)
}
init(location: CLLocation, user: MKUser, messageId: String, date: Date, senderLink: String) {
let locationItem = MKLocationItem(location: location)
self.init(kind: .location(locationItem), user: user, messageId: messageId, date: date, senderLink: senderLink)
}
}
| [
-1
] |
db783b707918c829ab7d0823bc797f39769ad39d | 09ca253947fb8df88b851948a538d39d187f021c | /Testable/Classes/Spy.swift | 1fc79db585a34899f62210f5258906fdf9b550f7 | [
"MIT"
] | permissive | pimnijman/Testable | cae1cccc575784451c6be6a4a9a4f39e80b9e71c | 9b834eca2c5471f1ce4acf2b7fc4e7fdfd2c8c7a | refs/heads/master | 2021-01-19T15:12:05.519271 | 2017-10-09T14:51:59 | 2017-10-09T14:51:59 | 88,204,310 | 5 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 3,413 | swift | //
// Spy.swift
// Pods
//
// Created by Pim on 09-04-17.
//
//
import Foundation
public class Spy {
enum Verb {
case get
case set
}
public struct Call {
public let args: [Any?]
}
let declarationName: String
let verb: Verb?
/// The recorded calls.
public private(set) var calls: [Call] = []
/// The number of recorded calls.
public var callCount: Int {
return calls.count
}
/// A Boolean value indicating whether at least one call was recorded.
public var called: Bool {
return callCount > 0
}
/// A Boolean value indicating whether no calls were recorded.
public var notCalled: Bool {
return callCount == 0
}
/// A Boolean value indicating whether exactly one call was recorded.
public var calledOnce: Bool {
return callCount == 1
}
/// A Boolean value indicating whether exactly two calls were recorded.
public var calledTwice: Bool {
return callCount == 2
}
/// A Boolean value indicating whether exactly three calls were recorded.
public var calledThrice: Bool {
return callCount == 3
}
/// The first call that was recorded.
public var firstCall: Call? {
return calls.first
}
/// The second call that was recorded.
public var secondCall: Call? {
let index = 1
return calls.indices.contains(index) ? calls[index] : nil
}
/// The third call that was recorded.
public var thirdCall: Call? {
let index = 2
return calls.indices.contains(index) ? calls[index] : nil
}
/// The last call that was recorded.
public var lastCall: Call? {
return calls.last
}
init(declarationName: String, verb: Verb?) {
self.declarationName = declarationName
self.verb = verb
}
func recordCall(withArgs args: [Any?] = []) {
calls.append(Call(args: args))
}
func recordCall(withValue value: Any?) {
calls.append(Call(args: [ value ]))
}
private func callCount(withArgs args: [Any]) -> Int {
return calls.filter { (call) -> Bool in
guard args.count <= call.args.count else {
// The number of provided arguments is greater than the number of recorded arguments
return false
}
for i in 0 ..< args.count {
guard let a = args[i] as? NSObject, let b = call.args[i] as? NSObject else { return false }
if a != b { return false }
}
return true
}.count
}
/// Returns the number of times a call was recorded with with the provided arguments.
public func callCount(withArgs args: Any...) -> Int {
return callCount(withArgs: args)
}
/// Returns a Boolean value indicating whether at least one call was recorded with the provided arguments.
public func called(withArgs args: Any...) -> Bool {
return callCount(withArgs: args) > 0
}
/// Returns a Boolean value indicating whether all calls were recorded with the provided arguments.
public func alwaysCalled(withArgs args: Any...) -> Bool {
return callCount(withArgs: args) == callCount
}
/// Reset the state of the spy.
public func reset() {
calls.removeAll()
}
}
| [
-1
] |
b28c0e5e7ffa8f33e2ec799557b14ae18da47231 | 5d2003140c99f501cca2c2ceaf5a99aa4eaf7474 | /iOS/beginning-iphone-development-with-swift/02-hello-world/Hello World/Hello World/AppDelegate.swift | 9074acfe207e4ded1019da8cfb80609abe1d67d0 | [] | no_license | pheihuihui/learn-to-code | 13d35ff923deaaa7d5d045209e98fea314771d67 | bb517bf649eec5f00c89f404eb301ffc854cdb69 | refs/heads/master | 2022-07-12T20:53:04.769082 | 2022-07-04T13:45:55 | 2022-07-04T13:45:55 | 126,029,751 | 2 | 0 | null | 2021-08-31T20:26:52 | 2018-03-20T14:24:17 | Swift | UTF-8 | Swift | false | false | 2,175 | swift | //
// AppDelegate.swift
// Hello World
//
// Created by feihuihui on 2018/11/21.
// Copyright © 2018 feihuihui. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}
func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
}
| [
229380,
229383,
229385,
278539,
294924,
229388,
278542,
327695,
229391,
229394,
278548,
229397,
229399,
229402,
352284,
229405,
278556,
278559,
229408,
294950,
229415,
229417,
327722,
237613,
229422,
360496,
237618,
229426,
229428,
311349,
286774,
286776,
319544,
286778,
229432,
204856,
352318,
286791,
237640,
286797,
278605,
311375,
163920,
237646,
196692,
319573,
311383,
278623,
278626,
319590,
311400,
278635,
303212,
278639,
131192,
237693,
303230,
327814,
303241,
131209,
417930,
303244,
311436,
319633,
286873,
286876,
311460,
311469,
32944,
327862,
286906,
327866,
180413,
286910,
131264,
286916,
295110,
286922,
286924,
286926,
319694,
286928,
131281,
278743,
278747,
295133,
155872,
319716,
237807,
303345,
286962,
303347,
131314,
229622,
327930,
278781,
278783,
278785,
237826,
319751,
278792,
286987,
319757,
311569,
286999,
319770,
287003,
287006,
287009,
287012,
287014,
287016,
287019,
311598,
287023,
262448,
311601,
295220,
287032,
155966,
319809,
319810,
278849,
319814,
311623,
319818,
311628,
229709,
319822,
287054,
278865,
229717,
196963,
196969,
139638,
213367,
106872,
319872,
311683,
319879,
311693,
65943,
319898,
311719,
278952,
139689,
278957,
311728,
278967,
180668,
311741,
278975,
319938,
278980,
98756,
278983,
319945,
278986,
319947,
278990,
278994,
311767,
279003,
279006,
188895,
172512,
287202,
279010,
279015,
172520,
319978,
279020,
172526,
311791,
279023,
172529,
279027,
319989,
172534,
180727,
164343,
279035,
311804,
287230,
279040,
303617,
287234,
279045,
172550,
303623,
172552,
320007,
287238,
279051,
172558,
279055,
303632,
279058,
303637,
279063,
279067,
172572,
279072,
172577,
295459,
172581,
295461,
311850,
279082,
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,
189040,
172660,
287349,
189044,
189039,
287355,
287360,
295553,
172675,
295557,
311942,
303751,
287365,
352905,
311946,
287371,
279178,
311951,
287377,
172691,
287381,
311957,
221850,
287386,
230045,
172702,
287390,
303773,
172705,
287394,
172707,
303780,
164509,
287398,
205479,
287400,
279208,
172714,
295595,
279212,
189102,
172721,
287409,
66227,
303797,
189114,
287419,
303804,
328381,
287423,
328384,
172737,
279231,
287427,
312005,
312006,
107208,
172748,
287436,
107212,
172751,
287440,
295633,
172755,
303827,
279255,
172760,
287450,
303835,
279258,
189149,
303838,
213724,
312035,
279267,
295654,
279272,
230128,
312048,
312050,
230131,
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,
189325,
213902,
189329,
295825,
304019,
279438,
189331,
58262,
304023,
304027,
279452,
410526,
279461,
279462,
304042,
213931,
230327,
304055,
287675,
197564,
230334,
304063,
238528,
304065,
213954,
189378,
156612,
295873,
213963,
197580,
312272,
304084,
304090,
320481,
304106,
320490,
312302,
328687,
320496,
304114,
295928,
320505,
312321,
295945,
230413,
197645,
295949,
320528,
140312,
295961,
238620,
197663,
304164,
304170,
304175,
238641,
312374,
238652,
238655,
230465,
238658,
336964,
296004,
205895,
320584,
238666,
296021,
402518,
336987,
230497,
296036,
296040,
361576,
205931,
296044,
164973,
205934,
312432,
279669,
337018,
189562,
279679,
304258,
279683,
222340,
205968,
296084,
238745,
304285,
238756,
205991,
222377,
165035,
337067,
238766,
165038,
230576,
238770,
304311,
230592,
312518,
279750,
230600,
230607,
148690,
320727,
279769,
304348,
279777,
304354,
296163,
320740,
279781,
304360,
320748,
279788,
279790,
304370,
296189,
320771,
312585,
296202,
296205,
230674,
320786,
230677,
296213,
230679,
320792,
230681,
296215,
214294,
304416,
230689,
173350,
312622,
296243,
312630,
222522,
296253,
222525,
296255,
312639,
230718,
296259,
378181,
296262,
230727,
238919,
296264,
320840,
296267,
296271,
222545,
230739,
312663,
222556,
337244,
230752,
312676,
230760,
173418,
148843,
410987,
230763,
230768,
296305,
312692,
230773,
304505,
304506,
181626,
279929,
181631,
148865,
312711,
312712,
296331,
288140,
288144,
230800,
304533,
288154,
337306,
288160,
173472,
288162,
288164,
279975,
304555,
370092,
279983,
173488,
288176,
279985,
312755,
296373,
312759,
279991,
288185,
337335,
222652,
312766,
173507,
296389,
222665,
230860,
312783,
288208,
230865,
148946,
370130,
222676,
288210,
288212,
288214,
280021,
329177,
288217,
288218,
280027,
288220,
239070,
239064,
288224,
370146,
280034,
288226,
288229,
280036,
280038,
288232,
288230,
288234,
320998,
288236,
288238,
288240,
288242,
296435,
288244,
288250,
296446,
321022,
402942,
148990,
296450,
206336,
230916,
230919,
214535,
230923,
304651,
304653,
370187,
402969,
230940,
222752,
108066,
296486,
296488,
157229,
239152,
230961,
157236,
288320,
288325,
124489,
280140,
280145,
288338,
280149,
288344,
280152,
239194,
280158,
403039,
370272,
181854,
239202,
370279,
312938,
280183,
280185,
280188,
280191,
116354,
280194,
280208,
280211,
288408,
280218,
280222,
419489,
190118,
198310,
321195,
296622,
321200,
337585,
296626,
296634,
296637,
419522,
313027,
280260,
419525,
206536,
280264,
206539,
206541,
206543,
313044,
280276,
321239,
280283,
313052,
18140,
288478,
313055,
321252,
313066,
288494,
280302,
280304,
313073,
321266,
288499,
419570,
288502,
280314,
288510,
124671,
67330,
280324,
198405,
280331,
198416,
280337,
296723,
116503,
321304,
329498,
296731,
321311,
313121,
313123,
304932,
321316,
280363,
141101,
165678,
280375,
321336,
296767,
288576,
345921,
337732,
280388,
304968,
280393,
280402,
173907,
313171,
313176,
42842,
280419,
321381,
296809,
296812,
313201,
1920,
255873,
305028,
280454,
247688,
280464,
124817,
280468,
239510,
280473,
124827,
214940,
247709,
214944,
280487,
313258,
321458,
296883,
124853,
214966,
296890,
10170,
288700,
296894,
190403,
296900,
280515,
337862,
165831,
280521,
231379,
296921,
354265,
354270,
239586,
313320,
354281,
231404,
124913,
165876,
321528,
239612,
313340,
288764,
239617,
313347,
288773,
313358,
305176,
313371,
354338,
305191,
223273,
313386,
354348,
124978,
215090,
124980,
288824,
288826,
321595,
378941,
313406,
288831,
288836,
67654,
280651,
354382,
288848,
280658,
215123,
354390,
288855,
288859,
280669,
313438,
149599,
280671,
149601,
321634,
149603,
223327,
329830,
280681,
313451,
223341,
280687,
149618,
215154,
313458,
280691,
313464,
329850,
321659,
280702,
288895,
321670,
215175,
141446,
141455,
275606,
141459,
280725,
313498,
100520,
288936,
280747,
288940,
288947,
280755,
321717,
280759,
280764,
280769,
280771,
280774,
280776,
313548,
321740,
280783,
280786,
280788,
313557,
280793,
280796,
280798,
338147,
280804,
280807,
157930,
280811,
280817,
125171,
280819,
157940,
182517,
280823,
280825,
280827,
280830,
280831,
280833,
125187,
280835,
125191,
125207,
125209,
321817,
125218,
321842,
223539,
125239,
280888,
305464,
280891,
289087,
280897,
280900,
305480,
239944,
280906,
239947,
305485,
305489,
379218,
280919,
248153,
215387,
354653,
354656,
313700,
313705,
280937,
190832,
280946,
223606,
313720,
280956,
239997,
280959,
313731,
199051,
240011,
289166,
240017,
297363,
190868,
240021,
297365,
297368,
297372,
141725,
297377,
289186,
297391,
289201,
240052,
289207,
289210,
305594,
281024,
289218,
289221,
289227,
436684,
281045,
281047,
166378,
305647,
281075,
174580,
240124,
281084,
305662,
305664,
240129,
305666,
305668,
223749,
330244,
240132,
223752,
150025,
338440,
281095,
223757,
281102,
223763,
223765,
281113,
322074,
281116,
281121,
182819,
281127,
281135,
150066,
158262,
158266,
289342,
281154,
322115,
158283,
281163,
281179,
338528,
338532,
281190,
199273,
281196,
19053,
158317,
313973,
297594,
281210,
158347,
264845,
182926,
133776,
182929,
314003,
117398,
314007,
289436,
174754,
330404,
289448,
133801,
174764,
314029,
314033,
240309,
133817,
314045,
314047,
314051,
199364,
297671,
158409,
289493,
363234,
289513,
289522,
289525,
289532,
322303,
289537,
322310,
264969,
322314,
322318,
281361,
281372,
322341,
215850,
281388,
289593,
281401,
289601,
281410,
281413,
281414,
240458,
281420,
240468,
281430,
322393,
297818,
281435,
281438,
281442,
174955,
224110,
207733,
207737,
158596,
183172,
338823,
322440,
314249,
240519,
183184,
142226,
289687,
224151,
240535,
297883,
289694,
289696,
289700,
289712,
281529,
289724,
52163,
183260,
420829,
281567,
289762,
322534,
297961,
183277,
322550,
134142,
322563,
314372,
330764,
175134,
322599,
322610,
314421,
281654,
314427,
314433,
207937,
314441,
207949,
322642,
314456,
281691,
314461,
281702,
281704,
314474,
281708,
281711,
289912,
248995,
306341,
306344,
306347,
322734,
306354,
142531,
199877,
289991,
306377,
289997,
249045,
363742,
363745,
298216,
330988,
126190,
216303,
322801,
388350,
257302,
363802,
199976,
199978,
314671,
298292,
298294,
257334,
216376,
380226,
298306,
224584,
224587,
224594,
216404,
306517,
150870,
314714,
224603,
159068,
314718,
265568,
314723,
281960,
150890,
306539,
314732,
314736,
290161,
216436,
306549,
298358,
314743,
306552,
290171,
314747,
298365,
290174,
306555,
224641,
281987,
298372,
314756,
281990,
224647,
265604,
298377,
314763,
142733,
298381,
314768,
224657,
306581,
314773,
314779,
314785,
314793,
282025,
282027,
241068,
241070,
241072,
282034,
241077,
150966,
298424,
306618,
282044,
323015,
306635,
306640,
290263,
290270,
290275,
339431,
282089,
191985,
282098,
290291,
282101,
241142,
191992,
290298,
151036,
290302,
282111,
290305,
175621,
306694,
192008,
323084,
257550,
282127,
290321,
282130,
323090,
290325,
282133,
241175,
290328,
282137,
290332,
241181,
282142,
282144,
290344,
306731,
290349,
290351,
290356,
282186,
224849,
282195,
282199,
282201,
306778,
159324,
159330,
314979,
298598,
323176,
224875,
241260,
323181,
257658,
315016,
282249,
290445,
282255,
282261,
175770,
298651,
282269,
323229,
298655,
323231,
61092,
282277,
306856,
196133,
282295,
323260,
282300,
323266,
282310,
323273,
282319,
306897,
241362,
306904,
282328,
298714,
52959,
216801,
282337,
241380,
216806,
323304,
282345,
12011,
282356,
323318,
282364,
282367,
306945,
241412,
323333,
282376,
216842,
323345,
282388,
323349,
282392,
184090,
315167,
315169,
282402,
315174,
323367,
241448,
315176,
241450,
282410,
306988,
306991,
315184,
323376,
315190,
241464,
159545,
282425,
298811,
118593,
307009,
413506,
307012,
241475,
298822,
315211,
282446,
307027,
315221,
323414,
315223,
241496,
241498,
307035,
307040,
110433,
282465,
241509,
110438,
298860,
110445,
282478,
315249,
282481,
110450,
315251,
315253,
315255,
339838,
315267,
282499,
315269,
241544,
282505,
241546,
241548,
298896,
298898,
282514,
241556,
44948,
298901,
241560,
282520,
241563,
241565,
241567,
241569,
282531,
241574,
282537,
298922,
36779,
241581,
282542,
241583,
323504,
241586,
290739,
241588,
282547,
241590,
241592,
241598,
290751,
241600,
241605,
151495,
241610,
298975,
241632,
298984,
241640,
241643,
298988,
241646,
241649,
241652,
323574,
290807,
299003,
241661,
299006,
282623,
315396,
241669,
315397,
282632,
307211,
282639,
290835,
282645,
241693,
282654,
102438,
217127,
282669,
323630,
282681,
290877,
282687,
159811,
315463,
315466,
192589,
307278,
192596,
176213,
307287,
307290,
217179,
315482,
192605,
315483,
233567,
299105,
200801,
217188,
299109,
307303,
315495,
356457,
45163,
307307,
315502,
192624,
307314,
323700,
299126,
233591,
299136,
307329,
315524,
307338,
233613,
241813,
307352,
299164,
299167,
315552,
184479,
184481,
315557,
184486,
307370,
307372,
184492,
307374,
307376,
299185,
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,
282893,
323854,
291089,
282906,
291104,
233766,
295583,
176435,
307508,
315701,
332086,
307510,
307512,
168245,
307515,
307518,
282942,
282947,
323917,
282957,
110926,
233808,
323921,
315733,
323926,
233815,
315739,
323932,
299357,
242018,
242024,
299373,
315757,
250231,
242043,
315771,
299388,
299391,
291202,
299398,
242057,
291212,
299405,
291222,
315801,
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,
283095,
127447,
299481,
127449,
176605,
242143,
127455,
127457,
291299,
340454,
127463,
242152,
291305,
127466,
176620,
127469,
127474,
291314,
291317,
127480,
135672,
291323,
233979,
127485,
291330,
127490,
127494,
283142,
127497,
233994,
135689,
127500,
291341,
233998,
127506,
234003,
127509,
234006,
127511,
152087,
283161,
242202,
234010,
135707,
135710,
242206,
242208,
291361,
242220,
291378,
152118,
234038,
234041,
315961,
70213,
242250,
111193,
242275,
299620,
242279,
168562,
184952,
135805,
135808,
291456,
373383,
299655,
135820,
316051,
225941,
316054,
299672,
135834,
373404,
299677,
225948,
135839,
299680,
225954,
299684,
135844,
242343,
209576,
242345,
373421,
135870,
135873,
135876,
135879,
299720,
299723,
299726,
225998,
226002,
119509,
226005,
226008,
299740,
242396,
201444,
299750,
283368,
234219,
283372,
185074,
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,
234333,
308063,
234336,
242530,
349027,
234338,
234341,
234344,
234347,
177004,
234350,
324464,
234353,
152435,
177011,
234356,
234358,
234362,
226171,
234364,
291711,
234368,
291714,
234370,
291716,
234373,
226182,
234375,
201603,
308105,
226185,
234379,
324490,
234384,
234388,
234390,
226200,
234393,
209818,
308123,
234396,
324508,
291742,
324504,
234398,
234401,
291747,
291748,
234405,
291750,
324518,
324520,
234407,
324522,
234410,
291756,
291754,
226220,
324527,
291760,
234417,
201650,
324531,
234414,
234422,
226230,
324536,
275384,
234428,
291773,
242623,
324544,
234431,
234434,
324546,
324548,
226239,
226245,
234437,
234439,
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,
234543,
234546,
275508,
300085,
234549,
300088,
234553,
234556,
234558,
316479,
234561,
316483,
160835,
234563,
308291,
234568,
234570,
316491,
234572,
300108,
234574,
300115,
234580,
234581,
234585,
275545,
242777,
234590,
234593,
234595,
234597,
300133,
234601,
300139,
234605,
160879,
234607,
275569,
234610,
316530,
300148,
234614,
398455,
144506,
234618,
234620,
275579,
234623,
226433,
234627,
275588,
234629,
242822,
234634,
234636,
177293,
234640,
275602,
234643,
308373,
324757,
234647,
226453,
234648,
234650,
308379,
275608,
300189,
324766,
119967,
234653,
324768,
283805,
234657,
242852,
300197,
234661,
283813,
234664,
275626,
234667,
316596,
308414,
234687,
300223,
300226,
308418,
234692,
300229,
308420,
308422,
283844,
300234,
283850,
300238,
300241,
316625,
300243,
300245,
316630,
300248,
300253,
300256,
300258,
300260,
234726,
300263,
300265,
300267,
161003,
300270,
300272,
120053,
300278,
275703,
316663,
300284,
275710,
300287,
292097,
300289,
161027,
300292,
300294,
275719,
234760,
177419,
300299,
242957,
300301,
349451,
177424,
275725,
283917,
349464,
415009,
283939,
259367,
292143,
283951,
300344,
226617,
243003,
283963,
226628,
300357,
283973,
177482,
283983,
316758,
357722,
316766,
316768,
292192,
218464,
292197,
316774,
243046,
218473,
136562,
324978,
333178,
275834,
275836,
275840,
316803,
316806,
226696,
316811,
226699,
316814,
226703,
300433,
234899,
300436,
226709,
357783,
316824,
316826,
300448,
144807,
144810,
144812,
284076,
144814,
227426,
144820,
374196,
284084,
292279,
284087,
144826,
144828,
144830,
144832,
144835,
144837,
38342,
144839,
144841,
144844,
144847,
144852,
144855,
103899,
300507,
333280,
226787,
218597,
292329,
300523,
259565,
300527,
308720,
259567,
292338,
226802,
316917,
292343,
308727,
300537,
316933,
316947,
308757,
308762,
284191,
284194,
284196,
235045,
284199,
284204,
284206,
284209,
284211,
194101,
284213,
316983,
194103,
284215,
308790,
284218,
226877,
292414,
284223,
284226,
284228,
243268,
226886,
284231,
292421,
128584,
284234,
366155,
317004,
276043,
284238,
226895,
284241,
194130,
284243,
300628,
284245,
292433,
284247,
317015,
235097,
243290,
284249,
276052,
276053,
300638,
284251,
284253,
284255,
284258,
243293,
292452,
292454,
284263,
177766,
284265,
292458,
284267,
292461,
284272,
284274,
284278,
292470,
276086,
292473,
284283,
276093,
284286,
292479,
284288,
292481,
284290,
325250,
284292,
292485,
325251,
276095,
276098,
284297,
317066,
284299,
317068,
284301,
276109,
284303,
284306,
276114,
284308,
284312,
284314,
284316,
276127,
284320,
284322,
284327,
284329,
317098,
284331,
276137,
284333,
284335,
276144,
284337,
284339,
300726,
284343,
284346,
284350,
358080,
276160,
284354,
358083,
284358,
276166,
358089,
284362,
276170,
284365,
276175,
284368,
276177,
284370,
358098,
284372,
317138,
284377,
284379,
284381,
284384,
358114,
284386,
358116,
276197,
317158,
358119,
284392,
325353,
358122,
284394,
284397,
358126,
284399,
358128,
276206,
358133,
358135,
276216,
358138,
300795,
358140,
284413,
358142,
358146,
317187,
284418,
317189,
317191,
284428,
300816,
300819,
317207,
300828,
300830,
276255,
300832,
325408,
300834,
317221,
227109,
358183,
186151,
276268,
300845,
243504,
300850,
284469,
276280,
325436,
358206,
276291,
366406,
276295,
300872,
292681,
153417,
358224,
284499,
276308,
178006,
317271,
284502,
276315,
292700,
317279,
284511,
227175,
292715,
300912,
292721,
284529,
300915,
284533,
292729,
317306,
284540,
292734,
325512,
169868,
317332,
358292,
399252,
284564,
284566,
350106,
284572,
276386,
284579,
276388,
358312,
317353,
284585,
276395,
292776,
292784,
276402,
358326,
161718,
358330,
276411,
276418,
276425,
301009,
301011,
301013,
292823,
358360,
301017,
301015,
292828,
276446,
276448,
153568,
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,
235581,
178238,
276539,
276544,
243779,
325700,
284739,
292934,
243785,
276553,
350293,
350295,
309337,
227418,
350299,
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,
276638,
153765,
284837,
350375,
350379,
350381,
350383,
129200,
350385,
350387,
350389,
350395,
350397,
350399,
227520,
350402,
227522,
301252,
350406,
227529,
301258,
309450,
276685,
309455,
276689,
309462,
301272,
276699,
194780,
309468,
309471,
301283,
317672,
317674,
325867,
243948,
194801,
309491,
227571,
309494,
243960,
227583,
276735,
227587,
276739,
211204,
276742,
227596,
325910,
309530,
342298,
211232,
317729,
276775,
211241,
325937,
325943,
211260,
260421,
276809,
285002,
276811,
235853,
276816,
235858,
276829,
276833,
391523,
276836,
293227,
276843,
293232,
276848,
186744,
211324,
227709,
285061,
366983,
317833,
178572,
285070,
285077,
178583,
227738,
317853,
276896,
317858,
342434,
285093,
317864,
285098,
276907,
235955,
276917,
293304,
293307,
293314,
309707,
293325,
129486,
317910,
293336,
235996,
317917,
293343,
358880,
276961,
293346,
227810,
276964,
293352,
236013,
293364,
301562,
293370,
317951,
309764,
301575,
121352,
293387,
236043,
342541,
317963,
113167,
55822,
309779,
317971,
309781,
277011,
55837,
227877,
227879,
293417,
227882,
309804,
293421,
105007,
236082,
285236,
23094,
277054,
244288,
219714,
129603,
301636,
318020,
301639,
301643,
285265,
399955,
309844,
277080,
309849,
285277,
285282,
326244,
318055,
277100,
121458,
170618,
170619,
309885,
309888,
277122,
227975,
277128,
285320,
301706,
318092,
326285,
334476,
318094,
277136,
277139,
227992,
334488,
318108,
285340,
318110,
227998,
137889,
383658,
285357,
318128,
277170,
293555,
342707,
154292,
318132,
277173,
277177,
277181,
318144,
277187,
277191,
277194,
277196,
277201,
342745,
137946,
342747,
113378,
203491,
228069,
277223,
342760,
285417,
56041,
56043,
56045,
277232,
228081,
56059,
310015,
285441,
310020,
285448,
310029,
228113,
285459,
277273,
293659,
326430,
228128,
285474,
293666,
228135,
318248,
277291,
318253,
293677,
285489,
301876,
293685,
285494,
301880,
285499,
301884,
293696,
310080,
277317,
293706,
277322,
277329,
162643,
310100,
301911,
301913,
277337,
301921,
400236,
236397,
162671,
326514,
310134,
236408,
277368,
15224,
416639,
416640,
113538,
310147,
416648,
277385,
187274,
39817,
301972,
424853,
277405,
277411,
310179,
293798,
293802,
236460,
277426,
293811,
276579,
293817,
293820,
203715,
326603,
342994,
276586,
293849,
293861,
228327,
228328,
318442,
228330,
228332,
326638,
277486,
351217,
318450,
293876,
293877,
285686,
302073,
121850,
293882,
302075,
244731,
285690,
293887,
277504,
277507,
277511,
293899,
277519,
293908,
302105,
293917,
293939,
318516,
277561,
277564,
310336,
7232,
293956,
277573,
228422,
293960,
310344,
277577,
277583,
203857,
293971,
310355,
310359,
236632,
277594,
138332,
277598,
203872,
277601,
285792,
310374,
203879,
310376,
228460,
318573,
203886,
187509,
285815,
367737,
285817,
302205,
285821,
392326,
285831,
253064,
294026,
302218,
285835,
162964,
384148,
187542,
302231,
285849,
302233,
285852,
302237,
285854,
285856,
302241,
285862,
277671,
302248,
64682,
277678,
294063,
294065,
302258,
277687,
294072,
318651,
294076,
277695,
318657,
244930,
302275,
130244,
302277,
228550,
302282,
310476,
302285,
302288,
310481,
302290,
203987,
302292,
302294,
310486,
302296,
384222,
310498,
285927,
318698,
302315,
228592,
294132,
138485,
228601,
204026,
228606,
204031,
64768,
310531,
138505,
228617,
318742,
204067,
277798,
130345,
277801,
113964,
285997,
384302,
285999,
277804,
113969,
277807,
277811,
318773,
318776,
277816,
286010,
277819,
294204,
417086,
277822,
286016,
302403,
294211,
384328,
277832,
277836,
294221,
146765,
294223,
326991,
277839,
277842,
277847,
277850,
179547,
277853,
146784,
277857,
302436,
277860,
294246,
327015,
310632,
327017,
351594,
277864,
277869,
277872,
351607,
310648,
277880,
310651,
277884,
277888,
310657,
351619,
294276,
310659,
327046,
277892,
253320,
310665,
318858,
277894,
277898,
277903,
310672,
351633,
277905,
277908,
277917,
310689,
277921,
130468,
228776,
277928,
277932,
310703,
277937,
310710,
130486,
310712,
277944,
310715,
277947,
302526,
228799,
277950,
277953,
302534,
310727,
245191,
64966,
277959,
277963,
302541,
277966,
302543,
310737,
277971,
228825,
163290,
277978,
310749,
277981,
277984,
310755,
277989,
277991,
187880,
277995,
310764,
286188,
278000,
228851,
310772,
278003,
278006,
40440,
212472,
278009,
40443,
310780,
286203,
40448,
228864,
286214,
228871,
302603,
302614,
302617,
286233,
302621,
286240,
187936,
146977,
187939,
40484,
294435,
40486,
286246,
294440,
40488,
294439,
294443,
40491,
294445,
245288,
310831,
286248,
40499,
40502,
212538,
40507,
40511,
40513,
228933,
327240,
40521,
286283,
40525,
40527,
212560,
400976,
228944,
40533,
147032,
40537,
40539,
40541,
278109,
40544,
40548,
40550,
40552,
286312,
40554,
286313,
310892,
40557,
40560,
188022,
122488,
294521,
343679,
294537,
310925,
286354,
278163,
302740,
122517,
278168,
179870,
327333,
229030,
212648,
302764,
278188,
278192,
319153,
278196,
302781,
319171,
302789,
294599,
278216,
294601,
302793,
343757,
212690,
319187,
286420,
278227,
229076,
286425,
319194,
278235,
229086,
278238,
286432,
294625,
294634,
302838,
319226,
286460,
278274,
302852,
278277,
302854,
294664,
311048,
352008,
319243,
311053,
302862,
319251,
294682,
278306,
188199,
294701,
319280,
278320,
319290,
229192,
302925,
188247,
188252,
237409,
229233,
294776,
360317,
294785,
327554,
360322,
40840,
40851,
294803,
188312,
294811,
237470,
319390,
40865,
319394,
294817,
294821,
311209,
180142,
343983,
294831,
188340,
40886,
319419,
294844,
294847,
393177,
294876,
294879,
294883,
393190,
294890,
311279,
278513,
237555,
311283,
278516,
278519,
237562
] |
5a3bd5b459f4397ddba123a2e646740741ed8292 | 28cac561b6dc3aca723a07da1be5bbca16889a19 | /NetflixClone/Detail Screen/SimilarMoviesCell.swift | 75f88ff4885116190be36591e37253bf07192218 | [] | no_license | MicheleMola/NetflixClone | 47d3a89d2f1a79e664938023b0d1283e832338c7 | 57944ef2f11bf3a46b7e053d85f295f5088f26ba | refs/heads/master | 2020-06-27T21:01:22.677730 | 2019-08-06T16:27:33 | 2019-08-06T16:27:33 | 200,048,014 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 2,634 | swift | //
// SimilarMoviesCell.swift
// NetflixClone
//
// Created by Michele Mola on 06/08/2019.
// Copyright © 2019 Michele Mola. All rights reserved.
//
import UIKit
import PinLayout
class SimilarMoviesCell: UICollectionViewCell {
static let reusableID = "SimilarMoviesCell"
let titleLabel = UILabel()
let collectionView: UICollectionView
let layout: UICollectionViewFlowLayout
var movies: [Movie]? {
didSet {
self.configure()
}
}
override init(frame: CGRect) {
self.layout = UICollectionViewFlowLayout()
self.collectionView = UICollectionView(frame: .zero,
collectionViewLayout: self.layout)
super.init(frame: frame)
self.setup()
self.style()
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
private func setup() {
self.collectionView.dataSource = self
self.collectionView.register(MovieCell.self,
forCellWithReuseIdentifier: MovieCell.reusableID)
self.addSubview(self.titleLabel)
self.addSubview(self.collectionView)
}
private func style() {
self.backgroundColor = .black
self.titleLabel.text = "ALTRI SIMILI"
self.titleLabel.font = UIFont.boldSystemFont(ofSize: 14)
self.titleLabel.textColor = .white
self.collectionView.isScrollEnabled = false
}
override func layoutSubviews() {
super.layoutSubviews()
self.titleLabel.pin
.left().marginLeft(16)
.top().marginTop(16)
.sizeToFit()
self.collectionView.pin
.top(to: self.titleLabel.edge.bottom).marginTop(8)
.left()
.right()
.height(360)
self.layout.itemSize = CGSize(width: self.bounds.width / 3 - 32,
height: self.bounds.height / 2 - 48)
self.layout.sectionInset = UIEdgeInsets(top: 0, left: 16, bottom: 0, right: 16)
}
private func configure() {
self.collectionView.reloadData()
}
}
extension SimilarMoviesCell: UICollectionViewDataSource {
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
// return movies?.count ?? 0
return 6
}
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: MovieCell.reusableID, for: indexPath) as? MovieCell else {
fatalError()
}
cell.movie = self.movies?[indexPath.row]
return cell
}
}
| [
-1
] |
8e323f5383997388571edd96c0d2398c0c2c1638 | 190be4cce4efcabd7ab34ad7e15761737acc5f63 | /Road Trip Radar/Location.swift | 9a2b1635df606d9ce8cf20a47ea89a88c8c1b629 | [] | no_license | mpujol/Road-Trip-Radar | 40777bdbc995c3d12261768bc9423f28eea76581 | ed85ded95bdfe24f3bf9e6294e2e416d00ab31aa | refs/heads/master | 2020-05-21T20:28:27.185030 | 2016-09-20T04:57:42 | 2016-09-20T04:57:42 | 62,921,774 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,273 | swift | //
// Location.swift
// Road Trip Radar
//
// Created by Michael Pujol on 8/28/16.
// Copyright © 2016 Michael Pujol. All rights reserved.
//
import Foundation
import FirebaseDatabase
struct Location {
let key: String!
let latitude: String!
let longitude: String!
let timestamp: String!
let ref: FIRDatabaseReference?
//Initialize the location from arbitrary data
init(latitude: String, longitude: String, timestamp: String, key: String = ""){
self.key = key
self.latitude = latitude
self.longitude = longitude
self.timestamp = timestamp
self.ref = nil
}
//Initialize the location from a snapshot
init(snapshot: FIRDataSnapshot!) {
key = snapshot.key
latitude = snapshot.value(forKey: "latitude") as! String
longitude = snapshot.value(forKey: "longitude") as! String
timestamp = snapshot.value(forKey: "timestamp") as! String
ref = snapshot.ref
}
// turn the struct into a dictionary for the JSON file
func toAnyObject() -> Any {
return [
"latitude": latitude,
"longitude": latitude,
"timestamp": timestamp
]
}
}
| [
-1
] |
e1b7cbc8c11d6abecc4abc39a7c9b6bb43e9b867 | 2440ce1efa9f7921ad8171a9506e8af86c8e3f39 | /client/SpaceGame/AppDelegate.swift | 17f2b018dd920a085af85e5554b4d37fa535695b | [] | no_license | blandinf/swiftSpaceGame | e094f2c94e6a0255a5ae62d670ab1b8d0c427e68 | 60243109e434adc59f5526d0f8e34364370e94ff | refs/heads/master | 2022-07-06T01:03:57.187962 | 2020-05-15T16:59:28 | 2020-05-15T16:59:28 | 256,441,911 | 1 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,482 | swift | //
// AppDelegate.swift
// SpaceGame
//
// Created by Florian on 17/04/2020.
// Copyright © 2020 blandinf. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
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) {
SocketIOManager.sharedInstance.closeConnection()
}
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) {
print("active")
SocketIOManager.sharedInstance.establishConnection()
}
}
| [
175360,
66690,
161027,
350210,
360322,
366983,
350218,
349451,
330764,
350222,
142226,
399252,
224151,
334488,
175770,
415009,
419489,
384302,
326321,
189367,
370365,
164546,
243779,
410820,
419522,
300872,
256716,
436684,
263888,
248153,
342745,
215387,
342747,
342749,
354265,
148575,
354270,
420829,
419555,
340454,
370279,
393190,
354281,
189169,
351217,
412659,
350200,
215422
] |
f831746534b20124a6393d17f05bfb2a45868004 | f58bd14d735f45e6c67e40d972baf8724f5f019a | /eTrip/eTrip Views/AutoPlanView/AutoPlanViewController.swift | 1372cc1066621d0cf29d25d6202c8a86f98144d3 | [] | no_license | jeffwang0516/Etrip | 038dfefdf64a0e1ccfc585910964145847568ea3 | b2b3450531496cf19e47ace1aec2a8fef055fae6 | refs/heads/master | 2020-03-18T17:38:11.646304 | 2018-06-15T13:01:07 | 2018-06-15T13:01:07 | 135,040,781 | 1 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 40,035 | swift | //
// AutoPlaneViewController.swift
// eTrip
//
// Created by 蕭恬 on 2018/5/30.
// Copyright © 2018年 JeffWang. All rights reserved.
//
import UIKit
import CoreLocation
import MapKit
class AutoPlanViewController: UIViewController {
var googleAPIKey = "------Please replace with your OWN Key------"
let backupKey = ["------Please replace with your OWN Key------"]
var currentBackupIndex = 0
let viewTitle = "自動規劃"
let db = DBManager.instance
let testUserId = "TCA"
@IBOutlet weak var activityIndicator: UIActivityIndicatorView!
var locationManager: CLLocationManager!
var currentLat: Double = 25.2218608856201
var currentLng: Double = 121.645889282227
var currentAddress: String = ""
@IBOutlet weak var cityDropdown: ZHDropDownMenu!
@IBOutlet weak var districtDropDown: ZHDropDownMenu!
var placeSuggestions: [PlaceInfo] = []
@IBOutlet weak var suggestionsTableView: UITableView!
var favoritePlaces: [PlaceInfo] = []
@IBOutlet weak var favoritePlacesTableView: UITableView!
var chosenPlaces: [PlaceInfo] = []
var chosenLandmarks: [PlaceInfo] = []
var chosenFavorites: [PlaceInfo] = []
var placeAlreadyPlanned: [PlaceInfo] = []
@IBOutlet weak var date: UIButton!
var selectedDate: Date!{
didSet {
let dateFormatter = DateFormatter()
dateFormatter.dateStyle = .medium
dateFormatter.timeStyle = .none
dateFormatter.dateFormat = "yyyy-MM-dd"
// print(selectedDate)
let dateString = dateFormatter.string(from: selectedDate)
let splitedDate = dateString.split(separator: "-")
self.date.setTitle("\(splitedDate[0])年\(splitedDate[1])月\(splitedDate[2])日", for: UIControlState.normal)
}
}
@IBOutlet weak var day: UILabel!
var selectedDay: Int!{
didSet {
self.day.text = "\(selectedDay!)日"
}
}
@IBOutlet weak var startAddress: UILabel!
@IBOutlet weak var carImg: UIButton!
@IBOutlet weak var busImg: UIButton!
var transportIsCar:Bool!{
didSet{
if transportIsCar{
carImg.setImage(UIImage(named: "transport_car_true"), for: UIControlState.normal)
busImg.setImage(UIImage(named: "transport_bus_false"), for: UIControlState.normal)
}else{
carImg.setImage(UIImage(named: "transport_car_false"), for: UIControlState.normal)
busImg.setImage(UIImage(named: "transport_bus_true"), for: UIControlState.normal)
}
}
} //true=car,false=bus
@IBOutlet weak var indoorCheckImg: UIButton!
var indoorIsChecked:Bool!{
didSet{
if indoorIsChecked{
indoorCheckImg.setImage(UIImage(named: "checked-1"), for: UIControlState.normal)
}else{
indoorCheckImg.setImage(UIImage(named: "uncheck"), for: UIControlState.normal)
}
}
}
@IBOutlet weak var outdoorCheckImg: UIButton!
var outdoorIsChecked:Bool!{
didSet{
if outdoorIsChecked{
outdoorCheckImg.setImage(UIImage(named: "checked-1"), for: UIControlState.normal)
}else{
outdoorCheckImg.setImage(UIImage(named: "uncheck"), for: UIControlState.normal)
}
}
}
override func viewWillAppear(_ animated: Bool) {
self.navigationController?.navigationBar.topItem?.title = viewTitle
self.updateDate(selectedDate: Date())
self.selectedDay = 3
// Dropdowns init
self.cityDropdown.options = db.getAllCityNames()
let firstCity = self.cityDropdown.options.first
self.cityDropdown.defaultValue = firstCity
self.cityDropdown.menuId = 1
self.cityDropdown.delegate = self
if firstCity != nil{
self.districtDropDown.options = db.getCityDistrict(city: firstCity!)
}
let firstDistrict = self.districtDropDown.options.first
if firstDistrict != nil {
self.districtDropDown.defaultValue = firstDistrict
}
self.districtDropDown.menuId = 2
self.districtDropDown.menuHeight = 160.0
self.districtDropDown.delegate = self
if let firstCity = firstCity, let firstDistrict = firstDistrict {
if let addrid = db.getAddressIdByAddressNames(city: firstCity, district: firstDistrict) {
self.activityIndicator.startAnimating()
DispatchQueue.main.async {
self.placeSuggestions = self.db.searchForPlaceInfos(by: Int(addrid), of: Int(PlaceForm.landmark.rawValue))
self.favoritePlaces = self.db.getFavoritePlaces(of: self.testUserId, with: Int(PlaceForm.landmark.rawValue), in: Int(addrid))
self.refreshTable()
self.activityIndicator.stopAnimating()
}
}
}
}
var timeRetrieved: Int = 0
override func viewDidLoad() {
super.viewDidLoad()
transportIsCar = true
indoorIsChecked = true
outdoorIsChecked = true
// Do any additional setup after loading the view.
self.suggestionsTableView.delegate = self
self.suggestionsTableView.dataSource = self
self.favoritePlacesTableView.delegate = self
self.favoritePlacesTableView.dataSource = self
self.setupDetermineLocation()
self.startAddress.text = "請定位..."
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
func updateDate(selectedDate: Date) {
self.selectedDate = selectedDate
}
@IBAction func dayMinus(_ sender: Any) {
let newInt = selectedDay - 1
if newInt < 1 {
selectedDay = 1
}else{
selectedDay = newInt
}
}
@IBAction func dayPlus(_ sender: Any) {
let newInt = selectedDay + 1
if newInt > 5 {
selectedDay = 5
}else{
selectedDay = newInt
}
}
@IBAction func changeTransport(_ sender: UIButton) {
if sender == self.carImg{
transportIsCar = true
}
if sender == self.busImg{
transportIsCar = false
}
}
@IBAction func changeIndoor(_ sender: Any) {
indoorIsChecked = !indoorIsChecked
}
@IBAction func changeOutdoor(_ sender: Any) {
outdoorIsChecked = !outdoorIsChecked
}
@IBAction func detectAddress(_ sender: Any) {
print("Detecting")
self.startAddress.text = "定位中..."
startDetectingLocation()
}
func refreshTable() {
self.suggestionsTableView.reloadData()
if self.placeSuggestions.count > 0 {
let indexPath = IndexPath(row: 0, section: 0)
self.suggestionsTableView.scrollToRow(at: indexPath, at: .top, animated: true)
}
self.favoritePlacesTableView.reloadData()
if self.favoritePlaces.count > 0 {
let indexPath = IndexPath(row: 0, section: 0)
self.favoritePlacesTableView.scrollToRow(at: indexPath, at: .top, animated: true)
}
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destinationViewController.
// Pass the selected object to the new view controller.
}
*/
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "OpenDatePicker" {
let datePickerView = segue.destination as! DatePickerDialogViewController
datePickerView.parentView = self
} else if segue.identifier == "OpenStartPlan" {
let autoPlanDialogView = segue.destination as! AutoPlanDialogViewController
autoPlanDialogView.parentView = self
autoPlanDialogView.planningDetailsByDays = self.planningDetailsByDays
autoPlanDialogView.userid = testUserId
autoPlanDialogView.dayCount = selectedDay
autoPlanDialogView.startDate = selectedDate
autoPlanDialogView.endDate = selectedDate + TimeInterval((selectedDay-1)*24*60*60)
} else {
super.prepare(for: segue, sender: sender)
}
}
// AutoPlanning func
var planningDetailsByDays: [[DiaryDetail]] = []
@IBAction func startPlanning(_ sender: UIButton) {
self.activityIndicator.startAnimating()
self.view.isUserInteractionEnabled = false
DispatchQueue.global().async {
self.planningDetailsByDays = self.runAutoPlanning()
// Manual perform segue
DispatchQueue.main.async{
self.view.isUserInteractionEnabled = true
self.performSegue(withIdentifier: "OpenStartPlan", sender: sender)
self.activityIndicator.stopAnimating()
}
}
}
private func runAutoPlanning() -> [[DiaryDetail]] {
// TEST API
// DispatchQueue.global().async {
// self.timeRetrieved = self.retrieveTimeFromGoogleAPI("40.6655101,-73.89188969999998", "40.6905615,-73.9976592", isDriving: transportIsCar)
// print("TESTAPI:" , self.timeRetrieved)
//// }
//
// for a in db.searchForDiningPlaces(near: 3152, considerOf: 1200) {
// print(a.name)
// }
// return []
let transport: Int = transportIsCar ? 3 : 1
self.chosenPlaces = combineChosenLists()
// for place in chosenPlaces {
// print(place.name)
// }
let diaryId = self.getAutoDiaryIdByCurTime()
print(diaryId)
var diaryDetail: [[DiaryDetail]] = []
var prevDayHotel: PlaceInfo? = nil
var isLastDay = false
placeAlreadyPlanned = []
for day in 0..<selectedDay {
print("Processing day \(day+1)")
if day == selectedDay - 1 { isLastDay = true }
// Record plans of single day
var diaryDetailForDay: [DiaryDetail] = []
if prevDayHotel != nil {
diaryDetailForDay.append(DiaryDetail(diaryId: diaryId, userid: testUserId, day: Int32(day + 1), content: prevDayHotel!.id, startTime: 0, endTime: 900, tag: 1, name: prevDayHotel!.name, form: prevDayHotel!.form))
} else {
diaryDetailForDay.append(DiaryDetail(diaryId: diaryId, userid: testUserId, day: Int32(day + 1), content: 0, startTime: 0, endTime: 900, tag: 1, name: "Home", form: PlaceForm.home))
}
var planTime: Int = 900
var startPlace: PlaceInfo? = nil
var nextPlaceLand: PlaceInfo? = nil
var staytime = 0
if prevDayHotel != nil { startPlace = prevDayHotel }
else {
startPlace = PlaceInfo(id: 0, name: "Home", address: currentAddress, form: PlaceForm.home, image: NSData(base64Encoded: "")!, ticket: 0, staytime: 0, hightime: 0, phone: "", abstract: "", lat: currentLat, lng: currentLng, score: Score(average: 0, total: 0))
}
// Prevent to plan multiple of the following in one day
var isLunchPlanned = false
var isDinnerPlanned = false
var isHotelPlanned = false
let city = self.cityDropdown.contentTextField.text
let district = self.districtDropDown.contentTextField.text
let destAddressId = Int(db.getAddressIdByAddressNames(city: city!, district: district!)!)
let destNearbyAddrIds = db.getNearbyAddressIds(of: destAddressId)
while planTime < 2400 {
if 1100 < planTime && planTime < 1300 && isLunchPlanned == false {
print("Plantime Lunch: \(planTime)")
isLunchPlanned = true
// Search for lunch place
// nextPlaceLand = self.findNextPlace(from: startPlace!, possiblePlaces: db.searchForDiningPlaces(near: Int(startPlace!.id), considerOf: planTime), planTime: planTime, isDriving: self.transportIsCar)
nextPlaceLand = self.findNextPlace(from: startPlace!, possiblePlaces: db.searchForPlaceInfos(by: destAddressId, of: Int(PlaceForm.restaurant.rawValue)), planTime: planTime, isDriving: self.transportIsCar)
if nextPlaceLand == nil {
print("nil lunch")
for addrId in destNearbyAddrIds {
nextPlaceLand = self.findNextPlace(from: startPlace!, possiblePlaces: db.searchForPlaceInfos(by: addrId, of: Int(PlaceForm.restaurant.rawValue)), planTime: planTime, isDriving: self.transportIsCar)
if nextPlaceLand != nil {
print("found lunch in nearby")
break
}
}
if nextPlaceLand == nil {
print("found lunch in ALL")
nextPlaceLand = self.findNextPlace(from: startPlace!, possiblePlaces: db.searchForPlaceInfos(with: "", of: Int(PlaceForm.restaurant.rawValue)), planTime: planTime, isDriving: self.transportIsCar)
}
}
staytime = Int(nextPlaceLand!.staytime)
} else if 1630 < planTime && planTime < 1900 && isDinnerPlanned == false {
print("Plantime dinner: \(planTime)")
isDinnerPlanned = true
// Search for dinner place
// nextPlaceLand = self.findNextPlace(from: startPlace!, possiblePlaces: db.searchForDiningPlaces(near: Int(startPlace!.id), considerOf: planTime), planTime: planTime, isDriving: self.transportIsCar)
nextPlaceLand = self.findNextPlace(from: startPlace!, possiblePlaces: db.searchForPlaceInfos(by: destAddressId, of: Int(PlaceForm.restaurant.rawValue)), planTime: planTime, isDriving: self.transportIsCar)
if nextPlaceLand == nil {
print("nil dinner")
for addrId in destNearbyAddrIds {
nextPlaceLand = self.findNextPlace(from: startPlace!, possiblePlaces: db.searchForPlaceInfos(by: addrId, of: Int(PlaceForm.restaurant.rawValue)), planTime: planTime, isDriving: self.transportIsCar)
if nextPlaceLand != nil {
print("found dinner in nearby")
break
}
}
if nextPlaceLand == nil {
print("found dinner in ALL")
nextPlaceLand = self.findNextPlace(from: startPlace!, possiblePlaces: db.searchForPlaceInfos(with: "", of: Int(PlaceForm.restaurant.rawValue)), planTime: planTime, isDriving: self.transportIsCar)
}
}
staytime = Int(nextPlaceLand!.staytime)
} else if 1530 <= planTime && planTime <= 2200 && isHotelPlanned == false && isLastDay == false {
print("Plantime Hotel: \(planTime)")
isHotelPlanned = true
// Search for hotel
nextPlaceLand = self.findNextPlace(from: startPlace!, possiblePlaces: db.searchForHotels(in: destAddressId), planTime: planTime, isDriving: self.transportIsCar)
if nextPlaceLand == nil {
print("nil hotel")
for addrId in destNearbyAddrIds {
nextPlaceLand = self.findNextPlace(from: startPlace!, possiblePlaces: db.searchForHotels(in: addrId), planTime: planTime, isDriving: self.transportIsCar)
if nextPlaceLand != nil {
print("found hotel in nearby")
break
}
}
if nextPlaceLand == nil {
print("found hotel in ALL")
nextPlaceLand = self.findNextPlace(from: startPlace!, possiblePlaces: db.searchForPlaceInfos(with: "", of: Int(PlaceForm.hotel.rawValue)), planTime: planTime, isDriving: self.transportIsCar)
}
}
staytime = 100
prevDayHotel = nextPlaceLand
// Add transport
diaryDetailForDay.append(DiaryDetail(diaryId: diaryId, userid: testUserId, day: Int32(day + 1), content: Int32(transport), startTime: Int32(planTime), endTime: Int32(addTime(planTime, timeRetrieved)), tag: 2, name: db.getTransportationName(of: Int32(transport)), form: db.getPlaceForm(of: Int32(transport))))
// Add place
if let nextPlaceLand = nextPlaceLand {
diaryDetailForDay.append(DiaryDetail(diaryId: diaryId, userid: testUserId, day: Int32(day + 1), content: nextPlaceLand.id, startTime: Int32(addTime(planTime, timeRetrieved)), endTime: 2400, tag: 1, name: db.getPlaceName(of: Int32(nextPlaceLand.id)), form: db.getPlaceForm(of: Int32(nextPlaceLand.id))))
planTime = addTime(addTime(planTime, timeRetrieved), staytime)
}
break
} else if 1800 <= planTime && planTime <= 2400 && isLastDay == true {
print("Plantime EndOfTrip: \(planTime)")
// Plan for End Of Trip
let startLatLng = "\(startPlace!.lat),\(startPlace!.lng)"
let destLatLng = "\(self.currentLat),\(self.currentLng)"
let transTimeSec = self.retrieveTimeFromGoogleAPI(startLatLng, destLatLng, isDriving: self.transportIsCar)
staytime = 100
let transTime = (transTimeSec/3600)*100 + (transTimeSec%3600/60)
// Add transport
diaryDetailForDay.append(DiaryDetail(diaryId: diaryId, userid: testUserId, day: Int32(day + 1), content: Int32(transport), startTime: Int32(planTime), endTime: Int32(addTime(planTime, transTime)), tag: 2, name: db.getTransportationName(of: Int32(transport)), form: db.getPlaceForm(of: Int32(transport))))
// Add HOME
diaryDetailForDay.append(DiaryDetail(diaryId: diaryId, userid: testUserId, day: Int32(day + 1), content: 0, startTime: Int32(addTime(planTime, transTime)), endTime: 2400, tag: 1, name: "", form: PlaceForm.home))
// END Planning HERE!
break
} else {
if (indoorIsChecked && outdoorIsChecked) || (!indoorIsChecked && !outdoorIsChecked) {
// Both checked or both not
print("Plantime LandMark: \(planTime)")
nextPlaceLand = self.findNextPlace(from: startPlace!, possiblePlaces: db.searchForLandmarks(with: LandmarkWay.all, in: destAddressId, considerOf: planTime), planTime: planTime, isDriving: self.transportIsCar)
if nextPlaceLand == nil {
print("nil Landmark inout")
for addrId in destNearbyAddrIds {
nextPlaceLand = self.findNextPlace(from: startPlace!, possiblePlaces: db.searchForLandmarks(with: LandmarkWay.all, in: addrId, considerOf: planTime), planTime: planTime, isDriving: self.transportIsCar)
if nextPlaceLand != nil {
print("found Landmark inout in nearby")
break
}
}
if nextPlaceLand == nil {
print("found Landmark inout in ALL")
nextPlaceLand = self.findNextPlace(from: startPlace!, possiblePlaces: db.searchForPlaceInfos(by: destAddressId, of: Int(PlaceForm.landmark.rawValue)), planTime: planTime, isDriving: self.transportIsCar)
// nextPlaceLand = self.findNextPlace(from: startPlace!, possiblePlaces: db.searchForPlaceInfos(with: "", of: Int(PlaceForm.landmark.rawValue)), planTime: planTime, isDriving: self.transportIsCar)
}
}
} else if indoorIsChecked {
nextPlaceLand = self.findNextPlace(from: startPlace!, possiblePlaces: db.searchForLandmarks(with: LandmarkWay.indoor, in: destAddressId, considerOf: planTime), planTime: planTime, isDriving: self.transportIsCar)
if nextPlaceLand == nil {
print("nil Landmark in")
for addrId in destNearbyAddrIds {
nextPlaceLand = self.findNextPlace(from: startPlace!, possiblePlaces: db.searchForLandmarks(with: LandmarkWay.indoor, in: addrId, considerOf: planTime), planTime: planTime, isDriving: self.transportIsCar)
if nextPlaceLand != nil {
print("found Landmark in in nearby")
break
}
}
if nextPlaceLand == nil {
print("found Landmark in in ALL")
nextPlaceLand = self.findNextPlace(from: startPlace!, possiblePlaces: db.searchForPlaceInfos(by: destAddressId, of: Int(PlaceForm.landmark.rawValue)), planTime: planTime, isDriving: self.transportIsCar)
// nextPlaceLand = self.findNextPlace(from: startPlace!, possiblePlaces: db.searchForPlaceInfos(with: "", of: Int(PlaceForm.landmark.rawValue)), planTime: planTime, isDriving: self.transportIsCar)
}
}
} else if outdoorIsChecked {
nextPlaceLand = self.findNextPlace(from: startPlace!, possiblePlaces: db.searchForLandmarks(with: LandmarkWay.outdoor, in: destAddressId, considerOf: planTime), planTime: planTime, isDriving: self.transportIsCar)
if nextPlaceLand == nil {
print("nil Landmark out")
for addrId in destNearbyAddrIds {
nextPlaceLand = self.findNextPlace(from: startPlace!, possiblePlaces: db.searchForLandmarks(with: LandmarkWay.outdoor, in: addrId, considerOf: planTime), planTime: planTime, isDriving: self.transportIsCar)
if nextPlaceLand != nil {
print("found Landmark out in nearby")
break
}
}
if nextPlaceLand == nil {
print("found Landmark out in ALL")
nextPlaceLand = self.findNextPlace(from: startPlace!, possiblePlaces: db.searchForPlaceInfos(by: destAddressId, of: Int(PlaceForm.landmark.rawValue)), planTime: planTime, isDriving: self.transportIsCar)
// nextPlaceLand = self.findNextPlace(from: startPlace!, possiblePlaces: db.searchForPlaceInfos(with: "", of: Int(PlaceForm.landmark.rawValue)), planTime: planTime, isDriving: self.transportIsCar)
}
}
}
staytime = Int(nextPlaceLand!.staytime)
// planTime = addTime(addTime(planTime, timeRetrieved), Int(nextPlaceLand!.staytime))
}
// Add transport
diaryDetailForDay.append(DiaryDetail(diaryId: diaryId, userid: testUserId, day: Int32(day + 1), content: Int32(transport), startTime: Int32(planTime), endTime: Int32(addTime(planTime, timeRetrieved)), tag: 2, name: db.getTransportationName(of: Int32(transport)), form: db.getPlaceForm(of: Int32(transport))))
// Add place
if let nextPlaceLand = nextPlaceLand {
diaryDetailForDay.append(DiaryDetail(diaryId: diaryId, userid: testUserId, day: Int32(day + 1), content: nextPlaceLand.id, startTime: Int32(addTime(planTime, timeRetrieved)), endTime: Int32(addTime(addTime(planTime, timeRetrieved), staytime)), tag: 1, name: db.getPlaceName(of: Int32(nextPlaceLand.id)), form: db.getPlaceForm(of: Int32(nextPlaceLand.id))))
planTime = addTime(addTime(planTime, timeRetrieved), staytime)
}
// Find following plans
startPlace = nextPlaceLand
}
diaryDetail.append(diaryDetailForDay)
}
return diaryDetail
}
private func findNextPlace(from startPlace: PlaceInfo, possiblePlaces: [PlaceInfo], planTime: Int, isDriving: Bool) -> PlaceInfo? {
// print(possiblePlaces)
var waitForArrange: [PlaceInfo] = []
for possible in possiblePlaces {
for chosen in self.chosenPlaces {
if possible.id == chosen.id {
if !self.checkIfPlaceChosen(chosenList: self.placeAlreadyPlanned, placeid: chosen.id) {
waitForArrange.append(chosen)
}
}
}
}
if waitForArrange.count == 0 { waitForArrange = possiblePlaces }
var finalPlanPlace: PlaceInfo? = nil
for place in waitForArrange {
if !self.checkIfPlaceChosen(chosenList: self.placeAlreadyPlanned, placeid: place.id) {
let startLatLng = "\(startPlace.lat),\(startPlace.lng)"
let destLatLng = "\(place.lat),\(place.lng)"
// TEST API
let transTimeSec = self.retrieveTimeFromGoogleAPI(startLatLng, destLatLng, isDriving: isDriving)
let transTime = (transTimeSec/3600)*100 + (transTimeSec%3600/60)
// var planTimePredict = addTime(addTime(planTime, transTime), Int(place.staytime))
// let checkIfItHasRelatedPlace = db.searchForDiningPlaces(near: Int(place.id))
// if checkIfItHasRelatedPlace.count <= 0 {
// print("\(place.id) \(place.name) no! time: \(planTimePredict)")
// continue
// }
if place.form != PlaceForm.hotel {
if place.hightime/10000 < addTime(planTime, transTime) && addTime(planTime, transTime) < place.hightime%10000 {
self.timeRetrieved = transTime
print("TESTAPI:" , timeRetrieved)
finalPlanPlace = place
break
}
} else {
finalPlanPlace = place
break
}
}
}
// print(finalPlanPlace)
if finalPlanPlace != nil {
placeAlreadyPlanned.append(finalPlanPlace!)
// print("Append \(finalPlanPlace!.id) \(finalPlanPlace!.name)")
}
return finalPlanPlace
}
private func addTime(_ a: Int, _ b: Int) -> Int{
if (a+b)%100 < 60 {
return a + b
} else {
return (a/100 + b/100)*100 + (a%100 + b%100)/60*100 + (a%100 + b%100)%60
}
}
private func retrieveTimeFromGoogleAPI(_ startCoord: String, _ endCoord: String, isDriving: Bool) -> Int{
var mode = "driving"
if isDriving == false { mode = "transit" }
let urlString = "https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial&origins=\(startCoord)&destinations=\(endCoord)&mode=\(mode)&key=\(googleAPIKey)"
guard let url = URL(string: urlString) else { return 0}
//Implement JSON decoding and parsing
do {
let data = try Data(contentsOf: url)
let json = try JSONSerialization.jsonObject(with: data, options: []) as! NSDictionary
// Check if exceeds LIMIT
if json["status"] as! String == "OVER_QUERY_LIMIT" {
print("GOOGLE OVER_QUERY_LIMIT error")
if currentBackupIndex >= backupKey.count {
print("All google API key OVER LIMIT")
} else {
print("Using backup GoogleAPI key: \(currentBackupIndex)")
}
self.googleAPIKey = backupKey[currentBackupIndex]
currentBackupIndex = currentBackupIndex + 1
return retrieveTimeFromGoogleAPI(startCoord, endCoord, isDriving: isDriving)
}
let json1 = json["rows"] as! NSArray
let json2 = json1[0] as! NSDictionary
let json3 = json2["elements"] as! NSArray
let dic = json3[0] as! NSDictionary
if dic["status"] as! String == "ZERO_RESULTS" {
return 1800
}
let dis = dic["distance"] as! NSDictionary, dur = dic["duration"] as! NSDictionary
if let timeVal = dur["value"]
{
//Get back to the main queue
return timeVal as! Int
}
} catch let jsonError {
print(jsonError)
}
//
//
// }.resume()
return 0
}
private func combineChosenLists() -> [PlaceInfo]{
var chosen = self.chosenLandmarks
for place in chosenFavorites {
if checkIfPlaceChosen(chosenList: chosen, placeid: place.id) == false {
chosen.append(place)
}
}
return chosen
}
private func checkIfPlaceChosen(chosenList: [PlaceInfo], placeid: Int32) -> Bool {
for place in chosenList {
if place.id == placeid {
return true
}
}
return false
}
private func getAutoDiaryIdByCurTime() -> String {
let dateFormatter = DateFormatter()
dateFormatter.dateStyle = .medium
dateFormatter.timeStyle = .none
dateFormatter.dateFormat = "yyMMddhhmmss"
// print(selectedDate)
return dateFormatter.string(from: Date())
}
}
extension AutoPlanViewController: UITableViewDelegate, UITableViewDataSource{
func numberOfSections(in tableView: UITableView) -> Int {
return 1
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if tableView == suggestionsTableView {
return placeSuggestions.count > 10 ? 10 : placeSuggestions.count
} else if tableView == favoritePlacesTableView {
return favoritePlaces.count
}
return 0
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if tableView == suggestionsTableView {
let suggestCell = tableView.dequeueReusableCell(withIdentifier: "SuggestionSelectCell", for: indexPath) as! AutoPlanCheckBoxCell
let placeInfo = placeSuggestions[indexPath.row]
suggestCell.title = placeInfo.name
suggestCell.isChecked = checkIfLandmarkChosen(placeid: placeInfo.id)
return suggestCell
} else {
let favorCell = tableView.dequeueReusableCell(withIdentifier: "FavoriteSelectCell", for: indexPath) as! AutoPlanCheckBoxCell
let placeInfo = favoritePlaces[indexPath.row]
favorCell.title = placeInfo.name
favorCell.isChecked = checkIfFavoriteChosen(placeid: placeInfo.id)
return favorCell
}
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
print("SELECT")
if tableView == suggestionsTableView {
let placeInfo = placeSuggestions[indexPath.row]
if !checkIfLandmarkChosen(placeid: placeInfo.id) {
chosenLandmarks.append(placeInfo)
} else {
var indexToRemove = -1
for (index, place) in chosenLandmarks.enumerated() {
if place.id == placeInfo.id {
indexToRemove = index
break
}
}
if indexToRemove >= 0 {
chosenLandmarks.remove(at: indexToRemove)
}
}
tableView.reloadData()
} else {
let placeInfo = favoritePlaces[indexPath.row]
if !checkIfFavoriteChosen(placeid: placeInfo.id) {
chosenFavorites.append(placeInfo)
} else {
var indexToRemove = -1
for (index, place) in chosenFavorites.enumerated() {
if place.id == placeInfo.id {
indexToRemove = index
break
}
}
if indexToRemove >= 0 {
chosenFavorites.remove(at: indexToRemove)
}
}
tableView.reloadData()
}
}
private func checkIfLandmarkChosen(placeid: Int32) -> Bool {
for place in chosenLandmarks {
if place.id == placeid {
return true
}
}
return false
}
private func checkIfFavoriteChosen(placeid: Int32) -> Bool {
for place in chosenFavorites {
if place.id == placeid {
return true
}
}
return false
}
}
extension AutoPlanViewController: ZHDropDownMenuDelegate {
func dropDownMenu(_ menu: ZHDropDownMenu, didEdit text: String) {
}
func dropDownMenu(_ menu: ZHDropDownMenu, didSelect index: Int) {
// City Selected
if menu.menuId == 1 {
let cityName = self.cityDropdown.options[index]
self.districtDropDown.options = db.getCityDistrict(city: cityName)
self.districtDropDown.defaultValue = "請選擇"
} else {
// District selected
let districtName = self.districtDropDown.options[index]
if let cityName = self.cityDropdown.contentTextField.text {
if let addrid = db.getAddressIdByAddressNames(city: cityName, district: districtName) {
self.activityIndicator.startAnimating()
DispatchQueue.main.async {
self.placeSuggestions = self.db.searchForPlaceInfos(by: Int(addrid), of: Int(PlaceForm.landmark.rawValue))
self.favoritePlaces = self.db.getFavoritePlaces(of: self.testUserId, with: Int(PlaceForm.landmark.rawValue), in: Int(addrid))
self.refreshTable()
self.activityIndicator.stopAnimating()
}
}
}
}
}
}
extension AutoPlanViewController: CLLocationManagerDelegate {
func setupDetermineLocation() {
locationManager = CLLocationManager()
locationManager.delegate = self
locationManager.desiredAccuracy = kCLLocationAccuracyBest
locationManager.requestWhenInUseAuthorization()
}
func startDetectingLocation() {
if CLLocationManager.locationServicesEnabled() {
locationManager.startUpdatingLocation()
}
}
func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
let userLocation:CLLocation = locations[0] as CLLocation
// Call stopUpdatingLocation() to stop listening for location updates,
// other wise this function will be called every time when user location changes.
manager.stopUpdatingLocation()
self.currentLat = userLocation.coordinate.latitude
self.currentLng = userLocation.coordinate.longitude
print("user latitude = \(userLocation.coordinate.latitude)")
print("user longitude = \(userLocation.coordinate.longitude)")
// print(locationManager.location)
lookUpCurrentLocation { location in
// print(location?.country, location?.locality, location?.name)
if let addr = location?.name {
self.startAddress.text = addr
self.currentAddress = addr
}
}
}
func locationManager(_ manager: CLLocationManager, didFailWithError error: Error)
{
print("Error \(error)")
}
func lookUpCurrentLocation(completionHandler: @escaping (CLPlacemark?)
-> Void ) {
// Use the last reported location.
if let lastLocation = self.locationManager.location {
let geocoder = CLGeocoder()
// Look up the location and pass it to the completion handler
geocoder.reverseGeocodeLocation(lastLocation,
completionHandler: { (placemarks, error) in
if error == nil {
let firstLocation = placemarks?[0]
completionHandler(firstLocation)
}
else {
// An error occurred during geocoding.
completionHandler(nil)
}
})
}
else {
// No location was available.
completionHandler(nil)
}
}
}
| [
-1
] |
343093f333d3df58c2f2c0f6fddf770565732147 | 16f51b9dc3f13ba01ffe4cb852b051ffcc96688d | /es_club/es_club/Controller/GuessViewController.swift | 7943a87714240eff2fd774c90fa73233da510775 | [] | no_license | yueyeqi/ES | b23f4ab047289f013b1e93cd1adfd0adc30ff459 | dc5c7d4714e65ba4500f62d3cf21a293b6fe8a4a | refs/heads/master | 2020-12-25T18:51:57.305537 | 2017-06-20T15:07:36 | 2017-06-20T15:07:36 | 93,998,075 | 1 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 866 | swift | //
// GuessViewController.swift
// es_club
//
// Created by 岳业骑 on 2017/5/31.
// Copyright © 2017年 岳业骑. All rights reserved.
//
import UIKit
class GuessViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
/*
// 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.
}
*/
}
| [
278016,
279041,
279046,
281107,
300057,
296489,
281142,
300089,
238653,
286786,
129604,
228932,
228945,
203858,
280146,
212573,
309347,
309349,
309351,
309353,
286314,
296042,
277612,
311913,
164974,
284275,
277108,
284277,
284279,
292478,
284289,
284298,
278675,
349332,
284315,
284317,
282275,
284323,
198315,
313007,
284336,
276150,
280760,
296638,
277696,
280770,
280772,
280775,
284361,
230604,
298189,
302286,
230608,
317137,
290004,
284373,
290006,
189655,
302295,
298202,
278749,
280797,
298206,
363743,
290020,
301284,
277224,
280808,
280810,
199402,
280813,
289524,
120054,
226038,
280826,
292096,
276736,
280832,
292102,
312586,
287231,
278298,
329499,
287004,
281373,
281380,
233767,
283433,
278845,
279360,
296272,
289112,
188253,
292701,
311645,
227688,
277364,
207738,
290175,
183173,
233869,
304015,
226196,
284570,
284574,
284577,
289187,
289190,
289191,
305577,
291755,
277420,
277421,
289196,
370093,
279982,
286126,
297903,
277427,
305582,
282548,
293816,
277433,
127418,
293308,
278973,
291774,
286158,
280015,
301012,
280030,
279011,
289771,
282095,
302580,
236022,
288251,
278015
] |
3234e690bf6b20596167abea7dc7dcda944ae623 | 84e589caa1d3b46fa393c208649519335cdbb29a | /Quickly/Quickly/Shared/SceneDelegate.swift | 3ec5d492010ff9ecea0f67faebc84a873a7e46db | [] | no_license | pedro0x53/Quickly | a5d6e78e9255711f1d5e9e7c3c988b3a79b7b6d5 | 679043a021eb8f3708304b9ea4d7491dd3b6eb75 | refs/heads/master | 2022-07-16T03:29:21.081260 | 2020-05-12T11:40:00 | 2020-05-12T11:40:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 2,593 | swift | //
// SceneDelegate.swift
// Quickly
//
// Created by Pedro Sousa on 11/05/20.
// Copyright © 2020 Quickly. All rights reserved.
//
import UIKit
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
guard let windowScene = (scene as? UIWindowScene) else { return }
let config = Config()
window = UIWindow(frame: UIScreen.main.bounds)
window?.windowScene = windowScene
window?.rootViewController = config.mainController()
window?.makeKeyAndVisible()
}
func sceneDidDisconnect(_ scene: UIScene) {
// Called as the scene is being released by the system.
// This occurs shortly after the scene enters the background, or when its session is discarded.
// Release any resources associated with this scene that can be re-created the next time the scene connects.
// The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead).
}
func sceneDidBecomeActive(_ scene: UIScene) {
// Called when the scene has moved from an inactive state to an active state.
// Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
}
func sceneWillResignActive(_ scene: UIScene) {
// Called when the scene will move from an active state to an inactive state.
// This may occur due to temporary interruptions (ex. an incoming phone call).
}
func sceneWillEnterForeground(_ scene: UIScene) {
// Called as the scene transitions from the background to the foreground.
// Use this method to undo the changes made on entering the background.
}
func sceneDidEnterBackground(_ scene: UIScene) {
// Called as the scene transitions from the foreground to the background.
// Use this method to save data, release shared resources, and store enough scene-specific state information
// to restore the scene back to its current state.
}
}
| [
325633,
372739,
325637,
350214,
354314,
268299,
350225,
350232,
333851,
405534,
350238,
350241,
350245,
352294,
344103,
350249,
411691,
350252,
178221,
350257,
350260,
266295,
213049,
266298,
376890,
385082,
16444,
350272,
254020,
243782,
217158,
350281,
376906,
395340,
350286,
254032,
374865,
286804,
338005,
368728,
180314,
217180,
342113,
180322,
376932,
266351,
368753,
286833,
252021,
342134,
374904,
286845,
266365,
329853,
192640,
286851,
417925,
262284,
225425,
250003,
268435,
360598,
356507,
411806,
225439,
286880,
346273,
286889,
333998,
258223,
225456,
387250,
225459,
225462,
379067,
225468,
334012,
389309,
225472,
327872,
180418,
225476,
389322,
395467,
225485,
377037,
346317,
225488,
225494,
266454,
256214,
377047,
211161,
225497,
411862,
225500,
411865,
411869,
418012,
418008,
225506,
411874,
379108,
411877,
334047,
225511,
377063,
387303,
338154,
225515,
327915,
205037,
393457,
372977,
375027,
387314,
358645,
393461,
381177,
436474,
321787,
336124,
385281,
336129,
397572,
262405,
389381,
325895,
180491,
411917,
194829,
43279,
268560,
262417,
368913,
379154,
395539,
387350,
432406,
387353,
381212,
258333,
377118,
325918,
182559,
338212,
262437,
356644,
356647,
266537,
356650,
358701,
391469,
395567,
248112,
332081,
358705,
307507,
340276,
368854,
356662,
262455,
264502,
332091,
225599,
332098,
201030,
362823,
262473,
348489,
356580,
151884,
436556,
190797,
334162,
136024,
344404,
213333,
332118,
348503,
418135,
430422,
250201,
383323,
332126,
418145,
332130,
383331,
250211,
262501,
340328,
250217,
348523,
246124,
391531,
383342,
262512,
348528,
182642,
332153,
268669,
194942,
213374,
356734,
438657,
332162,
389507,
356741,
385420,
391564,
420237,
332175,
334224,
366991,
379279,
383375,
272787,
393613,
262551,
262553,
373146,
340380,
373149,
268702,
342431,
416159,
262567,
354728,
375209,
326059,
385452,
262574,
338353,
393649,
373169,
385460,
334263,
262587,
266688,
324032,
344512,
334276,
358857,
338382,
338387,
256474,
195041,
334306,
340452,
338411,
104940,
127473,
162289,
328180,
248309,
217590,
328183,
340473,
199165,
328190,
328193,
350724,
266757,
164362,
391691,
248332,
330254,
328207,
324112,
410129,
186898,
393748,
199189,
340501,
420377,
330268,
334364,
358942,
385571,
191012,
197160,
377384,
33322,
350762,
356908,
381483,
262702,
324143,
358962,
334386,
356917,
324150,
270905,
197178,
324156,
168509,
188990,
334397,
358973,
418364,
418367,
266815,
324165,
219719,
356935,
348745,
270922,
369224,
352844,
324174,
324177,
199250,
385617,
399957,
334425,
191069,
340580,
369254,
262761,
375401,
248427,
352875,
381546,
191085,
338544,
346736,
191093,
346743,
352888,
268922,
336513,
334466,
377473,
334469,
148106,
377485,
162446,
330384,
326291,
184983,
342680,
98969,
352919,
340639,
354975,
344736,
258723,
332455,
150184,
344745,
361130,
271018,
332460,
389806,
332464,
385714,
336568,
248505,
381626,
164539,
328379,
350207,
363198,
260802,
328387,
332484,
350918,
332487,
344777,
373450,
418508,
332494,
385743,
385749,
355029,
391895,
264919,
154329,
416476,
139998,
183006,
338661,
332521,
338665,
361196,
418540,
264942,
330479,
342769,
203508,
340724,
332534,
363252,
375541,
342777,
418555,
348926,
344832,
391938,
207620,
344837,
336644,
191240,
344843,
338701,
391949,
361231,
375569,
394002,
256787,
336660,
375572,
326417,
375575,
338712,
375580,
369436,
363294,
162592,
396067,
336676,
346917,
396070,
389927,
326444,
215854,
383794,
355123,
152371,
326452,
326455,
348983,
361274,
375613,
244542,
398141,
260925,
326463,
328516,
355141,
326468,
127815,
328520,
336712,
355144,
361289,
338764,
244552,
326474,
326479,
357202,
389971,
330581,
326486,
416599,
213848,
330585,
357208,
342875,
357212,
197469,
389979,
355167,
265056,
357215,
430940,
265059,
439138,
326494,
361318,
326503,
344936,
355176,
433001,
361323,
355180,
326508,
400238,
326511,
375657,
355185,
211826,
330612,
381815,
430967,
324473,
398202,
119675,
340859,
324476,
392061,
430973,
340863,
252801,
359296,
351105,
373635,
211846,
369544,
342921,
381834,
324496,
361361,
236432,
324499,
430996,
330643,
252823,
400279,
392092,
324511,
422817,
324514,
201638,
359335,
398246,
252838,
211885,
340910,
324525,
5040,
111539,
324534,
412600,
324539,
324542,
207809,
351169,
359362,
326599,
359367,
187335,
347082,
398280,
345036,
340940,
340942,
209874,
386004,
345046,
330711,
396246,
359389,
340958,
248799,
383968,
431073,
398307,
340964,
386023,
209896,
343018,
209904,
257009,
359411,
435188,
349173,
381947,
201724,
349181,
330750,
383999,
265215,
199681,
431107,
328710,
338951,
328715,
379915,
326669,
330769,
361490,
349203,
386070,
209944,
386074,
209948,
345119,
377888,
250915,
357411,
250917,
158759,
347178,
357419,
214060,
209966,
359471,
396337,
330803,
345139,
209973,
386102,
209976,
339002,
388155,
209980,
361537,
209988,
209991,
347208,
248905,
209996,
341072,
248915,
349268,
189525,
345172,
250968,
156762,
210011,
343132,
339037,
373853,
412765,
361568,
257121,
322660,
341094,
265321,
384108,
210028,
187503,
210032,
345200,
173170,
343155,
384115,
210037,
326767,
361591,
386168,
420985,
361594,
341114,
210042,
210045,
349309,
212095,
361599,
349313,
343168,
210053,
330886,
210056,
384136,
330890,
386187,
384140,
349320,
384144,
373905,
351382,
337048,
248986,
210078,
345247,
384158,
384161,
210081,
251045,
210085,
44199,
380071,
384169,
185512,
339118,
210096,
337072,
345268,
337076,
210100,
324792,
361657,
367801,
210108,
384189,
343232,
351424,
384192,
210116,
244938,
384202,
402636,
322763,
326858,
330959,
210128,
384209,
343246,
333010,
146644,
210132,
330966,
333016,
265433,
351450,
210139,
265438,
66783,
210144,
384225,
388320,
328933,
222438,
343272,
328942,
218355,
386292,
384247,
218361,
384250,
388348,
339199,
242947,
206084,
351492,
396552,
343307,
384270,
261391,
253202,
261395,
349460,
333079,
384284,
245021,
345377,
384290,
345380,
345383,
263464,
208167,
245032,
273709,
349486,
372016,
437553,
347442,
245042,
349492,
199989,
337207,
345400,
396601,
378170,
369979,
415034,
208189,
386366,
437567,
120129,
437571,
384324,
343366,
126279,
212296,
437576,
337224,
251211,
357710,
437584,
331089,
437588,
210261,
263509,
331094,
365912,
396634,
437596,
251236,
337252,
374118,
208228,
345449,
99692,
265581,
367981,
333164,
343410,
271731,
234867,
390518,
249210,
175484,
249215,
249219,
181639,
245128,
249225,
353674,
181644,
249228,
361869,
384398,
136591,
245137,
181650,
249235,
245143,
349591,
230810,
245146,
343453,
245149,
396703,
245152,
357793,
396706,
263585,
245155,
155045,
355749,
181671,
40358,
245158,
181674,
245163,
380333,
181679,
181682,
337330,
343478,
259516,
384444,
415168,
361922,
337350,
181704,
327116,
339406,
359887,
327118,
372177,
208338,
343509,
366039,
415192,
339418,
415194,
339421,
249310,
368093,
415197,
249313,
339425,
415200,
423393,
333285,
339429,
329192,
361961,
415208,
339435,
343535,
366064,
249329,
415217,
343540,
337399,
368120,
415225,
69114,
343545,
402943,
423424,
253445,
337416,
339464,
329227,
359948,
419341,
249355,
208399,
419345,
380433,
175637,
419351,
405017,
345626,
415258,
419357,
370208,
134689,
415264,
394787,
419360,
419363,
366118,
415271,
419369,
359984,
419377,
415282,
265779,
339504,
349748,
415286,
210488,
343610,
415291,
206397,
333374,
415295,
214594,
415301,
396874,
333387,
419404,
370254,
343631,
419408,
214611,
419412,
380919,
224854,
400982,
224858,
366173,
403040,
257636,
423533,
245358,
257647,
138865,
210547,
155255,
224888,
224891,
224895,
333440,
372354,
415362,
126597,
421509,
341852,
224905,
155274,
198282,
274281,
403085,
339818,
11919,
159375,
224914,
403092,
345750,
224920,
206489,
126618,
224923,
419484,
140955,
345758,
224927,
333472,
368289,
224930,
245410,
345763,
224933,
419492,
425639,
345766,
224939,
413539,
224943,
370351,
257713,
425652,
257717,
419510,
257721,
419513,
155323,
333499,
257725,
339827,
425663,
155328,
224960,
337601,
257733,
224966,
419528,
210632,
224970,
419531,
259789,
224976,
257745,
339664,
272083,
257748,
358100,
394967,
155352,
419545,
419543,
224987,
345819,
419548,
181982,
333535,
419551,
153311,
257762,
155364,
345829,
225000,
419560,
337643,
155372,
419564,
399086,
245487,
337647,
210673,
366319,
366322,
399092,
225013,
366326,
325359,
409336,
339696,
245495,
257788,
225021,
337661,
257791,
333566,
372481,
155394,
225027,
257796,
341877,
337671,
210696,
362249,
268042,
155404,
257805,
395022,
225039,
257808,
362256,
366349,
210707,
225044,
167701,
249617,
225049,
399129,
333595,
257820,
225054,
155423,
184096,
210720,
360224,
225059,
339748,
362274,
257834,
225068,
155439,
358192,
225071,
225074,
345906,
225077,
257846,
372533,
397113,
225083,
417596,
345916,
257853,
354107,
397116,
225088,
325441,
366403,
384831,
247618,
225094,
325447,
341831,
225097,
329545,
360262,
370504,
257869,
370510,
341839,
257872,
225105,
341835,
337743,
354124,
225109,
415574,
247639,
337751,
370520,
354132,
358235,
155484,
257884,
261982,
425823,
257887,
155488,
225120,
313181,
257891,
155492,
350046,
376672,
399200,
225128,
257897,
399208,
327532,
345965,
354157,
376686,
268144,
345968,
225138,
345971,
358260,
257902,
225142,
325494,
327542,
345975,
1914,
257914,
399222,
257917,
155517,
225150,
243584,
325505,
257922,
155523,
225156,
339845,
333699,
257927,
360327,
376715,
155532,
247692,
225166,
333709,
395148,
337809,
397201,
225171,
380823,
225176,
329625,
333725,
225183,
436127,
436133,
327590,
155566,
362414,
382898,
370611,
337845,
184245,
190393,
350153,
346059,
311244,
247760,
346064,
393170,
155604,
399318,
372704,
329699,
155620,
253924,
155622,
253927,
190440,
354275,
372707,
247790,
356336,
204785,
350194,
360439,
253944,
333819,
350204,
155647
] |
49c962fb2b3ed2a6649bf6bb53f6f3c38afe5f8a | 87002dc598a6dc1153cea68c4205a67b0817b81e | /ActionAndOutletPractice/AppDelegate.swift | 6878b0d9567d62efffd0087c313b566320c4280e | [] | no_license | peachpipo/ActionAndOutletPractice | 441ecefe98fbf31652d3763aeb208ccff3be8675 | 782ddf2d16ead8481e61a3926ddb327eb209a53a | refs/heads/main | 2023-04-09T12:40:39.944314 | 2021-04-17T03:47:16 | 2021-04-17T03:47:16 | 358,778,483 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,359 | swift | //
// AppDelegate.swift
// ActionAndOutletPractice
//
// Created by lijensu on 2021/1/11.
//
import UIKit
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
// MARK: UISceneSession Lifecycle
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
// Called when a new scene session is being created.
// Use this method to select a configuration to create the new scene with.
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
}
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
// Called when the user discards a scene session.
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
}
}
| [
393222,
393224,
393230,
393250,
344102,
393261,
393266,
213048,
385081,
376889,
393275,
376905,
254030,
368727,
180320,
376931,
368752,
417924,
262283,
377012,
164028,
377036,
180431,
377046,
418007,
418010,
377060,
327914,
205036,
393456,
393460,
418043,
336123,
385280,
262404,
164106,
180490,
368911,
262416,
262422,
377117,
262436,
336180,
262454,
393538,
262472,
344403,
213332,
65880,
262496,
418144,
262499,
213352,
246123,
262507,
262510,
213372,
385419,
393612,
262550,
262552,
385440,
385443,
262566,
385451,
262573,
393647,
385458,
262586,
344511,
262592,
360916,
369118,
328177,
328179,
328182,
328189,
328192,
164361,
410128,
393747,
254490,
188958,
385570,
33316,
377383,
197159,
352821,
197177,
418363,
188987,
369223,
385609,
385616,
352864,
369253,
262760,
352874,
352887,
254587,
377472,
148105,
377484,
352918,
98968,
344744,
361129,
385713,
434867,
164534,
328378,
164538,
328386,
344776,
352968,
352971,
418507,
352973,
385742,
385748,
361179,
189153,
369381,
361195,
418553,
344835,
336643,
344841,
361230,
336659,
418580,
418585,
434970,
369435,
418589,
262942,
418593,
328484,
418598,
418605,
336696,
361273,
328515,
336708,
328519,
361288,
336711,
328522,
336714,
426841,
197468,
254812,
361309,
361315,
361322,
328573,
377729,
369542,
361360,
222128,
345035,
386003,
345043,
386011,
386018,
386022,
435187,
328714,
361489,
386069,
386073,
336921,
336925,
377887,
345133,
345138,
386101,
361536,
189520,
345169,
156761,
361567,
148578,
345199,
386167,
361593,
410745,
361598,
214149,
345222,
386186,
337047,
345246,
214175,
337071,
337075,
386258,
328924,
66782,
222437,
386285,
328941,
386291,
345376,
353570,
345379,
410917,
345382,
337205,
345399,
378169,
369978,
337222,
337229,
263508,
402791,
345448,
271730,
378227,
271745,
181638,
353673,
181643,
181654,
230809,
181673,
181681,
181684,
361917,
181696,
271839,
329191,
361960,
329194,
116210,
337398,
337415,
329226,
419339,
419343,
419349,
419355,
370205,
419359,
394786,
419362,
370213,
419368,
419376,
206395,
214593,
419400,
419402,
353867,
419406,
419410,
394853,
345701,
222830,
370297,
403070,
403075,
345736,
198280,
403091,
345749,
419483,
345757,
345762,
419491,
345765,
419497,
419501,
370350,
419506,
419509,
419512,
337592,
419517,
337599,
419527,
419530,
419535,
272081,
394966,
419542,
419544,
181977,
345818,
419547,
419550,
419559,
337642,
419563,
370415,
337659,
337668,
362247,
395021,
362255,
116509,
345887,
378663,
345905,
354106,
354111,
247617,
354117,
370503,
329544,
345930,
370509,
354130,
247637,
337750,
370519,
313180,
354142,
354150,
354156,
345967,
345970,
345974,
403320,
354172,
247691,
337808,
329623,
436126,
436132,
362413,
337844,
346057,
346063,
247759,
329697,
354277,
190439,
247789,
354313,
346139,
436289,
378954,
395339,
338004,
100453,
329832,
329855,
329885,
346272,
100524,
387249,
379066,
387260,
256191,
395466,
346316,
411861,
411864,
411868,
411873,
379107,
411876,
387301,
346343,
338152,
387306,
387312,
346355,
436473,
379134,
411903,
411916,
379152,
395538,
387349,
338199,
387352,
182558,
248111,
362822,
436555,
190796,
379233,
354673,
248186,
420236,
379278,
354727,
338352,
338381,
338386,
248308,
330252,
420376,
354855,
10828,
199249,
346721,
248425,
191084,
338543,
191092,
346742,
354974,
150183,
248504,
223934,
355024,
273108,
355028,
264918,
183005,
256734,
436962,
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,
248798,
347105,
257008,
183282,
265207,
330748,
265214,
330760,
248862,
347176,
396328,
158761,
199728,
396336,
330800,
396339,
339001,
388154,
388161,
347205,
248904,
330826,
248914,
412764,
339036,
257120,
265320,
248951,
420984,
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,
249227,
175516,
396705,
175522,
355748,
380332,
396722,
208311,
388542,
372163,
216517,
380360,
216522,
339404,
372176,
208337,
339412,
413141,
339417,
339420,
249308,
339424,
339428,
339434,
249328,
69113,
372228,
208398,
380432,
175635,
265778,
265795,
396872,
265805,
224853,
224857,
257633,
224870,
372327,
257646,
372337,
224884,
224887,
224890,
224894,
372353,
224897,
216707,
421508,
126596,
224904,
11918,
159374,
224913,
126610,
224916,
224919,
126616,
208538,
224922,
224926,
224929,
224932,
257704,
224936,
224942,
257712,
224947,
257716,
257720,
224953,
257724,
224959,
257732,
224965,
224969,
339662,
224975,
257747,
224981,
224986,
257761,
224993,
257764,
224999,
339695,
225012,
257787,
225020,
257790,
225025,
257794,
339721,
257801,
257804,
225038,
257807,
225043,
372499,
225048,
257819,
225053,
225058,
257833,
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,
257908,
225141,
257912,
225148,
257916,
257920,
225155,
339844,
225165,
397200,
225170,
380822,
225175,
225180,
118691,
184244,
372664,
372702,
372706,
356335,
372738,
405533,
430129,
266294,
266297,
421960,
356439,
421990,
266350,
356466,
266362,
381068,
225423,
250002,
250004,
225429,
356506,
225437,
135327,
225441,
438433,
225444,
438436,
225447,
438440,
225450,
258222,
225455,
225458,
225461,
225466,
389307,
225470,
381120,
372929,
430274,
225475,
389320,
225484,
225487,
225490,
225493,
266453,
225496,
225499,
225502,
225505,
356578,
225510,
217318,
225514,
225518,
372976,
381176,
389380,
356637,
356640,
356643,
356646,
266536,
356649,
356655,
332080,
340275,
356660,
397622,
332090,
225597,
332097,
348488,
332106,
332117,
348502,
250199,
250210,
389502,
250238,
332161,
356740,
332172,
373145,
340379,
389550,
324030,
266687,
127471,
340472,
381436,
324094,
266754,
324111,
340500,
381481,
356907,
324142,
356916,
324149,
324155,
348733,
324164,
348743,
381512,
324173,
324176,
389723,
332380,
373343,
381545,
340627,
373398,
184982,
258721,
332453,
332459,
389805,
332463,
381617,
332471,
332483,
332486,
373449,
357069,
332493,
357073,
332511,
332520,
332533,
348924,
373510,
389926,
348978,
152370,
340789,
348982,
398139,
357201,
357206,
389978,
430939,
357211,
357214,
201579,
349040,
340849,
430965,
381813,
324472,
398201,
119674,
324475,
430972,
340858,
340861,
324478,
373634,
398211,
324484,
324487,
381833,
324492,
324495,
324498,
430995,
324501,
324510,
422816,
324513,
398245,
324524,
324533,
324541,
398279,
340939,
340941,
209873,
340957,
431072,
398306,
340963,
209895,
201711,
349172,
381946,
349180,
439294,
431106,
357410,
250914,
185380,
357418,
209979,
209995,
341071,
349267,
250967,
210010,
341091,
210025,
210030,
210036,
349308,
349311,
160895,
152703,
210052,
210055,
349319,
218247,
210067,
251044,
185511,
210107,
332997,
210127,
333009,
210131,
333014,
210143,
218354,
218360,
275712,
275715,
275721,
349459,
333078,
251160,
349484,
349491,
415033,
251210,
210260,
365911,
259421,
365921,
333154,
333162,
234866,
390516,
333175,
357755,
374160,
112020,
349590,
357792,
259515,
415166,
415185,
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,
423528,
423532,
210544,
415353,
333439,
415361,
267909,
333498,
210631,
358099,
153302,
333534,
366307,
366311,
431851,
366318,
210672,
366321,
366325,
210695,
268041,
210698,
366348,
210706,
399128,
210719,
358191,
366387,
210739,
399159,
358200,
325440,
366401,
341829,
325446,
46920,
341834,
341838,
415573,
341851,
350045,
399199,
259938,
399206,
358255,
268143,
399215,
358259,
341876,
243579,
333698,
333708,
333724,
382890,
350146,
358371,
350189,
350193,
350202,
350206,
350213,
268298,
350224,
350231,
333850,
350237,
350240,
350244,
350248,
178218,
350251,
350256,
350259,
350271,
243781,
350285,
374864,
342111,
374902,
432271,
334011,
260289,
260298,
350410,
350416,
350422,
211160,
350425,
268507,
334045,
350445,
375026,
358644,
350458,
350461,
350464,
350467,
325891,
350475,
375053,
268559,
350480,
432405,
350486,
325914,
350490,
325917,
350493,
325919,
350498,
194852,
350504,
358700,
391468,
350509,
358704,
358713,
358716,
383306,
334161,
383321,
383330,
383333,
391530,
383341,
268668,
194941,
391563,
366990,
416157,
268701,
342430,
375216,
334262,
334275,
326084,
358856,
334304,
334311,
375277,
334321,
350723,
334358,
342550,
342554,
334363,
350761,
252461,
334384,
358961,
383536,
334394,
252482,
219718,
334407,
350822,
375400,
334465,
334468,
326290,
342679,
342683,
260766,
342710,
244409,
260797,
260801,
350917,
391894,
154328,
416473,
64230,
342766,
375535,
203506,
342776,
391937,
391948,
375568,
326416,
375571,
375574,
162591,
326441,
383793,
326451,
260924,
375612,
244540,
326460,
326467,
244551,
326473,
326477,
416597,
326485,
326490,
342874,
326502,
375656,
433000,
326507,
326510,
211825,
211831,
351097,
392060,
359295,
351104,
342915,
236430,
342930,
252822,
392091,
400285,
252836,
359334,
211884,
400306,
351168,
359361,
359366,
326598,
359382,
359388,
383967,
343015,
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,
384191,
326855,
244937,
253130,
343244,
146642,
359649,
343270,
351466,
351479,
343306,
261389,
359694,
384269,
253200,
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,
368122,
409091,
359947,
359955,
359983,
343630,
179802,
155239,
327275,
138864,
155254,
155273,
368288,
425638,
425649,
155322,
425662,
155327,
155351,
155354,
212699,
155363,
245475,
155371,
245483,
409335,
155393,
155403,
155422,
360223,
155438,
155442,
155447,
417595,
360261,
155461,
376663,
155482,
261981,
425822,
376671,
155487,
155490,
155491,
327531,
261996,
376685,
261999,
262002,
327539,
425845,
147317,
262005,
262008,
262011,
155516,
155521,
155525,
360326,
376714,
155531,
262027,
262030,
262033,
262036,
262039,
262042,
155549,
262045,
262048,
262051,
327589,
155559,
155562,
155565,
393150,
393169,
384977,
155611,
155619,
253923,
155621,
253926,
204784,
393203,
360438,
253943,
393206,
393212,
155646
] |
b4f518f226439ca0a6b9f74ce0b1fd62e75159f5 | 85215c983a56c79dc5dedabf1c3a13eabbbba88a | /IOS/acelerometro/acelerometro/AppDelegate.swift | 3e6cf032bd7e40e35b7d1f3fcb799a9b828ac2b2 | [] | no_license | amadorantonio/IOS-MTWDM | 430ce7ab340191c28c4bc4812c66f446f86eea50 | 06fcc9ae76ceb5cf54d82a1f8734f09ecc2e2f72 | refs/heads/main | 2023-04-16T20:14:50.707960 | 2021-05-08T15:05:50 | 2021-05-08T15:05:50 | 341,002,590 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,345 | swift | //
// AppDelegate.swift
// acelerometro
//
// Created by MTWDM on 08/05/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,
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,
180490,
164106,
368911,
262416,
262422,
377117,
262436,
336180,
262454,
393538,
262472,
344403,
213332,
65880,
262496,
418144,
262499,
213352,
246123,
262507,
262510,
213372,
385419,
393612,
262550,
262552,
385440,
385443,
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,
352968,
344776,
352971,
418507,
352973,
385742,
385748,
361179,
189153,
369381,
361195,
418553,
344831,
336643,
344835,
344841,
361230,
336659,
418580,
418585,
434970,
369435,
418589,
262942,
418593,
336675,
328484,
418598,
418605,
336696,
361273,
328515,
336708,
328519,
361288,
336711,
328522,
336714,
426841,
254812,
361309,
197468,
361315,
361322,
328573,
377729,
369542,
361360,
222128,
345035,
386003,
345043,
386011,
386018,
386022,
435187,
328714,
361489,
386069,
386073,
336921,
336925,
345118,
377887,
345133,
345138,
386101,
361536,
197707,
189520,
345169,
156761,
361567,
148578,
345199,
386167,
361593,
410745,
361598,
214149,
345222,
386186,
337047,
345246,
214175,
337071,
337075,
386258,
328924,
66782,
222437,
386285,
328941,
386291,
345376,
353570,
345379,
410917,
345382,
337205,
345399,
378169,
369978,
337222,
337229,
337234,
263508,
402791,
345448,
271730,
378227,
271745,
181638,
353673,
181643,
181654,
230809,
181670,
181673,
181678,
181681,
337329,
181684,
181690,
361917,
181696,
337349,
181703,
337365,
271839,
329191,
361960,
116210,
337398,
337415,
329226,
419339,
419343,
419349,
419355,
370205,
419359,
394786,
419362,
370213,
419368,
419376,
206395,
214593,
419400,
419402,
353867,
419406,
419410,
394853,
345701,
222830,
370297,
403070,
403075,
345736,
198280,
403091,
345749,
419483,
345757,
345762,
419491,
345765,
419497,
419501,
370350,
419506,
419509,
419512,
337592,
419517,
337599,
419527,
419530,
419535,
272081,
419542,
394966,
419544,
181977,
345818,
419547,
419550,
419559,
337642,
419563,
337645,
370415,
337659,
141051,
337668,
362247,
395021,
362255,
116509,
345887,
378663,
345905,
354106,
354111,
247617,
354117,
370503,
329544,
345930,
370509,
354130,
247637,
337750,
370519,
313180,
354142,
354150,
354156,
345967,
345970,
345974,
403320,
354172,
247691,
337808,
247700,
329623,
436126,
436132,
337833,
362413,
337844,
346057,
247759,
346063,
329697,
354277,
190439,
247789,
354313,
346139,
436289,
378954,
395339,
338004,
100453,
329832,
329855,
329867,
329885,
411805,
346272,
100524,
387249,
379066,
387260,
256191,
395466,
346316,
411861,
411864,
411868,
411873,
379107,
411876,
387301,
346343,
338152,
387306,
387312,
346355,
436473,
321786,
379134,
411903,
411916,
379152,
395538,
387349,
338199,
387352,
182558,
338211,
395566,
248111,
362822,
436555,
190796,
379233,
354673,
248186,
420236,
379278,
272786,
354727,
338352,
330189,
338381,
338386,
338403,
338409,
248308,
199164,
330252,
199186,
420376,
330267,
354855,
10828,
199249,
346721,
174695,
248425,
191084,
338543,
191092,
346742,
330383,
354974,
150183,
174774,
248504,
174777,
223934,
355024,
273108,
355028,
264918,
183005,
256734,
436962,
338660,
338664,
264941,
363251,
207619,
264964,
338700,
256786,
199452,
363293,
396066,
346916,
396069,
215853,
355122,
355131,
355140,
355143,
338763,
355150,
330580,
355166,
265055,
265058,
355175,
387944,
355179,
330610,
330642,
355218,
412599,
207808,
379848,
396245,
330710,
248792,
248798,
347105,
257008,
183282,
265207,
330748,
265214,
330760,
330768,
248862,
396328,
347176,
158761,
199728,
396336,
330800,
396339,
339001,
388154,
388161,
347205,
248904,
330826,
248914,
412764,
339036,
257120,
265320,
248951,
420984,
330889,
347287,
248985,
339097,
44197,
380070,
339112,
126144,
330958,
330965,
265432,
265436,
388319,
388347,
175375,
159005,
175396,
208166,
273708,
347437,
372015,
347441,
372018,
199988,
44342,
175415,
396600,
437566,
175423,
437570,
437575,
437583,
331088,
437587,
331093,
396633,
175450,
437595,
175457,
208227,
175460,
175463,
265580,
437620,
175477,
249208,
175483,
175486,
249214,
175489,
249218,
249224,
249227,
249234,
175513,
175516,
396705,
175522,
355748,
380332,
396722,
208311,
388542,
372163,
216517,
380360,
216522,
339404,
372176,
208337,
339412,
413141,
339417,
339420,
249308,
339424,
249312,
339428,
339434,
249328,
69113,
372228,
208398,
380432,
175635,
265778,
265795,
396872,
265805,
224853,
224857,
257633,
224870,
372327,
257646,
372337,
224884,
224887,
224890,
224894,
224897,
372353,
216707,
126596,
421508,
224904,
224909,
11918,
159374,
224913,
126610,
339601,
224916,
224919,
126616,
224922,
208538,
224926,
224929,
224932,
224936,
257704,
224942,
257712,
224947,
257716,
257720,
224953,
257724,
224959,
257732,
224965,
224969,
339662,
224975,
257747,
224981,
224986,
257761,
224993,
257764,
224999,
339695,
225012,
257787,
225020,
339710,
257790,
225025,
257794,
339721,
257801,
257804,
225038,
257807,
225043,
372499,
167700,
225048,
257819,
225053,
184094,
225058,
257833,
225066,
257836,
413484,
225070,
225073,
372532,
257845,
225079,
397112,
225082,
397115,
225087,
225092,
225096,
323402,
257868,
225103,
257871,
397139,
225108,
225112,
257883,
257886,
225119,
257890,
339814,
225127,
257896,
274280,
257901,
225137,
339826,
257908,
225141,
257912,
225148,
257916,
257920,
225155,
339844,
225165,
397200,
225170,
380822,
225175,
225180,
118691,
184244,
372664,
372702,
372706,
356335,
380918,
372738,
405533,
430129,
266294,
266297,
421960,
356439,
421990,
266350,
356466,
266362,
381068,
225423,
250002,
250004,
225429,
356506,
225437,
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,
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,
332493,
357069,
357073,
332511,
332520,
340718,
332533,
348924,
389892,
373510,
389926,
348978,
152370,
340789,
348982,
398139,
127814,
357201,
357206,
389978,
430939,
357211,
357214,
201579,
201582,
349040,
340849,
430965,
381813,
324472,
398201,
340858,
324475,
430972,
340861,
324478,
119674,
324481,
373634,
398211,
324484,
324487,
381833,
324492,
324495,
324498,
430995,
324501,
324510,
422816,
324513,
398245,
201637,
324524,
340909,
324533,
324538,
324541,
398279,
340939,
340941,
209873,
340957,
431072,
398306,
340963,
209895,
201711,
381946,
349180,
439294,
431106,
357410,
250914,
185380,
357418,
209979,
209995,
341071,
349267,
250967,
210010,
341091,
210025,
210030,
210036,
349308,
349311,
160895,
152703,
210052,
349319,
210055,
218247,
210067,
251044,
185511,
210107,
332997,
210127,
333009,
210131,
333014,
210143,
218354,
218360,
251128,
275706,
275712,
275715,
275721,
349459,
333078,
251160,
349484,
349491,
251189,
415033,
251210,
357708,
210260,
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,
153302,
333534,
366307,
366311,
431851,
366318,
210672,
366321,
366325,
210695,
268041,
210698,
366348,
210706,
399128,
333594,
210719,
358191,
366387,
210739,
399159,
358200,
325440,
366401,
341829,
325446,
46920,
341834,
341838,
341843,
415573,
358234,
341851,
350045,
399199,
259938,
399206,
268143,
358255,
399215,
358259,
341876,
243579,
325504,
333698,
333708,
333724,
382890,
350146,
358371,
350189,
350193,
350202,
333818,
350206,
350213,
268298,
350224,
350231,
333850,
350237,
350240,
350244,
350248,
178218,
350251,
350256,
350259,
350271,
243781,
350285,
374864,
342111,
342133,
374902,
432271,
333997,
334011,
260289,
260298,
350410,
350416,
350422,
211160,
350425,
268507,
334045,
350445,
375026,
358644,
350458,
350461,
350464,
325891,
350467,
350475,
375053,
268559,
350480,
432405,
350486,
325914,
350490,
325917,
350493,
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,
334275,
326084,
358856,
334304,
334311,
375277,
334321,
350723,
391690,
186897,
342545,
334358,
342550,
342554,
334363,
350761,
252461,
334384,
383536,
358961,
334394,
252482,
219718,
334407,
334420,
350822,
375400,
334465,
334468,
326290,
342679,
342683,
260766,
342710,
244409,
260797,
260801,
350917,
154317,
391894,
154328,
416473,
64230,
113388,
342766,
375535,
203506,
342776,
391937,
391948,
375568,
326416,
375571,
375574,
162591,
326441,
383793,
326451,
326454,
326460,
260924,
375612,
244540,
326467,
244551,
326473,
326477,
326485,
416597,
326490,
342874,
326502,
375656,
433000,
326507,
326510,
211825,
211831,
351097,
392060,
359295,
351104,
342915,
400259,
236430,
342930,
252822,
392091,
400285,
252836,
359334,
211884,
400306,
351168,
359361,
326598,
359366,
359382,
359388,
383967,
343015,
359407,
261108,
244726,
261111,
383997,
261129,
359451,
261147,
211998,
261153,
261159,
359470,
359476,
343131,
384098,
384101,
384107,
367723,
187502,
343154,
384114,
212094,
351364,
384135,
384139,
384143,
351381,
384160,
384168,
367794,
384181,
367800,
384191,
351423,
326855,
244937,
253130,
343244,
146642,
359649,
343270,
351466,
351479,
343306,
261389,
359694,
384269,
253200,
384275,
245020,
245029,
171302,
351534,
376110,
245040,
425276,
384323,
212291,
343365,
212303,
367965,
343393,
343398,
367980,
425328,
343409,
253303,
154999,
343417,
327034,
245127,
384397,
245136,
245142,
245145,
343450,
245148,
245151,
245154,
245157,
245162,
327084,
359865,
384443,
146876,
327107,
384453,
327110,
327115,
327117,
359886,
359890,
343507,
368092,
343534,
343539,
368119,
343544,
368122,
409091,
359947,
359955,
359983,
343630,
179802,
155239,
327275,
245357,
138864,
155254,
155273,
368288,
245409,
425638,
425649,
155322,
425662,
155327,
155351,
155354,
212699,
155363,
245475,
155371,
245483,
409335,
155393,
155403,
155422,
360223,
155438,
155442,
155447,
417595,
360261,
155461,
376663,
155482,
261981,
425822,
155487,
376671,
155490,
155491,
327531,
261996,
376685,
261999,
262002,
327539,
147317,
262005,
425845,
262008,
262011,
155516,
155521,
155525,
360326,
376714,
155531,
262027,
262030,
262033,
262036,
262039,
262042,
155549,
262045,
262048,
262051,
327589,
155559,
155562,
155565,
393150,
393169,
384977,
155611,
155619,
253923,
155621,
253926,
327654,
204784,
393203,
360438,
253943,
393206,
393212,
155646
] |
6ed1cacfbd479ea6e953a7dc0fbdb7ceed76ad31 | b2a9b3655446df7687439b82d1055c49b3e362f6 | /UpcomingMoviesTests/Helpers/Mocks/AccountMockFactory.swift | 09a8763e32f5981f07dbfc619ece0b6473d8cff7 | [
"MIT"
] | permissive | texyz/Upcoming-Movies-App | ddaf9dd09eeeafd85df08408df1715c528a1faea | 1bd630255e4624e2524d529678aac790d5522b54 | refs/heads/master | 2023-07-18T15:23:02.701042 | 2021-09-04T11:17:58 | 2021-09-04T11:17:58 | 403,035,400 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 758 | swift | //
// AccountMockFactory.swift
// UpcomingMoviesTests
//
// Created by Rotimi Joshua on 10/04/2021.
//
import Foundation
@testable import UpcomingMovies
@testable import UpcomingMoviesDomain
class MockAccountInteractor: AccountInteractorProtocol {
var permissionURLResult: Result<URL, Error>?
func getAuthPermissionURL(completion: @escaping (Result<URL, Error>) -> Void) {
completion(permissionURLResult!)
}
var signInUserResult: Result<User, Error>?
func signInUser(completion: @escaping (Result<User, Error>) -> Void) {
completion(signInUserResult!)
}
var currentUserResult: User?
func currentUser() -> User? {
return currentUserResult
}
func signOutUser() {}
}
| [
-1
] |
5e9ca5f32952cd18a26717e71a13bed4742efcc5 | 18a14fff0d1a13b0c459fa83daa45b78215669d6 | /CoordinatorsMemoryProblemProject/Scenes/Home/HomeViewModel.swift | 69b019a11be0326fc8c9b86bc561c166b981ec4b | [] | no_license | chrsp/CoordinatorsMemoryProblemProject | 5ee778bab9aa3c4a605116c66df4c029d7942a46 | 9a76481c0b727318aadf49802cfaac579e627643 | refs/heads/main | 2023-01-24T06:45:48.484308 | 2020-12-11T16:33:20 | 2020-12-11T16:33:20 | 320,314,900 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 270 | swift | //
// HomeViewModel.swift
// CoordinatorsMemoryProblemProject
//
// Created by Charles Prado on 10/12/2020.
//
import Foundation
class HomeViewModel: GenericViewModel {
override var title: String { "Home" }
override var buttonTitle: String { "Settings" }
}
| [
-1
] |
605533ffa42ad2bcddacbe9356b978f45a1c7dd6 | e7f58328ceb62a345243a8cd5a1592021c78ea30 | /Landmarks/Landmarks/SceneDelegate.swift | 4b7b47bcd32970aa9dc35ab093a211628e48662d | [] | no_license | borksson/XCODE | f55434e9991fb136ae33fcf6a64e99a19610d162 | c4ed4413369a917ddff50dd3bbbce8e2b8558eac | refs/heads/main | 2023-04-05T19:37:53.233942 | 2021-04-21T03:53:48 | 2021-04-21T03:53:48 | 360,024,341 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 2,755 | swift | //
// SceneDelegate.swift
// Landmarks
//
// Created by Max Smith on 4/14/20.
// Copyright © 2020 Max Smith. All rights reserved.
//
import UIKit
import SwiftUI
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
// Create the SwiftUI view that provides the window contents.
let contentView = ContentView()
// Use a UIHostingController as window root view controller.
if let windowScene = scene as? UIWindowScene {
let window = UIWindow(windowScene: windowScene)
window.rootViewController = UIHostingController(rootView: contentView)
self.window = window
window.makeKeyAndVisible()
}
}
func sceneDidDisconnect(_ scene: UIScene) {
// Called as the scene is being released by the system.
// This occurs shortly after the scene enters the background, or when its session is discarded.
// Release any resources associated with this scene that can be re-created the next time the scene connects.
// The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead).
}
func sceneDidBecomeActive(_ scene: UIScene) {
// Called when the scene has moved from an inactive state to an active state.
// Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
}
func sceneWillResignActive(_ scene: UIScene) {
// Called when the scene will move from an active state to an inactive state.
// This may occur due to temporary interruptions (ex. an incoming phone call).
}
func sceneWillEnterForeground(_ scene: UIScene) {
// Called as the scene transitions from the background to the foreground.
// Use this method to undo the changes made on entering the background.
}
func sceneDidEnterBackground(_ scene: UIScene) {
// Called as the scene transitions from the foreground to the background.
// Use this method to save data, release shared resources, and store enough scene-specific state information
// to restore the scene back to its current state.
}
}
| [
325633,
325637,
163849,
268299,
333838,
186388,
346140,
352294,
16444,
337980,
254020,
217158,
243782,
395340,
327757,
200786,
286804,
329816,
217180,
368736,
342113,
180322,
329833,
286833,
368753,
252021,
342134,
286845,
192640,
286851,
329868,
268435,
250008,
329886,
286880,
135328,
192674,
333989,
286889,
430257,
180418,
350411,
346317,
180432,
350417,
368854,
350423,
350426,
385243,
334047,
356580,
346344,
327915,
350449,
387314,
375027,
338161,
350454,
321787,
336124,
350459,
350462,
336129,
350465,
350469,
389381,
325895,
194829,
350477,
43279,
350481,
350487,
356631,
338201,
325915,
350491,
381212,
325918,
182559,
350494,
258333,
325920,
350500,
194854,
350505,
350510,
395567,
248112,
332081,
307507,
340276,
336181,
356662,
332091,
332098,
201030,
332107,
190797,
334162,
332118,
418135,
321880,
250201,
332126,
258399,
332130,
250211,
340328,
250217,
348523,
348528,
182642,
321911,
332153,
334204,
268669,
194942,
250239,
332158,
332162,
389507,
348548,
393613,
383375,
332175,
160152,
340380,
268702,
416159,
326059,
373169,
342453,
334263,
338363,
266688,
324032,
336326,
338387,
248279,
369119,
334306,
338404,
334312,
338411,
104940,
375279,
162289,
328178,
328180,
248309,
328183,
340473,
199165,
328190,
324095,
328193,
98819,
324100,
266757,
324103,
164362,
248332,
199182,
328207,
324112,
330254,
186898,
342546,
340501,
324118,
334359,
342551,
324122,
334364,
330268,
340512,
191012,
332325,
324134,
197160,
381483,
324141,
324143,
334386,
324156,
334397,
324161,
324165,
219719,
324171,
324174,
324177,
244309,
334425,
326240,
174696,
375401,
248427,
191085,
346736,
338544,
268922,
334466,
336517,
344710,
119432,
213642,
148106,
162446,
330384,
326291,
340628,
342685,
340639,
336549,
332455,
271018,
332460,
336556,
389806,
332464,
385714,
164535,
336568,
174775,
248505,
174778,
244410,
328379,
332473,
223936,
328387,
332484,
332487,
373450,
418508,
154318,
332494,
342737,
154329,
183006,
139998,
189154,
338661,
338665,
332521,
418540,
330479,
342769,
340724,
332534,
338680,
342777,
418555,
344832,
207620,
191240,
328462,
326417,
336660,
338712,
199455,
336676,
336681,
334633,
326444,
215854,
328498,
152371,
326452,
271154,
326455,
340792,
348983,
244542,
326463,
326468,
328516,
336709,
127815,
244552,
328520,
326474,
328523,
336712,
342857,
326479,
355151,
330581,
326486,
136024,
330585,
326494,
439138,
326503,
375657,
201580,
326508,
201583,
326511,
355185,
211826,
340850,
330612,
201589,
340859,
324476,
328574,
340863,
359296,
351105,
252801,
373635,
324482,
324488,
342921,
236432,
361361,
324496,
330643,
324502,
252823,
324511,
324514,
252838,
201638,
211885,
252846,
324525,
5040,
5047,
324539,
324542,
187335,
398280,
347082,
340940,
345046,
330711,
248794,
340958,
248799,
340964,
386023,
338928,
328690,
359411,
244728,
330750,
265215,
328703,
199681,
328710,
330761,
328715,
326669,
330769,
361490,
349203,
209944,
336922,
209948,
248863,
345119,
250915,
357411,
250917,
158759,
347178,
328747,
209966,
209969,
330803,
209973,
386102,
209976,
339002,
339010,
209988,
209991,
347208,
248905,
330827,
197708,
330830,
341072,
248915,
345172,
183384,
156762,
343132,
339037,
322660,
326764,
210028,
326767,
187503,
345200,
330869,
361591,
386168,
210042,
210045,
361599,
152704,
160896,
330886,
351366,
384136,
384140,
351382,
337048,
210072,
248986,
384152,
210078,
384158,
210081,
384161,
251045,
210085,
210089,
339118,
337072,
337076,
210100,
324792,
367801,
339133,
384189,
343232,
384192,
210116,
244934,
326858,
322763,
333003,
384202,
343246,
384209,
333010,
146644,
330966,
210139,
328925,
66783,
384225,
328933,
343272,
351467,
328942,
251123,
384247,
384250,
388348,
242947,
206084,
115973,
343307,
384270,
333075,
384276,
333079,
251161,
384284,
245021,
384290,
208167,
263464,
171304,
245032,
245042,
251190,
345400,
208189,
386366,
372035,
343366,
126279,
337224,
251211,
357710,
337230,
331089,
337235,
437588,
331094,
365922,
175458,
208228,
343394,
175461,
343399,
337252,
345449,
175464,
333164,
99692,
343410,
234867,
331124,
175478,
155000,
378232,
249210,
175484,
337278,
249215,
245121,
249219,
245128,
249225,
181644,
361869,
249228,
136591,
245137,
181650,
249235,
112021,
181655,
245143,
175514,
245146,
343453,
245149,
245152,
263585,
396706,
245155,
355749,
40358,
181671,
245158,
333222,
245163,
181679,
337330,
327090,
210357,
146878,
181697,
361922,
54724,
327108,
181704,
339401,
327112,
384457,
327116,
327118,
208338,
366035,
343509,
337366,
249310,
249313,
333285,
329195,
343540,
343545,
423424,
253445,
339464,
337416,
249355,
329227,
175637,
405017,
345626,
366118,
339504,
349748,
206397,
214594,
333387,
214611,
333400,
366173,
339553,
343650,
333415,
245358,
333423,
222831,
138865,
339572,
372354,
126597,
339593,
159375,
339602,
126611,
333472,
245410,
345763,
345766,
425639,
245415,
337588,
155323,
333499,
337601,
337607,
333512,
210632,
339664,
358100,
419543,
245463,
212700,
181982,
153311,
333535,
225000,
337643,
245487,
339696,
337647,
245495,
141052,
337661,
339711,
225027,
337671,
339722,
366349,
249617,
321300,
245528,
333593,
116512,
210720,
362274,
184096,
339748,
358192,
372533,
345916,
399166,
384831,
325441,
247618,
325447,
341831,
329545,
341835,
323404,
354124,
337743,
339795,
354132,
341844,
247639,
337751,
358235,
341852,
313181,
413539,
399208,
339818,
327532,
339827,
358260,
341877,
399222,
325494,
182136,
186233,
1914,
333690,
243584,
325505,
333699,
339845,
247692,
333709,
247701,
337814,
329625,
327590,
333737,
382898,
184245,
337845,
190393,
327613,
333767,
350153,
346059,
311244,
358348,
247760,
212945,
333777,
219094,
419810,
329699,
358372,
327655,
247790,
204785,
333819
] |
933945feadeb6c4a63f70b5e82e669f329c36ae6 | 0f80ecf2f8b5c9c159b7ced9a31afd257bfaf9e7 | /Pods/SwiftyStoreKit/SwiftyStoreKit/SwiftyStoreKit.swift | fd773cd40cbb978402638cd15fbef52cc1d65604 | [
"MIT"
] | permissive | sjc2wbq/rautuamn | b08cef045291473d86a0c83efc17c613ee084a92 | 6c4e888026062c2c38b62664f49c8269ad0ca62c | refs/heads/master | 2020-12-02T17:44:52.543280 | 2017-07-06T10:48:21 | 2017-07-06T10:48:21 | 96,419,403 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 12,104 | swift | //
// SwiftyStoreKit.swift
// SwiftyStoreKit
//
// Copyright (c) 2015 Andrea Bizzotto ([email protected])
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import StoreKit
public class SwiftyStoreKit {
// MARK: Private declarations
private class InAppPurchaseStore {
var products: [String: SKProduct] = [:]
func addProduct(_ product: SKProduct) {
products[product.productIdentifier] = product
}
func allProductsMatching(_ productIds: Set<String>) -> Set<SKProduct>? {
var requestedProducts = Set<SKProduct>()
for productId in productIds {
guard let product = products[productId] else {
return nil
}
requestedProducts.insert(product)
}
return requestedProducts
}
}
private var store: InAppPurchaseStore = InAppPurchaseStore()
// As we can have multiple inflight queries and purchases, we store them in a dictionary by product id
private var inflightQueries: [Set<String>: InAppProductQueryRequest] = [:]
private var inflightPurchases: [String: InAppProductPurchaseRequest] = [:]
private var restoreRequest: InAppProductPurchaseRequest?
private var completeTransactionsObserver: InAppCompleteTransactionsObserver?
private var receiptRefreshRequest: InAppReceiptRefreshRequest?
private enum InternalErrorCode: Int {
case restoredPurchaseWhenPurchasing = 0
case purchasedWhenRestoringPurchase = 1
}
// MARK: Singleton
private static let sharedInstance = SwiftyStoreKit()
public class var canMakePayments: Bool {
return SKPaymentQueue.canMakePayments()
}
class var hasInFlightPayments: Bool {
return sharedInstance.inflightPurchases.count > 0 || sharedInstance.restoreRequest != nil
}
public class func completeTransactions(atomically: Bool = true, completion: @escaping ([Product]) -> ()) {
sharedInstance.completeTransactionsObserver = InAppCompleteTransactionsObserver(atomically: atomically, callback: completion)
}
// MARK: Public methods
public class func retrieveProductsInfo(_ productIds: Set<String>, completion: @escaping (RetrieveResults) -> ()) {
guard let products = sharedInstance.store.allProductsMatching(productIds) else {
sharedInstance.requestProducts(productIds, completion: completion)
return
}
completion(RetrieveResults(retrievedProducts: products, invalidProductIDs: [], error: nil))
}
/**
* Purchase a product
* - Parameter productId: productId as specified in iTunes Connect
* - Parameter atomically: whether the product is purchased atomically (e.g. finishTransaction is called immediately)
* - Parameter applicationUsername: an opaque identifier for the user’s account on your system
* - Parameter completion: handler for result
*/
public class func purchaseProduct(_ productId: String, atomically: Bool = true, applicationUsername: String = "", completion: @escaping ( PurchaseResult) -> ()) {
if let product = sharedInstance.store.products[productId] {
sharedInstance.purchase(product: product, atomically: atomically, applicationUsername: applicationUsername, completion: completion)
}
else {
retrieveProductsInfo(Set([productId])) { result -> () in
if let product = result.retrievedProducts.first {
sharedInstance.purchase(product: product, atomically: atomically, applicationUsername: applicationUsername, completion: completion)
}
else if let error = result.error {
completion(.error(error: .failed(error: error)))
}
else if let invalidProductId = result.invalidProductIDs.first {
completion(.error(error: .invalidProductId(productId: invalidProductId)))
}
}
}
}
public class func restorePurchases(atomically: Bool = true, completion: @escaping (RestoreResults) -> ()) {
sharedInstance.restoreRequest = InAppProductPurchaseRequest.restorePurchases(atomically: atomically) { results in
sharedInstance.restoreRequest = nil
let results = sharedInstance.processRestoreResults(results)
completion(results)
}
}
public class func finishTransaction(_ transaction: PaymentTransaction) {
InAppProductPurchaseRequest.finishTransaction(transaction)
}
/**
* Return receipt data from the application bundle. This is read from Bundle.main.appStoreReceiptURL
*/
public static var localReceiptData: Data? {
return InAppReceipt.appStoreReceiptData
}
/**
* Verify application receipt
* - Parameter password: Only used for receipts that contain auto-renewable subscriptions. Your app’s shared secret (a hexadecimal string).
* - Parameter session: the session used to make remote call.
* - Parameter completion: handler for result
*/
public class func verifyReceipt(
using validator: ReceiptValidator,
password: String? = nil,
completion:@escaping (VerifyReceiptResult) -> ()) {
InAppReceipt.verify(using: validator, password: password) { result in
DispatchQueue.main.async {
completion(result)
}
}
}
/**
* Verify the purchase of a Consumable or NonConsumable product in a receipt
* - Parameter productId: the product id of the purchase to verify
* - Parameter inReceipt: the receipt to use for looking up the purchase
* - return: either NotPurchased or Purchased
*/
public class func verifyPurchase(
productId: String,
inReceipt receipt: ReceiptInfo
) -> VerifyPurchaseResult {
return InAppReceipt.verifyPurchase(productId: productId, inReceipt: receipt)
}
/**
* Verify the purchase of a subscription (auto-renewable, free or non-renewing) in a receipt. This method extracts all transactions mathing the given productId and sorts them by date in descending order, then compares the first transaction expiry date against the validUntil value.
* - Parameter productId: the product id of the purchase to verify
* - Parameter inReceipt: the receipt to use for looking up the subscription
* - Parameter validUntil: date to check against the expiry date of the subscription. If nil, no verification
* - Parameter validDuration: the duration of the subscription. Only required for non-renewable subscription.
* - return: either NotPurchased or Purchased / Expired with the expiry date found in the receipt
*/
public class func verifySubscription(
productId: String,
inReceipt receipt: ReceiptInfo,
validUntil date: Date = Date(),
validDuration duration: TimeInterval? = nil
) -> VerifySubscriptionResult {
return InAppReceipt.verifySubscription(productId: productId, inReceipt: receipt, validUntil: date, validDuration: duration)
}
// After verifying receive and have `ReceiptError.NoReceiptData`, refresh receipt using this method
public class func refreshReceipt(_ receiptProperties: [String : AnyObject]? = nil, completion: @escaping (RefreshReceiptResult) -> ()) {
sharedInstance.receiptRefreshRequest = InAppReceiptRefreshRequest.refresh(receiptProperties) { result in
sharedInstance.receiptRefreshRequest = nil
switch result {
case .success:
if let appStoreReceiptData = InAppReceipt.appStoreReceiptData {
completion(.success(receiptData: appStoreReceiptData))
}
else {
completion(.error(error: ReceiptError.noReceiptData))
}
case .error(let e):
completion(.error(error: e))
}
}
}
// MARK: private methods
private func purchase(product: SKProduct, atomically: Bool, applicationUsername: String = "", completion: @escaping (PurchaseResult) -> ()) {
guard SwiftyStoreKit.canMakePayments else {
completion(.error(error: .paymentNotAllowed))
return
}
inflightPurchases[product.productIdentifier] = InAppProductPurchaseRequest.startPayment(product: product, atomically: atomically, applicationUsername: applicationUsername) { results in
self.inflightPurchases[product.productIdentifier] = nil
if let purchasedProductTransaction = results.first {
let returnValue = self.processPurchaseResult(purchasedProductTransaction)
completion(returnValue)
}
}
}
private func processPurchaseResult(_ result: InAppProductPurchaseRequest.TransactionResult) -> PurchaseResult {
switch result {
case .purchased(let product):
return .success(product: product)
case .failed(let error):
return .error(error: .failed(error: error))
case .restored(let product):
return .error(error: .failed(error: storeInternalError(code: InternalErrorCode.restoredPurchaseWhenPurchasing.rawValue, description: "Cannot restore product \(product.productId) from purchase path")))
}
}
private func processRestoreResults(_ results: [InAppProductPurchaseRequest.TransactionResult]) -> RestoreResults {
var restoredProducts: [Product] = []
var restoreFailedProducts: [(Swift.Error, String?)] = []
for result in results {
switch result {
case .purchased(let product):
restoreFailedProducts.append((storeInternalError(code: InternalErrorCode.purchasedWhenRestoringPurchase.rawValue, description: "Cannot purchase product \(product.productId) from restore purchases path"), product.productId))
case .failed(let error):
restoreFailedProducts.append((error, nil))
case .restored(let product):
restoredProducts.append(product)
}
}
return RestoreResults(restoredProducts: restoredProducts, restoreFailedProducts: restoreFailedProducts)
}
private func requestProducts(_ productIds: Set<String>, completion: @escaping (RetrieveResults) -> ()) {
inflightQueries[productIds] = InAppProductQueryRequest.startQuery(productIds) { result in
self.inflightQueries[productIds] = nil
for product in result.retrievedProducts {
self.store.addProduct(product)
}
completion(result)
}
}
private func storeInternalError(code: Int = 0, description: String = "") -> NSError {
return NSError(domain: "SwiftyStoreKit", code: code, userInfo: [ NSLocalizedDescriptionKey: description ])
}
}
| [
181554
] |
aa7be7ff11c834a3f22354d81d3fa55d1be2555c | 553024d322d1573c0962edd393a3df04bbf66014 | /CollectionView/Collection View/FeedFooter.swift | 673b4a63af1c171d7d180d3a2f834720a37c1d9b | [
"MIT"
] | permissive | shabib87/SwiftUICollectionView | f4f41e075068acd04b9ae8db786d2ff8ada76d6e | 51ccfca1980bf27b8fd9a95c97c5d62817b03add | refs/heads/master | 2022-10-10T00:54:17.445452 | 2020-06-08T16:14:36 | 2020-06-08T16:14:36 | 270,055,646 | 9 | 1 | null | null | null | null | UTF-8 | Swift | false | false | 1,389 | swift | // FeedFooter.swift
// Created on 2020-06-06
// Distributed under MIT License
// Copyright © 2020 www.codewithshabib.com
import SwiftUI
struct FeedFooterView: View {
var body: some View {
VStack {
Text("Feed Footer")
.font(.caption)
.frame(minWidth: 0,
maxWidth: .infinity,
alignment: .leading)
.padding(.leading)
Divider()
}
}
}
final class FeedCollectionFooterView: UICollectionReusableView {
override init(frame _: CGRect) {
super.init(frame: .zero)
setupView()
}
required init?(coder _: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
private func setupView() {
let headerView = FeedFooterView()
let hostingController = UIHostingController(rootView: headerView)
hostingController.view.translatesAutoresizingMaskIntoConstraints = false
addSubview(hostingController.view)
hostingController.view.topAnchor.constraint(equalTo: topAnchor).isActive = true
hostingController.view.leftAnchor.constraint(equalTo: leftAnchor).isActive = true
hostingController.view.rightAnchor.constraint(equalTo: rightAnchor).isActive = true
hostingController.view.bottomAnchor.constraint(equalTo: bottomAnchor).isActive = true
}
}
| [
-1
] |
da270f5fdf093958513c3a19746e96333cfbe5d5 | 0a78cc813ce781278b68207ef80dee4d8e0e9585 | /TODOListExtension/TODOExtensionTableView.swift | ecb9e29e8bfd04e972e7aed2b336d05e592eabf3 | [
"MIT"
] | permissive | October-zhuo/TODOList | f94a7ec2e4bcb5b472a596f133aa88a6c7cd072a | bdfb4ea4460c170593c2035cef2c8ebfa3c5403f | refs/heads/master | 2021-01-22T06:58:13.280378 | 2017-09-13T14:03:26 | 2017-09-13T14:03:26 | 102,303,277 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 984 | swift | //
// TODOExtensionTableView.swift
// TODOList
//
// Created by zhuo on 2017/8/6.
// Copyright © 2017年 zhuo. All rights reserved.
//
import Foundation
import UIKit
let kTodayViewControllerCellID = "kTodayViewControllerCellID";
extension TodayViewController : UITableViewDataSource{
@available(iOSApplicationExtension 2.0, *)
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return dataList.count; //>= 3 ? 3 : dataList.count;
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
var cell = tableView.dequeueReusableCell(withIdentifier: kTodayViewControllerCellID) as? TODOListTableViewCell;
if cell == nil {
cell = TODOListTableViewCell.init(style: .default, reuseIdentifier: kTodayViewControllerCellID);
}
let task = dataList[indexPath.row] ;
cell?.configureListCell(task: task);
return cell!;
}
}
| [
-1
] |
ce533cce88b09620b21c9ed9fc2253e6c733f6a8 | 10e9471bbec2fbf8fd408d631dd0af6996f7bd5d | /Sources/CANHack/Signal Occurance/SignalInstance.swift | dfb2d5a35a597aa95cf2af88dbf4538e56b6b24b | [] | no_license | CarSmarts/CANHack | 10b89cc1b37bb7728d6af6f8a15071b37102e7b1 | a831b5cf8bd22443365e0b8b449b56c9fd3a5c76 | refs/heads/master | 2021-07-06T04:31:25.306006 | 2020-07-18T23:38:06 | 2020-07-18T23:38:06 | 94,712,417 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 2,343 | swift | //
// SignalInstance.swift
// SmartCar
//
// Created by Robert Smith on 11/14/17.
// Copyright © 2017 Robert Smith. All rights reserved.
//
import Foundation
import Combine
/// Super vague, but a `Signal` is anything that could be associated with "happening" at a certain time
public protocol Signal: Hashable, CustomStringConvertible, Comparable, Codable { }
/// When a `Signal` "happened"
public typealias Timestamp = Int
/// Ties a Signal to a specific Timestamp
public struct SignalInstance<S: Signal>: Hashable, Codable {
public var signal: S
public var timestamp: Timestamp
public init(signal: S, timestamp: Timestamp) {
self.signal = signal
self.timestamp = timestamp
}
}
extension SignalInstance: CustomStringConvertible {
public var description: String {
return "\(timestamp) \(signal)"
}
}
/// List of SignalInstance sorted by timestamp
public class SignalList<S: Signal>: SortedArray<SignalInstance<S>> {
public init(_ array: [Element] = []) {
super.init(sorting: array) { $0.timestamp < $1.timestamp }
}
}
public extension SignalList {
func mapSignal<T>(_ transform: (S) throws -> T) rethrows -> [(T, Timestamp)] {
try self.map {
(try transform($0.signal), $0.timestamp)
}
}
}
/// Anything that has a list of signalInstances...
public protocol InstanceList {
associatedtype S: Signal
var signalList: SignalList<S> { get }
}
/// ...should also have a list of Timestamps
extension InstanceList {
/// The first timestamp in this dataset
public var firstTimestamp: Timestamp {
return firstInstance?.timestamp ?? 0
}
/// The last timestamp in this dataset
public var lastTimestamp: Timestamp {
return lastInstance?.timestamp ?? 0
}
public var timestamps: [Timestamp] {
return signalList.map { $0.timestamp }
}
public var firstInstance: SignalInstance<S>? {
return signalList.first
}
public var lastInstance: SignalInstance<S>? {
return signalList.last
}
}
/// ...and a way to be notified of insertion
extension InstanceList {
public var newInstancePublisher: AnyPublisher<(Self, SignalInstance<S>), Never> {
return signalList.insertPublisher.map { (self, $0) }.eraseToAnyPublisher()
}
}
| [
-1
] |
784842b738fca499be3aae0b9904fe2fb59a9bc5 | 5cfe308a6eec20d9e6449a4a2fb6d5a686ab9136 | /SwiftLesson07Arrays.playground/Contents.swift | 72665684bc9395c9bd9fd61914a76675ebf8687d | [] | no_license | orest544/SwiftBookPlaygrounds | 77b6876d325aa32d2878b2d8cbe5ed00d8adbe63 | f0683db1fce1438a9d78575ad4e85d168c7a5af3 | refs/heads/master | 2021-01-01T20:18:37.605754 | 2017-10-16T12:00:05 | 2017-10-16T12:00:05 | 98,806,654 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 2,068 | swift |
// task 1
let dayMonth = [31, 28, 31 ,30, 31, 30, 31, 31, 30, 31, 30, 31]
let nameMonth = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
var tupleMonthDay = [(month:String, day:Int)]()
for index in 0..<dayMonth.count {
let tempTuple = (month:nameMonth[index], day:dayMonth[index])
tupleMonthDay.append(tempTuple)
}
// 1 array
for (index, value) in dayMonth.enumerated() {
print("Month: \(index + 1), Count of days: \(value)")
}
print("\n")
// 2 arrays
for i in 0..<dayMonth.count {
print("Month: \(nameMonth[i]), Count of days: \(dayMonth[i])")
}
print("\n")
//tuple
for i in 0..<tupleMonthDay.count {
print("Month: \(tupleMonthDay[i].month), Count of days: \(tupleMonthDay[i].day)")
}
print("\n")
// revers output
/*for var i = (tupleMonthDay.count - 1); i >= 0; i-- {
print("Month: \(tupleMonthDay[i].month), Count of days: \(tupleMonthDay[i].day)")
}
print("\n")
*/
//days to date
let date = (month: "October", day: 6)
var countDays = 0
for i in 0..<dayMonth.count {
if nameMonth[i] != date.month {
countDays += dayMonth[i]
} else {
countDays += date.day
break
}
}
print("Before \(date.month) \(date.day) is \(countDays) days")
print("\n")
// task 2
let optionalArray : [Int?] = [23, nil, 34, nil, nil, 100, nil, 200, 300, 200, nil]
var optionalSum = 0
// force unwrapping
for value in optionalArray {
if value != nil {
optionalSum += value!
}
}
print("Optional sum is: \(optionalSum)")
optionalSum = 0
// optional binding
for value in optionalArray {
if let value = value {
optionalSum += value
}
}
print("Optional sum is: \(optionalSum)")
optionalSum = 0
// binary operation
for value in optionalArray {
optionalSum += value ?? 0
}
print("Optional sum is: \(optionalSum)")
print("\n")
// task 3
let alphabet = "abcdefghijklmnopqrstuvwxyz"
var emptyArray = [String]()
for char in alphabet.characters {
emptyArray.insert(String(char), at: 0)
}
print(emptyArray)
| [
-1
] |
e782a91349f6d29275f0410c9392f83d86dac32c | 3ecffee5cc9d7be9e43e58b722c47881be5125e1 | /BookApp/extensions/UIColor+extensions.swift | b1a29daee79614bcda36df8d2bdd4306eebd34fc | [] | no_license | agCepeda/book-swap-animations | 669736d997439f1897711ea2fca67d331e0f2151 | 30081534fe699f7179fe43a3e098af9358f24ebf | refs/heads/master | 2022-04-25T07:49:56.750992 | 2020-04-26T00:07:20 | 2020-04-26T00:07:20 | 257,912,900 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,965 | swift | //
// UIColor+extensions.swift
// BookApp
//
// Created by Agustin Cepeda on 05/04/20.
// Copyright © 2020 Agustin Cepeda. All rights reserved.
//
import UIKit
extension UIColor {
convenience init(hexString: String, alpha: CGFloat = 1.0) {
let hexString: String = hexString.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines)
let scanner = Scanner(string: hexString)
if (hexString.hasPrefix("#")) {
scanner.scanLocation = 1
}
var color: UInt32 = 0
scanner.scanHexInt32(&color)
let mask = 0x000000FF
let r = Int(color >> 16) & mask
let g = Int(color >> 8) & mask
let b = Int(color) & mask
let red = CGFloat(r) / 255.0
let green = CGFloat(g) / 255.0
let blue = CGFloat(b) / 255.0
self.init(red:red, green:green, blue:blue, alpha:alpha)
}
func toHexString() -> String {
var r:CGFloat = 0
var g:CGFloat = 0
var b:CGFloat = 0
var a:CGFloat = 0
getRed(&r, green: &g, blue: &b, alpha: &a)
let rgb:Int = (Int)(r*255)<<16 | (Int)(g*255)<<8 | (Int)(b*255)<<0
return String(format:"#%06x", rgb)
}
func lighter(by percentage: CGFloat = 30.0) -> UIColor? {
return self.adjust(by: abs(percentage) )
}
func darker(by percentage: CGFloat = 30.0) -> UIColor? {
return self.adjust(by: -1 * abs(percentage) )
}
func adjust(by percentage: CGFloat = 30.0) -> UIColor? {
var red: CGFloat = 0, green: CGFloat = 0, blue: CGFloat = 0, alpha: CGFloat = 0
if self.getRed(&red, green: &green, blue: &blue, alpha: &alpha) {
return UIColor(red: min(red + percentage/100, 1.0),
green: min(green + percentage/100, 1.0),
blue: min(blue + percentage/100, 1.0),
alpha: alpha)
} else {
return nil
}
}
}
| [
-1
] |
219dbc1f74668f7deeb5cc79835d6c6ba7b657d7 | 4ee9cfc133e6fc2163afe590f95b96c34f70a2fb | /LLO_V1/AgreementViewController.swift | 5da422580505175914578a2b3062a7db3c7a70fc | [] | no_license | AtsutadaAbe/LLO_V1 | 5ce3fc907a26597d2f54bc097ae66f4bc431af46 | a1e87428e460b34a361ead5af1b376cc82ed196f | refs/heads/master | 2020-03-23T22:09:03.589131 | 2018-12-20T01:35:41 | 2018-12-20T01:35:41 | 142,156,394 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,100 | swift | //
// AgreementViewController.swift
// LLO_V1
//
// Created by 阿部敦忠 on 2018/08/09.
// Copyright © 2018年 阿部敦忠. All rights reserved.
//
import UIKit
class AgreementViewController: UIViewController {
@IBAction func agree(_ sender: UIButton) {
if (SettingViewController.datas["agree"] == nil || SettingViewController.datas["agree"]?.inputVal == 0) {
//まだ同意していない
let agreeData = ValueData()
agreeData.inputVal = 1
SettingViewController.datas["agree"] = agreeData
SettingViewController.postSetting("agree", agreeData)
}
}
@IBAction func notAgree(_ sender: UIButton) {
self.navigationController!.popToRootViewController(animated: true)
}
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
| [
-1
] |
4eb04ec6ca038fd0e58f44ea0eeb373321b77683 | 065abd74d560614b7e0767cc9daa8454c6db93cb | /Operation/WWDC 2015/Advanced-NSOperations/MyOperationPractice/MyOperationPractice/AppDelegate.swift | 044db1e3369727ea6afe40a194eac3fd7418ef6d | [] | no_license | ssamadgh/WWDC-Videos | 2677b4ac1eac724c2badd976220f6f8e68b526f7 | 4a1754e89c5d7512a21f4f44f627d415c2eb74c4 | refs/heads/master | 2023-08-28T18:28:27.154099 | 2023-08-14T09:56:30 | 2023-08-14T09:56:30 | 166,507,343 | 20 | 14 | null | 2023-08-14T09:56:31 | 2019-01-19T04:50:12 | Objective-C | UTF-8 | Swift | false | false | 459 | swift | /*
AppDelegate.swift
OperationPractice
Created by Seyed Samad Gholamzadeh on 6/27/1396 AP.
Copyright © 1396 AP Seyed Samad Gholamzadeh. All rights reserved.
Abstract:
The app delegate. This, by design, has almost no implementation.
*/
import UIKit
import CoreData
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
//MARK: Properties
var window: UIWindow?
//MARK: UIApplicationDelegate
}
| [
-1
] |
4c27800e0c056af0d623d4efa9b46bd700824d7f | 2b015321d3eb2372cfbdad64542a0ede077c4d9b | /ClassJSon/ClassJSon/AppDelegate.swift | 312984c39df312afcc9056a3b8dbbfa24b1134e0 | [] | no_license | charanr0121/NMIX4310 | 16e1a2d4705ea172bac17d5a89b2dddde875769c | c5bdcbf59fb066ec0553ccf0788488e7e9070cd6 | refs/heads/master | 2020-12-21T17:45:28.869012 | 2020-10-31T17:30:02 | 2020-10-31T17:30:02 | 236,506,672 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,419 | swift | //
// AppDelegate.swift
// ClassJSon
//
// Created by Charan Ramachandran on 2/24/20.
// Copyright © 2020 Charan. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
// MARK: UISceneSession Lifecycle
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
// Called when a new scene session is being created.
// Use this method to select a configuration to create the new scene with.
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
}
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
// Called when the user discards a scene session.
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
}
}
| [
393222,
393224,
393230,
393250,
344102,
393261,
393266,
163891,
213048,
376889,
385081,
393275,
376905,
327756,
254030,
286800,
368727,
180313,
368735,
180320,
376931,
368752,
262283,
377012,
327871,
180416,
377036,
180431,
377046,
377060,
327914,
205036,
393456,
393460,
418043,
336123,
336128,
385280,
262404,
180490,
368911,
262416,
262422,
377117,
262436,
336180,
262454,
262472,
344403,
213332,
65880,
418144,
262496,
262499,
213352,
246123,
262507,
262510,
213372,
385419,
262550,
262552,
385440,
385443,
385451,
262573,
393647,
385458,
262586,
344511,
262592,
360916,
369118,
328177,
328179,
328182,
328189,
328192,
164361,
328206,
410128,
393747,
254490,
188958,
385570,
33316,
197159,
377383,
352821,
188987,
418363,
369223,
385609,
385616,
352856,
352864,
369253,
262760,
352874,
352887,
254587,
377472,
336512,
148105,
377484,
352918,
98968,
344744,
361129,
336555,
385713,
434867,
164534,
336567,
164538,
328378,
328386,
352968,
344776,
418507,
385742,
385748,
361179,
189153,
369381,
418553,
344831,
336643,
344835,
344841,
361230,
336659,
418580,
418585,
434970,
369435,
418589,
262942,
418593,
336675,
328484,
418598,
418605,
336696,
361273,
328515,
336708,
328519,
336711,
361288,
328522,
336714,
426841,
254812,
361309,
197468,
361315,
361322,
328573,
377729,
369542,
222128,
345035,
345043,
386003,
386011,
386018,
386022,
435187,
328702,
328714,
361489,
386069,
336921,
386073,
336925,
345118,
377887,
345138,
386101,
361536,
197707,
345169,
156761,
361567,
148578,
345199,
386167,
361593,
410745,
214149,
345222,
386186,
337047,
345246,
214175,
337071,
337075,
386258,
328924,
66782,
222437,
328941,
386285,
386291,
345376,
353570,
345379,
410917,
345382,
337205,
345399,
378169,
369978,
337222,
337229,
337234,
263508,
402791,
345448,
271730,
378227,
271745,
181638,
353673,
181643,
181654,
230809,
181670,
181673,
181681,
337329,
181684,
181690,
361917,
181696,
337349,
181703,
337365,
271839,
329191,
361960,
329194,
116210,
337398,
337415,
329226,
419339,
419343,
419349,
345625,
419355,
370205,
419359,
394786,
419362,
370213,
419368,
419376,
206395,
214593,
419400,
419402,
353867,
419406,
214610,
419410,
345701,
394853,
222830,
370297,
403075,
198280,
345736,
345749,
345757,
345762,
419491,
345765,
419497,
419501,
370350,
419506,
419509,
419512,
337592,
419517,
337599,
419527,
419530,
419535,
272081,
419542,
394966,
419544,
181977,
419547,
419550,
419559,
337642,
419563,
337645,
370415,
337659,
141051,
337668,
362247,
395021,
362255,
321299,
116509,
345887,
378663,
345905,
354106,
354111,
247617,
354117,
370503,
329544,
370509,
354130,
247637,
337750,
370519,
313180,
354142,
345964,
345967,
345970,
345974,
403320,
354172,
247691,
337808,
247700,
329623,
436132,
337833,
362413,
337844,
346057,
247759,
346063,
329697,
354277,
190439,
247789,
354313,
346139,
436289,
378954,
395339,
338004,
329832,
329855,
329867,
329885,
411805,
346272,
100524,
387249,
379066,
387260,
256191,
346316,
411861,
411864,
411868,
411873,
379107,
411876,
387301,
346343,
338152,
387306,
387312,
346355,
436473,
321786,
379134,
411903,
379152,
395538,
387349,
338199,
387352,
182558,
338211,
395566,
248111,
362822,
436555,
190796,
321879,
379233,
354673,
321910,
248186,
420236,
379278,
354727,
338352,
330189,
338381,
338386,
338403,
338409,
248308,
199164,
330252,
199186,
330267,
354855,
10828,
199249,
174695,
248425,
191084,
338543,
191092,
346742,
330383,
354974,
150183,
174774,
248504,
174777,
223934,
355024,
273108,
355028,
264918,
183005,
256734,
436962,
338660,
338664,
264941,
207619,
264964,
338700,
256786,
199452,
363293,
396066,
346916,
396069,
215853,
355122,
355131,
355140,
355143,
338763,
355150,
330580,
355166,
265055,
355175,
387944,
355179,
330610,
330642,
355218,
412599,
207808,
379848,
396245,
330710,
248792,
248798,
347105,
257008,
183282,
265207,
330748,
265214,
330760,
330768,
248862,
396328,
158761,
199728,
330800,
396339,
339001,
388154,
388161,
347205,
248904,
330826,
248914,
183383,
339036,
412764,
257120,
265320,
248951,
420984,
330889,
347287,
248985,
339097,
44197,
380070,
339112,
249014,
126144,
330958,
330965,
265432,
388319,
388347,
175375,
159005,
175396,
208166,
273708,
372015,
347441,
372018,
199988,
175415,
396600,
437566,
175423,
437570,
437575,
437583,
331088,
437587,
331093,
396633,
175450,
437595,
175457,
208227,
175460,
175463,
265580,
437620,
175477,
249208,
175483,
175486,
249214,
175489,
249218,
249227,
249234,
175513,
175516,
396705,
175522,
355748,
380332,
396722,
372163,
216517,
380360,
216522,
339404,
372176,
208337,
339412,
413141,
339417,
249308,
339420,
339424,
339428,
339434,
249328,
69113,
372228,
339461,
208398,
380432,
175635,
339503,
265778,
265795,
396872,
265805,
224853,
224857,
257633,
224870,
372327,
257646,
372337,
224884,
224887,
224890,
224894,
224897,
372353,
216707,
126596,
339588,
421508,
224904,
224909,
11918,
159374,
224913,
126610,
339601,
224916,
224919,
126616,
224922,
208538,
224926,
224929,
224932,
224936,
257704,
224942,
257712,
224947,
257716,
257720,
224953,
257724,
224959,
257732,
224965,
224969,
339662,
224975,
257747,
224981,
224986,
257761,
224993,
257764,
224999,
339695,
225012,
257787,
225020,
339710,
257790,
225025,
257794,
339721,
257801,
257804,
225038,
257807,
225043,
372499,
167700,
225048,
257819,
225053,
225058,
339747,
339749,
257833,
225066,
257836,
413484,
225070,
225073,
372532,
257845,
225079,
397112,
225082,
397115,
225087,
225092,
225096,
323402,
257868,
225103,
257871,
397139,
225108,
225112,
257883,
257886,
225119,
257890,
339814,
225127,
257896,
274280,
257901,
225137,
339826,
257908,
225141,
257912,
225148,
257916,
257920,
225155,
339844,
225165,
397200,
225170,
380822,
225175,
225180,
118691,
184244,
372664,
372702,
372706,
356335,
380918,
405533,
430129,
217157,
421960,
356439,
421990,
266350,
356466,
266362,
381068,
225423,
250002,
250004,
225429,
356506,
225437,
135327,
225441,
438433,
225444,
438436,
225447,
438440,
225450,
258222,
225455,
430256,
225458,
225461,
225466,
389307,
225470,
381120,
372929,
430274,
225475,
389320,
225484,
225487,
225490,
225493,
266453,
225496,
225499,
225502,
225505,
356578,
225510,
217318,
225514,
225518,
372976,
381176,
389380,
356640,
356643,
356646,
356649,
356655,
332080,
340275,
356660,
397622,
332090,
225597,
332097,
201028,
348488,
332106,
332117,
250199,
250202,
332125,
250210,
348525,
332152,
389502,
250238,
332161,
332172,
373145,
340379,
389550,
324030,
266687,
340451,
160234,
127471,
340472,
324094,
266754,
324099,
324102,
324111,
340500,
324117,
324131,
332324,
381481,
324139,
356907,
324142,
356916,
324149,
324155,
348733,
324160,
324164,
348743,
381512,
324170,
324173,
324176,
389723,
332380,
381545,
340627,
184982,
373398,
258721,
332453,
332459,
389805,
332463,
381617,
332471,
332483,
332486,
373449,
332493,
357069,
357073,
332511,
332520,
340718,
332533,
348924,
389892,
389926,
152370,
348978,
340789,
348982,
398139,
127814,
357206,
389978,
430939,
357211,
357214,
201579,
201582,
349040,
340849,
201588,
430965,
324472,
398201,
119674,
340858,
324475,
430972,
340861,
324478,
324481,
373634,
398211,
324484,
324487,
381833,
324492,
324495,
324498,
430995,
324501,
324510,
422816,
324513,
201637,
398245,
324524,
340909,
324533,
5046,
324538,
324541,
398279,
340939,
340941,
209873,
340957,
431072,
398306,
340963,
209895,
201711,
349172,
349180,
439294,
209943,
209946,
250914,
357410,
185380,
357418,
209965,
209968,
209971,
209975,
209979,
209987,
209990,
341071,
349267,
250967,
210010,
341091,
210025,
210027,
210030,
210036,
210039,
341113,
349308,
210044,
349311,
152703,
160895,
210052,
349319,
210055,
210067,
210071,
210077,
210080,
251044,
210084,
185511,
210088,
210095,
210098,
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,
259421,
365921,
333154,
251235,
333162,
234866,
390516,
333175,
357755,
251271,
136590,
112020,
349590,
357792,
259515,
415166,
415185,
366034,
366038,
415191,
415193,
415196,
415199,
423392,
333284,
366056,
366061,
210420,
415224,
423423,
415257,
415263,
366117,
415270,
144939,
415278,
415281,
415285,
415290,
415293,
349761,
415300,
333386,
333399,
366172,
333413,
423528,
423532,
210544,
415353,
333439,
415361,
267909,
333498,
210631,
333511,
358099,
333534,
366307,
366311,
431851,
366318,
210672,
366321,
210695,
268041,
210698,
366348,
210706,
399128,
333594,
210719,
358191,
366387,
399159,
358200,
325440,
366401,
341829,
325446,
46920,
341834,
341838,
341843,
415573,
358234,
341851,
350045,
399199,
259938,
399206,
268143,
358255,
399215,
358259,
341876,
333689,
243579,
325504,
333698,
333708,
333724,
382890,
350146,
358339,
333774,
358371,
350189,
350193,
333818,
350202,
350206,
350213,
268298,
350224,
350231,
333850,
350237,
350240,
350244,
350248,
178218,
350251,
350256,
350259,
350271,
243781,
350285,
374864,
342111,
342133,
374902,
432271,
333997,
334011,
260289,
260298,
350410,
350416,
350422,
350425,
268507,
334045,
350445,
375026,
358644,
350458,
350461,
350464,
325891,
350467,
350475,
375053,
268559,
350480,
432405,
350486,
350490,
325914,
325917,
350493,
350498,
350504,
358700,
350509,
391468,
358704,
358713,
358716,
383306,
334161,
383321,
383330,
383333,
391530,
383341,
334203,
268668,
194941,
391563,
366990,
416157,
342430,
268701,
375208,
326058,
375216,
334262,
334275,
326084,
358856,
195039,
334304,
334311,
375277,
334321,
350723,
186897,
342545,
334358,
342550,
342554,
334363,
350761,
252461,
334384,
383536,
358961,
334394,
252482,
219718,
334407,
334420,
350822,
375400,
334465,
334468,
162445,
326290,
342679,
342683,
260766,
342710,
244409,
260797,
334528,
260801,
350917,
154317,
391894,
154328,
416473,
64230,
113388,
342766,
375535,
203506,
342776,
391937,
391948,
375568,
326416,
375571,
375574,
162591,
326441,
326451,
326454,
326460,
244540,
260924,
375612,
326467,
244551,
326473,
326477,
326485,
326490,
342874,
326502,
375656,
433000,
326507,
326510,
211825,
211831,
351097,
392060,
359295,
351104,
342915,
400259,
236430,
342930,
252822,
392091,
400285,
252836,
359334,
211884,
400306,
351168,
326598,
359366,
359382,
359388,
383967,
343015,
359407,
261108,
244726,
261111,
383997,
261129,
359451,
261147,
211998,
261153,
261159,
359470,
359476,
343131,
384098,
384101,
384107,
367723,
187502,
343154,
384114,
212094,
351364,
384135,
384139,
384143,
351381,
384151,
384160,
384168,
367794,
244916,
384181,
367800,
384188,
384191,
351423,
326855,
244937,
384201,
253130,
343244,
384208,
146642,
384224,
359649,
343270,
351466,
384246,
351479,
343306,
261389,
359694,
384275,
384283,
245020,
384288,
245029,
171302,
351534,
376110,
245040,
425276,
384323,
212291,
343365,
212303,
367965,
343393,
343398,
367980,
343409,
253303,
154999,
343417,
327034,
245127,
384397,
245136,
245142,
245145,
343450,
245148,
245151,
245154,
245157,
245162,
327084,
359865,
384443,
146876,
327107,
384453,
327110,
327115,
327117,
359886,
359890,
343507,
368092,
343534,
343539,
368119,
343544,
368122,
409091,
359947,
359955,
359983,
343630,
327275,
245357,
138864,
155254,
155273,
368288,
245409,
425638,
425649,
155322,
425662,
155327,
253943,
245460,
155351,
155354,
212699,
245475,
155363,
245483,
155371,
409335,
155393,
155403,
245525,
155422,
360223,
155438,
155442,
155447,
155461,
360261,
376663,
155482,
261981,
425822,
155487,
376671,
155490,
155491,
327531,
261996,
376685,
261999,
262002,
327539,
262005,
147317,
425845,
262008,
262011,
155516,
155521,
155525,
360326,
155531,
262027,
262030,
262033,
262036,
262039,
262042,
155549,
262045,
262048,
262051,
327589,
155559,
155562,
155565,
393150,
384977,
393169,
155611,
155619,
253923,
155621,
253926,
327654,
393203,
360438,
393206,
393212,
155646
] |
fd53334cc47a046a00b9853f65fd4de1586ed099 | c8643171020652426502fe3e26db39346e389c70 | /Sources/config-validator/Services/Task/Protocol/TaskService.swift | 9f6a7b02d614b2b6e0e23384609875a09c229b3b | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | rwbutler/ConfigValidator | 4c5863a3cc1412df9b85f3cb8c0ec7691db10dbb | 202ad633dcdc2adf0596aa819f6f8c7858ec68ff | refs/heads/master | 2021-06-27T13:07:56.013023 | 2020-09-24T14:06:19 | 2020-09-24T14:06:19 | 151,885,837 | 7 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 172 | swift | //
// TaskService.swift
// Config Validator
//
// Created by Ross Butler on 11/8/18.
//
import Foundation
protocol TaskService {
func run(task: Task) -> String?
}
| [
-1
] |
f15b39c689229ed728efab8c5b00cc56094986f8 | b61f41738e51d93f7523a43adedf5fc32faff146 | /Cookbook/Cookbook/Reusable Components/PlotView.swift | 512b3e8c8a89ae6059a45d789e86a1d3c758fb65 | [
"MIT"
] | permissive | sigmonkycnbc/Cookbook | b3471d42119a6e9d2c4052638df664baeee6069d | 01f1579414d5d2277f34c4875cf5ca3705f664e8 | refs/heads/main | 2023-03-13T13:01:32.722217 | 2021-02-12T04:31:10 | 2021-02-12T04:31:10 | 349,163,016 | 0 | 0 | MIT | 2021-03-18T17:33:14 | 2021-03-18T17:33:13 | null | UTF-8 | Swift | false | false | 3,207 | swift | import AudioKit
import AudioKitUI
import SwiftUI
import AVFoundation
struct DryWetMixPlotsView: View {
var dry: NodeOutputPlot
var wet: NodeOutputPlot
var mix: NodeOutputPlot
var height: CGFloat = 100
func plot(_ plot: NodeOutputPlot, label: String) -> some View {
VStack {
HStack { Text(label); Spacer() }
ZStack {
RoundedRectangle(cornerRadius: 10)
.foregroundColor(Color(hue: 0, saturation: 0, brightness: 0.5, opacity: 0.2))
.frame(height: height)
PlotView(view: plot).frame(height: height).clipped()
}
}
}
var body: some View {
VStack(spacing: 30) {
plot(dry, label: "Input")
plot(wet, label: "Processed Signal")
plot(mix, label: "Mixed Output")
}
}
}
struct DryWetMixView: View {
var dry: Node
var wet: Node
var mix: Node
var height: CGFloat = 100
func plot(_ node: Node, label: String, color: Color) -> some View {
VStack {
HStack { Text(label); Spacer() }
ZStack {
RoundedRectangle(cornerRadius: 10)
.foregroundColor(Color(hue: 0, saturation: 0, brightness: 0.5, opacity: 0.2))
.frame(height: height)
NodeOutputView(node, color: color).frame(height: height).clipped()
}
}
}
var body: some View {
VStack(spacing: 30) {
plot(dry, label: "Input", color: .red)
plot(wet, label: "Processed Signal", color: .blue)
plot(mix, label: "Mixed Output", color: .purple)
}
}
}
struct DryWetMixFFTPlotsView: View {
var dry: NodeFFTPlot
var wet: NodeFFTPlot
var mix: NodeFFTPlot
var height: CGFloat = 100
func plot(_ plot: NodeFFTPlot, label: String) -> some View {
VStack {
HStack { Text(label); Spacer() }
ZStack {
RoundedRectangle(cornerRadius: 10)
.foregroundColor(Color(hue: 0, saturation: 0, brightness: 0.5, opacity: 0.2))
.frame(height: height)
FFTPlotView(view: plot).frame(height: height).clipped()
}
}
}
var body: some View {
VStack(spacing: 30) {
plot(dry, label: "Input")
plot(wet, label: "Processed Signal")
plot(mix, label: "Mixed Output")
}
}
}
struct PlotView: UIViewRepresentable {
typealias UIViewType = NodeOutputPlot
var view: NodeOutputPlot
func makeUIView(context: Context) -> NodeOutputPlot {
view.backgroundColor = UIColor.clear //UIColor(hue: 0, saturation: 0, brightness: 0.5, alpha: 0.2)
return view
}
func updateUIView(_ uiView: NodeOutputPlot, context: Context) {
//
}
}
struct FFTPlotView: UIViewRepresentable {
typealias UIViewType = NodeFFTPlot
var view: NodeFFTPlot
func makeUIView(context: Context) -> NodeFFTPlot {
view.backgroundColor = .systemBackground
return view
}
func updateUIView(_ uiView: NodeFFTPlot, context: Context) {
//
}
}
| [
-1
] |
3fe287a639428628a9a2332fd24529150142e526 | 7dd33e817edb511e46ad94aff2532527457f9389 | /bePOSChallenge/bePOSChallenge/Bundle/SceneDelegate.swift | 1d185b4cea3f2e3efdda7e8fc9c288e57df9777d | [] | no_license | hoangbachvan/bePOSChallenge | 4857e9aeed2eb1db7ab32af60a12d498f2414e4b | 722793d9f129086971a6ceb6dcf674c0129d4897 | refs/heads/master | 2022-12-10T16:16:57.394684 | 2020-09-07T13:11:00 | 2020-09-07T13:11:00 | 293,516,826 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 2,542 | swift | //
// SceneDelegate.swift
// BaseProduct
//
// Created by Bach Hoang on 9/4/20.
// Copyright © 2020 Bach Van Hoang. All rights reserved.
//
import UIKit
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
guard let _ = (scene as? UIWindowScene) else { return }
}
func sceneDidDisconnect(_ scene: UIScene) {
// Called as the scene is being released by the system.
// This occurs shortly after the scene enters the background, or when its session is discarded.
// Release any resources associated with this scene that can be re-created the next time the scene connects.
// The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead).
}
func sceneDidBecomeActive(_ scene: UIScene) {
// Called when the scene has moved from an inactive state to an active state.
// Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
}
func sceneWillResignActive(_ scene: UIScene) {
// Called when the scene will move from an active state to an inactive state.
// This may occur due to temporary interruptions (ex. an incoming phone call).
}
func sceneWillEnterForeground(_ scene: UIScene) {
// Called as the scene transitions from the background to the foreground.
// Use this method to undo the changes made on entering the background.
}
func sceneDidEnterBackground(_ scene: UIScene) {
// Called as the scene transitions from the foreground to the background.
// Use this method to save data, release shared resources, and store enough scene-specific state information
// to restore the scene back to its current state.
// 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,
385082,
16444,
393277,
376906,
327757,
254032,
286804,
368728,
254045,
368736,
180322,
376932,
286833,
286845,
286851,
417925,
262284,
360598,
286880,
286889,
377003,
377013,
164029,
327872,
180418,
377030,
377037,
180432,
377047,
418008,
385243,
418012,
377063,
327915,
205037,
393457,
393461,
393466,
418044,
336124,
385281,
336129,
262405,
164107,
336140,
180491,
368913,
262417,
262423,
377118,
377121,
262437,
254253,
336181,
262455,
393539,
262473,
344404,
213333,
418135,
270687,
262497,
418145,
262501,
213354,
246124,
262508,
262512,
213374,
385420,
262551,
262553,
385441,
385444,
262567,
385452,
262574,
393649,
385460,
262587,
344512,
262593,
336326,
360917,
369119,
328178,
328180,
328183,
328190,
254463,
328193,
98819,
164362,
328204,
328207,
410129,
393748,
377372,
188959,
385571,
377384,
197160,
33322,
352822,
270905,
197178,
418364,
188990,
369224,
270922,
385610,
352844,
385617,
352865,
262761,
352875,
344694,
352888,
336513,
377473,
336517,
344710,
385671,
148106,
377485,
352919,
98969,
336549,
344745,
336556,
434868,
164535,
336568,
164539,
328379,
328387,
352969,
385743,
385749,
189154,
369382,
361196,
418555,
344832,
336644,
344837,
344843,
328462,
361231,
394002,
336660,
418581,
418586,
434971,
369436,
369439,
418591,
262943,
418594,
336676,
418600,
418606,
271154,
328498,
369464,
361274,
328516,
336709,
328520,
361289,
336712,
336715,
328523,
361300,
213848,
426842,
361307,
197469,
254813,
361310,
361318,
344936,
361323,
361335,
328574,
369544,
361361,
222129,
345036,
386004,
345046,
386012,
386019,
328690,
435188,
328703,
418822,
328710,
377867,
328715,
386070,
336922,
345119,
377888,
328747,
345134,
345139,
361525,
361537,
377931,
197708,
189525,
156762,
402523,
361568,
148580,
345200,
361591,
386168,
361594,
410746,
214150,
345224,
386187,
337048,
345247,
361645,
337072,
345268,
337076,
402615,
361657,
402636,
328925,
165086,
165092,
328933,
222438,
328942,
386286,
386292,
206084,
115973,
328967,
345377,
345380,
353572,
345383,
263464,
337207,
345400,
378170,
369979,
386366,
337224,
337230,
337235,
263509,
353634,
337252,
402792,
345449,
99692,
271731,
378232,
337278,
271746,
181639,
353674,
181644,
361869,
181650,
181655,
230810,
181671,
181674,
181679,
181682,
337330,
181687,
370105,
181691,
181697,
337350,
181704,
337366,
271841,
329192,
361961,
329195,
116211,
337399,
402943,
337416,
329227,
419341,
419345,
329234,
419351,
345626,
419357,
345631,
370208,
419360,
394787,
419363,
370214,
419369,
394796,
419377,
419386,
206397,
214594,
419401,
353868,
419404,
419408,
214611,
419412,
403040,
345702,
222831,
370298,
353920,
403076,
345737,
198282,
403085,
403092,
345750,
419484,
345758,
345763,
419492,
419498,
419502,
370351,
419507,
337588,
419510,
419513,
419518,
403139,
337607,
419528,
419531,
419536,
272083,
394967,
419545,
345819,
419548,
181982,
419551,
345829,
419560,
337643,
419564,
337647,
370416,
141052,
337661,
337671,
362249,
362252,
395022,
362256,
321300,
345888,
116512,
362274,
378664,
354107,
354112,
247618,
370504,
329545,
345932,
354124,
370510,
247639,
337751,
370520,
313181,
182110,
354143,
345965,
354157,
345968,
345971,
345975,
182136,
403321,
1914,
354173,
247692,
395148,
337809,
247701,
329625,
436127,
436133,
247720,
337834,
362414,
337845,
190393,
346064,
247760,
346069,
329699,
354275,
190440,
247790,
354314,
346140,
337980,
436290,
378956,
395340,
436307,
338005,
329816,
100454,
329833,
329853,
329857,
329868,
329886,
411806,
346273,
362661,
100525,
379067,
387261,
256193,
395467,
411862,
256214,
411865,
411869,
411874,
379108,
411877,
387303,
395496,
346344,
338154,
387307,
346350,
338161,
436474,
321787,
379135,
411905,
411917,
43279,
379154,
395539,
387350,
338201,
387353,
182559,
338212,
248112,
362823,
436556,
321880,
362844,
379234,
354674,
182642,
321911,
420237,
379279,
354728,
338353,
338363,
338382,
272849,
248279,
256474,
182755,
338404,
338411,
330225,
248309,
199165,
248332,
330254,
199182,
199189,
420377,
330268,
191012,
412215,
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,
256787,
199455,
396067,
346917,
396070,
215854,
355123,
355141,
355144,
338764,
330581,
330585,
387929,
355167,
265056,
265059,
355180,
355185,
330612,
330643,
412600,
207809,
379849,
347082,
396246,
330711,
248794,
248799,
347106,
437219,
257009,
265208,
330750,
199681,
379908,
338951,
330761,
330769,
330775,
248863,
158759,
396329,
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,
339199,
396552,
175376,
175397,
208167,
273709,
372016,
437553,
347442,
199989,
175416,
396601,
208189,
437567,
175425,
437571,
437576,
437584,
331089,
396634,
175451,
437596,
429408,
175458,
208228,
175461,
175464,
265581,
331124,
175478,
249210,
175484,
175487,
249215,
175491,
249219,
249225,
249228,
249235,
175514,
175517,
396703,
175523,
355749,
396723,
388543,
380353,
216518,
339401,
380364,
339406,
372177,
339414,
249303,
413143,
339418,
339421,
249310,
339425,
249313,
339429,
339435,
249329,
69114,
372229,
339464,
249355,
208399,
175637,
134689,
339504,
265779,
421442,
413251,
265796,
265806,
224854,
224858,
339553,
257636,
224871,
372328,
257647,
372338,
339572,
224885,
224888,
224891,
224895,
126597,
421509,
224905,
11919,
224911,
224914,
126611,
224917,
224920,
126618,
208539,
224923,
224927,
224930,
224933,
257705,
224939,
224943,
257713,
257717,
224949,
257721,
224954,
257725,
224960,
257733,
224966,
224970,
257740,
224976,
257745,
257748,
224982,
257752,
224987,
257762,
224996,
225000,
339696,
225013,
257788,
225021,
257791,
339711,
225027,
257796,
339722,
257802,
257805,
225039,
257808,
249617,
225044,
167701,
372500,
257815,
225049,
257820,
225054,
184096,
257825,
397089,
225059,
339748,
225068,
257837,
413485,
225071,
225074,
257843,
225077,
257846,
225080,
397113,
225083,
397116,
257853,
225088,
225094,
225097,
323404,
257869,
257872,
225105,
339795,
397140,
225109,
257881,
225113,
257884,
257887,
225120,
257891,
413539,
225128,
257897,
225138,
339827,
257909,
372598,
225142,
257914,
257917,
225150,
257922,
380803,
225156,
339845,
257927,
225166,
397201,
225171,
380823,
225176,
225183,
184245,
372698,
372704,
372707,
356336,
380919,
372739,
405534,
266295,
266298,
217158,
421961,
200786,
356440,
217180,
430181,
266351,
356467,
266365,
192640,
266375,
381069,
225425,
250003,
225430,
250008,
356507,
250012,
225439,
135328,
225442,
438434,
192674,
225445,
225448,
225451,
225456,
430257,
225459,
225462,
225468,
389309,
225472,
372931,
225476,
389322,
225485,
225488,
225491,
225494,
266454,
225497,
225500,
225503,
225506,
356580,
225511,
217319,
225515,
225519,
381177,
356631,
356638,
356641,
356644,
356647,
389417,
266537,
356650,
356656,
332081,
307507,
340276,
356662,
397623,
332091,
225599,
332098,
201030,
348489,
332107,
151884,
430422,
348503,
332118,
332130,
250211,
340328,
250217,
348523,
348528,
332153,
356734,
389503,
332158,
438657,
250239,
332162,
348548,
356741,
332175,
160152,
373146,
373149,
70048,
356783,
324032,
201158,
127473,
217590,
340473,
324095,
324100,
324103,
324112,
340501,
324118,
324122,
340512,
332325,
324134,
381483,
356908,
324141,
324143,
356917,
324150,
324156,
348734,
324161,
324165,
356935,
348745,
381513,
324171,
324174,
324177,
389724,
332381,
373344,
340580,
348777,
381546,
119432,
340628,
184983,
373399,
340639,
258723,
332460,
332464,
332473,
381626,
332484,
332487,
332494,
357070,
357074,
332512,
332521,
340724,
332534,
155647,
348926,
389927,
348979,
152371,
398141,
127815,
357202,
389971,
357208,
136024,
389979,
430940,
357212,
357215,
439138,
201580,
201583,
349041,
340850,
201589,
430967,
324473,
398202,
119675,
340859,
324476,
430973,
324479,
340863,
324482,
324485,
324488,
185226,
381834,
324493,
324496,
324499,
430996,
324502,
324511,
422817,
324514,
201638,
373672,
324525,
5040,
111539,
324534,
5047,
324539,
324542,
398280,
349129,
340940,
340942,
209874,
340958,
431073,
398307,
340964,
209896,
201712,
209904,
381947,
201724,
349181,
431100,
431107,
349203,
209944,
209948,
250915,
250917,
357419,
209966,
209969,
209973,
209976,
209980,
209988,
209991,
431180,
209996,
349268,
250968,
210011,
373853,
341094,
210026,
210028,
349296,
210032,
210037,
210042,
210045,
349309,
160896,
349313,
152704,
210053,
210056,
349320,
259217,
373905,
210068,
210072,
210078,
210081,
210085,
210089,
210096,
210100,
324792,
210108,
357571,
210116,
210128,
333010,
210132,
333016,
210139,
210144,
218355,
251123,
218361,
275709,
128254,
275713,
242947,
275717,
275723,
333075,
349460,
333079,
251161,
349486,
349492,
415034,
251211,
210261,
365912,
259423,
374113,
251236,
374118,
234867,
390518,
357756,
374161,
112021,
349591,
333222,
210357,
259516,
415168,
366035,
415187,
366039,
415192,
415194,
415197,
415200,
333285,
415208,
366057,
366064,
415217,
415225,
423424,
415258,
415264,
366118,
415271,
382503,
349739,
144940,
415279,
415282,
349748,
415286,
210488,
415291,
415295,
333387,
333396,
374359,
333400,
366173,
333415,
423529,
423533,
333423,
210547,
415354,
333440,
267910,
267929,
333472,
333512,
259789,
358100,
366301,
333535,
366308,
366312,
431852,
399086,
366319,
210673,
366322,
399092,
366326,
333566,
268042,
210700,
366349,
210707,
399129,
333593,
333595,
366384,
358192,
210740,
366388,
358201,
399166,
325441,
366403,
325447,
341831,
341835,
341839,
341844,
415574,
358235,
341852,
350046,
399200,
399208,
268144,
358256,
358260,
325494,
399222,
186233,
333690,
243584,
325505,
333699,
399244,
333709,
333725,
333737,
382891,
333767,
358348,
333777,
219094,
399318,
358372,
350190,
350194,
333819,
350204,
350207,
325633,
325637,
350214,
333838,
350225,
350232,
333851,
350238,
350241,
374819,
350245,
350249,
350252,
178221,
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,
268553,
194829,
350477,
268560,
350481,
432406,
350487,
350491,
350494,
325920,
350500,
350505,
358701,
391469,
350510,
358705,
358714,
358717,
383307,
358738,
334162,
383331,
383334,
391531,
383342,
334204,
391564,
366991,
342431,
375209,
326059,
375220,
342453,
334263,
326087,
358857,
195041,
334306,
334312,
104940,
375279,
162289,
416255,
350724,
186898,
342546,
350740,
342551,
334359,
342555,
334364,
416294,
350762,
252463,
358962,
334386,
334397,
252483,
219719,
399957,
244309,
334425,
326240,
334466,
334469,
391813,
162446,
326291,
342680,
342685,
260767,
342711,
244410,
260798,
260802,
350918,
154318,
342737,
391895,
154329,
416476,
64231,
113389,
342769,
203508,
375541,
342777,
391938,
391949,
375569,
375572,
375575,
375580,
162592,
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,
252823,
400279,
392092,
400286,
359335,
211885,
400307,
351169,
359362,
351172,
170950,
326599,
359367,
187335,
359383,
359389,
383968,
359411,
261109,
244728,
261112,
383999,
261130,
359452,
261148,
211999,
261155,
261160,
261166,
359471,
375868,
384099,
384102,
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,
359660,
384247,
351480,
384250,
351483,
343307,
384270,
261391,
359695,
253202,
261395,
384276,
384284,
245021,
384290,
253218,
171304,
245032,
384299,
351535,
245042,
326970,
384324,
343366,
212296,
212304,
367966,
343394,
343399,
367981,
343410,
155000,
327035,
245121,
245128,
253321,
155021,
384398,
245137,
245143,
245146,
245149,
343453,
245152,
245155,
155045,
245158,
40358,
245163,
114093,
327090,
343478,
359867,
384444,
146878,
327108,
327112,
384457,
327118,
359887,
359891,
343509,
368093,
155103,
343535,
343540,
368120,
343545,
359948,
359951,
359984,
400977,
400982,
179803,
138865,
155255,
155274,
368289,
245410,
245415,
425652,
425663,
155328,
245463,
155352,
155356,
212700,
155364,
245477,
155372,
245487,
212723,
245495,
409336,
155394,
155404,
245528,
155423,
360224,
155439,
204592,
155444,
155448,
417596,
384829,
384831,
360262,
155463,
155477,
376665,
155484,
261982,
425823,
155488,
376672,
155492,
327532,
261997,
376686,
262000,
262003,
425846,
147319,
327542,
262006,
262009,
262012,
155517,
155523,
155526,
360327,
376715,
155532,
262028,
262031,
262034,
262037,
262040,
262043,
155550,
262046,
253854,
262049,
262052,
327590,
155560,
155563,
155566,
327613,
393152,
311244,
212945,
393170,
155604,
155620,
253924,
155622,
253927,
327655,
360432,
393204,
360439,
253944,
393209,
393215
] |
7d74209bf3e64a8fd1e9d165428ff832fc2c4202 | 654d235533c3729441245b124431f198230535f1 | /Quotely/AddQuoteView.swift | 82715008d45baf49740b6441ec177f79a1eeb577 | [] | no_license | justncode/SwiftUI-Core-Data | 451d5cd17298176afee2aa22f3028ea85bff235d | 3b4985ed632b34c67813015c405fbbbf0c2d0341 | refs/heads/master | 2022-12-27T15:51:45.199762 | 2020-09-19T17:23:02 | 2020-09-19T17:23:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,020 | swift | //
// AddQuoteView.swift
// Quotely
//
// Created by Juke Jaster on 9/19/20.
// Copyright © 2020 Juke Jaster. All rights reserved.
//
import SwiftUI
struct AddQuoteView: View {
typealias CreateCompletion = (_ title: String, _ author: String) -> Void
@State private var title = ""
@State private var author = ""
@Binding var isPresented: Bool
let onCreate: CreateCompletion
var body: some View {
NavigationView {
VStack {
TextField("Title...", text: $title)
.textFieldStyle(RoundedBorderTextFieldStyle())
TextField("Author...", text: $author)
.textFieldStyle(RoundedBorderTextFieldStyle())
Spacer()
}
.padding()
.navigationBarTitle("Add Quote")
.navigationBarItems(trailing: barButton(.done) {
self.isPresented = false
self.onCreate(self.title, self.author)
})
}
}
}
| [
-1
] |
ad6e10f9cb112206a53fed78a544f52b3be0d5c9 | ee026a11e02cd3000a6d13261450b6fe29bc4f2a | /Prepwyzr App/Prepwyzr/Controllers/Menu Tab Controller/About US/AboutUSVC.swift | 6d6367ae69e5a2f779115d1d7ca22c2fe091efaa | [] | no_license | pratikpanchal13/Patrick-Model | 253cc1c1f03981aad78a78b1621bed0e91843ae2 | 6189ee220550e89d405e13b03e130d2869460d8f | refs/heads/master | 2020-03-30T12:53:36.577628 | 2018-10-02T11:56:00 | 2018-10-02T11:56:00 | 151,246,563 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 3,487 | swift | //
// AboutUSVC.swift
// Prepwyzr
//
// Created by Riddhi on 21/07/18.
// Copyright © 2018 Riddhi. All rights reserved.
//
import UIKit
class AboutUSVC: UIViewController {
//MARK:- OutSide Variables
//var isFromLoginOrRegistrationScreen = false
//MARK:- IBOutlets
@IBOutlet var constraintH_StatusBar: NSLayoutConstraint!
@IBOutlet var lblAppVersion: UILabel!
//View For Information
@IBOutlet var viewForInformation: UIView!
@IBOutlet var webViewForHtmlLoad: UIWebView!
@IBOutlet var btnBack: UIBarButtonItem!
//MARK:- Vaariables
//MARK:- UIView Related Methods
override func viewDidLoad() {
super.viewDidLoad()
self.webViewForHtmlLoad.addBorder(radius: 0, color: Constants.kColor_Green.cgColor)
if UIDevice().userInterfaceIdiom == .phone && UIScreen.main.nativeBounds.height == 2436 {
self.constraintH_StatusBar.constant = 44
}
// if !self.isFromLoginOrRegistrationScreen {
// //Remove
// self.btnBack.image = nil
// }
if let strVersion = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") {
self.lblAppVersion.text = "App Version: \(strVersion)"
}
self.viewForInformation.frame = self.view.frame
self.view.addSubview(self.viewForInformation)
self.viewForInformation.isHidden = true
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(true)
self.viewForInformation.frame = self.view.frame
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
//MARK:- UIButton Actions
@IBAction func btnAction_Back(_ sender: Any) {
//if self.isFromLoginOrRegistrationScreen {
self.navigationController?.popViewController(animated: true)
//}
}
@IBAction func btnAction_PrivacyPolicy(_ sender: Any) {
//self.webViewForHtmlLoad.loadHTMLString(Constants.getPrivacyPolicy(), baseURL: nil)
if let url = Bundle.main.url(forResource: "Privacy_Policy/index", withExtension: "html") {
self.webViewForHtmlLoad.loadRequest(URLRequest(url: url))
}
self.viewForInformation.isHidden = false
}
@IBAction func btnAction_TermsAndConditions(_ sender: Any) {
//self.webViewForHtmlLoad.loadHTMLString(Constants.getTermsAndConditions(), baseURL: nil)
if let url = Bundle.main.url(forResource: "Terms_Conditions/index", withExtension: "html") {
self.webViewForHtmlLoad.loadRequest(URLRequest(url: url))
}
self.viewForInformation.isHidden = false
}
@IBAction func btnAction_CancellationAndRefundPolicy(_ sender: Any) {
//self.webViewForHtmlLoad.loadHTMLString(Constants.getCancellationAndRefundPolicy(), baseURL: nil)
if let url = Bundle.main.url(forResource: "Cancellation_Refund_Policy/index", withExtension: "html") {
self.webViewForHtmlLoad.loadRequest(URLRequest(url: url))
}
self.viewForInformation.isHidden = false
}
@IBAction func btnAction_ViewInformation_OK(_ sender: Any) {
self.viewForInformation.isHidden = true
}
}
| [
-1
] |
1027987eb96f152b250a3471f735e9ce70119f52 | e831721e45302f5b4e06ddd6fb0cfcf0bf7c0329 | /InstaWeather/Features/Social Export/SocialExport.swift | d9975a62b9d10d839b531dc718c32c05a28f9e09 | [] | no_license | tarsbase/InstaWeather | 70f05aa9fe207378412f61205bd61d7c7f19eb7c | d3621fa2447dc62ee2fc7691cc66446f5e4d791e | refs/heads/master | 2022-01-17T14:04:44.656913 | 2019-06-03T02:08:21 | 2019-06-03T02:08:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 7,469 | swift | //
// SocialStack.swift
// InstaWeather
//
// Created by Besher on 2019-02-13.
// Copyright © 2019 Besher. All rights reserved.
//
import UIKit
import FBSDKShareKit
import TwitterKit
import SCSDKCreativeKit
import SafariServices
class SocialExport: NSObject, SharingDelegate {
enum AnchorSide {
case top, bottom
}
private weak var vcDelegate: UIViewController?
private weak var sourceButton: UIView?
private var anchor: UIView
private var instagramShareFile: UIDocumentInteractionController?
private var image: UIImage?
init(delegate: UIViewController, source: UIView, image: UIImage?, anchorSide: AnchorSide) {
self.vcDelegate = delegate
self.sourceButton = source
let anchor = UIView(frame: CGRect(x: 0, y: 0, width: 1, height: 1))
anchor.center.x = source.center.x
anchor.frame.origin.y = anchorSide == .bottom ? source.frame.maxY : source.frame.minY
self.anchor = anchor
vcDelegate?.view.addSubview(anchor)
self.image = image
}
private func getSocialMessage() -> String {
return "#InstaWeather"
}
func showAlert() {
let ac = UIAlertController(title: "Share image", message: nil, preferredStyle: .actionSheet)
ac.popoverPresentationController?.sourceView = anchor
ac.popoverPresentationController?.permittedArrowDirections = [.up, .down]
ac.addAction(UIAlertAction(title: "Facebook", style: .default, handler: { [weak self] _ in
self?.facebookShare()
}))
ac.addAction(UIAlertAction(title: "Instagram", style: .default, handler: { [weak self] _ in
self?.instagramShare()
}))
ac.addAction(UIAlertAction(title: "Twitter", style: .default, handler: { [weak self] _ in
self?.twitterShare()
}))
ac.addAction(UIAlertAction(title: "Snapchat", style: .default, handler: { [weak self] _ in
self?.snapchatShare()
}))
ac.addAction(UIAlertAction(title: "Other...", style: .default, handler: { [weak self] _ in
ShareDocumentHost.share(self?.image, by: self?.vcDelegate, source: self?.anchor)
}))
ac.addAction(UIAlertAction(title: "Cancel", style: .cancel, handler: nil))
vcDelegate?.present(ac, animated: true)
}
// MARK: - Facebook
private func facebookShare() {
AnalyticsEvents.logEvent(.exportFacebook)
if (UIApplication.shared.canOpenURL(URL(string: "fb://")!)) {
nativePhotoFacebookSheet()
} else {
launchAppStorePage(for: .facebook)
}
}
private func nativePhotoFacebookSheet() {
guard let imageToShare = image else {
return // No image selected.
}
let imageContent = SharePhoto(image: imageToShare, userGenerated: true)
let content = SharePhotoContent()
content.photos = [imageContent]
content.hashtag = Hashtag("#InstaWeather")
let dialog = ShareDialog()
dialog.shareContent = content
dialog.fromViewController = vcDelegate
dialog.mode = ShareDialog.Mode.shareSheet
dialog.delegate = self
dialog.show()
}
func sharer(_ sharer: Sharing!, didCompleteWithResults results: [AnyHashable: Any]!) {
//TODO stop loading animation
print("Finished loading")
}
func sharer(_ sharer: Sharing, didFailWithError error: Error) {
print(error.localizedDescription)
}
func sharerDidCancel(_ sharer: Sharing) {
// TODO
}
func sharer(_ sharer: Sharing, didCompleteWithResults results: [String : Any]) {
// TODO
}
// MARK: - Twitter
func twitterShare() {
AnalyticsEvents.logEvent(.exportTwitter)
if UIApplication.shared.canOpenURL(URL(string: "twitter://app")!) {
shareTwitter()
} else {
launchAppStorePage(for: .twitter)
}
}
private func shareTwitter() {
guard let image = image else { return }
let composer = TWTRComposer()
composer.setURL(URL(string: LiveInstance.shortAppStoreURL))
composer.setText(getSocialMessage())
composer.setImage(image)
// Called from a UIViewController
composer.show(from: (vcDelegate!)) { result in
if (result == .done) {
print("Successfully composed Tweet")
} else {
print("Cancelled composing")
}
}
}
}
extension SocialExport: UIDocumentInteractionControllerDelegate {
// MARK: - Instagram
private func instagramShare() {
AnalyticsEvents.logEvent(.exportInstagram)
if UIApplication.shared.canOpenURL(URL(string: "instagram://app")!) {
shareInstagram()
} else {
launchAppStorePage(for: .instagram)
}
}
private func shareInstagram() {
guard let image = image, let vcDelegate = vcDelegate else { return }
let imageData = image.jpegData(compressionQuality: 100)
let writePath = (NSTemporaryDirectory() as NSString).appendingPathComponent("instagram.igo")
let caption = getSocialMessage()
do {
try imageData?.write(to: URL(fileURLWithPath: writePath), options: .atomic)
} catch {
print(error)
}
let fileURL = URL(fileURLWithPath: writePath)
self.instagramShareFile = UIDocumentInteractionController(url: fileURL)
self.instagramShareFile?.delegate = self
self.instagramShareFile?.uti = "com.instagram.exlusivegram"
self.instagramShareFile?.annotation = ["InstagramCaption": caption]
if UIDevice.current.userInterfaceIdiom == .phone {
self.instagramShareFile?.presentOpenInMenu(from: vcDelegate.view.bounds, in: vcDelegate.view, animated: true)
} else {
self.instagramShareFile?.presentOpenInMenu(from: anchor.frame, in: vcDelegate.view, animated: true)
}
}
}
extension SocialExport {
// MARK: - SnapChat
private func snapchatShare() {
AnalyticsEvents.logEvent(.exportSnapchat)
if UIApplication.shared.canOpenURL(URL(string: "snapchat://app")!) {
snapchatCreativeShare()
} else {
launchAppStorePage(for: .snapchat)
}
}
private func snapchatCreativeShare() {
guard let image = image else { return }
let photo = SCSDKSnapPhoto(image: image)
let photoContent = SCSDKPhotoSnapContent(snapPhoto: photo)
photoContent.caption = getSocialMessage()
photoContent.attachmentUrl = LiveInstance.shortAppStoreURL
let api = SCSDKSnapAPI(content: photoContent)
api.startSnapping { error in
if let error = error {
print(error.localizedDescription)
}
}
}
}
// MARK: - StoreProduct Delegate
extension SocialExport {
private func launchAppStorePage(for app: AppStoreAppsKeys) {
if let url = URL(string: app.url) {
let config = SFSafariViewController.Configuration()
let vc = SFSafariViewController(url: url, configuration: config)
vc.modalPresentationStyle = .pageSheet
vcDelegate?.present(vc, animated: true)
}
}
}
| [
-1
] |
519171fdc64d740c73ed09b56167ae2ef0f28653 | e75769d7930718d8db35e6086ad70675253d25b7 | /SwiftLoginApp/LogoutViewController.swift | 299fa317263ab60f4c91d6e008636a53b9d60a96 | [] | no_license | HirotoToyoshima/SwiftLoginApp-master | 65cf7759c9a7735c1ff689cfdc6d6a5a1a4360e0 | d36799c898972f31d22f16664b3ceefca688c465 | refs/heads/master | 2020-12-24T06:12:23.271991 | 2016-11-08T09:21:18 | 2016-11-08T09:21:18 | 73,168,863 | 0 | 0 | null | 2016-11-08T09:21:19 | 2016-11-08T09:13:47 | Swift | UTF-8 | Swift | false | false | 497 | swift | //
// LogoutViewController.swift
// SwiftLoginApp
//
// Created by Natsumo Ikeda on 2016/05/26.
// Copyright © 2016年 NIFTY Corporation. All rights reserved.
//
import UIKit
import NCMB
class LogoutViewController: UIViewController {
// Logoutボタン押下時の処理
@IBAction func logoutBtn(sender: UIButton) {
NCMBUser.logOut()
self.dismissViewControllerAnimated(true, completion: nil)
print("ログアウトしました")
}
}
| [
-1
] |
812b66ee59138999d1f5e7622d649cc54040a016 | 9b20ae5d9d6df049a26d050659ec8d4ca1dc064f | /exercice1.swift | b927be3997625130b34326c0bfca27d99cbbaf85 | [] | no_license | jonathanSimonney/IosEx | 9f62d46e5c6414f6dc2b045cd79c2d82b4e24122 | 7263769ee1792523a2de1bdaa53936fecd5d40a8 | refs/heads/master | 2021-09-05T01:19:04.276383 | 2018-01-23T10:12:22 | 2018-01-23T10:12:22 | 116,800,684 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 306 | swift | //
// exercice1.swift
// Exercices
//
// Created by SUP'Internet 04 on 09/01/2018.
// Copyright © 2018 SUP'Internet 04. All rights reserved.
//
import Foundation
func condog(str :String, prefix :Character, suffix :String) -> String{
return [String(prefix), str, suffix].joined(separator: "")
}
| [
-1
] |
bcd7e61ff87ad8df49b8cb56a854c2abf3a5dc99 | 94dd845cfac22d062b3ecece54f0d50140b3bfe5 | /SwiftProject/Classes/Home/OrderComfirmBottomView.swift | 1d3f7d8780049767dc68edf55de633b1f17ce787 | [
"MIT"
] | permissive | hayier/SwiftProject | a9c9902868335e17bf12a910d1a5ac08e2418a08 | 916d72a961deefb2efd3cb3c40cdd2bfb1a0d969 | refs/heads/master | 2020-08-13T14:21:52.332146 | 2019-10-14T04:49:39 | 2019-10-14T04:49:39 | 214,983,184 | 1 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,322 | swift | //
// OrderComfirmBottomView.swift
// SwiftProject
//
// Created by tongcheng on 2019/5/20.
// Copyright © 2019 icx. All rights reserved.
//
import UIKit
class OrderComfirmBottomView: UIView {
let countLab = UILabel()
let sureBtn = UIButton()
override init(frame: CGRect) {
super.init(frame: frame)
addSubview(countLab)
countLab.text = "需付款:¥99.0"
sureBtn.setTitle("确认付款", for: .normal)
sureBtn.setTitleColor(.white, for: .normal)
sureBtn.backgroundColor = .HBlue
addSubview(sureBtn)
sureBtn.snp.makeConstraints {
$0.right.top.equalToSuperview()
$0.width.equalTo(110)
$0.height.equalTo(45)
}
countLab.snp.makeConstraints{
$0.centerY.equalTo(sureBtn.snp.centerY)
$0.centerX.equalToSuperview().offset(-50)
}
let line = UIView()
line.backgroundColor = UIColor.groupTableViewBackground
addSubview(line)
line.snp.makeConstraints{
$0.left.right.top.equalToSuperview()
$0.height.equalTo(1)
}
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
| [
-1
] |
5cbf9e50b87f02cc3257ada1b7a3fd6e3b8a44f6 | 4b71e084c5df122de42c6257ec87a57d3bd05fa3 | /ChatDemoTests/ChatDemoTests.swift | 0275c774d349077a1538223afec324d278abcd03 | [] | no_license | mohsinalimat/ChatDemo | ffcc86cf3e5e66bc08b44eda00f3b884f0d19dac | 3d568de38c9fdb88a1407c8dac2f1fd7f4a4e304 | refs/heads/master | 2021-01-18T16:56:49.325997 | 2016-12-09T06:57:23 | 2016-12-09T06:57:23 | 100,475,365 | 1 | 0 | null | 2017-08-16T09:59:15 | 2017-08-16T09:59:15 | null | UTF-8 | Swift | false | false | 960 | swift | //
// ChatDemoTests.swift
// ChatDemoTests
//
// Created by SHUVO on 8/4/16.
// Copyright © 2016 SHUVO. All rights reserved.
//
import XCTest
@testable import ChatDemo
class ChatDemoTests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}
func testExample() {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct results.
}
func testPerformanceExample() {
// This is an example of a performance test case.
self.measure {
// Put the code you want to measure the time of here.
}
}
}
| [
360462,
229413,
204840,
278570,
344107,
155694,
229424,
229430,
163896,
180280,
376894,
286788,
352326,
311372,
196691,
385116,
237663,
254048,
319591,
131178,
278634,
221290,
204916,
131191,
131198,
311438,
278677,
196760,
426138,
311458,
278691,
377009,
278708,
278714,
295098,
139479,
229597,
311519,
205035,
286958,
327929,
344313,
147717,
368905,
254226,
319763,
368916,
262421,
377114,
278816,
237856,
237857,
311597,
98610,
180535,
336183,
278842,
287041,
139589,
319813,
311621,
344401,
377169,
368981,
155990,
368984,
106847,
98657,
270701,
270706,
246136,
139640,
311681,
311685,
106888,
385417,
385422,
213403,
246178,
385454,
311727,
377264,
278970,
319930,
311738,
33211,
336320,
311745,
254406,
188871,
278989,
278993,
278999,
328152,
369116,
188894,
287198,
279008,
279013,
279018,
319981,
319987,
279029,
254456,
377338,
279039,
377343,
254465,
287241,
279050,
139792,
303636,
393751,
279065,
377376,
180771,
377386,
197167,
385588,
279094,
115270,
385615,
426576,
369235,
295519,
139872,
66150,
279146,
295536,
139892,
287352,
344696,
279164,
311941,
336518,
279177,
311945,
369289,
344715,
311949,
287374,
377489,
311954,
352917,
230040,
271000,
377497,
303771,
377500,
205471,
344738,
139939,
295599,
205487,
303793,
336564,
230072,
287417,
287422,
377539,
287439,
164560,
385747,
279252,
361176,
418520,
287452,
279269,
246503,
369385,
279280,
312052,
230134,
172792,
344827,
221948,
205568,
295682,
197386,
434957,
295697,
426774,
197399,
426775,
197411,
279336,
262954,
295724,
197422,
353070,
164656,
303920,
262962,
295729,
230199,
197431,
336702,
279362,
295746,
353109,
377686,
230234,
189275,
435039,
295776,
279392,
303972,
385893,
230248,
246641,
246643,
295798,
246648,
279417,
361337,
254850,
369538,
287622,
58253,
295824,
279464,
140204,
377772,
304051,
230332,
189374,
377790,
353215,
213957,
213960,
345033,
279498,
386006,
418776,
50143,
123881,
287731,
271350,
295927,
304122,
328700,
328706,
410627,
320516,
295942,
386056,
353290,
377869,
238610,
418837,
140310,
197657,
369701,
238639,
312373,
238651,
377926,
238664,
296019,
304222,
279660,
173166,
377972,
337017,
377983,
279685,
402565,
222343,
386189,
296086,
238743,
296092,
238765,
279728,
238769,
402613,
230588,
279747,
353479,
402634,
353482,
279760,
189652,
279765,
189653,
419029,
148696,
296153,
279774,
304351,
304356,
222440,
279785,
328940,
386294,
386301,
320770,
386306,
312587,
328971,
353551,
173334,
320796,
222494,
353584,
345396,
386359,
222524,
378172,
279875,
312648,
337225,
304456,
230729,
296270,
238927,
353616,
296273,
222559,
378209,
386412,
279920,
296307,
116084,
337281,
148867,
296329,
296335,
9619,
370071,
173491,
304564,
279989,
353719,
361927,
296392,
280010,
280013,
239068,
280032,
271843,
280041,
329197,
329200,
296433,
280055,
288249,
230921,
329225,
296461,
304656,
329232,
370197,
402985,
394794,
312880,
288309,
312889,
288318,
280130,
124485,
288327,
280147,
239198,
157281,
99938,
312940,
222832,
288378,
337534,
337535,
263809,
239237,
288392,
239250,
419478,
206504,
321199,
337591,
280251,
280257,
280267,
403148,
9936,
313041,
9937,
370388,
272085,
345814,
280280,
18138,
67292,
345821,
321247,
321249,
345833,
345834,
280300,
239341,
67315,
173814,
313081,
124669,
288512,
288516,
280327,
280329,
321302,
345879,
321310,
255776,
362283,
378668,
296755,
321337,
280380,
345919,
436031,
403267,
280392,
345929,
304977,
18262,
362327,
280410,
345951,
362337,
345955,
296806,
288620,
280430,
214895,
313199,
362352,
313203,
182144,
305026,
67463,
329622,
337815,
214937,
214938,
436131,
436137,
362417,
362431,
280514,
280519,
214984,
362443,
329695,
436191,
313319,
296941,
436205,
124911,
329712,
43014,
354316,
313357,
305179,
239650,
354343,
354345,
223274,
124975,
346162,
288828,
436285,
288833,
288834,
436292,
403525,
313416,
436301,
354385,
338001,
338003,
223316,
280661,
329814,
354393,
280675,
280677,
43110,
313447,
321637,
436329,
288879,
223350,
280694,
288889,
215164,
313469,
215166,
280712,
215178,
346271,
436383,
362659,
239793,
125109,
182456,
280762,
223419,
379071,
280768,
149703,
280778,
346314,
321745,
280795,
387296,
280802,
379106,
346346,
321772,
436470,
149760,
411906,
125188,
313608,
125198,
125199,
272658,
125203,
125208,
338218,
321840,
379186,
125235,
125240,
321860,
280902,
289110,
215385,
354655,
313713,
354676,
436608,
362881,
248194,
240002,
436611,
240016,
108944,
190871,
149916,
420253,
141728,
289189,
108972,
272813,
338356,
436661,
281040,
289232,
256477,
281072,
174593,
420369,
207393,
289332,
174648,
338489,
338490,
281171,
297560,
436832,
436834,
281199,
420463,
346737,
313971,
346740,
420471,
330379,
117396,
346772,
264856,
289434,
346779,
166582,
314040,
158394,
363211,
289502,
363230,
264928,
330474,
289518,
199414,
191235,
322316,
117517,
322319,
166676,
207640,
281377,
289576,
191283,
273207,
289598,
281408,
322395,
330609,
207732,
158593,
224145,
355217,
256922,
289690,
289698,
420773,
289703,
363438,
347055,
289727,
273344,
330689,
363458,
379844,
19399,
183248,
248796,
347103,
289774,
183279,
347123,
240630,
257024,
330754,
134150,
322570,
330763,
322582,
281626,
248872,
322612,
314448,
339030,
281697,
281700,
257125,
322663,
281706,
207979,
273515,
404593,
363641,
363644,
150657,
248961,
330888,
363669,
339100,
380061,
339102,
199839,
429214,
306338,
265379,
249002,
306346,
3246,
421048,
208058,
265412,
290000,
298208,
298212,
298213,
290022,
330984,
298221,
298228,
216315,
388349,
437505,
322824,
257305,
339234,
372009,
412971,
298291,
306494,
216386,
224586,
331090,
314710,
372054,
159066,
314720,
380271,
208244,
249204,
314741,
290173,
306559,
224640,
314751,
298374,
314758,
314760,
142729,
388487,
314766,
306579,
282007,
290207,
314783,
314789,
282022,
314791,
282024,
396711,
396712,
314798,
380337,
380338,
150965,
380357,
339398,
306631,
306639,
413137,
429542,
282096,
306673,
306677,
191990,
290300,
282114,
372227,
306692,
306693,
323080,
323087,
282129,
175639,
282136,
388632,
396827,
282141,
134686,
347694,
265798,
282183,
265804,
396882,
290390,
44635,
396895,
323172,
282213,
323178,
224883,
314998,
323196,
175741,
339584,
282245,
290443,
323217,
298654,
282271,
282273,
282276,
298661,
290471,
282280,
298667,
224946,
110268,
224958,
282303,
323263,
274115,
306890,
241361,
298720,
282369,
323331,
323332,
339715,
216839,
339720,
372496,
323346,
282391,
339745,
257830,
421672,
282409,
282417,
315202,
307025,
413521,
216918,
307031,
241495,
282480,
241528,
315264,
339841,
282504,
315273,
315274,
110480,
184208,
372626,
380821,
282519,
298909,
118685,
298920,
200627,
323507,
290745,
274371,
151497,
372701,
298980,
380908,
282612,
315432,
233517,
102445,
176175,
241716,
225351,
315465,
315476,
307289,
315487,
356447,
45153,
315497,
315498,
438377,
233589,
233590,
266357,
422019,
241808,
323729,
381073,
233636,
299174,
233642,
405687,
299198,
258239,
389313,
299203,
299209,
372941,
282831,
266449,
307435,
438511,
381172,
184575,
381208,
299293,
151839,
233762,
217380,
282919,
332083,
332085,
332089,
315706,
282939,
307517,
438596,
332101,
323913,
348492,
323920,
348500,
168281,
332123,
323935,
332127,
242023,
160110,
242033,
291192,
340357,
225670,
242058,
373134,
291224,
242078,
61857,
315810,
61859,
315811,
381347,
340398,
299441,
61880,
283064,
127427,
127428,
324039,
373197,
176601,
160225,
291311,
291333,
340490,
283153,
258581,
291358,
283182,
234036,
315960,
348732,
242237,
70209,
348742,
70215,
348749,
381517,
332378,
201308,
242277,
111208,
184940,
373358,
389745,
209530,
373375,
152195,
348806,
152203,
316049,
111253,
316053,
111258,
111259,
176808,
299699,
299700,
422596,
422599,
291530,
225995,
242386,
422617,
422626,
234217,
299759,
299770,
299776,
242433,
291585,
430849,
291592,
62220,
422673,
430865,
291604,
422680,
283419,
234277,
283430,
152365,
422703,
422709,
152374,
160571,
430910,
160575,
160580,
283467,
381773,
201551,
242529,
349026,
357218,
177001,
201577,
308076,
242541,
209783,
209785,
177019,
185211,
308092,
398206,
291712,
381829,
316298,
308112,
349072,
234386,
324507,
390045,
185250,
283558,
185254,
373687,
373706,
316364,
324586,
349175,
201720,
127992,
357379,
234500,
234514,
308243,
300068,
357414,
300084,
308287,
218186,
300111,
234577,
341073,
439384,
234587,
300135,
300136,
316520,
357486,
144496,
300150,
300151,
291959,
160891,
300158,
349316,
349318,
373903,
169104,
177296,
185493,
283802,
119962,
300188,
300187,
300201,
300202,
373945,
283840,
259268,
283852,
283853,
259280,
316627,
333011,
234733,
234742,
292091,
128251,
439562,
292107,
414990,
251153,
177428,
349462,
382258,
300343,
382269,
300359,
234827,
177484,
406861,
259406,
234831,
283991,
374109,
292195,
333160,
284014,
316787,
357762,
112017,
234898,
259475,
275859,
357786,
251298,
333220,
374191,
292283,
292292,
300487,
300489,
210390,
210391,
210393,
144867,
251378,
308723,
300535,
300536,
292356,
259599,
316946,
308756,
398869,
374296,
374299,
308764,
431649,
169518,
431663,
194110,
349763,
218696,
292425,
128587,
333388,
300630,
128599,
333408,
300644,
317032,
415338,
243307,
54893,
325231,
325245,
235135,
194180,
415375,
153251,
300714,
210603,
415420,
333503,
259781,
333517,
333520,
325346,
153319,
325352,
284401,
325371,
194304,
300811,
243472,
366360,
284442,
325404,
399147,
431916,
300848,
259899,
325439,
153415,
341836,
415567,
325457,
317269,
341847,
284507,
350044,
128862,
284512,
284514,
276327,
292712,
423789,
292720,
325492,
276341,
300918,
341879,
317304,
333688,
194429,
112509,
55167,
325503,
333701,
243591,
325518,
333722,
350109,
300963,
292771,
415655,
284587,
292782,
243637,
301008,
153554,
194515,
292836,
292837,
317415,
325619,
432116,
292858,
415741,
333828,
358410,
399373,
317467,
145435,
227370,
325674,
309295,
243759,
129076,
243767,
358456,
309345,
227428,
194666,
260207,
432240,
284788,
333940,
292988,
292992,
194691,
227460,
415881,
104587,
235662,
284826,
333991,
284842,
227548,
194782,
301279,
317664,
243962,
227578,
375039,
194820,
325905,
325912,
309529,
211235,
432421,
211238,
358703,
358709,
325968,
6481,
366930,
6489,
383332,
383336,
285040,
317820,
211326,
317831,
227725,
252308,
178582,
293274,
121245,
285090,
342450,
293303,
293310,
416197,
129483,
342476,
326100,
358882,
342498,
334309,
391655,
432618,
375276,
301571,
342536,
416286,
375333,
244269,
375343,
236081,
23092,
375351,
244281,
301638,
309830,
293448,
55881,
416341,
309846,
416351,
268899,
39530,
301689,
244347,
326287,
375440,
334481,
318106,
318107,
342682,
285361,
342706,
318130,
293556,
383667,
285373,
39614,
154316,
334547,
96984,
375526,
342762,
342763,
293612,
129773,
154359,
228088,
432893,
162561,
383754,
310036,
285466,
326429,
293664,
326433,
400166,
293672,
318250,
318252,
285487,
301871,
375609,
293693,
252741,
318278,
293711,
244568,
244570,
301918,
293730,
342887,
400239,
228215,
400252,
359298,
359299,
260996,
113542,
228233,
228234,
392074,
56208,
293781,
318364,
310176,
310178,
293800,
236461,
293806,
326581,
326587,
326601,
359381,
433115,
343005,
326635,
203757,
187374,
383983,
318461,
293886,
293893,
433165,
384016,
433174,
252958,
203830,
359478,
277597,
113760,
302177,
392290,
253029,
285798,
228458,
15471,
351344,
285814,
285820,
392318,
384131,
302216,
326804,
187544,
351390,
253099,
253100,
318639,
367799,
113850,
294074,
64700,
302274,
367810,
244940,
195808,
310497,
228588,
302325,
228600,
228609,
261377,
253216,
130338,
261425,
351537,
286013,
294218,
146762,
294219,
318805,
425304,
294243,
163175,
327024,
327025,
318848,
179587,
253317,
384393,
368011,
318864,
318868,
318875,
310692,
245161,
286129,
286132,
228795,
425405,
302531,
425418,
310732,
64975,
228827,
286172,
187878,
286202,
359930,
286205,
302590,
294400,
253451,
359950,
146964,
253463,
286244,
245287,
245292,
196164,
228943,
286288,
179801,
196187,
343647,
310889,
204397,
138863,
188016,
294529,
286343,
229001,
188048,
425626,
229020,
302754,
229029,
40613,
40614,
40615,
286388,
286391,
384695,
327358,
286399,
302797,
212685,
212688,
384720,
302802,
286423,
278233,
278234,
278240,
212716,
212717,
360177,
229113,
286459,
278272,
319233,
360195,
278293,
286494,
294700,
409394,
319292,
360252,
360264,
376669,
245599,
237408,
425825,
425833,
417654,
188292,
294807,
294809,
376732,
294814,
311199,
319392,
294823,
327596,
294843,
188348,
98239,
237504,
294850,
384964,
344013,
212942,
24532,
294886,
278512,
311281,
311282
] |
c5d99e3054e3b61320f31ffe56817192f5e5fe07 | c29b2c056736b8862775c1532d43c6d5944d3a9d | /bermuda/PresentationTheme.swift | 6aeed1798b1a4101dcdfb3c0b56f3bff2d87aaf7 | [
"MIT"
] | permissive | mkchoi212/bermuda | a6457d99e12dd1a5413a5ee862c91bb508a15313 | f84487a096bcf645cb0d7dce452d23f69c0b2cdd | refs/heads/master | 2020-04-09T00:36:40.586407 | 2018-12-05T02:30:24 | 2018-12-05T02:30:24 | 159,874,418 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 6,472 | swift | //
// PresentationTheme.swift
// bermuda
//
// Created by Mike Choi on 12/2/18.
// Copyright © 2018 Mike JS. Choi. All rights reserved.
//
import Foundation
import UIKit
extension Notification.Name {
static let VLCThemeDidChangeNotification = Notification.Name("themeDidChangeNotfication")
}
@objcMembers class ColorPalette: NSObject {
let isDark: Bool
let name: String
let statusBarStyle: UIStatusBarStyle
let navigationbarColor: UIColor
let navigationbarTextColor: UIColor
let background: UIColor
let cellBackgroundA: UIColor
let cellBackgroundB: UIColor
let cellDetailTextColor: UIColor
let cellTextColor: UIColor
let lightTextColor: UIColor
let sectionHeaderTextColor: UIColor
let separatorColor: UIColor
let mediaCategorySeparatorColor: UIColor
let tabBarColor: UIColor
let orangeUI: UIColor
init(isDark: Bool,
name: String,
statusBarStyle: UIStatusBarStyle,
navigationbarColor: UIColor,
navigationbarTextColor: UIColor,
background: UIColor,
cellBackgroundA: UIColor,
cellBackgroundB: UIColor,
cellDetailTextColor: UIColor,
cellTextColor: UIColor,
lightTextColor: UIColor,
sectionHeaderTextColor: UIColor,
separatorColor: UIColor,
mediaCategorySeparatorColor: UIColor,
tabBarColor: UIColor,
orangeUI: UIColor) {
self.isDark = isDark
self.name = name
self.statusBarStyle = statusBarStyle
self.navigationbarColor = navigationbarColor
self.navigationbarTextColor = navigationbarTextColor
self.background = background
self.cellBackgroundA = cellBackgroundA
self.cellBackgroundB = cellBackgroundB
self.cellDetailTextColor = cellDetailTextColor
self.cellTextColor = cellTextColor
self.lightTextColor = lightTextColor
self.sectionHeaderTextColor = sectionHeaderTextColor
self.separatorColor = separatorColor
self.mediaCategorySeparatorColor = mediaCategorySeparatorColor
self.tabBarColor = tabBarColor
self.orangeUI = orangeUI
}
}
@objcMembers class Typography: NSObject {
let tableHeaderFont: UIFont
init(tableHeaderFont: UIFont) {
self.tableHeaderFont = tableHeaderFont
}
}
@objcMembers class PresentationTheme: NSObject {
static let brightTheme = PresentationTheme(colors: brightPalette)
static let darkTheme = PresentationTheme(colors: darkPalette)
static var current: PresentationTheme = {
let isDarkTheme = UserDefaults.standard.bool(forKey: "kVLCSettingAppTheme")
return isDarkTheme ? PresentationTheme.darkTheme : PresentationTheme.brightTheme
}() {
didSet {
AppearanceManager.setupAppearance(theme: self.current)
NotificationCenter.default.post(name: .VLCThemeDidChangeNotification, object: self)
}
}
init(colors: ColorPalette) {
self.colors = colors
super.init()
}
let colors: ColorPalette
let font = defaultFont
}
@objc extension UIColor {
convenience init(_ rgbValue: UInt32, _ alpha: CGFloat = 1.0) {
let r = CGFloat((rgbValue & 0xFF0000) >> 16) / 255.0
let g = CGFloat((rgbValue & 0xFF00) >> 8) / 255.0
let b = CGFloat(rgbValue & 0xFF) / 255.0
self.init(red: r, green: g, blue: b, alpha: 1.0)
}
private func toHex(alpha: Bool = false) -> String? {
guard let components = cgColor.components, components.count >= 3 else {
assertionFailure()
return nil
}
let r = Float(components[0])
let g = Float(components[1])
let b = Float(components[2])
var a = Float(1.0)
if components.count == 4 {
a = Float(components[3])
}
if alpha {
return String(format: "#%02lX%02lX%02lX%02lX", lroundf(r * 255), lroundf(g * 255), lroundf(b * 255), lroundf(a * 255))
} else {
return String(format: "#%02lX%02lX%02lX", lroundf(r * 255), lroundf(g * 255), lroundf(b * 255))
}
}
var toHex: String? {
return toHex()
}
}
let brightPalette = ColorPalette(isDark: false,
name: "Default",
statusBarStyle: .default,
navigationbarColor: UIColor(0xFFFFFF),
navigationbarTextColor: UIColor(0x000000),
background: UIColor(0xF9F9F7),
cellBackgroundA: UIColor(0xF9F9F7),
cellBackgroundB: UIColor(0xE5E5E3),
cellDetailTextColor: UIColor(0xA9A9A9),
cellTextColor: UIColor(0x000000),
lightTextColor: UIColor(0x888888),
sectionHeaderTextColor: UIColor(0x25292C),
separatorColor: UIColor(0xF0F2F7),
mediaCategorySeparatorColor: UIColor(0xECF2F6),
tabBarColor: UIColor(0xFFFFFF),
orangeUI: UIColor(0xFF8800))
let darkPalette = ColorPalette(isDark: true,
name: "Dark",
statusBarStyle: .lightContent,
navigationbarColor: UIColor(0x292B36),
navigationbarTextColor: UIColor(0xD3D3D3),
background: UIColor(0x1B1E21),
cellBackgroundA: UIColor(0x292B36),
cellBackgroundB: UIColor(0x000000),
cellDetailTextColor: UIColor(0xD3D3D3),
cellTextColor: UIColor(0xFFFFFF),
lightTextColor: UIColor(0xB8B8B8),
sectionHeaderTextColor: UIColor(0xFFFFFF),
separatorColor: UIColor(0x25292C),
mediaCategorySeparatorColor: UIColor(0x25292C),
tabBarColor: UIColor(0x292B36),
orangeUI: UIColor(0xFF8800))
let defaultFont = Typography(tableHeaderFont: UIFont.systemFont(ofSize: 24, weight: .semibold))
| [
-1
] |
91bb2aa97f8b190d3a01afd3de4aef0ed60392ec | b908e89a8eeb56b5b96377da9e215aeac5f78b75 | /ISDKTest/ISDKTest/Classes/Presentation/Modules/ItemA/Module/ItemAModule.swift | 7bb1ca7b0c0e9de2f7ef62bb9b1058eab1ef3f1d | [] | no_license | vanmas2/ISDKTest | 08c281f9e4c70c179e1f8006a0ae841c5fa390e4 | 12b39555161bf6c5761f57c8f03e11fc8c14adab | refs/heads/master | 2020-12-02T07:25:45.006555 | 2020-01-14T03:59:58 | 2020-01-14T03:59:58 | 230,932,717 | 0 | 0 | null | 2020-01-13T03:58:40 | 2019-12-30T14:49:58 | Swift | UTF-8 | Swift | false | false | 715 | swift | //
// ItemAModule.swift
// ISDKTest
//
// Created by Иван Масальских on 11/01/2020.
//
import UIKit
// MARK: - ItemAModule
final class ItemAModule: Module, ItemAModuleProtocol {
// MARK: Properties
var input: ItemAModuleIntput
var output: ItemAModuleOutput
private var viewController: UIViewController?
// MARK: Constructors
init(input: ItemAModuleIntput, output: ItemAModuleOutput, viewController: UIViewController){
self.viewController = viewController
self.input = input
self.output = output
}
// MARK: Functions
func toPresent() -> UIViewController? {
return viewController
}
}
| [
-1
] |
729dafeee8adb0b4a843f063e81a085442fd6f54 | f570c34534c8f6645dc6df23f5a629abca622bae | /LIC/LIC_V0.6/LIC/MyRedEnvelopeTableController.swift | 804989171da9b38eebe9ec6de74c1dd9211d0574 | [] | no_license | wenhongquan/lexingbox | 6522679ac275a4ebd9a43c678ec3546cc9183eee | 79004fdf4aa634bed456c3e7f71714e1f9ebc12d | refs/heads/master | 2021-01-22T11:42:16.526633 | 2015-08-27T14:03:34 | 2015-08-27T14:03:34 | 41,488,190 | 2 | 1 | null | null | null | null | UTF-8 | Swift | false | false | 1,484 | swift | //
// MyRedEnvelopeTableController.swift
// LIC
//
// Created by 温红权 on 15/7/21.
// Copyright (c) 2015年 乐行天下. All rights reserved.
//
import Foundation
class MyRedEnvelopeTableController:BaseTableController{
override func viewDidLoad() {
super.viewDidLoad()
CommonUtil.setNavigationControllerBackground(self)
self.navigationItem.title = "我的红包"
self.navigationItem.rightBarButtonItem?.tintColor = UIColor.whiteColor()
self.navigationItem.leftBarButtonItem?.tintColor = UIColor.whiteColor()
self.navigationController?.navigationBar.tintColor=UIColor.whiteColor()
self.tableView.separatorStyle = UITableViewCellSeparatorStyle.None
}
var redEnvelopes:[Int] = [1,1,1]
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return redEnvelopes.count
}
override func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
return 110
}
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
var cell = tableView.dequeueReusableCellWithIdentifier("redEnvelopetableCell") as! RedEnvelopetableCell
cell.selectionStyle = UITableViewCellSelectionStyle.None
return cell
}
} | [
-1
] |
aae4a24e60e0edd753a5335a940031f3d0a8cb26 | 0416dfccd08e08706e52c21c62d6e64ca754b085 | /CatNap/GameViewController.swift | 2c546ed5b8a347d7344cf522e9600ee2d9703fc2 | [] | no_license | frankthamel/CatNap | 6dbac33eadecb7114816b91e80a33cb256ce4c6b | 519491159212828edbe6b5377230d95863e25a9f | refs/heads/master | 2020-04-01T09:16:16.525340 | 2016-06-13T16:00:35 | 2016-06-13T16:00:35 | 61,049,858 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,404 | swift | //
// GameViewController.swift
// CatNap
//
// Created by Frank Thamel on 6/11/16.
// Copyright (c) 2016 co.talene. All rights reserved.
//
import UIKit
import SpriteKit
class GameViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
if let scene = GameScene(fileNamed:"GameScene") {
// Configure the view.
let skView = self.view as! SKView
skView.showsFPS = true
skView.showsNodeCount = true
/* Sprite Kit applies additional optimizations to improve rendering performance */
skView.ignoresSiblingOrder = false
/* Set the scale mode to scale to fit the window */
scene.scaleMode = .AspectFill
skView.presentScene(scene)
}
}
override func shouldAutorotate() -> Bool {
return true
}
override func supportedInterfaceOrientations() -> UIInterfaceOrientationMask {
if UIDevice.currentDevice().userInterfaceIdiom == .Phone {
return .AllButUpsideDown
} else {
return .All
}
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Release any cached data, images, etc that aren't in use.
}
override func prefersStatusBarHidden() -> Bool {
return true
}
}
| [
316802,
182818,
282637,
277582,
234291,
280182,
275833,
228605,
282879
] |
3938c827894a7acc8838e8a06de5267ec9666e02 | 6de0bdc1afa70af6400f496ff0dc747a678592ab | /_Demo_and_Tests/Swift/AlgorithmsTests/BubbleSortTests.swift | 0087b38fd19368ec31021dab8d7d4794d904c334 | [] | no_license | Friend-LGA/Algorithms | e24a61f1a5a19b0f62086db5dcba8280f71c1f47 | 1def6f5cb7a8aa733a6438c41d0e382f754eb9de | refs/heads/master | 2021-01-17T14:55:44.698226 | 2017-05-29T18:03:43 | 2017-05-29T18:03:43 | 84,102,490 | 4 | 1 | null | null | null | null | UTF-8 | Swift | false | false | 1,589 | swift | //
// BubbleSortTests.swift
// Algorithms
//
import XCTest
class BubbleSortTests: XCTestCase {
override func setUp() {
super.setUp()
TestsHelper.reset()
}
override func tearDown() {
super.tearDown()
}
// MARK: -
func testAscOdd() {
let resultArray = BubbleSort.sort(TestsHelper.array, order: .ASC)
XCTAssert(resultArray ?= TestsHelper.sortedArrayAsc)
}
func testAscEven() {
TestsHelper.array.append(100)
TestsHelper.sortedArrayAsc.append(100)
let resultArray = BubbleSort.sort(TestsHelper.array, order: .ASC)
XCTAssert(resultArray ?= TestsHelper.sortedArrayAsc)
}
func testDescOdd() {
let resultArray = BubbleSort.sort(TestsHelper.array, order: .DESC)
XCTAssert(resultArray ?= TestsHelper.sortedArrayDesc)
}
func testDescEven() {
TestsHelper.array.append(100)
TestsHelper.sortedArrayDesc.insert(100, at: 0)
let resultArray = BubbleSort.sort(TestsHelper.array, order: .DESC)
XCTAssert(resultArray ?= TestsHelper.sortedArrayDesc)
}
func testNilArray() {
let nilArray: [Int]? = nil
let resultArray = BubbleSort.sort(nilArray, order: .ASC)
XCTAssert(resultArray == nil);
}
func testEmptyArray() {
let resultArray = BubbleSort.sort([] as [Int], order: .ASC)
XCTAssert(resultArray ?= []);
}
func testArrayWithOneNumber() {
let resultArray = BubbleSort.sort([0], order: .ASC)
XCTAssert(resultArray ?= [0]);
}
}
| [
-1
] |
879744a64d48a97c203005354742be430244bcf4 | 07b0fa93ee340c3a5428b5c8fc6e93a57436fe19 | /GoodNews/AppDelegate.swift | a3dbd2506b7cb38cabc166942046b30f3ddc32a7 | [] | no_license | jacekdogiel/GoodNews | c440cbc69c1c10f47e3498e60c182029f5678d7d | 9450d4419ff05b7db76b7e213dd5294e60d387a9 | refs/heads/master | 2023-01-20T04:23:31.604542 | 2020-12-04T13:53:26 | 2020-12-04T13:53:26 | 318,531,743 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 2,492 | swift | //
// AppDelegate.swift
// GoodNews
//
// Created by Mohammad Azam on 3/3/19.
// Copyright © 2019 Mohammad Azam. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
UINavigationBar.appearance().barTintColor = UIColor(displayP3Red: 47/255, green: 54/255, blue: 64/255, alpha: 1.0)
UINavigationBar.appearance().largeTitleTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor.white]
UINavigationBar.appearance().titleTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor.white]
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:.
}
}
| [
278539,
294924,
278542,
278545,
294950,
229415,
229417,
327722,
237613,
229422,
229428,
229432,
319544,
237640,
311375,
163920,
196692,
311400,
237693,
303241,
303244,
286876,
311460,
311469,
32944,
327862,
327866,
180413,
295110,
286922,
286924,
319694,
131281,
295133,
319716,
237807,
303345,
131314,
286962,
327930,
237826,
319751,
286987,
319757,
286999,
287003,
287006,
287009,
287014,
287016,
287019,
311598,
287023,
311601,
319809,
319814,
311623,
319818,
287054,
319822,
229717,
196963,
139638,
213367,
106872,
319872,
319879,
139689,
311728,
311741,
319938,
319945,
319947,
311767,
188895,
172512,
287202,
319978,
172526,
311791,
319989,
172534,
287230,
303617,
172550,
320007,
303623,
172558,
172572,
172577,
295459,
172581,
295461,
311850,
172591,
33357,
311911,
172656,
295538,
172660,
287349,
287355,
295553,
172675,
311942,
352905,
311946,
311951,
287377,
287381,
311957,
221850,
287394,
172707,
287398,
172714,
295595,
189102,
172721,
66227,
303797,
189114,
287419,
303804,
287423,
328384,
172737,
295633,
172755,
303827,
287450,
303835,
189149,
303838,
312035,
295654,
312048,
312050,
205564,
303871,
230146,
328453,
230154,
312077,
295695,
295701,
295707,
328476,
230175,
303914,
230202,
222018,
295755,
377676,
148302,
287569,
230237,
230241,
303976,
336744,
303985,
303987,
279413,
303991,
303997,
295806,
295808,
295813,
304005,
304007,
320391,
304009,
304013,
295822,
304019,
58262,
304023,
213931,
230327,
304055,
287675,
304063,
156612,
312272,
320481,
320490,
312302,
328687,
320496,
304114,
295928,
320505,
295945,
230413,
320528,
140312,
295961,
238620,
304170,
304175,
238641,
238652,
238655,
238658,
336964,
320584,
238666,
296040,
312432,
189562,
337018,
296084,
222377,
337067,
238766,
230576,
312518,
230600,
230607,
320727,
304354,
296163,
296189,
320771,
312585,
230674,
320786,
230677,
296215,
320792,
230681,
312622,
312630,
296253,
296255,
312639,
296259,
296262,
230727,
296264,
238919,
320840,
296267,
296271,
230739,
312663,
222556,
312676,
230760,
148843,
230763,
296305,
312692,
230773,
312711,
296331,
288144,
288154,
288164,
173488,
288176,
312759,
222652,
173507,
230860,
312783,
288208,
230865,
222676,
329177,
239070,
320998,
296435,
296446,
296450,
230916,
230919,
230923,
304651,
304653,
296486,
296488,
157229,
239152,
230961,
157236,
288325,
124489,
280140,
288338,
239202,
116354,
198310,
296622,
321200,
337585,
296634,
296637,
206536,
206539,
206541,
206543,
313044,
321239,
313052,
288478,
288494,
288499,
288510,
198405,
296723,
321304,
321311,
313121,
313123,
321316,
321336,
288576,
337732,
173907,
321381,
296809,
305028,
124817,
124827,
214944,
313258,
321458,
124853,
214966,
10170,
296890,
296894,
337862,
124913,
165876,
321528,
313340,
313347,
305176,
313371,
223273,
124978,
215090,
124980,
288824,
321595,
288836,
288855,
313438,
149599,
149601,
149603,
280681,
215154,
329850,
321659,
288895,
321670,
215175,
280725,
280747,
288947,
321717,
313548,
321740,
313557,
338147,
125171,
125187,
125191,
125207,
125209,
125218,
125239,
305464,
305480,
305485,
354653,
313705,
190832,
223606,
239997,
289166,
240017,
297363,
297365,
297368,
297372,
297377,
289186,
297391,
289201,
289207,
305594,
289218,
166378,
305647,
174580,
305662,
305664,
305666,
240132,
223749,
330244,
305668,
150025,
223757,
281135,
150066,
158266,
289342,
322115,
19053,
297594,
158347,
182926,
314003,
117398,
289436,
174754,
330404,
289448,
314029,
314033,
314045,
314047,
314051,
158409,
289493,
289513,
289532,
322303,
289537,
322314,
322318,
322341,
215850,
207661,
240468,
322393,
207737,
183172,
338823,
322440,
142226,
240535,
289687,
289694,
289700,
289724,
289762,
322550,
322563,
314372,
330764,
322610,
314441,
314456,
314461,
314474,
306341,
199877,
289991,
289997,
290008,
363742,
330988,
216303,
322801,
388350,
257302,
199976,
199978,
314671,
298294,
216376,
224587,
314714,
314718,
265568,
314723,
306539,
314732,
314736,
298358,
290171,
306555,
314747,
290174,
314756,
298377,
314763,
298381,
314768,
306581,
314779,
314785,
314793,
241070,
241072,
298424,
306618,
323015,
306640,
290263,
290270,
290275,
339431,
191985,
191992,
290298,
290302,
290305,
241175,
290356,
306778,
323176,
224875,
241260,
314994,
315016,
290445,
175770,
298651,
323229,
298655,
306856,
323260,
323266,
241362,
306904,
52959,
323304,
241412,
323345,
323349,
323367,
241448,
306988,
306991,
323376,
118593,
307009,
307012,
307027,
315223,
241496,
241498,
307035,
241509,
298860,
315253,
315255,
315267,
315269,
241544,
241546,
241556,
241560,
241563,
241565,
241567,
241569,
241581,
241583,
323504,
241586,
290739,
241588,
241590,
241592,
241598,
241600,
151495,
241610,
298975,
241640,
298984,
241643,
298988,
241646,
241649,
241652,
323574,
299003,
241661,
299006,
315396,
315397,
241669,
290835,
241693,
102438,
290877,
315463,
315482,
217179,
315483,
233567,
299105,
299109,
315495,
356457,
45163,
307307,
315502,
192624,
299126,
307338,
315552,
315557,
184486,
307370,
307374,
307376,
299185,
184503,
258235,
307388,
307390,
307394,
299204,
307396,
184518,
307399,
323784,
299225,
233701,
307432,
291104,
315701,
332086,
307518,
323917,
233808,
323921,
315733,
323926,
233815,
315739,
299357,
242018,
242024,
315757,
250231,
315771,
299391,
291202,
242057,
291212,
299405,
291222,
242075,
61855,
291231,
291238,
127403,
127405,
127407,
291247,
299444,
127413,
291254,
127417,
291260,
127421,
127424,
299457,
291269,
315856,
176592,
315860,
127447,
299481,
160221,
176605,
242143,
340454,
127463,
242152,
176620,
127469,
291314,
291317,
135672,
291323,
233979,
291330,
127497,
135689,
233994,
233998,
234003,
234006,
127511,
152087,
234010,
135707,
242202,
242206,
242208,
291361,
242220,
152118,
234038,
111193,
242275,
299620,
242279,
135805,
135808,
316054,
135834,
299684,
242343,
242345,
135870,
135876,
299720,
299726,
119509,
201444,
299750,
234219,
316151,
242431,
234246,
291601,
234258,
348950,
201496,
234264,
234266,
152355,
299814,
185138,
234296,
316233,
316235,
234319,
201557,
308063,
234336,
242530,
234344,
324464,
234356,
291711,
291714,
291716,
234373,
308105,
324504,
209818,
308123,
234396,
324508,
291742,
291747,
291748,
234405,
324518,
291754,
324522,
291756,
324527,
291760,
201650,
324531,
324536,
291773,
324544,
234434,
324546,
324548,
234464,
168935,
324585,
316400,
234481,
316403,
234485,
234487,
316416,
300054,
316439,
234520,
300066,
234540,
234546,
300085,
316479,
234561,
308291,
316491,
234572,
234574,
234593,
300133,
300139,
234605,
234610,
300148,
144506,
234620,
242822,
177293,
234640,
308373,
324757,
234647,
234648,
300189,
324766,
119967,
324768,
300197,
234667,
308401,
316596,
234687,
316610,
300226,
308420,
300229,
308422,
300234,
300238,
300241,
316625,
300243,
300245,
316630,
300248,
300256,
300258,
300260,
300263,
300265,
300267,
300270,
300272,
300278,
275703,
316663,
300284,
300287,
292097,
300289,
161027,
300292,
177419,
242957,
275725,
349464,
292143,
300344,
243003,
300357,
316758,
357722,
292192,
316768,
292197,
218473,
136562,
316803,
316806,
316811,
300433,
234899,
300436,
357783,
316824,
316826,
300448,
144810,
144814,
374196,
144820,
144826,
144830,
144832,
144835,
144837,
144839,
144841,
144844,
144847,
144855,
300507,
333280,
218597,
292329,
300523,
300527,
308720,
292338,
316917,
292343,
300537,
308762,
284191,
284194,
284196,
235045,
235047,
284206,
284211,
194101,
194103,
284215,
284218,
284226,
243268,
292421,
284234,
284238,
284241,
194130,
300628,
284245,
284247,
317015,
284249,
235097,
284251,
300638,
284265,
284274,
284278,
292470,
284283,
284286,
284288,
284290,
325250,
284292,
292485,
284297,
317066,
284299,
284301,
284303,
284306,
284308,
284312,
284314,
284316,
284322,
284327,
284329,
317098,
284331,
284333,
284335,
284337,
284339,
300726,
358080,
358083,
284362,
317138,
358098,
325353,
358135,
358140,
358142,
317189,
300816,
300819,
325408,
300832,
317221,
358183,
243504,
366406,
292681,
178006,
292700,
292715,
300915,
292729,
292734,
325512,
169868,
358292,
317353,
317361,
276425,
301011,
301013,
292823,
301015,
301017,
358360,
276446,
276448,
276452,
276455,
292843,
276460,
292845,
276464,
276466,
325624,
276472,
317435,
276476,
276482,
276485,
276490,
317458,
243733,
317468,
325666,
243751,
292904,
243762,
309298,
325685,
325689,
325692,
243779,
243785,
276553,
350293,
309337,
350302,
178273,
309346,
309348,
350308,
309350,
309352,
350313,
350316,
350321,
350325,
350328,
292985,
350332,
292993,
301185,
317570,
350339,
350342,
350345,
350349,
317584,
325777,
350357,
350362,
350366,
153765,
350379,
350381,
350383,
350385,
350387,
350389,
350395,
350397,
350399,
350402,
301252,
350406,
301258,
309462,
301272,
309468,
301283,
317674,
325867,
243960,
325910,
342298,
276766,
276775,
211241,
325937,
325943,
235853,
391523,
293227,
293232,
186744,
317833,
317853,
317858,
235955,
276917,
293304,
293307,
293314,
309707,
293325,
293336,
235996,
317917,
293343,
293346,
293352,
293364,
293370,
317951,
301575,
113167,
293417,
227882,
293421,
129603,
301636,
301639,
301643,
309844,
326244,
309871,
121458,
309885,
301706,
318092,
326285,
318094,
334476,
334488,
318108,
383658,
318128,
293555,
318144,
113378,
342760,
56059,
310015,
310029,
326430,
318248,
318253,
293685,
301880,
301884,
277322,
400236,
162671,
310134,
416639,
416640,
113538,
310147,
301972,
310179,
293798,
293802,
236460,
293817,
293820,
326603,
293849,
326638,
293876,
285686,
121850,
293882,
302075,
293939,
293956,
293960,
293971,
310359,
138332,
277608,
318573,
367737,
294026,
162964,
285849,
285852,
302237,
285854,
285856,
302241,
64682,
294063,
302258,
318651,
318657,
244930,
130244,
302282,
310476,
302285,
302288,
302290,
302292,
310486,
302294,
310498,
294132,
204031,
64768,
310531,
138505,
318742,
285999,
318776,
294211,
294223,
326991,
146784,
294246,
310632,
327017,
310651,
310657,
310659,
351619,
318858,
310672,
351633,
310689,
310703,
310712,
302526,
302534,
310727,
163272,
310737,
310749,
310764,
310772,
40440,
286203,
286214,
302603,
302617,
286240,
294435,
40484,
196133,
286246,
294439,
245288,
294440,
40491,
294443,
294445,
40499,
40502,
212538,
40511,
40513,
228933,
40527,
212560,
40533,
40552,
40560,
294521,
302740,
327333,
229030,
319153,
302781,
302789,
294599,
294601,
286420,
319194,
294634,
302838,
319226,
302852,
294664,
311048,
319243,
302862,
319251,
294682,
319290,
229192,
229233,
294776,
327554,
237470,
319390,
319394,
319419,
294844,
24528,
393177,
294876,
237555,
311283,
237562
] |
d3e045212eb728a3ed022e900a2073e2f0d63bbe | 335a4d267bd655d7ec95345dcef5fcd6a7bdf7bf | /ZombieBunnies/Pages11to20/No18.swift | 2baa8a0ea6492159bc4660dd5c2659d28e3ab238 | [] | no_license | thachgiasoft/ZombieBunnies | 1257390fc3288229108ecc064c5b313e8acc628f | f7ea341bfb1c5f4037b446a565abb46a413832b9 | refs/heads/master | 2022-05-21T02:47:59.166026 | 2020-04-23T14:43:05 | 2020-04-23T14:43:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,183 | swift | //
// No18.swift
// ZombieBunnies
//
// Created by steve groves on 08/03/2020.
// Copyright © 2020 steve groves. All rights reserved.
//
import SwiftUI
struct No18: View {
@State var goto1: Bool = false
var body: some View {
VStack {
Text("Page 18")
Divider()
VStack {
Text("You burst into the radio studio and grab the microphone. ''Hey, everyone!'' you cry, ''get into the cinema, it's the only safe place in - blub...burble...bibble...''").padding()
Text("The reason you say this is the zombie DJ has just bitten your hand holding the microphone.").padding()
Text("Tough luck - you've been......ZOMBIFIED!!!!").font(.headline).padding()
}.frame(width: 380, height: 400, alignment: .leading)
Divider().padding()
Button(action: {self.goto1 = true}, label: {Text("Go back to start").font(.headline)})
.sheet(isPresented: $goto1, content: {
No1()
})
}
}
}
struct No18_Previews: PreviewProvider {
static var previews: some View {
No18()
}
}
| [
-1
] |
ff64d1a0094a6829bc57c2dc080803b8d4300cb5 | 61520b0874ac277ee2aeb88631853c229d1da2e1 | /gigs/gigs/View Controllers/LoginViewController.swift | 0946b0754c35bbaccd1c9c7880922baff42224bd | [] | no_license | kerianne16/ios-gigs | f3aadfcd33e3bf4f358a458d59fe29a11e285a02 | 7e6f7439ef21f1d605308d8fcd5b7171728ed491 | refs/heads/master | 2021-01-03T14:26:16.810667 | 2020-02-14T00:02:11 | 2020-02-14T00:02:11 | 240,106,985 | 0 | 0 | null | 2020-02-12T20:21:21 | 2020-02-12T20:21:21 | null | UTF-8 | Swift | false | false | 3,306 | swift | //
// LoginViewController.swift
// gigs
//
// Created by Keri Levesque on 2/12/20.
// Copyright © 2020 Keri Levesque. All rights reserved.
//
import UIKit
enum LoginType {
case signUp
case signIn
}
class LoginViewController: UIViewController {
//MARK: Outlets
@IBOutlet weak var segmentedControl: UISegmentedControl!
@IBOutlet weak var usernameTextfield: UITextField! // thats supposed to be cap F (typo)
@IBOutlet weak var passwordTextField: UITextField!
@IBOutlet weak var button: UIButton!
//MARK: Properties
var gigController: GigController?
var loginType = LoginType.signUp
//MARK: View Lifecycle
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
//MARK: Actions
@IBAction func signInsignUp(_ sender: UISegmentedControl) {
// switch UI between login types
if sender.selectedSegmentIndex == 0 {
// sign up mode
loginType = .signUp
button.setTitle("Sign Up", for: .normal)
} else {
// sign in mode
loginType = .signIn
button.setTitle("Sign In", for: .normal)
}
}
@IBAction func buttonTapped(_ sender: UIButton) {
guard let gigController = gigController else { return }
// collect user content (username, password)
if let username = usernameTextfield.text,
!username.isEmpty,
let password = passwordTextField.text,
!password.isEmpty {
let user = User(username: username, password: password)
// determine which mode to use
if loginType == .signUp {
// perform signUp API call
gigController.signUp(with: user) { (error) in
if let error = error {
NSLog("Error occurred during sign up: \(error)")
} else {
DispatchQueue.main.async {
let alertController = UIAlertController(title: "Sign Up Successful", message: "Now please log in.", preferredStyle: .alert)
let alertAction = UIAlertAction(title: "OK", style: .default, handler: nil)
alertController.addAction(alertAction)
self.present(alertController, animated: true) {
self.loginType = .signIn
self.segmentedControl.selectedSegmentIndex = 1
self.button.setTitle("Sign In", for: .normal)
}
}
}
}
} else {
// perform signIn API call
gigController.signIn(with: user) { (error) in
if let error = error {
NSLog("Error occurred during sign up: \(error)")
} else {
DispatchQueue.main.async {
self.dismiss(animated: true, completion: nil)
}
}
}
}
}
}
}
| [
-1
] |
93cff5dfb38383a2f7fc95f95466c4955cf70ecd | 2687e22cc743f9aa4cac4d36a19ab2788c2a36d2 | /Jet2TT/ServiceManager/CoredataModule.swift | 516081ea056ae2e9303975052a30ec71485623b7 | [] | no_license | iYuvraj-kale/Jet2Test | 8c6cb1b45f62fe8f62743654a3a4696259ab65c4 | ee92f81141503c6d10a7c109fbd5e916d44ceaa0 | refs/heads/master | 2022-05-29T01:02:43.186441 | 2020-05-02T06:41:09 | 2020-05-02T06:41:09 | 260,623,031 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 8,587 | swift | //
// CoredataModule.swift
// Jet2TT
//
// Created by Yuvraj Kale on 01/05/20.
// Copyright © 2020 Yuvraj Kale. All rights reserved.
//
import UIKit
import CoreData
class CoredataModule: NSObject {
static let sharedInstance = CoredataModule()
private override init() {}
func writeData(withArticles articles:[Article]) {
DispatchQueue.main.async{
let appDelegate = UIApplication.shared.delegate as! AppDelegate
let context = appDelegate.persistentContainer.viewContext
context.mergePolicy = NSMergeByPropertyObjectTrumpMergePolicy
for article in articles{
if(!self.isEntityAttributeExist(id: article.id, entityName: "Articles")){
let articleEntity = NSEntityDescription.entity(forEntityName: "Articles", in: context)
let newArticle = NSManagedObject(entity: articleEntity!, insertInto: context)
newArticle.setValue(article.id, forKey: "id")
newArticle.setValue(article.createdAt, forKey: "createdAt")
newArticle.setValue(article.content, forKey: "content")
newArticle.setValue(article.comments as NSNumber, forKey: "comments")
newArticle.setValue(article.likes as NSNumber, forKey: "likes")
if(article.media.count>0){
let mediaEntity = NSEntityDescription.entity(forEntityName: "Media", in: context)
let newMedia = NSManagedObject(entity: mediaEntity!, insertInto: context)
newMedia.setValue(article.media[0].id, forKey: "id")
newMedia.setValue(article.media[0].blogId, forKey: "blogId")
newMedia.setValue(article.media[0].createdAt, forKey: "createdAt")
newMedia.setValue(article.media[0].image, forKey: "image")
newMedia.setValue(article.media[0].title, forKey: "title")
newMedia.setValue(article.media[0].url, forKey: "url")
}
if(article.user.count>0){
let userEntity = NSEntityDescription.entity(forEntityName: "User", in: context)
let newUser = NSManagedObject(entity: userEntity!, insertInto: context)
newUser.setValue(article.user[0].id, forKey: "id")
newUser.setValue(article.user[0].blogId, forKey: "blogId")
newUser.setValue(article.user[0].createdAt, forKey: "createdAt")
newUser.setValue(article.user[0].name, forKey: "name")
newUser.setValue(article.user[0].avatar, forKey: "avatar")
newUser.setValue(article.user[0].lastname, forKey: "lastname")
newUser.setValue(article.user[0].city, forKey: "city")
newUser.setValue(article.user[0].designation, forKey: "designation")
newUser.setValue(article.user[0].about, forKey: "about")
}
}
}
do {
try context.save()
} catch {
print("Failed saving")
}
}
}
func isEntityAttributeExist(id: String, entityName: String) -> Bool {
let appDelegate = UIApplication.shared.delegate as! AppDelegate
let managedContext = appDelegate.persistentContainer.viewContext
let fetchRequest = NSFetchRequest<NSFetchRequestResult>(entityName: entityName)
fetchRequest.predicate = NSPredicate(format: "id == %@", id)
let res = try! managedContext.fetch(fetchRequest)
return res.count > 0 ? true : false
}
func fetchData(from startIndex:Int, toEndIndex endIndex:Int)->[Article]?{
var articles = [Article]()
let appDelegate = UIApplication.shared.delegate as! AppDelegate
let context = appDelegate.persistentContainer.viewContext
let articleRequest = NSFetchRequest<NSFetchRequestResult>(entityName: "Articles")
articleRequest.fetchOffset = startIndex;
articleRequest.fetchLimit = endIndex;
articleRequest.returnsObjectsAsFaults = false
do {
let result = try context.fetch(articleRequest)
for data in result as! [NSManagedObject] {
var tempArticle = Article()
tempArticle.id = data.value(forKey: "id") as! String
tempArticle.createdAt = data.value(forKey: "createdAt") as! String
tempArticle.content = data.value(forKey: "content") as! String
tempArticle.comments = data.value(forKey: "comments") as! Int
tempArticle.likes = data.value(forKey: "likes") as! Int
let mediaRequest = NSFetchRequest<NSFetchRequestResult>(entityName: "Media")
mediaRequest.predicate = NSPredicate(format: "id == %@", "\(tempArticle.id)")
let mediaResult = try context.fetch(mediaRequest)
for mediaData in mediaResult as! [NSManagedObject]{
var tempMedia = Article.Media()
if let id = mediaData.value(forKey: "id") as? String{
tempMedia.id = id
}
if let blogid = mediaData.value(forKey: "blogId") as? String{
tempMedia.blogId = blogid
}
if let createAt = mediaData.value(forKey: "createdAt") as? String
{
tempMedia.createdAt = createAt
}
if let img = mediaData.value(forKey: "image") as? String{
tempMedia.image = img
}
if let titl = mediaData.value(forKey: "title") as? String{
tempMedia.title = titl
}
if let url = mediaData.value(forKey: "url") as? String{
tempMedia.url = url
}
tempArticle.media.append(tempMedia)
}
let userRequest = NSFetchRequest<NSFetchRequestResult>(entityName: "User")
userRequest.predicate = NSPredicate(format: "id == %@", "\(tempArticle.id)")
let userResult = try context.fetch(userRequest)
for userData in userResult as! [NSManagedObject]{
var tempUser = Article.UserModel()
if let id = userData.value(forKey: "id") as? String{
tempUser.id = id
}
if let blogid = userData.value(forKey: "blogId") as? String{
tempUser.blogId = blogid
}
if let createdat = userData.value(forKey: "createdAt") as? String{
tempUser.createdAt = createdat
}
if let name = userData.value(forKey: "name") as? String{
tempUser.name = name
}
if let city = userData.value(forKey: "city") as? String{
tempUser.city = city
}
if let lastname = userData.value(forKey: "lastname") as? String{
tempUser.lastname = lastname
}
if let avatar = userData.value(forKey: "avatar") as? String{
tempUser.avatar = avatar
}
if let about = userData.value(forKey: "about") as? String{
tempUser.about = about
}
if let designation = userData.value(forKey: "designation") as? String{
tempUser.designation = designation
}
tempArticle.user.append(tempUser)
}
articles.append(tempArticle)
}
} catch {
print("Failed")
}
return articles
}
}
| [
-1
] |
4846e8e4c50967f4799d9401f86653879b7f1e0b | 88f0d7c7e51e02ae1059146cdbc81b16a46e04ba | /brain/Interactor/Interactor.swift | 77017880cdb39b3c0d9fb5e7f5a8aae5c139034c | [
"MIT"
] | permissive | HelioMesquita/brain | a199727e03f1aa4f722d7ab6509613f1df63ed71 | 4bea2435f8d6546bcd752ef10e555c8a7803cdb5 | refs/heads/master | 2020-03-19T19:11:30.447602 | 2018-06-11T20:55:24 | 2018-06-11T20:55:24 | 136,844,082 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 577 | swift | import Alamofire
class Interactor<S> where S: Decodable {
typealias Model = S
var url: String
init(url: String) {
self.url = url
}
func execute(onSuccess: @escaping (Model) -> Void, onError: @escaping () -> Void) {
Alamofire.request(url).responseJSON { (dataResponse) in
if let data = dataResponse.data, dataResponse.result.isSuccess {
do {
let model = try JSONDecoder().decode(Model.self, from: data)
onSuccess(model)
} catch {
onError()
}
} else {
onError()
}
}
}
}
| [
-1
] |
01413445b5506c61c729a291223f67ccd5ccc71d | 97976a6a2084e01c019518218a7ead0a3d60ee49 | /newsAppUITests/newsAppUITests.swift | 2e0cc73c219362128b3c4c36467e149b52440149 | [] | no_license | aoguz1/mobiler-dev-blog-ios-fullstack-app | 84f06cfe58d952f8beffcda08206f36e53693d0d | e934248dcee0093a64ad9096181fae48b24aab7c | refs/heads/master | 2023-06-04T07:48:37.217350 | 2021-06-29T03:21:21 | 2021-06-29T03:21:21 | 381,225,918 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,418 | swift | //
// newsAppUITests.swift
// newsAppUITests
//
// Created by Abdullah Oğuz on 24.06.2021.
//
import XCTest
class newsAppUITests: XCTestCase {
override func setUpWithError() throws {
// Put setup code here. This method is called before the invocation of each test method in the class.
// In UI tests it is usually best to stop immediately when a failure occurs.
continueAfterFailure = false
// In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
}
override func tearDownWithError() throws {
// Put teardown code here. This method is called after the invocation of each test method in the class.
}
func testExample() throws {
// UI tests must launch the application that they test.
let app = XCUIApplication()
app.launch()
// Use recording to get started writing UI tests.
// Use XCTAssert and related functions to verify your tests produce the correct results.
}
func testLaunchPerformance() throws {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, *) {
// This measures how long it takes to launch your application.
measure(metrics: [XCTApplicationLaunchMetric()]) {
XCUIApplication().launch()
}
}
}
}
| [
360463,
155665,
376853,
344106,
253996,
385078,
163894,
180279,
352314,
213051,
376892,
32829,
286787,
352324,
237638,
352327,
385095,
393291,
163916,
311373,
368717,
196687,
278607,
311377,
254039,
426074,
368732,
180317,
32871,
352359,
221292,
278637,
385135,
319599,
376945,
131190,
385147,
131199,
426124,
196758,
49308,
65698,
311459,
49317,
377008,
377010,
180409,
295099,
377025,
377033,
164043,
417996,
254157,
368849,
368850,
139478,
229591,
385240,
254171,
147679,
147680,
311520,
205034,
254189,
286957,
254193,
344312,
336121,
262403,
147716,
368908,
180494,
368915,
254228,
319764,
278805,
262419,
377116,
254250,
311596,
418095,
336177,
180534,
155968,
287040,
311622,
270663,
368969,
254285,
180559,
377168,
344402,
229716,
368982,
270703,
139641,
385407,
385409,
106893,
270733,
385423,
385433,
213402,
385437,
254373,
156069,
385448,
385449,
115116,
385463,
319931,
278974,
336319,
336323,
188870,
278988,
278992,
262619,
377309,
377310,
369121,
369124,
279014,
270823,
279017,
311787,
360945,
139766,
279030,
377337,
279033,
254459,
410108,
410109,
262657,
377346,
279042,
279053,
410126,
393745,
385554,
303635,
279060,
279061,
254487,
410138,
279066,
188957,
377374,
385578,
377388,
197166,
393775,
418352,
33339,
352831,
33344,
385603,
377419,
385612,
303693,
426575,
385620,
369236,
115287,
189016,
270938,
287327,
279143,
279150,
287345,
352885,
352886,
344697,
189054,
287359,
369285,
385669,
311944,
344714,
311950,
377487,
311953,
287379,
336531,
180886,
352921,
377499,
221853,
344737,
295591,
352938,
295598,
418479,
279215,
279218,
164532,
336565,
287418,
377531,
303802,
377534,
377536,
66243,
385737,
287434,
279249,
303826,
385745,
369365,
369366,
385751,
230105,
361178,
352989,
352990,
418529,
295649,
385763,
295653,
369383,
230120,
361194,
312046,
418550,
279293,
344829,
205566,
197377,
434956,
312076,
295698,
418579,
426772,
197398,
426777,
221980,
344864,
197412,
336678,
262952,
262957,
189229,
164655,
197424,
328495,
197428,
336693,
230198,
377656,
426809,
197433,
222017,
295745,
377669,
197451,
369488,
279379,
385878,
385880,
295769,
197467,
435038,
230238,
279393,
303973,
279398,
385895,
197479,
385901,
197489,
295799,
164730,
336765,
254851,
369541,
172936,
320394,
426894,
377754,
140203,
172971,
377778,
304050,
189362,
377789,
189373,
345030,
345034,
279499,
418774,
386007,
418781,
386016,
123880,
418793,
320495,
222193,
435185,
271351,
214009,
312313,
435195,
312317,
328701,
328705,
386049,
418819,
410629,
377863,
189448,
230411,
361487,
435216,
386068,
254997,
336928,
336930,
410665,
345137,
361522,
312372,
238646,
238650,
320571,
386108,
410687,
336962,
238663,
377927,
361547,
205911,
156763,
361570,
214116,
230500,
214119,
402538,
279659,
173168,
230514,
238706,
279666,
312435,
377974,
66684,
279686,
402568,
222344,
140426,
337037,
386191,
410772,
222364,
418975,
124073,
402618,
148674,
402632,
148687,
402641,
189651,
419028,
279766,
189656,
304353,
279780,
222441,
279789,
386288,
66802,
271607,
386296,
369912,
369913,
419066,
279803,
386300,
386304,
369929,
419097,
320795,
115997,
222496,
320802,
304422,
369964,
353581,
116014,
312628,
345397,
345398,
222523,
386363,
230730,
353611,
353612,
337228,
345418,
296269,
222542,
238928,
296274,
337226,
353617,
378201,
230757,
296304,
312688,
337280,
353672,
263561,
296328,
296330,
9618,
279955,
411028,
370066,
370072,
148899,
148900,
361928,
337359,
329168,
312785,
222674,
329170,
353751,
280025,
239069,
361958,
271850,
280042,
280043,
271853,
329198,
411119,
337391,
116209,
296434,
386551,
288252,
271880,
198155,
304655,
329231,
370200,
222754,
157219,
157220,
394793,
312879,
288305,
288319,
288322,
280131,
288328,
353875,
312937,
271980,
206447,
403057,
42616,
337533,
280193,
370307,
419462,
149127,
149128,
288391,
419464,
214667,
411275,
239251,
345753,
198304,
255651,
337590,
370359,
280252,
280253,
321217,
239305,
296649,
403149,
313042,
345813,
370390,
272087,
345817,
337638,
345832,
181992,
345835,
288492,
141037,
313082,
288508,
288515,
173828,
395018,
395019,
116491,
395026,
116502,
411417,
345882,
435993,
255781,
362281,
378666,
403248,
378673,
345910,
182070,
182071,
436029,
345918,
337734,
280396,
272207,
272208,
337746,
395092,
345942,
362326,
370526,
345950,
362336,
255844,
296807,
214894,
362351,
214896,
313200,
313204,
182145,
280451,
67464,
305032,
337816,
239515,
329627,
436130,
354210,
436135,
10153,
313257,
362411,
370604,
362418,
411587,
280517,
362442,
346066,
231382,
354268,
436189,
403421,
329696,
354273,
403425,
354279,
436199,
247786,
329707,
354283,
174058,
337899,
247787,
296942,
436209,
239610,
346117,
182277,
354310,
43016,
354311,
354312,
403463,
313356,
436235,
419857,
305173,
436248,
223269,
346153,
354346,
313388,
272432,
403507,
378933,
378934,
436283,
288835,
403524,
436293,
313415,
239689,
436304,
329812,
223317,
411738,
272477,
280676,
313446,
395373,
288878,
346237,
215165,
436372,
329884,
378186,
362658,
436388,
215204,
133313,
395458,
338118,
436429,
346319,
379102,
387299,
18661,
379110,
338151,
149743,
379120,
436466,
411892,
395511,
436471,
313595,
436480,
272644,
338187,
338188,
395536,
338196,
272661,
379157,
338217,
321839,
362809,
379193,
395591,
289109,
272730,
436570,
215395,
239973,
280938,
321901,
354671,
362864,
354672,
272755,
354678,
199030,
223611,
436609,
395653,
436613,
395660,
264591,
272784,
420241,
240020,
190870,
190872,
289185,
436644,
289195,
272815,
436659,
338359,
436677,
289229,
281038,
281039,
256476,
420326,
166403,
420374,
322077,
289328,
330291,
338491,
322119,
191065,
436831,
420461,
346739,
346741,
420473,
297600,
166533,
346771,
363155,
264855,
363161,
289435,
436897,
248494,
166581,
355006,
363212,
363228,
436957,
322269,
436960,
264929,
338658,
289511,
330473,
346859,
330476,
289517,
215790,
199415,
289534,
322302,
35584,
133889,
322312,
346889,
166677,
207639,
363295,
355117,
191285,
355129,
273209,
273211,
355136,
355138,
420680,
355147,
355148,
355153,
281426,
363353,
363354,
281434,
420702,
363361,
363362,
412516,
355173,
355174,
281444,
207724,
355182,
207728,
420722,
314240,
158594,
330627,
240517,
265094,
387977,
396171,
355216,
224146,
224149,
256918,
256919,
256920,
240543,
256934,
289720,
273336,
289723,
273341,
330688,
379845,
19398,
363462,
273353,
191445,
207839,
347104,
314343,
134124,
412653,
248815,
257007,
347122,
437245,
257023,
125953,
396292,
330759,
330766,
347150,
330789,
248871,
281647,
412725,
257093,
404550,
207954,
339031,
257126,
265318,
404582,
322664,
265323,
396395,
404589,
273523,
363643,
248960,
363658,
404622,
224400,
347286,
265366,
429209,
339101,
429216,
265381,
380069,
3243,
208044,
322733,
421050,
339131,
265410,
183492,
273616,
339167,
298209,
421102,
52473,
363769,
265467,
52476,
208123,
412926,
437504,
322826,
380178,
429332,
126229,
412963,
257323,
273713,
298290,
208179,
159033,
347451,
372039,
257353,
257354,
109899,
437585,
331091,
150868,
314708,
372064,
429410,
437602,
281958,
265579,
306541,
421240,
224637,
388488,
298378,
306580,
282008,
396697,
282013,
290206,
396709,
298406,
241067,
380331,
314797,
380335,
355761,
421302,
134586,
380348,
380350,
216510,
216511,
306630,
200136,
273865,
306634,
339403,
372172,
413138,
437726,
429540,
3557,
3559,
191980,
282097,
265720,
216575,
290304,
372226,
437766,
323083,
208397,
323088,
413202,
413206,
388630,
175640,
372261,
347693,
323120,
396850,
200245,
323126,
290359,
134715,
323132,
421437,
396865,
282182,
413255,
265800,
273992,
421452,
265809,
396885,
290391,
265816,
396889,
306777,
388699,
396896,
388712,
388713,
314997,
290425,
339579,
396927,
282248,
224907,
396942,
405140,
274071,
323226,
208547,
208548,
405157,
388775,
282279,
364202,
421556,
224951,
224952,
306875,
282302,
323262,
241366,
224985,
282330,
159462,
372458,
397040,
12017,
323315,
274170,
200444,
175874,
249606,
282379,
216844,
372497,
397076,
421657,
339746,
216868,
241447,
167720,
257831,
421680,
282418,
274234,
339782,
315209,
159563,
339799,
307038,
282471,
274288,
372592,
274296,
339840,
372625,
282517,
298912,
118693,
438186,
126896,
151492,
380874,
372699,
323554,
380910,
380922,
380923,
274432,
372736,
241695,
102441,
315433,
430127,
405552,
282671,
241717,
249912,
225347,
307269,
421958,
233548,
176209,
315477,
53334,
381013,
200795,
356446,
323678,
438374,
176231,
438378,
233578,
422000,
249976,
266361,
422020,
168069,
381061,
168070,
381071,
241809,
430231,
200856,
422044,
192670,
192671,
299166,
258213,
299176,
323761,
184498,
266427,
299208,
266447,
372943,
258263,
356575,
307431,
438512,
372979,
389364,
381173,
135416,
356603,
184574,
266504,
217352,
61720,
381210,
282908,
389406,
282912,
233761,
438575,
315698,
266547,
397620,
332084,
438583,
307514,
127292,
438592,
332100,
323914,
201037,
397650,
348499,
250196,
348501,
389465,
110955,
242027,
242028,
160111,
250227,
315768,
291193,
438653,
291200,
266628,
340356,
242059,
225684,
373141,
373144,
291225,
389534,
397732,
373196,
176602,
242138,
184799,
291297,
201195,
324098,
233987,
340489,
397841,
283154,
258584,
397855,
291359,
348709,
348710,
397872,
283185,
234037,
340539,
266812,
438850,
348741,
381515,
348748,
430681,
332379,
242274,
184938,
373357,
184942,
176751,
389744,
356983,
356984,
209529,
356990,
291455,
373377,
422529,
152196,
201348,
356998,
348807,
356999,
316044,
275102,
340645,
176805,
422567,
176810,
160441,
422591,
291529,
225996,
135888,
242385,
234216,
373485,
373486,
21239,
348921,
275193,
234233,
242428,
299777,
430853,
430860,
62222,
430880,
234276,
234290,
152372,
430909,
160576,
348999,
283466,
234330,
275294,
381791,
127840,
357219,
439145,
177002,
308075,
381811,
201590,
177018,
398205,
340865,
291713,
349066,
316299,
349068,
234382,
308111,
381840,
308113,
390034,
373653,
430999,
209820,
381856,
185252,
398244,
422825,
381872,
177074,
398268,
349122,
398275,
127945,
373705,
340960,
398305,
340967,
398313,
234476,
127990,
349176,
201721,
349179,
234499,
357380,
398370,
357413,
357420,
300087,
21567,
308288,
349254,
250955,
218187,
300109,
234578,
250965,
439391,
250982,
398444,
62574,
357487,
300147,
119925,
349304,
234626,
349315,
349317,
234635,
373902,
234655,
234662,
373937,
373939,
324790,
300215,
283841,
283846,
259275,
316628,
259285,
357594,
414956,
251124,
316661,
292092,
439550,
439563,
242955,
414989,
349458,
259346,
259347,
382243,
382246,
382257,
292145,
382264,
333115,
193853,
193858,
251212,
234830,
406862,
259408,
283990,
357720,
300378,
300379,
374110,
234864,
382329,
259449,
357758,
243073,
357763,
112019,
398740,
234902,
333224,
374189,
251314,
284086,
259513,
54719,
292291,
300490,
300526,
259569,
251379,
300539,
398844,
210429,
366081,
316951,
374297,
153115,
431646,
349727,
431662,
374327,
210489,
235069,
349764,
292424,
292426,
128589,
333389,
333394,
349780,
128600,
235096,
300643,
300645,
415334,
54895,
366198,
210558,
210559,
415360,
325246,
210569,
415369,
431754,
267916,
415376,
259741,
153252,
399014,
210601,
202413,
415419,
333508,
259780,
267978,
333522,
325345,
333543,
325357,
431861,
284410,
161539,
284425,
300812,
284430,
366358,
169751,
431901,
341791,
186148,
186149,
284460,
399148,
431918,
202541,
153392,
431935,
325444,
153416,
325449,
341837,
415566,
431955,
325460,
341846,
300893,
259937,
276326,
415592,
292713,
292719,
325491,
341878,
333687,
276343,
350072,
112510,
325508,
333700,
243590,
325514,
350091,
350092,
350102,
350108,
333727,
219046,
284584,
292783,
300983,
128955,
219102,
292835,
6116,
317416,
432114,
325620,
415740,
268286,
415744,
243720,
399372,
153618,
358418,
178215,
325675,
243763,
358455,
399433,
333902,
104534,
194667,
260206,
432241,
284789,
374913,
374914,
415883,
333968,
153752,
333990,
104633,
260285,
227517,
268479,
374984,
301270,
301271,
325857,
334049,
268515,
383208,
317676,
260337,
260338,
432373,
375040,
309504,
432387,
260355,
375052,
194832,
325904,
391448,
268570,
178459,
186660,
268581,
334121,
358698,
317738,
325930,
260396,
432435,
358707,
358710,
14654,
268609,
227655,
383309,
383327,
391521,
366948,
416101,
416103,
383338,
432503,
432511,
211327,
227721,
285074,
252309,
39323,
285083,
317851,
285089,
375211,
334259,
342454,
358844,
293309,
317889,
326083,
416201,
129484,
154061,
416206,
326093,
432608,
285152,
391654,
432616,
334315,
375281,
293368,
317949,
334345,
432650,
309770,
342537,
342549,
342560,
416288,
350758,
350759,
358951,
358952,
293420,
219694,
219695,
375345,
432694,
244279,
309831,
375369,
375373,
416334,
301647,
416340,
244311,
260705,
416353,
375396,
268901,
244345,
334473,
375438,
326288,
285348,
293552,
342705,
285362,
383668,
342714,
39616,
383708,
342757,
269036,
432883,
342775,
203511,
383740,
416509,
359166,
162559,
375552,
432894,
228099,
285443,
285450,
383755,
326413,
285467,
326428,
318247,
342827,
391980,
318251,
375610,
301883,
342846,
416577,
416591,
244569,
375644,
252766,
293729,
351078,
342888,
392057,
211835,
392065,
260995,
400262,
392071,
424842,
252812,
400271,
392080,
400282,
7070,
211871,
359332,
359333,
293801,
326571,
252848,
326580,
261045,
261046,
326586,
359365,
211913,
252878,
342990,
433104,
56270,
359380,
433112,
433116,
359391,
383980,
343020,
187372,
203758,
383994,
171009,
384004,
433166,
384015,
433173,
293911,
326684,
252959,
384031,
375848,
318515,
203829,
261191,
375902,
375903,
392288,
253028,
351343,
187505,
138354,
187508,
384120,
302202,
285819,
392317,
343166,
285823,
392320,
384127,
285833,
285834,
318602,
228492,
187539,
326803,
359574,
285850,
351389,
302239,
253098,
302251,
367791,
367792,
367798,
64699,
294075,
228541,
343230,
367809,
253124,
113863,
351445,
310496,
253168,
351475,
351489,
367897,
367898,
245018,
130342,
130344,
130347,
261426,
212282,
294210,
359747,
359748,
146763,
114022,
253288,
425327,
425331,
163190,
327030,
384379,
253316,
294278,
384391,
318860,
253339,
253340,
318876,
343457,
245160,
359860,
359861,
343480,
310714,
228796,
228804,
425417,
310731,
327122,
425434,
310747,
310758,
253431,
359931,
187900,
343552,
245249,
228868,
409095,
359949,
294413,
253456,
302613,
253462,
146976,
245290,
245291,
343606,
163385,
425534,
138817,
147011,
147020,
179800,
196184,
343646,
212574,
204386,
155238,
204394,
138862,
310896,
188021,
294517,
286351,
188049,
425624,
229021,
245413,
286387,
384693,
376502,
286392,
302778,
409277,
286400,
409289,
425682,
286419,
294621,
245471,
155360,
294629,
212721,
286457,
286463,
319232,
360194,
409355,
417556,
294699,
204600,
319289,
384826,
409404,
360253,
409416,
376661,
237397,
368471,
425820,
409446,
368486,
425832,
40809,
368489,
384871,
417648,
417658,
360315,
253828,
327556,
311183,
425875,
294806,
294808,
253851,
376733,
204702,
319393,
294820,
253868,
204722,
188349,
98240,
212947,
212953,
360416,
294887,
253930,
327666,
385011
] |
cba3fad21a78ff1c5c6b4235ccd09e3da36f86f4 | 7bb72efe7f944a42cf84a23dd3f8a0b8f9c6858c | /test/TypeCoercion/protocols.swift | 4a6738824cb15d18cc3a77d4d25dc11418fd1255 | [
"Apache-2.0",
"Swift-exception"
] | permissive | slavapestov/swift | 2b4e47e49fb072b822ae81258c7e60a33caa409f | 2374a0e4b0be804d9eda99de1b4bb66b78dd338c | refs/heads/master | 2023-08-17T15:24:24.707126 | 2016-02-07T07:05:58 | 2016-02-07T07:26:55 | 50,827,146 | 9 | 3 | null | 2017-04-08T10:18:42 | 2016-02-01T08:58:18 | C++ | UTF-8 | Swift | false | false | 5,033 | swift | // RUN: %target-parse-verify-swift
protocol MyPrintable {
func print()
}
protocol Titled {
var title : String { get set }
}
struct IsPrintable1 : FormattedPrintable, Titled, Document {
var title = ""
func print() {}
func print(_: TestFormat) {}
}
// Printability is below
struct IsPrintable2 { }
struct IsNotPrintable1 { }
struct IsNotPrintable2 {
func print(_: Int) -> Int {}
}
struct Book : Titled {
var title : String
}
struct Lackey : Titled {
var title : String {
get {}
set {}
}
}
struct Number {
var title : Int
}
func testPrintableCoercion(ip1: IsPrintable1,
ip2: IsPrintable2,
inp1: IsNotPrintable1,
inp2: IsNotPrintable2,
op: OtherPrintable) {
var p : MyPrintable = ip1 // okay
p = ip1 // okay
p = ip2 // okay
p = inp1 // expected-error{{value of type 'IsNotPrintable1' does not conform to 'MyPrintable' in assignment}}
p = inp2 // expected-error{{value of type 'IsNotPrintable2' does not conform to 'MyPrintable' in assignment}}
p = op // expected-error{{value of type 'OtherPrintable' does not conform to 'MyPrintable' in assignment}}
_ = p
}
func testTitledCoercion(ip1: IsPrintable1, book: Book, lackey: Lackey,
number: Number, ip2: IsPrintable2) {
var t : Titled = ip1 // okay
t = ip1
t = book
t = lackey
t = number // expected-error{{value of type 'Number' does not conform to 'Titled' in assignment}}
t = ip2 // expected-error{{value of type 'IsPrintable2' does not conform to 'Titled' in assignment}}
_ = t
}
extension IsPrintable2 : MyPrintable {
func print() {}
}
protocol OtherPrintable {
func print()
}
struct TestFormat {}
protocol FormattedPrintable : MyPrintable {
func print(_: TestFormat)
}
struct NotFormattedPrintable1 {
func print(_: TestFormat) { }
}
func testFormattedPrintableCoercion(ip1: IsPrintable1,
ip2: IsPrintable2,
inout fp: FormattedPrintable,
inout p: MyPrintable,
inout op: OtherPrintable,
nfp1: NotFormattedPrintable1) {
fp = ip1
fp = ip2 // expected-error{{value of type 'IsPrintable2' does not conform to 'FormattedPrintable' in assignment}}
fp = nfp1 // expected-error{{value of type 'NotFormattedPrintable1' does not conform to 'FormattedPrintable' in assignment}}
p = fp
op = fp // expected-error{{value of type 'FormattedPrintable' does not conform to 'OtherPrintable' in assignment}}
fp = op // expected-error{{value of type 'OtherPrintable' does not conform to 'FormattedPrintable' in assignment}}
}
protocol Document : Titled, MyPrintable {
}
func testMethodsAndVars(fp: FormattedPrintable, f: TestFormat, inout doc: Document) {
fp.print(f)
fp.print()
doc.title = "Gone with the Wind"
doc.print()
}
func testDocumentCoercion(inout doc: Document, ip1: IsPrintable1, l: Lackey) {
doc = ip1
doc = l // expected-error{{value of type 'Lackey' does not conform to 'Document' in assignment}}
}
// Check coercion of references.
func refCoercion(inout p: MyPrintable) { }
var p : MyPrintable = IsPrintable1()
var fp : FormattedPrintable = IsPrintable1()
var ip1 : IsPrintable1
refCoercion(&p)
refCoercion(&fp) // expected-error{{cannot pass immutable value as inout argument: implicit conversion from 'FormattedPrintable' to 'MyPrintable' requires a temporary}}
refCoercion(&ip1) // expected-error{{cannot pass immutable value as inout argument: implicit conversion from 'IsPrintable1' to 'MyPrintable' requires a temporary}}
protocol IntSubscriptable {
subscript(i: Int) -> Int { get }
}
struct IsIntSubscriptable : IntSubscriptable {
subscript(i: Int) -> Int { get {} set {} }
}
struct IsDoubleSubscriptable {
subscript(d: Double) -> Int { get {} set {} }
}
struct IsIntToStringSubscriptable {
subscript(i: Int) -> String { get {} set {} }
}
func testIntSubscripting(inout i_s: IntSubscriptable,
iis: IsIntSubscriptable,
ids: IsDoubleSubscriptable,
iiss: IsIntToStringSubscriptable) {
var x = i_s[17]
i_s[5] = 7 // expected-error{{cannot assign through subscript: subscript is get-only}}
i_s = iis
i_s = ids // expected-error{{value of type 'IsDoubleSubscriptable' does not conform to 'IntSubscriptable' in assignment}}
i_s = iiss // expected-error{{value of type 'IsIntToStringSubscriptable' does not conform to 'IntSubscriptable' in assignment}}
}
protocol MyREPLPrintable {
func myReplPrint()
}
extension Int : MyREPLPrintable {
func myReplPrint() {}
}
extension String : MyREPLPrintable {
func myReplPrint() {}
}
func doREPLPrint(p: MyREPLPrintable) {
p.myReplPrint()
}
func testREPLPrintable() {
let i : Int = 1
_ = i as MyREPLPrintable
doREPLPrint(i)
doREPLPrint(1)
doREPLPrint("foo")
}
// Boolean coercion
if true as BooleanType {}
| [
89965,
71638
] |
7dfef86e7cc0027a828772a14d62fb7df8835171 | 44b17b1a816afd166be3a1501107bb4a4ea9dc56 | /test03/ViewController.swift | b59485772afc166f7ecd0cc3c6e4f3292e4884af | [] | no_license | MaxiJunkie/Homework1_Ios_Developer | e6954fa79691e895f3f46a3d0c0031fbfb8cb1d2 | 1f9da4392b29e766c55f4efc952d2fcc3b889154 | refs/heads/master | 2021-01-10T23:02:22.657556 | 2016-10-16T18:29:49 | 2016-10-16T18:29:49 | 70,629,294 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 3,175 | swift | //
// ViewController.swift
// Homework for ios
//
// Created by Maxim Stegnienko on 12/10/2016.
// Copyright © 2016 test. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
@IBOutlet var display: UILabel!
private var userStartedTyping = false
private let calculator = Calculator()
private var pointIsUse = false
var displayedNumber: Double {
get {
return Double(display.text!) ?? 0.0
}
set {
display.text = String(newValue)
calculator.setNumber(number: newValue)
}
}
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
@IBAction func resetButtonPressed(_ sender: AnyObject) {
display.text = "0"
userStartedTyping = false
calculator.setNumber(number: displayedNumber)
}
@IBAction func operationButtonPressed(_ sender: AnyObject) {
guard let button = sender as? UIButton else {
return
}
guard let op = button.currentTitle else {
return
}
displayedNumber = calculator.performOperation(operation: op)
userStartedTyping = false
}
@IBAction func numberButtonPressed(_ sender: AnyObject) {
guard let button = sender as? UIButton else {
return
}
guard let currentText = display.text, let number = button.currentTitle else {
return
}
if userStartedTyping {
// Здесь начинается пунтк номер 4
let textOnDisplay = display.text!
if (number != ".") || ((textOnDisplay.range(of: ".") == nil)) {
display.text = currentText + number
}
//Изначально я сделал так как написано ниже , но потом решил воспользоватья
// функций rangeofstring
/*
if (number == ".") && (pointIsUse == false) {
display.text = currentText + number
pointIsUse = true
}
if (number != ".") && (pointIsUse == true) {
display.text = currentText + number
}
if (number != ".") && (pointIsUse == false) {
display.text = currentText + number
}
*/
// здесь заканчивается пункт номер 4
} else {
display.text = number
}
calculator.setNumber(number: displayedNumber)
userStartedTyping = true
}
}
| [
-1
] |
cfbd7b4e854abc33858431d94287f792cb15163a | fd1ded45675d4094ab93825c424c6f3450dee4b4 | /tommy/tommy/tommy/AppDelegate.swift | adea029b1e05b9ca8b2d553e597af27363ea650e | [] | no_license | Zimby1/TommyTrush | 1e31bceb073b28cd102e4f24a684bfa4031d681c | 87865e9360a9420cd70385fe7623554ab6360e83 | refs/heads/master | 2021-05-03T04:48:16.765173 | 2018-02-07T14:56:49 | 2018-02-07T14:56:49 | 120,625,774 | 0 | 0 | null | 2018-02-07T14:56:50 | 2018-02-07T14:30:35 | Swift | UTF-8 | Swift | false | false | 2,171 | swift | //
// AppDelegate.swift
// tommy
//
// Created by Matteo De giuseppe on 22/01/18.
// Copyright © 2018 ZIMBY. 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,
229388,
294924,
278542,
327695,
229391,
278545,
229394,
278548,
229397,
229399,
229402,
352284,
229405,
278556,
278559,
229408,
294950,
229415,
229417,
327722,
237613,
229422,
360496,
229426,
237618,
229428,
286774,
286776,
319544,
204856,
229432,
286778,
352318,
286791,
237640,
286797,
278605,
311375,
163920,
237646,
196692,
319573,
311383,
278623,
278626,
319590,
311400,
278635,
303212,
278639,
131192,
278648,
237693,
327814,
131209,
303241,
417930,
303244,
311436,
319633,
286873,
286876,
311460,
311469,
32944,
327862,
286906,
327866,
180413,
286910,
131264,
286916,
286922,
286924,
286926,
319694,
286928,
131281,
278743,
278747,
295133,
155872,
319716,
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,
319809,
319810,
278849,
319814,
311623,
319818,
311628,
229709,
319822,
287054,
278865,
229717,
196963,
196969,
139638,
213367,
106872,
319872,
311683,
311693,
65943,
319898,
311719,
278952,
139689,
278957,
311728,
278967,
180668,
311741,
278975,
319938,
278980,
98756,
278983,
319945,
278986,
319947,
278990,
278994,
311767,
279003,
279006,
188895,
172512,
287202,
279010,
279015,
172520,
319978,
279020,
172526,
311791,
279023,
172529,
279027,
319989,
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,
172618,
303690,
33357,
287309,
279124,
172634,
262752,
254563,
172644,
311911,
189034,
295533,
172655,
172656,
352880,
295538,
189040,
172660,
189044,
287349,
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,
295583,
287400,
279208,
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,
230154,
33548,
312077,
295695,
295701,
230169,
369433,
295707,
328476,
295710,
230175,
303914,
279340,
205613,
279353,
230202,
312124,
222018,
295755,
377676,
148302,
287569,
303959,
230237,
279390,
230241,
279394,
303976,
336744,
303985,
303987,
328563,
279413,
303991,
303997,
295806,
295808,
304005,
295813,
304007,
320391,
304009,
213895,
304011,
230284,
189325,
304013,
295822,
213902,
189329,
279438,
189331,
304019,
295825,
58262,
304023,
279452,
410526,
279461,
279462,
304042,
213931,
304055,
230327,
287675,
230334,
304063,
238528,
304065,
213954,
189378,
156612,
295873,
213963,
312272,
304084,
304090,
320481,
304106,
320490,
312302,
328687,
320496,
304114,
295928,
320505,
312321,
295945,
230413,
197645,
295949,
320528,
140312,
295961,
238620,
197663,
304164,
304170,
238641,
312374,
238652,
238655,
230465,
238658,
296004,
132165,
336964,
205895,
320584,
238666,
296021,
402518,
336987,
230497,
296036,
361576,
296040,
205931,
296044,
164973,
205934,
279661,
312432,
279669,
337018,
189562,
279679,
66690,
279683,
222340,
205968,
296084,
238745,
304285,
238756,
205991,
222377,
165035,
337067,
165038,
238766,
230576,
238770,
304311,
230592,
312518,
279750,
230600,
230607,
148690,
320727,
279769,
304348,
279777,
304354,
296163,
320740,
279781,
304360,
320748,
279788,
279790,
304370,
296189,
320771,
312585,
296202,
296205,
230674,
320786,
230677,
296213,
230679,
320792,
230681,
296215,
214294,
304416,
230689,
173350,
312622,
296243,
312630,
222522,
296253,
222525,
296255,
312639,
230718,
296259,
378181,
296262,
230727,
296264,
320840,
238919,
296267,
296271,
222545,
230739,
312663,
222556,
337244,
230752,
312676,
230760,
173418,
410987,
230763,
230768,
296305,
312692,
230773,
304505,
181626,
304506,
279929,
181631,
312711,
312712,
296331,
288140,
288144,
230800,
304533,
288154,
337306,
288160,
173472,
288162,
288164,
279975,
304555,
370092,
279983,
173488,
288176,
279985,
312755,
296373,
312759,
337335,
288185,
279991,
222652,
312766,
173507,
296389,
222665,
230860,
312783,
288208,
230865,
148946,
370130,
222676,
288210,
288212,
288214,
239064,
329177,
288217,
288218,
280027,
288220,
239070,
288224,
370146,
280034,
288226,
288229,
280036,
280038,
288232,
288230,
288234,
320998,
288236,
288238,
288240,
288242,
296435,
288244,
288250,
148990,
321022,
206336,
402942,
296446,
296450,
230916,
230919,
214535,
304651,
370187,
304653,
402969,
230940,
222752,
108066,
296486,
296488,
157229,
230961,
157236,
288320,
288325,
124489,
280140,
280145,
288338,
280149,
288344,
280152,
239194,
280158,
403039,
370272,
181854,
239202,
370279,
312938,
280183,
280185,
280188,
280191,
116354,
280194,
280208,
280211,
288408,
280218,
280222,
419489,
190118,
321195,
296622,
321200,
337585,
296626,
296634,
296637,
419522,
280260,
419525,
206536,
280264,
206539,
206541,
206543,
263888,
280276,
313044,
321239,
280283,
18140,
288478,
313055,
419555,
321252,
313066,
288494,
280302,
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,
337732,
280388,
304968,
280393,
280402,
173907,
313176,
42842,
280419,
321381,
296812,
313201,
1920,
255873,
305028,
280454,
247688,
280464,
124817,
280468,
239510,
280473,
124827,
214940,
247709,
214944,
280487,
313258,
321458,
296883,
124853,
214966,
10170,
296890,
288700,
296894,
190403,
296900,
280515,
337862,
165831,
280521,
231379,
296921,
354265,
354270,
239586,
313320,
354281,
231404,
124913,
165876,
321528,
313340,
288764,
239612,
239617,
313347,
288773,
313358,
305176,
313371,
354338,
305191,
223273,
313386,
354348,
124978,
215090,
124980,
288824,
288826,
321595,
378941,
313406,
288831,
288836,
67654,
280651,
354382,
288848,
280658,
215123,
354390,
288855,
288859,
280669,
313438,
149599,
280671,
149601,
321634,
149603,
223327,
329830,
280681,
313451,
223341,
280687,
215154,
313458,
149618,
280691,
313464,
321659,
280702,
288895,
321670,
215175,
141446,
288909,
141455,
275606,
141459,
280725,
313498,
100520,
288936,
280747,
288940,
288947,
280755,
321717,
280759,
280764,
280769,
280771,
280774,
280776,
321740,
313548,
280783,
280786,
280788,
313557,
280793,
280796,
280798,
338147,
280804,
280807,
157930,
280811,
280817,
125171,
280819,
157940,
182517,
280823,
280825,
280827,
280830,
280831,
280833,
125187,
280835,
125191,
125207,
125209,
321817,
125218,
321842,
223539,
125239,
280888,
280891,
289087,
280897,
280900,
239944,
305480,
280906,
239947,
305485,
305489,
379218,
280919,
248153,
215387,
354653,
354656,
313700,
313705,
280937,
190832,
280946,
223606,
313720,
280956,
280959,
313731,
240011,
199051,
289166,
240017,
297363,
190868,
297365,
240021,
297368,
297372,
141725,
297377,
289186,
297391,
289201,
240052,
289207,
305594,
289210,
281024,
289218,
289221,
289227,
436684,
281045,
281047,
166378,
305647,
281075,
174580,
240124,
281084,
305662,
305664,
240129,
305666,
240132,
223749,
305668,
330244,
223752,
338440,
150025,
281095,
223757,
281102,
223763,
223765,
281113,
322074,
281116,
281121,
182819,
281127,
281135,
150066,
158262,
158266,
289342,
281154,
322115,
158283,
281163,
281179,
338528,
338532,
281190,
199273,
281196,
158317,
19053,
313973,
297594,
281210,
158347,
264845,
182926,
133776,
182929,
314003,
117398,
314007,
289436,
174754,
330404,
289448,
133801,
174764,
314029,
314033,
240309,
133817,
314045,
314047,
314051,
199364,
297671,
158409,
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,
240535,
224151,
289687,
297883,
289694,
289696,
289700,
289712,
281529,
289724,
52163,
183260,
420829,
281567,
289762,
322534,
297961,
183277,
322550,
134142,
322563,
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,
306354,
142531,
199877,
289991,
306377,
289997,
249045,
363742,
363745,
298216,
330988,
126190,
216303,
322801,
388350,
257302,
363802,
199976,
199978,
314671,
298292,
298294,
257334,
216376,
298306,
380226,
224584,
224587,
224594,
216404,
306517,
150870,
314714,
224603,
159068,
314718,
265568,
314723,
281960,
150890,
306539,
314732,
314736,
290161,
216436,
306549,
298358,
314743,
306552,
306555,
314747,
298365,
290171,
290174,
224641,
281987,
314756,
298372,
281990,
224647,
265604,
298377,
314763,
142733,
298381,
314768,
224657,
306581,
314773,
314779,
314785,
314793,
282025,
282027,
241068,
241070,
241072,
282034,
241077,
150966,
298424,
306618,
282044,
323015,
306635,
306640,
290263,
290270,
290275,
339431,
282089,
191985,
282098,
290291,
282101,
241142,
191992,
290298,
151036,
290302,
282111,
290305,
175621,
192008,
323084,
257550,
282127,
290321,
282130,
323090,
290325,
282133,
241175,
290328,
282137,
290332,
241181,
282142,
282144,
290344,
306731,
290349,
290351,
290356,
28219,
282186,
224849,
282195,
282199,
282201,
306778,
159324,
159330,
314979,
298598,
323176,
224875,
241260,
323181,
257658,
315016,
282249,
290445,
282255,
282261,
175770,
298651,
323229,
282269,
298655,
323231,
61092,
282277,
306856,
282295,
323260,
282300,
323266,
282310,
323273,
282319,
306897,
241362,
306904,
282328,
298714,
52959,
216801,
282337,
241380,
216806,
323304,
282345,
12011,
282356,
323318,
282364,
282367,
306945,
241412,
323333,
282376,
216842,
323345,
282388,
323349,
282392,
184090,
315167,
315169,
282402,
315174,
323367,
241448,
315176,
241450,
282410,
306988,
306991,
315184,
323376,
315190,
241464,
159545,
282425,
298811,
307009,
413506,
241475,
307012,
298822,
315211,
282446,
307027,
315221,
323414,
315223,
241496,
241498,
307035,
307040,
110433,
282465,
241509,
110438,
298860,
110445,
282478,
315249,
282481,
110450,
315251,
315253,
315255,
339838,
315267,
282499,
315269,
241544,
282505,
241546,
241548,
298896,
298898,
282514,
241556,
298901,
44948,
241560,
282520,
241563,
241565,
241567,
241569,
282531,
241574,
282537,
298922,
36779,
241581,
282542,
241583,
323504,
241586,
282547,
241588,
290739,
241590,
241592,
241598,
290751,
241600,
241605,
151495,
241610,
298975,
241632,
298984,
241640,
241643,
298988,
241646,
241649,
241652,
323574,
290807,
241661,
299006,
282623,
315396,
241669,
315397,
282632,
282639,
290835,
282645,
241693,
282654,
241701,
102438,
217127,
282669,
323630,
282681,
290877,
282687,
159811,
315463,
315466,
192589,
307278,
192596,
176213,
307287,
315482,
315483,
217179,
192605,
233567,
200801,
299105,
217188,
299109,
307303,
315495,
356457,
307307,
45163,
315502,
192624,
307314,
323700,
299126,
233591,
299136,
307329,
307338,
233613,
241813,
307352,
299164,
241821,
299167,
184479,
184481,
315557,
184486,
307370,
307372,
184492,
307374,
307376,
299185,
323763,
299191,
176311,
307385,
307386,
258235,
307388,
176316,
307390,
184503,
299200,
184512,
307394,
307396,
299204,
184518,
307399,
323784,
307409,
307411,
176343,
299225,
233701,
307432,
184572,
282881,
184579,
282893,
291089,
282906,
291104,
233766,
176435,
307508,
315701,
332086,
307510,
307512,
168245,
307515,
307518,
282942,
282947,
323917,
282957,
110926,
233808,
323921,
315733,
323926,
233815,
315739,
323932,
299357,
242018,
242024,
299373,
315757,
250231,
242043,
315771,
299388,
299391,
291202,
299398,
242057,
291212,
299405,
291222,
315801,
291226,
242075,
283033,
291231,
61855,
283042,
291238,
291241,
127403,
127405,
127407,
291247,
299440,
299444,
127413,
291254,
283062,
127417,
291260,
127421,
127424,
299457,
127429,
127431,
315856,
127440,
176592,
315860,
176597,
127447,
283095,
299481,
127449,
176605,
242143,
127455,
291299,
340454,
127463,
242152,
291305,
127466,
176620,
291314,
127474,
291317,
135672,
127480,
233979,
291323,
127485,
291330,
127494,
283142,
127497,
135689,
233994,
127500,
291341,
233998,
127506,
234003,
234006,
127511,
152087,
283161,
234010,
242202,
135707,
135710,
242206,
242208,
291361,
242220,
291378,
152118,
234038,
234041,
315961,
70213,
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,
185074,
226037,
283382,
316151,
234231,
234236,
226045,
242431,
234239,
209665,
234242,
299778,
242436,
234246,
226056,
291593,
234248,
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,
234329,
234333,
308063,
234336,
242530,
349027,
234338,
234341,
234344,
234347,
177004,
234350,
324464,
234353,
152435,
177011,
234356,
234358,
234362,
226171,
234364,
291711,
234368,
234370,
291714,
291716,
234373,
316294,
226182,
234375,
308105,
226185,
234379,
234384,
234388,
234390,
226200,
234393,
209818,
308123,
234396,
324504,
291742,
324508,
234398,
234401,
291747,
291748,
234405,
291750,
324518,
324520,
234407,
234410,
291754,
291756,
324522,
226220,
324527,
234414,
234417,
201650,
324531,
291760,
234422,
226230,
324536,
275384,
234428,
291773,
234431,
242623,
324544,
324546,
234434,
324548,
234437,
226239,
226245,
234439,
234443,
291788,
234446,
193486,
193488,
234449,
275406,
234452,
234455,
234459,
234461,
234464,
234467,
234470,
168935,
5096,
324585,
234475,
234478,
316400,
234481,
316403,
234484,
234485,
324599,
234487,
234490,
234493,
234496,
316416,
234501,
275462,
308231,
234504,
234507,
234510,
234515,
300054,
234519,
234520,
316439,
234523,
234526,
234528,
300066,
234532,
300069,
234535,
234537,
234540,
234543,
234546,
275508,
234549,
300085,
300088,
234553,
234556,
234558,
316479,
234561,
308291,
316483,
234563,
160835,
234568,
234570,
316491,
234572,
300108,
234574,
300115,
234580,
234581,
234585,
275545,
242777,
234590,
234593,
234595,
234597,
300133,
234601,
300139,
234605,
160879,
234607,
275569,
234610,
300148,
234614,
398455,
144506,
234618,
234620,
275579,
234623,
226433,
234627,
275588,
234629,
242822,
234634,
234636,
177293,
234640,
275602,
234643,
308373,
324757,
234647,
226453,
234648,
234650,
308379,
275608,
234653,
300189,
119967,
324766,
324768,
283805,
234657,
242852,
234661,
300197,
283813,
234664,
177318,
275626,
234667,
316596,
308414,
300223,
234687,
300226,
308418,
283844,
300229,
308420,
308422,
234692,
283850,
300234,
300238,
300241,
316625,
300243,
300245,
316630,
300248,
300253,
300256,
300258,
300260,
234726,
300263,
300265,
300267,
161003,
300270,
300272,
120053,
300278,
316663,
275703,
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,
226617,
243003,
283963,
226628,
283973,
300357,
177482,
283983,
316758,
357722,
316766,
316768,
292192,
218464,
292197,
316774,
243046,
218473,
284010,
324978,
136562,
333178,
275834,
275836,
275840,
316803,
316806,
226696,
316811,
226699,
316814,
226703,
300433,
234899,
226709,
357783,
316824,
316826,
300448,
144807,
144810,
144812,
284076,
144814,
144820,
284084,
292279,
284087,
144826,
144828,
144830,
144832,
144835,
144837,
38342,
144839,
144841,
144844,
144847,
144852,
144855,
103899,
300507,
333280,
226787,
218597,
292329,
300523,
259565,
300527,
308720,
259567,
226802,
316917,
292343,
308727,
300537,
316933,
316947,
308757,
308762,
284191,
316959,
284194,
284196,
235045,
284199,
284204,
284206,
284209,
284211,
284213,
194101,
284215,
316983,
194103,
284218,
226877,
284223,
284226,
284228,
243268,
292421,
284231,
226886,
128584,
284234,
366155,
317004,
276043,
284238,
226895,
284241,
292433,
284243,
300628,
284245,
194130,
284247,
317015,
235097,
243290,
284249,
276052,
276053,
300638,
284251,
284253,
284255,
284258,
243293,
292452,
292454,
284263,
177766,
284265,
292458,
284267,
292461,
284272,
284274,
284278,
292470,
276086,
292473,
284283,
276093,
284286,
292479,
284288,
292481,
284290,
325250,
284292,
292485,
325251,
276095,
276098,
284297,
317066,
284299,
317068,
276109,
284301,
284303,
284306,
276114,
284308,
284312,
284314,
284316,
276127,
284320,
284322,
284327,
284329,
317098,
284331,
276137,
284333,
284335,
276144,
284337,
284339,
300726,
284343,
284346,
284350,
358080,
276160,
284354,
358083,
284358,
276166,
358089,
284362,
276170,
276175,
284368,
276177,
284370,
358098,
284372,
317138,
284377,
284379,
284381,
284384,
358114,
284386,
358116,
276197,
317158,
358119,
284392,
325353,
358122,
284394,
284397,
358126,
284399,
358128,
276206,
358133,
358135,
276216,
358138,
300795,
358140,
284413,
358142,
358146,
317187,
284418,
317189,
317191,
284428,
300816,
300819,
317207,
284440,
300828,
300830,
276255,
325408,
300832,
300834,
317221,
227109,
358183,
186151,
276268,
300845,
243504,
300850,
284469,
276280,
325436,
358206,
276291,
366406,
276295,
300872,
153417,
292681,
358224,
284499,
276308,
284502,
317271,
178006,
276315,
292700,
284511,
227175,
292715,
300912,
292721,
284529,
300915,
284533,
292729,
317306,
284540,
292734,
325512,
169868,
276365,
358292,
284564,
317332,
399252,
284566,
350106,
284572,
276386,
284579,
276388,
358312,
317353,
284585,
276395,
292776,
292784,
276402,
358326,
161718,
358330,
276411,
276418,
276425,
301009,
301011,
301013,
292823,
301015,
358360,
301017,
292828,
276446,
153568,
276448,
276452,
292839,
276455,
350186,
292843,
276460,
178161,
227314,
276466,
350200,
325624,
276472,
317435,
276476,
276479,
350210,
276482,
178181,
276485,
350218,
276490,
292876,
350222,
317456,
276496,
317458,
243733,
317468,
243740,
317472,
325666,
243751,
292904,
178224,
276528,
243762,
309298,
325685,
325689,
235579,
325692,
235581,
178238,
276539,
276544,
243779,
284739,
292934,
243785,
276553,
350293,
350295,
309337,
227418,
194649,
350302,
194654,
227423,
178273,
309346,
227426,
309348,
350308,
309350,
194660,
309352,
350313,
309354,
301163,
350316,
292968,
227430,
301167,
276583,
350321,
276590,
284786,
276595,
350325,
227440,
350328,
292985,
301178,
292989,
301185,
317570,
350339,
292993,
317573,
350342,
350345,
350349,
301199,
317584,
325777,
350354,
350357,
350359,
350362,
350366,
276638,
153765,
284837,
350375,
350379,
350381,
350383,
129200,
350385,
350387,
350389,
350395,
350397,
350399,
227520,
350402,
227522,
301252,
350406,
227529,
301258,
309450,
276685,
309455,
276689,
309462,
301272,
276699,
309468,
194780,
309471,
301283,
317672,
317674,
325867,
243948,
194801,
227571,
309491,
309494,
243960,
227583,
276735,
227587,
276739,
211204,
276742,
227596,
325910,
309530,
342298,
211232,
317729,
276775,
211241,
325937,
325943,
211260,
260421,
276809,
285002,
276811,
235853,
276816,
235858,
276829,
276833,
391523,
276836,
293227,
276843,
293232,
276848,
186744,
211324,
227709,
285061,
366983,
317833,
178572,
285070,
285077,
178583,
227738,
317853,
276896,
317858,
342434,
285093,
317864,
285098,
276907,
235955,
276917,
293304,
293307,
293314,
309707,
293325,
129486,
317910,
293336,
235996,
317917,
293343,
358880,
276961,
293346,
227810,
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,
285265,
399955,
309844,
277080,
309849,
285277,
285282,
326244,
318055,
277100,
309871,
121458,
277106,
170618,
170619,
309885,
309888,
277122,
227975,
277128,
285320,
301706,
318092,
326285,
334476,
318094,
277136,
277139,
227992,
318108,
285340,
318110,
227998,
137889,
383658,
285357,
318128,
277170,
293555,
318132,
342707,
154292,
277173,
285368,
277177,
277181,
318144,
277187,
277191,
277194,
277196,
277201,
342745,
137946,
342747,
342749,
113378,
203491,
228069,
277223,
342760,
285417,
56041,
56043,
56045,
277232,
228081,
56059,
310015,
285441,
310020,
285448,
310029,
228113,
285459,
277273,
293659,
326430,
228128,
293666,
285474,
228135,
318248,
277291,
318253,
293677,
285489,
301876,
293685,
285494,
301880,
285499,
301884,
293696,
310080,
277317,
277322,
277329,
162643,
310100,
301911,
301913,
277337,
301921,
400236,
236397,
162671,
326514,
310134,
15224,
236408,
277368,
416639,
416640,
113538,
310147,
416648,
39817,
187274,
277385,
301972,
424853,
277405,
277411,
310179,
293798,
293802,
236460,
277426,
293811,
276579,
293817,
293820,
203715,
326603,
342994,
276586,
293849,
293861,
228327,
228328,
318442,
228330,
228332,
326638,
277486,
351217,
318450,
293876,
293877,
285686,
302073,
121850,
293882,
244731,
285690,
302075,
293887,
277504,
277507,
277511,
277519,
293908,
293917,
293939,
318516,
277561,
277564,
310336,
7232,
293956,
277573,
228422,
310344,
293960,
277577,
277583,
203857,
293971,
310355,
310359,
236632,
277594,
138332,
277598,
203872,
277601,
285792,
310374,
203879,
310376,
228460,
318573,
203886,
187509,
285815,
367737,
285817,
302205,
285821,
392326,
285831,
253064,
302218,
285835,
294026,
384148,
162964,
187542,
302231,
285849,
302233,
285852,
302237,
285854,
285856,
302241,
285862,
277671,
302248,
64682,
277678,
294063,
294065,
302258,
277687,
294072,
318651,
294076,
277695,
318657,
244930,
302275,
130244,
302277,
228550,
302282,
310476,
302285,
302288,
310481,
302290,
203987,
302292,
302294,
302296,
384222,
310498,
285927,
318698,
302315,
228592,
294132,
138485,
228601,
204026,
228606,
204031,
64768,
310531,
138505,
228617,
318742,
204067,
277798,
130345,
277801,
113964,
285997,
384302,
285999,
277804,
113969,
277807,
277811,
318773,
318776,
277816,
286010,
277819,
294204,
417086,
277822,
286016,
302403,
294211,
384328,
277832,
277836,
146765,
294221,
326991,
294223,
277839,
277842,
277847,
277850,
179547,
277853,
146784,
277857,
302436,
277860,
294246,
327015,
310632,
327017,
351594,
277864,
277869,
277872,
351607,
310648,
277880,
310651,
277884,
277888,
310657,
310659,
351619,
294276,
327046,
277892,
253320,
310665,
318858,
277894,
277898,
277903,
310672,
351633,
277905,
277908,
277917,
310689,
277921,
130468,
228776,
277928,
277932,
310703,
277937,
130486,
310710,
310712,
277944,
310715,
277947,
302526,
228799,
277950,
277953,
302534,
245191,
310727,
64966,
277959,
277963,
302541,
277966,
302543,
310737,
277971,
228825,
163290,
277978,
310749,
277981,
277984,
310755,
277989,
277991,
187880,
277995,
310764,
286188,
278000,
228851,
310772,
278003,
278006,
40440,
212472,
278009,
40443,
286203,
310780,
40448,
228864,
286214,
228871,
302603,
302614,
302617,
286233,
302621,
187936,
146977,
286240,
187939,
40484,
294435,
40486,
286246,
40488,
245288,
294439,
40491,
294440,
294443,
294445,
310831,
286248,
40499,
40502,
212538,
40507,
40511,
40513,
228933,
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,
310925,
286354,
278163,
302740,
122517,
278168,
179870,
327333,
229030,
212648,
302764,
278188,
278192,
319153,
278196,
302781,
319171,
302789,
294599,
278216,
302793,
294601,
212690,
319187,
286420,
278227,
229076,
286425,
319194,
278235,
229086,
278238,
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,
280021,
188252,
237409,
294776,
360317,
294785,
327554,
360322,
40840,
40851,
294803,
188312,
294811,
319390,
40865,
319394,
294817,
294821,
311209,
180142,
294831,
188340,
40886,
319419,
294844,
294847,
237508,
393177,
294876,
294879,
294883,
393190,
294890,
311279,
278513,
237555,
311283,
278516,
278519,
237562
] |
00043973ae5fc505119b5f2b08e29eb41de3d22f | cddaca06eb0d1af574c279693c9298a29dc64415 | /Shared/View/Home.swift | 4a082090a26fb398e190d36ec4efb802d978acf4 | [] | no_license | nyannya0328/UI-310 | 866a69c712af2ca28012253a1cb97c6bf3d4257d | ac54be18a59dadb7d7d9ac60d2de1c11aa9e793d | refs/heads/main | 2023-09-05T07:24:44.502807 | 2021-09-18T10:05:02 | 2021-09-18T10:05:02 | 431,072,064 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 3,769 | swift | //
// Home.swift
// UI-310 (iOS)
//
// Created by nyannyan0328 on 2021/09/18.
//
import SwiftUI
struct Home: View {
@State var currentIndex : Int = 0
var body: some View {
ZStack{
TabView(selection:$currentIndex){
ForEach(posts.indices,id:\.self){index in
Image(posts[index].postImage)
.resizable()
}
.ignoresSafeArea()
.offset(y: -100)
}
.tabViewStyle(PageTabViewStyle(indexDisplayMode: .never))
.animation(.easeInOut, value: currentIndex)
.overlay(
LinearGradient(colors: [
Color.white,
Color.white.opacity(0.4),
Color.white.opacity(0.2),
Color.white,
Color.white,
Color.white,
], startPoint: .top, endPoint: .bottom)
)
.ignoresSafeArea()
SnapCarousel(spacing:getRect().height < 750 ? 10 : 20,trailingSpace:getRect().height < 750 ? 100 : 150, index: $currentIndex, items: posts) {post in
cardView(post: post)
}
.offset(y: getRect().height / 3.5)
}
}
@ViewBuilder
func cardView(post : Post)->some View{
VStack(spacing:10){
GeometryReader{proxy in
let size = proxy.size
Image(post.postImage)
.resizable()
.aspectRatio(contentMode: .fill)
.frame(width: size.width, height: size.height)
.cornerRadius(15)
}
.padding(15)
.background(Color.white,in: RoundedRectangle(cornerRadius: 15))
.frame(height: getRect().height / 3.5)
Text(post.title)
.font(.title.bold())
.foregroundColor(.green)
HStack{
ForEach(1...5,id:\.self){index in
Image(systemName: "star.fill")
.foregroundColor(index <= post.starRating ? .yellow : .gray)
}
Text("(\(post.starRating).0)")
.font(.footnote)
.foregroundColor(.yellow)
}
Text(post.discription)
.font(getRect().height < 750 ? .callout : .title2.weight(.black))
.multilineTextAlignment(.center)
.lineLimit(1)
.padding(.top,9)
.padding(.horizontal)
}
}
}
struct Home_Previews: PreviewProvider {
static var previews: some View {
Home()
}
}
extension View{
func getRect()->CGRect{
return UIScreen.main.bounds
}
}
| [
-1
] |
5ecb9ab5ebc1bb390215b5e1ddfa4ee5dfbf3718 | 6de6fad31f8239559df260348f7b990ab94b6475 | /FinalProject/View/ContentView.swift | 3cda247490b1db5d4bee193e8df2bbc64fb27a8d | [] | no_license | kiranjotassi/FinalProjectiOS | ee3568f4b49d6ef4617468f127c94757bdcf68ff | 4979bb8e9ec1fc868a4b787f818b54e5d98ae9f7 | refs/heads/main | 2023-01-31T09:48:46.346510 | 2020-12-13T04:15:30 | 2020-12-13T04:15:30 | 304,621,683 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 453 | swift | //
// ContentView.swift
// FinalProject
//
// Created by Kiranjot Assi on 2020-10-16.
//
import SwiftUI
//Main body of the app
struct ContentView: View {
var body: some View {
Text("Hello, world!")
.padding()
.accentColor(/*@START_MENU_TOKEN@*/.blue/*@END_MENU_TOKEN@*/)
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
| [
369287,
126601,
343054,
108815,
108816,
256912,
108818,
347284,
386582,
357409,
252964,
153644,
378669,
372654,
372271,
180531,
375348,
384701,
372030,
214591,
349760,
374977,
147012,
420678,
204999,
356551,
272204,
345165,
353614,
357838,
391504,
212948,
379094,
352984,
398298,
260702,
379103,
345188,
168045,
207725,
66799,
369905,
162298,
360956,
377982
] |
ade2534b6d0606dca0cfb457ac3dac8ae0d4dd99 | 765cc196ccf1dc7ba4d1180a51487ce8d92047ad | /Stu-SIT206/Stu-SIT206/Base/BaseTableViewController.swift | 214bf7ac6e79d5a8a240c621f49e86aa3c8ec1d1 | [
"Apache-2.0"
] | permissive | cwpu/SIT206 | 59de09800dbdc78ad25576b3bc0c3a016eac9005 | b49f635bfd469780796e7a7904736add19c883c5 | refs/heads/master | 2020-03-17T00:42:58.853346 | 2018-05-25T23:41:35 | 2018-05-25T23:41:35 | 133,121,737 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,816 | swift | //
// BaseTableViewController.swift
// StudentSIT206
//
// Created by Chin Wai Pun on 2018/5/12.
// Copyright © 2018年 cwpu. All rights reserved.
//
import UIKit
class BaseTableViewController: BaseViewController {
var tableView : UITableView?
override func viewDidLoad() {
super.viewDidLoad()
creatUI()
// Do any additional setup after loading the view.
}
func creatUI() {
self.tableView = UITableView(frame: self.view.bounds, style: .plain)
self.tableView?.delegate = self
self.tableView?.dataSource = self
self.view .addSubview(self.tableView!)
self.tableView?.register(UITableViewCell.self, forCellReuseIdentifier: "cell")
self.tableView?.tableFooterView = UIView()
}
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.
}
*/
}
extension BaseTableViewController: UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return 1
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 1
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = UITableViewCell(style: .default, reuseIdentifier: "cell")
return cell
}
}
| [
-1
] |
b3636194efc470d659b16063b5cc01e8f44ff68f | feaf45c8c06a10a840b3ff6075c821a065fdecba | /TNSlider/Sources/TNTrackLayer.swift | c8e246af7a15b1ed91217be8f776ece1c09e81d5 | [
"MIT"
] | permissive | hilalbaig/TNSlider | 283ac0c34bd0a98768c07e3058226cb1ba039456 | 4eedd7396d8b30ef9645bb782a432f8f0bcc3284 | refs/heads/master | 2020-12-27T17:11:32.741020 | 2020-02-03T14:28:02 | 2020-02-03T14:28:02 | 237,984,438 | 0 | 0 | MIT | 2020-02-03T14:27:37 | 2020-02-03T14:27:37 | null | UTF-8 | Swift | false | false | 1,284 | swift | //
// TNTrackLayer.swift
// TNThumbValueSlider
//
// Created by Tien on 6/9/16.
// Copyright © 2016 tiennth. All rights reserved.
//
import UIKit
class TNTrackLayer: CALayer {
var trackMinColor: UIColor = TNConstants.trackMinColor
var trackMaxColor: UIColor = TNConstants.trackMaxColor
var value: Float = 0
var minimumValue: Float = 0
var maximumValue: Float = 1
override func draw(in ctx: CGContext) {
let cornerRadius = bounds.height * 1/2
let range = maximumValue - minimumValue
let thresholdX = bounds.size.width * CGFloat((value - minimumValue) / range)
let trackMinRect = CGRect(x: 0, y: 0, width: thresholdX, height: bounds.size.height)
let trackMinPath = UIBezierPath(roundedRect: trackMinRect, cornerRadius: cornerRadius)
ctx.setFillColor(trackMinColor.cgColor)
ctx.addPath(trackMinPath.cgPath)
ctx.fillPath()
let trackMaxRect = CGRect(x: thresholdX, y: 0, width: bounds.size.width - thresholdX, height: bounds.size.height)
let trackMaxPath = UIBezierPath(roundedRect: trackMaxRect, cornerRadius: cornerRadius)
ctx.setFillColor(trackMaxColor.cgColor)
ctx.addPath(trackMaxPath.cgPath)
ctx.fillPath()
}
}
| [
-1
] |
fd5049ddcff632dfe6c3f46a8b4004869a9d65e9 | 8f384f6fd6aaac1400b5977d70371b21d216dff8 | /ecodatum-ios-client/Utilities/DateFormatter.swift | 091af7b85fd902864137ad10993900030b092845 | [] | no_license | kwingerden/ecodatum-ios-client | 3eb206c3093ed01c747a72d545f603768e772ced | bc144c15a248a810455839d273601bb2cc4d7de1 | refs/heads/master | 2021-09-16T02:53:44.860040 | 2018-06-15T04:32:52 | 2018-06-15T04:32:52 | 115,587,468 | 0 | 1 | null | null | null | null | UTF-8 | Swift | false | false | 447 | swift | import Foundation
extension Formatter {
static let iso8601: ISO8601DateFormatter = {
let formatter = ISO8601DateFormatter()
formatter.formatOptions = [.withInternetDateTime, .withFractionalSeconds]
return formatter
}()
static let basic: DateFormatter = {
let formatter = DateFormatter()
formatter.dateStyle = .medium
formatter.timeStyle = .medium
return formatter
}()
}
| [
-1
] |
3e990dd2430cedb5663826f43054cc97cc3759d1 | d60d507b26d4c905291f95c2497c6c547d2c4f04 | /bk2ch17p704takeAPicture2/ch30p962takeAPicture2/ViewController.swift | 3c09d5d3ad28ab821e1f003ac7ea223293e7452f | [] | no_license | Natarajan-R/Programming-iOS-Book-Examples | 18e6066d09c8861fa63e38b4a891407f370b573d | b6569832e23df6b7719484f66e51dbe6e4bc08d2 | refs/heads/master | 2021-01-12T12:53:08.329703 | 2016-09-28T14:30:23 | 2016-09-28T14:30:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 5,407 | swift |
import UIKit
import AVFoundation
import AVKit
import MobileCoreServices
func imageOfSize(_ size:CGSize, closure:() -> ()) -> UIImage {
let r = UIGraphicsImageRenderer(size:size)
return r.image {
_ in closure()
}
}
extension CGRect {
init(_ x:CGFloat, _ y:CGFloat, _ w:CGFloat, _ h:CGFloat) {
self.init(x:x, y:y, width:w, height:h)
}
}
extension CGSize {
init(_ width:CGFloat, _ height:CGFloat) {
self.init(width:width, height:height)
}
}
extension CGPoint {
init(_ x:CGFloat, _ y:CGFloat) {
self.init(x:x, y:y)
}
}
extension CGVector {
init (_ dx:CGFloat, _ dy:CGFloat) {
self.init(dx:dx, dy:dy)
}
}
class ViewController: UIViewController,
UINavigationControllerDelegate, UIImagePickerControllerDelegate {
@IBOutlet var iv : UIImageView!
@IBOutlet var picker : UIImagePickerController!
@discardableResult
func determineStatus() -> Bool {
let status = AVCaptureDevice.authorizationStatus(forMediaType: AVMediaTypeVideo)
switch status {
case .authorized:
return true
case .notDetermined:
AVCaptureDevice.requestAccess(forMediaType: AVMediaTypeVideo, completionHandler: nil)
return false
case .restricted:
return false
case .denied:
let alert = UIAlertController(
title: "Need Authorization",
message: "Wouldn't you like to authorize this app " +
"to use the camera?",
preferredStyle: .alert)
alert.addAction(UIAlertAction(
title: "No", style: .cancel))
alert.addAction(UIAlertAction(
title: "OK", style: .default) {
_ in
let url = URL(string:UIApplicationOpenSettingsURLString)!
UIApplication.shared.open(url)
})
self.present(alert, animated:true)
return false
}
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
self.determineStatus()
NotificationCenter.default.addObserver(self,
selector: #selector(determineStatus),
name: .UIApplicationWillEnterForeground,
object: nil)
}
@IBAction func doTake (_ sender: Any!) {
let cam = UIImagePickerControllerSourceType.camera
let ok = UIImagePickerController.isSourceTypeAvailable(cam)
if (!ok) {
print("no camera")
return
}
let arr = UIImagePickerController.availableMediaTypes(for: cam)
let desiredType = kUTTypeImage as NSString as String
if arr?.index(of:desiredType) == nil {
print("no stills")
return
}
let picker = MyImagePickerController()
picker.sourceType = .camera
picker.mediaTypes = [desiredType]
picker.allowsEditing = true
picker.delegate = self
picker.showsCameraControls = false
let f = self.view.window!.bounds
let v = UIView(frame:f)
let t = UITapGestureRecognizer(target:self, action:#selector(tap))
t.numberOfTapsRequired = 2
v.addGestureRecognizer(t)
picker.cameraOverlayView = v
self.picker = picker
// user will get the "access the camera" system dialog at this point if necessary
// if the user refuses, Very Weird Things happen...
self.present(picker, animated: true)
}
func imagePickerControllerDidCancel(_ picker: UIImagePickerController) {
self.dismiss(animated:true)
}
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : AnyObject]) {
let im = info[UIImagePickerControllerOriginalImage] as? UIImage
if im == nil {
return
}
let svc = SecondViewController(image:im)
picker.pushViewController(svc, animated: true)
}
func tap (g:UIGestureRecognizer) {
self.picker.takePicture()
}
func navigationController(_ nc: UINavigationController, didShow vc: UIViewController, animated: Bool) {
if vc is SecondViewController {
nc.isToolbarHidden = true
return
}
nc.isToolbarHidden = false
let sz = CGSize(10,10)
let im = imageOfSize(sz) {
UIColor.black().withAlphaComponent(0.1).setFill()
UIGraphicsGetCurrentContext()!.fill(CGRect(origin: .zero, size: sz))
}
nc.toolbar.setBackgroundImage(im, forToolbarPosition: .any, barMetrics: .default)
nc.toolbar.isTranslucent = true
let b = UIBarButtonItem(title: "Cancel", style: .plain, target: self, action: #selector(doCancel))
let lab = UILabel()
lab.text = "Double tap to take a picture"
lab.textColor = .white
lab.backgroundColor = .clear
lab.sizeToFit()
let b2 = UIBarButtonItem(customView: lab)
nc.topViewController!.toolbarItems = [b,b2]
nc.topViewController!.title = "Retake"
}
func doCancel(_ sender: Any) {
self.dismiss(animated:true)
}
func doUse(_ im:UIImage?) {
if im != nil {
self.iv.image = im
}
self.dismiss(animated:true)
}
}
| [
-1
] |
afa7d3e7278dd1932e7fc4b5b67b9526c14672f7 | b2050e6dcec45ffedf8469353a688961eb71998e | /HamadHarisi_Lab19_AutoLayout2/HamadHarisi_Lab19_AutoLayout2UITests/HamadHarisi_Lab19_AutoLayout2UITestsLaunchTests.swift | 64da0e72f06bd1147738b42c7f8d1aecaa0073c4 | [] | no_license | HamadHarisi/lab19-autoLayout2 | 2afab9ab02f681b67d7d2e4aaf8befa69222ce7c | 3ae9af74e7b1ddc57b182bb6cbcfc937182381a5 | refs/heads/main | 2023-08-26T04:56:52.561020 | 2021-11-11T08:11:41 | 2021-11-11T08:11:41 | 426,579,905 | 0 | 0 | null | 2021-11-10T10:32:59 | 2021-11-10T10:32:58 | null | UTF-8 | Swift | false | false | 874 | swift | //
// HamadHarisi_Lab19_AutoLayout2UITestsLaunchTests.swift
// HamadHarisi_Lab19_AutoLayout2UITests
//
// Created by حمد الحريصي on 10/11/2021.
//
import XCTest
class HamadHarisi_Lab19_AutoLayout2UITestsLaunchTests: XCTestCase {
override class var runsForEachTargetApplicationUIConfiguration: Bool {
true
}
override func setUpWithError() throws {
continueAfterFailure = false
}
func testLaunch() throws {
let app = XCUIApplication()
app.launch()
// Insert steps here to perform after app launch but before taking a screenshot,
// such as logging into a test account or navigating somewhere in the app
let attachment = XCTAttachment(screenshot: app.screenshot())
attachment.name = "Launch Screen"
attachment.lifetime = .keepAlways
add(attachment)
}
}
| [
274433,
372737,
43015,
403464,
399371,
436236,
436247,
430119,
430126,
272431,
405553,
378932,
403508,
385077,
163893,
436282,
32828,
376893,
403523,
225348,
352325,
436294,
385096,
399432,
163915,
393292,
368718,
436305,
53333,
104535,
426075,
411739,
272478,
397410,
176230,
221291,
438379,
260205,
395374,
376946,
266360,
211064,
385146,
374912,
381062,
415882,
426123,
381072,
436373,
196759,
200857,
422043,
49309,
362657,
65699,
258212,
436389,
49318,
211122,
377011,
430264,
104634,
266426,
260286,
268480,
133314,
377026,
374985,
164042,
417995,
377034,
436428,
372942,
266448,
368848,
139477,
258264,
268505,
268516,
18662,
379111,
383207,
205033,
149744,
438513,
381174,
135415,
436472,
436481,
375041,
432386,
147715,
260356,
385289,
368907,
395537,
262420,
379156,
391447,
268569,
389405,
268577,
186659,
260395,
358699,
438574,
131375,
418096,
432434,
397619,
358708,
180533,
368948,
266548,
358711,
379194,
14653,
268608,
438593,
270662,
368968,
383310,
180560,
397651,
368983,
389466,
436571,
383326,
418143,
416102,
383337,
110956,
362865,
272754,
438654,
432510,
385406,
385410,
436610,
395652,
436612,
264589,
270734,
385424,
272785,
420242,
385427,
373140,
213401,
194979,
436643,
397733,
385450,
115115,
272814,
176564,
129462,
266683,
436678,
416202,
195022,
416207,
262618,
184798,
369123,
391653,
270822,
432617,
201196,
213487,
360946,
375282,
139765,
393720,
377336,
182778,
262658,
377347,
270852,
432651,
410127,
397840,
385553,
393746,
410137,
258585,
188956,
416287,
377375,
350757,
350760,
377387,
393776,
418353,
375344,
432693,
33338,
266813,
385602,
438851,
375370,
375372,
416333,
426574,
385613,
385619,
416339,
270934,
436830,
260704,
416352,
375395,
268900,
117349,
184939,
176750,
389743,
420462,
184943,
209528,
420472,
422528,
373376,
430723,
166532,
385668,
201349,
369286,
268939,
375439,
377488,
422546,
363156,
264854,
426647,
180887,
213655,
377498,
363162,
363165,
275103,
436898,
176804,
415739,
422568,
176811,
418480,
383669,
160442,
415743,
377532,
377535,
39615,
422592,
412358,
385738,
385746,
385752,
361177,
398040,
436956,
363229,
383709,
436961,
264930,
418530,
369384,
361193,
269035,
373484,
203501,
432882,
21238,
418551,
264952,
203512,
275192,
383739,
197374,
162560,
213761,
197378,
430852,
434955,
62221,
418578,
197397,
426773,
430879,
363296,
197413,
400167,
391981,
189230,
197423,
197427,
191284,
152373,
273208,
377657,
273210,
375611,
430908,
160570,
160577,
416578,
197452,
439117,
416590,
385879,
197466,
435037,
420701,
375645,
381792,
363360,
363363,
412517,
385894,
439146,
420721,
271218,
381810,
392056,
369530,
164731,
398204,
392066,
271236,
369540,
265093,
400263,
387976,
172937,
392072,
424843,
396172,
426893,
400270,
392079,
381841,
224147,
224148,
390035,
430998,
373654,
256921,
377753,
400281,
7069,
381855,
207775,
211872,
185251,
398243,
207784,
422824,
172972,
273328,
271282,
377779,
439227,
273340,
398269,
377788,
398276,
420807,
373704,
273352,
433105,
418775,
386008,
433113,
433117,
418782,
271327,
398304,
418794,
398314,
412652,
187373,
134123,
383981,
435184,
127991,
271352,
183290,
383995,
435196,
271358,
386048,
171010,
410628,
384005,
396293,
377864,
189449,
384014,
433167,
386067,
375847,
410666,
273459,
361523,
412726,
410686,
398404,
404549,
261192,
377928,
361546,
218188,
265304,
439392,
392289,
404583,
265319,
402537,
396394,
265324,
404588,
398445,
138355,
273524,
377973,
222329,
384121,
363642,
392316,
66685,
384126,
392319,
363657,
402569,
140427,
386190,
410771,
144534,
429210,
429215,
265380,
380068,
124074,
367790,
373936,
373938,
367797,
402617,
218300,
40125,
183493,
361669,
402631,
402642,
419027,
259286,
421080,
195810,
414955,
421101,
369911,
271608,
386295,
128250,
363770,
419065,
439549,
412927,
369928,
439564,
414988,
380177,
367896,
419098,
382242,
412964,
271655,
369965,
273712,
382256,
261427,
382263,
212281,
386362,
347452,
193854,
257352,
146761,
378185,
257355,
367949,
259407,
406863,
437586,
367957,
374111,
372065,
271715,
257385,
265578,
388459,
425326,
271727,
386414,
163191,
259448,
421239,
384378,
384392,
388489,
263560,
411027,
370067,
398741,
396696,
370073,
396710,
380330,
374190,
380336,
359859,
421303,
259512,
380349,
200135,
425416,
273866,
413139,
425433,
361959,
271851,
271852,
259568,
116208,
386552,
265721,
187901,
216576,
366082,
437765,
271881,
208396,
146957,
267792,
65042,
413203,
370201,
153114,
423452,
216609,
372262,
431661,
370232,
374328,
163386,
421436,
138816,
396866,
413254,
265799,
273993,
128588,
265808,
396884,
265815,
396888,
179799,
378458,
388700,
396897,
155237,
415333,
384617,
271979,
54896,
403058,
188020,
366199,
210557,
210560,
396928,
370308,
419461,
149126,
194182,
210568,
415370,
214666,
411276,
431755,
267915,
415377,
405139,
274072,
425625,
208546,
405156,
153253,
388776,
210602,
364203,
202414,
421555,
376501,
384694,
272056,
415418,
409276,
110269,
259779,
267977,
409290,
403150,
425681,
274132,
370389,
272086,
155361,
159461,
372459,
397039,
12016,
175875,
161540,
173829,
274181,
409354,
186128,
155409,
395025,
372498,
397077,
366359,
421656,
411416,
435994,
431900,
257832,
167721,
362282,
202540,
399149,
431919,
403247,
421681,
409395,
421687,
204601,
431934,
415554,
409415,
272202,
415565,
431954,
395091,
368472,
425819,
370525,
274275,
382821,
409445,
415591,
425831,
384872,
362350,
417647,
274289,
214897,
372593,
272246,
276342,
417657,
403325,
112511,
372624,
425874,
376734,
204703,
436129,
10152,
415656,
436136,
438187,
362412,
370605,
204723,
362419,
128956,
411588,
151493,
436188,
372700,
403420,
360415,
403424,
436200,
380909,
436210,
432115,
380921,
196603,
268287
] |
90b9896db96c7a74ad621d695109db31a632d1cf | e7c50ede9769c8589aee5b579a5b3e30fbe56f62 | /Sources/AWSSDKSwift/Services/Route53/Route53_API.swift | 06f58394242cca3dac7f83189bc10503d3515ca7 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | MaxDesiatov/aws-sdk-swift | b9beb1c3b138ead04ceafcd90b99ae1dd5109f3a | 9db729752ce3d9922b15071df41f1fdf286a0491 | refs/heads/master | 2020-05-19T08:52:15.517522 | 2019-05-02T18:24:14 | 2019-05-02T18:24:14 | 184,932,832 | 0 | 0 | null | 2019-05-04T18:50:11 | 2019-05-04T18:50:11 | null | UTF-8 | Swift | false | false | 50,002 | swift | // THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/noppoMan/aws-sdk-swift/blob/master/Sources/CodeGenerator/main.swift. DO NOT EDIT.
import Foundation
import AWSSDKSwiftCore
/**
*/
public struct Route53 {
let client: AWSClient
public init(accessKeyId: String? = nil, secretAccessKey: String? = nil, region: AWSSDKSwiftCore.Region? = nil, endpoint: String? = nil) {
self.client = AWSClient(
accessKeyId: accessKeyId,
secretAccessKey: secretAccessKey,
region: region,
service: "route53",
serviceProtocol: ServiceProtocol(type: .restxml),
apiVersion: "2013-04-01",
endpoint: endpoint,
serviceEndpoints: ["aws-global": "route53.amazonaws.com"],
partitionEndpoint: "aws-global",
middlewares: [],
possibleErrorTypes: [Route53ErrorType.self]
)
}
/// Associates an Amazon VPC with a private hosted zone. To perform the association, the VPC and the private hosted zone must already exist. You can't convert a public hosted zone into a private hosted zone. If you want to associate a VPC that was created by using one AWS account with a private hosted zone that was created by using a different account, the AWS account that created the private hosted zone must first submit a CreateVPCAssociationAuthorization request. Then the account that created the VPC must submit an AssociateVPCWithHostedZone request.
public func associateVPCWithHostedZone(_ input: AssociateVPCWithHostedZoneRequest) throws -> AssociateVPCWithHostedZoneResponse {
return try client.send(operation: "AssociateVPCWithHostedZone", path: "/2013-04-01/hostedzone/{Id}/associatevpc", httpMethod: "POST", input: input)
}
/// Creates, changes, or deletes a resource record set, which contains authoritative DNS information for a specified domain name or subdomain name. For example, you can use ChangeResourceRecordSets to create a resource record set that routes traffic for test.example.com to a web server that has an IP address of 192.0.2.44. Change Batches and Transactional Changes The request body must include a document with a ChangeResourceRecordSetsRequest element. The request body contains a list of change items, known as a change batch. Change batches are considered transactional changes. When using the Amazon Route 53 API to change resource record sets, Route 53 either makes all or none of the changes in a change batch request. This ensures that Route 53 never partially implements the intended changes to the resource record sets in a hosted zone. For example, a change batch request that deletes the CNAME record for www.example.com and creates an alias resource record set for www.example.com. Route 53 deletes the first resource record set and creates the second resource record set in a single operation. If either the DELETE or the CREATE action fails, then both changes (plus any other changes in the batch) fail, and the original CNAME record continues to exist. Due to the nature of transactional changes, you can't delete the same resource record set more than once in a single change batch. If you attempt to delete the same change batch more than once, Route 53 returns an InvalidChangeBatch error. Traffic Flow To create resource record sets for complex routing configurations, use either the traffic flow visual editor in the Route 53 console or the API actions for traffic policies and traffic policy instances. Save the configuration as a traffic policy, then associate the traffic policy with one or more domain names (such as example.com) or subdomain names (such as www.example.com), in the same hosted zone or in multiple hosted zones. You can roll back the updates if the new configuration isn't performing as expected. For more information, see Using Traffic Flow to Route DNS Traffic in the Amazon Route 53 Developer Guide. Create, Delete, and Upsert Use ChangeResourceRecordsSetsRequest to perform the following actions: CREATE: Creates a resource record set that has the specified values. DELETE: Deletes an existing resource record set that has the specified values. UPSERT: If a resource record set does not already exist, AWS creates it. If a resource set does exist, Route 53 updates it with the values in the request. Syntaxes for Creating, Updating, and Deleting Resource Record Sets The syntax for a request depends on the type of resource record set that you want to create, delete, or update, such as weighted, alias, or failover. The XML elements in your request must appear in the order listed in the syntax. For an example for each type of resource record set, see "Examples." Don't refer to the syntax in the "Parameter Syntax" section, which includes all of the elements for every kind of resource record set that you can create, delete, or update by using ChangeResourceRecordSets. Change Propagation to Route 53 DNS Servers When you submit a ChangeResourceRecordSets request, Route 53 propagates your changes to all of the Route 53 authoritative DNS servers. While your changes are propagating, GetChange returns a status of PENDING. When propagation is complete, GetChange returns a status of INSYNC. Changes generally propagate to all Route 53 name servers within 60 seconds. For more information, see GetChange. Limits on ChangeResourceRecordSets Requests For information about the limits on a ChangeResourceRecordSets request, see Limits in the Amazon Route 53 Developer Guide.
public func changeResourceRecordSets(_ input: ChangeResourceRecordSetsRequest) throws -> ChangeResourceRecordSetsResponse {
return try client.send(operation: "ChangeResourceRecordSets", path: "/2013-04-01/hostedzone/{Id}/rrset/", httpMethod: "POST", input: input)
}
/// Adds, edits, or deletes tags for a health check or a hosted zone. For information about using tags for cost allocation, see Using Cost Allocation Tags in the AWS Billing and Cost Management User Guide.
public func changeTagsForResource(_ input: ChangeTagsForResourceRequest) throws -> ChangeTagsForResourceResponse {
return try client.send(operation: "ChangeTagsForResource", path: "/2013-04-01/tags/{ResourceType}/{ResourceId}", httpMethod: "POST", input: input)
}
/// Creates a new health check. For information about adding health checks to resource record sets, see ResourceRecordSet$HealthCheckId in ChangeResourceRecordSets. ELB Load Balancers If you're registering EC2 instances with an Elastic Load Balancing (ELB) load balancer, do not create Amazon Route 53 health checks for the EC2 instances. When you register an EC2 instance with a load balancer, you configure settings for an ELB health check, which performs a similar function to a Route 53 health check. Private Hosted Zones You can associate health checks with failover resource record sets in a private hosted zone. Note the following: Route 53 health checkers are outside the VPC. To check the health of an endpoint within a VPC by IP address, you must assign a public IP address to the instance in the VPC. You can configure a health checker to check the health of an external resource that the instance relies on, such as a database server. You can create a CloudWatch metric, associate an alarm with the metric, and then create a health check that is based on the state of the alarm. For example, you might create a CloudWatch metric that checks the status of the Amazon EC2 StatusCheckFailed metric, add an alarm to the metric, and then create a health check that is based on the state of the alarm. For information about creating CloudWatch metrics and alarms by using the CloudWatch console, see the Amazon CloudWatch User Guide.
public func createHealthCheck(_ input: CreateHealthCheckRequest) throws -> CreateHealthCheckResponse {
return try client.send(operation: "CreateHealthCheck", path: "/2013-04-01/healthcheck", httpMethod: "POST", input: input)
}
/// Creates a new public or private hosted zone. You create records in a public hosted zone to define how you want to route traffic on the internet for a domain, such as example.com, and its subdomains (apex.example.com, acme.example.com). You create records in a private hosted zone to define how you want to route traffic for a domain and its subdomains within one or more Amazon Virtual Private Clouds (Amazon VPCs). You can't convert a public hosted zone to a private hosted zone or vice versa. Instead, you must create a new hosted zone with the same name and create new resource record sets. For more information about charges for hosted zones, see Amazon Route 53 Pricing. Note the following: You can't create a hosted zone for a top-level domain (TLD) such as .com. For public hosted zones, Amazon Route 53 automatically creates a default SOA record and four NS records for the zone. For more information about SOA and NS records, see NS and SOA Records that Route 53 Creates for a Hosted Zone in the Amazon Route 53 Developer Guide. If you want to use the same name servers for multiple public hosted zones, you can optionally associate a reusable delegation set with the hosted zone. See the DelegationSetId element. If your domain is registered with a registrar other than Route 53, you must update the name servers with your registrar to make Route 53 the DNS service for the domain. For more information, see Migrating DNS Service for an Existing Domain to Amazon Route 53 in the Amazon Route 53 Developer Guide. When you submit a CreateHostedZone request, the initial status of the hosted zone is PENDING. For public hosted zones, this means that the NS and SOA records are not yet available on all Route 53 DNS servers. When the NS and SOA records are available, the status of the zone changes to INSYNC.
public func createHostedZone(_ input: CreateHostedZoneRequest) throws -> CreateHostedZoneResponse {
return try client.send(operation: "CreateHostedZone", path: "/2013-04-01/hostedzone", httpMethod: "POST", input: input)
}
/// Creates a configuration for DNS query logging. After you create a query logging configuration, Amazon Route 53 begins to publish log data to an Amazon CloudWatch Logs log group. DNS query logs contain information about the queries that Route 53 receives for a specified public hosted zone, such as the following: Route 53 edge location that responded to the DNS query Domain or subdomain that was requested DNS record type, such as A or AAAA DNS response code, such as NoError or ServFail Log Group and Resource Policy Before you create a query logging configuration, perform the following operations. If you create a query logging configuration using the Route 53 console, Route 53 performs these operations automatically. Create a CloudWatch Logs log group, and make note of the ARN, which you specify when you create a query logging configuration. Note the following: You must create the log group in the us-east-1 region. You must use the same AWS account to create the log group and the hosted zone that you want to configure query logging for. When you create log groups for query logging, we recommend that you use a consistent prefix, for example: /aws/route53/hosted zone name In the next step, you'll create a resource policy, which controls access to one or more log groups and the associated AWS resources, such as Route 53 hosted zones. There's a limit on the number of resource policies that you can create, so we recommend that you use a consistent prefix so you can use the same resource policy for all the log groups that you create for query logging. Create a CloudWatch Logs resource policy, and give it the permissions that Route 53 needs to create log streams and to send query logs to log streams. For the value of Resource, specify the ARN for the log group that you created in the previous step. To use the same resource policy for all the CloudWatch Logs log groups that you created for query logging configurations, replace the hosted zone name with *, for example: arn:aws:logs:us-east-1:123412341234:log-group:/aws/route53/* You can't use the CloudWatch console to create or edit a resource policy. You must use the CloudWatch API, one of the AWS SDKs, or the AWS CLI. Log Streams and Edge Locations When Route 53 finishes creating the configuration for DNS query logging, it does the following: Creates a log stream for an edge location the first time that the edge location responds to DNS queries for the specified hosted zone. That log stream is used to log all queries that Route 53 responds to for that edge location. Begins to send query logs to the applicable log stream. The name of each log stream is in the following format: hosted zone ID/edge location code The edge location code is a three-letter code and an arbitrarily assigned number, for example, DFW3. The three-letter code typically corresponds with the International Air Transport Association airport code for an airport near the edge location. (These abbreviations might change in the future.) For a list of edge locations, see "The Route 53 Global Network" on the Route 53 Product Details page. Queries That Are Logged Query logs contain only the queries that DNS resolvers forward to Route 53. If a DNS resolver has already cached the response to a query (such as the IP address for a load balancer for example.com), the resolver will continue to return the cached response. It doesn't forward another query to Route 53 until the TTL for the corresponding resource record set expires. Depending on how many DNS queries are submitted for a resource record set, and depending on the TTL for that resource record set, query logs might contain information about only one query out of every several thousand queries that are submitted to DNS. For more information about how DNS works, see Routing Internet Traffic to Your Website or Web Application in the Amazon Route 53 Developer Guide. Log File Format For a list of the values in each query log and the format of each value, see Logging DNS Queries in the Amazon Route 53 Developer Guide. Pricing For information about charges for query logs, see Amazon CloudWatch Pricing. How to Stop Logging If you want Route 53 to stop sending query logs to CloudWatch Logs, delete the query logging configuration. For more information, see DeleteQueryLoggingConfig.
public func createQueryLoggingConfig(_ input: CreateQueryLoggingConfigRequest) throws -> CreateQueryLoggingConfigResponse {
return try client.send(operation: "CreateQueryLoggingConfig", path: "/2013-04-01/queryloggingconfig", httpMethod: "POST", input: input)
}
/// Creates a delegation set (a group of four name servers) that can be reused by multiple hosted zones. If a hosted zoned ID is specified, CreateReusableDelegationSet marks the delegation set associated with that zone as reusable. You can't associate a reusable delegation set with a private hosted zone. For information about using a reusable delegation set to configure white label name servers, see Configuring White Label Name Servers. The process for migrating existing hosted zones to use a reusable delegation set is comparable to the process for configuring white label name servers. You need to perform the following steps: Create a reusable delegation set. Recreate hosted zones, and reduce the TTL to 60 seconds or less. Recreate resource record sets in the new hosted zones. Change the registrar's name servers to use the name servers for the new hosted zones. Monitor traffic for the website or application. Change TTLs back to their original values. If you want to migrate existing hosted zones to use a reusable delegation set, the existing hosted zones can't use any of the name servers that are assigned to the reusable delegation set. If one or more hosted zones do use one or more name servers that are assigned to the reusable delegation set, you can do one of the following: For small numbers of hosted zones—up to a few hundred—it's relatively easy to create reusable delegation sets until you get one that has four name servers that don't overlap with any of the name servers in your hosted zones. For larger numbers of hosted zones, the easiest solution is to use more than one reusable delegation set. For larger numbers of hosted zones, you can also migrate hosted zones that have overlapping name servers to hosted zones that don't have overlapping name servers, then migrate the hosted zones again to use the reusable delegation set.
public func createReusableDelegationSet(_ input: CreateReusableDelegationSetRequest) throws -> CreateReusableDelegationSetResponse {
return try client.send(operation: "CreateReusableDelegationSet", path: "/2013-04-01/delegationset", httpMethod: "POST", input: input)
}
/// Creates a traffic policy, which you use to create multiple DNS resource record sets for one domain name (such as example.com) or one subdomain name (such as www.example.com).
public func createTrafficPolicy(_ input: CreateTrafficPolicyRequest) throws -> CreateTrafficPolicyResponse {
return try client.send(operation: "CreateTrafficPolicy", path: "/2013-04-01/trafficpolicy", httpMethod: "POST", input: input)
}
/// Creates resource record sets in a specified hosted zone based on the settings in a specified traffic policy version. In addition, CreateTrafficPolicyInstance associates the resource record sets with a specified domain name (such as example.com) or subdomain name (such as www.example.com). Amazon Route 53 responds to DNS queries for the domain or subdomain name by using the resource record sets that CreateTrafficPolicyInstance created.
public func createTrafficPolicyInstance(_ input: CreateTrafficPolicyInstanceRequest) throws -> CreateTrafficPolicyInstanceResponse {
return try client.send(operation: "CreateTrafficPolicyInstance", path: "/2013-04-01/trafficpolicyinstance", httpMethod: "POST", input: input)
}
/// Creates a new version of an existing traffic policy. When you create a new version of a traffic policy, you specify the ID of the traffic policy that you want to update and a JSON-formatted document that describes the new version. You use traffic policies to create multiple DNS resource record sets for one domain name (such as example.com) or one subdomain name (such as www.example.com). You can create a maximum of 1000 versions of a traffic policy. If you reach the limit and need to create another version, you'll need to start a new traffic policy.
public func createTrafficPolicyVersion(_ input: CreateTrafficPolicyVersionRequest) throws -> CreateTrafficPolicyVersionResponse {
return try client.send(operation: "CreateTrafficPolicyVersion", path: "/2013-04-01/trafficpolicy/{Id}", httpMethod: "POST", input: input)
}
/// Authorizes the AWS account that created a specified VPC to submit an AssociateVPCWithHostedZone request to associate the VPC with a specified hosted zone that was created by a different account. To submit a CreateVPCAssociationAuthorization request, you must use the account that created the hosted zone. After you authorize the association, use the account that created the VPC to submit an AssociateVPCWithHostedZone request. If you want to associate multiple VPCs that you created by using one account with a hosted zone that you created by using a different account, you must submit one authorization request for each VPC.
public func createVPCAssociationAuthorization(_ input: CreateVPCAssociationAuthorizationRequest) throws -> CreateVPCAssociationAuthorizationResponse {
return try client.send(operation: "CreateVPCAssociationAuthorization", path: "/2013-04-01/hostedzone/{Id}/authorizevpcassociation", httpMethod: "POST", input: input)
}
/// Deletes a health check. Amazon Route 53 does not prevent you from deleting a health check even if the health check is associated with one or more resource record sets. If you delete a health check and you don't update the associated resource record sets, the future status of the health check can't be predicted and may change. This will affect the routing of DNS queries for your DNS failover configuration. For more information, see Replacing and Deleting Health Checks in the Amazon Route 53 Developer Guide.
public func deleteHealthCheck(_ input: DeleteHealthCheckRequest) throws -> DeleteHealthCheckResponse {
return try client.send(operation: "DeleteHealthCheck", path: "/2013-04-01/healthcheck/{HealthCheckId}", httpMethod: "DELETE", input: input)
}
/// Deletes a hosted zone. If the name servers for the hosted zone are associated with a domain and if you want to make the domain unavailable on the Internet, we recommend that you delete the name servers from the domain to prevent future DNS queries from possibly being misrouted. If the domain is registered with Amazon Route 53, see UpdateDomainNameservers. If the domain is registered with another registrar, use the method provided by the registrar to delete name servers for the domain. Some domain registries don't allow you to remove all of the name servers for a domain. If the registry for your domain requires one or more name servers, we recommend that you delete the hosted zone only if you transfer DNS service to another service provider, and you replace the name servers for the domain with name servers from the new provider. You can delete a hosted zone only if it contains only the default SOA record and NS resource record sets. If the hosted zone contains other resource record sets, you must delete them before you can delete the hosted zone. If you try to delete a hosted zone that contains other resource record sets, the request fails, and Route 53 returns a HostedZoneNotEmpty error. For information about deleting records from your hosted zone, see ChangeResourceRecordSets. To verify that the hosted zone has been deleted, do one of the following: Use the GetHostedZone action to request information about the hosted zone. Use the ListHostedZones action to get a list of the hosted zones associated with the current AWS account.
public func deleteHostedZone(_ input: DeleteHostedZoneRequest) throws -> DeleteHostedZoneResponse {
return try client.send(operation: "DeleteHostedZone", path: "/2013-04-01/hostedzone/{Id}", httpMethod: "DELETE", input: input)
}
/// Deletes a configuration for DNS query logging. If you delete a configuration, Amazon Route 53 stops sending query logs to CloudWatch Logs. Route 53 doesn't delete any logs that are already in CloudWatch Logs. For more information about DNS query logs, see CreateQueryLoggingConfig.
public func deleteQueryLoggingConfig(_ input: DeleteQueryLoggingConfigRequest) throws -> DeleteQueryLoggingConfigResponse {
return try client.send(operation: "DeleteQueryLoggingConfig", path: "/2013-04-01/queryloggingconfig/{Id}", httpMethod: "DELETE", input: input)
}
/// Deletes a reusable delegation set. You can delete a reusable delegation set only if it isn't associated with any hosted zones. To verify that the reusable delegation set is not associated with any hosted zones, submit a GetReusableDelegationSet request and specify the ID of the reusable delegation set that you want to delete.
public func deleteReusableDelegationSet(_ input: DeleteReusableDelegationSetRequest) throws -> DeleteReusableDelegationSetResponse {
return try client.send(operation: "DeleteReusableDelegationSet", path: "/2013-04-01/delegationset/{Id}", httpMethod: "DELETE", input: input)
}
/// Deletes a traffic policy.
public func deleteTrafficPolicy(_ input: DeleteTrafficPolicyRequest) throws -> DeleteTrafficPolicyResponse {
return try client.send(operation: "DeleteTrafficPolicy", path: "/2013-04-01/trafficpolicy/{Id}/{Version}", httpMethod: "DELETE", input: input)
}
/// Deletes a traffic policy instance and all of the resource record sets that Amazon Route 53 created when you created the instance. In the Route 53 console, traffic policy instances are known as policy records.
public func deleteTrafficPolicyInstance(_ input: DeleteTrafficPolicyInstanceRequest) throws -> DeleteTrafficPolicyInstanceResponse {
return try client.send(operation: "DeleteTrafficPolicyInstance", path: "/2013-04-01/trafficpolicyinstance/{Id}", httpMethod: "DELETE", input: input)
}
/// Removes authorization to submit an AssociateVPCWithHostedZone request to associate a specified VPC with a hosted zone that was created by a different account. You must use the account that created the hosted zone to submit a DeleteVPCAssociationAuthorization request. Sending this request only prevents the AWS account that created the VPC from associating the VPC with the Amazon Route 53 hosted zone in the future. If the VPC is already associated with the hosted zone, DeleteVPCAssociationAuthorization won't disassociate the VPC from the hosted zone. If you want to delete an existing association, use DisassociateVPCFromHostedZone.
public func deleteVPCAssociationAuthorization(_ input: DeleteVPCAssociationAuthorizationRequest) throws -> DeleteVPCAssociationAuthorizationResponse {
return try client.send(operation: "DeleteVPCAssociationAuthorization", path: "/2013-04-01/hostedzone/{Id}/deauthorizevpcassociation", httpMethod: "POST", input: input)
}
/// Disassociates a VPC from a Amazon Route 53 private hosted zone. Note the following: You can't disassociate the last VPC from a private hosted zone. You can't convert a private hosted zone into a public hosted zone. You can submit a DisassociateVPCFromHostedZone request using either the account that created the hosted zone or the account that created the VPC.
public func disassociateVPCFromHostedZone(_ input: DisassociateVPCFromHostedZoneRequest) throws -> DisassociateVPCFromHostedZoneResponse {
return try client.send(operation: "DisassociateVPCFromHostedZone", path: "/2013-04-01/hostedzone/{Id}/disassociatevpc", httpMethod: "POST", input: input)
}
/// Gets the specified limit for the current account, for example, the maximum number of health checks that you can create using the account. For the default limit, see Limits in the Amazon Route 53 Developer Guide. To request a higher limit, open a case.
public func getAccountLimit(_ input: GetAccountLimitRequest) throws -> GetAccountLimitResponse {
return try client.send(operation: "GetAccountLimit", path: "/2013-04-01/accountlimit/{Type}", httpMethod: "GET", input: input)
}
/// Returns the current status of a change batch request. The status is one of the following values: PENDING indicates that the changes in this request have not propagated to all Amazon Route 53 DNS servers. This is the initial status of all change batch requests. INSYNC indicates that the changes have propagated to all Route 53 DNS servers.
public func getChange(_ input: GetChangeRequest) throws -> GetChangeResponse {
return try client.send(operation: "GetChange", path: "/2013-04-01/change/{Id}", httpMethod: "GET", input: input)
}
/// GetCheckerIpRanges still works, but we recommend that you download ip-ranges.json, which includes IP address ranges for all AWS services. For more information, see IP Address Ranges of Amazon Route 53 Servers in the Amazon Route 53 Developer Guide.
public func getCheckerIpRanges(_ input: GetCheckerIpRangesRequest) throws -> GetCheckerIpRangesResponse {
return try client.send(operation: "GetCheckerIpRanges", path: "/2013-04-01/checkeripranges", httpMethod: "GET", input: input)
}
/// Gets information about whether a specified geographic location is supported for Amazon Route 53 geolocation resource record sets. Use the following syntax to determine whether a continent is supported for geolocation: GET /2013-04-01/geolocation?continentcode=two-letter abbreviation for a continent Use the following syntax to determine whether a country is supported for geolocation: GET /2013-04-01/geolocation?countrycode=two-character country code Use the following syntax to determine whether a subdivision of a country is supported for geolocation: GET /2013-04-01/geolocation?countrycode=two-character country code&subdivisioncode=subdivision code
public func getGeoLocation(_ input: GetGeoLocationRequest) throws -> GetGeoLocationResponse {
return try client.send(operation: "GetGeoLocation", path: "/2013-04-01/geolocation", httpMethod: "GET", input: input)
}
/// Gets information about a specified health check.
public func getHealthCheck(_ input: GetHealthCheckRequest) throws -> GetHealthCheckResponse {
return try client.send(operation: "GetHealthCheck", path: "/2013-04-01/healthcheck/{HealthCheckId}", httpMethod: "GET", input: input)
}
/// Retrieves the number of health checks that are associated with the current AWS account.
public func getHealthCheckCount(_ input: GetHealthCheckCountRequest) throws -> GetHealthCheckCountResponse {
return try client.send(operation: "GetHealthCheckCount", path: "/2013-04-01/healthcheckcount", httpMethod: "GET", input: input)
}
/// Gets the reason that a specified health check failed most recently.
public func getHealthCheckLastFailureReason(_ input: GetHealthCheckLastFailureReasonRequest) throws -> GetHealthCheckLastFailureReasonResponse {
return try client.send(operation: "GetHealthCheckLastFailureReason", path: "/2013-04-01/healthcheck/{HealthCheckId}/lastfailurereason", httpMethod: "GET", input: input)
}
/// Gets status of a specified health check.
public func getHealthCheckStatus(_ input: GetHealthCheckStatusRequest) throws -> GetHealthCheckStatusResponse {
return try client.send(operation: "GetHealthCheckStatus", path: "/2013-04-01/healthcheck/{HealthCheckId}/status", httpMethod: "GET", input: input)
}
/// Gets information about a specified hosted zone including the four name servers assigned to the hosted zone.
public func getHostedZone(_ input: GetHostedZoneRequest) throws -> GetHostedZoneResponse {
return try client.send(operation: "GetHostedZone", path: "/2013-04-01/hostedzone/{Id}", httpMethod: "GET", input: input)
}
/// Retrieves the number of hosted zones that are associated with the current AWS account.
public func getHostedZoneCount(_ input: GetHostedZoneCountRequest) throws -> GetHostedZoneCountResponse {
return try client.send(operation: "GetHostedZoneCount", path: "/2013-04-01/hostedzonecount", httpMethod: "GET", input: input)
}
/// Gets the specified limit for a specified hosted zone, for example, the maximum number of records that you can create in the hosted zone. For the default limit, see Limits in the Amazon Route 53 Developer Guide. To request a higher limit, open a case.
public func getHostedZoneLimit(_ input: GetHostedZoneLimitRequest) throws -> GetHostedZoneLimitResponse {
return try client.send(operation: "GetHostedZoneLimit", path: "/2013-04-01/hostedzonelimit/{Id}/{Type}", httpMethod: "GET", input: input)
}
/// Gets information about a specified configuration for DNS query logging. For more information about DNS query logs, see CreateQueryLoggingConfig and Logging DNS Queries.
public func getQueryLoggingConfig(_ input: GetQueryLoggingConfigRequest) throws -> GetQueryLoggingConfigResponse {
return try client.send(operation: "GetQueryLoggingConfig", path: "/2013-04-01/queryloggingconfig/{Id}", httpMethod: "GET", input: input)
}
/// Retrieves information about a specified reusable delegation set, including the four name servers that are assigned to the delegation set.
public func getReusableDelegationSet(_ input: GetReusableDelegationSetRequest) throws -> GetReusableDelegationSetResponse {
return try client.send(operation: "GetReusableDelegationSet", path: "/2013-04-01/delegationset/{Id}", httpMethod: "GET", input: input)
}
/// Gets the maximum number of hosted zones that you can associate with the specified reusable delegation set. For the default limit, see Limits in the Amazon Route 53 Developer Guide. To request a higher limit, open a case.
public func getReusableDelegationSetLimit(_ input: GetReusableDelegationSetLimitRequest) throws -> GetReusableDelegationSetLimitResponse {
return try client.send(operation: "GetReusableDelegationSetLimit", path: "/2013-04-01/reusabledelegationsetlimit/{Id}/{Type}", httpMethod: "GET", input: input)
}
/// Gets information about a specific traffic policy version.
public func getTrafficPolicy(_ input: GetTrafficPolicyRequest) throws -> GetTrafficPolicyResponse {
return try client.send(operation: "GetTrafficPolicy", path: "/2013-04-01/trafficpolicy/{Id}/{Version}", httpMethod: "GET", input: input)
}
/// Gets information about a specified traffic policy instance. After you submit a CreateTrafficPolicyInstance or an UpdateTrafficPolicyInstance request, there's a brief delay while Amazon Route 53 creates the resource record sets that are specified in the traffic policy definition. For more information, see the State response element. In the Route 53 console, traffic policy instances are known as policy records.
public func getTrafficPolicyInstance(_ input: GetTrafficPolicyInstanceRequest) throws -> GetTrafficPolicyInstanceResponse {
return try client.send(operation: "GetTrafficPolicyInstance", path: "/2013-04-01/trafficpolicyinstance/{Id}", httpMethod: "GET", input: input)
}
/// Gets the number of traffic policy instances that are associated with the current AWS account.
public func getTrafficPolicyInstanceCount(_ input: GetTrafficPolicyInstanceCountRequest) throws -> GetTrafficPolicyInstanceCountResponse {
return try client.send(operation: "GetTrafficPolicyInstanceCount", path: "/2013-04-01/trafficpolicyinstancecount", httpMethod: "GET", input: input)
}
/// Retrieves a list of supported geographic locations. Countries are listed first, and continents are listed last. If Amazon Route 53 supports subdivisions for a country (for example, states or provinces), the subdivisions for that country are listed in alphabetical order immediately after the corresponding country.
public func listGeoLocations(_ input: ListGeoLocationsRequest) throws -> ListGeoLocationsResponse {
return try client.send(operation: "ListGeoLocations", path: "/2013-04-01/geolocations", httpMethod: "GET", input: input)
}
/// Retrieve a list of the health checks that are associated with the current AWS account.
public func listHealthChecks(_ input: ListHealthChecksRequest) throws -> ListHealthChecksResponse {
return try client.send(operation: "ListHealthChecks", path: "/2013-04-01/healthcheck", httpMethod: "GET", input: input)
}
/// Retrieves a list of the public and private hosted zones that are associated with the current AWS account. The response includes a HostedZones child element for each hosted zone. Amazon Route 53 returns a maximum of 100 items in each response. If you have a lot of hosted zones, you can use the maxitems parameter to list them in groups of up to 100.
public func listHostedZones(_ input: ListHostedZonesRequest) throws -> ListHostedZonesResponse {
return try client.send(operation: "ListHostedZones", path: "/2013-04-01/hostedzone", httpMethod: "GET", input: input)
}
/// Retrieves a list of your hosted zones in lexicographic order. The response includes a HostedZones child element for each hosted zone created by the current AWS account. ListHostedZonesByName sorts hosted zones by name with the labels reversed. For example: com.example.www. Note the trailing dot, which can change the sort order in some circumstances. If the domain name includes escape characters or Punycode, ListHostedZonesByName alphabetizes the domain name using the escaped or Punycoded value, which is the format that Amazon Route 53 saves in its database. For example, to create a hosted zone for exämple.com, you specify ex\344mple.com for the domain name. ListHostedZonesByName alphabetizes it as: com.ex\344mple. The labels are reversed and alphabetized using the escaped value. For more information about valid domain name formats, including internationalized domain names, see DNS Domain Name Format in the Amazon Route 53 Developer Guide. Route 53 returns up to 100 items in each response. If you have a lot of hosted zones, use the MaxItems parameter to list them in groups of up to 100. The response includes values that help navigate from one group of MaxItems hosted zones to the next: The DNSName and HostedZoneId elements in the response contain the values, if any, specified for the dnsname and hostedzoneid parameters in the request that produced the current response. The MaxItems element in the response contains the value, if any, that you specified for the maxitems parameter in the request that produced the current response. If the value of IsTruncated in the response is true, there are more hosted zones associated with the current AWS account. If IsTruncated is false, this response includes the last hosted zone that is associated with the current account. The NextDNSName element and NextHostedZoneId elements are omitted from the response. The NextDNSName and NextHostedZoneId elements in the response contain the domain name and the hosted zone ID of the next hosted zone that is associated with the current AWS account. If you want to list more hosted zones, make another call to ListHostedZonesByName, and specify the value of NextDNSName and NextHostedZoneId in the dnsname and hostedzoneid parameters, respectively.
public func listHostedZonesByName(_ input: ListHostedZonesByNameRequest) throws -> ListHostedZonesByNameResponse {
return try client.send(operation: "ListHostedZonesByName", path: "/2013-04-01/hostedzonesbyname", httpMethod: "GET", input: input)
}
/// Lists the configurations for DNS query logging that are associated with the current AWS account or the configuration that is associated with a specified hosted zone. For more information about DNS query logs, see CreateQueryLoggingConfig. Additional information, including the format of DNS query logs, appears in Logging DNS Queries in the Amazon Route 53 Developer Guide.
public func listQueryLoggingConfigs(_ input: ListQueryLoggingConfigsRequest) throws -> ListQueryLoggingConfigsResponse {
return try client.send(operation: "ListQueryLoggingConfigs", path: "/2013-04-01/queryloggingconfig", httpMethod: "GET", input: input)
}
/// Lists the resource record sets in a specified hosted zone. ListResourceRecordSets returns up to 100 resource record sets at a time in ASCII order, beginning at a position specified by the name and type elements. Sort order ListResourceRecordSets sorts results first by DNS name with the labels reversed, for example: com.example.www. Note the trailing dot, which can change the sort order when the record name contains characters that appear before . (decimal 46) in the ASCII table. These characters include the following: ! " # $ % & ' ( ) * + , - When multiple records have the same DNS name, ListResourceRecordSets sorts results by the record type. Specifying where to start listing records You can use the name and type elements to specify the resource record set that the list begins with: If you do not specify Name or Type The results begin with the first resource record set that the hosted zone contains. If you specify Name but not Type The results begin with the first resource record set in the list whose name is greater than or equal to Name. If you specify Type but not Name Amazon Route 53 returns the InvalidInput error. If you specify both Name and Type The results begin with the first resource record set in the list whose name is greater than or equal to Name, and whose type is greater than or equal to Type. Resource record sets that are PENDING This action returns the most current version of the records. This includes records that are PENDING, and that are not yet available on all Route 53 DNS servers. Changing resource record sets To ensure that you get an accurate listing of the resource record sets for a hosted zone at a point in time, do not submit a ChangeResourceRecordSets request while you're paging through the results of a ListResourceRecordSets request. If you do, some pages may display results without the latest changes while other pages display results with the latest changes. Displaying the next page of results If a ListResourceRecordSets command returns more than one page of results, the value of IsTruncated is true. To display the next page of results, get the values of NextRecordName, NextRecordType, and NextRecordIdentifier (if any) from the response. Then submit another ListResourceRecordSets request, and specify those values for StartRecordName, StartRecordType, and StartRecordIdentifier.
public func listResourceRecordSets(_ input: ListResourceRecordSetsRequest) throws -> ListResourceRecordSetsResponse {
return try client.send(operation: "ListResourceRecordSets", path: "/2013-04-01/hostedzone/{Id}/rrset", httpMethod: "GET", input: input)
}
/// Retrieves a list of the reusable delegation sets that are associated with the current AWS account.
public func listReusableDelegationSets(_ input: ListReusableDelegationSetsRequest) throws -> ListReusableDelegationSetsResponse {
return try client.send(operation: "ListReusableDelegationSets", path: "/2013-04-01/delegationset", httpMethod: "GET", input: input)
}
/// Lists tags for one health check or hosted zone. For information about using tags for cost allocation, see Using Cost Allocation Tags in the AWS Billing and Cost Management User Guide.
public func listTagsForResource(_ input: ListTagsForResourceRequest) throws -> ListTagsForResourceResponse {
return try client.send(operation: "ListTagsForResource", path: "/2013-04-01/tags/{ResourceType}/{ResourceId}", httpMethod: "GET", input: input)
}
/// Lists tags for up to 10 health checks or hosted zones. For information about using tags for cost allocation, see Using Cost Allocation Tags in the AWS Billing and Cost Management User Guide.
public func listTagsForResources(_ input: ListTagsForResourcesRequest) throws -> ListTagsForResourcesResponse {
return try client.send(operation: "ListTagsForResources", path: "/2013-04-01/tags/{ResourceType}", httpMethod: "POST", input: input)
}
/// Gets information about the latest version for every traffic policy that is associated with the current AWS account. Policies are listed in the order that they were created in.
public func listTrafficPolicies(_ input: ListTrafficPoliciesRequest) throws -> ListTrafficPoliciesResponse {
return try client.send(operation: "ListTrafficPolicies", path: "/2013-04-01/trafficpolicies", httpMethod: "GET", input: input)
}
/// Gets information about the traffic policy instances that you created by using the current AWS account. After you submit an UpdateTrafficPolicyInstance request, there's a brief delay while Amazon Route 53 creates the resource record sets that are specified in the traffic policy definition. For more information, see the State response element. Route 53 returns a maximum of 100 items in each response. If you have a lot of traffic policy instances, you can use the MaxItems parameter to list them in groups of up to 100.
public func listTrafficPolicyInstances(_ input: ListTrafficPolicyInstancesRequest) throws -> ListTrafficPolicyInstancesResponse {
return try client.send(operation: "ListTrafficPolicyInstances", path: "/2013-04-01/trafficpolicyinstances", httpMethod: "GET", input: input)
}
/// Gets information about the traffic policy instances that you created in a specified hosted zone. After you submit a CreateTrafficPolicyInstance or an UpdateTrafficPolicyInstance request, there's a brief delay while Amazon Route 53 creates the resource record sets that are specified in the traffic policy definition. For more information, see the State response element. Route 53 returns a maximum of 100 items in each response. If you have a lot of traffic policy instances, you can use the MaxItems parameter to list them in groups of up to 100.
public func listTrafficPolicyInstancesByHostedZone(_ input: ListTrafficPolicyInstancesByHostedZoneRequest) throws -> ListTrafficPolicyInstancesByHostedZoneResponse {
return try client.send(operation: "ListTrafficPolicyInstancesByHostedZone", path: "/2013-04-01/trafficpolicyinstances/hostedzone", httpMethod: "GET", input: input)
}
/// Gets information about the traffic policy instances that you created by using a specify traffic policy version. After you submit a CreateTrafficPolicyInstance or an UpdateTrafficPolicyInstance request, there's a brief delay while Amazon Route 53 creates the resource record sets that are specified in the traffic policy definition. For more information, see the State response element. Route 53 returns a maximum of 100 items in each response. If you have a lot of traffic policy instances, you can use the MaxItems parameter to list them in groups of up to 100.
public func listTrafficPolicyInstancesByPolicy(_ input: ListTrafficPolicyInstancesByPolicyRequest) throws -> ListTrafficPolicyInstancesByPolicyResponse {
return try client.send(operation: "ListTrafficPolicyInstancesByPolicy", path: "/2013-04-01/trafficpolicyinstances/trafficpolicy", httpMethod: "GET", input: input)
}
/// Gets information about all of the versions for a specified traffic policy. Traffic policy versions are listed in numerical order by VersionNumber.
public func listTrafficPolicyVersions(_ input: ListTrafficPolicyVersionsRequest) throws -> ListTrafficPolicyVersionsResponse {
return try client.send(operation: "ListTrafficPolicyVersions", path: "/2013-04-01/trafficpolicies/{Id}/versions", httpMethod: "GET", input: input)
}
/// Gets a list of the VPCs that were created by other accounts and that can be associated with a specified hosted zone because you've submitted one or more CreateVPCAssociationAuthorization requests. The response includes a VPCs element with a VPC child element for each VPC that can be associated with the hosted zone.
public func listVPCAssociationAuthorizations(_ input: ListVPCAssociationAuthorizationsRequest) throws -> ListVPCAssociationAuthorizationsResponse {
return try client.send(operation: "ListVPCAssociationAuthorizations", path: "/2013-04-01/hostedzone/{Id}/authorizevpcassociation", httpMethod: "GET", input: input)
}
/// Gets the value that Amazon Route 53 returns in response to a DNS request for a specified record name and type. You can optionally specify the IP address of a DNS resolver, an EDNS0 client subnet IP address, and a subnet mask.
public func testDNSAnswer(_ input: TestDNSAnswerRequest) throws -> TestDNSAnswerResponse {
return try client.send(operation: "TestDNSAnswer", path: "/2013-04-01/testdnsanswer", httpMethod: "GET", input: input)
}
/// Updates an existing health check. Note that some values can't be updated. For more information about updating health checks, see Creating, Updating, and Deleting Health Checks in the Amazon Route 53 Developer Guide.
public func updateHealthCheck(_ input: UpdateHealthCheckRequest) throws -> UpdateHealthCheckResponse {
return try client.send(operation: "UpdateHealthCheck", path: "/2013-04-01/healthcheck/{HealthCheckId}", httpMethod: "POST", input: input)
}
/// Updates the comment for a specified hosted zone.
public func updateHostedZoneComment(_ input: UpdateHostedZoneCommentRequest) throws -> UpdateHostedZoneCommentResponse {
return try client.send(operation: "UpdateHostedZoneComment", path: "/2013-04-01/hostedzone/{Id}", httpMethod: "POST", input: input)
}
/// Updates the comment for a specified traffic policy version.
public func updateTrafficPolicyComment(_ input: UpdateTrafficPolicyCommentRequest) throws -> UpdateTrafficPolicyCommentResponse {
return try client.send(operation: "UpdateTrafficPolicyComment", path: "/2013-04-01/trafficpolicy/{Id}/{Version}", httpMethod: "POST", input: input)
}
/// Updates the resource record sets in a specified hosted zone that were created based on the settings in a specified traffic policy version. When you update a traffic policy instance, Amazon Route 53 continues to respond to DNS queries for the root resource record set name (such as example.com) while it replaces one group of resource record sets with another. Route 53 performs the following operations: Route 53 creates a new group of resource record sets based on the specified traffic policy. This is true regardless of how significant the differences are between the existing resource record sets and the new resource record sets. When all of the new resource record sets have been created, Route 53 starts to respond to DNS queries for the root resource record set name (such as example.com) by using the new resource record sets. Route 53 deletes the old group of resource record sets that are associated with the root resource record set name.
public func updateTrafficPolicyInstance(_ input: UpdateTrafficPolicyInstanceRequest) throws -> UpdateTrafficPolicyInstanceResponse {
return try client.send(operation: "UpdateTrafficPolicyInstance", path: "/2013-04-01/trafficpolicyinstance/{Id}", httpMethod: "POST", input: input)
}
} | [
-1
] |
1d99405782b4865714491538ae610b84511653b2 | bd932cc434274fdbaccf37100e63250c90278f3a | /agFarm/ViewController/Satellite/WeatherInfoCell.swift | 0539a3190177a04176b7dd72ace8d63ae535e9c9 | [] | no_license | ganeshkadu/AgFarm | 5df353aac1a8882fd230c4a19133ab08c88efc68 | 280aa0a25788dc21568056b29a59bf4091ba4746 | refs/heads/master | 2020-08-01T02:23:45.562947 | 2019-10-31T06:03:23 | 2019-10-31T06:03:23 | 210,827,131 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 361 | swift | //
// WeatherInfoCell.swift
// agFarm
//
// Created by shashikant kadgi on 18/09/19.
// Copyright © 2019 shashikant kadgi. All rights reserved.
//
import UIKit
class WeatherInfoCell: UICollectionViewCell {
@IBOutlet weak var cardEffect: UIView!
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
}
| [
-1
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.