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
dc345c6643cc74d116df7fa9da41b193142615ef
22e4e03c7610e6ca94456a613af4cf723b31a03b
/omni/Model/FetchOrCreatable.swift
b70c49ff59849def99b72bbaa29d610a7bdfa3d5
[]
no_license
RebeccaElliceHsiao/ItemsChatRoom
9e30a3b5dbe04f0e0d1d0a3c4764f3b8a0c6fed8
bd66de184b7b8bfd1a5c4505f37e2196b64a12b7
refs/heads/master
2020-03-18T16:17:47.613127
2018-05-26T19:18:45
2018-05-26T19:18:45
134,957,466
0
0
null
null
null
null
UTF-8
Swift
false
false
2,313
swift
// // FetchOrCreatable.swift // omni // // Created by Rebecca Hsiao on 2018/05/06. // Copyright © 2018年 Rebecca Hsiao. All rights reserved. // import Foundation import UIKit import CoreData protocol HasID { var id: String { get set } } protocol Parseable { func parse(dict: [String: Any]) } protocol FetchOrCreatable: class, HasID, Parseable { associatedtype T: NSManagedObject, HasID, Parseable static func fetch(with ID: String) -> T? static func fetchOrCreate(with dict: [String: Any]) -> T? static func fetchOrCreate(with ID: String) -> T } extension FetchOrCreatable { static func fetch(with ID: String) -> T? { let className = String(describing: type(of: self)).split(separator: ".").first ?? "" let request = NSFetchRequest<T>(entityName: String(className)) request.predicate = NSPredicate(format: "id == %@", ID) let context = CoreDataManager.shared.context let fetchedObjects = try! context?.fetch(request) if let first = fetchedObjects?.first { return first } return nil } @discardableResult static func fetchOrCreate(with ID: String) -> T { if let object = self.fetch(with: ID) { return object } else { let className = String(describing: type(of: self)).split(separator: ".").first ?? "" var newT = NSEntityDescription.insertNewObject(forEntityName: String(className), into: CoreDataManager.shared.context) as! T newT.id = ID return newT } } @discardableResult static func fetchOrCreate(with dict: [String: Any]) -> T? { if let id = dict["id"] as? String { let object = self.fetchOrCreate(with: id) object.parse(dict: dict) return object } else if let id = dict["id"] as? Int { let object = self.fetchOrCreate(with: String(id)) object.parse(dict: dict) return object } return nil } static func createNew() -> T { let className = String(describing: type(of: self)).split(separator:".").first ?? "" let newT = NSEntityDescription.insertNewObject(forEntityName: String(className), into: CoreDataManager.shared.context) as! T return newT } }
[ -1 ]
5abba7e62bb6df78f52de2f6f4e3f2cb8ca58294
02897e1394859228e8e8d3c6095666a0e0a53bb9
/Lectures/Sep18/Sep18/View Controllers/YellowViewController.swift
f1c018daa84685d554ebb425d883d6cd35256b61
[]
no_license
mattwhitesides/MobileAppDev
08a7008044a239fbe14878949431b4a99bd3f4ce
a9788af7583a8b3b90b5b93f60115ccef186c7a4
refs/heads/master
2016-09-10T16:17:51.528670
2014-10-28T23:19:51
2014-10-28T23:19:51
null
0
0
null
null
null
null
UTF-8
Swift
false
false
1,756
swift
// // YellowViewController.swift // Sep18 // // Created by Matthew Whitesides on 9/18/14. // Copyright (c) 2014 Matthew Whitesides. All rights reserved. // import UIKit class YellowViewController: UIViewController { let textField = UITextField(frame: CGRectZero) let button = UIButton(UIButtonType.Custom) let textFieldConstraints = [ NSLayoutConstraint(item: textField, attribute: .CenterY, relatedBy: .Equal, toItem: view, attribute: .CenterY, multiplier: 1.0, constant: 0.0), NSLayoutConstraint(item: textField, attribute: .Left, relatedBy: .Equal, toItem: view, attribute: .Left, multiplier: 1.0, constant: 10), NSLayoutConstraint(item: textField, attribute: .Right, relatedBy: .Equal, toItem: view, attribute: .Right, multiplier: 1.0, constant: -10) ] var buttonConstraints = [ NSLayoutConstraint(item: button, attribute: .CenterX, relatedBy: .Equal, toItem: textField, attribute: .CenterX, multiplier: 1, constant: 0), NSLayoutConstraint(item: button, attribute: .CenterX, relatedBy: .Equal, toItem: textField, attribute: .CenterX, multiplier: 1, constant: 0), NSLayoutConstraint(item: button, attribute: .CenterX, relatedBy: .Equal, toItem: textField, attribute: .CenterX, multiplier: 1, constant: 0) ] override func loadView() { view = UIView(frame: UIScreen.mainScreen().bounds) view.backgroundColor = UIColor.yellowColor() textField.setTranslatesAutoresizingMaskIntoConstraints(false) view.addSubview(textField) view.addConstraints(textFieldConstraints) button.setTranslatesAutoresizingMaskIntoConstraints(false) textField.borderStyle = UITextBorderStyle.RoundedRect } }
[ -1 ]
a30330a6eb1d2f18ca61a7998d159d08d813e47d
5182f60d85f4753523235233b29f09c9046c6208
/googWeather/Models/Weather.swift
85a1f3d3aafd2b360cde6b7185dba08d8fa2149c
[ "MIT" ]
permissive
lismaroliveira1/goodweather
5cd4780fe5291882584cb7fc906df20e3ffdb2d5
61d0da3cbc4f82d7b399cb25dd2afe7a2d7547cb
refs/heads/main
2023-03-29T16:44:43.889778
2021-04-09T17:04:17
2021-04-09T17:04:17
null
0
0
null
null
null
null
UTF-8
Swift
false
false
245
swift
// // Weather.swift // googWeather // // Created by Lismar Oliveira on 09/04/21. // import Foundation struct WeatherResponse:Decodable { let main: Weather } struct Weather: Decodable { var temp: Double? var humidity: Double? }
[ -1 ]
08017a3086e968edab26357b21ddbf7b1bd6d9b4
51bfc65cc7fcdfae31497fc5aa6db2916007ddff
/WeiBo/WeiBo/Classes/Home/StatusesModel.swift
e5c941f43326e58314083c3307d4073fac8b7d04
[ "Apache-2.0" ]
permissive
wangjiayu4657/Weibo
dd07790a47e8efde96852d03a6534f315745b30e
deb6d613b3dd50faea86b1000e93c9ab74e7a6ed
refs/heads/master
2021-01-11T19:08:15.110353
2017-02-15T10:27:21
2017-02-15T10:27:21
79,322,732
0
0
null
null
null
null
UTF-8
Swift
false
false
6,938
swift
// // StatusesModel.swift // WeiBo // // Created by fangjs on 2016/11/23. // Copyright © 2016年 fangjs. All rights reserved. /** 数据模型 */ import UIKit import SDWebImage class StatusesModel: NSObject { ///微博创建时间 var created_at:String? { didSet { //将时间字符串转换为 Date let date = Date.dateWithString(time: created_at!) //将转化好的对应格式的时间字符串赋值给created_at created_at = date.descDate } } ///微博ID var id:Int = 0 ///微博信息内容 var text:String? ///微博来源 var source:String? { didSet { if let sourceString = source { if sourceString == "" { return } //先将 String 转换为 NSString let sourceString = sourceString as NSString //获取要截取字符串的起始位置 let startLocation: Int = sourceString.range(of: ">").location + 1 //获取要截取字符串的结束位置 let endLocation: Int = sourceString.range(of: "</").location //获取要截取字符串的长度 let length: Int = endLocation - startLocation //截取并拼接字符串 source = "来自: " + sourceString.substring(with: NSRange.init(location: startLocation, length: length)) } } } ///缩略图片地址,没有时不返回此字段 var pic_urls:[[String:AnyObject]]? { didSet { //初始化数组 storePicURLs = [URL]() bigStorePicURLs = [URL]() //遍历pic_urls for dict in pic_urls! { //取出图片的地址 let url = dict["thumbnail_pic"] as! String //将图片地址字符串转换为 URL并存在数组storePicURLs中 storePicURLs?.append(URL.init(string: url)!) //获取大图地址 bigStorePicURLs?.append(URL.init(string: url.replacingOccurrences(of: "thumbnail", with: "large"))!) } } } var storePicURLs:[URL]? var bigStorePicURLs:[URL]? ///User 模型 var user:User? ///转发微博 var retweeted_status:StatusesModel? //如果有转发,原创就没有配图 /// 定义一个计算属性, 用于返回原创获取配图的URL数组 or 转发获取的配图数组(缩略图) var pictureURLs:[URL]? { return retweeted_status == nil ? storePicURLs : retweeted_status?.storePicURLs } /// 定义一个计算属性, 用于返回原创获取配图的URL数组 or 转发获取的配图数组(大图) var biPictureURLs:[URL]? { return retweeted_status == nil ? bigStorePicURLs : retweeted_status?.bigStorePicURLs } ///获取当前登录用户及其所关注(授权)用户的最新微博 class func loadInfo(sinceId: Int,maxId:Int,finished:@escaping (_ statuse:[StatusesModel]?,_ error:Error?)->()) { let path = "2/statuses/home_timeline.json" var parameters = ["access_token":UserAccount.readAccount()!.access_token!] //下拉刷新,如果 sinceId > 0 则说明有新的微博 if sinceId > 0 { parameters["since_id"] = "\(sinceId)" } if maxId > 0 { //max_id: 会返回小于等于max_id的微博,maxId-1 是将重复的微博过滤 parameters["max_id"] = "\(maxId - 1)" } NetWorkTools.shareNetWorkTools().get(path, parameters: parameters, progress: { (_) in }, success: { (_, JSON) in //先把 JSON:Any? 类型转换为字典[String:AnyObject]类型 let dict = JSON as! [String:AnyObject] //将字典类型转换为数组[[String:AnyObject]] 类型 let models = dictToModel(states: dict["statuses"] as! [[String:AnyObject]]) //缓存缩略图 cacheImageURL(list: models, finished: finished) }) { (_, error) in finished(nil, error) } } ///缓存要展示的缩略图 class func cacheImageURL(list:[StatusesModel], finished:@escaping (_ statuse:[StatusesModel]?,_ error:Error?)->()) { //下拉刷新时如果没有新数据,则回调结束刷新动画 if list.count == 0 { finished(list, nil) return } //创建一个组 let group = DispatchGroup.init() //遍历list:[StatusesModel]取出数组中的StatusesModel模型 for statuse in list { //如果不满足条件就执行 else 中的语句 guard statuse.pictureURLs != nil else { continue } //遍历pictureURLs[URL]取出数组中的 url for url in statuse.pictureURLs! { //将当前的下载操作添加到group中 group.enter() //缓存图片 SDWebImageManager.shared().downloadImage(with: url, options: SDWebImageOptions.init(rawValue: 0), progress: nil, completed: { (_, _, _, _, _) in //离开当前group group.leave() }) } } //当所有操作完成离开当前 group时, group 会发送一个通知notify,然后通知调用者 group.notify(queue: DispatchQueue.main, execute: { finished(list, nil) }) } ///字典转模型 init(dictionary:[String:AnyObject]) { super.init() setValuesForKeys(dictionary) } ///当找不到对应的 key 时执行这个方法,不重写这个方法的话,如果找不到对应的 key 时会崩溃 override func setValue(_ value: Any?, forUndefinedKey key: String) { } override func setValue(_ value: Any?, forKey key: String) { if "user" == key { user = User.init(dictionary: value as! [String : AnyObject]) return } if "retweeted_status" == key { retweeted_status = StatusesModel.init(dictionary: value as! [String : AnyObject]) return } super.setValue(value, forKey: key) } let list = ["created_at","id","text","source","pic_urls"] ///根据 list 中的 key打印字典中的对应的值 override var description:String { let dict = dictionaryWithValues(forKeys: list) return "\(dict)" } /// 将字典数组转换为模型数组 private class func dictToModel(states:[[String:AnyObject]]) ->[StatusesModel] { //声明一个[StatusesModel]类型的数组 var models = [StatusesModel]() //遍历数组,将数组内的字典转化为模型并存储在数组中 for dict in states { models.append(StatusesModel(dictionary: dict)) } return models } }
[ -1 ]
520da43c5b6b2beb4237932070146653cd06d44c
316c4ac242db27103abb44bc4e6a170f42523642
/MetalImageProcessing.playground/Sources/Core/MetalObject.swift
dd45cac4a03636654b2913b91f933750ee37e989
[]
no_license
mohssenfathi/MetalImageProcessingExample
c0875116a4a5143684de8522a82a052bc686187b
b7e8599b10bb6abd35a7d53d56f06a72347191f3
refs/heads/master
2021-01-17T19:00:52.583234
2017-02-09T22:31:18
2017-02-09T22:31:18
71,594,165
2
0
null
null
null
null
UTF-8
Swift
false
false
2,111
swift
import Metal public protocol MetalInput { var output: MetalOutput? { get set } var texture: MTLTexture? { get set } var context: MetalContext? { get } func addOutput(_ output: MetalOutput) func processIfNeeded() } public protocol MetalOutput { var input: MetalInput? { get set } } open class MetalObject { var functionName: String! var pipeline: MTLComputePipelineState! var uniformsBuffer: MTLBuffer? var needsUpdate = true public var output: MetalOutput? public var texture: MTLTexture? public var input: MetalInput? { didSet { /** Our input has changed, so we want to make a new output texture with the same properties as our input's texture */ if let inputTexture = input?.texture { let textureDescriptor = MTLTextureDescriptor.texture2DDescriptor(pixelFormat: inputTexture.pixelFormat, width: inputTexture.width, height: inputTexture.height, mipmapped: false) texture = context?.device?.makeTexture(descriptor: textureDescriptor) } reload() } } // MARK: - Subclassing func update() { } func process() { } func reload() { } } extension MetalObject: MetalOutput { } extension MetalObject: MetalInput { public func processIfNeeded() { if needsUpdate { update() process() } } public var context: MetalContext? { return input?.context } public func addOutput(_ output: MetalOutput) { self.output = output self.output?.input = self } } // Default Implementation extension MetalInput { public func processIfNeeded() { } }
[ -1 ]
3b58144c930718743d9e2e8d867f32e0c7cc2928
918ceec0a60a4c2eb85caafa5c8c9dbb82198cd9
/APP12/Minhas Viagens/AppDelegate.swift
ee93c1000aa8a62cbc29a6fa1551b3e106f1f18d
[]
no_license
abdo010/CursoIOS
19b5dd3f04bc0ffff22eb33b3377a844a34c4284
f0a4a505c39d8970fa9fc84096492e5dc33aeafe
refs/heads/master
2020-03-28T01:59:57.649433
2018-08-15T22:04:40
2018-08-15T22:04:40
null
0
0
null
null
null
null
UTF-8
Swift
false
false
2,179
swift
// // AppDelegate.swift // Minhas Viagens // // Created by Leonardo Paza on 06/07/18. // Copyright © 2018 Curso IOS. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } func applicationWillResignActive(_ application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. } func applicationDidEnterBackground(_ application: UIApplication) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } func applicationWillEnterForeground(_ application: UIApplication) { // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. } func applicationDidBecomeActive(_ application: UIApplication) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } }
[ 229380, 229383, 229385, 278539, 294924, 229388, 278542, 229391, 327695, 229394, 278548, 229397, 229399, 229402, 352284, 229405, 278556, 278559, 229408, 278564, 294950, 229415, 229417, 327722, 237613, 229422, 360496, 229426, 237618, 229428, 311349, 286774, 286776, 319544, 286778, 204856, 229432, 352318, 286791, 237640, 286797, 278605, 311375, 163920, 237646, 196692, 319573, 311383, 278623, 278626, 319590, 311400, 278635, 303212, 278639, 131192, 278648, 237693, 303230, 327814, 303241, 131209, 417930, 303244, 311436, 319633, 286873, 286876, 311460, 311469, 32944, 327862, 286906, 327866, 180413, 286910, 131264, 286916, 295110, 286922, 286924, 286926, 319694, 286928, 131281, 278743, 278747, 295133, 155872, 319716, 237807, 303345, 286962, 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, 279082, 311850, 279084, 172591, 172598, 279095, 172607, 172609, 172612, 377413, 172614, 213575, 172618, 303690, 33357, 287309, 303696, 279124, 172634, 262752, 254563, 172644, 311911, 189034, 295533, 172655, 172656, 352880, 295538, 189039, 172660, 287349, 189040, 189044, 287355, 287360, 295553, 172675, 295557, 311942, 303751, 287365, 352905, 311946, 279178, 287371, 311951, 287377, 172691, 287381, 311957, 221850, 287386, 230045, 172702, 287390, 303773, 172705, 287394, 172707, 303780, 164509, 287398, 205479, 279208, 287400, 172714, 295595, 279212, 189102, 172721, 287409, 66227, 303797, 189114, 287419, 303804, 328381, 287423, 328384, 172737, 279231, 287427, 312005, 312006, 107208, 172748, 287436, 107212, 172751, 287440, 295633, 172755, 303827, 279255, 172760, 287450, 303835, 279258, 189149, 303838, 213724, 312035, 279267, 295654, 279272, 230128, 312048, 312050, 230131, 189169, 205564, 303871, 230146, 328453, 295685, 230154, 33548, 312077, 295695, 295701, 230169, 369433, 295707, 328476, 295710, 230175, 295720, 303914, 279340, 205613, 279353, 230202, 312124, 328508, 222018, 295755, 377676, 148302, 287569, 303959, 230237, 279390, 230241, 279394, 303976, 336744, 303981, 303985, 303987, 328563, 279413, 303991, 303997, 295806, 295808, 295813, 304005, 320391, 304007, 213895, 304009, 304011, 230284, 304013, 295822, 279438, 213902, 189329, 295825, 304019, 189331, 58262, 304023, 304027, 279452, 410526, 279461, 279462, 304042, 213931, 230327, 304055, 287675, 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, 295949, 197645, 320528, 140312, 295961, 238620, 197663, 304164, 304170, 304175, 238641, 312374, 238652, 238655, 230465, 238658, 336964, 132165, 296004, 205895, 320584, 238666, 296021, 402518, 336987, 230497, 296036, 296040, 361576, 205931, 296044, 279661, 205934, 164973, 312432, 279669, 337018, 189562, 279679, 304258, 279683, 222340, 66690, 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, 214294, 304416, 230689, 173350, 312622, 296243, 312630, 222522, 296253, 222525, 296255, 312639, 230718, 296259, 378181, 296262, 230727, 238919, 296264, 320840, 296267, 296271, 222545, 230739, 312663, 222556, 337244, 230752, 312676, 230760, 173418, 148843, 410987, 230763, 230768, 296305, 312692, 230773, 304505, 304506, 181626, 279929, 181631, 148865, 312711, 312712, 296331, 288140, 288144, 230800, 304533, 337306, 288154, 288160, 173472, 288162, 288164, 279975, 304555, 370092, 279983, 173488, 288176, 279985, 312755, 296373, 312759, 337335, 288185, 279991, 222652, 312766, 173507, 296389, 222665, 230860, 312783, 288208, 230865, 288210, 370130, 288212, 222676, 148946, 288214, 239064, 329177, 288217, 280027, 288220, 288218, 239070, 288224, 280034, 288226, 280036, 288229, 280038, 288230, 288232, 370146, 288234, 320998, 288236, 288238, 288240, 288242, 296435, 288244, 288250, 296446, 321022, 402942, 148990, 296450, 206336, 230916, 230919, 214535, 230923, 304651, 304653, 370187, 230940, 222752, 108066, 296486, 296488, 157229, 239152, 230961, 157236, 288320, 288325, 124489, 280140, 280145, 288338, 280149, 288344, 280152, 239194, 280158, 403039, 370272, 181854, 239202, 312938, 280183, 280185, 280188, 280191, 116354, 280194, 280208, 280211, 288408, 280218, 280222, 419489, 190118, 198310, 321195, 296622, 321200, 337585, 296626, 296634, 296637, 419522, 313027, 280260, 419525, 206536, 280264, 206539, 206541, 206543, 263888, 313044, 280276, 321239, 280283, 313052, 18140, 288478, 313055, 419555, 321252, 313066, 288494, 280302, 280304, 313073, 321266, 419570, 288499, 288502, 280314, 288510, 124671, 67330, 280324, 198405, 288519, 280331, 198416, 280337, 296723, 116503, 321304, 329498, 296731, 321311, 313121, 313123, 304932, 321316, 280363, 141101, 165678, 280375, 321336, 296767, 288576, 345921, 280388, 337732, 304968, 280393, 280402, 173907, 313171, 313176, 42842, 280419, 321381, 296809, 296812, 313201, 1920, 255873, 305028, 280454, 247688, 280464, 124817, 280468, 239510, 280473, 124827, 214940, 247709, 214944, 280487, 313258, 321458, 296883, 124853, 214966, 296890, 10170, 288700, 296894, 190403, 296900, 280515, 337862, 165831, 280521, 231379, 296921, 354265, 354270, 239586, 313320, 354281, 231404, 124913, 165876, 321528, 239612, 313340, 288764, 239617, 313347, 288773, 313358, 305176, 321560, 313371, 354338, 305191, 223273, 313386, 354348, 124978, 215090, 124980, 288824, 288826, 321595, 378941, 313406, 288831, 288836, 67654, 280651, 354382, 288848, 280658, 215123, 354390, 288855, 288859, 280669, 313438, 149599, 280671, 149601, 321634, 149603, 223327, 329830, 280681, 313451, 223341, 280687, 149618, 215154, 313458, 280691, 313464, 329850, 321659, 280702, 288895, 321670, 215175, 141446, 288909, 141455, 141459, 280725, 313498, 100520, 288936, 280747, 288940, 288947, 280755, 321717, 280759, 280764, 280769, 280771, 280774, 280776, 313548, 321740, 280783, 280786, 280788, 313557, 280793, 280796, 280798, 338147, 280804, 280807, 157930, 280811, 280817, 125171, 157940, 280819, 182517, 280823, 280825, 280827, 280830, 280831, 280833, 125187, 280835, 125191, 125207, 125209, 321817, 125218, 321842, 223539, 125239, 280888, 305464, 280891, 289087, 280897, 280900, 305480, 239944, 280906, 239947, 305485, 305489, 379218, 280919, 248153, 354653, 354656, 313700, 313705, 280937, 190832, 280946, 223606, 313720, 280956, 239997, 280959, 313731, 199051, 240011, 289166, 240017, 297363, 190868, 240021, 297365, 297368, 297372, 141725, 297377, 289186, 297391, 289201, 240052, 289207, 289210, 305594, 281024, 289218, 289221, 289227, 281045, 281047, 215526, 166378, 305647, 281075, 174580, 240124, 281084, 305662, 305664, 240129, 305666, 305668, 223749, 240132, 281095, 223752, 150025, 338440, 330244, 223757, 281102, 223763, 223765, 281113, 322074, 281116, 281121, 182819, 281127, 281135, 150066, 158262, 158266, 289342, 281154, 322115, 158283, 281163, 281179, 338528, 338532, 281190, 199273, 281196, 19053, 158317, 313973, 297594, 281210, 158347, 264845, 182926, 133776, 314003, 117398, 314007, 289436, 174754, 330404, 289448, 133801, 174764, 314029, 314033, 240309, 133817, 314045, 314047, 314051, 199364, 297671, 158409, 256716, 289493, 363234, 289513, 289522, 289525, 289532, 322303, 289537, 322310, 264969, 322314, 322318, 281361, 281372, 322341, 215850, 281388, 289593, 281401, 289601, 281410, 281413, 281414, 240458, 281420, 240468, 281430, 322393, 297818, 281435, 281438, 281442, 174955, 224110, 207733, 207737, 158596, 183172, 338823, 322440, 314249, 240519, 183184, 142226, 289687, 240535, 297883, 289694, 289696, 289700, 289712, 281529, 289724, 52163, 183260, 281567, 289762, 322534, 297961, 183277, 281581, 322550, 134142, 322563, 314372, 330764, 175134, 322599, 322610, 314421, 281654, 314427, 314433, 207937, 314441, 207949, 322642, 314456, 281691, 314461, 281702, 281704, 314474, 281708, 281711, 289912, 248995, 306341, 306344, 306347, 322734, 306354, 142531, 199877, 289991, 306377, 289997, 249045, 363742, 363745, 298216, 330988, 126190, 216303, 322801, 388350, 257302, 363802, 199976, 199978, 314671, 298292, 298294, 257334, 216376, 380226, 298306, 224584, 224587, 224594, 216404, 306517, 150870, 314714, 224603, 159068, 314718, 265568, 314723, 281960, 150890, 306539, 314732, 314736, 290161, 216436, 306549, 298358, 314743, 306552, 290171, 314747, 306555, 298365, 290174, 224641, 281987, 298372, 314756, 281990, 224647, 265604, 298377, 314763, 142733, 298381, 314768, 224657, 306581, 314773, 314779, 314785, 314793, 282025, 282027, 241068, 241070, 241072, 282034, 241077, 150966, 298424, 306618, 282044, 323015, 306635, 306640, 290263, 290270, 290275, 339431, 282089, 191985, 282098, 290291, 282101, 241142, 191992, 290298, 151036, 290302, 282111, 290305, 175621, 306694, 192008, 323084, 257550, 282127, 290321, 282130, 323090, 290325, 282133, 241175, 290328, 282137, 290332, 241181, 282142, 282144, 290344, 306731, 290349, 290351, 290356, 28219, 282186, 224849, 282195, 282199, 282201, 306778, 159324, 159330, 314979, 298598, 323176, 224875, 241260, 323181, 257658, 315016, 282249, 290445, 324757, 282261, 175770, 298651, 282269, 323229, 298655, 323231, 61092, 282277, 306856, 196133, 282295, 323260, 282300, 323266, 282310, 323273, 282319, 306897, 241362, 306904, 282328, 298714, 52959, 216801, 282337, 241380, 216806, 323304, 282345, 12011, 282356, 323318, 282364, 282367, 306945, 241412, 323333, 282376, 216842, 323345, 282388, 323349, 282392, 184090, 315167, 315169, 282402, 315174, 323367, 241448, 315176, 241450, 282410, 306988, 306991, 315184, 323376, 315190, 241464, 159545, 282425, 298811, 118593, 307009, 413506, 307012, 241475, 298822, 315211, 282446, 307027, 315221, 323414, 315223, 241496, 241498, 307035, 307040, 110433, 282465, 241509, 110438, 298860, 110445, 282478, 315249, 110450, 315251, 282481, 315253, 315255, 339838, 315267, 282499, 315269, 241544, 282505, 241546, 241548, 298896, 298898, 282514, 241556, 298901, 44948, 241560, 282520, 241563, 241565, 241567, 241569, 282531, 241574, 282537, 298922, 36779, 241581, 282542, 241583, 323504, 241586, 282547, 241588, 290739, 241590, 241592, 241598, 290751, 241600, 241605, 151495, 241610, 298975, 241632, 298984, 241640, 241643, 298988, 241646, 241649, 241652, 323574, 290807, 299003, 241661, 299006, 282623, 315396, 241669, 315397, 282632, 307211, 282639, 290835, 282645, 241693, 282654, 241701, 102438, 217127, 282669, 323630, 282681, 290877, 282687, 159811, 315463, 315466, 192589, 307278, 192596, 176213, 307287, 307290, 217179, 315482, 192605, 315483, 233567, 299105, 200801, 217188, 299109, 307303, 315495, 356457, 45163, 307307, 315502, 192624, 307314, 323700, 299126, 233591, 299136, 307329, 315524, 307338, 233613, 241813, 307352, 299164, 241821, 299167, 315552, 184479, 184481, 315557, 184486, 307370, 307372, 184492, 307374, 307376, 299185, 323763, 184503, 176311, 299191, 307386, 258235, 307388, 307385, 307390, 176316, 299200, 184512, 307394, 299204, 307396, 184518, 307399, 323784, 233679, 307409, 307411, 176343, 299225, 233701, 307432, 184572, 282881, 184579, 282893, 323854, 291089, 282906, 291104, 233766, 295583, 176435, 307508, 315701, 332086, 307510, 307512, 168245, 307515, 307518, 282942, 282947, 323917, 110926, 282957, 233808, 323921, 315733, 323926, 233815, 276052, 315739, 323932, 299357, 242018, 242024, 299373, 315757, 250231, 242043, 315771, 299388, 299391, 291202, 299398, 242057, 291212, 299405, 291222, 315801, 283033, 242075, 291226, 194654, 61855, 291231, 283042, 291238, 291241, 127403, 127405, 291247, 299440, 127407, 299444, 127413, 283062, 291254, 127417, 291260, 283069, 127421, 127424, 299457, 127429, 127431, 127434, 315856, 176592, 127440, 315860, 176597, 283095, 127447, 299481, 127449, 176605, 242143, 127455, 127457, 291299, 340454, 127463, 242152, 291305, 127466, 176620, 127469, 127474, 291314, 291317, 127480, 135672, 291323, 233979, 127485, 291330, 127490, 283142, 127494, 135689, 233994, 127497, 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, 226037, 283382, 316151, 234231, 234236, 226045, 242431, 234239, 209665, 234242, 299778, 242436, 226053, 234246, 226056, 234248, 291593, 242443, 234252, 242445, 234254, 291601, 234258, 242450, 242452, 234261, 348950, 201496, 234264, 234266, 234269, 283421, 234272, 234274, 152355, 299814, 234278, 283432, 234281, 234284, 234287, 283440, 185138, 242483, 234292, 234296, 234298, 160572, 283452, 234302, 234307, 242499, 234309, 316233, 234313, 316235, 234316, 283468, 234319, 242511, 234321, 234324, 185173, 201557, 234329, 234333, 308063, 234336, 242530, 349027, 234338, 234341, 234344, 234347, 177004, 234350, 324464, 234353, 152435, 177011, 234356, 234358, 234362, 226171, 234364, 291711, 234368, 291714, 234370, 291716, 234373, 316294, 201603, 226182, 308105, 234375, 226185, 234379, 324490, 234384, 234388, 234390, 324504, 234393, 209818, 308123, 324508, 234396, 291742, 226200, 234398, 234401, 291747, 291748, 234405, 291750, 234407, 324520, 324518, 324522, 234410, 291756, 291754, 226220, 324527, 291760, 234417, 201650, 324531, 234414, 234422, 226230, 324536, 275384, 234428, 291773, 242623, 324544, 234431, 234434, 324546, 324548, 234437, 226245, 234439, 226239, 234443, 291788, 234446, 275406, 193486, 234449, 316370, 193488, 234452, 234455, 234459, 234461, 234464, 234467, 234470, 168935, 5096, 324585, 234475, 234478, 316400, 234481, 316403, 234484, 234485, 234487, 324599, 234490, 234493, 316416, 234496, 308226, 234501, 275462, 308231, 234504, 234507, 234510, 234515, 300054, 316439, 234520, 234519, 234523, 234526, 234528, 300066, 234532, 300069, 234535, 234537, 234540, 144430, 234543, 234546, 275508, 300085, 234549, 300088, 234553, 234556, 234558, 316479, 234561, 316483, 160835, 234563, 308291, 234568, 234570, 316491, 234572, 300108, 234574, 300115, 234580, 234581, 242777, 234585, 275545, 234590, 234593, 234595, 234597, 300133, 234601, 300139, 234605, 160879, 234607, 275569, 234610, 316530, 300148, 234614, 398455, 144506, 234618, 234620, 275579, 234623, 226433, 234627, 275588, 234629, 242822, 234634, 234636, 177293, 234640, 275602, 234643, 308373, 226453, 234647, 275606, 275608, 234650, 308379, 234648, 300189, 324766, 119967, 234653, 324768, 283805, 234657, 242852, 300197, 234661, 283813, 234664, 177318, 275626, 234667, 316596, 308414, 234687, 300223, 300226, 308418, 234692, 300229, 308420, 308422, 283844, 226500, 300234, 283850, 300238, 300241, 316625, 300243, 300245, 316630, 300248, 300253, 300256, 300258, 300260, 234726, 300263, 300265, 300267, 161003, 300270, 300272, 120053, 300278, 275703, 316663, 300284, 275710, 300287, 292097, 300289, 161027, 300292, 300294, 275719, 234760, 177419, 300299, 242957, 300301, 283917, 177424, 275725, 349451, 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, 284010, 136562, 324978, 275834, 333178, 275836, 275840, 316803, 316806, 226696, 316811, 226699, 316814, 226703, 300433, 234899, 300436, 226709, 357783, 316824, 316826, 144796, 300448, 144807, 144810, 144812, 284076, 144814, 227426, 144820, 374196, 284084, 292279, 284087, 144826, 144828, 144830, 144832, 144835, 144837, 38342, 144839, 144841, 144844, 144847, 144852, 144855, 103899, 300507, 333280, 226787, 218597, 292329, 300523, 259565, 300527, 308720, 259567, 292338, 226802, 316917, 292343, 308727, 300537, 316933, 316947, 308757, 308762, 284191, 316959, 284194, 284196, 235045, 284199, 284204, 284206, 284209, 284211, 194101, 284213, 316983, 194103, 284215, 308790, 284218, 226877, 292414, 284223, 284226, 284228, 292421, 226886, 284231, 128584, 243268, 284234, 366155, 317004, 276043, 284238, 226895, 284241, 194130, 284243, 300628, 284245, 292433, 284247, 317015, 235097, 243290, 276053, 284249, 284251, 300638, 284253, 284255, 243293, 284258, 292452, 292454, 284263, 177766, 284265, 292458, 284267, 292461, 284272, 284274, 284278, 292470, 276086, 292473, 284283, 276093, 284286, 292479, 284288, 292481, 284290, 325250, 284292, 292485, 325251, 276095, 276098, 284297, 317066, 284299, 317068, 284301, 276109, 284303, 284306, 276114, 284308, 284312, 284314, 284316, 276127, 284320, 284322, 284327, 284329, 317098, 284331, 276137, 284333, 284335, 276144, 284337, 284339, 300726, 284343, 284346, 284350, 358080, 276160, 284354, 358083, 284358, 276166, 358089, 284362, 276170, 284365, 276175, 284368, 276177, 284370, 358098, 284372, 317138, 284377, 276187, 284379, 284381, 284384, 358114, 284386, 358116, 276197, 317158, 358119, 284392, 325353, 358122, 284394, 284397, 358126, 284399, 358128, 276206, 358133, 358135, 276216, 358138, 300795, 358140, 284413, 358142, 358146, 317187, 284418, 317189, 317191, 284428, 300816, 300819, 317207, 284440, 300828, 300830, 276255, 300832, 325408, 300834, 317221, 227109, 358183, 186151, 276268, 300845, 243504, 300850, 284469, 276280, 325436, 358206, 276291, 366406, 276295, 300872, 292681, 153417, 358224, 284499, 276308, 178006, 317271, 284502, 276315, 292700, 317279, 284511, 227175, 292715, 300912, 292721, 284529, 300915, 284533, 292729, 317306, 284540, 292734, 325512, 169868, 276365, 317332, 358292, 284564, 284566, 399252, 350106, 284572, 276386, 284579, 276388, 358312, 317353, 284585, 276395, 292776, 292784, 276402, 358326, 161718, 358330, 276410, 276411, 276418, 276425, 301009, 301011, 301013, 292823, 358360, 301017, 301015, 292828, 276446, 153568, 276448, 276452, 292839, 276455, 292843, 276460, 292845, 276464, 178161, 227314, 276466, 325624, 276472, 317435, 276476, 276479, 276482, 276485, 317446, 276490, 350218, 292876, 350222, 317456, 276496, 317458, 178195, 243733, 243740, 317468, 317472, 325666, 243751, 292904, 276528, 243762, 309298, 325685, 325689, 235579, 325692, 235581, 178238, 276539, 276544, 284739, 325700, 243779, 292934, 243785, 276553, 350293, 350295, 309337, 194649, 227418, 350299, 350302, 227423, 350304, 178273, 309346, 194657, 194660, 350308, 309350, 309348, 292968, 309352, 309354, 301163, 350313, 350316, 227430, 301167, 276583, 350321, 276590, 284786, 276595, 350325, 252022, 227440, 350328, 292985, 301178, 350332, 292989, 301185, 292993, 350339, 317570, 317573, 350342, 350345, 350349, 301199, 317584, 325777, 350354, 194708, 350357, 350359, 350362, 350366, 276638, 284837, 153765, 350375, 350379, 350381, 350383, 129200, 350385, 350387, 350389, 350395, 350397, 350399, 227520, 350402, 227522, 301252, 350406, 227529, 301258, 309450, 276685, 309455, 276689, 309462, 301272, 276699, 194780, 309468, 309471, 301283, 317672, 317674, 325867, 243948, 194801, 309491, 227571, 309494, 243960, 276735, 227583, 227587, 276739, 211204, 276742, 227593, 227596, 325910, 309530, 342298, 211232, 317729, 276775, 211241, 325937, 325943, 211260, 260421, 276809, 285002, 276811, 235853, 276816, 235858, 276829, 276833, 391523, 276836, 293227, 276843, 293232, 276848, 186744, 211324, 227709, 285061, 366983, 317833, 178572, 285070, 285077, 178583, 227738, 317853, 276896, 317858, 342434, 285093, 317864, 285098, 276907, 235955, 276917, 293304, 293307, 293314, 309707, 293325, 317910, 293336, 235996, 317917, 293343, 358880, 276961, 227810, 293346, 276964, 293352, 236013, 293364, 301562, 293370, 317951, 309764, 301575, 121352, 293387, 236043, 342541, 317963, 113167, 55822, 309779, 317971, 309781, 277011, 55837, 227877, 227879, 293417, 227882, 309804, 293421, 105007, 236082, 285236, 23094, 277054, 244288, 219714, 129603, 301636, 318020, 301639, 301643, 277071, 285265, 399955, 309844, 277080, 309849, 285277, 285282, 326244, 318055, 277100, 309871, 121458, 277106, 170618, 170619, 309885, 309888, 277122, 227975, 277128, 285320, 301706, 318092, 326285, 334476, 318094, 277136, 277139, 227992, 334488, 318108, 285340, 318110, 227998, 137889, 383658, 285357, 318128, 277170, 293555, 318132, 342707, 154292, 277173, 277177, 277181, 318144, 277187, 277191, 277194, 277196, 277201, 342745, 137946, 342747, 342749, 113378, 203491, 228069, 277223, 342760, 285417, 56041, 56043, 277232, 228081, 56059, 310015, 285441, 310020, 285448, 310029, 228113, 285459, 277273, 293659, 326430, 228128, 285474, 293666, 228135, 318248, 277291, 318253, 293677, 285489, 301876, 293685, 285494, 301880, 285499, 301884, 310080, 293696, 277317, 277322, 293706, 277329, 162643, 310100, 301911, 301913, 277337, 301921, 400236, 236397, 162671, 326514, 310134, 236408, 15224, 277368, 416639, 416640, 113538, 310147, 416648, 39817, 187274, 277385, 301972, 424853, 277405, 277411, 310179, 293798, 293802, 236460, 277426, 276579, 293811, 293817, 293820, 203715, 326603, 342994, 276586, 293849, 293861, 228327, 228328, 318442, 228330, 228332, 326638, 277486, 351217, 318450, 293876, 293877, 285686, 302073, 121850, 293882, 302075, 285690, 244731, 293887, 277504, 277507, 277511, 293899, 277519, 293908, 302105, 293917, 293939, 318516, 277561, 277564, 310336, 7232, 293956, 277573, 228422, 293960, 310344, 277577, 277583, 203857, 293971, 310355, 310359, 236632, 277594, 138332, 277598, 203872, 277601, 285792, 310374, 203879, 310376, 228460, 318573, 203886, 187509, 285815, 367737, 285817, 302205, 285821, 392326, 285831, 253064, 294026, 302218, 285835, 162964, 384148, 187542, 302231, 285849, 302233, 285852, 302237, 285854, 285856, 302241, 285862, 277671, 302248, 64682, 277678, 294063, 294065, 302258, 277687, 294072, 318651, 294076, 277695, 318657, 244930, 302275, 130244, 302277, 228550, 302282, 310476, 302285, 302288, 310481, 302290, 203987, 302292, 302294, 310486, 302296, 384222, 310498, 285927, 318698, 302315, 195822, 228592, 294132, 138485, 228601, 204026, 228606, 204031, 64768, 310531, 285958, 138505, 228617, 318742, 204067, 277798, 130345, 277801, 113964, 285997, 277804, 285999, 277807, 113969, 277811, 318773, 318776, 277816, 286010, 277819, 294204, 417086, 277822, 286016, 302403, 294211, 384328, 277832, 277836, 294221, 294223, 326991, 277839, 277842, 277847, 277850, 179547, 277853, 146784, 277857, 302436, 277860, 294246, 327015, 310632, 327017, 351594, 277864, 277869, 277872, 351607, 310648, 277880, 310651, 277884, 277888, 310657, 351619, 294276, 310659, 327046, 277892, 253320, 310665, 318858, 277894, 277898, 277903, 310672, 351633, 277905, 277908, 277917, 310689, 277921, 130468, 228776, 277928, 277932, 310703, 277937, 310710, 130486, 310712, 277944, 310715, 277947, 302526, 228799, 277950, 277953, 302534, 310727, 245191, 64966, 163272, 277959, 277963, 302541, 277966, 302543, 310737, 277971, 228825, 163290, 277978, 310749, 277981, 277984, 310755, 277989, 277991, 187880, 277995, 310764, 286188, 278000, 228851, 310772, 278003, 278006, 40440, 212472, 278009, 40443, 286203, 310780, 40448, 228864, 286214, 228871, 302603, 65038, 302614, 302617, 286233, 302621, 286240, 146977, 187939, 40484, 294435, 40486, 286246, 294440, 40488, 294439, 294443, 40491, 294445, 278057, 310831, 245288, 286248, 40499, 40502, 212538, 40507, 40511, 40513, 228933, 327240, 40521, 286283, 40525, 40527, 212560, 400976, 228944, 40533, 147032, 40537, 40539, 40541, 278109, 40544, 40548, 40550, 40552, 286312, 40554, 286313, 310892, 40557, 40560, 188022, 122488, 294521, 343679, 294537, 310925, 286354, 278163, 302740, 122517, 278168, 179870, 327333, 229030, 212648, 278188, 302764, 278192, 319153, 278196, 302781, 319171, 302789, 294599, 278216, 294601, 302793, 343757, 212690, 319187, 286420, 278227, 229076, 286425, 319194, 278235, 278238, 229086, 286432, 294625, 294634, 302838, 319226, 286460, 278274, 302852, 278277, 302854, 294664, 311048, 352008, 319243, 311053, 302862, 319251, 294682, 278306, 188199, 294701, 319280, 278320, 319290, 229192, 302925, 188247, 280021, 188252, 237409, 229233, 294776, 360317, 294785, 327554, 360322, 40840, 40851, 294803, 188312, 294811, 237470, 319390, 40865, 319394, 294817, 294821, 311209, 180142, 343983, 294831, 188340, 40886, 319419, 294844, 294847, 237508, 393177, 294876, 294879, 294883, 393190, 294890, 311279, 278513, 237555, 311283, 278516, 278519, 237562 ]
15d1f1e41701936ffbe680c031b0e8cb970c5407
44b52899c8acb14b3efc0cc131b5dff745859e0b
/Stepic/CourseSubscriptionManager.swift
9441cff23fe0b40dc173055faebe0e083b6bdb23
[ "MIT" ]
permissive
romanbannikov/stepik-ios
9b72843f7bc1d869103f70dbca2eef21dd7f10cf
9469c4ccc8ea920f7a2966820b71fda2dd8870a2
refs/heads/master
2021-05-04T14:44:19.169270
2018-01-28T21:58:27
2018-01-28T21:58:27
null
0
0
null
null
null
null
UTF-8
Swift
false
false
3,365
swift
// // CoursesJoinManager.swift // Stepic // // Created by Alexander Karpov on 11.02.16. // Copyright © 2016 Alex Karpov. All rights reserved. // import UIKit class CourseSubscriptionManager: NSObject { static let sharedManager = CourseSubscriptionManager() let courseSubscribedNotificationName = NSNotification.Name(rawValue: "CourseSubscribedNotification") let courseUnsubscribedNotificationName = NSNotification.Name(rawValue: "CourseUnsubscribedNotification") var handleUpdatesBlock: (() -> Void)? override init() {} func startObservingOtherSubscriptionManagers() { NotificationCenter.default.addObserver(self, selector: #selector(CourseSubscriptionManager.courseSubscribed(_:)), name: courseSubscribedNotificationName, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(CourseSubscriptionManager.courseUnsubscribed(_:)), name: courseUnsubscribedNotificationName, object: nil) } fileprivate var dCourses = [Course]() fileprivate var aCourses = [Course]() @objc func courseSubscribed(_ notification: Foundation.Notification) { if let course = (notification as NSNotification).userInfo?["course"] as? Course { subscribedTo(course: course, notifyOthers: false) } } @objc func courseUnsubscribed(_ notification: Foundation.Notification) { if let course = (notification as NSNotification).userInfo?["course"] as? Course { unsubscribedFrom(course: course, notifyOthers: false) } } var deletedCourses: [Course] { get { return dCourses } set(value) { var v = value removeIntersectedElements(&v, &aCourses) dCourses = filterRepetitions(arr: v) } } var addedCourses: [Course] { get { return aCourses } set(value) { var v = value removeIntersectedElements(&v, &dCourses) aCourses = filterRepetitions(arr: v) } } func unsubscribedFrom(course: Course, notifyOthers: Bool = true) { deletedCourses += [course] handleUpdatesBlock?() if notifyOthers { NotificationCenter.default.post(name: courseUnsubscribedNotificationName, object: nil, userInfo: ["course": course]) } } func subscribedTo(course: Course, notifyOthers: Bool = true) { addedCourses += [course] handleUpdatesBlock?() if notifyOthers { NotificationCenter.default.post(name: courseSubscribedNotificationName, object: nil, userInfo: ["course": course]) } } var hasUpdates: Bool { return (deletedCourses.count + addedCourses.count) > 0 } func filterRepetitions(arr: [Course]) -> [Course] { var filtered: [Course] = [] var distinct: [Course] = [] for c in arr { let f = arr.filter({$0.id == c.id}) if f.count != 1 { if distinct.index(of: c) == nil { distinct += [c] } } else { filtered += [c] } } return filtered + distinct } func clean() { deletedCourses = [] addedCourses = [] } deinit { NotificationCenter.default.removeObserver(self) } }
[ -1 ]
6387079d4947fbc45f6d721736f5d0e4c6df79aa
ebe58d92f15c5bac4c91b5566211a4b01c819f50
/SplashBase/Extensions/UITableView+Extension.swift
25f7865914bbd861fec333570e67094e7d842712
[ "MIT" ]
permissive
RobertShrestha/SpashBase
57e60111314cd1b4fd4818c8de2b28fb758a19e2
1def716396175cb7fbb05944622f03a2da19aee9
refs/heads/master
2020-09-16T07:51:58.629263
2019-12-15T16:11:26
2019-12-15T16:11:26
223,703,396
0
0
null
null
null
null
UTF-8
Swift
false
false
1,218
swift
// // UITableView+Extension.swift // SplashBase // // Created by Robert Shrestha on 11/23/19. // Copyright © 2019 robert. All rights reserved. // import UIKit extension UITableView{ func dequeueResuableCell<Cell: UITableViewCell>(forIndexPath indexPath:IndexPath) -> Cell { guard let cell = self.dequeueReusableCell(withIdentifier: Cell.resuseID, for: indexPath) as? Cell else { fatalError("Fatal error for cell at \(indexPath)") } return cell } } protocol Resuable {} extension UITableViewCell:Resuable {} extension Resuable where Self: UITableViewCell{ static var resuseID:String{ return String(describing: self) } } extension UICollectionViewCell:Resuable {} extension Resuable where Self:UICollectionViewCell{ static var resuseID:String{ return String(describing: self) } } extension UICollectionView{ func dequeueResuableCell<Cell: UICollectionViewCell>(forIndexPath indexPath:IndexPath) -> Cell { guard let cell = self.dequeueReusableCell(withReuseIdentifier: Cell.resuseID, for: indexPath) as? Cell else { fatalError("Fatal error for cell at \(indexPath)") } return cell } }
[ -1 ]
14b0bc8b7cb008b07b0cc04212c829146a1d04a3
a95ac8951d898763cd3adf809cfa24c7eef3b12c
/HonoluluArt/HonoluluArt/ViewController.swift
12185dcb7f3d97232478c64fdd8ce0d3adc32dd3
[]
no_license
Ry-Mu/iOS_intermediate
cab41a84d04dcddec226ef9de0484efaf264462e
1a2a5bec964e2c6c61faecdca5a9a114c074d78b
refs/heads/master
2021-01-22T17:53:06.960612
2017-03-21T04:28:31
2017-03-21T04:28:31
85,045,280
0
0
null
null
null
null
UTF-8
Swift
false
false
408
swift
// // ViewController.swift // HonoluluArt // // Created by Ryan Munguia on 3/16/17. // Copyright © 2017 Ryan Munguia. All rights reserved. // import MapKit class ViewController: UIViewController { @IBOutlet weak var mapView: MKMapView! override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. } }
[ 135843 ]
f378463e4689475e9807ede457ff8edbe00b4e26
8158093fa0dfa6b30c77dd59719423ba48dff4f3
/Gluco App/Controllers/SecondLoginViewController.swift
3f7ce58bbb6b043500480ce3e2508fe836a6f7d5
[]
no_license
chaitraBL/Dr-Trust
d911f974a7802e4cde202baff4396c04747350f0
03e9b68ed9d40196ab39be2d6e39ecaedeca9c69
refs/heads/main
2023-08-21T08:33:13.618166
2021-10-18T06:05:59
2021-10-18T06:05:59
null
0
0
null
null
null
null
UTF-8
Swift
false
false
754
swift
// // SecondLoginViewController.swift // Gluco App // // Created by edgefinity on 27/07/21. // import UIKit import SkyFloatingLabelTextField class SecondLoginViewController: UIViewController { @IBOutlet var name: UILabel! @IBOutlet var password: SkyFloatingLabelTextField! @IBOutlet var showHidePassword: UIButton! override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. } @IBAction func notYou(_ sender: UIButton) { } @IBAction func forgotPassword(_ sender: UIButton) { } @IBAction func login(_ sender: UIButton) { } @IBAction func hideShowPassword(_ sender: UIButton) { } }
[ -1 ]
f62e8596748b9ab9ee453fb51c43537b36e477da
dd485eb0ede67285af51b512c9d79770bffeb4b9
/Contact/View/ContactCell.swift
399dbedc13f72e3ab9907768a332bbb087817acc
[]
no_license
klaes-ashford/Contact
2e96e5d5d1d1f618a6922fc1c13fbd4ae24c068e
459ca7c61a807b2acc07d290d02b0b5efe113ba7
refs/heads/master
2022-01-13T12:18:26.329739
2019-02-19T18:11:08
2019-02-19T18:11:08
null
0
0
null
null
null
null
UTF-8
Swift
false
false
4,276
swift
// // ContactCell.swift // Contact // // Created by Kuliza-148 on 17/02/19. // Copyright © 2019 swift. All rights reserved. // import UIKit import RxSwift import Kingfisher class ContactCell: UITableViewCell, ReusableView { private var fullNameLabel: UILabel! private var profileImageView: UIImageView! private var favouriteImageView: UIImageView! private var disposeBag: DisposeBag! private var viewModel: ContactCellViewModeling! { didSet { setupBinding() } } func prepare(with viewModel: ContactCellViewModeling) { self.viewModel = viewModel } override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { super.init(style: style, reuseIdentifier: reuseIdentifier) setup() } required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) setup() } override func prepareForReuse() { viewModel = nil disposeBag = nil } private func setup() { self.clipsToBounds = true self.backgroundColor = .clear self.selectionStyle = .none setupFullNameLabel() setupProfileImageView() setupFavouriteImageView() } private func setupBinding() { guard let viewModel = viewModel else { return } let bag = DisposeBag() viewModel.fullNameText .bind(to: fullNameLabel.rx.text) .disposed(by: bag) viewModel.imageUrl.subscribe(onNext: { [weak self] (url) in self?.profileImageView.kf.setImage(with: url) }).disposed(by: bag) viewModel.isFavourite.subscribe(onNext: { [weak self] (isFavourite) in self?.favouriteImageView.isHidden = !isFavourite }).disposed(by: bag) self.disposeBag = bag } private func setupFullNameLabel() { fullNameLabel = UILabel() self.contentView.addSubview(fullNameLabel) NSLayoutConstraint.activate([ fullNameLabel.topAnchor.constraint(equalTo: contentView.topAnchor, constant: 24), fullNameLabel.bottomAnchor.constraint(equalTo: contentView.bottomAnchor, constant: -24), fullNameLabel.centerYAnchor.constraint(equalTo: contentView.centerYAnchor, constant: 0) ]) fullNameLabel.translatesAutoresizingMaskIntoConstraints = false fullNameLabel.numberOfLines = 0 fullNameLabel.textAlignment = .left fullNameLabel.font = UIFont.boldSystemFont(ofSize: 14) fullNameLabel.textColor = UIColor.tundora() } private func setupProfileImageView() { profileImageView = UIImageView() profileImageView.layer.cornerRadius = 20 profileImageView.layer.masksToBounds = true contentView.addSubview(profileImageView) NSLayoutConstraint.activate([ profileImageView.trailingAnchor.constraint(equalTo: fullNameLabel.leadingAnchor, constant: -16), profileImageView.leadingAnchor.constraint(equalTo: contentView.leadingAnchor, constant: 16), profileImageView.centerYAnchor.constraint(equalTo: contentView.centerYAnchor, constant: 0), profileImageView.widthAnchor.constraint(equalToConstant: 40), profileImageView.heightAnchor.constraint(equalToConstant: 40) ]) profileImageView.translatesAutoresizingMaskIntoConstraints = false } private func setupFavouriteImageView() { favouriteImageView = UIImageView() favouriteImageView.image = UIImage(named: "favourite") contentView.addSubview(favouriteImageView) NSLayoutConstraint.activate([ favouriteImageView.trailingAnchor.constraint(equalTo: contentView.trailingAnchor, constant: -32), favouriteImageView.leadingAnchor.constraint(equalTo: fullNameLabel.trailingAnchor, constant: 16), favouriteImageView.centerYAnchor.constraint(equalTo: contentView.centerYAnchor, constant: 0), favouriteImageView.widthAnchor.constraint(equalToConstant: 16), favouriteImageView.heightAnchor.constraint(equalToConstant: 16) ]) favouriteImageView.translatesAutoresizingMaskIntoConstraints = false favouriteImageView.isHidden = true } }
[ -1 ]
ed72ef8b7d28e0be72038ed0f5d9f45321dc6f57
e36578dc036798cd465715bf54834e3dfb19526b
/AutoLayout/AppDelegate.swift
50ee9f5bdf9457c7e81893b602868d02cca456e3
[]
no_license
NikitaAntonenko/AutoLayout
cf4f2b6266c3e471217b868068de4943fd549cac
aeb09608eb132b010800b8dd61d0acde01f53ee6
refs/heads/master
2021-04-27T20:00:20.352397
2018-02-21T17:29:16
2018-02-21T17:29:16
122,369,199
0
0
null
null
null
null
UTF-8
Swift
false
false
2,167
swift
// // AppDelegate.swift // AutoLayout // // Created by getTrickS2 on 2/21/18. // Copyright © 2018 Nik's. 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, 229391, 327695, 278545, 229394, 278548, 229397, 229399, 229402, 352284, 229405, 278556, 278559, 229408, 278564, 294950, 229415, 229417, 327722, 237613, 229422, 360496, 229426, 237618, 229428, 311349, 286774, 319544, 204856, 229432, 286776, 286778, 352318, 286791, 237640, 278605, 286797, 311375, 163920, 237646, 196692, 319573, 311383, 278623, 278626, 319590, 311400, 278635, 303212, 278639, 131192, 278648, 237693, 303230, 327814, 131209, 303241, 417930, 303244, 311436, 319633, 286873, 286876, 311460, 311469, 32944, 327862, 286906, 327866, 180413, 286910, 131264, 286916, 295110, 286922, 286924, 286926, 319694, 286928, 131281, 278743, 278747, 295133, 155872, 319716, 237807, 303345, 286962, 303347, 131314, 229622, 327930, 278781, 278783, 278785, 237826, 319751, 278792, 286987, 319757, 311569, 286999, 319770, 287003, 287006, 287009, 287012, 287014, 287016, 287019, 311598, 287023, 262448, 311601, 295220, 287032, 155966, 319809, 319810, 278849, 319814, 311623, 319818, 311628, 229709, 319822, 287054, 278865, 229717, 196963, 196969, 139638, 213367, 106872, 319872, 311683, 319879, 311693, 65943, 319898, 311719, 278952, 139689, 278957, 311728, 278967, 180668, 311741, 278975, 319938, 278980, 98756, 278983, 319945, 278986, 319947, 278990, 278994, 311767, 279003, 279006, 188895, 172512, 287202, 279010, 279015, 172520, 319978, 279020, 172526, 311791, 279023, 172529, 279027, 319989, 180727, 164343, 279035, 311804, 287230, 279040, 303617, 287234, 279045, 172550, 303623, 320007, 287238, 172552, 279051, 172558, 279055, 303632, 279058, 303637, 279063, 279067, 172572, 279072, 172577, 295459, 172581, 295461, 279082, 311850, 279084, 172591, 172598, 279095, 172607, 172609, 172612, 377413, 172614, 213575, 172618, 303690, 33357, 287309, 303696, 279124, 172634, 262752, 172644, 311911, 189034, 295533, 172655, 172656, 352880, 189039, 295538, 172660, 189040, 189044, 287349, 287355, 287360, 295553, 295557, 311942, 303751, 287365, 352905, 311946, 279178, 287371, 311951, 287377, 172691, 287381, 311957, 221850, 287386, 230045, 287390, 303773, 164509, 172705, 287394, 172702, 303780, 172707, 287398, 205479, 279208, 287400, 172714, 295595, 279212, 189102, 172721, 287409, 66227, 303797, 189114, 287419, 303804, 328381, 287423, 328384, 279231, 287427, 312005, 312006, 107208, 107212, 172748, 287436, 172751, 287440, 295633, 172755, 303827, 279255, 172760, 287450, 303835, 279258, 189149, 303838, 213724, 279267, 312035, 295654, 279272, 312048, 230128, 312050, 230131, 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, 304005, 295813, 304007, 320391, 213895, 304009, 304011, 230284, 304013, 279438, 189325, 295822, 189329, 295825, 189331, 304019, 213902, 58262, 304023, 279452, 234648, 410526, 279461, 279462, 304042, 213931, 304055, 230327, 287675, 197564, 230334, 304063, 238528, 304065, 213954, 189378, 156612, 295873, 213963, 312272, 304084, 304090, 320481, 304106, 320490, 312302, 328687, 320496, 304114, 295928, 320505, 312321, 295945, 295949, 230413, 197645, 320528, 140312, 295961, 238620, 197663, 304164, 304170, 304175, 238641, 312374, 238652, 238655, 230465, 238658, 296004, 132165, 336964, 205895, 320584, 238666, 296021, 402518, 336987, 230497, 296036, 361576, 296040, 205931, 296044, 279661, 205934, 164973, 312432, 279669, 337018, 189562, 279679, 304258, 279683, 222340, 205968, 296084, 238745, 304285, 238756, 205991, 222377, 165035, 337067, 165038, 238766, 230576, 238770, 304311, 230592, 312518, 279750, 230600, 230607, 148690, 320727, 279769, 304348, 279777, 304354, 296163, 320740, 279781, 304360, 320748, 279788, 279790, 304370, 296189, 320771, 312585, 296202, 296205, 230674, 320786, 230677, 296213, 296215, 320792, 230681, 230679, 214294, 304416, 230689, 173350, 312622, 296243, 312630, 222522, 296253, 222525, 296255, 312639, 230718, 296259, 378181, 296262, 230727, 296264, 238919, 320840, 296267, 296271, 222545, 230739, 312663, 337244, 222556, 230752, 312676, 230760, 173418, 410987, 230763, 148843, 230768, 296305, 312692, 230773, 304505, 181626, 304506, 279929, 181631, 148865, 312711, 312712, 296331, 288140, 288144, 230800, 304533, 337306, 288154, 288160, 173472, 288162, 288164, 279975, 304555, 370092, 279983, 173488, 288176, 279985, 312755, 296373, 312759, 337335, 288185, 279991, 222652, 312766, 173507, 296389, 222665, 230860, 312783, 288208, 230865, 288210, 370130, 288212, 222676, 148946, 288214, 239064, 329177, 288217, 280027, 288220, 288218, 239070, 288224, 280034, 288226, 280036, 288229, 280038, 288230, 288232, 370146, 288234, 320998, 288236, 288238, 288240, 288242, 296435, 288244, 288250, 148990, 321022, 206336, 402942, 296446, 296450, 230916, 230919, 214535, 304651, 370187, 304653, 230923, 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, 280276, 313044, 321239, 280283, 18140, 313052, 288478, 313055, 321252, 313066, 280302, 288494, 280304, 313073, 419570, 288499, 321266, 288502, 280314, 288510, 124671, 67330, 280324, 198405, 288519, 280331, 198416, 280337, 296723, 116503, 321304, 329498, 296731, 321311, 313121, 313123, 304932, 321316, 280363, 141101, 165678, 280375, 321336, 296767, 288576, 345921, 280388, 337732, 304968, 280393, 280402, 173907, 313176, 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, 10170, 296890, 288700, 296894, 190403, 296900, 280515, 337862, 165831, 280521, 231379, 296921, 354265, 354270, 239586, 313320, 354281, 231404, 124913, 165876, 321528, 313340, 239612, 288764, 239617, 313347, 288773, 313358, 305176, 321560, 313371, 354338, 305191, 223273, 313386, 354348, 124978, 215090, 124980, 288824, 288826, 321595, 378941, 313406, 288831, 288836, 67654, 280651, 354382, 288848, 280658, 215123, 354390, 288855, 288859, 280669, 313438, 149599, 280671, 149601, 321634, 149603, 223327, 329830, 280681, 313451, 223341, 280687, 215154, 313458, 280691, 149618, 313464, 329850, 321659, 280702, 288895, 321670, 215175, 141446, 288909, 141455, 141459, 280725, 313498, 100520, 288936, 280747, 288940, 280755, 288947, 321717, 280759, 280764, 280769, 280771, 280774, 280776, 321740, 313548, 280783, 280786, 280788, 313557, 280793, 280796, 280798, 338147, 280804, 280807, 157930, 280811, 280817, 125171, 157940, 280819, 182517, 280823, 280825, 280827, 280830, 280831, 280833, 125187, 280835, 125191, 125207, 125209, 321817, 125218, 321842, 223539, 125239, 280888, 305464, 280891, 289087, 280897, 280900, 239944, 305480, 280906, 239947, 305485, 305489, 379218, 280919, 248153, 215387, 354653, 354656, 313700, 313705, 280937, 190832, 280946, 223606, 313720, 280956, 239997, 280959, 313731, 240011, 199051, 289166, 240017, 297363, 190868, 297365, 240021, 297368, 297372, 141725, 297377, 289186, 297391, 289201, 240052, 289207, 305594, 289210, 281024, 289218, 289221, 289227, 436684, 281045, 281047, 215526, 166378, 305647, 281075, 174580, 240124, 281084, 305662, 305664, 240129, 305666, 305668, 223749, 330244, 281095, 223752, 338440, 150025, 240132, 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, 289493, 363234, 289513, 289522, 289525, 289532, 322303, 289537, 322310, 264969, 322314, 322318, 281361, 281372, 322341, 215850, 281388, 289593, 281401, 289601, 281410, 281413, 281414, 240458, 281420, 240468, 281430, 322393, 297818, 281435, 281438, 281442, 174955, 224110, 207733, 207737, 183172, 158596, 338823, 322440, 314249, 240519, 183184, 142226, 240535, 289687, 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, 314441, 207949, 322642, 314456, 281691, 314461, 281702, 281704, 314474, 281708, 281711, 289912, 248995, 306341, 306344, 306347, 322734, 306354, 142531, 199877, 289991, 306377, 289997, 249045, 363742, 363745, 298216, 330988, 126190, 216303, 322801, 388350, 257302, 363802, 199976, 199978, 314671, 298292, 298294, 257334, 216376, 298306, 380226, 224584, 224587, 224594, 216404, 306517, 150870, 314714, 224603, 159068, 314718, 265568, 314723, 281960, 150890, 306539, 314732, 314736, 290161, 216436, 306549, 298358, 314743, 306552, 306555, 314747, 298365, 290171, 290174, 224641, 281987, 314756, 298372, 281990, 224647, 265604, 298377, 314763, 142733, 298381, 314768, 224657, 306581, 314773, 314779, 314785, 314793, 282025, 282027, 241068, 241070, 241072, 282034, 241077, 150966, 298424, 306618, 282044, 323015, 306635, 306640, 290263, 290270, 290275, 339431, 282089, 191985, 282098, 290291, 282101, 241142, 191992, 290298, 151036, 290302, 282111, 290305, 175621, 306694, 192008, 323084, 257550, 282127, 290321, 282130, 323090, 282133, 290325, 241175, 290328, 282137, 290332, 241181, 282142, 282144, 290344, 306731, 290349, 290351, 290356, 28219, 282186, 224849, 282195, 282199, 282201, 306778, 159324, 159330, 314979, 298598, 323176, 224875, 241260, 323181, 257658, 315016, 282249, 290445, 282255, 282261, 175770, 298651, 323229, 282269, 298655, 323231, 61092, 282277, 306856, 196133, 282295, 323260, 282300, 323266, 282310, 323273, 282319, 306897, 241362, 306904, 282328, 298714, 52959, 216801, 282337, 241380, 216806, 323304, 282345, 12011, 282356, 323318, 282364, 282367, 306945, 241412, 323333, 282376, 216842, 323345, 282388, 323349, 282392, 184090, 315167, 315169, 282402, 315174, 323367, 241448, 315176, 241450, 282410, 306988, 306991, 315184, 323376, 315190, 241464, 159545, 282425, 298811, 307009, 413506, 241475, 307012, 298822, 315211, 282446, 307027, 315221, 323414, 315223, 241496, 241498, 307035, 307040, 110433, 282465, 241509, 110438, 298860, 110445, 282478, 315249, 110450, 315251, 282481, 315253, 315255, 339838, 315267, 282499, 315269, 241544, 282505, 241546, 241548, 298896, 298898, 282514, 241556, 298901, 44948, 241560, 282520, 241563, 241565, 241567, 241569, 282531, 241574, 282537, 298922, 36779, 241581, 282542, 241583, 323504, 241586, 282547, 241588, 290739, 241590, 241592, 241598, 290751, 241600, 241605, 151495, 241610, 298975, 241632, 298984, 241640, 241643, 298988, 241646, 241649, 241652, 323574, 290807, 241661, 299006, 282623, 315396, 241669, 315397, 282632, 307211, 282639, 290835, 282645, 241693, 282654, 241701, 102438, 217127, 282669, 323630, 282681, 290877, 282687, 159811, 315463, 315466, 192589, 307278, 192596, 176213, 307287, 315482, 217179, 315483, 192605, 233567, 200801, 299105, 217188, 299109, 307303, 315495, 356457, 307307, 45163, 315502, 192624, 307314, 323700, 299126, 233591, 299136, 307329, 315524, 307338, 233613, 241813, 307352, 299164, 184479, 299167, 184481, 315557, 184486, 307370, 307372, 184492, 307374, 307376, 299185, 323763, 176311, 299191, 307385, 307386, 258235, 307388, 176316, 307390, 184503, 299200, 184512, 307394, 307396, 299204, 184518, 307399, 323784, 233679, 307409, 307411, 176343, 299225, 233701, 307432, 184572, 282881, 184579, 282893, 323854, 291089, 282906, 291104, 233766, 295583, 176435, 307508, 315701, 332086, 307510, 307512, 168245, 307515, 307518, 282942, 282947, 323917, 110926, 282957, 233808, 323921, 315733, 323926, 233815, 276052, 315739, 323932, 299357, 242018, 242024, 299373, 315757, 250231, 242043, 315771, 299388, 299391, 291202, 299398, 242057, 291212, 299405, 291222, 315801, 283033, 242075, 291226, 291231, 61855, 283042, 291238, 291241, 127403, 127405, 127407, 291247, 299440, 299444, 127413, 283062, 291254, 127417, 291260, 283069, 127421, 127424, 299457, 127429, 127431, 315856, 176592, 127440, 315860, 176597, 283095, 127447, 299481, 127449, 176605, 242143, 127455, 127457, 291299, 340454, 127463, 242152, 291305, 127466, 176620, 127469, 127474, 291314, 291317, 135672, 127480, 233979, 291323, 127485, 291330, 127490, 283142, 127494, 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, 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, 226053, 234246, 226056, 234248, 291593, 242443, 234252, 242445, 234254, 291601, 242450, 234258, 242452, 234261, 348950, 201496, 234264, 234266, 234269, 283421, 234272, 234274, 152355, 234278, 299814, 283432, 234281, 234284, 234287, 283440, 185138, 242483, 234292, 234296, 234298, 160572, 283452, 234302, 234307, 242499, 234309, 316233, 234313, 316235, 234316, 283468, 242511, 234319, 234321, 234324, 201557, 185173, 234329, 234333, 308063, 234336, 234338, 349027, 242530, 234341, 234344, 234347, 177004, 234350, 324464, 234353, 152435, 177011, 234356, 234358, 234362, 226171, 234364, 291711, 234368, 234370, 201603, 291714, 234373, 316294, 226182, 234375, 308105, 291716, 226185, 234379, 324490, 234384, 234388, 234390, 324504, 234393, 209818, 308123, 324508, 234396, 291742, 226200, 234398, 234401, 291747, 291748, 234405, 291750, 234407, 324520, 324518, 234410, 291754, 291756, 324522, 226220, 324527, 291760, 234417, 201650, 324531, 234414, 234422, 226230, 324536, 275384, 234428, 291773, 234431, 242623, 324544, 324546, 234434, 324548, 234437, 226245, 234439, 226239, 234443, 291788, 234446, 275406, 193486, 234449, 316370, 193488, 234452, 234455, 234459, 234461, 234464, 234467, 234470, 168935, 5096, 324585, 234475, 234478, 316400, 234481, 316403, 234484, 234485, 324599, 234487, 234490, 234493, 234496, 316416, 308226, 234501, 275462, 308231, 234504, 234507, 234510, 234515, 300054, 234519, 316439, 234520, 234523, 234526, 234528, 300066, 234532, 300069, 234535, 234537, 234540, 144430, 234543, 234546, 275508, 234549, 300085, 300088, 234553, 234556, 234558, 316479, 234561, 308291, 316483, 234563, 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, 308373, 226453, 234647, 275606, 275608, 234650, 308379, 324757, 234653, 300189, 119967, 324766, 324768, 283805, 234657, 242852, 234661, 283813, 300197, 234664, 275626, 234667, 316596, 308414, 300223, 234687, 300226, 308418, 283844, 300229, 308420, 308422, 226500, 234692, 283850, 300234, 300238, 300241, 316625, 300243, 300245, 316630, 300248, 300253, 300256, 300258, 300260, 234726, 300263, 300265, 300267, 161003, 300270, 300272, 120053, 300278, 316663, 275703, 300284, 275710, 300287, 300289, 292097, 161027, 300292, 300294, 275719, 234760, 177419, 300299, 242957, 283917, 300301, 177424, 349451, 275725, 349464, 415009, 283939, 259367, 292143, 283951, 300344, 226617, 243003, 283963, 226628, 283973, 300357, 177482, 283983, 316758, 357722, 316766, 316768, 292192, 218464, 292197, 316774, 243046, 218473, 284010, 324978, 136562, 275834, 333178, 275836, 275840, 316803, 316806, 226696, 316811, 226699, 316814, 226703, 300433, 234899, 226709, 357783, 316824, 316826, 144796, 300448, 144807, 144810, 144812, 284076, 144814, 144820, 284084, 284087, 292279, 144826, 144828, 144830, 144832, 144835, 144837, 38342, 144839, 144841, 144844, 144847, 144852, 144855, 103899, 300507, 333280, 226787, 218597, 292329, 300523, 259565, 300527, 308720, 259567, 226802, 292338, 316917, 292343, 308727, 300537, 316933, 316947, 308757, 308762, 284191, 284194, 284196, 235045, 284199, 284204, 284206, 284209, 284211, 284213, 308790, 284215, 316983, 194103, 284218, 194101, 226877, 292414, 284223, 284226, 284228, 292421, 226886, 284231, 128584, 243268, 284234, 366155, 317004, 276043, 284238, 226895, 284241, 292433, 284243, 300628, 284245, 194130, 284247, 317015, 235097, 243290, 276053, 284249, 284251, 300638, 284253, 284255, 243293, 284258, 292452, 292454, 284263, 177766, 284265, 292458, 284267, 292461, 284272, 284274, 276086, 284278, 292470, 292473, 284283, 276093, 284286, 292479, 284288, 292481, 284290, 325250, 284292, 292485, 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, 276166, 284358, 358089, 284362, 276170, 276175, 284368, 276177, 284370, 358098, 284372, 317138, 284377, 276187, 284379, 284381, 284384, 358114, 284386, 358116, 276197, 317158, 358119, 284392, 325353, 358122, 284394, 284397, 358126, 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, 317279, 227175, 292715, 300912, 284529, 292721, 300915, 284533, 292729, 317306, 284540, 292734, 325512, 169868, 276365, 358292, 284564, 317332, 399252, 284566, 350106, 284572, 276386, 284579, 276388, 358312, 284585, 317353, 276395, 292776, 292784, 276402, 358326, 161718, 276410, 276411, 358330, 276418, 276425, 301009, 301011, 301013, 292823, 301015, 301017, 358360, 292828, 276446, 153568, 276448, 276452, 292839, 276455, 350186, 292843, 276460, 292845, 276464, 178161, 227314, 276466, 350200, 325624, 276472, 317435, 276476, 276479, 276482, 350210, 276485, 317446, 178181, 276490, 350218, 292876, 350222, 317456, 276496, 317458, 178195, 243733, 243740, 317468, 317472, 325666, 243751, 292904, 276528, 178224, 243762, 309298, 325685, 325689, 235579, 325692, 235581, 178238, 276539, 276544, 243779, 284739, 325700, 292934, 243785, 276553, 350293, 350295, 309337, 194649, 227418, 350299, 350302, 227423, 194654, 178273, 309346, 194657, 309348, 350308, 309350, 227426, 309352, 350313, 309354, 301163, 350316, 194660, 227430, 276583, 276590, 350321, 284786, 276595, 301167, 350325, 227440, 350328, 292985, 301178, 350332, 292989, 301185, 292993, 350339, 317570, 317573, 350342, 350345, 350349, 301199, 317584, 325777, 350354, 350357, 350359, 350362, 350366, 276638, 284837, 153765, 350375, 350379, 350381, 350383, 129200, 350385, 350387, 350389, 350395, 350397, 350399, 227520, 350402, 227522, 301252, 350406, 227529, 309450, 301258, 276685, 309455, 276689, 309462, 301272, 276699, 309468, 194780, 309471, 301283, 317672, 317674, 325867, 243948, 194801, 309491, 227571, 309494, 243960, 276735, 227583, 227587, 276739, 211204, 276742, 227593, 227596, 325910, 309530, 342298, 211232, 317729, 276775, 211241, 325937, 325943, 211260, 260421, 276809, 285002, 276811, 235853, 276816, 235858, 276829, 276833, 391523, 276836, 276843, 293227, 276848, 293232, 186744, 211324, 227709, 285061, 366983, 317833, 178572, 285070, 285077, 178583, 227738, 317853, 276896, 317858, 342434, 285093, 317864, 285098, 276907, 235955, 276917, 293304, 293307, 293314, 309707, 293325, 129486, 317910, 293336, 235996, 317917, 293343, 358880, 276961, 227810, 293346, 276964, 293352, 236013, 293364, 301562, 293370, 317951, 309764, 301575, 121352, 236043, 317963, 342541, 55822, 113167, 309779, 317971, 309781, 277011, 55837, 227877, 227879, 293417, 227882, 309804, 293421, 105007, 236082, 285236, 23094, 277054, 244288, 219714, 129603, 318020, 301636, 301639, 301643, 277071, 285265, 399955, 309844, 277080, 309849, 285277, 285282, 326244, 318055, 277100, 309871, 121458, 277106, 170618, 170619, 309885, 309888, 277122, 227975, 277128, 285320, 301706, 318092, 326285, 334476, 318094, 277136, 277139, 227992, 334488, 318108, 285340, 318110, 227998, 137889, 383658, 285357, 318128, 277170, 342707, 318132, 154292, 293555, 277173, 285368, 277177, 277181, 318144, 277187, 277191, 277194, 277196, 277201, 342745, 137946, 342747, 113378, 203491, 228069, 277223, 342760, 285417, 56041, 56043, 56045, 277232, 228081, 56059, 310015, 285441, 310020, 285448, 310029, 228113, 285459, 277273, 293659, 326430, 228128, 293666, 285474, 228135, 318248, 277291, 318253, 293677, 285489, 301876, 293685, 285494, 301880, 285499, 301884, 310080, 293696, 277317, 277322, 293706, 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, 276579, 293811, 293817, 293820, 203715, 326603, 342994, 276586, 293849, 293861, 228327, 228328, 228330, 318442, 228332, 326638, 277486, 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, 7232, 293956, 277573, 228422, 310344, 277577, 293960, 277583, 203857, 310355, 293971, 310359, 236632, 277594, 138332, 277598, 203872, 277601, 285792, 310374, 203879, 310376, 228460, 318573, 203886, 187509, 285815, 285817, 367737, 302205, 285821, 392326, 285831, 253064, 302218, 294026, 285835, 384148, 162964, 187542, 302231, 285849, 302233, 285852, 302237, 285854, 285856, 302241, 285862, 277671, 302248, 64682, 277678, 294063, 294065, 302258, 277687, 294072, 318651, 294076, 277695, 318657, 244930, 302275, 130244, 302277, 228550, 302282, 310476, 302285, 302288, 310481, 302290, 203987, 302292, 302294, 302296, 384222, 310498, 285927, 318698, 302315, 195822, 228592, 294132, 138485, 228601, 204026, 228606, 204031, 64768, 310531, 285958, 138505, 228617, 318742, 204067, 277798, 130345, 277801, 113964, 285997, 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, 310710, 130486, 310712, 277944, 310715, 277947, 302526, 228799, 277950, 277953, 302534, 245191, 310727, 64966, 163272, 277959, 292968, 302541, 277963, 302543, 277966, 310737, 277971, 228825, 163290, 277978, 310749, 277981, 277984, 310755, 277989, 277991, 187880, 277995, 310764, 286188, 278000, 228851, 310772, 278003, 278006, 40440, 212472, 278009, 40443, 286203, 310780, 40448, 228864, 286214, 228871, 302603, 65038, 302614, 302617, 286233, 302621, 187936, 146977, 286240, 187939, 40484, 294435, 40486, 286246, 40488, 278057, 245288, 40491, 294439, 294440, 294443, 310831, 294445, 286248, 40499, 40502, 212538, 40507, 40511, 40513, 228933, 327240, 40521, 286283, 40525, 40527, 400976, 212560, 228944, 40533, 147032, 40537, 40539, 40541, 278109, 40544, 40548, 40550, 40552, 286312, 40554, 286313, 310892, 40557, 40560, 188022, 122488, 294521, 343679, 294537, 310925, 286354, 278163, 302740, 122517, 278168, 179870, 327333, 229030, 212648, 278188, 302764, 278192, 319153, 278196, 302781, 319171, 302789, 294599, 278216, 302793, 294601, 343757, 212690, 278227, 286420, 319187, 229076, 286425, 319194, 278235, 278238, 229086, 286432, 294625, 294634, 302838, 319226, 286460, 278274, 302852, 278277, 302854, 311048, 294664, 352008, 319243, 311053, 302862, 319251, 294682, 278306, 188199, 294701, 319280, 278320, 319290, 229192, 302925, 188247, 280021, 188252, 237409, 229233, 294776, 360317, 294785, 327554, 360322, 40840, 40851, 294803, 188312, 294811, 319390, 237470, 40865, 319394, 294817, 294821, 311209, 180142, 294831, 188340, 40886, 319419, 294844, 294847, 237508, 393177, 294876, 294879, 294883, 393190, 294890, 311279, 278513, 237555, 311283, 278516, 278519, 237562 ]
543ecf6994829c107a44fba4a0fb2f15bbe7c974
ed9fbbe5e79e55af9723336236b748bb7d09feb1
/Cactacea/Classes/Swaggers/Models/NotificationSetting.swift
86e10db002581785ba27ac0f8ebf3ab8d0fc76b3
[ "MIT" ]
permissive
cactacea/ios
d9c8247acb4fc0230dd41033dff7c274fd743f7a
4bb6462b1c2ff5d8bee65cc04d063d8e4c44edaa
refs/heads/master
2021-06-20T14:59:41.432237
2019-11-02T11:13:58
2019-11-02T11:13:58
150,113,874
0
0
MIT
2019-03-03T14:05:14
2018-09-24T14:17:32
Swift
UTF-8
Swift
false
false
2,104
swift
// // NotificationSetting.swift // // Generated by swagger-codegen // https://github.com/swagger-api/swagger-codegen // import Foundation open class NotificationSetting: Codable { public var tweet: Bool public var comment: Bool public var friendRequest: Bool public var message: Bool public var channelMessage: Bool public var invitation: Bool public var showMessage: Bool public init(tweet: Bool, comment: Bool, friendRequest: Bool, message: Bool, channelMessage: Bool, invitation: Bool, showMessage: Bool) { self.tweet = tweet self.comment = comment self.friendRequest = friendRequest self.message = message self.channelMessage = channelMessage self.invitation = invitation self.showMessage = showMessage } // Encodable protocol methods public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: String.self) try container.encode(tweet, forKey: "tweet") try container.encode(comment, forKey: "comment") try container.encode(friendRequest, forKey: "friendRequest") try container.encode(message, forKey: "message") try container.encode(channelMessage, forKey: "channelMessage") try container.encode(invitation, forKey: "invitation") try container.encode(showMessage, forKey: "showMessage") } // Decodable protocol methods public required init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: String.self) tweet = try container.decode(Bool.self, forKey: "tweet") comment = try container.decode(Bool.self, forKey: "comment") friendRequest = try container.decode(Bool.self, forKey: "friendRequest") message = try container.decode(Bool.self, forKey: "message") channelMessage = try container.decode(Bool.self, forKey: "channelMessage") invitation = try container.decode(Bool.self, forKey: "invitation") showMessage = try container.decode(Bool.self, forKey: "showMessage") } }
[ -1 ]
ce2224e453f2e2fefe562d2d9556085bba8d2e98
5e3c11567972a8e6cf1da02e46e6c74241329948
/SideMenuTest/HistoryViewController.swift
32a2295eb0fc760a1bf7a755437525e3498b5a01
[]
no_license
raqeeb23/SideMenuUsingLibrary
9e65cb2179386829057683a082172292c178a829
f0abf30682804097141121896bb69321135c073d
refs/heads/master
2021-01-14T19:30:31.807924
2020-02-24T12:29:51
2020-02-24T12:29:51
242,731,237
0
0
null
null
null
null
UTF-8
Swift
false
false
1,256
swift
// // HistoryViewController.swift // SideMenuTest // // Created by mac mini on 20/02/20. // Copyright © 2020 mac mini. All rights reserved. // import UIKit class HistoryViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() title = "History" sideMenuController?.hideMenu(animated: true, completion: nil) // Do any additional setup after loading the view. let backButton: UIBarButtonItem = UIBarButtonItem(title: "Back", style: .plain, target: self, action: #selector(back)) navigationController?.navigationItem.leftBarButtonItem = backButton } @objc func back() { let vc = storyboard?.instantiateViewController(identifier: "ViewController") as! ViewController } @IBAction func GotoHomeScreen(_ sender: Any) { self.dismiss(animated: true, completion: nil) } /* // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepare(for segue: UIStoryboardSegue, sender: Any?) { // Get the new view controller using segue.destination. // Pass the selected object to the new view controller. } */ }
[ -1 ]
e36b54134153ecbe11342f3fb831ade1e4b4f8b3
3c7ddb5c53734be432c89b956a990546226c8f59
/Muzinda DevOps/NewMessageController.swift
54ccb2f0d70005f387ab24c33f673396b57bf018
[]
no_license
C4sse/Muzinda-DevOps
be22e52c1f31f8c9162b71e208c4b1d6af52c43e
81969231187c8369782e1575b3669738d87deabd
refs/heads/master
2020-05-19T15:14:28.246597
2019-05-13T08:40:02
2019-05-13T08:40:02
185,080,978
0
0
null
null
null
null
UTF-8
Swift
false
false
3,058
swift
// // NewMessageController.swift // Spark // // Created by Casse on 13/3/19. // Copyright © 2019 AppsDevo. All rights reserved. // import UIKit import Firebase class NewMessageController: UITableViewController { let cellId = "cellId" var users: [UserModel] = [ ] override func viewDidLoad() { super.viewDidLoad() navigationItem.leftBarButtonItem = UIBarButtonItem(title: "Cancel", style: .plain, target: self, action: #selector(handleCancel)) tableView.register(UserCell.self, forCellReuseIdentifier: cellId) fetchUser() } func fetchUser() { API.User.observeUsers() { (user) in self.users.append(user) DispatchQueue.main.async { self.tableView.reloadData() } } } @objc func handleCancel() { dismiss(animated: true, completion: nil) } override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return users.count } override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: cellId, for: indexPath) as! UserCell let user = users[indexPath.row] cell.textLabel?.text = user.username cell.detailTextLabel?.text = user.email if let profileImageUrl = user.profileImageUrl { cell.profileImageView.loadImageUsingCacheWithUrlString(urlString: profileImageUrl) } return cell } override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { return 60 } var messagesController: MessagesController? override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { dismiss(animated: true) { print("dimiss completed") let user = self.users[indexPath.row] self.messagesController!.showChatControllerForUser(user: user) } } } let imageCache = NSCache<AnyObject, AnyObject>() extension UIImageView { func loadImageUsingCacheWithUrlString(urlString: String) { if let cachedImage = imageCache.object(forKey: urlString as AnyObject) as? UIImage { self.image = cachedImage return } let url = NSURL(string: urlString) URLSession.shared.dataTask(with: url! as URL, completionHandler: { (data, response, error) in if error != nil { print(error as Any) return } DispatchQueue.main.async { if let downloadedImage = UIImage(data: data!) { imageCache.setObject(downloadedImage, forKey: urlString as AnyObject) self.image = downloadedImage } } }).resume() } }
[ 316620 ]
242cf9739d338b4254ae938bbc10c54b41af5cac
efcbf87c7090d9b3ef2c4245dbb9ac54792c2d96
/PracticeRxUITests/PracticeRxUITests.swift
ca6bd3f81b6817fa924f3bcf90c8f1ea0cd33240
[]
no_license
MiuraToya/MVVM-by-RxSwift
8e20e22edb749a023fbf200fe3785c089c434a19
5f0fd1f644360d7e9847aa462e0754a7a24920a8
refs/heads/main
2023-05-21T19:50:54.280259
2021-06-12T03:59:40
2021-06-12T03:59:40
375,434,785
0
0
null
null
null
null
UTF-8
Swift
false
false
1,428
swift
// // PracticeRxUITests.swift // PracticeRxUITests // // Created by 三浦 登哉 on 2021/06/09. // import XCTest class PracticeRxUITests: 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, 368717, 311373, 196687, 278607, 311377, 254039, 426074, 368732, 180317, 32871, 352359, 221292, 278637, 385135, 319599, 376945, 131190, 385147, 131199, 426124, 196758, 49308, 65698, 311459, 49317, 377008, 377010, 180409, 295099, 377025, 377033, 164043, 417996, 254157, 368849, 368850, 139478, 229591, 385240, 254171, 147679, 147680, 311520, 205034, 254189, 286957, 254193, 344312, 336121, 262403, 147716, 385291, 368908, 180494, 262419, 368915, 254228, 319764, 278805, 377116, 254250, 311596, 131374, 418095, 336177, 368949, 180534, 155968, 287040, 311622, 270663, 368969, 254285, 180559, 377168, 344402, 229716, 368982, 270703, 139641, 385407, 385409, 270733, 106893, 385423, 385433, 213402, 385437, 254373, 156069, 385448, 385449, 115116, 385463, 319931, 278974, 336319, 336323, 188870, 278988, 278992, 262619, 377309, 377310, 369121, 369124, 279014, 270823, 279017, 311787, 213486, 360945, 139766, 393719, 279030, 377337, 279033, 254459, 410108, 410109, 262657, 377346, 279042, 279053, 410126, 262673, 385554, 393745, 303635, 279060, 279061, 254487, 410138, 279066, 188957, 377374, 385569, 385578, 377388, 197166, 393775, 418352, 33339, 352831, 33344, 385603, 377419, 385612, 303693, 426575, 385620, 369236, 115287, 189016, 270938, 287327, 279143, 279150, 287345, 352885, 352886, 344697, 189054, 287359, 385669, 369285, 311944, 344714, 311950, 377487, 311953, 287379, 336531, 180886, 426646, 352921, 377499, 221853, 344737, 295591, 352938, 295598, 418479, 279215, 279218, 164532, 336565, 287418, 377531, 303802, 377534, 377536, 66243, 385737, 287434, 385745, 279249, 303826, 369365, 369366, 385751, 230105, 361178, 352989, 352990, 418529, 295649, 385763, 295653, 369383, 230120, 361194, 312046, 418550, 344829, 279293, 205566, 197377, 434956, 312076, 295698, 418579, 426772, 197398, 426777, 221980, 344864, 197412, 336678, 262952, 189229, 262957, 164655, 197424, 328495, 197428, 336693, 230198, 377656, 426809, 197433, 222017, 295745, 377669, 197451, 369488, 279379, 385878, 385880, 295769, 197467, 435038, 230238, 279393, 303973, 279398, 385895, 197479, 385901, 197489, 295799, 164730, 336765, 254851, 369541, 172936, 320394, 426894, 377754, 172971, 140203, 377778, 304050, 189365, 377789, 189373, 345030, 345034, 279499, 418774, 386007, 386009, 418781, 386016, 123880, 418793, 320495, 222193, 435185, 271351, 214009, 312313, 435195, 328701, 312317, 386049, 328705, 418819, 410629, 377863, 189448, 230411, 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, 377986, 279686, 402568, 222344, 140426, 337037, 386191, 410772, 222364, 418975, 124073, 402618, 148674, 402632, 148687, 402641, 189651, 419028, 279766, 189656, 304353, 279780, 222441, 279789, 386288, 66802, 271607, 369912, 386296, 369913, 419066, 386300, 279803, 386304, 369929, 419097, 320795, 115997, 222496, 320802, 304422, 369964, 353581, 116014, 66863, 312628, 345397, 345398, 386363, 222523, 345418, 353611, 337228, 337226, 353612, 230730, 296269, 353617, 222542, 238928, 296274, 378201, 230757, 296304, 312688, 337280, 353672, 263561, 296328, 296330, 370066, 9618, 411028, 279955, 370072, 148899, 148900, 361928, 337359, 329168, 312785, 329170, 222674, 353751, 280025, 239069, 361958, 271850, 280042, 280043, 271853, 329198, 411119, 337391, 116209, 296434, 386551, 288252, 271880, 198155, 329231, 304655, 370200, 222754, 157219, 157220, 394793, 312879, 288305, 288319, 288322, 280131, 288328, 353875, 312937, 271980, 206447, 403057, 42616, 337533, 280193, 370307, 419462, 149127, 149128, 419464, 288391, 411275, 214667, 239251, 345753, 198304, 255651, 337590, 370359, 280252, 280253, 321217, 239305, 296649, 403149, 313042, 345813, 370390, 272087, 345817, 337638, 181992, 345832, 345835, 288492, 141037, 313082, 288508, 288515, 173828, 395018, 395019, 116491, 395026, 116502, 435993, 345882, 411417, 255781, 362281, 378666, 403248, 378673, 345910, 182070, 182071, 436029, 345918, 337734, 280396, 272207, 272208, 337746, 362326, 345942, 370526, 345950, 362336, 255844, 296807, 214894, 362351, 214896, 313200, 313204, 182145, 280451, 67464, 305032, 337816, 329627, 239515, 354210, 436130, 436135, 10153, 313257, 362411, 370604, 362418, 280517, 362442, 346066, 231382, 354268, 436189, 403421, 329696, 354273, 403425, 354279, 436199, 174058, 337899, 354283, 247787, 329707, 296942, 247786, 436209, 239610, 182277, 346117, 403463, 43016, 354312, 354311, 354310, 313356, 436235, 419857, 305173, 436248, 223269, 346153, 354346, 313388, 272432, 403507, 378933, 378934, 436283, 288835, 403524, 436293, 313415, 239689, 436304, 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, 436471, 395511, 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, 436613, 395653, 395660, 264591, 272784, 420241, 240020, 190870, 43416, 190872, 289185, 436644, 289195, 272815, 436659, 338359, 436677, 289229, 281038, 281039, 256476, 420326, 166403, 420374, 322077, 289328, 330291, 322119, 191065, 436831, 420461, 346739, 346741, 420473, 297600, 166533, 363155, 346771, 264855, 363161, 289435, 436897, 248494, 166581, 355006, 363212, 363228, 436957, 322269, 436960, 264929, 338658, 289511, 330473, 346859, 330476, 289517, 215790, 199415, 289534, 322302, 35584, 133889, 322312, 346889, 166677, 207639, 363295, 355117, 191285, 273209, 355129, 273211, 355136, 355138, 420680, 355147, 355148, 355153, 281426, 387927, 363353, 363354, 281434, 420702, 363361, 363362, 412516, 355173, 355174, 281444, 207724, 355182, 207728, 420722, 314240, 158594, 330627, 240517, 387977, 396171, 355216, 224146, 224149, 256918, 256919, 256920, 240543, 256934, 273336, 289720, 289723, 273341, 330688, 379845, 363462, 19398, 273353, 191445, 207839, 347104, 314343, 134124, 412653, 248815, 257007, 347122, 437245, 257023, 125953, 396292, 330759, 347150, 330766, 412692, 330789, 248871, 281647, 412725, 257093, 404550, 207954, 339031, 404582, 257126, 265318, 322664, 265323, 396395, 404589, 273523, 363643, 248960, 363658, 404622, 224400, 265366, 347286, 429209, 339101, 429216, 380069, 265381, 3243, 208044, 322733, 421050, 339131, 265410, 183492, 273616, 421081, 339167, 298209, 421102, 363769, 52473, 208123, 52476, 412926, 437504, 322826, 388369, 380178, 429332, 126229, 412963, 257323, 437550, 273713, 298290, 208179, 159033, 347451, 372039, 257353, 257354, 109899, 437585, 331091, 150868, 314708, 372064, 429410, 437602, 281958, 388458, 265579, 306541, 421240, 224637, 388488, 298378, 306580, 282008, 396697, 282013, 290206, 396709, 298406, 241067, 314797, 380335, 355761, 421302, 134586, 380348, 216510, 380350, 216511, 306630, 200136, 273865, 306634, 339403, 372172, 413138, 421338, 437726, 429540, 3557, 3559, 191980, 282097, 265720, 216575, 290304, 372226, 437766, 323083, 208397, 323088, 413202, 413206, 388630, 175640, 216610, 372261, 347693, 323120, 396850, 200245, 323126, 290359, 134715, 323132, 421437, 396865, 282182, 413255, 273992, 265800, 421452, 265809, 396885, 290391, 265816, 396889, 306777, 388699, 396896, 388712, 388713, 314997, 290425, 339579, 396927, 282248, 224907, 396942, 405140, 274071, 323226, 208547, 208548, 405157, 388775, 282279, 364202, 421556, 224951, 224952, 306875, 282302, 323262, 241366, 224985, 282330, 159462, 372458, 397040, 12017, 323315, 274170, 200444, 175874, 249606, 282379, 216844, 372497, 397076, 421657, 339746, 216868, 257831, 167720, 241447, 421680, 282418, 274234, 339782, 315209, 159563, 339799, 307038, 274276, 282471, 274288, 372592, 274296, 339840, 372625, 282517, 298912, 118693, 438186, 126896, 151492, 380874, 372699, 323554, 380910, 380922, 380923, 274432, 372736, 241695, 430120, 102441, 315433, 430127, 405552, 282671, 241717, 249912, 225347, 307269, 421958, 233548, 176209, 381013, 53334, 315477, 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, 356550, 299208, 372943, 266447, 258263, 356575, 307431, 438512, 372979, 389364, 381173, 135416, 356603, 184574, 266504, 217352, 61720, 381210, 282908, 389406, 282912, 233761, 438575, 315698, 266547, 397620, 332084, 438583, 127292, 438592, 323914, 201037, 397650, 348499, 250196, 348501, 389465, 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, 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, 234330, 275294, 381791, 127840, 357219, 439145, 177002, 308075, 381811, 201590, 177018, 398205, 340865, 291713, 349066, 316299, 349068, 234382, 308111, 381840, 308113, 390034, 373653, 430999, 209820, 381856, 398244, 185252, 422825, 381872, 177074, 398268, 349122, 398275, 373705, 127945, 340960, 398305, 340967, 398313, 234476, 127990, 349176, 201721, 349179, 234499, 357380, 398370, 357413, 357420, 300087, 21567, 308288, 398405, 349254, 218187, 250955, 300109, 234578, 250965, 439391, 250982, 398444, 62574, 357487, 300147, 119925, 349304, 234626, 349315, 349317, 234635, 373902, 234655, 234662, 373937, 373939, 324790, 300215, 218301, 283841, 283846, 259275, 316628, 259285, 357594, 414956, 251124, 316661, 292092, 439550, 439563, 242955, 414989, 259346, 349458, 259347, 382243, 382246, 382257, 292145, 382264, 333115, 193853, 193858, 251212, 406862, 234830, 259408, 283990, 357720, 300378, 300379, 374110, 234864, 259449, 382329, 357758, 243073, 357763, 112019, 398740, 234902, 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, 415369, 431754, 210569, 267916, 415376, 259741, 153252, 399014, 210601, 202413, 415419, 259780, 333508, 267978, 333522, 325345, 333543, 325357, 431861, 284410, 161539, 284425, 300812, 284430, 366358, 169751, 431901, 341791, 186148, 186149, 284460, 202541, 431918, 399148, 153392, 431935, 415555, 325444, 153416, 325449, 341837, 415566, 431955, 325460, 341846, 300893, 259937, 382820, 276326, 415592, 292713, 292719, 325491, 341878, 276343, 350072, 333687, 112510, 325508, 333700, 243590, 325514, 350091, 350092, 350102, 350108, 333727, 219046, 284584, 292783, 300983, 128955, 219102, 292835, 6116, 317416, 432114, 325620, 415740, 268286, 415744, 243720, 399372, 153618, 358418, 178215, 325675, 243763, 358455, 399433, 333902, 104534, 194667, 260206, 432241, 284789, 374913, 374914, 415883, 333968, 153752, 333990, 104633, 260285, 227517, 268479, 374984, 301270, 301271, 334049, 325857, 268515, 383208, 317676, 260337, 260338, 432373, 375040, 309504, 432387, 260355, 375052, 194832, 325904, 391448, 268570, 178459, 186660, 268581, 334121, 358698, 317738, 260396, 325930, 432435, 358707, 178485, 358710, 14654, 268609, 227655, 383309, 383327, 391521, 366948, 416101, 416103, 383338, 432503, 432511, 211327, 227721, 285074, 252309, 39323, 285083, 317851, 285089, 375211, 334259, 129461, 342454, 358844, 293309, 317889, 326083, 416201, 129484, 154061, 416206, 326093, 432608, 285152, 391654, 432616, 334315, 375281, 293368, 317949, 334345, 432650, 309770, 342537, 342549, 342560, 416288, 350758, 350759, 358951, 358952, 293420, 219694, 219695, 375345, 432694, 244279, 309831, 375369, 375373, 416334, 301647, 416340, 244311, 416353, 260705, 375396, 268901, 244345, 334473, 375438, 326288, 285348, 293552, 342705, 285362, 383668, 342714, 39616, 383708, 342757, 269036, 432883, 203511, 342775, 383740, 416509, 359166, 162559, 375552, 432894, 228099, 285443, 285450, 383755, 326413, 285467, 326428, 318247, 342827, 391980, 318251, 375610, 301883, 342846, 416577, 416591, 244569, 375644, 252766, 293729, 351078, 342888, 392057, 211835, 392065, 260995, 400262, 392071, 424842, 236427, 252812, 400271, 392080, 400282, 7070, 211871, 359332, 359333, 293801, 326571, 252848, 326580, 261045, 261046, 326586, 359365, 211913, 326602, 342990, 252878, 433104, 56270, 359380, 433112, 433116, 359391, 187372, 343020, 383980, 203758, 383994, 171009, 384004, 433166, 384015, 433173, 293911, 326684, 252959, 384031, 375848, 318515, 203829, 261191, 375902, 375903, 392288, 253028, 351343, 187505, 138354, 187508, 302202, 285819, 392317, 343166, 384127, 392320, 285823, 285833, 285834, 318602, 228492, 253074, 326803, 187539, 359574, 285850, 351389, 302239, 253098, 302251, 367791, 367792, 367798, 64699, 294075, 228541, 343230, 367809, 253124, 113863, 351445, 310496, 195809, 253168, 351475, 351489, 367897, 367898, 245018, 130342, 130344, 130347, 261426, 212282, 294210, 359747, 359748, 146760, 146763, 114022, 253288, 425327, 425331, 163190, 327030, 384379, 253316, 294278, 384391, 318860, 253339, 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, 163575, 286457, 286463, 319232, 360194, 409355, 155408, 417556, 294699, 319289, 384826, 409404, 360253, 409416, 376661, 237397, 368471, 425820, 368486, 384871, 409446, 368489, 40809, 425832, 417648, 417658, 360315, 253828, 327556, 311183, 425875, 294806, 294808, 253851, 376733, 204702, 319393, 294820, 253868, 204722, 188349, 98240, 212947, 212953, 360416, 294887, 253930, 327666, 385011 ]
4bbbf8460baeb24d64e3b8a8b2719b03d62cf5ef
11d64ed779ad0173f250c615c44949a3db2de3d4
/Bobber WatchKit Extension/NotificationController.swift
c1b6ceb6d8320fb8cd5e048949474bd2733970b2
[]
no_license
aryaxt/Bobber
54d30e9b5e2d1060f2ae7aa5a974111fec682983
fd00ecb986109142f8ad1adc77183c9bda5e60fe
refs/heads/master
2021-01-14T14:23:22.308012
2016-01-06T17:42:10
2016-01-06T17:42:10
28,982,438
4
0
null
null
null
null
UTF-8
Swift
false
false
1,855
swift
// // NotificationController.swift // Bobber WatchKit Extension // // Created by Aryan Ghassemi on 3/14/15. // Copyright (c) 2015 aryaxt. All rights reserved. // import WatchKit import Foundation class NotificationController: WKUserNotificationInterfaceController { override init() { // Initialize variables here. super.init() // Configure interface objects here. } override func willActivate() { // This method is called when watch view controller is about to be visible to user super.willActivate() } override func didDeactivate() { // This method is called when watch view controller is no longer visible super.didDeactivate() } /* override func didReceiveLocalNotification(localNotification: UILocalNotification, withCompletion completionHandler: ((WKUserNotificationInterfaceType) -> Void)) { // This method is called when a local notification needs to be presented. // Implement it if you use a dynamic notification interface. // Populate your dynamic notification interface as quickly as possible. // // After populating your dynamic notification interface call the completion block. completionHandler(.Custom) } */ /* override func didReceiveRemoteNotification(remoteNotification: [NSObject : AnyObject], withCompletion completionHandler: ((WKUserNotificationInterfaceType) -> Void)) { // This method is called when a remote notification needs to be presented. // Implement it if you use a dynamic notification interface. // Populate your dynamic notification interface as quickly as possible. // // After populating your dynamic notification interface call the completion block. completionHandler(.Custom) } */ }
[ 282371, 282385, 216859, 66075, 282413, 178353, 282420, 7226, 282305, 309446, 282314, 180044, 282323, 196054, 282332, 286178, 282341, 229221, 282351, 34674, 144501, 282360 ]
657c7846d71f5a98b7d12420f9d3dd5799073f8c
28e2a07aed23636737d8ace05df6de39d6438f98
/Morse/ViewController.swift
feaad7a2c111a80ad02ecd7e3c81985392866a5a
[]
no_license
jorgenrh/morse
376b07f3b01227a81f24e3108055cb45540d1cdd
ceed97b10e79bb1ca83f19535eff9a5f69263171
refs/heads/master
2021-01-10T09:20:36.147511
2016-03-20T23:23:05
2016-03-20T23:23:05
54,240,972
1
0
null
null
null
null
UTF-8
Swift
false
false
5,086
swift
// // ViewController.swift // Morse // // Created by J.R.Hoem on 28.09.15. // Copyright © 2015 JRH. All rights reserved. // /* https://stackoverflow.com/questions/7298342/generating-morse-code-style-tones-in-objective-c You need to be able to generate tones of a specific duration, separated by silences of a specific duration. So long as you have these two building blocks you can send morse code: dot = 1 unit dash = 3 units space between dots/dashes within a letter = 1 unit space between letters = 3 units space between words = 5 units The length of unit determines the overall speed of the morse code. Start with e.g. 50 ms. The tone should just be a pure sine wave at an appropriate frequency, e.g. 400 Hz. The silence can just be an alternate buffer containing all zeroes. That way you can "play" both the tone and the silence using the same API, without worrying about timing/synchronisation, etc. */ import UIKit class ViewController: UIViewController { @IBOutlet weak var encodedTextView: MDTextView! @IBOutlet weak var decodedTextView: MDTextView! let morse = MorseTranslater() override func viewDidLoad() { super.viewDidLoad() /* for _ in 1...10 { TorchGenerator.sharedInstance.setTorch(0.1, duration: 1000) TorchGenerator.sharedInstance.setTorch(0.0, duration: 1000) } */ //self.addDoneButtonOnKeyboard(encodedTextView) //self.addDoneButtonOnKeyboard(decodedTextView) } /* func addDoneButtonOnKeyboard() { let doneToolbar: UIToolbar = UIToolbar(frame: CGRectMake(0, 0, 320, 50)) doneToolbar.barStyle = UIBarStyle.BlackTranslucent let flexSpace = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.FlexibleSpace, target: nil, action: nil) var done: UIBarButtonItem = UIBarButtonItem(title: "Done", style: UIBarButtonItemStyle.Done, target: self, action: Selector("doneButtonAction")) //let done: UIBarButtonItem = UIBarButtonItem(title: "Done", style: UIBarButtonItemStyle.Done, target: view, action: "resignFirstResponder") var items = [UIBarButtonItem]() items.append(flexSpace) items.append(done) doneToolbar.items = items doneToolbar.sizeToFit() self.encodedTextView.inputAccessoryView = doneToolbar self.decodedTextView.inputAccessoryView = doneToolbar } func doneButtonAction() { self.encodedTextView.resignFirstResponder() self.decodedTextView.resignFirstResponder() } */ func addDoneButtonOnKeyboard(view: UIView?) { let doneToolbar: UIToolbar = UIToolbar(frame: CGRectMake(0, 0, 320, 50)) doneToolbar.barStyle = UIBarStyle.BlackTranslucent let flexSpace = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.FlexibleSpace, target: nil, action: nil) let done: UIBarButtonItem = UIBarButtonItem(title: "Done", style: UIBarButtonItemStyle.Done, target: view, action: "resignFirstResponder") var items = [UIBarButtonItem]() items.append(flexSpace) items.append(done) doneToolbar.items = items //as? [UIBarButtonItem] doneToolbar.sizeToFit() if let accessorizedView = view as? UITextView { accessorizedView.inputAccessoryView = doneToolbar accessorizedView.inputAccessoryView = doneToolbar } else if let accessorizedView = view as? UITextField { accessorizedView.inputAccessoryView = doneToolbar accessorizedView.inputAccessoryView = doneToolbar } } @IBAction func encodeBtnPressed(sender: UIButton) { let encode = morse.encodeText(encodedTextView.text) decodedTextView.text = encode } @IBAction func decodeBtnPressed(sender: UIButton) { let decode = morse.decodeText(decodedTextView.text) encodedTextView.text = decode } @IBAction func playBtnPressed(sender: UIButton) { if sender.titleLabel?.text == "Tone" { sender.setTitle("Stop", forState: .Normal) morse.playTone(decodedTextView.text) } else { sender.setTitle("Tone", forState: .Normal) morse.stopTone() } } @IBAction func torchBtnPressed(sender: UIButton) { if sender.titleLabel?.text == "Torch" { sender.setTitle("Stop", forState: .Normal) morse.runTorch(decodedTextView.text) } else { sender.setTitle("Torch", forState: .Normal) morse.stopTorch() } } @IBAction func toneTorchBtnPressed(sender: UIButton) { if sender.titleLabel?.text == "Tone & Torch" { sender.setTitle("Stop", forState: .Normal) //morse.runToneTorch(decodedTextView.text) morse.runAV(decodedTextView.text) } else { sender.setTitle("Tone & Torch", forState: .Normal) morse.stopAV() } } }
[ -1 ]
fe6694bfac17c6fd65b1b6f567b9eae9b9cd9320
5e2109f764c958e3af84f0f2f02acb3de1ea2a82
/Curve/Curve.swift
49dd528eda6682e1c4800214e5a510712e369e50
[]
no_license
Curnelius/Papaya
767daa1b841121145c18dc98062692c17f5563f8
99ae6064e5dee4803fbcf129c8b3a167d585bae7
refs/heads/master
2020-04-03T05:37:02.415568
2018-11-12T07:12:53
2018-11-12T07:12:53
155,051,332
0
1
null
null
null
null
UTF-8
Swift
false
false
2,077
swift
// // Curve.swift // Papaya // // Created by ran T on 28/10/2018. // Copyright © 2018 ran T. All rights reserved. // import UIKit class Curve: UIView { var container:CurveContainer! var cornerRadius = 26.0 //observe vars changes all the time var title = "" { didSet {container.curveTitles.title.text=title} } var subtitle = "" { didSet {container.curveTitles.subtitle.text=subtitle} } var font = "" { didSet { container.curveTitles.title.font=UIFont(name: font, size: 24) container.curveTitles.subtitle.font=UIFont(name: font, size: 12) }} override init (frame : CGRect) { super.init(frame : frame) //THIS VIEW HOLDS THE CONTAINER THAT HOLDS THE OTHER VIEWS //THIS VIEW HAS THE SHADOW AND TAKE CARE OF LOGICS self.layer.cornerRadius = CGFloat(cornerRadius) self.backgroundColor=UIColor.white self.clipsToBounds=false self.backgroundColor=UIColor.white self.layer.shadowColor=UIColor(red: 0.875, green: 0.875, blue: 0.875, alpha: 1.0).cgColor self.layer.shadowOffset=CGSize(width: 2.0, height: 2.0) self.layer.shadowRadius=5.0 self.layer.shadowOpacity=1.0 //add container with all views container = CurveContainer(frame: CGRect(x: 0, y: 0, width: frame.width, height: frame.height)) self.addSubview(container) } convenience init () { self.init(frame:CGRect.zero) } func addNewCurve(name:String, data:[[String:Any]], fillColor:UIColor, lineColor:UIColor, animation:String) { container.addNewCurve(name: name, data: data, fillColor: fillColor, lineColor: lineColor, animation: animation) } required init(coder aDecoder: NSCoder) { fatalError("This class does not support NSCoding") } }
[ -1 ]
686495a8772b84f21aff9732907e9a159209f32a
12f1e34fb6d2cd458466694de4c62ea0aaa1155c
/BluePic/DataManagers/BluemixDataManager.swift
a206215d35c9ed628500645277b0ae73909bee89
[]
no_license
fakanbrandli/BluePic
b29f65f56b677d6aea30f5ff006acd76a96f37fd
fca19e12daaf8b70bf630cdbae5813b1d1776de1
refs/heads/master
2021-01-20T11:38:48.928227
2017-02-25T20:21:12
2017-02-25T20:21:12
83,159,893
0
0
null
null
null
null
UTF-8
Swift
false
false
24,461
swift
/** * Copyright IBM Corporation 2016 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. **/ import UIKit import BMSCore enum BlueMixDataManagerError: Error { //error when the user does not exist when we attempt to get the user by id case userDoesNotExist //error when there is a connection failure when doing a REST call case connectionFailure } extension Notification.Name { //Notification to notify the app that the REST call to get all images has started static let getAllImagesStarted = Notification.Name("GetAllImagesStarted") //Notification to notify the app that repulling for images has completed, the images have been refreshed static let imagesRefreshed = Notification.Name("ImagesRefreshed") //Notification to notify the app that uploading an image has began static let imageUploadBegan = Notification.Name("ImageUploadBegan") //Notification to nofify the app that Image upload was successfull static let imageUploadSuccess = Notification.Name("ImageUploadSuccess") //Notification to notify the app that image upload failed static let imageUploadFailure = Notification.Name("ImageUploadFailure") //Notificaiton used when there was a server error getting all the images static let getAllImagesFailure = Notification.Name("GetAllImagesFailure") //Notification to notify the app that the popular tags were receieved static let popularTagsReceived = Notification.Name("PopularTagsReceived") } class BluemixDataManager: NSObject { //Make BluemixDataManager a singlton static let SharedInstance: BluemixDataManager = { var manager = BluemixDataManager() return manager }() //holds all images for the app var images = [Image]() //filters images variable to only images taken by the user var currentUserImages: [Image] { get { return images.filter({ $0.user.facebookID == CurrentUser.facebookUserId}) } } /// images that were taken during this app session (used to help make images appear faster in the image feed as we wait for the image to download from the url var imagesTakenDuringAppSessionById = [String : UIImage]() //array that stores all the images currently being uploaded. This is used to show the images currently posting on the feed var imagesCurrentlyUploading: [ImagePayload] = [] //array that stores all the images that failed to upload. This is used so users can rety try uploading images that failed. var imagesThatFailedToUpload: [ImagePayload] = [] //stores the most popular tags var tags = [String]() //stores all the bluemix configuration setup let bluemixConfig = BluemixConfiguration() //default timeout is 60 seconds fileprivate let kDefaultTimeOut: Double = 60 //End Points fileprivate let kImagesEndPoint = "images" fileprivate let kUsersEndPoint = "users" fileprivate let kTagsEndPoint = "tags" fileprivate let kPingEndPoint = "ping" //used to help the feed view model decide to show the loading animaiton on the feed vc var hasReceievedInitialImages = false /** Method initilizes the BMSClient */ func initilizeBluemixAppRoute() { BMSClient.sharedInstance.initialize(bluemixRegion: bluemixConfig.appRegion) BMSClient.sharedInstance.requestTimeout = 10.0 } /** Method gets the Bluemix base request URL depending on if the isLocal key is set in the plist or not - returns: String */ func getBluemixBaseRequestURL() -> String { if bluemixConfig.isLocal { return bluemixConfig.localBaseRequestURL } else { return bluemixConfig.remoteBaseRequestURL } } } // MARK: - Methods related to getting/creating users extension BluemixDataManager { /** Method gets user by id and will return the parsed response in the result callback - parameter userId: String - parameter result: (user : User?, error : BlueMixDataManagerError?) -> () */ func getUserById(_ userId: String, result: @escaping (_ user: User?, _ error: BlueMixDataManagerError?) -> ()) { let requestURL = getBluemixBaseRequestURL() + "/" + kUsersEndPoint + "/" + userId let request = Request(url: requestURL, method: HttpMethod.GET) request.timeout = kDefaultTimeOut request.send { response, error in //error if let error = error { if let response = response, let statusCode = response.statusCode { //user does not exist if statusCode == 404 { result(nil, BlueMixDataManagerError.userDoesNotExist) } //any other error code means that it was a connection failure else { print(NSLocalizedString("Get User By ID Error:", comment : "") + " \(error.localizedDescription)") result(nil, BlueMixDataManagerError.connectionFailure) } } //connection failure else { print(NSLocalizedString("Get User By ID Error:", comment : "") + " \(error.localizedDescription)") result(nil, BlueMixDataManagerError.connectionFailure) } } //No error else { //success if let user = User(response) { result(user, nil) } //can't parse response - error else { print(NSLocalizedString("Get User By ID Error: Invalid Response JSON)", comment: "")) result(nil, BlueMixDataManagerError.connectionFailure) } } } } /** Method creates a new user and returns the parsed response in the result callback - parameter userId: String - parameter name: String - parameter result: ((user : User?) -> ()) */ func createNewUser(_ userId: String, name: String, result : @escaping (_ user: User?) -> ()) { let requestURL = getBluemixBaseRequestURL() + "/" + kUsersEndPoint let request = Request(url: requestURL, method: HttpMethod.POST) request.timeout = kDefaultTimeOut let json = ["_id": userId, "name": name] do { let jsonData = try JSONSerialization.data(withJSONObject: json, options: .prettyPrinted) request.send(requestBody: jsonData) { response, error in if let error = error { result(nil) print(NSLocalizedString("Create New User Error:)", comment: "") + " \(error.localizedDescription)") } else { if let user = User(response) { result(user) } else { result(nil) print(NSLocalizedString("Create New User Error: Invalid Response JSON", comment: "")) } } } } catch { print(NSLocalizedString("Create New User Error", comment: "")) result(nil) } } /** Method checks to see if a user already exists, if the user doesn't exist then it creates a new user. It will return the parsed response in the callback parameter - parameter userId: String - parameter name: String - parameter callback: ((success : Bool) -> ()) */ func checkIfUserAlreadyExistsIfNotCreateNewUser(_ userId: String, name: String, callback : @escaping ((_ success: Bool) -> ())) { getUserById(userId, result: { (user, error) in if let error = error { //user does not exist so create new user if error == BlueMixDataManagerError.userDoesNotExist { self.createNewUser(userId, name: name, result: { user in if user != nil { callback(true) } else { callback(false) } }) } else if error == BlueMixDataManagerError.connectionFailure { print(NSLocalizedString("Check If User Already Exists Error: Connection Failure", comment: "")) callback(false) } } else { callback(true) } }) } } // MARK: - Methods related to gettings images extension BluemixDataManager { /** Method gets all the images posted on BluePic. When this request begins, the GetAllImagesStarted BluemixDataManagerNotification is sent out to the app. When the images have been successfully received, the ImagesRefreshed BluemixDataManagerNotification will be sent out */ func getImages() { NotificationCenter.default.post(name: .getAllImagesStarted, object: nil) let requestURL = getBluemixBaseRequestURL() + "/" + kImagesEndPoint let request = Request(url: requestURL, method: HttpMethod.GET) self.getImages(request) { images in if let images = images { self.images = images self.hasReceievedInitialImages = true NotificationCenter.default.post(name: .imagesRefreshed, object: nil) } else { print(NSLocalizedString("Get Images Error: Connection Failure", comment: "")) self.hasReceievedInitialImages = true NotificationCenter.default.post(name: .getAllImagesFailure, object: nil) } } } /** Method gets all the images by the specified tags in the tags parameter. When a response is receieved, we pass back the images we receive in the callback parameter - parameter tags: [String] - parameter callback: (images : [Image]?)->() */ func getImagesByTags(_ tags: [String], callback : @escaping (_ images: [Image]?)->()) { var requestURL = getBluemixBaseRequestURL() + "/" + kImagesEndPoint + "?tag=" for (index, tag) in tags.enumerated() { guard let encodedTag = tag.addingPercentEncoding(withAllowedCharacters: CharacterSet.urlQueryAllowed) else { print(NSLocalizedString("Get Images By Tags Error: Failed to encode search tag", comment: "")) continue } if index == 0 { requestURL.append(encodedTag.lowercased()) } else { requestURL.append(",\(encodedTag.lowercased())") } } let request = Request(url: requestURL, method: HttpMethod.GET) self.getImages(request) { images in callback(images) } } /** Helper method to getImages and getImagesByTags method. It makes the request and then parses the response into an image array, then passes back response in result parameter - parameter request: Request - parameter result: (images : [Image]?)-> () */ func getImages(_ request: Request, result : @escaping (_ images: [Image]?) -> ()) { request.timeout = kDefaultTimeOut request.send { response, error in if let error = error { print(NSLocalizedString("Get Images Error:", comment: "") + " \(error.localizedDescription)") result(nil) } else { let images = self.parseGetImagesResponse(response, userId: nil, usersName: nil) result(images) } } } /** Method parses the getImages response and returns an array of images - parameter response: Response? - parameter userId: String? - parameter usersName: String? - returns: [Image] */ fileprivate func parseGetImagesResponse(_ response: Response?, userId: String?, usersName: String?) -> [Image] { var images = [Image]() if let dict = Utils.convertResponseToDictionary(response), let records = dict["records"] as? [[String: Any]] { for var record in records { if let userId = userId, let usersName = usersName { var user = [String: String]() user["name"] = usersName user["_id"] = userId record["user"] = user } if let image = Image(record) { images.append(image) } } } return images } } // MARK: - Methods related to image uploading extension BluemixDataManager { /** Method pings service and will be challanged if the app has MCA configured but the user hasn't signed in yet. - parameter callback: (response: Response?, error: Error?) -> Void */ fileprivate func ping(_ callback : @escaping (_ response: Response?, _ error: Error?) -> Void) { let requestURL = getBluemixBaseRequestURL() + "/" + kPingEndPoint let request = Request(url: requestURL, method: HttpMethod.GET) request.timeout = kDefaultTimeOut request.send { response, error in callback(response, error) } } /** Method will first call the ping method, to force the user to login with Facebook (if MCA is configured). When we get a reponse, if we have the Facebook userIdentity, then this means the user succuessfully logged into Facebook (and MCA is configured). We will then try to create a new user and when this is succuessful we finally call the postNewImage method. If we don't have the Facebook user Identity, then this means MCA isn't configured and we will continue by calling the postNewImage method. - parameter image: Image */ func tryToPostNewImage(_ image: ImagePayload) { addImageToImagesCurrentlyUploading(image) NotificationCenter.default.post(name: .imageUploadBegan, object: nil) //ping backend to trigger Facebook login if MCA is configured ping({ (response, error) -> Void in //either there was a network failure, user authentication with facebook failed, or user authentication with facebook was canceled by the user if let _ = error { print(NSLocalizedString("Try To Post New Image Error: Ping failed", comment: "")) self.handleImageUploadFailure(image) } //successfully pinged service else { //Check if User Authenticated with Facebook (aka is MCA configured) if let userIdentity = FacebookDataManager.SharedInstance.getFacebookUserIdentity(), let facebookUserId = userIdentity.ID, let facebookUserFullName = userIdentity.displayName { //User is authenticated with Facebook, create new user record self.createNewUser(facebookUserId, name: facebookUserFullName, result: { user in if let _ = user { CurrentUser.facebookUserId = facebookUserId CurrentUser.fullName = facebookUserFullName //User Authentication complete, ready to post image self.postNewImage(image) } //Something went wrong creating new user else { print(NSLocalizedString("Try To Post New Image Error: Something went wrong calling create a new user", comment: "")) self.handleImageUploadFailure(image) } }) } //MCA is not configured else { self.postNewImage(image) } } }) } /** Method posts a new image. It will send the ImageUploadBegan notification when the image upload begins. It will send the ImageUploadSuccess notification when the image uploads successfully. For all other errors it will send out the ImageUploadFailure notification. - parameter image: Image */ fileprivate func postNewImage(_ image: ImagePayload) { guard let uiImage = image.image, let imageData = UIImagePNGRepresentation(uiImage) else { print(NSLocalizedString("Post New Image Error: Could not process image data properly", comment: "")) NotificationCenter.default.post(name: .imageUploadFailure, object: nil) return } let requestURL = getBluemixBaseRequestURL() + "/" + kImagesEndPoint let imageDictionary = ["fileName": image.fileName, "caption" : image.caption, "width" : image.width, "height" : image.height, "location" : ["name" : image.location.name, "latitude" : image.location.latitude, "longitude" : image.location.longitude]] as [String : Any] do { let jsonData = try JSONSerialization.data(withJSONObject: imageDictionary, options: JSONSerialization.WritingOptions(rawValue: 0)) let boundary = generateBoundaryString() let mimeType = ("application/json", "image/png") let request = Request(url: requestURL, method: HttpMethod.POST) request.headers = ["Content-Type" : "multipart/form-data; boundary=\(boundary)"] var body = Data() guard let boundaryStart = "--\(boundary)\r\n".data(using: String.Encoding.utf8), let dispositionEncoding = "Content-Disposition:form-data; name=\"imageJson\"\r\n".data(using: String.Encoding.utf8), let typeEncoding = "Content-Type: \(mimeType.0)\r\n\r\n".data(using: String.Encoding.utf8), let imageDispositionEncoding = "Content-Disposition:form-data; name=\"imageBinary\"; filename=\"\(image.fileName)\"\r\n".data(using: String.Encoding.utf8), let imageTypeEncoding = "Content-Type: \(mimeType.1)\r\n\r\n".data(using: String.Encoding.utf8), let imageEndEncoding = "\r\n".data(using: String.Encoding.utf8), let boundaryEnd = "--\(boundary)--\r\n".data(using: String.Encoding.utf8) else { print("Post New Image Error: Could not encode all values for multipart data") NotificationCenter.default.post(name: .imageUploadFailure, object: nil) return } body.append(boundaryStart) body.append(dispositionEncoding) body.append(typeEncoding) body.append(jsonData) body.append(boundaryStart) body.append(imageDispositionEncoding) body.append(imageTypeEncoding) body.append(imageData) body.append(imageEndEncoding) body.append(boundaryEnd) request.timeout = kDefaultTimeOut request.send(requestBody: body) { response, error in //failure if let error = error { print(NSLocalizedString("Post New Image Error:", comment: "") + " \(error.localizedDescription)") self.handleImageUploadFailure(image) } //success else { self.addImageToImageTakenDuringAppSessionByIdDictionary(image) self.removeImageFromImagesCurrentlyUploading(image) NotificationCenter.default.post(name: .imageUploadSuccess, object: nil) } } } catch { print("Error converting image dictionary to Json") } } func generateBoundaryString() -> String { return "Boundary-\(UUID().uuidString)" } /** Method handles when there is an image upload failure. It will remove the image that was uploading from the imagesCurrentlyUploading array, and then will add the image to the imagesThatFailedToUpload array. Finally it will notify the rest of the app with the BluemixDataManagerNotification.ImageUploadFailure notification - parameter image: Image */ fileprivate func handleImageUploadFailure(_ image: ImagePayload) { self.removeImageFromImagesCurrentlyUploading(image) self.addImageToImagesThatFailedToUpload(image) NotificationCenter.default.post(name: .imageUploadFailure, object: nil) } } // MARK: - Methods related to uploading images extension BluemixDataManager { /** Method will retry to upload each image in the imagesThatFailedToUpload array */ func retryUploadingImagesThatFailedToUpload() { for image in imagesThatFailedToUpload { removeImageFromImagesThatFailedToUpload(image) tryToPostNewImage(image) } } /** Method will remove each image in the imagesThatFailedToUpload array */ func cancelUploadingImagesThatFailedToUpload() { for image in imagesThatFailedToUpload { removeImageFromImagesThatFailedToUpload(image) } } /** Method will add the image parameter to the imagesThatFailedToUpload array - parameter image: Image */ fileprivate func addImageToImagesThatFailedToUpload(_ image: ImagePayload) { imagesThatFailedToUpload.append(image) } /** Method will remove the image parameter from the imagesThatFailedToUpload array - parameter image: Image */ fileprivate func removeImageFromImagesThatFailedToUpload(_ image: ImagePayload) { imagesThatFailedToUpload = imagesThatFailedToUpload.filter({ $0 != image}) } /** Method will add the image parameter to the imagesCurrentlyUploading array - parameter image: Image */ fileprivate func addImageToImagesCurrentlyUploading(_ image: ImagePayload) { imagesCurrentlyUploading.append(image) } /** Method will remove the image parameter from the imagesCurrentlyUploading array - parameter image: Image */ fileprivate func removeImageFromImagesCurrentlyUploading(_ image: ImagePayload) { imagesCurrentlyUploading = imagesCurrentlyUploading.filter({ $0 != image}) } /** Method adds the photo to the imagesTakenDuringAppSessionById cache to display the photo in the image feed or profile feed while we wait for the photo to upload to. */ fileprivate func addImageToImageTakenDuringAppSessionByIdDictionary(_ image: ImagePayload) { let id = image.fileName + CurrentUser.facebookUserId imagesTakenDuringAppSessionById[id] = image.image } } // MARK: - Methods related to tags extension BluemixDataManager { /** Method gets the most popular tags of BluePic. When tags receieved, it sends out the PopularTagsReceieved BluemixDataManagerNotification to the app */ func getPopularTags() { let requestURL = getBluemixBaseRequestURL() + "/" + kTagsEndPoint let request = Request(url: requestURL, method: HttpMethod.GET) request.timeout = kDefaultTimeOut request.send { response, error in if let error = error { print(NSLocalizedString("Get Popular Tags Error:", comment: "") + " \(error.localizedDescription)") } else { if let text = response?.responseText, let result = Utils.convertStringToDictionary(text), let records = result["records"] as? [[String: Any]] { // Extract string tags from server results self.tags = records.flatMap { value in if let key = value["key"] as? String { return key.uppercased() } return nil } NotificationCenter.default.post(name: .popularTagsReceived, object: nil) } } } } }
[ -1 ]
e26976aefcaab855397a4538923a79f3112da153
bf73236db291891071b856f1ed6d6cfd060694cd
/FoodPin/AppDelegate.swift
d2c3e78b9aac93fe7ecbc267ee9de359393b64c8
[]
no_license
ZWeiweiY/BEaTs_iOS
a876ffc0d84d862ae024746b465cc9dd7511e65a
94042c886997f635821cd1c386f179646138be8b
refs/heads/main
2023-08-05T20:04:24.160472
2023-07-24T14:50:23
2023-07-24T14:50:23
327,467,537
0
0
null
null
null
null
UTF-8
Swift
false
false
4,005
swift
// // AppDelegate.swift // FoodPin // // Created by NDHU_CSIE on 2020/10/22. // Copyright © 2020 NDHU_CSIE. 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. let os = ProcessInfo().operatingSystemVersion if os.majorVersion <= 12 { saveData() //call when OS version is then 13 } } 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:. let os = ProcessInfo().operatingSystemVersion if os.majorVersion <= 12 { saveData() //call when OS version is then 13 } } // MARK: UISceneSession Lifecycle @available(iOS 13.0, *) 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) } @available(iOS 13.0, *) 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. } func saveData() { let tabBarController = window!.rootViewController as! UITabBarController let navigationController = tabBarController.viewControllers?[0] as! UINavigationController //let navigationController = window!.rootViewController as! UINavigationController let controller = navigationController.viewControllers[0] as! RestaurantTableViewController //or navigationController.topViewController controller.saveRestaurants() } }
[ 348776, 325632, 311746, 168508 ]
3de787c0fcf9d2605a263d932385aa8a7a6a75c0
100c7486772cb03047e55364ddc854d86db02fd5
/Guardian-UI/Guardian-UI/Presenter/FeedDetailPresenter.swift
bc9c6c4a0508b4e2767cbf731dba3f11c8a0a274
[]
no_license
marwen86/GuardModule
4b381cd156cfea3426f97eaff77ca7d9abe5df9a
a26c20abf215f9ba2750d225f38bb6568ea187fc
refs/heads/master
2023-02-17T21:45:20.453864
2021-01-18T23:08:45
2021-01-18T23:08:45
330,503,355
0
0
null
null
null
null
UTF-8
Swift
false
false
1,405
swift
// // FeedDetailPresenter.swift // Guardian-UI // // Created by Youssef Marouane on 18/01/2021. // import Foundation import GuardianCore public protocol FeedDetailView { func display(_ viewModel: FeedDetailViewModel) } class FeedDetailPresenter { private let feedView: FeedDetailView private let errorView: FeedErrorView private var feedLoadError: String { return NSLocalizedString("FEED_VIEW_CONNECTION_ERROR", tableName: "Feed", bundle: Bundle(for: FeedPresenter.self), comment: "Error message displayed when we can't load the image feed from the server") } public init(feedView: FeedDetailView, errorView: FeedErrorView) { self.feedView = feedView self.errorView = errorView } public static var title: String { return NSLocalizedString("FEED_DETAIL_VIEW_TITLE", tableName: "Feed", bundle: Bundle(for: FeedDetailPresenter.self), comment: "Title for the feed view") } public func didStartLoadingFeed() { errorView.display(.noError) } public func didFinishLoadingFeed(with feed: FeedDetail) { feedView.display(FeedDetailViewModel(feedDetail: feed.item)) } public func didFinishLoadingFeed(with error: Error) { errorView.display(.error(message: feedLoadError)) } }
[ -1 ]
ccd5d562cad2e65c7d54f7745adfbdfc85673c68
9eef374dce9934b1b88325852adbffe1a986662a
/MailerLite/Utils/UIViewControllerExtension.swift
4da1fda6af94f52c1258d9cf7b128aae329f04af
[]
no_license
bardonadam/mailerlite-ios-client
37950cd91ccbad0cb99ba3db38f803bd20925146
ff553abb68499a6c13d63ef21b63a0b2bcdac0ea
refs/heads/master
2020-04-23T16:44:23.587220
2019-02-22T06:13:09
2019-02-22T06:13:09
171,307,990
1
0
null
null
null
null
UTF-8
Swift
false
false
350
swift
// // UIViewControllerExtension.swift // MailerLite // // Created by Adam Bardon on 21/02/2019. // Copyright © 2019 Adam Bardon. All rights reserved. // import UIKit extension UIViewController { func add(_ child: UIViewController) { addChild(child) view.addSubview(child.view) child.didMove(toParent: self) } }
[ -1 ]
4c28d4cf664f8aeaafbddd349921c2d51a84cf1e
50a2322a17d7f2041abfe1fe3fd3ecce730cf246
/iOSFigmaEffects/iOSFigmaEffects/Classes/UIView+DropShadow.swift
712d06521a843d3918bf4b91494ab0343d68550c
[ "MIT" ]
permissive
TiagoMJFlores/iOSFigmaEffects
4c3528fa948e9fcf96838133c9611d207eb4cf3a
ad5ed4b2835ff26b12d37b1d2a696934d78ebd25
refs/heads/main
2023-02-05T15:11:28.869365
2020-12-21T16:47:37
2020-12-21T16:47:37
322,313,923
0
0
null
null
null
null
UTF-8
Swift
false
false
1,580
swift
// // View+UniversalShadow.swift // Nimble // // Created by Tiago Flores on 17/12/2020. // import UIKit import UIKit enum InnerShadowDirection { case Top case Right case Bottom case Left } public extension UIView { // also called Outer Shadow func applyDropShadow( color: UIColor = .black, x: CGFloat = 0, y: CGFloat = 2, blur: CGFloat = 4, spread: CGFloat = 0, alpha: Float = 0.5) { let shadowView = UIView() shadowView.backgroundColor = UIColor.white let configurator = DropShadowConfigurator() configurator.applyLayerShadowColorStyle(color: color, alpha: alpha, blur: blur, toLayer: shadowView.layer) configurator.applyLayerDropShadowPath(fromViewBounds: self.bounds, spread: spread, toLayer: shadowView.layer) shadowView.layer.shadowOffset = CGSize(width: x, height: y) superview?.insertSubview(shadowView, belowSubview: self) pin(toMe: shadowView) } private func pin(toMe view: UIView) { view.translatesAutoresizingMaskIntoConstraints = false if #available(iOSApplicationExtension 9.0, *) { NSLayoutConstraint.activate([ view.topAnchor.constraint(equalTo: self.topAnchor), view.bottomAnchor.constraint(equalTo: self.bottomAnchor), view.leadingAnchor.constraint(equalTo: self.leadingAnchor), view.trailingAnchor.constraint(equalTo: self.trailingAnchor), ]) } } }
[ -1 ]
9fc450c9003378587e9abe91db22609eb1c97657
a278e8eecacd0a264b33af51c203c424c8fdd511
/ios/JSProps/OverlayConfig.swift
744abc24a00f96d2344efebfec89101f140a4fa2
[ "MIT" ]
permissive
DiceTechnology/react-native-video
9c0f70de77f852f5eb94636b54c7654ee68bcf45
5b4f7b17526eb6272c22f10eb2e2b3ea0252cf7d
refs/heads/super/dicetechnology
2023-09-05T01:08:09.746781
2023-08-29T09:12:44
2023-08-29T09:12:44
117,120,378
0
0
MIT
2023-09-05T10:11:31
2018-01-11T15:57:44
Java
UTF-8
Swift
false
false
2,216
swift
// // OverlayConfig.swift // react-native-video // // Created by Yaroslav Lvov on 11.03.2022. // import AVDoris struct OverlayConfig: SuperCodable { let type: OverlayConfigType let button: String let components: [Component] enum OverlayConfigType: String, Codable { case expanded, side, bottom, full } struct Component: Codable { let name: String let type: OverlayConfigType let initialProps: Dictionary<String, String>? } func create(bridge: RCTBridge?) -> OverlayType { guard let bridge = bridge else { return .none } switch type { case .expanded: guard let sideComponent = components.first(where: {$0.type == .side}), let bottomComponent = components.first(where: {$0.type == .bottom}) else { return .none } let sideJSComponentView = RCTRootView(bridge: bridge, moduleName: sideComponent.name, initialProperties: sideComponent.initialProps) let bottomJSComponentView = RCTRootView(bridge: bridge, moduleName: bottomComponent.name, initialProperties: bottomComponent.initialProps) return .rightAndBottom(rightView: sideJSComponentView, bottomView: bottomJSComponentView, closeAction: nil) case .side: guard let sideComponent = components.first(where: {$0.type == .side}) else { return .none } let sideJSComponentView = RCTRootView(bridge: bridge, moduleName: sideComponent.name, initialProperties: sideComponent.initialProps) return .right(rightView: sideJSComponentView, closeAction: nil) default: return .none } } }
[ -1 ]
fd17e863e8fb6477f051f04e475226e126f4b013
7af656575a6fb0991055e0f93b823050d9f86a11
/BrewEstateChat/Everything/APIHandler/EndPoint.swift
e8483fcdb751db6dccf700ac47264e5f6e2fd572
[]
no_license
SyedArifulIslamEmon/Chat
7c4f4fee709dc3958b5bbaef303be425405a4dc1
2023b848bb8a831625ac412b1eff3d37f99d140a
refs/heads/master
2021-01-19T19:41:16.408456
2017-03-29T04:52:45
2017-03-29T04:52:45
null
0
0
null
null
null
null
UTF-8
Swift
false
false
1,649
swift
// // Login.swift // APISampleClass // // Created by cbl20 on 2/23/17. // Copyright © 2017 Taran. All rights reserved. // import UIKit import Alamofire enum EndPoint { case messages(api_token : String? , timezone : String?) case sendMessage(api_token: String?, timezone: String?, other_id: String?, chat_type: String?, message: String?) case polling(api_token: String?, other_id: String?, timezone: String?, id: String?) } extension EndPoint : Router{ var route : String { switch self { case .messages(_): return APIConstants.messages case .sendMessage(_): return APIConstants.sendMessage case .polling(_): return APIConstants.polling } } var parameters: OptionalDictionary{ return format() } func format() -> OptionalDictionary { switch self { case .messages(let api_token , let timezone): return Parameters.messages.map(values: [api_token,timezone]) case .sendMessage(let api_token, let timezone, let other_id, let chat_type, let message): return Parameters.sendMessage.map(values: [api_token, timezone, other_id, chat_type, message]) case .polling(let api_token, let other_id, let timezone, let id): return Parameters.polling.map(values: [api_token, other_id, timezone, id]) } } var method : Alamofire.HTTPMethod { switch self { default: return .post } } var baseURL: String{ return APIConstants.basePath } }
[ -1 ]
ebfe561646e813a040c2111edaf1c6bc15d7a2e7
410a3fb2c0f79f7f141eed75d2904d9bd99063ad
/Expense/DataSource/PlacesViewController.swift
81483f265295b3b9607f9f30f61cdb729cfbd6d8
[]
no_license
haspindergill/hackathon
14e238a9a7289ca38406e15e90efb67eb5cbea35
b2704078805f7ecedc7546b9b322996c93207bde
refs/heads/master
2020-03-22T13:14:46.178504
2018-07-07T16:05:12
2018-07-07T16:05:12
140,093,649
0
0
null
null
null
null
UTF-8
Swift
false
false
3,058
swift
// // PlacesViewController.swift // Expense // // Created by Haspinder on 07/07/18. // Copyright © 2018 Haspinder Singh. All rights reserved. // import UIKit import FirebaseDatabase class PlacesViewController: UIViewController { var ref: DatabaseReference! var dataSource : TableDataSource?{ didSet{ tableView.delegate = dataSource tableView.dataSource = dataSource } } var places = [Place](){didSet{ dataSource?.items = places as Array<AnyObject> self.tableView?.reloadData() }} @IBAction func actionAddPlace(_ sender: Any) { } @IBOutlet weak var tableView: UITableView! override func viewDidLoad() { super.viewDidLoad() ref = Database.database().reference() setupTableView() // 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. } */ func fetchPlaces() { self.ref.child("places").child("hasp").observeSingleEvent(of: .value, with: { snapshot in for rest in (snapshot.children.allObjects as? [DataSnapshot])! { let value = rest.value as? NSDictionary let place = Place(name:value?["name"] as? String ?? "" , lat: value?["lat"] as? String ?? "", long: value?["long"] as? String ?? "") // let email = value?["email"] as? String ?? "" self.places.append(place) } }) } } //MARK: TableView extension PlacesViewController{ func setupTableView() { dataSource = TableDataSource(items:places as Array<AnyObject>, height: UITableViewAutomaticDimension, tableView: tableView, cellIdentifier: "cell", configureCellBlock: { (cell, item, index) in self.configureTableCell(cell: cell, item: item,index: index) }, aRowSelectedListener: { (indexPath) in self.clickHandler(indexPath: indexPath) }) } func clickHandler(indexPath : NSIndexPath) { let vc = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "NewExpenseViewController") as! NewExpenseViewController self.navigationController?.pushViewController(vc, animated: true) } func configureTableCell(cell : AnyObject?,item : AnyObject?,index : NSIndexPath?) { let cell = cell as? UITableViewCell let user = places[index?.row ?? 0] cell?.textLabel?.text = user.name } }
[ -1 ]
6da8f104ed52fd7dfb6b554ce46731f09939fd1e
defe927ca7ea92adbc2d2c3e4fa464acb6c97522
/ScrollViewDemo4-scrollerview+container=tableview/ScrollViewDemo4Tests/ScrollViewDemo4Tests.swift
3dc2a898338a1b56174cea1ba83d091bb1fe5e89
[]
no_license
xiaolangshou/Swift_repository
b8bc2200a9f1a05631479a0ed2842c99b6bf941a
46625f679c59650b6b40c4635a55816da47a36d1
refs/heads/master
2021-08-20T05:09:19.484036
2021-07-17T07:22:35
2021-07-17T07:22:35
249,946,297
2
0
null
null
null
null
UTF-8
Swift
false
false
1,003
swift
// // ScrollViewDemo4Tests.swift // ScrollViewDemo4Tests // // Created by Thomas Lau on 2018/9/1. // Copyright © 2018年 Thomas Lau. All rights reserved. // import XCTest @testable import ScrollViewDemo4 class ScrollViewDemo4Tests: XCTestCase { override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. super.tearDown() } func testExample() { // This is an example of a functional test case. // Use XCTAssert and related functions to verify your tests produce the correct results. } func testPerformanceExample() { // This is an example of a performance test case. self.measure { // Put the code you want to measure the time of here. } } }
[ 313357, 98333, 102437, 292902, 229413, 354343, 354345, 278570, 233517, 309295, 282672, 229424, 237620, 229430, 180280, 288833, 288834, 286788, 311372, 223316, 315476, 280661, 307289, 354393, 315487, 237663, 45153, 309345, 280675, 227428, 280677, 313447, 278638, 223350, 131191, 280694, 131198, 292992, 280712, 311438, 284825, 284826, 311458, 299174, 284842, 153776, 239793, 299187, 184505, 227513, 295098, 280762, 223419, 280768, 227524, 309444, 280778, 280795, 227548, 301279, 311519, 280802, 176362, 286958, 227578, 184570, 184575, 278797, 282909, 278816, 282913, 233762, 237857, 211235, 217380, 211238, 280887, 315706, 282939, 287041, 260418, 287043, 139589, 227654, 311621, 6481, 168281, 379225, 323935, 321894, 416104, 280939, 285040, 242033, 199029, 291192, 311681, 227725, 240016, 190871, 285084, 61857, 285090, 61859, 289189, 293303, 278970, 293306, 278978, 291267, 127427, 283075, 278989, 281037, 281040, 328152, 285150, 279008, 358882, 279013, 291311, 309744, 281072, 279029, 279032, 233978, 279039, 291333, 279050, 303631, 283153, 279057, 303636, 279062, 279065, 291358, 180771, 293419, 244269, 283182, 283184, 234036, 289332, 23092, 70209, 115270, 309830, 293448, 55881, 377418, 281166, 281171, 287318, 309846, 295519, 279146, 313966, 295536, 287346, 287352, 301689, 189057, 152203, 287374, 117397, 230040, 314009, 289434, 303771, 221852, 279206, 279210, 287404, 295599, 303793, 285361, 299699, 166582, 289462, 314040, 287417, 285371, 285372, 285373, 285374, 287422, 303803, 66242, 287433, 225995, 279252, 287452, 289502, 285415, 234217, 342762, 293612, 230125, 289518, 312047, 279280, 230134, 154359, 228088, 234234, 299770, 221948, 205568, 242433, 299776, 285444, 322313, 166676, 293664, 234277, 283430, 262951, 312108, 285487, 262962, 230199, 285497, 293693, 289598, 160575, 281408, 295746, 318278, 201551, 281427, 281433, 230234, 301918, 279392, 295776, 293730, 303972, 174963, 207732, 310131, 295798, 209785, 279417, 177019, 308092, 291712, 158593, 113542, 228234, 308107, 56208, 308112, 293781, 324506, 324507, 283558, 310182, 279464, 236461, 289727, 213960, 279498, 316364, 183248, 50143, 314342, 234472, 234473, 326635, 203757, 304110, 287731, 295927, 312314, 234500, 277509, 230410, 234514, 277524, 293910, 281626, 175132, 300068, 238639, 238651, 308287, 238664, 234587, 277597, 304222, 281697, 302177, 230499, 281700, 300135, 322663, 207979, 279660, 15471, 144496, 234609, 312434, 285814, 300151, 279672, 160891, 285820, 300158, 150657, 187521, 234625, 285828, 279685, 285830, 302213, 302216, 228491, 234638, 308372, 185493, 296086, 238743, 187544, 283802, 285851, 296092, 300187, 330913, 234663, 300202, 249002, 238765, 279728, 238769, 294074, 208058, 64700, 228540, 228542, 283840, 302274, 279747, 283847, 283852, 189652, 279765, 279774, 304351, 310497, 298212, 304356, 290022, 234733, 298221, 279792, 302325, 228600, 216315, 208124, 228609, 292107, 312587, 130338, 339234, 130343, 298291, 222524, 286013, 286018, 113987, 279875, 230729, 224586, 177484, 222541, 296270, 238927, 314709, 357719, 283991, 230756, 281957, 163175, 230765, 306542, 296303, 284014, 279920, 181625, 306559, 224640, 148867, 294275, 298374, 142729, 368011, 296335, 112017, 306579, 282007, 318875, 310692, 282022, 310701, 173491, 304564, 228795, 292283, 292292, 306631, 296392, 300489, 280010, 310732, 302540, 312782, 280013, 306639, 310736, 222675, 228827, 239068, 280032, 316902, 280041, 296433, 308723, 306677, 280055, 300536, 286202, 290300, 290301, 286205, 296448, 230913, 306692, 306693, 296461, 282129, 308756, 282136, 282141, 302623, 288309, 290358, 280130, 288326, 282183, 288327, 218696, 292425, 286288, 290390, 128599, 235095, 300630, 306776, 286306, 300644, 222832, 314998, 288378, 294529, 282245, 282246, 288392, 229001, 290443, 310923, 323217, 282259, 229020, 298654, 282271, 282273, 302754, 282276, 229029, 40613, 40614, 282280, 40615, 300714, 298667, 286391, 306874, 280251, 282303, 286399, 218819, 306890, 280267, 302797, 212688, 302802, 280278, 282327, 286423, 278233, 278234, 298712, 67292, 294622, 278240, 282339, 288491, 280300, 239341, 282348, 284401, 282355, 323316, 229113, 313081, 286459, 300794, 278272, 288512, 311042, 288516, 216839, 282378, 300811, 321295, 284431, 278291, 278293, 282400, 313120, 315171, 284459, 280366, 282417, 200498, 296755, 280372, 282427, 345919, 282434, 282438, 280390, 18262, 280410, 188251, 284507, 300894, 284512, 284514, 296806, 276327, 292712, 282474, 288619, 288620, 280430, 282480, 313203, 300918, 194429, 339841, 305026, 67463, 282504, 243597, 110480, 184208, 282518, 282519, 214937, 239514, 298909, 311199, 298920, 284587, 292782, 288697, 294843, 280514, 294850, 280519, 344013, 301008, 294886, 296941, 311282, 292858 ]
d2c0634bbdcffe4c7187c1f6bb813df366b24025
a40176e66eacec197801dad06d024ba8864fc73e
/RockPaperScissors/RockPaperScissors/RockPaperScissorsApp.swift
5ec7dfed3e1cf566b0a6e54f63934cad59b37185
[ "Unlicense" ]
permissive
kuroski/100daysOfSwift
49bdaa55e94921589643e7441a2c043396159348
e10f15b2c042711d47aeddde14650c203ce2e070
refs/heads/main
2023-01-29T06:47:57.337394
2020-12-15T15:16:28
2020-12-15T15:16:28
312,393,215
1
0
null
null
null
null
UTF-8
Swift
false
false
256
swift
// // RockPaperScissorsApp.swift // RockPaperScissors // // Created by Daniel Kuroski on 17.11.20. // import SwiftUI @main struct RockPaperScissorsApp: App { var body: some Scene { WindowGroup { ContentView() } } }
[ 216581, 375592, 412618, 438254, 418483, 359795, 383573, 370423, 419100 ]
f995960078732f25d1c0a0067f8cdda6c1f03cc3
63f9010d3415e0068e49aa6690ba0e6c9f893e28
/language-code/doc-kotlin/CollectionsFiltering_4_3d63a13e83b59f354fbb60abeef8c436.swift
dc7c0a0056a369f1d8c2caa59862ba65647fefa7
[]
no_license
tonnylitao/swift-vs-kotlin
589e9d0cae9c5bfe08c859ea63135098b88274a9
6676796123a244610cd172abe9432cb75b357b33
refs/heads/master
2023-03-04T19:38:59.542318
2021-02-16T08:30:59
2021-02-16T08:30:59
336,926,755
0
0
null
null
null
null
UTF-8
Swift
false
false
176
swift
let numbers = [nil, 1, "two", 3.0, "four"] as [Any?] print("All String elements in upper case:") numbers.compactMap({ $0 as? String }) .forEach { print($0.uppercased()) }
[ -1 ]
99776f45380458d094fd673f8d3ad6e269257619
4111d229790c4e60ea968631d26c3774d77f5324
/leetcode/geek-time/linklist/876_链表的中间结点.swift
80b29f526004f2e21b7aeba85768694e44971170
[ "MIT" ]
permissive
EricLi404/nb
a6a3e90b79bd8ee2e35d93285dea5650b804e3da
bdfa24db288df791320b5f610981b53aa7963fac
refs/heads/master
2020-09-12T11:36:33.043546
2020-07-31T07:44:59
2020-07-31T07:44:59
222,411,259
0
1
MIT
2019-12-25T09:14:25
2019-11-18T09:31:09
Python
UTF-8
Swift
false
false
1,367
swift
///给定一个带有头结点 head 的非空单链表,返回链表的中间结点。 /// /// 如果有两个中间结点,则返回第二个中间结点。 /// /// /// /// 示例 1: /// /// 输入:[1,2,3,4,5] ///输出:此列表中的结点 3 (序列化形式:[3,4,5]) ///返回的结点值为 3 。 (测评系统对该结点序列化表述是 [3,4,5])。 ///注意,我们返回了一个 ListNode 类型的对象 ans,这样: ///ans.val = 3, ans.next.val = 4, ans.next.next.val = 5, 以及 ans.next.next.next = /// NULL. /// /// /// 示例 2: /// /// 输入:[1,2,3,4,5,6] ///输出:此列表中的结点 4 (序列化形式:[4,5,6]) ///由于该列表有两个中间结点,值分别为 3 和 4,我们返回第二个结点。 /// /// /// /// /// 提示: /// /// /// 给定链表的结点数介于 1 和 100 之间。 /// /// Related Topics 链表 /// 👍 237 👎 0 ///leetcode submit region begin(Prohibit modification and deletion) /** * Definition for singly-linked list. * public class ListNode { * public var val: Int * public var next: ListNode? * public init(_ val: Int) { * self.val = val * self.next = nil * } * } */ class Solution { func middleNode(_ head: ListNode?) -> ListNode? { } } ///leetcode submit region end(Prohibit modification and deletion)
[ -1 ]
d63be37b4d20f643002e66a58c617b353ede0c68
6728452760be3bcba0cfb3c639d18f63056a6c70
/GildedRoseKata/GildedRoseKataTests/PassItemTests.swift
a002dd71c370e8501e649d9742067ef306e71c5d
[ "MIT" ]
permissive
Shah3r/gildedrosekata-swift
d876d3242093dc0c219af6eea02afbbdaf5a7f06
a05ef4a36501a4ef12fc2ce5bd7d41f5b224688d
refs/heads/master
2022-01-26T21:28:04.027277
2019-06-06T10:04:48
2019-06-06T10:04:48
null
0
0
null
null
null
null
UTF-8
Swift
false
false
3,039
swift
// // PassItemTests.swift // GildedRoseKataTests // // Created by Shaher Kassam on 09/03/2019. // Copyright © 2019 Shaher. All rights reserved. // @testable import GildedRoseKata import XCTest class PassItemTests: XCTestCase { //MARK: Pass func testPassItem() { //given let items = [Item(name: ItemName.pass.rawValue, sellIn: 15, quality: 20)] let app = GildedRoseInventory(items: items) //when app.updateQuality() //then XCTAssertEqual(14, app.items[0].sellIn) XCTAssertEqual(21, app.items[0].quality) } func testPassItemDouble() { //given let items = [ Item(name: ItemName.pass.rawValue, sellIn: 10, quality: 20)] let app = GildedRoseInventory(items: items) //when app.updateQuality() //then XCTAssertEqual(9, app.items[0].sellIn) XCTAssertEqual(22, app.items[0].quality) } func testPassItemTriple() { //given let items = [Item(name: ItemName.pass.rawValue, sellIn: 5, quality: 20)] let app = GildedRoseInventory(items: items) //when app.updateQuality() //then XCTAssertEqual(4, app.items[0].sellIn) XCTAssertEqual(23, app.items[0].quality) } func testPassItemDoubleEdge() { //given let items = [ Item(name: ItemName.pass.rawValue, sellIn: 10, quality: 49)] let app = GildedRoseInventory(items: items) //when app.updateQuality() //then XCTAssertEqual(9, app.items[0].sellIn) XCTAssertEqual(50, app.items[0].quality) } func testPassItemTripleEdge() { //given let items = [Item(name: ItemName.pass.rawValue, sellIn: 5, quality: 49)] let app = GildedRoseInventory(items: items) //when app.updateQuality() //then XCTAssertEqual(4, app.items[0].sellIn) XCTAssertEqual(50, app.items[0].quality) } func testPassItemAfterSellIn() { //given let items = [Item(name: ItemName.pass.rawValue, sellIn: -1, quality: 49)] let app = GildedRoseInventory(items: items) //when app.updateQuality() //then XCTAssertEqual(-2, app.items[0].sellIn) XCTAssertEqual(0, app.items[0].quality) } func testPassItemOnSellIn() { //given let items = [Item(name: ItemName.pass.rawValue, sellIn: 0, quality: 20)] let app = GildedRoseInventory(items: items) //when app.updateQuality() //then XCTAssertEqual(-1, app.items[0].sellIn) XCTAssertEqual(0, app.items[0].quality) } func testPassItemMax() { //given let items = [Item(name: ItemName.pass.rawValue, sellIn: 0, quality: 50)] let app = GildedRoseInventory(items: items) //when app.updateQuality() //then XCTAssertEqual(-1, app.items[0].sellIn) XCTAssertEqual(0, app.items[0].quality) } }
[ -1 ]
01c7eb4d15eb93ebd1ae2fc750b1ade761bbedc2
364cc3d32e52982e115be571e1fadca4dc0fe30f
/curbmap/Restriction/TimeDelegateData.swift
0857efd3fd433b93592184728d09f4a71e1c7023
[ "Apache-2.0" ]
permissive
curbmap/curbmap-ios
84dfa665a0bbfeb29fbaec64ab655cacbb62454d
fb913437c71ec47f3d526e8ff32e50d9ffc713f4
refs/heads/master
2021-01-01T04:53:05.785025
2018-03-23T03:11:03
2018-03-23T03:11:03
97,264,295
0
1
null
null
null
null
UTF-8
Swift
false
false
867
swift
// // TimeDelegate.swift // curbmap // // Created by Eli Selkin on 1/8/18. // Copyright © 2018 Eli Selkin. All rights reserved. // import Foundation import UIKit class TimeDelegateData: NSObject, UIPickerViewDelegate, UIPickerViewDataSource { func numberOfComponents(in pickerView: UIPickerView) -> Int { return 2 } func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int { if (component == 0) { return 24 } else { return 60 } } func pickerView(_ pickerView: UIPickerView, attributedTitleForRow row: Int, forComponent component: Int) -> NSAttributedString? { let keyValue = [NSAttributedStringKey.foregroundColor: UIColor.white] let str = NSAttributedString(string: String(row), attributes: keyValue) return str } }
[ -1 ]
27f089d395920f1f81168488363c5643c2a6593a
73f1766106f53aafc7888a7b4abb7894a779a87a
/MyMotor/Home_ViewController.swift
6b628e43def01b4e5a460b63e8c81137aac758bd
[]
no_license
Jollinsss/MyMotor
4f7dcfbdd0c686af29b0850385e3c69397c28e37
d4eb0cf337caebdc8b88b0792aa2266e36631145
refs/heads/master
2023-07-02T05:51:08.848157
2021-07-26T20:52:08
2021-07-26T20:52:08
385,880,420
0
0
null
null
null
null
UTF-8
Swift
false
false
3,170
swift
// // ViewController.swift // MyMotor // // Created by Robert Hardy on 12/07/2021. // import UIKit import Foundation class Home_ViewController: UIViewController { @IBOutlet weak var registrationTextField: UITextField! @IBOutlet weak var findCarButton: UIButton! @IBOutlet weak var vehicleInformationTextView: UITextView! override func viewDidLoad() { super.viewDidLoad() overrideUserInterfaceStyle = .light NotificationCenter.default.addObserver(self, selector: #selector(motDetailsRetrievedSuccess), name: Notification.Name("motDetailsRetrievedSuccess"), object: nil) NotificationCenter.default.addObserver(self, selector: #selector(motDetailsRetrievedError), name: Notification.Name("motDetailsRetrievedError"), object: nil) NotificationCenter.default.addObserver(self, selector: #selector(motDetailsRetrievedError), name: Notification.Name("taxDetailsRetrievedError"), object: nil) } @IBAction func findCarButtonPressed() { let registration_plate = registrationTextField.text! DVSA().get_tax_details(registration_plate: registration_plate) } @objc func motDetailsRetrievedSuccess() { let dateFormatter = DateFormatter() dateFormatter.dateFormat = "yyyy.MM.dd" dateFormatter.timeZone = NSTimeZone(name: "UTC") as TimeZone? let timestampVehicleMotExpiry = dateFormatter.date(from: DVSA.vehicleMotExpiry) let timestampVehicleRegistrationDate = dateFormatter.date(from: DVSA.vehicleRegistrationDate) let newDateFormatter = DateFormatter() newDateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss Z" newDateFormatter.timeZone = NSTimeZone(name: "UTC") as TimeZone? newDateFormatter.dateStyle = .long newDateFormatter.timeStyle = .none let friendlyVehicleMotExpiry = newDateFormatter.string(from: timestampVehicleMotExpiry ?? Date()) let friendlyVehicleRegistrationDate = newDateFormatter.string(from: timestampVehicleRegistrationDate ?? Date()) vehicleInformationTextView.text = "\(DVSA.vehicleMake.capitalized) \(DVSA.vehicleModel.capitalized) (\(DVSA.vehiclePrimaryColour)) \nRegistered on: \(friendlyVehicleRegistrationDate) \nMileage (at last MOT): \(DVSA.vehicleOdometerValue) \nMOT Expires: \(friendlyVehicleMotExpiry) \nMOT Count: \(DVSA.vehicleMotCount) \nAdvisories Count (previous MOT): \(DVSA.vehicleLatestMotAdvisoriesCount) \nVehicle is \(DVSA.vehicleIsTaxed) \nVehicle Tax Due Date: \(DVSA.vehicleTaxDueDate) \nCo2 Emissions: \(DVSA.vehicleCo2Emissions)" performSegue(withIdentifier: "goToVehicle", sender: self) } @objc func motDetailsRetrievedError() { let alert_success = UIAlertController(title: "Error", message: "Unable to locate vehicle with specified registration plate.", preferredStyle: .alert) let default_action = UIAlertAction(title: "Dismiss", style: .default, handler: nil) alert_success.addAction(default_action) self.present(alert_success, animated: true, completion: nil) } }
[ -1 ]
fbc98251eaa539ecef023b4470ffe9bbf8b6aa5b
9a4751949034a8e4b4e7ad872d15ec4757ba0329
/SKPhotoBrowser/SKButtons.swift
66784e4a44323bfab7eaeb3421b4382ad2b6fc1f
[ "MIT" ]
permissive
shenglinFL/SKPhotoBrowser
d9c90a303ac3b71a4d7eb5c420ae25d56f4101e8
2fb25e61ab516ad8ea5f09ad4be510a928d3ed3c
refs/heads/master
2020-03-27T04:44:05.467610
2018-08-31T04:43:58
2018-08-31T04:43:58
145,964,313
0
0
MIT
2018-08-24T08:25:41
2018-08-24T08:25:41
null
UTF-8
Swift
false
false
4,146
swift
// // SKButtons.swift // SKPhotoBrowser // // Created by 鈴木 啓司 on 2016/08/09. // Copyright © 2016年 suzuki_keishi. All rights reserved. // import Foundation // helpers which often used private let bundle = Bundle(for: SKPhotoBrowser.self) class SKButton: UIButton { internal var showFrame: CGRect! internal var hideFrame: CGRect! fileprivate var insets: UIEdgeInsets { if UI_USER_INTERFACE_IDIOM() == .phone { return UIEdgeInsets(top: 15.25, left: 15.25, bottom: 15.25, right: 15.25) } else { return UIEdgeInsets(top: 12, left: 12, bottom: 12, right: 12) } } fileprivate let size: CGSize = CGSize(width: 44, height: 44) fileprivate var marginX: CGFloat = 0 fileprivate var marginY: CGFloat = 0 fileprivate var extraMarginY: CGFloat = SKMesurement.isPhoneX ? 10 : 0 func setup(_ imageName: String) { backgroundColor = .clear imageEdgeInsets = insets translatesAutoresizingMaskIntoConstraints = true autoresizingMask = [.flexibleBottomMargin, .flexibleLeftMargin, .flexibleRightMargin, .flexibleTopMargin] let image = UIImage(named: "SKPhotoBrowser.bundle/images/\(imageName)", in: bundle, compatibleWith: nil) ?? UIImage() setImage(image, for: UIControlState()) } func setFrameSize(_ size: CGSize? = nil) { guard let size = size else { return } let newRect = CGRect(x: marginX, y: marginY, width: size.width, height: size.height) frame = newRect showFrame = newRect hideFrame = CGRect(x: marginX, y: -marginY, width: size.width, height: size.height) } func updateFrame(_ frameSize: CGSize) { } } class SKImageButton: SKButton { fileprivate var imageName: String { return "" } required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) } override init(frame: CGRect) { super.init(frame: frame) setup(imageName) showFrame = CGRect(x: marginX, y: marginY, width: size.width, height: size.height) hideFrame = CGRect(x: marginX, y: -marginY, width: size.width, height: size.height) } } class SKCloseButton: SKImageButton { override var imageName: String { return "btn_common_close_wh" } override var marginX: CGFloat { get { return SKPhotoBrowserOptions.swapCloseAndDeleteButtons ? SKMesurement.screenWidth - SKButtonOptions.closeButtonPadding.x - self.size.width : SKButtonOptions.closeButtonPadding.x } set { super.marginX = newValue } } override var marginY: CGFloat { get { return SKButtonOptions.closeButtonPadding.y + extraMarginY } set { super.marginY = newValue } } required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) } override init(frame: CGRect) { super.init(frame: frame) setup(imageName) showFrame = CGRect(x: marginX, y: marginY, width: size.width, height: size.height) hideFrame = CGRect(x: marginX, y: -marginY, width: size.width, height: size.height) } } class SKDeleteButton: SKImageButton { override var imageName: String { return "btn_common_delete_wh" } override var marginX: CGFloat { get { return SKPhotoBrowserOptions.swapCloseAndDeleteButtons ? SKButtonOptions.deleteButtonPadding.x : SKMesurement.screenWidth - SKButtonOptions.deleteButtonPadding.x - self.size.width } set { super.marginX = newValue } } override var marginY: CGFloat { get { return SKButtonOptions.deleteButtonPadding.y + extraMarginY } set { super.marginY = newValue } } required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) } override init(frame: CGRect) { super.init(frame: frame) setup(imageName) showFrame = CGRect(x: marginX, y: marginY, width: size.width, height: size.height) hideFrame = CGRect(x: marginX, y: -marginY, width: size.width, height: size.height) } }
[ 34482, 287502, 39958 ]
666bc1ed740e5f662399becf2e0962ee442a5aff
b4edae0b7124512b6ee3e81a3031ec4365bf286a
/CuttyFlamTV/AppDelegate.swift
535724544a0761cbcf8848447c93838e9edc5568
[]
no_license
DanPatey/CuttyFlamTV
543c8dc151a570093f92259693915f6722e946d8
e9a5a78463cb45bcf92dd6db9684b962c26a6858
refs/heads/master
2021-01-18T16:55:14.370227
2017-03-12T08:28:13
2017-03-12T08:28:13
84,353,724
0
0
null
null
null
null
UTF-8
Swift
false
false
1,349
swift
// // AppDelegate.swift // CuttyFlamTV // // Created by Dan Patey on 3/8/17. // Copyright © 2017 Dan Patey. All rights reserved. // import UIKit import TVMLKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate, TVApplicationControllerDelegate { var window: UIWindow? var appController: TVApplicationController? // static let TVBaseURL = "http://localhost:9001/" static let TVBaseURL = "http://45.55.67.167:80/" static let TVBootURL = "\(AppDelegate.TVBaseURL)js/application.js" func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool { window = UIWindow(frame: UIScreen.main.bounds) let appControllerContext = TVApplicationControllerContext() // Configure paths to TVJS and root of our server guard let javascriptURL = URL(string: AppDelegate.TVBootURL) else { fatalError("Unable to create NSURL") } appControllerContext.javaScriptApplicationURL = javascriptURL appControllerContext.launchOptions["BASEURL"] = AppDelegate.TVBaseURL // Start up our TVApplicationController appController = TVApplicationController(context: appControllerContext, window: window, delegate: self) return true } }
[ -1 ]
d369240682e43b91fdb83407f49cbd75efefec9f
60dff711cee6b76a3715ed835f458a37b71d79db
/DealBreakers/MVC/Controllers/Profile/Setting/ContactUsVC.swift
429e6c7754d771e4db6495d6f2efd38153819b20
[]
no_license
happyguleria1234/Dealbreaker
c5564cd89fb055df39a4133f6899166b54f60edd
b70dd57229d09b2ab0059a7fdc7361be8b3a025b
refs/heads/main
2023-05-30T05:35:55.610064
2021-06-08T14:38:38
2021-06-08T14:38:38
343,757,109
1
0
null
null
null
null
UTF-8
Swift
false
false
2,241
swift
// // ContactUsVC.swift // DealBreakers // // Created by Vivek Dharmani on 3/23/20. // Copyright © 2020 apple. All rights reserved. // import UIKit class ContactUsVC: UIViewController,UITextViewDelegate { var message = String() @IBOutlet weak var contactUSTxtView: UITextView! override func viewDidLoad() { super.viewDidLoad() contactUSTxtView.delegate = self // Do any additional setup after loading the view. } // func textViewDidBeginEditing(_ textView: UITextView) { // // contactUSTxtView.text = "" // // } @IBAction func backButtonAction(_ sender: Any) { self.navigationController?.popViewController(animated: true) } @IBAction func contactUsButtonTap(_ sender: Any) { if contactUSTxtView.text.isEmpty{ ValidateData(strMessage: "Please enter Message") }else{ addData() } } func addData() { IJProgressView.shared.showProgressView() let signUpUrl = Constant.shared.baseUrl + Constant.shared.contactUS let id = UserDefaults.standard.value(forKey: "userId") as? String ?? "" let parms : [String:Any] = ["user_id": id,"content": contactUSTxtView.text!] print(parms) AFWrapperClass.requestPOSTURL(signUpUrl, params: parms, success: { (response) in IJProgressView.shared.hideProgressView() let status = response["status"] as? Int self.message = response["message"] as? String ?? "" if status == 1{ self.contactUSTxtView.text = "" // alert(Constant.shared.appTitle, message: self.message, view: self) showAlertMessage(title: Constant.shared.appTitle, message: self.message, okButton: "Ok", controller: self) { self.navigationController?.popViewController(animated: true) } }else{ IJProgressView.shared.hideProgressView() alert(Constant.shared.appTitle, message: self.message, view: self) } }) { (error) in IJProgressView.shared.hideProgressView() print(error) } } }
[ -1 ]
3409245bc13a0855564eecc8a7c9f28339a2e162
6f84f0b7263e40252bf22b071c318163cafe3ba5
/BSL Hands One/SignSongsViewController.swift
0cf5fa668069e176987cc1b41ec03915f3a7940b
[]
no_license
TJM-12/BslHandsOneFree
accbb2d7ebbebea94699c516115c02632926d577
bb966f98100dc2d29f1db0ec8a9a4f8f94389584
refs/heads/master
2021-06-20T15:46:10.844008
2017-07-12T00:22:46
2017-07-12T00:22:46
96,947,973
0
0
null
null
null
null
UTF-8
Swift
false
false
4,179
swift
// // AnimalViewController.swift // BSL Hands One // // Created by Thomas Maher on 23/06/2017. // Copyright © 2017 Thomas Maher. All rights reserved. // import UIKit import AVFoundation import AVKit import GoogleMobileAds class SignSongsViewController: UIViewController, UIScrollViewDelegate, GADBannerViewDelegate { var heightValuePortrait : CGFloat = 1.0 var heightValueLandscape : CGFloat = 1.0 @IBOutlet weak var googleBanner: GADBannerView! @IBOutlet weak var scrollView: UIScrollView! let avPlayerViewController = AVPlayerViewController() var avPlayer:AVPlayer? override func viewDidLoad() { super.viewDidLoad() self.scrollView.delegate = self self.scrollView.isScrollEnabled = true applyDeviceSpecificChecks() // Google Banner Script let request = GADRequest() request.testDevices = [kGADSimulatorID] googleBanner.adUnitID = "ca-app-pub-7466211922726741/7595203519" googleBanner.rootViewController = self googleBanner.delegate = self googleBanner.load(request) } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) if AppGlobal.isLandscape() { DispatchQueue.main.async { self.scrollView.contentSize = CGSize(width:320, height: self.view.frame.size.height * self.heightValueLandscape) self.scrollView.setNeedsLayout() } } else{ DispatchQueue.main.async { self.scrollView.contentSize = CGSize(width:320, height: self.view.frame.size.height * self.heightValuePortrait) self.scrollView.setNeedsLayout() } } } override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) { if AppGlobal.isLandscape() { DispatchQueue.main.async { self.scrollView.contentSize = CGSize(width:320, height: self.view.frame.size.height * self.heightValueLandscape) self.scrollView.setNeedsLayout() } } else{ DispatchQueue.main.async { self.scrollView.contentSize = CGSize(width:320, height: self.view.frame.size.height * self.heightValuePortrait) self.scrollView.setNeedsLayout() } } } func applyDeviceSpecificChecks() { if Display.typeIsLike == DisplayType.iphoneSE { heightValuePortrait = 1.1 heightValueLandscape = 1.3 } else if Display.typeIsLike == DisplayType.iphone7 { heightValuePortrait = 1.1 heightValueLandscape = 1.1 } else if Display.typeIsLike == DisplayType.iphone7plus { heightValuePortrait = 1.1 heightValueLandscape = 1.1 } else if Display.typeIsLike == DisplayType.ipad9 { heightValuePortrait = 1.1 heightValueLandscape = 1.1 } else if Display.typeIsLike == DisplayType.ipad12 { heightValuePortrait = 1.1 heightValueLandscape = 1.1 } } @IBAction func lovemedoAction(_ sender: Any) { playVideo(url: "http://www.discoverycamp.co.uk/BT_Video/lovemedo.mp4") } @IBAction func countonmeAction(_ sender: Any) { playVideo(url: "http://www.discoverycamp.co.uk/BT_Video/countonme.mp4") } @IBAction func proudmaryAction(_ sender: Any) { playVideo(url: "http://www.discoverycamp.co.uk/BT_Video/proudmary.mp4") } func playVideo(url: String?) { let movieUrl:NSURL? = NSURL(string: url!) if let url = movieUrl { self.avPlayer = AVPlayer(url: url as URL) self.avPlayerViewController.player = self.avPlayer } self.present(self.avPlayerViewController, animated: true) { () -> Void in self.avPlayerViewController.player?.play() } } }
[ -1 ]
f4ab43cfd5afb4b03775cc9c896c4bead179f59d
c222c678ee5633950d479da7d5f362e7b1919c6c
/AssignmentSix/AppDelegate.swift
17ac676e942f4d22614c83da59eefc8ba403dfd1
[]
no_license
naohiro6/AssignmentSix
c7642c74056547766ad3e73435952bde5832b3bb
d56366a53894006d09e785a00e3eaeaacd305395
refs/heads/master
2020-04-26T06:23:18.040815
2019-03-01T20:38:20
2019-03-01T20:38:20
173,362,809
0
0
null
null
null
null
UTF-8
Swift
false
false
2,177
swift
// // AppDelegate.swift // AssignmentSix // // Created by CM Student on 3/1/19. // Copyright © 2019 Naohiro Kiryu. 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, 229388, 294924, 229391, 327695, 229394, 229397, 229399, 229402, 278556, 229405, 229408, 278564, 294950, 229415, 229417, 327722, 237613, 229422, 360496, 229426, 237618, 229428, 286774, 229432, 286776, 286778, 319544, 204856, 352318, 286791, 237640, 278605, 286797, 311375, 163920, 237646, 196692, 319573, 311383, 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, 131264, 286916, 295110, 286922, 286924, 286926, 319694, 286928, 131281, 278743, 278747, 295133, 155872, 319716, 237807, 303345, 286962, 303347, 131314, 229622, 327930, 278781, 278783, 278785, 237826, 319751, 278792, 286987, 319757, 311569, 286999, 319770, 287003, 287006, 287009, 287012, 287014, 287016, 287019, 311598, 287023, 262448, 311601, 287032, 155966, 319809, 319810, 278849, 319814, 311623, 319818, 311628, 229709, 287054, 319822, 278865, 229717, 196963, 196969, 139638, 213367, 106872, 319872, 311683, 319879, 311693, 65943, 319898, 311719, 278952, 139689, 278957, 311728, 278967, 180668, 311741, 278975, 319938, 278980, 98756, 278983, 319945, 278986, 319947, 278990, 278994, 311767, 279003, 279006, 188895, 172512, 279010, 287202, 279015, 172520, 319978, 279020, 172526, 279023, 311791, 172529, 279027, 319989, 164343, 180727, 279035, 311804, 287230, 279040, 303617, 287234, 279045, 172550, 287238, 172552, 303623, 320007, 279051, 172558, 279055, 303632, 279058, 303637, 279063, 279067, 172572, 279072, 172577, 295459, 172581, 295461, 279082, 311850, 279084, 172591, 172598, 279095, 172607, 172609, 172612, 377413, 172614, 213575, 172618, 303690, 33357, 287309, 303696, 279124, 172634, 262752, 254563, 172644, 311911, 189034, 295533, 172655, 172656, 189039, 295538, 189040, 172660, 189044, 287349, 352880, 287355, 287360, 295553, 172675, 287365, 311942, 303751, 295557, 352905, 279178, 287371, 311946, 311951, 287377, 172691, 287381, 311957, 221850, 287386, 164509, 303773, 230045, 172702, 287390, 287394, 172705, 303780, 172707, 287398, 295583, 279208, 287400, 172714, 295595, 279212, 189102, 172721, 287409, 66227, 303797, 189114, 287419, 303804, 328381, 287423, 328384, 279231, 287427, 312005, 312006, 107208, 172748, 287436, 107212, 172751, 287440, 295633, 172755, 303827, 279255, 172760, 279258, 303835, 213724, 189149, 303838, 287450, 279267, 312035, 295654, 279272, 230128, 312048, 312050, 230131, 189169, 205564, 303871, 230146, 328453, 295685, 230154, 33548, 312077, 295695, 295701, 230169, 369433, 295707, 328476, 295710, 230175, 303914, 279340, 205613, 279353, 230202, 312124, 328508, 222018, 295755, 377676, 148302, 287569, 303959, 230237, 279390, 230241, 279394, 303976, 336744, 303981, 303985, 328563, 303987, 279413, 303991, 303997, 295806, 295808, 304005, 295813, 213895, 320391, 304007, 304009, 304011, 230284, 304013, 279438, 189325, 295822, 189329, 295825, 304019, 189331, 58262, 304023, 279452, 234648, 410526, 279461, 279462, 304042, 213931, 230327, 304055, 287675, 197564, 230334, 304063, 238528, 304065, 213954, 189378, 156612, 295873, 213963, 312272, 304084, 304090, 320481, 304106, 320490, 312302, 328687, 320496, 304114, 295928, 320505, 312321, 295945, 295949, 230413, 197645, 320528, 140312, 295961, 238620, 197663, 304164, 304170, 304175, 238641, 312374, 238652, 238655, 230465, 238658, 336964, 296004, 205895, 320584, 238666, 296021, 402518, 336987, 230497, 296036, 296040, 361576, 205931, 296044, 279661, 205934, 164973, 312432, 279669, 337018, 189562, 279679, 66690, 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, 230718, 296259, 378181, 296262, 230727, 238919, 320840, 296264, 296267, 296271, 222545, 230739, 312663, 337244, 222556, 230752, 312676, 230760, 173418, 410987, 230763, 148843, 230768, 296305, 312692, 230773, 304505, 304506, 181626, 181631, 312711, 312712, 296331, 288140, 288144, 230800, 304533, 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, 148946, 280021, 239064, 288217, 329177, 280027, 288220, 288214, 239070, 288218, 288224, 280034, 288226, 280036, 288229, 280038, 288230, 288232, 370146, 320998, 288234, 288236, 288238, 288240, 288242, 296435, 288244, 288250, 402942, 296446, 321022, 206336, 296450, 148990, 230916, 230919, 214535, 304651, 370187, 304653, 230923, 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, 313027, 280260, 419525, 206536, 280264, 206539, 206541, 206543, 263888, 280276, 313044, 321239, 280283, 313052, 288478, 313055, 419555, 321252, 313066, 280302, 288494, 280304, 313073, 321266, 288499, 419570, 288502, 280314, 288510, 124671, 67330, 280324, 198405, 288519, 280331, 198416, 280337, 296723, 116503, 321304, 329498, 296731, 321311, 313121, 313123, 304932, 321316, 280363, 141101, 165678, 280375, 321336, 296767, 288576, 345921, 280388, 337732, 304968, 280393, 280402, 173907, 313176, 280419, 321381, 296809, 296812, 313201, 1920, 255873, 305028, 280454, 247688, 280464, 124817, 280468, 239510, 280473, 124827, 214940, 247709, 214944, 280487, 313258, 321458, 296883, 124853, 214966, 10170, 296890, 288700, 296894, 190403, 296900, 280515, 337862, 165831, 280521, 231379, 296921, 354265, 354270, 239586, 313320, 354281, 231404, 124913, 165876, 321528, 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, 329830, 280681, 313451, 223341, 280687, 313458, 280691, 215154, 149618, 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, 182517, 280823, 280825, 280827, 280830, 280831, 280833, 125187, 280835, 125191, 125207, 125209, 321817, 125218, 321842, 223539, 125239, 280888, 305464, 280891, 289087, 280897, 280900, 239944, 305480, 280906, 239947, 305485, 305489, 379218, 280919, 248153, 215387, 354653, 354656, 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, 281045, 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, 150066, 158262, 158266, 289342, 281154, 322115, 158283, 281163, 281179, 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, 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, 240519, 322440, 314249, 338823, 183184, 142226, 289687, 224151, 240535, 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, 207937, 314433, 314441, 207949, 322642, 314456, 281691, 314461, 281702, 281704, 314474, 281708, 281711, 289912, 248995, 306341, 306344, 306347, 322734, 306354, 142531, 199877, 289991, 306377, 289997, 249045, 363742, 363745, 298216, 330988, 126190, 216303, 322801, 388350, 257302, 363802, 199976, 199978, 314671, 298292, 298294, 257334, 216376, 298306, 380226, 224584, 224587, 224594, 216404, 306517, 150870, 314714, 224603, 159068, 314718, 265568, 314723, 281960, 150890, 306539, 314732, 314736, 290161, 216436, 306549, 298358, 314743, 306552, 290171, 314747, 298365, 290174, 306555, 224641, 281987, 298372, 314756, 281990, 224647, 265604, 298377, 314763, 142733, 298381, 314768, 224657, 314773, 306581, 314779, 314785, 282025, 314793, 282027, 241068, 241070, 241072, 282034, 241077, 150966, 298424, 306618, 282044, 323015, 306635, 306640, 290263, 290270, 290275, 339431, 282089, 191985, 282098, 290291, 282101, 241142, 191992, 290298, 151036, 290302, 282111, 290305, 175621, 192008, 323084, 257550, 290321, 282130, 323090, 282133, 290325, 241175, 290328, 282137, 290332, 241181, 282142, 282144, 290344, 306731, 290349, 290351, 290356, 282186, 224849, 282195, 282199, 282201, 306778, 159324, 159330, 314979, 298598, 323176, 224875, 241260, 323181, 257658, 315016, 282249, 290445, 282255, 282261, 175770, 298651, 282269, 323229, 298655, 323231, 61092, 282277, 306856, 196133, 282295, 282300, 323260, 323266, 282310, 323273, 282319, 306897, 241362, 306904, 282328, 298714, 52959, 216801, 282337, 241380, 216806, 323304, 282345, 12011, 282356, 323318, 282364, 282367, 306945, 241412, 323333, 282376, 216842, 323345, 282388, 323349, 282392, 184090, 315167, 315169, 282402, 315174, 323367, 241448, 315176, 241450, 282410, 306988, 306991, 315184, 323376, 315190, 241464, 159545, 282425, 298811, 307009, 413506, 241475, 307012, 298822, 315211, 282446, 307027, 315221, 323414, 315223, 241496, 241498, 307035, 307040, 110433, 282465, 241509, 110438, 298860, 110445, 282478, 315249, 110450, 315251, 282481, 315253, 315255, 339838, 315267, 282499, 315269, 241544, 282505, 241546, 241548, 298896, 298898, 282514, 44948, 298901, 241556, 282520, 241560, 241563, 241565, 241567, 241569, 282531, 241574, 282537, 298922, 36779, 241581, 282542, 241583, 323504, 241586, 282547, 241588, 290739, 241590, 241592, 241598, 290751, 241600, 241605, 151495, 241610, 298975, 241632, 298984, 241640, 241643, 298988, 241646, 241649, 241652, 323574, 290807, 241661, 299006, 282623, 315396, 241669, 315397, 282632, 307211, 282639, 290835, 282645, 241693, 282654, 241701, 102438, 217127, 282669, 323630, 282681, 290877, 282687, 159811, 315463, 315466, 192589, 307278, 192596, 176213, 307287, 315482, 217179, 315483, 192605, 233567, 200801, 299105, 217188, 299109, 307303, 315495, 356457, 45163, 307307, 315502, 192624, 307314, 323700, 299126, 233591, 299136, 307329, 315524, 307338, 233613, 241813, 307352, 299164, 241821, 184479, 299167, 184481, 315557, 184486, 307370, 307372, 184492, 307374, 307376, 299185, 323763, 176311, 299191, 307385, 307386, 258235, 176316, 307388, 307390, 184503, 299200, 184512, 307394, 307396, 299204, 184518, 307399, 323784, 307409, 307411, 176343, 299225, 233701, 307432, 184572, 282881, 184579, 282893, 323854, 291089, 282906, 291104, 233766, 176435, 307508, 315701, 307510, 332086, 307512, 168245, 307515, 282942, 307518, 282947, 323917, 110926, 282957, 233808, 323921, 315733, 323926, 233815, 315739, 323932, 299357, 242018, 242024, 299373, 315757, 250231, 242043, 315771, 299388, 299391, 291202, 299398, 242057, 291212, 299405, 291222, 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, 127440, 315860, 176597, 283095, 127447, 299481, 127449, 176605, 242143, 127455, 291299, 340454, 127463, 242152, 291305, 127466, 176620, 127469, 127474, 291314, 291317, 135672, 127480, 233979, 291323, 127485, 291330, 127490, 283142, 127494, 127497, 233994, 135689, 127500, 291341, 233998, 127506, 234003, 127509, 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, 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, 234239, 242431, 209665, 234242, 299778, 242436, 226053, 234246, 226056, 234248, 291593, 242443, 234252, 242445, 234254, 291601, 234258, 242450, 242452, 234261, 348950, 201496, 234264, 234266, 234269, 283421, 234272, 234274, 152355, 234278, 299814, 283432, 234281, 234284, 234287, 283440, 185138, 242483, 234292, 234296, 234298, 283452, 160572, 234302, 234307, 242499, 234309, 292433, 234313, 316233, 316235, 234316, 283468, 242511, 234319, 234321, 234324, 185173, 201557, 234329, 234333, 308063, 234336, 234338, 242530, 349027, 234341, 234344, 234347, 177004, 234350, 324464, 234353, 152435, 177011, 234356, 234358, 234362, 234364, 291711, 234368, 234370, 201603, 291714, 234373, 226182, 234375, 291716, 308105, 226185, 234379, 234384, 234388, 234390, 324504, 234393, 209818, 308123, 324508, 234396, 291742, 226200, 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, 234501, 308231, 234504, 234507, 234510, 234515, 300054, 234519, 316439, 234520, 234523, 234526, 234528, 300066, 234532, 300069, 234535, 234537, 234540, 144430, 234543, 234546, 275508, 234549, 300085, 300088, 234553, 234556, 234558, 316479, 234561, 316483, 308291, 234563, 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, 324768, 283805, 234657, 242852, 234661, 283813, 300197, 234664, 177318, 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, 226617, 243003, 283963, 226628, 283973, 300357, 177482, 283983, 316758, 357722, 316766, 292192, 316768, 218464, 292197, 316774, 243046, 218473, 284010, 136562, 324978, 275834, 333178, 275836, 275840, 316803, 316806, 226696, 316811, 226699, 316814, 226703, 300433, 234899, 226709, 357783, 316824, 316826, 144796, 300448, 144807, 144810, 144812, 284076, 144814, 144820, 284084, 284087, 292279, 144826, 144828, 144830, 144832, 144835, 144837, 38342, 144839, 144841, 144844, 144847, 144852, 144855, 103899, 300507, 333280, 218597, 292329, 300523, 259565, 300527, 308720, 259567, 226802, 292338, 316917, 308727, 292343, 300537, 316933, 316947, 308757, 308762, 284191, 316959, 284194, 284196, 235045, 284199, 284204, 284206, 284209, 284211, 284213, 308790, 316983, 284215, 194103, 284218, 194101, 226877, 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, 243293, 284258, 292452, 292454, 284263, 177766, 284265, 292458, 284267, 292461, 284272, 284274, 276086, 284278, 292470, 292473, 284283, 276093, 284286, 292479, 284288, 292481, 284290, 325250, 284292, 292485, 325251, 276095, 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, 276206, 358128, 284399, 358133, 358135, 276216, 358138, 300795, 358140, 284413, 358142, 358146, 317187, 284418, 317189, 317191, 284428, 300816, 300819, 317207, 284440, 300828, 300830, 276255, 325408, 300832, 300834, 317221, 227109, 358183, 186151, 276268, 300845, 243504, 300850, 284469, 276280, 325436, 358206, 276291, 366406, 276295, 300872, 153417, 292681, 358224, 284499, 276308, 178006, 317271, 284502, 276315, 292700, 284511, 317279, 227175, 292715, 300912, 284529, 292721, 300915, 284533, 292729, 317306, 284540, 292734, 325512, 169868, 276365, 284564, 358292, 399252, 284566, 317332, 350106, 284572, 276386, 284579, 276388, 358312, 284585, 317353, 276395, 292776, 292784, 276402, 358326, 161718, 276410, 276411, 358330, 276418, 276425, 301009, 301011, 301013, 292823, 301015, 301017, 358360, 292828, 276446, 153568, 276448, 276452, 276455, 292839, 350186, 292843, 276460, 292845, 276464, 178161, 227314, 276466, 350200, 325624, 276472, 317435, 276476, 276479, 276482, 350210, 276485, 317446, 178181, 276490, 350218, 292876, 350222, 276496, 317456, 317458, 243733, 243740, 317468, 317472, 325666, 243751, 292904, 276528, 178224, 243762, 309298, 325685, 325689, 235579, 325692, 235581, 178238, 276539, 276544, 243779, 325700, 284739, 292934, 243785, 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, 153765, 350375, 350379, 350381, 350383, 129200, 350385, 350387, 350389, 350395, 350397, 350399, 227520, 350402, 227522, 301252, 350406, 227529, 309450, 301258, 276685, 309455, 276689, 309462, 301272, 276699, 309468, 194780, 309471, 301283, 317672, 317674, 325867, 243948, 194801, 309491, 227571, 309494, 243960, 276735, 227583, 227587, 276739, 211204, 276742, 227593, 227596, 325910, 309530, 342298, 211232, 317729, 276775, 211241, 325937, 325943, 211260, 260421, 276809, 285002, 276811, 235853, 276816, 235858, 276829, 276833, 391523, 276836, 276843, 293227, 276848, 293232, 186744, 211324, 227709, 285061, 366983, 317833, 178572, 285070, 285077, 178583, 227738, 317853, 276896, 317858, 342434, 285093, 317864, 285098, 276907, 235955, 276917, 293304, 293307, 293314, 309707, 293325, 129486, 317910, 293336, 235996, 317917, 293343, 358880, 276961, 227810, 293346, 276964, 293352, 236013, 293364, 293370, 301562, 317951, 309764, 301575, 121352, 236043, 317963, 342541, 55822, 113167, 317971, 309779, 309781, 277011, 55837, 227877, 227879, 293417, 227882, 309804, 293421, 105007, 236082, 285236, 23094, 277054, 244288, 219714, 129603, 318020, 301636, 301639, 301643, 277071, 285265, 399955, 309844, 277080, 309849, 285277, 285282, 326244, 318055, 277100, 309871, 121458, 277106, 170618, 170619, 309885, 309888, 277122, 227975, 277128, 285320, 301706, 318092, 326285, 318094, 334476, 277136, 277139, 227992, 334488, 285340, 318108, 227998, 318110, 137889, 383658, 285357, 318128, 277170, 342707, 154292, 293555, 318132, 277173, 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, 293677, 318253, 285489, 293685, 285494, 301880, 285499, 301884, 310080, 293696, 277317, 277322, 293706, 277329, 162643, 310100, 301911, 277337, 301913, 301921, 400236, 236397, 162671, 326514, 310134, 15224, 236408, 277368, 416639, 416640, 113538, 310147, 416648, 39817, 187274, 277385, 301972, 424853, 277405, 277411, 310179, 293798, 293802, 236460, 277426, 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, 244731, 302075, 293887, 277504, 277507, 277511, 277519, 293908, 293917, 293939, 318516, 277561, 277564, 310336, 7232, 293956, 277573, 228422, 310344, 277577, 293960, 277583, 203857, 310355, 293971, 310359, 236632, 277594, 138332, 277598, 203872, 277601, 285792, 310374, 203879, 310376, 228460, 318573, 203886, 187509, 285815, 285817, 367737, 285821, 302205, 392326, 285831, 253064, 302218, 285835, 294026, 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, 302296, 384222, 310498, 285927, 318698, 302315, 195822, 228592, 294132, 138485, 228601, 204026, 228606, 204031, 64768, 310531, 285958, 138505, 228617, 318742, 204067, 277798, 130345, 277801, 113964, 285997, 384302, 285999, 277804, 113969, 277807, 277811, 318773, 318776, 277816, 286010, 277819, 294204, 417086, 277822, 286016, 294211, 302403, 384328, 277832, 277836, 146765, 326991, 294223, 277839, 277842, 277847, 277850, 179547, 277853, 146784, 277857, 302436, 277860, 294246, 327015, 310632, 327017, 351594, 277864, 277869, 277872, 351607, 310648, 277880, 310651, 277884, 277888, 310657, 351619, 294276, 310659, 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, 64966, 245191, 163272, 310727, 302534, 277959, 292968, 302541, 277963, 302543, 277966, 310737, 277971, 228825, 163290, 277978, 310749, 277981, 277984, 310755, 277989, 277991, 187880, 277995, 310764, 286188, 278000, 228851, 310772, 278003, 278006, 40440, 212472, 278009, 40443, 286203, 310780, 40448, 228864, 286214, 228871, 302603, 65038, 302614, 286233, 302617, 302621, 187936, 146977, 286240, 187939, 40484, 294435, 286246, 40486, 40488, 278057, 245288, 40491, 294439, 294440, 294443, 310831, 294445, 286248, 40499, 40502, 212538, 40507, 40511, 40513, 228933, 40521, 286283, 40525, 40527, 212560, 228944, 400976, 40533, 147032, 40537, 40539, 40541, 278109, 40544, 40548, 40550, 40552, 286313, 40554, 286312, 310892, 40557, 40560, 188022, 122488, 294521, 343679, 294537, 310925, 286354, 278163, 302740, 122517, 278168, 179870, 327333, 229030, 212648, 278188, 302764, 278192, 319153, 278196, 302781, 319171, 302789, 294599, 278216, 294601, 302793, 343757, 212690, 278227, 286420, 319187, 229076, 286425, 319194, 278235, 301163, 278238, 229086, 286432, 294625, 294634, 302838, 319226, 286460, 278274, 302852, 278277, 302854, 294664, 311048, 352008, 319243, 311053, 302862, 319251, 294682, 278306, 188199, 294701, 278320, 319280, 319290, 229192, 302925, 188247, 188252, 237409, 229233, 294776, 360317, 294785, 327554, 360322, 40840, 40851, 294803, 188312, 294811, 319390, 237470, 294817, 319394, 40865, 294821, 311209, 180142, 294831, 188340, 40886, 319419, 294844, 294847, 393177, 294876, 294879, 294883, 393190, 294890, 311279, 278513, 237555, 278516, 311283, 237562 ]
1c386a5b9972879ecf14197b413a2958212a7fe7
72c013893d4380adfdd528ec483a7662c649eb6b
/Sources/AdventOfCode2020/Day03_01.swift
ca98682d3f0fed70a7e8d47a52819de445d82e16
[]
no_license
Jman012/AdventOfCode2020
e05b16ba9861de6191ebca323fedeb51fd93f715
d744f0446a8ab6413341bf0e9ee6a29bafbc1009
refs/heads/main
2023-02-02T23:08:17.275429
2020-12-25T06:55:46
2020-12-25T06:55:46
317,456,932
0
0
null
null
null
null
UTF-8
Swift
false
false
2,505
swift
import Foundation public protocol Defaultable { init() } struct Day03_01 { enum MountainCell: Defaultable { case empty case tree init() { self = .empty } } class Grid<Cell> where Cell: Defaultable { // Each inner array is a row, // each outer array is a column. // gridContents[row][column] private var gridContents: [[Cell]] let columns: Int let rows: Int init(columns: Int, rows: Int) { let row = Array<Cell>(repeating: Cell(), count: columns) gridContents = Array<Array<Cell>>(repeating: row, count: rows) self.columns = columns self.rows = rows } private func safeWrapping(column: Int, row: Int) -> (column: Int, row: Int) { return (column: column % self.columns, row: row % self.rows) } func get(column unsafeCol: Int, row unsafeRow: Int) -> Cell { let (col, row) = safeWrapping(column: unsafeCol, row: unsafeRow) return self.gridContents[row][col] } func set(column unsafeCol: Int, row unsafeRow: Int, to cellValue: Cell) { let (col, row) = safeWrapping(column: unsafeCol, row: unsafeRow) self.gridContents[row][col] = cellValue } } func createMap(input: String) -> Grid<MountainCell> { let lines = input.split(separator: "\n") let rows = lines.count let columns = lines.first!.count let grid = Grid<MountainCell>(columns: columns, rows: rows) for (lineIndex, line) in lines.enumerated() { for (cellIndex, cell) in line.enumerated() { let mountainCell: MountainCell if cell == "#" { mountainCell = .tree } else { mountainCell = .empty } grid.set(column: cellIndex, row: lineIndex, to: mountainCell) } } return grid } func countTreesHit(onGrid grid: Grid<MountainCell>, goingRight right: Int, goingDown down: Int) -> Int { var row = 0, col = 0 var treesHit = 0 while row < grid.rows { if grid.get(column: col, row: row) == .tree { treesHit += 1 } col += right row += down } return treesHit } func solve() { let grid = createMap(input: Inputs.day03Input) let treesHit = countTreesHit(onGrid: grid, goingRight: 3, goingDown: 1) print(treesHit) } func solvePart2() { let grid = createMap(input: Inputs.day03Input) let slopes: [(right: Int, down: Int)] = [ (right: 1, down: 1), (right: 3, down: 1), (right: 5, down: 1), (right: 7, down: 1), (right: 1, down: 2), ] let result = slopes.map { countTreesHit(onGrid: grid, goingRight: $0.right, goingDown: $0.down) }.reduce(1, *) print(result) } }
[ -1 ]
3f11d49aea756ae01fc0a510fd923c0462bdb905
86aa231d2d251c30e214dd3d9220c24ec8c8d3f3
/Buoi_02_28_12/Buoi_02_28_12/Bai04_zalo.swift
1aa1fcdd6331080ccfb8c82975e795871ee9fdf2
[]
no_license
onglao1999/onglao1999.github.io
613e70079f11fa8f75f7b4a0c02a4f261cbf0b28
9fd0fb1542e29300a5da472999924dbabd8047db
refs/heads/master
2020-11-30T05:05:44.050596
2020-05-04T02:17:29
2020-05-04T02:17:29
230,309,554
2
0
null
null
null
null
UTF-8
Swift
false
false
426
swift
// // Bai04_zalo.swift // Buoi_02_28_12 // // Created by Ong_Lao_Ngao on 12/28/19. // Copyright © 2019 Ong_Lao_Ngao. All rights reserved. // import Foundation //4, Nhập vào thời điểm T gồm 3 số theo dạng : “Giờ : Phút : Giây” và 1 số nguyên X <= 10000 //- Hỏi sau X giây kể từ thời điểm T thì thời gian là bao nhiêu ? //- Hãy in ra theo dạng “Giờ : Phút : Giây”
[ -1 ]
bd3562f0206c91e24a8a04bad07bd8c5c4db201d
32bef380d7f98bd0a3c23b4c3ed05439f4bc7259
/源代码/03/3.8/3.8.3/3-51/4-51Tests/__51Tests.swift
0aa21d07663f317fcac2973d0b33889e36c4a2a6
[ "MIT" ]
permissive
CoderDream/SwiftGameInAction
1ff4fe8cd2b906053687da69b78cfeb4acca523f
f53523efe85c15ecb39b70472b2f2b702570cf0b
refs/heads/master
2020-05-01T04:47:28.781004
2019-07-23T13:43:46
2019-07-23T13:43:46
177,283,631
0
1
null
null
null
null
UTF-8
Swift
false
false
879
swift
// // __51Tests.swift // 4-51Tests // // Created by Mac on 14-12-23. // Copyright (c) 2014年 Mac. All rights reserved. // import UIKit import XCTest class __51Tests: XCTestCase { override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. super.tearDown() } func testExample() { // This is an example of a functional test case. XCTAssert(true, "Pass") } func testPerformanceExample() { // This is an example of a performance test case. self.measureBlock() { // Put the code you want to measure the time of here. } } }
[ 276481, 276484, 276489, 276492, 278541, 278544, 278550, 276509, 278561, 276543, 159807, 280649, 276555, 223318, 288857, 227417, 278618, 194652, 194653, 276577, 43109, 276581, 276582, 276585, 223340, 276589, 227439, 276592, 227446, 276603, 276606, 276613, 141450, 311435, 276627, 276631, 276632, 184475, 227492, 196773, 227495, 129203, 176314, 227528, 276684, 276687, 278742, 278746, 155867, 278753, 196834, 276709, 276710, 276715, 233715, 157944, 211193, 227576, 227585, 276744, 227592, 276748, 276753, 157970, 129301, 276760, 278810, 276764, 276774, 262450, 276787, 276792, 278846, 164162, 278856, 276813, 278862, 278863, 6482, 276821, 276822, 276831, 276835, 276839, 276847, 278898, 278908, 280961, 178571, 278951, 278954, 278965, 276919, 276920, 278969, 278985, 279002, 276958, 227813, 279019, 279022, 276998, 186893, 279054, 223767, 277017, 223769, 277029, 281138, 277048, 301634, 369220, 277066, 166507, 189036, 189037, 277101, 189042, 189043, 277118, 184962, 277133, 133774, 225933, 225936, 277138, 277141, 277142, 225943, 225944, 164512, 225956, 285353, 225962, 209581, 154291, 154294, 277176, 277190, 199366, 225997, 226001, 164563, 277204, 203477, 226004, 226007, 203478, 119513, 277203, 201442, 226019, 226033, 226035, 226036, 226043, 209660, 234238, 234241, 226051, 234245, 277254, 209670, 203529, 226058, 234250, 234253, 234256, 285463, 234263, 369432, 234268, 105246, 228129, 234280, 277289, 234283, 277294, 277295, 234286, 226097, 234289, 162621, 234301, 277312, 234304, 162626, 234305, 277316, 234311, 234312, 234317, 277327, 234323, 234326, 277339, 297822, 234335, 297826, 234340, 174949, 234343, 277354, 234346, 234349, 277360, 213876, 277366, 234361, 277370, 226170, 234366, 234367, 234372, 226181, 213894, 277381, 226184, 234377, 226189, 234381, 226194, 234387, 234392, 234395, 279456, 277410, 234404, 226214, 256937, 234409, 275371, 234412, 226222, 226223, 234419, 226227, 234425, 277435, 287677, 234430, 226241, 275397, 234438, 226249, 234445, 275410, 234450, 234451, 234454, 234457, 275418, 234463, 234466, 277480, 179176, 234477, 234482, 234492, 234495, 277505, 234498, 277510, 234503, 234506, 275469, 277517, 197647, 277518, 295953, 234509, 277523, 234517, 281625, 234530, 234531, 234534, 275495, 234539, 275500, 310317, 277550, 275505, 275506, 234548, 277563, 234555, 156733, 277566, 230463, 7229, 7230, 207938, 7231, 234560, 234565, 277574, 281666, 234569, 207953, 277585, 296018, 234583, 234584, 275547, 277596, 234594, 277603, 234603, 281707, 275565, 156785, 275571, 234612, 398457, 234622, 226435, 275590, 275591, 234631, 253063, 277640, 302217, 234632, 234642, 277651, 226452, 226451, 275607, 119963, 234652, 277665, 275625, 208043, 275628, 226476, 226479, 226481, 277686, 277690, 277694, 203989, 275671, 195811, 285929, 204022, 120055, 120056, 204041, 277792, 259363, 199971, 277800, 113962, 277803, 277806, 113966, 226608, 277809, 226609, 277814, 277815, 277821, 277824, 226624, 277825, 15686, 277831, 226632, 277834, 142669, 277838, 277841, 222548, 277845, 277844, 277852, 224605, 218462, 224606, 277856, 179552, 142689, 302438, 277862, 281962, 277866, 173420, 277868, 277871, 279919, 277878, 275831, 275832, 277882, 277883, 142716, 275838, 275839, 277890, 277891, 226694, 275847, 277896, 277897, 281992, 277900, 230799, 296338, 277907, 206228, 226711, 226712, 277911, 277919, 277920, 277925, 277927, 370091, 277936, 277939, 277940, 296375, 277943, 277946, 277949, 277952, 296387, 163269, 277957, 296391, 277962, 282060, 277965, 277969, 277974, 228823, 228824, 277977, 277980, 226781, 277983, 277988, 277993, 296425, 277994, 277997, 278002, 278005, 226805, 278008, 153095, 175625, 192010, 280077, 149007, 65041, 204313, 278056, 278060, 228917, 226875, 128583, 226888, 276045, 276046, 226897, 276050, 226906, 147036, 243292, 226910, 370271, 276084, 276085, 276088, 278140, 188031, 276097, 192131, 276100, 276101, 312972, 278160, 278162, 276116, 276117, 276120, 278170, 280220, 276126, 276129, 278191, 276146, 278195, 296628, 276148, 278201, 276156, 276165, 278214, 276172, 276173, 323276, 276179, 276180, 216795, 216796, 276195, 313065, 276210, 276211, 276219, 171776, 278285, 276238, 227091, 184086, 278299, 276253, 276257, 278307, 288547, 278316, 159533, 165677, 276279, 276282, 276283, 288574, 276287, 276298, 296779, 188246, 276311, 276318, 276325, 276332, 173936, 110452, 276344, 276350, 227199, 1923, 40850, 40853, 44952, 247712, 276385, 227238, 276394, 276400, 276401, 276408, 161722, 276413, 276421, 276422, 276430, 153552, 276443, 276444, 153566, 276450, 276451, 276454, 276459, 276462, 276463, 276468, 276469, 278518, 276475, 276478 ]
ff10a300929c1f265e0f7421bf34911b41a129c2
91ece349d02208d00a7814611bfc060769ee682f
/Notes App/Notes App/NotesClass.swift
91174fc6b7b2f05d3e42b59ebb2b0598a249a829
[]
no_license
ethanweinrot20/CAS-Computer-Science
bceb4600b9642d14af864ced7c155e6f7032874f
abcaceb6d71d6d46327230f30f38171638590595
refs/heads/master
2020-07-23T15:06:50.938755
2020-04-23T21:05:41
2020-04-23T21:05:41
207,603,772
0
0
null
2020-04-23T21:20:29
2019-09-10T16:03:31
Swift
UTF-8
Swift
false
false
233
swift
// // NotesClass.swift // Notes App // // Created by Ethan Weinrot on 11/15/19. // Copyright © 2019 Ethan Weinrot. All rights reserved. // import Foundation class Note { var note: String = "" var date: Date = Date() }
[ -1 ]
562000a53d38afeeb905b5b8f61cfa430cd9ce77
c06106f8c70eec98eb5c616396c23263398e7b24
/GFExtensions/Extension+Tools/Extension+UIKit.swift
7ffbcbe6935be33f3d0e026547700bc8d6a557f7
[]
no_license
913868456/GFExtensions
3251b492693405e18628e68f7dd53d1bd83d87d4
8c24a5d63883720824286b63dd48b5e334fc0b63
refs/heads/master
2021-07-09T03:35:26.345029
2020-08-29T03:36:51
2020-08-29T03:36:51
189,173,898
1
0
null
null
null
null
UTF-8
Swift
false
false
37,170
swift
// // Extension+UIKit.swift // GFExtensions // // Created by 防神 on 2018/8/3. // Copyright © 2018年 吃面多放葱. All rights reserved. // import CoreGraphics import Foundation import ImageIO import UIKit import Photos // MARK: UIEdgeInsets public extension GFCompat where Base == UIEdgeInsets { static func all(_ side: CGFloat) -> UIEdgeInsets { return .init(top: side, left: side, bottom: side, right: side) } static func margin(horizon: CGFloat = 0, vertical: CGFloat = 0) -> UIEdgeInsets { return Base(top: vertical, left: horizon, bottom: vertical, right: horizon) } static func left(_ value: CGFloat) -> UIEdgeInsets { return Base(top: 0, left: value, bottom: 0, right: 0) } static func right(_ value: CGFloat) -> UIEdgeInsets { return Base(top: 0, left: 0, bottom: 0, right: value) } static func top(_ value: CGFloat) -> UIEdgeInsets { return Base(top: value, left: 0, bottom: 0, right: 0) } static func bottom(_ value: CGFloat) -> UIEdgeInsets { return Base(top: 0, left: 0, bottom: value, right: 0) } } // MARK: - UIViewController public extension GFCompat where Base: UIViewController { // 适配scrollview边距 func adjustScrollContentInset(_ scroll: UIScrollView?) { if #available(iOS 11.0, *) { scroll?.contentInsetAdjustmentBehavior = .never } else { base.automaticallyAdjustsScrollViewInsets = false } } func setStatusBarColor(color: UIColor) { if UIScreen.gf.isFullScreen { if let statusWin = UIApplication.shared.value(forKey: "statusBarWindow") as? UIView { if let statusBar = statusWin.value(forKey: "statusBar") as? UIView { statusBar.backgroundColor = color } } } } func popAction() { base.navigationController?.popViewController(animated: true) } func dismissAction() { base.dismiss(animated: true, completion: nil) } } // MARK: - UINavigationController public extension GFCompat where Base: UINavigationController { /// 设置导航栏背景透明度 func backgroundAlpha(alpha: CGFloat) { if let barBackgroundView = base.navigationBar.subviews.first { if #available(iOS 11.0, *) { if base.navigationBar.isTranslucent { for view in barBackgroundView.subviews { view.alpha = alpha } } else { barBackgroundView.alpha = alpha } } else { barBackgroundView.alpha = alpha } } } } // MARK: - UIScreen public extension GFCompat where Base: UIScreen { /// Size static var isFullScreen: Bool { if #available(iOS 11, *) { guard let w = UIApplication.shared.delegate?.window, let unwrapedWindow = w else { return false } if unwrapedWindow.safeAreaInsets.bottom > 0 { print(unwrapedWindow.safeAreaInsets) return true } } return false } static var screenWidth: CGFloat { return UIScreen.main.bounds.size.width } static var screenHeight: CGFloat { return UIScreen.main.bounds.size.height } static var navigationBarHeight: CGFloat { return statusBarHeight + UINavigationBar.appearance().gf.height } static var statusBarHeight: CGFloat { return UIApplication.shared.statusBarFrame.size.height } static var bottomBarHeight: CGFloat { return isFullScreen ? 83 : 49 } } // MARK: - UIView public extension GFCompat where Base: UIView { var x: CGFloat { set { base.frame.origin.x = newValue } get { return base.frame.origin.x } } var y: CGFloat { set { base.frame.origin.y = newValue } get { return base.frame.origin.y } } var width: CGFloat { set { base.frame.size.width = newValue } get { return base.frame.size.width } } var height: CGFloat { set { base.frame.size.height = newValue } get { return base.frame.size.height } } var center: CGPoint { set { base.center = newValue } get { return base.center } } var centerX: CGFloat { set { base.center.x = newValue } get { return base.center.x } } var centerY: CGFloat { set { base.center.y = newValue } get { return base.center.y } } var top: CGFloat { return base.frame.minY } var bottom: CGFloat { return base.frame.maxY } var left: CGFloat { return base.frame.minX } var right: CGFloat { return base.frame.maxX } /// 画圆角 func roundCorners(radius: CGFloat, _ corners: UIRectCorner = UIRectCorner.allCorners) { let rect = CGRect(x: 0, y: 0, width: base.bounds.width, height: base.bounds.height) let path = UIBezierPath(roundedRect: rect, byRoundingCorners: corners, cornerRadii: CGSize(width: radius, height: radius)) if radius == 0 { base.layer.mask = nil } else { let mask = CAShapeLayer() mask.path = path.cgPath mask.frame = rect base.layer.mask = mask } } /// 渐变色 @discardableResult func addGradient(colors: [UIColor], startPoint: CGPoint = CGPoint(x: 0.5, y: 0), endPoint: CGPoint = CGPoint(x: 0.5, y: 1)) -> CAGradientLayer { let gradient = CAGradientLayer() gradient.frame = base.bounds gradient.colors = colors.map { $0.cgColor } gradient.startPoint = startPoint gradient.endPoint = endPoint base.layer.insertSublayer(gradient, at: 0) return gradient } /// 获取View的第一响应者 var firstResponder: UIView? { guard !base.isFirstResponder else { return base } for subview in base.subviews { if let firstResponder = subview.gf.firstResponder { return firstResponder } } return nil } /// 截屏 func screenShot() -> UIImage? { var image: UIImage? if #available(iOS 10.0, *) { let format = UIGraphicsImageRendererFormat() format.opaque = base.isOpaque let renderer = UIGraphicsImageRenderer(size: base.frame.size, format: format) image = renderer.image { _ in base.drawHierarchy(in: base.frame, afterScreenUpdates: true) } } else { UIGraphicsBeginImageContextWithOptions(base.frame.size, base.isOpaque, UIScreen.main.scale) base.drawHierarchy(in: base.frame, afterScreenUpdates: true) image = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext() } return image } /// 获取当前控制器 func ownerController() -> UIViewController? { var n = base.next while n != nil { if n is UIViewController { return n as? UIViewController } n = n?.next } return nil } /// 阴影 func addShadow(color: UIColor = UIColor.black.withAlphaComponent(0.05), offset: CGSize = .zero, opacity: Float = 1, shadowRadius: CGFloat = 11) { base.layer.shadowColor = color.cgColor base.layer.shadowOffset = offset base.layer.shadowOpacity = opacity base.layer.shadowRadius = shadowRadius } func removeShadow() { base.layer.shadowColor = nil base.layer.shadowOffset = .zero base.layer.shadowOpacity = 0 base.layer.shadowRadius = 0 } /// UIViewAnimation 旋转 static func transformRotate(view: UIView, duration: TimeInterval, rotationAngle angle: CGFloat) { UIView.animate(withDuration: duration) { view.transform = CGAffineTransform(rotationAngle: angle) } } /// 平移 static func transformTranslate(view: UIView, duration: TimeInterval, translationX tx: CGFloat, y ty: CGFloat) { UIView.animate(withDuration: duration) { view.transform = CGAffineTransform(translationX: tx, y: ty) } } /// 缩放 static func transformScale(view: UIView, duration: TimeInterval, scaleX sx: CGFloat, y sy: CGFloat) { UIView.animate(withDuration: duration) { view.transform = CGAffineTransform(scaleX: sx, y: sy) } } } // MARK: - UILabel public extension GFCompat where Base: UILabel { func setTextColor(textColor: UIColor, font: UIFont, _ alignment: NSTextAlignment = .center) { base.textColor = textColor base.font = font base.textAlignment = alignment } func setText(text: String, textColor: UIColor, font: UIFont, _ alignment: NSTextAlignment = .center) { base.text = text base.textColor = textColor base.font = font base.textAlignment = alignment } } // MARK: - UIButton public extension GFCompat where Base: UIButton { enum ButtonLayoutPosition { case `default` // image left, title right case imageRight case imageTop case imageBottom } /// 布局位置 /// - Parameters: /// - position: 默认左图右文 /// - space: 图文间距 func layoutWithPosiziton(_ position: ButtonLayoutPosition = .default, space: CGFloat = 0) { base.layoutIfNeeded() let imageSize = base.imageView?.intrinsicContentSize ?? CGSize.zero let titleSize = base.titleLabel?.intrinsicContentSize ?? CGSize.zero var titleEdgeInset = UIEdgeInsets.zero var imageEdgeInset = UIEdgeInsets.zero switch position { case .imageTop: imageEdgeInset = UIEdgeInsets(top: -titleSize.height - space / 2.0, left: 0, bottom: 0, right: -titleSize.width) titleEdgeInset = UIEdgeInsets(top: 0, left: -imageSize.width, bottom: -imageSize.height - space / 2.0, right: 0) case .imageBottom: imageEdgeInset = UIEdgeInsets(top: 0, left: 0, bottom: -titleSize.height - space / 2.0, right: -titleSize.width) titleEdgeInset = UIEdgeInsets(top: -imageSize.height - space / 2.0, left: -imageSize.width, bottom: 0, right: 0) case .imageRight: imageEdgeInset = UIEdgeInsets(top: 0, left: titleSize.width + space / 2.0, bottom: 0, right: -titleSize.width - space / 2.0) titleEdgeInset = UIEdgeInsets(top: 0, left: -imageSize.width - space / 2.0, bottom: 0, right: imageSize.width + space / 2.0) default: imageEdgeInset = UIEdgeInsets(top: 0, left: -space / 2.0, bottom: 0, right: space / 2.0) titleEdgeInset = UIEdgeInsets(top: 0, left: space / 2.0, bottom: 0, right: -space / 2.0) } base.titleEdgeInsets = titleEdgeInset base.imageEdgeInsets = imageEdgeInset } /// Button背景色 /// - Parameters: /// - color: 颜色 /// - state: 状态 func setBackgroundColor(_ color: UIColor, for state: UIControl.State) { let image = UIImage.init(color: color) base.setBackgroundImage(image, for: state) } } // MARK: - UIImage extension UIImage { /// 生成指定颜色和尺寸的图片, 尺寸默认为 CGSize(width:1, height:1) /// - Parameters: /// - color: 颜色 /// - size: 尺寸 convenience init?(color: UIColor, size: CGSize = CGSize(width: 1, height: 1)) { let rect = CGRect(origin: .zero, size: size) UIGraphicsBeginImageContextWithOptions(rect.size, false, 0.0) color.setFill() UIRectFill(rect) let image = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext() guard let cgImage = image?.cgImage else { return nil } self.init(cgImage: cgImage) } /// view生成图片 /// - Parameters: /// - view: 需要生成图片的view /// - scale: 缩放倍率 convenience init(view: UIView, scale: CGFloat) { UIGraphicsBeginImageContextWithOptions(view.bounds.size, view.isOpaque, scale) view.drawHierarchy(in: view.bounds, afterScreenUpdates: false) defer { UIGraphicsEndImageContext() } let image = UIGraphicsGetImageFromCurrentImageContext() self.init(cgImage: (image?.cgImage)!) } /// 画圆 /// - Parameters: /// - size: 圆的大小 /// - color: 圆的颜色 class func setArc(size: CGSize, color: UIColor) -> UIImage? { UIGraphicsBeginImageContext(size) let context = UIGraphicsGetCurrentContext() context?.setFillColor(color.cgColor) context?.move(to: .zero) context?.addArc(center: CGPoint(x: size.width/2.0, y: size.height/2.0), radius: size.width/2.0, startAngle: CGFloat.pi * 0, endAngle: CGFloat.pi * 2.0, clockwise: true) context?.fillPath() let image = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext() return image } /// 画线 /// - Parameters: /// - size: 线的大小 /// - lineColor: 线颜色 /// - length: 线长 /// - lineCap: 线头的形状 /// - phrase: dash间距 class func setLine(size: CGSize, lineColor: UIColor, length: [CGFloat] = [10,10], lineCap: CGLineCap = .square, phrase: CGFloat = 0) -> UIImage? { UIGraphicsBeginImageContext(size) let context = UIGraphicsGetCurrentContext() context?.setLineCap(lineCap) context?.setLineWidth(size.height) context?.setStrokeColor(lineColor.cgColor) context?.setLineDash(phase: phrase, lengths: length) context?.move(to: .zero) context?.addLine(to: CGPoint(x: size.width, y: 0)) context?.stroke(CGRect(origin: .zero, size: size)) let image = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext() return image } /// 画线 /// - Parameters: /// - size: 线的大小 /// - lineColor: 线颜色 /// - lineWidth: 线宽 class func lineImage(size: CGSize, lineColor: UIColor, lineWidth: CGFloat) -> UIImage? { return self.setLine(size: size, lineColor: lineColor, length: [lineWidth, lineWidth]) } } public extension GFCompat where Base: UIImage { /// Add WaterMarkingImage /// /// - Parameters: /// - image: the image that painted on /// - waterImageName: waterImage /// - Returns: the warterMarked image static func waterMarkingImage(image: UIImage, with waterImage: UIImage) -> UIImage? { UIGraphicsBeginImageContextWithOptions(image.size, false, 0) image.draw(in: CGRect(x: 0, y: 0, width: image.size.width, height: image.size.height)) let waterImageX = image.size.width * 0.78 let waterImageY = image.size.height - image.size.width / 5.4 let waterImageW = image.size.width * 0.2 let waterImageH = image.size.width * 0.075 waterImage.draw(in: CGRect(x: waterImageX, y: waterImageY, width: waterImageW, height: waterImageH)) let waterMarkingImage = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext() return waterMarkingImage } /// Add WaterMarking Text /// /// - Parameters: /// - image: the image that painted on /// - text: the text that needs painted /// - Returns: the waterMarked image static func waterMarkingImage(image: UIImage, with text: String) -> UIImage? { UIGraphicsBeginImageContextWithOptions(image.size, false, 0) image.draw(in: CGRect(x: 0, y: 0, width: image.size.width, height: image.size.height)) let str = text as NSString let pointY = image.size.height - image.size.width * 0.1 let point = CGPoint(x: image.size.width * 0.78, y: pointY) let attributes = [NSAttributedString.Key.foregroundColor: UIColor.white.withAlphaComponent(0.8), NSAttributedString.Key.font: UIFont.systemFont(ofSize: image.size.width / 25.0)] as [NSAttributedString.Key: Any] str.draw(at: point, withAttributes: attributes) let waterMarkingImage = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext() return waterMarkingImage } /// 修改图片填充色 func transform(withNewColor color: UIColor) -> UIImage { UIGraphicsBeginImageContextWithOptions(base.size, false, base.scale) let context = UIGraphicsGetCurrentContext()! context.translateBy(x: 0, y: base.size.height) context.scaleBy(x: 1.0, y: -1.0) context.setBlendMode(.normal) let rect = CGRect(x: 0, y: 0, width: base.size.width, height: base.size.height) context.clip(to: rect, mask: base.cgImage!) color.setFill() context.fill(rect) let newImage = UIGraphicsGetImageFromCurrentImageContext()! UIGraphicsEndImageContext() return newImage } /// 保存图片 func savedPhotos(_ completionHandler: ((Bool, Error?) -> Void)? = nil) { PHPhotoLibrary.shared().performChanges({ PHAssetChangeRequest.creationRequestForAsset(from: self.base) }, completionHandler: { isSuccess, error in DispatchQueue.main.async { completionHandler?(isSuccess, error) } }) } /// 旋转图片 /// - Parameter angle: 旋转角度 func rotate(_ angle: Double) -> UIImage? { if angle.truncatingRemainder(dividingBy: 360) == 0 { return base } let imageRect = CGRect(origin: .zero, size: base.size) let radian = CGFloat(angle) / CGFloat(180) * CGFloat.pi var rotatedRect = imageRect.applying(CGAffineTransform.identity.rotated(by: radian)) rotatedRect.origin.x = 0 rotatedRect.origin.y = 0 UIGraphicsBeginImageContextWithOptions(rotatedRect.size, false, base.scale) guard let context = UIGraphicsGetCurrentContext() else { return nil } context.translateBy(x: rotatedRect.width / 2, y: rotatedRect.height / 2) context.rotate(by: radian) context.translateBy(x: -base.size.width / 2, y: -base.size.height / 2) base.draw(at: CGPoint.zero) let rotatedImage = UIGraphicsGetImageFromCurrentImageContext() defer { UIGraphicsEndImageContext() } return rotatedImage } /// 图片裁圆角 /// - Parameter cornerRadius: 圆角 func roundCorners(_ cornerRadius: CGFloat) -> UIImage? { return image(withRoundRadius: cornerRadius, fit: base.size, roundingCorners: .allCorners, backgroundColor: nil) } func draw(cgImage _: CGImage?, to size: CGSize, draw: () -> Void) -> UIImage { UIGraphicsBeginImageContextWithOptions(size, false, base.scale) defer { UIGraphicsEndImageContext() } draw() return UIGraphicsGetImageFromCurrentImageContext() ?? base } func image(withRoundRadius radius: CGFloat, fit size: CGSize, roundingCorners corners: UIRectCorner = .allCorners, backgroundColor: UIColor? = nil) -> UIImage? { guard let cgImage = base.cgImage else { assertionFailure("[Kingfisher] Round corner image only works for CG-based image.") return base } let rect = CGRect(origin: CGPoint(x: 0, y: 0), size: size) return draw(cgImage: cgImage, to: size) { guard let context = UIGraphicsGetCurrentContext() else { assertionFailure("[Kingfisher] Failed to create CG context for image.") return } if let backgroundColor = backgroundColor { let rectPath = UIBezierPath(rect: rect) backgroundColor.setFill() rectPath.fill() } let path = UIBezierPath(roundedRect: rect, byRoundingCorners: corners, cornerRadii: CGSize(width: radius, height: radius)).cgPath context.addPath(path) context.clip() base.draw(in: rect) } } /// 将图片裁剪成指定比例(多余部分自动删除) func crop(ratio: CGFloat) -> UIImage { // 计算最终尺寸 var newSize: CGSize! if base.size.width / base.size.height > ratio { newSize = CGSize(width: base.size.height * ratio, height: base.size.height) } else { newSize = CGSize(width: base.size.width, height: base.size.width / ratio) } ////图片绘制区域 var rect = CGRect.zero rect.size.width = base.size.width rect.size.height = base.size.height rect.origin.x = (newSize.width - base.size.width) / 2.0 rect.origin.y = (newSize.height - base.size.height) / 2.0 // 绘制并获取最终图片 UIGraphicsBeginImageContext(newSize) base.draw(in: rect) let scaledImage = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext() return scaledImage! } /// 将图片缩放成指定尺寸(多余部分自动删除) func scale(to newSize: CGSize) -> UIImage { // 计算比例 let aspectWidth = newSize.width / base.size.width let aspectHeight = newSize.height / base.size.height let aspectRatio = max(aspectWidth, aspectHeight) // 图片绘制区域 var scaledImageRect = CGRect.zero scaledImageRect.size.width = base.size.width * aspectRatio scaledImageRect.size.height = base.size.height * aspectRatio scaledImageRect.origin.x = (newSize.width - base.size.width * aspectRatio) / 2.0 scaledImageRect.origin.y = (newSize.height - base.size.height * aspectRatio) / 2.0 // 绘制并获取最终图片 UIGraphicsBeginImageContext(newSize) base.draw(in: scaledImageRect) let scaledImage = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext() return scaledImage! } } // MARK: - UIColor public extension UIColor { /// HEX色值转换 /// - Parameters: /// - hex: hex /// - alpha: 透明度 convenience init(hex: String, alpha: CGFloat = 1.0) { var cString: String = hex.trimmingCharacters(in: .whitespacesAndNewlines).uppercased() if cString.hasPrefix("#") { cString.remove(at: cString.startIndex) } if cString.hasPrefix("0x") { cString.removeFirst(2) } if cString.count != 6 { self.init(white: 1, alpha: 1) return } var rgbValue: UInt32 = 0 Scanner(string: cString).scanHexInt32(&rgbValue) self.init( red: CGFloat((rgbValue & 0xFF0000) >> 16) / 255.0, green: CGFloat((rgbValue & 0x00FF00) >> 8) / 255.0, blue: CGFloat(rgbValue & 0x0000FF) / 255.0, alpha: alpha ) } } public extension GFCompat where Base: UIColor { /// 随机色 static func randomColor() -> UIColor { return UIColor(red: CGFloat.random(in: 0 ... 255) / 255.0, green: CGFloat.random(in: 0 ... 255) / 255.0, blue: CGFloat.random(in: 0 ... 255) / 255.0, alpha: 1.0) } } // MARK: - CGFloat protocol CGFloatConvertble { var f: CGFloat { get } } extension Int: CGFloatConvertble { var f: CGFloat { return CGFloat(self) } } extension Float: CGFloatConvertble { var f: CGFloat { return CGFloat(self) } } extension Double: CGFloatConvertble { var f: CGFloat { return CGFloat(self) } } // MARK: - 适配 ///尺寸适配 public extension CGFloat { /// 视图中所有水平值都是宽度为375时设定的逻辑值,这里返回实际的水平方向上的值 var scale: CGFloat { return (self * UIScreen.gf.screenWidth) / 375.0 } /// 屏幕顶部该数值在刘海影响下的数值 var safeAreaTopOffset: CGFloat { if #available(iOS 11.0, *), let top = UIApplication.shared.keyWindow?.safeAreaInsets.top, top != 0 { return top + scale } else { // Fallback on earlier versions return scale } } /// 屏幕底部该数值在刘海屏影响下的数值 var safeAreaBottomOffset: CGFloat { if #available(iOS 11.0, *), let bottom = UIApplication.shared.keyWindow?.safeAreaInsets.bottom, bottom != 0 { return bottom + scale } else { return scale } } } enum CompatibleFontWeight: String, CaseIterable { case ultraLight = "HelveticaNeue-UltraLight" case thin = "HelveticaNeue-Thin" case light = "HelveticaNeue-Light" case regular = "HelveticaNeue" case medium = "HelveticaNeue-Medium" case semibold = "Helvetica-Bold" case bold = "HelveticaNeue-Bold" case heavy = "HelveticaNeue-CondensedBold" case black = "HelveticaNeue-CondensedBlack" @available(iOS 8.2, *) var systemWeight: UIFont.Weight { switch self { case .ultraLight: return UIFont.Weight.ultraLight case .thin: return UIFont.Weight.thin case .light: return UIFont.Weight.light case .regular: return UIFont.Weight.regular case .medium: return UIFont.Weight.medium case .semibold: return UIFont.Weight.semibold case .bold: return UIFont.Weight.bold case .heavy: return UIFont.Weight.heavy case .black: return .black } } } /// 字体适配 extension UIFont { static func appFont(ofSize size: CGFloat, weight: CompatibleFontWeight = .regular) -> UIFont { if #available(iOS 8.2, *) { return UIFont.systemFont(ofSize: size, weight: weight.systemWeight) } else if let font = UIFont(name: weight.rawValue, size: size) { return font } else { return .systemFont(ofSize: size) } } } // MARK: - UISCcrollView public extension GFCompat where Base: UIScrollView { func scrollToTop() { base.gf.scrollToTopAnimated(true) } func scrollToBottom() { base.gf.scrollToBottomAnimated(true) } func scrollToLeft() { base.gf.scrollToLeftAnimated(true) } func scrollToRight() { base.gf.scrollToRightAnimated(true) } func scrollToTopAnimated(_ animated: Bool) { var off = base.contentOffset off.y = 0 - base.contentInset.top base.setContentOffset(off, animated: animated) } func scrollToBottomAnimated(_ animated: Bool) { var off = base.contentOffset off.y = base.contentSize.height - base.bounds.size.height + base.contentInset.bottom base.setContentOffset(off, animated: animated) } func scrollToLeftAnimated(_ animated: Bool) { var off = base.contentOffset off.x = 0 - base.contentInset.left base.setContentOffset(off, animated: animated) } func scrollToRightAnimated(_ animated: Bool) { var off = base.contentOffset off.x = base.contentSize.width - base.bounds.size.width + base.contentInset.right base.setContentOffset(off, animated: animated) } } extension GFCompat where Base: UITableView { func scrollToRow(_ row: Int, in section: Int, atScrollPosition position: UITableView.ScrollPosition, _ animated: Bool) { let indexpath = IndexPath(row: row, section: section) base.scrollToRow(at: indexpath, at: position, animated: animated) } func insertRow(at indexPath: IndexPath, withRowAnimation animation: UITableView.RowAnimation) { base.insertRows(at: [indexPath], with: animation) } func insertRow(_ row: Int, in section: Int, withRowAnimation animation: UITableView.RowAnimation) { let toInsert = IndexPath(row: row, section: section) base.insertRows(at: [toInsert], with: animation) } func reloadRow(at indexPath: IndexPath, withRowAnimation animation: UITableView.RowAnimation) { base.reloadRows(at: [indexPath], with: animation) } func reloadRow(_ row: Int, in section: Int, withRowAnimation animation: UITableView.RowAnimation) { let toReload = IndexPath(row: row, section: section) base.reloadRows(at: [toReload], with: animation) } func deleteRow(at indexPath: IndexPath, withRowAnimation animation: UITableView.RowAnimation) { base.deleteRows(at: [indexPath], with: animation) } } // MARK: - UITextView @IBDesignable class GFTextView: UITextView { let changeAnimationDuration = 0.25 let placeholerLabel = UILabel() override var text: String! { didSet { self.textChange(nil) } } override init(frame: CGRect, textContainer: NSTextContainer?) { super.init(frame: frame, textContainer: textContainer) placeholerLabel.textColor = .lightGray placeholerLabel.numberOfLines = 0 NotificationCenter.default.addObserver(self, selector: #selector(textChange(_:)), name: UITextView.textDidChangeNotification, object: self) } override class func awakeFromNib() { super.awakeFromNib() NotificationCenter.default.addObserver(self, selector: #selector(textChange(_:)), name: UITextView.textDidChangeNotification, object: nil) } deinit { NotificationCenter.default.removeObserver(self) } required init?(coder _: NSCoder) { fatalError("init(coder:) has not been implemented") } @objc func textChange(_: NSNotification?) { guard let txt = placeholerLabel.text, txt.isEmpty == false else { return } UIView.animate(withDuration: changeAnimationDuration) { if self.text.count == 0 { self.placeholerLabel.alpha = 1 } else { self.placeholerLabel.alpha = 0 } } } override func draw(_ rect: CGRect) { if placeholerLabel.frame == .zero { let size = bounds.size placeholerLabel.frame = CGRect(x: 8, y: 8, width: size.width - 16, height: size.height - 16) placeholerLabel.sizeToFit() addSubview(placeholerLabel) } if let txt = self.text, txt.isEmpty, let placeholder = self.placeholerLabel.text, !placeholder.isEmpty { placeholerLabel.alpha = 1 } super.draw(rect) } } // MARK: - UIGestureRecognizer public extension UIGestureRecognizer { @discardableResult convenience init(addToView targetView: UIView, closure: @escaping (UIGestureRecognizer) -> Void) { self.init() GestureTarget.add(gesture: self, closure: closure, toView: targetView) } } private class GestureTarget: UIView { class ClosureContainer { weak var gesture: UIGestureRecognizer? let closure: (UIGestureRecognizer) -> Void init(closure: @escaping (UIGestureRecognizer) -> Void) { self.closure = closure } } var containers = [ClosureContainer]() convenience init() { self.init(frame: .zero) isHidden = true } class func add(gesture: UIGestureRecognizer, closure: @escaping (UIGestureRecognizer) -> Void, toView targetView: UIView) { let target: GestureTarget if let existingTarget = existingTarget(inTargetView: targetView) { target = existingTarget } else { target = GestureTarget() targetView.addSubview(target) } let container = ClosureContainer(closure: closure) container.gesture = gesture target.containers.append(container) gesture.addTarget(target, action: #selector(GestureTarget.target(gesture:))) targetView.addGestureRecognizer(gesture) } class func existingTarget(inTargetView targetView: UIView) -> GestureTarget? { for subview in targetView.subviews { if let target = subview as? GestureTarget { return target } } return nil } func cleanUpContainers() { containers = containers.filter { $0.gesture != nil } } @objc func target(gesture: UIGestureRecognizer) { cleanUpContainers() for container in containers { guard let containerGesture = container.gesture else { continue } if gesture === containerGesture { container.closure(gesture) } } } } // MARK: - UIApplication public extension GFCompat where Base: UIApplication { static func openUrl(_ string: String?, _ complete: ((Bool) -> Void)? = nil) { guard let string = string, let url = URL(string: string), UIApplication.shared.canOpenURL(url) else { return } if #available(iOS 10.0, *) { UIApplication.shared.open(url, options: [:], completionHandler: complete) } else { let res = UIApplication.shared.openURL(url) complete?(res) } } /// 打开设置 static func openSetting() { openUrl(UIApplication.openSettingsURLString) } /// 拨打电话 /// - Parameter tel: telephone number static func openTelUrl(_ tel: String?) { if let tel = tel { openUrl("tel:" + tel) } } } // MARK: - UIDevice public extension GFCompat where Base: UIDevice { /// 检查系统语言是否变动 /// /// - Returns: ture 变动,false 未变动 func langChanged() -> Bool { guard let currentLanguage = NSLocale.preferredLanguages.first else { return false } if let preLanguage = UserDefaults.standard.object(forKey: "localLanguage") as? String { if preLanguage != currentLanguage { UserDefaults.standard.set(currentLanguage, forKey: "localLanguage") return true } else { return false } } else { UserDefaults.standard.set(currentLanguage, forKey: "localLanguage") return false } } } // MARK: - String public extension GFCompat where Base == String { /// 返回Int var int: Int? { return Int(base) } /// 返回URL var url: URL? { return URL(string: base) } /// 返回Float var float: Float? { let formatter = NumberFormatter() formatter.locale = .current formatter.allowsFloats = true return formatter.number(from: base)?.floatValue } /// 返回Double var double: Double? { let formatter = NumberFormatter() formatter.locale = .current formatter.allowsFloats = true return formatter.number(from: base)?.doubleValue } /// 过滤空格 var trim: String { return base.trimmingCharacters(in: .whitespacesAndNewlines) } /// 文字尺寸计算相关 func boundingRect(with size: CGSize, attributes: [NSAttributedString.Key: Any]) -> CGRect { let options: NSStringDrawingOptions = [.usesLineFragmentOrigin, .usesFontLeading] let rect = base.boundingRect(with: size, options: options, attributes: attributes, context: nil) return rect } /// 文字的尺寸 /// - Parameters: /// - size: 文字的约束尺寸 /// - font: 字号 /// - maximumNumberOfLines: 最大行数 func size(thatFits size: CGSize, font: UIFont, maximumNumberOfLines: Int = 0) -> CGSize { let attributes = [NSAttributedString.Key.font: font] var size = boundingRect(with: size, attributes: attributes).size if maximumNumberOfLines > 0 { size.height = max(size.height, CGFloat(maximumNumberOfLines) * font.lineHeight) } return size } /// 单行文字的宽度 /// - Parameters: /// - font: 字号 func width(with font: UIFont) -> CGFloat { let size = CGSize(width: CGFloat.greatestFiniteMagnitude, height: CGFloat.greatestFiniteMagnitude) return self.size(thatFits: size, font: font).width } /// 指定宽度的文字高度 /// - Parameters: /// - width: 宽度 /// - font: 字号 /// - maximumNumberOfLines: 最大行数 func height(thatFitsWidth width: CGFloat, font: UIFont, maximumNumberOfLines: Int = 0) -> CGFloat { let size = CGSize(width: width, height: CGFloat.greatestFiniteMagnitude) return self.size(thatFits: size, font: font, maximumNumberOfLines: maximumNumberOfLines).height } }
[ -1 ]
7c001b21818ad836c5f5ad5b9663383171a3ec4b
571352b32c6d77197e3506da9a3ba5cb70a2b945
/ViewFInderUITests/ViewFInderUITests.swift
83745c5705011ae85b048bdf7e9be2226cebbb08
[]
no_license
jenniferrr26/ViewFinder
9f28f32fbfd1f7ba9848638502d4e313d78e09b0
de145d1f6ec915c9e31f960c9450acb5eebaf751
refs/heads/master
2020-06-10T19:21:07.911371
2019-06-26T15:46:15
2019-06-26T15:46:15
193,720,171
0
0
null
null
null
null
UTF-8
Swift
false
false
1,158
swift
// // ViewFInderUITests.swift // ViewFInderUITests // // Created by Apple on 6/25/19. // Copyright © 2019 Apple. All rights reserved. // import XCTest class ViewFInderUITests: XCTestCase { override func setUp() { // Put setup code here. This method is called before the invocation of each test method in the class. // In UI tests it is usually best to stop immediately when a failure occurs. continueAfterFailure = false // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. XCUIApplication().launch() // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. } func testExample() { // Use recording to get started writing UI tests. // Use XCTAssert and related functions to verify your tests produce the correct results. } }
[ 155665, 237599, 229414, 344106, 278571, 229425, 229431, 180279, 319543, 352314, 213051, 376892, 32829, 286787, 237638, 311373, 196687, 278607, 311377, 368732, 180317, 278637, 319599, 278642, 131190, 131199, 278669, 278676, 311447, 327834, 278684, 278690, 311459, 278698, 278703, 278707, 180409, 278713, 295099, 139459, 131270, 229591, 385240, 147679, 147680, 311520, 319719, 295147, 286957, 262403, 180494, 319764, 278805, 311582, 278817, 311596, 336177, 98611, 368949, 278843, 287040, 319812, 311622, 319816, 254285, 344402, 229716, 278895, 287089, 139641, 311679, 311692, 106893, 156069, 254373, 311723, 377265, 319931, 311739, 278974, 336319, 311744, 336323, 278979, 278988, 278992, 279000, 369121, 279009, 188899, 279014, 319976, 279017, 311787, 360945, 319986, 279030, 311800, 279033, 279042, 287237, 279053, 303634, 303635, 279060, 279061, 254487, 279066, 188954, 279092, 352831, 377419, 303693, 369236, 115287, 189016, 295518, 287327, 279143, 279150, 287345, 344697, 189054, 287359, 311944, 279176, 344714, 311948, 311950, 311953, 287379, 336531, 180886, 295575, 352921, 303772, 221853, 205469, 295591, 279207, 295598, 279215, 279218, 287412, 164532, 287418, 303802, 66243, 287434, 287438, 279249, 303826, 369365, 369366, 279253, 230105, 361178, 295653, 369383, 230120, 361194, 279278, 312046, 279293, 205566, 295688, 312076, 295698, 221980, 336678, 262952, 262953, 279337, 262957, 164655, 328495, 303921, 336693, 230198, 295745, 222017, 279379, 295769, 230238, 435038, 230239, 279393, 303973, 279398, 295797, 295799, 279418, 336765, 287623, 320394, 189327, 189349, 279465, 140203, 304050, 189373, 213956, 345030, 279499, 304086, 304104, 123880, 320492, 320495, 320504, 214009, 312313, 312317, 328701, 418819, 320520, 230411, 320526, 361487, 238611, 140311, 197658, 336930, 132140, 189487, 345137, 361522, 312372, 238646, 238650, 320571, 336962, 238663, 361547, 205911, 296023, 156763, 361570, 230500, 214116, 214119, 279659, 238706, 312435, 230514, 279666, 279686, 222344, 140426, 337037, 296091, 238764, 279729, 148674, 312519, 148687, 189651, 279766, 189656, 279775, 304352, 304353, 279780, 279789, 279803, 320769, 312588, 320795, 320802, 304422, 353581, 116014, 312628, 345397, 345398, 222523, 181568, 279872, 279874, 304457, 230730, 345418, 337228, 296269, 222542, 337226, 238928, 296274, 230757, 312688, 296304, 230772, 337280, 296328, 296330, 304523, 9618, 279955, 148899, 148900, 279979, 279980, 173492, 279988, 280003, 280011, 337359, 329168, 312785, 222674, 329170, 353751, 280025, 239069, 329181, 320997, 280042, 280043, 329198, 337391, 296434, 288248, 288252, 312830, 230922, 304655, 329231, 230933, 222754, 312879, 230960, 288305, 239159, 157246, 288319, 288322, 280131, 124486, 288328, 239192, 345697, 99937, 312937, 312941, 206447, 288377, 337533, 280193, 239238, 288391, 239251, 280217, 345753, 198304, 255651, 280252, 296636, 280253, 321217, 280259, 321220, 239305, 296649, 280266, 313042, 345813, 280279, 18139, 321250, 337638, 181992, 345832, 288492, 141037, 34547, 67316, 313082, 288508, 288515, 116491, 280333, 124691, 116502, 321308, 321309, 255781, 280367, 280373, 280377, 321338, 280381, 345918, 280386, 280391, 280396, 345942, 362326, 370526, 345950, 362336, 296807, 296815, 313200, 362351, 313204, 124795, 280451, 67464, 305032, 124816, 214936, 337816, 124826, 239515, 329627, 214943, 354210, 313257, 288698, 214978, 280517, 280518, 214983, 362442, 346066, 231382, 354268, 190437, 313322, 174058, 247786, 337899, 296942, 354283, 124912, 313338, 239610, 182277, 354312, 313356, 305173, 223269, 354342, 346153, 354346, 313388, 124974, 321589, 215095, 288829, 288835, 313415, 239689, 354386, 223317, 354394, 321632, 280676, 313446, 215144, 288878, 288890, 215165, 329884, 215204, 125108, 280761, 223418, 280767, 338118, 280779, 346319, 321744, 280792, 280803, 338151, 182503, 125166, 125170, 395511, 313595, 125180, 125184, 125192, 125197, 125200, 338196, 125204, 272661, 125215, 125216, 125225, 338217, 321839, 125236, 362809, 280903, 289109, 379224, 272730, 215395, 239973, 313703, 280938, 321901, 354671, 354672, 199030, 223611, 248188, 313726, 240003, 158087, 240020, 190870, 190872, 289185, 305572, 436644, 289195, 338359, 289229, 281038, 281039, 256476, 281071, 322057, 182802, 322077, 289328, 330291, 338491, 322119, 281165, 281170, 436831, 281200, 313970, 297600, 346771, 363155, 289435, 314020, 248494, 166581, 314043, 355006, 363212, 158424, 322269, 338658, 289511, 330473, 330476, 289517, 215790, 199415, 322302, 289534, 35584, 322312, 346889, 264971, 322320, 166677, 207639, 281378, 289580, 355129, 281407, 355136, 355138, 355147, 355148, 355153, 281426, 281434, 322396, 281444, 355173, 355174, 314240, 158594, 330627, 240517, 355216, 256920, 289691, 240543, 289699, 256934, 289704, 289720, 289723, 330688, 281541, 19398, 191445, 183254, 183258, 207839, 314343, 183276, 289773, 248815, 347122, 330759, 330766, 347150, 330789, 281647, 322609, 314437, 257093, 207954, 339031, 314458, 281699, 257126, 322664, 363643, 314493, 150656, 248960, 347286, 339101, 339106, 306339, 3243, 208044, 322733, 339131, 290001, 339167, 298209, 290030, 208123, 322826, 126229, 257323, 298290, 208179, 159033, 216387, 372039, 109899, 224591, 331091, 314708, 150868, 314711, 314721, 281958, 314727, 134504, 306541, 314734, 314740, 314742, 314745, 290170, 224637, 306558, 290176, 306561, 314752, 314759, 388488, 298378, 314765, 314771, 306580, 224662, 314776, 282008, 282013, 290206, 314788, 314790, 298406, 282023, 241067, 314797, 134586, 380350, 306630, 200136, 306634, 339403, 3559, 191980, 282097, 191991, 290304, 323079, 323083, 208397, 323088, 282132, 282135, 175640, 282147, 372261, 306730, 290359, 134715, 323132, 282182, 224848, 224852, 290391, 306777, 323171, 282214, 224874, 314997, 290425, 339579, 282244, 323208, 282248, 224907, 323226, 282272, 282279, 298664, 298666, 224951, 224952, 306875, 323262, 282302, 323265, 282309, 241360, 282321, 241366, 224985, 282330, 282336, 12009, 282347, 282349, 323315, 200444, 282366, 175874, 249606, 282375, 323335, 282379, 216844, 118549, 282390, 282399, 241440, 282401, 339746, 315172, 216868, 241447, 282418, 282424, 282428, 413500, 241471, 339782, 315209, 159563, 307024, 307030, 241494, 339799, 307038, 282471, 282476, 339840, 315265, 282503, 315272, 315275, 184207, 282517, 298912, 118693, 126896, 282572, 282573, 323554, 298987, 282634, 241695, 315431, 315433, 102441, 102446, 282671, 241717, 249912, 307269, 315468, 233548, 176209, 315477, 53334, 200795, 323678, 356446, 315489, 45154, 217194, 233578, 307306, 381071, 241809, 323730, 299166, 233635, 299176, 184489, 323761, 184498, 258233, 299197, 299202, 176325, 299208, 233678, 282832, 356575, 307431, 356603, 184574, 217352, 61720, 315674, 282908, 299294, 282912, 233761, 282920, 315698, 307514, 282938, 127292, 168251, 332100, 323914, 201037, 282959, 348499, 250196, 348501, 168280, 332128, 381286, 242027, 242028, 160111, 250227, 315768, 315769, 291194, 291193, 291200, 340356, 242059, 315798, 291225, 242079, 283039, 299449, 291266, 283088, 283089, 176602, 242138, 291297, 242150, 324098, 233987, 340489, 283154, 291359, 348709, 348710, 283185, 234037, 340539, 234044, 332379, 111197, 242274, 176751, 356990, 291455, 152196, 316044, 184974, 316048, 316050, 340645, 176810, 291529, 225996, 135888, 242385, 299737, 234216, 234233, 242428, 291584, 299777, 291591, 291605, 283418, 234276, 283431, 242481, 234290, 201534, 348999, 283466, 201562, 234330, 275294, 127840, 349025, 357219, 177002, 308075, 242540, 242542, 201590, 177018, 308093, 291713, 340865, 299912, 349066, 316299, 234382, 308111, 308113, 209820, 283551, 177074, 127945, 340960, 234469, 340967, 324587, 234476, 201721, 234499, 357380, 234513, 316441, 300087, 21567, 308288, 160834, 349254, 250955, 300109, 234578, 250965, 250982, 234606, 300145, 300147, 234626, 349317, 234635, 177297, 308375, 324761, 119965, 234655, 300192, 234662, 300200, 373937, 324790, 300215, 283841, 283846, 283849, 259275, 316628, 259285, 357594, 251124, 316661, 283894, 234741, 292092, 234756, 242955, 177420, 292145, 300342, 333115, 193858, 300354, 300355, 234830, 259408, 283990, 357720, 300378, 300379, 316764, 292194, 284015, 234864, 316786, 243073, 292242, 112019, 234902, 374189, 284086, 259513, 284090, 54719, 415170, 292291, 300488, 300490, 234957, 144862, 300526, 259569, 308722, 251379, 300539, 210429, 366081, 292359, 218632, 316951, 374297, 349727, 374327, 210489, 235069, 349764, 194118, 292424, 292426, 333389, 128589, 333394, 349780, 235096, 128600, 300643, 300645, 415334, 243306, 54895, 325246, 333438, 235136, 317102, 259780, 333508, 333522, 325345, 153318, 333543, 284410, 284425, 300812, 284430, 161553, 284436, 169751, 325403, 341791, 325411, 186148, 186149, 333609, 284460, 300849, 325444, 153416, 325449, 317268, 325460, 341846, 284508, 300893, 259937, 284515, 276326, 292713, 292719, 325491, 333687, 350072, 317305, 317308, 325508, 333700, 243592, 325514, 350091, 350092, 350102, 333727, 219046, 333734, 284584, 292783, 300983, 153553, 292835, 292838, 317416, 325620, 333827, 243720, 292901, 178215, 325675, 243763, 325695, 227432, 194667, 284789, 292987, 227459, 235661, 333968, 153752, 284827, 333990, 284840, 284843, 227517, 309443, 227525, 301255, 227536, 301270, 301271, 325857, 317676, 309504, 194832, 227601, 334104, 211239, 334121, 317738, 325930, 227655, 383309, 391521, 366948, 416103, 285031, 211327, 227721, 227730, 285074, 317851, 285083, 293275, 39323, 227743, 285089, 293281, 375211, 334259, 342454, 293309, 317889, 129484, 326093, 285152, 195044, 334315, 293368, 317949, 334345, 309770, 342537, 342560, 227881, 293420, 23093, 244279, 244280, 301635, 309831, 55880, 301647, 326229, 244311, 309847, 375396, 244326, 301688, 244345, 334473, 326288, 227991, 285348, 318127, 285360, 342705, 293552, 285362, 154295, 342714, 342757, 285419, 170735, 342775, 359166, 375552, 228099, 285443, 285450, 326413, 285457, 285467, 318247, 293673, 318251, 301872, 285493, 285496, 301883, 342846, 293702, 318279, 244569, 252766, 301919, 293729, 351078, 342888, 310132, 228214, 269179, 211835, 228232, 416649, 252812, 293780, 310166, 400282, 277404, 310177, 359332, 359333, 293801, 326571, 252848, 326580, 326586, 359365, 211913, 56270, 252878, 359380, 343020, 203758, 277493, 293894, 384015, 293911, 326684, 384031, 318515, 203829, 277600, 285795, 253028, 228457, 318571, 187508, 302202, 285819, 285823, 285833, 285834, 318602, 228492, 162962, 187539, 359574, 285850, 351389, 302239, 253098, 302251, 367798, 294075, 64699, 228541, 343230, 310496, 228587, 302319, 351475, 228608, 318732, 318746, 245018, 130342, 130344, 130347, 286012, 294210, 286019, 359747, 359748, 294220, 318804, 294236, 327023, 327030, 310650, 179586, 294278, 318860, 318876, 343457, 245160, 286128, 286133, 310714, 302523, 228796, 302530, 228804, 310725, 302539, 310731, 310735, 327122, 310747, 286176, 187877, 310758, 40439, 253431, 286201, 359931, 286208, 245249, 228868, 302602, 294413, 359949, 253456, 302613, 302620, 146976, 425534, 310853, 286281, 196184, 212574, 204386, 204394, 138862, 310896, 294517, 286344, 286351, 188049, 229021, 302751, 245413, 286387, 286392, 302778, 286400, 319176, 212684, 286419, 294621, 294629, 286457, 286463, 319232, 278273, 360194, 278292, 278294, 286507, 294699, 319289, 237397, 188250, 237411, 327556, 188293, 311183, 294806, 294808, 253851, 319393, 294820, 253868, 343993, 188349, 98240, 24531, 212953, 360416, 294887, 253930, 278507, 311277, 327666, 278515 ]
4e5b11dc2beef5e3bfb77fd0e404b147ffd8266a
10962ae8f91dc9e2060551e86693fe2c95fefef7
/pod/ModuleSample/ModuleSample/Generated/GeneratedClass925.swift
e037642e50ea3811a73e83f436a740db0543b81d
[]
no_license
annomusa/Pod-or-Project
80a997df642090a569ca699c5e9b55bbe41f9308
b040200ae081efe3c750a296bf1a9940cb473b07
refs/heads/master
2023-02-11T17:55:25.857420
2021-01-11T06:34:01
2021-01-11T06:34:01
303,269,784
0
0
null
null
null
null
UTF-8
Swift
false
false
137
swift
public class GeneratedClass925 { public var a: String = "" public var b: String = "" public var c: Int = 0 public init() { } }
[ -1 ]
67872646fd34d86c14ec3297ec38f6a3b9c4b39a
c3f45c0bb0f3ce2c986d878814940efe57cde40f
/Yala/Screens/FeedsViewController.swift
01cff271881adbfb78a6512adee94916cf64b96e
[]
no_license
bluesky375/Yala
8c89e302bdd86bc65345a15dba615ed1124677b8
1aca88e0c00ba1d3c71f2c4b3ec8f9f11ef765ff
refs/heads/master
2020-07-07T23:54:25.223643
2019-08-21T05:16:15
2019-08-21T05:16:15
203,511,176
1
0
null
null
null
null
UTF-8
Swift
false
false
3,352
swift
// // FeedsViewController.swift // Yala // // Created by Admin on 3/29/19. // Copyright © 2019 Yala. All rights reserved. // import UIKit import FacebookLogin import FacebookCore import SVProgressHUD import BEMCheckBox import Kingfisher import EMSpinnerButton import MessageUI import CoreLocation import Messages class FeedsViewController: UIViewController, VisibleTabBarProtocol { var user: User! var friends : [Friend] = [] var feedbacks : [FeedItem] = [] var cellType: FriendCellType = .invite @IBOutlet weak var tableView: UITableView! override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. user = User.loadCurrentUser() // getFriendList() getFeedbacks() } class func fromStoryboard() -> FeedsViewController { let viewController = UIStoryboard (name: "Main", bundle: nil).instantiateViewController(withIdentifier: String(describing: FeedsViewController.self)) as! FeedsViewController return viewController } func getFeedbacks(){ SpinnerWrapper.showSpinner() UserService.shared.getFeedbacks(user) { [weak self] (success, error, feedbacks) in SpinnerWrapper.hideSpinnerView() if feedbacks != nil, (feedbacks?.count)! > 0 { self?.feedbacks = feedbacks! self?.tableView.reloadData() } else { print("There is no feedbacks!") } } } @objc func addLike(button : UIButton){ // print("button clicked! \(button.tag)") let eventId = feedbacks[button.tag].id UserService.shared.addLikeToEvent(eventId!) { [weak self] (success, error, feedbacks) in if feedbacks != nil, (feedbacks?.count)! > 0 { self?.feedbacks = feedbacks! self?.tableView.reloadData() } else { print("There is no feedbacks!") } } } @objc func addComment(button : UIButton){ let selectEvent = feedbacks[button.tag] let vc = storyboard?.instantiateViewController(withIdentifier: "CommetLeaveViewController") as! CommetLeaveViewController vc.feedback = selectEvent present(vc,animated: true, completion: nil) } } extension FeedsViewController: UITableViewDataSource { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return feedbacks.count } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "FeedItemTableViewCell") as! FeedItemTableViewCell let feeditem = feedbacks[indexPath.item] cell.configure(feeditem) cell.btnLikeToEvent?.addTarget(self, action: #selector(self.addLike), for: .touchUpInside) cell.btnLikeToEvent.tag = indexPath.item cell.btnAddComment?.addTarget(self, action: #selector(self.addComment), for: .touchUpInside) cell.btnAddComment.tag = indexPath.item return cell } } extension FeedsViewController: UITableViewDelegate { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { } }
[ -1 ]
5b18ffd5a17c0cae1be995042754e2799d0e444d
3b2ff3a8ffca0fbb024f897ac4713fdfbe780e9f
/ViewBuilderDemo/ViewBuilderDemo/Helpers/Converter.swift
86eaa962dc0e0100b6b6615f9908815b3622c73c
[ "MIT" ]
permissive
abelsanchezali/ViewBuilder
1a08a7792b04127655cd8727eb0d9f0e362299e6
55ca397ffdad66f54b28ea7cb57cf6e40d8687c3
refs/heads/master
2021-10-07T11:13:06.006055
2021-09-30T16:02:53
2021-09-30T16:02:53
100,129,963
15
0
null
null
null
null
UTF-8
Swift
false
false
512
swift
// // Converter.swift // ViewBuilderDemo // // Created by Abel Sanchez on 11/4/16. // Copyright © 2016 Abel Sanchez. All rights reserved. // import UIKit public class Converter { static let colors : [UIColor] = [UIColor.red, UIColor.blue, UIColor.brown, UIColor.green, UIColor.black, UIColor.orange, UIColor.orange, UIColor.darkGray, UIColor.cyan, UIColor.magenta, UIColor.purple] public class func intToColor(_ source: Int) -> UIColor { return colors[abs(source % colors.count)] } }
[ -1 ]
6908e4f4d65d0e30e2a7e3aca448f6b7c69be410
98585b13dc10378d14ec28bc62da9becfc273463
/RxSwiftDemo/Service/GankAPI.swift
f39e8d9054ea328b1c565f296e8bb7fd2c261821
[]
no_license
youhui/RxSwiftDemo
edb6b4aac049d6db7ff960f2dfe3f83fc89ce528
b59b1ed816e1828b1789b2101262476a579f110d
refs/heads/master
2020-04-17T04:46:24.876010
2019-02-16T10:36:52
2019-02-16T10:36:52
166,245,450
0
0
null
null
null
null
UTF-8
Swift
false
false
712
swift
import UIKit import Moya let GankProvider = MoyaProvider<GankAPI>() enum GankAPI { case gankList(category: String, size: Int, index: Int) } extension GankAPI: TargetType { var baseURL: URL { return URL(string: "http://gank.io/api/data/")! } var path: String { switch self { case .gankList(let category, let size, let index): return "\(category)/\(size)/\(index)" } } var method: Moya.Method { return .get } var sampleData: Data { return "".data(using: .utf8)! } var task: Task { return .requestPlain } var headers: [String : String]? { return nil } }
[ -1 ]
36c573c6d5472f771fb63555b27ed96a39dbbcda
6749b15fbe3af16eb95eeeed46f2404ca934e491
/OTP View/ViewController.swift
65f57ca0a817fd31503a732606f9998a50ce9816
[]
no_license
Rishu0021/OTP-View
fb522391ae44089dd6f298e4dcb7c591cefb784d
20c209619a3138e7d7ecd97e78c7a8fc1f10e6e7
refs/heads/master
2023-01-24T18:06:18.699526
2020-12-01T17:23:25
2020-12-01T17:23:25
285,996,585
0
0
null
null
null
null
UTF-8
Swift
false
false
1,010
swift
// // ViewController.swift // OTP View // // Created by Rishu Gupta on 08/08/20. // Copyright © 2020 Rishu Gupta. All rights reserved. // import UIKit class ViewController: UIViewController { @IBOutlet weak var viewOTP: RGOTPView! @IBOutlet weak var buttonSubmit: UIButton! override func viewDidLoad() { super.viewDidLoad() self.view.backgroundColor = Theme.Colors.BackgroundPrimary } @IBAction func buttonHandlerSubmit(_ sender: Any) { /// Use below line to display warning or error with color to otp fields // self.viewOTP.setAllFieldColor(isWarningColor: true, color: Theme.Colors.Error) /// Used to get otp text from fields let otp = self.viewOTP.getOTP() if otp.count < 4 { self.viewOTP.setAllFieldColor(isWarningColor: true, color: Theme.Colors.Error) print("Please enter valid 4 digit OTP.") return } print("Entered OTP:", otp) } }
[ -1 ]
85dedd82fc506774b0fb7ea7e27b06cb10ca4274
b4cdda0de2ff9392c318fc0491c1020432cdd899
/Tests/TuistGeneratorTests/Linter/TargetLinterTests.swift
a4a74d85f08dfb37072c033b129839b54d96d322
[ "MIT" ]
permissive
MatyasKriz/tuist
4266e221b0abd55add5dcd8143f520734754d520
edcbf0f8d2cf40c925ed6b592d08143f3b61b84d
refs/heads/master
2022-11-23T10:31:51.319171
2020-07-11T08:59:45
2020-07-11T08:59:45
278,866,574
0
0
MIT
2020-07-11T13:25:50
2020-07-11T13:25:50
null
UTF-8
Swift
false
false
11,041
swift
import Foundation import TSCBasic import TuistCore import TuistCoreTesting import TuistSupport import XCTest @testable import TuistGenerator @testable import TuistSupportTesting final class TargetLinterTests: TuistUnitTestCase { var subject: TargetLinter! override func setUp() { super.setUp() subject = TargetLinter() } override func tearDown() { subject = nil super.tearDown() } func test_lint_when_target_has_invalid_product_name() { let XCTAssertInvalidProductName: (String) -> Void = { productName in let target = Target.test(productName: productName) let got = self.subject.lint(target: target) let reason = "Invalid product name '\(productName)'. This string must contain only alphanumeric (A-Z,a-z,0-9) and underscore (_) characters." self.XCTContainsLintingIssue(got, LintingIssue(reason: reason, severity: .error)) } let XCTAssertValidProductName: (String) -> Void = { bundleId in let target = Target.test(bundleId: bundleId) let got = self.subject.lint(target: target) XCTAssertNil(got.first(where: { $0.description.contains("Invalid product name") })) } XCTAssertInvalidProductName("MyFramework-iOS") XCTAssertInvalidProductName("My.Framework") XCTAssertInvalidProductName("ⅫFramework") XCTAssertInvalidProductName("ؼFramework") XCTAssertValidProductName("MyFramework_iOS") XCTAssertValidProductName("MyFramework") } func test_lint_when_target_has_invalid_bundle_identifier() { let XCTAssertInvalidBundleId: (String) -> Void = { bundleId in let target = Target.test(bundleId: bundleId) let got = self.subject.lint(target: target) let reason = "Invalid bundle identifier '\(bundleId)'. This string must be a uniform type identifier (UTI) that contains only alphanumeric (A-Z,a-z,0-9), hyphen (-), and period (.) characters." self.XCTContainsLintingIssue(got, LintingIssue(reason: reason, severity: .error)) } let XCTAssertValidBundleId: (String) -> Void = { bundleId in let target = Target.test(bundleId: bundleId) let got = self.subject.lint(target: target) XCTAssertNil(got.first(where: { $0.description.contains("Invalid bundle identifier") })) } XCTAssertInvalidBundleId("_.company.app") XCTAssertInvalidBundleId("com.company.◌́") XCTAssertInvalidBundleId("Ⅻ.company.app") XCTAssertInvalidBundleId("ؼ.company.app") XCTAssertValidBundleId("com.company.MyModule${BUNDLE_SUFFIX}") } func test_lint_when_target_no_source_files() { let target = Target.test(sources: []) let got = subject.lint(target: target) XCTContainsLintingIssue(got, LintingIssue(reason: "The target \(target.name) doesn't contain source files.", severity: .warning)) } func test_lint_when_a_infoplist_file_is_being_copied() { let infoPlistPath = AbsolutePath("/Info.plist") let googeServiceInfoPlistPath = AbsolutePath("/GoogleService-Info.plist") let target = Target.test( infoPlist: .file(path: infoPlistPath), resources: [ .file(path: infoPlistPath), .file(path: googeServiceInfoPlistPath), ] ) let got = subject.lint(target: target) XCTContainsLintingIssue(got, LintingIssue(reason: "Info.plist at path \(infoPlistPath.pathString) being copied into the target \(target.name) product.", severity: .warning)) XCTDoesNotContainLintingIssue(got, LintingIssue(reason: "Info.plist at path \(googeServiceInfoPlistPath.pathString) being copied into the target \(target.name) product.", severity: .warning)) } func test_lint_when_a_entitlements_file_is_being_copied() { let path = AbsolutePath("/App.entitlements") let target = Target.test(resources: [.file(path: path)]) let got = subject.lint(target: target) XCTContainsLintingIssue(got, LintingIssue(reason: "Entitlements file at path \(path.pathString) being copied into the target \(target.name) product.", severity: .warning)) } func test_lint_when_entitlements_not_missing() throws { let temporaryPath = try self.temporaryPath() let path = temporaryPath.appending(component: "Info.plist") let target = Target.test(infoPlist: .file(path: path)) let got = subject.lint(target: target) XCTContainsLintingIssue(got, LintingIssue(reason: "Info.plist file not found at path \(path.pathString)", severity: .error)) } func test_lint_when_infoplist_not_found() throws { let temporaryPath = try self.temporaryPath() let path = temporaryPath.appending(component: "App.entitlements") let target = Target.test(entitlements: path) let got = subject.lint(target: target) XCTContainsLintingIssue(got, LintingIssue(reason: "Entitlements file not found at path \(path.pathString)", severity: .error)) } func test_lint_when_library_has_resources() throws { let temporaryPath = try self.temporaryPath() let path = temporaryPath.appending(component: "Image.png") let element = FileElement.file(path: path) let staticLibrary = Target.test(product: .staticLibrary, resources: [element]) let dynamicLibrary = Target.test(product: .dynamicLibrary, resources: [element]) let staticResult = subject.lint(target: staticLibrary) XCTContainsLintingIssue(staticResult, LintingIssue(reason: "Target \(staticLibrary.name) cannot contain resources. Libraries don't support resources", severity: .error)) let dynamicResult = subject.lint(target: dynamicLibrary) XCTContainsLintingIssue(dynamicResult, LintingIssue(reason: "Target \(dynamicLibrary.name) cannot contain resources. Libraries don't support resources", severity: .error)) } func test_lint_when_ios_bundle_has_sources() { // Given let bundle = Target.empty(platform: .iOS, product: .bundle, sources: [ (path: "/path/to/some/source.swift", compilerFlags: nil), ], resources: []) // When let result = subject.lint(target: bundle) // Then XCTContainsLintingIssue(result, LintingIssue(reason: "Target \(bundle.name) cannot contain sources. iOS bundle targets don't support source files", severity: .error)) } func test_lint_valid_ios_bundle() { // Given let bundle = Target.empty(platform: .iOS, product: .bundle, resources: [ .file(path: "/path/to/some/asset.png"), ]) // When let result = subject.lint(target: bundle) // Then XCTAssertTrue(result.isEmpty) } func test_lint_when_deployment_target_version_is_valid() { let validVersions = ["10.0", "9.0.1"] for version in validVersions { // Given let target = Target.test(platform: .macOS, deploymentTarget: .macOS(version)) // When let got = subject.lint(target: target) // Then XCTDoesNotContainLintingIssue(got, LintingIssue(reason: "The version of deployment target is incorrect", severity: .error)) } } func test_lint_when_deployment_target_version_is_invalid() { let validVersions = ["tuist", "tuist9.0.1", "1.0tuist", "10_0", "1_1_3"] for version in validVersions { // Given let target = Target.test(platform: .macOS, deploymentTarget: .macOS(version)) // When let got = subject.lint(target: target) // Then XCTContainsLintingIssue(got, LintingIssue(reason: "The version of deployment target is incorrect", severity: .error)) } } func test_lint_invalidProductPlatformCombinations() throws { // Given let invalidTargets: [Target] = [ .empty(name: "WatchApp_for_iOS", platform: .iOS, product: .watch2App), .empty(name: "Watch2Extension_for_iOS", platform: .iOS, product: .watch2Extension), ] // When let got = invalidTargets.flatMap { subject.lint(target: $0) } // Then let expectedIssues: [LintingIssue] = [ LintingIssue(reason: "'WatchApp_for_iOS' for platform 'iOS' can't have a product type 'watch 2 application'", severity: .error), LintingIssue(reason: "'Watch2Extension_for_iOS' for platform 'iOS' can't have a product type 'watch 2 extension'", severity: .error), ] XCTAssertTrue(expectedIssues.allSatisfy { got.contains($0) }) } func test_lint_when_target_has_duplicate_dependencies_specified() { let testDependency: Dependency = .sdk(name: "libc++.tbd", status: .optional) // Given let target = Target.test(dependencies: .init(repeating: testDependency, count: 2)) // When let got = subject.lint(target: target) // Then XCTContainsLintingIssue(got, .init( reason: "Target has duplicate '\(testDependency)' dependency specified", severity: .warning )) } func test_lint_when_target_has_non_existing_core_data_models() throws { // Given let path = try temporaryPath() let dataModelPath = path.appending(component: "Model.xcdatamodeld") let target = Target.test(coreDataModels: [ CoreDataModel(path: dataModelPath, versions: [], currentVersion: "1.0.0"), ]) // When let got = subject.lint(target: target) // Then XCTContainsLintingIssue(got, .init( reason: "The Core Data model at path \(dataModelPath.pathString) does not exist", severity: .error )) } func test_lint_when_target_has_core_data_models_with_default_versions_that_dont_exist() throws { // Given let path = try temporaryPath() let dataModelPath = path.appending(component: "Model.xcdatamodeld") try FileHandler.shared.createFolder(dataModelPath) let target = Target.test(coreDataModels: [ CoreDataModel(path: dataModelPath, versions: [], currentVersion: "1.0.0"), ]) // When let got = subject.lint(target: target) // Then XCTContainsLintingIssue(got, .init( reason: "The default version of the Core Data model at path \(dataModelPath.pathString), 1.0.0, does not exist. There should be a file at \(dataModelPath.appending(component: "1.0.0.xcdatamodel").pathString)", severity: .error )) } }
[ -1 ]
57b4e8279673e000b6c795067c88044bfde5a05b
6d6d056d7c9bfa416fb484fce546c67df8fcc70b
/native_library/apple/MLANE/MLANE/Extensions/FreMLModelDescription.swift
3d2c94c70d76c86cb4f03f5e14bfa20618ca4209
[ "Apache-2.0" ]
permissive
tuarua/ML-ANE
1d1c11f85f2726622c0633d3d947ad69a75bd0d5
887a88786347546f738e1de5bcba3b60afc2672e
refs/heads/master
2021-05-01T11:30:59.887026
2020-04-11T15:07:45
2020-04-11T15:07:45
121,122,200
5
1
Apache-2.0
2020-04-11T15:07:46
2018-02-11T12:41:33
ActionScript
UTF-8
Swift
false
false
1,728
swift
/* Copyright 2018 Tua Rua Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ import Foundation import CoreML import FreSwift public extension MLModelDescription { func toFREObject(id: String) -> FREObject? { guard let fre = FreObjectSwift(className: "com.tuarua.mlane.ModelDescription", args: id) else { return nil } fre.predictedFeatureName = self.predictedFeatureName fre.predictedProbabilitiesName = self.predictedProbabilitiesName fre.metadata = self.metadata.toFREObject() var freInputDict = FREObject(className: "flash.utils.Dictionary") for input in self.inputDescriptionsByName { freInputDict?[input.key] = input.value.toFREObject() } fre.inputDescriptionsByName = freInputDict var freOutputDict = FREObject(className: "flash.utils.Dictionary") for output in self.outputDescriptionsByName { freOutputDict?[output.key] = output.value.toFREObject() } fre.outputDescriptionsByName = freOutputDict if #available(iOS 13.0, OSX 10.15, tvOS 13.0, *) { fre.isUpdatable = self.isUpdatable } return fre.rawValue } }
[ -1 ]
3bfa5896e4761753ca3c36d4466a259075480270
736a3013b3a67a77e34adbe890819d7801004373
/Source/PublicAPI/Encryption/EThree+AuthEncrypt.swift
a1d2a58ee1e15a5c35031b4ca74d7db020e12243
[ "BSD-3-Clause" ]
permissive
VirgilSecurity/virgil-e3kit-x
d2a43da5419e46b0b4bcffa49393625548a5bcc7
bae4fda63a19c60652ebaa894d8cc772bb752b57
refs/heads/master
2022-08-22T22:58:31.266064
2022-07-28T13:43:17
2022-07-28T13:43:17
153,477,913
13
8
NOASSERTION
2023-08-14T04:50:48
2018-10-17T15:12:13
Swift
UTF-8
Swift
false
false
8,988
swift
// // Copyright (C) 2015-2021 Virgil Security Inc. // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // (1) Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // // (2) Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in // the documentation and/or other materials provided with the // distribution. // // (3) Neither the name of the copyright holder nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING // IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Lead Maintainer: Virgil Security Inc. <[email protected]> // import Foundation import VirgilSDK import VirgilCrypto // MARK: - Extension with peer-to-pear encrypt and decrypt operations extension EThree { /// Signs then encrypts data (and signature) for user /// /// - Important: Deprecated decrypt method is unable to decrypt result of this method /// /// - Parameters: /// - data: data to encrypt /// - user: user Card to encrypt for /// - Returns: encrypted data /// - Important: Automatically includes self key to recipientsKeys. /// - Important: Requires private key in local storage @objc(authEncryptData:forUser:error:) open func authEncrypt(data: Data, for user: Card) throws -> Data { return try self.authEncrypt(data: data, for: [user.identity: user]) } /// Signs then encrypts string (and signature) for user /// /// - Important: Deprecated decrypt method is unable to decrypt result of this method /// /// - Parameters: /// - text: String to encrypt /// - user: user Card to encrypt for /// - Returns: encrypted String /// - Important: Automatically includes self key to recipientsKeys. /// - Important: Requires private key in local storage @objc(authEncryptText:forUser:error:) open func authEncrypt(text: String, for user: Card) throws -> String { return try self.authEncrypt(text: text, for: [user.identity: user]) } /// Decrypts data and signature and verifies signature of sender /// /// - Parameters: /// - data: data to decrypt /// - user: sender Card with Public Key to verify with. Use nil to decrypt and verify from self /// - Returns: decrypted Data /// - Important: Requires private key in local storage @objc(authDecryptData:fromUsers:error:) open func authDecrypt(data: Data, from user: Card? = nil) throws -> Data { return try self.decryptInternal(data: data, from: user?.publicKey) } /// Decrypts data and signature and verifies signature of sender /// /// - Parameters: /// - data: data to decrypt /// - user: sender Card with Public Key to verify with /// - date: date of encryption to use proper card version /// - Returns: decrypted Data /// - Important: Requires private key in local storage @objc(authDecryptData:fromUsers:date:error:) open func authDecrypt(data: Data, from user: Card, date: Date) throws -> Data { var card = user while let previousCard = card.previousCard { guard card.createdAt > date else { break } card = previousCard } return try self.decryptInternal(data: data, from: card.publicKey) } /// Decrypts base64 string and signature and verifies signature of sender /// /// - Parameters: /// - text: encrypted String /// - user: sender Card with Public Key to verify with. Use nil to decrypt and verify from self. /// - Returns: decrypted String /// - Important: Requires private key in local storage @objc(authDecryptText:fromUser:error:) open func authDecrypt(text: String, from user: Card? = nil) throws -> String { guard let data = Data(base64Encoded: text) else { throw EThreeError.strToDataFailed } let decryptedData = try self.authDecrypt(data: data, from: user) guard let decryptedString = String(data: decryptedData, encoding: .utf8) else { throw EThreeError.strFromDataFailed } return decryptedString } /// Decrypts base64 string and signature and verifies signature of sender /// /// - Parameters: /// - text: encrypted String /// - user: sender Card with Public Key to verify with /// - date: date of encryption to use proper card version /// - Returns: decrypted String /// - Important: Requires private key in local storage @objc(authDecryptText:fromUser:date:error:) open func authDecrypt(text: String, from user: Card, date: Date) throws -> String { guard let data = Data(base64Encoded: text) else { throw EThreeError.strToDataFailed } let decryptedData = try self.authDecrypt(data: data, from: user, date: date) guard let decryptedString = String(data: decryptedData, encoding: .utf8) else { throw EThreeError.strFromDataFailed } return decryptedString } /// Signs then encrypts string (and signature) for group of users /// /// - Important: Deprecated decrypt method is unable to decrypt result of this method /// /// - Parameters: /// - text: String to encrypt /// - users: result of findUsers call recipient Cards with Public Keys to sign and encrypt with. /// Use nil to sign and encrypt for self /// - Returns: encrypted base64String /// - Important: Automatically includes self key to recipientsKeys. /// - Important: Requires private key in local storage /// - Note: Avoid key duplication @objc(authEncryptText:forUsers:error:) open func authEncrypt(text: String, for users: FindUsersResult? = nil) throws -> String { guard let data = text.data(using: .utf8) else { throw EThreeError.strToDataFailed } return try self.authEncrypt(data: data, for: users).base64EncodedString() } /// Signs then encrypts string (and signature) for group of users /// /// - Important: Deprecated decrypt method is unable to decrypt result of this method /// /// - Parameters: /// - data: data to encrypt /// - users: result of findUsers call recipient Cards with Public Keys to sign and encrypt with. /// Use nil to sign and encrypt for self /// - Returns: decrypted Data /// - Important: Automatically includes self key to recipientsKeys. /// - Important: Requires private key in local storage /// - Note: Avoid key duplication @objc(authEncryptData:forUsers:error:) open func authEncrypt(data: Data, for users: FindUsersResult? = nil) throws -> Data { return try self.encryptInternal(data: data, for: users?.map { $1.publicKey }) } } extension EThree { internal func encryptInternal(data: Data, for publicKeys: [VirgilPublicKey]?) throws -> Data { let selfKeyPair = try self.localKeyStorage.retrieveKeyPair() var pubKeys = [selfKeyPair.publicKey] if let publicKeys = publicKeys { guard !publicKeys.isEmpty else { throw EThreeError.missingPublicKey } pubKeys += publicKeys } let encryptedData = try self.crypto.authEncrypt(data, with: selfKeyPair.privateKey, for: pubKeys) return encryptedData } internal func decryptInternal(data: Data, from publicKey: VirgilPublicKey?) throws -> Data { let selfKeyPair = try self.localKeyStorage.retrieveKeyPair() let publicKey = publicKey ?? selfKeyPair.publicKey do { return try self.crypto.authDecrypt(data, with: selfKeyPair.privateKey, usingOneOf: [publicKey]) } catch VirgilCryptoError.signatureNotVerified { throw EThreeError.verificationFailed } } }
[ -1 ]
289008e241653df49dd33b1e27151000c0ee3cc8
a2bceb3d46ae0c895722f472d1ba6f95461759da
/FoundationExtendedTests/(T) Types/WeakObjectSetTests.swift
f371c6f8cf7da4c633fac34c8cdeecaaa7901e4e
[]
no_license
Jride/FoundationExtended
0910bc708d6cfffa7b7c6db4204a7e5582f9df66
f83ebee39f98e08e0eab692e162a31cabed43eee
refs/heads/master
2023-02-27T13:19:43.811595
2021-02-07T15:05:52
2021-02-07T15:05:52
272,386,405
0
0
null
null
null
null
UTF-8
Swift
false
false
1,629
swift
// // WeakObjectSetTests.swift // FoundationExtendedTests // // Created by Steve Barnegren on 31/10/2019. // Copyright © 2019 ITV. All rights reserved. // import XCTest import FoundationExtended fileprivate class SetItem { let value: String init(_ value: String) { self.value = value } } class WeakObjectSetTests: XCTestCase { // MARK: - Insert func test_InsertObject() { let item = SetItem("a") var set = WeakObjectSet<SetItem>() set.insert(object: item) XCTAssertEqual(set.count, 1) } func test_InsertMultipleObjects() { let itemA = SetItem("a") let itemB = SetItem("a") var set = WeakObjectSet<SetItem>() set.insert(object: itemA) set.insert(object: itemB) XCTAssertEqual(set.count, 2) } func test_CannotInsertSameObjectMultipleTimes() { let item = SetItem("a") var set = WeakObjectSet<SetItem>() set.insert(object: item) set.insert(object: item) set.insert(object: item) XCTAssertEqual(set.count, 1) } // MARK: - Test object deallocation func test_doesNotRetainObjects() { var strongItem: SetItem? = SetItem("a") weak var weakItem: SetItem? = strongItem var set = WeakObjectSet<SetItem>() set.insert(object: strongItem!) XCTAssertEqual(set.count, 1) XCTAssertNotNil(weakItem) strongItem = nil XCTAssertEqual(set.count, 0) XCTAssertNil(weakItem) } }
[ -1 ]
f056a9719a04ad2929f6026ad7e2ae0b126792f0
c47dc27e8d9a858a1abe6305aeb22383bc18df41
/Memorize/ContentView.swift
da4991299137a90e79d6dc070f9df78cf36d39c1
[]
no_license
kritiagarwal13/Memorize
f4ba91c898320c31d0c90477d739a3157883e35f
76d462d429ebc0557a342353e3f65513991adae1
refs/heads/main
2023-07-04T19:49:23.281956
2021-08-06T07:21:07
2021-08-06T07:21:07
392,931,300
0
0
null
null
null
null
UTF-8
Swift
false
false
2,309
swift
// // ContentView.swift // Memorize // // Created by Kriti Agarwal on 05/08/21. // import SwiftUI struct ContentView: View { var emojis = ["🚗", "✈️", "⛴", "🚲", "🏳️‍🌈", "✂️", "🔊", "🎀", "🌂", "🐅", "⛄️", "🧅", "🥨", "🥘", "🍰", "🥂", "🥡", "🛼", "🚴🏻‍♀️", "🧩", "🕹", "💰", "⚱️", "🦠", "🎁"] @State var emojiCount = 5 var body: some View{ VStack { LazyVGrid(columns: [GridItem(), GridItem(), GridItem()]) { ForEach(emojis[0..<emojiCount], id: \.self) { emoji in CardView(isFaceUp: true, content: emoji) } } Spacer() HStack { remove Spacer() Text("Shuffle") Spacer() add } .font(.largeTitle) .padding(.horizontal) .foregroundColor(.blue) } .foregroundColor(.red) .padding() } var remove: some View { Button { if emojiCount > 1 { emojiCount -= 1 } } label: { Image(systemName: "minus.circle") } } var add: some View { Button{ if emojiCount < emojis.count { emojiCount += 1 } } label: { Image(systemName: "plus.circle") } } } struct CardView: View { @State var isFaceUp: Bool var content: String var body : some View { ZStack{ let shape = RoundedRectangle(cornerRadius: 25.0) if isFaceUp { shape.fill().foregroundColor(.white) shape.stroke(lineWidth: 3.0) Text(content) .font(.largeTitle) } else { shape.fill().foregroundColor(.red) } }.onTapGesture(perform: { isFaceUp = !isFaceUp }) } } func emojiCounterTapped() { print("emoji counter tapped") } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() .preferredColorScheme(.dark) ContentView() .preferredColorScheme(.light) } }
[ -1 ]
e820c747a8f728304753286b911eea3ada15fa20
7eee8106e44eb8d6cae45ab108dde1218e8b4d2a
/InstagramTests/InstagramTests.swift
d2c35ba3e611ab86a257bcef06f79a3b7203bbe6
[]
no_license
ermalbujupi/instagram4fun
e49c3611f948ce731edda8bd07712d406eb9a869
e871f8a00abd9fa83b340e882c8fe5fa2ab519e6
refs/heads/master
2020-04-07T10:17:44.449326
2018-11-19T19:56:34
2018-11-19T19:56:34
158,281,409
0
0
null
null
null
null
UTF-8
Swift
false
false
912
swift
// // InstagramTests.swift // InstagramTests // // Created by Ermal Buju on 19.11.18. // Copyright © 2018 Ermal Bujupaj. All rights reserved. // import XCTest @testable import Instagram class InstagramTests: XCTestCase { override func setUp() { // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. } func testExample() { // This is an example of a functional test case. // Use XCTAssert and related functions to verify your tests produce the correct results. } func testPerformanceExample() { // This is an example of a performance test case. self.measure { // Put the code you want to measure the time of here. } } }
[ 360462, 229413, 204840, 344107, 155694, 229424, 229430, 163896, 180280, 376894, 352326, 196691, 385116, 237663, 254048, 319591, 221290, 204916, 131191, 131198, 278677, 196760, 426138, 278691, 173, 377009, 278708, 295098, 417988, 417994, 139479, 229597, 311519, 205035, 344313, 327929, 147717, 368905, 180493, 254226, 319763, 368916, 262421, 377114, 237856, 237857, 311597, 98610, 180535, 336183, 287041, 319813, 344401, 377169, 368981, 155990, 368984, 106847, 98657, 270701, 270706, 246136, 246137, 139640, 311681, 311685, 106888, 385417, 311691, 385422, 213403, 246178, 385454, 311727, 377264, 319930, 311738, 33211, 336320, 311745, 254406, 188871, 278993, 278999, 328152, 369116, 287198, 279018, 319981, 319987, 279029, 254456, 377338, 279039, 377343, 254465, 279050, 139792, 303636, 393751, 279065, 377376, 377386, 197167, 385588, 115270, 385615, 426576, 369235, 295519, 139872, 66150, 139892, 344696, 287352, 311941, 336518, 311945, 369289, 344715, 311949, 287374, 377489, 311954, 352917, 230040, 271000, 377497, 303771, 377500, 205471, 344738, 139939, 295599, 205487, 303793, 336564, 230072, 287417, 287422, 377539, 164560, 385747, 361176, 418520, 287452, 279269, 246503, 369385, 312052, 172792, 344827, 221948, 205568, 295682, 336648, 197386, 434957, 426774, 197399, 426775, 197411, 295724, 197422, 353070, 164656, 295729, 353078, 197431, 336702, 279362, 353109, 377686, 230234, 189275, 435039, 295776, 303972, 385893, 246641, 246643, 295798, 246648, 361337, 254850, 369538, 58253, 295824, 140204, 377772, 304051, 230332, 377790, 353215, 213957, 345033, 279498, 386006, 418776, 50143, 123881, 271350, 295927, 328700, 328706, 410627, 320516, 295942, 386056, 353290, 377869, 238610, 418837, 140310, 369701, 238639, 312373, 238651, 361535, 377926, 238664, 361566, 304222, 173166, 377972, 337017, 377983, 402565, 386189, 296086, 238743, 296092, 238765, 238769, 402613, 230588, 353479, 353481, 353482, 402634, 189653, 419029, 148696, 296153, 304351, 222440, 328940, 353523, 386294, 386301, 320770, 386306, 312587, 328971, 353551, 320796, 222494, 353584, 345396, 386359, 378172, 279875, 312648, 337225, 304456, 230729, 238927, 353616, 378209, 386412, 296307, 116084, 337281, 148867, 296329, 296335, 9619, 370071, 173491, 304564, 353719, 361927, 296392, 280010, 280013, 239068, 280032, 271843, 329197, 329200, 296433, 288249, 296448, 230921, 329225, 296461, 304656, 329232, 370197, 402985, 394794, 312880, 288309, 312889, 280130, 288327, 239198, 99938, 312940, 222832, 370296, 247416, 288378, 337534, 337535, 263809, 288392, 239250, 419478, 206504, 321199, 337591, 280251, 403148, 9936, 313041, 9937, 370388, 272085, 345814, 18138, 345821, 321247, 321249, 345833, 345834, 280300, 239341, 67315, 173814, 288512, 288516, 280327, 321302, 345879, 321310, 255776, 362283, 378668, 296755, 321337, 345919, 436031, 403267, 345929, 337745, 18262, 362327, 280410, 345951, 362337, 345955, 296806, 280430, 214895, 313199, 362352, 182144, 305026, 329622, 337815, 436131, 436137, 362417, 362431, 280514, 174019, 214984, 362443, 329695, 436191, 313319, 354280, 247785, 296941, 436205, 362480, 329712, 43014, 354316, 313357, 239650, 354343, 354345, 223274, 346162, 288828, 436285, 288833, 288834, 436292, 403525, 313416, 436301, 354385, 338001, 338003, 280661, 329814, 354393, 280675, 280677, 43110, 321637, 436329, 288879, 288889, 215164, 313469, 215166, 280712, 346271, 436383, 362659, 239793, 182456, 280762, 379071, 280768, 149703, 346314, 321745, 387296, 280802, 379106, 346346, 321772, 436470, 149760, 411906, 313608, 272658, 338218, 321840, 379186, 321860, 280902, 289110, 215385, 354655, 354676, 436608, 362881, 248194, 240002, 436611, 395659, 240016, 108944, 190871, 149916, 420253, 141728, 289189, 108972, 272813, 338356, 436661, 289232, 256477, 281072, 174593, 420369, 207393, 289332, 174648, 338489, 338490, 297560, 436832, 436834, 420463, 346737, 313971, 346740, 420471, 330379, 117396, 346772, 264856, 289434, 346779, 166582, 314040, 363211, 363230, 264928, 330474, 289518, 363263, 191235, 322316, 117517, 322319, 166676, 207640, 281377, 289576, 191283, 273207, 289598, 322395, 207727, 330609, 207732, 158593, 224145, 355217, 256922, 289690, 289698, 420773, 289703, 363438, 347055, 289727, 273344, 330689, 363458, 379844, 19399, 248796, 347103, 183279, 347123, 240630, 257024, 330754, 134150, 330763, 322582, 248872, 322612, 314436, 314448, 339030, 257125, 273515, 404593, 363641, 363644, 150657, 248961, 330888, 363669, 339100, 380061, 339102, 199839, 429214, 265379, 249002, 306346, 3246, 421048, 208058, 265412, 290000, 298208, 298212, 298213, 290022, 330984, 298221, 298228, 388349, 437505, 322824, 257305, 339234, 372009, 412971, 306494, 216386, 224586, 331090, 314710, 372054, 159066, 314720, 380271, 208244, 249204, 290173, 306559, 224640, 314751, 314758, 298374, 314760, 142729, 388487, 314766, 306579, 282007, 290207, 314783, 314789, 282022, 314791, 396711, 396712, 314798, 380337, 380338, 150965, 380357, 339398, 306639, 413137, 429542, 282096, 306673, 191990, 372227, 323080, 323087, 175639, 388632, 396827, 282141, 134686, 355876, 347694, 265798, 282183, 265804, 224847, 396882, 44635, 396895, 323172, 323178, 224883, 314998, 323196, 175741, 339584, 282245, 323217, 282271, 282276, 298661, 282280, 298667, 61101, 224946, 110268, 224958, 323263, 274115, 306890, 241361, 298720, 323331, 323332, 339715, 216839, 339720, 372496, 323346, 339745, 257830, 421672, 315202, 216918, 241495, 241528, 315264, 339841, 282504, 315273, 315274, 372626, 380821, 298909, 118685, 200627, 323507, 290745, 274371, 151497, 372701, 298980, 380908, 282612, 315432, 102445, 233517, 176175, 241716, 225351, 315465, 315476, 307289, 315487, 356447, 315497, 315498, 438377, 233589, 266357, 422019, 241808, 323729, 381073, 299174, 405687, 258239, 389313, 299203, 299209, 372941, 282831, 266449, 307435, 438511, 381172, 184575, 381208, 151839, 233762, 217380, 282919, 332083, 332085, 332089, 438596, 332101, 323913, 348492, 323920, 348500, 168281, 332123, 332127, 242023, 160110, 242033, 291192, 340357, 225670, 242058, 373134, 291224, 242078, 315810, 315811, 381347, 340398, 127427, 324039, 373197, 160225, 291311, 291333, 340490, 283153, 258581, 234036, 315960, 348732, 242237, 70209, 348742, 70215, 348749, 381517, 332378, 201308, 111208, 184940, 373358, 389745, 209530, 356989, 373375, 152195, 348806, 316049, 111253, 316053, 111258, 111259, 176808, 299699, 422596, 422599, 291530, 225995, 242386, 422617, 422626, 234217, 299759, 299776, 291585, 430849, 291592, 62220, 422673, 430865, 291604, 422680, 283419, 152365, 422703, 422709, 152374, 160571, 430910, 160575, 160580, 381773, 201551, 242529, 349026, 357218, 201577, 308076, 242541, 177019, 185211, 308092, 398206, 291712, 381829, 316298, 349072, 308112, 390045, 185250, 185254, 373687, 373706, 316364, 324586, 349175, 201720, 127992, 357379, 308243, 357414, 300084, 308287, 218186, 341073, 439384, 300135, 300136, 316520, 357486, 144496, 300150, 291959, 300151, 160891, 300158, 349316, 349318, 373903, 169104, 177296, 185493, 119962, 300187, 300188, 300201, 300202, 373945, 259268, 62665, 283852, 283853, 259280, 316627, 333011, 234742, 128251, 439562, 292107, 414990, 251153, 177428, 349462, 382258, 300343, 382269, 177484, 406861, 259406, 234831, 283991, 374109, 333160, 316787, 357762, 112017, 234898, 259475, 275859, 357786, 251298, 333220, 374191, 292292, 300487, 300489, 366037, 210390, 210391, 210393, 144867, 54765, 251378, 308723, 300535, 300536, 259599, 316946, 308756, 398869, 374296, 374299, 308764, 431649, 169518, 431663, 194110, 349763, 218696, 292425, 128587, 333388, 128599, 333408, 374372, 300644, 415338, 243307, 54893, 325231, 325245, 235135, 194180, 415375, 153251, 300714, 210603, 415420, 333503, 259781, 333517, 333520, 325346, 153319, 325352, 284401, 325371, 243472, 366360, 325404, 399147, 431916, 300848, 259899, 325439, 325445, 153415, 341836, 415567, 325457, 317269, 341847, 350044, 128862, 292712, 423789, 292720, 325492, 276341, 341879, 317304, 333688, 112509, 55167, 325503, 333701, 243591, 317323, 325518, 333722, 350109, 292771, 415655, 284587, 292782, 243637, 301008, 153554, 292836, 292837, 317415, 325619, 432116, 292858, 415741, 333828, 358410, 399373, 317467, 145435, 325674, 309295, 129076, 243767, 358456, 227428, 194666, 260207, 432240, 333940, 292988, 194691, 415881, 104587, 235662, 284826, 333991, 194782, 301279, 317664, 243962, 375039, 194820, 325905, 325912, 309529, 211235, 432421, 211238, 358703, 358709, 325968, 366930, 6489, 383332, 383336, 317820, 211326, 317831, 252308, 293274, 39324, 121245, 342450, 293303, 293310, 416197, 129483, 342476, 317901, 334290, 358882, 342498, 334309, 391655, 432618, 375276, 301571, 342536, 416286, 375333, 244269, 375343, 23092, 375351, 244281, 301638, 309830, 293448, 55881, 416341, 309846, 416351, 268899, 39530, 244347, 326287, 375440, 334481, 318106, 318107, 342682, 318130, 383667, 293556, 39614, 334547, 375526, 342762, 342763, 293612, 129773, 154359, 228088, 432893, 162561, 383754, 310036, 285466, 326429, 293664, 326433, 400166, 293672, 318250, 318252, 375609, 293693, 252741, 293711, 244568, 244570, 342887, 228215, 400252, 359298, 359299, 260996, 113542, 392074, 56208, 318364, 310176, 310178, 293800, 236461, 326581, 326587, 326601, 359381, 433115, 343005, 326635, 187374, 383983, 318461, 293886, 293893, 433165, 384016, 433174, 252958, 359478, 203830, 359495, 277597, 113760, 392290, 253029, 285798, 15471, 351344, 285814, 285820, 392318, 384131, 302216, 326804, 187544, 351390, 253099, 253100, 318639, 367799, 113850, 294074, 302274, 367810, 244940, 195808, 310497, 302325, 228600, 261377, 228609, 253216, 130338, 261425, 351537, 286013, 146762, 294218, 294219, 318805, 425304, 163175, 327024, 327025, 318848, 179587, 253317, 384393, 368011, 318864, 318868, 318875, 310692, 245161, 286129, 286132, 228795, 425405, 302531, 425418, 286172, 187878, 359930, 286202, 302590, 253451, 359950, 146964, 253463, 286244, 245287, 245292, 425535, 196164, 286288, 179801, 196187, 343647, 310889, 204397, 138863, 188016, 294529, 229001, 188048, 425626, 302754, 229029, 40614, 384695, 327358, 286399, 212685, 384720, 302802, 278233, 278240, 212716, 212717, 360177, 229113, 278272, 319233, 360195, 286494, 294700, 409394, 319292, 360252, 360264, 376669, 245599, 425825, 425833, 417654, 188292, 253829, 294807, 376732, 311199, 319392, 294823, 327596, 294843, 188348, 237504, 294850, 384964, 344013, 212942, 24532, 294886, 311281, 311282 ]
65f927c7a7598e8552d8726b52c6116a94e48142
603212bff9d125cfe7853742b09b647e91f8d074
/Candy/Candy/Classes/Modules/UserCenter/Controller/UserCenterController.swift
1660bdc086c07280637a09d627893a2f906d3315
[ "MIT" ]
permissive
zuoguihao/candy-ios
a44403937304e9b68852cf83799a3fa0aa088bb3
d3aab9cbc3331a2db8d4365f67647bd074ec4ea4
refs/heads/master
2022-07-20T08:23:38.062149
2020-01-13T03:01:45
2020-01-13T03:01:45
231,123,251
0
1
null
null
null
null
UTF-8
Swift
false
false
2,638
swift
// // UserCenterController.swift // RxSwiftDemo // // Created by 左聂荣 on 2020/1/1. // Copyright © 2020 左聂荣. All rights reserved. // import UIKit class UserCenterController: ViewController { // MARK: - Property // MARK: - LifeCycle override var supportedInterfaceOrientations: UIInterfaceOrientationMask { return .all } override func viewDidLoad() { super.viewDidLoad() makeUI() setupData() } override func updateViewConstraints() { super.updateViewConstraints() tableView.snp.makeConstraints { make in make.edges.equalToSuperview() } } // MARK: - Action override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) { let testVC = TestController() navigationController?.pushViewController(testVC, animated: true) } // MARK: - Lazy /// 懒加载:tableView private lazy var tableView: UITableView = { let tv = UITableView(frame: .zero, style: .plain) tv.register(cellWithClass: UITableViewCell.self) tv.rowHeight = CGFloat.tableRow tv.tableFooterView = UIView(frame: CGRect(origin: .zero, size: CGSize(width: view.bounds.width, height: CGFloat.leastNormalMagnitude))) return tv }() /// 懒加载:dataSource private lazy var dataSource: [(String, ViewController.Type)] = { [ (R.string.localizable.userCenterDataSourceHomepage(), HomepageController.self), (R.string.localizable.userCenterDataSourceLogin(), LoginController.self), (R.string.localizable.userCenterDataSourceListEdit(), ListEditController.self), (R.string.localizable.userCenterDataSourceQuery(), QueryController.self) ] }() } // MARK: - Private Method private extension UserCenterController { func makeUI() { navItemTitle = R.string.localizable.userCenterNavTitle() view.addSubview(tableView) } func setupData() { Driver.of(dataSource) .drive(tableView.rx.items(cellIdentifier: UITableViewCell.className)) { _, item, cell in cell.textLabel?.text = item.0 } .disposed(by: rx.disposeBag) tableView.rx.itemSelected .subscribe(onNext: { [unowned self] indexPath in self.tableView.deselectRow(at: indexPath, animated: true) }) .disposed(by: rx.disposeBag) tableView.rx.modelSelected((String, ViewController.Type).self) .map { $0.1 } .bind(to: rx.push) .disposed(by: rx.disposeBag) } }
[ -1 ]
bbfa7e40dbae2339f7b49500883bc8b2ea179ff5
575a883f70159e953958ea6d46a225f153d5247b
/Sources/AsyncNinja/ExecutionContext.swift
0248c4ce9f78d318166e68b3a88a62d8eaf2e7b7
[ "MIT" ]
permissive
AsyncNinja/AsyncNinja
3c5928bfcaff24c4d7aeefff7f0872338bfd4673
12887fc0a02425aebb177becfd63c54dbc69356d
refs/heads/master
2021-10-13T06:43:47.091073
2021-10-03T20:19:53
2021-10-03T20:19:53
65,158,825
163
18
MIT
2021-01-05T23:03:44
2016-08-07T23:29:44
Swift
UTF-8
Swift
false
false
6,330
swift
// // Copyright (c) 2016-2017 Anton Mironov // // 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 Dispatch /// Protocol for concurrency-aware active objects. /// Conforming to this protocol helps to avoid boilerplate code related to dispatching and memory management. /// See ["Moving to nice asynchronous Swift code"](https://github.com/AsyncNinja/article-moving-to-nice-asynchronous-swift-code/blob/master/ARTICLE.md) for complete explanation. /// /// Best way to conform for model-related classes looks like: /// /// ```swift /// public class MyService: ExecutionContext, ReleasePoolOwner { /// private let _internalQueue = DispatchQueue(label: "my-service-queue", target: .global()) /// public var executor: Executor { return .queue(_internalQueue) } /// public let releasePool = ReleasePool() /// /// /* class implementation */ /// } /// ``` /// /// Best way to conform for classes related to main queue looks like: /// /// ```swift /// public class MyMainQueueService: ExecutionContext, ReleasePoolOwner { /// public var executor: Executor { return .main } /// public let releasePool = ReleasePool() /// /// /* class implementation */ /// } /// ``` /// /// Best way to conform for classes related to UI manipulations looks like: /// /// ```swift /// public class MyPresenter: NSObject, ObjCUIInjectedExecutionContext { /// /* class implementation */ /// } /// ``` /// Classes that conform to NSResponder/UIResponder are automatically conformed to exection context. public protocol ExecutionContext: Retainer { /// Executor to perform internal state-changing operations on. /// It is highly recommended to use serial executor var executor: Executor { get } } // swiftlint:enable line_length public extension ExecutionContext { /// Schedules execution of the block /// /// - Parameters: /// - cancellationToken: `CancellationToken` that can cancel execution /// - block: to schedule after timeout /// - strongSelf: is `ExecutionContext` restored from weak reference of self func async(cancellationToken: CancellationToken? = nil, block: @escaping (_ strongContext: Self) -> Void) { self.executor.execute(from: nil) { [weak self] (_) in guard let strongSelf = self else { return } block(strongSelf) } } /// Schedules execution of the block after specified timeout /// /// - Parameters: /// - timeout: (in seconds) to execute the block after /// - cancellationToken: `CancellationToken` that can cancel execution /// - block: to schedule after timeout /// - strongSelf: is `ExecutionContext` restored from weak reference of self func after(_ timeout: Double, cancellationToken: CancellationToken? = nil, block: @escaping (_ strongContext: Self) -> Void) { self.executor.execute(after: timeout) { [weak self] (_) in if cancellationToken?.isCancelled ?? false { return } guard let strongSelf = self else { return } block(strongSelf) } } /// Adds dependent `Cancellable`. `Cancellable` will be weakly referenced /// and cancelled on deinit func addDependent(cancellable: Cancellable) { self.notifyDeinit { [weak cancellable] in cancellable?.cancel() } } /// Adds dependent `Completable`. `Completable` will be weakly /// referenced and cancelled because of deallocated context on deinit func addDependent<T: Completable>(completable: T) { self.notifyDeinit { [weak completable] in completable?.cancelBecauseOfDeallocatedContext() } } /// Makes a dynamic property bound to the execution context /// /// - Parameters: /// - initialValue: initial value to set /// - bufferSize: `DerivedChannelBufferSize` of derived channel. /// Keep default value of the argument unless you need /// an extended buffering options of returned channel /// - Returns: `DynamicProperty` bound to the context func makeDynamicProperty<T>( _ initialValue: T, bufferSize: Int = AsyncNinjaConstants.defaultChannelBufferSize ) -> DynamicProperty<T> { return DynamicProperty( initialValue: initialValue, updateExecutor: executor, bufferSize: bufferSize) } } /// Protocol for any instance that has `ReleasePool`. /// Made to proxy calls of `func releaseOnDeinit(_ object: AnyObject)` /// and `func notifyDeinit(_ block: @escaping () -> Void)` to `ReleasePool` public protocol ReleasePoolOwner: Retainer { /// `ReleasePool` to proxy calls to. Perfect implementation looks like: /// ```swift /// public class MyService: ExecutionContext, ReleasePoolOwner { /// let releasePool = ReleasePool() /// /* other implementation */ /// } /// ``` var releasePool: ReleasePool { get } } public extension ExecutionContext where Self: ReleasePoolOwner { func releaseOnDeinit(_ object: AnyObject) { self.releasePool.insert(object) } func notifyDeinit(_ block: @escaping () -> Void) { self.releasePool.notifyDrain(block) } } /// An object that can extend lifetime of another objects up to deinit or notify deinit public protocol Retainer: AnyObject { /// Extends lifetime of specified object func releaseOnDeinit(_ object: AnyObject) /// calls specified block on deinit func notifyDeinit(_ block: @escaping () -> Void) }
[ -1 ]
2610d1be63f249cc249e6d27dff42b8a798fe7d6
35019a3a0644367198ed4058243ee7840bc7f6d3
/fitsky/Classes/Mine/Controllers/FSVenueConfirmVC.swift
9c92cf1c972b906653034de09f69344576872e76
[ "MIT" ]
permissive
gouyz/fitsky
81b841dfc672da6e6250468d68896e4db27dbe99
fe03da08f7a34b051928d83487846706cf5d2fbf
refs/heads/master
2020-11-27T21:25:13.843495
2020-06-03T08:55:34
2020-06-03T08:55:34
229,605,354
1
0
null
null
null
null
UTF-8
Swift
false
false
33,713
swift
// // FSVenueConfirmVC.swift // fitsky // 场馆认证 // Created by gouyz on 2019/10/29. // Copyright © 2019 gyz. All rights reserved. // import UIKit import MBProgressHUD class FSVenueConfirmVC: GYZWhiteNavBaseVC { var venueTypeList:[FSCompainCategoryModel] = [FSCompainCategoryModel]() /// 类型id var selectTypeId: String = "" var typeNameArr:[String] = [String]() /// 地点 var currAddress: AMapPOI? /// 选择身份证正面 var selectCardPhotoImg: UIImage? /// 选择身份证正面url var selectCardPhotoImgUrl: String = "" /// 选择身份证反面 var selectCardPhotoFanImg: UIImage? /// 选择身份证反面url var selectCardPhotoFanImgUrl: String = "" /// 选择手持身份证 var selectShouCardPhotoImg: UIImage? /// 选择手持身份证 var selectShouCardPhotoImgUrl: String = "" /// 选择门店照 var selectRoomPhotoImg: UIImage? /// 选择门店照url var selectRoomPhotoImgUrl: String = "" /// 选择店内照 var selectRoomLinePhotoImg: UIImage? /// 选择店内照url var selectRoomLinePhotoImgUrl: String = "" /// 选择手持身份证 var selectyyzzPhotoImg: UIImage? /// 选择手持身份证 var selectyyzzPhotoImgUrl: String = "" let ruleContent: String = "阅读并确定《场馆认证须知》" override func viewDidLoad() { super.viewDidLoad() self.navigationItem.title = "场馆认证" self.view.backgroundColor = kWhiteColor let rightBtn = UIButton(type: .custom) rightBtn.setTitle("提交", for: .normal) rightBtn.titleLabel?.font = k15Font rightBtn.setTitleColor(kBlueFontColor, for: .normal) rightBtn.frame = CGRect.init(x: 0, y: 0, width: kTitleHeight, height: kTitleHeight) rightBtn.addTarget(self, action: #selector(onClickRightBtn), for: .touchUpInside) navigationItem.rightBarButtonItem = UIBarButtonItem.init(customView: rightBtn) setUpUI() ruleLab.yb_addAttributeTapAction(with: ["《场馆认证须知》"]) {[unowned self] (label, string, range, index) in if index == 0{//《场馆认证须知》 self.goWebVC(method: "News/Home/storeCertificationInstructions") } } requestVenueTypeData() } ///场馆认证类型 func requestVenueTypeData(){ if !GYZTool.checkNetWork() { return } weak var weakSelf = self createHUD(message: "加载中...") GYZNetWork.requestNetwork("Member/Apply/storeApplyInit", parameters: nil, success: { (response) in weakSelf?.hud?.hide(animated: true) GYZLog(response) if response["result"].intValue == kQuestSuccessTag{//请求成功 guard let data = response["data"]["store_type"].array else { return } for item in data{ guard let itemInfo = item.dictionaryObject else { return } let model = FSCompainCategoryModel.init(dict: itemInfo) weakSelf?.typeNameArr.append(model.name!) weakSelf?.venueTypeList.append(model) } if weakSelf?.venueTypeList.count > 0 { weakSelf?.areaView.textFiled.text = weakSelf?.typeNameArr[0] weakSelf?.selectTypeId = (weakSelf?.venueTypeList[0].id)! } }else{ MBProgressHUD.showAutoDismissHUD(message: response["msg"].stringValue) } }, failture: { (error) in weakSelf?.hud?.hide(animated: true) GYZLog(error) }) } func setUpUI(){ view.addSubview(scrollView) scrollView.addSubview(contentView) contentView.addSubview(roomDesLab) contentView.addSubview(roomPhotoView) contentView.addSubview(desLab1) contentView.addSubview(lineView0) contentView.addSubview(roomNameView) contentView.addSubview(lineView) contentView.addSubview(roomInLineDesLab) contentView.addSubview(roomLinePhotoView) contentView.addSubview(lineView1) contentView.addSubview(addressView) contentView.addSubview(mapTagView) contentView.addSubview(lineView2) contentView.addSubview(areaView) contentView.addSubview(rightIconView) contentView.addSubview(lineView3) contentView.addSubview(yyzzDesLab) contentView.addSubview(yyzzPhotoView) contentView.addSubview(desLab3) contentView.addSubview(lineView4) contentView.addSubview(nameView) contentView.addSubview(lineView5) contentView.addSubview(cardNoView) contentView.addSubview(lineView9) contentView.addSubview(shouCardDesLab) contentView.addSubview(shouCardPhotoView) contentView.addSubview(desLab4) contentView.addSubview(lineView6) contentView.addSubview(cardDesLab) contentView.addSubview(cardPhotoView) contentView.addSubview(cardFanPhotoView) contentView.addSubview(lineView7) contentView.addSubview(phoneView) contentView.addSubview(lineView8) contentView.addSubview(checkImgView) contentView.addSubview(ruleLab) scrollView.snp.makeConstraints { (make) in make.left.bottom.right.top.equalTo(view) } contentView.snp.makeConstraints { (make) in make.left.width.equalTo(scrollView) make.top.equalTo(scrollView) make.bottom.equalTo(scrollView) // 这个很重要!!!!!! // 必须要比scroll的高度大一,这样才能在scroll没有填充满的时候,保持可以拖动 make.height.greaterThanOrEqualTo(scrollView).offset(1) } roomDesLab.snp.makeConstraints { (make) in make.left.equalTo(kMargin) make.height.equalTo(kTitleHeight) make.top.equalTo(kMargin) make.width.equalTo(100) } roomPhotoView.snp.makeConstraints { (make) in make.left.equalTo(roomDesLab.snp.right).offset(kMargin) make.top.equalTo(roomDesLab) make.size.equalTo(CGSize.init(width: 80, height: 80)) } desLab1.snp.makeConstraints { (make) in make.right.equalTo(-kMargin) make.left.equalTo(roomPhotoView) make.height.equalTo(30) make.top.equalTo(roomPhotoView.snp.bottom) } lineView0.snp.makeConstraints { (make) in make.left.right.equalTo(contentView) make.top.equalTo(desLab1.snp.bottom).offset(kMargin) make.height.equalTo(klineDoubleWidth) } roomNameView.snp.makeConstraints { (make) in make.left.right.equalTo(contentView) make.top.equalTo(lineView0.snp.bottom) make.height.equalTo(50) } lineView.snp.makeConstraints { (make) in make.left.right.height.equalTo(lineView0) make.top.equalTo(roomNameView.snp.bottom) } roomInLineDesLab.snp.makeConstraints { (make) in make.left.height.width.equalTo(roomDesLab) make.top.equalTo(lineView.snp.bottom).offset(kMargin) } roomLinePhotoView.snp.makeConstraints { (make) in make.left.equalTo(roomInLineDesLab.snp.right).offset(kMargin) make.top.equalTo(roomInLineDesLab) make.size.equalTo(roomPhotoView) } lineView1.snp.makeConstraints { (make) in make.left.right.height.equalTo(lineView) make.top.equalTo(roomLinePhotoView.snp.bottom).offset(kMargin) } addressView.snp.makeConstraints { (make) in make.left.height.equalTo(roomNameView) make.right.equalTo(mapTagView.snp.left) make.top.equalTo(lineView1.snp.bottom) } mapTagView.snp.makeConstraints { (make) in make.right.equalTo(-kMargin) make.centerY.equalTo(addressView) make.size.equalTo(CGSize.init(width: kTitleHeight, height: kTitleHeight)) } lineView2.snp.makeConstraints { (make) in make.left.right.height.equalTo(lineView) make.top.equalTo(addressView.snp.bottom) } areaView.snp.makeConstraints { (make) in make.left.height.equalTo(roomNameView) make.right.equalTo(rightIconView.snp.left) make.top.equalTo(lineView2.snp.bottom) } rightIconView.snp.makeConstraints { (make) in make.right.equalTo(-kMargin) make.centerY.equalTo(areaView) make.size.equalTo(rightArrowSize) } lineView3.snp.makeConstraints { (make) in make.left.right.height.equalTo(lineView) make.top.equalTo(areaView.snp.bottom) } yyzzDesLab.snp.makeConstraints { (make) in make.left.height.width.equalTo(roomDesLab) make.top.equalTo(lineView3.snp.bottom).offset(kMargin) } yyzzPhotoView.snp.makeConstraints { (make) in make.left.equalTo(yyzzDesLab.snp.right).offset(kMargin) make.top.equalTo(yyzzDesLab) make.size.equalTo(roomPhotoView) } desLab3.snp.makeConstraints { (make) in make.left.right.height.equalTo(desLab1) make.top.equalTo(yyzzPhotoView.snp.bottom) } lineView4.snp.makeConstraints { (make) in make.left.right.height.equalTo(lineView) make.top.equalTo(desLab3.snp.bottom).offset(kMargin) } nameView.snp.makeConstraints { (make) in make.left.right.height.equalTo(roomNameView) make.top.equalTo(lineView4.snp.bottom) } lineView5.snp.makeConstraints { (make) in make.left.right.height.equalTo(lineView) make.top.equalTo(nameView.snp.bottom) } cardNoView.snp.makeConstraints { (make) in make.left.right.height.equalTo(roomNameView) make.top.equalTo(lineView5.snp.bottom) } lineView9.snp.makeConstraints { (make) in make.left.right.height.equalTo(lineView) make.top.equalTo(cardNoView.snp.bottom) } shouCardDesLab.snp.makeConstraints { (make) in make.left.height.width.equalTo(roomDesLab) make.top.equalTo(lineView9.snp.bottom).offset(kMargin) } shouCardPhotoView.snp.makeConstraints { (make) in make.left.equalTo(shouCardDesLab.snp.right).offset(kMargin) make.top.equalTo(shouCardDesLab) make.size.equalTo(roomPhotoView) } desLab4.snp.makeConstraints { (make) in make.left.right.height.equalTo(desLab1) make.top.equalTo(shouCardPhotoView.snp.bottom) } lineView6.snp.makeConstraints { (make) in make.left.right.height.equalTo(lineView) make.top.equalTo(desLab4.snp.bottom).offset(kMargin) } cardDesLab.snp.makeConstraints { (make) in make.left.height.width.equalTo(roomDesLab) make.top.equalTo(lineView6.snp.bottom).offset(kMargin) } cardPhotoView.snp.makeConstraints { (make) in make.left.equalTo(cardDesLab.snp.right).offset(kMargin) make.top.equalTo(cardDesLab) make.size.equalTo(roomPhotoView) } cardFanPhotoView.snp.makeConstraints { (make) in make.size.top.equalTo(cardPhotoView) make.left.equalTo(cardPhotoView.snp.right).offset(kMargin) } lineView7.snp.makeConstraints { (make) in make.left.right.height.equalTo(lineView) make.top.equalTo(cardPhotoView.snp.bottom).offset(kMargin) } phoneView.snp.makeConstraints { (make) in make.left.right.height.equalTo(nameView) make.top.equalTo(lineView7.snp.bottom) } lineView8.snp.makeConstraints { (make) in make.left.right.height.equalTo(lineView) make.top.equalTo(phoneView.snp.bottom) } checkImgView.snp.makeConstraints { (make) in make.left.equalTo(kMargin) make.centerY.equalTo(ruleLab) make.size.equalTo(CGSize.init(width: 16, height: 16)) } ruleLab.snp.makeConstraints { (make) in make.left.equalTo(checkImgView.snp.right).offset(kMargin) make.top.equalTo(lineView8.snp.bottom).offset(15) make.right.equalTo(-20) make.height.equalTo(30) // 这个很重要,viewContainer中的最后一个控件一定要约束到bottom,并且要小于等于viewContainer的bottom // 否则的话,上面的控件会被强制拉伸变形 // 最后的-10是边距,这个可以随意设置 make.bottom.lessThanOrEqualTo(contentView).offset(-kMargin) } } /// scrollView var scrollView: UIScrollView = UIScrollView() /// 内容View var contentView: UIView = UIView() /// 门店照 lazy var roomDesLab : UILabel = { let lab = UILabel() lab.font = k15Font lab.textColor = kHeightGaryFontColor let strAttr : NSMutableAttributedString = NSMutableAttributedString(string: "* 门店照") strAttr.addAttribute(NSAttributedString.Key.foregroundColor, value: kRedFontColor, range: NSMakeRange(0, 1)) lab.attributedText = strAttr return lab }() /// 门店照 lazy var roomPhotoView: UIImageView = { let imgView = UIImageView.init(image: UIImage.init(named: "icon_upload_img")) imgView.contentMode = .scaleAspectFill /// 超出部分裁剪 imgView.clipsToBounds = true imgView.tag = 104 imgView.addOnClickListener(target: self, action: #selector(onClickedSelectPhoto(sender:))) return imgView }() /// lazy var desLab1 : UILabel = { let lab = UILabel() lab.font = k13Font lab.textColor = kHeightGaryFontColor lab.text = "需拍全,包含完整的店牌" return lab }() lazy var lineView0: UIView = { let view = UIView() view.backgroundColor = kBackgroundColor return view }() lazy var roomNameView: GYZLabAndFieldView = { let nView = GYZLabAndFieldView.init(desName: "门店名称", placeHolder: "需与门店照牌面一致,若为品牌分店请注明") nView.desLab.textColor = kHeightGaryFontColor nView.textFiled.textColor = kGaryFontColor return nView }() lazy var lineView: UIView = { let view = UIView() view.backgroundColor = kBackgroundColor return view }() /// 店内照 lazy var roomInLineDesLab : UILabel = { let lab = UILabel() lab.font = k15Font lab.textColor = kHeightGaryFontColor let strAttr : NSMutableAttributedString = NSMutableAttributedString(string: "* 店内照") strAttr.addAttribute(NSAttributedString.Key.foregroundColor, value: kRedFontColor, range: NSMakeRange(0, 1)) lab.attributedText = strAttr return lab }() /// 店内照 lazy var roomLinePhotoView: UIImageView = { let imgView = UIImageView.init(image: UIImage.init(named: "icon_upload_img")) imgView.contentMode = .scaleAspectFill /// 超出部分裁剪 imgView.clipsToBounds = true imgView.tag = 105 imgView.addOnClickListener(target: self, action: #selector(onClickedSelectPhoto(sender:))) return imgView }() lazy var lineView1: UIView = { let view = UIView() view.backgroundColor = kBackgroundColor return view }() lazy var addressView: GYZLabAndFieldView = { let nView = GYZLabAndFieldView.init(desName: "", placeHolder: "请选择详细地址") nView.desLab.textColor = kHeightGaryFontColor nView.textFiled.textColor = kGaryFontColor // nView.textFiled.isEnabled = false let strAttr : NSMutableAttributedString = NSMutableAttributedString(string: "* 门店地址") strAttr.addAttribute(NSAttributedString.Key.foregroundColor, value: kRedFontColor, range: NSMakeRange(0, 1)) nView.desLab.attributedText = strAttr return nView }() /// 地图图标 lazy var mapTagView : UIButton = { let btn = UIButton.init(type: .custom) btn.setImage(UIImage.init(named: "app_square_location"), for: .normal) btn.addTarget(self, action: #selector(onClickedSelectAddress), for: .touchUpInside) return btn }() lazy var lineView2: UIView = { let view = UIView() view.backgroundColor = kBackgroundColor return view }() /// 经营范围 lazy var areaView: GYZLabAndFieldView = { let nView = GYZLabAndFieldView.init(desName: "经营范围", placeHolder: "请选择经营范围") nView.desLab.textColor = kHeightGaryFontColor nView.textFiled.textColor = kBlueFontColor nView.textFiled.isEnabled = false nView.addOnClickListener(target: self, action: #selector(onClickedSelectDaRenType)) return nView }() /// 右侧箭头图标 lazy var rightIconView: UIImageView = UIImageView.init(image: UIImage.init(named: "icon_right_arrow")) lazy var lineView3: UIView = { let view = UIView() view.backgroundColor = kBackgroundColor return view }() /// 营业执照 lazy var yyzzDesLab : UILabel = { let lab = UILabel() lab.font = k15Font lab.textColor = kHeightGaryFontColor let strAttr : NSMutableAttributedString = NSMutableAttributedString(string: "* 营业执照") strAttr.addAttribute(NSAttributedString.Key.foregroundColor, value: kRedFontColor, range: NSMakeRange(0, 1)) lab.attributedText = strAttr return lab }() /// 营业执照 lazy var yyzzPhotoView: UIImageView = { let imgView = UIImageView.init(image: UIImage.init(named: "icon_upload_img")) imgView.contentMode = .scaleAspectFill /// 超出部分裁剪 imgView.clipsToBounds = true imgView.tag = 106 imgView.addOnClickListener(target: self, action: #selector(onClickedSelectPhoto(sender:))) return imgView }() /// lazy var desLab3 : UILabel = { let lab = UILabel() lab.font = k13Font lab.textColor = kHeightGaryFontColor lab.text = "需提供清晰的照片" return lab }() lazy var lineView4: UIView = { let view = UIView() view.backgroundColor = kBackgroundColor return view }() lazy var nameView: GYZLabAndFieldView = { let nView = GYZLabAndFieldView.init(desName: "", placeHolder: "运营者姓名") nView.desLab.textColor = kHeightGaryFontColor nView.textFiled.textColor = kGaryFontColor let strAttr : NSMutableAttributedString = NSMutableAttributedString(string: "* 运营者姓名") strAttr.addAttribute(NSAttributedString.Key.foregroundColor, value: kRedFontColor, range: NSMakeRange(0, 1)) nView.desLab.attributedText = strAttr return nView }() lazy var lineView5: UIView = { let view = UIView() view.backgroundColor = kBackgroundColor return view }() lazy var cardNoView: GYZLabAndFieldView = { let nView = GYZLabAndFieldView.init(desName: "", placeHolder: "运营者身份证号") nView.desLab.textColor = kHeightGaryFontColor nView.desLab.numberOfLines = 0 nView.textFiled.textColor = kGaryFontColor let strAttr : NSMutableAttributedString = NSMutableAttributedString(string: "* 运营者身份**证号") strAttr.addAttribute(NSAttributedString.Key.foregroundColor, value: kRedFontColor, range: NSMakeRange(0, 1)) strAttr.addAttribute(NSAttributedString.Key.foregroundColor, value: kWhiteColor, range: NSMakeRange(7, 2)) nView.desLab.attributedText = strAttr return nView }() lazy var lineView9: UIView = { let view = UIView() view.backgroundColor = kBackgroundColor return view }() /// lazy var cardDesLab : UILabel = { let lab = UILabel() lab.font = k15Font lab.textColor = kHeightGaryFontColor lab.numberOfLines = 0 let strAttr : NSMutableAttributedString = NSMutableAttributedString(string: "* 运营者身份**证正反照") strAttr.addAttribute(NSAttributedString.Key.foregroundColor, value: kRedFontColor, range: NSMakeRange(0, 1)) strAttr.addAttribute(NSAttributedString.Key.foregroundColor, value: kWhiteColor, range: NSMakeRange(7, 2)) lab.attributedText = strAttr return lab }() /// 身份证正照 lazy var cardPhotoView: UIImageView = { let imgView = UIImageView.init(image: UIImage.init(named: "icon_upload_img")) imgView.contentMode = .scaleAspectFill /// 超出部分裁剪 imgView.clipsToBounds = true imgView.tag = 101 imgView.addOnClickListener(target: self, action: #selector(onClickedSelectPhoto(sender:))) return imgView }() /// 身份证反照 lazy var cardFanPhotoView: UIImageView = { let imgView = UIImageView.init(image: UIImage.init(named: "icon_upload_img")) imgView.contentMode = .scaleAspectFill /// 超出部分裁剪 imgView.clipsToBounds = true imgView.tag = 102 imgView.addOnClickListener(target: self, action: #selector(onClickedSelectPhoto(sender:))) return imgView }() lazy var lineView6: UIView = { let view = UIView() view.backgroundColor = kBackgroundColor return view }() /// 手持身份证 lazy var shouCardDesLab : UILabel = { let lab = UILabel() lab.font = k15Font lab.textColor = kHeightGaryFontColor lab.numberOfLines = 0 let strAttr : NSMutableAttributedString = NSMutableAttributedString(string: "* 运营者手持**身份证") strAttr.addAttribute(NSAttributedString.Key.foregroundColor, value: kRedFontColor, range: NSMakeRange(0, 1)) strAttr.addAttribute(NSAttributedString.Key.foregroundColor, value: kWhiteColor, range: NSMakeRange(7, 2)) lab.attributedText = strAttr return lab }() /// 手持身份证 lazy var shouCardPhotoView: UIImageView = { let imgView = UIImageView.init(image: UIImage.init(named: "icon_upload_img")) imgView.contentMode = .scaleAspectFill /// 超出部分裁剪 imgView.clipsToBounds = true imgView.tag = 103 imgView.addOnClickListener(target: self, action: #selector(onClickedSelectPhoto(sender:))) return imgView }() /// 需提供清晰的照片 lazy var desLab4 : UILabel = { let lab = UILabel() lab.font = k13Font lab.textColor = kHeightGaryFontColor lab.text = "需提供清晰的照片" return lab }() lazy var lineView7: UIView = { let view = UIView() view.backgroundColor = kBackgroundColor return view }() lazy var phoneView: GYZLabAndFieldView = { let nView = GYZLabAndFieldView.init(desName: "联系方式", placeHolder: "输入联系电话,方便我们更好联系你") nView.desLab.textColor = kHeightGaryFontColor nView.textFiled.textColor = kGaryFontColor return nView }() lazy var lineView8: UIView = { let view = UIView() view.backgroundColor = kBackgroundColor return view }() lazy var checkImgView: UIImageView = { let imgView = UIImageView.init(image: UIImage.init(named: "app_icon_radio_no")) imgView.highlightedImage = UIImage.init(named: "app_icon_radio_yes") imgView.addOnClickListener(target: self, action: #selector(clickedCheckRule)) return imgView }() lazy var ruleLab: UILabel = { let lab = UILabel() let attStr = NSMutableAttributedString.init(string: ruleContent) attStr.addAttribute(NSAttributedString.Key.font, value: k15Font, range: NSMakeRange(0, ruleContent.count)) attStr.addAttribute(NSAttributedString.Key.foregroundColor, value: kBlueFontColor, range: NSMakeRange(0, ruleContent.count)) attStr.addAttribute(NSAttributedString.Key.foregroundColor, value: kBlackFontColor, range: NSMakeRange(0, 5)) lab.attributedText = attStr /// 点击效果,关闭 lab.enabledTapEffect = false lab.numberOfLines = 0 return lab }() /// 同意协议按钮 @objc func clickedCheckRule(){ checkImgView.isHighlighted = !checkImgView.isHighlighted } /// webView func goWebVC(method: String){ let vc = JSMWebViewVC() vc.method = method navigationController?.pushViewController(vc, animated: true) } /// 提交 @objc func onClickRightBtn(){ if !checkImgView.isHighlighted { MBProgressHUD.showAutoDismissHUD(message: "请先同意场馆认证须知") return } if (roomNameView.textFiled.text?.isEmpty)!{ MBProgressHUD.showAutoDismissHUD(message: "请输入门店名称") return } if selectRoomPhotoImgUrl.isEmpty{ MBProgressHUD.showAutoDismissHUD(message: "请上传门店照") return } if selectRoomLinePhotoImgUrl.isEmpty{ MBProgressHUD.showAutoDismissHUD(message: "请上传店内照") return } if selectyyzzPhotoImgUrl.isEmpty{ MBProgressHUD.showAutoDismissHUD(message: "请上传营业执照") return } if (nameView.textFiled.text?.isEmpty)!{ MBProgressHUD.showAutoDismissHUD(message: "请输入运营者姓名") return } if (cardNoView.textFiled.text?.isEmpty)!{ MBProgressHUD.showAutoDismissHUD(message: "请输入运营者身份证号") return } if selectCardPhotoImgUrl.isEmpty{ MBProgressHUD.showAutoDismissHUD(message: "请上传身份证正面照") return } if selectCardPhotoFanImgUrl.isEmpty{ MBProgressHUD.showAutoDismissHUD(message: "请上传身份证反面") return } if selectShouCardPhotoImgUrl.isEmpty{ MBProgressHUD.showAutoDismissHUD(message: "请上传手持身份证") return } if currAddress == nil{ MBProgressHUD.showAutoDismissHUD(message: "请选择门店地址") return } if (addressView.textFiled.text?.isEmpty)!{ MBProgressHUD.showAutoDismissHUD(message: "请选择门店地址") return } if selectTypeId.isEmpty{ MBProgressHUD.showAutoDismissHUD(message: "请选择经营范围") return } requestConfirm() } /// 选择认证方式 @objc func onClickedSelectDaRenType(){ if typeNameArr.count == 0 { return } UsefulPickerView.showSingleColPicker("选择经营范围", data: typeNameArr, defaultSelectedIndex: 0) {[unowned self] (index, value) in self.areaView.textFiled.text = self.venueTypeList[index].name self.selectTypeId = self.venueTypeList[index].id! } } //场馆认证 func requestConfirm(){ if !GYZTool.checkNetWork() { return } weak var weakSelf = self createHUD(message: "加载中...") GYZNetWork.requestNetwork("Member/Apply/storeApplySubmit", parameters: ["store_name":roomNameView.textFiled.text!,"store_logo":selectRoomPhotoImgUrl,"store_inside":selectRoomLinePhotoImgUrl,"identity_card_front":selectCardPhotoImgUrl,"identity_card_backend":selectCardPhotoFanImgUrl,"identity_card_half":selectShouCardPhotoImgUrl,"business_license":selectyyzzPhotoImgUrl,"address":addressView.textFiled.text!,"lng":(currAddress?.location.longitude)!,"lat":(currAddress?.location.latitude)!,"tel":phoneView.textFiled.text ?? "","store_type":selectTypeId,"operate_real_name": nameView.textFiled.text!,"operate_identity_card_number": cardNoView.textFiled.text!], success: { (response) in weakSelf?.hud?.hide(animated: true) GYZLog(response) MBProgressHUD.showAutoDismissHUD(message: response["msg"].stringValue) if response["result"].intValue == kQuestSuccessTag{//请求成功 _ = weakSelf?.navigationController?.popToRootViewController(animated: true) } }, failture: { (error) in weakSelf?.hud?.hide(animated: true) GYZLog(error) }) } /// 选择地址 @objc func onClickedSelectAddress(){ let vc = FSSelectAddressVC() vc.selectPoi = self.currAddress vc.resultBlock = {[unowned self] (address) in self.currAddress = address if address != nil { self.addressView.textFiled.text = address?.name } } let seeNav = GYZBaseNavigationVC(rootViewController:vc) self.present(seeNav, animated: true, completion: nil) } @objc func onClickedSelectPhoto(sender:UITapGestureRecognizer){ let tag = sender.view?.tag selectPhotoImg(tag: tag!) } /// 选择图片 func selectPhotoImg(tag: Int){ GYZOpenCameraPhotosTool.shareTool.choosePicture(self, editor: true, finished: { [unowned self] (image) in if tag == 101{// 身份证正面 self.selectCardPhotoImg = image self.cardPhotoView.image = image }else if tag == 102{// 身份证反面 self.selectCardPhotoFanImg = image self.cardFanPhotoView.image = image }else if tag == 103{// 手持身份证 self.selectShouCardPhotoImg = image self.shouCardPhotoView.image = image }else if tag == 104{// 门店照 self.selectRoomPhotoImg = image self.roomPhotoView.image = image }else if tag == 105{// 店内照 self.selectRoomLinePhotoImg = image self.roomLinePhotoView.image = image }else if tag == 106{// 营业执照 self.selectyyzzPhotoImg = image self.yyzzPhotoView.image = image } self.uploadImgFiles(img: image, tag: tag) }) } /// 上传图片 /// /// - Parameter params: 参数 func uploadImgFiles(img: UIImage,tag: Int){ if !GYZTool.checkNetWork() { return } // createHUD(message: "加载中...") weak var weakSelf = self var imgsParam: [ImageFileUploadParam] = [ImageFileUploadParam]() let imgParam: ImageFileUploadParam = ImageFileUploadParam() imgParam.name = "files[]" imgParam.fileName = "dynamic0.jpg" imgParam.mimeType = "image/jpg" imgParam.data = UIImage.jpegData(img)(compressionQuality: 0.5)! imgsParam.append(imgParam) GYZNetWork.uploadImageRequest("Dynamic/Publish/addMaterial", parameters: nil, uploadParam: imgsParam, success: { (response) in weakSelf?.hud?.hide(animated: true) GYZLog(response) if response["result"].intValue == kQuestSuccessTag{//请求成功 guard let data = response["data"]["files"].array else { return } var urls: String = "" for item in data{ urls += item["material"].stringValue + "," } if urls.count > 0{ urls = urls.subString(start: 0, length: urls.count - 1) } if tag == 101{// 身份证正面 weakSelf?.selectCardPhotoImgUrl = urls }else if tag == 102{// 身份证反面 weakSelf?.selectCardPhotoFanImgUrl = urls }else if tag == 103{// 手持身份证 weakSelf?.selectShouCardPhotoImgUrl = urls }else if tag == 104{// 门店照 weakSelf?.selectRoomPhotoImgUrl = urls }else if tag == 105{// 店内照 weakSelf?.selectRoomLinePhotoImgUrl = urls }else if tag == 106{// 营业执照 weakSelf?.selectyyzzPhotoImgUrl = urls } }else{ MBProgressHUD.showAutoDismissHUD(message: response["msg"].stringValue) } }, failture: { (error) in weakSelf?.hud?.hide(animated: true) GYZLog(error) }) } }
[ -1 ]
1d110041ef077ef225bdfaf1d6407d30d9e37d95
0d3aa06844ebb8af878d72bc15d0f33bc7244b06
/DesignCodev2/PostList.swift
4f4ca80adf63eae2354d3a67e71dea16f3d7f091
[ "MIT" ]
permissive
lduraes/advanced-layout
1c002a0d88556fcb7deb1e9c59de030e3f7afdf2
02ef37279a20e0a5e027009ba13cec1b32b97194
refs/heads/master
2022-12-06T21:27:34.418009
2020-08-27T09:08:48
2020-08-27T09:08:48
261,774,072
0
0
null
null
null
null
UTF-8
Swift
false
false
735
swift
// // PostList.swift // DesignCodev2 // // Created by Luiz Durães on 04/05/2020. // Copyright © 2020 Luiz Durães. All rights reserved. // import SwiftUI struct PostList: View { @ObservedObject var store = DataStore() var body: some View { List(store.posts) { post in VStack(alignment: .leading, spacing: 8.0) { Text(post.title) .font(.system(.title, design: .serif)) .bold() Text(post.body) .font(.subheadline) .foregroundColor(.secondary) } } } } struct PostList_Previews: PreviewProvider { static var previews: some View { PostList() } }
[ -1 ]
52d29dbc87f084255696c4c72a4f1bbaf3f7f4d0
5f36d6140bf1c432c5ec6dca9759827489bd09da
/viewusingmodelclass/viewusingmodelclassUITests/viewusingmodelclassUITests.swift
2fa14a96bc036a1ca42abe67458b72fc3d580aae
[]
no_license
hetalAcharya/Dummy
9c2599f1ac5cbfbf90e95180a870016c02b5a3ea
182edce1bd39d251472bf1b0a3347f6c61f1bcaa
refs/heads/master
2020-04-07T02:07:35.236738
2018-11-17T08:26:47
2018-11-17T08:26:47
157,964,714
0
0
null
null
null
null
UTF-8
Swift
false
false
1,268
swift
// // viewusingmodelclassUITests.swift // viewusingmodelclassUITests // // Created by Kush on 13/07/17. // Copyright © 2017 bansi. All rights reserved. // import XCTest class viewusingmodelclassUITests: XCTestCase { override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. // In UI tests it is usually best to stop immediately when a failure occurs. continueAfterFailure = false // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. XCUIApplication().launch() // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. super.tearDown() } func testExample() { // Use recording to get started writing UI tests. // Use XCTAssert and related functions to verify your tests produce the correct results. } }
[ 333827, 243720, 282634, 313356, 155665, 305173, 237599, 241695, 292901, 223269, 354342, 229414, 102441, 315433, 354346, 278571, 325675, 102446, 282671, 315431, 229425, 124974, 243763, 313388, 241717, 321589, 180279, 229431, 215095, 319543, 213051, 288829, 325695, 286787, 288835, 307269, 237638, 313415, 239689, 233548, 311373, 315468, 278607, 333902, 311377, 196687, 354386, 329812, 315477, 223317, 285362, 200795, 323678, 315488, 315489, 45154, 321632, 280676, 313446, 215144, 233578, 194667, 307306, 278637, 288878, 319599, 278642, 284789, 284790, 131190, 288890, 292987, 215165, 131199, 194692, 235661, 278669, 241809, 323730, 278676, 311447, 153752, 327834, 284827, 278684, 329884, 299166, 278690, 311459, 215204, 233635, 284840, 184489, 278698, 284843, 299176, 278703, 323761, 184498, 278707, 278713, 258233, 295099, 280761, 299197, 180409, 280767, 223418, 227517, 299202, 139459, 309443, 176325, 131270, 301255, 299208, 227525, 280779, 233678, 282832, 321744, 227536, 301270, 229591, 301271, 280792, 311520, 325857, 334049, 280803, 307431, 182503, 338151, 319719, 295147, 317676, 286957, 125166, 125170, 313595, 184574, 309504, 125184, 217352, 125192, 125197, 194832, 227601, 325904, 125200, 319764, 278805, 125204, 334104, 315674, 282908, 311582, 299294, 282912, 233761, 278817, 125215, 211239, 282920, 125225, 317738, 311596, 321839, 315698, 98611, 332084, 125236, 307514, 278843, 282938, 168251, 287040, 319812, 280903, 227655, 319816, 323914, 201037, 282959, 229716, 289109, 168280, 379224, 323934, 391521, 239973, 381286, 285031, 416103, 313703, 280938, 242027, 242028, 321901, 354671, 278895, 287089, 199030, 227702, 315768, 315769, 291194, 223611, 248188, 139641, 291193, 311679, 211327, 291200, 313726, 240003, 158087, 313736, 227721, 242059, 311692, 285074, 227730, 240020, 190870, 315798, 190872, 291225, 293275, 285083, 317851, 242079, 227743, 289185, 293281, 283039, 285089, 305572, 156069, 301482, 289195, 311723, 377265, 338359, 299449, 311739, 319931, 293309, 278974, 311744, 317889, 291266, 278979, 326083, 278988, 289229, 281038, 281039, 278992, 283088, 283089, 326093, 279000, 176602, 242138, 285152, 279009, 369121, 160224, 195044, 188899, 279014, 291297, 319976, 279017, 311787, 281071, 319986, 236020, 279030, 293368, 311800, 279033, 317949, 283138, 279042, 233987, 287237, 377352, 322057, 309770, 342537, 279053, 283154, 303634, 303635, 279061, 182802, 279060, 188954, 279066, 322077, 291359, 227881, 293420, 289328, 236080, 283185, 279092, 234037, 23093, 244279, 244280, 338491, 234044, 301635, 309831, 55880, 322119, 377419, 281165, 303693, 301647, 281170, 326229, 309847, 189016, 115287, 287319, 332379, 111197, 295518, 287327, 306634, 242274, 244326, 279143, 279150, 281200, 287345, 313970, 287348, 301688, 244345, 189054, 287359, 297600, 303743, 291455, 301702, 164487, 311944, 334473, 279176, 316044, 311948, 311950, 184974, 316048, 311953, 316050, 287379, 326288, 227991, 295575, 289435, 303772, 205469, 221853, 285348, 314020, 279207, 295591, 295598, 248494, 285360, 279215, 299698, 293552, 287412, 166581, 318127, 154295, 164532, 342705, 303802, 314043, 287418, 66243, 291529, 287434, 225996, 363212, 287438, 242385, 303826, 279253, 158424, 230105, 299737, 322269, 295653, 342757, 289511, 230120, 330473, 234216, 285419, 330476, 289517, 312046, 170735, 279278, 215790, 125683, 230133, 199415, 234233, 242428, 279293, 289534, 205566, 322302, 299777, 291584, 228099, 285443, 291591, 295688, 322312, 285450, 264971, 312076, 326413, 322320, 285457, 295698, 166677, 291605, 283418, 285467, 326428, 221980, 281378, 234276, 283431, 262952, 262953, 279337, 293673, 289580, 262957, 318247, 164655, 301872, 242481, 234290, 303921, 318251, 285493, 230198, 328495, 285496, 301883, 201534, 281407, 289599, 295745, 342846, 222017, 293702, 318279, 283466, 281426, 279379, 295769, 201562, 244569, 281434, 322396, 230238, 230239, 301919, 279393, 293729, 275294, 349025, 281444, 279398, 303973, 351078, 177002, 308075, 242540, 310132, 295797, 201590, 295799, 207735, 228214, 279418, 177018, 269179, 308093, 314240, 291713, 158594, 240517, 287623, 228232, 299912, 279434, 320394, 416649, 316299, 252812, 308111, 189327, 308113, 234382, 293780, 310166, 289691, 209820, 283551, 240543, 310177, 289699, 189349, 289704, 293801, 279465, 326571, 304050, 177074, 326580, 289720, 326586, 289723, 189373, 213956, 281541, 19398, 345030, 213961, 279499, 56270, 191445, 183254, 304086, 234469, 314343, 304104, 324587, 183276, 289773, 203758, 320492, 234476, 320495, 287730, 240631, 320504, 312313, 214009, 312315, 312317, 328701, 328705, 234499, 293894, 320520, 230411, 320526, 330766, 234513, 238611, 293911, 140311, 316441, 197658, 238617, 132140, 113710, 281647, 189487, 322609, 312372, 203829, 238646, 300087, 238650, 320571, 21567, 308288, 336962, 160834, 314437, 349254, 238663, 300109, 234578, 207954, 296023, 205911, 314458, 156763, 281698, 281699, 285795, 214116, 230500, 322664, 228457, 279659, 318571, 234606, 300145, 238706, 279666, 312435, 187508, 230514, 300147, 302202, 285819, 314493, 285823, 150656, 234626, 279686, 222344, 285833, 285834, 318602, 228492, 337037, 234635, 177297, 162962, 187539, 326803, 308375, 324761, 285850, 296091, 119965, 302239, 300192, 330912, 339106, 306339, 234655, 234662, 300200, 249003, 238764, 208044, 322733, 3243, 302251, 294069, 300215, 294075, 64699, 228541, 283841, 148674, 283846, 312519, 279752, 283849, 148687, 290001, 189651, 316628, 279766, 189656, 279775, 304352, 298209, 304353, 310496, 279780, 228587, 279789, 290030, 302319, 251124, 234741, 316661, 283894, 208123, 292092, 279803, 228608, 320769, 234756, 322826, 242955, 177420, 312588, 318732, 126229, 245018, 320795, 318746, 320802, 239610, 130342, 304422, 130344, 292145, 298290, 312628, 300342, 159033, 333114, 222523, 333115, 286012, 279872, 181568, 294210, 279874, 300355, 193858, 216387, 300354, 372039, 304457, 230730, 294220, 296269, 234830, 222542, 238928, 224591, 296274, 314708, 318804, 283990, 314711, 357720, 300378, 300379, 294236, 234330, 316764, 314721, 292194, 230757, 281958, 314727, 134504, 306541, 327023, 234864, 296304, 312688, 316786, 230772, 314740, 327030, 284015, 314742, 314745, 310650, 290170, 224637, 306558, 290176, 243073, 179586, 314752, 306561, 294278, 314759, 296328, 296330, 298378, 368012, 314765, 318860, 304523, 292242, 112019, 306580, 279955, 234902, 224662, 282008, 314776, 314771, 318876, 282013, 290206, 148899, 314788, 298406, 282023, 314790, 245160, 333224, 241067, 279979, 314797, 279980, 286128, 279988, 173492, 286133, 284086, 310714, 284090, 228796, 302523, 54719, 302530, 292291, 228804, 415170, 306630, 310725, 300488, 280003, 370122, 310731, 302539, 234957, 339403, 310735, 329168, 300490, 222674, 327122, 280020, 329170, 312785, 280025, 310747, 239069, 144862, 286176, 187877, 320997, 310758, 280042, 280043, 191980, 300526, 329198, 337391, 282097, 308722, 296434, 306678, 40439, 288248, 191991, 286201, 300539, 288252, 312830, 290304, 245249, 228868, 323079, 218632, 292359, 302602, 230922, 323083, 294413, 304655, 329231, 323088, 282132, 230933, 302613, 282135, 316951, 374297, 302620, 222754, 282147, 306730, 245291, 312879, 230960, 288305, 290359, 239159, 323132, 235069, 157246, 288319, 288322, 280131, 349764, 310853, 282182, 194118, 292424, 288328, 286281, 292426, 124486, 333389, 224848, 224852, 290391, 128600, 196184, 235096, 306777, 239192, 230999, 212574, 345697, 204386, 300643, 300645, 282214, 312937, 204394, 224874, 243306, 312941, 206447, 310896, 294517, 314997, 288377, 290425, 325246, 333438, 235136, 280193, 282244, 239238, 288391, 282248, 286344, 323208, 179853, 286351, 188049, 229011, 239251, 280217, 323226, 179868, 229021, 302751, 282272, 198304, 282279, 298664, 212649, 298666, 317102, 286387, 300725, 337590, 286392, 300729, 302778, 306875, 296636, 280253, 282302, 280252, 286400, 323262, 321217, 280259, 321220, 282309, 333508, 323265, 296649, 239305, 280266, 306891, 212684, 302798, 9935, 241360, 282321, 313042, 286419, 241366, 280279, 282330, 18139, 294621, 280285, 282336, 321250, 294629, 153318, 333543, 181992, 337638, 12009, 282347, 288492, 282349, 323315, 67316, 34547, 286457, 284410, 288508, 200444, 282366, 286463, 319232, 288515, 280326, 282375, 323335, 284425, 300810, 116491, 282379, 280333, 216844, 300812, 284430, 161553, 124691, 284436, 278292, 116502, 118549, 278294, 282390, 325403, 321308, 321309, 282399, 241440, 282401, 325411, 315172, 186149, 186148, 241447, 280011, 333609, 294699, 286507, 284460, 280367, 300849, 282418, 280373, 282424, 280377, 321338, 319289, 282428, 280381, 345918, 413500, 241471, 280386, 280391, 153416, 315209, 325449, 159563, 280396, 307024, 317268, 237397, 307030, 18263, 241494, 188250, 284508, 300893, 307038, 237411, 284515, 276326, 296807, 282471, 292713, 282476, 292719, 313200, 296815, 325491, 313204, 333687, 317305, 317308, 339840, 315265, 280451, 327556, 188293, 243590, 282503, 67464, 305032, 315272, 315275, 325514, 243592, 184207, 311183, 279218, 282517, 294806, 214936, 294808, 337816, 239515, 214943, 298912, 319393, 333727, 294820, 333734, 219046, 284584, 294824, 298921, 313257, 292783, 126896, 200628, 300983, 343993, 288698, 98240, 294849, 214978, 280517, 280518, 214983, 282572, 282573, 153553, 24531, 231382, 329696, 323554, 292835, 6116, 190437, 292838, 294887, 317416, 313322, 298987, 278507, 311277, 329707, 296942, 124912, 327666, 278515, 325620, 313338 ]
f78475b0884a1500643b22cb777b4ffac93ba0d8
48e7e02ae83dbe83bf9c73f0437cba71b524174c
/ColeccionDeJuegos/JuegoViewController.swift
089cc40ff9f347258bee02d73334ba61b16a8e27
[]
no_license
JosimarTT/iOS-ColeccionDeJuegos
43ae97b53d5d2b0f6f2aff5e2d982b8c1a2d61b3
847dda972bbe61326e47f755ace20bb3b77a9139
refs/heads/master
2020-05-18T01:19:52.695692
2019-05-03T21:39:35
2019-05-03T21:39:35
184,087,902
0
0
null
null
null
null
UTF-8
Swift
false
false
2,809
swift
// // JuegoViewController.swift // ColeccionDeJuegos // // Created by Josimar Javier Tantahuilca Torres on 3/05/19. // Copyright © 2019 Tecsup. All rights reserved. // import UIKit class JuegoViewController: UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate { @IBOutlet weak var JuegoImageView: UIImageView! @IBOutlet weak var tituloTextField: UITextField! @IBOutlet weak var agregarActualizarBoton: UIButton! @IBOutlet weak var eliminarBoton: UIButton! var imagePicker = UIImagePickerController() var juego : Juego? = nil override func viewDidLoad() { super.viewDidLoad() imagePicker.delegate = self if juego != nil { JuegoImageView.image = UIImage(data: (juego!.imagen!) as Data) tituloTextField.text = juego!.titulo agregarActualizarBoton.setTitle("Actualizar", for: .normal) } else { eliminarBoton.isHidden = true } } @IBAction func fotosTapped(_ sender: Any) { imagePicker.sourceType = .photoLibrary present(imagePicker, animated: true, completion: nil) } func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) { let imagenSeleccionada = info[UIImagePickerControllerOriginalImage] as! UIImage JuegoImageView.image = imagenSeleccionada imagePicker.dismiss(animated: true, completion: nil) } @IBAction func camaraTapped(_ sender: Any) { imagePicker.sourceType = .camera present(imagePicker, animated: true, completion: nil) } @IBAction func agregarTapped(_ sender: Any) { if juego != nil { juego!.titulo = tituloTextField.text juego!.imagen = UIImagePNGRepresentation(JuegoImageView.image!) as Data? } else { let context = (UIApplication.shared.delegate as! AppDelegate).persistentContainer.viewContext let juego = Juego(context: context) juego.titulo = tituloTextField.text juego.imagen = UIImagePNGRepresentation(JuegoImageView.image!) as Data? } (UIApplication.shared.delegate as! AppDelegate).saveContext() navigationController!.popViewController(animated: true) } @IBAction func eliminarTapped(_ sender: Any) { let context = (UIApplication.shared.delegate as! AppDelegate).persistentContainer.viewContext context.delete(juego!) (UIApplication.shared.delegate as! AppDelegate).saveContext() navigationController!.popViewController(animated: true) } // override func didReceiveMemoryWarning() { // super.didReceiveMemoryWarning() // } }
[ -1 ]
d9add18a9c1b754697557c92a09eb969463b0518
82c2669228ab7c7a1fa37bccb13e5ab15be4e5a4
/LJToolDemo/LJToolDemo/LJStringViewController.swift
853fca689ddb8c948077f8cb5295f8c19ca606a1
[ "MIT" ]
permissive
ljcoder2015/LJTool
f32b9478ead8967f6692549f520c6e501d5ddec1
d3354198e1ae4e297ff807879296c34bd7511634
refs/heads/master
2021-06-02T05:54:46.058051
2021-04-24T08:16:17
2021-04-24T08:16:17
96,732,646
11
0
null
null
null
null
UTF-8
Swift
false
false
1,453
swift
// // LJStringViewController.swift // LJToolDemo // // Created by ljcoder on 2017/9/27. // Copyright © 2017年 ljcoder. All rights reserved. // import UIKit class LJStringViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() title = "String" self.view.backgroundColor = UIColor.lj.background let text = "create a color image create a color image create a color image create a color image create a color image create a color image create a color image create a color imagecreate a color image create a color image create a color image create a color image create a color image create a color image create a color image create a color image" let size = text.lj.size(drawIn: CGSize(width: UIScreen.main.bounds.size.width - 20, height: 300), font: UIFont.preferredFont(forTextStyle: .body)) print(size) } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } /* // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepare(for segue: UIStoryboardSegue, sender: Any?) { // Get the new view controller using segue.destinationViewController. // Pass the selected object to the new view controller. } */ }
[ -1 ]
911e96d213fc84a1b59540755460e8e4aa67b3c5
525b019d50430f987a6de577f905feb38811635a
/BullsEye/AboutAuthorViewController.swift
8a48141c655436d09f8a0f884dab61725de3f6a3
[]
no_license
rkbroach/Bulls-Eye-Game
3235752f4ebed343ee2ded74e791ca71cecdac13
bc47c66d202eb0968e6bbfa0eea483828e6930ad
refs/heads/master
2020-06-21T18:00:18.317560
2019-07-18T06:01:15
2019-07-18T06:01:15
197,521,098
0
0
null
null
null
null
UTF-8
Swift
false
false
393
swift
// // AboutAuthorViewController.swift // BullsEye // // Created by Rohan Kevin Broach on 6/13/19. // Copyright © 2019 rkbroach. All rights reserved. // import UIKit class AboutAuthorViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() } @IBAction func goBack(_ sender: UIButton) { dismiss(animated: true, completion: nil) } }
[ -1 ]
a81c51faed889a8601a5986b03327725715ee1a5
ce3399e18c0cafd664df4ebbfba66d25f590d3b9
/rideasy/CustomTableViewForRideDetails.swift
fc86cd4755feea3f2d43decec1ed4ab2dde596b4
[]
no_license
yamdud/rideasy
d45c0e417d607620e6bd3515517b4de952e0437b
8f762972f63b19a1933ef8db8a77e72b2df970ca
refs/heads/master
2021-01-01T04:17:39.153776
2017-08-07T16:45:12
2017-08-07T16:45:12
97,159,075
0
0
null
null
null
null
UTF-8
Swift
false
false
3,375
swift
// // CustomTableViewForRideDetails.swift // rideasy // // Created by Siraprapha Suayngam on 03/03/2017. // Copyright © 2017 Gurung. All rights reserved. // import UIKit import MapKit class CustomTableViewForRideDetails: UITableViewCell { @IBOutlet weak var cancelButton: UIButton! @IBOutlet weak var mainView: UIView! @IBOutlet weak var shadowView: ShadowView! @IBOutlet weak var ExpandView: UIView! @IBOutlet weak var DateOfTravel: UILabel! @IBOutlet weak var bodyStackview: UIStackView! @IBOutlet weak var MainStackView: UIStackView! @IBOutlet weak var bodyViewHeight:NSLayoutConstraint! @IBOutlet weak var ExpandViewHeightConstraint: NSLayoutConstraint! @IBOutlet weak var dateOfTravelLabel: UILabel! @IBOutlet weak var originLabel: UILabel! @IBOutlet weak var DestinationLabel: UILabel! @IBOutlet weak var Costabel: UILabel! @IBOutlet weak var DistanceLabel: UILabel! var fareBreakDown = UIViewController() var ContainerView = UIView() override func awakeFromNib() { super.awakeFromNib() } func setupCell(){ mainView.layer.cornerRadius = 8 mainView.layer.masksToBounds = true shadowView.layer.cornerRadius = 8 shadowView.layer.masksToBounds = false } func nonSelectedCell(){ cancelButton.isHidden = true MainStackView.isHidden = false ContainerView.removeFromSuperview() } override func setSelected(_ selected: Bool, animated: Bool) { super.setSelected(selected, animated: animated) // Configure the view for the selected state } func expand(cell : CustomTableViewForRideDetails, storyboard: UIStoryboard){ MainStackView.isHidden = true cancelButton.isHidden = false //let ContainerView = UIView() //ContainerView.backgroundColor = UIColor.red ContainerView.frame = CGRect(origin: CGPoint(x: cell.frame.origin.x, y: cell.mainView.frame.origin.y - 10 ), size: CGSize(width: cell.frame.width - 40 ,height: cell.frame.height - 20)) //if (fareBreakDown == nil){ fareBreakDown = storyboard.instantiateViewController(withIdentifier: "RideDetailsFareBreakDown") //addChildViewController(fareBreakDown) //} fareBreakDown.view.frame = ContainerView.frame ContainerView.addSubview(fareBreakDown.view) cell.mainView.addSubview(ContainerView) print("containerView", ContainerView.frame, "farebreakdownView",fareBreakDown.view.frame) } } class ShadowView: UIView { override var bounds: CGRect { didSet { setupShadow() print("didSet shadowView's width to: \(self.bounds.width)\n") } } private func setupShadow() { self.translatesAutoresizingMaskIntoConstraints = false self.layer.shadowOffset = CGSize(width: 0, height: 3) self.layer.shadowRadius = 3 self.layer.shadowColor = UIColor.gray.cgColor self.layer.shadowOpacity = 1 self.layer.shadowPath = UIBezierPath(roundedRect: self.bounds, byRoundingCorners: .allCorners, cornerRadii: CGSize(width: 8, height: 8)).cgPath self.layer.shouldRasterize = true self.layer.rasterizationScale = UIScreen.main.scale } }
[ -1 ]
c46f14cd07393a45e0efec49743cab4a6cdfbc2f
dbbfe841da1b6cc5f167b1c40371bd30df133c60
/Dotkun/Util.swift
742749aad524163ebed66dca854f1ae37e715af7
[]
no_license
SakuragiYoshimasa/Dotkun
29c29e4d3e4351213cb44fd04b9f8646d81ec4d6
253aae5b410524bda008feec979b2d6bba96f006
refs/heads/master
2016-08-12T13:15:03.225771
2016-02-22T06:30:28
2016-02-22T06:30:28
45,382,599
1
0
null
2016-02-22T06:30:29
2015-11-02T08:49:13
Swift
UTF-8
Swift
false
false
5,297
swift
// // Util.swift // Dotkun // // Created by 山口智生 on 2015/11/03. // Copyright © 2015年 SakuragiYoshimasa. All rights reserved. // import UIKit class TestUtil { static func randomColor() -> UIColor { return UIColor(red: Util.generateRandom(), green: Util.generateRandom(), blue: Util.generateRandom(), alpha: 1.0) } static func randomPoint(rect: CGRect) -> CGPoint { return CGPointMake( rect.minX + Util.generateRandom() * rect.width, rect.minY + Util.generateRandom() * rect.height ) } } class Util { static func getStatusBarHeight() -> CGFloat { return UIApplication.sharedApplication().statusBarFrame.height } static func generateRandom() -> CGFloat { return CGFloat(rand())/CGFloat(RAND_MAX) } } extension UIColor { /** "ff00ff"みたいなStringをUIColorに変換 */ func colorFromRGB(rgb: String, alpha: CGFloat) -> UIColor { let scanner = NSScanner(string: rgb) var rgbInt: UInt32 = 0 scanner.scanHexInt(&rgbInt) let r = CGFloat(((rgbInt & 0xFF0000) >> 16)) / 255.0 let g = CGFloat(((rgbInt & 0x00FF00) >> 8)) / 255.0 let b = CGFloat(rgbInt & 0x0000FF) / 255.0 return UIColor(red: r, green: g, blue: b, alpha: alpha) } func getRGBA() -> (CGFloat, CGFloat, CGFloat, CGFloat) { var red: CGFloat = 1.0, green: CGFloat = 1.0, blue: CGFloat = 1.0, alpha: CGFloat = 1.0 self.getRed(&red, green: &green, blue: &blue, alpha: &alpha) return (r: red, g: green, b: blue, a: alpha) } // alphaを取得 var alpha: CGFloat { return CGColorGetAlpha(self.CGColor) } } extension CGPoint { mutating func move(x: CGFloat, y: CGFloat) { self.x += x self.y += y } } extension UIImage { // リサイズ func getResizedImage(size: CGSize) -> UIImage { UIGraphicsBeginImageContext(size) self.drawInRect(CGRect(origin: CGPoint.zero, size: size)) let resizedImage = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext() return resizedImage } // 透過色をいい感じ白にする func getFlatImage() -> UIImage { UIGraphicsBeginImageContext(self.size) let context = UIGraphicsGetCurrentContext() UIColor.whiteColor().setFill() CGContextFillRect(context, CGRect(origin: CGPoint.zero, size: self.size)) self.drawInRect(CGRect(origin: CGPoint.zero, size: self.size)) let image = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext() return image } func getColor(x x: Int, y: Int) -> UIColor { // 範囲オーバー if x > Int(self.size.width) || y > Int(self.size.height) || x < 0 || y < 0 { return UIColor.clearColor() } let pixelDataByteSize = 4 let data : UnsafePointer = CFDataGetBytePtr(CGDataProviderCopyData(CGImageGetDataProvider(self.CGImage))) var address = (Int(self.size.width) * y + x) * pixelDataByteSize //通常が3 //描いた奴は8194 let r: CGFloat, g: CGFloat, b: CGFloat, a: CGFloat let alphaInfo = CGImageGetAlphaInfo(self.CGImage) switch(alphaInfo) { case .First: a = CGFloat(data[address])/CGFloat(255.0) address += pixelDataByteSize break case .Only: a = CGFloat(data[address])/CGFloat(255.0) address += pixelDataByteSize break default: a = CGFloat(data[address+3])/CGFloat(255.0) } let info = CGImageGetBitmapInfo(self.CGImage).rawValue if ((info & CGBitmapInfo.ByteOrder32Little.rawValue) > 0) || ((info & CGBitmapInfo.ByteOrder16Little.rawValue) > 0) { r = CGFloat(data[address+2])/CGFloat(255.0) g = CGFloat(data[address+1])/CGFloat(255.0) b = CGFloat(data[address])/CGFloat(255.0) } else { r = CGFloat(data[address])/CGFloat(255.0) g = CGFloat(data[address+1])/CGFloat(255.0) b = CGFloat(data[address+2])/CGFloat(255.0) } /* // 通常が3、描いたやつは2 print(CGImageAlphaInfo.Last.rawValue)//3 print(CGImageAlphaInfo.None.rawValue)//0 print(CGImageAlphaInfo.NoneSkipFirst.rawValue)//6 print(CGImageAlphaInfo.NoneSkipLast.rawValue)//5 print(CGImageAlphaInfo.First.rawValue)//4 print(CGImageAlphaInfo.Only.rawValue)//7 */ /* // 通常が3、描いたやつは8194 print(CGBitmapInfo.AlphaInfoMask.rawValue)//31 print(CGBitmapInfo.ByteOrder16Big.rawValue)//12288 print(CGBitmapInfo.ByteOrder16Little.rawValue)//4096 print(CGBitmapInfo.ByteOrder32Big.rawValue)//16384 print(CGBitmapInfo.ByteOrder32Little.rawValue)//8192 print(CGBitmapInfo.ByteOrderDefault.rawValue)//0 print(CGBitmapInfo.ByteOrderMask.rawValue)//28672 */ //print(UIColor(red: r, green: g, blue: b, alpha: a)) return UIColor(red: r, green: g, blue: b, alpha: a) } }
[ -1 ]
9343fb8c3986424b51180b2e081411531ae9701c
12ea049fb685c5caf381418d5da241a835145fb4
/How Many Fingers 2/How Many Fingers 2/AppDelegate.swift
ad9691606c22c553b9ab175b0a86c27d42bf7940
[]
no_license
Sheena-Marie/ios-practice-stuff
3a90f734e8406108064dbde12def7d8e7b01136b
a1675e3d448a25a81c9cc67560bad6396a9f0c42
refs/heads/master
2021-01-21T06:19:14.286805
2017-03-16T01:49:29
2017-03-16T01:49:29
83,209,986
0
0
null
null
null
null
UTF-8
Swift
false
false
2,194
swift
// // AppDelegate.swift // How Many Fingers 2 // // Created by Sheena Takkenberg on 15/3/17. // Copyright © 2017 Sheena Takkenberg. 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, 278545, 229394, 278548, 229397, 229399, 229402, 352284, 229405, 278556, 278559, 229408, 294950, 229415, 229417, 327722, 237613, 229422, 360496, 229426, 237618, 229428, 311349, 286774, 286776, 319544, 286778, 229432, 204856, 286791, 237640, 286797, 278605, 311375, 163920, 237646, 196692, 319573, 311383, 278623, 278626, 319590, 311400, 278635, 303212, 278639, 131192, 278648, 237693, 303230, 327814, 303241, 131209, 417930, 303244, 311436, 319633, 286873, 286876, 311460, 311469, 32944, 327862, 286906, 327866, 180413, 286910, 131264, 286916, 295110, 286922, 286924, 286926, 319694, 286928, 131281, 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, 262448, 311601, 295220, 287032, 155966, 319809, 319810, 278849, 319814, 311623, 319818, 311628, 229709, 319822, 287054, 278865, 229717, 196963, 196969, 139638, 213367, 106872, 319872, 311683, 319879, 311693, 65943, 319898, 311719, 278952, 139689, 278957, 311728, 278967, 180668, 311741, 278975, 319938, 278980, 98756, 278983, 319945, 278986, 319947, 278990, 278994, 311767, 279003, 279006, 188895, 172512, 287202, 279010, 279015, 172520, 319978, 279020, 172526, 311791, 279023, 172529, 279027, 319989, 172534, 180727, 164343, 279035, 311804, 287230, 279040, 303617, 287234, 279045, 172550, 303623, 172552, 287238, 320007, 279051, 172558, 279055, 303632, 279058, 303637, 279063, 279067, 172572, 279072, 172577, 295459, 172581, 295461, 279082, 311850, 279084, 172591, 172598, 279095, 172607, 172609, 172612, 377413, 172614, 172618, 303690, 33357, 287309, 303696, 279124, 172634, 262752, 172644, 311911, 189034, 295533, 172655, 172656, 352880, 295538, 189040, 172660, 287349, 189044, 189039, 287355, 287360, 295553, 172675, 295557, 311942, 303751, 287365, 352905, 311946, 287371, 279178, 311951, 287377, 172691, 287381, 311957, 221850, 287386, 230045, 172702, 303773, 164509, 172705, 287394, 172707, 303780, 287390, 287398, 205479, 287400, 279208, 172714, 295595, 279212, 189102, 172721, 287409, 66227, 303797, 189114, 287419, 303804, 328381, 287423, 328384, 172737, 279231, 287427, 312005, 312006, 107208, 172748, 287436, 107212, 172751, 287440, 295633, 172755, 303827, 279255, 172760, 287450, 303835, 279258, 189149, 303838, 213724, 312035, 279267, 295654, 279272, 230128, 312048, 312050, 230131, 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, 213895, 304007, 304009, 304011, 230284, 304013, 295822, 213902, 279438, 189329, 295825, 304019, 189331, 58262, 304023, 304027, 279452, 410526, 279461, 279462, 304042, 213931, 230327, 304055, 287675, 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, 279661, 312432, 279669, 337018, 189562, 279679, 304258, 279683, 222340, 205968, 296084, 238745, 304285, 238756, 205991, 222377, 165035, 337067, 238766, 165038, 230576, 238770, 304311, 230592, 312518, 279750, 230600, 230607, 148690, 320727, 279769, 304348, 279777, 304354, 296163, 320740, 279781, 304360, 320748, 279788, 279790, 304370, 296189, 320771, 312585, 296202, 296205, 230674, 320786, 230677, 296213, 296215, 320792, 230681, 230679, 214294, 304416, 230689, 173350, 312622, 296243, 312630, 222522, 296253, 222525, 296255, 312639, 230718, 296259, 378181, 296262, 230727, 238919, 296264, 320840, 296267, 296271, 222545, 230739, 312663, 222556, 337244, 230752, 312676, 230760, 173418, 148843, 410987, 230763, 230768, 296305, 312692, 230773, 304505, 304506, 279929, 181626, 181631, 148865, 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, 370130, 222676, 288212, 288214, 148946, 239064, 288217, 288218, 280027, 288220, 329177, 239070, 288224, 280034, 288226, 280036, 288229, 280038, 288230, 288232, 370146, 288234, 320998, 288236, 288238, 288240, 288242, 296435, 288244, 288250, 296446, 321022, 402942, 148990, 296450, 206336, 230916, 230919, 214535, 230923, 304651, 304653, 370187, 230940, 222752, 108066, 296486, 296488, 157229, 239152, 230961, 157236, 288320, 288325, 124489, 280140, 280145, 288338, 280149, 288344, 280152, 239194, 280158, 403039, 370272, 181854, 239202, 312938, 280183, 280185, 280188, 280191, 116354, 280194, 280208, 280211, 288408, 280218, 280222, 190118, 198310, 321195, 296622, 321200, 337585, 296626, 296634, 296637, 280260, 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, 239586, 313320, 231404, 124913, 165876, 321528, 239612, 313340, 288764, 239617, 313347, 288773, 313358, 305176, 313371, 354338, 305191, 223273, 313386, 354348, 124978, 215090, 124980, 288824, 288826, 321595, 378941, 313406, 288831, 288836, 67654, 280651, 354382, 288848, 280658, 215123, 354390, 288855, 288859, 280669, 313438, 149599, 280671, 149601, 321634, 149603, 223327, 329830, 280681, 313451, 223341, 280687, 149618, 215154, 313458, 280691, 313464, 329850, 321659, 280702, 288895, 321670, 215175, 141446, 141455, 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, 354653, 313700, 280937, 313705, 190832, 280946, 223606, 313720, 280956, 239997, 280959, 313731, 199051, 240011, 289166, 240017, 297363, 190868, 240021, 297365, 297368, 297372, 141725, 297377, 289186, 297391, 289201, 240052, 289207, 289210, 305594, 281024, 289218, 289221, 289227, 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, 182926, 133776, 314003, 117398, 314007, 289436, 174754, 330404, 289448, 133801, 174764, 314029, 314033, 240309, 133817, 314045, 314047, 314051, 199364, 297671, 158409, 289493, 363234, 289513, 289522, 289525, 289532, 322303, 289537, 322310, 264969, 322314, 322318, 281361, 281372, 322341, 215850, 281388, 281401, 289593, 289601, 281410, 281413, 281414, 240458, 281420, 240468, 281430, 322393, 297818, 281435, 281438, 281442, 174955, 224110, 207733, 207737, 158596, 183172, 338823, 322440, 314249, 240519, 183184, 142226, 289687, 240535, 289694, 289696, 289700, 289712, 281529, 289724, 52163, 183260, 281567, 289762, 322534, 297961, 183277, 322550, 134142, 322563, 314372, 330764, 175134, 322599, 322610, 314421, 281654, 314427, 314433, 207937, 314441, 207949, 322642, 314456, 281691, 314461, 281702, 281704, 314474, 281708, 281711, 289912, 248995, 306341, 306344, 306347, 322734, 306354, 142531, 199877, 289991, 306377, 289997, 249045, 363742, 363745, 298216, 330988, 126190, 216303, 322801, 388350, 257302, 363802, 199976, 199978, 314671, 298292, 298294, 257334, 216376, 380226, 298306, 224584, 224587, 224594, 216404, 306517, 150870, 314714, 224603, 159068, 314718, 265568, 314723, 281960, 150890, 306539, 314732, 314736, 290161, 216436, 306549, 298358, 314743, 306552, 290171, 314747, 306555, 290174, 298365, 224641, 281987, 298372, 314756, 281990, 224647, 265604, 298377, 314763, 142733, 298381, 314768, 224657, 306581, 314773, 314779, 314785, 314793, 282025, 282027, 241068, 241070, 241072, 282034, 241077, 150966, 298424, 306618, 282044, 323015, 306635, 306640, 290263, 290270, 290275, 339431, 282089, 191985, 282098, 290291, 282101, 241142, 191992, 290298, 151036, 290302, 282111, 290305, 175621, 306694, 192008, 323084, 257550, 282127, 290321, 282130, 323090, 290325, 282133, 241175, 290328, 282137, 290332, 241181, 282142, 282144, 290344, 306731, 290349, 290351, 290356, 282186, 224849, 282195, 282199, 282201, 306778, 159324, 159330, 314979, 298598, 323176, 224875, 241260, 323181, 257658, 315016, 282249, 290445, 282261, 175770, 298651, 282269, 323229, 298655, 323231, 61092, 282277, 306856, 282295, 323260, 282300, 323266, 282310, 323273, 282319, 306897, 241362, 306904, 282328, 298714, 52959, 216801, 282337, 241380, 216806, 323304, 282345, 12011, 282356, 323318, 282364, 282367, 306945, 241412, 323333, 282376, 216842, 323345, 282388, 323349, 282392, 184090, 315167, 315169, 282402, 315174, 323367, 241448, 315176, 241450, 282410, 306988, 306991, 315184, 323376, 315190, 241464, 159545, 282425, 298811, 118593, 307009, 413506, 307012, 241475, 315211, 282446, 307027, 315221, 323414, 315223, 241496, 241498, 307035, 307040, 110433, 282465, 241509, 110438, 298860, 110445, 282478, 315249, 282481, 110450, 315251, 315253, 315255, 339838, 315267, 282499, 315269, 241544, 282505, 241546, 241548, 298896, 282514, 298898, 241556, 298901, 44948, 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, 307338, 233613, 241813, 307352, 299164, 299167, 315552, 184479, 184481, 315557, 184486, 307370, 307372, 184492, 307374, 307376, 299185, 323763, 184503, 176311, 307385, 299191, 258235, 307388, 176316, 307390, 307386, 299200, 184512, 307394, 299204, 307396, 184518, 307399, 323784, 233679, 307409, 307411, 176343, 299225, 233701, 307432, 184572, 282881, 184579, 282893, 291089, 282906, 291104, 233766, 295583, 176435, 307508, 315701, 332086, 307510, 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, 176592, 315860, 176597, 127447, 283095, 299481, 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, 234010, 135707, 242202, 135710, 242206, 242208, 291361, 242220, 291378, 234038, 152118, 234041, 315961, 70213, 242250, 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, 135870, 135873, 135876, 135879, 299720, 299723, 299726, 225998, 226002, 119509, 226005, 226008, 299740, 242396, 201444, 299750, 283368, 234219, 283372, 226037, 283382, 316151, 234231, 234236, 226045, 242431, 234239, 209665, 234242, 299778, 242436, 234246, 226056, 291593, 234248, 242443, 234252, 242445, 234254, 291601, 234258, 242450, 242452, 234261, 348950, 201496, 234264, 234266, 234269, 283421, 234272, 234274, 152355, 299814, 234278, 283432, 234281, 234284, 234287, 283440, 185138, 242483, 234292, 234296, 234298, 160572, 283452, 234302, 234307, 242499, 234309, 316233, 234313, 316235, 234316, 283468, 234319, 242511, 234321, 234324, 185173, 201557, 234329, 234333, 308063, 234336, 242530, 349027, 234338, 234341, 234344, 234347, 177004, 234350, 324464, 234353, 152435, 177011, 234356, 234358, 234362, 226171, 291711, 234368, 291714, 234370, 291716, 234373, 226182, 234375, 201603, 308105, 226185, 234379, 324490, 234384, 234388, 234390, 226200, 234393, 209818, 308123, 234396, 324508, 291742, 324504, 234398, 234401, 291747, 291748, 234405, 291750, 324518, 324520, 234407, 324522, 234410, 291756, 291754, 226220, 324527, 291760, 234414, 234417, 324531, 201650, 234422, 226230, 324536, 275384, 234428, 291773, 242623, 324544, 226239, 234434, 324546, 234431, 226245, 234437, 234439, 324548, 234443, 291788, 234446, 275406, 193486, 193488, 316370, 234449, 234452, 234455, 234459, 234461, 234464, 234467, 234470, 168935, 5096, 324585, 234475, 234478, 316400, 234481, 316403, 234484, 234485, 234487, 324599, 234490, 234493, 316416, 234496, 308226, 234501, 275462, 308231, 234504, 234507, 234510, 234515, 300054, 316439, 234520, 234519, 234523, 234526, 234528, 300066, 234532, 300069, 234535, 234537, 234540, 234543, 234546, 275508, 300085, 234549, 300088, 234553, 234556, 234558, 316479, 234561, 316483, 160835, 234563, 308291, 234568, 234570, 316491, 234572, 300108, 234574, 300115, 234580, 234581, 234585, 275545, 242777, 234590, 234593, 234595, 234597, 300133, 234601, 300139, 234605, 160879, 234607, 275569, 234610, 316530, 300148, 234614, 398455, 144506, 234618, 234620, 275579, 234623, 226433, 234627, 275588, 234629, 234634, 234636, 177293, 234640, 275602, 234643, 308373, 226453, 234647, 234648, 275608, 234650, 308379, 324757, 300189, 324766, 119967, 234653, 283805, 234657, 324768, 242852, 300197, 234661, 283813, 234664, 275626, 234667, 316596, 308414, 234687, 300223, 300226, 308418, 234692, 300229, 308420, 308422, 283844, 300234, 283850, 300238, 300241, 316625, 300243, 300245, 316630, 300248, 300253, 300256, 300258, 300260, 234726, 300263, 300265, 300267, 161003, 300270, 300272, 120053, 300278, 275703, 316663, 300284, 275710, 300287, 292097, 300289, 161027, 300292, 300294, 275719, 234760, 177419, 300299, 242957, 300301, 275725, 177424, 283917, 349464, 283939, 259367, 292143, 283951, 300344, 226617, 243003, 283963, 226628, 300357, 283973, 177482, 283983, 316758, 357722, 316766, 292192, 316768, 218464, 292197, 316774, 243046, 218473, 284010, 136562, 324978, 275834, 333178, 275836, 275840, 316803, 316806, 226696, 316811, 226699, 316814, 226703, 300433, 234899, 300436, 226709, 357783, 316824, 316826, 300448, 144807, 144810, 144812, 284076, 144814, 144820, 374196, 284084, 292279, 284087, 144826, 144828, 144830, 144832, 144835, 144837, 38342, 144839, 144841, 144844, 144847, 144852, 144855, 103899, 300507, 333280, 226787, 218597, 292329, 300523, 259565, 300527, 308720, 259567, 292338, 226802, 316917, 292343, 308727, 300537, 316933, 316947, 308757, 308762, 284191, 284194, 284196, 235045, 284199, 284204, 284206, 284209, 284211, 194101, 284213, 316983, 194103, 284215, 308790, 284218, 226877, 292414, 284223, 284226, 284228, 292421, 243268, 284231, 226886, 128584, 284234, 276043, 317004, 366155, 284238, 226895, 284241, 194130, 284243, 300628, 284245, 292433, 284247, 317015, 276052, 276053, 235097, 243290, 284249, 300638, 284251, 284253, 284255, 284258, 243293, 292452, 292454, 284263, 177766, 284265, 292458, 284267, 292461, 284272, 284274, 284278, 292470, 276086, 292473, 284283, 276093, 284286, 292479, 284288, 276095, 284290, 325250, 284292, 292485, 276098, 292481, 284297, 317066, 284299, 317068, 284301, 276109, 284303, 284306, 276114, 284308, 284312, 284314, 284316, 276127, 284320, 284322, 284327, 284329, 317098, 284331, 276137, 284333, 284335, 276144, 284337, 284339, 300726, 284343, 284346, 284350, 358080, 276160, 284354, 358083, 284358, 276166, 358089, 284362, 276170, 284365, 276175, 284368, 276177, 284370, 358098, 284372, 317138, 284377, 284379, 284381, 284384, 358114, 284386, 358116, 276197, 317158, 358119, 284392, 325353, 358122, 284394, 284397, 358126, 284399, 358128, 276206, 358133, 358135, 276216, 358138, 300795, 358140, 284413, 358142, 358146, 284418, 317187, 317189, 317191, 284428, 300816, 300819, 317207, 284440, 300828, 300830, 276255, 300832, 325408, 300834, 317221, 227109, 358183, 186151, 276268, 300845, 243504, 300850, 284469, 276280, 325436, 358206, 276291, 366406, 276295, 300872, 292681, 153417, 358224, 284499, 276308, 284502, 317271, 178006, 276315, 292700, 317279, 284511, 227175, 292715, 300912, 292721, 284529, 300915, 284533, 292729, 317306, 284540, 292734, 325512, 169868, 276365, 317332, 358292, 284564, 284566, 350106, 284572, 276386, 284579, 276388, 358312, 317353, 284585, 276395, 292776, 292784, 276402, 358326, 161718, 358330, 276411, 276418, 276425, 301009, 301011, 301013, 292823, 358360, 301017, 301015, 292828, 276446, 153568, 276448, 276452, 292839, 276455, 292843, 276460, 292845, 178161, 227314, 276466, 325624, 276472, 317435, 276476, 276479, 276482, 276485, 317446, 276490, 292876, 317456, 276496, 317458, 178195, 243733, 243740, 317468, 317472, 325666, 243751, 292904, 276528, 243762, 309298, 325685, 325689, 235579, 325692, 276539, 178238, 235581, 276544, 284739, 325700, 243779, 292934, 243785, 276553, 350293, 350295, 309337, 227418, 350299, 194649, 194654, 227423, 350304, 178273, 309346, 350302, 194660, 350308, 309350, 309348, 292968, 309352, 309354, 227426, 227430, 276583, 350313, 301167, 350316, 350321, 276590, 284786, 276595, 350325, 252022, 227440, 350328, 292985, 301178, 350332, 292989, 301185, 292993, 350339, 317570, 317573, 350342, 350345, 350349, 301199, 317584, 325777, 350354, 350357, 350359, 350362, 350366, 276638, 153765, 284837, 350375, 350379, 350381, 350383, 129200, 350385, 350387, 350389, 350395, 350397, 350399, 227520, 350402, 227522, 301252, 350406, 227529, 301258, 309450, 276685, 309455, 276689, 309462, 301272, 276699, 194780, 309468, 309471, 301283, 317672, 317674, 325867, 243948, 194801, 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, 317833, 178572, 285070, 285077, 178583, 227738, 317853, 276896, 317858, 342434, 285093, 317864, 285098, 276907, 235955, 276917, 293304, 293307, 293314, 309707, 293325, 317910, 293336, 235996, 317917, 293343, 358880, 276961, 293346, 227810, 276964, 293352, 236013, 293364, 301562, 293370, 317951, 309764, 301575, 121352, 293387, 236043, 342541, 317963, 113167, 55822, 309779, 317971, 309781, 277011, 55837, 227877, 227879, 293417, 227882, 309804, 293421, 105007, 236082, 285236, 23094, 277054, 244288, 129603, 301636, 318020, 301639, 301643, 285265, 399955, 309844, 277080, 309849, 285277, 285282, 326244, 318055, 277100, 121458, 277106, 170618, 170619, 309885, 309888, 277122, 227975, 277128, 285320, 301706, 318092, 326285, 334476, 318094, 277136, 277139, 227992, 334488, 318108, 285340, 318110, 227998, 137889, 383658, 285357, 318128, 277170, 293555, 342707, 154292, 277173, 318132, 285368, 277177, 277181, 318144, 277187, 277191, 277194, 277196, 277201, 137946, 113378, 203491, 228069, 277223, 342760, 285417, 56041, 56043, 277232, 228081, 56059, 310015, 285441, 310020, 285448, 310029, 228113, 285459, 277273, 293659, 326430, 228128, 285474, 293666, 228135, 318248, 277291, 318253, 293677, 285489, 301876, 293685, 285494, 301880, 285499, 301884, 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, 310179, 277411, 293798, 293802, 236460, 277426, 293811, 276579, 293817, 293820, 203715, 326603, 276586, 293849, 293861, 228327, 228328, 318442, 228330, 228332, 326638, 277486, 318450, 293876, 293877, 285686, 302073, 121850, 293882, 302075, 285690, 244731, 293887, 277504, 277507, 277511, 293899, 277519, 293908, 302105, 293917, 293939, 318516, 277561, 277564, 310336, 7232, 293956, 277573, 228422, 293960, 310344, 277577, 277583, 203857, 293971, 310355, 310359, 236632, 277594, 138332, 277598, 203872, 277601, 285792, 310374, 203879, 310376, 228460, 318573, 203886, 187509, 285815, 367737, 285817, 302205, 285821, 392326, 285831, 253064, 294026, 302218, 285835, 162964, 384148, 187542, 302231, 285849, 302233, 285852, 302237, 285854, 285856, 302241, 285862, 277671, 302248, 64682, 277678, 294063, 294065, 302258, 277687, 294072, 318651, 294076, 277695, 318657, 244930, 302275, 130244, 302277, 228550, 302282, 310476, 302285, 302288, 310481, 302290, 203987, 302292, 302294, 310486, 302296, 384222, 310498, 285927, 318698, 302315, 228592, 294132, 138485, 228601, 204026, 228606, 204031, 64768, 310531, 138505, 228617, 318742, 204067, 277798, 130345, 277801, 113964, 285997, 277804, 285999, 277807, 113969, 277811, 318773, 318776, 277816, 286010, 277819, 294204, 417086, 277822, 286016, 302403, 294211, 384328, 277832, 277836, 294221, 294223, 326991, 277839, 277842, 277847, 277850, 179547, 277853, 146784, 277857, 302436, 277860, 294246, 327015, 310632, 327017, 351594, 277864, 277869, 277872, 351607, 310648, 277880, 310651, 277884, 277888, 310657, 351619, 294276, 310659, 327046, 277892, 253320, 310665, 318858, 277894, 277898, 277903, 310672, 351633, 277905, 277908, 277917, 310689, 277921, 130468, 228776, 277928, 277932, 310703, 277937, 310710, 130486, 310712, 277944, 310715, 277947, 302526, 228799, 277950, 277953, 302534, 310727, 245191, 64966, 277959, 277963, 302541, 277966, 302543, 310737, 277971, 228825, 163290, 277978, 310749, 277981, 277984, 310755, 277989, 277991, 187880, 277995, 310764, 286188, 278000, 228851, 310772, 278003, 278006, 40440, 212472, 278009, 40443, 286203, 40448, 228864, 286214, 228871, 302603, 302614, 302617, 286233, 302621, 286240, 146977, 187939, 40484, 294435, 40486, 286246, 294440, 40488, 294439, 294443, 40491, 294445, 196133, 310831, 245288, 286248, 40499, 40502, 212538, 40507, 40511, 40513, 228933, 327240, 40521, 286283, 40525, 40527, 212560, 400976, 228944, 40533, 147032, 40537, 40539, 40541, 278109, 40544, 40548, 40550, 40552, 286312, 40554, 286313, 310892, 40557, 40560, 188022, 122488, 294521, 343679, 294537, 310925, 286354, 278163, 302740, 122517, 278168, 179870, 327333, 229030, 212648, 278188, 302764, 278192, 319153, 278196, 302781, 319171, 302789, 294599, 278216, 294601, 302793, 343757, 212690, 319187, 286420, 278227, 229076, 286425, 319194, 278235, 301163, 229086, 278238, 286432, 294625, 294634, 302838, 319226, 286460, 278274, 302852, 278277, 302854, 294664, 311048, 352008, 319243, 311053, 302862, 319251, 294682, 278306, 188199, 294701, 278320, 319280, 319290, 229192, 302925, 188247, 280021, 188252, 237409, 229233, 294776, 360317, 294785, 327554, 40840, 294803, 40851, 188312, 294811, 237470, 319390, 40865, 319394, 294817, 294821, 311209, 180142, 343983, 294831, 188340, 40886, 319419, 294844, 294847, 393177, 294876, 294879, 294883, 294890, 311279, 278513, 237555, 311283, 278516, 278519, 237562 ]
d404824ed26aca71bf518966e786d15995c7003b
f86fbc83c5b08adba0f1bc8fb594a46daafc5507
/Milestone_Project1-3/Milestone_Project1-3/ViewController.swift
fb7a9079ea620c65ce2c57ce813c786558ed0fd7
[]
no_license
lgq2015/100_Days_of_Swift
35b657b1a297e1315120f208b1dfeadf68de7f53
3c48d8b329c2eac6d5b91aab51a78f052838daad
refs/heads/main
2023-08-24T04:19:26.881578
2021-11-05T17:22:54
2021-11-05T17:22:54
null
0
0
null
null
null
null
UTF-8
Swift
false
false
3,319
swift
// // ViewController.swift // Milestone_Project1-3 // // Created by out-usacheva-ei on 22.07.2021. // import UIKit class ViewController: UITableViewController { // Array of using countries var countries = [String]() var pictures = [String]() override func viewDidLoad() { super.viewDidLoad() title = "Countries" // Interface settings tableView.backgroundColor = UIColor.systemGray4 navigationController?.navigationBar.prefersLargeTitles = true navigationController?.navigationBar.tintColor = UIColor.black navigationController?.navigationBar.barTintColor = UIColor.systemGray4 navigationController?.navigationBar.titleTextAttributes = [.foregroundColor: UIColor.blue] // Fill the array of countries countries += ["estonia", "france", "germany", "ireland", "italy", "monaco", "nigeria", "poland", "russia", "spain", "uk", "us"] // Loading images from file system let fm = FileManager.default let path = Bundle.main.resourcePath! // let items = try! fm.contentsOfDirectory(atPath: path) // Fill the array of file names for country in countries { pictures.append("\(path)/\(country).png") } // print(path) print(pictures) } // For separating cells. Separated cells by sections. override func numberOfSections(in tableView: UITableView) -> Int { return countries.count } // Method for set number of rows in section. override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return 1 } // For separating cells. Set distance between sections. override func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { return CGFloat(10) } // For set separator of sections color. override func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { let headerView = UIView(frame: CGRect(x: 0, y: 0, width: tableView.bounds.size.width, height: 30)) headerView.backgroundColor = UIColor.clear return headerView } // Setting cells and dequeuing cells (delete cells from queue) for optimization. override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "Country", for: indexPath) cell.imageView?.image = UIImage(named: countries[indexPath.section]) cell.textLabel?.text = countries[indexPath.section].uppercased() cell.textLabel?.textColor = UIColor.blue cell.backgroundColor = UIColor.clear return cell } // Method for set action for pushed cell override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { // Loading "Detail View Controller" if let vc = storyboard?.instantiateViewController(identifier: "Detail") as? DetailViewController { vc.selectedFlag = countries[indexPath.section] vc.pathToImage = pictures[indexPath.section] // Show new view navigationController?.pushViewController(vc, animated: true) } } }
[ -1 ]
43a7e72611c15497c93b54617866de43dad5acde
acf828de5c255529ca7dd1445dd83f1f2788d519
/Sources/kubrick/MediaDevices/MediaDeviceInput.swift
54423025396e3220acd985c00edd2baf61811cd7
[ "MIT" ]
permissive
krad/kubrick
136d54c4c2dc8406aa46780284a0e3514d559825
41b1abcb79d58c9e70379bb314187c20ebabcf0f
refs/heads/master
2021-04-27T05:15:16.107673
2018-04-15T03:26:10
2018-04-15T03:26:10
122,594,113
4
0
null
null
null
null
UTF-8
Swift
false
false
1,523
swift
public protocol MediaDeviceInput { var hashValue: Int { get } static func makeInput(device: Source) throws -> MediaDeviceInput } internal typealias MediaDeviceInputCreateCallback = (MediaDeviceInput) -> Void internal typealias MakeMediaDeviceInput = (Source, MediaDeviceInputCreateCallback) throws -> MediaDeviceInput public enum MediaDeviceInputError: Error { case couldNotCreateInput } func ==(lhs: MediaDeviceInput, rhs: MediaDeviceInput) -> Bool { return lhs.hashValue == rhs.hashValue } #if os(macOS) || os(iOS) import AVFoundation var makeInput: MakeMediaDeviceInput = { src, onCreate in let input = try AVCaptureInput.makeInput(device: src) onCreate(input) return input } extension MediaDevice { public mutating func createInput(onCreate: MediaDeviceInputClosure) { do { self.input = try kubrick.makeInput(self.source, onCreate) } catch { } } } extension AVCaptureInput: MediaDeviceInput { static public func makeInput(device: Source) throws -> MediaDeviceInput { if let dev = device as? AVCaptureDevice { return try AVCaptureDeviceInput(device: dev) } #if os(macOS) if let dev = device as? DisplaySource { return AVCaptureScreenInput(displayID: dev.displayID) } #endif throw MediaDeviceInputError.couldNotCreateInput } } #endif
[ -1 ]
6377fb2f80f81545cd6d8ef2cd05cc33a0ff95ad
590e6f0b68cf735d9e06a67b6367cab1b42a185c
/HW4/hustle-mode/hustle-mode/ViewController.swift
6943a41484342547e03fa0c9990451be07d9103f
[]
no_license
sheepy23/MAS.500
01e945dc77100bf5261884997ca98bfa38e71160
acf5b9f6aca63f65b4732ff52f80e50fc82b1757
refs/heads/master
2021-08-23T23:46:37.248332
2017-12-07T04:17:37
2017-12-07T04:17:37
110,900,677
0
3
null
null
null
null
UTF-8
Swift
false
false
1,310
swift
// // ViewController.swift // hustle-mode // // Created by Yangyang Yang on 12/2/17. // Copyright © 2017 Yangyang Yang. All rights reserved. // import UIKit import AVFoundation class ViewController: UIViewController { @IBOutlet weak var darkBlueBG: UIImageView! @IBOutlet weak var powerBtn: UIButton! @IBOutlet weak var cloudHolder: UIView! @IBOutlet weak var rocket: UIImageView! @IBOutlet weak var hustleLbl: UILabel! var player: AVAudioPlayer! override func viewDidLoad() { super.viewDidLoad() let path = Bundle.main.path(forResource:"hustle-on", ofType:"wav")! let url = URL(fileURLWithPath:path) do{ player = try AVAudioPlayer(contentsOf:url) player.prepareToPlay() } catch let error as NSError { print(error.description) } } @IBAction func powerBtnPressed(_ sender: Any) { cloudHolder.isHidden = false darkBlueBG.isHidden = true powerBtn.isHidden = true player.play() UIView.animate(withDuration:2.3, animations: { self.rocket.frame = CGRect(x:0, y:140, width: 375, height: 402) }) {(finished) in self.hustleLbl.isHidden = false } } }
[ 302289, 310658, 305665 ]
07fb4f763248eee6507c58e9dbbef721e44c6fc2
bcafd89a9047f4167a07117704d2b679d7aadd20
/TestSwiftUI/TestSwiftUI/Other/LiveViewController.swift
d04b6e12dcb9244f906c500b8b94c83a7b4e4f74
[]
no_license
18710102619/TestSwiftUI
49bf251d104e64287291c7e736f761c92e8d9a3a
f713b1d13fbaa7d58aba97c103300417f1a28747
refs/heads/master
2023-03-25T04:59:47.665948
2021-03-23T02:55:52
2021-03-23T02:55:52
348,998,048
0
0
null
null
null
null
UTF-8
Swift
false
false
645
swift
// // LiveViewController.swift // TestSwiftUI // // Created by 张玲玉 on 2021/3/18. // import UIKit class LiveViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. } /* // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepare(for segue: UIStoryboardSegue, sender: Any?) { // Get the new view controller using segue.destination. // Pass the selected object to the new view controller. } */ }
[ -1 ]
7faf1c9acc682c0932c9d7b607ca0cf3100a2114
bc7a0e49adea27b31b39b35f5fadc4835a4950ba
/Strings/UI/StringsList/StringsListWindowController.swift
b09cd436fa6dc325dd5c536c8146f7405ddee528
[]
no_license
pillboxer/Strings
ea5c4cc393204c9eee2fa7ebb018f7a43586f092
7440f2a8a98f10097d5300dd1b66286d2b1b70d2
refs/heads/master
2023-01-10T19:38:59.578067
2020-11-11T09:16:33
2020-11-11T09:16:33
244,746,113
0
0
null
null
null
null
UTF-8
Swift
false
false
22,553
swift
// // StringsListWindowController.swift // Strings // // Created by Henry Cooper on 03/03/2020. // Copyright © 2020 Henry Cooper. All rights reserved. // import Cocoa import UIHelper import StringEditorFramework class StringsListWindowController: NSWindowController { // MARK: - Action Methods @IBAction func addButtonPressed(_ sender: Any) { let newKey = newKeyTextField.stringValue.trimmingCharacters(in: .whitespaces) let newValue = newValueTextField.string.trimmingCharacters(in: .whitespaces) addToKeysAndValues(key: newKey, value: newValue) } @IBAction func ctaButtonPressed(_ sender: Any) { guard !commitMessageTextField.stringValue.isEmpty else { commitMessageTextField.layer?.borderColor = NSColor.red.cgColor commitMessageTextField.layer?.borderWidth = 1.0 return } commitMessageTextField.layer?.borderWidth = 0.0 enableInterface(false) // Manually disable so we can't spam ctaButton.isEnabled = false manager.addToStrings(keysAndValues: newKeysAndValuesToAdd, editedStrings: editedStrings, commitMessage: commitMessage) { [weak self] (error) in DispatchQueue.main.async { self?.reset(error: error) } } } @IBAction func environmentButtonPressed(_ sender: Any) { shouldContinueAfterCheckingForUncommittedChanges { (shouldContinue) in if shouldContinue { Environment.setEnvironment(!Environment.isDev) BitbucketManager.shared.load { (error) in DispatchQueue.main.async { self.spinner.isHidden = true if let error = error { self.showErrorAlert(error) } else { self.reloadCurrentKeysAndValues(afterPushing: false) self.setTitle(string: self.manager.latestMessage) } } } } else { return } } } @IBAction func filterButtonPressed(_ sender: NSButton) { if sender.state == .off { cancelFilter() return } filterEnabled = true NSAlert.showSingleTextFieldAlert(window: window, title: "Filter", textFieldPlaceholder: "Key Or Value", returnButtonTitle: "Filter") { (filterValue) in if let filterValue = filterValue { self.topTableView.scrollRowToVisible(0) self.filterKeysAndValues(text: filterValue) } else { self.cancelFilter() } } } @IBAction func radioButtonSelected(_ sender: NSButton) { guard sender != selectedButton else { return } let newPlatform: Platform = (sender == iosButton) ? .ios : .android let oldPlatformButton = (sender == iosButton) ? androidButton : iosButton shouldContinueAfterCheckingForUncommittedChanges { (shouldContinue) in if shouldContinue { self.editedKeysAndValues.removeAll() BitbucketManager.shared.changePlatformTo(newPlatform) { (error) in DispatchQueue.main.async { self.cancelFilter() self.spinner.isHidden = true if let error = error { self.showErrorAlert(error) oldPlatformButton?.state = .on } else { self.selectedButton = sender self.configurePopUpButtonConstraintsForPlatform(newPlatform) self.reloadCurrentKeysAndValues(afterPushing: false) self.setTitle(string: self.manager.latestMessage) } } } } else { oldPlatformButton?.state = .on } } } // MARK: - IBOutlets @IBOutlet weak var topTableView: NSTableView! @IBOutlet weak var newKeyTextField: NSTextField! @IBOutlet weak var newValueTextField: PlaceholderTextView! @IBOutlet weak var commitMessageTextField: NSTextField! @IBOutlet weak var addButton: NSButton! @IBOutlet weak var bottomTableView: UIHelperTableView! @IBOutlet weak var ctaButton: NSButton! @IBOutlet weak var loadingLabel: NSTextField! @IBOutlet weak var spinner: NSProgressIndicator! @IBOutlet weak var androidButton: NSButton! @IBOutlet weak var iosButton: NSButton! @IBOutlet weak var newValueTextFieldToLanguageConstraint: NSLayoutConstraint! @IBOutlet weak var newValueTextFieldToSuperviewConstraint: NSLayoutConstraint! @IBOutlet var newKeyTextFieldToBottomTableViewConstraint: NSLayoutConstraint! @IBOutlet var addButtonToBottomTableViewConstraint: NSLayoutConstraint! @IBOutlet var newValueTextFieldToBottomTableViewConstraint: NSLayoutConstraint! @IBOutlet var languagePopUpToBottomTableViewConstraint: NSLayoutConstraint! @IBOutlet var newValueTextFieldHeightConstraint: NSLayoutConstraint! @IBOutlet var bottomTableHeightConstraint: NSLayoutConstraint! @IBOutlet weak var languagePopUp: NSPopUpButton! @IBOutlet weak var environmentButton: NSButton! @IBOutlet weak var filterButton: NSButton! // MARK: - Private private let manager = BitbucketManager.shared private var originalKeysAndValues: [KeyAndValue]? private var currentKeysAndValues: [KeyAndValue]? private var filteredKeysAndValues: [KeyAndValue]? private var editedKeysAndValues = [Int: KeyAndValue]() { didSet { updateCurrentKeysAndValues() } } private var filterEnabled = false private var newKeysAndValuesToAdd = [KeyAndValue]() private var selectedButton: NSButton? private var editedStrings: [String: KeyAndValue] { var dict = [String : KeyAndValue]() for (row, keyAndValue) in editedKeysAndValues { if let currentKey = currentKeyAndValueAtRow(row)?.key { dict[currentKey] = keyAndValue } } return dict } private var selectedLanguage: KeyAndValue.Language { if let title = languagePopUp.selectedItem?.title, let language = KeyAndValue.Language(title: title) { return language } return .en } private var constraintsToAnimate: [NSLayoutConstraint] { return [languagePopUpToBottomTableViewConstraint, addButtonToBottomTableViewConstraint, newKeyTextFieldToBottomTableViewConstraint, newValueTextFieldToBottomTableViewConstraint] } // MARK: - Exposed Properties override var windowNibName: NSNib.Name? { return classNibName } // MARK: - Initialisation init() { super.init(window: nil) } required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } // MARK: - Life Cycle override func windowDidLoad() { super.windowDidLoad() newValueTextField.placeholderDelegate = self bottomTableView.deleteDelegate = self originalKeysAndValues = manager.displayTuples currentKeysAndValues = originalKeysAndValues topTableView.reloadData() manager.delegate = self configureUI() } } // MARK: - Keys And Values extension StringsListWindowController { private func addToKeysAndValues(key: String, value: String) { let keys = newKeysAndValuesToAdd.map() { $0.key } let newKeyAndValue = KeyAndValue(key: key, value: value, language: selectedLanguage) let alreadyInTopTable = (currentKeysAndValues?.contains() { $0.key == key }) ?? false if keys.contains(key) || alreadyInTopTable { let message = alreadyInTopTable ? "\(key) already in strings above!" : "\(key) already added below!" loadingLabel.isHidden = false loadingLabel.stringValue = message return } newKeysAndValuesToAdd.insert(newKeyAndValue, at: 0) resetTextFields() bottomTableView.reloadData() } private func topTableViewKeyAndValueAtRow(_ row: Int) -> KeyAndValue? { if let _ = filteredKeysAndValues { return filteredKeyAndValueAtRow(row) } else if let _ = currentKeysAndValues { return currentKeyAndValueAtRow(row) } return nil } private func currentKeyAndValueAtRow(_ row: Int) -> KeyAndValue? { return currentKeysAndValues?[row] } private func filteredKeyAndValueAtRow(_ row: Int) -> KeyAndValue? { return filteredKeysAndValues?[row] } private func correctKeysAndValuesForTableVew(_ tableView: NSTableView) -> [KeyAndValue]? { if tableView == self.topTableView { return correctKeysAndValuesForTopTableView } else { return newKeysAndValuesToAdd.sorted() { $0.key < $1.key } } } private var correctKeysAndValuesForTopTableView: [KeyAndValue]? { return filteredKeysAndValues ?? currentKeysAndValues } private var commitMessage: String { return commitMessageTextField.stringValue } private func filterKeysAndValues(text: String) { filteredKeysAndValues = currentKeysAndValues?.compactMap() { keyAndValue in if keyAndValue.key.localizedCaseInsensitiveContains(text) || keyAndValue.value.localizedCaseInsensitiveContains(text) { return keyAndValue } else { return nil } } topTableView.reloadData() } private func updateCurrentKeysAndValues() { for (row, keyAndValue) in editedKeysAndValues { let newKeyAndValue = KeyAndValue(key: keyAndValue.key, value: keyAndValue.value, language: keyAndValue.language) currentKeysAndValues?[row] = newKeyAndValue } } } // MARK: - UI extension StringsListWindowController { private func configureUI() { setTitle(string: manager.latestMessage) resetTextFields() configureButtonStates() window?.center() let platform = UserDefaults.selectedPlatform configurePopUpButtonConstraintsForPlatform(platform) selectedButton = (platform == .ios) ? iosButton : androidButton selectedButton?.state = .on configurePopUp() configureEnvironmentButton() } private func configurePopUpButtonConstraintsForPlatform(_ platform: Platform) { let isIos = platform == .ios newValueTextFieldToLanguageConstraint.priority = isIos ? .defaultLow : .defaultHigh newValueTextFieldToSuperviewConstraint.priority = isIos ? .defaultHigh : .defaultLow languagePopUp.isHidden = platform == .ios } private func reset(error: StringEditError?) { // The spinner should always hide spinner.isHidden = true if let error = error { loadingLabel.isHidden = true NSAlert.showSimpleAlert(window: window, title: "Error", message: error.localizedDescription, completion: nil) } else { loadingLabel.stringValue = "Upload successful" newKeysAndValuesToAdd.removeAll() editedKeysAndValues.removeAll() bottomTableView.reloadData() let string = commitMessage.isEmpty ? "Edited With Bitbucket" : commitMessage setTitle(string: string) reloadCurrentKeysAndValues(afterPushing: true) } resetTextFields() } private func setTitle(string: String?) { if let string = string { window?.title = "Commit: \(string)" } } private func cancelFilter() { filteredKeysAndValues = nil topTableView.reloadData() topTableView.scrollRowToVisible(0) filterButton.state = .off } private func configurePopUp() { for language in KeyAndValue.Language.allCases { languagePopUp.addItem(withTitle: language.rawValue.uppercased()) } } private func reloadCurrentKeysAndValues(afterPushing: Bool) { originalKeysAndValues = manager.displayTuples currentKeysAndValues = originalKeysAndValues cancelFilter() loadingLabel.isHidden = !afterPushing configureButtonStates() commitMessageTextField.stringValue = "" configureEnvironmentButton() } private func resetTextFields() { newValueTextField.string = "" newKeyTextField.stringValue = "" newValueTextField.placeholderAttributedString = NSMutableAttributedString(string: "New Value") enableInterface(true) newKeyTextField.becomeFirstResponder() } private func enableInterface(_ enabled: Bool) { newKeyTextField.isEnabled = enabled newValueTextField.isEditable = enabled configureButtonStates() } private func configureButtonStates() { addButton.isEnabled = !newKeyTextField.stringValue.isEmpty && !newValueTextField.string.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty ctaButton.isEnabled = !newKeysAndValuesToAdd.isEmpty || !editedStrings.isEmpty } private func showErrorAlert(_ error: RequestError) { NSAlert.showSimpleAlert(window: self.window, isError: true, title: "Error", message: error.localizedDescription) { self.loadingLabel.isHidden = true } } private func configureEnvironmentButton() { if Environment.isDev { environmentButton.image = NSImage(named: NSImage.Name("NSStatusPartiallyAvailable")) } else { environmentButton.image = NSImage(named: NSImage.Name("NSStatusUnavailable")) } } private func shouldContinueAfterCheckingForUncommittedChanges(completion: @escaping (Bool) -> Void) { guard !editedKeysAndValues.isEmpty else { completion(true) return } let changeOrChanges = (editedKeysAndValues.count == 1) ? "change" : "changes" NSAlert.showDualButtonAlert(window: window, title: "Unsaved Changes", message: "You currently have \(editedKeysAndValues.count) unsaved \(changeOrChanges). Are you sure you wish to continue?", returnButtonTitle: "Discard My Changes And Continue") { response in completion(response == .alertFirstButtonReturn) } } } // MARK: - Table View Data Source extension StringsListWindowController: NSTableViewDataSource { func numberOfRows(in tableView: NSTableView) -> Int { if tableView == self.topTableView { return numberOfRowsForCurrentOrFilteredTableView } else if tableView == bottomTableView { return numberOfRowsForNewKeysAndValuesTableView } return 0 } private var numberOfRowsForCurrentOrFilteredTableView: Int { if let _ = filteredKeysAndValues { return filteredKeysAndValues?.count ?? 0 } else { return currentKeysAndValues?.count ?? 0 } } private var numberOfRowsForNewKeysAndValuesTableView: Int { return newKeysAndValuesToAdd.count } } // MARK: - Table View Delegate extension StringsListWindowController: NSTableViewDelegate, UIHelperTableViewDelegate { func tableView(_ tableView: NSTableView, viewFor tableColumn: NSTableColumn?, row: Int) -> NSView? { guard let column = tableColumn, let keysAndValues = correctKeysAndValuesForTableVew(tableView) else { return nil } let keyAndValue = keysAndValues[row] let key = keyAndValue.key let value = keyAndValue.value let identifier: String let text: String switch column.identifier { case .key: identifier = "KeyView" text = key case .value: identifier = "ValueView" text = value default: identifier = "" text = "" } if let cell = tableView.makeView(withIdentifier: NSUserInterfaceItemIdentifier(identifier), owner: nil) as? NSTableCellView { let rowView = tableView.rowView(atRow: row, makeIfNecessary: false) if tableView == topTableView { cell.textField?.textColor = keyAndValue.isSeparator ? .white : .labelColor let currentBackgroundColor = rowView?.backgroundColor ?? .clear rowView?.backgroundColor = keyAndValue.isSeparator ? .black : currentBackgroundColor } else { cell.textField?.isEditable = false } cell.textField?.stringValue = text cell.textField?.target = self cell.textField?.action = #selector(edit(_:)) cell.textField?.delegate = self return cell } return nil } func uiHelperTableViewShouldDeleteRow(tableView: UIHelperTableView, rowToDelete: Int) { newKeysAndValuesToAdd.remove(at: rowToDelete) bottomTableView.reloadData() configureButtonStates() } } extension StringsListWindowController: NSTextFieldDelegate, NSTextViewDelegate, PlaceholderTextViewDelegate { func controlTextDidChange(_ obj: Notification) { loadingLabel.isHidden = true configureButtonStates() } func textDidChange(_ notification: Notification) { loadingLabel.isHidden = true configureButtonStates() } func controlTextDidEndEditing(_ obj: Notification) { if let object = obj.object as? NSTextField, object == newKeyTextField, newKeyTextField.stringValue.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty { newKeyTextField.stringValue = "" } } func placeholderTextViewFocusChanged(_ placeholderTextView: PlaceholderTextView, inFocus: Bool) { NSAnimationContext.runAnimationGroup() { _ in NSAnimationContext.current.duration = 0.4 NSAnimationContext.current.allowsImplicitAnimation = true bottomTableHeightConstraint.constant -= inFocus ? 100 : -100 self.window?.layoutIfNeeded() } for constraint in constraintsToAnimate { constraint.isActive = !inFocus } newValueTextFieldHeightConstraint.constant += inFocus ? 100.0 : -100.0 } @objc private func edit(_ sender: NSTextField) { let text = sender.stringValue.trimmingCharacters(in: .whitespaces) // 'Updating' means to change the text of a specific row. There are potentially two rows to update, depending on whether we are filtering or not. let visibleRow = topTableView.row(for: sender) guard visibleRow != -1, let currentKeyAndValueToUpdate = topTableViewKeyAndValueAtRow(visibleRow), let rowToIndex = currentKeysAndValues?.firstIndex(of: currentKeyAndValueToUpdate), let existingKeyAndValue = currentKeysAndValues?[rowToIndex], let originalKeyAndValue = originalKeysAndValues?[rowToIndex] else { return } // Is the string the same? let newKey = sender.isKeyTextField ? text : existingKeyAndValue.key let newValue = sender.isKeyTextField ? existingKeyAndValue.value : text let newKeyAndValue = KeyAndValue(key: newKey, value: newValue, language: existingKeyAndValue.language) let newKeyAlreadyExists = currentKeysAndValues?.contains() { newKey == $0.key } ?? false if sender.isKeyTextField && newKeyAlreadyExists { NSAlert.showSimpleAlert(window: window, isError: true, title: "Error", message: "\(newKey) already exists in the JSON. You'll need to edit that string") { sender.stringValue = existingKeyAndValue.key } return } if newKeyAndValue == originalKeyAndValue { editedKeysAndValues.removeValue(forKey: rowToIndex) currentKeysAndValues?[rowToIndex] = originalKeyAndValue filteredKeysAndValues?[visibleRow] = originalKeyAndValue configureButtonStates() return } let editingContentVersion = (sender.isKeyTextField && existingKeyAndValue.key.isContentVersion) // Has the string been left empty? let shouldRefill = text.isEmpty || editingContentVersion if shouldRefill { sender.stringValue = existingKeyAndValue.key return } editedKeysAndValues[rowToIndex] = newKeyAndValue filteredKeysAndValues?[visibleRow] = newKeyAndValue configureButtonStates() } } extension StringsListWindowController: BitbucketManagerDelegate { func bitbucketManagerLoadingStateDidChange(_ newState: LoadingState) { DispatchQueue.main.async { self.updateLabelForLoadingState(newState) } } private func updateLabelForLoadingState(_ state: LoadingState) { loadingLabel.isHidden = false spinner.isHidden = false spinner.startAnimation(nil) switch state { case .fetching: loadingLabel.stringValue = "Fetching latest commit" case .pulling: loadingLabel.stringValue = "Pulling latest commit" case .pushing: loadingLabel.stringValue = "Pushing your changes" case .error(let error): loadingLabel.stringValue = "Error received: \(error.localizedDescription)" default: return } } } private extension String { var isContentVersion: Bool { return self == "content_version" } } private extension NSUserInterfaceItemIdentifier { static var key: NSUserInterfaceItemIdentifier { return NSUserInterfaceItemIdentifier("KeyColumn") } static var value: NSUserInterfaceItemIdentifier { return NSUserInterfaceItemIdentifier("ValueColumn") } }
[ -1 ]
11309ef7e80cedf70e359d56ce74c01775df7c58
04efd498daa888884b4091251b7fb636179f0562
/Tests/SwiftSyntaxParserTest/SyntaxTests.swift
b86e0e0aa5b4bbb1ae7acafbc9c7859ba582c9af
[ "Apache-2.0", "Swift-exception", "LicenseRef-scancode-unknown-license-reference" ]
permissive
kevinmbeaulieu/swift-syntax
023cd610ce9597e685d9d58c46703559a82e6128
e6e1e3e7aa5af9fe8b6b1e79ff4d68ab78983a29
refs/heads/main
2022-11-22T09:59:29.317676
2022-06-16T09:32:15
2022-06-16T09:32:15
282,011,928
0
0
Apache-2.0
2020-07-23T17:14:19
2020-07-23T17:14:19
null
UTF-8
Swift
false
false
6,158
swift
import XCTest import SwiftSyntax import SwiftSyntaxParser public class SyntaxTests: XCTestCase { public func testSyntaxAPI() { let source = "struct A { func f() {} }" let tree = try! SyntaxParser.parse(source: source) XCTAssertEqual("\(tree.firstToken!)", "struct ") XCTAssertEqual("\(tree.firstToken!.nextToken!)", "A ") let funcKW = tree.firstToken!.nextToken!.nextToken!.nextToken! XCTAssertEqual("\(funcKW)", "func ") XCTAssertEqual("\(funcKW.nextToken!.nextToken!.nextToken!.nextToken!.nextToken!.nextToken!)", "}") XCTAssertEqual(tree.lastToken!.tokenKind, .eof) XCTAssertEqual("\(funcKW.parent!.lastToken!)", "} ") XCTAssertEqual("\(funcKW.nextToken!.previousToken!)", "func ") XCTAssertEqual("\(funcKW.previousToken!)", "{ ") let toks = Array(funcKW.parent!.tokens) XCTAssertEqual(toks.count, 6) guard toks.count == 6 else { return } XCTAssertEqual("\(toks[0])", "func ") XCTAssertEqual("\(toks[1])", "f") XCTAssertEqual("\(toks[2])", "(") XCTAssertEqual("\(toks[3])", ") ") XCTAssertEqual("\(toks[4])", "{") XCTAssertEqual("\(toks[5])", "} ") let rtoks = Array(funcKW.parent!.tokens.reversed()) XCTAssertEqual(rtoks.count, 6) guard rtoks.count == 6 else { return } XCTAssertEqual("\(rtoks[5])", "func ") XCTAssertEqual("\(rtoks[4])", "f") XCTAssertEqual("\(rtoks[3])", "(") XCTAssertEqual("\(rtoks[2])", ") ") XCTAssertEqual("\(rtoks[1])", "{") XCTAssertEqual("\(rtoks[0])", "} ") XCTAssertEqual(toks[0], rtoks[5]) XCTAssertEqual(toks[1], rtoks[4]) XCTAssertEqual(toks[2], rtoks[3]) XCTAssertEqual(toks[3], rtoks[2]) XCTAssertEqual(toks[4], rtoks[1]) XCTAssertEqual(toks[5], rtoks[0]) let tokset = Set(toks+rtoks) XCTAssertEqual(tokset.count, 6) XCTAssertEqual(toks[0].id, rtoks[5].id) XCTAssertEqual(toks[1].id, rtoks[4].id) XCTAssertEqual(toks[2].id, rtoks[3].id) XCTAssertEqual(toks[3].id, rtoks[2].id) XCTAssertEqual(toks[4].id, rtoks[1].id) XCTAssertEqual(toks[5].id, rtoks[0].id) } public func testPositions() { func testFuncKw(_ funcKW: TokenSyntax) { XCTAssertEqual("\(funcKW)", " func ") XCTAssertEqual(funcKW.position, AbsolutePosition(utf8Offset: 0)) XCTAssertEqual(funcKW.positionAfterSkippingLeadingTrivia, AbsolutePosition(utf8Offset: 2)) XCTAssertEqual(funcKW.endPositionBeforeTrailingTrivia, AbsolutePosition(utf8Offset: 6)) XCTAssertEqual(funcKW.endPosition, AbsolutePosition(utf8Offset: 7)) XCTAssertEqual(funcKW.contentLength, SourceLength(utf8Length: 4)) } do { let source = " func f() {}" let tree = try! SyntaxParser.parse(source: source) let funcKW = tree.firstToken! testFuncKw(funcKW) } do { let leading = Trivia(pieces: [ .spaces(2) ]) let trailing = Trivia(pieces: [ .spaces(1) ]) let funcKW = SyntaxFactory.makeFuncKeyword( leadingTrivia: leading, trailingTrivia: trailing) testFuncKw(funcKW) } } public func testCasting() { let integerExpr = IntegerLiteralExprSyntax { $0.useDigits(SyntaxFactory.makeIntegerLiteral("1", trailingTrivia: .spaces(1))) } let expr = ExprSyntax(integerExpr) let node = Syntax(expr) XCTAssertTrue(expr.is(IntegerLiteralExprSyntax.self)) XCTAssertTrue(node.is(IntegerLiteralExprSyntax.self)) XCTAssertTrue(node.as(ExprSyntax.self)!.is(IntegerLiteralExprSyntax.self)) XCTAssertTrue(node.isProtocol(ExprSyntaxProtocol.self)) XCTAssertTrue(node.asProtocol(ExprSyntaxProtocol.self) is IntegerLiteralExprSyntax) XCTAssertTrue(expr.asProtocol(ExprSyntaxProtocol.self) is IntegerLiteralExprSyntax) XCTAssertTrue(expr.asProtocol(ExprSyntaxProtocol.self) as? IntegerLiteralExprSyntax == integerExpr) XCTAssertFalse(node.isProtocol(BracedSyntax.self)) XCTAssertNil(node.asProtocol(BracedSyntax.self)) XCTAssertFalse(expr.isProtocol(BracedSyntax.self)) XCTAssertNil(expr.asProtocol(BracedSyntax.self)) let classDecl = SyntaxFactory.makeCodeBlock( leftBrace: SyntaxFactory.makeToken(.leftBrace, presence: .present), statements: SyntaxFactory.makeCodeBlockItemList([]), rightBrace: SyntaxFactory.makeToken(.rightBrace, presence: .present) ) XCTAssertTrue(classDecl.isProtocol(BracedSyntax.self)) XCTAssertNotNil(classDecl.asProtocol(BracedSyntax.self)) let optNode: Syntax? = node switch optNode?.as(SyntaxEnum.self) { case .integerLiteralExpr: break default: XCTFail("failed to convert to SyntaxEnum") } XCTAssertNil(ExprSyntax(nil as IntegerLiteralExprSyntax?)) XCTAssertEqual(ExprSyntax(integerExpr).as(IntegerLiteralExprSyntax.self)!, integerExpr) } public func testNodeType() { let integerExpr = IntegerLiteralExprSyntax { $0.useDigits(SyntaxFactory.makeIntegerLiteral("1", trailingTrivia: .spaces(1))) } let expr = ExprSyntax(integerExpr) let node = Syntax(expr) XCTAssertTrue(integerExpr.syntaxNodeType == expr.syntaxNodeType) XCTAssertTrue(integerExpr.syntaxNodeType == node.syntaxNodeType) XCTAssertEqual("\(integerExpr.syntaxNodeType)", "IntegerLiteralExprSyntax") } public func testConstructFromSyntaxProtocol() { let integerExpr = IntegerLiteralExprSyntax { $0.useDigits(SyntaxFactory.makeIntegerLiteral("1", trailingTrivia: .spaces(1))) } XCTAssertEqual(Syntax(integerExpr), Syntax(fromProtocol: integerExpr as SyntaxProtocol)) XCTAssertEqual(Syntax(integerExpr), Syntax(fromProtocol: integerExpr as ExprSyntaxProtocol)) } public func testRunParserOnForeignString() { // Store the source code in a foreign non-UTF-8 string. // If SwiftSyntax fails to convert it to a native UTF-8 string, internal assertions should fail. let sourceNsString = "var 🎉 = 2" as NSString _ = try? SyntaxParser.parse(source: sourceNsString as String) } public func testParseFileWithNullCharacter() throws { let source = "var x = 1\0\nvar y = 2" let tree = try SyntaxParser.parse(source: source) XCTAssertEqual(tree.description, source) } }
[ -1 ]
2d6125f81bdd592fe55f248697fd061343eee590
61922e2702d3cf17ebc17b59d37b347d0f7cd1e0
/00657023/AppDelegate.swift
c71ae8fe42099537fbec4af75452570e4dd90966
[]
no_license
Dunja0218/00657023
c2ce577bea934eea92781917283d91f07504057e
dcefb1b1b57c5c39af31603550cc2b081205a1f2
refs/heads/master
2020-09-16T07:34:51.546286
2019-11-24T05:49:34
2019-11-24T05:49:34
223,698,950
0
0
null
null
null
null
UTF-8
Swift
false
false
1,408
swift
// // AppDelegate.swift // 00657023 // // Created by User10 on 2019/11/20. // Copyright © 2019 Starmy. 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, 286831, 368752, 286844, 417924, 262283, 286879, 286888, 377012, 327871, 180416, 377036, 180431, 377046, 377060, 327914, 205036, 393456, 393460, 336123, 418043, 385280, 336128, 262404, 180490, 368911, 262416, 262422, 262436, 336180, 262454, 393538, 262472, 344403, 213332, 65880, 262496, 418144, 262499, 213352, 246123, 262507, 262510, 213372, 385419, 393612, 262550, 262552, 385440, 385443, 385451, 262573, 393647, 385458, 262586, 344511, 262592, 360916, 369118, 328177, 328179, 328182, 328189, 328192, 164361, 328206, 410128, 393747, 254490, 188958, 385570, 377383, 197159, 352821, 188987, 418363, 369223, 385609, 385616, 352856, 352864, 369253, 262760, 352874, 254587, 377472, 336512, 148105, 352918, 98968, 344744, 361129, 336555, 385713, 434867, 164534, 336567, 328378, 164538, 328386, 352968, 352971, 418507, 352973, 385742, 385748, 361179, 189153, 369381, 361195, 418553, 344831, 336643, 344835, 344841, 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, 222128, 345035, 386003, 345043, 386011, 386018, 386022, 435187, 328702, 328714, 361489, 386069, 336921, 386073, 336925, 345118, 377887, 345133, 345138, 386101, 197707, 189520, 345169, 156761, 361567, 148578, 345199, 386167, 361593, 410745, 214149, 345222, 386186, 337047, 345246, 214175, 337071, 337075, 345267, 386258, 328924, 222437, 328941, 386285, 345376, 345379, 410917, 337205, 345399, 378169, 369978, 337222, 337229, 337234, 263508, 402791, 345448, 271730, 378227, 181638, 353673, 181643, 181649, 181654, 230809, 181670, 181673, 337329, 181681, 181684, 181690, 361917, 181696, 337349, 181703, 337365, 271839, 329191, 361960, 329194, 116210, 337398, 337415, 329226, 419339, 419343, 419349, 345625, 419355, 370205, 419359, 419362, 394786, 370213, 419368, 419376, 206395, 214593, 419400, 419402, 353867, 419406, 419410, 345701, 394853, 222830, 370297, 353919, 403075, 198280, 403091, 345749, 345757, 345762, 419491, 345765, 419497, 419501, 370350, 419506, 419509, 337592, 419512, 419517, 337599, 419527, 419530, 419535, 272081, 394966, 419542, 419544, 181977, 345818, 419547, 419550, 419559, 337642, 419563, 337645, 370415, 141051, 337659, 337668, 395021, 362255, 321299, 116509, 345887, 378663, 345905, 354106, 354111, 247617, 354117, 370503, 329544, 370509, 354130, 247637, 337750, 313180, 354142, 345964, 345967, 345970, 345974, 403320, 354172, 247691, 337808, 247700, 329623, 436126, 436132, 337833, 362413, 337844, 346057, 247759, 346063, 329697, 354277, 190439, 247789, 354313, 346139, 436289, 378954, 395339, 338004, 100453, 329832, 329855, 329867, 329885, 346272, 362660, 100524, 387249, 379066, 387260, 256191, 395466, 346316, 411861, 411864, 411868, 411873, 379107, 411876, 387301, 346343, 338152, 387306, 387312, 346355, 436473, 321786, 379134, 411903, 379152, 395538, 387349, 338199, 387352, 182558, 338211, 248111, 362822, 436555, 190796, 321879, 379233, 354673, 321910, 248186, 420236, 379278, 272786, 354727, 338352, 330189, 338381, 338386, 256472, 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, 436962, 338660, 338664, 264941, 363251, 207619, 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, 248792, 248798, 347105, 257008, 183282, 265207, 330748, 265214, 330760, 330768, 248862, 396328, 158761, 199728, 330800, 396336, 396339, 339001, 388154, 388161, 347205, 248904, 330826, 248914, 183383, 339036, 412764, 257120, 265320, 248951, 420984, 330889, 248985, 339097, 44197, 380070, 339112, 249014, 126144, 330958, 330965, 388319, 388347, 175375, 159005, 175396, 208166, 273708, 372015, 347441, 372018, 199988, 44342, 175415, 396600, 437566, 175423, 437570, 437575, 437583, 331088, 437587, 331093, 396633, 175450, 437595, 175457, 208227, 175460, 175463, 437620, 175477, 249208, 175483, 175486, 249214, 175489, 249218, 249227, 249234, 175513, 175516, 396705, 175522, 355748, 380332, 396722, 208311, 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, 339588, 126596, 421508, 224904, 159374, 11918, 339601, 126610, 224913, 224916, 224919, 126616, 224922, 224926, 224929, 224932, 257704, 224936, 224942, 257712, 224947, 257716, 257720, 257724, 257732, 224969, 339662, 257747, 224981, 224986, 224993, 257761, 224999, 339695, 225012, 257787, 225020, 339710, 257790, 225025, 257794, 339721, 257801, 257804, 225038, 257807, 225043, 167700, 372499, 225048, 257819, 225053, 184094, 225058, 339747, 339749, 257833, 225066, 257836, 413484, 225070, 225073, 372532, 257845, 397112, 225082, 397115, 225087, 225092, 323402, 257868, 225103, 257871, 397139, 225108, 225112, 257883, 257886, 225119, 225127, 257896, 274280, 257901, 225137, 257908, 225141, 257912, 257916, 225148, 257920, 225155, 339844, 225165, 397200, 225170, 380822, 225175, 225180, 118691, 184244, 372664, 372702, 372706, 356335, 380918, 405533, 430129, 266294, 266297, 217157, 421960, 356439, 430180, 421990, 266350, 381068, 225423, 250002, 250004, 225429, 356506, 225437, 135327, 225441, 438433, 225444, 438436, 225447, 438440, 225450, 258222, 225455, 430256, 225458, 225461, 225466, 225470, 381120, 372929, 430274, 225475, 389320, 225484, 225487, 225490, 225493, 266453, 225496, 225499, 225502, 356578, 217318, 225510, 225514, 225518, 372976, 381176, 389380, 61722, 356637, 356640, 356643, 356646, 266536, 356649, 356655, 332080, 340275, 356660, 397622, 332090, 332097, 201028, 348488, 332106, 332117, 250199, 250202, 332125, 250210, 348525, 332152, 250238, 389502, 356740, 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, 356934, 348743, 381512, 324170, 324173, 324176, 389723, 332380, 340627, 184982, 373398, 258721, 332453, 332459, 389805, 332463, 381617, 332471, 332483, 332486, 373449, 332493, 357069, 357073, 332511, 332520, 340718, 332533, 348924, 389926, 152370, 340789, 348982, 398139, 127814, 430939, 357211, 357214, 201579, 201582, 349040, 340849, 201588, 430965, 324472, 398201, 340858, 324475, 119674, 340861, 324478, 430972, 324481, 373634, 398211, 324484, 324487, 381833, 324492, 324495, 324498, 430995, 324501, 324510, 422816, 324513, 398245, 201637, 324524, 340909, 324533, 5046, 324538, 324541, 398279, 340939, 340941, 209873, 340957, 431072, 398306, 340963, 209895, 201711, 349172, 349180, 439294, 431106, 209943, 209946, 250914, 357410, 185380, 357418, 209965, 209968, 209971, 209975, 209979, 209987, 209990, 341071, 349267, 250967, 210010, 341091, 210025, 210027, 210030, 210036, 210039, 341113, 210044, 152703, 160895, 349311, 210052, 349319, 210055, 210067, 210071, 210077, 210080, 210084, 251044, 185511, 210088, 210095, 210098, 210107, 210115, 332997, 210127, 333009, 210131, 333014, 210138, 210143, 218354, 251128, 218360, 275706, 275712, 275715, 275721, 333078, 251160, 349484, 349491, 251189, 415033, 251210, 357708, 210260, 365911, 259421, 365921, 333154, 251235, 374117, 333162, 234866, 390516, 333175, 357755, 136590, 112020, 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, 333399, 366172, 333413, 423528, 423532, 210544, 415353, 333439, 415361, 267909, 153227, 333498, 333511, 210631, 259788, 358099, 333534, 366307, 366311, 431851, 366318, 210672, 366321, 366325, 210695, 268041, 210698, 366348, 210706, 399128, 333594, 358191, 210739, 366387, 399159, 358200, 325440, 366401, 341829, 325446, 46920, 341834, 341838, 341843, 415573, 358234, 341851, 399199, 259938, 399206, 268143, 358255, 399215, 358259, 341876, 333689, 243579, 325504, 333698, 333708, 333724, 382890, 350146, 358339, 333774, 358371, 350189, 333818, 268298, 333850, 178218, 350256, 243781, 350285, 374864, 342111, 342133, 374902, 333997, 334011, 260289, 350410, 260298, 350416, 350422, 211160, 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, 268701, 416157, 342430, 375208, 326058, 375216, 334262, 334275, 326084, 358856, 195039, 334304, 334311, 375277, 334321, 350723, 186897, 342545, 334358, 342550, 342554, 334363, 358941, 350761, 252461, 334384, 358961, 383536, 334394, 252482, 219718, 334407, 334420, 350822, 375400, 334465, 334468, 162445, 326290, 342679, 342683, 260766, 342710, 244409, 260797, 334528, 260801, 350917, 391894, 154328, 416473, 64230, 342766, 375535, 203506, 342776, 391937, 391948, 326416, 375568, 375571, 162591, 326441, 326451, 326454, 244540, 326460, 375612, 326467, 244551, 326473, 326477, 326485, 416597, 326490, 326502, 375656, 433000, 326507, 326510, 211825, 211831, 392060, 351104, 400259, 342915, 236430, 342930, 252822, 392091, 400285, 252836, 359334, 211884, 400306, 351168, 359361, 359366, 326598, 359382, 359388, 383967, 343015, 359407, 261108, 244726, 261111, 383997, 261129, 359451, 261147, 211998, 261153, 261159, 359470, 359476, 343131, 384098, 384101, 367723, 384107, 187502, 343154, 384114, 212094, 351364, 384135, 384139, 384143, 351381, 384151, 384160, 384168, 367794, 244916, 384181, 367800, 384188, 351423, 384191, 384198, 326855, 244937, 384201, 253130, 343244, 384208, 146642, 384224, 359649, 343270, 351466, 384246, 351479, 384249, 343306, 261389, 359694, 253200, 261393, 384275, 384283, 245020, 384288, 245029, 171302, 351534, 376110, 245040, 384314, 425276, 384323, 212291, 343365, 212303, 367965, 343393, 343398, 367980, 425328, 343409, 154999, 253303, 343417, 327034, 245127, 384397, 245136, 245142, 245145, 343450, 245148, 245151, 245154, 245157, 245162, 327084, 359865, 384443, 146876, 327107, 384453, 327110, 327115, 327117, 359886, 359890, 343507, 368092, 343534, 343539, 368119, 343544, 368122, 409091, 359947, 359983, 343630, 327275, 245357, 138864, 155254, 155273, 368288, 245409, 425638, 155322, 425662, 155327, 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, 425845, 262005, 147317, 262008, 262011, 155516, 155521, 155525, 360326, 262027, 155531, 262030, 262033, 262036, 262039, 262042, 155549, 262045, 262048, 262051, 327589, 155559, 155562, 155565, 393150, 384977, 393169, 155611, 155619, 253923, 155621, 327654, 253926, 393203, 360438, 253943, 393206, 393212, 155646 ]
7b74db262af73bca5071ffdbcf63f6f5a1814f85
065abd74d560614b7e0767cc9daa8454c6db93cb
/UIKit and Animations/WWDC 2013/Custom Transitions Using View Controllers New capabilities, APIs and enhancements/SampleCodes/FaderCustomTransition_1/FaderCustomTransition/AppDelegate.swift
27889b63258c2a0fdc4dbd7aef32cd6214abb93d
[]
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
2,116
swift
// // AppDelegate.swift // FaderCustomTransition // // Created by Seyed Samad Gholamzadeh on 6/16/18. // Copyright © 2018 Seyed Samad Gholamzadeh. 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, 278545, 229394, 278548, 229397, 229399, 229402, 352284, 229405, 278556, 278559, 229408, 278564, 294950, 229415, 229417, 327722, 237613, 229422, 360496, 229426, 237618, 229428, 311349, 286774, 286776, 319544, 286778, 204856, 229432, 352318, 286791, 237640, 286797, 278605, 311375, 163920, 237646, 196692, 319573, 311383, 278623, 278626, 319590, 311400, 278635, 303212, 278639, 131192, 278648, 237693, 303230, 327814, 303241, 131209, 417930, 303244, 311436, 319633, 286873, 286876, 311460, 311469, 32944, 327862, 286906, 327866, 180413, 286910, 131264, 286916, 295110, 286922, 286924, 286926, 319694, 286928, 131281, 278743, 278747, 295133, 155872, 319716, 237807, 303345, 286962, 131314, 229622, 327930, 278781, 278783, 278785, 237826, 319751, 278792, 286987, 319757, 311569, 286999, 319770, 287003, 287006, 287009, 287012, 287014, 287016, 287019, 311598, 287023, 262448, 311601, 295220, 287032, 155966, 319809, 319810, 278849, 319814, 311623, 319818, 311628, 229709, 319822, 287054, 278865, 229717, 196963, 196969, 139638, 213367, 106872, 319872, 311683, 319879, 311693, 65943, 319898, 311719, 278952, 139689, 278957, 311728, 278967, 180668, 311741, 278975, 319938, 278980, 98756, 278983, 319945, 278986, 319947, 278990, 278994, 311767, 279003, 279006, 188895, 172512, 287202, 279010, 279015, 172520, 319978, 279020, 172526, 311791, 279023, 172529, 279027, 319989, 172534, 180727, 164343, 279035, 311804, 287230, 279040, 303617, 287234, 279045, 172550, 303623, 172552, 320007, 287238, 279051, 172558, 279055, 303632, 279058, 303637, 279063, 279067, 172572, 279072, 172577, 295459, 172581, 295461, 279082, 311850, 279084, 172591, 172598, 279095, 172607, 172609, 172612, 377413, 172614, 172618, 303690, 33357, 287309, 303696, 279124, 172634, 262752, 254563, 172644, 311911, 189034, 295533, 172655, 172656, 352880, 295538, 189039, 172660, 287349, 189040, 189044, 287355, 287360, 295553, 172675, 295557, 311942, 303751, 287365, 352905, 311946, 279178, 287371, 311951, 287377, 172691, 287381, 311957, 221850, 287386, 230045, 172702, 287390, 303773, 172705, 287394, 172707, 303780, 164509, 287398, 205479, 279208, 287400, 172714, 295595, 279212, 189102, 172721, 287409, 66227, 303797, 189114, 287419, 303804, 328381, 287423, 328384, 172737, 279231, 287427, 312005, 312006, 107208, 172748, 287436, 107212, 172751, 287440, 295633, 172755, 303827, 279255, 172760, 287450, 303835, 279258, 189149, 303838, 213724, 312035, 279267, 295654, 279272, 230128, 312048, 312050, 230131, 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, 213895, 304009, 304011, 230284, 304013, 295822, 279438, 213902, 189329, 295825, 304019, 189331, 58262, 304023, 304027, 279452, 410526, 279461, 279462, 304042, 213931, 230327, 304055, 287675, 230334, 304063, 238528, 304065, 213954, 189378, 156612, 295873, 213963, 197580, 312272, 304084, 304090, 320481, 304106, 320490, 312302, 328687, 320496, 304114, 295928, 320505, 312321, 295945, 230413, 295949, 197645, 320528, 140312, 295961, 238620, 197663, 304164, 304170, 304175, 238641, 312374, 238652, 238655, 230465, 238658, 336964, 132165, 296004, 205895, 320584, 238666, 296021, 402518, 336987, 230497, 296036, 296040, 361576, 205931, 296044, 279661, 205934, 164973, 312432, 279669, 337018, 189562, 279679, 304258, 279683, 222340, 66690, 205968, 296084, 238745, 304285, 238756, 205991, 222377, 165035, 337067, 238766, 165038, 230576, 238770, 304311, 230592, 312518, 279750, 230600, 230607, 148690, 320727, 279769, 304348, 279777, 304354, 296163, 320740, 279781, 304360, 320748, 279788, 279790, 304370, 296189, 320771, 312585, 296202, 296205, 230674, 320786, 230677, 296213, 296215, 320792, 230681, 230679, 214294, 304416, 230689, 173350, 312622, 296243, 312630, 222522, 296253, 222525, 296255, 312639, 230718, 296259, 378181, 296262, 230727, 238919, 296264, 320840, 296267, 296271, 222545, 230739, 312663, 222556, 337244, 230752, 312676, 230760, 173418, 148843, 410987, 230763, 230768, 296305, 312692, 230773, 304505, 304506, 181626, 279929, 181631, 148865, 312711, 312712, 296331, 288140, 288144, 230800, 304533, 337306, 288154, 288160, 173472, 288162, 288164, 279975, 304555, 370092, 279983, 173488, 288176, 279985, 312755, 296373, 312759, 337335, 288185, 279991, 222652, 312766, 173507, 296389, 222665, 230860, 312783, 288208, 230865, 288210, 370130, 288212, 148946, 222676, 288214, 239064, 329177, 288217, 280027, 288220, 288218, 239070, 288224, 280034, 288226, 280036, 288229, 280038, 288230, 288232, 370146, 288234, 320998, 288236, 288238, 288240, 288242, 296435, 288244, 288250, 296446, 321022, 402942, 148990, 296450, 206336, 230916, 230919, 214535, 230923, 304651, 304653, 370187, 230940, 222752, 108066, 296486, 296488, 157229, 239152, 230961, 157236, 288320, 288325, 124489, 280140, 280145, 288338, 280149, 288344, 280152, 239194, 280158, 403039, 370272, 181854, 239202, 312938, 280183, 280185, 280188, 280191, 116354, 280194, 280208, 280211, 288408, 280218, 280222, 419489, 190118, 321195, 296622, 321200, 337585, 296626, 296634, 296637, 419522, 313027, 280260, 419525, 206536, 280264, 206539, 206541, 206543, 263888, 313044, 280276, 321239, 280283, 313052, 18140, 288478, 313055, 419555, 321252, 313066, 288494, 280302, 280304, 313073, 321266, 419570, 288499, 288502, 280314, 288510, 124671, 67330, 280324, 198405, 288519, 280331, 198416, 280337, 296723, 116503, 321304, 329498, 296731, 321311, 313121, 313123, 304932, 321316, 280363, 141101, 165678, 280375, 321336, 296767, 288576, 345921, 280388, 337732, 304968, 280393, 280402, 173907, 313171, 313176, 42842, 280419, 321381, 296809, 296812, 313201, 1920, 255873, 305028, 280454, 247688, 280464, 124817, 280468, 239510, 280473, 124827, 214940, 247709, 214944, 280487, 313258, 321458, 296883, 124853, 214966, 296890, 10170, 288700, 296894, 190403, 296900, 280515, 337862, 165831, 280521, 231379, 296921, 354265, 354270, 239586, 313320, 354281, 231404, 124913, 165876, 321528, 239612, 313340, 288764, 239617, 313347, 288773, 313358, 305176, 321560, 313371, 354338, 305191, 223273, 313386, 354348, 124978, 215090, 124980, 288824, 288826, 321595, 378941, 313406, 288831, 288836, 67654, 280651, 354382, 288848, 280658, 215123, 354390, 288855, 288859, 280669, 313438, 149599, 280671, 149601, 321634, 149603, 223327, 329830, 280681, 313451, 223341, 280687, 149618, 215154, 313458, 280691, 313464, 329850, 321659, 280702, 288895, 321670, 215175, 141446, 288909, 141455, 141459, 280725, 313498, 100520, 288936, 280747, 288940, 288947, 280755, 321717, 280759, 280764, 280769, 280771, 280774, 280776, 313548, 321740, 280783, 280786, 280788, 313557, 280793, 280796, 280798, 338147, 280804, 280807, 157930, 280811, 280817, 125171, 157940, 280819, 182517, 280823, 280825, 280827, 280830, 280831, 280833, 125187, 280835, 125191, 125207, 125209, 321817, 125218, 321842, 223539, 125239, 280888, 305464, 280891, 289087, 280897, 280900, 305480, 239944, 280906, 239947, 305485, 305489, 379218, 280919, 248153, 354653, 354656, 313700, 313705, 280937, 190832, 280946, 223606, 313720, 280956, 239997, 280959, 313731, 199051, 240011, 289166, 240017, 297363, 190868, 240021, 297365, 297368, 297372, 141725, 297377, 289186, 297391, 289201, 240052, 289207, 289210, 305594, 281024, 289218, 289221, 289227, 281045, 281047, 215526, 166378, 305647, 281075, 174580, 240124, 281084, 305662, 305664, 240129, 305666, 305668, 223749, 240132, 281095, 223752, 150025, 338440, 330244, 223757, 281102, 223763, 223765, 281113, 322074, 281116, 281121, 182819, 281127, 281135, 150066, 158262, 158266, 289342, 281154, 322115, 158283, 281163, 281179, 338528, 338532, 281190, 199273, 281196, 19053, 158317, 313973, 297594, 281210, 158347, 264845, 182926, 133776, 314003, 117398, 314007, 289436, 174754, 330404, 289448, 133801, 174764, 314029, 314033, 240309, 133817, 314045, 314047, 314051, 199364, 297671, 158409, 256716, 289493, 363234, 289513, 289522, 289525, 289532, 322303, 289537, 322310, 264969, 322314, 322318, 281361, 281372, 322341, 215850, 281388, 289593, 281401, 289601, 281410, 281413, 281414, 240458, 281420, 240468, 281430, 322393, 297818, 281435, 281438, 281442, 174955, 224110, 207733, 207737, 158596, 183172, 338823, 322440, 314249, 240519, 183184, 142226, 289687, 240535, 297883, 289694, 289696, 289700, 289712, 281529, 289724, 52163, 183260, 281567, 289762, 322534, 297961, 183277, 281581, 322550, 134142, 322563, 314372, 330764, 175134, 322599, 322610, 314421, 281654, 314427, 314433, 207937, 314441, 207949, 322642, 314456, 281691, 314461, 281702, 281704, 314474, 281708, 281711, 289912, 248995, 306341, 306344, 306347, 322734, 306354, 142531, 199877, 289991, 306377, 289997, 249045, 363742, 363745, 298216, 330988, 126190, 216303, 322801, 388350, 257302, 363802, 199976, 199978, 314671, 298292, 298294, 257334, 216376, 380226, 298306, 224584, 224587, 224594, 216404, 306517, 150870, 314714, 224603, 159068, 314718, 265568, 314723, 281960, 150890, 306539, 314732, 314736, 290161, 216436, 306549, 298358, 314743, 306552, 290171, 314747, 306555, 298365, 290174, 224641, 281987, 298372, 314756, 281990, 224647, 265604, 298377, 314763, 142733, 298381, 314768, 224657, 306581, 314773, 314779, 314785, 314793, 282025, 282027, 241068, 241070, 241072, 282034, 241077, 150966, 298424, 306618, 282044, 323015, 306635, 306640, 290263, 290270, 290275, 339431, 282089, 191985, 282098, 290291, 282101, 241142, 191992, 290298, 151036, 290302, 282111, 290305, 175621, 306694, 192008, 323084, 257550, 282127, 290321, 282130, 323090, 290325, 282133, 241175, 290328, 282137, 290332, 241181, 282142, 282144, 290344, 306731, 290349, 290351, 290356, 28219, 282186, 224849, 282195, 282199, 282201, 306778, 159324, 159330, 314979, 298598, 323176, 224875, 241260, 323181, 257658, 315016, 282249, 290445, 324757, 282261, 175770, 298651, 282269, 323229, 298655, 323231, 61092, 282277, 306856, 196133, 282295, 323260, 282300, 323266, 282310, 323273, 282319, 306897, 241362, 306904, 282328, 298714, 52959, 216801, 282337, 241380, 216806, 323304, 282345, 12011, 282356, 323318, 282364, 282367, 306945, 241412, 323333, 282376, 216842, 323345, 282388, 323349, 282392, 184090, 315167, 315169, 282402, 315174, 323367, 241448, 315176, 241450, 282410, 306988, 306991, 315184, 323376, 315190, 241464, 159545, 282425, 298811, 118593, 307009, 413506, 307012, 241475, 298822, 315211, 282446, 307027, 315221, 323414, 315223, 241496, 241498, 307035, 307040, 110433, 282465, 241509, 110438, 298860, 110445, 282478, 315249, 110450, 315251, 282481, 315253, 315255, 339838, 315267, 282499, 315269, 241544, 282505, 241546, 241548, 298896, 298898, 282514, 241556, 298901, 44948, 241560, 282520, 241563, 241565, 241567, 241569, 282531, 241574, 282537, 298922, 36779, 241581, 282542, 241583, 323504, 241586, 282547, 241588, 290739, 241590, 241592, 241598, 290751, 241600, 241605, 151495, 241610, 298975, 241632, 298984, 241640, 241643, 298988, 241646, 241649, 241652, 323574, 290807, 299003, 241661, 299006, 282623, 315396, 241669, 315397, 282632, 307211, 282639, 290835, 282645, 241693, 282654, 241701, 102438, 217127, 282669, 323630, 282681, 290877, 282687, 159811, 315463, 315466, 192589, 307278, 192596, 176213, 307287, 307290, 217179, 315482, 192605, 315483, 233567, 299105, 200801, 217188, 299109, 307303, 315495, 356457, 45163, 307307, 315502, 192624, 307314, 323700, 299126, 233591, 299136, 307329, 307338, 233613, 241813, 307352, 299164, 241821, 299167, 315552, 184479, 184481, 315557, 184486, 307370, 307372, 184492, 307374, 307376, 299185, 323763, 184503, 176311, 299191, 307386, 258235, 307388, 307385, 307390, 176316, 299200, 184512, 307394, 299204, 307396, 184518, 307399, 323784, 233679, 307409, 307411, 176343, 299225, 233701, 307432, 184572, 282881, 184579, 282893, 291089, 282906, 291104, 233766, 295583, 176435, 307508, 315701, 332086, 307510, 307512, 168245, 307515, 307518, 282942, 282947, 323917, 110926, 282957, 233808, 323921, 315733, 323926, 233815, 276052, 315739, 323932, 299357, 242018, 242024, 299373, 315757, 250231, 242043, 315771, 299388, 299391, 291202, 299398, 242057, 291212, 299405, 291222, 315801, 283033, 242075, 291226, 194654, 61855, 291231, 283042, 291238, 291241, 127403, 127405, 291247, 299440, 127407, 299444, 127413, 283062, 291254, 127417, 291260, 283069, 127421, 127424, 299457, 127429, 127431, 127434, 315856, 176592, 127440, 315860, 176597, 283095, 127447, 299481, 127449, 176605, 242143, 127455, 127457, 291299, 340454, 127463, 242152, 291305, 127466, 176620, 127469, 127474, 291314, 291317, 127480, 135672, 291323, 233979, 127485, 291330, 127490, 283142, 127494, 135689, 233994, 127497, 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, 226037, 283382, 316151, 234231, 234236, 226045, 242431, 234239, 209665, 234242, 299778, 242436, 226053, 234246, 226056, 234248, 291593, 242443, 234252, 242445, 234254, 291601, 234258, 242450, 242452, 234261, 348950, 201496, 234264, 234266, 234269, 283421, 234272, 234274, 152355, 299814, 234278, 283432, 234281, 234284, 234287, 283440, 185138, 242483, 234292, 234296, 234298, 160572, 283452, 234302, 234307, 242499, 234309, 316233, 234313, 316235, 234316, 283468, 234319, 242511, 234321, 234324, 185173, 201557, 234329, 234333, 308063, 234336, 242530, 349027, 234338, 234341, 234344, 234347, 177004, 234350, 324464, 234353, 152435, 177011, 234356, 234358, 234362, 226171, 234364, 291711, 234368, 291714, 234370, 291716, 234373, 316294, 201603, 226182, 308105, 234375, 226185, 234379, 324490, 234384, 234388, 234390, 324504, 234393, 209818, 308123, 324508, 226200, 291742, 234396, 234398, 234401, 291747, 291748, 234405, 291750, 234407, 324520, 324518, 324522, 234410, 291756, 291754, 226220, 324527, 291760, 234417, 201650, 324531, 234414, 234422, 226230, 324536, 275384, 234428, 291773, 242623, 324544, 234431, 234434, 324546, 324548, 234437, 226245, 234439, 226239, 234443, 291788, 234446, 275406, 193486, 234449, 316370, 193488, 234452, 234455, 234459, 234461, 234464, 234467, 234470, 168935, 5096, 324585, 234475, 234478, 316400, 234481, 316403, 234484, 234485, 234487, 324599, 234490, 234493, 316416, 234496, 234501, 275462, 308231, 234504, 234507, 234510, 234515, 300054, 316439, 234520, 234519, 234523, 234526, 234528, 300066, 234532, 300069, 234535, 234537, 234540, 144430, 234543, 234546, 275508, 300085, 234549, 300088, 234553, 234556, 234558, 316479, 234561, 316483, 160835, 234563, 308291, 234568, 234570, 316491, 234572, 300108, 234574, 300115, 234580, 234581, 242777, 234585, 275545, 234590, 234593, 234595, 234597, 300133, 234601, 300139, 234605, 160879, 234607, 275569, 234610, 316530, 300148, 234614, 398455, 144506, 234618, 234620, 275579, 234623, 226433, 234627, 275588, 234629, 242822, 234634, 234636, 177293, 234640, 275602, 234643, 308373, 226453, 234647, 275606, 275608, 234650, 308379, 234648, 300189, 324766, 119967, 234653, 324768, 283805, 234657, 242852, 300197, 234661, 283813, 234664, 177318, 275626, 234667, 316596, 308414, 234687, 300223, 300226, 308418, 234692, 300229, 308420, 308422, 283844, 226500, 300234, 283850, 300238, 300241, 316625, 300243, 300245, 316630, 300248, 300253, 300256, 300258, 300260, 234726, 300263, 300265, 300267, 161003, 300270, 300272, 120053, 300278, 275703, 316663, 300284, 275710, 300287, 292097, 300289, 161027, 300292, 300294, 275719, 234760, 177419, 300299, 242957, 300301, 283917, 177424, 275725, 349451, 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, 284010, 136562, 324978, 275834, 333178, 275836, 275840, 316803, 316806, 226696, 316811, 226699, 316814, 226703, 300433, 234899, 300436, 226709, 357783, 316824, 316826, 144796, 300448, 144807, 144810, 144812, 284076, 144814, 227426, 144820, 374196, 284084, 292279, 284087, 144826, 144828, 144830, 144832, 144835, 144837, 38342, 144839, 144841, 144844, 144847, 144852, 144855, 103899, 300507, 333280, 226787, 218597, 292329, 300523, 259565, 300527, 308720, 259567, 292338, 226802, 316917, 292343, 308727, 300537, 316933, 316947, 308757, 308762, 284191, 316959, 284194, 284196, 235045, 284199, 284204, 284206, 284209, 284211, 194101, 284213, 316983, 194103, 284215, 308790, 284218, 226877, 292414, 284223, 284226, 284228, 292421, 226886, 284231, 128584, 243268, 284234, 366155, 317004, 276043, 284238, 226895, 284241, 194130, 284243, 300628, 284245, 292433, 284247, 317015, 235097, 243290, 276053, 284249, 284251, 300638, 284253, 284255, 243293, 284258, 292452, 292454, 284263, 177766, 284265, 292458, 284267, 292461, 284272, 284274, 284278, 292470, 276086, 292473, 284283, 276093, 284286, 292479, 284288, 292481, 284290, 325250, 284292, 292485, 325251, 276095, 276098, 284297, 317066, 284299, 317068, 284301, 276109, 284303, 284306, 276114, 284308, 284312, 284314, 284316, 276127, 284320, 284322, 284327, 284329, 317098, 284331, 276137, 284333, 284335, 276144, 284337, 284339, 300726, 284343, 284346, 284350, 358080, 276160, 284354, 358083, 284358, 276166, 358089, 284362, 276170, 284365, 276175, 284368, 276177, 284370, 358098, 284372, 317138, 284377, 276187, 284379, 284381, 284384, 358114, 284386, 358116, 276197, 317158, 358119, 284392, 325353, 358122, 284394, 284397, 358126, 284399, 358128, 276206, 358133, 358135, 276216, 358138, 300795, 358140, 284413, 358142, 358146, 317187, 284418, 317189, 317191, 284428, 300816, 300819, 317207, 284440, 300828, 300830, 276255, 300832, 325408, 300834, 317221, 227109, 358183, 186151, 276268, 300845, 243504, 300850, 284469, 276280, 325436, 358206, 276291, 366406, 276295, 300872, 292681, 153417, 358224, 284499, 276308, 284502, 317271, 178006, 276315, 292700, 317279, 284511, 227175, 292715, 300912, 292721, 284529, 300915, 284533, 292729, 317306, 284540, 292734, 325512, 169868, 276365, 317332, 358292, 284564, 284566, 399252, 350106, 284572, 276386, 284579, 276388, 358312, 317353, 284585, 276395, 292776, 292784, 276402, 358326, 161718, 358330, 276410, 276411, 276418, 276425, 301009, 301011, 301013, 292823, 358360, 301017, 301015, 292828, 276446, 153568, 276448, 276452, 292839, 276455, 292843, 276460, 292845, 276464, 178161, 227314, 276466, 325624, 276472, 317435, 276476, 276479, 276482, 276485, 317446, 276490, 350218, 292876, 350222, 317456, 276496, 317458, 178195, 243733, 243740, 317468, 317472, 325666, 243751, 292904, 276528, 243762, 309298, 325685, 325689, 235579, 325692, 235581, 178238, 276539, 276544, 284739, 325700, 243779, 292934, 243785, 276553, 350293, 350295, 309337, 194649, 227418, 350299, 350302, 227423, 350304, 178273, 309346, 194657, 194660, 350308, 309350, 309348, 292968, 309352, 309354, 301163, 350313, 350316, 227430, 301167, 276583, 350321, 276590, 284786, 276595, 350325, 252022, 227440, 350328, 292985, 301178, 350332, 292989, 301185, 292993, 350339, 317570, 317573, 350342, 350345, 350349, 301199, 317584, 325777, 350354, 350357, 350359, 350362, 350366, 276638, 284837, 153765, 350375, 350379, 350381, 350383, 129200, 350385, 350387, 350389, 350395, 350397, 350399, 227520, 350402, 227522, 301252, 350406, 227529, 301258, 309450, 276685, 309455, 276689, 309462, 301272, 276699, 194780, 309468, 309471, 301283, 317672, 317674, 325867, 243948, 194801, 227571, 309491, 309494, 243960, 276735, 227583, 227587, 276739, 211204, 276742, 227593, 227596, 325910, 309530, 342298, 211232, 317729, 276775, 211241, 325937, 325943, 211260, 260421, 276809, 285002, 276811, 235853, 276816, 235858, 276829, 276833, 391523, 276836, 293227, 276843, 293232, 276848, 186744, 211324, 227709, 285061, 366983, 317833, 178572, 285070, 285077, 178583, 227738, 317853, 276896, 317858, 342434, 285093, 317864, 285098, 276907, 235955, 276917, 293304, 293307, 293314, 309707, 293325, 317910, 293336, 235996, 317917, 293343, 358880, 276961, 227810, 293346, 276964, 293352, 236013, 293364, 301562, 293370, 317951, 309764, 301575, 121352, 293387, 236043, 342541, 317963, 113167, 55822, 309779, 317971, 309781, 277011, 55837, 227877, 227879, 293417, 227882, 309804, 293421, 105007, 236082, 285236, 23094, 277054, 244288, 129603, 301636, 318020, 301639, 301643, 277071, 285265, 399955, 309844, 277080, 309849, 285277, 285282, 326244, 318055, 277100, 309871, 121458, 277106, 170618, 170619, 309885, 309888, 277122, 227975, 277128, 285320, 301706, 318092, 326285, 334476, 318094, 277136, 277139, 227992, 334488, 318108, 285340, 318110, 227998, 137889, 383658, 285357, 318128, 277170, 293555, 318132, 342707, 154292, 277173, 285368, 277177, 277181, 318144, 277187, 277191, 277194, 277196, 277201, 342745, 137946, 342747, 342749, 113378, 203491, 228069, 277223, 342760, 285417, 56041, 56043, 277232, 228081, 56059, 310015, 285441, 310020, 285448, 310029, 228113, 285459, 277273, 293659, 326430, 228128, 285474, 293666, 228135, 318248, 277291, 318253, 293677, 285489, 301876, 293685, 285494, 301880, 285499, 301884, 310080, 293696, 277317, 277322, 277329, 162643, 310100, 301911, 301913, 277337, 301921, 400236, 236397, 162671, 326514, 310134, 236408, 15224, 277368, 416639, 416640, 113538, 310147, 416648, 39817, 187274, 277385, 301972, 424853, 277405, 277411, 310179, 293798, 293802, 236460, 277426, 276579, 293811, 293817, 293820, 203715, 326603, 342994, 276586, 293849, 293861, 228327, 228328, 318442, 228330, 228332, 326638, 277486, 351217, 318450, 293876, 293877, 285686, 302073, 121850, 293882, 302075, 285690, 244731, 293887, 277504, 277507, 277511, 293899, 277519, 293908, 302105, 293917, 293939, 318516, 277561, 277564, 310336, 7232, 293956, 277573, 228422, 293960, 310344, 277577, 277583, 203857, 293971, 310355, 310359, 236632, 277594, 138332, 277598, 203872, 277601, 285792, 310374, 203879, 310376, 228460, 318573, 203886, 187509, 285815, 367737, 285817, 302205, 285821, 392326, 285831, 253064, 294026, 302218, 285835, 162964, 384148, 187542, 302231, 285849, 302233, 285852, 302237, 285854, 285856, 302241, 285862, 277671, 302248, 64682, 277678, 294063, 294065, 302258, 277687, 294072, 318651, 294076, 277695, 318657, 244930, 302275, 130244, 302277, 228550, 302282, 310476, 302285, 302288, 310481, 302290, 203987, 302292, 302294, 310486, 302296, 384222, 310498, 285927, 318698, 302315, 195822, 228592, 294132, 138485, 228601, 204026, 228606, 204031, 64768, 310531, 285958, 138505, 228617, 318742, 204067, 277798, 130345, 277801, 113964, 285997, 277804, 285999, 277807, 113969, 277811, 318773, 318776, 277816, 286010, 277819, 294204, 417086, 277822, 286016, 302403, 294211, 384328, 277832, 277836, 294221, 294223, 326991, 277839, 277842, 277847, 277850, 179547, 277853, 146784, 277857, 302436, 277860, 294246, 327015, 310632, 327017, 351594, 277864, 277869, 277872, 351607, 310648, 277880, 310651, 277884, 277888, 310657, 351619, 294276, 310659, 327046, 277892, 253320, 310665, 318858, 277894, 277898, 277903, 310672, 351633, 277905, 277908, 277917, 310689, 277921, 130468, 228776, 277928, 277932, 310703, 277937, 310710, 130486, 310712, 277944, 310715, 277947, 302526, 228799, 277950, 277953, 302534, 310727, 245191, 64966, 163272, 277959, 277963, 302541, 277966, 302543, 310737, 277971, 228825, 163290, 277978, 310749, 277981, 277984, 310755, 277989, 277991, 187880, 277995, 310764, 286188, 278000, 228851, 310772, 278003, 278006, 40440, 212472, 278009, 40443, 286203, 310780, 40448, 228864, 286214, 228871, 302603, 65038, 302614, 302617, 286233, 302621, 286240, 146977, 187939, 40484, 294435, 40486, 286246, 294440, 40488, 294439, 294443, 40491, 294445, 278057, 310831, 245288, 286248, 40499, 40502, 212538, 40507, 40511, 40513, 228933, 327240, 40521, 286283, 40525, 40527, 212560, 400976, 228944, 40533, 147032, 40537, 40539, 40541, 278109, 40544, 40548, 40550, 40552, 286312, 40554, 286313, 310892, 40557, 40560, 188022, 122488, 294521, 343679, 294537, 310925, 286354, 278163, 302740, 122517, 278168, 179870, 327333, 229030, 212648, 278188, 302764, 278192, 319153, 278196, 302781, 319171, 302789, 294599, 278216, 294601, 302793, 343757, 212690, 319187, 286420, 278227, 229076, 286425, 319194, 278235, 278238, 229086, 286432, 294625, 294634, 302838, 319226, 286460, 278274, 302852, 278277, 302854, 294664, 311048, 352008, 319243, 311053, 302862, 319251, 294682, 278306, 188199, 294701, 319280, 278320, 319290, 229192, 302925, 188247, 280021, 188252, 237409, 229233, 294776, 360317, 294785, 327554, 360322, 40840, 40851, 294803, 188312, 294811, 237470, 319390, 40865, 319394, 294817, 294821, 311209, 180142, 343983, 294831, 188340, 40886, 319419, 294844, 294847, 237508, 393177, 294876, 294879, 294883, 393190, 294890, 311279, 278513, 237555, 311283, 278516, 278519, 237562 ]
fbe9dab1277ef10e97e81533d8437f0ca4046535
c7f9752797905bf7ae0ffec27d0a7f10ffc2f673
/CustomTabMenu/CustomTabMenu/Source/VCs/MenuVCs/SecondViewController.swift
2a6c1235a3c28c579514a845bed536b84d7343e2
[]
no_license
YumYum-iOS/YumYum-Yeji
044e05979afe66b4672edbc83c3af48972db423b
2dba262da9037e9b8ef98b8eab653ddf2b80a6d2
refs/heads/main
2023-05-26T21:41:18.688404
2021-06-14T19:00:27
2021-06-14T19:00:27
376,583,515
0
0
null
null
null
null
UTF-8
Swift
false
false
278
swift
// // SecondViewController.swift // CustomTabMenu // // Created by 윤예지 on 2021/06/15. // import UIKit class SecondViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = .brown } }
[ -1 ]
0f73ad2a5edb22f1e9121578b248194d42366546
b29aa4f231016a696c1a9a7da728d2a53a524bc5
/flowAccount/Pouch/View/Spinner/SpinnerViewController.swift
a1469f11aca6b136be2278b66495d7ab75d564a2
[]
no_license
SomsakGitHub/testJob
9567deda22374fbf1cd26aa5312f44c90013df07
0279a0fcf714d29a76d651e877e7f95750c2b89e
refs/heads/master
2023-06-05T21:36:34.833192
2021-06-24T20:12:26
2021-06-24T20:12:26
378,786,761
0
0
null
null
null
null
UTF-8
Swift
false
false
1,656
swift
// // SpinnerViewController.swift // Pouch // // Created by somsak on 1/6/2564 BE. // import UIKit protocol SpinnerViewControllerViewControllerDelegate { func spinnerSelected(data: String) } class SpinnerViewController: UIViewController { var spinnerType: SpinnerType = .type var spinnerData: [String] = [] var transactionType = "" var delegate: SpinnerViewControllerViewControllerDelegate! override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. // setupPicker() } static func createSpinner() -> SpinnerViewController { let spinner: SpinnerViewController = UIStoryboard(name: "Spinner", bundle: nil) .instantiateViewController(withIdentifier: "SpinnerViewController") as! SpinnerViewController return spinner } @IBAction func selectTypeTouch(_ sender: Any) { self.dismiss(animated: true) { self.delegate.spinnerSelected(data: self.transactionType) } } } //MARK: Extension datasource and delegate. extension SpinnerViewController: UIPickerViewDelegate, UIPickerViewDataSource { func numberOfComponents(in pickerView: UIPickerView) -> Int { return 1 } func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int { return self.spinnerData.count } func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? { self.transactionType = self.spinnerData[row] return self.spinnerData[row] } }
[ -1 ]
6381174ddc80bdfb791e73874207d05552a8c6c6
11bda16f3e1a15120443ea9824163375a294760b
/StudyPad/Scenes/Main/Challenges/ChallengesOverviewViewController.swift
22d8486239ecf8c1e00a7cef6988fef12c4c95c4
[]
no_license
levinzonr/studypad-ios
5b4812615f78962160165f3e29d97575c174411d
e47b11f7bf3ac293e659843e714374eb97b8ba64
refs/heads/master
2020-04-16T08:03:37.721391
2019-02-09T18:36:06
2019-02-09T18:36:06
165,410,049
0
0
null
null
null
null
UTF-8
Swift
false
false
2,342
swift
// // ChallengesOverviewViewController.swift // StudyPad // // Created by Roman Levinzon on 03/02/2019. // Copyright (c) 2019 Roman Levinzon. All rights reserved. // import UIKit import SnapKit class ChallengesOverviewViewController: UIViewController { // MARK: - Outlets @IBOutlet weak var basicTestButton: UIButton! { didSet { basicTestButton.setTitle("Basic Self check", for: .normal) basicTestButton.layer.cornerRadius = 8 basicTestButton.titleEdgeInsets.left = 24 basicTestButton.imageEdgeInsets.left = 16 basicTestButton.snp.makeConstraints { make in make.height.equalTo(50) } } } @IBOutlet weak var writtenTestButton: UIButton! { didSet { writtenTestButton.isEnabled = false writtenTestButton.setTitle("Written test", for: .normal) writtenTestButton.layer.cornerRadius = 8 writtenTestButton.titleEdgeInsets.left = 24 writtenTestButton.imageEdgeInsets.left = 16 writtenTestButton.snp.makeConstraints { make in make.height.equalTo(50) } } } @IBOutlet weak var overviewTitleLabel: UILabel! { didSet { overviewTitleLabel.text = "Choose your challenge to continue" } } // MARK: - Properties private var presenter: ChallengesOverviewPresenterInput! // MARK: - Init class func instantiate(with presenter: ChallengesOverviewPresenterInput) -> ChallengesOverviewViewController { let name = "\(ChallengesOverviewViewController.self)" let storyboard = UIStoryboard(name: name, bundle: nil) // swiftlint:disable:next force_cast let vc = storyboard.instantiateViewController(withIdentifier: name) as! ChallengesOverviewViewController vc.presenter = presenter return vc } // MARK: - View Lifecycle - override func viewDidLoad() { super.viewDidLoad() presenter.viewCreated() } // MARK: - Callbacks - @IBAction func onChallengeSelected(_ sender: Any) { presenter.handle(.typeSelected(type: .memorize)) } } // MARK: - Display Logic - // PRESENTER -> VIEW extension ChallengesOverviewViewController: ChallengesOverviewPresenterOutput { }
[ -1 ]
21f688a362d0454759d0a44e10080838113ee044
9052069617eb7817ace8bd5d921218b9badae33d
/FourCornersWatch/FourCorners/FourCorners/ContentView.swift
602631cd795dc7d1c5018dfec69ba9ebda945fdd
[]
no_license
mohjache/FourCorners
acbfd1d4c023e0aff52b1f208ce202ac3ea5c528
84dda2eeba4c47634f635a2236bd258d3de46e13
refs/heads/master
2020-05-25T23:03:35.369155
2020-02-24T23:39:23
2020-02-24T23:39:23
188,027,451
0
0
null
null
null
null
UTF-8
Swift
false
false
370
swift
// // ContentView.swift // FourCorners // // Created by Anaru Herbert on 27/11/19. // Copyright © 2019 Anaru Herbert. All rights reserved. // import SwiftUI struct ContentView: View { var body: some View { Text("Hello, World!") } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } }
[ 33292, 24462, 343054, 192656, 326415, 260372, 337812, 347284, 374935, 267800, 356504, 370198, 386582, 369946, 398870, 341916, 66845, 376736, 357409, 264739, 176806, 254374, 412588, 223152, 353585, 307506, 342451, 375348, 337594, 325307, 343100, 375227, 377406, 208320, 147012, 362436, 333510, 356551, 368710, 323401, 333514, 373194, 208332, 393669, 357838, 208339, 356437, 327382, 208343, 194525, 260702, 377438, 385889, 355043, 357220, 264933, 352360, 359786, 168045, 207725, 361325, 276339, 377982 ]
7a6ae9ac7172da026fe103d3ff027b6a8941e9aa
3eab7f56ebc84137c23eb3202fb23cdd74a0afbe
/PersonListExam/PersonListExam/AppDelegate.swift
4c856f4506218bbc2744e61b4365d8b2a60fd9b2
[]
no_license
rhenz/ios-exam
ef6c0e664c3b829739146109e0848ba1eedada99
1018425bb963235e24cd064453f6958e958a342f
refs/heads/master
2020-03-22T15:34:28.027083
2018-07-09T16:14:05
2018-07-09T16:14:05
140,262,422
0
0
null
null
null
null
UTF-8
Swift
false
false
2,167
swift
// // AppDelegate.swift // PersonListExam // // Created by JLCS on 09/07/2018. // Copyright © 2018 JLCS. 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, 327695, 229391, 278545, 229394, 278548, 229397, 229399, 229402, 352284, 278556, 229405, 278559, 229408, 294950, 229415, 229417, 327722, 237613, 229422, 360496, 229426, 237618, 229428, 311349, 286774, 286776, 319544, 286778, 204856, 229432, 286791, 237640, 286797, 278605, 311375, 163920, 237646, 196692, 319573, 311383, 278623, 278626, 319590, 311400, 278635, 303212, 278639, 131192, 278648, 237693, 303230, 327814, 303241, 131209, 417930, 303244, 311436, 319633, 286873, 286876, 311460, 311469, 32944, 327862, 286906, 327866, 180413, 286910, 131264, 286916, 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, 279082, 311850, 279084, 172591, 172598, 279095, 172607, 172609, 172612, 377413, 172614, 213575, 172618, 303690, 33357, 287309, 303696, 279124, 172634, 262752, 172644, 311911, 189034, 295533, 172655, 172656, 352880, 295538, 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, 213895, 304009, 304011, 230284, 304013, 295822, 213902, 279438, 189329, 295825, 304019, 189331, 58262, 304023, 304027, 279452, 410526, 279461, 279462, 304042, 213931, 230327, 304055, 287675, 197564, 230334, 304063, 238528, 304065, 213954, 189378, 156612, 295873, 213963, 197580, 312272, 304084, 304090, 320481, 304106, 320490, 312302, 328687, 320496, 304114, 295928, 320505, 312321, 295945, 230413, 197645, 295949, 320528, 140312, 295961, 238620, 197663, 304164, 304170, 304175, 238641, 312374, 238652, 238655, 230465, 238658, 336964, 132165, 296004, 205895, 320584, 238666, 296021, 402518, 336987, 230497, 296036, 296040, 361576, 205931, 296044, 164973, 205934, 279661, 312432, 279669, 337018, 189562, 279679, 304258, 279683, 222340, 205968, 296084, 238745, 304285, 238756, 205991, 222377, 165035, 337067, 238766, 165038, 230576, 238770, 304311, 230592, 312518, 279750, 230600, 230607, 148690, 320727, 279769, 304348, 279777, 304354, 296163, 320740, 279781, 304360, 320748, 279788, 279790, 304370, 296189, 320771, 312585, 296202, 296205, 230674, 320786, 230677, 296213, 296215, 320792, 230681, 230679, 214294, 304416, 230689, 173350, 312622, 296243, 312630, 222522, 296253, 222525, 296255, 312639, 230718, 296259, 378181, 296262, 230727, 238919, 296264, 320840, 296267, 296271, 222545, 230739, 312663, 222556, 337244, 230752, 312676, 230760, 173418, 148843, 410987, 230763, 230768, 296305, 312692, 230773, 304505, 304506, 181626, 279929, 181631, 148865, 312711, 312712, 296331, 288140, 288144, 230800, 304533, 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, 288230, 288232, 288234, 320998, 288236, 288238, 288240, 288242, 296435, 288244, 288250, 296446, 321022, 402942, 148990, 296450, 206336, 230916, 230919, 214535, 230923, 304651, 304653, 370187, 230940, 222752, 108066, 296486, 296488, 157229, 230961, 157236, 288320, 288325, 124489, 280140, 280145, 288338, 280149, 288344, 280152, 239194, 280158, 403039, 370272, 181854, 239202, 312938, 280183, 280185, 280188, 280191, 116354, 280194, 280208, 280211, 288408, 280218, 280222, 190118, 198310, 321195, 296622, 321200, 337585, 296626, 296634, 296637, 313027, 280260, 206536, 280264, 206539, 206541, 206543, 313044, 280276, 321239, 280283, 313052, 18140, 288478, 313055, 321252, 313066, 288494, 280302, 280304, 313073, 321266, 419570, 288499, 288502, 280314, 288510, 124671, 67330, 280324, 198405, 280331, 198416, 280337, 296723, 116503, 321304, 329498, 296731, 321311, 313121, 313123, 304932, 321316, 280363, 141101, 165678, 280375, 321336, 296767, 288576, 345921, 280388, 304968, 280393, 280402, 173907, 313171, 313176, 42842, 280419, 321381, 296809, 296812, 313201, 1920, 255873, 305028, 280454, 247688, 280464, 124817, 280468, 239510, 280473, 124827, 214940, 247709, 214944, 280487, 313258, 321458, 296883, 124853, 214966, 296890, 10170, 288700, 296894, 190403, 296900, 280515, 337862, 165831, 280521, 231379, 296921, 239586, 313320, 231404, 124913, 165876, 321528, 239612, 313340, 288764, 239617, 313347, 288773, 313358, 305176, 313371, 354338, 305191, 223273, 313386, 354348, 124978, 215090, 124980, 288824, 288826, 321595, 378941, 313406, 288831, 288836, 67654, 280651, 354382, 288848, 280658, 215123, 354390, 288855, 288859, 280669, 313438, 149599, 280671, 149601, 321634, 149603, 223327, 329830, 280681, 313451, 223341, 280687, 149618, 215154, 313458, 280691, 313464, 329850, 321659, 280702, 288895, 321670, 215175, 141446, 288909, 141455, 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, 280891, 289087, 280897, 280900, 305480, 239944, 280906, 239947, 305485, 305489, 379218, 280919, 354653, 354656, 313700, 313705, 280937, 190832, 280946, 223606, 313720, 280956, 239997, 280959, 313731, 199051, 240011, 289166, 240017, 297363, 190868, 240021, 297365, 297368, 297372, 141725, 297377, 289186, 297391, 289201, 240052, 289207, 289210, 305594, 281024, 289218, 289221, 289227, 281045, 281047, 166378, 305647, 281075, 174580, 240124, 281084, 305662, 305664, 240129, 305666, 305668, 223749, 240132, 281095, 223752, 150025, 338440, 223757, 281102, 223763, 223765, 281113, 322074, 281116, 281121, 182819, 281127, 281135, 150066, 158262, 158266, 289342, 281154, 322115, 158283, 281163, 281179, 338528, 338532, 281190, 199273, 281196, 19053, 158317, 313973, 297594, 281210, 158347, 133776, 314003, 117398, 314007, 289436, 174754, 330404, 289448, 133801, 174764, 314029, 314033, 240309, 133817, 314045, 314047, 314051, 199364, 297671, 158409, 289493, 363234, 289513, 289522, 289525, 289532, 322303, 289537, 322310, 264969, 322314, 322318, 281361, 281372, 322341, 215850, 281388, 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, 289687, 240535, 297883, 289694, 289696, 289700, 289712, 281529, 289724, 52163, 183260, 281567, 289762, 322534, 297961, 183277, 322550, 134142, 322563, 314372, 175134, 322599, 322610, 314421, 281654, 314427, 314433, 207937, 314441, 207949, 322642, 314456, 281691, 314461, 281702, 281704, 314474, 281708, 281711, 289912, 248995, 306341, 306344, 306347, 322734, 306354, 142531, 199877, 289991, 306377, 289997, 249045, 363742, 363745, 298216, 330988, 126190, 216303, 322801, 388350, 257302, 363802, 199976, 199978, 314671, 298292, 298294, 257334, 216376, 380226, 298306, 224584, 224587, 224594, 216404, 306517, 150870, 314714, 224603, 159068, 314718, 265568, 314723, 281960, 150890, 306539, 314732, 314736, 290161, 216436, 306549, 298358, 314743, 306552, 290171, 314747, 306555, 298365, 290174, 224641, 281987, 298372, 314756, 281990, 224647, 265604, 298377, 314763, 142733, 298381, 314768, 224657, 306581, 314773, 314779, 314785, 314793, 282025, 282027, 241068, 241070, 241072, 282034, 241077, 150966, 298424, 306618, 282044, 323015, 306635, 306640, 290263, 290270, 290275, 339431, 282089, 191985, 282098, 290291, 282101, 241142, 191992, 290298, 151036, 290302, 282111, 290305, 175621, 306694, 192008, 323084, 257550, 282127, 290321, 282130, 323090, 290325, 282133, 241175, 290328, 282137, 290332, 241181, 282142, 282144, 290344, 306731, 290349, 290351, 290356, 28219, 282186, 224849, 282195, 282199, 282201, 306778, 159324, 159330, 314979, 298598, 323176, 224875, 241260, 323181, 257658, 315016, 282249, 290445, 282261, 298651, 282269, 323229, 298655, 323231, 61092, 282277, 306856, 282295, 323260, 282300, 323266, 282310, 323273, 282319, 306897, 241362, 306904, 282328, 298714, 52959, 216801, 282337, 241380, 216806, 323304, 282345, 12011, 282356, 323318, 282364, 282367, 306945, 323330, 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, 298901, 44948, 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, 241701, 102438, 217127, 282669, 323630, 282681, 290877, 282687, 159811, 315463, 315466, 192589, 307278, 192596, 176213, 307287, 307290, 217179, 315482, 192605, 315483, 233567, 299105, 200801, 217188, 299109, 307303, 315495, 356457, 45163, 307307, 315502, 192624, 307314, 323700, 299126, 233591, 299136, 307329, 315524, 307338, 233613, 241813, 307352, 299164, 299167, 315552, 184479, 184481, 315557, 184486, 307370, 307372, 184492, 307374, 307376, 323763, 184503, 299191, 176311, 307386, 258235, 307388, 176316, 307390, 307385, 299200, 184512, 307394, 299204, 307396, 184518, 307399, 323784, 233679, 307409, 307411, 176343, 299225, 233701, 307432, 184572, 282881, 184579, 282893, 323854, 291089, 282906, 291104, 233766, 295583, 176435, 307508, 315701, 332086, 307510, 307512, 168245, 307515, 307518, 282942, 282947, 323917, 282957, 110926, 233808, 323921, 315733, 323926, 233815, 315739, 323932, 299357, 242018, 242024, 299373, 315757, 250231, 242043, 315771, 299388, 299391, 291202, 299398, 242057, 291212, 299405, 291222, 315801, 283033, 242075, 291226, 61855, 291231, 283042, 291238, 291241, 127403, 127405, 291247, 299440, 127407, 299444, 127413, 291254, 283062, 127417, 291260, 127421, 127424, 299457, 127429, 127431, 127434, 315856, 127440, 176592, 315860, 176597, 127447, 283095, 299481, 127449, 176605, 242143, 127455, 127457, 291299, 127463, 242152, 291305, 127466, 176620, 127469, 127474, 291314, 291317, 127480, 135672, 291323, 233979, 127485, 291330, 127494, 283142, 135689, 233994, 127497, 127500, 291341, 233998, 127506, 234003, 234006, 127511, 152087, 283161, 234010, 135707, 242202, 135710, 242206, 242208, 291361, 242220, 291378, 152118, 234038, 234041, 315961, 70213, 242250, 111193, 242275, 299620, 242279, 168562, 184952, 135805, 135808, 291456, 373383, 299655, 135820, 316051, 225941, 316054, 299672, 135834, 373404, 299677, 225948, 135839, 299680, 225954, 299684, 135844, 242343, 209576, 242345, 373421, 135870, 135873, 135876, 135879, 299720, 299723, 299726, 225998, 226002, 119509, 226005, 226008, 299740, 242396, 201444, 299750, 283368, 234219, 283372, 226037, 283382, 316151, 234231, 234236, 226045, 242431, 234239, 209665, 234242, 299778, 242436, 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, 316294, 226182, 234375, 308105, 226185, 234379, 201603, 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, 234437, 226239, 226245, 234439, 234443, 291788, 234446, 193486, 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, 234634, 234636, 177293, 234640, 275602, 234643, 308373, 226453, 234647, 234648, 275608, 234650, 308379, 324757, 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, 300292, 300294, 275719, 234760, 177419, 300299, 242957, 300301, 275725, 177424, 283917, 349464, 283939, 259367, 292143, 283951, 300344, 226617, 243003, 283963, 226628, 300357, 283973, 177482, 283983, 316758, 357722, 316766, 316768, 292192, 218464, 292197, 316774, 243046, 218473, 284010, 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, 292421, 243268, 284231, 226886, 128584, 284234, 366155, 317004, 276043, 284238, 226895, 284241, 194130, 284243, 300628, 284245, 292433, 284247, 317015, 235097, 243290, 276052, 276053, 284249, 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, 284440, 300828, 300830, 276255, 300832, 325408, 300834, 317221, 227109, 358183, 186151, 276268, 300845, 243504, 300850, 284469, 276280, 325436, 358206, 276291, 366406, 276295, 300872, 292681, 153417, 358224, 284499, 276308, 284502, 317271, 178006, 276315, 292700, 317279, 284511, 227175, 292715, 300912, 292721, 284529, 300915, 284533, 292729, 317306, 284540, 292734, 325512, 169868, 276365, 317332, 358292, 284564, 284566, 350106, 284572, 276386, 284579, 276388, 358312, 317353, 284585, 276395, 292776, 292784, 276402, 358326, 161718, 358330, 276411, 276418, 276425, 301009, 301011, 301013, 292823, 358360, 301017, 301015, 292828, 276446, 153568, 276448, 276452, 292839, 276455, 292843, 276460, 178161, 227314, 276466, 325624, 276472, 317435, 276476, 276479, 276482, 276485, 317446, 276490, 292876, 317456, 276496, 317458, 178195, 243733, 243740, 317468, 317472, 325666, 243751, 292904, 276528, 243762, 309298, 325685, 325689, 235579, 325692, 235581, 178238, 276539, 276544, 284739, 325700, 292934, 243785, 276553, 350293, 350295, 309337, 227418, 350299, 194649, 350302, 194654, 350304, 178273, 309346, 227423, 194660, 350308, 309350, 309348, 292968, 309352, 309354, 301163, 350313, 350316, 227430, 301167, 276583, 350321, 276590, 284786, 276595, 350325, 252022, 227440, 350328, 292985, 301178, 350332, 292989, 301185, 292993, 350339, 317570, 317573, 350342, 350345, 350349, 301199, 317584, 325777, 350354, 350357, 350359, 350362, 350366, 276638, 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, 317833, 178572, 285070, 285077, 178583, 227738, 317853, 276896, 317858, 342434, 285093, 317864, 285098, 276907, 235955, 276917, 293304, 293307, 293314, 309707, 293325, 317910, 293336, 235996, 317917, 293343, 358880, 276961, 293346, 227810, 276964, 293352, 236013, 293364, 301562, 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, 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, 137946, 113378, 203491, 228069, 277223, 342760, 285417, 56041, 56043, 277232, 228081, 56059, 310015, 285441, 310020, 285448, 310029, 228113, 285459, 277273, 293659, 326430, 228128, 285474, 293666, 228135, 318248, 277291, 318253, 293677, 285489, 301876, 293685, 285494, 301880, 285499, 301884, 293696, 310080, 277317, 293706, 277322, 277329, 162643, 310100, 301911, 301913, 277337, 301921, 400236, 236397, 162671, 326514, 310134, 236408, 15224, 277368, 416639, 416640, 113538, 310147, 416648, 39817, 187274, 277385, 301972, 424853, 277405, 277411, 310179, 293798, 293802, 236460, 277426, 293811, 276579, 293817, 293820, 203715, 326603, 276586, 293849, 293861, 228327, 228328, 318442, 228330, 228332, 326638, 277486, 318450, 293876, 293877, 285686, 302073, 121850, 293882, 302075, 244731, 285690, 293887, 277504, 277507, 277511, 293899, 277519, 293908, 302105, 293917, 293939, 318516, 277561, 277564, 310336, 7232, 293956, 277573, 228422, 293960, 310344, 277577, 277583, 203857, 293971, 310355, 310359, 236632, 277594, 138332, 277598, 203872, 277601, 285792, 310374, 203879, 310376, 228460, 318573, 203886, 187509, 285815, 367737, 285817, 302205, 285821, 392326, 285831, 253064, 294026, 302218, 285835, 162964, 384148, 187542, 302231, 285849, 302233, 285852, 302237, 285854, 285856, 302241, 285862, 277671, 302248, 64682, 277678, 294063, 294065, 302258, 277687, 294072, 318651, 294076, 277695, 318657, 244930, 302275, 130244, 302277, 228550, 302282, 310476, 302285, 302288, 310481, 302290, 203987, 302292, 302294, 310486, 302296, 384222, 310498, 285927, 318698, 302315, 228592, 294132, 138485, 228601, 204026, 228606, 204031, 64768, 310531, 138505, 228617, 318742, 204067, 277798, 130345, 277801, 113964, 285997, 277804, 285999, 277807, 113969, 277811, 318773, 318776, 277816, 286010, 277819, 294204, 417086, 277822, 286016, 302403, 294211, 384328, 277832, 277836, 294221, 294223, 326991, 277839, 277842, 277847, 277850, 179547, 277853, 146784, 277857, 302436, 277860, 294246, 327015, 310632, 327017, 351594, 277864, 277869, 277872, 351607, 310648, 277880, 310651, 277884, 277888, 310657, 351619, 294276, 310659, 327046, 277892, 253320, 310665, 318858, 277894, 277898, 277903, 310672, 351633, 277905, 277908, 277917, 310689, 277921, 130468, 228776, 277928, 277932, 310703, 277937, 310710, 130486, 310712, 277944, 310715, 277947, 302526, 228799, 277950, 277953, 302534, 310727, 245191, 64966, 277959, 277963, 302541, 277966, 302543, 310737, 277971, 228825, 163290, 277978, 310749, 277981, 277984, 310755, 277989, 277991, 187880, 277995, 310764, 286188, 278000, 228851, 310772, 278003, 278006, 40440, 212472, 278009, 40443, 286203, 310780, 40448, 228864, 286214, 228871, 302603, 302614, 302617, 286233, 302621, 286240, 146977, 187939, 40484, 294435, 40486, 286246, 294440, 40488, 294439, 294443, 40491, 294445, 286248, 310831, 40499, 40502, 212538, 40507, 40511, 40513, 228933, 327240, 40521, 286283, 40525, 40527, 212560, 400976, 228944, 40533, 147032, 40537, 40539, 40541, 278109, 40544, 40548, 40550, 40552, 286312, 40554, 286313, 310892, 40557, 40560, 188022, 122488, 294521, 343679, 294537, 310925, 286354, 278163, 302740, 122517, 278168, 179870, 327333, 229030, 212648, 278188, 302764, 278192, 319153, 278196, 302781, 319171, 302789, 294599, 278216, 294601, 302793, 343757, 212690, 319187, 286420, 278227, 229076, 286425, 319194, 278235, 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, 280021, 188252, 237409, 294776, 360317, 294785, 327554, 40840, 40851, 294803, 188312, 294811, 237470, 319390, 40865, 319394, 294817, 294821, 311209, 180142, 343983, 294831, 188340, 40886, 319419, 294844, 294847, 237508, 393177, 294876, 294879, 294883, 294890, 311279, 278513, 237555, 311283, 278516, 278519, 237562 ]
0776b2d9cd274a2cde062a66b39a6e7075038cdd
b16ada0eac5c472317629963f1a39c21c906b883
/Chapter 11/RxSwift.playground/Pages/replay.xcplaygroundpage/Contents.swift
c60dea257a04014ec3cb58e798ad7f2980d81dbb
[]
no_license
Nemexur/RxSwift-Book-Ray-Wenderlich
ec1e54e2a3560ef0c1e0727626cda767eff2fa1c
f35176ba5043e7ff83714544e11226f0a2ab5c31
refs/heads/master
2020-05-24T16:13:24.552505
2019-05-18T22:14:05
2019-05-18T22:14:05
187,350,917
0
0
null
null
null
null
UTF-8
Swift
false
false
5,195
swift
import UIKit import RxSwift import RxCocoa let elementsPerSecond = 1 let maxElements = 5 let replayedElements = 1 let replayDelay: TimeInterval = 3 //let sourceObservable = Observable<Int>.create { observer in // var value = 1 // let timer = DispatchSource.timer(interval: 1.0 / // Double(elementsPerSecond), queue: .main) { // if value <= maxElements { // observer.onNext(value) // value = value + 1 // } // } // return Disposables.create { // timer.suspend() // } //}/*.replay(replayedElements)*/.replayAll() /* Interval timers are incredibly easy to create with RxSwift. Not only that, but they are also easy to cancel: since Observable.interval(_:scheduler:) generates an observable sequence, subscriptions can simply dispose() the returned disposable to cancel the subscription and stop the timer */ /* It is notable that the first value is emitted at the specified duration after a subscriber starts observing the sequence. Also, the timer won't start before this point. The subscription is the trigger that kicks it off. */ // You cast elementsPerSecond to the RxTimeInterval type which happens to be a Double. This simply is the number of seconds to wait between emitted elements. If you used a number directly, the compiler would automatically have inferred the literal value to be of the appropriate type. // Также если ко второму подписчику, который подпишется через 3 секунды сделать некоторый replay в случае если каждый новый элемент появляется через 2 секнуды, то у нас сначала появится replay элемент, а вот уже потом через 1 секунды поступит элемент от Observable // Будет просто выдавать через 1 секунды элементы, начиная с 0 let sourceObservable = Observable<Int> .interval(RxTimeInterval(elementsPerSecond), scheduler: MainScheduler.instance) /* As you can see in the timeline view, values emitted by Observable.interval(_:scheduler:) are signed integers starting from 0. Should you need different values, you can simply map(_:) them. In most real life cases, the value emitted by the timer is simply ignored. But it can make a convenient index. */ .replay(replayedElements) /* The second replay operator you can use is replayAll(). This one should be used with caution: only use it in scenarios where you know the total number of buffered elements will stay reasonable. For example, it’s appropriate to use replayAll() in the context of HTTP requests. You know the approximate memory impact of retaining the data returned by a query. On the other hand, using replayAll() on a sequence that may not terminate and may produce a lot of data will quickly clog your memory. This could grow to the point where the OS jettisons your application! */ let sourceTimeline = TimelineView<Int>.make() let replayedTimeline = TimelineView<Int>.make() let stack = UIStackView.makeVertical([ UILabel.makeTitle("replay"), UILabel.make("Emit \(elementsPerSecond) per second:"), sourceTimeline, UILabel.make("Replay \(replayedElements) after \(replayDelay) sec:"), replayedTimeline]) _ = sourceObservable.subscribe(sourceTimeline) DispatchQueue.main.asyncAfter(deadline: .now() + replayDelay) { /* In the settings you used, replayedElements is equal to 1. It configures the replay(_:) operator to only buffer the last element from the source observable. The animated timeline shows that the second subscriber receives elements 3 and 4 in the same time frame. By the time it subscribes, it gets both the latest buffer element (3) and the one that happens to be emitted just right when subscription occurs. The timeline view shows them stacked up since the time they arrive is about the same (although not exactly the same). */ _ = sourceObservable.subscribe(replayedTimeline) } /* Now since replay(_:) creates a connectable observable, you need to connect it to its underlying source to start receiving items. If you forget this, subscribers will never receive anything. */ /* Connectable observables are a special class of observables. Regardless of their number of subscribers, they won't start emitting items until you call their connect() method. While this is beyond the scope of this chapter, remember that a few operators return ConnectableObservable<E>, not Observable<E>. These operators are: replay(_:) replayAll() multicast(_:) publish() */ _ = sourceObservable.connect() let hostView = setupHostView() hostView.addSubview(stack) hostView // Support code -- DO NOT REMOVE class TimelineView<E>: TimelineViewBase, ObserverType where E: CustomStringConvertible { static func make() -> TimelineView<E> { return TimelineView(width: 400, height: 100) } public func on(_ event: Event<E>) { switch event { case .next(let value): add(.Next(String(describing: value))) case .completed: add(.Completed()) case .error(_): add(.Error()) } } }
[ -1 ]
235abbe307f84215c916e2a067988037cd5b8e1f
ed923906b21995a15fd18ddd5238ae26f96e6085
/Sources/UserDefaults+PFExtension.swift
27fd5f9e9ae4c32a08997c0d8e8ef216e7ea0519
[ "MIT" ]
permissive
pengfei2015/PFSwiftExtension
68755c14aeafffdee18c1a97a923f6ae7b00eee0
7f4c153bf91c47894222d5c30f7fb7fa39956031
refs/heads/master
2021-09-23T18:06:02.420845
2018-09-26T09:11:24
2018-09-26T09:11:24
116,897,727
0
0
null
null
null
null
UTF-8
Swift
false
false
1,061
swift
// // UserDefaults+Extension.swift // Extensions // // Created by 飞流 on 2017/11/10. // Copyright © 2017年 飞流. All rights reserved. // import UIKit private let kKeyPrefix = "com.qufaya.qzzb." extension UserDefaults { @discardableResult class func executeOnceWithShortKey(_ shortKey: Key, excute: () -> Void) -> Bool { let key = kKeyPrefix + shortKey if UserDefaults.standard.object(forKey: key) == nil { UserDefaults.standard.set(key, forKey: key) excute() return true } else { return false } } class func executePeriodic(with shortKey: Key, shortestIntervals: TimeInterval, excute: () -> Void) { let key = kKeyPrefix + shortKey let preTimeInterval = UserDefaults.standard.double(forKey: key) let nowTimeInterval = Date().timeIntervalSince1970 if preTimeInterval + shortestIntervals <= nowTimeInterval { UserDefaults.standard.set(nowTimeInterval, forKey: key) excute() } } }
[ -1 ]
40c70ebbf73e6ac22d46c8003791b491cb257a53
10e9471bbec2fbf8fd408d631dd0af6996f7bd5d
/Sources/CANHackUI/Model/CANHackManager.swift
b131f8622334aae0b09705449deb1622c4e94fe4
[]
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
1,540
swift
// // CANHackManager.swift // SmartCar // // Created by Robert Smith on 4/27/20. // Copyright © 2020 Robert Smith. All rights reserved. // #if canImport(UIKit) import SwiftUI import Combine import CANHack import AppFolder public class CANHackManager: ObservableObject { public var decoderBinding: Binding<CarDecoder> { return Binding(get: { self.decoderDocument.decoder }) { (newValue) in self.decoderDocument.decoder = newValue } } public private(set) var decoderDocument: CarDecoderDocument! public private(set) var messageSetDocument: MessageSetDocument? lazy public private(set) var scratch: MessageSetDocument = { return MessageSetDocument(fileURL: AppFolder.Documents.url.appendingPathComponent("scratch.csv")) }() public func openMessageSet(at url: URL) { messageSetDocument = MessageSetDocument(fileURL: url) messageSetDocument!.open(completionHandler: { _ in self.objectWillChange.send() }) } public init() { let url = AppFolder.Documents.url.appendingPathComponent("mainDecoder.json") decoderDocument = CarDecoderDocument(fileURL: url) if !FileManager.default.fileExists(atPath: url.path) { decoderDocument.save(to: url, for: .forCreating, completionHandler: nil) } else { decoderDocument.open(completionHandler: { _ in self.objectWillChange.send() }) } } } #endif
[ -1 ]
bd3a472c53a34794e3a28775e251d08c4489b985
84ef0e780c659d9b618b8219268b3add8a52418c
/Other Projects/iPadOS Scenes/BehindTheScenes/ContentView.swift
6da776177102c6c301e0d0d21c32024527d3a20a
[ "MIT" ]
permissive
guangqiang-liu/SwiftUI
57042a8ca01a5889d5e99b19d511ea829021e348
ec256804f9234257e637883c12da48fa9aea7663
refs/heads/master
2020-06-28T11:58:35.123023
2019-07-31T14:14:41
2019-07-31T14:14:41
200,228,828
2
0
MIT
2019-08-02T12:12:54
2019-08-02T12:12:54
null
UTF-8
Swift
false
false
369
swift
// // ContentView.swift // BehindTheScenes // // Created by Simeon Saint-Saens on 4/6/19. // Copyright © 2019 Two Lives Left. All rights reserved. // import SwiftUI struct ContentView : View { let count: Int var body: some View { VStack { Text("Scene \(count)") Text("This is a SwiftUI View 🚀") } } }
[ -1 ]
4201daf4a1e1b18358cd7c324bbc382bd0578e17
2c266f6f5f5cd94353a71d24e178756b52e5bcf4
/NewsUI/CommonClass/AsyncImage/AsyncImage.swift
23ed4c70db1b57238149fb2312677448833d52d6
[]
no_license
vigneshKumarD/SwiftUINews
6e03a8b5be4d4177e01b3386df04f9abdb336f08
dcb73e3f1836fc77a57eb334c5d09de2f975b88f
refs/heads/master
2022-04-20T20:06:59.769532
2020-04-27T10:45:19
2020-04-27T10:45:19
255,817,042
0
0
null
2020-04-27T10:45:20
2020-04-15T05:45:13
Swift
UTF-8
Swift
false
false
1,102
swift
// // AsyncImage.swift // AsyncImage // // Created by Vadym Bulavin on 2/13/20. // Copyright © 2020 Vadym Bulavin. All rights reserved. // https://www.vadimbulavin.com/asynchronous-swiftui-image-loading-from-url-with-combine-and-swift/ import SwiftUI struct AsyncImage<Placeholder: View>: View { @ObservedObject private var loader: ImageLoader private let placeholder: Placeholder? private let configuration: (Image) -> Image init(url: URL, cache: ImageCache? = nil, placeholder: Placeholder? = nil, configuration: @escaping (Image) -> Image = { $0 }) { loader = ImageLoader(url: url, cache: cache) self.placeholder = placeholder self.configuration = configuration } var body: some View { image .onAppear(perform: loader.load) .onDisappear(perform: loader.cancel) } private var image: some View { Group { if loader.image != nil { configuration(Image(uiImage: loader.image!)) } else { placeholder } } } }
[ -1 ]
e0998fa653a57bbdf96269e1c838b6de73dbc44d
c207981dc301e93b6fe63dc72d60a2232a8bff0e
/Demo5/TableViewDemo1/ViewControllers/UserListViewController/UserListViewController.swift
46fc228dba645a2b02c1731551ae0838b11fa499
[]
no_license
MostafaBelihi/iOS-Workshop-Mansoura
13a1a7902abc345e55c6c219b4b40c1c466df88b
5fab464fca873f1bc7bf447b097ecdcbdbf954e6
refs/heads/master
2022-11-29T22:52:30.172768
2020-08-21T13:44:43
2020-08-21T13:44:43
null
0
0
null
null
null
null
UTF-8
Swift
false
false
2,031
swift
// // UserListViewController.swift // TableViewDemo1 // // Created by Mahmoud Ibaraheim on 8/8/18. // Copyright © 2018 MahmoudOrganization. All rights reserved. // import UIKit class UserListViewController: UIViewController,UITableViewDataSource,UITableViewDelegate { @IBOutlet weak var usersTableView: UITableView! lazy var usersDataSource:[User] = [User(userImage: UIImage(named: "account_green")!, userName: "Name 0", userAddress: "Address 0"), User(userImage: UIImage(named: "account_green")!, userName: "Name 1", userAddress: "Address 1"), User(userImage: UIImage(named: "account_green")!, userName: "Name 2", userAddress: "Address 2"), User(userImage: UIImage(named: "account_green")!, userName: "Name 3", userAddress: "Address 3")] override func viewDidLoad() { super.viewDidLoad() usersTableView.dataSource = self usersTableView.delegate = self } func numberOfSections(in tableView: UITableView) -> Int { return 1 } func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return usersDataSource.count } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "UserCustomeTableCell", for: indexPath) as! UserCustomeTableCell let currentUser = usersDataSource[indexPath.row] cell.userImageView.image = currentUser.userImage cell.usernameLbl.text = currentUser.userName cell.userAddressLbl.text = currentUser.userAddress return cell } func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { print("IndexPath Section = \(indexPath.section) Row = \(indexPath.row)") let selectedUser = usersDataSource[indexPath.row] print("User name \(selectedUser.userName)") } }
[ -1 ]
e3b614f561b0f8a0b916982f4c259233991eb006
714601a7eaa5869827fe8100596690604f3ad550
/sample/SceneDelegate.swift
454a993f67f2e2bfcc72b1f590117aaa4be5df59
[]
no_license
ghelich/charts
94990d9a1a9af46811889ca2e3a7fb630ddcbd3a
233098169827de117b57210088409df5364b4b02
refs/heads/main
2023-03-22T11:51:55.672976
2021-03-13T15:53:58
2021-03-13T15:53:58
347,409,846
0
0
null
null
null
null
UTF-8
Swift
false
false
2,290
swift
// // SceneDelegate.swift // sample // // Created by hossin ghelich on 3/12/21. // import UIKit class SceneDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow? func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). guard let _ = (scene as? UIWindowScene) else { return } } func sceneDidDisconnect(_ scene: UIScene) { // Called as the scene is being released by the system. // This occurs shortly after the scene enters the background, or when its session is discarded. // Release any resources associated with this scene that can be re-created the next time the scene connects. // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead). } func sceneDidBecomeActive(_ scene: UIScene) { // Called when the scene has moved from an inactive state to an active state. // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. } func sceneWillResignActive(_ scene: UIScene) { // Called when the scene will move from an active state to an inactive state. // This may occur due to temporary interruptions (ex. an incoming phone call). } func sceneWillEnterForeground(_ scene: UIScene) { // Called as the scene transitions from the background to the foreground. // Use this method to undo the changes made on entering the background. } func sceneDidEnterBackground(_ scene: UIScene) { // Called as the scene transitions from the foreground to the background. // Use this method to save data, release shared resources, and store enough scene-specific state information // to restore the scene back to its current state. } }
[ 393221, 163849, 393228, 393231, 393251, 352294, 344103, 393260, 393269, 213049, 376890, 385082, 393277, 376906, 327757, 254032, 368728, 180314, 254045, 180322, 376932, 286833, 286845, 286851, 417925, 262284, 360598, 286880, 377003, 377013, 164029, 327872, 180418, 377030, 377037, 377047, 418008, 418012, 377063, 327915, 205037, 393457, 393461, 393466, 418044, 385281, 336129, 262405, 180491, 336140, 164107, 262417, 368913, 262423, 377118, 377121, 262437, 254253, 336181, 262455, 393539, 262473, 344404, 213333, 418135, 262497, 418145, 262501, 213354, 246124, 262508, 262512, 213374, 385420, 393613, 262551, 262553, 385441, 385444, 262567, 385452, 262574, 393649, 385460, 262587, 344512, 262593, 360917, 369119, 328178, 328180, 328183, 328190, 254463, 328193, 164362, 328207, 410129, 393748, 262679, 377372, 188959, 385571, 377384, 197160, 33322, 352822, 270905, 197178, 418364, 188990, 369224, 385610, 270922, 352844, 385617, 352865, 262761, 352875, 344694, 352888, 336513, 377473, 385671, 148106, 213642, 377485, 352919, 98969, 344745, 361130, 336556, 385714, 434868, 164535, 336568, 164539, 328379, 328387, 352969, 344777, 418508, 385743, 385749, 139998, 189154, 369382, 361196, 418555, 344832, 336644, 344837, 344843, 328462, 361231, 394002, 336660, 418581, 418586, 434971, 369436, 262943, 369439, 418591, 418594, 336676, 418600, 418606, 369464, 361274, 328516, 336709, 328520, 336712, 361289, 328523, 336715, 361300, 213848, 426842, 361307, 197469, 361310, 254813, 361318, 344936, 361323, 361335, 328574, 369544, 361361, 222129, 345036, 115661, 386004, 345046, 386012, 386019, 386023, 328690, 435188, 328703, 328710, 418822, 377867, 328715, 361490, 386070, 271382, 336922, 345119, 377888, 214060, 345134, 345139, 361525, 386102, 361537, 377931, 345172, 189525, 156762, 402523, 361568, 148580, 345200, 361591, 386168, 361594, 410746, 214150, 345224, 386187, 345247, 361645, 345268, 402615, 361657, 337093, 402636, 328925, 165086, 66783, 328933, 222438, 328942, 386286, 386292, 206084, 328967, 345377, 345380, 353572, 345383, 263464, 337207, 345400, 378170, 369979, 386366, 337224, 337230, 337235, 263509, 353634, 337252, 402792, 271731, 378232, 337278, 271746, 181639, 353674, 181644, 361869, 181650, 181655, 230810, 181671, 181674, 181679, 181682, 337330, 181687, 370105, 181691, 181697, 361922, 337350, 181704, 337366, 271841, 329192, 361961, 329195, 116211, 337399, 402943, 337416, 329227, 419341, 419345, 329234, 419351, 345626, 419357, 345631, 419360, 370208, 394787, 419363, 370214, 419369, 394796, 419377, 419386, 206397, 214594, 419401, 353868, 419404, 173648, 419408, 214611, 419412, 403040, 345702, 222831, 370298, 353920, 403073, 403076, 345737, 198282, 403085, 403092, 345750, 419484, 345758, 345763, 419492, 345766, 419498, 419502, 370351, 419507, 337588, 419510, 419513, 419518, 337601, 403139, 337607, 419528, 419531, 419536, 272083, 394967, 419543, 419545, 345819, 419548, 419551, 345829, 419560, 337643, 419564, 337647, 370416, 337671, 362249, 362252, 395022, 362256, 321300, 345888, 362274, 378664, 354107, 345916, 354112, 370504, 329545, 345932, 370510, 354132, 247639, 337751, 370520, 313181, 354143, 354157, 345965, 345968, 345971, 345975, 403321, 1914, 354173, 395148, 247692, 337809, 247701, 329625, 436127, 436133, 247720, 337834, 362414, 337845, 190393, 346059, 247760, 346064, 346069, 419810, 329699, 354275, 190440, 354314, 346140, 436290, 395340, 378956, 436307, 338005, 100454, 329833, 329853, 329857, 329868, 411806, 329886, 346273, 362661, 100525, 387250, 379067, 387261, 256193, 395467, 346317, 411862, 256214, 411865, 411869, 411874, 379108, 411877, 387303, 346344, 395496, 338154, 387307, 346350, 338161, 387314, 436474, 321787, 379135, 411905, 411917, 379154, 395539, 387350, 387353, 338201, 182559, 338212, 395567, 248112, 362823, 436556, 321880, 362844, 379234, 354674, 321911, 420237, 379279, 272787, 354728, 338353, 338382, 272849, 248279, 256474, 182755, 338404, 338411, 330225, 248309, 248332, 330254, 199189, 420377, 330268, 191012, 330320, 199250, 191069, 346722, 248427, 191085, 338544, 346736, 191093, 346743, 346769, 150184, 174775, 248505, 174778, 363198, 223936, 355025, 273109, 355029, 264919, 256735, 338661, 264942, 363252, 338680, 264965, 338701, 256787, 363294, 199455, 396067, 346917, 396070, 215854, 355123, 355141, 355144, 338764, 355151, 330581, 330585, 387929, 355167, 265056, 265059, 355176, 355180, 355185, 412600, 207809, 379849, 347082, 396246, 330711, 248794, 248799, 347106, 437219, 257009, 265208, 265215, 199681, 338951, 330761, 330769, 330775, 248863, 158759, 396329, 347178, 404526, 396337, 330803, 396340, 339002, 388155, 339010, 347208, 248905, 330827, 248915, 183384, 339037, 412765, 257121, 322660, 265321, 248952, 420985, 330886, 330890, 347288, 248986, 44199, 380071, 339118, 249018, 339133, 126148, 322763, 330959, 330966, 265433, 265438, 388320, 363757, 388348, 339199, 396552, 175376, 175397, 273709, 372016, 437553, 347442, 199989, 175416, 396601, 208189, 437567, 175425, 437571, 126279, 437576, 437584, 331089, 437588, 331094, 396634, 175451, 437596, 429408, 175458, 175461, 175464, 265581, 175478, 249210, 175484, 175487, 249215, 175491, 249219, 249225, 249228, 249235, 175514, 175517, 396703, 396706, 175523, 355749, 396723, 388543, 380353, 216518, 380364, 339406, 372177, 339414, 249303, 413143, 339418, 339421, 249310, 339425, 249313, 339429, 339435, 249329, 69114, 372229, 208399, 380433, 175637, 405017, 134689, 339504, 265779, 421442, 413251, 265796, 265806, 224854, 224858, 339553, 257636, 224871, 372328, 257647, 372338, 224885, 224888, 224891, 224895, 372354, 126597, 421509, 224905, 11919, 224911, 224914, 126611, 224917, 224920, 126618, 208539, 224923, 224927, 224930, 224933, 257705, 224939, 224943, 257713, 224949, 257717, 257721, 224954, 257725, 224960, 257733, 224966, 224970, 257740, 224976, 257745, 339664, 257748, 224982, 257752, 224987, 257762, 224996, 225000, 225013, 257788, 225021, 339711, 257791, 225027, 257796, 339722, 257802, 257805, 225039, 257808, 249617, 225044, 167701, 372500, 257815, 225049, 257820, 225054, 184096, 397089, 257825, 225059, 339748, 225068, 257837, 413485, 225071, 225074, 257843, 225077, 257846, 225080, 397113, 225083, 397116, 257853, 225088, 225094, 225097, 257869, 257872, 225105, 397140, 225109, 225113, 257881, 257884, 257887, 225120, 257891, 413539, 225128, 257897, 339818, 225138, 339827, 257909, 225142, 372598, 257914, 257917, 225150, 257922, 380803, 225156, 339845, 257927, 225166, 397201, 225171, 380823, 225176, 225183, 372698, 372704, 372707, 356336, 380919, 393215, 372739, 405534, 266295, 266298, 217158, 421961, 200786, 356440, 217180, 430181, 266351, 356467, 266365, 192640, 266375, 381069, 225425, 250003, 225430, 250008, 356507, 225439, 135328, 192674, 225442, 438434, 225445, 438438, 225448, 438441, 356521, 225451, 258223, 225456, 430257, 225459, 225462, 225468, 389309, 225472, 372931, 225476, 430275, 389322, 225485, 225488, 225491, 266454, 225494, 225497, 225500, 225503, 225506, 356580, 225511, 217319, 225515, 225519, 381177, 397572, 389381, 381212, 356638, 356641, 356644, 356647, 266537, 389417, 356650, 356656, 332081, 307507, 340276, 356662, 397623, 332091, 225599, 201030, 348489, 332107, 151884, 430422, 348503, 332118, 250201, 250203, 250211, 340328, 250217, 348523, 348528, 332153, 356734, 389503, 332158, 438657, 332162, 389507, 348548, 356741, 250239, 332175, 160152, 373146, 340380, 373149, 70048, 356783, 373169, 266688, 324032, 201158, 340452, 127473, 217590, 340473, 324095, 324100, 324103, 324112, 340501, 324118, 324122, 340512, 332325, 324134, 381483, 356908, 324141, 324143, 356917, 324150, 324156, 168509, 348734, 324161, 324165, 356935, 348745, 381513, 324171, 324174, 324177, 389724, 332381, 373344, 340580, 348777, 381546, 119432, 340628, 184983, 373399, 258723, 332455, 332460, 389806, 332464, 332473, 381626, 332484, 332487, 332494, 357070, 357074, 332512, 332521, 340724, 332534, 373499, 348926, 389927, 348979, 152371, 348983, 340792, 398141, 357202, 389971, 357208, 389979, 430940, 357212, 357215, 439138, 201580, 201583, 349041, 340850, 381815, 430967, 324473, 398202, 119675, 340859, 324476, 430973, 324479, 340863, 324482, 373635, 324485, 324488, 185226, 381834, 324493, 324496, 324499, 430996, 324502, 324511, 422817, 324514, 201638, 398246, 373672, 324525, 5040, 111539, 324534, 5047, 324539, 324542, 398280, 349129, 340940, 340942, 209874, 340958, 431073, 398307, 340964, 209896, 201712, 209904, 349173, 381947, 201724, 349181, 431100, 431107, 349203, 209944, 209948, 357411, 250915, 250917, 357419, 209966, 209969, 209973, 209976, 209980, 209988, 209991, 431180, 209996, 341072, 349268, 250968, 210011, 373853, 341094, 210026, 210028, 210032, 349296, 210037, 210042, 210045, 349309, 152704, 349313, 160896, 210053, 210056, 349320, 259217, 373905, 210068, 210072, 210078, 210081, 210085, 210089, 210096, 210100, 324792, 210108, 357571, 210116, 210128, 210132, 333016, 210139, 210144, 218355, 218361, 275709, 275713, 242947, 275717, 275723, 333075, 349460, 333079, 251161, 349486, 349492, 415034, 210261, 365912, 259423, 374113, 251236, 374118, 333164, 234867, 390518, 357756, 374161, 112021, 349591, 357793, 333222, 259516, 415168, 366035, 415187, 366039, 415192, 415194, 415197, 415200, 333285, 415208, 366057, 366064, 415217, 415225, 423424, 415258, 415264, 366118, 415271, 382503, 349739, 144940, 415279, 415282, 415286, 210488, 415291, 415295, 349762, 333396, 374359, 333400, 366173, 423529, 423533, 210547, 415354, 333440, 267910, 267929, 333512, 259789, 366301, 333535, 153311, 366308, 366312, 431852, 399086, 366319, 210673, 366322, 399092, 366326, 333566, 268042, 210700, 366349, 210707, 399129, 333595, 210720, 366384, 358192, 210740, 366388, 358201, 325441, 366403, 325447, 341831, 341835, 341839, 341844, 415574, 358235, 341852, 350046, 399200, 399208, 268144, 358256, 358260, 341877, 399222, 325494, 333690, 325505, 333699, 399244, 333709, 333725, 333737, 382891, 382898, 350153, 358348, 333777, 219094, 399318, 358372, 350190, 350194, 333819, 350204, 350207, 325633, 325637, 350214, 219144, 268299, 333838, 350225, 186388, 350232, 333851, 350238, 350241, 374819, 350245, 350249, 350252, 178221, 350257, 350260, 350272, 243782, 350281, 350286, 374865, 342113, 252021, 342134, 374904, 268435, 333998, 334012, 260299, 350411, 350417, 350423, 211161, 350426, 350449, 375027, 358645, 350459, 350462, 350465, 350469, 268553, 350477, 268560, 350481, 432406, 350487, 325915, 350491, 325918, 350494, 325920, 350500, 194854, 350505, 358701, 391469, 350510, 358705, 358714, 358717, 383307, 358738, 334162, 383331, 383334, 391531, 383342, 334204, 268669, 194942, 391564, 366991, 334224, 268702, 342431, 375209, 375220, 334263, 326087, 358857, 195041, 334312, 104940, 375279, 416255, 350724, 186898, 342546, 350740, 342551, 334359, 342555, 334364, 416294, 350762, 252463, 358962, 334386, 334397, 358973, 252483, 219719, 399957, 334425, 326240, 375401, 334466, 334469, 391813, 162446, 326291, 342680, 342685, 260767, 342711, 244410, 260798, 334530, 260802, 350918, 154318, 342737, 391895, 154329, 416476, 64231, 113389, 342769, 203508, 375541, 342777, 391938, 391949, 375569, 326417, 375572, 375575, 375580, 162592, 334633, 326444, 383794, 326452, 326455, 375613, 244542, 260925, 375616, 326463, 326468, 342857, 326474, 326479, 326486, 416599, 342875, 244572, 326494, 433001, 400238, 326511, 211826, 211832, 392061, 351102, 359296, 252801, 260993, 351105, 400260, 211846, 342921, 342931, 252823, 400279, 392092, 400286, 252838, 359335, 211885, 252846, 400307, 351169, 359362, 351172, 170950, 187335, 326599, 359367, 359383, 359389, 383968, 343018, 359411, 261109, 261112, 244728, 383999, 261130, 261148, 359452, 211999, 261155, 261160, 359471, 375868, 343132, 384099, 384102, 384108, 367724, 187503, 343155, 384115, 212095, 351366, 384136, 384140, 384144, 351382, 384152, 384158, 384161, 351399, 384169, 367795, 244917, 384182, 367801, 384189, 384192, 351424, 343232, 367817, 244938, 384202, 253132, 326858, 384209, 146644, 351450, 384225, 343272, 351467, 359660, 384247, 351480, 384250, 351483, 351492, 343307, 384270, 359695, 261391, 253202, 261395, 384276, 384284, 245021, 384290, 253218, 245032, 171304, 384299, 351535, 376111, 245042, 326970, 384324, 343366, 212296, 212304, 367966, 343394, 367981, 343410, 155000, 327035, 245121, 245128, 253321, 155021, 384398, 245137, 245143, 245146, 245149, 343453, 245152, 245155, 155045, 245158, 40358, 245163, 114093, 327090, 343478, 359867, 384444, 146878, 327108, 327112, 384457, 359887, 359891, 368093, 155103, 343535, 343540, 368120, 343545, 409092, 253445, 359948, 359951, 245295, 359984, 343610, 400977, 400982, 179803, 155241, 245358, 155255, 155274, 368289, 245410, 425639, 425652, 425663, 155328, 245463, 155352, 155356, 212700, 155364, 245477, 155372, 245487, 212723, 409336, 155394, 155404, 245528, 155423, 360224, 155439, 204592, 155444, 155448, 417596, 384829, 384831, 360262, 155463, 155477, 376665, 155484, 261982, 425823, 155488, 376672, 155492, 327532, 261997, 376686, 262000, 262003, 425846, 262006, 147319, 262009, 327542, 262012, 155517, 155523, 155526, 360327, 376715, 155532, 262028, 262031, 262034, 262037, 262040, 262043, 155550, 253854, 262046, 262049, 262052, 327590, 155560, 155563, 155566, 327613, 393152, 311244, 393170, 155604, 155620, 253924, 155622, 253927, 327655, 360432, 393204, 360439, 253944, 393209, 155647 ]
992a71144d885928fcbeb46eca729ff0e528e6fa
bf6fad9102a9e15fe595cc44580796b66b286318
/Source/JsonWebToken/JwtBodyContent.swift
a7a151bfa46cd1b74dc0d6117fd7750099d02912
[ "BSD-3-Clause" ]
permissive
hyuni/virgil-sdk-x
ec8e5b43dba23e137eb40f7e772b876abe16a6ba
1fd0938b436ffce461fb2396beca38c67bd77f6f
refs/heads/master
2020-04-12T15:27:09.316795
2018-12-13T16:58:32
2018-12-13T16:58:32
null
0
0
null
null
null
null
UTF-8
Swift
false
false
6,739
swift
// // Copyright (C) 2015-2018 Virgil Security Inc. // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // (1) Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // // (2) Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in // the documentation and/or other materials provided with the // distribution. // // (3) Neither the name of the copyright holder nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING // IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Lead Maintainer: Virgil Security Inc. <[email protected]> // import Foundation /// Declares error types and codes /// /// - base64UrlStrIsInvalid: If given base64 string is invalid @objc(VSSJwtBodyContentError) public enum JwtBodyContentError: Int, Error { case base64UrlStrIsInvalid = 1 } /// Class representing JWT Body content @objc(VSSJwtBodyContent) public class JwtBodyContent: NSObject { /// Issuer containing application id /// - Note: Can be taken [here](https://dashboard.virgilsecurity.com) @objc public var appId: String { return self.container.appId } /// Subject as identity @objc public var identity: String { return self.container.identity } /// Timestamp in seconds with expiration date @objc public var expiresAt: Date { return self.container.expiresAt } /// Timestamp in seconds with issued date @objc public var issuedAt: Date { return self.container.issuedAt } /// Dictionary with additional data @objc public var additionalData: [String: String]? { return self.container.additionalData } /// String representation @objc public let stringRepresentation: String private let container: Container private struct Container: Codable { let appId: String let identity: String let expiresAt: Date let issuedAt: Date let additionalData: [String: String]? private enum CodingKeys: String, CodingKey { case appId = "iss" case identity = "sub" case issuedAt = "iat" case expiresAt = "exp" case additionalData = "ada" } init(appId: String, identity: String, expiresAt: Date, issuedAt: Date, additionalData: [String: String]?) { self.appId = appId self.identity = identity self.expiresAt = expiresAt self.issuedAt = issuedAt self.additionalData = additionalData } init(from decoder: Decoder) throws { let values = try decoder.container(keyedBy: Container.CodingKeys.self) let issuer = try values.decode(String.self, forKey: .appId) let subject = try values.decode(String.self, forKey: .identity) self.appId = issuer.replacingOccurrences(of: "virgil-", with: "") self.identity = subject.replacingOccurrences(of: "identity-", with: "") self.additionalData = try? values.decode(Dictionary.self, forKey: .additionalData) self.issuedAt = try values.decode(Date.self, forKey: .issuedAt) self.expiresAt = try values.decode(Date.self, forKey: .expiresAt) } func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encode("virgil-" + self.appId, forKey: .appId) try container.encode("identity-" + self.identity, forKey: .identity) try container.encode(self.issuedAt, forKey: .issuedAt) try container.encode(self.expiresAt, forKey: .expiresAt) if let additionalData = self.additionalData { try container.encode(additionalData, forKey: .additionalData) } } } /// Initializer /// /// - Parameters: /// - appId: Issuer containing application id. Can be taken [here](https://dashboard.virgilsecurity.com) /// - identity: identity (must be equal to RawSignedModel identity when publishing card) /// - expiresAt: expiration date /// - issuedAt: issued date /// - additionalData: dictionary with additional data /// - Throws: Rethrows from JSONEncoder @objc public init(appId: String, identity: String, expiresAt: Date, issuedAt: Date, additionalData: [String: String]? = nil) throws { let container = Container(appId: appId, identity: identity, expiresAt: expiresAt, issuedAt: issuedAt, additionalData: additionalData) self.container = container let encoder = JSONEncoder() encoder.dateEncodingStrategy = .custom(DateUtils.timestampDateEncodingStrategy) self.stringRepresentation = try encoder.encode(container).base64UrlEncodedString() super.init() } /// Imports JwtBodyContent from base64Url encoded string /// /// - Parameter base64UrlEncoded: base64Url encoded string with JwtBodyContent /// - Throws: JwtBodyContentError.base64UrlStrIsInvalid If given base64 string is invalid /// Rethrows from JSONDencoder @objc public init(base64UrlEncoded: String) throws { guard let data = Data(base64UrlEncoded: base64UrlEncoded) else { throw JwtBodyContentError.base64UrlStrIsInvalid } self.stringRepresentation = base64UrlEncoded let decoder = JSONDecoder() decoder.dateDecodingStrategy = .custom(DateUtils.timestampDateDecodingStrategy) self.container = try decoder.decode(Container.self, from: data) super.init() } }
[ -1 ]
a8cb1e2f8d259228bcd937290f3b02451572c3b2
0413ea0e678a2bfacb292ada2d405281acdfa4cd
/SMC App/SMC App/ProfessorContainerViewController.swift
5e1e8648ed6705133674b986959a5086c6d3cc8d
[]
no_license
SMCProgrammingClub/Profsquire_iOS
871c45ff3b01b7b39b0bb19a79a5c62837a7da27
577a506756299c8c58ab4490714401ef23470529
refs/heads/master
2021-01-10T15:29:44.472035
2015-07-18T02:50:41
2015-07-18T02:50:41
36,137,049
0
0
null
null
null
null
UTF-8
Swift
false
false
3,400
swift
// // ProfessorContainerViewController.swift // SMC App // // Created by Harrison Balogh on 6/19/15. // Copyright (c) 2015 CPC iOS. All rights reserved. // import UIKit class ProfessorContainerViewController: UIViewController, GradeDistributionBarDelegate{ @IBOutlet weak var gradeBar_base: UIImageView! @IBOutlet var gradeBarView: GradeDistributionBarView! @IBOutlet weak var ratingNumberLabel: UILabel! @IBOutlet weak var ratingCircle: UIImageView! var selectedCourse: Course? override func viewDidLoad() { super.viewDidLoad() gradeBarView.delegate = self if selectedCourse != nil { ratingNumberLabel.text = "\(Int(Double(selectedCourse!.grade_distribution.avgGPA)/4.0 * 100.0))" println("Grades for selected course:\n A: \(selectedCourse!.grade_distribution.a)\n B: \(selectedCourse!.grade_distribution.b)\n C: \(selectedCourse!.grade_distribution.c)\n D: \(selectedCourse!.grade_distribution.d)\n F: \(selectedCourse!.grade_distribution.f)") } else { gradeBarView.hidden = true gradeBar_base.hidden = true } } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() } // MARK: - Grade Distribution Bar Delegate Functions func getA_w() -> Int { let base_w = Int(gradeBar_base.frame.width) if selectedCourse == nil { return 0 } return 1 + Int(Double(selectedCourse!.grade_distribution.a)/Double(selectedCourse!.grade_distribution.total) * Double(base_w)) } func getB_x() -> Int { return getA_w() } func getB_w() -> Int { let base_w = Int(gradeBar_base.frame.width) if selectedCourse == nil { return 0 } return 1 + Int(Double(selectedCourse!.grade_distribution.b)/Double(selectedCourse!.grade_distribution.total) * Double(base_w)) } func getC_x() -> Int { return getB_w() + getB_x() } func getC_w() -> Int { let base_w = Int(gradeBar_base.frame.width) if selectedCourse == nil { return 0 } return 1 + Int(Double(selectedCourse!.grade_distribution.c)/Double(selectedCourse!.grade_distribution.total) * Double(base_w)) } func getD_x() -> Int { return getC_w() + getC_x() } func getD_w() -> Int { let base_w = Int(gradeBar_base.frame.width) if selectedCourse == nil { return 0 } return 1 + Int(Double(selectedCourse!.grade_distribution.d)/Double(selectedCourse!.grade_distribution.total) * Double(base_w)) } func getF_x() -> Int { return getD_w() + getD_x() } func getF_w() -> Int { let base_w = Int(gradeBar_base.frame.width) if selectedCourse == nil { return 0 } return 1 + Int(Double(selectedCourse!.grade_distribution.f)/Double(selectedCourse!.grade_distribution.total) * Double(base_w)) } /* // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { // Get the new view controller using segue.destinationViewController. // Pass the selected object to the new view controller. } */ }
[ -1 ]
0ddfa7298fb8c28df78af20f06e47eddbcdd2583
c99447d9d47a2f8cd21c0ce88a8b72d210af82de
/Moonshot/ContentView.swift
560cd0faa86b719c75556407d30f32c9c7fbade5
[]
no_license
valerie-makes/Moonshot
ad763b3b4977ad02bbe2cca999699cfb412e3151
c8286ecde11fa3a7c92b749eac59be6fbcabc5fe
refs/heads/main
2023-05-26T18:11:27.578358
2021-06-08T11:57:42
2021-06-08T11:57:42
null
0
0
null
null
null
null
UTF-8
Swift
false
false
2,027
swift
// // ContentView.swift // Moonshot // // Created by David Bailey on 05/06/2021. // import SwiftUI struct ContentView: View { static let astronauts: [Astronaut] = Bundle.main.decode("astronauts.json") static let missions: [Mission] = Bundle.main.decode("missions.json") @State private var showingCrew = false var body: some View { NavigationView { List(Self.missions) { mission in NavigationLink( destination: MissionView( mission: mission, missions: Self.missions, astronauts: Self.astronauts ) ) { Image(mission.image) .resizable() .scaledToFit() .frame(width: 44, height: 44) VStack(alignment: .leading) { Text(mission.displayName) .font(.headline) if showingCrew { ForEach( mission.getCrewNames(with: Self.astronauts), id: \.self ) { Text($0) .font(.caption) } } else { Text(mission.formattedLaunchDate) } } } } .navigationTitle("Moonshot") .toolbar { ToolbarItem { Button(action: { showingCrew.toggle() }) { Image(systemName: showingCrew ? "clock" : "person.2") Text(showingCrew ? "Show launch" : "Show crew") } } } } } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } }
[ -1 ]
21fc35186b13a3e867aae675cff2e53644e2ad72
80e55abe4e318d0f13691ec0ae9dba4840df5aa4
/SuperHeroMarvel/Proyect/Home/Models/SuperHero.swift
9a80be4ac60563a375c1bc6931fe37a52fce9f13
[]
no_license
ddelucas/superHeroMarvel
29f3b8a23503bd985851dfd05aa664f030f2cab9
a64d45678f716336ee511fd6739b8a20bc82ca9d
refs/heads/master
2020-07-04T02:14:43.400643
2019-03-25T18:31:30
2019-03-25T18:31:30
null
0
0
null
null
null
null
UTF-8
Swift
false
false
894
swift
// // SuperHero.swift // SuperHeroMarvel // // Created by JJ Montes on 25/03/2019. // Copyright © 2019 jjmontes. All rights reserved. // import Foundation import UIKit class SuperHero { var name: String? var photo: String? var realName: String? var height: String? var power: String? var abilities: String? var groups: [String?]? var photoData: Data? init() {} convenience init(superHeroEntity: SuperHeroEntity) { self.init() self.name = superHeroEntity.name self.photo = superHeroEntity.photo self.realName = superHeroEntity.realName self.height = superHeroEntity.height self.power = superHeroEntity.power self.abilities = superHeroEntity.abilities self.groups = superHeroEntity.groups?.components(separatedBy: ",") self.photoData = nil } }
[ -1 ]
78da9c913d0371bcddcaa7c05b364c0a70ca3186
769d0e6dac71291ed59e6f0494896dd32764af95
/EasyTask/AppDelegate.swift
c2aa0d57a011c85cd1ff26f34808e59061c3e1a4
[]
no_license
dennyalfath/EasyTask
7a50aa60f7c4776bcdff7bd12ca67ef22a800313
ca847108130cba6a2c6ce54b862c6061cb3de015
refs/heads/master
2022-12-07T13:56:28.902205
2020-09-03T16:10:53
2020-09-03T16:10:53
292,614,200
0
0
null
null
null
null
UTF-8
Swift
false
false
3,706
swift
// // AppDelegate.swift // EasyTask // // Created by Denny Alfath on 02/09/20. // Copyright © 2020 Denny Alfath. All rights reserved. // import UIKit import CoreData @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. } // MARK: - Core Data stack lazy var persistentContainer: NSPersistentContainer = { /* The persistent container for the application. This implementation creates and returns a container, having loaded the store for the application to it. This property is optional since there are legitimate error conditions that could cause the creation of the store to fail. */ let container = NSPersistentContainer(name: "EasyTask") container.loadPersistentStores(completionHandler: { (storeDescription, error) in if let error = error as NSError? { // Replace this implementation with code to handle the error appropriately. // fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. /* Typical reasons for an error here include: * The parent directory does not exist, cannot be created, or disallows writing. * The persistent store is not accessible, due to permissions or data protection when the device is locked. * The device is out of space. * The store could not be migrated to the current model version. Check the error message to determine what the actual problem was. */ fatalError("Unresolved error \(error), \(error.userInfo)") } }) return container }() // MARK: - Core Data Saving support func saveContext () { let context = persistentContainer.viewContext if context.hasChanges { do { try context.save() } catch { // Replace this implementation with code to handle the error appropriately. // fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. let nserror = error as NSError fatalError("Unresolved error \(nserror), \(nserror.userInfo)") } } } }
[ 199680, 379906, 253443, 418820, 249351, 328199, 384007, 377866, 379914, 372747, 199180, 326668, 329233, 349202, 186387, 350738, 262677, 330774, 324121, 245274, 377371, 345630, 340511, 384032, 362529, 394795, 404523, 245293, 262701, 349744, 361524, 337975, 343609, 375867, 333373, 418366, 152127, 339009, 413250, 214087, 352840, 377930, 337994, 370253, 330319, 200784, 173647, 436306, 333395, 244308, 374358, 329815, 254042, 402522, 326239, 322658, 340579, 244329, 333422, 349295, 204400, 173169, 339571, 330868, 344693, 268921, 343167, 192639, 344707, 330884, 336516, 266374, 385670, 346768, 268434, 409236, 336548, 333988, 356520, 377001, 379048, 361644, 402614, 361655, 325308, 339132, 343231, 403138, 337092, 244933, 322758, 337606, 367816, 257738, 342736, 245460, 257751, 385242, 366300, 165085, 350433, 328931, 395495, 363755, 343276, 346348, 338158, 325358, 212722, 251122, 350453, 338679, 393465, 351482, 264961, 115972, 268552, 346890, 362251, 328460, 336139, 257814, 333592, 397084, 257824, 362272, 377120, 334631, 336680, 389416, 384298, 204589, 271150, 366383, 328497, 257842, 339768, 326969, 257852, 384828, 386365, 204606, 375615, 339792, 358737, 389970, 361299, 155476, 366931, 330584, 361305, 257880, 362843, 429406, 374112, 353633, 439137, 355184, 361333, 332156, 337277, 245120, 260992, 389506, 380802, 264583, 337290, 155020, 348565, 337813, 250262, 155044, 333221, 373671, 333736, 252845, 356781, 288174, 370610, 268210, 210356, 342452, 370102, 338362, 327612, 358335, 380352, 201157, 333766, 393670, 339400, 349128, 347081, 358347, 187334, 336325, 272848, 379856, 155603, 399317, 249302, 379863, 372697, 155102, 329182, 182754, 360429, 338927, 330224, 379895, 201723, 257020, 254461 ]
6aff128f05e418b34f2dfb2fe148a68efcc98d0e
1f3e2b1b2b9b7651aca730be56fd80d08675a3d7
/ChattingApplication/CustomCells/ConversationListCell.swift
c436745db36da3432562da48a80587c30b3ed0db
[]
no_license
KrishnaGunjal/Firechat
749c955600ed267cbce41499b3e09248cc7d6a54
02b7f1ed9a223536e4bb56cd276edbc82439b6da
refs/heads/master
2020-04-08T02:59:34.108987
2019-10-02T05:57:54
2019-10-02T05:57:54
158,957,199
0
0
null
null
null
null
UTF-8
Swift
false
false
607
swift
// // ConversationListCell.swift // ChattingApplication // // Created by krishna gunjal on 24/11/18. // Copyright © 2018 krishna gunjal. All rights reserved. // import UIKit class ConversationListCell: UITableViewCell { @IBOutlet weak var profileImage: UIImageView! @IBOutlet weak var contactName: UILabel! @IBOutlet weak var time: UILabel! @IBOutlet weak var lastMessage: UILabel! override func awakeFromNib() { super.awakeFromNib() } override func setSelected(_ selected: Bool, animated: Bool) { super.setSelected(selected, animated: animated) } }
[ -1 ]
09f4ebf4edd51dc45136088297ba374f79e82740
ca8c26d87c2cb014dc9470f080128d9116dd694b
/Shopping app/Model/Currency.swift
0bab4c246fe52787f413843592ea926ecd1b0cde
[]
no_license
RefactoringiOS/Assignment
8f41a1d5856c000c3031f6af46299b3b9f73062e
2eeffa1e092f7d5c079a2e264f8b46d674022d31
refs/heads/master
2020-08-06T21:10:29.856952
2019-10-08T13:03:42
2019-10-08T13:03:42
null
0
0
null
null
null
null
UTF-8
Swift
false
false
313
swift
// // Currency.swift // Shopping app // // Created by KOVIGROUP on 06/10/2019. // Copyright © 2019 KOVIGROUP. All rights reserved. // import UIKit struct Currency : Decodable { let rates: String let rate: Double func getString() { print( "rates: \(rates), rate: \(rate)" ) } }
[ -1 ]
6577730b27cb72807300e2420f2cb4a35a472ccb
633afbaca6d2571c621c33d49aa63877a617d1a5
/VenueFinder/VenueFinder/Model/RestaurantVGModel.swift
6309be393d2de6daaf74379faf988ad12319b5e9
[]
no_license
SimoneGrant/VenueFinder
b69db5a1e63b22390196e51b4dfb4861f4f7f3d9
fd78e1f214f8f9156f82c51f1608d41833f9542f
refs/heads/master
2021-09-04T13:04:49.493012
2017-11-28T18:42:56
2017-11-28T18:42:56
110,286,328
0
0
null
2017-11-28T18:42:57
2017-11-10T19:46:50
Swift
UTF-8
Swift
false
false
1,178
swift
// // RestaurantVGModel.swift // VenueFinder // // Created by Simone Grant on 11/10/17. // Copyright © 2017 Simone Grant. All rights reserved. // import Foundation struct EntryItems: Decodable { let entries: [Entries] } struct Entries: Decodable { let distance: Float let website: String? let veg_level_description: String let long_description: LongDescription? let reviews_uri: String let city: String let country: String let postal_code: String? let neighborhood: String? let price_range: String let images: [Images]? let hours: [Schedule]? let name: String let region: String let categories: [String] let weighted_rating: String? let phone: String? let tags: [String]? let short_description: String let address1: String } struct LongDescription: Decodable { let wikitext: String private enum CodingKeys: String, CodingKey { case wikitext = "text/vnd.vegguide.org-wikitext" } } struct Images: Decodable { let files: [Files] } struct Files: Decodable { let uri: String } struct Schedule: Decodable { let hours: [String] let days: String }
[ -1 ]
1e3d60a87f12478087c1cfaa84f2a1efeeba1308
cbedb2001120f322debf8c7f011582081c68e4e1
/My First IOS App/My First IOS AppTests/My_First_IOS_AppTests.swift
90736dea076ce0e77a5253d1def7710ecfbe2203
[ "Apache-2.0" ]
permissive
tonilopezmr/Learning-Swift
6bc77487c78fcf3f9d98bf9538ad2b6ffa11f3d2
477a0fba7b6f34910f98d494058e097192c1c339
refs/heads/master
2021-01-10T02:43:59.208511
2017-11-21T16:46:55
2017-11-21T16:46:55
49,320,045
0
0
null
null
null
null
UTF-8
Swift
false
false
1,031
swift
// // My_First_IOS_AppTests.swift // My First IOS AppTests // // Created by Antonio López Marín on 25/01/16. // Copyright © 2016 Antonio López Marín. All rights reserved. // import XCTest @testable import My_First_IOS_App class My_First_IOS_AppTests: XCTestCase { override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. super.tearDown() } func testExample() { // This is an example of a functional test case. // Use XCTAssert and related functions to verify your tests produce the correct results. } func testPerformanceExample() { // This is an example of a performance test case. self.measureBlock { // Put the code you want to measure the time of here. } } }
[ 333828, 282633, 313357, 317467, 241692, 229413, 229424, 288828, 288833, 288834, 254027, 315476, 180311, 180312, 237663, 307299, 329829, 313447, 319598, 288879, 288889, 215164, 215178, 317587, 278677, 278704, 323762, 299187, 280762, 223419, 227524, 282831, 317664, 356576, 321772, 286958, 319763, 309529, 282909, 299293, 227616, 282913, 278816, 233762, 211238, 282919, 98610, 280887, 278842, 282939, 6481, 289110, 106847, 391520, 246127, 227725, 227726, 178582, 293274, 61857, 246178, 61859, 289194, 108972, 377264, 311738, 319930, 291267, 127428, 324039, 317901, 373197, 281040, 369116, 279013, 279029, 287241, 303631, 180771, 23092, 234036, 338490, 55881, 281166, 281171, 295519, 242277, 111208, 279146, 287346, 330379, 316049, 330387, 330388, 117397, 295576, 221852, 205487, 295599, 342706, 158394, 287422, 242386, 287452, 330474, 289518, 199414, 221948, 205568, 242433, 291585, 299776, 285444, 295697, 285458, 326433, 285487, 234294, 285497, 299849, 281433, 301918, 295776, 242529, 349026, 230248, 201577, 308076, 246641, 209783, 246648, 279417, 269178, 177019, 291712, 287622, 228234, 316298, 56208, 293781, 326553, 277403, 289698, 289703, 189374, 353216, 279498, 248796, 340961, 52200, 324586, 203757, 316405, 293886, 330763, 324625, 320536, 189474, 353367, 300135, 207979, 279660, 144496, 291959, 160891, 279685, 330888, 162961, 185493, 296086, 339102, 281771, 279728, 208058, 322749, 228542, 283847, 353479, 228563, 316627, 279765, 279774, 298212, 290022, 330984, 279785, 279792, 208124, 316669, 234755, 322824, 328971, 298291, 333117, 193859, 294218, 372043, 238927, 120148, 318805, 222559, 234850, 134506, 296303, 243056, 327024, 179587, 142729, 296335, 9619, 357786, 318875, 290207, 333220, 316842, 284089, 296392, 302540, 329173, 286172, 144867, 187878, 316902, 333300, 191990, 333303, 286202, 282114, 329225, 282129, 308756, 302623, 333343, 230943, 286244, 230959, 280130, 349763, 243274, 333388, 280147, 290390, 235095, 306776, 333408, 286306, 282213, 222832, 314998, 247416, 325245, 294529, 286343, 282273, 323236, 229029, 296632, 280257, 280267, 333517, 282318, 245457, 241361, 333521, 241365, 286423, 18138, 282339, 282348, 284401, 282358, 313081, 278272, 288512, 323331, 323332, 284431, 294678, 284442, 282400, 315171, 247590, 333610, 282417, 296755, 321337, 282434, 307011, 282438, 323406, 280410, 284514, 276327, 282474, 280430, 296814, 282480, 313203, 300918, 317304, 241540, 325515, 110480, 294807, 294809, 300963, 292771, 313254, 284587, 282549, 288697, 290746, 284619, 24532, 280541, 329695, 298980, 294886, 247785 ]
4dde3f899dd11bed646a90acccf4cd09191b4599
a0da19c04315c0f7f55c9d5b673f847e4333b266
/ViewController.swift
4195777c076ee4e9b7f0bdb8ca05e87227ab536d
[]
no_license
joynuelle/XcodePractice1
91a874443d89ed8a43d712d12f0fbbe49097936c
259d8a9f6090108582e856ab4771eeb9601e67e9
refs/heads/master
2020-05-22T19:53:51.633240
2019-05-13T21:53:55
2019-05-13T21:53:55
null
0
0
null
null
null
null
UTF-8
Swift
false
false
1,962
swift
// // ViewController.swift // HelloWorld // // Created by Joy Nuelle on 5/13/19. // Copyright © 2019 Joy Nuelle. All rights reserved. // import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. } @IBAction func showMessage(sender: UIButton) { // Initialize the dictionary for the emoji icons // If you forgot how to do it, refer to the previous chapter // Fill in the code below var emojiDict: [String: String] = ["🐼": "Panda", "🍟": "French Fries", "🥐": "Croissant", "🌟": "Star"] var wordToLookup = "🐼" var meaning = emojiDict[wordToLookup] wordToLookup = "🍟" meaning = emojiDict[wordToLookup] // The sender is the button that is tapped by the user. // Here we store the sender in the selectedButton constant let selectedButton = sender // Get the emoji from the title label of the selected button if let wordToLookup = selectedButton.titleLabel?.text { // Get the meaning of the emoji from the dictionary // Fill in the code below meaning = emojiDict[wordToLookup] // Change the line below to display the meaning of the emoji instead of Hello World let alertController = UIAlertController(title: "Meaning", message: meaning, preferredStyle: UIAlertController.Style.alert) alertController.addAction(UIAlertAction(title: "OK", style: UIAlertAction.Style.default, handler: nil)) present(alertController, animated: true, completion: nil) } } }
[ -1 ]
b8bd7bfaaed942fc8d1e7ca68bf371ae1abd5925
e0560521947e2381b92bb9355149ca4f687eb77d
/Darwin/Services/StitchHTTPService/StitchHTTPService/StitchHTTPServiceExports.swift
5eee3cbdba096fd96ea56ee4e14fcd0223d5d45c
[ "Apache-2.0" ]
permissive
malexandert/stitch-ios-sdk
9e14bfc88fd140f81828dd50993fbfa55ef9d5c8
a9ba5163455923cac87c58b41fd08695a6edd810
refs/heads/master
2023-02-27T22:27:00.750238
2020-01-27T11:28:51
2020-01-27T11:28:51
337,554,193
0
0
Apache-2.0
2021-02-09T22:31:35
2021-02-09T22:31:34
null
UTF-8
Swift
false
false
449
swift
// Re-exported classes, structs, protocols, and enums from StitchCoreHTTPService @_exported import struct StitchCoreHTTPService.HTTPCookie @_exported import enum StitchCoreHTTPService.HTTPMethod @_exported import struct StitchCoreHTTPService.HTTPRequest @_exported import class StitchCoreHTTPService.HTTPRequestBuilder @_exported import enum StitchCoreHTTPService.HTTPRequestBuilderError @_exported import struct StitchCoreHTTPService.HTTPResponse
[ -1 ]
f918b9469ccc8ebc8357b26e315bed46d9583a12
bbeaf4ae113445467a4fa54dbf2e7362299702a7
/gen/grammars-v4/datetime/datetimeBaseListener.swift
a1880427d2d7b96b12d3d17cc90364d5cb72e8f8
[]
no_license
johndpope/swift-walker-antlr
d52e675ebbed76dca2d850b5fcfd880b0bcf3997
30c3cc936e75157a7c541376d434cb68d0672df1
refs/heads/master
2021-01-21T16:44:04.315359
2018-01-18T15:48:22
2018-01-18T15:48:22
91,900,233
1
0
null
null
null
null
UTF-8
Swift
false
false
3,879
swift
// Generated from ./grammars-v4/datetime/datetime.g4 by ANTLR 4.7.1 import Antlr4 /** * This class provides an empty implementation of {@link datetimeListener}, * which can be extended to create a listener which only needs to handle a subset * of the available methods. */ open class datetimeBaseListener: datetimeListener { public init() { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterDate_time(_ ctx: datetimeParser.Date_timeContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitDate_time(_ ctx: datetimeParser.Date_timeContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterDay(_ ctx: datetimeParser.DayContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitDay(_ ctx: datetimeParser.DayContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterDate(_ ctx: datetimeParser.DateContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitDate(_ ctx: datetimeParser.DateContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterMonth(_ ctx: datetimeParser.MonthContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitMonth(_ ctx: datetimeParser.MonthContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterTime(_ ctx: datetimeParser.TimeContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitTime(_ ctx: datetimeParser.TimeContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterHour(_ ctx: datetimeParser.HourContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitHour(_ ctx: datetimeParser.HourContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterZone(_ ctx: datetimeParser.ZoneContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitZone(_ ctx: datetimeParser.ZoneContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterTwo_digit(_ ctx: datetimeParser.Two_digitContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitTwo_digit(_ ctx: datetimeParser.Two_digitContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterFour_digit(_ ctx: datetimeParser.Four_digitContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitFour_digit(_ ctx: datetimeParser.Four_digitContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterAlphanumeric(_ ctx: datetimeParser.AlphanumericContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitAlphanumeric(_ ctx: datetimeParser.AlphanumericContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func enterEveryRule(_ ctx: ParserRuleContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func exitEveryRule(_ ctx: ParserRuleContext) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func visitTerminal(_ node: TerminalNode) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ open func visitErrorNode(_ node: ErrorNode) { } }
[ -1 ]
1d3dc435b1da581bd61178e409fc317c59297cf3
fb6c6112334626259ed2a992018c3ff614d6b130
/Slidebar Menu/Controllers/PhotoViewController.swift
be368f65fb30137abf9e466648314650aefb2f15
[]
no_license
AdnannM/Slidebar-Menu
69c4aea17a300755e4937ffd2d32c3192e31647d
55e9059650c88afcb4b6e6fd258c902992d87dec
refs/heads/master
2023-08-06T00:47:06.243842
2021-08-26T12:30:07
2021-08-26T12:30:07
null
0
0
null
null
null
null
UTF-8
Swift
false
false
700
swift
// // PhotoViewController.swift // Slidebar Menu // // Created by Adnann Muratovic on 26.08.21. // import UIKit class PhotoViewController: UIViewController { @IBOutlet weak var menuButton: UIBarButtonItem! override func viewDidLoad() { super.viewDidLoad() addSlideBarMenu(leftMenuButton: menuButton) } /* // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepare(for segue: UIStoryboardSegue, sender: Any?) { // Get the new view controller using segue.destination. // Pass the selected object to the new view controller. } */ }
[ -1 ]