blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 2
625
| content_id
stringlengths 40
40
| detected_licenses
listlengths 0
47
| license_type
stringclasses 2
values | repo_name
stringlengths 5
116
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringclasses 643
values | visit_date
timestamp[ns] | revision_date
timestamp[ns] | committer_date
timestamp[ns] | github_id
int64 80.4k
689M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 16
values | gha_event_created_at
timestamp[ns] | gha_created_at
timestamp[ns] | gha_language
stringclasses 85
values | src_encoding
stringclasses 7
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 1
class | length_bytes
int64 4
6.44M
| extension
stringclasses 17
values | content
stringlengths 4
6.44M
| duplicates
listlengths 1
9.02k
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
14f1e46d73f0368e8d464789fac985468eb9ef30
|
9e572e8387b3a039a2d8da7185ed9fdb7a7db0be
|
/Messager/ChatLogCell.swift
|
077f2ca05a0d84da02856b7097a98a6beb20f642
|
[] |
no_license
|
ksupensa/iOS10-Messager
|
37622ae6af7acf0e1773b4e36dda28a282263e10
|
aa8ba46b85538279e9b21303ec3391ed7ea6ed26
|
refs/heads/master
| 2021-08-30T07:58:12.853785 | 2017-05-10T22:29:50 | 2017-05-10T22:29:50 | 114,493,910 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 4,119 |
swift
|
//
// ChatLogCell.swift
// Messager
//
// Created by Spencer Forrest on 21/03/2017.
// Copyright © 2017 Spencer Forrest. All rights reserved.
//
import UIKit
class ChatLogCell: UICollectionViewCell {
let txtV: UITextView = {
let tv = UITextView()
tv.backgroundColor = UIColor.clear
tv.translatesAutoresizingMaskIntoConstraints = false
tv.textAlignment = NSTextAlignment.center
tv.isEditable = false
tv.isSelectable = false
tv.isUserInteractionEnabled = true
tv.isScrollEnabled = false
return tv
}()
let bubbleV: UIView = {
let view = UIView()
view.translatesAutoresizingMaskIntoConstraints = false
view.layer.cornerRadius = 18
return view
}()
let messageImgView: UIImageView = {
let imageView = UIImageView()
imageView.layer.cornerRadius = 16
imageView.translatesAutoresizingMaskIntoConstraints = false
imageView.layer.masksToBounds = true
imageView.contentMode = UIViewContentMode.scaleAspectFit
imageView.backgroundColor = UIColor.purple
return imageView
}()
override init(frame: CGRect) {
super.init(frame: frame)
addSubview(bubbleV)
addSubview(txtV)
bubbleV.addSubview(messageImgView)
// Anchors: x, y, width, height
messageImgView.leftAnchor.constraint(equalTo: bubbleV.leftAnchor).isActive = true
messageImgView.topAnchor.constraint(equalTo: bubbleV.topAnchor).isActive = true
messageImgView.widthAnchor.constraint(equalTo: bubbleV.widthAnchor).isActive = true
messageImgView.heightAnchor.constraint(equalTo: bubbleV.heightAnchor).isActive = true
// Anchors: x, y, width, height
txtV.topAnchor.constraint(equalTo: self.topAnchor).isActive = true
// Anchors: x, y, width, height
bubbleV.topAnchor.constraint(equalTo: txtV.topAnchor).isActive = true
bubbleV.leftAnchor.constraint(equalTo: txtV.leftAnchor).isActive = true
bubbleV.rightAnchor.constraint(equalTo: txtV.rightAnchor).isActive = true
bubbleV.bottomAnchor.constraint(equalTo: txtV.bottomAnchor).isActive = true
}
func setImg(_ url: String? = nil){
messageImgView.loadImgFromCache(imgUrl: url)
}
var textW: NSLayoutConstraint!
var textH: NSLayoutConstraint!
var textRL: NSLayoutConstraint!
var bubbleW: NSLayoutConstraint!
var bubbleH: NSLayoutConstraint!
var bubbleRL: NSLayoutConstraint!
func setText(_ txt: String, isUser: Bool) {
let cellsize = CellSize.getCellSizeToFitText(txt, maxWidth: self.frame.width * 0.6)
txtV.attributedText = cellsize.attributedString
// Give size of the Cell
let size = cellsize.size!
let w = size.width
let h = size.height
// Update textView size et position
if let tw = textW, let th = textH, let trl = textRL {
tw.isActive = false
th.isActive = false
trl.isActive = false
}
textW = txtV.widthAnchor.constraint(equalToConstant: w)
textW.isActive = true
textH = txtV.heightAnchor.constraint(equalToConstant: h)
textH.isActive = true
let padding:CGFloat = 10
// Side of Text and Bubble depends on Contact and User
if isUser {
textRL = txtV.rightAnchor.constraint(equalTo: self.rightAnchor , constant: -padding)
textRL.isActive = true
bubbleV.backgroundColor = UIColor(r: 0, g: 137, b: 249)
txtV.textColor = UIColor.white
} else {
textRL = txtV.leftAnchor.constraint(equalTo: self.leftAnchor, constant: padding)
textRL.isActive = true
bubbleV.backgroundColor = UIColor(r: 230, g: 230, b: 230)
txtV.textColor = UIColor.black
}
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
|
[
-1
] |
7727681c21a7b928d202c0a07b4fc2fad266bf76
|
dd7f406364774c8036e866bf5a9cca2f2906583b
|
/car1/draw_car.swift
|
a01452860ab6b7b7a79e7b8ecf766ce3d2becc87
|
[] |
no_license
|
rotem154154/ai-car-swift
|
248173075220157b0dfc38db4740459eaa481491
|
b00820e530974d3eb6abafedf66b468045b80862
|
refs/heads/master
| 2022-02-16T09:10:20.645617 | 2019-07-24T02:19:16 | 2019-07-24T02:19:16 | 198,314,722 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 3,196 |
swift
|
//
// draw_car.swift
// car1
//
// Created by rotem israeli on 22/07/2019.
// Copyright © 2019 TandR. All rights reserved.
//
import Foundation
import SpriteKit
let pi = Float32(M_PI)
class draw_car{
var cr : car
var node : SKSpriteNode
var back_wheel1 : SKSpriteNode
var back_wheel2 : SKSpriteNode
var front_wheel1 : SKSpriteNode
var front_wheel2 : SKSpriteNode
var scene : GameScene
var wheel_base2 : Float32 = 30
init(scene : GameScene) {
cr = car()
self.scene = scene
self.node = SKSpriteNode(imageNamed: "car")
node.zPosition = 100
node.xScale = 0.2
node.yScale = 0.2
scene.addChild(node)
self.back_wheel1 = SKSpriteNode(imageNamed: "wheel")
self.back_wheel2 = SKSpriteNode(imageNamed: "wheel")
self.front_wheel1 = SKSpriteNode(imageNamed: "wheel")
self.front_wheel2 = SKSpriteNode(imageNamed: "wheel")
back_wheel1.zPosition = 99
front_wheel1.zPosition = 99
back_wheel1.position = CGPoint(x: CGFloat(-cr.wheel_base/2), y: CGFloat(wheel_base2/2))
front_wheel1.position = CGPoint(x: CGFloat(cr.wheel_base/2), y: CGFloat(wheel_base2/2))
front_wheel1.xScale = 0.1
front_wheel1.yScale = 0.2
back_wheel1.xScale = 0.1
back_wheel1.yScale = 0.2
scene.addChild(front_wheel1)
scene.addChild(back_wheel1)
back_wheel2.zPosition = 99
front_wheel2.zPosition = 99
back_wheel2.position = CGPoint(x: CGFloat(-cr.wheel_base/2), y: CGFloat(-wheel_base2/2))
front_wheel2.position = CGPoint(x: CGFloat(cr.wheel_base/2), y: CGFloat(-wheel_base2/2))
front_wheel2.xScale = 0.1
front_wheel2.yScale = 0.2
back_wheel2.xScale = 0.1
back_wheel2.yScale = 0.2
scene.addChild(front_wheel2)
scene.addChild(back_wheel2)
}
func update(){
cr.update()
let front_x = cr.x + cr.wheel_base/2 * cos(cr.rotation)
let front_y = cr.y + cr.wheel_base/2 * sin(cr.rotation)
let back_x = cr.x - cr.wheel_base/2 * cos(cr.rotation)
let back_y = cr.y - cr.wheel_base/2 * sin(cr.rotation)
node.position = CGPoint(x: CGFloat(cr.x),y: CGFloat(cr.y))
node.zRotation = CGFloat(cr.rotation)
let rot = -cr.rotation
let front_x1 = front_x + (wheel_base2/2 * sin(rot))
let front_y1 = front_y + (wheel_base2/2 * cos(rot))
let front_x2 = front_x - (wheel_base2/2 * sin(rot))
let front_y2 = front_y - (wheel_base2/2 * cos(rot))
let back_x1 = back_x + (wheel_base2/2 * sin(rot))
let back_y1 = back_y + (wheel_base2/2 * cos(rot))
let back_x2 = back_x - (wheel_base2/2 * sin(rot))
let back_y2 = back_y - (wheel_base2/2 * cos(rot))
back_wheel1.position = CGPoint(x: CGFloat(back_x1), y: CGFloat(back_y1))
front_wheel1.position = CGPoint(x: CGFloat(front_x1), y: CGFloat(front_y1))
back_wheel1.zRotation = node.zRotation
front_wheel1.zRotation = CGFloat(cr.rotation + cr.stering*(cr.right-cr.left))
back_wheel2.position = CGPoint(x: CGFloat(back_x2), y: CGFloat(back_y2))
front_wheel2.position = CGPoint(x: CGFloat(front_x2), y: CGFloat(front_y2))
back_wheel2.zRotation = node.zRotation
front_wheel2.zRotation = CGFloat(cr.rotation + cr.stering*(cr.right-cr.left))
}
}
|
[
-1
] |
f72793c66e81c9df72c8bcec3cbf72cc44d5b1dd
|
3ebd41be73f694669e8fdd46ef68d4c74ab2667c
|
/WeSplit/WeSplit/SceneDelegate.swift
|
a328a765625bfd44b2c25d1c9e7184c8ea11f9df
|
[] |
no_license
|
Pribzy/100DaysOfSwiftUI
|
66a727c68f69a109cbf577c57affa1fe7288171c
|
770a1aa0ad90523f4031cc023b09d98a07725b70
|
refs/heads/main
| 2023-06-30T00:37:45.781068 | 2021-08-03T08:25:55 | 2021-08-03T08:25:55 | 302,006,745 | 0 | 0 | null | 2021-01-25T09:52:06 | 2020-10-07T10:52:17 |
Swift
|
UTF-8
|
Swift
| false | false | 2,711 |
swift
|
//
// SceneDelegate.swift
// WeSplit
//
// Created by Pribelszki Levente on 2020. 10. 07..
//
import UIKit
import SwiftUI
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
// Create the SwiftUI view that provides the window contents.
let contentView = SplitView()
// Use a UIHostingController as window root view controller.
if let windowScene = scene as? UIWindowScene {
let window = UIWindow(windowScene: windowScene)
window.rootViewController = UIHostingController(rootView: contentView)
self.window = window
window.makeKeyAndVisible()
}
}
func sceneDidDisconnect(_ scene: UIScene) {
// Called as the scene is being released by the system.
// This occurs shortly after the scene enters the background, or when its session is discarded.
// Release any resources associated with this scene that can be re-created the next time the scene connects.
// The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead).
}
func sceneDidBecomeActive(_ scene: UIScene) {
// Called when the scene has moved from an inactive state to an active state.
// Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
}
func sceneWillResignActive(_ scene: UIScene) {
// Called when the scene will move from an active state to an inactive state.
// This may occur due to temporary interruptions (ex. an incoming phone call).
}
func sceneWillEnterForeground(_ scene: UIScene) {
// Called as the scene transitions from the background to the foreground.
// Use this method to undo the changes made on entering the background.
}
func sceneDidEnterBackground(_ scene: UIScene) {
// Called as the scene transitions from the foreground to the background.
// Use this method to save data, release shared resources, and store enough scene-specific state information
// to restore the scene back to its current state.
}
}
|
[
393221,
393228,
393231,
393251,
352294,
344103,
393260,
163892,
393269,
213049,
376890,
385082,
16444,
393277,
254020,
376906,
327757,
254032,
286804,
368728,
180314,
254045,
368736,
376932,
286833,
368753,
286845,
286851,
262284,
286880,
286889,
377003,
327872,
377030,
180432,
368854,
377047,
205037,
393457,
393461,
336124,
418044,
336129,
385281,
262405,
180491,
262417,
368913,
262423,
377121,
262437,
336181,
262455,
262473,
344404,
418135,
262497,
418145,
262501,
213354,
262508,
262512,
385420,
393613,
262551,
262553,
385444,
262567,
385452,
393649,
385460,
262587,
262593,
336326,
360917,
369119,
328178,
328180,
328183,
328190,
254463,
328193,
164362,
328207,
410129,
393748,
377372,
188959,
385571,
377384,
270905,
197178,
418364,
369224,
270922,
385610,
352844,
385617,
352865,
262761,
352875,
344694,
352888,
336513,
377473,
385671,
213642,
148106,
352919,
344745,
271018,
361130,
385714,
434868,
164535,
336568,
164539,
328379,
328387,
418508,
385749,
139998,
189154,
418540,
361196,
418555,
344832,
344837,
344843,
328462,
394002,
418581,
418586,
369436,
262943,
418591,
418594,
336676,
418600,
336681,
418606,
328498,
361274,
328516,
328520,
361289,
328523,
213848,
361307,
197469,
361310,
361318,
344936,
361323,
361335,
369544,
361361,
345036,
386004,
345046,
386012,
386019,
386023,
328710,
418822,
328715,
377867,
361490,
336922,
345119,
345134,
386102,
361537,
377931,
197708,
345172,
189525,
156762,
402523,
361568,
148580,
345200,
361591,
386168,
410746,
361599,
345224,
386187,
337048,
345247,
361645,
337072,
337076,
345268,
402615,
361657,
337093,
402636,
66783,
328933,
222438,
328942,
386286,
386292,
206084,
115973,
345377,
345380,
345383,
263464,
337207,
378170,
369979,
386366,
337224,
337230,
337235,
353634,
197987,
337252,
402792,
345449,
99692,
271731,
378232,
337278,
271746,
181639,
181644,
361869,
181650,
230810,
263585,
181671,
181674,
181679,
337330,
181682,
181687,
370105,
181691,
181697,
361922,
337350,
181717,
329192,
402943,
337416,
329227,
419345,
329234,
419351,
345631,
370208,
419360,
394787,
419363,
370214,
419369,
419377,
206397,
214594,
419408,
214611,
403040,
345702,
222831,
370298,
353920,
403076,
198282,
403085,
345750,
419492,
345766,
419498,
419502,
370351,
419507,
337588,
419510,
419513,
337601,
403139,
337607,
419528,
419531,
272083,
419543,
394967,
419545,
419548,
181982,
419551,
345829,
419560,
419564,
337647,
141052,
337661,
337671,
362249,
362252,
395022,
362256,
321300,
116512,
345888,
362274,
378664,
354107,
345916,
354112,
247618,
329545,
345932,
354124,
337743,
354132,
247639,
337751,
313181,
345965,
354157,
345968,
345971,
345975,
182136,
403321,
354173,
247692,
337809,
247701,
329625,
436133,
362414,
337845,
190393,
346059,
247760,
346064,
419810,
329699,
354275,
190440,
247790,
354314,
378956,
395340,
100454,
329857,
329868,
411806,
346273,
362661,
379067,
387261,
346317,
411862,
411865,
411869,
411874,
379108,
387303,
338154,
387307,
346350,
387314,
436474,
321787,
379135,
411905,
411917,
43279,
395539,
387350,
338201,
182559,
395567,
248112,
264502,
436556,
190797,
321880,
362844,
379234,
182642,
354674,
379279,
354728,
338353,
338382,
338387,
248279,
256474,
338404,
330225,
248309,
199165,
199189,
420377,
191012,
330320,
199250,
346722,
174696,
248427,
191085,
346736,
338544,
191093,
330384,
346769,
150184,
363198,
223936,
355025,
355029,
264919,
183006,
338661,
338665,
264942,
330479,
338680,
207620,
191240,
338701,
338712,
363294,
199455,
396067,
346917,
396070,
215854,
355123,
355141,
355144,
338764,
355151,
330581,
387929,
330585,
355167,
265056,
355185,
330612,
330643,
412600,
207809,
347082,
396246,
330711,
248794,
248799,
338928,
257009,
265208,
330750,
265215,
199681,
158759,
396329,
347178,
404526,
396337,
396340,
339002,
388155,
339010,
347208,
339037,
412765,
257121,
322660,
265321,
248952,
330886,
248986,
44199,
339118,
249015,
339133,
322763,
388320,
363757,
388348,
339199,
175376,
175397,
208167,
372016,
347442,
199989,
44343,
175416,
396601,
208189,
175425,
126279,
331089,
437588,
331094,
396634,
175451,
175458,
208228,
175461,
175464,
249210,
175484,
175487,
249215,
249219,
249228,
249235,
175514,
175517,
396706,
175523,
355749,
396723,
380353,
339401,
380364,
339406,
372177,
208338,
249303,
413143,
339418,
339421,
249310,
249313,
339425,
339429,
339435,
249329,
69114,
372229,
339464,
249355,
208399,
175637,
405017,
134689,
339504,
413251,
265796,
265806,
224854,
224858,
257636,
224871,
372328,
257647,
339572,
224885,
224888,
224891,
224895,
372354,
126597,
421509,
339593,
224905,
159375,
11919,
126611,
224917,
126618,
208539,
224923,
224927,
224930,
224933,
224943,
224949,
224954,
224960,
224966,
224970,
339664,
224976,
224982,
224987,
224996,
225000,
339696,
225013,
257788,
225021,
225027,
257796,
257805,
225039,
257808,
225044,
167701,
372500,
257815,
225049,
257820,
225054,
184096,
257825,
225059,
339748,
257837,
225071,
225074,
257843,
372533,
225077,
257846,
225080,
397113,
225083,
397116,
257853,
225088,
225094,
225097,
323404,
257869,
257872,
225105,
339795,
397140,
225109,
225113,
257881,
257884,
257887,
225120,
413539,
257891,
225128,
257897,
339818,
225138,
339827,
257909,
225142,
372598,
257914,
257917,
257922,
225156,
339845,
257927,
225166,
397201,
225171,
380823,
225176,
225183,
184245,
372698,
372704,
372707,
356336,
393215,
372739,
266298,
217158,
200786,
356440,
217180,
266365,
192640,
266375,
381069,
225425,
250003,
225430,
250008,
225439,
225442,
225445,
225448,
225451,
225456,
430257,
225459,
225462,
225468,
225472,
372931,
225476,
389322,
225485,
225488,
225494,
266454,
225497,
225500,
225503,
356580,
217319,
225515,
225519,
381177,
389381,
381212,
258333,
389417,
332081,
307507,
356662,
397623,
332091,
225599,
332098,
201030,
348489,
151884,
430422,
348503,
250201,
332126,
332130,
250211,
340328,
250217,
348523,
332153,
332158,
250239,
389503,
389507,
348548,
332175,
160152,
340380,
373169,
266688,
201158,
127473,
217590,
340473,
266757,
340512,
381483,
356908,
356917,
348734,
381513,
348745,
332381,
373344,
119432,
340628,
184983,
340639,
332455,
389806,
381626,
373450,
357070,
357074,
332512,
332521,
340724,
332534,
348926,
389927,
152371,
348983,
340792,
398141,
127815,
357202,
389971,
136024,
357208,
389979,
357212,
357215,
439138,
201580,
201583,
349041,
340850,
201589,
324473,
398202,
119675,
324476,
340859,
324479,
324482,
373635,
324485,
324488,
381834,
324493,
324496,
324499,
324502,
324511,
324525,
324534,
324539,
324542,
398280,
349129,
340940,
340942,
398307,
340964,
201712,
381947,
201724,
431100,
349203,
250915,
357411,
250917,
357419,
341072,
349268,
250968,
341094,
349296,
349309,
152704,
160896,
349313,
210053,
373905,
251045,
333003,
333010,
333016,
218355,
218361,
275709,
275713,
242947,
275717,
349460,
333079,
251161,
349486,
349492,
251190,
415034,
251211,
357710,
210261,
259423,
374113,
365922,
374118,
333164,
234867,
390518,
357756,
136591,
374161,
349591,
333222,
259516,
415168,
54724,
415187,
415192,
415194,
415197,
415208,
366057,
423424,
415258,
415264,
366118,
415271,
349739,
144940,
415279,
415282,
349748,
415286,
210488,
415291,
415295,
333387,
333396,
366173,
333415,
333423,
210547,
415354,
333440,
267910,
333472,
333499,
333512,
210632,
259789,
358100,
366301,
153311,
333535,
366308,
366312,
399086,
366319,
210673,
366322,
399092,
366326,
268042,
210700,
366349,
399129,
210720,
358192,
366384,
366388,
358201,
399166,
325441,
366403,
325447,
341831,
341835,
341839,
341844,
415574,
341852,
350046,
399200,
399208,
268144,
358256,
341877,
399222,
325494,
243584,
325505,
333699,
399244,
333725,
382898,
333767,
350153,
358348,
333777,
399318,
358372,
333819,
268299,
178221,
243782,
374865,
342113,
342134,
374904,
268435,
333989,
350411,
350417,
350423,
350426,
334047,
350449,
375027,
358645,
350459,
350462,
350465,
350469,
325895,
194829,
350477,
268560,
350481,
350487,
325915,
350491,
325918,
350494,
325920,
350500,
194854,
350505,
358701,
350510,
391469,
358714,
358717,
383307,
334162,
358738,
383331,
383334,
391531,
383342,
268669,
194942,
391564,
383375,
366991,
268702,
416159,
342431,
375209,
326059,
375220,
334263,
195041,
334306,
104940,
375279,
162289,
350724,
350740,
334359,
342551,
342555,
334364,
416294,
350762,
252463,
334386,
358962,
334397,
358973,
219719,
399957,
334425,
326240,
375401,
268922,
334466,
334469,
162446,
326291,
342680,
342685,
260767,
342711,
260798,
260802,
350918,
342737,
391895,
154329,
342769,
203508,
342777,
391938,
391949,
326417,
375572,
375580,
162592,
326444,
383794,
326452,
326455,
244542,
326463,
326468,
326474,
326479,
326486,
326494,
326503,
375657,
326508,
400238,
326511,
392061,
359296,
351105,
252801,
260993,
400260,
342921,
236432,
342931,
400279,
392092,
400286,
252838,
359335,
252846,
400307,
187335,
359383,
359389,
383968,
359411,
244728,
383999,
326669,
359452,
211999,
359471,
375868,
343132,
384099,
326764,
367724,
384108,
326767,
187503,
343155,
384115,
351366,
351382,
367795,
367801,
351424,
244934,
367817,
326858,
244938,
343246,
343272,
351467,
351480,
351483,
351492,
343307,
261395,
171304,
376111,
326970,
343366,
212296,
212304,
343394,
343399,
367981,
343410,
155000,
327035,
253321,
155021,
384398,
245143,
343453,
155045,
40358,
245163,
359867,
384444,
146878,
327112,
384457,
327116,
327118,
359887,
359891,
343509,
368093,
155103,
343535,
343540,
343545,
253445,
359948,
245295,
359984,
400977,
400982,
343650,
327276,
245358,
138865,
155255,
155274,
425639,
425652,
155323,
425663,
155328,
155352,
212700,
155356,
155364,
245477,
212723,
245495,
409336,
155394,
155404,
245528,
155423,
204592,
155444,
155448,
384829,
384831,
360262,
155463,
155477,
155484,
261982,
425823,
376672,
155488,
155492,
327532,
261997,
262000,
262003,
262006,
147319,
327542,
262009,
262012,
155517,
155523,
155526,
360327,
376715,
262028,
155532,
262031,
262034,
262037,
262040,
262043,
155550,
253854,
262046,
262049,
262052,
155560,
155563,
155566,
393152,
311244,
212945,
393170,
155604,
155620,
253924,
155622,
253927,
327655,
360432,
204785,
393204,
360439,
393209,
155647
] |
ad236ca575c17198b17463b9445e54cb990c1db6
|
de201d815f979e518896a4d6b1fd4f4fe200685e
|
/GLPageView/GLPageView/GLPageView.swift
|
ccca1790d1507183299d6a4a615e1075b3c1d8bf
|
[
"MIT"
] |
permissive
|
GLei1122/GLPageView
|
a848c0d0bee78c5b2cc2a75a32d88edbc7f51966
|
b024ac3a95c303c0d82331b2b1d49c223584515d
|
refs/heads/master
| 2020-12-02T06:28:33.860092 | 2017-07-21T08:54:35 | 2017-07-21T08:54:35 | 96,839,664 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 23,672 |
swift
|
//
// GLPageView.swift
// GLPageView
//
// Created by GL on 2017/7/11.
// Copyright © 2017年 GL. All rights reserved.
//
import UIKit
enum GLPageTitleStyle {
case Default //默认
case Gradient //文字渐变
case Blend //文字填充
}
enum GLPageIndicatorStyle {
case Default
case FollowText //跟随文本长度变化
case Stretch //拉伸
}
//协议
protocol GLPageViewDelegate{
//var delegateTest: CGFloat {set get} //定义属性,表示可读可写
func pageTabViewDidEndChange()
}
class GLPageView: UIView {
var delegete: GLPageViewDelegate?
/*pageView背景色,默认white*/
var pageViewBackgroundColor : UIColor = UIColor.white{
didSet {
pageScrollView.backgroundColor = pageViewBackgroundColor
}
}
/*pageView size,默认(self.width, 40.0)*/
var pageViewSize: CGSize = CGSize(width: 0, height: 40)
/*一页展示最多的item个数,如果比item总数少,按照item总数计算*/
var maxNumberOfPageItems: NSInteger = 4
/*item的字体大小 默认15*/
var pageItemFont: UIFont = UIFont.systemFont(ofSize: 15)
/*设置当前选择项(无动画效果)默认第一个 */
var selectedPageIndex: NSInteger = 0
fileprivate var pageItemWidth: CGFloat = 0
/*未选择颜色 默认黑色*/
var unSelectedColor: UIColor = UIColor.black {
didSet {
updateColors(selectBool: false)
}
}
/*当前选中颜色 默认红色*/
var selectedColor: UIColor = UIColor.red {
didSet {
updateColors(selectBool: true)
}
}
/*是否打开body的边界弹动效果*/
var bodyBounces: Bool = true {
didSet {
bodyScrollView.bounces = bodyBounces
}
}
/*Title效果设置*/
var titleStyle: GLPageTitleStyle = GLPageTitleStyle.Default
/*字体渐变,未选择的item的scale,默认是0.8(0~1)。仅XXPageTabTitleStyleScale生效*/
var minScale: CGFloat = 0.8
/*Indicator效果设置*/
var indicatorStyle: GLPageIndicatorStyle = GLPageIndicatorStyle.Default
/*下标高度,默认是2.0*/
var indicatorHeight: CGFloat = 2.0
/*下标宽度,默认是20。XXPageTabIndicatorStyleFollowText时无效*/
var indicatorWidth: CGFloat = 20
/*标题数组*/
fileprivate var titlesArray: [String] = []
fileprivate var controllers: [UIViewController] = []
/*记录上一次的索引 */
fileprivate var lastSelectedPageIndex: NSInteger = 0
//标题label数组
fileprivate var pageItemLabels:Array<UILabel> = []
//animation
//滑动过程中不允许layoutSubviews
fileprivate var isNeedRefreshLayout: Bool = true
//是否是通过点击改变的。因为点击可以长距离点击,部分效果不作处理会出现途中经过的按钮也会依次有效果(仿网易客户端有此效果,个人觉得并不好,头条的客户端更合理)
fileprivate var isChangeByClick: Bool = false
/* 记录滑动时左边的itemIndex */
fileprivate var leftItemIndex: NSInteger = 0
/* 记录滑动时右边的itemIndex */
fileprivate var rightItemIndex: NSInteger = 0
/*XXPageTabTitleStyleScale*/
fileprivate var selectedColorR: CGFloat = 1
fileprivate var selectedColorG: CGFloat = 0
fileprivate var selectedColorB: CGFloat = 0
fileprivate var unSelectedColorR: CGFloat = 0
fileprivate var unSelectedColorG: CGFloat = 0
fileprivate var unSelectedColorB: CGFloat = 0
//标题栏
var pageScrollView:UIScrollView
//body视图
var bodyScrollView:UIScrollView
//下标视图
var indicatorView:UIView = UIView()
//MARK: - 初始化
init(frame: CGRect , childTitles: Array<String> , childControllers: Array<UIViewController>) {
pageScrollView = UIScrollView()
bodyScrollView = UIScrollView()
controllers = childControllers;
titlesArray = childTitles;
super.init(frame: frame)
//创建标题view
initPageView()
//创建
initBodyView()
}
private func initPageView() {
pageViewSize = CGSize(width: self.bounds.size.width, height: 40);
pageScrollView.showsVerticalScrollIndicator = false;
pageScrollView.showsHorizontalScrollIndicator = false;
pageScrollView.backgroundColor = pageViewBackgroundColor
pageScrollView.delegate = self
//超出父视图,子视图裁剪
pageScrollView.clipsToBounds = true
self.addSubview(pageScrollView);
//遍历
print(selectedPageIndex)
for (index,str) in titlesArray.enumerated() {
let pageItem: GLPageTitleLabel = GLPageTitleLabel()
pageItem.font = pageItemFont;
pageItem.text = str;
pageItem.textColor = index==selectedPageIndex ? selectedColor : unSelectedColor;
pageItem.textAlignment = NSTextAlignment.center;
pageItem.isUserInteractionEnabled = true;
pageItem.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(changeChildControllerOnClick(tap:))))
pageScrollView.addSubview(pageItem)
pageItemLabels.append(pageItem)
}
//添加下标
indicatorView.backgroundColor = selectedColor
self.addSubview(indicatorView)
}
private func initBodyView() {
bodyScrollView.showsVerticalScrollIndicator = false
bodyScrollView.showsHorizontalScrollIndicator = false
bodyScrollView.isPagingEnabled = true
bodyScrollView.bounces = bodyBounces
bodyScrollView.delegate = self
for childController in controllers {
if childController.view.superview != bodyScrollView {
bodyScrollView.addSubview(childController.view)
}
}
self.addSubview(bodyScrollView)
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func layoutSubviews() {
if isNeedRefreshLayout {
if pageViewSize.height <= 0 {
pageViewSize.height = 40
}
if pageViewSize.width <= 0 {
pageViewSize.width = self.bounds.size.width
}
//每个item的宽度
pageItemWidth = pageViewSize.width / CGFloat((pageItemLabels.count < maxNumberOfPageItems ? pageItemLabels.count : maxNumberOfPageItems));
pageScrollView.frame = CGRect(x: 0, y: 0, width: pageViewSize.width, height: pageViewSize.height)
pageScrollView.contentSize = CGSize(width: pageItemWidth * CGFloat(pageItemLabels.count), height: 0)
for (index,itemLabel) in pageItemLabels.enumerated() {
itemLabel.frame = CGRect(x: pageItemWidth * CGFloat(index), y: 0, width: pageItemWidth, height: pageViewSize.height)
}
if titleStyle == GLPageTitleStyle.Default {
//文字颜色切换
self.changeSelectedItemToNextItem(selectedPageIndex)
}
//
//下标view frame
self.layoutIndicatorView()
//body layout
print("---%f",self.bounds.size.height)
bodyScrollView.frame = CGRect(x: 0, y: pageViewSize.height, width: self.bounds.size.width, height: self.bounds.size.height-pageViewSize.height)
bodyScrollView.contentSize = CGSize(width: self.bounds.size.width * CGFloat(pageItemLabels.count), height: 0)
bodyScrollView.contentOffset = CGPoint(x: self.bounds.size.width * CGFloat(selectedPageIndex), y: 0)
self.reviseTabContentOffsetBySelectedIndex(false)
for (index,childController) in controllers.enumerated() {
childController.view.frame = CGRect(x: self.bounds.size.width * CGFloat(index), y: 0, width: bodyScrollView.bounds.size.width, height: bodyScrollView.bounds.size.height)
}
}
}
//MARK: - 点击分类切换
func changeChildControllerOnClick(tap: UITapGestureRecognizer) {
print("哈哈")
//获取点击的label
let index: NSInteger = pageItemLabels.index(of: tap.view as! UILabel)!
//如果不是当前选中的
if index != selectedPageIndex {
if titleStyle == GLPageTitleStyle.Default {
//文字颜色切换
self.changeSelectedItemToNextItem(index)
}
isChangeByClick = true
leftItemIndex = index > selectedPageIndex ? selectedPageIndex : index
rightItemIndex = index > selectedPageIndex ? index : selectedPageIndex
selectedPageIndex = index
bodyScrollView.setContentOffset(CGPoint(x: bodyScrollView.frame.size.width * CGFloat(selectedPageIndex), y: 0), animated: false)
}
}
/**
一般常用改变selected Item方法(无动画效果,直接变色)
*/
func changeSelectedItemToNextItem(_ index: NSInteger) {
let currentPageItem = pageItemLabels[selectedPageIndex];
let nextPageItem = pageItemLabels[index];
currentPageItem.textColor = unSelectedColor;
nextPageItem.textColor = selectedColor;
}
/**
根据选择项修正Page的展示区域
*/
func reviseTabContentOffsetBySelectedIndex(_ isAnimate: Bool) {
let currentPageItem = pageItemLabels[selectedPageIndex]
let selectedItemCenterX = currentPageItem.center.x
var reviseX: CGFloat = 0.0
if selectedItemCenterX + pageViewSize.width*0.5 >= pageScrollView.contentSize.width {
//不足以到中心,靠右
reviseX = CGFloat(pageScrollView.contentSize.width - pageViewSize.width);
}else if selectedItemCenterX - pageViewSize.width*0.5 <= 0 {
//不足以到中心,靠左
reviseX = 0;
}else{
reviseX = CGFloat(selectedItemCenterX - pageViewSize.width * 0.5); //修正至中心
}
//如果前后没有偏移量差,setContentOffset实际不起作用;或者没有动画效果
if fabsf(Float(pageScrollView.contentOffset.x-reviseX)) < 1 || !isAnimate {
self.finishReviseTabContentOffset()
}
pageScrollView.setContentOffset(CGPoint(x: reviseX, y: 0), animated: isAnimate)
}
/**
tabview修正完成后的操作,无论是点击还是滑动body,此方法都是真正意义上的最后一步
*/
func finishReviseTabContentOffset() {
isNeedRefreshLayout = true
isChangeByClick = false
if lastSelectedPageIndex != selectedPageIndex {
self.delegete?.pageTabViewDidEndChange()
}
lastSelectedPageIndex = selectedPageIndex
}
func layoutIndicatorView() {
let indicatorWidth = self.getIndicatorWidthWithTitle(titlesArray[selectedPageIndex])
let selectPageItem = pageItemLabels[selectedPageIndex];
indicatorView.frame = CGRect(x: selectPageItem.center.x-indicatorWidth*0.5-pageScrollView.contentOffset.x, y: pageViewSize.height-indicatorHeight, width: indicatorWidth, height: indicatorHeight)
}
/**
根据对应文本计算下标线宽度
*/
func getIndicatorWidthWithTitle(_ title: String) -> CGFloat {
if indicatorStyle == GLPageIndicatorStyle.Default || indicatorStyle == GLPageIndicatorStyle.Stretch{
return indicatorWidth;
}else {
if title.characters.count < 2 {
return 40
}else{
return CGFloat(title.characters.count) * pageItemFont.pointSize + 12
}
}
}
//MARK: - didSet
// 更新颜色
private func updateColors(selectBool: Bool) {
if selectBool {
pageItemLabels[selectedPageIndex].textColor = selectedColor
indicatorView.backgroundColor = selectedColor
let rgb: [CGFloat] = getRGBWithColor(color: selectedColor)
selectedColorR = rgb[0]
selectedColorG = rgb[1]
selectedColorB = rgb[2]
}else{
for (index,item) in pageItemLabels.enumerated() {
item.textColor = index == selectedPageIndex ? selectedColor : unSelectedColor
}
let rgb: [CGFloat] = getRGBWithColor(color: unSelectedColor)
unSelectedColorR = rgb[0]
unSelectedColorG = rgb[1]
unSelectedColorB = rgb[2]
}
}
}
//MARK: - extension
extension GLPageView: UIScrollViewDelegate {
//降速结束
/*手指滑动会触发该方法,setContentOffset:animated:不会触发*/
func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {
if scrollView == bodyScrollView {
selectedPageIndex = NSInteger(bodyScrollView.contentOffset.x / bodyScrollView.bounds.size.width)
self.reviseTabContentOffsetBySelectedIndex(true)
}
}
func scrollViewDidEndScrollingAnimation(_ scrollView: UIScrollView) {
if scrollView == bodyScrollView {
self.reviseTabContentOffsetBySelectedIndex(true)
}else{
self.finishReviseTabContentOffset()
}
}
func scrollViewDidScroll(_ scrollView: UIScrollView) {
if scrollView == pageScrollView {
isNeedRefreshLayout = false
let selectPageItem: GLPageTitleLabel = pageItemLabels[selectedPageIndex] as! GLPageTitleLabel
let indicatorViewX: CGFloat = selectPageItem.center.x - indicatorView.bounds.size.width * 0.5 - scrollView.contentOffset.x
indicatorView.frame = CGRect(x: indicatorViewX, y: indicatorView.bounds.origin.y, width: indicatorView.bounds.size.width, height: indicatorView.bounds.size.height)
} else if scrollView == bodyScrollView {
//未初始化时不处理
if bodyScrollView.contentSize.width <= 0 {
return
}
//滚动过程中不允许layout
isNeedRefreshLayout = false
//获取当前左右item index(点击方式已获知左右index,无需根据contentoffset计算)
if !isChangeByClick {
if bodyScrollView.contentOffset.x <= 0 { //左边界
leftItemIndex = 0
rightItemIndex = 0
}else if bodyScrollView.contentOffset.x >= bodyScrollView.contentSize.width - bodyScrollView.bounds.size.width { //右边界
leftItemIndex = pageItemLabels.count - 1
rightItemIndex = pageItemLabels.count - 1
}else {
leftItemIndex = NSInteger(bodyScrollView.contentOffset.x / bodyScrollView.bounds.size.width)
rightItemIndex = leftItemIndex + 1;
}
}
//调整title
changeTitleStyle()
//调整下标
switch indicatorStyle {
case .Default:
changeIndicatorFrame()
break
case .FollowText:
changeIndicatorFrame()
break
case .Stretch:
if(isChangeByClick) {
changeIndicatorFrame()
} else {
changeIndicatorFrameByStretch()
}
break
default:
break
}
}
}
//MARK: - Title animation
func changeTitleStyle() {
//bodyScrollView的偏移百分比
let bodyOffsetPercent: CGFloat = bodyScrollView.contentOffset.x / CGFloat(bodyScrollView.bounds.size.width) - CGFloat(leftItemIndex)
switch titleStyle {
case .Default:
if !isChangeByClick {
//滑动超过页面一半,切换视图和文字
if bodyOffsetPercent > 0.5 {
self.changeSelectedItemToNextItem(rightItemIndex)
selectedPageIndex = rightItemIndex
}else {
self.changeSelectedItemToNextItem(leftItemIndex)
selectedPageIndex = leftItemIndex
}
}
break
case .Gradient:
//当页面不在左边界 右边界时
if leftItemIndex != rightItemIndex {
let rightScale: CGFloat = bodyOffsetPercent
let leftScale = 1 - rightScale
//颜色渐变
let difR = selectedColorR - unSelectedColorR
let difG = selectedColorG - unSelectedColorG
let difB = selectedColorB - unSelectedColorB
print("difR = , difG = , difB=",difR,difG,difB)
print(unSelectedColorR+leftScale*difR)
print(unSelectedColorG+leftScale*difG)
print(unSelectedColorB+leftScale*difB)
let leftItemColor = UIColor.init(colorLiteralRed: Float(unSelectedColorR+leftScale*difR), green: Float(unSelectedColorG+leftScale*difG), blue: Float(unSelectedColorB+leftScale*difB), alpha: 1)
let rightItemColor = UIColor.init(colorLiteralRed: Float(unSelectedColorR+rightScale*difR), green: Float(unSelectedColorG+rightScale*difG), blue: Float(unSelectedColorB+rightScale*difB), alpha: 1)
let leftPageItem = pageItemLabels[leftItemIndex]
let rightPageItem = pageItemLabels[rightItemIndex]
leftPageItem.textColor = leftItemColor;
rightPageItem.textColor = rightItemColor;
//字体渐变
let left: CGFloat = minScale+(1-minScale)*leftScale
print("left = ",left)
leftPageItem.transform = CGAffineTransform.init(scaleX: left, y: left)
let right: CGFloat = minScale+(1-minScale)*rightScale
print("right = ",right)
rightPageItem.transform = CGAffineTransform.init(scaleX: right, y: right)
}
break
case .Blend:
if leftItemIndex != rightItemIndex {
//起点和终点不处理,终点时左右index已更新,会绘画错误(你可以注释看看)
if bodyOffsetPercent == 0 {
return
}
let leftPageItem: GLPageTitleLabel = pageItemLabels[leftItemIndex] as! GLPageTitleLabel
let rightPageItem: GLPageTitleLabel = pageItemLabels[rightItemIndex] as! GLPageTitleLabel
leftPageItem.textColor = selectedColor;
rightPageItem.textColor = unSelectedColor;
leftPageItem.fillColor = unSelectedColor;
rightPageItem.fillColor = selectedColor;
leftPageItem.process = bodyOffsetPercent
rightPageItem.process = bodyOffsetPercent
}
break
default:
break
}
}
//MARK: - Indicator animation
func changeIndicatorFrame() {
//计算indicator此时的centerx
let nowIndicatorCenterX: CGFloat = pageItemWidth*(0.5+bodyScrollView.contentOffset.x/bodyScrollView.bounds.size.width)
//计算此时body的偏移量在一页中的占比
var relativeLocation: CGFloat = (bodyScrollView.contentOffset.x/bodyScrollView.bounds.size.width - CGFloat(leftItemIndex)) / CGFloat(rightItemIndex - leftItemIndex)
//记录左右对应的indicator宽度
let leftIndicatorWidth: CGFloat = getIndicatorWidthWithTitle(titlesArray[leftItemIndex])
let rightIndicatorWidth: CGFloat = getIndicatorWidthWithTitle(titlesArray[rightItemIndex])
//左右边界的时候,占比清0
if leftItemIndex == rightItemIndex {
relativeLocation = 0.0
}
//基于从左到右方向(无需考虑滑动方向),计算当前中心轴所处位置的长度
let nowIndicatorWidth: CGFloat = leftIndicatorWidth + (rightIndicatorWidth - leftIndicatorWidth) * relativeLocation
indicatorView.frame = CGRect(x: nowIndicatorCenterX - nowIndicatorWidth * 0.5 - pageScrollView.contentOffset.x, y: indicatorView.frame.origin.y, width: nowIndicatorWidth, height: indicatorView.bounds.size.height)
}
func changeIndicatorFrameByStretch() {
if indicatorWidth <= 0 {
return
}
//计算此时body的偏移量在一页中的占比
var relativeLocation: CGFloat = (bodyScrollView.contentOffset.x / bodyScrollView.bounds.size.width - CGFloat(leftItemIndex)) / CGFloat(rightItemIndex - leftItemIndex)
//左右边界的时候,占比清0
if leftItemIndex == rightItemIndex {
relativeLocation = 0
}
let leftPageItem = pageItemLabels[leftItemIndex]
let rightPageItem = pageItemLabels[rightItemIndex]
//当前的frame
var nowFrame: CGRect = CGRect(x: 0, y: indicatorView.frame.origin.y, width: 0, height: indicatorView.bounds.size.height)
//计算宽度
if relativeLocation <= 0.5 {
nowFrame.size.width = indicatorWidth + pageItemWidth * (relativeLocation / 0.5)
nowFrame.origin.x = (leftPageItem.center.x - pageScrollView.contentOffset.x) - indicatorWidth * 0.5
} else {
nowFrame.size.width = indicatorWidth + pageItemWidth * ((1 - relativeLocation) / 0.5)
nowFrame.origin.x = (rightPageItem.center.x - pageScrollView.contentOffset.x) + indicatorWidth * 0.5 - nowFrame.size.width
}
indicatorView.frame = nowFrame
}
/**
获取color的rgb值
*/
func getRGBWithColor(color: UIColor) -> Array<CGFloat> {
var R: CGFloat = 0
var G: CGFloat = 0
var B: CGFloat = 0
let numComponents: Int = color.cgColor.numberOfComponents
let components: [CGFloat] = color.cgColor.components!
if numComponents == 4 {
R = components[0];
G = components[1];
B = components[2];
}
return [R,G,B]
}
}
|
[
-1
] |
245bc92b6d15a820f561320876d5b4f53413123b
|
dad27520642930a013d0ea56a76d9039432b3d7b
|
/main/Operators/Filtering Operators/skip.playground/Contents.swift
|
42d0208e5e2c255669cdf4adc9d33c3f81bfe4a7
|
[
"MIT"
] |
permissive
|
taeroi/RxSwiftStudy
|
39ff7f8ac572a6a5a9f37028d2f938af72c17727
|
45bf2056dbdc35f56438f6e6bf4a6dd79a4577a1
|
refs/heads/main
| 2023-04-16T11:13:52.786798 | 2021-04-28T06:15:20 | 2021-04-28T06:15:20 | 358,088,421 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,453 |
swift
|
//
// Copyright (c) 2019 KxCoding <[email protected]>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
import UIKit
import RxSwift
/*:
# skip
*/
let disposeBag = DisposeBag()
let numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
//특정 요소를 무시
Observable.from(numbers)
.skip(3) //정수를 입력하여 처음 3개의 요소를 제외
.subscribe{print($0)}
.disposed(by: disposeBag)
|
[
194560,
395274,
395277,
395279,
395280,
407569,
395282,
395283,
61478,
98344,
98345,
98349,
329778,
174135,
354359,
174139,
124988,
229441,
229443,
229444,
174148,
395334,
378951,
174152,
229449,
174161,
106580,
106584,
106586,
106587,
112730,
284783,
125048,
229504,
125057,
125062,
125064,
125065,
319626,
125066,
235658,
125087,
215205,
129190,
215206,
215208,
215211,
215212,
215215,
193,
241862,
317638,
317640,
241868,
241873,
262353,
241878,
262359,
241879,
106713,
106714,
262366,
224,
106720,
106725,
241904,
176370,
241907,
176373,
260342,
106742,
176378,
141566,
141569,
141572,
141576,
241928,
241931,
141583,
241937,
141586,
141588,
12565,
227607,
227608,
141593,
141594,
141595,
227609,
141597,
227610,
227612,
141598,
141601,
141599,
141600,
227613,
241952,
141606,
241955,
141607,
141609,
241961,
241963,
289068,
141612,
12592,
141622,
141627,
215356,
141629,
141632,
141634,
213319,
213320,
141641,
141642,
262475,
141646,
241998,
141650,
141654,
242006,
282967,
141655,
282969,
168285,
227614,
141670,
172391,
141674,
141677,
141679,
141681,
287090,
375154,
190836,
334196,
190842,
430458,
190844,
375165,
141696,
375168,
375172,
141701,
430471,
430475,
141708,
141711,
197016,
197018,
197019,
197021,
197029,
303550,
160208,
319972,
305638,
272872,
223741,
191007,
272931,
57893,
272934,
57896,
420394,
57899,
57900,
57903,
57904,
272944,
324145,
57905,
57906,
158257,
336445,
336450,
336451,
336464,
336466,
336467,
55890,
336469,
336470,
336472,
336473,
336479,
336480,
336481,
111202,
272994,
336482,
336488,
273003,
273021,
273023,
297615,
297625,
135854,
135861,
242361,
244421,
244430,
66257,
66261,
127702,
62174,
334562,
127727,
127729,
244469,
244470,
164601,
316155,
142076,
142078,
334590,
244480,
334591,
142083,
142087,
318218,
334602,
334604,
318220,
334606,
142095,
318223,
334607,
318228,
318233,
318234,
318239,
187173,
187174,
318246,
187176,
187175,
187178,
396095,
396098,
279366,
396104,
279369,
396114,
396117,
396118,
396119,
396120,
396121,
396122,
396123,
396126,
396127,
299880,
187260,
322430,
60304,
201619,
60308,
60318,
60319,
60322,
60323,
60324,
60327,
60328,
60331,
23469,
213935,
23473,
23474,
23475,
60337,
185267,
23487,
185280,
23490,
281538,
23492,
23494,
185286,
23502,
23508,
259036,
242658,
40089,
203755,
152560,
242675,
40096,
23559,
23560,
437256,
437258,
437262,
40098,
437269,
23574,
437273,
437277,
40101,
437281,
3119,
437297,
187442,
144435,
189491,
189492,
187444,
189496,
144441,
437305,
97339,
144445,
189502,
144447,
341054,
341055,
341058,
437310,
189508,
341060,
341057,
97347,
437314,
222278,
341062,
341063,
341068,
341066,
437326,
185428,
285781,
312407,
437340,
312413,
437345,
437349,
185446,
293990,
312423,
115817,
312427,
185452,
437356,
115819,
242796,
185457,
142450,
115825,
437364,
437369,
437371,
294012,
142463,
294016,
437384,
437390,
437392,
437396,
189590,
312473,
312474,
189595,
437402,
437404,
189598,
312478,
228512,
312479,
312481,
312483,
312476,
40092,
228510,
40095,
189608,
208041,
189610,
437416,
189612,
312493,
312489,
437415,
40105,
40109,
40110,
437424,
437428,
312501,
437426,
437431,
189621,
437433,
312502,
312504,
437436,
322751,
437440,
38081,
437443,
437445,
437446,
292041,
292042,
437451,
38092,
437453,
437458,
203990,
203991,
152795,
204000,
204003,
339176,
339177,
152821,
208117,
294138,
279818,
206094,
279823,
294162,
206108,
206109,
425247,
27943,
27944,
181544,
27948,
181553,
181559,
173368,
245058,
173379,
312480,
152909,
173394,
378206,
64865,
222563,
222566,
222573,
228717,
173425,
171377,
222577,
222579,
228721,
222581,
222582,
222587,
222590,
54655,
222591,
173441,
222597,
222600,
279944,
363913,
222601,
54666,
222605,
222604,
222606,
54673,
54678,
54680,
279969,
54692,
54698,
54700,
153009,
157118,
298431,
212420,
370118,
153037,
153049,
153051,
157151,
157158,
157159,
112111,
112115,
112117,
65016,
112120,
40451,
112131,
40453,
40454,
280068,
40455,
40458,
40460,
40463,
112144,
112145,
40466,
40469,
40471,
40475,
40477,
40479,
40482,
34359,
34362,
316993,
173634,
173635,
263751,
173639,
314987,
319085,
319088,
319089,
300662,
319094,
52857,
319098,
319101,
319103,
175746,
52882,
394899,
52886,
52887,
394908,
394910,
104095,
394912,
52897,
52896,
52899,
52900,
394925,
151218,
394935,
321210,
292544,
108234,
296660,
34516,
212694,
108245,
34522,
34531,
296679,
34538,
192234,
296682,
296685,
296687,
155377,
296691,
151285,
296694,
108279,
108281,
216826,
296699,
216828,
296700,
296701,
296703,
296704,
296706,
216834,
296708,
296710,
276232,
313099,
276236,
313102,
313108,
313111,
159518,
149280,
227116,
227119,
321342,
210755,
210756,
210758,
120655,
120656,
120657,
218960,
218959,
218962,
223064,
223065,
223069,
292705,
223075,
223076,
292709,
237413,
180070,
128874,
169835,
128876,
128875,
227180,
223087,
227183,
128881,
169843,
128884,
227188,
169856,
141189,
116622,
108431,
141202,
169879,
141208,
141220,
219045,
108460,
108462,
141246,
319426,
141253,
319432,
59348,
59349,
141272,
141273,
141284,
40934,
40940,
40941,
141292,
174063,
141297,
174066,
174067,
174074,
395259,
194558,
194559
] |
a8f575fb098ad989358173df15f096d0fabe284d
|
9689625f7884cfe0b28a149be4fc85acd2e0d146
|
/Portal1/YardimTableViewCell.swift
|
522a94b6caf98988dc181124e9a5055d3fb3c40a
|
[] |
no_license
|
nicatguliyev/ozel
|
763b8aee49f90bc9d16deefa8ea0a76a5f045376
|
6f5852433fff69a4a64c485705de405e80670f35
|
refs/heads/master
| 2020-04-08T23:30:14.965529 | 2018-11-30T13:28:10 | 2018-11-30T13:28:10 | 159,827,705 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 592 |
swift
|
//
// YardimTableViewCell.swift
// Portal1
//
// Created by Nicat Guliyev on 11/5/18.
// Copyright © 2018 Nicat Guliyev. All rights reserved.
//
import UIKit
class YardimTableViewCell: UITableViewCell {
@IBOutlet weak var menbeLbl: UILabel!
@IBOutlet weak var yardimLbl: UILabel!
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
}
|
[
320001,
384002,
337412,
227845,
328709,
333831,
227849,
418826,
227852,
333837,
372750,
287247,
283152,
372753,
196114,
372754,
327190,
328214,
287258,
370207,
243746,
287266,
281636,
360485,
356391,
199212,
327224,
327225,
307277,
327248,
235604,
235611,
259165,
213095,
213097,
310894,
213109,
148600,
230522,
403068,
410751,
300672,
288390,
346761,
373913,
148637,
148638,
276639,
131745,
148648,
300206,
327344,
361651,
313528,
327360,
379078,
223437,
273105,
291544,
306907,
337627,
131808,
176358,
249067,
375532,
271087,
325874,
338682,
300801,
276746,
298255,
282898,
276756,
203542,
261406,
349470,
257823,
396065,
111912,
369452,
369458,
369461,
282934,
296758,
380220,
300350,
399679,
393537,
342850,
342851,
151881,
380234,
430412,
283471,
283472,
270679,
348504,
287066,
287067,
228188,
200543,
350050,
270691,
355170,
37219,
257898,
330602,
179568,
317296,
113524,
317302,
213878,
244600,
179578,
244602,
179580,
211843,
213891,
36743,
225159,
209803,
302475,
242571,
242574,
227219,
289684,
337317,
276390,
211370,
311211,
288690,
281014,
276406,
354742,
299965,
306623,
299968,
306625,
306626,
317379,
430546,
430547,
358870,
180695,
180696,
155614,
282590,
284131,
237542,
344039,
323561,
196076,
310778,
305661
] |
27a0629cd993a6ba51c06c37449d648aff0028d2
|
5371be75575142c015160ad9e5f747dea9bbc4a3
|
/LifeARtistTest/result18/ResultVCCell.swift
|
e43aae1221838c99ea6a1a2a6df56888a526df04
|
[] |
no_license
|
MohamedELfishawy1/Yarb
|
3f48a8a9eeaae4de31a6ca2f6ea8bda746ab1301
|
d8846159310449d00acb792c6b2880cffc96ffcc
|
refs/heads/master
| 2020-03-19T21:41:04.981079 | 2018-06-11T15:38:19 | 2018-06-11T15:38:19 | 136,946,855 | 1 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 714 |
swift
|
//
// ResultVCCell.swift
// LifeARtistTest
//
// Created by mohamed on 4/20/18.
// Copyright © 2018 Mohamed ELfishawy. All rights reserved.
//
import UIKit
import Cosmos
class ResultVCCell: UITableViewCell {
@IBOutlet weak var photo: UIImageView!
@IBOutlet weak var cosmosView: CosmosView!
@IBOutlet weak var prize: UILabel!
@IBOutlet weak var name: UILabel!
@IBOutlet weak var service: UILabel!
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
}
|
[
100480,
317952,
431104,
211843,
337412,
271112,
271117,
373908,
196119,
334231,
305202,
289336,
306623,
306625,
306626,
323530,
323532,
323536,
327248,
358868,
384982,
180695,
180696,
287066,
358875,
358876,
384988,
287071,
37215,
265569,
339039,
270691,
317283,
350049,
340582,
302183,
355170,
384995,
302573,
340589,
271088,
271089,
308081,
302195,
317296,
262518,
340599,
244602,
305661
] |
cd053a3e46cb5c542100979c0d29c75ed0bc41da
|
03f780eacf785ed53c25e13596561b0ac1a6fbb4
|
/CollectionImages/ViewController.swift
|
e67e5433ea8a386cfe94080a47fe2337e42981ba
|
[] |
no_license
|
satyam04/CollectionImages
|
d43df7c765c4a2fd0ffa871b8a27590164a2bb32
|
a0ad58b82fbf53d4634db79bf751864f4500cd67
|
refs/heads/master
| 2021-07-17T04:53:39.671036 | 2017-10-16T21:03:48 | 2017-10-16T21:03:48 | 107,324,770 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,668 |
swift
|
//
// ViewController.swift
// CollectionImages
//
// Created by Satyam Saluja on 01/10/17.
// Copyright © 2017 Satyam Saluja. All rights reserved.
//
import UIKit
class ViewController: UIViewController,UICollectionViewDelegate,UICollectionViewDataSource {
@IBOutlet weak var myCollectionView: UICollectionView!
var imagesCollection:[String]=["1","2","3","1","2","3","1","2","3","1","2","3","1","2","3","1","2","3","1","2","3","1","2","3","1","2","3"]
override func viewDidLoad() {
super.viewDidLoad()
let itemSize=UIScreen.main.bounds.width/3-3
let layout=UICollectionViewFlowLayout()
layout.sectionInset=UIEdgeInsetsMake(10, 0, 10, 0)
layout.itemSize=CGSize(width: itemSize, height: itemSize)
layout.minimumInteritemSpacing=3
layout.minimumLineSpacing=3
myCollectionView.collectionViewLayout=layout
myCollectionView.dataSource=self
myCollectionView.delegate=self
// Do any additional setup after loading the view, typically from a nib.
}
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return imagesCollection.count
}
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell=collectionView.dequeueReusableCell(withReuseIdentifier: "cell", for: indexPath) as! myCellCollectionViewCell
cell.myImageView.image=UIImage(named:imagesCollection[indexPath.row])
cell.backgroundColor=UIColor.blue
return cell
}
}
|
[
-1
] |
5f8c7bb3f00b61e00e100e000b91c8c2ef69993d
|
c7ce47d175abc74ef45790f082a872d15a0aed47
|
/Landmarks/ContentView.swift
|
81d552131a28f4d6a59d2ec157fe3d4057fcd1bc
|
[] |
no_license
|
lportella/swiftui-landmarks
|
2becd133cac22783c247398631012dacbf3dc800
|
bd0d6e9734c336b29d54e094015a9478443751c7
|
refs/heads/master
| 2022-09-15T11:08:02.271389 | 2019-07-11T05:10:25 | 2019-07-11T05:10:25 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 937 |
swift
|
import SwiftUI
struct ContentView : View {
var body: some View {
VStack {
MapView()
.edgesIgnoringSafeArea(.top)
.frame(height: 300)
CircleImage()
.offset(y: -130)
.padding(.bottom, -130)
VStack(alignment: .leading) {
Text("Turtle Rock")
.font(.title)
.color(.green)
HStack {
Text("Joshua Tree National Park")
.font(.subheadline)
Spacer()
Text("California")
.font(.subheadline)
}
}
.padding()
Spacer()
}
}
}
#if DEBUG
struct ContentView_Previews : PreviewProvider {
static var previews: some View {
ContentView()
}
}
#endif
|
[
345185,
255777,
386181,
330961,
421177
] |
9477d15c2752623282d588b9286434a461347d8d
|
966bf8ebfe6b09d348ba9b30613aa2e7aff4cccc
|
/XcodeServerSDKTests/TestUtils.swift
|
1cfc1343ace5ee231b0f53a037197ba77e3e8d7f
|
[
"MIT"
] |
permissive
|
RyanTech/XcodeServerSDK
|
69d4857321a736b2bed706222c5ed99bb2aa6e12
|
15e9289773420fe02f0a7281a0228d17f3b66e5c
|
HEAD
| 2018-01-13T18:35:53.159515 | 2015-07-13T22:44:01 | 2015-07-13T22:44:01 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 7,106 |
swift
|
//
// TestUtils.swift
// XcodeServerSDK
//
// Created by Honza Dvorsky on 17/06/15.
// Copyright (c) 2015 Honza Dvorsky. All rights reserved.
//
import Foundation
import XCTest
import XcodeServerSDK
import DVR
struct StringError: ErrorType {
let description: String
let _domain: String = ""
let _code: Int = 0
init(_ description: String) {
self.description = description
}
}
extension XCTestCase {
func getRecordingXcodeServer(cassetteName: String) -> XcodeServer {
let config = try! XcodeServerConfig(
host: "https://127.0.0.1",
user: "ICanCreateBots",
password: "superSecr3t")
return self.getRecordingXcodeServerWithConfig(config, cassetteName: cassetteName)
}
func getRecordingXcodeServerWithConfig(config: XcodeServerConfig, cassetteName: String) -> XcodeServer
{
let server = XcodeServerFactory.server(config)
let backingSession = server.http.session
let session = DVR.Session(cassetteName: cassetteName, testBundle: NSBundle(forClass: self.classForCoder), backingSession: backingSession)
server.http.session = session
return server
}
}
// MARK: Mock JSON helper methods
extension XCTestCase {
func stringAtPath(path: String) -> String {
return try! NSString(contentsOfFile: path.stringByExpandingTildeInPath, encoding: NSUTF8StringEncoding) as String
}
func loadJSONResponseFromCassetteWithName(name: String) -> NSDictionary {
let dictionary = self.loadJSONWithName(name)
let interactions = dictionary["interactions"] as! [NSDictionary]
let response = interactions.first!["response"] as! NSDictionary
//make sure it's json
assert(response["body_format"] as! String == "json")
//get the response data out
let body = response["body"] as! NSDictionary
return body
}
func loadJSONWithName(name: String) -> NSDictionary {
let bundle = NSBundle(forClass: BotParsingTests.classForCoder())
do {
if let url = bundle.URLForResource(name, withExtension: "json") {
let data = try NSData(contentsOfURL: url, options: NSDataReadingOptions())
if let json = try NSJSONSerialization.JSONObjectWithData(data, options: NSJSONReadingOptions()) as? NSDictionary {
return json
}
} else {
throw StringError("File with name \(name) not found in the bundle")
}
} catch {
XCTFail("Error reading file with name \(name), error: \(error)")
}
return NSDictionary()
}
func botInCassetteWithName(name: String) -> Bot {
let json = self.loadJSONResponseFromCassetteWithName(name)
let bot = Bot(json: json)
return bot
}
func botInFileWithName(name: String) -> Bot {
let json = self.loadJSONWithName(name)
let bot = Bot(json: json)
return bot
}
func configurationFromBotWithName(name: String) -> BotConfiguration {
let bot = self.botInFileWithName(name)
let configuration = bot.configuration
return configuration
}
}
// MARK: Exception assertions
// Based on: https://forums.developer.apple.com/thread/5824
extension XCTestCase {
/**
Replacement method for XCTAssertThrowsError which isn't currently supported.
- parameter message: Message which should be displayed
- parameter file: File in which assertion happened
- parameter line: Line in which assertion happened
- parameter block: Block of code against which assertion should be matched
*/
func XCTempAssertThrowsError(message: String = "", file: String = __FILE__, line: UInt = __LINE__, _ block: () throws -> ()) {
do {
try block()
let msg = (message == "") ? "Tested block did not throw error as expected." : message
XCTFail(msg, file: file, line: line)
} catch {}
}
/**
Replacement method for XCTAssertThrowsSpecificError which isn't currently supported.
- parameter kind: ErrorType which is expected to be thrown from block
- parameter message: Message which should be displayed
- parameter file: File in which assertion happened
- parameter line: Line in which assertion happened
- parameter block: Block of code against which assertion should be matched
*/
func XCTempAssertThrowsSpecificError(kind: ErrorType, _ message: String = "", file: String = __FILE__, line: UInt = __LINE__, _ block: () throws -> ()) {
do {
try block()
let msg = (message == "") ? "Tested block did not throw expected \(kind) error." : message
XCTFail(msg, file: file, line: line)
} catch let error as NSError {
let expected = kind as NSError
if ((error.domain != expected.domain) || (error.code != expected.code)) {
let msg = (message == "") ? "Tested block threw \(error), not expected \(kind) error." : message
XCTFail(msg, file: file, line: line)
}
}
}
/**
Replacement method for XCTAssertNoThrowsError which isn't currently supported.
- parameter message: Message which should be displayed
- parameter file: File in which assertion happened
- parameter line: Line in which assertion happened
- parameter block: Block of code against which assertion should be matched
*/
func XCTempAssertNoThrowError(message: String = "", file: String = __FILE__, line: UInt = __LINE__, _ block: () throws -> ()) {
do {
try block()
} catch {
let msg = (message == "") ? "Tested block threw unexpected error." : message
XCTFail(msg, file: file, line: line)
}
}
/**
Replacement method for XCTAssertNoThrowsSpecificError which isn't currently supported.
- parameter kind: ErrorType which isn't expected to be thrown from block
- parameter message: Message which should be displayed
- parameter file: File in which assertion happened
- parameter line: Line in which assertion happened
- parameter block: Block of code against which assertion should be matched
*/
func XCTempAssertNoThrowSpecificError(kind: ErrorType, _ message: String = "", file: String = __FILE__, line: UInt = __LINE__, _ block: () throws -> ()) {
do {
try block()
} catch let error as NSError {
let unwanted = kind as NSError
if ((error.domain == unwanted.domain) && (error.code == unwanted.code)) {
let msg = (message == "") ? "Tested block threw unexpected \(kind) error." : message
XCTFail(msg, file: file, line: line)
}
}
}
}
|
[
-1
] |
6fe9e4d920b6d572cddd081a360b2da81aad73fa
|
ee0ed2b8578dcc6e4550932b276e02fb21a3bfc3
|
/EarthMap/EarthMap/CustomAnnotation.swift
|
14f14356d534cf30da478a880f7ab1120e8070f6
|
[] |
no_license
|
8auka/IOS
|
1f7006bef4ca00128e773d7c90be22108ff4cdfa
|
c35311afdcaf57ec79057d4d59853aa0c2ad03a1
|
refs/heads/master
| 2020-03-19T06:11:30.316171 | 2018-06-04T09:01:29 | 2018-06-04T09:01:29 | 135,998,630 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 538 |
swift
|
//
// CustomAnnotation.swift
// EarthMap
//
// Created by Bauyrzhan on 30.03.17.
// Copyright © 2017 Bauyrzhan. All rights reserved.
//
import UIKit
import MapKit
class CustomAnnotation: NSObject, MKAnnotation {
var coordinate: CLLocationCoordinate2D
var title: String?
var subtitle: String?
var bar: UIBarButtonItem?
init(coordinate: CLLocationCoordinate2D, title: String!, subtitle: String!) {
self.coordinate = coordinate
self.title = title
self.subtitle = subtitle
}
}
|
[
284342,
284198
] |
c416a864480c858ceb2a70aa951e9837b799aee6
|
5f78ab1dad9b9273526c1151edc2c621b50e94e8
|
/Clouds/Sections/Settings/Pages/RadarSource/SettingsRadarSource.swift
|
6cc9d273b451d4056dc652f3d649589a9c89c03d
|
[
"MIT"
] |
permissive
|
heisken/clouds
|
2d3e01f8fe1a8eb8357d59091e62489d337aa8ce
|
5b4bd72ec70640d4165a3c3c123e73f05768b25f
|
refs/heads/master
| 2023-04-02T12:03:27.127376 | 2021-04-10T01:17:51 | 2021-04-10T01:17:51 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,951 |
swift
|
//
// SettingsRadarSource.swift
// Clouds
//
// Created by Lukas Romsicki on 2020-04-21.
// Copyright © 2020 Lukas Romsicki. All rights reserved.
//
import CloudsAPI
import SwiftUI
struct SettingsRadarSource: View {
@Binding var selectedSource: CloudsAPI.RadarProvider
var body: some View {
ScrollView(.vertical, showsIndicators: true) {
VStack(alignment: .leading, spacing: Dimension.Global.padding) {
LabeledGroup {
VStack(alignment: .leading, spacing: 14) {
Button(action: { self.selectedSource = .environmentCanada }) {
OptionRow(symbolName: "map.fill", color: .red, label: "ECCC (Canada & USA)") {
if self.selectedSource == .environmentCanada {
Image(systemName: "checkmark.circle.fill")
}
}
}
Divider()
Button(action: { self.selectedSource = .rainviewer }) {
OptionRow(symbolName: "globe", color: .blue, label: "RainViewer (Global)") {
if self.selectedSource == .rainviewer {
Image(systemName: "checkmark.circle.fill")
}
}
}
}
}
Text("ECCC: Environment and Climate Change Canada")
.font(.caption)
.foregroundColor(AppColor.Display.secondary)
}
.padding(Dimension.Global.padding)
}
.navigationBarTitle("Radar Data Source")
}
}
struct SettingsRadarSource_Previews: PreviewProvider {
static var previews: some View {
SettingsRadarSource(selectedSource: .constant(.environmentCanada))
}
}
|
[
-1
] |
78a01405490b5b11d8c3cfe5e3025e507da6da77
|
f6df22f663eee786460a32c6676e419f655f1d97
|
/Cocktail Factory/Helper/LocalReachability.swift
|
2d8c77b0324a0098757712b7ee84958fc3804c12
|
[] |
no_license
|
nyan-lin-tun/Cocktail-Factory
|
76facf2859c9440f27dbe67c6984f9cc0189bfb6
|
c468eede402238d003019782bc272c1a5980e655
|
refs/heads/master
| 2022-11-19T06:30:46.938369 | 2020-07-20T16:01:38 | 2020-07-20T16:01:38 | 273,937,173 | 1 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,133 |
swift
|
//
// LocalReachability.swift
// Cocktail Factory
//
// Created by Nyan Lin Tun on 22/06/2020.
// Copyright © 2020 Nyan Lin Tun. All rights reserved.
//
import Foundation
import SystemConfiguration
open class LocalReachability {
class func isConnectedToNetwork() -> Bool {
var zeroAddress = sockaddr_in()
zeroAddress.sin_len = UInt8(MemoryLayout.size(ofValue: zeroAddress))
zeroAddress.sin_family = sa_family_t(AF_INET)
let defaultRouteReachability = withUnsafePointer(to: &zeroAddress) {
$0.withMemoryRebound(to: sockaddr.self, capacity: 1) {zeroSockAddress in
SCNetworkReachabilityCreateWithAddress(nil, zeroSockAddress)
}
}
var flags = SCNetworkReachabilityFlags()
if !SCNetworkReachabilityGetFlags(defaultRouteReachability!, &flags) {
return false
}
let isReachable = (flags.rawValue & UInt32(kSCNetworkFlagsReachable)) != 0
let needsConnection = (flags.rawValue & UInt32(kSCNetworkFlagsConnectionRequired)) != 0
return (isReachable && !needsConnection)
}
}
|
[
329731,
317578,
132365,
303249,
333465,
210845,
317216,
252071,
303784,
215082,
300203,
178355,
140084,
340280,
316987,
361279,
369729,
391623,
334024,
348243,
330972,
430429,
386153,
195946,
301433
] |
ee5f900e5389a37a773f2c28fba10cc004ba3bc2
|
8d858030bff1b4a870710e78d1c599bea3f6864d
|
/Controllers/HomeViewController.swift
|
05b95c2bda3137a16a1b20b9cf4de885cd4fd59b
|
[] |
no_license
|
BartechSpaceship/BinouralBeats
|
f312918bccf0c3979edc15f87deeeace86cd8fe7
|
540edc10e6f8a1183f8267fbc3f88f0064356abf
|
refs/heads/master
| 2022-07-28T20:20:53.129321 | 2020-05-17T23:45:19 | 2020-05-17T23:45:19 | 264,591,940 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 3,506 |
swift
|
//
// ViewController.swift
// BinouralBeats
//
// Created by Bartek on 5/16/20.
// Copyright © 2020 Bartek. All rights reserved.
//
import UIKit
import Foundation
class HomeViewController: UIViewController, UICollectionViewDataSource, UICollectionViewDelegate {
@IBOutlet weak var collectionView: UICollectionView!
let binouralTitle = ["STUDY", "SPIRIT","SLEEP", "BODY", "BRAIN"]
let binouralImage = [
UIImage(named: "study"),
UIImage(named: "spirit"),
UIImage(named: "sleep"),
UIImage(named: "body"),
UIImage(named: "brain"),
]
let binouralDiscription = ["Memory | Focus | Aid", "Trance | Astral travel | Solfeggio | Chanting | 3rd Eye", "Sleep | Deep Sleep | Lucid Dream", "Healing | Addictions | Energizer | Inflammation", "Intelligence | Creativity | Relaxation | Euphoria | Intuition"]
override func viewDidLoad() {
super.viewDidLoad()
// collectionView.dataSource = self
// collectionView.delegate = self
}
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return binouralTitle.count
}
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "cell", for: indexPath) as! CollectionViewCell
cell.binouralName.text = binouralTitle[indexPath.row]
cell.binouralImage.image = binouralImage[indexPath.row]
cell.binouralDiscription.text = binouralDiscription[indexPath.row]
cell.contentView.layer.cornerRadius = 4.0
cell.contentView.layer.borderWidth = 1.0
cell.contentView.layer.borderColor = UIColor.clear.cgColor
cell.contentView.layer.masksToBounds = false
cell.layer.shadowOffset = CGSize(width: 0, height: 1.0)
cell.layer.shadowColor = UIColor.gray.cgColor
cell.layer.shadowRadius = 4.0
cell.layer.shadowOpacity = 1.0
cell.layer.masksToBounds = false
cell.layer.shadowPath = UIBezierPath(roundedRect: cell.bounds, cornerRadius: cell.contentView.layer.cornerRadius).cgPath
return cell
}
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
print(indexPath.row)
let studyVC = storyboard?.instantiateViewController(withIdentifier: "StudyController") as! StudyController
let spiritVC = storyboard?.instantiateViewController(withIdentifier: "SpiritController") as! SpiritController
let sleepVC = storyboard?.instantiateViewController(withIdentifier: "SleepController") as! SleepController
let bodyVC = storyboard?.instantiateViewController(withIdentifier: "BodyController") as! BodyController
let brainVC = storyboard?.instantiateViewController(withIdentifier: "BrainController") as! BrainController
if indexPath.row == 0 {
self.show(studyVC, sender: self)
} else if indexPath.row == 1 {
self.show(spiritVC, sender: self)
} else if indexPath.row == 2 {
self.show(sleepVC, sender: self)
} else if indexPath.row == 3 {
self.show(bodyVC, sender: self)
}else if indexPath.row == 4 {
self.show(brainVC, sender: self)
} else {
print("Fail")
}
//
}
}
|
[
-1
] |
fdd0cbcbfc4c444e6a7be87250aa7aaa755ec30b
|
4c044a171d9a974e89b4e7bf911c953583f08402
|
/Blockchain/Transactions/ 💶 Money.swift
|
62b3990373c5a71733fe38cc08eed90d743e8d74
|
[] |
no_license
|
mischa-hildebrand/Blockchain
|
a2e2168e408d442a737d9e8a58d5d137efca04fe
|
dde41b920374bc0ef75e3ba8394e6148e31d3061
|
refs/heads/master
| 2020-03-07T10:26:00.908658 | 2018-03-30T14:05:01 | 2018-03-30T14:05:01 | 127,431,325 | 1 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,133 |
swift
|
//
// Money.swift
// Blockchain
//
// Created by Mischa (Privat) on 3/2/18.
// Copyright © 2018 Mischa Hildebrand. All rights reserved.
//
public struct Money: Equatable {
public let value: Float
public let currency: Currency
public init(value: Float, currency: Currency) {
self.value = value
self.currency = currency
}
public static func ==(lhs: Money, rhs: Money) -> Bool {
return (lhs.value == rhs.value) && (lhs.currency == rhs.currency)
}
}
public struct Currency: Equatable {
/// The name of the currency, e.g. "Euro" or "Dollar".
public let name: String
/// The symbol of the currency, e.g. "€" or "$".
public let symbol: Character
/// The abbreviation for the currency, e.g. "EUR" or "USD".
public let abbreviation: String
public init(name: String, symbol: Character, abbreviation: String) {
self.name = name
self.symbol = symbol
self.abbreviation = abbreviation
}
public static func ==(lhs: Currency, rhs: Currency) -> Bool {
return lhs.abbreviation == rhs.abbreviation
}
}
|
[
-1
] |
e6403a68933ce5540ffcf37ccc63735f56c6c057
|
566871d7fe85f4113b24e959b85ebe527068857f
|
/WhoToFollow/ViewModels/UserTableViewCellModel.swift
|
4849409fb5d03a1a6e525e1723dae724fc2a2dfe
|
[
"MIT"
] |
permissive
|
danimal141/WhoToFollow
|
f32add8aac0ceae270298852efa5698d6c2bd273
|
eee965f010e7931691a294d7825c5af1f67a8203
|
refs/heads/master
| 2021-01-10T20:44:11.653337 | 2016-02-03T14:08:08 | 2016-02-03T14:55:46 | 42,914,569 | 6 | 1 | null | null | null | null |
UTF-8
|
Swift
| false | false | 538 |
swift
|
//
// UserTableViewCellModel.swift
// WhoToFollow
//
// Created by Hideaki Ishii on 9/22/15.
//
//
import RxSwift
class UserTableViewCellModel {
// MARK: - Properties
let model: Variable<User>
let name: Observable<String>
let avatarUrl: Observable<NSURL?>
let disposeBag = DisposeBag()
// MARK: - Initializers
init(model: User) {
self.model = Variable(model)
self.name = self.model.map { $0.name }
self.avatarUrl = self.model.map { NSURL(string: $0.avatarUrl) }
}
}
|
[
-1
] |
aca284cc8701192870a726838168b2441ec1f9ed
|
e6f26919ec847ac54a4f758c9086d52fb16fa6ca
|
/Neufast/View/HelloViewCell.swift
|
846a411872d54480f59a2ee281656a50c0501619
|
[] |
no_license
|
priyankacgore/Neufast
|
409e59bff1018a82ab4f01efcca3a14866dc4b70
|
862da730bace8b837f1649e9f38d3602cb85b54d
|
refs/heads/master
| 2022-12-31T05:15:50.797063 | 2020-06-11T12:45:17 | 2020-06-11T12:45:17 | 271,517,127 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 485 |
swift
|
//
// HelloViewCell.swift
// Neufast
//
// Created by Priyanka Gore on 28/05/20.
// Copyright © 2020 Asiapay. All rights reserved.
//
import UIKit
class HelloViewCell: UITableViewCell {
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
}
|
[
172545,
322306,
211843,
230522,
225159,
418826,
302475,
277904,
230545,
307218,
227219,
320404,
336158,
123678,
366111,
123681,
349477,
276390,
278567,
293674,
199212,
287022,
300206,
327344,
110387,
281014,
282934,
289336,
292919,
276406,
123451,
228599,
66109,
299965,
306623,
299968,
200513,
306625,
306626,
306627,
317377,
317378,
317379,
379078,
313546,
311755,
278220,
311756,
311757,
311759,
228602,
327248,
310778,
332882,
273105,
278231,
290007,
291544,
298746,
228188,
200542,
155614,
375532,
115313,
258931,
113524,
244599,
244602,
196093
] |
15dcea75db7e87a09378f42ce67c1fc12f1e672f
|
12a7927d01dcafc438363d48235dcb3b7b946d8c
|
/Sources/Constants/Localizable.swift
|
3e7a4778cd61a8e0716f271760c209cf580f4f16
|
[] |
no_license
|
oleizer/Wallet
|
7a6a9c667433988d551bea70b5b0a38998aa82db
|
4ca0422fe7409f6c5d1a1bdddbf5a19cf67c3bb7
|
refs/heads/master
| 2020-04-09T11:32:51.217093 | 2019-02-14T04:57:21 | 2019-02-14T04:57:21 | 160,314,183 | 0 | 0 | null | 2019-02-13T11:34:49 | 2018-12-04T07:06:54 |
Swift
|
UTF-8
|
Swift
| false | false | 2,577 |
swift
|
// swiftlint:disable all
// Generated using SwiftGen, by O.Halligon — https://github.com/SwiftGen/SwiftGen
import Foundation
// swiftlint:disable superfluous_disable_command
// swiftlint:disable file_length
// MARK: - Strings
// swiftlint:disable explicit_type_interface function_parameter_count identifier_name line_length
// swiftlint:disable nesting type_body_length type_name
internal enum L10n {
internal enum Common {
/// Отмена
internal static let cancel = L10n.tr("Localizable", "Common.Cancel")
/// Выход
internal static let logout = L10n.tr("Localizable", "Common.Logout")
/// Ок
internal static let ok = L10n.tr("Localizable", "Common.Ok")
}
internal enum Welcome {
internal enum Buttons {
/// Восстановить с паролем
internal static let `import` = L10n.tr("Localizable", "Welcome.Buttons.import")
/// Создать новый кошелёк
internal static let new = L10n.tr("Localizable", "Welcome.Buttons.new")
}
internal enum Import {
/// JSON ключа
internal static let json = L10n.tr("Localizable", "Welcome.Import.json")
/// Фразы восстановления
internal static let mnemonic = L10n.tr("Localizable", "Welcome.Import.mnemonic")
/// Приватного ключа
internal static let `private` = L10n.tr("Localizable", "Welcome.Import.private")
/// Восстановить с помощью
internal static let subtitle = L10n.tr("Localizable", "Welcome.Import.subtitle")
/// Восстановить
internal static let title = L10n.tr("Localizable", "Welcome.Import.title")
}
internal enum Labels {
/// Начните с создания нового кошелька или восстановления существующего
internal static let subtitle = L10n.tr("Localizable", "Welcome.Labels.subtitle")
/// MVO Wallet
internal static let title = L10n.tr("Localizable", "Welcome.Labels.title")
}
}
}
// swiftlint:enable explicit_type_interface function_parameter_count identifier_name line_length
// swiftlint:enable nesting type_body_length type_name
// MARK: - Implementation Details
extension L10n {
private static func tr(_ table: String, _ key: String, _ args: CVarArg...) -> String {
let format = NSLocalizedString(key, tableName: table, bundle: Bundle(for: BundleToken.self), comment: "")
return String(format: format, locale: Locale.current, arguments: args)
}
}
private final class BundleToken {}
|
[
-1
] |
c0c2f40fa9a08d55801b0d7f3799a5f762771cdd
|
fb8a44da18e8d0a9198341f444516809b7efe0a0
|
/PrevieTest/PrevieTest/ContentView.swift
|
344902419e12941a073935c9578534d762c4e0ec
|
[] |
no_license
|
daddy73e/DevIOS
|
f13dc3c05a85e18be1959c9409cd315703e6646f
|
e80be5351b936ae2fb6dafbbb19523f24ef6fc71
|
refs/heads/master
| 2023-01-30T03:34:48.251544 | 2020-12-09T08:49:08 | 2020-12-09T08:49:08 | 285,433,743 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 365 |
swift
|
//
// ContentView.swift
// PrevieTest
//
// Created by Yeongeun Song on 2020/08/20.
// Copyright © 2020 daddy73. 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()
}
}
|
[
369287,
126601,
343054,
108815,
108816,
256912,
108818,
347284,
386582,
357409,
252964,
153644,
378669,
372654,
372271,
180531,
375348,
384701,
372030,
214591,
349760,
374977,
147012,
420678,
204999,
356551,
272204,
345165,
353614,
357838,
391504,
212948,
379094,
352984,
398298,
260702,
379103,
345188,
168045,
207725,
66799,
369905,
162298,
360956,
377982
] |
22b5c68733cb63dbcb0ef00a250644acb90f6172
|
ab9d1ac47b743a56296a88bcf280e71d86610667
|
/TrainDatabase/WindowController.swift
|
b09948ab603433e7f51f4af5f18e5e6a0402b1a1
|
[] |
no_license
|
keybuk/TrainDatabase
|
3ee0dc7e44cf8e4df5bfc45cc7f5f5af71ea1a6f
|
0ed3d6e783bc46917869751a4564d129a0a782e9
|
refs/heads/master
| 2021-03-16T09:20:44.074598 | 2020-01-25T05:39:45 | 2020-01-25T05:39:45 | 113,150,152 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 6,553 |
swift
|
//
// WindowController.swift
// TrainDatabase
//
// Created by Scott James Remnant on 12/16/17.
// Copyright © 2017 Scott James Remnant. All rights reserved.
//
import Cocoa
import CoreData
extension NSStoryboard.SceneIdentifier {
static let searchViewController = "searchViewController"
}
class WindowController : NSWindowController, RecordController {
@IBOutlet var navigationControl: NSSegmentedControl!
@IBOutlet var searchField: NSSearchField!
var persistentContainer: NSPersistentContainer!
var sourceListViewController: SourceListViewController!
var tabViewController: NSTabViewController!
var modelsViewController: ModelsViewController!
var recordStack: [CurrentRecord] = []
var recordIndex: Int = 0
func currentRecordChanged() {
navigationControl.setEnabled(recordIndex > recordStack.startIndex, forSegment: 0)
navigationControl.setEnabled(recordIndex < recordStack.index(before: recordStack.endIndex), forSegment: 1)
}
override func windowDidLoad() {
super.windowDidLoad()
persistentContainer = (NSApplication.shared.delegate! as! AppDelegate).persistentContainer
// View hierarchy:
// Split View
// +- Source List
// +- Tab View
// +- Split View (purchase)
// +- Models View
// +- Purchase View
let splitViewController = contentViewController as! NSSplitViewController
sourceListViewController = (splitViewController.splitViewItems[0].viewController as! SourceListViewController)
tabViewController = (splitViewController.splitViewItems[1].viewController as! NSTabViewController)
let purchaseSplitViewController = tabViewController.children[0] as! NSSplitViewController
modelsViewController = (purchaseSplitViewController.splitViewItems[0].viewController as! ModelsViewController)
sourceListViewController.delegate = self
}
@IBAction func navigation(_ sender: NSSegmentedControl) {
switch sender.selectedSegment {
case 0:
recordIndex = recordStack.index(before: recordIndex)
case 1:
recordIndex = recordStack.index(after: recordIndex)
default:
fatalError("There are only two segments")
}
recordIndexChanged()
}
@IBAction func addPurchase(_ sender: NSButton) {
// Clear the current responder first (end editing).
guard window?.makeFirstResponder(nil) ?? true else { return }
let context = persistentContainer.viewContext
var purchase = Purchase(context: context)
let model = purchase.addModel()
currentRecord = .model(model)
}
@IBAction func backupAction(_ sender: NSButton) {
let context = persistentContainer.viewContext
if !context.commitEditing() {
NSLog("Unable to commit editing before saving")
}
if context.hasChanges {
do {
try context.save()
} catch {
let nserror = error as NSError
NSApplication.shared.presentError(nserror)
return
}
}
do {
try (NSApplication.shared.delegate! as! AppDelegate).backup()
} catch {
let nserror = error as NSError
NSApplication.shared.presentError(nserror)
return
}
let alert = NSAlert()
alert.alertStyle = .informational
alert.messageText = "Backup complete."
alert.addButton(withTitle: "OK")
alert.runModal()
}
@IBAction func uploadAction(_ sender: NSButton) {
let context = persistentContainer.viewContext
if !context.commitEditing() {
NSLog("Unable to commit editing before uploading")
}
if context.hasChanges {
do {
try context.save()
} catch {
let nserror = error as NSError
NSApplication.shared.presentError(nserror)
return
}
}
do {
try (NSApplication.shared.delegate! as! AppDelegate).upload() {
let alert = NSAlert()
alert.alertStyle = .informational
alert.messageText = "Upload complete."
alert.addButton(withTitle: "OK")
alert.runModal()
}
} catch {
let nserror = error as NSError
NSApplication.shared.presentError(nserror)
return
}
}
@IBAction func saveAction(_ sender: NSButton) {
let context = persistentContainer.viewContext
if !context.commitEditing() {
NSLog("Unable to commit editing before saving")
}
if context.hasChanges {
do {
try context.save()
} catch {
let nserror = error as NSError
NSApplication.shared.presentError(nserror)
return
}
}
let alert = NSAlert()
alert.alertStyle = .informational
alert.messageText = "Saved."
alert.addButton(withTitle: "OK")
alert.runModal()
}
@IBAction func showFilter(_ sender: NSButton) {
guard let searchViewController = storyboard?.instantiateController(withIdentifier: .searchViewController) as? SearchViewController else { return }
let popover = NSPopover()
popover.contentViewController = searchViewController
popover.behavior = .transient
popover.animates = true
popover.show(relativeTo: sender.bounds, of: sender, preferredEdge: .maxY)
}
@IBAction func search(_ sender: NSSearchField) {
guard !sender.stringValue.isEmpty else {
modelsViewController.setFilter(search: nil)
return
}
sourceListViewController.searching()
tabViewController.selectedTabViewItemIndex = 0
modelsViewController.setFilter(search: sender.stringValue)
}
}
extension WindowController : SourceListDelegate {
func sourceListDidSelect(modelClassification: ModelClassification) {
tabViewController.selectedTabViewItemIndex = 0
modelsViewController.setFilter(classification: modelClassification)
}
func sourceListDidSelectDecoders() {
tabViewController.selectedTabViewItemIndex = 1
}
}
|
[
-1
] |
441a07ea4e2c22a7959e2b6e714fa7ba085dcb64
|
0a1641c9f84faa8359b19e4ca61c2c48256b3aea
|
/Sky/Manager/WeatherDataManager.swift
|
324f69c07c2a0ed01a0b579e733f3709a85e3075
|
[] |
no_license
|
wanqingrongruo/SkyByBoxueio
|
2838417bb725f9255d3384942c3324350834a329
|
bd05d2bef52c72d30eb3af737781a225cf024940
|
refs/heads/master
| 2021-08-28T11:18:01.337929 | 2017-12-12T03:27:25 | 2017-12-12T03:27:25 | 113,411,211 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 3,067 |
swift
|
//
// WeatherDataManager.swift
// Sky
//
// Created by roni on 2017/12/7.
// Copyright © 2017年 Mars. All rights reserved.
//
import Foundation
enum DataManagerError: Error {
case failedRequest
case invalidResponse
case unknown
}
final class WeatherDataManager {
internal let baseURL: URL
internal let urlSession: URLSessionProtocol
// 我们管这种在init中可以传入其它依赖对象的方式,就叫做Dependency Injection。
private init(baseURL: URL, urlSession: URLSessionProtocol){
self.baseURL = baseURL
self.urlSession = urlSession
}
// Single
static let shared = WeatherDataManager(baseURL: API.authenticateUrl, urlSession: Config.urlSession)
typealias CompletionHandler = (WeatherData?, DataManagerError?) -> Void
func weatherDataAt(latitude: Double, longitude: Double, completion: @escaping CompletionHandler){
let url = baseURL.appendingPathComponent("\(latitude), \(longitude)")
var request = URLRequest(url: url)
request.setValue("appliction/json", forHTTPHeaderField: "Content-Type")
request.httpMethod = "GET"
self.urlSession.dataTask(with: request) { (data, response, error) in
// DispatchQueue.main.async {
self.didFinishGettingWeatherData(data: data, response: response, error: error, completion: completion)
// }
}.resume()
}
func didFinishGettingWeatherData(data: Data?, response: URLResponse?, error: Error?, completion: CompletionHandler) {
if let _ = error {
completion(nil, .failedRequest)
}
else if let data = data, let response = response as? HTTPURLResponse {
if response.statusCode == 200 {
do {
let decoder = JSONDecoder()
decoder.dateDecodingStrategy = .secondsSince1970
let weatherData = try decoder.decode(
WeatherData.self, from: data)
completion(weatherData, nil)
}
catch {
completion(nil, .invalidResponse)
}
}
else{
completion(nil, .failedRequest)
}
}
else {
completion(nil, .unknown)
}
}
}
internal class DarkSkyURLSession: URLSessionProtocol {
func dataTask(
with request: URLRequest,
completionHandler: @escaping DataTaskHandler)
-> URLSessionDataTaskProtocol {
return DarkSkyURLSessionDataTask(
request: request,
completion: completionHandler)
}
}
internal struct Config {
private static func isUITesting() -> Bool {
return ProcessInfo.processInfo.arguments.contains("UI-TESTING")
}
static var urlSession: URLSessionProtocol = {
if isUITesting() {
return DarkSkyURLSession()
}
else {
return URLSession.shared
}
}()
}
|
[
-1
] |
a06a6d2e20a7a39a71ee0868bb1a99c7aa47b5bc
|
a39acc5f1fef1e4c344b2810e65742b7fc9dc265
|
/MinimedKit/Messages/ReadRemainingInsulinMessageBody.swift
|
35af7dff363e49a99a75171b6ca98dc386ed00c1
|
[
"MIT"
] |
permissive
|
swiftWindsurfer/rileylink_ios
|
b2b5efd779a6397cb0d06b5aca8481fcb2b9771e
|
45b422fb17f47cb4813e9836fbdbaf5fabfcd15e
|
refs/heads/master
| 2020-04-01T17:49:42.080040 | 2016-07-21T18:10:55 | 2016-07-21T18:10:55 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 795 |
swift
|
//
// ReadRemainingInsulinMessageBody.swift
// RileyLink
//
// Created by Nathan Racklyeft on 5/25/16.
// Copyright © 2016 Pete Schwamb. All rights reserved.
//
import UIKit
public class ReadRemainingInsulinMessageBody: CarelinkLongMessageBody {
public func getUnitsRemainingForStrokes(strokesPerUnit: Int) -> Double {
let strokes: [UInt8]
switch strokesPerUnit {
case let x where x > 10:
strokes = rxData[3..<5]
default:
strokes = rxData[1..<3]
}
return Double(Int(bigEndianBytes: strokes)) / Double(strokesPerUnit)
}
public required init?(rxData: NSData) {
guard rxData.length == self.dynamicType.length else {
return nil
}
super.init(rxData: rxData)
}
}
|
[
-1
] |
2106850b8cab184becf6f3758be472290e0c5d0a
|
76101f186bf59814443446f781ce1ef8a17a2465
|
/SwiftFacebookIntegration/PostViewController.swift
|
ef7d21e75cefe59e9e8aaee79ed739ce01dea871
|
[] |
no_license
|
shobhavj/Facebook-Integration
|
7c0714b637ec21c1d4006e114e6b22c42735363e
|
2f7894b1b0ab96527261bf338b6a47e342872850
|
refs/heads/master
| 2021-04-26T00:46:44.211714 | 2017-11-03T20:54:27 | 2017-11-03T20:54:27 | 107,323,570 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 881 |
swift
|
//
// PostViewController.swift
// SwiftFacebookIntegration
//
// Created by Shobha V J on 2017-10-18.
// Copyright © 2017 Shobha V J. All rights reserved.
//
import UIKit
class PostViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destinationViewController.
// Pass the selected object to the new view controller.
}
*/
}
|
[
278016,
292096,
292102,
198315,
277420,
277421,
277427,
277433,
278015
] |
cafe55610b18a992e2c4b2d26896d6abcca26b29
|
4ed738b5959654fdf45569a8f19b8208e529e0dc
|
/login-screen-exampleUITests/login_screen_exampleUITests.swift
|
c6c18d48bd6ead85967e4293d4a164993586fdbf
|
[] |
no_license
|
rub1cc/login-screen-example
|
0ebc99d44a4524fbb5adf5426d3a5aad66d21e73
|
a754f57b6fde8b96a8ddc73e9f6316bc88356e15
|
refs/heads/master
| 2022-03-31T07:20:59.954775 | 2020-01-07T06:17:24 | 2020-01-07T06:17:24 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,489 |
swift
|
//
// login_screen_exampleUITests.swift
// login-screen-exampleUITests
//
// Created by Faraz Muhammad Aulia on 07/01/20.
// Copyright © 2020 Faraz Muhammad Aulia. All rights reserved.
//
import XCTest
class login_screen_exampleUITests: 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
// 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() {
// 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() {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, *) {
// This measures how long it takes to launch your application.
measure(metrics: [XCTOSSignpostMetric.applicationLaunch]) {
XCUIApplication().launch()
}
}
}
}
|
[
360463,
376853,
237599,
229414,
344106,
278571,
253996,
229425,
385078,
229431,
180279,
352314,
376892,
32829,
286787,
352324,
237638,
352327,
385095,
163916,
368717,
196687,
278607,
311377,
254039,
426074,
368732,
180317,
32871,
352359,
278637,
319599,
385135,
376945,
278642,
385147,
131199,
426124,
278676,
196758,
311447,
327834,
278684,
278690,
49317,
278698,
377010,
278707,
180409,
278713,
139459,
131270,
377033,
164043,
417996,
254157,
368849,
368850,
139478,
229591,
385240,
254171,
147679,
311520,
147680,
205034,
254189,
254193,
147716,
368908,
180494,
368915,
319764,
254228,
278805,
262419,
377116,
311582,
278817,
254250,
311596,
418095,
336177,
98611,
180534,
287040,
155968,
319812,
311622,
270663,
368969,
254285,
180559,
377168,
344402,
229716,
287089,
311679,
385407,
385409,
311692,
106893,
270733,
385423,
213402,
385437,
156069,
254373,
385449,
311723,
115116,
385463,
311739,
319931,
278974,
336319,
311744,
278979,
188870,
278988,
278992,
279000,
377309,
377310,
369121,
279009,
369124,
279014,
319976,
279017,
360945,
319986,
279030,
139766,
311800,
254459,
410108,
410109,
279042,
377346,
287237,
377352,
279053,
410126,
393745,
303634,
303635,
385554,
279061,
254487,
279066,
188957,
385578,
197166,
279092,
33344,
385603,
377419,
426575,
369236,
385620,
115287,
270938,
295518,
287327,
279150,
287345,
287348,
352885,
352886,
344697,
189054,
287359,
303743,
369285,
164487,
279176,
311944,
344714,
311950,
377487,
311953,
336531,
287379,
180886,
295575,
352921,
221853,
205469,
344737,
279207,
295591,
352938,
295598,
279215,
418479,
164532,
287418,
377531,
377534,
66243,
385737,
287438,
385745,
369365,
369366,
385751,
230105,
361178,
352989,
352990,
295649,
418529,
385763,
295653,
369383,
230120,
361194,
312046,
230133,
344829,
205566,
279293,
197377,
295688,
434956,
418579,
197398,
426777,
344864,
197412,
336678,
262952,
262953,
279337,
262957,
189229,
164655,
328495,
303921,
197424,
197428,
336693,
230198,
377656,
197433,
222017,
295745,
377669,
197451,
279379,
385878,
385880,
197467,
230238,
230239,
435038,
279393,
303973,
279398,
197479,
385895,
385901,
197489,
295797,
279418,
164730,
336765,
254851,
369541,
279434,
189327,
377754,
189349,
172971,
377778,
377789,
345030,
213961,
279499,
304086,
418774,
386007,
386016,
304104,
123880,
418793,
222193,
287730,
271351,
435195,
328701,
312317,
328705,
386049,
418819,
410629,
377863,
230411,
320526,
361487,
238611,
386068,
254997,
140311,
238617,
197658,
336928,
336930,
410665,
189487,
345137,
361522,
238646,
238650,
320571,
386108,
336962,
238663,
377927,
361547,
205911,
296023,
156763,
361570,
230500,
214116,
214119,
279659,
173168,
279666,
312435,
377974,
66684,
402568,
140426,
337037,
386191,
296091,
222364,
418975,
124073,
238764,
402618,
148674,
312519,
279752,
402632,
148687,
419028,
279766,
189656,
279775,
304352,
279780,
222441,
279789,
386288,
66802,
271607,
369912,
369913,
386296,
279803,
386304,
320769,
369929,
312588,
320795,
115997,
222496,
320802,
304422,
369964,
353581,
116014,
66863,
312628,
345397,
345398,
386363,
181568,
279872,
279874,
304457,
345418,
337226,
230730,
296269,
238928,
353617,
296274,
378201,
296304,
337280,
263561,
296330,
9618,
279955,
370066,
411028,
370072,
148899,
279980,
173492,
361928,
370122,
337359,
329168,
312785,
329170,
222674,
280020,
353751,
280025,
239069,
329181,
320997,
361958,
271850,
280043,
271853,
329198,
337391,
411119,
116209,
296434,
386551,
288248,
288252,
312830,
271880,
230922,
198155,
329231,
304655,
230933,
370200,
222754,
157219,
157220,
394793,
312879,
230960,
288305,
239159,
157246,
288319,
280131,
124486,
288328,
353875,
239192,
99937,
345697,
312941,
206447,
288377,
337533,
239238,
149127,
149128,
419462,
419464,
239251,
345753,
280217,
198304,
255651,
337590,
370359,
280252,
280253,
321217,
321220,
296649,
239305,
403149,
9935,
313042,
345813,
370390,
280279,
272087,
18139,
280285,
321250,
337638,
181992,
345832,
345835,
288492,
141037,
67316,
288508,
288515,
173828,
280326,
395018,
116491,
395019,
280333,
395026,
124691,
116502,
435993,
345882,
321309,
255781,
378666,
280367,
403248,
378673,
280373,
182070,
182071,
345910,
321338,
280381,
345918,
436029,
337734,
280396,
272207,
272208,
337746,
345942,
362326,
18263,
370526,
345950,
362336,
255844,
214894,
362351,
214896,
124795,
182142,
182145,
280451,
67464,
305032,
214936,
337816,
329627,
239515,
214943,
354210,
436130,
436135,
313257,
10153,
362411,
370604,
362418,
288698,
214978,
280517,
362442,
346066,
231382,
354268,
403421,
436189,
329696,
354273,
190437,
354279,
436199,
313322,
354283,
329707,
174058,
296942,
247787,
124912,
337899,
436209,
247786,
313338,
239610,
346117,
182277,
354310,
354312,
354311,
43016,
403463,
436235,
419857,
436248,
223269,
354342,
346153,
354346,
124974,
272432,
403507,
321589,
378933,
378934,
436283,
288829,
288835,
403524,
436293,
313415,
239689,
436304,
354386,
329812,
411738,
272477,
280676,
313446,
215144,
395373,
288878,
288890,
215165,
436372,
329884,
362658,
215204,
125108,
280761,
280767,
133313,
395458,
280779,
436429,
346319,
321744,
280792,
379102,
387299,
18661,
379110,
182503,
338151,
125166,
149743,
379120,
125170,
411892,
395511,
436471,
313595,
125184,
272644,
125192,
338187,
338188,
125200,
395536,
125204,
272661,
338196,
379157,
125215,
125225,
338217,
321839,
125236,
362809,
379193,
280903,
289109,
272730,
436570,
215395,
239973,
321901,
354671,
354672,
362864,
272755,
354678,
199030,
223611,
248188,
313726,
436609,
436613,
158087,
313736,
264591,
420241,
240020,
190870,
436644,
272815,
436659,
338359,
436677,
289229,
281038,
281039,
256476,
420326,
281071,
166403,
322057,
420374,
289328,
330291,
338491,
281165,
281170,
191065,
436831,
420461,
346739,
346741,
420473,
297600,
166533,
363155,
264855,
289435,
248494,
166581,
314043,
355006,
158424,
363228,
436957,
436960,
264929,
338658,
289511,
330473,
346859,
330476,
289517,
125683,
322302,
35584,
133889,
322312,
346889,
264971,
322320,
207639,
363295,
281378,
289580,
355117,
191285,
355129,
273209,
273211,
281407,
355136,
289599,
355138,
420680,
355147,
355148,
355153,
363353,
281434,
363354,
322396,
420702,
363361,
363362,
281444,
355173,
355174,
207724,
207728,
420722,
207735,
158594,
330627,
240517,
355216,
224149,
256918,
256919,
256920,
289691,
240543,
289699,
256934,
289720,
273336,
273341,
330688,
281541,
363462,
19398,
379845,
273353,
183254,
207839,
347104,
183276,
289773,
412653,
248815,
347122,
240631,
437245,
257023,
125953,
330759,
330766,
347150,
330789,
248871,
281647,
322609,
412725,
314437,
404550,
207954,
339031,
314458,
281698,
281699,
257126,
322664,
265323,
330867,
363643,
150656,
248960,
363658,
224400,
347286,
265366,
339101,
330912,
429216,
339106,
265381,
380069,
249003,
208044,
322733,
421050,
339131,
265410,
290001,
339167,
298209,
290030,
421102,
52473,
363769,
208123,
52476,
412926,
437504,
380178,
429332,
412963,
257323,
273713,
208179,
159033,
347451,
216387,
372039,
257353,
257354,
109899,
224591,
437585,
331091,
314708,
150868,
314711,
372064,
314721,
429410,
437602,
281958,
314727,
134504,
265579,
306541,
314734,
314740,
314742,
421240,
314745,
290170,
224637,
306558,
314759,
388488,
306580,
224662,
282008,
314776,
396697,
282013,
314788,
396709,
314790,
282023,
298406,
241067,
314797,
380335,
355761,
134586,
380348,
216510,
216511,
380350,
200136,
273865,
339403,
372172,
429540,
3557,
3559,
191980,
282097,
306678,
191991,
216575,
290304,
323083,
208397,
413202,
282132,
388630,
175640,
372261,
347693,
323120,
396850,
200245,
323126,
290359,
134715,
323132,
421437,
396865,
282182,
265800,
273992,
421452,
224848,
265809,
224852,
396885,
306777,
396889,
396896,
323171,
282214,
388712,
388713,
290425,
339579,
396927,
282244,
323208,
282248,
224907,
405140,
274071,
323226,
282272,
208547,
208548,
282279,
298664,
364202,
224951,
224952,
306875,
282302,
323262,
323265,
306891,
282321,
241366,
224985,
282336,
159462,
12009,
282349,
397040,
12017,
274170,
175874,
249606,
282375,
323335,
216844,
118549,
282390,
421657,
282399,
282401,
339746,
315172,
241447,
257831,
167720,
282418,
282424,
274234,
241471,
339782,
315209,
159563,
323405,
307024,
307030,
339799,
241494,
307038,
274288,
372592,
274296,
339840,
315265,
282503,
315272,
315275,
184207,
372625,
282517,
298912,
118693,
298921,
438186,
126896,
200628,
380874,
282573,
323554,
380910,
380922,
380923,
274432,
372736,
282634,
241695,
315431,
315433,
102446,
282671,
430127,
405552,
249912,
225347,
233548,
315468,
176209,
315477,
53334,
381013,
200795,
323678,
356446,
315488,
315489,
45154,
438374,
176231,
217194,
233578,
307306,
438378,
422000,
249976,
266361,
422020,
168069,
381061,
168070,
381071,
241809,
323730,
430231,
422044,
299166,
192670,
192671,
233635,
258213,
258233,
299202,
176325,
233678,
266447,
282832,
372943,
356575,
438512,
372979,
381173,
356603,
266504,
61720,
315674,
381210,
282908,
282912,
282920,
438575,
315698,
332084,
438583,
282938,
127292,
438592,
332100,
323914,
282959,
348499,
250196,
348501,
168280,
389465,
323934,
332128,
381286,
242027,
242028,
160111,
250227,
315768,
315769,
291194,
291200,
266628,
340356,
242059,
225684,
373141,
315798,
291225,
389534,
242079,
397732,
291266,
373196,
283088,
283089,
242138,
184799,
283138,
324098,
397841,
283154,
258584,
291359,
348709,
397872,
283185,
266812,
348741,
381515,
348748,
430681,
332379,
111197,
242274,
184938,
373357,
184942,
176751,
389744,
356983,
356984,
209529,
356990,
291455,
373377,
422529,
152196,
201348,
356998,
348807,
356999,
316044,
316048,
316050,
275102,
176805,
340645,
176810,
299698,
160441,
422591,
291529,
135888,
242385,
299737,
373485,
373486,
348921,
275193,
299777,
430853,
430860,
62222,
283418,
430880,
283431,
234290,
152372,
430909,
201534,
160576,
348999,
283466,
275294,
127840,
349025,
357219,
439145,
308075,
242542,
381811,
201590,
177018,
398205,
291713,
340865,
299912,
349066,
316299,
349068,
308111,
381840,
308113,
390034,
430999,
209820,
283551,
398244,
422825,
381872,
349122,
127945,
373705,
340960,
398305,
340967,
324587,
127990,
349176,
201721,
349179,
357380,
398370,
357413,
357420,
21567,
308288,
160834,
349254,
250955,
218187,
300109,
250965,
439391,
250982,
398444,
62574,
357487,
300145,
119925,
349304,
349315,
349317,
373902,
177297,
324761,
300192,
300200,
373937,
324790,
283849,
259275,
316628,
259285,
357594,
414956,
251124,
316661,
283894,
439550,
242955,
177420,
439563,
414989,
349458,
259346,
292145,
382257,
382264,
333114,
333115,
193853,
193858,
300354,
300355,
234830,
406862,
259408,
283990,
357720,
300379,
316764,
374110,
292194,
284015,
234864,
316786,
382329,
243073,
357763,
112019,
398740,
234902,
333224,
374189,
251314,
259513,
54719,
415170,
292291,
300488,
144862,
300526,
259569,
308722,
251379,
398844,
210429,
366081,
316951,
431646,
431662,
374327,
210489,
235069,
349764,
292426,
333389,
128589,
333394,
128600,
235096,
300643,
300645,
54895,
366198,
210558,
210559,
325246,
235136,
415360,
210569,
415369,
431754,
415376,
259741,
153252,
399014,
210601,
317102,
300729,
415419,
333508,
259780,
267978,
333522,
325345,
153318,
333543,
325357,
431861,
284410,
300810,
300812,
161553,
284436,
366358,
169751,
325403,
431901,
341791,
325411,
186148,
186149,
333609,
399148,
202541,
431918,
153392,
300849,
431935,
325444,
153416,
325449,
341837,
415566,
431955,
317268,
325460,
341846,
284508,
300893,
259937,
284515,
276326,
415592,
292713,
292719,
325491,
341878,
333687,
350072,
276343,
317308,
112510,
325508,
333700,
243590,
350091,
350092,
350102,
350108,
333727,
219046,
333734,
284584,
292783,
128955,
153553,
219102,
6116,
292838,
317416,
432114,
325620,
415740,
268286,
415744,
333827,
399372,
358418,
178215,
325675,
243763,
358455,
325695,
399433,
333902,
104534,
194667,
432241,
284789,
284790,
374913,
374914,
194692,
415883,
333968,
153752,
284827,
284840,
284843,
104633,
227517,
260285,
268479,
301255,
374984,
301271,
325857,
334049,
268515,
383208,
317676,
260337,
260338,
375040,
260355,
375052,
194832,
227601,
325904,
334104,
178459,
334121,
317738,
325930,
358698,
260396,
358707,
268609,
227655,
383309,
383327,
391521,
366948,
285031,
416103,
383338,
227702,
211327,
285074,
227730,
252309,
285083,
293275,
39323,
285089,
293281,
301482,
375211,
334259,
342454,
293309,
317889,
326083,
416201,
129484,
326093,
154061,
285152,
432608,
195044,
432616,
334315,
236020,
317949,
342537,
309770,
334345,
342549,
342560,
416288,
350758,
350759,
358951,
227881,
358952,
293420,
219694,
219695,
236080,
23093,
301635,
309831,
55880,
375373,
244311,
309847,
260705,
416353,
375396,
268901,
244326,
301688,
244345,
301702,
375438,
326288,
227991,
285348,
318127,
293552,
342705,
285362,
383668,
154295,
342714,
39616,
383708,
342757,
285419,
269036,
170735,
432883,
342775,
203511,
383740,
432894,
228099,
285443,
285450,
383755,
326413,
285457,
285467,
326428,
318247,
293673,
318251,
342827,
301872,
285493,
285496,
342846,
416577,
293702,
244569,
252766,
301919,
293729,
351078,
342888,
228214,
269179,
211835,
260995,
392071,
416649,
236427,
252812,
400271,
392080,
293780,
310166,
359332,
293801,
326571,
252848,
326580,
261045,
261046,
326586,
359365,
211913,
326602,
56270,
252878,
342990,
433104,
359380,
433112,
433116,
359391,
343020,
187372,
203758,
383980,
383994,
293894,
433166,
384015,
433173,
293911,
326684,
252959,
384031,
375848,
113710,
203829,
375902,
375903,
392288,
285795,
253028,
228457,
351343,
187505,
187508,
302202,
285819,
343166,
285823,
384127,
392320,
318602,
228492,
253074,
326803,
162962,
187539,
359574,
285850,
351389,
367791,
367792,
294069,
367798,
294075,
228541,
343230,
367809,
253124,
113863,
351445,
310496,
228587,
302319,
253168,
351475,
228608,
351489,
318732,
367897,
245018,
367898,
130342,
130347,
286012,
359747,
359748,
114022,
253288,
327030,
163190,
310650,
384379,
253316,
384391,
253339,
318876,
253340,
343457,
245160,
359860,
359861,
343480,
228796,
302530,
228804,
425417,
302539,
327122,
425434,
310747,
286176,
187877,
310758,
40439,
253431,
359931,
343552,
245249,
228868,
302602,
294413,
359949,
253456,
302613,
253462,
302620,
146976,
245290,
245291,
343606,
425534,
147011,
310853,
286281,
147020,
196184,
179800,
212574,
204386,
155238,
204394,
138862,
310896,
294517,
188021,
286344,
188049,
229011,
425624,
229021,
245413,
212649,
286387,
384693,
286392,
286400,
302798,
425682,
286419,
245471,
212721,
286457,
286463,
319232,
360194,
409355,
278292,
278294,
294699,
286507,
384826,
409404,
237397,
376661,
368471,
188250,
237411,
368486,
384871,
409446,
40809,
368489,
425832,
417648,
360315,
253828,
188293,
425875,
294806,
376733,
319393,
294824,
253868,
343993,
188349,
294849,
212947,
212953,
360416,
294887,
253930,
278507,
327666,
278515,
385011
] |
a2046accfbe4d9f0d8d0185dd92bd6bade8a834e
|
480583aadf916ddbc5d67c71e064bd3ea20dcff7
|
/Keyboard Row.playground/Contents.swift
|
059ba1c7722fb9c71c45044e99226f4ddc5e63e4
|
[] |
no_license
|
hbucius/leecode
|
72f1a33d7f90a127883094eb8e9f42318c4d0b27
|
f0baa04d958d33ab14e1d7c6a3ea96568ecb1cfc
|
refs/heads/master
| 2021-01-22T21:38:27.964453 | 2017-03-23T01:42:46 | 2017-03-23T01:43:09 | 85,457,607 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 890 |
swift
|
//: 太简单了,不建议做第二次
class Solution {
func findWords(_ words: [String]) -> [String] {
return words.filter{belongToOneKeyBoardRow(word: $0)}
}
private func belongToOneKeyBoardRow(word:String) -> Bool {
if word.characters.count == 0 {
return true
}
let word = word.lowercased()
let line1 = "qwertyuiop"
let line2 = "asdfghjkl"
let line3 = "zxcvbnm"
var first: String? = nil
for character in word.characters {
if first != nil {
if !first!.characters.contains(character) {
return false
}
} else {
first = [line1, line2, line3].filter{$0.characters.contains(character)}.first
assert(first != nil, "invalid input")
}
}
return true
}
}
|
[
-1
] |
e1a856287831af5663acc2f1a091f7057f1867ea
|
51b92ecda899c9a995899a4af23aaf5a0ae20a9e
|
/game/ViewController.swift
|
2ff69eb5f53ca735fd153ec5ccbf054aed837c90
|
[] |
no_license
|
ikaola-xyz/kaola-iOS
|
fcde39a3566c53ec738d3897cba2807f4f65ef3e
|
2ebd5653814571e2241c824f699ca74430da48ce
|
refs/heads/master
| 2020-09-25T14:42:03.260617 | 2019-12-24T07:32:59 | 2019-12-24T07:32:59 | 226,026,594 | 1 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 315 |
swift
|
//
// ViewController.swift
// game
//
// Created by Eric on 31/5/2019.
// Copyright © 2019 Eric. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
}
|
[
327555,
398203,
356742,
384145,
391441,
188950,
375576,
384153,
399130,
258589,
254494,
254495,
436128,
254497,
155551,
397091,
245024,
351400,
356652,
343984,
319284,
383797,
396725,
402616,
397114,
111292,
384447,
266816,
360903,
359368,
437582,
330960,
316626,
146645,
399958,
402524,
362845,
332513,
399201,
247652,
247653,
384103,
247655,
374122,
352876,
349297,
210674,
324465,
320506,
361595
] |
45513c57b65d88830ca7a5275595f71cf40883ad
|
d3f841d8631644be1d1e99f3a7d5fb01a9370639
|
/BookStore/MasterViewController.swift
|
39c7af705226c0a3d179e8938ad6445bc6d39a05
|
[] |
no_license
|
jeremeallen/BookStore
|
e054ee26f4107cd8445b48a929b8a1d766a46636
|
df617d2b60c477c7a91ea257b3111fad2776a3f0
|
refs/heads/master
| 2021-01-10T09:01:47.949825 | 2016-01-30T03:53:08 | 2016-01-30T03:53:08 | 50,707,581 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 3,635 |
swift
|
//
// MasterViewController.swift
// BookStore
//
// Created by Jereme Allen on 1/29/16.
// Copyright © 2016 Jereme Allen. All rights reserved.
//
import UIKit
class MasterViewController: UITableViewController {
var detailViewController: DetailViewController? = nil
var objects = [AnyObject]()
var myBookStore: BookStore = BookStore()
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
let addButton = UIBarButtonItem(barButtonSystemItem: .Add, target: self, action: "insertNewObject:")
self.navigationItem.rightBarButtonItem = addButton
if let split = self.splitViewController {
let controllers = split.viewControllers
self.detailViewController = (controllers[controllers.count-1] as! UINavigationController).topViewController as? DetailViewController
}
}
override func viewWillAppear(animated: Bool) {
self.clearsSelectionOnViewWillAppear = self.splitViewController!.collapsed
super.viewWillAppear(animated)
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
func insertNewObject(sender: AnyObject) {
objects.insert(NSDate(), atIndex: 0)
let indexPath = NSIndexPath(forRow: 0, inSection: 0)
self.tableView.insertRowsAtIndexPaths([indexPath], withRowAnimation: .Automatic)
}
// MARK: - Segues
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if segue.identifier == "showDetail" {
if let indexPath = self.tableView.indexPathForSelectedRow {
let selectedBook:Book = myBookStore.theBookStore[indexPath.row]
let controller = (segue.destinationViewController as! UINavigationController).topViewController as! DetailViewController
controller.detailItem = selectedBook
controller.navigationItem.leftBarButtonItem = self.splitViewController?.displayModeButtonItem()
controller.navigationItem.leftItemsSupplementBackButton = true
}
}
}
// MARK: - Table View
override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
return 1
}
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return myBookStore.theBookStore.count
}
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath)
cell.textLabel!.text = myBookStore.theBookStore[indexPath.row].title
cell.accessoryType = UITableViewCellAccessoryType.DisclosureIndicator
return cell
}
override func tableView(tableView: UITableView, canEditRowAtIndexPath indexPath: NSIndexPath) -> Bool {
// Return false if you do not want the specified item to be editable.
return true
}
override func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) {
if editingStyle == .Delete {
objects.removeAtIndex(indexPath.row)
tableView.deleteRowsAtIndexPaths([indexPath], withRowAnimation: .Fade)
} else if editingStyle == .Insert {
// Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view.
}
}
}
|
[
281546,
277691,
289168,
228211,
283415,
226907
] |
82ed6a4d1859a017920441644e1c6bbffe6f8978
|
be66d3d8e980fae013d65898b0ee4a9adfcdcb24
|
/Rhymer/Rhymer/View Controllers/HomeScreenViewController.swift
|
fff9cd0f5ff643528c8c19bfd1f93a90da369dc3
|
[
"MIT"
] |
permissive
|
JoshBergstrom/Make-school-project
|
9bb0c2d7a4b10958819e3e4f1a3993a09ea0df2b
|
15520de60e43cb8f87bb3b4257c917f6b7324ed3
|
refs/heads/master
| 2020-03-23T05:49:23.514752 | 2018-07-20T23:00:06 | 2018-07-20T23:00:06 | 141,168,145 | 3 | 3 |
MIT
| 2018-07-20T03:46:30 | 2018-07-16T16:59:56 |
Swift
|
UTF-8
|
Swift
| false | false | 2,297 |
swift
|
//
// HomeScreenViewController.swift
// Rhymer
//
// Created by Arya Gharib on 7/16/18.
// Copyright © 2018 Sina Gharib. All rights reserved.
//
import UIKit
import SwiftyJSON
import Alamofire
public var wordToSearch: String? = nil
class HomeScreenViewController: UIViewController, UITextFieldDelegate, UITableViewDelegate, UITableViewDataSource {
@IBOutlet weak var homeTableView: UITableView!
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 4
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = homeTableView.dequeueReusableCell(withIdentifier: "homeCell") as! HomeTableViewCell
return cell
}
override func viewDidLoad() {
super.viewDidLoad()
// Constantly update the global variable "wordToSearch" here with the contents of the search bar
searchBar.searchButtonPressed = {
self.search()
}
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.navigationController?.setNavigationBarHidden(true, animated: animated)
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
self.navigationController?.setNavigationBarHidden(false, animated: animated)
}
//IBOutlets home page
@IBOutlet weak var searchBar: SearchBar!
@IBOutlet weak var recentTableView: UITableView!
//dismiss Keyboard
func search () {
if self.searchBar.isFirstResponder {
self.searchBar.resignFirstResponder()
}
guard let searchBar = self.searchBar.text else { return }
wordToSearch = searchBar
performSegue(withIdentifier: "wordSearch", sender: nil)
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "wordSearch"{
let resultVC = segue.destination as! ResultsScreenViewController
resultVC.word = searchBar.text
}
}
@IBAction func unwindWithSegue(_ segue: UIStoryboardSegue) {
}
@IBAction func EnterButtonClicked(_ sender: Any) {
search()
}
}
|
[
-1
] |
c239b8308c1bafa0b72ca75977248903282b7964
|
ed7edc1fac4ef45df15994e7286cf539da396f2d
|
/Swift/SwiftBigNerdRanch/MonsterTown (Ch 16 Properties)/MonsterTown/main.swift
|
fd15851df7af878b46566213753dfd4239f9737c
|
[] |
no_license
|
CorbanSwain/Programming-Lessons
|
113c3d4f0e50f15541dcb953b249bdd781b00680
|
1d5178c9aae2ed692b2f8d36f6d27be4a842c52f
|
refs/heads/master
| 2021-07-15T00:41:42.914843 | 2017-10-21T02:48:50 | 2017-10-21T02:48:50 | 107,744,779 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 738 |
swift
|
//
// main.swift
// MonsterTown
//
// Created by Corban Swain on 12/28/16.
// Copyright © 2016 BigNerdRanch. All rights reserved.
//
import Foundation
var myTown = Town()
let myTownSize = myTown.townSize
print(myTownSize)
myTown.changePopulation(by: Int(1e6))
print("Size: \(myTown.townSize); population: \(myTown.population)")
let fredTheZombie = Zombie()
fredTheZombie.town = myTown
fredTheZombie.town?.printDescription()
fredTheZombie.terrorizeTown()
fredTheZombie.terrorizeTown()
fredTheZombie.town?.printDescription()
print("Victim Pool: \(fredTheZombie.victimPool)")
fredTheZombie.victimPool = 500
print("Victim Pool: \(fredTheZombie.victimPool)")
print(Zombie.spookyNoise)
if Zombie.isTerrifying {
print("Run away!")
}
|
[
-1
] |
68b746ae587d7ae1b7e795f54adf8b6c2be1cc00
|
069898bdc136368e676ce546922486744a1eb70e
|
/IOSTwitter/ComposeViewController.swift
|
e34e9979c718f6e8778d9d85131de5f79d6da33e
|
[] |
no_license
|
cassiomo/IOSTwitter
|
ae329e3e80732e077bc56371dd8788857b3e0a22
|
2546296bdc1443c3a99a6aae33f3f9c61d695bea
|
refs/heads/master
| 2021-01-10T13:31:08.912624 | 2015-10-12T06:13:46 | 2015-10-12T06:13:46 | 43,589,311 | 0 | 1 | null | null | null | null |
UTF-8
|
Swift
| false | false | 898 |
swift
|
//
// ComposeViewController.swift
// IOSTwitter
//
// Created by Mo, Kevin on 10/4/15.
// Copyright © 2015 Mo, Kevin. All rights reserved.
//
import UIKit
class ComposeViewController: UIViewController, UITextViewDelegate {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
// Get the new view controller using segue.destinationViewController.
// Pass the selected object to the new view controller.
}
*/
}
|
[
279046,
309264,
279064,
295460,
286249,
197677,
300089,
226878,
277057,
288321,
288332,
292428,
278606,
292431,
292432,
212561,
300116,
300629,
276054,
237655,
200802,
286314,
164974,
284276,
284277,
294518,
314996,
284287,
278657,
281218,
284289,
281221,
284293,
284298,
303242,
311437,
227984,
303760,
278675,
226454,
226455,
226456,
226458,
278686,
284323,
278693,
284328,
284336,
280760,
277180,
283839,
280772,
228551,
280775,
298189,
290004,
284373,
290006,
189655,
226009,
298202,
298204,
280797,
298207,
278752,
290016,
298211,
290020,
284391,
280808,
234223,
358127,
312049,
286963,
280821,
226038,
286965,
333048,
288501,
358139,
280832,
230147,
358147,
278791,
300817,
278298,
287005,
287007,
295711,
281380,
315177,
130346,
282922,
289578,
312107,
282926,
113972,
159541,
289596,
283453,
289600,
283461,
234829,
298830,
279380,
295766,
279386,
298843,
308064,
200549,
227688,
216433,
290166,
292730,
333179,
290175,
224643,
313733,
304012,
304015,
300432,
310673,
275358,
289697,
284586,
276396,
277420,
277422,
279982,
286126,
297903,
305582,
230323,
277429,
277430,
277432,
277433,
277434,
278973,
291774,
298951,
280015,
280029,
286175,
286189,
183278,
298989,
237556,
292341,
286204,
290303
] |
3d933652937a4b2dbdadaa522760a90a91a84061
|
03e8fd8c19c41e2e82113e4a264475d015c6896d
|
/Market/Helpers/FirebaseCollectionReference.swift
|
9811e5c849ba90f3a34df923d6f0393aa1ae3e2f
|
[] |
no_license
|
conorandrews16/MarketApp
|
630f7233b1a780ebc10d8257b2b2faf1ef29caf8
|
ac2f75ce2e293ee2c8f673d48cbc779738d5fb71
|
refs/heads/main
| 2023-05-26T12:44:53.409793 | 2021-05-28T10:31:32 | 2021-05-28T10:31:32 | 371,668,193 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 434 |
swift
|
//
// FirebaseCollectionReference.swift
// Market
//
// Created by Conor Andrews on 21/04/2021.
//
import Foundation
import FirebaseFirestore
enum FCollectionReference: String {
case User
case Category
case Items
case Basket
case Orders
}
func FirebaseReference(_ collectionReference: FCollectionReference) -> CollectionReference {
return Firestore.firestore().collection(collectionReference.rawValue)
}
|
[
-1
] |
3612ad2d34bb1e956635335eaedb34d53580f672
|
7b69baafdaf91062d12ba2bb920adeb2cbbcef85
|
/Sources/Kitura/bodyParser/RawBodyParser.swift
|
e40756860f0a843af0ca55505b31f4cfa8d61496
|
[
"Apache-2.0"
] |
permissive
|
Kitura-Next/Kitura
|
6573fe2ce561641a985553eccdee251607c8a742
|
96f80313254fa6fd4492ab91267cb41aaa3c3544
|
refs/heads/master
| 2023-02-16T05:44:11.348447 | 2021-01-07T13:34:43 | 2021-01-07T13:34:43 | 306,770,307 | 0 | 1 |
Apache-2.0
| 2021-01-07T13:34:44 | 2020-10-23T23:49:06 |
Swift
|
UTF-8
|
Swift
| false | false | 747 |
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 Foundation
class RawBodyParser: BodyParserProtocol {
func parse(_ data: Data) -> ParsedBody? {
return ParsedBody.raw(data)
}
}
|
[
-1
] |
125bdd29754a279451964658a41d42f6047740a8
|
2bcbab6551b3169e80a49742ba60cec7f4d50511
|
/SmartCity/GarbageLocationVC.swift
|
b03ccd461a7ee4255e4a379464582fa384d9869c
|
[] |
no_license
|
Prithviraj8/Smart-City-Hackathon
|
ef1d7e652e9f26c06edf8bdf7224bcc54ba4e7e9
|
f2161af7c3869d42443d616c11d898e65256bb06
|
refs/heads/master
| 2020-12-09T06:34:06.928277 | 2020-01-11T11:51:02 | 2020-01-11T11:51:02 | 233,223,755 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 6,518 |
swift
|
//
// GarbageLocationVC.swift
// SmartCity
//
// Created by Prithviraj Murthy on 20/11/19.
// Copyright © 2019 Prithviraj Murthy. All rights reserved.
//
import UIKit
import MapKit
class customPin: NSObject, MKAnnotation {
var coordinate: CLLocationCoordinate2D
var title: String?
var subtitle: String?
init(pinTitle:String, pinSubTitle:String, location:CLLocationCoordinate2D) {
self.title = pinTitle
self.subtitle = pinSubTitle
self.coordinate = location
}
}
//18.573482, 73.876825 18.572781, 73.877898 18.571723, 73.877254 18.575018, 73.876871
class GarbageLocationVC: UIViewController, MKMapViewDelegate , CLLocationManagerDelegate{
@IBOutlet weak var mapView: MKMapView!
var locations = [CLLocationCoordinate2D]()
var pinTitles = [String]()
var pinSubTitles = [String]()
let locationManager = CLLocationManager()
var getDirections: Bool = false
override func viewDidLoad() {
super.viewDidLoad()
locationManager.delegate = self
locationManager.desiredAccuracy = kCLLocationAccuracyNearestTenMeters
locationManager.requestAlwaysAuthorization()
locationManager.startUpdatingLocation()
// Do any additional setup after loading the view.
let location = CLLocationCoordinate2D(latitude: (locationManager.location?.coordinate.latitude)!, longitude: (locationManager.location?.coordinate.longitude)!)
locations.append(CLLocationCoordinate2D(latitude: 18.573482, longitude:73.876825))
locations.append(CLLocationCoordinate2D(latitude: 18.572781, longitude:73.877898))
locations.append(CLLocationCoordinate2D(latitude: 18.571723, longitude:73.877254))
locations.append(CLLocationCoordinate2D(latitude: 18.575018, longitude:73.876871))
pinTitles.append("Location1")
pinTitles.append("Location2")
pinTitles.append("Location3")
pinTitles.append("Location4")
pinSubTitles.append("Click here to get Directions")
let region = MKCoordinateRegion(center: location, span: MKCoordinateSpan(latitudeDelta: 0.005, longitudeDelta: 0.005))
self.mapView.setRegion(region, animated: true)
for i in 0..<locations.count {
let pin1 = customPin(pinTitle: pinTitles[i], pinSubTitle: pinSubTitles[0], location: locations[i])
self.mapView.addAnnotation(pin1)
self.mapView.delegate = self
}
}
func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView? {
if annotation is MKUserLocation {
return nil
}
let annotationView = MKAnnotationView(annotation: annotation, reuseIdentifier: "customannotation")
annotationView.image = UIImage(named:"pin")
annotationView.canShowCallout = true
return annotationView
}
var location = CLLocationCoordinate2D()
var garbageImg: Int = 1
func mapView(_ mapView: MKMapView, didSelect view: MKAnnotationView) {
print("annotation title == \(String(describing: view.annotation?.title!))")
if view.annotation?.title! == "Location1"{
location.latitude = locations[0].latitude
location.longitude = locations[0].longitude
garbageImg = 1
performSegue(withIdentifier: "GarbageInfo", sender: self)
}
if view.annotation?.title! == "Location2"{
location.latitude = locations[1].latitude
location.longitude = locations[1].longitude
garbageImg = 2
performSegue(withIdentifier: "GarbageInfo", sender: self)
}
if view.annotation?.title! == "Location3"{
location.latitude = locations[2].latitude
location.longitude = locations[2].longitude
garbageImg = 3
performSegue(withIdentifier: "GarbageInfo", sender: self)
}
if view.annotation?.title! == "Location4"{
location.latitude = locations[3].latitude
location.longitude = locations[3].longitude
garbageImg = 4
performSegue(withIdentifier: "GarbageInfo", sender: self)
}
if view.annotation?.title! == "Location5"{
location.latitude = locations[4].latitude
location.longitude = locations[4].longitude
garbageImg = 5
performSegue(withIdentifier: "GarbageInfo", sender: self)
}
if view.annotation?.title! == "Location6"{
location.latitude = locations[5].latitude
location.longitude = locations[5].longitude
garbageImg = 6
performSegue(withIdentifier: "GarbageInfo", sender: self)
}
if view.annotation?.title! == "Location7"{
location.latitude = locations[6].latitude
location.longitude = locations[6].longitude
garbageImg = 7
performSegue(withIdentifier: "GarbageInfo", sender: self)
}
}
@IBAction func getMoreLocations(_ sender: Any) {
let center = CLLocationCoordinate2D(latitude: (locationManager.location?.coordinate.latitude)!, longitude: (locationManager.location?.coordinate.longitude)!)
let region = MKCoordinateRegion(center: center, span: MKCoordinateSpan(latitudeDelta: 0.040, longitudeDelta: 0.040))
self.mapView.setRegion(region, animated: true)
locations.append(CLLocationCoordinate2D(latitude: 18.575185, longitude:73.897061))
locations.append(CLLocationCoordinate2D(latitude: 18.560296, longitude:73.876289))
locations.append(CLLocationCoordinate2D(latitude: 18.568351, longitude:73.885473))
pinTitles.append("Location5")
pinTitles.append("Location6")
pinTitles.append("Location7")
for i in 4..<locations.count {
let pin = customPin(pinTitle: pinTitles[i], pinSubTitle: pinSubTitles[0], location: locations[i])
self.mapView.addAnnotation(pin)
self.mapView.delegate = self
}
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "GarbageInfo"{
let VC = segue.destination as! GarbageInfoVC
VC.location = location
VC.garbageImg = garbageImg
}
}
}
|
[
-1
] |
64510092172a6fb21f574255fef7878971f1b648
|
8fad42a798c09166ef2af53421c47232672af53f
|
/GitTest/AppDelegate.swift
|
47ff452bf0a2a40f5688b13ad9329a442ffcb178
|
[] |
no_license
|
ChristopherM9/HelloWorldGitTest
|
b185c37357781ccbd18e427909a30d9c649ae682
|
2d105c6059146c1a4bae675a42c82bf5b4d57945
|
refs/heads/main
| 2023-03-20T19:37:24.269556 | 2021-03-19T13:06:47 | 2021-03-19T13:06:47 | 349,420,052 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,351 |
swift
|
//
// AppDelegate.swift
// GitTest
//
// Created by Christopher Mabry on 3/19/21.
//
import UIKit
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
// MARK: UISceneSession Lifecycle
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
// Called when a new scene session is being created.
// Use this method to select a configuration to create the new scene with.
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
}
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
// Called when the user discards a scene session.
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
}
}
|
[
393222,
393224,
393230,
393250,
344102,
393261,
393266,
213048,
385081,
376889,
393275,
376905,
327756,
254030,
286800,
368727,
180313,
368735,
180320,
376931,
286831,
368752,
286844,
417924,
262283,
286879,
286888,
377012,
327871,
180416,
377036,
180431,
377046,
418007,
418010,
377060,
327914,
205036,
393456,
393460,
418043,
336123,
385280,
336128,
262404,
180490,
164106,
368911,
262416,
262422,
377117,
262436,
336180,
262454,
393538,
262472,
344403,
213332,
65880,
262496,
418144,
262499,
213352,
246123,
262507,
262510,
213372,
385419,
393612,
262550,
262552,
385440,
385443,
262566,
385451,
262573,
393647,
385458,
262586,
344511,
262592,
360916,
369118,
328177,
328179,
328182,
328189,
328192,
164361,
410128,
393747,
254490,
188958,
385570,
33316,
377383,
197159,
352821,
197177,
418363,
188987,
369223,
385609,
385616,
352864,
369253,
262760,
352874,
352887,
254587,
377472,
148105,
377484,
352918,
98968,
344744,
361129,
336555,
385713,
434867,
164534,
336567,
328378,
164538,
328386,
352968,
344776,
352971,
418507,
352973,
385742,
385748,
361179,
189153,
369381,
361195,
418553,
344831,
336643,
344835,
344841,
361230,
336659,
418580,
418585,
434970,
369435,
418589,
262942,
418593,
336675,
328484,
418598,
418605,
336696,
361273,
328515,
336708,
328519,
361288,
336711,
328522,
336714,
426841,
254812,
361309,
197468,
361315,
361322,
328573,
377729,
369542,
361360,
222128,
345035,
386003,
345043,
386011,
386018,
386022,
435187,
328702,
328714,
361489,
386069,
386073,
336921,
336925,
345118,
377887,
345133,
345138,
386101,
361536,
197707,
189520,
345169,
156761,
361567,
148578,
345199,
386167,
361593,
410745,
361598,
214149,
345222,
386186,
337047,
345246,
214175,
337071,
337075,
345267,
386258,
328924,
66782,
222437,
386285,
328941,
386291,
345376,
353570,
345379,
410917,
345382,
337205,
345399,
378169,
369978,
337222,
337229,
337234,
263508,
402791,
345448,
271730,
378227,
271745,
181638,
353673,
181643,
181649,
181654,
230809,
181670,
181673,
181678,
181681,
337329,
181684,
181690,
361917,
181696,
337349,
181703,
337365,
271839,
329191,
361960,
329194,
116210,
337398,
337415,
329226,
419339,
419343,
419349,
345625,
419355,
370205,
419359,
394786,
419362,
370213,
419368,
419376,
206395,
214593,
419400,
419402,
353867,
419406,
419410,
394853,
345701,
222830,
370297,
403070,
353919,
403075,
345736,
198280,
403091,
345749,
419483,
345757,
345762,
419491,
345765,
419497,
419501,
370350,
419506,
419509,
419512,
337592,
419517,
337599,
419527,
419530,
419535,
272081,
419542,
394966,
419544,
181977,
345818,
419547,
419550,
419559,
337642,
419563,
337645,
370415,
337659,
141051,
337668,
362247,
395021,
362255,
116509,
345887,
378663,
345905,
354106,
354111,
247617,
354117,
370503,
329544,
345930,
370509,
354130,
247637,
337750,
370519,
313180,
354142,
354150,
354156,
345967,
345970,
345974,
403320,
354172,
247691,
337808,
247700,
329623,
436126,
436132,
337833,
362413,
337844,
346057,
247759,
346063,
329697,
354277,
190439,
247789,
354313,
346139,
436289,
378954,
395339,
338004,
100453,
329832,
329855,
329867,
329885,
411805,
346272,
362660,
100524,
387249,
379066,
387260,
256191,
395466,
346316,
411861,
411864,
411868,
411873,
379107,
411876,
387301,
346343,
338152,
387306,
387312,
346355,
436473,
321786,
379134,
411903,
411916,
379152,
395538,
387349,
338199,
387352,
182558,
338211,
395566,
248111,
362822,
436555,
190796,
379233,
354673,
321910,
248186,
420236,
379278,
272786,
354727,
338352,
330189,
338381,
338386,
256472,
338403,
338409,
248308,
199164,
330252,
199186,
420376,
330267,
354855,
10828,
199249,
346721,
174695,
248425,
191084,
338543,
191092,
346742,
330383,
354974,
150183,
174774,
248504,
174777,
223934,
355024,
273108,
355028,
264918,
183005,
256734,
436962,
338660,
338664,
264941,
363251,
207619,
264964,
338700,
256786,
199452,
363293,
396066,
346916,
396069,
215853,
355122,
355131,
355140,
355143,
338763,
355150,
330580,
355166,
265055,
265058,
355175,
387944,
355179,
330610,
330642,
355218,
412599,
207808,
379848,
396245,
330710,
248792,
248798,
347105,
257008,
183282,
265207,
330748,
265214,
330760,
330768,
248862,
396328,
347176,
158761,
199728,
396336,
330800,
396339,
339001,
388154,
388161,
347205,
248904,
330826,
248914,
412764,
339036,
257120,
265320,
248951,
420984,
330889,
347287,
248985,
339097,
44197,
380070,
339112,
249014,
126144,
330958,
330965,
265432,
265436,
388319,
388347,
175375,
159005,
175396,
208166,
273708,
347437,
372015,
347441,
372018,
199988,
44342,
175415,
396600,
437566,
175423,
437570,
437575,
437583,
331088,
437587,
331093,
396633,
175450,
437595,
175457,
208227,
175460,
175463,
265580,
437620,
175477,
249208,
175483,
175486,
249214,
175489,
249218,
249224,
249227,
249234,
175513,
175516,
396705,
175522,
355748,
380332,
396722,
208311,
388542,
372163,
216517,
380360,
216522,
339404,
372176,
208337,
339412,
413141,
339417,
339420,
249308,
339424,
249312,
339428,
339434,
249328,
69113,
372228,
208398,
380432,
175635,
265778,
265795,
396872,
265805,
224853,
224857,
257633,
224870,
372327,
257646,
372337,
224884,
224887,
224890,
224894,
224897,
372353,
216707,
126596,
421508,
224904,
224909,
11918,
159374,
224913,
126610,
339601,
224916,
224919,
126616,
224922,
208538,
224926,
224929,
224932,
224936,
257704,
224942,
257712,
224947,
257716,
257720,
224953,
257724,
224959,
257732,
224965,
224969,
339662,
224975,
257747,
224981,
224986,
257761,
224993,
257764,
224999,
339695,
225012,
257787,
225020,
339710,
257790,
225025,
257794,
339721,
257801,
257804,
225038,
257807,
225043,
372499,
167700,
225048,
257819,
225053,
184094,
225058,
257833,
225066,
257836,
413484,
225070,
225073,
372532,
257845,
225079,
397112,
225082,
397115,
225087,
225092,
225096,
323402,
257868,
225103,
257871,
397139,
225108,
225112,
257883,
257886,
225119,
257890,
339814,
225127,
257896,
274280,
257901,
225137,
339826,
257908,
225141,
257912,
225148,
257916,
257920,
225155,
339844,
225165,
397200,
225170,
380822,
225175,
225180,
118691,
184244,
372664,
372702,
372706,
356335,
380918,
372738,
405533,
430129,
266294,
266297,
421960,
356439,
430180,
421990,
266350,
356466,
266362,
381068,
225423,
250002,
250004,
225429,
356506,
225437,
135327,
225441,
438433,
225444,
438436,
225447,
438440,
225450,
258222,
225455,
430256,
225458,
225461,
225466,
389307,
225470,
381120,
372929,
430274,
225475,
389320,
225484,
225487,
225490,
225493,
266453,
225496,
225499,
225502,
225505,
356578,
225510,
217318,
225514,
225518,
372976,
381176,
397571,
389380,
61722,
356637,
356640,
356643,
356646,
266536,
356649,
356655,
332080,
340275,
356660,
397622,
332090,
225597,
332097,
201028,
348488,
332106,
332117,
348502,
250199,
250202,
332125,
250210,
348522,
348525,
348527,
332152,
389502,
250238,
332161,
356740,
332172,
373145,
340379,
389550,
324030,
266687,
160234,
127471,
340472,
381436,
324094,
266754,
324099,
324102,
324111,
340500,
324117,
324131,
332324,
381481,
356907,
324139,
324142,
356916,
324149,
324155,
348733,
324164,
356934,
348743,
381512,
324170,
324173,
324176,
389723,
332380,
373343,
381545,
340627,
373398,
184982,
258721,
332453,
332459,
389805,
332463,
381617,
332471,
332483,
332486,
373449,
332493,
357069,
357073,
332511,
332520,
340718,
332533,
348924,
389892,
373510,
389926,
348978,
152370,
340789,
348982,
398139,
127814,
357201,
357206,
389978,
430939,
357211,
357214,
201579,
201582,
349040,
340849,
201588,
430965,
381813,
324472,
398201,
340858,
324475,
430972,
340861,
324478,
119674,
324481,
373634,
398211,
324484,
324487,
381833,
324492,
324495,
324498,
430995,
324501,
324510,
422816,
324513,
398245,
201637,
324524,
340909,
324533,
324538,
324541,
398279,
340939,
340941,
209873,
340957,
431072,
398306,
340963,
209895,
201711,
349172,
381946,
349180,
439294,
431106,
357410,
250914,
185380,
357418,
209965,
209968,
209975,
209979,
209987,
209995,
341071,
349267,
250967,
210010,
341091,
210025,
210027,
210030,
210036,
210039,
349308,
349311,
160895,
152703,
210052,
349319,
210055,
218247,
210067,
210071,
210077,
210080,
251044,
210084,
185511,
210088,
210098,
210107,
210115,
332997,
210127,
333009,
210131,
333014,
210138,
210143,
218354,
218360,
251128,
275706,
275712,
275715,
275721,
349459,
333078,
251160,
349484,
349491,
251189,
415033,
251210,
357708,
210260,
365911,
259421,
365921,
333154,
251235,
374117,
333162,
234866,
390516,
333175,
357755,
251271,
136590,
374160,
112020,
349590,
357792,
259515,
415166,
415185,
366034,
366038,
415191,
415193,
415196,
415199,
423392,
333284,
415207,
366056,
366061,
415216,
210420,
415224,
423423,
415257,
415263,
366117,
415270,
144939,
415278,
415281,
415285,
210487,
415290,
415293,
349761,
415300,
333386,
366172,
333413,
423528,
423532,
210544,
415353,
333439,
415361,
267909,
153227,
333498,
210631,
333511,
259788,
358099,
153302,
333534,
366307,
366311,
431851,
366318,
210672,
366321,
366325,
210695,
268041,
210698,
366348,
210706,
399128,
333594,
210719,
358191,
366387,
210739,
399159,
358200,
325440,
366401,
341829,
325446,
46920,
341834,
341838,
341843,
415573,
358234,
341851,
350045,
399199,
259938,
399206,
268143,
358255,
399215,
358259,
341876,
333689,
243579,
325504,
333698,
333708,
333724,
382890,
350146,
333774,
358371,
350189,
350193,
350202,
333818,
350206,
350213,
268298,
350224,
350231,
333850,
350237,
350240,
350244,
350248,
178218,
350251,
350256,
350259,
350271,
243781,
350285,
374864,
342111,
342133,
374902,
432271,
333997,
334011,
260289,
260298,
350410,
350416,
350422,
211160,
350425,
268507,
334045,
350445,
375026,
358644,
350458,
350461,
350464,
325891,
350467,
350475,
375053,
268559,
350480,
432405,
350486,
325914,
350490,
325917,
350493,
325919,
350498,
194852,
350504,
358700,
391468,
350509,
358704,
358713,
358716,
383306,
334161,
383321,
383330,
383333,
391530,
383341,
334203,
268668,
194941,
391563,
366990,
416157,
342430,
268701,
375208,
326058,
375216,
334262,
334275,
326084,
358856,
334304,
334311,
375277,
334321,
350723,
186897,
342545,
334358,
342550,
342554,
334363,
358941,
350761,
252461,
334384,
383536,
358961,
334394,
252482,
219718,
334407,
334420,
350822,
375400,
334465,
334468,
162445,
326290,
342679,
342683,
260766,
342710,
244409,
260797,
260801,
350917,
154317,
391894,
154328,
416473,
64230,
113388,
342766,
375535,
203506,
342776,
391937,
391948,
375568,
326416,
375571,
375574,
162591,
326441,
383793,
326451,
326454,
326460,
260924,
375612,
244540,
326467,
244551,
326473,
326477,
326485,
416597,
326490,
342874,
326502,
375656,
433000,
326507,
326510,
211825,
211831,
351097,
392060,
359295,
351104,
342915,
400259,
236430,
342930,
252822,
392091,
400285,
252836,
359334,
211884,
400306,
351168,
359361,
326598,
359366,
359382,
359388,
383967,
343015,
359407,
261108,
244726,
261111,
383997,
261129,
359451,
261147,
211998,
261153,
261159,
359470,
359476,
343131,
384098,
384101,
384107,
367723,
187502,
343154,
384114,
212094,
351364,
384135,
384139,
384143,
351381,
384160,
384168,
367794,
384181,
367800,
384191,
351423,
384198,
326855,
244937,
253130,
343244,
146642,
359649,
343270,
351466,
351479,
384249,
343306,
261389,
359694,
384269,
253200,
261393,
384275,
245020,
245029,
171302,
351534,
376110,
245040,
384314,
425276,
384323,
212291,
343365,
212303,
367965,
343393,
343398,
367980,
425328,
343409,
253303,
154999,
343417,
327034,
245127,
384397,
245136,
245142,
245145,
343450,
245148,
245151,
245154,
245157,
245162,
327084,
359865,
384443,
146876,
327107,
384453,
327110,
327115,
327117,
359886,
359890,
343507,
368092,
343534,
343539,
368119,
343544,
368122,
409091,
359947,
359955,
359983,
343630,
179802,
155239,
327275,
245357,
138864,
155254,
155273,
368288,
245409,
425638,
425649,
155322,
425662,
155327,
155351,
155354,
212699,
155363,
245475,
155371,
245483,
409335,
155393,
155403,
155422,
360223,
155438,
155442,
155447,
417595,
360261,
155461,
376663,
155482,
261981,
425822,
155487,
376671,
155490,
155491,
327531,
261996,
376685,
261999,
262002,
327539,
147317,
262005,
425845,
262008,
262011,
155516,
155521,
155525,
360326,
376714,
155531,
262027,
262030,
262033,
262036,
262039,
262042,
155549,
262045,
262048,
262051,
327589,
155559,
155562,
155565,
393150,
393169,
384977,
155611,
155619,
253923,
155621,
253926,
327654,
204784,
393203,
360438,
253943,
393206,
393212,
155646
] |
159655484c24f6adc33cc492ea5863d7eee627cf
|
2094857f5794904376d47c989e8f3be55e527078
|
/EZ Ryder/Koober_iOS/iOSApp/Onboarding/KooberOnboardingDependencyContainer.swift
|
52a68bc1be06524a3539e6aa878dc0c1d7b8278b
|
[] |
no_license
|
Erscheinung/EZ-Ryder
|
caa108a9d694b02d2ba6fd10d04ed10c88aab62d
|
8f0a45fcf8224c5b6130477205aee17243ee1b86
|
refs/heads/master
| 2020-09-24T22:45:22.853853 | 2020-09-07T03:56:40 | 2020-09-07T03:56:40 | 225,861,146 | 0 | 1 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,589 |
swift
|
import UIKit
import KooberKit
public class KooberOnboardingDependencyContainer {
// MARK: - Properties
// From parent container
let sharedUserSessionRepository: UserSessionRepository
let sharedMainViewModel: MainViewModel
// Long-lived dependencies
let sharedOnboardingViewModel: OnboardingViewModel
// MARK: - Methods
init(appDependencyContainer: KooberAppDependencyContainer) {
func makeOnboardingViewModel() -> OnboardingViewModel {
return OnboardingViewModel()
}
self.sharedUserSessionRepository = appDependencyContainer.sharedUserSessionRepository
self.sharedMainViewModel = appDependencyContainer.sharedMainViewModel
self.sharedOnboardingViewModel = makeOnboardingViewModel()
}
// On-boarding (signed-out)
// Factories needed to create an OnboardingViewController.
public func makeOnboardingViewController() -> OnboardingViewController {
let welcomeViewController = makeWelcomeViewController()
let signInViewController = makeSignInViewController()
let signUpViewController = makeSignUpViewController()
return OnboardingViewController(viewModel: sharedOnboardingViewModel,
welcomeViewController: welcomeViewController,
signInViewController: signInViewController,
signUpViewController: signUpViewController)
}
// Welcome
public func makeWelcomeViewController() -> WelcomeViewController {
return WelcomeViewController(welcomeViewModelFactory: self)
}
public func makeWelcomeViewModel() -> WelcomeViewModel {
return WelcomeViewModel(goToSignUpNavigator: sharedOnboardingViewModel,
goToSignInNavigator: sharedOnboardingViewModel)
}
// Sign In
public func makeSignInViewController() -> SignInViewController {
return SignInViewController(viewModelFactory: self)
}
public func makeSignInViewModel() -> SignInViewModel {
return SignInViewModel(userSessionRepository: sharedUserSessionRepository,
signedInResponder: sharedMainViewModel)
}
// Sign Up
public func makeSignUpViewController() -> SignUpViewController {
return SignUpViewController(viewModelFactory: self)
}
public func makeSignUpViewModel() -> SignUpViewModel {
return SignUpViewModel(userSessionRepository: sharedUserSessionRepository,
signedInResponder: sharedMainViewModel)
}
}
extension KooberOnboardingDependencyContainer: WelcomeViewModelFactory, SignInViewModelFactory, SignUpViewModelFactory {}
|
[
-1
] |
c3a4a943a30c69ecfa6f3c71be699e7327360d7a
|
ec13e063a84afc619a160f5c92758803b015385d
|
/Sources/Crypto/Message Authentication Codes/MACFunctions.swift
|
dc39f3a3c628779c014dbac8227237c046fa3949
|
[
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
kingring/swift-crypto
|
b1e50593b20b94ea6e395fc1148a020b5338de12
|
22fd38919566816705c57d5f4dd5a97a4edcf25e
|
refs/heads/main
| 2023-05-25T15:46:00.890500 | 2021-06-09T08:51:01 | 2021-06-09T08:51:01 | 376,066,450 | 1 | 0 |
Apache-2.0
| 2021-06-11T15:22:39 | 2021-06-11T15:22:38 | null |
UTF-8
|
Swift
| false | false | 2,623 |
swift
|
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftCrypto open source project
//
// Copyright (c) 2019-2020 Apple Inc. and the SwiftCrypto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.md for the list of SwiftCrypto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
#if (os(macOS) || os(iOS) || os(watchOS) || os(tvOS)) && CRYPTO_IN_SWIFTPM && !CRYPTO_IN_SWIFTPM_FORCE_BUILD_API
@_exported import CryptoKit
#else
import Foundation
protocol MACAlgorithm {
associatedtype Key
#if (os(macOS) || os(iOS) || os(watchOS) || os(tvOS)) && !CRYPTO_IN_SWIFTPM_FORCE_BUILD_API
associatedtype MAC: CryptoKit.MessageAuthenticationCode
#else
associatedtype MAC: Crypto.MessageAuthenticationCode
#endif
/// Initializes the MAC Algorithm
///
/// - Parameter key: The key used to authenticate the data
init(key: Key)
/// Updates the MAC with the buffer.
///
/// - Parameter bufferPointer: The buffer to update the MAC
mutating func update(bufferPointer: UnsafeRawBufferPointer)
/// Returns the MAC from the input in the MAC Algorithm instance.
///
/// - Returns: The Message Authentication Code
func finalize() -> MAC
}
extension MACAlgorithm {
/// Computes a Message Authentication Code.
///
/// - Parameters:
/// - bufferPointer: The buffer to authenticate
/// - key: The key used to authenticate the data
/// - Returns: A Message Authentication Code
static func authenticationCode(bufferPointer: UnsafeRawBufferPointer, using key: Key) -> MAC {
// swiftlint:disable:next explicit_init
var authenticator = Self(key: key)
// swiftlint:disable:previous explicit_init
authenticator.update(bufferPointer: bufferPointer)
return authenticator.finalize()
}
/// Verifies a Message Authentication Code. The comparison is done in constant-time.
///
/// - Parameters:
/// - key: The key used to authenticate the data
/// - bufferPointer: The buffer to authenticate
/// - mac: The MAC to verify
/// - Returns: Returns true if the MAC is valid. False otherwise.
static func isValidAuthenticationCode(_ mac: MAC, authenticating bufferPointer: UnsafeRawBufferPointer, using key: Key) -> Bool {
return mac == Self.authenticationCode(bufferPointer: bufferPointer, using: key)
}
}
#endif // Linux or !SwiftPM
|
[
-1
] |
c6a5f3a019aaf47d5809f96703e9a74323ce6624
|
f195b296b4c11dd87dc60efcaf548104a110264b
|
/Marvel/Feature/CharacterCommons/Model/URLModel.swift
|
59fef3d3ab7c0b71b30cf772ac67ea0320cb244d
|
[] |
no_license
|
Anna3993/Marvel
|
f180cdab9d3ffcedd0e23afa1c7258d1b0217686
|
e69cf7522990d312b2d3fecbb2e8396e839734b1
|
refs/heads/master
| 2023-05-28T11:56:30.954796 | 2021-06-16T18:49:41 | 2021-06-16T18:49:41 | 376,863,551 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 166 |
swift
|
//
// URLModel.swift
// Marvel
//
// Created by Anna on 14/06/2021.
//
import Foundation
struct URLModel: Codable {
let type: String?
let url: String?
}
|
[
-1
] |
f425ecdc4f79ef63aa909efe63fd449c029ead6b
|
f1d7b322fc3689272776b28206796344b2324022
|
/Projects/Review-AddCalendar/local-notifications-demo/Models/ToDo.swift
|
07dff2d4cda8d74aa5239d951937124c625b2cfc
|
[] |
no_license
|
Agarrovi1/Example
|
64b104d790520cecd93000ed4c685eb6937f68fb
|
2f7c2c02ddcb61f0811fa159d563950c6d286655
|
refs/heads/master
| 2021-06-14T05:50:20.541657 | 2021-05-03T19:56:37 | 2021-05-03T19:56:37 | 194,325,712 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 484 |
swift
|
//
// ToDo.swift
// local-notifications-demo
//
// Created by David Rifkin on 10/29/19.
// Copyright © 2019 David Rifkin. All rights reserved.
//
import Foundation
import MapKit
struct ToDo: Codable {
let title: String
let dueBy: Date
static func getDefaultTodos() -> [ToDo] {
return [ToDo(title: "This is due in two minutes", dueBy: Date().advanced(by: 2 * 60)), ToDo(title: "This is due in five minutes", dueBy: Date().advanced(by: 5 * 60))]
}
}
|
[
-1
] |
e6c8b9becfe7c12f318da208609a2ed09f332dc4
|
735a6222d836700aa7aee833ff03b618e51637ad
|
/100 Day of SwiftUI/Project06/Animations/AnimationsUITests/AnimationsUITests.swift
|
994dd6b98b574399da71be779ebea68e05d5e62d
|
[
"MIT"
] |
permissive
|
ronaldogomes96/100-Days-Of-SwiftUI
|
58ea40708e2ec7d7ca0f8f202ddc4f352252a829
|
70c9887834e98c0c3799dd29c15b7d31fea3fa0a
|
refs/heads/main
| 2023-06-05T17:32:44.961315 | 2021-06-29T23:58:54 | 2021-06-29T23:58:54 | 352,682,694 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,437 |
swift
|
//
// AnimationsUITests.swift
// AnimationsUITests
//
// Created by Ronaldo Gomes on 29/04/21.
//
import XCTest
class AnimationsUITests: XCTestCase {
override func setUpWithError() throws {
// Put setup code here. This method is called before the invocation of each test method in the class.
// In UI tests it is usually best to stop immediately when a failure occurs.
continueAfterFailure = false
// In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
}
override func tearDownWithError() throws {
// Put teardown code here. This method is called after the invocation of each test method in the class.
}
func testExample() throws {
// UI tests must launch the application that they test.
let app = XCUIApplication()
app.launch()
// Use recording to get started writing UI tests.
// Use XCTAssert and related functions to verify your tests produce the correct results.
}
func testLaunchPerformance() throws {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 7.0, *) {
// This measures how long it takes to launch your application.
measure(metrics: [XCTApplicationLaunchMetric()]) {
XCUIApplication().launch()
}
}
}
}
|
[
360463,
376853,
344106,
253996,
385078,
163894,
352314,
376892,
32829,
352324,
352327,
385095,
393291,
163916,
368717,
254039,
426074,
368732,
32871,
352359,
221292,
385135,
376945,
385147,
426124,
196758,
49308,
65698,
49317,
377008,
377010,
377025,
377033,
164043,
417996,
254157,
368849,
368850,
139478,
385240,
254171,
147679,
147680,
205034,
254189,
254193,
344312,
336121,
262403,
147716,
368908,
180494,
262419,
368915,
254228,
377116,
254250,
131374,
418095,
336177,
368949,
180534,
155968,
270663,
368969,
254285,
180559,
377168,
344402,
368982,
270703,
385407,
385409,
270733,
106893,
385423,
385433,
213402,
385437,
254373,
385448,
385449,
115116,
385463,
336319,
336323,
188870,
262619,
377309,
377310,
369121,
369124,
270823,
213486,
360945,
139766,
393719,
377337,
254459,
410108,
410109,
262657,
377346,
410126,
262673,
385554,
393745,
254487,
410138,
188957,
377374,
385569,
385578,
377388,
197166,
393775,
418352,
33339,
352831,
33344,
385603,
385612,
426575,
385620,
369236,
270938,
352885,
352886,
344697,
385669,
369285,
344714,
377487,
180886,
426646,
352921,
377499,
344737,
352938,
418479,
164532,
336565,
377531,
377534,
377536,
385737,
385745,
369365,
369366,
385751,
361178,
352989,
352990,
418529,
295649,
385763,
369383,
361194,
418550,
344829,
197377,
434956,
418579,
426772,
197398,
426777,
344864,
197412,
336678,
189229,
197424,
197428,
336693,
377656,
426809,
197433,
377669,
197451,
369488,
385878,
385880,
197467,
435038,
385895,
197479,
385901,
197489,
164730,
254851,
369541,
172936,
426894,
377754,
172971,
140203,
377778,
189362,
189365,
377789,
345034,
418774,
386007,
386009,
418781,
386016,
123880,
418793,
222193,
435185,
271351,
435195,
328701,
386049,
328705,
418819,
410629,
377863,
189448,
361487,
435216,
386068,
254997,
336928,
336930,
410665,
345137,
361522,
386108,
410687,
377927,
361547,
361570,
214119,
402538,
173168,
377974,
66684,
377986,
402568,
140426,
386191,
410772,
222364,
418975,
124073,
402618,
402632,
402641,
419028,
222441,
386288,
66802,
271607,
369912,
386296,
369913,
419066,
386300,
386304,
369929,
419097,
115997,
222496,
369964,
353581,
116014,
345397,
386363,
337226,
353611,
353612,
337228,
378186,
353617,
378201,
337280,
353672,
263561,
370066,
9618,
411028,
370072,
148900,
361928,
337359,
329168,
353751,
361958,
271850,
271853,
411119,
116209,
386551,
271880,
198155,
329231,
370200,
157219,
157220,
394793,
353875,
271980,
206447,
403057,
42616,
337533,
370307,
419462,
149127,
419464,
149128,
411275,
214667,
345753,
255651,
337590,
370359,
403149,
345813,
370390,
272087,
345817,
345832,
181992,
345835,
141037,
173828,
395018,
395019,
395026,
435993,
345882,
411417,
255781,
362281,
378666,
403248,
378673,
345910,
182070,
182071,
436029,
337734,
272207,
272208,
337746,
395092,
362326,
345942,
370526,
345950,
362336,
255844,
214894,
362351,
214896,
182145,
337816,
329627,
436130,
354210,
436135,
10153,
362411,
370604,
362418,
411587,
362442,
346066,
354268,
436189,
403421,
329696,
354273,
403425,
354279,
436199,
174058,
337899,
354283,
247787,
436209,
182277,
346117,
354310,
43016,
354312,
354311,
403463,
436235,
419857,
436248,
346153,
272432,
403507,
378933,
378934,
436283,
403524,
436293,
436304,
411738,
272477,
395373,
346237,
436372,
362658,
436388,
133313,
395458,
338118,
436429,
346319,
379102,
387299,
18661,
379110,
149743,
379120,
436466,
411892,
436471,
395511,
436480,
272644,
338187,
338188,
395536,
338196,
157973,
272661,
379157,
338217,
362809,
379193,
395591,
272730,
436570,
215395,
362864,
272755,
354678,
436609,
436613,
395653,
395660,
264591,
272784,
420241,
43416,
436644,
272815,
436659,
338359,
436677,
256476,
420326,
166403,
420374,
330291,
191065,
436831,
117350,
420461,
346739,
346741,
420473,
166533,
363155,
346771,
264855,
363161,
436897,
355006,
363228,
436957,
436960,
264929,
338658,
346859,
330476,
35584,
133889,
207639,
363295,
355117,
191285,
273209,
355129,
273211,
355136,
355138,
420680,
355147,
355148,
355153,
387927,
363353,
363354,
420702,
363361,
363362,
412516,
355173,
355174,
207724,
355182,
207728,
420722,
330627,
265094,
387977,
396171,
355216,
224146,
224149,
256918,
256919,
256920,
256934,
273336,
273341,
330688,
379845,
363462,
273353,
207839,
347104,
134124,
412653,
248815,
257007,
347122,
437245,
257023,
125953,
396292,
330759,
347150,
330766,
412692,
330789,
248871,
412725,
257093,
404550,
339031,
404582,
265318,
257126,
265323,
396395,
404589,
273523,
363643,
248960,
363658,
404622,
224400,
265366,
347286,
429209,
339101,
429216,
380069,
265381,
421050,
265410,
183492,
273616,
421081,
339167,
421102,
363769,
52473,
52476,
412926,
437504,
388369,
380178,
429332,
412963,
257323,
437550,
273713,
347451,
257353,
257354,
109899,
437585,
331091,
150868,
372064,
429410,
437602,
388458,
265579,
421240,
388488,
396697,
396709,
380335,
355761,
421302,
134586,
380348,
216510,
380350,
216511,
200136,
273865,
339403,
372172,
413138,
421338,
437726,
429540,
3557,
3559,
265720,
216575,
372226,
437766,
208397,
413202,
413206,
388630,
175640,
216610,
372261,
347693,
323120,
396850,
200245,
323126,
134715,
421437,
396865,
413255,
273992,
265800,
421452,
265809,
396885,
265816,
396889,
388699,
396896,
388712,
388713,
339579,
396927,
224907,
396942,
405140,
274071,
208547,
208548,
405157,
388775,
364202,
421556,
224951,
224952,
224985,
159462,
372458,
397040,
12017,
274170,
175874,
249606,
372497,
397076,
421657,
339746,
257831,
167720,
421680,
421686,
274234,
339782,
339799,
274276,
274288,
372592,
274296,
372625,
118693,
438186,
151492,
380874,
372699,
380910,
380922,
380923,
274432,
372736,
430120,
430127,
405552,
249912,
225347,
421958,
176209,
381013,
53334,
356446,
438374,
176231,
438378,
422000,
249976,
266361,
422020,
168069,
381061,
168070,
381071,
430231,
200856,
422044,
192670,
192671,
258213,
430263,
266427,
372943,
266447,
258263,
356575,
438512,
372979,
389364,
381173,
135416,
356603,
266504,
61720,
381210,
389406,
438575,
266547,
397620,
332084,
438583,
127292,
438592,
397650,
348499,
250196,
348501,
389465,
110955,
160111,
250227,
438653,
266628,
340356,
225684,
373141,
373144,
389534,
397732,
373196,
184799,
201195,
324098,
340489,
397841,
258584,
397855,
348709,
348710,
397872,
340539,
266812,
438850,
348741,
381515,
348748,
430681,
332379,
184938,
373357,
184942,
176751,
389744,
356983,
356984,
209529,
356990,
373377,
422529,
201348,
152196,
356998,
356999,
348807,
275102,
176805,
340645,
422567,
176810,
160441,
422591,
135888,
373485,
373486,
21239,
275193,
348921,
430853,
430860,
62222,
430880,
152372,
160569,
430909,
160576,
348999,
439118,
381791,
127840,
357219,
439145,
381811,
201590,
398205,
340865,
349066,
349068,
381840,
390034,
373653,
430999,
381856,
398244,
185252,
422825,
381872,
398268,
349122,
398275,
127945,
373705,
340960,
398305,
398313,
127990,
349176,
201721,
349179,
357380,
398370,
357413,
357420,
398405,
218187,
250955,
250965,
439391,
250982,
398444,
62574,
357487,
119925,
349304,
349315,
349317,
373902,
373937,
373939,
218301,
259275,
259285,
357594,
414956,
251124,
439550,
439563,
414989,
259346,
349458,
382243,
382246,
382257,
382264,
333115,
193853,
251212,
406862,
259408,
374110,
259449,
382329,
357758,
357763,
112019,
398740,
374189,
251314,
259513,
259569,
251379,
398844,
210429,
366081,
153115,
431646,
349727,
431662,
374327,
210489,
128589,
333394,
349780,
415334,
54895,
366198,
210558,
210559,
415360,
415369,
210569,
431754,
267916,
415376,
259741,
153252,
399014,
210601,
202413,
415419,
259780,
267978,
333522,
325345,
431861,
366358,
169751,
431901,
341791,
399148,
202541,
431918,
153392,
431935,
415555,
325444,
325449,
341837,
415566,
431955,
325460,
341846,
259937,
382820,
415592,
325491,
341878,
276343,
350072,
333687,
112510,
325508,
333700,
243590,
350091,
350092,
350102,
350108,
333727,
128955,
219102,
6116,
432114,
415740,
268286,
415744,
399372,
153618,
358418,
178215,
358455,
399433,
104534,
260206,
432241,
374913,
374914,
415883,
333968,
333990,
104633,
260285,
268479,
374984,
334049,
268515,
383208,
260337,
260338,
432373,
375040,
260355,
432387,
375052,
325904,
391448,
268570,
178459,
186660,
268581,
358698,
325930,
260396,
432435,
358707,
178485,
358710,
14654,
268609,
383309,
383327,
366948,
416101,
383338,
432503,
432511,
252309,
39323,
375211,
129461,
342454,
358844,
326083,
416201,
129484,
154061,
416206,
432608,
391654,
432616,
334315,
375281,
334345,
432650,
342549,
342560,
416288,
350758,
350759,
358951,
358952,
219694,
219695,
375345,
432694,
375369,
375373,
416334,
416340,
244311,
416353,
260705,
375396,
268901,
244345,
375438,
326288,
383668,
342714,
39616,
383708,
269036,
432883,
203511,
342775,
383740,
416509,
359166,
162559,
375552,
432894,
383755,
326413,
342827,
391980,
416577,
244569,
375644,
252766,
342888,
392057,
211835,
392065,
260995,
400262,
392071,
424842,
400271,
392080,
400282,
7070,
211871,
359332,
359333,
326571,
252848,
326580,
261045,
261046,
326586,
359365,
211913,
252878,
342990,
433104,
359380,
433112,
433116,
359391,
187372,
343020,
383980,
383994,
171009,
384004,
433166,
384015,
433173,
252959,
384031,
375848,
261191,
375902,
375903,
392288,
253028,
351343,
187505,
138354,
384120,
392317,
343166,
384127,
392320,
359574,
351389,
253098,
367791,
367792,
367798,
343230,
367809,
253124,
113863,
351445,
195809,
253168,
351475,
351489,
367897,
367898,
130347,
261426,
212282,
359747,
359748,
146760,
146763,
114022,
253288,
425327,
425331,
163190,
384379,
253316,
384391,
253339,
253340,
343457,
245160,
359860,
359861,
343480,
425417,
425434,
253431,
359931,
187900,
343552,
409095,
359949,
253456,
253462,
146976,
245290,
245291,
343606,
163385,
425534,
138817,
147011,
147020,
179800,
343646,
155238,
204394,
138862,
188021,
425624,
245413,
384693,
376502,
409277,
409289,
425682,
245471,
155360,
212721,
163575,
360194,
409355,
155408,
417556,
204600,
384826,
409404,
360253,
409416,
376661,
368471,
425820,
368486,
409446,
425832,
368489,
40809,
384871,
417648,
417658,
360315,
253828,
425875,
253851,
376733,
204702,
253868,
204722,
188349,
212947,
212953,
360416,
253930,
385011
] |
12bb4252997dd3c7fbad99ac1fd411f07d97ea98
|
a0cd3fe41293a8581ad81d3cef474bd1d6754e5d
|
/fastlane/swift/Scanfile.swift
|
aa2b0c1e1bcdb0330817cceff8615e28d1ac55ca
|
[
"MIT"
] |
permissive
|
feiser2016/fastlane
|
b9bb1c5bc7da577dfc1c414dc470db0fd5f80d21
|
054794665bfe368e123ffef84f010c3b34ccfad6
|
refs/heads/master
| 2020-04-01T12:31:49.726666 | 2019-05-05T01:42:57 | 2019-05-05T01:42:57 | 153,211,674 | 0 | 0 |
MIT
| 2019-05-05T01:42:58 | 2018-10-16T02:39:19 |
Ruby
|
UTF-8
|
Swift
| false | false | 714 |
swift
|
// This class is automatically included in FastlaneRunner during build
// This autogenerated file will be overwritten or replaced during build time, or when you initialize `scan`
//
// ** NOTE **
// This file is provided by fastlane and WILL be overwritten in future updates
// If you want to add extra functionality to this project, create a new file in a
// new group so that it won't be marked for upgrade
//
class Scanfile: ScanfileProtocol {
// If you want to enable `scan`, run `fastlane scan init`
// After, this file will be replaced with a custom implementation that contains values you supplied
// during the `init` process, and you won't see this message
}
// Generated with fastlane 2.122.0
|
[
16536,
16538,
16541,
16544,
173217,
173216,
173220,
16549,
173222,
173224,
16553,
173228,
173233,
115531,
115533,
115536,
311250,
115539,
311252,
311255,
115544,
4313,
311258,
4311,
115547,
4316,
311263,
4319,
311266,
4324,
115556,
4329,
311274,
4338
] |
4104e33c8089b825750600233ce9f675cf389c47
|
5bd80577e813d030933d24ec97e2b4c0b2b1261e
|
/MyPlayground.playground/Pages/main.xcplaygroundpage/Contents.swift
|
1e18b8ab45a508a7f2e76d9070fc2d1696e47931
|
[
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] |
permissive
|
laurenoreilly/swift-allAboutFunctions-lab-swift-intro-000
|
33410cc2cee0d64eaa50f6bb3d4600d0ec178707
|
47165331ad9c2dd7505df6cb9b71f6817dab98f9
|
refs/heads/master
| 2021-01-12T12:07:00.792009 | 2016-10-29T19:56:31 | 2016-10-29T19:56:31 | 72,304,709 | 0 | 0 | null | 2016-10-29T19:20:02 | 2016-10-29T19:20:02 | null |
UTF-8
|
Swift
| false | false | 4,066 |
swift
|
/*: Outline
# Functions
### Readings associated with this lab
* [Functions](https://github.com/learn-co-curriculum/swift-functions-readme)
* [Functions with multiple arguments](https://github.com/learn-co-curriculum/swift-funcMultipleArg-readme)
* [Functions with return values](https://github.com/learn-co-curriculum/swift-functionReturn-readme)
*/
/*: question1
### 1. Create a function named `frozen` which takes no arguments. When this function is called, it prints "Let it go!".
*/
func frozen() {
print("Let it go!")
}
frozen ()
/*: question2
### 2. Write a function named `frozenAgain` that takes no arguments. Declare a constant in the body of the function, and assign it the value "Let it go!". Then print it to the console.
*/
func frozenAgain () {
let copy = "Let it go!"
print(copy)
}
frozenAgain()
/*: question3
### 3. Write a function that takes in a character's name as an argument (it can be any character from anything). What should the type of that argument be? Print the message "My favorite character is <character name>." to the screen.
*/
func favCharacter(name: String) {
print("My favorite character is \(name).")
}
favCharacter(name: "Ariel")
/*: question4
### 4. Call the function you wrote in Question 3 using a constant you define. Then call it using a variable. Change the value of the variable, and call it again. What do you see in the console?
*/
let favCharacterName = "Mulan"
favCharacter(name:favCharacterName)
/*: question5
### 5. Write a function that takes an integer as an argument and prints the string "I got <number> problems but Swift ain't one" to the console.
*/
func jayZ (problems: Int) {
print("I got \(problems) problems but Swift ain't one.")
}
jayZ(problems:99)
/*: question6
### 6. Write a function that takes two arguments, the name of a band (a `String`) and a number (an `Int`). It should print the message "My #<number> favorite band is <band>." to the console.
*/
func favBand (band: String, number: Int) {
print("My #\(number) favorite band is \(band).")
}
favBand (band: "Number Twelve", number: 1)
/*: question7
### 7. The code below is broken. Can you identify which line has an error and fix it so that it works again? Uncomment the code below before starting.
*/
func badFavoriteBand(bandName: String, position: Int) {
print("My #\(position) favorite band is \(bandName).")
}
badFavoriteBand(bandName: "The Beatles", position: 2)
/*: question8
### 8. This code is broken, too. Assume the call to the function is correct. What's broken about the function definition? Can you fix it? Uncomment the code below before starting.
*/
func alsoBadFavoriteBand(bandName: String, position: Int) {
print("My #\(position) favorite band is \(bandName)")
}
alsoBadFavoriteBand(bandName: "Blink-182", position: 42)
/*: question9
### 9. Let's play Mad Libs! Create a function called `madLib`. It should take three parameters: A character name, a noun, and a preposition, and print out the line "To <noun> and <preposition>, <character name>!" to the console. Don't forget to call your function to test it out!
*/
func madLib(name: String, noun: String, preposition: String) {
print("To \(noun) and \(preposition), \(name)!")
}
madLib(name: "Mulder", noun: "Panera", preposition: "after")
/*: question10
### 10. Create a function that takes no arguments and returns the string "Buzz Lightyear to the rescue!"
*/
func buzzLightyear () {
print("Buzz Lightyear to the rescue!")
}
buzzLightyear()
func luckyNumber() -> Int {
return 7
}
print(luckyNumber())
/*: question12
### 12. Create a function that takes in a characters name. This function will return back a `String` as follows: "To infinity and beyond, <character name>!". The character name should be returned uppercased.
*/
func charName(name: String) {
let uppercasedName = name.uppercased()
print("To infinity and beyond, \(uppercasedName)")
}
charName (name: "Buzz Lightyear")
|
[
-1
] |
bb5608f9df9c322e4fac24c06c9e898dfbab6d78
|
1cefb6453a1710bdc4eea14870492f6acbddd540
|
/The Hitchhiker Prophecy/Modules/Home/Home Scene/Views/CollectionViewLayoutUtils/CollectionViewLayoutAspects.swift
|
c10ee36c469e0e5293d6f55e6c787839efbacb8b
|
[] |
no_license
|
O-labeb/HitchhickerProphecy
|
b7836f26dc62ea5a826d8d0b709667c6736cf767
|
bc2424e269beec44558c2dd747ed66f93d3fc63f
|
refs/heads/main
| 2023-06-03T05:29:32.706716 | 2021-03-22T09:50:13 | 2021-03-22T09:50:13 | 380,729,701 | 0 | 0 | null | 2021-06-27T13:39:28 | 2021-06-27T12:06:13 | null |
UTF-8
|
Swift
| false | false | 628 |
swift
|
//
// CollectionViewLayoutAspects.swift
// The Hitchhiker Prophecy
//
// Created by mac on 3/22/21.
// Copyright © 2021 SWVL. All rights reserved.
//
import UIKit
enum CollectionViewLayoutAspects { }
extension CollectionViewLayoutAspects {
enum Horizontal {
static let sideInsets: CGFloat = 12
static let topInsets: CGFloat = 0
static let cellToCollectionViewWidthRatio: CGFloat = 0.8
}
}
extension CollectionViewLayoutAspects {
enum Vertical {
static let sideInsets: CGFloat = 8
static let topInsets: CGFloat = 6
static let cellHeight: CGFloat = 200
}
}
|
[
-1
] |
65f4147d29891979aefb011d855411954730393f
|
ff8fc9435e4e0cb9ff1c63e0a53466478d47ff26
|
/DemoDropDown/ViewController.swift
|
fc0e9368caade7cb4ea230fc28519acd879edcdf
|
[] |
no_license
|
RahulM1987/DemoDropDown
|
ccfc549535497c43391615cfa00efa2abf894f2d
|
a37b1e2aa16ca6a6eb6a4e6f35516e436e435899
|
refs/heads/master
| 2021-01-01T05:28:06.253365 | 2016-05-05T06:59:58 | 2016-05-05T06:59:58 | 57,213,835 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,022 |
swift
|
//
// ViewController.swift
// DemoDropDown
//
// Created by Rahul Morade on 27/04/16.
// Copyright © 2016 Rahul Morade. All rights reserved.
//
import UIKit
class ViewController: UIViewController,UITextFieldDelegate{
@IBOutlet weak var textV: UITextField!
var DataArray:NSMutableArray=["First","Second","Third","Fourth","Fifth","Sixth","Seventh","Eight"]
@IBOutlet weak var output: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
func textFieldShouldBeginEditing(textField: UITextField) -> Bool {
let dropdown = DropDown.init(framea: CGRectMake(textV.frame.origin.x, textV.frame.origin.y, textV.frame.width, 200), SetArray: DataArray)
self.view.addSubview(dropdown)
return false;
}
}
|
[
-1
] |
49ab47357846157b1919a5b55198fc2534ff294b
|
d439a95c18c503bc47b418d78094b97bcfd895cc
|
/test/Interpreter/interpret_load_framework.swift
|
c3c4470f95465e1cc49931d69d5ea00b220f9c62
|
[
"Apache-2.0",
"Swift-exception"
] |
permissive
|
DougGregor/swift
|
7e40d5a1b672e6fca9b28130ef8ac0ce601cf650
|
16b686989c12bb1acf9d1a490c1f301d71428f47
|
refs/heads/master
| 2023-08-05T05:11:53.545515 | 2016-07-06T18:23:34 | 2016-07-06T18:23:34 | 50,400,732 | 14 | 2 |
Apache-2.0
| 2023-08-23T05:19:32 | 2016-01-26T03:34:10 |
C++
|
UTF-8
|
Swift
| false | false | 402 |
swift
|
// RUN: rm -rf %t && mkdir -p %t
// RUN: cp -R %S/Inputs/VerySmallObjCFramework.framework %t
// RUN: %clang -dynamiclib %S/Inputs/VerySmallObjCFramework.m -fmodules -F %t -o %t/VerySmallObjCFramework.framework/VerySmallObjCFramework
// RUN: %swift_driver -F %t %s | FileCheck %s
// REQUIRES: objc_interop
// REQUIRES: swift_interpreter
import VerySmallObjCFramework
// CHECK: 42
print(globalValue)
|
[
82418,
71167,
89743
] |
4f38c3d26588c9c8cfb01a57643b9be639f8ca46
|
28fadc94652eae9265ede8828f1091e9568621ce
|
/ServerSide/Sources/ImageLibrary/configuration/Routes.swift
|
ded9ab1839fc2f4c88ae68946314bffc5d90a700
|
[
"Apache-2.0"
] |
permissive
|
jiangming1/ImageLibraryDemo
|
0df8b60be130e93ed151ac435d8dd55ded4098b3
|
3bb612d284e26edc94a618bf4336594dfd050cde
|
refs/heads/master
| 2020-03-30T04:24:57.216341 | 2018-05-07T14:45:50 | 2018-05-07T14:45:50 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,043 |
swift
|
//
// Routes.swift
// ImageLibrary
//
// Created by Jonathan Guthrie on 2017-02-20.
// Copyright (C) 2017 PerfectlySoft, Inc.
//
//===----------------------------------------------------------------------===//
//
// This source file is part of the Perfect.org open source project
//
// Copyright (c) 2015 - 2016 PerfectlySoft Inc. and the Perfect project authors
// Licensed under Apache License v2.0
//
// See http://perfect.org/licensing.html for license information
//
//===----------------------------------------------------------------------===//
//
// Modified by Clingon: https://github.com/iamjono/clingon
//
import PerfectHTTPServer
func mainRoutes() -> [[String: Any]] {
var routes: [[String: Any]] = [[String: Any]]()
routes.append(["method":"get", "uri":"/**", "handler":PerfectHTTPServer.HTTPHandler.staticFiles, "documentRoot":"./webroot","allowResponseFilters":true])
/// Image Listing as JSON
routes.append(["method":"get", "uri":"/api/v1/images", "handler":Handlers.imageAPIlist])
return routes
}
|
[
-1
] |
54e8e52a20ea65855cdd0598f58a77deebba30f2
|
10962ae8f91dc9e2060551e86693fe2c95fefef7
|
/pod/ModuleSample/ModuleSample/Generated/GeneratedClass22.swift
|
68b9325a8bd17f8f45bf9310679c91ebb2695806
|
[] |
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 | 136 |
swift
|
public class GeneratedClass22 {
public var a: String = ""
public var b: String = ""
public var c: Int = 0
public init() { }
}
|
[
-1
] |
a783f5628f8afaeae44c48b52b455c482bf856e6
|
f508ac902303e6a0ede1b8e46af49e42bf5c0cd6
|
/Parstagram/PostCell.swift
|
87091b4822bd29f95573525babc7ce9279792b67
|
[] |
no_license
|
cicelybeckford/Parstagram-iOS
|
332432f6455429f30967cb7d2c0fa89a4e4771b3
|
d9b15a92339e7004b4663569b8077e2de2281370
|
refs/heads/master
| 2021-02-10T00:29:01.050448 | 2020-03-10T04:52:41 | 2020-03-10T04:52:41 | 244,337,869 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 627 |
swift
|
//
// PostCell.swift
// Parstagram
//
// Created by Cicely Beckford on 3/2/20.
// Copyright © 2020 Cicely Beckford. All rights reserved.
//
import UIKit
class PostCell: UITableViewCell {
@IBOutlet weak var photoView: UIImageView!
@IBOutlet weak var usernameLabel: UILabel!
@IBOutlet weak var captionLabel: UILabel!
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
}
|
[
403072,
213094,
111912,
317296,
311704,
281183
] |
6bf1ca5288ef7654cb1d8b15f63eb302ff8277d1
|
01c15343547f8519203a69d025b1739cbc2f7543
|
/Package.swift
|
1cfb22080eb6867ed599b5083b55290f06e0c910
|
[
"MIT"
] |
permissive
|
thediversecandidate/SwiftServerSideScraper
|
a8f046037407afce7fbf7734b00f130846bc6b12
|
9251cfca2f42e61354b5697720bfb382e3943c72
|
refs/heads/master
| 2022-07-31T10:21:30.929831 | 2020-05-19T18:05:30 | 2020-05-19T18:05:30 | 264,727,253 | 1 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 716 |
swift
|
// swift-tools-version:4.0
import PackageDescription
let package = Package(
name: "SwiftServerSide",
products: [
.library(name: "SwiftServerSide", targets: ["App"]),
],
dependencies: [
// 💧 A server-side Swift web framework.
.package(url: "https://github.com/vapor/vapor.git", from: "3.0.0"),
// 🔵 Swift ORM (queries, models, relations, etc) built on SQLite 3.
.package(url: "https://github.com/vapor/fluent-sqlite.git", from: "3.0.0")
],
targets: [
.target(name: "App", dependencies: ["FluentSQLite", "Vapor"]),
.target(name: "Run", dependencies: ["App"]),
.testTarget(name: "AppTests", dependencies: ["App"])
]
)
|
[
333702,
327559,
308712,
334506,
334636,
312305,
340731
] |
3ab018888a54db2891c25db051e03c2a55ac3dbb
|
d83a8466a99737d2ce4c1d2b087c2bf340d86495
|
/HowITalk/HowITalk/SceneDelegate.swift
|
a9e89e47d1606f445337e3838b8548e36e752cc2
|
[] |
no_license
|
rudeh567/TalkApp
|
508b61aa1ee367400cdb4d6276073798fcb5bdb9
|
6ec2b1b439a159cb953e71bb9a433600208e73d5
|
refs/heads/main
| 2023-07-16T16:29:53.698062 | 2021-08-25T11:50:51 | 2021-08-25T11:50:51 | 385,478,083 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,286 |
swift
|
//
// SceneDelegate.swift
// HowITalk
//
// Created by GSM08 on 2021/07/14.
//
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,
254045,
180322,
376932,
286845,
286851,
417925,
262284,
360598,
377003,
377013,
164029,
327872,
180418,
377030,
377037,
377047,
418008,
418012,
377063,
327915,
205037,
393457,
393461,
393466,
418044,
385281,
262405,
180491,
336140,
164107,
262417,
368913,
262423,
377118,
377121,
262437,
254253,
336181,
262455,
393539,
262473,
344404,
213333,
418135,
270687,
262497,
418145,
262501,
213354,
246124,
262508,
262512,
213374,
385420,
262551,
262553,
385441,
385444,
262567,
385452,
262574,
393649,
385460,
262587,
344512,
262593,
360917,
369119,
328180,
328183,
328190,
254463,
328193,
328207,
410129,
393748,
377372,
188959,
385571,
377384,
197160,
33322,
352822,
270905,
197178,
418364,
188990,
369224,
385610,
270922,
352844,
385617,
352865,
262761,
352875,
344694,
352888,
336513,
377473,
385671,
148106,
377485,
352919,
98969,
344745,
361130,
336556,
385714,
434868,
164535,
164539,
328379,
328387,
352969,
418508,
385743,
385749,
189154,
369382,
361196,
418555,
344832,
336644,
344837,
344843,
328462,
361231,
394002,
336660,
418581,
418586,
434971,
369436,
262943,
369439,
418591,
418594,
336676,
418600,
418606,
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,
361537,
377931,
189525,
402523,
361568,
148580,
345200,
361591,
386168,
361594,
410746,
214150,
345224,
386187,
345247,
361645,
345268,
402615,
361657,
402636,
328925,
165086,
165092,
328933,
222438,
328942,
386286,
386292,
206084,
328967,
345377,
345380,
353572,
345383,
263464,
337207,
345400,
378170,
369979,
386366,
337230,
337235,
263509,
353634,
337252,
402792,
271731,
378232,
337278,
271746,
181639,
353674,
181644,
361869,
181650,
181655,
230810,
181671,
181674,
181679,
181682,
337330,
181687,
370105,
181691,
181697,
361922,
337350,
181704,
337366,
271841,
329192,
361961,
329195,
116211,
337399,
402943,
337416,
329227,
419341,
419345,
329234,
419351,
345626,
419357,
345631,
419360,
370208,
394787,
419363,
370214,
419369,
394796,
419377,
419386,
214594,
419401,
353868,
419404,
173648,
419408,
214611,
419412,
403040,
345702,
370298,
353920,
403073,
403076,
345737,
198282,
403085,
403092,
345750,
419484,
345758,
345763,
419492,
345766,
419498,
419502,
370351,
419507,
337588,
419510,
419513,
419518,
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,
247639,
337751,
370520,
313181,
182110,
354143,
354157,
345965,
345968,
345971,
345975,
403321,
1914,
354173,
395148,
247692,
337809,
247701,
436127,
436133,
247720,
337834,
362414,
337845,
190393,
247760,
346064,
346069,
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,
436474,
379135,
411905,
411917,
379154,
395539,
387350,
387353,
338201,
338212,
395567,
248112,
362823,
436556,
321880,
362844,
379234,
354674,
321911,
420237,
379279,
272787,
354728,
338353,
338382,
272849,
248279,
256474,
182755,
338404,
338411,
330225,
248309,
248332,
330254,
199189,
420377,
330268,
191012,
330320,
199250,
191069,
346722,
248427,
338544,
346736,
191093,
346743,
346769,
150184,
174775,
248505,
174778,
363198,
223936,
355025,
273109,
355029,
264919,
256735,
264942,
363252,
338680,
264965,
338701,
256787,
363294,
396067,
346917,
396070,
215854,
355123,
355141,
355144,
338764,
330581,
330585,
387929,
355167,
265056,
265059,
355176,
355180,
355185,
412600,
207809,
379849,
347082,
396246,
330711,
248794,
248799,
347106,
437219,
257009,
265208,
199681,
338951,
330761,
330769,
330775,
248863,
396329,
347178,
404526,
396337,
330803,
396340,
339002,
388155,
339010,
347208,
248905,
330827,
248915,
183384,
339037,
412765,
257121,
265321,
248952,
420985,
330890,
347288,
248986,
44199,
380071,
339118,
249018,
339133,
126148,
330959,
330966,
265433,
265438,
388320,
363757,
388348,
339199,
396552,
175376,
175397,
273709,
372016,
437553,
347442,
199989,
175416,
396601,
208189,
437567,
175425,
437571,
437576,
437584,
437588,
396634,
175451,
437596,
429408,
175458,
175461,
175464,
265581,
331124,
175478,
175487,
249215,
175491,
249219,
249225,
249228,
249235,
175514,
175517,
396703,
396706,
175523,
355749,
396723,
388543,
380353,
216518,
372166,
380364,
339406,
372177,
208338,
339414,
249303,
413143,
339418,
339421,
249310,
339425,
249313,
339429,
339435,
249329,
69114,
372229,
208399,
380433,
175637,
405017,
134689,
265779,
421442,
413251,
265796,
265806,
224854,
224858,
339553,
257636,
224871,
372328,
257647,
372338,
224885,
224888,
224891,
224895,
372354,
126597,
421509,
224905,
11919,
224911,
224914,
126611,
224917,
224920,
126618,
208539,
224923,
224927,
224930,
224933,
257705,
224939,
224943,
257713,
224949,
257717,
257721,
224954,
257725,
224960,
257733,
224966,
224970,
257740,
224976,
257745,
257748,
224982,
257752,
224987,
257762,
224996,
225000,
225013,
257788,
225021,
339711,
257791,
225027,
257796,
339722,
257802,
257805,
225039,
257808,
249617,
225044,
167701,
372500,
257815,
225049,
257820,
225054,
184096,
397089,
257825,
225059,
339748,
225068,
257837,
413485,
225071,
225074,
257843,
225077,
257846,
225080,
397113,
225083,
397116,
257853,
225088,
225094,
225097,
257869,
257872,
225105,
397140,
225109,
225113,
257881,
257884,
257887,
225120,
257891,
225128,
257897,
225138,
257909,
225142,
372598,
257914,
257917,
225150,
257922,
380803,
225156,
339845,
257927,
225166,
397201,
225171,
380823,
225176,
225183,
372698,
372704,
372707,
356336,
380919,
393215,
372739,
405534,
266295,
266298,
421961,
200786,
356440,
217180,
430181,
266351,
356467,
266365,
192640,
266375,
381069,
225425,
250003,
225430,
250008,
356507,
250012,
225439,
135328,
192674,
225442,
438434,
225445,
438438,
225448,
438441,
225451,
258223,
225456,
430257,
225459,
225462,
225468,
389309,
225472,
372931,
225476,
430275,
389322,
225485,
225488,
225491,
266454,
225494,
225497,
225500,
225503,
225506,
225511,
217319,
225515,
225519,
381177,
397572,
389381,
356638,
356641,
356644,
356647,
266537,
389417,
356650,
356656,
332081,
340276,
356662,
397623,
332091,
225599,
348489,
332107,
151884,
430422,
348503,
332118,
250201,
250203,
250211,
340328,
250217,
348523,
348528,
332153,
356734,
389503,
332158,
438657,
332162,
389507,
348548,
356741,
332175,
160152,
373146,
373149,
70048,
356783,
266688,
324032,
201158,
340452,
127473,
217590,
340473,
324095,
324100,
324103,
324112,
340501,
324118,
324122,
340512,
332325,
324134,
381483,
356908,
324141,
324143,
356917,
324150,
324156,
168509,
348734,
324161,
324165,
356935,
348745,
381513,
324171,
324174,
324177,
389724,
332381,
373344,
340580,
348777,
381546,
340628,
184983,
373399,
258723,
332455,
332460,
389806,
332464,
332473,
381626,
332484,
332487,
332494,
357070,
357074,
332512,
340724,
332534,
373499,
348926,
389927,
348979,
398141,
357202,
389971,
357208,
389979,
430940,
357212,
357215,
439138,
349041,
340850,
381815,
430967,
324473,
398202,
119675,
340859,
324476,
430973,
324479,
340863,
324482,
324485,
324488,
185226,
381834,
324493,
324496,
324499,
430996,
324502,
324511,
422817,
324514,
201638,
398246,
373672,
324525,
5040,
111539,
324534,
5047,
324539,
324542,
398280,
349129,
340942,
209874,
340958,
431073,
398307,
340964,
209896,
201712,
209904,
349173,
381947,
201724,
349181,
431100,
431107,
349203,
209944,
209948,
250917,
169002,
357419,
209966,
209969,
209973,
209976,
209980,
209988,
209991,
431180,
209996,
349268,
177238,
250968,
210011,
373853,
341094,
210026,
210028,
210032,
349296,
210037,
210042,
210045,
349309,
152704,
349313,
160896,
210053,
210056,
349320,
259217,
373905,
210068,
210072,
210078,
210081,
210085,
210089,
210096,
210100,
324792,
210108,
357571,
210116,
210128,
210132,
333016,
210139,
210144,
218355,
218361,
275709,
128254,
275713,
242947,
275717,
275723,
333075,
349460,
349486,
349492,
415034,
210261,
365912,
259423,
374113,
251236,
374118,
390518,
357756,
374161,
112021,
349591,
357793,
333222,
259516,
415168,
366035,
415187,
366039,
415192,
415194,
415197,
415200,
333285,
415208,
366057,
366064,
415217,
415225,
423424,
415258,
415264,
366118,
415271,
382503,
349739,
144940,
415279,
415282,
415286,
210488,
415291,
415295,
333396,
333400,
366173,
423529,
423533,
210547,
415354,
333440,
267910,
267929,
259789,
366301,
333535,
366308,
366312,
431852,
399086,
366319,
210673,
366322,
399092,
366326,
333566,
268042,
210700,
366349,
210707,
399129,
333595,
210720,
366384,
358192,
210740,
366388,
358201,
325441,
366403,
325447,
341831,
341839,
341844,
415574,
358235,
350046,
399200,
399208,
268144,
358256,
358260,
399222,
325494,
333690,
325505,
399244,
333709,
333725,
333737,
382891,
382898,
358348,
333777,
219094,
399318,
358372,
350190,
350194,
333819,
350204,
350207,
325633,
325637,
350214,
268299,
333838,
350225,
350232,
333851,
350238,
350241,
374819,
350245,
350249,
350252,
178221,
350257,
350260,
350272,
243782,
350281,
350286,
374865,
252021,
342134,
374904,
268435,
333998,
334012,
260299,
211161,
375027,
358645,
268553,
268560,
432406,
325920,
358701,
391469,
358705,
358714,
358717,
383307,
358738,
383331,
383334,
391531,
383342,
334204,
268669,
194942,
391564,
366991,
334224,
342431,
375209,
375220,
334263,
326087,
358857,
195041,
334312,
104940,
375279,
350724,
186898,
342546,
350740,
342551,
342555,
416294,
350762,
252463,
358962,
334397,
358973,
252483,
219719,
399957,
334425,
326240,
375401,
334466,
334469,
391813,
162446,
342680,
342685,
260767,
342711,
244410,
260798,
334530,
260802,
350918,
154318,
342737,
391895,
154329,
416476,
64231,
113389,
203508,
375541,
342777,
391938,
391949,
375569,
375572,
375575,
375580,
162592,
334633,
326444,
383794,
375613,
244542,
260925,
375616,
342857,
416599,
342875,
244572,
433001,
400238,
211826,
211832,
392061,
351102,
252801,
260993,
400260,
211846,
342921,
342931,
252823,
400279,
392092,
400286,
359335,
211885,
400307,
351169,
359362,
351172,
170950,
187335,
326599,
359367,
359383,
359389,
383968,
343018,
261109,
261112,
244728,
383999,
261130,
261148,
359452,
211999,
261155,
261160,
261166,
359471,
375868,
384099,
384102,
384108,
367724,
187503,
343155,
384115,
212095,
384136,
384140,
384144,
351382,
384152,
384158,
384161,
351399,
384169,
367795,
244917,
384182,
384189,
384192,
351424,
343232,
367817,
244938,
384202,
253132,
384209,
146644,
351450,
384225,
359650,
343272,
351467,
359660,
384247,
351480,
384250,
351483,
351492,
384270,
359695,
261391,
253202,
261395,
384276,
384284,
245021,
384290,
253218,
245032,
171304,
384299,
351535,
245042,
326970,
384324,
212296,
212304,
367966,
343394,
367981,
343410,
155000,
327035,
245121,
245128,
253321,
155021,
384398,
245137,
245143,
245146,
245149,
245152,
245155,
155045,
245158,
114093,
327090,
343478,
359867,
384444,
327108,
327112,
384457,
359887,
359891,
368093,
155103,
343535,
343540,
368120,
409092,
359948,
359951,
245295,
359984,
400977,
400982,
179803,
155241,
155255,
155274,
368289,
245410,
425639,
425652,
425663,
155328,
245463,
155352,
155356,
155364,
245477,
155372,
245487,
212723,
409336,
155394,
155404,
245528,
155423,
360224,
155439,
204592,
155444,
155448,
417596,
384829,
360262,
155463,
155477,
376665,
155484,
261982,
425823,
155488,
376672,
155492,
327532,
261997,
376686,
262000,
262003,
425846,
262006,
147319,
262009,
327542,
262012,
155517,
155523,
155526,
360327,
376715,
155532,
262028,
262031,
262034,
262037,
262040,
262043,
155550,
253854,
262046,
262049,
262052,
327590,
155560,
155563,
155566,
327613,
393152,
393170,
155604,
155620,
253924,
155622,
253927,
327655,
360432,
393204,
360439,
253944,
393209,
155647
] |
faeea321c22e891170a8c7ce5ae6c881e185443e
|
5871c6c717aac69e049b88278181b884b6c736d4
|
/StudyNotes/Swift Collection/UIExamples/LiveBroadcast/Server/LiveBroadcastServer/protobuf-swift/plugin/Tests/CodedOuputStreamTests.swift
|
4e9bf5a75d0361365a669b10b263240666d6e687
|
[
"Apache-2.0",
"MIT"
] |
permissive
|
coderZsq/coderZsq.practice.native
|
f33c03b4d3a35581b28ec3e188a7625f9b8de910
|
e44dd6e50b794b66218f0a706d3dd3cda5142525
|
refs/heads/master
| 2023-08-09T02:24:23.477843 | 2023-08-08T14:11:25 | 2023-08-08T14:11:25 | 87,806,175 | 44 | 7 |
MIT
| 2023-08-10T06:42:08 | 2017-04-10T12:06:35 |
Swift
|
UTF-8
|
Swift
| false | false | 12,745 |
swift
|
//
// CodedOuputStreamTests.swift
// ProtocolBuffers
//
// Created by Alexey Khokhlov on 25.07.14.
// Copyright (c) 2014 Alexey Khokhlov. All rights reserved.
//
import Foundation
import XCTest
import ProtocolBuffers
internal class CodedOuputStreamTests: XCTestCase
{
func openMemoryStream() -> OutputStream {
let stream:OutputStream = OutputStream.toMemory()
stream.open()
return stream
}
func bytes(_ from:UInt8...) -> Data
{
let returnData:NSMutableData = NSMutableData()
var bytesArray = [UInt8](repeating: 0, count: Int(from.count))
var i:Int = 0
for index:UInt8 in from
{
bytesArray[i] = index
i += 1
}
returnData.append(&bytesArray, length: bytesArray.count)
return returnData as Data
}
func assertWriteLittleEndian32(_ data:Data, value:Int32) throws {
let rawOutput:OutputStream = openMemoryStream()
let output:CodedOutputStream = CodedOutputStream(stream: rawOutput)
try output.writeRawLittleEndian32(value: value)
try output.flush()
let actual:Data = rawOutput.property(forKey: Stream.PropertyKey.dataWrittenToMemoryStreamKey) as! Data
XCTAssertTrue(data == actual, "Test32")
var blockSize:Int = 1
while blockSize <= 16 {
let rawOutput:OutputStream = openMemoryStream()
let output:CodedOutputStream = CodedOutputStream(stream: rawOutput, bufferSize: blockSize)
try output.writeRawLittleEndian32(value: value)
try output.flush()
let actual:Data = rawOutput.property(forKey: Stream.PropertyKey.dataWrittenToMemoryStreamKey) as! Data
XCTAssertTrue(data == actual, "Test32")
blockSize *= 2
}
}
func assertWriteLittleEndian64(_ data:Data, value:Int64) throws {
let rawOutput:OutputStream = openMemoryStream()
let output:CodedOutputStream = CodedOutputStream(stream: rawOutput)
try output.writeRawLittleEndian64(value: value)
try output.flush()
let actual:Data = rawOutput.property(forKey: Stream.PropertyKey.dataWrittenToMemoryStreamKey) as! Data
XCTAssertTrue(data == actual, "Test64")
var blockSize:Int = 1
while blockSize <= 16 {
let rawOutput:OutputStream = openMemoryStream()
let output:CodedOutputStream = CodedOutputStream(stream: rawOutput, bufferSize: blockSize)
try output.writeRawLittleEndian64(value: value)
try output.flush()
let actual:Data = rawOutput.property(forKey: Stream.PropertyKey.dataWrittenToMemoryStreamKey) as! Data
XCTAssertTrue(data == actual,"Test64")
blockSize *= 2
}
}
func assertWriteVarint(_ data:Data, value:Int64) throws
{
let shift = WireFormat.logicalRightShift64(value:value, spaces: 31)
if (shift == 0)
{
let rawOutput1:OutputStream = openMemoryStream()
let output1:CodedOutputStream = CodedOutputStream(stream: rawOutput1)
let invalue = Int32(value)
try output1.writeRawVarint32(value: invalue)
try output1.flush()
let actual1:Data = rawOutput1.property(forKey: Stream.PropertyKey.dataWrittenToMemoryStreamKey) as! Data
XCTAssertTrue(data == actual1, "")
XCTAssertTrue(Int32(data.count) == Int32(value).computeRawVarint32Size(), "")
}
let rawOutput2:OutputStream = openMemoryStream()
let output2:CodedOutputStream = CodedOutputStream(stream:rawOutput2)
try output2.writeRawVarint64(value: value)
try output2.flush()
let actual2:Data = rawOutput2.property(forKey: Stream.PropertyKey.dataWrittenToMemoryStreamKey) as! Data
XCTAssertTrue(data == actual2, "")
XCTAssertTrue(Int32(data.count) == value.computeRawVarint64Size(), "")
var blockSize:Int = 1
while blockSize <= 16 {
if (WireFormat.logicalRightShift64(value:value, spaces: 31) == 0)
{
let rawOutput3:OutputStream = openMemoryStream()
let output3:CodedOutputStream = CodedOutputStream(stream: rawOutput3, bufferSize: blockSize)
try output3.writeRawVarint32(value: Int32(value))
try output3.flush()
let actual3:Data = rawOutput3.property(forKey: Stream.PropertyKey.dataWrittenToMemoryStreamKey) as! Data
XCTAssertTrue(data == actual3, "")
}
let rawOutput4:OutputStream = openMemoryStream()
let output4:CodedOutputStream = CodedOutputStream(stream: rawOutput4, bufferSize: blockSize)
try output4.writeRawVarint64(value: value)
try output4.flush()
let actual4:Data = rawOutput4.property(forKey: Stream.PropertyKey.dataWrittenToMemoryStreamKey) as! Data
XCTAssertTrue(data == actual4, "")
blockSize *= 2
}
}
func testWriteVarintOne()
{
do {
try assertWriteVarint(bytes(UInt8(0x00)), value:0)
}
catch
{
XCTFail("testWriteVarintOne")
}
}
func testWriteVarintTwo()
{
do {
try assertWriteVarint(bytes(UInt8(0x01)), value:1)
}
catch
{
XCTFail("testWriteVarintTwo")
}
}
func testWriteVarintThree()
{
do {
try assertWriteVarint(bytes(UInt8(0x7f)), value:127)
}
catch
{
XCTFail("testWriteVarintThree")
}
}
func testWriteVarintFour()
{
//14882
do {
try assertWriteVarint(bytes(0xa2, 0x74), value:(0x22 << 0) | (0x74 << 7))
}
catch
{
XCTFail("Fail testWriteVarintFour")
}
}
func testWriteVarintFive()
{
// 2961488830
// var signedByte:UInt8 = UInt8(129)
// var UInt8:SignedByte = SignedByte(signedByte)
var value:Int64 = (0x3e << 0)
value |= (0x77 << 7)
value |= (0x12 << 14)
value |= (0x04 << 21)
value |= (0x0b << 28)
do {
try assertWriteVarint(bytes(0xbe, 0xf7, 0x92, 0x84, 0x0b), value:value)
}
catch
{
XCTFail("Fail testWriteVarintFive")
}
}
func testWriteVarintSix()
{
// 64-bit
// 7256456126
var value:Int64 = (0x3e << 0)
value |= (0x77 << 7)
value |= (0x12 << 14)
value |= (0x04 << 21)
value |= (0x1b << 28)
do {
try assertWriteVarint(bytes(0xbe, 0xf7, 0x92, 0x84, 0x1b), value:value)
}
catch
{
XCTFail("Fail testWriteVarintSix")
}
}
//
func testWriteVarintSeven()
{
// 41256202580718336
var value:Int64 = (0x00 << 0)
value |= (0x66 << 7)
value |= (0x6b << 14)
value |= (0x1c << 21)
value |= (0x43 << 28)
value |= (0x49 << 35)
value |= (0x24 << 42)
value |= (0x49 << 49)
do {
try assertWriteVarint(bytes(0x80, 0xe6, 0xeb, 0x9c, 0xc3, 0xc9, 0xa4, 0x49), value:value)
}
catch
{
XCTFail("Fail testWriteVarintSeven")
}
}
//
func testWriteVarintEight()
{
// 11964378330978735131
var value:Int64 = (0x1b << 0)
value |= (0x28 << 7)
value |= (0x79 << 14)
value |= (0x42 << 21)
value |= (0x3b << 28)
value |= (0x56 << 35)
value |= (0x00 << 42)
value |= (0x05 << 49)
value |= (0x26 << 56)
value |= (0x01 << 63)
do {
try assertWriteVarint(bytes(0x9b, 0xa8, 0xf9, 0xc2, 0xbb, 0xd6, 0x80, 0x85, 0xa6, 0x01), value:value)
}
catch
{
XCTFail("Fail testWriteVarintEight")
}
}
func testWriteLittleEndian()
{
do {
try assertWriteLittleEndian32(bytes(0x78, 0x56, 0x34, 0x12) , value:0x12345678)
try assertWriteLittleEndian32(bytes(0xde, 0xbc, 0xac, 0x11), value:0x11acbcde)
try assertWriteLittleEndian64(bytes(0xf0, 0xde, 0xbc, 0x9a, 0x78, 0x56, 0x34, 0x12), value:0x123456789abcdef0)
try assertWriteLittleEndian64(bytes(0x78, 0x56, 0x34, 0x12, 0xf0, 0xde, 0xbc, 0x11), value:0x11bcdef012345678)
}
catch
{
XCTFail("Fail testWriteLittleEndian")
}
}
func testEncodeZigZag()
{
XCTAssertTrue(0 == WireFormat.encodeZigZag32(n: 0), "")
XCTAssertTrue(1 == WireFormat.encodeZigZag32(n: -1), "")
XCTAssertTrue(2 == WireFormat.encodeZigZag32(n: 1), "")
XCTAssertTrue(3 == WireFormat.encodeZigZag32(n: -2), "")
XCTAssertTrue(0x7FFFFFFE == WireFormat.encodeZigZag32(n: 0x3FFFFFFF), "")
XCTAssertTrue(0 == WireFormat.encodeZigZag64(n: 0), "")
XCTAssertTrue(1 == WireFormat.encodeZigZag64(n: -1), "")
XCTAssertTrue(2 == WireFormat.encodeZigZag64(n: 1), "")
XCTAssertTrue(3 == WireFormat.encodeZigZag64(n: -2), "")
XCTAssertTrue(0x000000007FFFFFFE == WireFormat.encodeZigZag64(n: 0x000000003FFFFFFF), "")
XCTAssertTrue(0 == WireFormat.encodeZigZag32(n: WireFormat.decodeZigZag32(n: 0)), "")
XCTAssertTrue(1 == WireFormat.encodeZigZag32(n: WireFormat.decodeZigZag32(n: 1)), "")
XCTAssertTrue(-1 == WireFormat.encodeZigZag32(n: WireFormat.decodeZigZag32(n: -1)), "")
XCTAssertTrue(14927 == WireFormat.encodeZigZag32(n: WireFormat.decodeZigZag32(n: 14927)), "")
XCTAssertTrue(-3612 == WireFormat.encodeZigZag32(n: WireFormat.decodeZigZag32(n: -3612)), "")
XCTAssertTrue(0 == WireFormat.encodeZigZag64(n: WireFormat.decodeZigZag64(n: 0)), "")
XCTAssertTrue(1 == WireFormat.encodeZigZag64(n: WireFormat.decodeZigZag64(n: 1)), "")
XCTAssertTrue(-1 == WireFormat.encodeZigZag64(n: WireFormat.decodeZigZag64(n: -1)), "")
XCTAssertTrue(14927 == WireFormat.encodeZigZag64(n: WireFormat.decodeZigZag64(n: 14927)), "")
XCTAssertTrue(-3612 == WireFormat.encodeZigZag64(n: WireFormat.decodeZigZag64(n: -3612)), "")
XCTAssertTrue(856912304801416 == WireFormat.encodeZigZag64(n: WireFormat.decodeZigZag64(n: 856912304801416)), "")
XCTAssertTrue(-75123905439571256 == WireFormat.encodeZigZag64(n: WireFormat.decodeZigZag64(n: -75123905439571256)), "")
}
func testWriteWholeMessage()
{
// do {
// let message = try TestUtilities.allSet()
//
// let rawBytes = message.data()
// let goldenData = TestUtilities.goldenData()
// XCTAssertTrue(rawBytes == goldenData, "")
//
// // Try different block sizes.
//
// var blockSize:Int = 1
// while blockSize <= 256 {
// let rawOutput = openMemoryStream()
// let output:CodedOutputStream = CodedOutputStream(stream:rawOutput, bufferSize:blockSize)
// try message.writeTo(codedOutputStream:output)
// try output.flush()
// let actual = rawOutput.property(forKey: Stream.PropertyKey.dataWrittenToMemoryStreamKey) as! Data
// XCTAssertTrue(rawBytes == actual, "")
// blockSize *= 2
// }
// }
// catch
// {
// XCTFail("Fail testWriteLittleEndian")
// }
}
func testDelimitedEncodingEncoding()
{
do {
let str = (Bundle(for:TestUtilities.self).resourcePath! as NSString).appendingPathComponent("delimitedFile.dat")
let stream = OutputStream(toFileAtPath: str, append: false)
stream?.open()
for i in 1...100 {
let mes = try PBProtoPoint.Builder().setLatitude(1.0).setLongitude(Float(i)).build()
try mes.writeDelimitedTo(outputStream:stream!)
}
stream?.close()
let input = InputStream(fileAtPath: str)
input?.open()
let message = try PBProtoPoint.parseArrayDelimitedFrom(inputStream:input!)
XCTAssertTrue(message[1].longitude == 2.0, "")
}
catch
{
XCTFail("Fail testDelimitedEncodingEncoding")
}
}
}
|
[
-1
] |
fdb1c5168d00b00758a66b8e370cabbc6e779c8a
|
c2b6c5c516b88fa93e884ca8fa31d8e9e1bda928
|
/COVID-19/COVID-19/SceneDelegate.swift
|
53132fb3d0ba9c1dbd1cbbad7a2a3da1890a92a3
|
[
"Unlicense"
] |
permissive
|
santoshbotre/COVID-19
|
e5ffede012bdfa681134cbdeb720fada0f98bc67
|
47e5ae047ec78f1e0fdcf84756f28bf8c161a7ce
|
refs/heads/master
| 2021-05-18T16:43:13.695399 | 2020-03-30T14:52:15 | 2020-03-30T14:52:15 | 251,322,174 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,763 |
swift
|
//
// SceneDelegate.swift
// COVID-19
//
// Created by Santosh Botre on 27/03/20.
// Copyright © 2020 Santosh Botre. All rights reserved.
//
import UIKit
import SwiftUI
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
// Create the SwiftUI view that provides the window contents.
let contentView = ContentView()
// Use a UIHostingController as window root view controller.
if let windowScene = scene as? UIWindowScene {
let window = UIWindow(windowScene: windowScene)
window.rootViewController = UIHostingController(rootView: contentView)
self.window = window
window.makeKeyAndVisible()
}
}
func sceneDidDisconnect(_ scene: UIScene) {
// Called as the scene is being released by the system.
// This occurs shortly after the scene enters the background, or when its session is discarded.
// Release any resources associated with this scene that can be re-created the next time the scene connects.
// The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead).
}
func sceneDidBecomeActive(_ scene: UIScene) {
// Called when the scene has moved from an inactive state to an active state.
// Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
}
func sceneWillResignActive(_ scene: UIScene) {
// Called when the scene will move from an active state to an inactive state.
// This may occur due to temporary interruptions (ex. an incoming phone call).
}
func sceneWillEnterForeground(_ scene: UIScene) {
// Called as the scene transitions from the background to the foreground.
// Use this method to undo the changes made on entering the background.
}
func sceneDidEnterBackground(_ scene: UIScene) {
// Called as the scene transitions from the foreground to the background.
// Use this method to save data, release shared resources, and store enough scene-specific state information
// to restore the scene back to its current state.
}
}
|
[
325633,
325637,
163849,
268299,
333838,
186388,
346140,
352294,
163892,
16444,
337980,
254020,
217158,
243782,
395340,
327757,
200786,
286804,
329816,
217180,
368736,
342113,
180322,
329833,
286833,
368753,
252021,
342134,
286845,
192640,
286851,
329868,
268435,
250008,
329886,
286880,
135328,
192674,
333989,
286889,
430257,
180418,
350411,
346317,
180432,
350417,
368854,
350423,
350426,
385243,
334047,
356580,
346344,
327915,
350449,
387314,
375027,
338161,
350454,
321787,
336124,
350459,
350462,
336129,
350465,
350469,
389381,
325895,
194829,
350477,
43279,
350481,
350487,
356631,
338201,
325915,
350491,
381212,
325918,
182559,
350494,
258333,
325920,
350500,
194854,
350505,
350510,
395567,
248112,
332081,
307507,
340276,
336181,
356662,
332091,
332098,
201030,
332107,
190797,
334162,
332118,
418135,
321880,
250201,
332126,
258399,
332130,
250211,
340328,
250217,
348523,
348528,
182642,
321911,
332153,
334204,
268669,
194942,
250239,
332158,
332162,
389507,
348548,
393613,
383375,
332175,
160152,
340380,
268702,
416159,
326059,
373169,
342453,
334263,
338363,
266688,
324032,
336326,
338387,
248279,
369119,
334306,
338404,
334312,
338411,
104940,
375279,
162289,
328178,
328180,
248309,
328183,
340473,
199165,
328190,
324095,
328193,
98819,
324100,
266757,
324103,
164362,
248332,
199182,
328207,
324112,
330254,
186898,
342546,
340501,
324118,
334359,
342551,
324122,
334364,
330268,
340512,
191012,
332325,
324134,
197160,
381483,
324141,
324143,
334386,
324156,
334397,
188990,
324161,
324165,
219719,
324171,
324174,
324177,
244309,
334425,
326240,
340580,
174696,
375401,
248427,
191085,
346736,
338544,
268922,
334466,
336517,
344710,
119432,
213642,
148106,
162446,
330384,
326291,
340628,
342685,
340639,
336549,
332455,
271018,
332460,
336556,
389806,
332464,
385714,
164535,
336568,
174775,
248505,
174778,
244410,
328379,
332473,
223936,
328387,
332484,
332487,
373450,
418508,
154318,
332494,
342737,
154329,
183006,
139998,
189154,
338661,
338665,
332521,
418540,
330479,
342769,
340724,
332534,
338680,
342777,
418555,
344832,
207620,
336644,
191240,
328462,
326417,
336660,
338712,
199455,
336676,
336681,
334633,
326444,
215854,
328498,
152371,
326452,
271154,
326455,
340792,
348983,
244542,
326463,
326468,
328516,
336709,
127815,
244552,
328520,
326474,
328523,
336712,
342857,
326479,
355151,
330581,
326486,
136024,
330585,
326494,
439138,
326503,
375657,
201580,
326508,
201583,
326511,
355185,
211826,
340850,
330612,
201589,
340859,
324476,
328574,
340863,
359296,
351105,
252801,
373635,
324482,
324488,
342921,
236432,
361361,
324496,
330643,
324502,
252823,
324511,
324514,
252838,
201638,
211885,
252846,
324525,
5040,
5047,
324539,
324542,
187335,
398280,
347082,
340940,
345046,
330711,
248794,
340958,
248799,
340964,
386023,
338928,
328690,
359411,
244728,
330750,
265215,
328703,
199681,
328710,
338951,
330761,
328715,
326669,
330769,
361490,
349203,
209944,
336922,
209948,
248863,
345119,
250915,
357411,
250917,
158759,
347178,
328747,
209966,
209969,
330803,
209973,
386102,
209976,
339002,
339010,
209988,
209991,
347208,
248905,
330827,
197708,
330830,
341072,
248915,
345172,
183384,
156762,
343132,
339037,
322660,
326764,
210028,
326767,
187503,
345200,
330869,
361591,
386168,
210042,
210045,
361599,
152704,
160896,
351366,
330886,
384136,
384140,
351382,
337048,
210072,
248986,
384152,
210078,
384158,
210081,
384161,
251045,
210085,
210089,
339118,
337072,
210096,
337076,
210100,
249015,
324792,
367801,
339133,
384189,
343232,
384192,
210116,
244934,
326858,
322763,
333003,
384202,
343246,
384209,
333010,
146644,
330966,
210139,
328925,
66783,
384225,
328933,
343272,
351467,
328942,
251123,
384247,
384250,
388348,
242947,
206084,
115973,
343307,
384270,
333075,
384276,
333079,
251161,
384284,
245021,
384290,
208167,
263464,
171304,
245032,
245042,
251190,
345400,
208189,
386366,
372035,
343366,
126279,
337224,
251211,
357710,
337230,
331089,
337235,
437588,
263509,
331094,
365922,
175458,
208228,
343394,
175461,
343399,
337252,
345449,
175464,
333164,
99692,
343410,
234867,
331124,
175478,
155000,
378232,
249210,
175484,
337278,
249215,
245121,
249219,
245128,
249225,
181644,
361869,
249228,
136591,
245137,
181650,
249235,
112021,
181655,
245143,
175514,
245146,
343453,
245149,
245152,
263585,
396706,
245155,
355749,
40358,
181671,
245158,
333222,
245163,
181679,
337330,
327090,
210357,
146878,
181697,
361922,
54724,
327108,
181704,
339401,
327112,
384457,
327116,
327118,
208338,
366035,
343509,
181717,
337366,
249310,
249313,
333285,
329195,
343540,
343545,
423424,
253445,
339464,
337416,
249355,
329227,
175637,
405017,
345626,
366118,
339504,
349748,
206397,
214594,
333387,
214611,
333400,
366173,
339553,
343650,
333415,
327276,
245358,
333423,
222831,
138865,
339572,
372354,
126597,
339593,
159375,
339602,
126611,
333472,
245410,
345763,
345766,
425639,
245415,
337588,
155323,
333499,
337601,
337607,
333512,
210632,
339664,
358100,
419543,
245463,
212700,
181982,
153311,
333535,
225000,
337643,
245487,
339696,
337647,
245495,
141052,
337661,
333566,
339711,
225027,
337671,
339722,
366349,
249617,
321300,
245528,
333593,
116512,
210720,
362274,
184096,
339748,
358192,
372533,
345916,
399166,
384831,
325441,
247618,
325447,
341831,
329545,
341835,
323404,
354124,
337743,
339795,
354132,
341844,
247639,
337751,
358235,
341852,
313181,
413539,
399208,
339818,
327532,
339827,
358260,
341877,
399222,
325494,
182136,
186233,
1914,
333690,
243584,
325505,
333699,
339845,
247692,
333709,
247701,
337814,
329625,
327590,
333737,
382898,
184245,
337845,
190393,
327613,
333767,
350153,
346059,
311244,
358348,
247760,
212945,
333777,
219094,
419810,
329699,
358372,
327655,
247790,
204785,
380919,
333819
] |
acc1101237306007c32651fbcde3b80e067b67de
|
53f35a34892d66b1a5cee0ec3ecececec78d5f30
|
/ThirdParty/Box/MutableBox.swift
|
2fe30b6c6d844c8a0023d8da8aab9f7a68819a70
|
[
"MIT"
] |
permissive
|
PacktPublishing/Continuous-Delivery-for-Mobile-with-fastlane
|
88fcdc5bcd8c7ce9c2772b0a3a95f4a48eca8ef9
|
55ed4ee496e86e43fa7d07ba3e4bcc2a0292a918
|
refs/heads/master
| 2023-02-09T15:45:58.772042 | 2023-01-30T09:12:04 | 2023-01-30T09:12:04 | 122,930,195 | 28 | 12 |
MIT
| 2018-02-26T07:32:30 | 2018-02-26T07:25:40 |
Swift
|
UTF-8
|
Swift
| false | false | 996 |
swift
|
// Copyright (c) 2014 Rob Rix. All rights reserved.
/// Wraps a type `T` in a mutable reference type.
///
/// While this, like `Box<T>` could be used to work around limitations of value types, it is much more useful for sharing a single mutable value such that mutations are shared.
///
/// As with all mutable state, this should be used carefully, for example as an optimization, rather than a default design choice. Most of the time, `Box<T>` will suffice where any `BoxType` is needed.
public final class MutableBox<T>: MutableBoxType, CustomStringConvertible {
/// Initializes a `MutableBox` with the given value.
public init(_ value: T) {
self.value = value
}
/// The (mutable) value wrapped by the receiver.
public var value: T
/// Constructs a new MutableBox by transforming `value` by `f`.
public func map<U>(_ f: (T) -> U) -> MutableBox<U> {
return MutableBox<U>(f(value))
}
// MARK: Printable
public var description: String {
return String(describing: value)
}
}
|
[
227104,
363924,
130741
] |
645ccadc0d3589ffb9c284f37a83c929f010c0aa
|
1dc3324b8bf50a994f287e36ed1a49ed23eff741
|
/tomatoes/ViewController.swift
|
ae110461c8bbd07e2941a35af11986b1c0b9e72a
|
[] |
no_license
|
atn832/ios-intro-2-rotten-tomatoes
|
41de4ed0e0d0726eaac5f846c5614b04e58d4144
|
7aa6e1f07091565c74db8898a866428bcef8d51e
|
refs/heads/master
| 2020-06-04T02:06:47.416013 | 2014-09-19T04:00:10 | 2014-09-19T04:00:10 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 527 |
swift
|
//
// ViewController.swift
// tomatoes
//
// Created by Anh Tuan on 9/9/14.
// Copyright (c) 2014 Anh Tuan. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
|
[
288775,
278543,
237616,
360501,
286775,
288827,
286796,
278606,
237655,
307288,
200802,
309347,
276580,
309351,
309353,
356458,
307311,
276597,
278657,
276612,
280710,
303242,
311437,
299165,
278693,
100521,
299186,
307379,
280770,
227523,
280772,
280775,
313550,
276686,
229585,
307410,
280797,
278752,
280808,
286963,
280821,
286965,
280826,
280832,
278786,
282917,
233767,
307516,
278845,
289088,
323933,
313704,
227688,
313706,
313708,
299374,
199024,
276849,
278897,
311684,
313733,
285087,
289187,
285103,
278968,
293308,
278973,
276959,
276965,
281073,
281078,
236022,
233980,
287231,
279041,
279046,
215562,
281107,
279064,
281118,
295460,
289318,
309807,
279096,
234043,
277057,
129604,
301637,
158285,
311913,
281202,
277108,
287350,
285321,
117399,
228000,
225955,
287399,
326311,
209577,
277171,
285377,
277192,
226009,
277224,
312049,
226038,
234232,
230147,
226055,
299786,
369434,
228127,
281380,
283433,
312107,
293682,
289596,
283453,
279360,
289600,
293700,
308064,
303977,
162672,
277364,
207738,
303998,
304008,
324491,
304012,
234380,
304015,
277406,
234402,
283556,
279463,
277420,
324528,
230323,
277430,
234423,
277432,
295874,
299973,
234465,
168936,
183278,
277487,
293888,
277512,
275466,
277527,
304174,
300086,
234551,
300089,
238653,
293961,
277602,
281701,
281703,
296042,
277612,
164974,
312433,
300149,
234619,
279684,
253066,
226447,
234641,
349332,
285855,
283839,
277696,
228548,
228551,
279751,
279754,
230604,
298189,
302286,
230608,
302295,
189655,
363743,
228585,
279791,
120054,
204027,
300288,
312586,
277796,
130346,
300358,
238920,
234829,
296272,
306540,
298359,
310649,
333179,
290175,
275842,
224643,
300432,
226705,
310673,
306578,
288165,
370093,
286126,
277935,
282035,
292277,
296374,
130487,
337336,
306633,
288205,
286158,
280015,
310734,
163289,
280028,
286175,
286189,
282095,
296436,
302580,
310773,
288251,
290299,
286204,
290303,
282128,
282143,
284197,
296487,
296489,
286249,
226878,
288321,
226887,
226896,
212561,
284242,
292435,
284240,
300629,
276054,
282202,
212573,
40545,
284261,
306791,
286314,
284275,
314996,
276087,
284287,
284289,
276099,
284298,
278157,
282262,
280219,
282270,
282275,
280231,
284328,
313007,
284336,
284341,
286390,
300727,
282301,
302788,
276167,
282311,
284361,
282320,
284373,
282329,
282338,
284391,
282346,
358127,
282357,
358139,
282365,
286462,
282368,
358147,
282377,
300817,
282389,
282393,
278298,
329499,
276256,
278304,
315170,
282403,
304933,
315177,
282411,
159541,
282426,
288577,
307029,
276309,
241499,
188253,
315250,
292730,
284580,
284586,
276396,
276412,
165832,
301012,
301016,
294889,
231405,
227315,
237556,
237564
] |
fba010e6277749fd3f77d4a083c89944b763de49
|
e2ced2352c1a04e96e08df8cc0a1d3b7081a1fc6
|
/CoreDataDemo/ViewController/SearchVC.swift
|
cc7fb3b9beb8aff8e197770304727bf63711edb0
|
[] |
no_license
|
Nikul-007/CoreDataDemo
|
60e16d48e95e6da1b54d72681505a0732215bdf7
|
d7f76269534d0cf9131dcc77b8dacdb933011ca7
|
refs/heads/master
| 2022-10-04T22:00:31.968990 | 2020-06-08T04:25:36 | 2020-06-08T04:25:36 | 247,225,516 | 0 | 0 | null | 2020-06-08T04:25:54 | 2020-03-14T06:37:20 |
Swift
|
UTF-8
|
Swift
| false | false | 2,376 |
swift
|
//
// SearchVC.swift
// CoreDataDemo
//
// Created by nikunj on 16/03/20.
// Copyright © 2020 Nikul. All rights reserved.
//
import UIKit
import CoreData
class SearchVC: UIViewController {
@IBOutlet var searchField : UITextField!
@IBOutlet var searchLabel : UILabel!
@IBOutlet var searchView : UIView!
override func viewDidLoad() {
super.viewDidLoad()
searchView.setViewShadow( clr: .red)
// Do any additional setup after loading the view.
}
// Search RECORD
@IBAction func onClickSearchRecord()
{
searchLabel.text = ""
searchRecord(searchText: searchField.text!)
}
func searchRecord(searchText : String)
{
let managedObject = appDelegate.persistentContainer.viewContext
let fetchReq = NSFetchRequest<NSFetchRequestResult>.init(entityName: "User")
fetchReq.predicate = NSPredicate.init(format: "firstname = %@", searchText)
do{
let data = try! managedObject.fetch(fetchReq)
if data.count == 0{
searchLabel.text = "Not Found"
return
}
for obj in (data as? [NSManagedObject])!
{
let firstName = obj.value(forKey: "firstname") as! String
let lastName = obj.value(forKey: "lastname") as! String
searchLabel.text = firstName + " " + lastName
}
}
}
// DELETE RECORD
@IBAction func onClickDeleteRecord()
{
deleteDataByName(searchText: searchField.text!)
}
func deleteDataByName(searchText : String)
{
let managedObject = appDelegate.persistentContainer.viewContext
let fetchReq = NSFetchRequest<NSFetchRequestResult>.init(entityName: "User")
fetchReq.predicate = NSPredicate.init(format: "firstname = %@", searchText)
do{
let data = try! managedObject.fetch(fetchReq)
if data.count > 0{
managedObject.delete(data[0] as! NSManagedObject)
try? managedObject.save()
searchLabel.text = "Record Deleted"
searchField.text = ""
}
else{
searchLabel.text = "No Record Found"
}
}
}
}
|
[
-1
] |
dc9ce96147e162d7c7fbfc9dc9aff97915e0942e
|
62b09785a9f55314198ec21b415a0292e74d1e5d
|
/Cosmos-IOS/Cosmostation/Cosmostation/Controller/GenTx/StepMemoViewController.swift
|
50732cd21b1b49a7fed7154cb64e99dfecc41130
|
[
"MIT"
] |
permissive
|
FollowMeDown/cosmostation-mobile
|
a7f52279f98aad8cc9ebeaee07cfe5556feca024
|
61fb5b87f04214d8432bf5ddbae5169fdbd6e7ee
|
refs/heads/master
| 2023-03-26T06:50:43.872697 | 2021-03-27T11:07:37 | 2021-03-27T11:07:37 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 6,978 |
swift
|
//
// StepDelegateMemoViewController.swift
// Cosmostation
//
// Created by yongjoo on 08/04/2019.
// Copyright © 2019 wannabit. All rights reserved.
//
import UIKit
class StepMemoViewController: BaseViewController, UITextViewDelegate, QrScannerDelegate {
@IBOutlet weak var memoInputTextView: MemoTextView!
@IBOutlet weak var memoCntLabel: UILabel!
@IBOutlet weak var beforeBtn: UIButton!
@IBOutlet weak var nextBtn: UIButton!
@IBOutlet weak var memoControlLayer: UIStackView!
@IBOutlet weak var emptyMemoIcon: UIImageView!
@IBOutlet weak var emptyMemoMsg: UILabel!
var pageHolderVC: StepGenTxViewController!
override func viewDidLoad() {
super.viewDidLoad()
pageHolderVC = self.parent as? StepGenTxViewController
memoInputTextView.tintColor = UIColor.init(hexString: "FFFFFF")
memoInputTextView.delegate = self
(NSClassFromString("UICalloutBarButton")! as! UIButton.Type).appearance().backgroundColor = UIColor.white
(NSClassFromString("UICalloutBarButton")! as! UIButton.Type).appearance().setTitleColor(UIColor.black, for: .normal)
chainType = pageHolderVC.chainType!
if (chainType == ChainType.COSMOS_MAIN || chainType == ChainType.KAVA_MAIN || chainType == ChainType.KAVA_TEST ||
chainType == ChainType.IOV_MAIN || chainType == ChainType.BAND_MAIN || chainType == ChainType.SECRET_MAIN ||
chainType == ChainType.CERTIK_MAIN || chainType == ChainType.IOV_TEST || chainType == ChainType.OKEX_TEST ||
chainType == ChainType.CERTIK_TEST || chainType == ChainType.COSMOS_TEST || chainType == ChainType.OKEX_MAIN) {
memoCntLabel.text = "0/255 byte"
} else {
memoCntLabel.text = "0/100 byte"
}
if (isTransfer()) {
self.memoControlLayer.isHidden = false
self.emptyMemoIcon.isHidden = false
self.emptyMemoMsg.isHidden = false
} else {
self.memoControlLayer.isHidden = true
self.emptyMemoIcon.isHidden = true
self.emptyMemoMsg.isHidden = true
}
}
@IBAction func onClickBack(_ sender: Any) {
self.beforeBtn.isUserInteractionEnabled = false
self.nextBtn.isUserInteractionEnabled = false
pageHolderVC.onBeforePage()
}
@IBAction func onClickNext(_ sender: Any) {
if (isValiadMemoSize()) {
if (memoInputTextView.text != nil && memoInputTextView.text.count > 0) {
pageHolderVC.mMemo = memoInputTextView.text.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines)
} else {
pageHolderVC.mMemo = ""
}
self.beforeBtn.isUserInteractionEnabled = false
self.nextBtn.isUserInteractionEnabled = false
pageHolderVC.onNextPage()
} else {
self.onShowToast(NSLocalizedString("error_memo", comment: ""))
}
}
@IBAction func onClickQrCode(_ sender: UIButton) {
let qrScanVC = QRScanViewController(nibName: "QRScanViewController", bundle: nil)
qrScanVC.hidesBottomBarWhenPushed = true
qrScanVC.resultDelegate = self
self.navigationItem.title = ""
self.navigationController!.view.layer.add(WUtils.getPasswordAni(), forKey: kCATransition)
self.navigationController?.pushViewController(qrScanVC, animated: false)
}
@IBAction func onClickPaste(_ sender: UIButton) {
if let myString = UIPasteboard.general.string {
self.memoInputTextView.text = myString.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines)
} else {
self.onShowToast(NSLocalizedString("error_no_clipboard", comment: ""))
}
}
override func enableUserInteraction() {
self.beforeBtn.isUserInteractionEnabled = true
self.nextBtn.isUserInteractionEnabled = true
}
func textViewDidChange(_ textView: UITextView) {
let byteArray = [UInt8](textView.text.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines).utf8)
if (chainType == ChainType.COSMOS_MAIN || chainType == ChainType.KAVA_MAIN || chainType == ChainType.KAVA_TEST ||
chainType == ChainType.IOV_MAIN || chainType == ChainType.BAND_MAIN || chainType == ChainType.SECRET_MAIN ||
chainType == ChainType.CERTIK_MAIN || chainType == ChainType.IOV_TEST || chainType == ChainType.OKEX_TEST ||
chainType == ChainType.CERTIK_TEST || chainType == ChainType.COSMOS_TEST || chainType == ChainType.OKEX_MAIN) {
memoCntLabel.text = String(byteArray.count) + "/255 byte"
if (byteArray.count > 255) {
self.memoInputTextView.layer.borderColor = UIColor.init(hexString: "f31963").cgColor
} else {
self.memoInputTextView.layer.borderColor = UIColor.white.cgColor
}
} else {
memoCntLabel.text = String(byteArray.count) + "/100 byte"
if (byteArray.count > 100) {
self.memoInputTextView.layer.borderColor = UIColor.init(hexString: "f31963").cgColor
} else {
self.memoInputTextView.layer.borderColor = UIColor.white.cgColor
}
}
}
func isValiadMemoSize() -> Bool {
let byteArray = [UInt8](memoInputTextView.text.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines).utf8)
if (chainType == ChainType.COSMOS_MAIN || chainType == ChainType.KAVA_MAIN || chainType == ChainType.KAVA_TEST ||
chainType == ChainType.IOV_MAIN || chainType == ChainType.BAND_MAIN || chainType == ChainType.SECRET_MAIN ||
chainType == ChainType.CERTIK_MAIN || chainType == ChainType.IOV_TEST || chainType == ChainType.OKEX_TEST ||
chainType == ChainType.CERTIK_TEST || chainType == ChainType.COSMOS_TEST || chainType == ChainType.OKEX_MAIN) {
if (byteArray.count > 255) {
return false
}
} else {
if (byteArray.count > 100) {
return false
}
}
return true
}
func scannedAddress(result: String) {
self.memoInputTextView.text = result.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines)
}
func isTransfer() -> Bool {
var result = true
let type = self.pageHolderVC.mType
if (type == COSMOS_MSG_TYPE_TRANSFER2 || type == IRIS_MSG_TYPE_TRANSFER || type == BNB_MSG_TYPE_TRANSFER ||
type == KAVA_MSG_TYPE_TRANSFER || type == IOV_MSG_TYPE_TRANSFER || type == BAND_MSG_TYPE_TRANSFER ||
type == SECRET_MSG_TYPE_TRANSFER || type == OK_MSG_TYPE_TRANSFER || type == CERTIK_MSG_TYPE_TRANSFER) {
result = true
} else {
result = false
}
return result
}
}
|
[
-1
] |
141a91bf5369fad434b9ee9ba55b2df77a3e446d
|
194f6d6852f7c4ad563810f90ba94a17d44e71e9
|
/MovieFan/SceneDelegate.swift
|
99cd98a10f24849c8ff3baa0ba3c6d5bd6c933dc
|
[] |
no_license
|
Meseery2/MovieFan
|
9b44ad5f7b9ea5c03f54aaeb76ee33d5b912f9aa
|
87a4baa4391158c70babcb75879c5bd9197cb527
|
refs/heads/master
| 2022-11-05T07:19:54.808394 | 2020-06-21T23:41:11 | 2020-06-21T23:41:11 | 274,000,811 | 1 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,433 |
swift
|
//
// SceneDelegate.swift
// MovieFan
//
// Created by Mohammed ELMeseery on 6/20/20.
// Copyright © 2020 Mohammed ELMeseery. All rights reserved.
//
import UIKit
import SwiftUI
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
@available(iOS 13.0, *)
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
// Create the SwiftUI view that provides the window contents.
let viewController = AppNavigationCordinator.buildMovieListModule()
let navigationController = UINavigationController(rootViewController: viewController)
// Use a UIHostingController as window root view controller.
if let windowScene = scene as? UIWindowScene {
let window = UIWindow(windowScene: windowScene)
window.rootViewController = navigationController
self.window = window
window.makeKeyAndVisible()
UINavigationBar.applyTheme()
}
}
}
|
[
-1
] |
553d4a893b264757218d53847724af289b354c58
|
a6d4ce577e04189bd7545dcec68db0c25a93eef9
|
/Alchemist/View/IndividualView/TopSectionDetail.swift
|
1780043ed5e70c18c8d0fb3473f30829865010b8
|
[
"MIT"
] |
permissive
|
ClaudiaAF/Alchemist
|
f1d4e89a6479e27e5629b014fa8a6f1316e9039c
|
c15a472f44b2ce025c903f72fb0a47d0235a0cbf
|
refs/heads/main
| 2023-07-10T21:35:19.107330 | 2021-08-17T11:41:40 | 2021-08-17T11:41:40 | 387,446,070 | 0 | 1 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,780 |
swift
|
//
// TopSectionDetail.swift
// Alchemist
//
// Created by Claudia Ferreira on 13/05/1400 AP.
//
import SwiftUI
struct TopSectionDetail: View {
// object for detailed view navigation
@EnvironmentObject var dungeon: Dungeon
// @state bool for animations
@State private var isAnimating: Bool = false
var body: some View {
HStack(alignment: /*@START_MENU_TOKEN@*/ .center/*@END_MENU_TOKEN@*/, spacing: 6, content: {
// effects
VStack(alignment: .leading, spacing: 6, content: {
Text("Effect")
.fontWeight(.semibold)
.foregroundColor(Color("text"))
.padding(.leading, 40)
Text(dungeon.selectedPotion?.points ?? sampleProduct.points)
.font(.title3)
.fontWeight(.bold)
.foregroundColor(Color("lightGrey"))
.scaleEffect(1.35, anchor: .leading)
.padding(.leading, 40)
.padding(.top)
})
.offset(y: isAnimating ? -5 : -750)
Spacer()
// photo
Image(dungeon.selectedPotion?.image ?? sampleProduct.image)
.resizable()
.offset(y: isAnimating ? 0 : -35)
.frame(height: 240, alignment: .center)
})
.onAppear(perform: {
withAnimation(.easeOut(duration: 0.75)) {
isAnimating.toggle()
}
})
}
}
struct TopSectionDetail_Previews: PreviewProvider {
static var previews: some View {
TopSectionDetail()
.previewLayout(.sizeThatFits)
.padding()
.environmentObject(Dungeon())
}
}
|
[
-1
] |
168551baab8a417369e61ff47e10255e838771e6
|
1996f8dde66affb6e1f31e548508800850a1c592
|
/Sources/Utilities/ALMessage+Extension.swift
|
128e66b4788001c96328a9870777c53c2f6ce6d5
|
[
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
suyeshkandpal28/ApplozicSwift
|
966366af5e3229ee9c98a5b8d18a0f1ca2040e6f
|
8014312973d62449472571c82644993fd8a88414
|
refs/heads/master
| 2021-07-16T18:34:42.898756 | 2020-04-21T07:20:12 | 2020-04-21T07:20:12 | 259,909,102 | 0 | 0 |
BSD-3-Clause
| 2020-04-29T11:40:30 | 2020-04-29T11:40:29 | null |
UTF-8
|
Swift
| false | false | 12,283 |
swift
|
//
// ALMessage+Extension.swift
// ApplozicSwift
//
// Created by Mukesh Thawani on 04/05/17.
// Copyright © 2017 Applozic. All rights reserved.
//
import Applozic
import Foundation
let friendsMessage = "4"
let myMessage = "5"
let imageBaseUrl = ALUserDefaultsHandler.getFILEURL() + "/rest/ws/aws/file/"
enum ChannelMetadataKey {
static let conversationSubject = "KM_CONVERSATION_SUBJECT"
}
let emailSourceType = 7
extension ALMessage: ALKChatViewModelProtocol {
private var alContact: ALContact? {
let alContactDbService = ALContactDBService()
guard let alContact = alContactDbService.loadContact(byKey: "userId", value: to) else {
return nil
}
return alContact
}
private var alChannel: ALChannel? {
let alChannelService = ALChannelService()
// TODO: This is a workaround as other method uses closure.
// Later replace this with:
// alChannelService.getChannelInformation(, orClientChannelKey: , withCompletion: )
guard let groupId = groupId,
let alChannel = alChannelService.getChannelByKey(groupId)
else {
return nil
}
return alChannel
}
public var avatar: URL? {
guard let alContact = alContact, let url = alContact.contactImageUrl else {
return nil
}
return URL(string: url)
}
public var avatarImage: UIImage? {
return isGroupChat ? UIImage(named: "group_profile_picture-1", in: Bundle.applozic, compatibleWith: nil) : nil
}
public var avatarGroupImageUrl: String? {
guard let alChannel = alChannel, let avatar = alChannel.channelImageURL else {
return nil
}
return avatar
}
public var name: String {
guard let alContact = alContact, let id = alContact.userId else {
return ""
}
guard let displayName = alContact.getDisplayName(), !displayName.isEmpty else { return id }
return displayName
}
public var groupName: String {
guard let alChannel = alChannel else { return "" }
let name = alChannel.name ?? ""
guard
let userId = alChannel.getReceiverIdInGroupOfTwo(),
let contact = ALContactDBService().loadContact(byKey: "userId", value: userId)
else {
return name
}
return contact.getDisplayName()
}
public var theLastMessage: String? {
switch messageType {
case .text:
return message
case .photo:
return "Photo"
case .location:
return "Location"
case .voice:
return "Audio"
case .information:
return "Update"
case .video:
return "Video"
case .html:
return "Text"
case .faqTemplate:
return message ?? "FAQ"
case .quickReply:
return message
case .button:
return message
case .listTemplate:
return message
case .cardTemplate:
return message
case .imageMessage:
return message ?? "Photo"
case .email:
guard let channelMetadata = alChannel?.metadata,
let messageText = channelMetadata[ChannelMetadataKey.conversationSubject]
else {
return message
}
return messageText as? String
case .document:
return "Document"
case .contact:
return "Contact"
case .allButtons:
return message ?? "Buttons"
}
}
public var hasUnreadMessages: Bool {
if isGroupChat {
guard let alChannel = alChannel, let unreadCount = alChannel.unreadCount else {
return false
}
return unreadCount.boolValue
} else {
guard let alContact = alContact, let unreadCount = alContact.unreadCount else {
return false
}
return unreadCount.boolValue
}
}
var identifier: String {
guard let key = self.key else {
return ""
}
return key
}
var friendIdentifier: String? {
return nil
}
public var totalNumberOfUnreadMessages: UInt {
if isGroupChat {
guard let alChannel = alChannel, let unreadCount = alChannel.unreadCount else {
return 0
}
return UInt(truncating: unreadCount)
} else {
guard let alContact = alContact, let unreadCount = alContact.unreadCount else {
return 0
}
return UInt(truncating: unreadCount)
}
}
public var isGroupChat: Bool {
guard groupId != nil else {
return false
}
return true
}
public var contactId: String? {
return contactIds
}
public var channelKey: NSNumber? {
return groupId
}
public var createdAt: String? {
let isToday = ALUtilityClass.isToday(date)
return getCreatedAtTime(isToday)
}
public var channelType: Int16 {
guard let alChannel = alChannel else { return 0 }
return alChannel.type
}
}
extension ALMessage {
var isMyMessage: Bool {
return (type != nil) ? (type == myMessage) : false
}
public var messageType: ALKMessageType {
guard source != emailSourceType else {
// Attachments come as separate message.
if message == nil, let type = getAttachmentType() {
return type
}
return .email
}
switch Int32(contentType) {
case ALMESSAGE_CONTENT_DEFAULT:
return richMessageType()
case ALMESSAGE_CONTENT_LOCATION:
return .location
case ALMESSAGE_CHANNEL_NOTIFICATION:
return .information
case ALMESSAGE_CONTENT_TEXT_HTML:
return .html
case ALMESSAGE_CONTENT_VCARD:
return .contact
default:
guard let attachmentType = getAttachmentType() else { return .text }
return attachmentType
}
}
var date: Date {
guard let time = createdAtTime else { return Date() }
let sentAt = Date(timeIntervalSince1970: Double(time.doubleValue / 1000))
return sentAt
}
var time: String? {
let dateFormatterGet = DateFormatter()
dateFormatterGet.dateFormat = "HH:mm"
return dateFormatterGet.string(from: date)
}
var isSent: Bool {
guard let status = status else {
return false
}
return status == NSNumber(integerLiteral: Int(SENT.rawValue))
}
var isAllRead: Bool {
guard let status = status else {
return false
}
return status == NSNumber(integerLiteral: Int(DELIVERED_AND_READ.rawValue))
}
var isAllReceived: Bool {
guard let status = status else {
return false
}
return status == NSNumber(integerLiteral: Int(DELIVERED.rawValue))
}
var ratio: CGFloat {
// Using default
if messageType == .text {
return 1.7
}
return 0.9
}
var size: Int64 {
guard let fileMeta = fileMeta, let size = Int64(fileMeta.size) else {
return 0
}
return size
}
var thumbnailURL: URL? {
guard let fileMeta = fileMeta, let urlStr = fileMeta.thumbnailUrl, let url = URL(string: urlStr) else {
return nil
}
return url
}
var imageUrl: URL? {
guard let fileMeta = fileMeta, let urlStr = fileMeta.blobKey, let imageUrl = URL(string: imageBaseUrl + urlStr) else {
return nil
}
return imageUrl
}
var filePath: String? {
guard let filePath = imageFilePath else {
return nil
}
return filePath
}
var geocode: Geocode? {
guard messageType == .location else {
return nil
}
// Returns lat, long
func getCoordinates(from message: String) -> (Any, Any)? {
guard let messageData = message.data(using: .utf8),
let jsonObject = try? JSONSerialization.jsonObject(
with: messageData,
options: .mutableContainers
),
let messageJSON = jsonObject as? [String: Any] else {
return nil
}
guard let lat = messageJSON["lat"],
let lon = messageJSON["lon"] else {
return nil
}
return (lat, lon)
}
guard let message = message,
let (lat, lon) = getCoordinates(from: message) else {
return nil
}
// Check if type is double or string
if let lat = lat as? Double,
let lon = lon as? Double {
let location = CLLocationCoordinate2D(latitude: lat, longitude: lon)
return Geocode(coordinates: location)
} else {
guard let latString = lat as? String,
let lonString = lon as? String,
let lat = Double(latString),
let lon = Double(lonString) else {
return nil
}
let location = CLLocationCoordinate2D(latitude: lat, longitude: lon)
return Geocode(coordinates: location)
}
}
var fileMetaInfo: ALFileMetaInfo? {
return fileMeta ?? nil
}
private func getAttachmentType() -> ALKMessageType? {
guard let fileMeta = fileMeta else { return nil }
if fileMeta.contentType.hasPrefix("image") {
return .photo
} else if fileMeta.contentType.hasPrefix("audio") {
return .voice
} else if fileMeta.contentType.hasPrefix("video") {
return .video
} else {
return .document
}
}
private func richMessageType() -> ALKMessageType {
guard let metadata = metadata,
let contentType = metadata["contentType"] as? String, contentType == "300",
let templateId = metadata["templateId"] as? String
else {
return .text
}
switch templateId {
case "3":
return .button
case "6":
return .quickReply
case "7":
return .listTemplate
case "8":
return .faqTemplate
case "9":
return .imageMessage
case "10":
return .cardTemplate
case "11":
return .allButtons
default:
return .text
}
}
}
extension ALMessage {
public var messageModel: ALKMessageModel {
let messageModel = ALKMessageModel()
messageModel.message = message
messageModel.isMyMessage = isMyMessage
messageModel.identifier = identifier
messageModel.date = date
messageModel.time = time
messageModel.avatarURL = avatar
messageModel.displayName = name
messageModel.contactId = contactId
messageModel.conversationId = conversationId
messageModel.channelKey = channelKey
messageModel.isSent = isSent
messageModel.isAllReceived = isAllReceived
messageModel.isAllRead = isAllRead
messageModel.messageType = messageType
messageModel.ratio = ratio
messageModel.size = size
messageModel.thumbnailURL = thumbnailURL
messageModel.imageURL = imageUrl
messageModel.filePath = filePath
messageModel.geocode = geocode
messageModel.fileMetaInfo = fileMetaInfo
messageModel.receiverId = to
messageModel.isReplyMessage = isAReplyMessage()
messageModel.metadata = metadata as? [String: Any]
messageModel.source = source
return messageModel
}
}
extension ALMessage {
open override func isEqual(_ object: Any?) -> Bool {
if let object = object as? ALMessage, let objectKey = object.key, let key = self.key {
return key == objectKey
} else {
return false
}
}
}
|
[
-1
] |
9f0c36095600ac4273be398bad0c5382f8d0593c
|
b0bbe146bc13b1fa2ef6c27874e8be69aa44da55
|
/Browser/Browser/Supporting files/AppDelegate.swift
|
b442c2fed286da45d10cd03f50e8ef2d90262725
|
[] |
no_license
|
adiletabs/iOSDev
|
76b250f099ae59dbb94533206b08386b13ebda15
|
211157cea8323d0d3f930b47b73d20f2bee20356
|
refs/heads/main
| 2023-04-02T01:50:25.741715 | 2021-03-27T18:08:56 | 2021-03-27T18:08:56 | 334,817,018 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,351 |
swift
|
//
// AppDelegate.swift
// Browser
//
// Created by Adilet Absatov on 25.02.2021.
//
import UIKit
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
// MARK: UISceneSession Lifecycle
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
// Called when a new scene session is being created.
// Use this method to select a configuration to create the new scene with.
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
}
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
// Called when the user discards a scene session.
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
}
}
|
[
393222,
393224,
393230,
393250,
344102,
393261,
393266,
213048,
385081,
376889,
393275,
376905,
327756,
254030,
286800,
368727,
180313,
368735,
180320,
376931,
286831,
368752,
286844,
417924,
262283,
286879,
286888,
377012,
164028,
327871,
377036,
180431,
377046,
418007,
418010,
377060,
327914,
205036,
393456,
393460,
418043,
336123,
385280,
336128,
262404,
164106,
180490,
368911,
262416,
262422,
377117,
262436,
336180,
262454,
393538,
262472,
344403,
213332,
65880,
262496,
418144,
262499,
213352,
246123,
262507,
262510,
213372,
385419,
393612,
262550,
262552,
385440,
385443,
262566,
385451,
262573,
393647,
385458,
262586,
344511,
262592,
360916,
369118,
328177,
328179,
328182,
328189,
328192,
164361,
410128,
393747,
254490,
188958,
385570,
33316,
197159,
377383,
352821,
197177,
418363,
188987,
369223,
385609,
385616,
352864,
369253,
262760,
352874,
352887,
254587,
377472,
148105,
377484,
352918,
98968,
344744,
361129,
336555,
385713,
434867,
164534,
336567,
328378,
164538,
328386,
344776,
352968,
418507,
352971,
385742,
385748,
361179,
189153,
369381,
361195,
418553,
344831,
344835,
336643,
344841,
361230,
336659,
418580,
418585,
434970,
369435,
418589,
262942,
418593,
336675,
328484,
418598,
418605,
336696,
361273,
328515,
336708,
328519,
361288,
336711,
328522,
336714,
426841,
197468,
254812,
361309,
361315,
361322,
328573,
377729,
369542,
361360,
222128,
345035,
345043,
386003,
386011,
386018,
386022,
435187,
328702,
328714,
361489,
386069,
386073,
336921,
336925,
345118,
377887,
345133,
345138,
386101,
361536,
197707,
189520,
345169,
156761,
361567,
148578,
345199,
386167,
361593,
410745,
361598,
214149,
345222,
386186,
337047,
345246,
214175,
337071,
337075,
386258,
328924,
66782,
222437,
328941,
386285,
386291,
345376,
353570,
345379,
410917,
345382,
337205,
345399,
378169,
369978,
337222,
337229,
337234,
263508,
402791,
345448,
271730,
378227,
271745,
181638,
353673,
181643,
181649,
181654,
230809,
181670,
181673,
181678,
181681,
337329,
181684,
181690,
361917,
181696,
337349,
181703,
337365,
271839,
329191,
361960,
329194,
116210,
337398,
337415,
329226,
419339,
419343,
419349,
345625,
419355,
370205,
419359,
394786,
419362,
370213,
419368,
419376,
206395,
214593,
419400,
419402,
353867,
419406,
419410,
345701,
394853,
222830,
370297,
403075,
198280,
345736,
345749,
419483,
345757,
345762,
419491,
345765,
419497,
419501,
370350,
419506,
419509,
419512,
337592,
419517,
337599,
419527,
419530,
419535,
272081,
394966,
419542,
419544,
181977,
345818,
419547,
419550,
419559,
337642,
419563,
337645,
370415,
141051,
337659,
337668,
362247,
395021,
362255,
116509,
345887,
378663,
345905,
354106,
354111,
247617,
354117,
370503,
329544,
370509,
354130,
247637,
337750,
370519,
313180,
354142,
354150,
354156,
345964,
345967,
345970,
345974,
403320,
354172,
247691,
337808,
247700,
329623,
436126,
436132,
337833,
362413,
337844,
346057,
346063,
247759,
329697,
354277,
190439,
247789,
354313,
346139,
436289,
378954,
395339,
338004,
100453,
329832,
329855,
329885,
411805,
346272,
362660,
100524,
387249,
379066,
387260,
256191,
395466,
346316,
411861,
411864,
411868,
411873,
379107,
411876,
387301,
346343,
338152,
387306,
387312,
346355,
436473,
321786,
379134,
411903,
411916,
379152,
395538,
387349,
338199,
387352,
182558,
338211,
395566,
248111,
362822,
436555,
190796,
379233,
354673,
321910,
248186,
420236,
379278,
272786,
354727,
338352,
338381,
330189,
338386,
338403,
338409,
248308,
199164,
330252,
199186,
330267,
354855,
10828,
199249,
346721,
174695,
248425,
191084,
338543,
191092,
346742,
330383,
354974,
150183,
174774,
248504,
174777,
223934,
355024,
273108,
355028,
264918,
183005,
256734,
436962,
338660,
338664,
264941,
363251,
207619,
264964,
338700,
256786,
199452,
363293,
396066,
346916,
396069,
215853,
355122,
355131,
355140,
355143,
338763,
355150,
330580,
355166,
265055,
265058,
355175,
387944,
355179,
330610,
355218,
330642,
412599,
207808,
379848,
396245,
330710,
248792,
248798,
347105,
257008,
183282,
265207,
330748,
265214,
330760,
330768,
248862,
347176,
158761,
396328,
199728,
330800,
396336,
396339,
339001,
388154,
388161,
347205,
330826,
412764,
339036,
257120,
265320,
248951,
420984,
330889,
347287,
248985,
339097,
44197,
380070,
339112,
249014,
126144,
330958,
330965,
265432,
265436,
388319,
388347,
175375,
159005,
175396,
208166,
273708,
347437,
372015,
347441,
372018,
199988,
44342,
175415,
396600,
437566,
175423,
437570,
437575,
437583,
331088,
437587,
331093,
396633,
175450,
437595,
175457,
208227,
175460,
175463,
265580,
437620,
175477,
249208,
175483,
249214,
175486,
175489,
249218,
249224,
249227,
249234,
175513,
175516,
396705,
175522,
355748,
380332,
396722,
208311,
372163,
216517,
380360,
216522,
339404,
372176,
208337,
339412,
413141,
339417,
339420,
249308,
339424,
249312,
339428,
339434,
249328,
69113,
372228,
208398,
380432,
175635,
265778,
265795,
396872,
265805,
224853,
224857,
257633,
224870,
372327,
257646,
372337,
224884,
224887,
224890,
224894,
224897,
372353,
216707,
421508,
126596,
224904,
224909,
11918,
159374,
224913,
126610,
224916,
224919,
126616,
224922,
208538,
224926,
224929,
224932,
224936,
257704,
224942,
257712,
224947,
257716,
257720,
224953,
257724,
224959,
257732,
224965,
224969,
339662,
224975,
257747,
224981,
224986,
257761,
224993,
257764,
224999,
339695,
225012,
257787,
225020,
257790,
339710,
225025,
257794,
257801,
339721,
257804,
225038,
257807,
225043,
372499,
167700,
225048,
257819,
225053,
184094,
225058,
257833,
225066,
257836,
413484,
225070,
225073,
372532,
257845,
225079,
397112,
225082,
397115,
225087,
225092,
225096,
323402,
257868,
257871,
225103,
397139,
225108,
225112,
257883,
257886,
225119,
257890,
339814,
225127,
257896,
274280,
257901,
225137,
339826,
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,
421960,
356439,
430180,
421990,
266350,
356466,
266362,
381068,
225423,
250002,
250004,
225429,
356506,
225437,
135327,
438433,
225441,
225444,
438436,
225447,
438440,
225450,
258222,
225455,
430256,
225458,
225461,
225466,
389307,
225470,
381120,
372929,
430274,
225475,
389320,
225484,
225487,
225490,
225493,
266453,
225496,
225499,
225502,
225505,
356578,
217318,
225510,
225514,
225518,
372976,
381176,
397571,
389380,
356637,
356640,
356643,
356646,
266536,
356649,
356655,
332080,
340275,
356660,
397622,
332090,
225597,
332097,
201028,
348488,
332106,
332117,
348502,
250199,
250202,
332125,
250210,
348522,
348525,
348527,
332152,
389502,
250238,
332161,
356740,
332172,
373145,
340379,
389550,
324030,
266687,
160234,
127471,
340472,
381436,
324094,
266754,
324099,
324102,
324111,
340500,
324117,
324131,
332324,
381481,
356907,
324139,
324142,
356916,
324149,
324155,
348733,
324164,
356934,
348743,
381512,
324170,
324173,
324176,
389723,
332380,
373343,
381545,
340627,
184982,
373398,
258721,
332453,
332459,
389805,
332463,
381617,
332471,
332483,
332486,
373449,
357069,
332493,
357073,
332511,
332520,
340718,
332533,
348924,
373510,
389926,
152370,
348978,
340789,
348982,
398139,
127814,
357201,
357206,
389978,
357211,
430939,
357214,
201579,
201582,
349040,
340849,
201588,
430965,
381813,
324472,
398201,
119674,
324475,
430972,
340858,
340861,
324478,
324481,
373634,
398211,
324484,
324487,
381833,
324492,
324495,
430995,
324501,
324510,
422816,
324513,
398245,
201637,
324524,
340909,
324533,
324538,
324541,
398279,
340939,
340941,
209873,
340957,
431072,
398306,
340963,
209895,
201711,
349172,
349180,
439294,
431106,
209943,
357410,
250914,
185380,
357418,
209965,
209968,
209971,
209975,
209979,
209987,
209990,
341071,
349267,
250967,
210010,
341091,
210025,
210027,
210030,
210036,
210039,
349308,
210044,
160895,
349311,
152703,
210052,
349319,
210055,
218247,
210067,
210071,
210077,
210080,
251044,
210084,
185511,
210088,
210095,
210098,
210107,
210115,
332997,
210127,
333009,
210131,
333014,
210138,
210143,
218354,
218360,
251128,
275706,
275712,
275715,
275721,
349459,
333078,
251160,
349484,
349491,
251189,
415033,
251210,
357708,
210260,
365911,
259421,
365921,
333154,
251235,
374117,
333162,
234866,
390516,
333175,
357755,
251271,
136590,
374160,
112020,
349590,
357792,
259515,
415166,
415185,
366034,
366038,
415191,
415193,
415196,
415199,
423392,
333284,
415207,
366056,
366061,
210420,
415224,
423423,
415257,
415263,
366117,
415270,
144939,
415278,
415281,
415285,
210487,
415290,
415293,
349761,
415300,
333386,
366172,
333413,
423528,
423532,
210544,
415353,
333439,
415361,
267909,
333498,
210631,
333511,
358099,
333534,
366307,
366311,
431851,
366318,
210672,
366321,
366325,
210695,
268041,
210698,
366348,
210706,
399128,
333594,
210719,
358191,
366387,
210739,
399159,
358200,
325440,
366401,
341829,
325446,
46920,
341834,
341838,
341843,
415573,
358234,
341851,
350045,
399199,
259938,
399206,
358255,
399215,
268143,
358259,
341876,
243579,
325504,
333698,
333708,
333724,
382890,
350146,
333774,
358371,
350189,
350193,
350202,
333818,
350206,
350213,
268298,
350224,
350231,
333850,
350237,
350240,
350244,
350248,
178218,
350251,
350256,
350259,
350271,
243781,
350285,
374864,
342111,
342133,
374902,
432271,
333997,
334011,
260289,
260298,
350410,
350416,
350422,
211160,
350425,
334045,
350445,
375026,
358644,
350458,
350461,
350464,
350467,
325891,
350475,
375053,
268559,
350480,
432405,
350486,
325914,
350490,
325917,
350493,
325919,
350498,
194852,
350504,
358700,
350509,
391468,
358704,
358713,
358716,
383306,
334161,
383321,
383330,
383333,
391530,
383341,
334203,
268668,
194941,
391563,
366990,
416157,
342430,
268701,
375208,
326058,
375216,
334262,
334275,
326084,
358856,
195039,
334304,
334311,
375277,
334321,
350723,
391690,
186897,
342545,
334358,
342550,
342554,
334363,
350761,
252461,
334384,
383536,
358961,
334394,
252482,
219718,
334407,
334420,
350822,
375400,
334465,
334468,
162445,
326290,
342679,
342683,
260766,
342710,
244409,
260797,
260801,
350917,
154317,
391894,
154328,
416473,
64230,
113388,
342766,
375535,
203506,
342776,
391937,
391948,
375568,
326416,
375571,
375574,
162591,
326441,
383793,
326451,
326454,
375612,
244540,
326460,
260924,
326467,
244551,
326473,
326477,
416597,
326485,
326490,
342874,
326502,
375656,
433000,
326507,
326510,
211825,
211831,
351097,
392060,
359295,
351104,
342915,
400259,
236430,
342930,
252822,
392091,
400285,
252836,
359334,
211884,
400306,
351168,
359361,
359366,
326598,
359382,
359388,
383967,
343015,
359407,
261108,
244726,
261111,
383997,
261129,
261147,
359451,
211998,
261153,
261159,
359470,
359476,
343131,
384098,
384101,
367723,
384107,
187502,
343154,
384114,
212094,
351364,
384135,
384139,
384143,
351381,
384160,
384168,
367794,
384181,
367800,
351423,
384191,
326855,
244937,
253130,
343244,
146642,
359649,
343270,
351466,
351479,
343306,
261389,
384269,
359694,
253200,
261393,
384275,
245020,
245029,
171302,
351534,
376110,
245040,
425276,
212291,
384323,
343365,
212303,
367965,
343393,
343398,
367980,
425328,
343409,
253303,
154999,
343417,
327034,
245127,
384397,
245136,
245142,
245145,
343450,
245148,
245151,
245154,
245157,
245162,
327084,
359865,
384443,
146876,
327107,
384453,
327110,
327115,
327117,
359886,
359890,
343507,
368092,
343534,
343539,
368119,
343544,
368122,
409091,
359947,
359955,
359983,
343630,
155239,
327275,
245357,
138864,
155254,
155273,
368288,
245409,
425638,
425649,
155322,
425662,
155327,
253943,
155351,
155354,
212699,
155363,
245475,
155371,
245483,
409335,
155393,
155403,
155422,
360223,
155438,
155442,
155447,
417595,
360261,
155461,
376663,
155482,
261981,
425822,
376671,
155487,
155490,
155491,
327531,
261996,
376685,
261999,
262002,
327539,
147317,
262005,
425845,
262008,
262011,
155516,
155521,
155525,
360326,
155531,
262027,
262030,
262033,
262036,
262039,
262042,
155549,
262045,
262048,
262051,
327589,
155559,
155562,
155565,
393150,
384977,
393169,
155611,
253923,
155619,
155621,
253926,
327654,
204784,
393203,
360438,
393206,
393212,
155646
] |
dd3a38d366dff45add6bc147c04fa7a2389eb869
|
dddbff8230f69de8ea9276b76e9422078ef6ccf3
|
/myResturentApp/CustomerLoginViewController.swift
|
6e48bddcd80407eb674d6f58a3b36c85150992c1
|
[] |
no_license
|
Erozone/myApp
|
324b96aba287b1d1a19d5c27ef5988debcbf66c7
|
8f2cbeec8ab6bc7b730d2d2783f23a13e3aede11
|
refs/heads/master
| 2020-12-30T13:19:43.484779 | 2017-06-30T15:40:13 | 2017-06-30T15:40:13 | 91,343,681 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,033 |
swift
|
//
// CustomerLoginViewController.swift
// myResturentApp
//
// Created by Mohit Kumar on 24/05/17.
// Copyright © 2017 Mohit Kumar. All rights reserved.
//
import UIKit
import FirebaseAuth
import FirebaseDatabase
class CustomerLoginViewController: UIViewController,UITextFieldDelegate {
@IBOutlet weak var emailTF: UITextField!
@IBOutlet weak var passwordTF: UITextField!
override func viewDidLoad() {
super.viewDidLoad()
customizeView()
self.hideKeyboardWhenTappedAround()
}
//MARK:- User Functions
func customizeView(){
emailTF = emailTF.makeModTF(textFieldName: emailTF, placeHolderName: "Email")
passwordTF = passwordTF.makeModTF(textFieldName: passwordTF, placeHolderName: "Password")
emailTF.delegate = self
passwordTF.delegate = self
}
@IBAction func loginBtnPressed(_ sender: UIButton) {
if let email = emailTF.text,let password = passwordTF.text{
FIRAuth.auth()?.signIn(withEmail: email, password: password, completion: { (user, error) in
if error != nil{
print(error as Any)
return
}
let userId = user?.uid
UserDefaults.standard.set(userId, forKey: "uid")
let vc = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "CustomerPanelVC")
self.present(vc, animated: true, completion: nil)
})
}
}
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
textField.resignFirstResponder()
return true
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "toResetCustomer",let destination = segue.destination as? ResetPasswordViewController{
destination.isCustomer = true
}
}
//MARK:- Actions
}
|
[
-1
] |
5eba0b8623060ad8c961bd7b15ce87a913a7824c
|
b6da25b27628c3bc17a517a3e19cb6d48da585fc
|
/CombineDecode2/CommentViewModel.swift
|
339b541b1ca442e14d7505efb0f9da1af06165d1
|
[] |
no_license
|
patsis/CombineDecode2
|
a34032672eab6b0ebf6b9b884d86a5c5c00e84b6
|
d8215ca10064ebb81a59e163e6fd5abe5d55d3a0
|
refs/heads/master
| 2020-07-11T20:03:16.488001 | 2019-08-27T06:18:09 | 2019-08-27T06:18:09 | 204,633,296 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,110 |
swift
|
//
// CommentViewModel.swift
// CombineDecode
//
// Created by Harry Patsis on 24/8/19.
// Copyright © 2019 Harry Patsis. All rights reserved.
//
import Foundation
import Combine
public class CommentViewModel: ObservableObject {
@Published var comments: Comments = []
private var cancellable: AnyCancellable?
func load() {
guard let url = URL(string: "https://jsonplaceholder.typicode.com/comments/") else {
return
}
self.cancellable = URLSession.shared.dataTaskPublisher(for: url)
.map { $0.data }
.decode(type: Comments.self, decoder: JSONDecoder())
.receive(on: DispatchQueue.main)
.replaceError(with: [])
.eraseToAnyPublisher()
.assign(to: \.comments, on: self)
// .sink(receiveCompletion: { completion in
// switch completion {
// case .finished:
// break
// case .failure(let error):
// fatalError(error.localizedDescription)
// }
// }, receiveValue: { comments in
// DispatchQueue.main.async {
// self.comments = comments
// }
// })
}
}
|
[
-1
] |
5a60b7a36b0dfcaa2be4c4206b4663820062f566
|
a4e60f2d3b982805ede69a1fd501c25bd1bda6ee
|
/AFinder/Modules/Onboarding/OnboardingProtocols.swift
|
a700feab177ca3a15c94ce404da4727dd875f089
|
[] |
no_license
|
Danixfun/AFinderMain
|
28dbbcbfd142b824a7fe141097df437ef4833990
|
6541a32d8c88b7b853e7e6811ae587d149f7a2f1
|
refs/heads/main
| 2023-03-03T02:56:10.193474 | 2021-02-08T23:53:02 | 2021-02-08T23:53:02 | 337,240,365 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,063 |
swift
|
//
// OnboardingProtocols.swift
// AFinder
//
// Created by Daniel Tejeda on 06/02/21.
//
//
import Foundation
import UIKit
protocol OnboardingViewProtocol: class {
// PRESENTER -> VIEW
var presenter: OnboardingPresenterProtocol? { get set }
func setUpViews()
func fixLayoutSubviews()
func updateStep(index: Int, direction: UIPageViewController.NavigationDirection)
}
protocol OnboardingWireFrameProtocol: class {
// PRESENTER -> WIREFRAME
static func createOnboardingModule() -> UIViewController
func dismiss(view: OnboardingViewProtocol)
func finish(view: OnboardingViewProtocol)
}
protocol OnboardingPresenterProtocol: class {
// VIEW -> PRESENTER
var view: OnboardingViewProtocol? { get set }
var interactor: OnboardingInteractorInputProtocol? { get set }
var wireFrame: OnboardingWireFrameProtocol? { get set }
func viewDidLoad()
func viewDidLayoutSubviews()
}
protocol OnboardingInteractorOutputProtocol: class {
// INTERACTOR -> PRESENTER
func updateStep(index: Int, direction: UIPageViewController.NavigationDirection)
func dismiss()
func finish()
}
protocol OnboardingInteractorInputProtocol: class {
// PRESENTER -> INTERACTOR
var presenter: OnboardingInteractorOutputProtocol? { get set }
var localDatamanager: OnboardingLocalDataManagerInputProtocol? { get set }
var remoteDatamanager: OnboardingRemoteDataManagerInputProtocol? { get set }
func setUpNotifications()
}
protocol OnboardingRemoteDataManagerInputProtocol: class {
// INTERACTOR -> REMOTEDATAMANAGER
var remoteRequestHandler: OnboardingRemoteDataManagerOutputProtocol? { get set }
}
protocol OnboardingRemoteDataManagerOutputProtocol: class {
// REMOTEDATAMANAGER -> INTERACTOR
}
protocol OnboardingLocalDataManagerInputProtocol: class {
// INTERACTOR -> LOCALDATAMANAGER
var localRequestHandler: OnboardingLocalDataManagerOutputProtocol? { get set }
}
protocol OnboardingLocalDataManagerOutputProtocol: class {
// LOCALDATAMANAGER -> INTERACTOR
}
|
[
-1
] |
565b50d61ec9f3a95b573c0c65b38f2b00dc4fe5
|
4eb31e8a426984be55ff2d8b5bd6163d4813fee1
|
/Classes/Compose/View/WBComposeToolbar.swift
|
f9559858a1e8e6b06d90165dadc1a61d52602661
|
[] |
no_license
|
yefenglei/WeiBo
|
75ad1ff078834add544f87c2bf53d5e169460ac7
|
285db5c7a7872c02eaf5f296408d48fe4d9cb146
|
refs/heads/master
| 2019-01-02T07:46:42.157811 | 2016-02-13T03:47:27 | 2016-02-13T03:47:27 | 41,958,699 | 1 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 4,655 |
swift
|
//
// WBComposeToolbar.swift
// WeiBo
//
// Created by 叶锋雷 on 15/10/7.
// Copyright © 2015年 叶锋雷. All rights reserved.
//
import UIKit
enum WBComposeToolbarButtonType:Int{
case HWComposeToolbarButtonTypeCamera, // 拍照
HWComposeToolbarButtonTypePicture, // 相册
HWComposeToolbarButtonTypeMention, // @
HWComposeToolbarButtonTypeTrend, // #
HWComposeToolbarButtonTypeEmotion // 表情
}
protocol WBComposeToolbarDelegate:NSObjectProtocol{
func composeToolbar(toolbar:WBComposeToolbar,didClickButton buttonType:WBComposeToolbarButtonType)
}
class WBComposeToolbar: UIView {
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
override func drawRect(rect: CGRect) {
// Drawing code
}
*/
var delegate:WBComposeToolbarDelegate?
var emotionButton:UIButton!
/** 是否要显示键盘按钮 */
private var _showKeyboardButton:Bool?
var showKeyboardButton:Bool!{
get{
if(self._showKeyboardButton == nil){
return false
}else{
return self._showKeyboardButton!
}
}
set{
self._showKeyboardButton=newValue
// 默认的图片名
var image="compose_emoticonbutton_background"
var highImage="compose_emoticonbutton_background_highlighted"
// 显示键盘图标
if(self.showKeyboardButton == true){
image = "compose_keyboardbutton_background"
highImage = "compose_keyboardbutton_background_highlighted"
}
// 设置图片
self.emotionButton.setImage(UIImage(named: image), forState: UIControlState.Normal)
self.emotionButton.setImage(UIImage(named: highImage), forState: UIControlState.Highlighted)
}
}
override init(frame: CGRect) {
super.init(frame: frame)
self.backgroundColor=UIColor(patternImage: UIImage(named: "compose_toolbar_background")!)
// 初始化按钮
self.setupBtn("compose_camerabutton_background", highImage: "compose_camerabutton_background_highlighted", type: WBComposeToolbarButtonType.HWComposeToolbarButtonTypeCamera)
self.setupBtn("compose_toolbar_picture", highImage: "compose_toolbar_picture_highlighted", type: WBComposeToolbarButtonType.HWComposeToolbarButtonTypePicture)
self.setupBtn("compose_mentionbutton_background", highImage: "compose_mentionbutton_background_highlighted", type: WBComposeToolbarButtonType.HWComposeToolbarButtonTypeMention)
self.setupBtn("compose_trendbutton_background", highImage: "compose_trendbutton_background_highlighted", type: WBComposeToolbarButtonType.HWComposeToolbarButtonTypeTrend)
self.emotionButton = self.setupBtn("compose_emoticonbutton_background", highImage: "compose_emoticonbutton_background_highlighted", type: WBComposeToolbarButtonType.HWComposeToolbarButtonTypeEmotion)
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
/// 创建一个按钮
///
/// - parameter image: 普通状态下的图片
/// - parameter highImage: 高亮状态下的图片
/// - parameter type: 按钮类型
///
/// - returns: 按钮
func setupBtn(image:String,highImage:String,type:WBComposeToolbarButtonType)->UIButton{
let btn=UIButton()
btn.setImage(UIImage(named: image), forState: UIControlState.Normal)
btn.setImage(UIImage(named: highImage), forState: UIControlState.Highlighted)
btn.addTarget(self, action: "btnClicked:", forControlEvents: UIControlEvents.TouchUpInside)
btn.tag = type.rawValue
self.addSubview(btn)
return btn
}
func btnClicked(btn:UIButton){
if(self.delegate != nil ){
self.delegate!.composeToolbar(self, didClickButton: WBComposeToolbarButtonType(rawValue: btn.tag)!)
}
}
override func layoutSubviews() {
super.layoutSubviews()
// 设置所有按钮的frame
let count=self.subviews.count
if(count == 0){
return
}
let btnW:CGFloat=self.width / CGFloat(count)
let btnH:CGFloat=self.height
for i:Int in 0...count-1{
let btn=self.subviews[i] as! UIButton
btn.y=0
btn.width=btnW
btn.x = CGFloat(i) * btnW
btn.height=btnH
}
}
}
|
[
-1
] |
da2ed99092bf722884f942815e2390d26ab3aae1
|
860d031dfeb08833df0b0bb7354c31a4f4602fbd
|
/demo/SFCaptchaInputControl/SFCaptchaInputControl/sources/SFCaptchaInputTextField.swift
|
c1f0250d1d60777d0c23671e9e60a98dc969c445
|
[
"MIT"
] |
permissive
|
AbnormalProgrammer/SFCaptchaInputControl
|
5bfec5fe9a8489ddf15f37015bc03e3ab25605bc
|
6d1393678c96cb8b8603b9e209336ef47ef132cb
|
refs/heads/main
| 2023-06-05T20:10:09.792645 | 2021-06-29T09:10:16 | 2021-06-29T09:10:16 | 381,299,993 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 3,474 |
swift
|
//
// LPInputCaptchaTextField.swift
// LovelyPet
//
// Created by Stroman on 2021/6/18.
//
import UIKit
class SFCaptchaInputTextField: UITextField {
// MARK: - lifecycle
override init(frame: CGRect) {
super.init(frame:frame)
self.customInitilizer()
self.installUI()
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
deinit {
print("\(type(of: self))释放了")
}
override func becomeFirstResponder() -> Bool {
let result:Bool = super.becomeFirstResponder()
if result == true {
self.addAnimation()
self.textChangedAction()
}
return result
}
override func resignFirstResponder() -> Bool {
let result:Bool = super.resignFirstResponder()
if result == true {
self.removeAnimation()
}
return result
}
override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
var result:UIView? = super.hitTest(point, with: event)
if result != nil {
result = self.focusButton
}
return result
}
// MARK: - custom methods
private func customInitilizer() -> Void {
self.backgroundColor = UIColor.clear
}
private func installUI() -> Void {
self.addSubview(self.cursorLabel)
self.addSubview(self.focusButton)
self.cursorLabel.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.centerX.equalToSuperview()
make.width.equalTo(1.4)
make.height.equalTo(24)
}
self.focusButton.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
}
private func addAnimation() -> Void {
self.removeAnimation()
let animation:CAKeyframeAnimation = CAKeyframeAnimation.init(keyPath: "opacity")
animation.duration = 1
animation.values = [1,1,0,0]
animation.keyTimes = [0,0.5,0.5,1]
animation.repeatCount = HUGE
self.cursorLabel.layer.add(animation, forKey: "cursor")
}
private func removeAnimation() -> Void {
self.cursorLabel.layer.removeAllAnimations()
self.cursorLabel.layer.opacity = 0
}
private func textChangedAction() -> Void {
let offset:CGFloat = 8
if self.text != nil && self.text != "" {
self.cursorLabel.snp.updateConstraints { make in
make.centerX.equalToSuperview().offset(offset)
}
} else {
self.cursorLabel.snp.updateConstraints { make in
make.centerX.equalToSuperview()
}
}
}
// MARK: - public interfaces
// MARK: - actions
@objc private func focusButtonAction(_ sender:UIButton) -> Void {
self.becomeFirstResponder()
}
// MARK: - accessors
lazy private var focusButton:UIButton = {
let result:UIButton = UIButton.init(type: .custom)
result.addTarget(self, action: #selector(focusButtonAction(_:)), for: .touchUpInside)
return result
}()
lazy private var cursorLabel:UILabel = {
let result:UILabel = UILabel.init()
result.backgroundColor = UIColor.colorFromHex(0x43D3ED)
result.textAlignment = .center
result.layer.opacity = 0
result.sizeToFit()
return result
}()
// MARK: - delegates
}
|
[
-1
] |
007243c8f8e6f3210f162f4de3a29d48a4f8b38d
|
ecc044c478bf5fa6e5cb97ff926041a17c6094dd
|
/SpaceXTests/Source/UI/Filters/FiltersTableViewDataSourceTests.swift
|
150d702e78a1fb5f3bb883b0de78b9d40b8aca42
|
[] |
no_license
|
alexstergiou/SpaceX-coding-demo
|
009e80949e4fe39915f96e4206e616449172a6bc
|
949ef4307bc7f55b45b5779f0df099afdb14ccd7
|
refs/heads/main
| 2023-07-03T21:30:16.476041 | 2021-08-09T13:23:28 | 2021-08-09T13:23:28 | 363,399,109 | 1 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,798 |
swift
|
//
// FiltersTableViewDataSourceTests.swift
// SpaceXTests
//
// Created by Alex Stergiou on 01/05/2021.
//
import XCTest
@testable import SpaceX
final class MockFiltersTableViewDataSourceResponder: FiltersTableViewDataSourceResponder {
var filtersChangedCalled: Bool = false
func filtersChanged() {
filtersChangedCalled = true
}
}
final class FiltersTableViewDataSourceTests: XCTestCase {
var filtersManager: MockFiltersManager!
var subject: FiltersTableViewDataSource!
var dateFormatter: DateFormatter!
override func setUpWithError() throws {
filtersManager = MockFiltersManager()
dateFormatter = DateFormatter()
subject = FiltersTableViewDataSource(filtersManager: filtersManager,
dateFormatter: dateFormatter)
}
override func tearDownWithError() throws {
subject = nil
filtersManager = nil
dateFormatter = nil
}
func testSetup() {
let tableView: UITableView = UITableView()
subject.setup(tableView: tableView)
XCTAssertNotNil(tableView.dataSource)
XCTAssertNotNil(tableView.tableFooterView)
}
func testTableViewMethods() {
let tableView: UITableView = UITableView()
subject.setup(tableView: tableView)
XCTAssertEqual(subject.tableView(tableView, numberOfRowsInSection: 0), 0)
filtersManager.filters = [DurationFilter(), LaunchSuccessFilter()]
subject = FiltersTableViewDataSource(filtersManager: filtersManager,
dateFormatter: dateFormatter)
subject.setup(tableView: tableView)
XCTAssertEqual(subject.tableView(tableView, numberOfRowsInSection: 0), 2)
guard let durationCell = subject.tableView(tableView, cellForRowAt: IndexPath(row: 0, section: 0)) as? StartEndDateTableViewCell else {
XCTFail()
return
}
XCTAssertNotNil(durationCell.titleLabel.text)
guard let switchCell = subject.tableView(tableView, cellForRowAt: IndexPath(row: 1, section: 0)) as? TitleSwitchTableViewCell else {
XCTFail()
return
}
XCTAssertNotNil(switchCell.titleLabel.text)
}
func testDateMethods() {
let date1: Date = Date.with(year: 2021)
XCTAssertEqual(subject.startText(date: date1), "Start: 2021")
let date2: Date = Date.with(year: 2022)
XCTAssertEqual(subject.endText(date: date2), "End: 2022")
}
func testResponder() {
let responder: MockFiltersTableViewDataSourceResponder = MockFiltersTableViewDataSourceResponder()
subject.responder = responder
subject.valueChanged()
XCTAssertTrue(responder.filtersChangedCalled)
}
}
|
[
-1
] |
c279ac50c0530fc9836e091911fba11b1891371b
|
28fbfb57915b8938a7115e8ff5492767eca5c56f
|
/BasicIOS-tutorial-CoreData/BasicIOS-tutorial-CoreData/Controller/Home/Cells/HomeCell.swift
|
87bc23ec4d0104462d92d19c7f2dc7838ab0c322
|
[] |
no_license
|
kieubakhoi/BasicIOS-tutorial
|
990a4270bcce47455e33ea3736dda08e6984002c
|
44e4869626bcc9b92626333adf6738d82e50a81c
|
refs/heads/main
| 2023-07-07T14:05:43.865266 | 2021-08-04T23:47:01 | 2021-08-04T23:47:01 | 390,785,025 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 575 |
swift
|
//
// HomeCell.swift
// BasicIOS-tutorial-CoreData
//
// Created by Apple on 05/08/2021.
//
import UIKit
class HomeCell: UITableViewCell {
@IBOutlet weak var nameLabel: UILabel!
@IBOutlet weak var genderLabel: UILabel!
@IBOutlet weak var ageLabel: UILabel!
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
}
|
[
281217,
384970,
381943,
200533,
278583,
155576,
113529,
200508
] |
db1832846752e354f310ac0e4f4a91d47dc224e7
|
f09b9b7a38581d058d0da33b3d8d12d6b7649318
|
/Specs/TFL/generated/Swift/Sources/Models/Instruction.swift
|
2e422be5f2ceabee88b168a5f974663f5c623054
|
[
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
yonaskolb/SwagGen
|
bf89fe538c6514465742be2b4799c91e6de32d1a
|
61877cb860d59cdf4c2cc747354ec9d8b397d588
|
refs/heads/master
| 2023-08-30T00:59:22.511375 | 2023-06-19T23:13:33 | 2023-06-19T23:13:33 | 75,459,721 | 631 | 182 |
MIT
| 2023-06-19T23:13:35 | 2016-12-03T07:41:07 |
Swift
|
UTF-8
|
Swift
| false | false | 1,543 |
swift
|
//
// Generated by SwagGen
// https://github.com/yonaskolb/SwagGen
//
import Foundation
public class Instruction: APIModel {
public var detailed: String?
public var steps: [InstructionStep]?
public var summary: String?
public init(detailed: String? = nil, steps: [InstructionStep]? = nil, summary: String? = nil) {
self.detailed = detailed
self.steps = steps
self.summary = summary
}
public required init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: StringCodingKey.self)
detailed = try container.decodeIfPresent("detailed")
steps = try container.decodeArrayIfPresent("steps")
summary = try container.decodeIfPresent("summary")
}
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: StringCodingKey.self)
try container.encodeIfPresent(detailed, forKey: "detailed")
try container.encodeIfPresent(steps, forKey: "steps")
try container.encodeIfPresent(summary, forKey: "summary")
}
public func isEqual(to object: Any?) -> Bool {
guard let object = object as? Instruction else { return false }
guard self.detailed == object.detailed else { return false }
guard self.steps == object.steps else { return false }
guard self.summary == object.summary else { return false }
return true
}
public static func == (lhs: Instruction, rhs: Instruction) -> Bool {
return lhs.isEqual(to: rhs)
}
}
|
[
-1
] |
9f35db4193d00dc84b297aa99b94e0a807cc399d
|
2df44eb88e7c0812956ed7029652072bc846d305
|
/Own/CatOrDog/CatOrDog/SceneDelegate.swift
|
2f15aa924246ccc61dc3c5477b4e49174235cde4
|
[] |
no_license
|
dimaS0611/IOS_study
|
00c6d48dd607164e15e5644b9dd8d70f51cbf7af
|
09af2ff2e82679673cb7134e393af82b021cd870
|
refs/heads/main
| 2023-06-11T15:47:41.804730 | 2021-06-16T18:08:00 | 2021-06-16T18:08:00 | 374,796,221 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,297 |
swift
|
//
// SceneDelegate.swift
// CatOrDog
//
// Created by Dzmitry Semenovich on 16.06.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,
270687,
262497,
418145,
262501,
213354,
246124,
262508,
262512,
213374,
385420,
393613,
262551,
262553,
385441,
385444,
262567,
385452,
262574,
393649,
385460,
262587,
344512,
262593,
360917,
369119,
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,
165092,
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,
337601,
403139,
337607,
419528,
419531,
272083,
394967,
419543,
419545,
345819,
419548,
419551,
345829,
419560,
337643,
419564,
337647,
370416,
337671,
362249,
362252,
395022,
362256,
321300,
345888,
362274,
378664,
354107,
345916,
354112,
370504,
329545,
345932,
370510,
354132,
247639,
337751,
370520,
313181,
182110,
354143,
354157,
345965,
345968,
345971,
345975,
403321,
1914,
354173,
395148,
247692,
337809,
247701,
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,
331124,
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,
250012,
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,
340859,
324476,
430973,
119675,
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,
169002,
357419,
209966,
209969,
209973,
209976,
209980,
209988,
209991,
431180,
209996,
341072,
349268,
177238,
250968,
210011,
373853,
341094,
210026,
210028,
210032,
349296,
210037,
210042,
210045,
349309,
152704,
349313,
160896,
210053,
210056,
349320,
259217,
373905,
210068,
210072,
210078,
210081,
210085,
210089,
210096,
210100,
324792,
210108,
357571,
210116,
210128,
210132,
333016,
210139,
210144,
218355,
218361,
275709,
128254,
275713,
242947,
275717,
275723,
333075,
349460,
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,
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,
261166,
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,
359650,
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
] |
f2a0682806f545ca442395d5b4658427255fa230
|
760cd75e1ceb377656812ffbe532f0b35b700507
|
/CricPlayerInfoTC/CricPlayerInfoTC/Models/PlayerInfo.swift
|
1f281d245a9c7d3e4f73ab56a86a03fb66ee5025
|
[] |
no_license
|
Arunachalam0007/SHA-IOS-App-Exp
|
7b7ee3c0b766e4036a36821da77afb8ecef0884c
|
ac1e465f0d88bf67c74136043badd2b10ae7fd86
|
refs/heads/main
| 2023-03-27T03:51:08.924451 | 2021-04-01T13:43:40 | 2021-04-01T13:43:40 | 350,362,467 | 0 | 0 | null | 2021-03-23T16:32:48 | 2021-03-22T13:54:58 | null |
UTF-8
|
Swift
| false | false | 250 |
swift
|
//
// PlayerInfo.swift
// CricPlayerInfoTC
//
// Created by ArunSha on 23/03/21.
//
import Foundation
struct PlayerInfo {
var playerProfile : [String] = [ "Raina Four", "Raina Six", "Raina 100", "Raina Catch", "Raina Wicket", "Raina Out"]
}
|
[
-1
] |
90bb4ef891788d7bffb0ebc2fb8107f03f1b08e9
|
70ca7e148fb571fbb4c5e6c0837fb198b137341b
|
/Turing/Turing/TuringVM.swift
|
fc7740f2132f26d625bf3119548bf56565d5866d
|
[] |
no_license
|
jbredd/SwiftTuringMachine
|
d7492fc7d3a0b9e7265817d29d819780989f86c6
|
b3140f233b356e5bc2d9eee64f5458e90bbdcbf7
|
refs/heads/master
| 2022-12-19T11:18:10.619031 | 2020-09-21T17:55:54 | 2020-09-21T17:55:54 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,121 |
swift
|
//
// TuringVM.swift
// Turing
//
// Created by Joshua Shen on 3/6/18.
// Copyright © 2018 Joshua Shen. All rights reserved.
//
import Foundation
class TuringVM {
var ttuplesArray: [TTuple]
var tapeAsString = " "
var numSteps = 0
var key = [String: TTuple]()
init(ttuplesArray: [TTuple]) {
self.ttuplesArray = ttuplesArray
for t in ttuplesArray {
let csic = "\(t.currentState) \(t.inputChar)"
key[csic] = t
}
}
func nakedTupleReport()-> String {
var result = "cs ic ns oc di"
for t in ttuplesArray {
result += "\n\(t.nakedTuple())"
}
return result
}
func tapeAsString(_ tape: [String])-> String {
var result = ""
for s in tape {result += s}
return result
}
func runTuring(initialTape: String, initialState: Int, initialHead: Int)-> (numberSteps: Int, finalTape: String, trace: [String]) {
self.tapeAsString = initialTape
var tapeAsStrings = tapeAsString.map{String($0)}
var head = initialHead
var state = initialState
var csic = "\(state) \(tapeAsStrings[head])"
var trace = [String]()
var step = " "
while key[csic] != nil || head > tapeAsStrings.count {
numSteps += 1
let tuple = key[csic]!
step = "\(numSteps): {cs: \(tuple.currentState), ic: \(tuple.inputChar),ns: \(tuple.newState),oc: \(tuple.outputChar),di: \(tuple.direction)} "
tapeAsStrings[head] = String(tuple.outputChar)
state = tuple.newState
if tuple.direction == Direction.right {head += 1} else {head += -1}
var tapeCopy = tapeAsStrings
tapeCopy[head] = "[\(tapeCopy[head])]"
step += "\(tapeAsString(tapeCopy))"
trace.append(step)
tapeCopy[head] = "\(tapeAsStrings[head])"
csic = "\(state) \(tapeAsStrings[head])"
}
return (numSteps, tapeAsString(tapeAsStrings), trace)
}
}
|
[
-1
] |
52883c15601cd9c38f289edb74c73eee205511ba
|
ad250744e26e2bc3d59b3a24169a43a18a74528d
|
/MyBloodBank/AppDelegate.swift
|
9f3f1ab111a7e9bb834e3ecdde4f370e07053e80
|
[] |
no_license
|
Talha-Faiz/BloodBankApp
|
f17b91947aa70e88b26206eee76821ed62410930
|
f8cb08c42884ce646354a058a3fb58f45163e91b
|
refs/heads/master
| 2021-01-02T01:49:53.061572 | 2020-03-02T20:47:17 | 2020-03-02T20:47:17 | 239,441,287 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,602 |
swift
|
//
// AppDelegate.swift
// MyBloodBank
//
// Created by Talha Faiz on 28/01/2020.
// Copyright © 2020 Talha Faiz. All rights reserved.
//
import UIKit
import Firebase
import IQKeyboardManagerSwift
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
FirebaseApp.configure()
IQKeyboardManager.shared.enable = true
IQKeyboardManager.shared.enableAutoToolbar = true
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.
}
}
|
[
333850,
346139,
344102,
163891,
217157,
243781,
327756,
286800,
374864,
338004,
342111,
368735,
342133,
250002,
250004,
329885,
333997,
430256,
256191,
327871,
350410,
180431,
350416,
350422,
350425,
268507,
334045,
356578,
387301,
346343,
338152,
327914,
350445,
346355,
321786,
350458,
336123,
350461,
350464,
325891,
350467,
350475,
350480,
350486,
338199,
350490,
325917,
350493,
350498,
338211,
350504,
350509,
248111,
332080,
340275,
336180,
332090,
332097,
332106,
190796,
334161,
250199,
321879,
250202,
332125,
250210,
246123,
348525,
354673,
321910,
332152,
334203,
250238,
340379,
338352,
334262,
334275,
326084,
330189,
338381,
338386,
338403,
334311,
338409,
328177,
334321,
328179,
328182,
340472,
328189,
324094,
328192,
328206,
324111,
186897,
342545,
340500,
324117,
334358,
420376,
342554,
334363,
332324,
197159,
324139,
356907,
324142,
334384,
324149,
334394,
324155,
188987,
324160,
219718,
324173,
324176,
352856,
332380,
174695,
248425,
191084,
334468,
148105,
326290,
340627,
184982,
342679,
98968,
342683,
332453,
332459,
332463,
332471,
336567,
328378,
223934,
334528,
328386,
332483,
332486,
332493,
189153,
338660,
338664,
342766,
340718,
332533,
207619,
338700,
326416,
336659,
199452,
336675,
215853,
348978,
326451,
340789,
326454,
244540,
326460,
326467,
328515,
127814,
244551,
328519,
326473,
328522,
336714,
338763,
326477,
336711,
326485,
326490,
201579,
201582,
326510,
211825,
330610,
201588,
324475,
328573,
324478,
324481,
342915,
324484,
324487,
324492,
236430,
324495,
330642,
252822,
158618,
324510,
324513,
211884,
324524,
340909,
5046,
324538,
324541,
340939,
340941,
248792,
340957,
340963,
359407,
244726,
330748,
328702,
330760,
328714,
330768,
209943,
336921,
336925,
345118,
250914,
209965,
209968,
209971,
209975,
339001,
209987,
209990,
248904,
330826,
341071,
248914,
250967,
339036,
341091,
210027,
345199,
210039,
210044,
152703,
160895,
384135,
330889,
384139,
210071,
337047,
248985,
339097,
384151,
210077,
345246,
210080,
384160,
210084,
210088,
210095,
337071,
210098,
337075,
244916,
249014,
384188,
210115,
332997,
326855,
244937,
384201,
343244,
384208,
333009,
146642,
330965,
333014,
210138,
384224,
343270,
351466,
384246,
251128,
384275,
333078,
251160,
384283,
245020,
384288,
245029,
208166,
347437,
199988,
251189,
337222,
331088,
337234,
263508,
331093,
343393,
208227,
251235,
345448,
333162,
343409,
234866,
378227,
154999,
333175,
327034,
249218,
245127,
181643,
136590,
245136,
249234,
112020,
181654,
245142,
245145,
343450,
245148,
245151,
245154,
245157,
181670,
337329,
181684,
181690,
146876,
181696,
327107,
384453,
181703,
327115,
327117,
366034,
343507,
337365,
339417,
249308,
333284,
339434,
343539,
210420,
337398,
337415,
329226,
345625,
366117,
339503,
265778,
206395,
333386,
333399,
333413,
327275,
222830,
138864,
339588,
345736,
159374,
339601,
245409,
345762,
337592,
337599,
333511,
339662,
358099,
245460,
181977,
224993,
245475,
224999,
337642,
245483,
337645,
141051,
225020,
337659,
339710,
225025,
337668,
339721,
321299,
333594,
345887,
225066,
225070,
358191,
225073,
399159,
325440,
341829,
325446,
354117,
323402,
341834,
341843,
337750,
358234,
345970,
327539,
341876,
358259,
345974,
333689,
325504,
333698,
339844,
333708,
337808,
247700,
329623,
225180,
333724,
118691,
327589,
337833,
184244,
337844,
358339,
346057,
247759,
329697,
358371,
327654,
247789,
380918
] |
dcda6dfada86c8f3e64ea4a2997d95c09f60d5e0
|
7865a540e2e3102beebf36820a3548b495a2dc37
|
/CoffeeOrder_sampel/FirebaseListener/DrinkListener.swift
|
8daaacb9979710fcf2b7289d972fc3147a2098b7
|
[] |
no_license
|
jin-aiit-a1824jj/ios13-swiftUI-sample-coffee_order_app_client
|
06d02975f1c679da63972d345a41eeb864bf3ca1
|
15c7d47c6e1c2afc50a9fefcb55879ff9d874e2b
|
refs/heads/master
| 2022-05-22T07:19:55.904986 | 2020-04-16T01:59:32 | 2020-04-16T01:59:32 | 256,084,546 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,546 |
swift
|
//
// DrinkListener.swift
// CoffeeOrder_sampel
//
// Created by JONGWOO JIN on 2020/04/15.
// Copyright © 2020 JONGWOO JIN. All rights reserved.
//
import Foundation
import Firebase
class DrinkListener: ObservableObject {
@Published var drinks: [Drink] = []
init() {
downloadDrinks()
}
func downloadDrinks() {
FirebaseReference(.Menu).getDocuments { (snapshot, error) in
guard let snapshot = snapshot else { return }
if !snapshot.isEmpty {
self.drinks = DrinkListener.drinkFromDictionary(snapshot)
}
}
}
static func drinkFromDictionary(_ snapshot: QuerySnapshot) -> [Drink] {
var allDrinks: [Drink] = []
for snapshot in snapshot.documents {
let drinkData = snapshot.data()
let drinkItem = Drink(id: drinkData[kID] as? String ?? UUID().uuidString,
name: drinkData[kNAME] as? String ?? "unknown",
imageName: drinkData[kIMAGENAME] as? String ?? "unknown",
category: Category(rawValue: drinkData[kCATEGORY] as? String ?? "cold") ?? .cold,
description:drinkData[kDESCRIPTION] as? String ?? "Description is missing" ,
price: drinkData[kPRICE] as? Double ?? 0.0)
allDrinks.append(drinkItem)
}
return allDrinks
}
}
|
[
-1
] |
c144e16e43fa65584205ceca40d3dcf3ad77dcb8
|
ae3cb275a3387f028a99f641a3335c661dc8d1ab
|
/Entities/Monsters/DeathCap.swift
|
ee75670a618e2fc3aea97c1d89a1730e7700ec17
|
[] |
no_license
|
gviegas/of-witches-and-mazes
|
5e8bc8147ea99042ffdac5c0773529f147a2cd9b
|
52530f4e14d2a508f6ec57710eaad6a89781d2d0
|
refs/heads/main
| 2023-02-27T07:00:08.838569 | 2021-02-01T04:31:00 | 2021-02-01T04:31:00 | 334,824,742 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 6,340 |
swift
|
//
// DeathCap.swift
// Of Witches and Mazes
//
// Created by Gustavo C. Viegas on 1/9/19.
// Copyright © 2019 Gustavo C. Viegas. All rights reserved.
//
import SpriteKit
/// The Death Cap entity, a monster.
///
class DeathCap: Monster, TextureUser, AnimationUser {
static var animationKeys: Set<String> {
return DeathCapAnimationSet.animationKeys.union(DeathCapAuraAnimation.animationKeys)
}
static var textureNames: Set<String> {
return DeathCapAnimationSet.textureNames
.union(DeathCapAuraAnimation.textureNames)
.union([PortraitSet.deathCap.imageName])
}
/// Creates a new instance with the given level of experience.
///
/// - Parameter levelOfExperience: The entity's level of experience.
///
init(levelOfExperience: Int) {
let data = DeathCapData(levelOfExperience: levelOfExperience)
super.init(data: data, levelOfExperience: levelOfExperience)
component(ofType: ProgressionComponent.self)?.grade = 1.0
// StateComponent
addComponent(StateComponent(initialState: MonsterInitialState.self,
states: [(MonsterInitialState(entity: self), nil),
(MonsterStandardState(entity: self), .standard),
(MonsterDeathState(entity: self), .death),
(MonsterChaseState(entity: self), nil),
(MonsterStayState(entity: self), nil),
(MonsterQuelledState(entity: self), .quelled)]))
// LootComponent
addComponent(LootComponent(lootTable: UniversalLootTable(quality: .typical, level: levelOfExperience)))
// AuraComponent
let interval: TimeInterval = 1.5
let duration: TimeInterval = interval + 1.0 / 30.0
let damage = Damage(scale: 0.85, ratio: 0, level: levelOfExperience, modifiers: [:], type: .natural,
sfx: nil)
let dot = PoisonCondition(tickTime: interval, tickDamage: damage, isExclusive: false,
isResettable: true, duration: duration, source: self)
let slow = HamperCondition(slowFactor: 0.65, isExclusive: true, isResettable: true,
duration: duration, source: self, color: nil, sfx: nil)
let aura = Aura(radius: 128.0, refreshTime: interval, alwaysInFront: true, affectedByDispel: true,
duration: nil, damage: nil, conditions: [dot, slow],
animation: DeathCapAuraAnimation.instance, sfx: nil)
addComponent(AuraComponent(interaction: Interaction.monsterEffect, aura: aura))
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
/// The `MonsterData` defining the data associated with the `DeathCap` entity.
///
fileprivate class DeathCapData: MonsterData {
let name: String
let size: CGSize
let speed: MovementSpeed
let physicsShape: PhysicsShape
let progressionValues: EntityProgressionValues
let animationSet: DirectionalAnimationSet
let portrait: Portrait
let shadow: (size: CGSize, image: String)?
let voice: (sound: SoundFX, volubleness: VoiceComponent.Volubleness)?
/// Creates a new instance with the given level of experience.
///
/// - Parameter levelOfExperience: The entity's level of experience.
///
init(levelOfExperience: Int) {
name = "Death Cap"
size = CGSize(width: 64.0, height: 64.0)
speed = .verySlow
physicsShape = .rectangle(size: CGSize(width: 32.0, height: 32.0), center: CGPoint(x: 0, y: -16.0))
progressionValues = DeathCapProgressionValues.instance
animationSet = DeathCapAnimationSet()
portrait = PortraitSet.deathCap
shadow = (CGSize(width: 24.0, height: 16.0), "Shadow")
voice = (SoundFXSet.Voice.lazyBeast, .normal)
}
}
/// The `EntityProgressionValues` subclass defining the progression values of the `DeathCap` entity.
///
fileprivate class DeathCapProgressionValues: EntityProgressionValues {
/// The instance of the class.
///
static let instance = DeathCapProgressionValues()
private init() {
let abilityValues = [
Ability.strength: ProgressionValue(initialValue: 2, rate: 0.25),
Ability.agility: ProgressionValue(initialValue: 1, rate: 0.1),
Ability.intellect: ProgressionValue(initialValue: 3, rate: 0.35),
Ability.faith: ProgressionValue(initialValue: 1, rate: 0.1)]
let healthPointsValue = ProgressionValue(initialValue: 15, rate: 7.6)
let defenseValue = ProgressionValue(initialValue: 10, rate: 0)
let resistancevalue = ProgressionValue(initialValue: 20, rate: 0)
super.init(abilityValues: abilityValues, healthPointsValue: healthPointsValue, skillPointsValue: nil,
criticalHitValues: nil, damageCausedValues: nil, damageTakenValues: nil,
defenseValue: defenseValue, resistanceValue: resistancevalue, mitigationValue: nil)
}
}
/// The `TextureAnimation` subclass defining the animation for the `DeathCap`s aura.
///
fileprivate class DeathCapAuraAnimation: TextureAnimation, TextureUser, AnimationUser {
private static let key = "DeathCapAuraAnimation"
static var animationKeys: Set<String> {
return [key]
}
static var textureNames: Set<String> {
let cloud = ImageArray.createFrom(baseName: "Toxic_Cloud_", first: 1, last: 3)
return Set<String>(cloud)
}
/// The instance of the class.
///
static var instance: Animation {
return AnimationSource.getAnimation(forKey: key) ?? DeathCapAuraAnimation()
}
private init() {
let images = ImageArray.createFrom(baseName: "Toxic_Cloud_", first: 1, last: 3)
super.init(images: images, replaceable: false, flipped: false, repeatForever: true,
fadeInDuration: 3.0, fadeOutDuration: 3.0)
AnimationSource.storeAnimation(self, forKey: DeathCapAuraAnimation.key)
}
}
|
[
-1
] |
93711b114e35b029d24644ec67305f9a18118e73
|
f6634f782efb85770fa62436a7a25e0a14068487
|
/Midterm/workout/workout/ViewController.swift
|
d24782a16d13d170e4d6032dade633643f661b06
|
[] |
no_license
|
dmcclure40/MobileApp
|
d79bcac635a5893705747fce4b0e4d1810d0136d
|
7bea9bdf2a92d19e4faa81761e635995cd9ac66f
|
refs/heads/master
| 2020-04-18T08:34:41.989352 | 2016-12-13T23:09:07 | 2016-12-13T23:09:07 | 66,386,997 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 9,800 |
swift
|
//
// ViewController.swift
// workout
//
// Created by Davis Mcclure on 10/13/16.
// Copyright © 2016 Epic Octopus. All rights reserved.
//
import UIKit
class ViewController: UIViewController, UITextFieldDelegate {
@IBOutlet weak var workMins: UITextField!
@IBOutlet weak var workType: UISegmentedControl!
@IBOutlet weak var milesWorked: UILabel!
@IBOutlet weak var calsBurned: UILabel!
@IBOutlet weak var workImage: UIImageView!
@IBOutlet weak var weeklyWork: UISwitch!
func textFieldShouldReturn(textField: UITextField) -> Bool {
textField.resignFirstResponder()
return true
}
@IBAction func calcWork(sender: UIButton) {
if workType.selectedSegmentIndex == 0{
if weeklyWork.on{
weeklyRun()
} else{
calcRun()
}
}
else if workType.selectedSegmentIndex == 1{
if weeklyWork.on{
weeklySwim()
}else{
calcSwim()
}
}
else if workType.selectedSegmentIndex == 2{
if weeklyWork.on{
weeklyBike()
}else{
calcBike()
}
}
}
func calcRun(){
var minsWorked:Float //workout time
let time:Float = 10.00
let minmMins = Float(workMins.text!)
if minmMins < 30 {
//create a UIAlertController object
let alert=UIAlertController(title: "Warning", message: "The amount of time must be greater than 30", preferredStyle: UIAlertControllerStyle.Alert)
//create a UIAlertAction object for the button
let cancelAction=UIAlertAction(title: "Cancel", style:UIAlertActionStyle.Cancel, handler: nil)
alert.addAction(cancelAction) //adds the alert action to the alert object
let okAction=UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: {action in
self.workMins.text="30"
})
alert.addAction(okAction)
presentViewController(alert, animated: true, completion: nil)
minsWorked = 30.00
} else {
minsWorked = Float(workMins.text!)!
}
let miles:Float=minsWorked/time
let cals=miles*100
let nf = NSNumberFormatter()
nf.numberStyle = .DecimalStyle
milesWorked.text=nf.stringFromNumber(miles)
calsBurned.text=nf.stringFromNumber(cals)
}
func weeklyRun(){
var minsWorked:Float //workout time
let time:Float = 10.00
let minmMins = Float(workMins.text!)
if minmMins < 30 {
//create a UIAlertController object
let alert=UIAlertController(title: "Warning", message: "The amount of time must be greater than 30", preferredStyle: UIAlertControllerStyle.Alert)
//create a UIAlertAction object for the button
let cancelAction=UIAlertAction(title: "Cancel", style:UIAlertActionStyle.Cancel, handler: nil)
alert.addAction(cancelAction) //adds the alert action to the alert object
let okAction=UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: {action in
self.workMins.text="30"
})
alert.addAction(okAction)
presentViewController(alert, animated: true, completion: nil)
minsWorked = 30.00
} else {
minsWorked = Float(workMins.text!)!
}
let miles:Float=(minsWorked/time)*5
let cals=(miles*100)*5
let nf = NSNumberFormatter()
nf.numberStyle = .DecimalStyle
milesWorked.text=nf.stringFromNumber(miles)
calsBurned.text=nf.stringFromNumber(cals)
}
func calcSwim(){
var minsWorked:Float //workout time
let time:Float = 30.00
let minmMins = Float(workMins.text!)
if minmMins < 30 {
//create a UIAlertController object
let alert=UIAlertController(title: "Warning", message: "The amount of time must be greater than 30", preferredStyle: UIAlertControllerStyle.Alert)
//create a UIAlertAction object for the button
let cancelAction=UIAlertAction(title: "Cancel", style:UIAlertActionStyle.Cancel, handler: nil)
alert.addAction(cancelAction) //adds the alert action to the alert object
let okAction=UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: {action in
self.workMins.text="30"
})
alert.addAction(okAction)
presentViewController(alert, animated: true, completion: nil)
minsWorked = 30.00
} else {
minsWorked = Float(workMins.text!)!
}
let miles:Float=minsWorked/time
let cals=miles*210
let nf = NSNumberFormatter()
milesWorked.text=nf.stringFromNumber(miles)
calsBurned.text=nf.stringFromNumber(cals)
}
func weeklySwim(){
var minsWorked:Float //workout time
let time:Float = 30.00
let minmMins = Float(workMins.text!)
if minmMins < 30 {
//create a UIAlertController object
let alert=UIAlertController(title: "Warning", message: "The amount of time must be greater than 30", preferredStyle: UIAlertControllerStyle.Alert)
//create a UIAlertAction object for the button
let cancelAction=UIAlertAction(title: "Cancel", style:UIAlertActionStyle.Cancel, handler: nil)
alert.addAction(cancelAction) //adds the alert action to the alert object
let okAction=UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: {action in
self.workMins.text="30"
})
alert.addAction(okAction)
presentViewController(alert, animated: true, completion: nil)
minsWorked = 30.00
} else {
minsWorked = Float(workMins.text!)!
}
let miles:Float=(minsWorked/time)*5
let cals=(miles*210)*5
let nf = NSNumberFormatter()
milesWorked.text=nf.stringFromNumber(miles)
calsBurned.text=nf.stringFromNumber(cals)
}
func calcBike(){
var minsWorked:Float //workout time
let time:Float = 4.00
let minmMins = Float(workMins.text!)
if minmMins < 30 {
//create a UIAlertController object
let alert=UIAlertController(title: "Warning", message: "The amount of time must be greater than 30", preferredStyle: UIAlertControllerStyle.Alert)
//create a UIAlertAction object for the button
let cancelAction=UIAlertAction(title: "Cancel", style:UIAlertActionStyle.Cancel, handler: nil)
alert.addAction(cancelAction) //adds the alert action to the alert object
let okAction=UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: {action in
self.workMins.text="30"
})
alert.addAction(okAction)
presentViewController(alert, animated: true, completion: nil)
minsWorked = 30.00 } else {
minsWorked = Float(workMins.text!)!
}
let miles:Float=minsWorked/time
let cals=miles*34
let nf = NSNumberFormatter()
milesWorked.text=nf.stringFromNumber(miles)
calsBurned.text=nf.stringFromNumber(cals)
}
func weeklyBike(){
var minsWorked:Float //workout time
let time:Float = 4.00
let minmMins = Float(workMins.text!)
if minmMins < 30 {
//create a UIAlertController object
let alert=UIAlertController(title: "Warning", message: "The amount of time must be greater than 30", preferredStyle: UIAlertControllerStyle.Alert)
//create a UIAlertAction object for the button
let cancelAction=UIAlertAction(title: "Cancel", style:UIAlertActionStyle.Cancel, handler: nil)
alert.addAction(cancelAction) //adds the alert action to the alert object
let okAction=UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: {action in
self.workMins.text="30"
})
alert.addAction(okAction)
presentViewController(alert, animated: true, completion: nil)
minsWorked = 30.00
} else {
minsWorked = Float(workMins.text!)!
}
let miles:Float=(minsWorked/time)*5
let cals=(miles*34)*5
let nf = NSNumberFormatter()
milesWorked.text=nf.stringFromNumber(miles)
calsBurned.text=nf.stringFromNumber(cals)
}
func updateImage(){
if workType.selectedSegmentIndex == 0 {
workImage.image=UIImage(named: "Run.png")
}
else if workType.selectedSegmentIndex == 1 {
workImage.image=UIImage(named: "Swim.png")
}
else if workType.selectedSegmentIndex == 2 {
workImage.image=UIImage(named: "Bike.png")
}
}
@IBAction func pickWorkout(sender: UISegmentedControl) {
updateImage()
}
override func viewDidLoad() {
super.viewDidLoad()
workMins.delegate=self
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
|
[
-1
] |
9d8a096e42aee1ae2c1f38560fdfafd2847bb38d
|
c5bec81f49e00145753a130224a78feb1ffe1b96
|
/PersonalityTestTests/ViewModelTests/PersonalityTest_PersonalityQuizQuestionListViewModelTest.swift
|
e7488685cf81b8629e3cc55f936ab75b7b15ca11
|
[] |
no_license
|
Zulqurnain24/PersonalityTest
|
27de737b1c705a53faf2143cf17b79fa954af90e
|
d3970be0db795703cdae74b3d2cfe88ffd3ad083
|
refs/heads/master
| 2020-06-21T21:44:43.123969 | 2019-08-03T21:40:11 | 2019-08-03T21:40:11 | 197,558,693 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 7,897 |
swift
|
//
// PersonalityTest_PersonalityQuizQuestionListViewModelTest.swift
// PersonalityTestTests
//
// Created by Mohammad Zulqarnain on 31/07/2019.
// Copyright © 2019 Mohammad Zulqarnain. All rights reserved.
//
import XCTest
@testable import PersonalityTest
class PersonalityTest_PersonalityQuizQuestionListViewModelTest: XCTestCase {
var sut: PersonalityQuizQuestionListViewModel!
var personalityQuizDataManager: PersonalityQuizDataManager!
override func setUp() {
// Put setup code here. This method is called before the invocation of each test method in the class.
super.setUp()
sut = PersonalityQuizQuestionListViewModel(questionList: QuestionList(questions: [Question(question: "How important is the age of your partner to you?", category: QuestionCategory.hard_fact, question_type: QuestionType(type: "number_range", options: ["not important","important","very important"], condition: Condition(predicate: Predicate(exactEquals: ["${selection}","very important"]), if_positive: IfPositive(question: "What age should your potential partner be?", category: QuestionCategory.hard_fact, question_type: Type(type: "number_range", range: ["from":18, "to":140]))), selectedOption: 3))]))
personalityQuizDataManager = PersonalityQuizDataManager()
personalityQuizDataManager.initFBQuestionsDatasource { dataSnapShot in
self.sut = PersonalityQuizQuestionListViewModel(dataSnapshot: dataSnapShot)
}
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
sut = nil
super.tearDown()
}
func populateArrayFromJSONFile(completionHandler: ([Question]) -> Void) {
//load from json
let bundle = Bundle(for: type(of: self))
guard let url = bundle.url(forResource: "questions", withExtension: "json"),
let data = try? Data(contentsOf: url) else {
return
}
let decoder = JSONDecoder()
decoder.keyDecodingStrategy = .convertFromSnakeCase
decoder.dateDecodingStrategy = .secondsSince1970
guard let questions = try? decoder.decode([Question].self, from: data) else {
return
}
completionHandler(questions)
}
func testExample() {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct results.
self.populateArrayFromJSONFile(completionHandler: { questions in
XCTAssertEqual(questions, self.sut.getQuestions())
})
self.sut.setSelectedOption(questionNumber: 0, value: 2)
XCTAssertEqual(self.sut.getQuestions()[0].question_type.selectedOption, 2)
self.sut.setQuestions(questions: [
Question(question: "How important is the gender of your partner?", category: QuestionCategory.hard_fact, question_type: QuestionType(type: "single_choice", options: [
"not important",
"important",
"very important"
], condition: Condition(predicate: Predicate(exactEquals: [
"${selection}",
"very important"
]), if_positive: IfPositive(question: "", category: QuestionCategory.hard_fact, question_type: Type(type: "", range: Dictionary<String, Int>()))), selectedOption: 0)),
Question(question: "Do any children under the age of 18 live with you?", category: QuestionCategory.hard_fact, question_type: QuestionType(type: "single_choice", options: [
"not important",
"important",
"very important"
], condition: Condition(predicate: Predicate(exactEquals: [
"",
""
]), if_positive: IfPositive(question: "", category: QuestionCategory.hard_fact, question_type: Type(type: "", range: Dictionary<String, Int>()))), selectedOption: 0)),
Question(question: "How should your potential partner respond to this question?", category: QuestionCategory.lifestyle, question_type: QuestionType(type: "single_choice", options: [
"yes",
"sometimes",
"no"
], condition: Condition(predicate: Predicate(exactEquals: [
"",
""
]), if_positive: IfPositive(question: "", category: QuestionCategory.hard_fact, question_type: Type(type: "", range: Dictionary<String, Int>()))), selectedOption: 0)),
Question(question: "Could you imagine having children with your potential partner?", category: QuestionCategory.lifestyle, question_type: QuestionType(type: "single_choice", options: [
"yes",
"maybe",
"no"
], condition: Condition(predicate: Predicate(exactEquals: [
"",
""
]), if_positive: IfPositive(question: "", category: QuestionCategory.hard_fact, question_type: Type(type: "", range: Dictionary<String, Int>()))), selectedOption: 0))
])
XCTAssertEqual(self.sut.getQuestions(), [
Question(question: "How important is the gender of your partner?", category: QuestionCategory.hard_fact, question_type: QuestionType(type: "single_choice", options: [
"not important",
"important",
"very important"
], condition: Condition(predicate: Predicate(exactEquals: [
"${selection}",
"very important"
]), if_positive: IfPositive(question: "", category: QuestionCategory.hard_fact, question_type: Type(type: "", range: Dictionary<String, Int>()))), selectedOption: 0)),
Question(question: "Do any children under the age of 18 live with you?", category: QuestionCategory.hard_fact, question_type: QuestionType(type: "single_choice", options: [
"not important",
"important",
"very important"
], condition: Condition(predicate: Predicate(exactEquals: [
"",
""
]), if_positive: IfPositive(question: "", category: QuestionCategory.hard_fact, question_type: Type(type: "", range: Dictionary<String, Int>()))), selectedOption: 0)),
Question(question: "How should your potential partner respond to this question?", category: QuestionCategory.lifestyle, question_type: QuestionType(type: "single_choice", options: [
"yes",
"sometimes",
"no"
], condition: Condition(predicate: Predicate(exactEquals: [
"",
""
]), if_positive: IfPositive(question: "", category: QuestionCategory.hard_fact, question_type: Type(type: "", range: Dictionary<String, Int>()))), selectedOption: 0)),
Question(question: "Could you imagine having children with your potential partner?", category: QuestionCategory.lifestyle, question_type: QuestionType(type: "single_choice", options: [
"yes",
"maybe",
"no"
], condition: Condition(predicate: Predicate(exactEquals: [
"",
""
]), if_positive: IfPositive(question: "", category: QuestionCategory.hard_fact, question_type: Type(type: "", range: Dictionary<String, Int>()))), selectedOption: 0))
])
}
func testPerformanceExample() {
// This is an example of a performance test case.
self.measure {
// Put the code you want to measure the time of here.
}
}
}
|
[
-1
] |
57ea05fcde4d640f3b105ff2df253fd84bc73f0f
|
bee953e4a57dfd6462ff79d44f9b1395f802534c
|
/Groover/Groover/DeleteSongCtrl.swift
|
c29a9ba958ada23c34be14d726dcb807bab7b6d5
|
[] |
no_license
|
JoshuaBThompson/WristBand
|
6a8cfd038146abad0bf918dd9afa4b524df01719
|
f34417659974517cb128f30bbd4850b2e4f32a42
|
refs/heads/master
| 2020-04-11T14:05:19.479709 | 2017-10-20T00:34:31 | 2017-10-20T00:34:31 | 35,336,815 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 925 |
swift
|
//
// DeleteSongCtrl.swift
// Groover
//
// Created by Joshua Thompson on 1/22/17.
// Copyright © 2017 TCM. All rights reserved.
//
import UIKit
class DeleteSongCtrl: DeleteSong {
/*
// Only override draw() if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
override func draw(_ rect: CGRect) {
// Drawing code
}
*/
override init(frame: CGRect) {
super.init(frame: frame)
self.addTarget(self, action: #selector(buttonTapped), for: .touchDown)
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
self.addTarget(self, action: #selector(buttonTapped), for: .touchDown)
}
func buttonTapped(){
print("delete song button tapped")
sendActions(for: .valueChanged) //this tells view controller that something changed
}
}
|
[
-1
] |
ccd58923f133458f8276db6c559f80e7e8aad4c4
|
c8cb13e8ad0b2cefabf59553e15b23a9e77782cf
|
/Neighbourhelp/PageViews/LoginView.swift
|
29ad623771848b94e174c2050d5e0d2a266646ee
|
[] |
no_license
|
JuVo1102/Neighbourhelp
|
8cb07dfaf088063603f2347e53f5d4255ea63912
|
8486df509c77048d88fcb22db2c167c531948627
|
refs/heads/main
| 2023-06-19T16:08:04.668180 | 2021-07-12T10:47:13 | 2021-07-12T10:47:13 | 382,130,363 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 3,334 |
swift
|
//
// LoginView.swift
// Neighbourhelp
//
// Created by Julian Vorbink on 01.07.21.
//
import SwiftUI
struct LoginView: View {
@EnvironmentObject var contentViewController: ContentViewController
@EnvironmentObject var loginViewController: LoginViewController
@EnvironmentObject var userDatabase: UserDatabase
@EnvironmentObject var entryDatabase: EntryDatabase
var body: some View {
NavigationView {
VStack (spacing: 30) {
Spacer()
Text("Email:")
.font(.callout)
.bold()
TextField("Enter email...", text: $loginViewController.email)
.multilineTextAlignment(
.center)
.autocapitalization(.none)
.font(.headline)
.foregroundColor(.black)
.padding()
.frame(width: 300, height: 50)
.background(Color(hue: 1.0, saturation: 0.028, brightness: 0.864))
.cornerRadius(20)
Text("Password:")
.font(.callout)
.bold()
SecureField("Enter password...", text: $loginViewController.password)
.multilineTextAlignment(
.center)
.autocapitalization(.none)
.font(.headline)
.foregroundColor(.black)
.padding()
.frame(width: 300, height: 50)
.background(Color(hue: 1.0, saturation: 0.028, brightness: 0.864))
.cornerRadius(20)
Spacer()
Text(loginViewController.warning)
.bold()
.foregroundColor(.red)
Button("Login!") {
loginViewController.login(userDatabase: userDatabase, entryDatabase: entryDatabase, contentViewController: contentViewController)
}
.font(.headline)
.foregroundColor(.black)
.padding()
.frame(width: 300, height: 50)
.background(Color(hue: 1.0, saturation: 0.028, brightness: 0.864))
.cornerRadius(15.0)
Button("Register!") {
loginViewController.navigateToRegistry(contentViewController: contentViewController)
}
.font(.headline)
.foregroundColor(.black)
.padding()
.frame(width: 300, height: 50)
.background(Color(hue: 1.0, saturation: 0.028, brightness: 0.864))
.cornerRadius(15.0)
Spacer()
}
.navigationBarTitle("Login")
}
}
}
struct LoginView_Previews: PreviewProvider {
static var previews: some View {
LoginView()
.environmentObject(ContentViewController())
.environmentObject(LoginViewController())
.environmentObject(UserDatabase())
.environmentObject(EntryDatabase())
}
}
|
[
-1
] |
9e5dc7cafa147117aa537dc3c910248ba1b02347
|
f8449379a335339ccdd3be9682ceb66af0057d95
|
/Pod/Classes/UI/CardTextField+ViewAnimations.swift
|
ed1dc4eecb83043399fe98e550610811186cad3b
|
[
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] |
permissive
|
Moovit/Caishen
|
5544407f93f50761b167a47c1be40c41f78952db
|
f4364c7de93a16c97b267e4120a66c0267e82a20
|
refs/heads/master
| 2021-07-14T19:31:13.674897 | 2020-12-15T15:20:20 | 2020-12-15T15:20:20 | 224,220,053 | 0 | 1 |
MIT
| 2020-12-13T17:56:59 | 2019-11-26T15:06:29 |
Swift
|
UTF-8
|
Swift
| false | false | 7,605 |
swift
|
//
// CardTextField+ViewAnimations.swift
// Caishen
//
// Created by Daniel Vancura on 3/9/16.
// Copyright © 2016 Prolific Interactive. All rights reserved.
//
import UIKit
extension CardTextField {
// MARK: - View animations
/**
Moves the card number input field to the left outside of the screen with an animation of the duration `viewAnimationDuration`, so that only the last group of the card number is visible. At the same time, the card detail (expiration month and year and CVC) slide in from the right.
- Parameters:
- remainFirstResponder: Indicates whether the text field should remain first responder after finishing the animation.
*/
@objc open func moveCardNumberOutAnimated(remainFirstResponder: Bool) {
UIView.animate(withDuration: viewAnimationDuration, animations: { [weak self] in
self?.moveCardNumberOut(remainFirstResponder: remainFirstResponder)
})
}
/**
Moves the full card number input field to inside the screen with an animation of the duration `viewAnimationDuration`. At the same time, the card detail (expiration month and year and CVC) slide outside the view.
*/
@objc open func moveCardNumberInAnimated() {
UIView.animate(withDuration: viewAnimationDuration, animations: { [weak self] in
self?.moveCardNumberIn()
})
}
/**
Moves the card number input field to the left outside of the screen, so that only the last group of the card number is visible. At the same time, the card detail (expiration month and year and CVC) are displayed to its right.
- Parameters:
- remainFirstResponder: Indicates whether the text field should remain first responder after finishing the animation.
*/
@objc open func moveCardNumberOut(remainFirstResponder: Bool) {
if UIAccessibility.isVoiceOverRunning {
return
}
// If the card number is invalid, do not allow to move to the card detail
if cardType?.validate(number: card.bankCardNumber) != .Valid && !UIAccessibility.isVoiceOverRunning {
return
}
// If neither expiry nor cvc are required, also do not allow to move to the detail
if hideExpiryTextFields && hideCVCTextField {
return
}
// We will set numberInputTextField as first responder in the next step. This will trigger `editingDidBegin`
// which in turn will cause the number field to move to full display. This can cause animation issues.
// In order to tackle these animation issues, check if the cardInfoView was previously fully displayed (and should therefor not be moved with an animation).
var shouldMoveAnimated: Bool = true
if let transform = cardInfoView?.transform, !transform.isIdentity {
shouldMoveAnimated = false
}
if UIAccessibility.isVoiceOverRunning {
shouldMoveAnimated = false
}
if !UIAccessibility.isVoiceOverRunning {
UIView.performWithoutAnimation { [weak self] in
self?.numberInputTextField?.becomeFirstResponder()
}
}
// Get the rect for the last group of digits
if let rect = numberInputTextField?.rectForLastGroup() {
// If on RTL language: hide the entire number except for the last group.
// Else: Move the number out of range, except for the last group.
if isRightToLeftLanguage {
let shapeLayer = CAShapeLayer()
let path = CGPath(rect: rect, transform: nil)
shapeLayer.path = path
numberInputTextField.layer.mask = shapeLayer
numberInputTextField?.transform = CGAffineTransform.identity
} else {
if shouldMoveAnimated {
numberInputTextField?.transform = CGAffineTransform(translationX: -rect.origin.x, y: 0)
} else {
UIView.performWithoutAnimation { [weak self] in
self?.numberInputTextField?.transform = CGAffineTransform(translationX: -rect.origin.x, y: 0)
}
}
}
let offset = isRightToLeftLanguage ? rect.origin.x : -rect.origin.x
if shouldMoveAnimated {
cardInfoView?.transform = CGAffineTransform(translationX: offset, y: 0)
} else {
UIView.performWithoutAnimation { [weak self] in
self?.cardInfoView?.transform = CGAffineTransform(translationX: offset, y: 0)
}
}
} else {
numberInputTextField?.alpha = 0
}
// Reset the first responder status as it was before.
if !UIAccessibility.isVoiceOverRunning {
UIView.performWithoutAnimation { [weak self] in
self?.numberInputTextField?.resignFirstResponder()
}
}
if remainFirstResponder {
monthTextField.becomeFirstResponderIfNotVoiceOver()
}
}
/**
Moves the full card number input field to inside the screen. At the same time, the card detail (expiration month and year and CVC) are moved outside the view.
*/
@objc open func moveCardNumberIn() {
if UIAccessibility.isVoiceOverRunning {
return
}
let infoTextFields: [UITextField?] = [monthTextField, yearTextField, cvcTextField]
translateCardNumberIn()
// If card info view is moved with an animation, wait for it to finish before
// showing the full card number to avoid overlapping on RTL language.
if cardInfoView?.layer.animationKeys() != nil {
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + Double(Int64(viewAnimationDuration * Double(NSEC_PER_SEC))) / Double(NSEC_PER_SEC), execute: { [weak self] in
self?.numberInputTextField?.layer.mask = nil
})
// Let the number text field become first responder only after the animation has completed (left to right script)
// or half way through the view animation (right to left script)
let firstResponderDelay = isRightToLeftLanguage ? viewAnimationDuration / 2.0 : viewAnimationDuration
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + Double(Int64(firstResponderDelay * Double(NSEC_PER_SEC))) / Double(NSEC_PER_SEC), execute: {
if !UIAccessibility.isVoiceOverRunning {
infoTextFields.forEach({$0?.resignFirstResponder()})
self.numberInputTextField.becomeFirstResponder()
}
})
} else {
numberInputTextField?.layer.mask = nil
if !UIAccessibility.isVoiceOverRunning {
infoTextFields.forEach({$0?.resignFirstResponder()})
numberInputTextField.becomeFirstResponder()
}
}
}
open func translateCardNumberIn() {
if UIAccessibility.isVoiceOverRunning {
return
}
if isRightToLeftLanguage {
UIView.performWithoutAnimation {
self.numberInputTextField?.alpha = 1
self.numberInputTextField?.transform = CGAffineTransform.identity
}
} else {
numberInputTextField?.alpha = 1
numberInputTextField?.transform = CGAffineTransform.identity
}
// Move card info view
cardInfoView?.transform = .identity
}
}
|
[
-1
] |
e0ebb63cc9cfbec78e6725e5bd988ba934a402d2
|
96fa6d949f4af9fd596d613b09466a223444ade5
|
/Nomad/Data/Helpers/LoadingStatus.swift
|
c55b2b47b540a8dd9446b03a3281d0440b46c399
|
[] |
no_license
|
mohammedsafwat/nomad
|
3174372740714b33f88a3b19b745d69176521855
|
dd616466465dc04ef851ccfffb696e8c02c10e4e
|
refs/heads/master
| 2020-04-24T02:08:44.104073 | 2019-03-09T16:01:02 | 2019-03-09T16:01:02 | 171,626,244 | 5 | 1 | null | null | null | null |
UTF-8
|
Swift
| false | false | 221 |
swift
|
//
// LoadingStatus.swift
// Nomad
//
// Created by Mohammed Safwat on 22.02.19.
// Copyright © 2019 Mohammed Safwat. All rights reserved.
//
enum LoadingStatus {
case success
case loading
case failed
}
|
[
-1
] |
ca8f899989092eedcde1c7f6564d6cbbf6a019ed
|
7232670da1097184e48e543323376aae39e05d4f
|
/ScrollingMenu/Views/HorizontalItemCell.swift
|
33e50ed89a1ceb3123d8fd2c46a8feb26f69ad89
|
[] |
no_license
|
grd888/ScrollingMenu
|
3dd55a759566d45762308eda778c3c60edfff344
|
fab1f6303605579179c92f67f3f4c48788937da9
|
refs/heads/main
| 2023-07-19T10:11:19.445486 | 2021-09-16T03:27:03 | 2021-09-16T03:27:03 | 406,343,473 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 554 |
swift
|
//
// HorizontalItemCell.swift
// ScrollingMenu
//
// Created by GD on 9/15/21.
//
import UIKit
class HorizontalItemCell: UICollectionViewCell {
@IBOutlet weak var itemImageView: UIImageView!
@IBOutlet weak var itemTitle: UILabel!
@IBOutlet weak var menuItemContainer: UIView!
override func awakeFromNib() {
super.awakeFromNib()
menuItemContainer.layer.borderWidth = 1.0
menuItemContainer.layer.borderColor = UIColor.lightGray.cgColor
menuItemContainer.layer.cornerRadius = 10.0
}
}
|
[
-1
] |
5338c4ce30c16460a8a232fd3fc6b9a474b9d964
|
d60420d55b593e59503344c49b2a8bd07100e755
|
/SunSeeker/SunSeeker/MapViewController.swift
|
f633995ac6728f8da1d4810ae87869077b6187c3
|
[
"MIT"
] |
permissive
|
mikemiksch/SunSeeker
|
37ef7cf4cba189d3a3713106cf275c456ff4c66c
|
c7636b751530bc78bf77e588b52460715eaa0462
|
refs/heads/master
| 2021-08-08T06:10:38.923996 | 2017-11-09T18:20:26 | 2017-11-09T18:20:26 | 104,239,151 | 0 | 0 | null | 2017-09-25T17:56:36 | 2017-09-20T16:15:38 |
Swift
|
UTF-8
|
Swift
| false | false | 4,914 |
swift
|
//
// MapViewController.swift
// SunSeeker
//
// Created by Mike Miksch on 9/20/17.
// Copyright © 2017 MikschSoft. All rights reserved.
//
import UIKit
import MapKit
class MapViewController: UIViewController, MKMapViewDelegate, CLLocationManagerDelegate {
@IBOutlet weak var listButton: UIButton!
@IBOutlet weak var bookingsButton: UIButton!
@IBOutlet weak var activityIndicator: UIActivityIndicatorView!
@IBOutlet weak var weatherMap: MKMapView!
@IBOutlet weak var listButtonTrailingConstraint: NSLayoutConstraint!
@IBOutlet weak var bookingButtonLeadingConstraint: NSLayoutConstraint!
@IBAction func listButtonPressed(_ sender: Any) {
}
static var centerPoint = CLLocation(latitude: 47.6062, longitude: -122.3321)
let locationManager = CLLocationManager()
var forecasts = [Forecast]()
var cities = [City]() {
didSet {
addAnnotations()
}
}
override func viewDidLoad() {
super.viewDidLoad()
self.activityIndicator.startAnimating()
mapSetup()
applyFormatting()
API.shared.fetchData(callback: { (cities) in
OperationQueue.main.addOperation {
self.cities = cities ?? []
self.activityIndicator.stopAnimating()
self.activityIndicator.isHidden = true
self.animations()
}
})
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
super.prepare(for: segue, sender: sender)
if segue.identifier == ListViewController.identifier {
guard let destinationController = segue.destination as? ListViewController else { return }
let backButton = UIBarButtonItem()
backButton.title = "Back"
navigationItem.backBarButtonItem = backButton
destinationController.cities = cities.sorted(by: { (first, second) -> Bool in
if first.rank < second.rank {
return true
}
if first.rank == second.rank {
return first.distance < second.distance
}
return false
})
}
}
func addAnnotations() {
for city in cities {
let location = city.twoDLocation
let annotation = CustomPointAnnotation()
annotation.coordinate = location
annotation.title = city.name
annotation.subtitle = city.description
annotation.imageName = city.icon
weatherMap.addAnnotation(annotation)
}
}
func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView? {
if !(annotation is CustomPointAnnotation) {
return nil
}
let identifier = "weatherIcon"
var annotationView = weatherMap.dequeueReusableAnnotationView(withIdentifier: identifier)
if annotationView == nil {
annotationView = MKAnnotationView(annotation: annotation, reuseIdentifier: identifier)
annotationView?.canShowCallout = true
} else {
annotationView!.annotation = annotation
}
let customAnnotation = annotation as! CustomPointAnnotation
annotationView!.image = UIImage(named: "\(customAnnotation.imageName!).png")
return annotationView
}
func applyFormatting() {
self.navigationItem.title = "SunSeeker"
weatherMap.layer.cornerRadius = 25.0
listButton.layer.cornerRadius = 10.0
bookingsButton.layer.cornerRadius = 10.0
listButton.titleLabel?.adjustsFontSizeToFitWidth = true
listButton.titleLabel?.lineBreakMode = NSLineBreakMode.byClipping
bookingsButton.titleLabel?.adjustsFontSizeToFitWidth = true
bookingsButton.titleLabel?.lineBreakMode = NSLineBreakMode.byClipping
}
func animations() {
UIView.animate(withDuration: 1.0, animations: {
self.bookingButtonLeadingConstraint.constant = 0
self.listButtonTrailingConstraint.constant = 0
self.view.layoutIfNeeded()
})
}
func mapSetup() {
let center = CLLocationCoordinate2DMake(47.6062, -122.3321)
let span = MKCoordinateSpanMake(3, 3)
let region = MKCoordinateRegionMake(center, span)
weatherMap.setRegion(region, animated: true)
weatherMap.delegate = self
weatherMap.showsUserLocation = true
locationManager.requestWhenInUseAuthorization()
if CLLocationManager.locationServicesEnabled() {
locationManager.delegate = self
locationManager.desiredAccuracy = kCLLocationAccuracyKilometer
locationManager.startUpdatingLocation()
}
}
}
|
[
-1
] |
f25ecc6341ee0a18d5bb2f78206f6b370f774c0e
|
8ba7402e377250f3a1e91a4432879d3089f28170
|
/ToDo Master/LogInVC.swift
|
0e2ec3c6c7ebe70dd244a0119cd110d60be6fdca
|
[] |
no_license
|
dssp100/ToDo-Master
|
cb802bf92010c88d915bee4c88a87bc693399ff8
|
2b998a329dbf4078dde44b7e0c1dbc245f015006
|
refs/heads/master
| 2021-01-13T16:29:18.200524 | 2017-01-24T11:49:18 | 2017-01-24T11:49:18 | 79,325,850 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,246 |
swift
|
//
// LogInVC.swift
// ToDo Master
//
// Created by Daniel Springer on 19/01/2017.
// Copyright © 2017 Daniel Springer. All rights reserved.
//
import UIKit
import Firebase
class LogInVC: UIViewController {
//Variables
//Outlets
@IBOutlet weak var UserEmailField: UITextField!
@IBOutlet weak var UserPaswordField: UITextField!
@IBOutlet weak var LogInError: UIImageView!
@IBOutlet weak var LogInSuccess: UIImageView!
override func viewDidLoad() {
}
//Actions
@IBAction func LogMeInButton(_ sender: Any) {
FIRAuth.auth()?.signIn(withEmail: UserEmailField.text!, password: UserPaswordField.text!, completion: {
user, error in
if error != nil{
self.LogInError.isHidden = false
print("Incorrect credentials")
}
else {
self.LogInSuccess.isHidden = false
print("User logged in")
DispatchQueue.main.asyncAfter(deadline: .now() + .seconds(3), execute: {
self.performSegue(withIdentifier: "ImportPhoto", sender: self)
})
}
})
}
//Functions
}
|
[
-1
] |
63b702c76cbd7074980de190179893759ac98242
|
a8becd6e54e632d99e3688fbcc9dca70178f067b
|
/PopularMoviesTestApp/Modules/FavoriteMoviesTab/FaforiteMoviesCoordinator.swift
|
13dfc1c485b0559ec6998419e1a2631aeb3dd02f
|
[] |
no_license
|
shekunsky/PopularMoviesTestApp
|
ea77cc96963442bcad97c16c9cb8eb83cb33af72
|
42665e861d1f652bd782a775a5651ccda92187c7
|
refs/heads/master
| 2022-11-09T15:58:01.910626 | 2020-04-26T12:07:07 | 2020-04-26T12:07:07 | 259,017,775 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 700 |
swift
|
//
// FaforiteMoviesCoordinator.swift
// PopularMoviesTestApp
//
// Created by Alex2 on 26.04.2020.
// Copyright © 2020 Alex2. All rights reserved.
//
import UIKit
final class FaforiteMoviesCoordinator: TabBaseCoordinator {
lazy var favoriteMoviesVC = makeFavoriteMoviesViewController()
override var mainVC: TabBarBaseViewController {
return favoriteMoviesVC
}
}
extension FaforiteMoviesCoordinator {
func makeFavoriteMoviesViewController() -> FavoriteMoviesViewController {
return makeController(from: .main) {
let viewModel = FavoriteMoviesViewModel(useCases: useCases, coordinator: self)
$0.viewModel = viewModel
}
}
}
|
[
-1
] |
8a75eed94f3512f7b49562d57cd0cb123edbb167
|
340950d1bae4a8e81491e70a1fc5ddb107647ee2
|
/NetflixClone/Model/Trailer.swift
|
f74ec18404ceb3d628e1319ebdce3307b13127e2
|
[] |
no_license
|
ronaldfpaglinawan/ios-netflixclone
|
cf6e343d85626086e7f7e7e9e9b5dd90e11aecba
|
c2263088dafdcd4ab4d95d8fe50c1212c376c14e
|
refs/heads/main
| 2023-04-29T23:57:57.455622 | 2021-05-20T03:04:29 | 2021-05-20T03:04:29 | 347,065,651 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 273 |
swift
|
//
// Trailer.swift
// NetflixClone
//
// Created by Ronald Fornis Paglinawan on 30/03/21.
//
import Foundation
struct Trailer: Identifiable, Hashable {
var id: String = UUID().uuidString
var name: String
var videoURL: URL
var thumbnailImageURL: URL
}
|
[
-1
] |
4ab7213551450bb891137e76d28a25ab8eef5f2d
|
fd2f3b2ffbf2718ebf9bb2f265d82636250c6866
|
/Sources/ARHeadsetKit/Central Rendering/Shapes/Round Shapes/CentralCone.swift
|
5f1bf173f0c27ef30c69401c4637e4450493766e
|
[
"MIT"
] |
permissive
|
garrettsickles/ARHeadsetKit
|
98b9f050422a3b581e1bc92c17cde531eaa6183f
|
a95efcf480672b8174af8f5aef33b28bee66ec1b
|
refs/heads/main
| 2023-09-03T21:28:26.998662 | 2021-11-01T23:00:50 | 2021-11-01T23:00:50 | 423,657,966 | 0 | 0 |
MIT
| 2021-11-02T00:30:12 | 2021-11-02T00:30:11 | null |
UTF-8
|
Swift
| false | false | 5,422 |
swift
|
//
// CentralCone.swift
// ARHeadsetKit
//
// Created by Philip Turner on 4/17/21.
//
import Metal
import simd
#if !os(macOS)
struct CentralCone: CentralRoundShape {
static let shapeType: ARShapeType = .cone
var numIndices: Int
var normalOffset: Int
var indexOffset: Int
init(centralRenderer: CentralRenderer, numSegments: UInt16,
vertices: inout [CentralVertex], indices: inout [UInt16])
{
let circleVertices = centralRenderer.circle(numSegments: numSegments)
var currentVertices = [CentralVertex]()
var currentIndices = Self.makePointedTipIndices(upperStart: 0, numSegments: numSegments, upward: true)
let i_end = circleVertices.count - 1
var lastDirection = circleVertices[0] + circleVertices[i_end]
var directionMultiplier = rsqrt(length_squared(lastDirection))
directionMultiplier *= sqrt(0.8)
lastDirection *= directionMultiplier
var cachedCircleVertex = circleVertices[0]
for i in 1...i_end {
let currentCircleVertex = circleVertices[i]
var direction = cachedCircleVertex + currentCircleVertex
direction *= directionMultiplier
let normal = simd_float3(direction.x, sqrt(0.2), direction.y)
cachedCircleVertex = currentCircleVertex
currentVertices.append(CentralVertex(position: [0, 0.5, 0], normal: normal))
}
let lastNormal = simd_float3(lastDirection.x, sqrt(0.2), lastDirection.y)
currentVertices.append(CentralVertex(position: [0, 0.5, 0], normal: lastNormal))
currentVertices += circleVertices.map {
let direction = $0 * sqrt(0.8) * 2
let normal = simd_float3(direction.x, sqrt(0.2), direction.y)
return CentralVertex(position: [$0.x, -0.5, $0.y], normal: normal)
}
currentIndices += Self.makeRoundTipIndices(circleStart: numSegments + numSegments, numSegments: numSegments, upward: false)
currentVertices += circleVertices.map {
CentralVertex(position: [$0.x, -0.5, $0.y], normal: [0, -1, 0])
}
currentVertices.append(CentralVertex(position: [0, -0.5, 0], normal: [0, -1, 0]))
numIndices = currentIndices.count
normalOffset = vertices.count * MemoryLayout<simd_half3>.stride
indexOffset = indices.count * MemoryLayout<UInt16>.stride
vertices += currentVertices
indices += currentIndices
}
}
#endif
public extension RayTracing.Ray {
/// Intersects a cone confined to model space.
@inlinable
func getConeProgress() -> Float? {
let possibleBaseProgress = getConeBaseProgress()
if origin.y <= -0.5, possibleBaseProgress != nil {
return possibleBaseProgress
}
if let middleProgress = getConeMiddleProgress() {
if let baseProgress = possibleBaseProgress {
return min(baseProgress, middleProgress)
} else {
return middleProgress
}
} else {
return possibleBaseProgress
}
}
/// Intersects a cone confined to model space, except that its tip may extend above `y = 0.5`.
@inlinable
func getConeMiddleProgress(topY: Float = 0.5) -> Float? {
let theta = atan2(Float(1), 2)
let angle_multiplier = cos(theta) * cos(theta)
let CO = origin - simd_float3(0, 0.5, 0)
var coefficients = dotAdd(direction, direction,
direction, CO,
CO, CO) * -angle_multiplier
coefficients = fma(simd_float3(direction.y, direction.y, CO.y),
simd_float3(direction.y, CO.y, CO.y), coefficients)
var a: Float { coefficients[0] }
var b_half: Float { coefficients[1] }
var c: Float { coefficients[2] }
let discriminant_4th = fma(b_half, b_half, -a * c)
guard discriminant_4th >= 0 else { return nil }
let discriminant_sqrt_half = sqrt(discriminant_4th)
var solutions = simd_float2(
discriminant_sqrt_half,
-discriminant_sqrt_half
) - b_half
solutions.replace(with: [.nan, .nan], where: sign(solutions) .!= sign(a))
solutions /= a
let P_y = fma(direction.y, solutions, origin.y)
solutions.replace(with: [.nan, .nan], where: P_y .> topY .| P_y .< -0.5)
let possibleTipProgress = solutions.min()
return possibleTipProgress.isNaN ? nil : possibleTipProgress
}
/// Intersects the base of a cone confined to model space.
@inlinable
func getConeBaseProgress() -> Float? {
let origin_to_base_distance = -0.5 - origin.y
let baseProgress = origin_to_base_distance / direction.y
guard baseProgress > 0 else { return nil }
let projection3D = project(progress: baseProgress)
let projection2D = simd_float2(projection3D.x, projection3D.z)
if length_squared(projection2D) < 0.25 {
return baseProgress
} else {
return nil
}
}
}
|
[
-1
] |
d1dc5d41b7aaeb1687b62f42bd461ebb40413d68
|
e8d71b9e5e044dd031ff29149ba811fef35c8efd
|
/JMarvel/API/Models/Request.swift
|
21d59bf60e467bd2f82c75d63988dc864ae759e7
|
[] |
no_license
|
joaooomarcos/JMarvel
|
654b07429970fe879c3352f713da252ce8806895
|
cce6488be7d6effbdec7340437d784835b087d4c
|
refs/heads/develop
| 2023-04-14T11:25:33.991987 | 2020-03-02T18:59:52 | 2020-03-02T18:59:52 | 241,527,038 | 0 | 0 | null | 2023-03-09T06:12:37 | 2020-02-19T03:50:22 |
Swift
|
UTF-8
|
Swift
| false | false | 537 |
swift
|
//
// Request.swift
// JMarvel
//
// Created by Joao Marcos Ribeiro Araujo on 18/02/20.
// Copyright © 2020 JoaoMarcos. All rights reserved.
//
import Foundation
public protocol Request {
var headers: HTTPHeaders { get }
var endpoint: Endpoint { get }
var parameters: Parameters { get }
var method: HTTPMethod? { get }
}
public extension Request {
var headers: HTTPHeaders {
[:]
}
var parameters: Parameters {
[:]
}
var method: HTTPMethod? {
.get
}
}
|
[
-1
] |
37644170fbce138bd04d71c45bede4edf69a0fd7
|
444fcee88793de73990e853bcb075cebac1e674a
|
/OddEvenSumApp/AppDelegate.swift
|
3a02b329575243ebf3c7b086f40369766c21dc63
|
[] |
no_license
|
SF18AS01-usmanwed/OddEvenSumApp
|
b14fa3d22a8dc5f54f31cd1ee586bc6491c43714
|
3c6743fca4abcbe86771dae6c9f3239b0f1bdf43
|
refs/heads/master
| 2020-04-18T00:06:47.427447 | 2019-01-22T20:37:12 | 2019-01-22T20:37:12 | 167,063,560 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,190 |
swift
|
//
// AppDelegate.swift
// OddEvenSumApp
//
// Created by Ousmane Ouedraogo on 1/22/19.
// Copyright © 2019 Ousmane Ouedraogo. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}
func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
}
|
[
229380,
229383,
229385,
278539,
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,
286774,
229432,
286776,
286778,
319544,
204856,
352318,
286791,
237640,
278605,
286797,
311375,
163920,
237646,
196692,
319573,
311383,
278623,
278626,
319590,
311400,
278635,
303212,
278639,
131192,
278648,
237693,
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,
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,
172618,
303690,
33357,
287309,
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,
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,
222018,
295755,
377676,
148302,
287569,
303959,
230237,
279390,
230241,
279394,
303976,
336744,
303985,
328563,
303987,
279413,
303991,
303997,
295806,
295808,
304005,
295813,
213895,
320391,
304007,
304009,
304011,
230284,
304013,
279438,
189325,
213902,
189329,
295822,
304019,
295825,
189331,
58262,
304023,
279452,
410526,
279461,
279462,
304042,
213931,
230327,
304055,
287675,
230334,
304063,
238528,
304065,
213954,
189378,
156612,
295873,
213963,
312272,
304084,
304090,
320481,
304106,
320490,
312302,
328687,
320496,
304114,
295928,
320505,
312321,
295945,
295949,
197645,
230413,
320528,
140312,
295961,
238620,
197663,
304164,
304170,
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,
279929,
304506,
181626,
304505,
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,
288214,
280021,
239064,
288217,
329177,
280027,
288220,
288218,
239070,
288224,
280034,
288226,
280036,
288229,
280038,
288230,
288232,
370146,
288234,
320998,
288236,
288238,
288240,
288242,
296435,
288244,
288250,
402942,
296446,
148990,
206336,
296450,
321022,
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,
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,
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,
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,
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,
280891,
289087,
280897,
280900,
239944,
305480,
280906,
239947,
305485,
305489,
379218,
280919,
248153,
215387,
354653,
313700,
280937,
313705,
190832,
280946,
223606,
313720,
280956,
239997,
280959,
313731,
199051,
240011,
289166,
240017,
297363,
190868,
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,
281135,
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,
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,
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,
282127,
290321,
282130,
323090,
282133,
290325,
241175,
290328,
282137,
290332,
241181,
282142,
282144,
290344,
306731,
290349,
290351,
290356,
282186,
224849,
282195,
282199,
282201,
306778,
159324,
159330,
314979,
298598,
323176,
224875,
241260,
323181,
257658,
315016,
282249,
290445,
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,
148946,
315211,
282446,
307027,
315221,
323414,
315223,
241496,
241498,
307035,
307040,
110433,
282465,
241509,
110438,
298860,
110445,
282478,
315249,
110450,
315251,
282481,
315253,
315255,
339838,
315267,
282499,
315269,
241544,
282505,
241546,
241548,
298896,
298898,
282514,
44948,
298901,
241556,
282520,
241560,
241563,
241565,
241567,
241569,
282531,
241574,
282537,
298922,
36779,
241581,
282542,
241583,
323504,
241586,
282547,
241588,
290739,
241590,
241592,
241598,
290751,
241600,
241605,
151495,
241610,
298975,
241632,
298984,
241640,
241643,
298988,
241646,
241649,
241652,
323574,
290807,
241661,
299006,
282623,
315396,
241669,
315397,
282632,
282639,
290835,
282645,
241693,
282654,
241701,
102438,
217127,
282669,
323630,
282681,
290877,
282687,
159811,
315463,
315466,
192589,
307278,
192596,
176213,
307287,
315482,
217179,
315483,
192605,
233567,
200801,
299105,
217188,
299109,
307303,
315495,
356457,
45163,
307307,
315502,
192624,
307314,
323700,
299126,
233591,
299136,
307329,
307338,
233613,
241813,
307352,
299164,
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,
291089,
282906,
291104,
233766,
176435,
307508,
315701,
307510,
332086,
307512,
168245,
307515,
282942,
307518,
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,
283033,
291226,
242075,
315801,
291231,
61855,
283042,
291238,
291241,
127403,
127405,
291247,
127407,
299440,
299444,
127413,
283062,
291254,
127417,
291260,
283069,
127421,
127424,
299457,
127429,
127431,
176592,
315856,
315860,
176597,
283095,
127447,
299481,
176605,
242143,
291299,
340454,
127463,
242152,
291305,
127466,
176620,
127469,
127474,
291314,
291317,
135672,
233979,
291323,
291330,
283142,
127497,
233994,
135689,
127500,
291341,
233998,
127506,
234003,
234006,
152087,
127511,
283161,
242202,
234010,
135707,
242206,
135710,
242208,
291361,
242220,
291378,
234038,
152118,
234041,
315961,
70213,
242250,
111193,
242275,
299620,
242279,
168562,
184952,
135805,
291456,
135808,
373383,
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,
226171,
291711,
234368,
234370,
201603,
291714,
234373,
226182,
234375,
291716,
308105,
226185,
234379,
234384,
234388,
234390,
324504,
234393,
209818,
308123,
324508,
234396,
226200,
234398,
291742,
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,
275462,
308231,
234504,
234507,
234510,
234515,
300054,
234519,
316439,
234520,
234523,
234526,
234528,
300066,
234532,
300069,
234535,
234537,
234540,
144430,
234543,
234546,
275508,
234549,
300085,
300088,
234553,
234556,
234558,
316479,
234561,
316483,
308291,
234563,
234568,
234570,
316491,
300108,
234572,
234574,
300115,
234580,
234581,
242777,
234585,
275545,
234590,
234593,
234595,
300133,
234597,
234601,
300139,
234605,
160879,
234607,
275569,
234610,
300148,
234614,
398455,
144506,
234618,
275579,
234620,
234623,
226433,
234627,
275588,
234629,
242822,
234634,
234636,
177293,
234640,
275602,
234643,
226453,
275606,
234647,
275608,
308373,
234650,
324757,
308379,
234653,
324766,
119967,
300189,
234648,
283805,
234657,
324768,
234661,
283813,
300197,
234664,
242852,
275626,
234667,
177318,
316596,
308414,
234687,
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,
374196,
284087,
292279,
144826,
144828,
144830,
144832,
144835,
144837,
38342,
144839,
144841,
144844,
144847,
144852,
144855,
103899,
300507,
333280,
226787,
218597,
292329,
300523,
259565,
300527,
308720,
259567,
226802,
292338,
316917,
308727,
292343,
300537,
316933,
316947,
308757,
308762,
284191,
316959,
284194,
284196,
235045,
284199,
284204,
284206,
284209,
284211,
284213,
194101,
316983,
284215,
194103,
284218,
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,
276095,
284288,
292481,
284290,
325250,
284292,
292485,
292479,
276098,
284297,
317066,
284299,
317068,
276109,
284301,
284303,
276114,
284306,
284308,
284312,
284314,
284316,
276127,
284320,
284322,
284327,
276137,
284329,
284331,
317098,
284333,
284335,
276144,
284337,
284339,
300726,
284343,
284346,
284350,
276160,
358080,
284354,
358083,
276166,
284358,
358089,
276170,
284362,
276175,
284368,
276177,
284370,
317138,
284372,
358098,
284377,
276187,
284379,
284381,
284384,
284386,
358114,
358116,
276197,
317158,
358119,
284392,
325353,
284394,
358122,
284397,
358126,
284399,
358128,
276206,
358133,
358135,
276216,
358138,
300795,
358140,
284413,
358142,
358146,
317187,
284418,
317189,
317191,
284428,
300816,
300819,
317207,
284440,
300828,
300830,
276255,
325408,
300832,
300834,
317221,
227109,
358183,
186151,
276268,
300845,
243504,
300850,
284469,
276280,
325436,
358206,
276291,
366406,
276295,
300872,
153417,
292681,
358224,
284499,
276308,
284502,
317271,
178006,
276315,
292700,
284511,
227175,
292715,
300912,
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,
284739,
292934,
243785,
276553,
350293,
350295,
194649,
227418,
309337,
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,
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,
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,
277173,
318132,
285368,
277177,
277181,
318144,
277187,
277191,
277194,
277196,
277201,
342745,
137946,
342747,
342749,
113378,
203491,
228069,
277223,
342760,
285417,
56041,
56043,
56045,
277232,
228081,
56059,
310015,
285441,
310020,
285448,
310029,
228113,
285459,
277273,
293659,
326430,
228128,
293666,
285474,
228135,
318248,
277291,
293677,
318253,
285489,
293685,
285494,
301880,
285499,
301884,
310080,
293696,
277317,
277322,
277329,
162643,
310100,
301911,
301913,
277337,
301921,
400236,
236397,
162671,
326514,
310134,
15224,
236408,
277368,
416639,
416640,
113538,
310147,
416648,
39817,
187274,
277385,
301972,
424853,
277405,
277411,
310179,
293798,
293802,
236460,
277426,
293811,
293817,
293820,
203715,
326603,
342994,
276586,
293849,
293861,
228327,
228328,
228330,
318442,
228332,
277486,
326638,
351217,
318450,
293876,
293877,
285686,
302073,
285690,
121850,
293882,
302075,
244731,
293887,
277504,
277507,
277511,
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,
294221,
326991,
294223,
277839,
277842,
277847,
277850,
179547,
277853,
146784,
277857,
302436,
277860,
294246,
327015,
310632,
327017,
351594,
277864,
277869,
277872,
351607,
310648,
277880,
310651,
277884,
277888,
310657,
351619,
294276,
310659,
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,
310925,
286354,
278163,
302740,
122517,
278168,
327333,
229030,
212648,
278188,
302764,
278192,
319153,
278196,
319163,
302781,
319171,
302789,
294599,
278216,
294601,
302793,
343757,
212690,
319187,
278227,
286420,
229076,
286425,
319194,
278235,
301163,
278238,
229086,
286432,
294625,
294634,
302838,
319226,
286460,
278274,
302852,
278277,
302854,
294664,
311048,
352008,
319243,
311053,
302862,
319251,
294682,
278306,
188199,
294701,
278320,
319280,
319290,
229192,
302925,
188247,
188252,
237409,
229233,
294776,
360317,
294785,
327554,
360322,
40840,
40851,
294803,
188312,
294811,
319390,
294817,
319394,
40865,
294821,
311209,
180142,
343983,
294831,
188340,
40886,
319419,
294844,
294847,
393177,
294876,
294879,
294883,
393190,
294890,
311279,
278513,
237555,
278516,
311283,
278519,
237562
] |
5d4a77e04ef19323a3a3c6051309245f2821cb59
|
43a2fb0182c31072e3a129057c8c8b6a6626eacc
|
/PopCaveUITests/PopCaveUITests.swift
|
afe55d6053109bb50db7e42438fd0a4f084c1c6b
|
[] |
no_license
|
HenrikSandberg/PopCave
|
a2a861dbcf885efe2b72f1334d9b4c67146ffd69
|
cb8ef948b5043885bfbdb250ae3308e8ee43ff30
|
refs/heads/master
| 2020-09-09T15:23:59.358656 | 2020-01-23T09:19:49 | 2020-01-23T09:19:49 | 221,482,774 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,470 |
swift
|
//
// PopCaveUITests.swift
// PopCaveUITests
//
// Created by Henrik Anthony Odden Sandberg on 13/11/2019.
// Copyright © 2019 Henrik Anthony Odden Sandberg. All rights reserved.
//
import XCTest
class PopCaveUITests: 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
// 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() {
// 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() {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, *) {
// This measures how long it takes to launch your application.
measure(metrics: [XCTOSSignpostMetric.applicationLaunch]) {
XCUIApplication().launch()
}
}
}
}
|
[
274432,
372736,
415744,
182277,
354310,
354311,
43016,
354312,
403463,
436235,
399372,
360463,
358418,
376853,
436248,
237599,
178215,
253996,
430127,
272432,
405552,
403507,
378933,
378934,
358455,
249912,
385078,
352314,
436283,
32829,
225347,
352324,
403524,
436293,
352327,
385095,
399433,
163916,
368717,
333902,
436304,
176209,
329812,
381013,
53334,
104534,
254039,
411738,
426074,
368732,
272477,
356446,
200795,
180317,
438374,
32871,
176231,
352359,
438378,
395373,
385135,
422000,
432241,
249976,
266361,
292987,
385147,
374913,
374914,
422020,
168069,
381061,
168070,
415883,
426124,
381071,
333968,
436372,
196758,
430231,
422044,
329884,
192670,
192671,
362658,
49317,
333990,
377010,
104633,
260285,
268479,
395458,
139459,
374984,
377033,
164043,
417996,
436429,
266447,
346319,
368849,
368850,
372943,
139478,
385240,
254171,
379102,
147679,
147680,
334049,
356575,
268515,
387299,
18661,
379110,
383208,
205034,
254189,
149743,
379120,
254193,
260337,
260338,
372979,
381173,
411892,
395511,
436471,
438512,
375040,
260355,
147716,
272644,
266504,
338187,
338188,
368908,
180494,
375052,
194832,
325904,
395536,
262419,
254228,
272661,
338196,
379157,
61720,
381210,
178459,
377116,
338217,
325930,
358698,
260396,
334121,
418095,
438575,
336177,
358707,
332084,
438583,
362809,
379193,
278843,
127292,
155968,
268609,
438592,
270663,
368969,
254285,
377168,
344402,
348499,
348501,
389465,
272730,
436570,
383327,
332128,
215395,
366948,
383338,
160111,
362864,
354672,
272755,
385407,
385409,
436609,
266628,
340356,
436613,
106893,
270733,
264591,
385423,
420241,
225684,
373141,
385437,
389534,
397732,
254373,
385449,
375211,
115116,
272815,
436659,
334259,
342454,
338359,
385463,
336319,
326083,
436677,
188870,
416201,
129484,
154061,
373196,
256476,
377309,
377310,
184799,
432608,
369121,
369124,
420326,
432616,
334315,
360945,
139766,
254459,
410108,
410109,
324098,
166403,
377346,
377352,
334345,
340489,
410126,
393745,
385554,
397841,
342549,
420374,
254487,
258584,
188957,
342560,
416288,
350758,
350759,
358951,
358952,
385578,
197166,
397872,
330291,
266812,
33344,
385603,
348741,
381515,
348748,
375373,
426575,
369236,
385620,
244311,
430681,
270938,
332379,
191065,
436831,
260705,
416353,
375396,
268901,
184938,
373357,
184942,
176751,
389744,
420461,
346739,
346741,
352885,
352886,
356983,
209529,
344697,
420473,
244345,
356984,
373377,
422529,
152196,
166533,
201348,
356999,
348807,
369285,
344714,
356998,
375438,
377487,
326288,
363155,
336531,
180886,
264855,
352921,
275102,
344737,
176805,
340645,
352938,
248494,
418479,
164532,
383668,
160441,
342714,
377531,
355006,
377534,
39616,
422591,
385737,
135888,
385745,
369365,
369366,
385751,
361178,
363228,
352989,
352990,
383708,
436957,
264929,
295649,
338658,
385763,
418529,
436960,
369383,
361194,
285419,
346859,
269036,
330476,
373485,
373486,
432883,
203511,
342775,
275193,
383740,
344829,
432894,
35584,
133889,
197377,
430853,
346889,
383755,
430860,
326413,
62222,
434956,
418579,
197398,
207639,
426777,
326428,
363295,
344864,
430880,
197412,
336678,
342827,
355117,
328495,
197424,
197428,
191285,
336693,
377656,
197433,
273209,
273211,
355129,
430909,
342846,
160576,
355136,
355138,
416577,
348999,
197451,
355147,
355148,
355153,
385878,
385880,
244569,
363353,
197467,
363354,
252766,
420702,
127840,
363361,
363362,
435038,
355173,
351078,
197479,
342888,
385895,
439145,
385901,
207728,
197489,
420722,
381811,
201590,
164730,
398205,
336765,
340865,
254851,
260995,
330627,
369541,
392071,
349066,
236427,
349068,
252812,
400271,
355216,
381840,
390034,
392080,
224149,
256918,
256919,
256920,
430999,
377754,
359332,
398244,
422825,
326571,
172971,
377778,
326580,
261045,
261046,
273336,
326586,
273341,
377789,
330688,
379845,
363462,
127945,
211913,
273353,
373705,
326602,
252878,
342990,
433104,
359380,
418774,
386007,
433112,
433116,
207839,
340960,
347104,
386016,
398305,
340967,
123880,
418793,
187372,
343020,
383980,
412653,
248815,
222193,
347122,
127990,
271351,
349176,
201721,
383994,
349179,
435195,
328701,
437245,
257023,
125953,
328705,
386049,
357380,
410629,
418819,
330759,
377863,
330766,
347150,
361487,
384015,
433166,
386068,
433173,
326684,
384031,
336928,
336930,
398370,
330789,
357413,
248871,
375848,
410665,
357420,
345137,
361522,
412725,
386108,
404550,
377927,
218187,
250955,
250965,
339031,
156763,
375902,
375903,
392288,
439391,
253028,
214116,
250982,
214119,
257126,
265323,
398444,
62574,
351343,
357487,
187505,
330867,
119925,
377974,
349304,
363643,
66684,
384127,
248960,
392320,
349315,
349317,
402568,
140426,
363658,
373902,
386191,
224400,
326803,
265366,
347286,
359574,
222364,
339101,
351389,
418975,
429216,
265381,
380069,
124073,
367791,
367792,
373937,
367798,
324790,
402618,
421050,
339131,
265410,
253124,
113863,
402632,
259275,
419028,
259285,
357594,
339167,
222441,
414956,
421102,
253168,
386288,
66802,
351475,
251124,
271607,
369912,
52473,
369913,
386296,
52476,
412926,
439550,
386304,
437504,
439563,
414989,
259346,
380178,
429332,
367897,
367898,
245018,
115997,
222496,
412963,
257323,
369964,
353581,
273713,
382257,
208179,
345397,
345398,
382264,
159033,
333114,
333115,
347451,
193853,
386363,
359747,
359748,
257353,
257354,
337226,
345418,
406862,
224591,
259408,
437585,
331091,
150868,
378201,
294236,
374110,
372064,
429410,
437602,
114022,
253288,
265579,
327030,
163190,
421240,
384379,
357763,
253316,
384391,
388488,
263561,
9618,
112019,
370066,
398740,
411028,
370072,
396697,
253339,
253340,
343457,
396709,
245160,
333224,
374189,
380335,
355761,
359860,
359861,
259513,
380348,
380350,
54719,
200136,
273865,
361928,
339403,
425417,
337359,
329168,
327122,
329170,
425434,
329181,
429540,
3557,
3559,
271850,
271853,
329198,
411119,
116209,
259569,
251379,
253431,
386551,
359931,
398844,
210429,
216575,
343552,
366081,
245249,
271880,
208397,
359949,
329231,
253456,
413202,
253462,
388630,
175640,
370200,
431646,
146976,
157219,
157220,
372261,
394793,
245290,
245291,
431662,
396850,
200245,
343606,
210489,
134715,
421437,
235069,
396865,
147011,
265800,
273992,
147020,
128589,
421452,
333389,
265809,
333394,
353875,
396885,
179800,
396889,
196184,
396896,
155238,
388712,
388713,
204394,
138862,
206447,
188021,
366198,
339579,
337533,
210558,
210559,
396927,
415360,
419462,
149127,
149128,
210569,
415369,
224907,
419464,
431754,
415376,
405140,
274071,
425624,
259741,
208547,
153252,
208548,
245413,
255651,
399014,
210601,
364202,
384693,
337590,
224951,
224952,
370359,
415419,
259780,
333508,
267978,
403149,
333522,
425682,
345813,
370390,
272087,
224985,
245471,
325345,
159462,
337638,
181992,
345832,
333543,
345835,
325357,
397040,
12017,
212721,
431861,
274170,
175874,
360194,
173828,
249606,
395018,
395019,
409355,
395026,
366358,
169751,
421657,
345882,
435993,
431901,
341791,
339746,
325411,
255781,
167720,
378666,
399148,
202541,
431918,
153392,
378673,
403248,
345910,
274234,
384826,
409404,
436029,
431935,
325444,
337734,
339782,
325449,
341837,
415566,
272207,
272208,
323405,
337746,
431955,
325460,
376661,
341846,
339799,
345942,
345950,
362336,
259937,
255844,
368486,
384871,
409446,
40809,
368489,
415592,
282476,
425832,
214894,
362351,
214896,
274288,
372592,
325491,
417648,
276343,
274296,
333687,
350072,
360315,
112510,
182145,
253828,
325508,
243590,
333700,
350091,
350092,
372625,
425875,
350102,
337816,
329627,
350108,
376733,
333727,
354210,
436130,
118693,
436135,
10153,
438186,
362411,
253868,
370604,
362418,
128955,
188349,
362442,
380874,
346066,
212947,
212953,
403421,
219102,
436189,
329696,
436199,
174058,
253930,
337899,
247786,
380910,
329707,
436209,
432114,
385011,
380922,
380923,
415740,
268286
] |
92badbda1cf00507a04c4144dffadaf36c232825
|
065ff5bbe07ca88eb304a2ba0252a4c42418cb88
|
/CalendarTests/CalendarTests.swift
|
de81171dab6448b381e35b97ea9b3aa19f2dd5b7
|
[] |
no_license
|
iceboxi/CustomCalendar
|
1c84109d292d2b786f8c4520a7f631cd8aa63bf9
|
f8aca8560bfb34a1aa9ca88fea7c6ead5a70d010
|
refs/heads/main
| 2023-06-26T12:02:20.148186 | 2021-07-27T08:05:35 | 2021-07-27T08:05:35 | 389,897,086 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 5,614 |
swift
|
//
// CalendarTests.swift
// CalendarTests
//
// Created by ice on 2021/7/3.
//
import XCTest
@testable import Calendar
class CalendarTests: XCTestCase {
var session: NetworkSessionMock!
var manager: NetworkManager!
override func setUpWithError() throws {
session = NetworkSessionMock()
manager = NetworkManager(session: session)
}
override func tearDownWithError() throws {
session = nil
manager = nil
}
func testClassModelConvert() throws {
let model = CourseAPIModel.ClassModel.convert(with: testJson)
XCTAssertEqual(model?.available.count, 8)
XCTAssertEqual(model?.booked.count, 3)
}
func testAPIMock() throws {
let promise = expectation(description: "Completion handler invoked")
let data = testJson.data(using: .utf8)
session.data = data
let url = URL(fileURLWithPath: "url")
var model: CourseAPIModel.ClassModel?
manager.loadData(from: url) { result in
model = result
promise.fulfill()
}
wait(for: [promise], timeout: 5)
XCTAssertEqual(model?.available.count, 8)
XCTAssertEqual(model?.booked.count, 3)
}
func testExpandSchedule() throws {
let json = """
{
"available": [
{
"start": "2020-07-04T08:30:00Z",
"end": "2020-07-04T16:00:00Z"
},
{
"start": "2020-07-05T08:30:00Z",
"end": "2020-07-05T16:00:00Z"
},
{
"start": "2020-07-06T08:30:00Z",
"end": "2020-07-06T16:00:00Z"
}
],
"booked": [
{
"start": "2999-07-24T17:30:00Z",
"end": "2999-07-24T18:30:00Z"
},
{
"start": "2999-07-27T17:00:00Z",
"end": "2999-07-27T17:30:00Z"
},
{
"start": "2999-07-28T11:00:00Z",
"end": "2999-07-28T11:30:00Z"
}
]
}
"""
let model = CourseAPIModel.ClassModel.convert(with: json)
let result = model?.expandSchedule()
XCTAssertEqual(result?.keys.count, 2)
}
func testExpandFilterOlderSchedule() throws {
let json = """
{
"available": [
{
"start": "2020-07-04T08:30:00Z",
"end": "2020-07-04T16:00:00Z"
},
{
"start": "2020-07-05T08:30:00Z",
"end": "2020-07-05T16:00:00Z"
},
{
"start": "2020-07-06T08:30:00Z",
"end": "2020-07-06T16:00:00Z"
}
],
"booked": [
{
"start": "2020-07-24T17:30:00Z",
"end": "2020-07-24T18:30:00Z"
},
{
"start": "2020-07-27T17:00:00Z",
"end": "2020-07-27T17:30:00Z"
},
{
"start": "2020-07-28T11:00:00Z",
"end": "2020-07-28T11:30:00Z"
}
]
}
"""
let model = CourseAPIModel.ClassModel.convert(with: json)
let result = model?.expandSchedule()
XCTAssertEqual(result?.keys.count, 0)
}
func testPerformanceExample() throws {
measure {
let promise = expectation(description: "Completion handler invoked")
let data = testJson.data(using: .utf8)
session.data = data
let url = URL(fileURLWithPath: "url")
var model: CourseAPIModel.ClassModel?
manager.loadData(from: url) { result in
model = result
_ = model?.expandSchedule()
promise.fulfill()
}
wait(for: [promise], timeout: 5)
}
}
func testInvaildData() throws {
let promise = expectation(description: "Completion handler invoked")
let json = """
{
"available": [
{
"start": "2021-07-23T08:30:00Z",
"end": "2021-07-23T16:00:00Z"
}
],
"booked": ""
}
"""
let data = json.data(using: .utf8)
session.data = data
let url = URL(fileURLWithPath: "url")
var model: CourseAPIModel.ClassModel?
manager.loadData(from: url) { result in
model = result
promise.fulfill()
}
wait(for: [promise], timeout: 5)
XCTAssertNil(model)
}
func testExpandSchedule2() throws {
let json = """
{
"available": [
{
"start": "2021-07-23T08:30:00Z",
"end": "2021-07-23T10:00:00Z"
}
],
"booked": [
]
}
"""
let model = CourseAPIModel.ClassModel.convert(with: json)
let result = model?.expandSchedule()
XCTAssertEqual(result?.keys.count, 1)
XCTAssertEqual(result?.keys.first, "2021/07/23")
XCTAssertEqual(result?[(result?.keys.first)!]?.count, 3)
}
}
|
[
-1
] |
bdb91f0081409d7b91ca01e801ccb2ea2c718164
|
f1ff7ebac97dcfaa70517d2a1d843bba877045ca
|
/ios/Runner/AppDelegate.swift
|
0c5f2557b2833083698fbd83aabe57d682a65f4a
|
[] |
no_license
|
OmarMaklad/aile
|
7e2c44ff6a9bb7ffd7d02b90f282b4bd62300992
|
135c1e3fa99af79d933184e8759157013db8de2c
|
refs/heads/master
| 2023-06-08T04:47:37.526038 | 2021-05-02T12:42:51 | 2021-05-02T12:42:51 | 360,469,035 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 667 |
swift
|
import UIKit
import Flutter
import Firebase
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
// configureFirebaseNotifications()
GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
func configureFirebaseNotifications() -> Void {
if #available(iOS 10.0, *) {
UNUserNotificationCenter.current().delegate = self
}
FirebaseApp.configure()
}
}
|
[
1170,
346341,
435030
] |
fc8e52e3705347de01adced2737912dd96e99d3c
|
79e1f4997e96f4e835139c48f6d8627aeb6779c3
|
/insta_app/Core/Network/RequestRouter.swift
|
1ced902308acc288fa1db089c8c251b1d7957a70
|
[] |
no_license
|
ArtemB49/InstagramImagination
|
2ba753b4ca28ee55272b164019a1e9c2b611cc5f
|
1c797ce32998c1f84fe26800cc1e7556b0da9893
|
refs/heads/master
| 2020-03-26T23:38:51.833935 | 2018-08-25T11:24:21 | 2018-08-25T11:24:21 | 145,557,784 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 1,058 |
swift
|
/**
* Протокол роутера запросов
*/
import Foundation
import Alamofire
enum RequestRouterEncoding {
case url, json
}
protocol RequestRouter: URLRequestConvertible {
var baseUrl: URL { get }
var method: HTTPMethod { get }
var path: String { get }
var parameters: Parameters? { get }
var fullUrl: URL { get }
var encoding: RequestRouterEncoding { get }
}
extension RequestRouter {
var fullUrl: URL {
return baseUrl.appendingPathComponent(path)
}
var encoding: RequestRouterEncoding {
return .url
}
func asURLRequest() throws -> URLRequest {
var urlRequest = URLRequest(url: fullUrl)
urlRequest.httpMethod = method.rawValue
switch self.encoding {
case .url:
let url = try URLEncoding.default.encode(urlRequest, with: parameters)
print("--- URL: \(url) ----")
return url
case .json:
return try JSONEncoding.default.encode(urlRequest, with: parameters)
}
}
}
|
[
-1
] |
8ab7c359733fec0d154cf210935609a7afdf7a6f
|
9c2ab37df012fc724c36273139655c0bfddfc2cb
|
/DYZB/DYZB/Classes/Tools/Extension/UIColorExtension.swift
|
3c956d272b06cbb39ec195a6a3d546a7d2f8f340
|
[
"MIT"
] |
permissive
|
listen-li/DYZB
|
d14fd28ae9dac40729fdb9ed5500d84683ee7e32
|
f7058cb6f11295647f47d5cb25b1d4b76c82bb11
|
refs/heads/master
| 2021-01-01T04:37:47.442325 | 2017-08-18T09:54:10 | 2017-08-18T09:54:10 | 97,213,319 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 498 |
swift
|
//
// UIColorExtension.swift
// DYZB
//
// Created by admin on 17/7/17.
// Copyright © 2017年 smartFlash. All rights reserved.
//
import UIKit
extension UIColor{
convenience init(r:CGFloat,g:CGFloat,b:CGFloat) {
self.init(red: r / 255.0, green: g / 255.0, blue: b/255.0, alpha: 1.0)
}
class func randomColor() -> UIColor {
return UIColor(r: CGFloat(arc4random_uniform(256)), g: CGFloat(arc4random_uniform(256)), b: CGFloat(arc4random_uniform(256)))
}
}
|
[
-1
] |
35a475a098c2fe8af5eff638f742686a97896dbc
|
b8d569c5afed1f7dd3de9bb4ce8f2ec27e59ff0e
|
/ToDoList/ToDo.swift
|
c30c1f822ca7ba7647ee08f93f3b12f095e3813f
|
[] |
no_license
|
jadeloveland/ToDopList
|
931e4073cb02c55ba2ab1066835b3ea1a90a1392
|
386e9a02a7cd1830c2a8ea32163418a492ebe576
|
refs/heads/master
| 2020-06-20T07:00:31.568276 | 2019-07-15T18:42:06 | 2019-07-15T18:42:06 | 197,034,743 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 59 |
swift
|
class ToDo {
var name = ""
var important = false
}
|
[
-1
] |
2b0bc531ac7b36ada0220a5bb71b00c1ffd5e3b8
|
6010cc9b4284721ac5346e4f7c3dcbf039f5518a
|
/ProtocoloOP.playground/Contents.swift
|
efec34ec4f0f7ee02cb33ac757e432841fe51d13
|
[] |
no_license
|
aldaircc/Protocol-OP-Swift
|
0938072bdfbec11bb8ccbbb78f2322a3a3d80ab0
|
f6f0c5588b5432bb6389de6e2449b9e930abaebf
|
refs/heads/master
| 2023-01-13T09:57:40.560785 | 2020-11-09T19:01:04 | 2020-11-09T19:01:04 | 311,436,635 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 838 |
swift
|
import UIKit
protocol Phone {
var name: String { get }
var canCall: Bool { get }
var canDive: Bool { get }
}
protocol Touchable {
var sizeScreen: Int { get }
}
protocol Moveable {
var weight: Double { get }
}
extension Phone {
var canDive: Bool { return self is Touchable }
var canCall: Bool { return self is Moveable || self is Touchable}
}
struct IPhone: Phone, Touchable, Moveable {
var name: String
var sizeScreen: Int
var weight: Double
}
struct NextTelRadio: Phone, Moveable {
var name: String
var weight: Double
}
let myIphone = IPhone.init(name: "AldairIphone", sizeScreen: 6, weight: 120.0)
myIphone.name
myIphone.canDive
myIphone.canCall
let myNextTel = NextTelRadio.init(name: "RadioPhone", weight: 2.0)
myNextTel.name
myNextTel.canCall
myNextTel.canDive
|
[
-1
] |
baad3fb740d97ea69d0a4d86a95b00dcad2544b1
|
da58519d0677331c68853c59df5f7161197d6c12
|
/QuoteMe/QuoteMeTests/QuoteMeTests.swift
|
004a672a2be124021bc6529c19448ed9343f9d1f
|
[] |
no_license
|
jasoliyajatin281/IOS_Single_Page_App
|
2ebaecca979f5c876b2969e9ee5c0a129b47f725
|
d5cf995cf343fc0410eb298c97f978d664ff6efd
|
refs/heads/master
| 2020-07-06T12:32:13.942470 | 2019-08-18T14:48:20 | 2019-08-18T14:48:20 | 203,018,646 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 898 |
swift
|
//
// QuoteMeTests.swift
// QuoteMeTests
//
// Created by Student on 2019-06-02.
// Copyright © 2019 Priyanka. All rights reserved.
//
import XCTest
@testable import QuoteMe
class QuoteMeTests: 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,
98333,
16419,
229413,
204840,
278570,
344107,
155694,
253999,
229430,
319542,
163896,
180280,
352315,
376894,
352326,
254027,
311372,
196691,
278615,
385116,
237663,
254048,
319591,
221290,
278634,
319598,
352368,
204916,
131191,
237689,
278655,
278677,
196760,
426138,
278685,
311458,
278691,
49316,
173,
32941,
278704,
377009,
278708,
131256,
295098,
417988,
417994,
139479,
254170,
229597,
311519,
205035,
385262,
286958,
344313,
327929,
147717,
368905,
180493,
254226,
368916,
262421,
377114,
237856,
237857,
278816,
311597,
98610,
180535,
336183,
278842,
287041,
319821,
254286,
344401,
377169,
368981,
155990,
368984,
106847,
98657,
270701,
246127,
270706,
139640,
246137,
106874,
246136,
311685,
106888,
385417,
311691,
385422,
213403,
246178,
385454,
311727,
377264,
311738,
33211,
278970,
336317,
319930,
336320,
311745,
278978,
254406,
188871,
278993,
278999,
328152,
369116,
287198,
279008,
279013,
279018,
319981,
319987,
279029,
254456,
279032,
377338,
377343,
279039,
254465,
287241,
279050,
139792,
303636,
393751,
254488,
279065,
377376,
377386,
197167,
385588,
352829,
115270,
385615,
426576,
369235,
139872,
66150,
344680,
139892,
344696,
287352,
279164,
189057,
311941,
336518,
311945,
369289,
344715,
279177,
311949,
287374,
377489,
311954,
352917,
230040,
271000,
377497,
303771,
377500,
205471,
344738,
139939,
279206,
295590,
287404,
205487,
303793,
336564,
164533,
287417,
287422,
66242,
377539,
164560,
385747,
279252,
361176,
418520,
287452,
295652,
369385,
418546,
312052,
312053,
172792,
344827,
221948,
205568,
295682,
197386,
434957,
312079,
426774,
197399,
426775,
336671,
344865,
197411,
279336,
295724,
312108,
197422,
353070,
164656,
295729,
353069,
328499,
353078,
197431,
230199,
353079,
336702,
353094,
353095,
353109,
377686,
230234,
189275,
435039,
295776,
303972,
385893,
246641,
246643,
295798,
246648,
361337,
279417,
254850,
369538,
287622,
58253,
426895,
295824,
189348,
353195,
140204,
377772,
353197,
304051,
230332,
377790,
353215,
353216,
213957,
213960,
345033,
279498,
386006,
418776,
50143,
123881,
304110,
320494,
271350,
295927,
304122,
320507,
328700,
328706,
410627,
320516,
295942,
386056,
353290,
230410,
377869,
320527,
238610,
418837,
140310,
197657,
336929,
369701,
345132,
238639,
312373,
238651,
361535,
377926,
361543,
214086,
238664,
353367,
156764,
156765,
361566,
304222,
173166,
377972,
353397,
377983,
402565,
279685,
222343,
386189,
296086,
238743,
296092,
238765,
279728,
238769,
402613,
337077,
353479,
353481,
353482,
402634,
189653,
419029,
148696,
296153,
279774,
304351,
304356,
222440,
328940,
279792,
353523,
386294,
386301,
320770,
386306,
279814,
328971,
312587,
353551,
320796,
222494,
369956,
353584,
345396,
386359,
116026,
378172,
222524,
279875,
312648,
337225,
304456,
230729,
238927,
353616,
296273,
222559,
378209,
230756,
386412,
230765,
279920,
312689,
296307,
116084,
337281,
148867,
378244,
296329,
304524,
296335,
9619,
370071,
279974,
173491,
304564,
353719,
361927,
370123,
148940,
280013,
312782,
222675,
353750,
271843,
280041,
361963,
296433,
321009,
280055,
288249,
329225,
230921,
296461,
304656,
329232,
370197,
402985,
394794,
230959,
312880,
288309,
312889,
288318,
124485,
288326,
288327,
239198,
99938,
312940,
222832,
370296,
247416,
337534,
337535,
263809,
288392,
239250,
419478,
345752,
255649,
206504,
321199,
337591,
321207,
296632,
280251,
321219,
280267,
403148,
9936,
9937,
313041,
370388,
272085,
345814,
181975,
280278,
280280,
18138,
345821,
321247,
321249,
345833,
345834,
280300,
67315,
173814,
313081,
124669,
288512,
288516,
280329,
321302,
345879,
116505,
321310,
255776,
247590,
362283,
378668,
296755,
321337,
345919,
436031,
403267,
345929,
337745,
18262,
362327,
370522,
345951,
362337,
345955,
296806,
288619,
214895,
313199,
362352,
313203,
124798,
182144,
305026,
67463,
329622,
337815,
124824,
214937,
436131,
354212,
436137,
362417,
124852,
288697,
362431,
214977,
174019,
214984,
321480,
362443,
247757,
280541,
329695,
436191,
313319,
354280,
247785,
337895,
436205,
362480,
329712,
313339,
43014,
354316,
313357,
182296,
354345,
223274,
321583,
124975,
346162,
124984,
288828,
436285,
288833,
288834,
436292,
403525,
436301,
338001,
354385,
338003,
280661,
329814,
338007,
354393,
280675,
280677,
43110,
321637,
329829,
436329,
313447,
288879,
280694,
215164,
313469,
215166,
280712,
215178,
346271,
436383,
362659,
239793,
125109,
182456,
379071,
149703,
338119,
346314,
321745,
387296,
280802,
379106,
338150,
346346,
321772,
125169,
338164,
436470,
125183,
149760,
411906,
125188,
313608,
125193,
125198,
125199,
272658,
125203,
338197,
125208,
305440,
125217,
338218,
321840,
379186,
125235,
280887,
125240,
321860,
182598,
289110,
215385,
272729,
379225,
354655,
321894,
280939,
354676,
313727,
436608,
362881,
240002,
436611,
248194,
395659,
395661,
108944,
240016,
190871,
149916,
420253,
141728,
289189,
108972,
272813,
338356,
436661,
289232,
281040,
256477,
281072,
174593,
420369,
289304,
322078,
207393,
182817,
289332,
174648,
338489,
338490,
322120,
281166,
297560,
354911,
436832,
436834,
191082,
313966,
420463,
281199,
346737,
313971,
346740,
420471,
330379,
330387,
117396,
346772,
330388,
264856,
289434,
363163,
346779,
338613,
314040,
109241,
158394,
248517,
363211,
363230,
289502,
264928,
338662,
330474,
346858,
289518,
199414,
363263,
35583,
191235,
264968,
322316,
117517,
322319,
166676,
207640,
289576,
191283,
273207,
355130,
289598,
355139,
420677,
355146,
355154,
281427,
281433,
322395,
355165,
355178,
207727,
330609,
207732,
158593,
240518,
224145,
355217,
256922,
289690,
420773,
289703,
256935,
363438,
347055,
289727,
273344,
330689,
363458,
379844,
19399,
338899,
330708,
248796,
248797,
207838,
347103,
314342,
52200,
289774,
347123,
240630,
314362,
257024,
330754,
330763,
330772,
281626,
248872,
322612,
314436,
314448,
339030,
314467,
281700,
257125,
322663,
273515,
207979,
404593,
363641,
363644,
150657,
248961,
330888,
363669,
339100,
380061,
429214,
199839,
339102,
265379,
249002,
306346,
3246,
421048,
339130,
265412,
290000,
298208,
298212,
298213,
330984,
298221,
298228,
216315,
208124,
363771,
388349,
437505,
322824,
257305,
126237,
339234,
109861,
372009,
412971,
306494,
216386,
224586,
372043,
331090,
314710,
372054,
159066,
314720,
314726,
314728,
380271,
314739,
208244,
249204,
314741,
290173,
306559,
314751,
298374,
314758,
314760,
142729,
388487,
314766,
306579,
282007,
290207,
314783,
314789,
314791,
396711,
396712,
282024,
241066,
314798,
380337,
380338,
150965,
380357,
339398,
306639,
413137,
429542,
191981,
191990,
290301,
282114,
372227,
323080,
323087,
323089,
175639,
388632,
396827,
134686,
282146,
306723,
355876,
347694,
290358,
265798,
265804,
396882,
290390,
44635,
396895,
323172,
282213,
323178,
224883,
314998,
323196,
175741,
339584,
224901,
282245,
282246,
323217,
282259,
323236,
298661,
282280,
61101,
364207,
224946,
110268,
224958,
282303,
323264,
274115,
306890,
241361,
241365,
298712,
298720,
12010,
282348,
282358,
175873,
339715,
323331,
323332,
339720,
372496,
323346,
249626,
282400,
339745,
241441,
241442,
257830,
421672,
282417,
282427,
315202,
307011,
339783,
216918,
241495,
307039,
241528,
339841,
315273,
315274,
372626,
380821,
282518,
282519,
118685,
298909,
323507,
290745,
274371,
151497,
372701,
298980,
380908,
282633,
241692,
102437,
315432,
315434,
102445,
233517,
176175,
241716,
241720,
225351,
315465,
315476,
307289,
200794,
315487,
356447,
438377,
315498,
299121,
233589,
266357,
422019,
241808,
381073,
323729,
233636,
299174,
405687,
184505,
299198,
258239,
389313,
299203,
299209,
372941,
282831,
266449,
356576,
176362,
307435,
438511,
381172,
356602,
184570,
184575,
381208,
315673,
299293,
151839,
233762,
217380,
151847,
282919,
332083,
332085,
332089,
315706,
282939,
241986,
438596,
332101,
323913,
348492,
323916,
323920,
250192,
348500,
168281,
332123,
332127,
323935,
242023,
242029,
160110,
242033,
291192,
340357,
225670,
332167,
242058,
373134,
291224,
242078,
283038,
61857,
315810,
315811,
381347,
61859,
340398,
61873,
61880,
283064,
127427,
127428,
283075,
324039,
373197,
176601,
242139,
160225,
242148,
291311,
233978,
291333,
340490,
348682,
258581,
291358,
283184,
234036,
315960,
348732,
242237,
70209,
348742,
70215,
348749,
381517,
332378,
201308,
242277,
111208,
184940,
373358,
389745,
209530,
356989,
373375,
152195,
348806,
184973,
316049,
111253,
316053,
111258,
111259,
176808,
299699,
299700,
422596,
422599,
291530,
225995,
242386,
422617,
422626,
234217,
299759,
299776,
291585,
430849,
291592,
62220,
422673,
430865,
291604,
422680,
152365,
422703,
422709,
152374,
242485,
160571,
430910,
160575,
160580,
299849,
283467,
381773,
201551,
242529,
349026,
357218,
275303,
308076,
242541,
209785,
177019,
185211,
308092,
398206,
291712,
381829,
316298,
349067,
308107,
349072,
308112,
209817,
324506,
324507,
390045,
185250,
324517,
185254,
316333,
373687,
316343,
349121,
373706,
316364,
340955,
340961,
324586,
340974,
316405,
349175,
201720,
127992,
357379,
324625,
308243,
316437,
201755,
300068,
357414,
300084,
324666,
324667,
308287,
21569,
218186,
300111,
341073,
439384,
250981,
300135,
316520,
300136,
357486,
316526,
144496,
300150,
291959,
300151,
160891,
341115,
300158,
349316,
349318,
373903,
169104,
177296,
308372,
324760,
119962,
300187,
300188,
300201,
300202,
373945,
259268,
283847,
62665,
283852,
283853,
259280,
316627,
333011,
357595,
234733,
234742,
128251,
316669,
439562,
292107,
242954,
414990,
251153,
177428,
349462,
333090,
382258,
300343,
382269,
193859,
177484,
406861,
259406,
234831,
251213,
120148,
283991,
374109,
316765,
292195,
333160,
243056,
316787,
357762,
112017,
234898,
259475,
275859,
112018,
357786,
251298,
333220,
316842,
374191,
210358,
284089,
292283,
415171,
300487,
300489,
366037,
210390,
210391,
210392,
210393,
144867,
54765,
251378,
308723,
333300,
300536,
210433,
366083,
259599,
316946,
308756,
398869,
374296,
374299,
308764,
349726,
431649,
349741,
169518,
431663,
194110,
235070,
349763,
218696,
292425,
243274,
128587,
333388,
333393,
300630,
128599,
235095,
333408,
374372,
300644,
415338,
243307,
54893,
325231,
333430,
366203,
325245,
194180,
415375,
153251,
300714,
210603,
415420,
333503,
218819,
259781,
333509,
333517,
333520,
333521,
333523,
325346,
153319,
325352,
284401,
325371,
194303,
284429,
243472,
366360,
284442,
325404,
325410,
341796,
333610,
399147,
431916,
300848,
317232,
259899,
325439,
325445,
153415,
341836,
415567,
325457,
317269,
341847,
350044,
128862,
284514,
292712,
325484,
423789,
292720,
325492,
276341,
341879,
317304,
333688,
112509,
194429,
55167,
325503,
333701,
243591,
317323,
325515,
243597,
325518,
333722,
350109,
292771,
415655,
333735,
284587,
243637,
301008,
153554,
219101,
292836,
292837,
317415,
325619,
432116,
333817,
292858,
415741,
333828,
358410,
399373,
317467,
145435,
292902,
325674,
243759,
129076,
243767,
358456,
325694,
309345,
194666,
260207,
432240,
333940,
284788,
292992,
333955,
415881,
104587,
235662,
325776,
317587,
284826,
333991,
333992,
284842,
333996,
301251,
309444,
194782,
301279,
317664,
243962,
375039,
309503,
194820,
375051,
325905,
334103,
325912,
211235,
432421,
211238,
358703,
358709,
260418,
6481,
366930,
366929,
6489,
391520,
383332,
383336,
317820,
211326,
317831,
227725,
252308,
39324,
121245,
317852,
285090,
375207,
342450,
334260,
293303,
293310,
342466,
416197,
129483,
342476,
317901,
6606,
334290,
326100,
285150,
342498,
358882,
334309,
195045,
391655,
432618,
375276,
342536,
342553,
416286,
375333,
244269,
375343,
23092,
375351,
244281,
301638,
309830,
293448,
55881,
416341,
244310,
416351,
268899,
39530,
244347,
326287,
375440,
334481,
227990,
318106,
318107,
342682,
318130,
383667,
293556,
342713,
285373,
39614,
318173,
375526,
285415,
342762,
342763,
293612,
129773,
154359,
432893,
162561,
285444,
383754,
326414,
310036,
326429,
293664,
326433,
400166,
293672,
318250,
318252,
375609,
342847,
252741,
293711,
244568,
244570,
293730,
351077,
342887,
326505,
269178,
400252,
359298,
359299,
260996,
113542,
228233,
392074,
228234,
56208,
318364,
310176,
310178,
293800,
236461,
252847,
326581,
326587,
326601,
359381,
433115,
343005,
130016,
64485,
326635,
187374,
383983,
383982,
318461,
293886,
293893,
433165,
384016,
146448,
433174,
252958,
252980,
359478,
203830,
302139,
359495,
392290,
253029,
228458,
351344,
187506,
285814,
392318,
187521,
384131,
302216,
228491,
228493,
285838,
162961,
326804,
351390,
302240,
343203,
253099,
253100,
318639,
367799,
113850,
294074,
64700,
302274,
367810,
343234,
244940,
228563,
359647,
195808,
310497,
228588,
253167,
302325,
261377,
228609,
245019,
253216,
130338,
130343,
130348,
261425,
351537,
318775,
286013,
286018,
146762,
294218,
294219,
318805,
425304,
294243,
163175,
327024,
327025,
327031,
318848,
253317,
384393,
368011,
318864,
318868,
310692,
245161,
286129,
286132,
228795,
425405,
302529,
302531,
163268,
425418,
310732,
64975,
327121,
228827,
286172,
310757,
187878,
245223,
343542,
343543,
359930,
286202,
286205,
302590,
228867,
253451,
253452,
359950,
146964,
253463,
187938,
286244,
245287,
245292,
286254,
425535,
196164,
56902,
179801,
196187,
343647,
310889,
204397,
138863,
188016,
294529,
229001,
310923,
188048,
425626,
229020,
302754,
245412,
40613,
40614,
40615,
229029,
384695,
319162,
327358,
286399,
319177,
212685,
384720,
245457,
302802,
278234,
294622,
278240,
212716,
212717,
294638,
360177,
286459,
278272,
319233,
360195,
278291,
294678,
286494,
409394,
319292,
360252,
360264,
188251,
376669,
245599,
425825,
425833,
417654,
188292,
253829,
327557,
294807,
376732,
311199,
319392,
253856,
294823,
327596,
294843,
188348,
237504,
294850,
384964,
163781,
344013,
212942,
212946,
24532,
212951,
360417,
294886,
253929,
327661,
311281,
311282
] |
3313bb5b254e4264b2f9df413a0566433a688604
|
4a65f6883cdf4e9636b99686cfdc5119078e0f01
|
/AppcentCase/Controllers/CuriosityViewController.swift
|
2f8ef4723221d7f1c49e8f7b054b05a924e36d88
|
[] |
no_license
|
OguzDm/AppcentCase
|
9642231c85a2ca1980fb16c1164c9f9972a2eb78
|
77f8bcf66f03c1b7bed208a78b9188b649dad96e
|
refs/heads/master
| 2023-07-16T18:44:24.040525 | 2021-08-17T13:50:09 | 2021-08-17T13:50:09 | 397,251,811 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 3,934 |
swift
|
//
// CuriosityViewController.swift
// AppcentCase
//
// Created by Oguz Demırhan on 12.08.2021.
//
import UIKit
final class CuriosityViewController: UIViewController, FilterViewControllerDelegate {
func didUpdateFilter(filter: String) {
queryParams["camera"] = filter
currentPage = 1
self.PHOTOS.removeAll()
Service.shared.fetchRequest(rover: .Curiosity,queryParams: queryParams,page: currentPage,sol: sol) { rover in
self.PHOTOS.append(contentsOf: rover.photos)
DispatchQueue.main.async {
self.collectionView.reloadData()
}
}
}
private var collectionView: UICollectionView!
private var PHOTOS = [RoverPhotos]()
private var sol = 1000
private var currentPage = 1
private var queryParams = ["api_key":Constants.apiKEY]
private let activeCameras = ["FHAZ","RHAZ","MAST","CHEMCAM","MAHLI","MARDI","NAVCAM"]
private let filterButton : UIButton = {
let button = UIButton(type: .system)
button.tintColor = #colorLiteral(red: 0.521568656, green: 0.1098039225, blue: 0.05098039284, alpha: 1)
button.backgroundColor = .white
button.setImage(UIImage(named: "filter"), for: .normal)
return button
}()
override func viewDidLoad() {
super.viewDidLoad()
configureCollectionView()
configureCircleButton(button: filterButton, size: 60)
filterButton.addTarget(self, action: #selector(filterButtonAction), for: .touchUpInside)
Service.shared.fetchRequest(rover: .Curiosity,queryParams: queryParams,page: currentPage,sol: sol) { rover in
self.PHOTOS.append(contentsOf: rover.photos)
DispatchQueue.main.async {
self.collectionView.reloadData()
}
}
}
@objc private func filterButtonAction(){
let filterVC = FilterViewController()
filterVC.activeCameras = activeCameras
filterVC.delegate = self
present(filterVC, animated: true, completion: nil)
}
private func configureCollectionView(){
collectionView = UICollectionView(frame: view.bounds, collectionViewLayout: createLayout())
collectionView.delegate = self
collectionView.dataSource = self
collectionView.backgroundColor = .white
collectionView.register(UINib.loadNib(name: RoverCollectionViewCell.reuseIdentifier), forCellWithReuseIdentifier: RoverCollectionViewCell.reuseIdentifier)
view.addSubview(collectionView)
}
}
extension CuriosityViewController: UICollectionViewDelegate {
func collectionView(_ collectionView: UICollectionView, willDisplay cell: UICollectionViewCell, forItemAt indexPath: IndexPath) {
if indexPath.item == PHOTOS.count - 2 {
currentPage += 1
Service.shared.fetchRequest(rover: .Curiosity,queryParams: queryParams,page: currentPage,sol: sol) { rover in
self.PHOTOS.append(contentsOf: rover.photos)
DispatchQueue.main.async {
self.collectionView.reloadData()
}
}
}
}
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
preparePhotoDetailVC(with: PHOTOS[indexPath.item])
}
}
extension CuriosityViewController: UICollectionViewDataSource {
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return PHOTOS.count
}
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: RoverCollectionViewCell.reuseIdentifier, for: indexPath) as! RoverCollectionViewCell
cell.configure(image: PHOTOS[indexPath.item].imgSrc)
return cell
}
}
|
[
-1
] |
33339db6b4262ef7d69ea582f2dd93f8141b1376
|
e083a705cb5aa4605d8bce8150dd1755251aee2d
|
/Sources/SwiftDriver/Toolchains/Toolchain.swift
|
1e7106db24e21fda735ee95843be333fcf7aabf0
|
[
"Apache-2.0",
"Swift-exception"
] |
permissive
|
amomchilov/swift-driver
|
3b08d731ceb6ae34499f9c471876742d05649cb4
|
f9821a1b19fde0e319ff9b69049dd9aea6fa4174
|
refs/heads/main
| 2023-09-02T13:13:47.295739 | 2021-10-27T17:25:38 | 2021-10-27T17:25:38 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 9,009 |
swift
|
//===--------------- Toolchain.swift - Swift Toolchain Abstraction --------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2019 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
import Foundation
import TSCBasic
import SwiftOptions
public enum Tool: Hashable {
case swiftCompiler
case staticLinker(LTOKind?)
case dynamicLinker
case clang
case swiftAutolinkExtract
case dsymutil
case lldb
case dwarfdump
case swiftHelp
case swiftAPIDigester
}
/// Describes a toolchain, which includes information about compilers, linkers
/// and other tools required to build Swift code.
public protocol Toolchain {
init(env: [String: String], executor: DriverExecutor, fileSystem: FileSystem, compilerExecutableDir: AbsolutePath?, toolDirectory: AbsolutePath?)
var env: [String: String] { get }
var fileSystem: FileSystem { get }
var searchPaths: [AbsolutePath] { get }
var executor: DriverExecutor { get }
/// Where we should find compiler executables, e.g. XcodeDefault.xctoolchain/usr/bin
var compilerExecutableDir: AbsolutePath? { get }
var toolDirectory: AbsolutePath? { get }
/// Retrieve the absolute path to a particular tool.
func getToolPath(_ tool: Tool) throws -> AbsolutePath
/// Set an absolute path to be used for a particular tool.
func overrideToolPath(_ tool: Tool, path: AbsolutePath)
/// Remove the absolute path used for a particular tool, in case it was overriden or cached.
func clearKnownToolPath(_ tool: Tool)
/// Returns path of the default SDK, if there is one.
func defaultSDKPath(_ target: Triple?) throws -> AbsolutePath?
/// When the compiler invocation should be stored in debug information.
var shouldStoreInvocationInDebugInfo: Bool { get }
/// Constructs a proper output file name for a linker product.
func makeLinkerOutputFilename(moduleName: String, type: LinkOutputType) -> String
/// Perform platform-specific argument validation.
func validateArgs(_ parsedOptions: inout ParsedOptions,
targetTriple: Triple,
targetVariantTriple: Triple?, diagnosticsEngine: DiagnosticsEngine) throws
/// Adds platform-specific linker flags to the provided command line
func addPlatformSpecificLinkerArgs(
to commandLine: inout [Job.ArgTemplate],
parsedOptions: inout ParsedOptions,
linkerOutputType: LinkOutputType,
inputs: [TypedVirtualPath],
outputFile: VirtualPath,
shouldUseInputFileList: Bool,
lto: LTOKind?,
sanitizers: Set<Sanitizer>,
targetInfo: FrontendTargetInfo
) throws -> AbsolutePath
func runtimeLibraryName(
for sanitizer: Sanitizer,
targetTriple: Triple,
isShared: Bool
) throws -> String
func platformSpecificInterpreterEnvironmentVariables(
env: [String: String],
parsedOptions: inout ParsedOptions,
sdkPath: VirtualPath.Handle?,
targetInfo: FrontendTargetInfo) throws -> [String: String]
func addPlatformSpecificCommonFrontendOptions(
commandLine: inout [Job.ArgTemplate],
inputs: inout [TypedVirtualPath],
frontendTargetInfo: FrontendTargetInfo,
driver: Driver
) throws
var dummyForTestingObjectFormat: Triple.ObjectFormat {get}
}
extension Toolchain {
public var searchPaths: [AbsolutePath] {
// Conditionalize this on the build time host because cross-compiling from
// a non-Windows host, we would use a Windows toolchain, but would want to
// use the platform variable for the path.
#if os(Windows)
return getEnvSearchPaths(pathString: env["Path"], currentWorkingDirectory: fileSystem.currentWorkingDirectory)
#else
return getEnvSearchPaths(pathString: env["PATH"], currentWorkingDirectory: fileSystem.currentWorkingDirectory)
#endif
}
/// Returns the `executablePath`'s directory.
public var executableDir: AbsolutePath {
// If the path is given via the initializer, use that.
if let givenDir = compilerExecutableDir {
return givenDir
}
// If the path isn't given, we are running the driver as an executable,
// so assuming the compiler is adjacent to the driver.
guard let path = Bundle.main.executablePath else {
fatalError("Could not find executable path.")
}
return AbsolutePath(path).parentDirectory
}
/// Looks for `SWIFT_DRIVER_TOOLNAME_EXEC` in the `env` property.
/// - Returns: Environment variable value, if any.
func envVar(forExecutable toolName: String) -> String? {
return env[envVarName(for: toolName)]
}
/// - Returns: String in the form of: `SWIFT_DRIVER_TOOLNAME_EXEC`
private func envVarName(for toolName: String) -> String {
let lookupName = toolName
.replacingOccurrences(of: "-", with: "_")
// FIXME(compnerd) we should extract the extension for generating the
// toolname rather than assuming that we can convert the tool name blindly
.replacingOccurrences(of: ".", with: "_")
.uppercased()
return "SWIFT_DRIVER_\(lookupName)_EXEC"
}
/// Use this property only for testing purposes, for example,
/// to enable cross-compiling tests that depends on macOS tooling such as `dsymutil`.
///
/// Returns true if `SWIFT_DRIVER_TESTS_ENABLE_EXEC_PATH_FALLBACK` is set to `1`.
private var fallbackToExecutableDefaultPath: Bool {
env["SWIFT_DRIVER_TESTS_ENABLE_EXEC_PATH_FALLBACK"] == "1"
}
/// Looks for the executable in the `SWIFT_DRIVER_TOOLNAME_EXEC` environment variable, if found nothing,
/// looks in the `executableDir`, `xcrunFind` or in the `searchPaths`.
/// - Parameter executable: executable to look for [i.e. `swift`].
func lookup(executable: String) throws -> AbsolutePath {
if let overrideString = envVar(forExecutable: executable) {
return try AbsolutePath(validating: overrideString)
} else if let toolDir = toolDirectory,
let path = lookupExecutablePath(filename: executable, searchPaths: [toolDir]) {
// Looking for tools from the tools directory.
return path
} else if let path = lookupExecutablePath(filename: executable, searchPaths: [executableDir]) {
return path
} else if let path = try? xcrunFind(executable: executable) {
return path
} else if ![executableName("swift-frontend"), executableName("swift")].contains(executable),
let parentDirectory = try? getToolPath(.swiftCompiler).parentDirectory,
parentDirectory != executableDir,
let path = lookupExecutablePath(filename: executable, searchPaths: [parentDirectory]) {
// If the driver library's client and the frontend are in different directories,
// try looking for tools next to the frontend.
return path
} else if let path = lookupExecutablePath(filename: executable, searchPaths: searchPaths) {
return path
} else if executable == executableName("swift-frontend") {
// Temporary shim: fall back to looking for "swift" before failing.
return try lookup(executable: executableName("swift"))
} else if fallbackToExecutableDefaultPath {
if self is WindowsToolchain {
if let DEVELOPER_DIR = env["DEVELOPER_DIR"] {
return AbsolutePath(DEVELOPER_DIR)
.appending(component: "Toolchains")
.appending(component: "unknown-Asserts-development.xctoolchain")
.appending(component: "usr")
.appending(component: "bin")
.appending(component: executable)
}
return try getToolPath(.swiftCompiler)
.parentDirectory
.appending(component: executable)
} else {
return AbsolutePath("/usr/bin/" + executable)
}
} else {
throw ToolchainError.unableToFind(tool: executable)
}
}
private func xcrunFind(executable: String) throws -> AbsolutePath {
let xcrun = "xcrun"
guard lookupExecutablePath(filename: xcrun, searchPaths: searchPaths) != nil else {
throw ToolchainError.unableToFind(tool: xcrun)
}
let path = try executor.checkNonZeroExit(
args: xcrun, "--find", executable,
environment: env
).spm_chomp()
return AbsolutePath(path)
}
public func validateArgs(_ parsedOptions: inout ParsedOptions,
targetTriple: Triple,
targetVariantTriple: Triple?, diagnosticsEngine: DiagnosticsEngine) {}
public func addPlatformSpecificCommonFrontendOptions(
commandLine: inout [Job.ArgTemplate],
inputs: inout [TypedVirtualPath],
frontendTargetInfo: FrontendTargetInfo,
driver: Driver
) throws {}
}
@_spi(Testing) public enum ToolchainError: Swift.Error {
case unableToFind(tool: String)
}
|
[
-1
] |
856f96b05471acda39d329a539c36ba532f2dea4
|
c53d776f9ead8bdd028dd321b6e28c10d91c6908
|
/Tests/Admob/Mocks/MockAdMobInterstitial.swift
|
662c2d7f9c6ad4d23033ad0de3baac4a783fc734
|
[
"MIT"
] |
permissive
|
p-morris/WaterfallKit
|
09e0f8e11d42dd106f1406f109b87dc1da1dccb8
|
b535cb7dd892b2479c354fd87f406a2dd8d6cc22
|
refs/heads/master
| 2020-04-03T09:09:24.956023 | 2018-11-15T11:03:05 | 2018-11-15T11:03:05 | 155,155,862 | 2 | 1 | null | null | null | null |
UTF-8
|
Swift
| false | false | 841 |
swift
|
//
// MockAdMobInterstitial.swift
// iOS Video Interstitial Advert MediatorTests
//
// Created by Peter Morris on 08/11/2018.
// Copyright © 2018 Pete Morris. All rights reserved.
//
import XCTest
import UIKit
import GoogleMobileAds
//import WaterfallKit
class MockAdMobInterstitial: AdMobAdProtocol {
static weak var testDelegate: AdmobTestDelegate?
weak var delegate: GADInterstitialDelegate? {
didSet {
MockAdMobInterstitial.testDelegate?.didSetDelegate = true
}
}
required init(adUnitID: String) {
//
}
func load(_ request: GADRequest?) {
MockAdMobInterstitial.testDelegate?.loaded = true
}
func present(fromRootViewController rootViewController: UIViewController) {
MockAdMobInterstitial.testDelegate?.presentedFrom = rootViewController
}
}
|
[
-1
] |
08bf33c038ae5b42173950e166ab79e4b68e4e79
|
6aa15f5e5d4bf307a04a473c0bb7e63f96a83e34
|
/Sources/msgs/trajectory_msgs/MultiDOFJointTrajectoryPointMsg.swift
|
c0ef2ef3dfeaf2b40059291f077ae75f47394bef
|
[
"MIT"
] |
permissive
|
duringhof/RosSwift
|
ac5ca0a559531a5adb3abea515e60a203765155c
|
dbc52721f57204484a551596142a643513193180
|
refs/heads/master
| 2023-03-03T06:25:22.904540 | 2021-02-15T08:31:21 | 2021-02-15T08:31:21 | 331,442,159 | 0 | 0 |
MIT
| 2021-02-15T08:31:22 | 2021-01-20T21:52:24 | null |
UTF-8
|
Swift
| false | false | 1,593 |
swift
|
// Generated by msgbuilder 2020-05-15 06:20:49 +0000
import RosTime
import StdMsgs
extension trajectory_msgs {
/// Each multi-dof joint can specify a transform (up to 6 DOF)
/// There can be a velocity specified for the origin of the joint
/// There can be an acceleration specified for the origin of the joint
public struct MultiDOFJointTrajectoryPoint: Message {
public static let md5sum: String = "3ebe08d1abd5b65862d50e09430db776"
public static let datatype = "trajectory_msgs/MultiDOFJointTrajectoryPoint"
public static let definition = """
# Each multi-dof joint can specify a transform (up to 6 DOF)
geometry_msgs/Transform[] transforms
# There can be a velocity specified for the origin of the joint
geometry_msgs/Twist[] velocities
# There can be an acceleration specified for the origin of the joint
geometry_msgs/Twist[] accelerations
duration time_from_start
"""
public var transforms: [geometry_msgs.Transform]
public var velocities: [geometry_msgs.Twist]
public var accelerations: [geometry_msgs.Twist]
public var time_from_start: Duration
public init(transforms: [geometry_msgs.Transform], velocities: [geometry_msgs.Twist], accelerations: [geometry_msgs.Twist], time_from_start: Duration) {
self.transforms = transforms
self.velocities = velocities
self.accelerations = accelerations
self.time_from_start = time_from_start
}
public init() {
transforms = [geometry_msgs.Transform]()
velocities = [geometry_msgs.Twist]()
accelerations = [geometry_msgs.Twist]()
time_from_start = Duration()
}
}
}
|
[
-1
] |
9625fc458436a267f6633a2442e0f5cf8ff10481
|
f47f06ff8ff9bf3bff9c4a451e4060733178d518
|
/customTabbar/CustomizedTabBar.swift
|
0485798b715bc09e27d53efce3c80246a8d16f5a
|
[] |
no_license
|
DeepikaRamesh1510/CustomTabbar
|
d800cb284bb262e351aeea37c35ff5e0a7f248fd
|
21a30db9319b68e98aba8f3003fe8818c77ff7fb
|
refs/heads/master
| 2022-10-22T03:36:10.448352 | 2020-06-18T09:52:21 | 2020-06-18T09:52:21 | 272,991,335 | 0 | 0 | null | null | null | null |
UTF-8
|
Swift
| false | false | 2,084 |
swift
|
//
// CustomizedTabBar.swift
// customTabbar
//
// Created by Deepika on 18/06/20.
// Copyright © 2020 Deepika. All rights reserved.
//
import UIKit
@IBDesignable
class CustomizedTabBar: UITabBar {
private var shapeLayer: CALayer?
override func draw(_ rect: CGRect) {
self.addShape()
}
private func addShape() {
let shapeLayer = CAShapeLayer()
shapeLayer.path = createPath()
shapeLayer.strokeColor = UIColor.lightGray.cgColor
shapeLayer.fillColor = UIColor.white.cgColor
shapeLayer.lineWidth = 1
if let oldShapeLayer = self.shapeLayer {
self.layer.replaceSublayer(oldShapeLayer, with: shapeLayer)
} else {
self.layer.insertSublayer(shapeLayer, at: 0)
}
self.shapeLayer = shapeLayer
}
private func createPath() -> CGPath {
let height: CGFloat = 37
let path = UIBezierPath()
let centerWidth = self.frame.width / 2
path.move(to: CGPoint(x: 0, y: 0))
path.addLine(to: CGPoint(x: (centerWidth - height * 2), y: 0))
//first curve down
path.addCurve(to: CGPoint(x: centerWidth, y: height), controlPoint1: CGPoint(x: centerWidth - 30, y: 0), controlPoint2: CGPoint(x: centerWidth - 35, y: height))
//second curve up
path.addCurve(to: CGPoint(x: centerWidth + height * 2, y: 0), controlPoint1: CGPoint(x: centerWidth + 35, y: height), controlPoint2: CGPoint(x: centerWidth + 30, y: 0))
//complete the rect
path.addLine(to: CGPoint(x: self.frame.width, y: 0))
path.addLine(to: CGPoint(x: self.frame.width, y: self.frame.height))
path.addLine(to: CGPoint(x: 0, y: self.frame.height))
path.close()
return path.cgPath
}
override func point(inside point: CGPoint, with event: UIEvent?) -> Bool {
let buttonRadius: CGFloat = 35
return abs(self.center.x - point.x) > buttonRadius || abs(point.y) > buttonRadius
}
}
|
[
-1
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.