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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
500383f9552e2e8e189f3a65cdd72d0705d36aa2 | 69b7c996d189d348e5fc09a4a6c716e0853d27c6 | /Weather/Model/NetwotkWeatherManager.swift | aba07c1590070eabc713a96f432131a1b1078738 | [] | no_license | relsyrc/test | 9711dba55dcf1732cf77af3dddfef7c57a17d7c8 | 68ae9aaa20f6c66bb65da063d8115a5261f64633 | refs/heads/main | 2023-07-03T18:42:48.060395 | 2021-08-12T08:31:08 | 2021-08-12T08:31:08 | 395,247,118 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,548 | swift | //
// NetwotkWeatherManager.swift
// Weather
//
// Created by Илья Горшков on 30.07.21.
//
import Foundation
struct NetwotkWeatherManager {
func fetchWeather(latitude: Double, longitude: Double ,completionHandler: @escaping (Weather) -> Void) {
let urlString = "https://api.weather.yandex.ru/v2/forecast?lat=\(latitude)&lon=\(longitude)"
guard let url = URL(string: urlString) else {return}
var request = URLRequest(url: url, timeoutInterval: Double.infinity)
request.addValue(apiKey, forHTTPHeaderField: "X-Yandex-API-Key")
request.httpMethod = "GET"
let task = URLSession.shared.dataTask(with: request) { (data, response, error) in
guard let data = data else {
print(String(describing: error))
return
}
//print(String(data: data, encoding: .utf8)!)
if let wethear = self.parseJson(withData: data) {
completionHandler(wethear)
}
}
task.resume()
}
func parseJson(withData data: Data) -> Weather? {
let decoder = JSONDecoder()
do {
let weatherData = try decoder.decode(WeatherData.self, from: data)
guard let weather = Weather(weatherData: weatherData) else {
return nil
}
return weather
} catch let error as NSError {
print(error.localizedDescription)
}
return nil
}
}
| [
-1
] |
cf3995fc2036cd5975e5277cb52f1cd97f42d680 | 3690acb29aa5ba3e8faa87e1d425d4c26e8ef2b5 | /2016/Puzzles.swift | e9868520fd25670f6ec9ad9399eda11c846940be | [] | no_license | apparentorder/aoc | fb64afdba707cc9a0e4c2bfa30d7844626006f0a | 3182d28914796aacf2fd5ba62dd021f350e0f8c3 | refs/heads/master | 2022-12-26T17:36:01.684375 | 2022-12-26T15:28:32 | 2022-12-26T15:28:32 | 228,545,126 | 4 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 700 | swift | typealias PuzzleResult = Any
struct Puzzle {
var implementation: ((PuzzleInput) -> PuzzleResult)
var input: PuzzleInput
var tests: [PuzzleTest]
}
protocol PuzzleClass {
var puzzleConfig: [String:Puzzle] { get }
init()
}
var PuzzleClasses: [String:PuzzleClass] = [
"d01": Day01(),
"d02": Day02(),
"d03": Day03(),
"d04": Day04(),
"d05": Day05(),
"d06": Day06(),
"d07": Day07(),
"d08": Day08(),
"d09": Day09(),
"d10": Day10(),
"d11": Day11(),
"d12": Day12(),
"d13": Day13(),
"d14": Day14(),
"d15": Day15(),
"d16": Day16(),
"d17": Day17(),
"d18": Day18(),
"d19": Day19(),
"d20": Day20(),
"d21": Day21(),
"d22": Day22(),
"d23": Day23(),
"d24": Day24(),
"d25": Day25(),
]
| [
-1
] |
57e8d773ecf1caa8e469639bbe5870b8ddbb20bd | c81b4e696d641c75b5eff1beca04a36691ec0ccb | /DisplayPlanStatsTests/ShowTextTests.swift | 5c51a89823aa1b2191912b6f5adf22b8c07d9357 | [] | no_license | prizrak1609/TestApp | 573f5257ba2440a14d6f4e10bd2c8a7288563534 | c2062909d18faf1b1b962b94ab2a96ea882f18f5 | refs/heads/master | 2020-12-02T11:27:04.083864 | 2017-06-18T22:10:36 | 2017-06-18T22:10:36 | 96,640,090 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,043 | swift | //
// ShowTextTests.swift
// DisplayPlanStats
//
// Created by Dima Gubatenko on 12.06.17.
// Copyright © 2017 A2Lab. All rights reserved.
//
import XCTest
@testable import DisplayPlanStats
class ShowTextTests: XCTestCase {
func testExample() {
XCTAssertTrue(true)
}
func testShowText() {
let wait = expectation(description: "testShowText")
wait.expectedFulfillmentCount = 6
showText("Test text 0")
showText("Test text 1", time: 2)
showText("Tap on this text", time: 50, onTap: { wait.fulfill() })
showText("Test text 2", time: 2, completionBlock: { wait.fulfill() })
showText("Test text 3", time: 2, onTap: { wait.fulfill() }, completionBlock: { wait.fulfill() })
showText("Tap on this text", onTap: { wait.fulfill() })
showText("Test text 5", onTap: { wait.fulfill() }, completionBlock: { wait.fulfill() })
showText("Test text 6", completionBlock: { wait.fulfill() })
waitForExpectations(timeout: 100, handler: nil)
}
}
| [
-1
] |
ba09e4fd0f5696c03456790f36ad558ae6a1d4c1 | 960e5fa8c04c589c17a41aa58f917d7dc393b41e | /YQSlideMenuControllerUITests/YQSlideMenuControllerUITests.swift | f9f7bf94cd7b6a6c9a90c7fc1bf36ff85a54ed3b | [
"MIT"
] | permissive | yuyedaidao/YQSlideMenuController | e5ccee8678e734a713bbd9e885a3de8a699f5a41 | 642e3bfa2f5009972fea5697bf686acdf60504dc | refs/heads/master | 2021-01-12T10:03:16.095410 | 2016-12-26T01:33:13 | 2016-12-26T01:33:13 | 76,344,995 | 6 | 1 | null | null | null | null | UTF-8 | Swift | false | false | 1,278 | swift | //
// YQSlideMenuControllerUITests.swift
// YQSlideMenuControllerUITests
//
// Created by Wang on 2016/12/12.
// Copyright © 2016年 Wang. All rights reserved.
//
import XCTest
class YQSlideMenuControllerUITests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
// In UI tests it is usually best to stop immediately when a failure occurs.
continueAfterFailure = false
// UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method.
XCUIApplication().launch()
// In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}
func testExample() {
// Use recording to get started writing UI tests.
// Use XCTAssert and related functions to verify your tests produce the correct results.
}
}
| [
333827,
182277,
243720,
282634,
313356,
155665,
305173,
237599,
241695,
223269,
229414,
354342,
315431,
315433,
354346,
278571,
313388,
325675,
102446,
282671,
102441,
229425,
243763,
241717,
180279,
229431,
215095,
213051,
288829,
325695,
288835,
286787,
307269,
237638,
313415,
285360,
239689,
233548,
315468,
333902,
196687,
278607,
311377,
354386,
311373,
329812,
223317,
315477,
200795,
368732,
180317,
323678,
315488,
315489,
45154,
321632,
280676,
313446,
215144,
307306,
194667,
233578,
278637,
288878,
319599,
278642,
284789,
284790,
131190,
288890,
215165,
131199,
194692,
278669,
235661,
333968,
241809,
323730,
278676,
311447,
153752,
327834,
284827,
278684,
329884,
299166,
278690,
311459,
215204,
333990,
284840,
299176,
278698,
284843,
184489,
323761,
184498,
278707,
278713,
223418,
280761,
258233,
180409,
295099,
280767,
227517,
299202,
139459,
309443,
176325,
131270,
301255,
338118,
299208,
227525,
280779,
282832,
321744,
227536,
301270,
229591,
280792,
301271,
147679,
311520,
325857,
334049,
147680,
356575,
280803,
307431,
338151,
295147,
317676,
286957,
395511,
313595,
184574,
309504,
217352,
194832,
227601,
325904,
319764,
278805,
338196,
282908,
311582,
299294,
282912,
278817,
233761,
211239,
282920,
334121,
317738,
325930,
311596,
338217,
321839,
336177,
315698,
98611,
332084,
282938,
307514,
127292,
278843,
287040,
319812,
311622,
280903,
227655,
323914,
201037,
383309,
229716,
289109,
250196,
168280,
379224,
201562,
323934,
391521,
239973,
381286,
285031,
313703,
416103,
280938,
242027,
242028,
321901,
354671,
278895,
287089,
250227,
199030,
227702,
315768,
291193,
315769,
223611,
291194,
248188,
139641,
311679,
211327,
291200,
240003,
158087,
313736,
227721,
242059,
311692,
106893,
227730,
285074,
240020,
190870,
190872,
291225,
293275,
285083,
317851,
242079,
227743,
285089,
293281,
289185,
305572,
156069,
283039,
301482,
311723,
289195,
375211,
234957,
377265,
334259,
338359,
311739,
319931,
293309,
278974,
336319,
311744,
317889,
278979,
326083,
336323,
278988,
289229,
281038,
281039,
278992,
283089,
283088,
129484,
326093,
279000,
176602,
242138,
160224,
279009,
291297,
369121,
195044,
285152,
279014,
188899,
319976,
279017,
311787,
334315,
281071,
319986,
236020,
279030,
311800,
293368,
279033,
317949,
279042,
283138,
233987,
287237,
324098,
377352,
322057,
309770,
342537,
334345,
279053,
340489,
283154,
303634,
279060,
279061,
303635,
182802,
279066,
322077,
291359,
342560,
293420,
236080,
283185,
289328,
279092,
23093,
234037,
244279,
338491,
340539,
301635,
309831,
55880,
322119,
377419,
281165,
303693,
301647,
281170,
326229,
115287,
189016,
309847,
244311,
332379,
111197,
295518,
287327,
242274,
279143,
279150,
281200,
287345,
313970,
301688,
244345,
189054,
303743,
297600,
287359,
291455,
301702,
164487,
279176,
311944,
334473,
344714,
316044,
311948,
311950,
316048,
311953,
316050,
287379,
326288,
336531,
295575,
227991,
289435,
303772,
205469,
221853,
285348,
340645,
314020,
279207,
295591,
176810,
248494,
279215,
293552,
295598,
285362,
299698,
318127,
166581,
164532,
342705,
154295,
279218,
287418,
314043,
303802,
287412,
66243,
291529,
287434,
225996,
363212,
287438,
135888,
279249,
242385,
303826,
369365,
369366,
279253,
158424,
230105,
299737,
322269,
338658,
295653,
342757,
289511,
230120,
234216,
330473,
285419,
330476,
289517,
279278,
312046,
170735,
215790,
125683,
230133,
199415,
342775,
234233,
242428,
279293,
205566,
322302,
289534,
299777,
35584,
228099,
285443,
375552,
291584,
291591,
322312,
346889,
285450,
264971,
312076,
326413,
295688,
322320,
285457,
295698,
291605,
166677,
207639,
283418,
285467,
326428,
221980,
281378,
234276,
336678,
283431,
203560,
279337,
318247,
293673,
318251,
289580,
262952,
164655,
301872,
303921,
234290,
328495,
262957,
285493,
230198,
285496,
301883,
201534,
289599,
281407,
295745,
342846,
222017,
293702,
318279,
283466,
281426,
279379,
244569,
234330,
281434,
322396,
295769,
230238,
230239,
275294,
279393,
293729,
349025,
281444,
303973,
279398,
351078,
301919,
357219,
177002,
308075,
242540,
310132,
295797,
228214,
207735,
201590,
295799,
279418,
177018,
269179,
308093,
336765,
314240,
291713,
158594,
330627,
340865,
240517,
228232,
299912,
279434,
320394,
416649,
316299,
234382,
252812,
308111,
308113,
189327,
293780,
310166,
289691,
209820,
240543,
283551,
310177,
289699,
189349,
289704,
293801,
279465,
326571,
177074,
304050,
326580,
289720,
326586,
289723,
189373,
213956,
281541,
19398,
359365,
345030,
213961,
127945,
279499,
211913,
56270,
191445,
304086,
183254,
207839,
340960,
234469,
314343,
304104,
123880,
340967,
324587,
234476,
183276,
203758,
248815,
320495,
320492,
287730,
240631,
214009,
201721,
312313,
312315,
312317,
328701,
328705,
234499,
418819,
293894,
330759,
320520,
322571,
230411,
320526,
330766,
234513,
238611,
140311,
293911,
238617,
197658,
326684,
336930,
113710,
189487,
281647,
322609,
318515,
312372,
203829,
238646,
300087,
238650,
320571,
21567,
308288,
160834,
336962,
314437,
349254,
238663,
300109,
234578,
207954,
250965,
205911,
296023,
339031,
314458,
156763,
281698,
285795,
214116,
230500,
250982,
322664,
228457,
279659,
318571,
234606,
300145,
230514,
238706,
187508,
312435,
279666,
300147,
302202,
285819,
285823,
150656,
234626,
279686,
222344,
285833,
318602,
234635,
228492,
337037,
285834,
177297,
162962,
187539,
326803,
347286,
308375,
324761,
285850,
296091,
119965,
234655,
300192,
302239,
339106,
306339,
234662,
300200,
302251,
208044,
238764,
249003,
322733,
3243,
294069,
324790,
300215,
64699,
294075,
228541,
339131,
343230,
283841,
148674,
283846,
312519,
279752,
283849,
148687,
290001,
189651,
316628,
279766,
189656,
279775,
304352,
298209,
310496,
339167,
279780,
304353,
228587,
279789,
290030,
302319,
251124,
316661,
283894,
234741,
208123,
292092,
279803,
228608,
320769,
234756,
322826,
242955,
312588,
177420,
318732,
126229,
245018,
320795,
320802,
130342,
304422,
130344,
130347,
292145,
298290,
208179,
312628,
345398,
300342,
159033,
333114,
333115,
286012,
222523,
181568,
279872,
279874,
300355,
193858,
216387,
300354,
372039,
294210,
304457,
230730,
345418,
337228,
296269,
222542,
224591,
238928,
234830,
296274,
331091,
314708,
150868,
283990,
314711,
357720,
318804,
300378,
300379,
294236,
314721,
230757,
281958,
314727,
134504,
306541,
327023,
296304,
234864,
312688,
316786,
314740,
230772,
327030,
284015,
310650,
224637,
306558,
337280,
306561,
243073,
179586,
294278,
314759,
296328,
296330,
298378,
318860,
314765,
368012,
9618,
279955,
306580,
112019,
224662,
234902,
282008,
314776,
292242,
318876,
282013,
290206,
282375,
343457,
148899,
314788,
298406,
314790,
245160,
333224,
282023,
279979,
279980,
241067,
314797,
286128,
173492,
279988,
286133,
284086,
259513,
310714,
284090,
228796,
54719,
302530,
280003,
228804,
292291,
415170,
306630,
310725,
306634,
370122,
302539,
339403,
300490,
310731,
329168,
337359,
222674,
327122,
280020,
329170,
312785,
310735,
280025,
310747,
239069,
144862,
286176,
187877,
310758,
320997,
280042,
280043,
191980,
329198,
337391,
300526,
282097,
296434,
308722,
306678,
40439,
191991,
288248,
286201,
300539,
288252,
210429,
312830,
359931,
290304,
245249,
228868,
323079,
218632,
292359,
302602,
230922,
323083,
294413,
359949,
304655,
329231,
323088,
282132,
230933,
302613,
316951,
175640,
374297,
282135,
282399,
302620,
222754,
313338,
245291,
312879,
230960,
288305,
290359,
239159,
323132,
235069,
157246,
288319,
288322,
280131,
349764,
310853,
282182,
194118,
288328,
292424,
292426,
286281,
333389,
224848,
224852,
349780,
290391,
128600,
235096,
239192,
196184,
306777,
212574,
204386,
300643,
300645,
282214,
294220,
312937,
204394,
312941,
138862,
206447,
310896,
314997,
294517,
290425,
288377,
339579,
337533,
325246,
333438,
235136,
280193,
282244,
239238,
288391,
282248,
286344,
179853,
286351,
188049,
229011,
239251,
280217,
323226,
179868,
229021,
302751,
198304,
282272,
245413,
282279,
298664,
212649,
298666,
317102,
286387,
300725,
337590,
286392,
300729,
302778,
306875,
280252,
280253,
282302,
323262,
286400,
321217,
296636,
280259,
321220,
282309,
333508,
239305,
296649,
280266,
212684,
306891,
302798,
9935,
241360,
282321,
313042,
286419,
333522,
241366,
280279,
282330,
18139,
294621,
280285,
282336,
325345,
321250,
294629,
153318,
333543,
181992,
12009,
337638,
282347,
288492,
282349,
34547,
67316,
323315,
286457,
284410,
313082,
200444,
288508,
282366,
286463,
319232,
288515,
280326,
323335,
249606,
284425,
300810,
282379,
216844,
116491,
284430,
280333,
300812,
161553,
278292,
118549,
278294,
282390,
116502,
284436,
325403,
321308,
321309,
341791,
241440,
282401,
339746,
325411,
315172,
186149,
186148,
241447,
216868,
333609,
286507,
294699,
284460,
280367,
300849,
282418,
280373,
282424,
280377,
321338,
319289,
282428,
280381,
345918,
413500,
280386,
325444,
280391,
153416,
315209,
325449,
159563,
280396,
307024,
317268,
237397,
241494,
18263,
307030,
325460,
188250,
341846,
284508,
300893,
307038,
370526,
237411,
284515,
276326,
282471,
296807,
292713,
282476,
292719,
313200,
325491,
313204,
333687,
317305,
317308,
339840,
315265,
280451,
325508,
188293,
243590,
282503,
67464,
305032,
315272,
315275,
327556,
333700,
325514,
311183,
350091,
350092,
184207,
282517,
294806,
350102,
214936,
337816,
124826,
239515,
294808,
214943,
298912,
319393,
333727,
294820,
118693,
219046,
284584,
294824,
313257,
292783,
126896,
200628,
300983,
343993,
288698,
98240,
294849,
214978,
280517,
280518,
282572,
282573,
153553,
24531,
231382,
329696,
323554,
292835,
6116,
190437,
292838,
294887,
317416,
262953,
313322,
278507,
329707,
174058,
296942,
298987,
311277,
327666,
278515,
325620,
239610
] |
085f48e7a6b004d41c93401218c6c97b9923fb9f | c80ef120768c9f24218ad7baa4c9abfdee2c0301 | /MiniGames Ultra/FootballController.swift | 635c4a235c60db1a405fc54f7dce276253156df1 | [] | no_license | Hydex/MiniGames | 91a1b8c6ff199d39ba2bc3a3fa555609bfe37abb | a0d0737335845e93f9cdddfa70689d973fff1243 | refs/heads/master | 2021-01-15T14:36:41.057929 | 2015-05-07T06:52:49 | 2015-05-07T06:52:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 678 | swift | //
// FootballController.swift
// MiniGames Ultra
//
// Created by Mark Yankovskiy on 05/05/15.
// Copyright (c) 2015 TheUnbelievable. All rights reserved.
//
import Foundation
import AppKit
import SpriteKit
class FootballController: NSViewController {
override func viewDidLoad() {
super.viewDidLoad()
let scene = FootballMainScene(size : self.view.bounds.size)
let skView = CustomView(frame: NSRect(x: 0, y: 0, width: self.view.frame.size.width, height: self.view.frame.size.height))
skView.ignoresSiblingOrder = true
scene.scaleMode = .AspectFit
skView.presentScene(scene)
self.view.addSubview(skView)
}
} | [
-1
] |
c85be05ff501d4fcf20beed88b28966cc3757f84 | ff8eb7d02d930a08e4b609cce5a9cc317b04b61d | /BookBustersTests/BookBustersTests.swift | 8f8296af089eb09fefe4819cc09ec0de773aad0f | [] | no_license | BCGupta/BookBusters | 38073962c614dc9b4e27c47ec58dc96a1a744529 | 52ba4face43f16f9a3f1886f4edc7f6c9016c1c2 | refs/heads/master | 2020-09-09T07:30:13.907162 | 2018-12-14T08:08:23 | 2018-12-14T08:08:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 917 | swift | //
// BookBustersTests.swift
// BookBustersTests
//
// Created by Brian Casipit on 11/18/18.
// Copyright © 2018 B-E-S-M. All rights reserved.
//
import XCTest
@testable import BookBusters
class BookBustersTests: 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.
}
}
}
| [
145435,
317467,
241692,
239650,
329765,
292902,
354343,
223274,
315434,
325674,
282672,
215089,
241716,
358456,
288828,
288833,
288834,
315465,
311372,
311374,
354385,
196691,
329814,
354393,
200794,
309345,
280675,
280677,
43110,
321637,
329829,
315498,
131178,
319598,
288879,
204916,
223350,
131191,
233590,
288889,
280694,
131198,
319629,
235662,
311438,
325776,
233636,
239793,
180408,
227513,
295098,
258239,
280768,
301251,
227524,
309444,
321745,
280795,
229597,
194782,
356576,
346346,
125169,
327929,
356602,
184570,
184575,
194820,
321800,
278797,
338197,
309529,
227616,
278816,
305440,
211235,
151847,
282919,
332083,
332085,
332089,
282939,
287041,
139589,
182597,
280902,
282960,
325968,
366929,
289110,
168281,
332123,
334171,
106847,
323935,
332127,
354655,
321894,
242033,
313713,
291192,
315773,
211326,
291198,
332167,
242058,
311691,
227725,
108944,
291224,
285084,
317852,
242078,
141728,
315810,
315811,
381347,
289189,
108972,
61873,
299441,
283064,
311738,
293310,
291265,
278978,
291267,
127427,
127428,
283075,
311745,
278989,
281037,
317901,
281040,
278993,
289232,
369116,
285150,
279008,
160225,
279013,
127465,
279018,
311786,
330218,
109042,
319987,
279029,
233978,
301571,
342536,
348682,
279050,
279062,
289304,
279065,
291358,
293419,
244269,
197167,
234036,
338490,
115270,
55881,
377418,
244327,
295536,
287346,
139892,
301689,
244347,
279164,
291454,
330379,
311949,
316049,
330387,
330388,
111253,
295576,
111258,
279206,
295599,
342706,
299699,
299700,
164533,
289462,
109241,
248517,
363211,
154316,
242386,
279252,
289502,
299746,
295652,
299759,
312052,
199414,
221948,
279294,
299776,
295682,
291592,
322313,
326414,
312079,
322319,
295697,
291604,
207640,
291612,
293664,
281377,
326433,
279336,
295724,
152365,
312108,
285487,
301871,
318252,
230199,
355130,
293693,
295746,
353094,
318278,
201549,
281427,
353109,
377686,
230234,
322395,
109409,
177001,
201577,
242541,
400239,
330609,
174963,
109428,
207732,
310131,
209783,
113542,
109447,
416646,
228233,
316298,
236428,
56208,
308112,
209817,
289690,
318364,
127902,
310182,
240552,
353195,
236461,
293806,
316333,
316343,
289722,
230332,
353215,
345033,
279498,
359387,
50143,
52200,
203757,
289774,
287731,
277492,
316405,
240630,
201720,
312314,
314362,
328700,
328706,
293893,
134150,
330763,
320527,
238610,
308243,
316437,
197657,
281626,
175132,
326685,
300068,
322612,
238651,
302139,
21569,
214086,
296019,
339030,
353367,
281697,
314467,
230499,
228458,
207979,
281706,
318572,
316526,
15471,
312434,
353397,
300150,
300151,
337017,
285820,
300158,
150657,
302213,
228491,
228493,
177296,
326804,
119962,
283802,
285851,
296092,
300188,
300202,
306346,
228540,
230588,
228542,
353479,
353481,
189652,
189653,
148696,
333022,
304351,
304356,
290022,
234733,
279792,
353523,
298228,
216315,
208124,
292091,
228609,
320770,
292107,
251153,
177428,
245019,
126237,
115998,
333090,
279854,
298291,
171317,
318775,
286013,
333117,
300359,
312648,
294218,
296273,
331090,
120148,
314709,
314710,
357719,
134491,
316765,
222559,
163175,
333160,
306542,
296303,
327025,
249204,
249205,
181625,
111993,
290169,
224640,
306560,
294275,
298374,
314760,
368011,
304524,
296335,
112017,
112018,
234898,
224661,
318875,
310692,
282024,
241066,
316842,
314798,
286129,
279989,
228795,
292283,
280004,
300487,
306631,
284107,
302540,
310732,
312782,
64975,
310736,
327121,
210393,
286172,
144867,
103909,
316902,
245223,
54765,
191981,
282096,
321009,
329200,
191990,
280055,
300536,
359930,
290301,
286205,
300542,
230913,
292356,
323087,
323089,
282141,
187938,
245292,
230959,
288309,
290358,
194110,
288318,
56902,
282183,
288327,
292423,
243274,
333388,
224847,
228943,
118353,
280147,
290390,
128599,
235095,
44635,
333408,
157281,
286306,
312940,
204397,
224883,
333430,
175741,
337535,
294529,
312965,
282246,
229001,
290443,
188048,
282259,
302739,
229020,
257699,
40613,
40614,
40615,
298661,
61101,
321199,
337591,
319162,
280251,
327358,
282303,
323264,
321219,
333509,
9936,
9937,
302802,
229088,
298720,
321249,
153319,
12010,
280300,
300794,
325371,
194303,
194304,
216839,
339720,
284431,
243472,
321295,
161554,
323346,
116505,
321310,
255776,
313120,
241441,
315171,
284459,
294700,
200498,
319292,
315202,
307011,
325445,
282438,
153415,
280392,
325457,
413521,
317269,
216918,
18262,
284507,
300894,
245599,
237408,
302946,
276327,
325484,
296814,
282480,
292720,
325492,
241528,
194429,
325503,
315264,
241540,
188292,
327557,
67463,
243591,
315273,
315274,
243597,
329622,
294807,
350109,
311199,
292771,
300963,
313254,
294823,
292782,
317360,
294843,
214977,
280514,
214984,
284619,
344013,
231375,
294886,
317415,
313319,
296941,
278512,
311281,
223218,
311282,
333817,
292858
] |
d0d143e6012b98ef19007790fb373ff17ab82f68 | 820d3add915c9d3432a51bb3d9cb358d66d15cb1 | /AdaptiveSpaceItem Example/macOS Example/AppDelegate.swift | 0cd7a267ce3a4060c970e94e5beb961e67231da0 | [
"MIT"
] | permissive | tbaranes/AdaptiveSpaceItem | 01c8710d7d4eace7b9f0147228c54e6244d4f5b0 | f52c7cf72abf7a30ba6f7b7e01e002d43e417282 | refs/heads/master | 2021-08-14T11:31:28.294276 | 2017-11-15T14:24:16 | 2017-11-15T14:24:16 | 52,022,239 | 9 | 0 | null | 2017-09-15T07:14:59 | 2016-02-18T16:41:04 | Swift | UTF-8 | Swift | false | false | 554 | swift | //
// AppDelegate.swift
// AdaptiveSpaceItem
//
// Created by Tom Baranes on 18/02/16.
// Copyright © 2016 Tom Baranes. All rights reserved.
//
import Cocoa
@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {
@IBOutlet weak var window: NSWindow!
func applicationDidFinishLaunching(aNotification: NSNotification) {
// Insert code here to initialize your application
}
func applicationWillTerminate(aNotification: NSNotification) {
// Insert code here to tear down your application
}
}
| [
285698,
281069,
280656,
326449,
285845,
282940,
279771,
344700,
295933
] |
78d341ad370d5822e7c9960b45f523645e8456aa | 6dde25008a034bb2085fa34107222875e448828c | /visorTests/visorTests.swift | e4ab42d32cec733481116b8dc80b6585f7d14311 | [] | no_license | mzegarras/visorPDF | 83abd32080d78015f390ace86f3ea26e3f02585b | 42bbcca7ef9830ce75aa851c1cd291341ba10e48 | refs/heads/master | 2016-09-10T20:09:09.753475 | 2015-09-08T20:16:06 | 2015-09-08T20:16:06 | 42,135,736 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 893 | swift | //
// visorTests.swift
// visorTests
//
// Created by Manuel Zegarra on 8/09/15.
// Copyright (c) 2015 M-Sonic. All rights reserved.
//
import UIKit
import XCTest
class visorTests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}
func testExample() {
// This is an example of a functional test case.
XCTAssert(true, "Pass")
}
func testPerformanceExample() {
// This is an example of a performance test case.
self.measureBlock() {
// Put the code you want to measure the time of here.
}
}
}
| [
276481,
276484,
276489,
276492,
278541,
278544,
305179,
276509,
278558,
307231,
313375,
102437,
227370,
360491,
276534,
159807,
276543,
286788,
280649,
223316,
315476,
223318,
288857,
278618,
227417,
194652,
194653,
278624,
276577,
194656,
309345,
227428,
276581,
276582,
43109,
276585,
223340,
276589,
278638,
227439,
276592,
131189,
227446,
223350,
276603,
276606,
292992,
276613,
141450,
311435,
215178,
311438,
276627,
276631,
276632,
184475,
227492,
196773,
227495,
129203,
299187,
131256,
176314,
280762,
223419,
299198,
309444,
227528,
276682,
276684,
276687,
278742,
278746,
155867,
280802,
276709,
276710,
276715,
233715,
157944,
211193,
227576,
168188,
227585,
276737,
276744,
227592,
276753,
157970,
129301,
276760,
309529,
278810,
276764,
299293,
276774,
282919,
262450,
276787,
315706,
278846,
164162,
311621,
280902,
278856,
227658,
276813,
278862,
278863,
6481,
6482,
276821,
6489,
276831,
323935,
276835,
321894,
276839,
416104,
276847,
285040,
278898,
280961,
178571,
227725,
178578,
190871,
293274,
61857,
61859,
276900,
278954,
278961,
278965,
293303,
276920,
278969,
33211,
276925,
278978,
278985,
278993,
279002,
287198,
276958,
227809,
358882,
276962,
276963,
227813,
279013,
279019,
279022,
281072,
279039,
276998,
287241,
279050,
186893,
279054,
303631,
223767,
223769,
277017,
291358,
277029,
293419,
281138,
277048,
301634,
369220,
238651,
277066,
277083,
295519,
66150,
277094,
166507,
189036,
189037,
277101,
287346,
189043,
277111,
279164,
277118,
291454,
184962,
303746,
152203,
277133,
133774,
225933,
225936,
277138,
277142,
225944,
230040,
164512,
225956,
285353,
225962,
209581,
205487,
285361,
303793,
154291,
299699,
293556,
154294,
342706,
285371,
199366,
225997,
226001,
164563,
277204,
277203,
226004,
226007,
203477,
119513,
279252,
201442,
226019,
277219,
285415,
342762,
277227,
226033,
226035,
226036,
230134,
234234,
226043,
209660,
234238,
279294,
234241,
226051,
234245,
277254,
209670,
203529,
226058,
234250,
234253,
234256,
234263,
234268,
105246,
228129,
234277,
234280,
277289,
279336,
234283,
289576,
277294,
234286,
226097,
234289,
234294,
230199,
162621,
234301,
289598,
234304,
234305,
162626,
281408,
277316,
293693,
234311,
234312,
299849,
234317,
277325,
277327,
293711,
234323,
234326,
277339,
234331,
297822,
234335,
301918,
279392,
297826,
349026,
234340,
174949,
234343,
234346,
277354,
234349,
277360,
234355,
213876,
277366,
234360,
234361,
277370,
226170,
279417,
209785,
234366,
234367,
177019,
158593,
234372,
226181,
213894,
113542,
226184,
234377,
277381,
228234,
226189,
234381,
295824,
226194,
234387,
234386,
234392,
234395,
324507,
279456,
234400,
277410,
234404,
289703,
234409,
275371,
234412,
236461,
234419,
234425,
277435,
234427,
287677,
234430,
226241,
234436,
275397,
234438,
226249,
52172,
234445,
234444,
183248,
275410,
234450,
234451,
234454,
234457,
275418,
234463,
234466,
277479,
277480,
179176,
234472,
234473,
234477,
234482,
287731,
277492,
314355,
234492,
234495,
277505,
234498,
234500,
277509,
277510,
234503,
277513,
234506,
230410,
275469,
277517,
197647,
234509,
295953,
277518,
277523,
234517,
230423,
281625,
234522,
197657,
281626,
175132,
234530,
234531,
234534,
275495,
234539,
275500,
310317,
277550,
234542,
275505,
275506,
234548,
277563,
234555,
156733,
277566,
230463,
7229,
7230,
207938,
7231,
234560,
234565,
277574,
234569,
277579,
300111,
207953,
277585,
296018,
234577,
296019,
234583,
234584,
275547,
277596,
234594,
277603,
230499,
281700,
300135,
234603,
281707,
275565,
156785,
312434,
275571,
234612,
300151,
234616,
398457,
234622,
300158,
275585,
226435,
285828,
302213,
275590,
275591,
234631,
253063,
277640,
302217,
234632,
234642,
226451,
226452,
308372,
275607,
119963,
234652,
234656,
277665,
330913,
234659,
306338,
234663,
275625,
300201,
208043,
275628,
226479,
226481,
238769,
277686,
277690,
208058,
230588,
283840,
279747,
279760,
290000,
189652,
203989,
363744,
195811,
298212,
304356,
285929,
279792,
298228,
204022,
120055,
234742,
228600,
208124,
204041,
292107,
277792,
339234,
199971,
304421,
277800,
113962,
277803,
277806,
113966,
226608,
277809,
226609,
277814,
277815,
300343,
277821,
277824,
277825,
226624,
15686,
277831,
226632,
294218,
177484,
142669,
277838,
222541,
277841,
296273,
222548,
277845,
277844,
314709,
283991,
357719,
224605,
218462,
224606,
277856,
142689,
230756,
277862,
163175,
281962,
173420,
277868,
284014,
277871,
279919,
277878,
275831,
181625,
277882,
142716,
275838,
275839,
277890,
277891,
226694,
275847,
277896,
277897,
281992,
277900,
230799,
112017,
296338,
277907,
206228,
306579,
226711,
226712,
277919,
277920,
310692,
277925,
279974,
277927,
282024,
277936,
277939,
279989,
296375,
277943,
277946,
277949,
277952,
296387,
415171,
163269,
277957,
296391,
300487,
277962,
282060,
277965,
280013,
312782,
284116,
277974,
228823,
228824,
277977,
277980,
226781,
277983,
277988,
310757,
316902,
277993,
296425,
277994,
277997,
278002,
278005,
226805,
306677,
278008,
300542,
306693,
153095,
278023,
175625,
192010,
280077,
149007,
65041,
282136,
204313,
278060,
286254,
228917,
226875,
194110,
128583,
226888,
276040,
366154,
276045,
276046,
286288,
226897,
276050,
280147,
300630,
226906,
147036,
243292,
226910,
282213,
317032,
222832,
276084,
276085,
276088,
278140,
188031,
276097,
192131,
276100,
276101,
229001,
310923,
312972,
278160,
278162,
282259,
276116,
276117,
276120,
278170,
280220,
276126,
276129,
282273,
282276,
278191,
276146,
278195,
276148,
296628,
198324,
286388,
278201,
276156,
276165,
278214,
323276,
276173,
302797,
276172,
212688,
302802,
276179,
276180,
286423,
216795,
216796,
276195,
153319,
313065,
280300,
419569,
276210,
276219,
194303,
171776,
288512,
311042,
288516,
278285,
276238,
227091,
184086,
294678,
284442,
278299,
276253,
276257,
278307,
288547,
159533,
165677,
276279,
276282,
276283,
276287,
345919,
276294,
282438,
276298,
216918,
276311,
307031,
276318,
237408,
276325,
282474,
288619,
276332,
173936,
110452,
276344,
194429,
276350,
227199,
40850,
40853,
44952,
247712,
227238,
294823,
276394,
276400,
276401,
276408,
161722,
290746,
276413,
276421,
276422,
276430,
231375,
153552,
153554,
276443,
276444,
280541,
153566,
276450,
276451,
276454,
276459,
296941,
276462,
276463,
276468,
276469,
278518,
276475,
276478
] |
2a0c1c1c5ae0fe3593be2410fdd1342e086327ad | 54bfbb1c73f5d66cea51cc5d5c8cefb070e09470 | /destroytheworld/AppDelegate.swift | 8e707f4a419f62a63ef75077b97910edb670b605 | [] | no_license | joelaruljohn/destroytheworld | 08fa82271b95456fc493939c0ab0ab06d087b9a0 | 77b4b9196fa5f21925f0b96bd6b75849864bc648 | refs/heads/master | 2020-08-31T09:49:47.234663 | 2017-06-15T03:38:00 | 2017-06-15T03:38:00 | 94,395,324 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 2,178 | swift | //
// AppDelegate.swift
// destroytheworld
//
// Created by Joel A. John on 15/6/17.
// Copyright © 2017 cortes.io. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}
func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
}
| [
229380,
229383,
229385,
278539,
294924,
229388,
278542,
229391,
327695,
278545,
229394,
278548,
229397,
229399,
229402,
352284,
229405,
278556,
278559,
229408,
278564,
294950,
229415,
229417,
327722,
237613,
229422,
360496,
229426,
237618,
229428,
311349,
286774,
286776,
319544,
286778,
229432,
204856,
352318,
286791,
237640,
286797,
278605,
311375,
163920,
237646,
196692,
319573,
311383,
278623,
278626,
319590,
311400,
278635,
303212,
278639,
131192,
278648,
237693,
303230,
327814,
303241,
131209,
417930,
303244,
311436,
319633,
286873,
286876,
311460,
311469,
32944,
327862,
286906,
327866,
180413,
286910,
131264,
286916,
295110,
286922,
286924,
286926,
319694,
286928,
131281,
131278,
278743,
278747,
295133,
155872,
131299,
319716,
237807,
303345,
286962,
131314,
229622,
327930,
278781,
278783,
278785,
237826,
319751,
278792,
286987,
319757,
311569,
286999,
319770,
287003,
287006,
287009,
287012,
287014,
287016,
287019,
311598,
287023,
262448,
311601,
295220,
287032,
155966,
319809,
319810,
278849,
319814,
311623,
319818,
311628,
229709,
319822,
287054,
278865,
229717,
196963,
196969,
139638,
213367,
106872,
319872,
311683,
319879,
311693,
65943,
319898,
311719,
278952,
139689,
278957,
311728,
278967,
180668,
311741,
278975,
319938,
278980,
98756,
278983,
319945,
278986,
319947,
278990,
278994,
311767,
279003,
279006,
188895,
172512,
287202,
279010,
279015,
172520,
319978,
279020,
172526,
311791,
279023,
172529,
279027,
319989,
172534,
180727,
164343,
279035,
311804,
287230,
279040,
303617,
287234,
279045,
172550,
303623,
172552,
287238,
320007,
279051,
172558,
279055,
303632,
279058,
303637,
279063,
279067,
172572,
279072,
172577,
295459,
172581,
295461,
279082,
311850,
279084,
172591,
172598,
279095,
172607,
172612,
377413,
172614,
172618,
303690,
33357,
287309,
303696,
279124,
172634,
262752,
254563,
172644,
311911,
189034,
295533,
172655,
172656,
352880,
295538,
189039,
172660,
287349,
189040,
189044,
287355,
287360,
295553,
172675,
295557,
287365,
311942,
303751,
352905,
279178,
287371,
311946,
311951,
287377,
172691,
287381,
311957,
221850,
287386,
230045,
172702,
164509,
303773,
172705,
287394,
172707,
303780,
287390,
287398,
205479,
279208,
287400,
172714,
295595,
279212,
189102,
172721,
287409,
66227,
303797,
189114,
287419,
303804,
328381,
287423,
328384,
172737,
279231,
287427,
312005,
312006,
172748,
287436,
107212,
172751,
287440,
295633,
172755,
303827,
279255,
172760,
287450,
303835,
279258,
189149,
303838,
213724,
312035,
279267,
295654,
279272,
230128,
312048,
312050,
230131,
189169,
205564,
303871,
230146,
328453,
295685,
230154,
33548,
312077,
295695,
295701,
230169,
369433,
295707,
328476,
295710,
230175,
295720,
303914,
279340,
205613,
279353,
230202,
312124,
328508,
222018,
295755,
377676,
148302,
287569,
303959,
230237,
279390,
230241,
279394,
303976,
336744,
303985,
328563,
303987,
279413,
303991,
303997,
295806,
295808,
295813,
304005,
320391,
213895,
304007,
304009,
304011,
230284,
304013,
295822,
279438,
189325,
189329,
295825,
304019,
213902,
189331,
58262,
304023,
304027,
279452,
410526,
279461,
279462,
304042,
213931,
230327,
304055,
287675,
230334,
304063,
304065,
213954,
189378,
156612,
295873,
213963,
197580,
312272,
304084,
304090,
320481,
304106,
320490,
312302,
328687,
320496,
304114,
295928,
320505,
312321,
295945,
230413,
295949,
197645,
320528,
140312,
295961,
238620,
197663,
304164,
304170,
304175,
238641,
312374,
238652,
238655,
230465,
238658,
336964,
296004,
205895,
320584,
238666,
296021,
402518,
336987,
230497,
296036,
296040,
361576,
205931,
279661,
205934,
164973,
312432,
279669,
337018,
189562,
279679,
304258,
279683,
222340,
66690,
205968,
296084,
238745,
304285,
238756,
205991,
222377,
165035,
337067,
238766,
165038,
230576,
238770,
304311,
230592,
312518,
279750,
230600,
230607,
148690,
320727,
279769,
304348,
279777,
304354,
296163,
320740,
279781,
304360,
320748,
279788,
279790,
304370,
296189,
320771,
312585,
296202,
296205,
230674,
320786,
230677,
296213,
296215,
320792,
230681,
230679,
230689,
173350,
312622,
296243,
312630,
222522,
296253,
222525,
296255,
312639,
230718,
296259,
378181,
296262,
230727,
238919,
296264,
320840,
296267,
296271,
222545,
230739,
312663,
222556,
337244,
230752,
312676,
230760,
173418,
148843,
410987,
230763,
230768,
296305,
312692,
230773,
304505,
304506,
181626,
279929,
181631,
148865,
312711,
312712,
296331,
288140,
288144,
230800,
304533,
337306,
288154,
288160,
288162,
288164,
279975,
304555,
370092,
279983,
173488,
288176,
279985,
312755,
296373,
312759,
279991,
288185,
337335,
222652,
312766,
173507,
296389,
222665,
230860,
312783,
288208,
230865,
288210,
370130,
222676,
288212,
148946,
288214,
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,
296446,
321022,
402942,
148990,
296450,
206336,
230916,
230919,
214535,
230923,
304651,
304653,
370187,
402969,
230940,
222752,
108066,
296486,
296488,
157229,
239152,
230961,
157236,
288320,
288325,
124489,
280140,
280145,
288338,
280149,
288344,
280152,
239194,
280158,
403039,
181854,
370272,
239202,
370279,
312938,
280183,
280185,
280188,
280191,
116354,
280194,
280208,
280211,
288408,
280218,
280222,
419489,
190118,
198310,
321195,
296622,
321200,
337585,
296626,
296634,
296637,
419522,
313027,
280260,
419525,
206536,
280264,
206539,
206541,
206543,
263888,
313044,
280276,
321239,
280283,
313052,
18140,
288478,
313055,
419555,
321252,
313066,
288494,
280302,
280304,
313073,
321266,
288499,
419570,
288502,
280314,
288510,
124671,
67330,
280324,
198405,
288519,
280331,
198416,
280337,
296723,
116503,
321304,
329498,
296731,
321311,
313121,
313123,
304932,
321316,
280363,
141101,
165678,
280375,
321336,
296767,
288576,
345921,
280388,
337732,
304968,
280393,
280402,
173907,
313171,
313176,
42842,
280419,
321381,
296809,
296812,
313201,
1920,
255873,
305028,
280454,
247688,
280464,
124817,
280468,
239510,
280473,
124827,
214940,
247709,
214944,
280487,
313258,
321458,
296883,
124853,
214966,
296890,
10170,
288700,
296894,
190403,
296900,
280515,
337862,
165831,
280521,
231379,
296921,
354265,
354270,
239586,
313320,
354281,
231404,
124913,
165876,
321528,
239612,
313340,
288764,
239617,
313347,
288773,
313358,
305176,
321560,
313371,
354338,
305191,
223273,
313386,
354348,
124978,
215090,
124980,
288824,
288826,
321595,
313406,
288831,
288836,
67654,
280651,
354382,
288848,
280658,
215123,
354390,
288855,
288859,
280669,
313438,
149599,
280671,
149601,
321634,
149603,
223327,
329830,
280681,
313451,
223341,
280687,
149618,
215154,
313458,
280691,
313464,
329850,
321659,
280702,
288895,
321670,
215175,
141446,
141455,
141459,
280725,
313498,
100520,
288936,
280747,
288940,
288947,
280755,
321717,
280759,
280764,
280769,
280771,
280774,
280776,
313548,
321740,
280783,
280786,
280788,
313557,
280793,
280796,
280798,
338147,
280804,
280807,
157930,
280811,
280817,
125171,
157940,
280819,
182517,
280823,
280825,
280827,
280830,
280831,
280833,
125187,
280835,
125191,
125207,
125209,
321817,
125218,
321842,
223539,
125239,
305464,
280888,
280891,
289087,
108865,
280897,
280900,
305480,
239944,
280906,
239947,
305485,
305489,
379218,
280919,
248153,
215387,
354653,
354656,
313700,
280937,
190832,
280946,
223606,
313720,
280956,
239997,
280959,
313731,
199051,
240011,
289166,
240017,
297363,
190868,
240021,
297365,
297368,
297372,
141725,
297377,
289186,
297391,
289201,
240052,
289207,
289210,
305594,
281024,
289218,
289221,
289227,
436684,
281045,
281047,
215526,
166378,
305647,
281075,
174580,
240124,
281084,
305662,
305664,
240129,
305666,
305668,
223749,
240132,
281095,
223752,
150025,
338440,
330244,
223757,
281102,
223763,
223765,
281113,
322074,
281116,
281121,
182819,
289317,
281127,
281135,
150066,
158262,
158266,
289342,
281154,
322115,
158283,
281163,
281179,
338528,
338532,
281190,
199273,
281196,
19053,
158317,
313973,
297594,
281210,
158347,
264845,
182926,
133776,
182929,
314003,
117398,
314007,
289436,
174754,
330404,
289448,
133801,
174764,
314029,
314033,
240309,
133817,
314045,
314047,
314051,
199364,
297671,
158409,
256716,
289493,
363234,
289513,
289522,
289525,
289532,
322303,
289537,
322310,
264969,
322314,
322318,
281361,
281372,
322341,
215850,
281388,
289593,
281401,
289601,
281410,
281413,
281414,
240458,
281420,
240468,
281430,
322393,
297818,
281435,
281438,
281442,
174955,
224110,
207733,
207737,
158596,
183172,
240519,
322440,
314249,
338823,
183184,
142226,
289687,
224151,
240535,
297883,
289694,
289696,
289700,
289712,
281529,
289724,
52163,
183260,
420829,
281567,
289762,
322534,
297961,
183277,
281581,
322550,
134142,
322563,
314372,
330764,
175134,
322599,
322610,
314421,
281654,
314427,
314433,
207937,
314441,
207949,
322642,
314456,
281691,
314461,
281702,
281704,
314474,
281708,
281711,
289912,
248995,
306341,
306344,
306347,
322734,
306354,
142531,
199877,
289991,
306377,
289997,
249045,
363742,
363745,
298216,
330988,
126190,
216303,
322801,
388350,
257302,
363802,
199976,
199978,
314671,
298292,
298294,
257334,
216376,
380226,
298306,
224584,
224587,
224594,
216404,
306517,
150870,
314714,
224603,
159068,
314718,
265568,
314723,
281960,
150890,
306539,
314732,
314736,
290161,
216436,
306549,
298358,
314743,
306552,
290171,
314747,
298365,
290174,
306555,
224641,
281987,
298372,
314756,
281990,
224647,
265604,
298377,
314763,
142733,
298381,
314768,
224657,
306581,
314773,
314779,
314785,
314793,
282025,
282027,
241068,
241070,
241072,
282034,
241077,
150966,
298424,
306618,
282044,
323015,
306635,
306640,
290263,
290270,
290275,
339431,
282089,
191985,
282098,
290291,
282101,
241142,
191992,
290298,
151036,
290302,
282111,
290305,
175621,
306694,
192008,
323084,
257550,
282127,
290321,
282130,
323090,
290325,
282133,
241175,
290328,
282137,
290332,
241181,
282142,
282144,
290344,
306731,
290349,
290351,
290356,
282186,
224849,
282195,
282199,
282201,
306778,
159324,
159330,
314979,
298598,
323176,
224875,
241260,
323181,
257658,
315016,
282249,
290445,
282255,
282261,
175770,
298651,
282269,
323229,
298655,
323231,
61092,
282277,
306856,
196133,
282295,
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,
118593,
307009,
413506,
307012,
241475,
315211,
282446,
307027,
315221,
323414,
315223,
241496,
241498,
307035,
307040,
110433,
282465,
241509,
110438,
298860,
110445,
282478,
315249,
110450,
315251,
282481,
315253,
315255,
339838,
315267,
282499,
315269,
241544,
282505,
241546,
241548,
298896,
298898,
282514,
241556,
44948,
298901,
241560,
282520,
241563,
241565,
241567,
241569,
282531,
241574,
282537,
298922,
36779,
241581,
282542,
241583,
323504,
241586,
290739,
241588,
282547,
241590,
241592,
241598,
290751,
241600,
241605,
151495,
241610,
298975,
241632,
298984,
241640,
241643,
298988,
241646,
241649,
241652,
323574,
290807,
299003,
241661,
299006,
282623,
315396,
241669,
315397,
282632,
307211,
282639,
290835,
282645,
241693,
282654,
241701,
102438,
217127,
282669,
323630,
282681,
290877,
282687,
159811,
315463,
315466,
192589,
307278,
192596,
176213,
307287,
307290,
217179,
315482,
192605,
315483,
233567,
299105,
200801,
217188,
299109,
307303,
315495,
356457,
45163,
307307,
315502,
192624,
307314,
323700,
299126,
233591,
299136,
307329,
307338,
233613,
241813,
307352,
299164,
241821,
299167,
315552,
184479,
184481,
315557,
184486,
307370,
307372,
184492,
307374,
307376,
299185,
323763,
184503,
299191,
176311,
307385,
307386,
307388,
258235,
307390,
176316,
299200,
184512,
307394,
299204,
307396,
184518,
307399,
323784,
233679,
307409,
307411,
176343,
299225,
233701,
307432,
184572,
282881,
184579,
184586,
282893,
291089,
282906,
291104,
233766,
299304,
176435,
307508,
315701,
332086,
307510,
307512,
168245,
307515,
307518,
282942,
282947,
323917,
110926,
282957,
233808,
323921,
315733,
323926,
233815,
276052,
315739,
323932,
299357,
242018,
242024,
299373,
315757,
250231,
242043,
315771,
299388,
299391,
291202,
299398,
242057,
291212,
299405,
291222,
315801,
291226,
242075,
283033,
194654,
61855,
291231,
283042,
291238,
291241,
127403,
127405,
291247,
299440,
127407,
299444,
127413,
291254,
283062,
127417,
291260,
127421,
283069,
127424,
299457,
127429,
127434,
315856,
127440,
176592,
315860,
176597,
127447,
283095,
299481,
127449,
176605,
242143,
127455,
127457,
291299,
127460,
340454,
127463,
242152,
291305,
127466,
176620,
127469,
127474,
291314,
291317,
127480,
135672,
291323,
233979,
127485,
291330,
127490,
127494,
283142,
127497,
233994,
135689,
127500,
291341,
233998,
127506,
234003,
127509,
234006,
127511,
152087,
283161,
242202,
234010,
135707,
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,
299684,
135844,
242343,
209576,
242345,
373421,
299706,
135870,
135873,
135876,
135879,
299720,
299723,
299726,
225998,
226002,
119509,
226005,
226008,
299740,
242396,
201444,
299750,
283368,
234219,
283372,
185074,
226037,
283382,
316151,
234231,
234236,
226045,
242431,
234239,
209665,
234242,
299778,
242436,
226053,
234246,
226056,
291593,
234248,
242443,
234252,
242445,
234254,
291601,
234258,
242450,
242452,
234261,
201496,
234264,
234266,
234269,
283421,
234272,
234274,
152355,
299814,
234278,
283432,
234281,
234284,
234287,
283440,
185138,
242483,
234292,
234296,
234298,
160572,
283452,
234302,
234307,
242499,
234309,
292433,
316233,
234313,
316235,
234316,
283468,
234319,
242511,
234321,
234324,
185173,
201557,
234329,
234333,
308063,
234336,
242530,
349027,
234338,
234341,
234344,
234347,
177004,
234350,
324464,
234353,
152435,
177011,
234356,
234358,
234362,
226171,
291711,
234368,
291714,
234370,
291716,
234373,
201603,
226182,
234375,
308105,
226185,
234379,
324490,
234384,
234388,
234390,
324504,
234393,
209818,
308123,
234396,
324508,
291742,
226200,
234398,
234401,
291747,
291748,
234405,
291750,
234407,
324520,
324518,
324522,
234410,
291756,
226220,
291754,
324527,
291760,
234417,
201650,
324531,
234414,
234422,
226230,
275384,
324536,
234428,
291773,
242623,
324544,
234431,
234434,
324546,
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,
234487,
324599,
234490,
234493,
316416,
234496,
308226,
234501,
275462,
308231,
234504,
234507,
234510,
234515,
300054,
316439,
234520,
234519,
234523,
234526,
234528,
300066,
234532,
300069,
234535,
234537,
234540,
144430,
234543,
234546,
275508,
300085,
234549,
300088,
234553,
234556,
234558,
316479,
234561,
316483,
160835,
234563,
308291,
234568,
234570,
316491,
234572,
300108,
234574,
300115,
234580,
234581,
242777,
234585,
275545,
234590,
234593,
234595,
234597,
300133,
234601,
300139,
234605,
160879,
234607,
275569,
234610,
316530,
300148,
234614,
398455,
144506,
234618,
234620,
275579,
234623,
226433,
234627,
275588,
234629,
242822,
234634,
234636,
177293,
234640,
275602,
234643,
308373,
226453,
234647,
234648,
275606,
234650,
275608,
324757,
300189,
324766,
119967,
234653,
308379,
324768,
283805,
242852,
300197,
234661,
283813,
234664,
234657,
275626,
234667,
177318,
316596,
308414,
234687,
300223,
300226,
308418,
234692,
300229,
308420,
308422,
226500,
283844,
300234,
283850,
300238,
300241,
316625,
300243,
300245,
316630,
300248,
300253,
300256,
300258,
300260,
234726,
300263,
300265,
300267,
161003,
300270,
300272,
120053,
300278,
275703,
316663,
300284,
275710,
300287,
292097,
300289,
161027,
300292,
300294,
275719,
234760,
177419,
300299,
242957,
300301,
283917,
177424,
349451,
275725,
349464,
415009,
283939,
259367,
292143,
283951,
300344,
226617,
243003,
283963,
226628,
300357,
283973,
177482,
283983,
316758,
357722,
316766,
292192,
316768,
218464,
292197,
316774,
243046,
218473,
284010,
136562,
324978,
275834,
333178,
275836,
275840,
316803,
316806,
226696,
316811,
226699,
316814,
226703,
300433,
234899,
300436,
226709,
357783,
316824,
316826,
144796,
300448,
144807,
144810,
144812,
144814,
144820,
374196,
284084,
292279,
284087,
144826,
144828,
144830,
144832,
144835,
144837,
38342,
144839,
144841,
144844,
144847,
144852,
144855,
103899,
300507,
333280,
226787,
218597,
292329,
300523,
259565,
300527,
308720,
259567,
292338,
226802,
227440,
316917,
308727,
292343,
300537,
316933,
316947,
308757,
308762,
284191,
316959,
284194,
284196,
235045,
284199,
284204,
284206,
284209,
284211,
194101,
284213,
316983,
194103,
284215,
308790,
284218,
226877,
292414,
284223,
284226,
284228,
292421,
226886,
284231,
128584,
243268,
284234,
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,
284278,
292470,
276086,
292473,
284283,
276093,
284286,
292479,
284288,
292481,
284290,
325250,
284292,
292485,
325251,
276095,
276098,
284297,
317066,
284299,
317068,
284301,
276109,
284303,
284306,
276114,
284308,
284312,
284314,
284316,
276127,
284320,
284322,
284327,
284329,
317098,
284331,
276137,
284333,
284335,
284337,
284339,
300726,
284343,
284346,
284350,
276160,
358080,
284354,
358083,
284358,
276166,
358089,
284362,
276170,
284365,
276175,
284368,
276177,
284370,
358098,
284372,
317138,
284377,
276187,
284379,
284381,
284384,
358114,
284386,
358116,
276197,
317158,
358119,
284392,
325353,
358122,
284394,
284397,
358126,
284399,
358128,
276206,
358133,
358135,
276216,
358138,
300795,
358140,
284413,
358142,
358146,
317187,
284418,
317189,
317191,
284428,
300816,
300819,
317207,
284440,
300828,
300830,
276255,
300832,
325408,
300834,
317221,
227109,
358183,
186151,
276268,
300845,
243504,
300850,
284469,
276280,
325436,
358206,
276291,
366406,
276295,
300872,
292681,
153417,
358224,
284499,
276308,
284502,
317271,
178006,
276315,
292700,
317279,
284511,
227175,
292715,
300912,
292721,
284529,
300915,
284533,
292729,
317306,
284540,
292734,
325512,
169868,
276365,
317332,
358292,
284564,
399252,
284566,
350106,
284572,
276386,
284579,
276388,
358312,
317353,
292776,
284585,
276395,
276402,
358326,
161718,
358330,
276410,
276411,
276418,
276425,
301009,
301011,
301013,
292823,
358360,
301017,
301015,
292828,
276446,
153568,
276452,
292839,
276455,
350186,
292843,
276460,
292845,
276464,
178161,
227314,
325624,
350200,
276472,
317435,
276479,
276482,
350210,
276485,
317446,
178181,
276490,
350218,
292876,
350222,
317456,
276496,
317458,
178195,
243733,
243740,
317468,
317472,
325666,
243751,
292904,
276528,
178224,
243762,
309298,
325685,
325689,
235579,
325692,
235581,
178238,
276539,
276544,
243779,
325700,
284739,
292934,
243785,
276553,
350293,
350295,
309337,
194649,
227418,
350299,
350302,
227423,
350304,
178273,
309346,
194657,
194660,
350308,
309350,
309348,
292968,
309352,
227426,
276579,
227430,
276583,
309354,
301167,
276590,
350321,
350313,
350316,
284786,
350325,
252022,
276595,
350328,
292985,
301178,
350332,
292989,
301185,
292993,
350339,
317570,
317573,
350342,
350345,
350349,
301199,
317584,
325777,
350354,
350357,
350359,
350362,
350366,
276638,
284837,
153765,
350375,
350379,
350381,
350383,
350385,
350387,
350389,
350395,
350397,
350399,
227520,
350402,
227522,
301252,
350406,
227529,
301258,
309450,
276685,
309455,
276689,
227540,
309462,
301272,
276699,
194780,
309468,
309471,
301283,
317672,
317674,
325867,
243948,
194801,
309494,
243960,
276735,
227583,
227587,
276739,
211204,
276742,
227593,
227596,
325910,
309530,
342298,
211232,
317729,
276775,
211241,
325937,
325943,
211260,
260421,
285002,
276811,
235853,
276816,
235858,
276829,
276833,
391523,
276836,
293227,
276843,
293232,
276848,
186744,
211324,
227709,
285061,
366983,
317833,
178572,
285070,
285077,
178583,
227738,
317853,
276896,
317858,
342434,
285093,
317864,
285098,
276907,
235955,
276917,
293304,
293307,
293314,
309707,
293325,
129486,
317910,
293336,
235996,
317917,
293343,
358880,
276961,
227810,
293346,
276964,
293352,
236013,
293364,
301562,
293370,
317951,
309764,
301575,
121352,
293387,
236043,
342541,
317963,
113167,
55822,
309779,
317971,
309781,
55837,
227877,
227879,
293417,
227882,
309804,
293421,
105007,
236082,
285236,
23094,
277054,
244288,
219714,
129603,
301636,
318020,
301639,
301643,
277071,
285265,
309844,
277080,
309849,
285277,
285282,
326244,
318055,
277100,
309871,
121458,
277106,
170618,
170619,
309885,
309888,
277122,
227975,
277128,
285320,
301706,
318092,
326285,
334476,
318094,
277136,
277139,
227992,
334488,
318108,
285340,
318110,
227998,
137889,
383658,
285357,
318128,
277170,
293555,
342707,
154292,
318132,
277173,
285368,
277177,
277181,
318144,
277187,
277191,
277194,
277196,
277201,
342745,
137946,
342747,
342749,
113378,
203491,
228069,
277223,
342760,
285417,
56041,
56043,
56045,
277232,
228081,
56059,
310015,
285441,
310020,
285448,
310029,
228113,
285459,
277273,
293659,
326430,
228128,
285474,
293666,
228135,
318248,
277291,
318253,
293677,
285489,
301876,
293685,
285494,
301880,
285499,
301884,
293696,
310080,
277317,
277322,
277329,
162643,
310100,
301911,
301913,
277337,
301921,
400236,
236397,
162671,
326514,
310134,
236408,
15224,
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,
318442,
228330,
228332,
326638,
277486,
351217,
318450,
293876,
293877,
285686,
302073,
121850,
293882,
302075,
244731,
285690,
293887,
277504,
277507,
277511,
293899,
277519,
293908,
302105,
293917,
293939,
318516,
277561,
277564,
310336,
7232,
293956,
277573,
228422,
293960,
310344,
277577,
277583,
203857,
293971,
310355,
310359,
236632,
277594,
138332,
277598,
203872,
277601,
285792,
310374,
203879,
310376,
228460,
318573,
203886,
187509,
285815,
367737,
285817,
302205,
285821,
392326,
285831,
294026,
302218,
285835,
162964,
384148,
187542,
302231,
285849,
302233,
285852,
302237,
285854,
285856,
302241,
285862,
277671,
302248,
64682,
277678,
294063,
294065,
302258,
277687,
294072,
318651,
294076,
277695,
318657,
244930,
302275,
130244,
302277,
228550,
302282,
310476,
302285,
302288,
310481,
302290,
203987,
302292,
302294,
310486,
302296,
384222,
310498,
285927,
318698,
302315,
195822,
228592,
294132,
138485,
228601,
204026,
228606,
204031,
64768,
310531,
285958,
138505,
228617,
318742,
204067,
277798,
130345,
277801,
113964,
277804,
384302,
285999,
285997,
113969,
277807,
277811,
318773,
318776,
277816,
286010,
277819,
294204,
417086,
277822,
286016,
302403,
294211,
384328,
277832,
277836,
294221,
146765,
294223,
326991,
277839,
277842,
277847,
277850,
179547,
277853,
277857,
302436,
277860,
294246,
327015,
310632,
327017,
351594,
277864,
277869,
277872,
351607,
310648,
277880,
310651,
277884,
277888,
310657,
351619,
294276,
310659,
277892,
277894,
253320,
310665,
318858,
327046,
277898,
277903,
310672,
351633,
277905,
277908,
277917,
310689,
277921,
130468,
277928,
277932,
310703,
277937,
310710,
130486,
310712,
277944,
310715,
277947,
302526,
228799,
277950,
277953,
302534,
310727,
64966,
245191,
163272,
277959,
277963,
302541,
277966,
302543,
310737,
277971,
228825,
277978,
310749,
277981,
277984,
310755,
277989,
277991,
187880,
277995,
310764,
286188,
278000,
228851,
310772,
278003,
278006,
40440,
212472,
278009,
40443,
286203,
40448,
228864,
286214,
228871,
302603,
65038,
302614,
286233,
302617,
302621,
286240,
146977,
187936,
187939,
40484,
294435,
40486,
286246,
294440,
40488,
294439,
294443,
40491,
294445,
278057,
310831,
245288,
286248,
40499,
40502,
212538,
40507,
40511,
40513,
228933,
327240,
40521,
286283,
40525,
40527,
212560,
400976,
228944,
40533,
147032,
40537,
40539,
40541,
278109,
40544,
40548,
40550,
40552,
286313,
40554,
286312,
310892,
40557,
40560,
188022,
122488,
294521,
343679,
294537,
310925,
286354,
278163,
302740,
122517,
278168,
179870,
327333,
229030,
212648,
278188,
302764,
278192,
319153,
278196,
302781,
319171,
302789,
294599,
278216,
294601,
302793,
343757,
212690,
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,
280021,
188252,
237409,
229233,
294776,
360317,
294785,
327554,
360322,
40840,
294803,
40851,
188312,
294811,
237470,
319390,
40865,
319394,
294817,
294821,
311209,
180142,
343983,
188340,
40886,
319419,
294844,
294847,
393177,
294876,
294879,
294883,
393190,
294890,
311279,
278513,
237555,
278516,
311283,
278519,
237562
] |
7c0ef8ecfbeb8874892c790710cb7bf5acfad73e | c87c0182aa98fb69d65393e2124d3a239321b981 | /prox_iMuzic/Scences/Tabbar/TabbarVC/TabbarVC.swift | 14371763e8a35320e4eae06129b849f3d4a70e0d | [] | no_license | trunghieunt/Imuzic | 632a65972300c457025e7926a954bd1613158903 | 333d36a2ad3308348393853061a78713b4a7cada | refs/heads/master | 2022-11-29T10:52:48.507083 | 2020-07-09T11:57:35 | 2020-07-09T11:57:35 | 254,887,609 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 2,587 | swift | //
// TabbarVC.swift
// prox_iMuzic
//
// Created by Nguyen Trung Hieu on 4/7/20.
// Copyright © 2020 Nguyen Trung Hieu. All rights reserved.
//
import UIKit
class TabbarVC: BaseViewController {
override func viewDidLoad() {
super.viewDidLoad()
setupTabbar()
setupNav()
}
func setupNav() {
self.navigationController?.navigationBar.isHidden = true
}
func setupTabbar() {
let homeVC = HomeVC.loadFromNib()
homeVC.tabBarItem = createTabbarItem(title: "Home", imageName: "home-run")
let playListVC = PlayListVC.loadFromNib()
playListVC.tabBarItem = createTabbarItem(title: "Play List", imageName: "ic_audio")
let favoriteVC = FavoritesVC.loadFromNib()
favoriteVC.tabBarItem = createTabbarItem(title: "Favorites", imageName: "ic_passion")
let settingVC = SettingVC.loadFromNib()
settingVC.tabBarItem = createTabbarItem(title: "Setting", imageName: "ic_settings")
let tabBarController = BubbleTabBarController()
// self.viewControllers = [homeNav, playListNav, favoriteNav, settingNav]
let viewControllers = [homeVC, playListVC,favoriteVC ,settingVC]
tabBarController.viewControllers = viewControllers
let tabbarBL = tabBarController.tabBar
tabbarBL.tintColor = AppColors.primary
tabbarBL.shadowImage = UIImage.init()
tabbarBL.backgroundImage = UIImage.init()
tabbarBL.isTranslucent = false
tabbarBL.layer.masksToBounds = false
tabbarBL.isTranslucent = true
tabbarBL.barStyle = .blackOpaque
tabbarBL.itemPositioning = .centered
tabbarBL.itemWidth = 40
tabbarBL.itemSpacing = 38
tabBarController.tabBarItem.setTitleTextAttributes([NSAttributedString.Key.font: AppFonts.coreSansGS45Regular(12), NSAttributedString.Key.foregroundColor: UIColor.gray], for: .normal)
tabBarController.tabBarItem.setTitleTextAttributes([NSAttributedString.Key.font: AppFonts.coreSansGS45Regular(18), NSAttributedString.Key.foregroundColor: AppColors.primary], for: .selected)
self.navigationController?.pushViewController(tabBarController, animated: true)
}
func createTabbarItem(title: String, imageName: String) -> UITabBarItem {
let _image = UIImage.init(named: imageName)?.withRenderingMode(.alwaysOriginal)
let tabbarItem = UITabBarItem.init(title: title, image: _image, selectedImage: UIImage.init(named: imageName))
return tabbarItem
}
}
| [
-1
] |
33f1a592da6177cb0d07cca74cf2bb1d8ea23a3c | 4112b1095af9503c21700339b1fc584519254dca | /MyPersonalAssistant/Controllers/LoginViewController.swift | 1f3529084c653ea02c508873cda57832159211c2 | [] | no_license | VladimirRice/MyPersonalAssistant | 61bc68576447bf60a21f48f47a69d362c8252808 | ecdbb8e043eab9f1eea2e072514cad2350bc62d4 | refs/heads/main | 2023-06-24T14:00:20.878370 | 2021-07-23T05:36:56 | 2021-07-23T05:36:56 | 350,329,604 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 3,082 | swift | //
// LoginViewController.swift
// MyPersonalAssistant
//
// Created by Test on 23.03.17.
// Copyright © 2017 Test. All rights reserved.
//
import UIKit
import LocalAuthentication
class LoginViewController: UIViewController {
var identTrue = false
@IBOutlet weak var faceIdButton: UIButton!
@IBOutlet weak var pinKodtextField: UITextField!
@IBAction func identUserButton(_ sender: UIButton) {
localAuthentication()
}
@IBAction func loginButton(_ sender: UIButton) {
login()
}
override func viewDidLoad() {
super.viewDidLoad()
}
// MARK: func
func login() {
if !identTrue { //&& !(pinKodtextField.text != nil) {
let pinKod = UserDefaults.standard.object(forKey: "pinKod") as? String
if pinKod == pinKodtextField.text || pinKod == PublicVars().mPinKod {//"10297777" {
identTrue = true
}
if identTrue == true {
openViewController()
}
}
}
func openViewController(){
let strViewController = "tabBar"
let navigationController: UINavigationController? = nil
Functions.openNextViewController(selfViewController: self, strViewController: strViewController, navigationController: navigationController, fullScren: true)
}
func localAuthentication() -> Void {
let laContext = LAContext()
var error: NSError?
let biometricsPolicy = LAPolicy.deviceOwnerAuthenticationWithBiometrics
if (laContext.canEvaluatePolicy(biometricsPolicy, error: &error)) {
if let laError = error {
print("laError - \(laError)")
return
}
var localizedReason = "Unlock device"
if #available(iOS 11.0, *) {
if (laContext.biometryType == LABiometryType.faceID) {
localizedReason = "Unlock using Face ID"
//print("FaceId support")
} else if (laContext.biometryType == LABiometryType.touchID) {
localizedReason = "Unlock using Touch ID"
print("TouchId support")
} else {
print("No Biometric support")
}
} else {
//Fallback on earlier versions
}
laContext.evaluatePolicy(biometricsPolicy, localizedReason: localizedReason, reply: { (isSuccess, error) in
DispatchQueue.main.async(execute: {
if let laError = error {
print("laError - \(laError)")
} else {
if isSuccess {
//print("sucess")
self.openViewController()
self.identTrue = true
} else {
print("failure")
}
}
})
})
}
}
} // class
| [
-1
] |
a660f26354688263170fceda64d34dc35bac3a63 | 042c1d0f7fa08c5e78ee0c47f4ab7fc23bac7827 | /MyWeather/HourlyForeCastCVC.swift | f7a42921334729a1aff7b233dbcf9dcacd76ba05 | [] | no_license | jagonza/MyWeather | 3b13660cededc2d92e783c9ca86ed74c40778e80 | f489f94546d69a8390919436ec03355e84703106 | refs/heads/master | 2021-01-10T10:26:45.388985 | 2016-04-17T18:14:23 | 2016-04-17T18:14:23 | 55,348,564 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 613 | swift | //
// HourlyForeCastCVC.swift
// MyWeather
//
// Created by Javier González Rojo on 10/4/16.
// Copyright © 2016 Javier González Rojo. All rights reserved.
//
import UIKit
class HourlyForeCastCVC: UICollectionViewCell {
@IBOutlet weak var dayLbl: UILabel!
@IBOutlet weak var hourLbl: UILabel!
@IBOutlet weak var iconImg: UIImageView!
@IBOutlet weak var tempLbl: UILabel!
@IBOutlet weak var precipProb: UILabel!
override func awakeFromNib() {
dayLbl.numberOfLines = 0;
dayLbl.lineBreakMode = NSLineBreakMode.ByCharWrapping;
}
}
| [
-1
] |
1303b6c7a055d493df088d1ea589cdc8e3fd2a5e | 2630bce11d760b1569b6c714aaa7e7f876e2ac0d | /RxMvvmMoyaCoordinatorDemoTwo/Users/ViewController/Cells/UsersTableViewCell.swift | 2c0b38e361b7fc9206fb7656065ea4eae3d1e0fd | [] | no_license | Ayahamdy97/RxMvvm | 8f4bbffbb263168562052261212eec4015f912fb | cef0f0f1fe8366ab841400786215a1e3f7a775e0 | refs/heads/main | 2023-06-24T09:24:08.237275 | 2021-07-24T15:14:16 | 2021-07-24T15:14:16 | 389,138,589 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 817 | swift | //
// UsersTableViewCell.swift
// RxMvvmMoyaCoordinatorDemoTwo
//
// Created by Aya on 7/24/21.
// Copyright © 2021 Aya. All rights reserved.
//
import UIKit
import SkeletonView
class UsersTableViewCell: UITableViewCell {
@IBOutlet weak var name: UILabel!
@IBOutlet weak var email: UILabel!
override func awakeFromNib() {
super.awakeFromNib()
name.showAnimatedGradientSkeleton()
email.showAnimatedSkeleton()
}
func hideAnimation() {
name.hideSkeleton()
email.hideSkeleton()
}
func configure(user:UserElement) {
name.text = user.name
email.text = user.email
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
}
}
| [
-1
] |
98377dfaa78f06a411a9989dd46b5956a3cc0785 | a1ce4f512c890e06aa0aa4fc94e15951c68bb6cc | /ReSwiftMonitorBrowser/Log.swift | fe5779f93bd00074e926382bb861c4a9339c8563 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | t-osawa-009/ReSwiftMonitorBrowser | 6a35b7c9bfdce469a45e4de0cfe4ccd6be118605 | 29e30fbb5b2ea7dce3c3eae4fa7b57cb4a6e6d43 | refs/heads/master | 2022-12-03T12:12:05.528186 | 2020-08-21T02:14:32 | 2020-08-21T02:14:32 | 287,482,076 | 1 | 0 | null | 2020-08-14T19:49:12 | 2020-08-14T08:21:18 | Swift | UTF-8 | Swift | false | false | 616 | swift | import Foundation
import os.log
private var formatter: DateFormatter = {
let dateFormatter = DateFormatter()
dateFormatter.formatterBehavior = .behavior10_4
dateFormatter.dateFormat = "HH:mm:ss.SSS"
return dateFormatter
}()
func logMessage(message: String, filename: String = #file, line: Int = #line, function: String = #function) {
let dateAndTime = formatter.string(from: Date())
let lastPathComponent = URL(fileURLWithPath: filename).lastPathComponent
let formattedLog = "\(dateAndTime) | \(lastPathComponent):\(line): ( \(function) ): \(message)"
os_log("%@", formattedLog)
}
| [
-1
] |
f5922d8f7fc83a756dc9250923b33a365d391f3e | 6ea659636afb801fad56fd699bb3e3230bad8f42 | /Lifer/Models/Custom Cells/MessagingTableViewCell.swift | 45f2329602d4ee4b77e6e7fd75d8d6eeea94a6f5 | [] | no_license | mauriciocabreira/lifer | 93d859d0bb2fb783a9fe9d4071d1d53481eb828c | 1970d8c6f3da12f8f6a1eb000bcfa0a6c6cd778d | refs/heads/master | 2021-04-15T17:48:28.932180 | 2018-03-21T22:57:51 | 2018-03-21T22:57:51 | 126,250,212 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 380 | swift | //
// MessagingTableViewCell.swift
// Lifer
//
// Created by Mauricio Cabreira on 05/02/18.
// Copyright © 2018 Mauricio Cabreira. All rights reserved.
//
import UIKit
class MessagingTableViewCell: UITableViewCell {
@IBOutlet weak var messageContent: UILabel!
@IBOutlet weak var messageLeftLabel: UILabel!
@IBOutlet weak var messageRightLabel: UILabel!
}
| [
-1
] |
a323b530ef5d52541cb0dd4f507f81423a385ebf | fc7de977645e9a612e769e9b3b9c031ef55f1dcb | /CloudBoost/CloudUser.swift | 7307dc18ba08882614423ab7d4ec2d855ce4c30c | [
"MIT"
] | permissive | visualitysoftware/swift-sdk | b958344ea43c14c5548567f55b7b5ba6b62b004a | 834582c6400a9a0669fc777211493233cd145168 | refs/heads/master | 2020-04-01T23:52:22.950145 | 2016-06-27T14:42:53 | 2016-06-27T14:42:53 | 58,728,257 | 0 | 1 | null | null | null | null | UTF-8 | Swift | false | false | 13,581 | swift | //
// CloudUser.swift
// CloudBoost
//
// Created by Randhir Singh on 27/03/16.
// Copyright © 2016 Randhir Singh. All rights reserved.
//
import Foundation
public class CloudUser: CloudObject {
static var currentUser: CloudUser?
public init(username: String, password: String){
super.init(tableName: "User")
document["username"] = username
document["password"] = password
_modifiedColumns.append("username")
_modifiedColumns.append("password")
document["_modifiedColumns"] = _modifiedColumns
}
private init(doc: NSMutableDictionary){
super.init(tableName: "User")
self.document = doc
}
required public init(tableName: String) {
super.init(tableName: "User")
}
// MARK: Setters
public func setEmail(email: String) {
document["email"] = email
_modifiedColumns.append("email")
document["_modifiedColumns"] = _modifiedColumns
}
public func setUsername(username: String){
document["username"] = username
_modifiedColumns.append("username")
document["_modifiedColumns"] = _modifiedColumns
}
public func setPassword(password: String){
document["password"] = password
_modifiedColumns.append("password")
document["_modifiedColumns"] = _modifiedColumns
}
// MARK: Getters
public func getUsername() -> String? {
return document["username"] as? String
}
public func getEmail() -> String? {
return document["email"] as? String
}
public func getPassword() -> String? {
return document["password"] as? String
}
public func getVersion() -> String?{
return document["_version"] as? String
}
// MARK: Cloud operations on CloudUser
/**
*
* Sign Up
*
* @param callbackObject
* @throws CloudBoostError
*/
public func signup(callback: (response: CloudBoostResponse)->Void) throws{
if(CloudApp.appID == nil){
throw CloudBoostError.AppIdNotSet
}
if(document["username"] == nil){
throw CloudBoostError.UsernameNotSet
}
if(document["email"] == nil){
throw CloudBoostError.EmailNotSet
}
if(document["password"] == nil){
throw CloudBoostError.PasswordNotSet
}
// Setting the payload
let data = NSMutableDictionary()
data["document"] = document
data["key"] = CloudApp.appKey
let url = CloudApp.getApiUrl() + "/user/" + CloudApp.getAppId()! + "/signup"
CloudCommunications._request("POST", url: NSURL(string: url)!, params: data, callback: {
(response: CloudBoostResponse) in
if(CloudApp.isLogging()){
response.log()
}
// Save the user if he has been successfully logged in
if(response.status == 200){
if let doc = response.object as? NSMutableDictionary{
self.resetModificationState()
self.document = doc
self.setAsCurrentUser()
}
}
callback(response: response)
})
}
/**
*
* Log in
*
* @param callbackObject
* @throws CloudBoostError
*/
public func login(callback: (response: CloudBoostResponse)->Void) throws {
if(CloudApp.appID == nil){
throw CloudBoostError.AppIdNotSet
}
if(document["username"] == nil){
throw CloudBoostError.UsernameNotSet
}
if(document["password"] == nil){
throw CloudBoostError.PasswordNotSet
}
// Setting the payload
let data = NSMutableDictionary()
data["document"] = document
data["key"] = CloudApp.appKey
let url = CloudApp.getApiUrl() + "/user/" + CloudApp.getAppId()! + "/login"
CloudCommunications._request("POST", url: NSURL(string: url)!, params: data, callback: {
(response: CloudBoostResponse) in
if response.success {
if let doc = response.object as? NSMutableDictionary {
self.resetModificationState()
self.document = doc
self.setAsCurrentUser()
}
}
// Save the user if he has been successfully logged in
callback(response: response)
})
}
/// Authenticate user against a social provider
///
/// - parameter provider: name of the provider
/// - parameter accessToken: the access token for the specific provider
/// - parameter accessSecret: the access secret key for the specific provider
/// - parameter callback: the response block for this call
///
/// - returns: if response.success is true, response.object will contain a valid CloudUser
///
public class func authenticateWithProvider(provider: String,
accessToken: String,
accessSecret: String,
callback: (response: CloudBoostResponse)->()) throws {
if(CloudApp.appID == nil){
throw CloudBoostError.AppIdNotSet
}
let data: NSMutableDictionary = [
"key": CloudApp.appKey!,
"provider": provider.lowercaseString,
"accessToken": accessToken,
"accessSecret": accessSecret
]
let url = CloudApp.getApiUrl() + "/user/" + CloudApp.getAppId()! + "/loginwithprovider"
CloudCommunications._request("POST", url: NSURL(string: url)!, params: data, callback: {
(response: CloudBoostResponse) in
if let doc = response.object as? NSDictionary where response.success {
if let user = CloudUser.cloudObjectFromDocumentDictionary(doc, documentType: self) as? CloudUser {
response.object = user
user.setAsCurrentUser()
}
}
callback(response: response)
})
}
/**
*
* Log out
*
* @param callbackObject
* @throws CloudBoostError
*/
public func logout(callback: (response: CloudBoostResponse)->Void) throws{
if(CloudApp.appID == nil){
throw CloudBoostError.AppIdNotSet
}
// Setting the payload
let data = NSMutableDictionary()
data["document"] = document
data["key"] = CloudApp.appKey
let url = CloudApp.getApiUrl() + "/user/" + CloudApp.getAppId()! + "/logout"
CloudCommunications._request("POST", url: NSURL(string: url)!, params: data, callback: {
(response: CloudBoostResponse) in
if response.success || response.status == 400 {
CloudUser.removeCurrentUser()
}
// return callback
callback(response: response)
})
}
/// Reset the Password associated with a given email
///
/// - parameter email: email addesso of the use requesting password reset
/// - parameter callback: a block returning a CloudBoostResponse with the response of the operation
///
public static func resetPassword(email: String, callback: (reponse: CloudBoostResponse)->Void) {
let data = NSMutableDictionary()
data["key"] = CloudApp.getAppKey()
data["email"] = email
let url = CloudApp.getApiUrl() + "/user/" + CloudApp.getAppId()! + "/resetPassword"
CloudCommunications._request("POST", url: NSURL(string: url)!, params: data, callback: {
(response: CloudBoostResponse) in
if(CloudApp.isLogging()){
response.log()
}
// Save the user if he has been successfully logged in
callback(reponse: response)
})
}
/// Change the password the current logged user
///
/// - parameter oldPassword: The previous password associaterd with this user
/// - parameter newPassword: The new password to be associated with this user
/// - parameter callback: The block called after the operation is completed, with an `CloudBoostResponse` containing the result
///
public func changePassword(oldPassword: String, newPassword: String, callback: (response: CloudBoostResponse)->Void) {
let data = NSMutableDictionary()
data["key"] = CloudApp.getAppKey()
data["oldPassword"] = oldPassword
data["newPassword"] = newPassword
let url = CloudApp.getApiUrl() + "/user/" + CloudApp.getAppId()! + "/changePassword"
CloudCommunications._request("PUT", url: NSURL(string: url)!, params: data, callback: {
(response: CloudBoostResponse) in
if(CloudApp.isLogging()){
response.log()
}
// Save the user if he has been successfully logged in
if response.status == 200 && response.success {
if let doc = response.object as? NSMutableDictionary {
self.document = doc
}
}
callback(response: response)
})
}
/// Add this user to a spcified CloudRole
///
/// - parameter role: The role to be assigned to this user; must be of class CloudRole
/// - parameter callback: The block called after the operation has bee executed, returning an `CloudBoostResponse` with the result of the operation
///
public func addToRole(role: CloudRole, callback: (response: CloudBoostResponse)-> Void) throws{
if role.getName() == nil {
throw CloudBoostError.InvalidArgument
}
let params = NSMutableDictionary()
params["user"] = self.document
params["role"] = role.document
params["key"] = CloudApp.getAppKey()
let url = CloudApp.getApiUrl() + "/user/" + CloudApp.getAppId()! + "/addToRole"
CloudCommunications._request("PUT", url: NSURL(string: url)!, params: params, callback: {
response in
callback(response: response)
})
}
/**
*
* Remove from Role
*
* @param role
* @param callbackObject
* @throws CloudBoostError
*/
public func removeFromRole(role: CloudRole, callback: (response: CloudBoostResponse)->Void) throws{
if role.getName() == nil {
throw CloudBoostError.InvalidArgument
}
let params = NSMutableDictionary()
params["user"] = self.document
params["role"] = role.document
params["key"] = CloudApp.getAppKey()
let url = CloudApp.getApiUrl() + "/user/" + CloudApp.getAppId()! + "/removeFromRole"
CloudCommunications._request("PUT", url: NSURL(string: url)!, params: params, callback: {
response in
callback(response: response)
})
}
/// Check if the current user belongs to a Role
///
/// - parameter role: The role to check against
/// - returns: true if this user belongs to the Role
///
public func isInRole(role: CloudRole) -> Bool {
if let roles = self.document.get("roles") as? [String] {
if let rID = role.get("_id") as? String where roles.contains(rID) {
return true
}
}
if let roles = self.document.get("roles") as? [NSDictionary] {
if (roles.contains { _role in return (_role["_id"] as! String) == role.getId()!}) {
return true
}
}
if let roles = self.document.get("roles") as? [CloudRole] {
if (roles.contains { _role in return _role.getId()! == role.getId()!}) {
return true
}
}
return false
}
/// Get the current user logged in the system
///
/// - returns: A CloudUser object contining the user currently logged in. If nil, no user is logged in in CLoudBoost
///
public static func getCurrentUser<T where T:CloudUser>() -> T? {
if self.currentUser != nil {
return self.currentUser as? T
}
let def = NSUserDefaults.standardUserDefaults()
if let userDat = def.objectForKey("cb_current_user") as? NSData{
if let doc = NSKeyedUnarchiver.unarchiveObjectWithData(userDat) as? NSMutableDictionary {
let user = T.cloudObjectFromDocumentDictionary(doc, documentType: T.self)
self.currentUser = user as? T
return user as? T
}
return nil
}
return nil
}
public func setAsCurrentUser(){
CloudUser.currentUser = self
let def = NSUserDefaults.standardUserDefaults()
let data = NSKeyedArchiver.archivedDataWithRootObject(self.document)
def.setObject(data, forKey: "cb_current_user")
def.synchronize()
}
public class func removeCurrentUser() {
self.currentUser = nil
let def = NSUserDefaults.standardUserDefaults()
def.removeObjectForKey("cb_current_user")
}
} | [
-1
] |
cf6f983528eef0eb747b8f31c21f7b22fc662e4c | c32f37534d890cb312857c885228da2cfeca1267 | /iOSTask/Controller/APIFunctions.swift | f42a0c7e5422540bb9e02bb6439dd78b9b4becb8 | [] | no_license | Mohamedghaly/iOSTask | 161f35054beb3d28a79a00dff9574ff2afeb0e6d | c94e496284ad286c1809b3870904c935f177e531 | refs/heads/master | 2021-06-28T09:09:34.283965 | 2021-03-24T23:59:16 | 2021-03-24T23:59:16 | 227,392,953 | 0 | 1 | null | 2021-03-24T23:59:16 | 2019-12-11T15:04:00 | Swift | UTF-8 | Swift | false | false | 1,935 | swift | //
// APIFunctions.swift
// Bleeza
//
// Created by Admin on 4/18/19.
// Copyright © 2019 Ghalii. All rights reserved.
//
import Foundation
import UIKit
// MARK: - API Handeller
func api_function <T : Codable> (PageNumber : Int,Items_Per_Page : Int, decoded_data : T.Type , vc : UIViewController) {
let url = setup_url(PageNumber, Items_Per_Page)
var request = URLRequest(url: url)
request.httpMethod = "GET"
request.addValue("application/json", forHTTPHeaderField: "Content-Type")
// MARK: - URL Session Handeller
URLSession.shared.dataTask(with: request) { (data, response, error) in
if response == nil || data == nil || error != nil{
Alert_View(MSG: "There is an Error", vc: vc)
}else{
guard let data = data else {return}
let test = String(data: data, encoding: .utf8)
let jsonData = test!.data(using: .utf8)!
let decoder = JSONDecoder()
guard let respnse = try? decoder.decode( decoded_data.self , from: jsonData) else {
Alert_View(MSG: "There is an Error", vc: vc)
return}
// MARK: - viewController Data Handeller
Notification_Center.post(name: NSNotification.Name(rawValue: "Repos"), object: nil, userInfo: ["data" : respnse.toJSONData()! ])
}
}.resume()
}
func Alert_View(MSG : String , vc: UIViewController) {
let alert = UIAlertController(title: "Alert", message: MSG, preferredStyle: UIAlertController.Style.alert)
alert.addAction(UIAlertAction(title: "Ok", style: UIAlertAction.Style.default, handler: { action in
}))
DispatchQueue.main.async {
vc.present(alert, animated: true, completion: nil)
}
}
| [
-1
] |
1bd45f151ae58b584031ac8e856cfdce03dd993b | 02b1d03747f9b072d9d1909c9ec9342d28a36e90 | /VideoApp/VideoApp/Stores/TwilioAccessToken/CommunityTwilioAccessTokenStore.swift | 048ae0da0527d8200d22e39f9de569284b81dfc3 | [
"Apache-2.0"
] | permissive | asemivragovs/twilio-video-app-ios | 5d4aa4c5a969d090a3546911ccc293ac26a59500 | 5b8efab70a9d98718484f25b11dee39ad6a5a320 | refs/heads/master | 2022-12-07T15:15:08.882403 | 2020-08-25T19:30:22 | 2020-08-25T19:30:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 2,112 | swift | //
// Copyright (C) 2020 Twilio, Inc.
//
// 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 CommunityTwilioAccessTokenStore: TwilioAccessTokenStoreReading {
private let api: APIRequesting
private let appSettingsStore: AppSettingsStoreWriting
private let authStore: AuthStoreReading
init(
api: APIRequesting,
appSettingsStore: AppSettingsStoreWriting,
authStore: AuthStoreReading
) {
self.api = api
self.appSettingsStore = appSettingsStore
self.authStore = authStore
}
func fetchTwilioAccessToken(roomName: String, completion: @escaping (Result<String, APIError>) -> Void) {
let request = CommunityCreateTwilioAccessTokenRequest(
passcode: authStore.passcode ?? "",
userIdentity: appSettingsStore.userIdentity,
createRoom: true,
roomName: roomName
)
api.request(request) { [weak self] result in
guard let self = self else { return }
if let roomType = try? result.get().roomType, roomType != self.appSettingsStore.remoteRoomType {
switch roomType {
case .group, .groupSmall, .unknown:
self.appSettingsStore.videoCodec = .vp8SimulcastVGA
case .peerToPeer:
self.appSettingsStore.videoCodec = .vp8
}
self.appSettingsStore.remoteRoomType = roomType
}
completion(result.map { $0.token })
}
}
}
| [
244608,
203909,
360838,
115465,
115467,
135825,
203922,
203923,
203925,
127766,
127767,
203927,
203926,
385302,
127771,
203932,
127773,
203933,
203934,
203936,
151073,
203937,
203939,
431128,
151082,
151089,
151091,
431165,
135999,
313024,
272324,
262729,
54346,
262733,
272336,
54357,
133846,
244861,
135900,
133853,
133854,
174946,
174947,
339182,
238962,
318194,
318195,
238972,
203901,
244606
] |
45dbd7c466a6502e00da21cace6a805ddd73b5bf | 5277ac5dc20d0a0e4f3cc73226fba8b9916d6143 | /famouschat/Controller/More/Rating/MoreRateVC.swift | 1c229bf1464d9563b03a8df202be8e3e11b47c4b | [] | no_license | DedicatedDev/FamousChat | 6de6601f1ef4a9ca2e023e10d7542741c42fef33 | c6d93f7991325edf14d9cd139da561b17c1fb438 | refs/heads/master | 2022-11-15T21:45:00.182970 | 2020-07-19T17:26:08 | 2020-07-19T17:26:08 | 280,915,795 | 1 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 12,476 | swift | //
// MoreRateVC.swift
// famouschat
//
// Created by T-Tech Solutions LLC on 09/11/2018.
// Copyright © 2018 T-Tech Solutions LLC. All rights reserved.
//
import UIKit
import NVActivityIndicatorView
import ObjectMapper
class MoreRateVC: UIViewController, NVActivityIndicatorViewable {
@IBOutlet weak var header_frame: UIView!
@IBOutlet weak var back_img: UIImageView!
@IBOutlet weak var back_btn: UIButton!
@IBOutlet weak var menu_img: UIImageView!
@IBOutlet weak var menu_btn: UIButton!
@IBOutlet weak var collectionView: UICollectionView!
@IBOutlet weak var rate_frame: UIView!
@IBOutlet weak var minute_today: UILabel!
@IBOutlet weak var minute_month_frame: UIView!
@IBOutlet weak var minute_month: UILabel!
@IBOutlet weak var minute_year_frame: UIView!
@IBOutlet weak var minute_year: UILabel!
@IBOutlet weak var minute_total_frame: UIView!
@IBOutlet weak var minute_total: UILabel!
@IBOutlet weak var earn_today: UILabel!
@IBOutlet weak var earn_month_frame: UIView!
@IBOutlet weak var earn_month: UILabel!
@IBOutlet weak var earn_year_frame: UIView!
@IBOutlet weak var earn_year: UILabel!
@IBOutlet weak var earn_total_frame: UIView!
@IBOutlet weak var earn_total: UILabel!
@IBOutlet weak var call_today: UILabel!
@IBOutlet weak var call_month_frame: UIView!
@IBOutlet weak var call_month: UILabel!
@IBOutlet weak var call_year_frame: UIView!
@IBOutlet weak var call_year: UILabel!
@IBOutlet weak var call_total_frame: UIView!
@IBOutlet weak var call_total: UILabel!
@IBOutlet weak var review_frame: UIView!
@IBOutlet weak var review_go_img: UIImageView!
@IBOutlet weak var rate_label: UILabel!
@IBOutlet weak var like_0: UIImageView!
@IBOutlet weak var like_1: UIImageView!
@IBOutlet weak var like_2: UIImageView!
@IBOutlet weak var like_3: UIImageView!
@IBOutlet weak var like_4: UIImageView!
@IBOutlet weak var go_img: UIImageView!
var like_stars = [UIImageView]()
let progressDlg = ShareData.progressDlgs[ShareData.progress_index]
var collectionViewLayout: LGHorizontalLinearFlowLayout?
let rate_cnt = ShareData.rank_info.category_rank!.count + 1
var shadow_10_views = [UIView]()
var shadow_5_views = [UIView]()
var selectedIndexPath: IndexPath!
override func viewDidLoad() {
super.viewDidLoad()
like_stars = [like_0, like_1, like_2, like_3, like_4]
shadow_10_views = [header_frame]
shadow_5_views = [rate_frame, minute_month_frame, minute_year_frame, minute_total_frame, earn_month_frame, earn_year_frame, earn_total_frame, call_month_frame, call_year_frame, call_total_frame]
init_UI()
}
func init_UI()
{
self.navigationController?.isNavigationBarHidden = true
let back_image = UIImage.init(named: "back")!.withRenderingMode(.alwaysTemplate)
back_img.image = back_image
back_img.tintColor = Utility.color(withHexString: "10A7BA")
// let menu_image = UIImage.init(named: "menu_1")!.withRenderingMode(.alwaysTemplate)
// menu_img.image = menu_image
// menu_img.tintColor = Utility.color(withHexString: ShareData.btn_color)
let go_image = UIImage.init(named: "go")!.withRenderingMode(.alwaysTemplate)
go_img.image = go_image
go_img.tintColor = UIColor.darkGray
// menu_btn.addTarget(self.slideMenuController, action: #selector(slideMenuController.toggleMenuAnimated(_:)), for: .touchUpInside)
back_btn.addTarget(self, action: #selector(self.backAction(_:)), for: .touchUpInside)
for cell in shadow_10_views
{
cell.dropShadow(color: .gray, opacity: 0.8, offSet: CGSize.zero, radius: 10, scale: true)
}
for cell in shadow_5_views
{
cell.layer.cornerRadius = CGFloat(ShareData.btn_radius)
cell.clipsToBounds = true
cell.dropShadow(color: .gray, opacity: 0.8, offSet: CGSize.zero, radius: 5, scale: true)
}
rate_label.text = String(format: "%.01f", Double(ShareData.user_info.rate!)!)
CommonFuncs().likeStars(Double(ShareData.user_info.rate!)!, [like_0, like_1, like_2, like_3, like_4])
let data = ShareData.rank_info!
minute_today.text = "\(data.today_minutes!)"
minute_month.text = "\(data.month_minutes!)"
minute_year.text = "\(data.year_minutes!)"
minute_total.text = "\(data.total_minutes!)"
let array = CommonFuncs().splitString(ShareData.user_info.chat_rate!.characters.split(separator: ",").map(String.init)[0])
let rate = (Double(array[2])! + Double(array[3])! / 100) / (Double(array[0])! * 60 + Double(array[1])!)
earn_today.text = String(format: "%.01f", rate * Double(data.today_minutes!)!)
earn_month.text = String(format: "%.01f", rate * Double(data.month_minutes!)!)
earn_year.text = String(format: "%.01f", rate * Double(data.year_minutes!)!)
earn_total.text = String(format: "%.01f", rate * Double(data.total_minutes!)!)
call_today.text = "\(data.today_calls!)"
call_month.text = "\(data.month_calls!)"
call_year.text = "\(data.year_calls!)"
call_total.text = "\(data.total_calls!)"
collectionView.dataSource = self
collectionView.delegate = self
collectionView.register(UINib(nibName: "RateCell", bundle: nil), forCellWithReuseIdentifier: "RateCell")
let height = collectionView.frame.height - 10
let width = height
collectionViewLayout = LGHorizontalLinearFlowLayout.init(configuredWith: collectionView, itemSize: CGSize(width: width, height: height), minimumLineSpacing: 0)
// self.tableView.separatorColor = UIColor.clear
// self.tableView.separatorStyle = .none
// self.tableView.tableFooterView = UIView()
//
// self.tableView.delegate = self
// self.tableView.dataSource = self
// self.tableView.register(UINib(nibName: "ReviewCell", bundle: nil), forCellReuseIdentifier: "ReviewCell")
}
override func viewDidLayoutSubviews() {
let indexPath = IndexPath(item: rate_cnt / 2, section: 0)
self.collectionView.scrollToItem(at: indexPath, at: [.centeredVertically, .centeredHorizontally], animated: true)
}
@objc func backAction(_ sender: UIButton) {
ShareData.main_or_more_status = true
UIApplication.shared.keyWindow?.setRootViewController(MainTabVC(), options: UIWindow.TransitionOptions(direction: .toLeft, style: .easeIn), slide_direction: .fromLeftToRight)
}
@IBAction func reviewAction(_ sender: Any) {
ShareData.review_from_status = true
ShareData.rate_or_follow_status = true
self.startAnimating(CGSize(width: 40, height: 40), message: nil, type: progressDlg, color: .darkGray, fadeInAnimation: nil)
let parmeters = ["user_id": ShareData.user_info.id!, "type": "0"] as [String: Any]
CommonFuncs().createRequest(false, "review/request", "POST", parmeters, completionHandler: {data in
let status = data["status"] as! Bool
let message = data["message"] as! String
DispatchQueue.main.async {
if status
{
if let detail = data["data"] as? [AnyHashable:Any], let temp = Mapper<ReviewMDL>().mapArray(JSONObject: detail["reviews"])
{
ShareData.reviews = temp
self.navigationController?.pushViewController(MoreRateReviewVC(), animated: true)
}
else
{
CommonFuncs().doneAlert(ShareData.appTitle, "There are currently no reviews", "CLOSE", {})
}
}
else
{
CommonFuncs().doneAlert(ShareData.appTitle, "There are currently no reviews", "CLOSE", {})
}
self.stopAnimating(nil)
}
})
}
}
extension MoreRateVC: UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout
{
func numberOfSections(in collectionView: UICollectionView) -> Int {
return 1
}
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return rate_cnt
}
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {
return UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
}
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat {
return 50
}
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
let height = collectionView.frame.height - 10
let width = height
return CGSize(width: width, height: height)
}
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "RateCell", for: indexPath) as! RateCell
cell.first_frame.layer.cornerRadius = cell.first_frame.frame.height / 2
cell.first_frame.clipsToBounds = true
let data = ShareData.rank_info!
let array = CommonFuncs().splitString(ShareData.user_info.category!)
if indexPath.row == rate_cnt / 2
{
cell.rate.text = "\(data.total_rank!)"
cell.category.text = "GENERAL RANKING"
}
else if indexPath.row < rate_cnt / 2
{
cell.rate.text = "\(data.category_rank[indexPath.row])"
cell.category.text = ShareData.category_list.filter{$0.id! == array[indexPath.row]}[0].name!.uppercased()
}
else
{
cell.rate.text = "\(data.category_rank[indexPath.row - 1])"
cell.category.text = ShareData.category_list.filter{$0.id! == array[indexPath.row - 1]}[0].name!.uppercased()
}
return cell
}
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
selectedIndexPath = indexPath
}
}
extension MoreRateVC: UITableViewDelegate, UITableViewDataSource
{
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int
{
return ShareData.reviews.count
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return CommonFuncs().getStringHeight(ShareData.reviews[indexPath.row].review, 15, UIScreen.main.bounds.width, 100, 60)
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell
{
let cell : ReviewCell = tableView.dequeueReusableCell(withIdentifier: "ReviewCell", for: indexPath) as! ReviewCell
cell.backgroundColor = UIColor.clear
cell.contentView.backgroundColor = UIColor.clear
cell.selectionStyle = UITableViewCellSelectionStyle.none
let data = ShareData.reviews[indexPath.row]
cell.photo.load(url: data.photo!)
cell.photo.layer.cornerRadius = cell.photo.frame.height / 2
cell.photo.clipsToBounds = true
cell.name.text = data.name!
cell.post_date.text = CommonFuncs().historyTime(data.time!, data.time_zone!)
CommonFuncs().likeStars((Double(data.mark1!)! + Double(data.mark2!)! + Double(data.mark3!)!) / 3, cell.like_stars)
cell.review.text = data.review!
return cell
}
}
| [
-1
] |
88d64d72ad0d5f771d29ec52f956d5955f9a2ac5 | 0b3f84a44456c734a6a1bf6b24229ee447b172e1 | /ViewController.swift | e6d9265c0b8a1a2f15bb1bfc7432f8863f52fa0e | [] | no_license | dyk940707/DoyunWeather | 8284ffa437e47d7a9cf440c8ec36068f19c3c402 | a76622e5306a8b5568001073b943e1b2e03c841e | refs/heads/master | 2020-06-17T07:21:47.072691 | 2019-07-11T05:52:44 | 2019-07-11T05:52:44 | 195,844,026 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 6,881 | swift | //
// ViewController.swift
// DoyunWeather
//
// Created by Doyun on 09/07/2019.
// Copyright © 2019 Doyun. All rights reserved.
//
import UIKit
import CoreLocation
extension UIViewController {
func show(message: String) {
let alert = UIAlertController(title: "알림", message: message, preferredStyle: .alert)
let ok = UIAlertAction(title: "확인", style: .default, handler: nil)
alert.addAction(ok)
present(alert, animated: true, completion: nil)
}
}
class ViewController: UIViewController {
@IBOutlet weak var locationLabel: UILabel!
lazy var locationManager: CLLocationManager = {
let m = CLLocationManager()
m.delegate = self
return m
}()
let tempFormatter: NumberFormatter = {
let formatter = NumberFormatter()
formatter.minimumFractionDigits = 0
formatter.maximumFractionDigits = 1
return formatter
}()
let dateFormatter: DateFormatter = {
let formatter = DateFormatter()
formatter.locale = Locale(identifier: "Ko_kr")
return formatter
}()
@IBOutlet weak var listTableView: UITableView!
override func viewDidLoad() {
super.viewDidLoad()
listTableView.backgroundColor = UIColor.clear
listTableView.separatorStyle = .none
listTableView.showsVerticalScrollIndicator = false
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
locationLabel.text = "업데이트 중..."
if CLLocationManager.locationServicesEnabled() {
switch CLLocationManager.authorizationStatus(){
case .notDetermined:
locationManager.requestWhenInUseAuthorization()
case .authorizedWhenInUse, .authorizedAlways: updateCurrentLocation()
case .denied, .restricted:
show(message: "위치 서비스 사용 불가")
}
} else {
show(message: "위치 서비스 사용 불가")
}
}
var topInset: CGFloat = 0.0
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
if topInset == 0.0 {
let first = IndexPath(row: 0, section: 0)
if let cell = listTableView.cellForRow(at: first) {
topInset = listTableView.frame.height - cell.frame.height
listTableView.contentInset = UIEdgeInsets(top: topInset, left: 0, bottom: 0, right: 0)
}
}
}
}
extension ViewController: CLLocationManagerDelegate {
func updateCurrentLocation() {
locationManager.startUpdatingLocation()
}
func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
if let loc = locations.first {
print(loc.coordinate)
//Geocoding이란? 특정위치에 대한 고유한명칭을 사용하여 좌표를 얻는 것
//ex)주소를 좌표로 바꾸는 것
//Reverse Geocoding : 좌표를 주소로 바꾸는 것
let decoder = CLGeocoder()
decoder.reverseGeocodeLocation(loc) { [weak self] (placemarks, error) in
if let place = placemarks?.first {
if let gu = place.locality, let dong = place.subLocality {
self?.locationLabel.text = "\(gu) \(dong)"
} else {
self?.locationLabel.text = place.name
}
}
}
WeatherDataSource.shared.fetch(location: loc) {
self.listTableView.reloadData()
}
}
manager.stopUpdatingLocation()
}
func locationManager(_ manager: CLLocationManager, didFailWithError error: Error) {
show(message: error.localizedDescription)
manager.stopUpdatingLocation()
}
func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) {
switch status {
case .authorizedWhenInUse, .authorizedAlways:
updateCurrentLocation()
default:
break
}
}
}
extension ViewController: UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return 2 // 테이블뷰에 2개의 섹션 표시
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
switch section {
case 0: //현재날씨 하나만 표시
return 1
case 1: //예보의 숫자만큼 리턴해야함.
return WeatherDataSource.shared.forecastList.count
default:
return 0
}
}
//셀을 리턴하는 코드
//summary 셀 리턴
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.section == 0 {
let cell = tableView.dequeueReusableCell(withIdentifier: SummaryTableViewCell.identifier, for: indexPath) as! SummaryTableViewCell
if let data = WeatherDataSource.shared.summary?.weather.minutely.first {
cell.weatherImageView.image = UIImage(named: data.sky.code)
cell.statusLabel.text = data.sky.name
let max = Double(data.temperature.tmax) ?? 0.0
let min = Double(data.temperature.tmin) ?? 0.0
let maxStr = tempFormatter.string(for: max) ?? "-"
let minStr = tempFormatter.string(for: min) ?? "-"
cell.minMaxLabel.text = "최대 \(maxStr)º 최소 \(minStr)º"
let current = Double(data.temperature.tc) ?? 0.0
let currentStr = tempFormatter.string(for: current) ?? "-"
cell.currentTemperatureLabel.text = "\(currentStr)º"
}
return cell
}
//forecast 셀 리턴
let cell = tableView.dequeueReusableCell(withIdentifier: ForecastTableViewCell.identifier, for: indexPath) as! ForecastTableViewCell
let target = WeatherDataSource.shared.forecastList[indexPath.row]
dateFormatter.dateFormat = "M.d (E)"
cell.dateLabel.text = dateFormatter.string(for: target.date)
dateFormatter.dateFormat = "HH:00"
cell.timeLabel.text = dateFormatter.string(for: target.date)
cell.weatherImageView.image = UIImage(named: target.skyCode)
// 현재날씨
cell.statusLabel.text = target.skyName
let tempStr = tempFormatter.string(for: target.temperature) ?? "-"
cell.temperatureLabel.text = "\(tempStr)º"
return cell
}
}
| [
-1
] |
d79d09293c4d04b08430aaa3187d3de092f4e12d | 83480dae5c313fcaffc8e990c9433a37c09ac414 | /Slogger/Slogger/Destination.swift | d5337e21e4ac1ae9c1b359e2e616c56ec6c5c9dd | [
"MIT"
] | permissive | dgoodine/Slogger | c76b2d1d617d6860d52bb28d46e7023ae1c5d9b4 | 7e9aa72efce932c6af76fffb4d0a1f9ff72686a5 | refs/heads/master | 2020-12-25T20:56:50.902290 | 2020-08-03T17:32:15 | 2020-08-03T17:32:15 | 44,602,129 | 4 | 0 | MIT | 2020-08-03T17:32:17 | 2015-10-20T11:37:35 | Swift | UTF-8 | Swift | false | false | 1,971 | swift | //
// BaseDestination.swift
// Slogger
//
// Created by David Goodine on 10/28/15.
// Copyright © 2015 David Goodine. All rights reserved.
//
import Foundation
/// Protocol all destinations must implement.
public protocol Destination {
/// A custom generator for this destination. If nil, the output will not be decorated.
var decorator: Decorator? { get set }
/// The generator for this destination.
var generator: Generator { get set }
/// A custom decorator for this destination. If nil, no color will be used.
var colorMap: ColorMap? { get set }
/// The details to be logged for this destination.
var details: [Detail] { get set }
/*
The function called by the internal system to emit the event.
- Parameter string: The string representation of the logging event.
- Parameter level: The logging level, provided for level-based destination routing.
*/
func logString (_ string: String, level: Level)
}
/**
Abstract providing some of the Destination protocol.
Subclasses must conform to Destination and provide the `logString` function.
*/
open class DestinationBase {
/// Protocol Implementation
open var decorator: Decorator?
/// Protocol Implementation
open var generator: Generator
/// Protocol Implementation
open var colorMap: ColorMap?
/// Protocol Implementation
open var details: [Detail]
/**
Designated initializer.
- Parameter generator: Generator to use for this destination.
- Parameter colorMap: Colormap to use for this destination. If nil, uses the logger's colorMap.
- Parameter decorator: Decorator to use for this destination. If nil, uses the logger's decorator.
*/
public init (details: [Detail]? = nil, generator: Generator = Generator(), colorMap: ColorMap? = nil, decorator: Decorator? = nil) {
self.generator = generator
self.details = details != nil ? details! : Detail.allValues
self.colorMap = colorMap
self.decorator = decorator
}
}
| [
-1
] |
cfa9c149c6180948cd6605e9df6740ae509a5c9f | d0060c72b31455cd54bd56b953f5d96fb183ec52 | /SmartStroller/SmartStroller/SmartStrollerApp.swift | b421cd17322ed5bd216c1f4c7f730c139aafb84b | [
"MIT"
] | permissive | RamonBrisk/SmartStroller | c33b6663f16292e69865d96c5789ddef2c87dfbe | 9332dc2249b14f227e08035ed1550cb1b69620e2 | refs/heads/main | 2023-05-02T05:43:09.631432 | 2021-05-14T02:52:34 | 2021-05-14T02:52:34 | 336,799,893 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 236 | swift | //
// SmartStrollerApp.swift
// SmartStroller
//
// Created by 李杨 on 2021/2/6.
//
import SwiftUI
@main
struct SmartStrollerApp: App {
var body: some Scene {
WindowGroup {
ContentView()
}
}
}
| [
402952,
266773,
435226,
397857,
253991,
404520,
395307,
273453,
375349,
385086,
352323,
404552,
257621,
383575,
345176,
392282,
260703,
435300,
377445,
266348,
377458,
272499,
48246,
370295,
210552,
377465,
384118,
422531,
377988,
413317,
265365,
199834,
422042,
221343,
275106,
386732,
210605,
265397,
272055,
369335,
384697,
272575,
153795,
199881,
417998,
418005,
358616,
436953,
380139,
380652,
203500,
418548,
264951,
203516,
416512,
387348,
257309,
434973,
419103,
271654,
197415,
342822,
415014,
378670,
156476,
274237,
429375,
274243,
438595,
268613,
272205,
353615,
409423,
372055,
420699,
173919,
271714,
384355,
213351,
197484,
271726,
345454,
213360,
213363,
272245,
156543,
396166,
387978,
426898,
395179,
347056,
176563,
436666,
349120,
398274,
208333,
225230,
393168,
208340,
421334,
425944,
359386,
271326,
369127,
418795,
380917,
391670
] |
6399c0c972a8e648343a89abe48bde75fa2263f0 | 2dbcbc208616e4358cc0b853ae2ee48a30693e82 | /Smashtag/SmashtagTests/SmashtagTests.swift | d1b6782fee5762009f93274930083b868faf6fac | [] | no_license | eclipsegst/ios-swift | 72db53b22d3e018dc9d09f7f540003761599aeef | 9cf5ddbd4415fc7e1db7fdba215e6d8b22354b0a | refs/heads/master | 2021-03-22T00:10:38.072024 | 2015-05-15T17:39:12 | 2015-05-15T17:39:12 | 35,078,814 | 1 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 907 | swift | //
// SmashtagTests.swift
// SmashtagTests
//
// Created by iOS Students on 5/13/15.
// Copyright (c) 2015 Zhaolong Zhong. All rights reserved.
//
import UIKit
import XCTest
class SmashtagTests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}
func testExample() {
// This is an example of a functional test case.
XCTAssert(true, "Pass")
}
func testPerformanceExample() {
// This is an example of a performance test case.
self.measureBlock() {
// Put the code you want to measure the time of here.
}
}
}
| [
276481,
276484,
276489,
278541,
278544,
278550,
276509,
278561,
159807,
280649,
278618,
194652,
194653,
278624,
276581,
276582,
43109,
276585,
276589,
227439,
227446,
276606,
276613,
141450,
276631,
276632,
227492,
227495,
176314,
276684,
278742,
278746,
155867,
276709,
276715,
233715,
227576,
211193,
227585,
276737,
227592,
276744,
276753,
276760,
278810,
276764,
276774,
276787,
164162,
278856,
278862,
278863,
276821,
276822,
276831,
278898,
278908,
178571,
276900,
278951,
278954,
278965,
276919,
276920,
278969,
276925,
278985,
279002,
227813,
279019,
279022,
276998,
279054,
223769,
277029,
277048,
277066,
277083,
166507,
277101,
189037,
189042,
189043,
277117,
277118,
184962,
225933,
133774,
277133,
277142,
225943,
225944,
164512,
225956,
285353,
209581,
154291,
277172,
277175,
277176,
277190,
199366,
225997,
226001,
164563,
226004,
203477,
203478,
277204,
201442,
226035,
234238,
234241,
226051,
234245,
226058,
234250,
234253,
234256,
285463,
234263,
369432,
105246,
228129,
234280,
277289,
234283,
226097,
234289,
162621,
234301,
234304,
234305,
234311,
277327,
234323,
234326,
277339,
297822,
174949,
234343,
277354,
234346,
234361,
277370,
226170,
234366,
234367,
226181,
213894,
277381,
226184,
234377,
234381,
226194,
234395,
279456,
234404,
226214,
234409,
275371,
226223,
226227,
234419,
234425,
277435,
287677,
234430,
226241,
275397,
226249,
234445,
234450,
234451,
234454,
234457,
234466,
277480,
234477,
234492,
234495,
277505,
234498,
277510,
234503,
277513,
234506,
277517,
275469,
197647,
295953,
234517,
234530,
234531,
234534,
275495,
234539,
310317,
277550,
275505,
277563,
234555,
156733,
7230,
277566,
234560,
207938,
281666,
277574,
207953,
277585,
296018,
234583,
234584,
275547,
234594,
277603,
234603,
156785,
275571,
234622,
275590,
234632,
302217,
234642,
277651,
226452,
226451,
119963,
234652,
277665,
275620,
275625,
275628,
226479,
226481,
277686,
277690,
277694,
203989,
275671,
285929,
204022,
120055,
277792,
259363,
277800,
113962,
113966,
226609,
277809,
277814,
277815,
277821,
277824,
277825,
15686,
277831,
277838,
277841,
277845,
277852,
224606,
142689,
302438,
277862,
281962,
277868,
277871,
279919,
277878,
275831,
275832,
277882,
277883,
142716,
275839,
277890,
277891,
226694,
277896,
281992,
277900,
230799,
296338,
277907,
226711,
226712,
277911,
277920,
277925,
277927,
370091,
277936,
277939,
277940,
277943,
296375,
277946,
277952,
296387,
277957,
163269,
296391,
277962,
277965,
277974,
277977,
277980,
226781,
277983,
277988,
277993,
277994,
296425,
277997,
278002,
226805,
278005,
278008,
175625,
280077,
65041,
204313,
278056,
278060,
228917,
226875,
128583,
226888,
276045,
276046,
226897,
276050,
226906,
370271,
276085,
276088,
276092,
278140,
188031,
192131,
276100,
276101,
312972,
278160,
278162,
276116,
276120,
280220,
276126,
276129,
276146,
278214,
276179,
276180,
216795,
276195,
276219,
171776,
278285,
276238,
227091,
184086,
278299,
276253,
278316,
276279,
288574,
276287,
276298,
296779,
188246,
276325,
227177,
173936,
276344,
227199,
40850,
40853,
44952,
276385,
227238,
276394,
276400,
276401,
276408,
276413,
276421,
276422,
276430,
276444,
276450,
276451,
276454,
276459,
276463,
276468,
276469,
276475,
276478
] |
c564453cb3e33145a2425028918e48c6bc2edbd7 | ff76bb8d2eedb69ca041bd68e6a47f77c5f7f871 | /Funny/Funny/Classes/Essence(精华)/ViewModel/XGTopicListViewModel.swift | 4c3a6c63fba8142bd3c5b34eb7e337653d4cf9eb | [
"Apache-2.0"
] | permissive | shaoxingguo/Funny | 59cd692848d2acf1a347abb6bacd739e2c23c9cb | a6f957b2d507e9b85259e7f12843aeb9d10ba79c | refs/heads/master | 2020-07-06T02:37:14.364109 | 2019-06-09T08:47:41 | 2019-06-09T08:47:41 | 202,861,757 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,681 | swift | //
// XGTopicListViewModel.swift
// Funny
//
// Created by monkey on 2019/3/12.
// Copyright © 2019 itcast. All rights reserved.
//
import UIKit
class XGTopicListViewModel
{
/// 数据模型数组
private(set) open var topicList = [XGTopicViewModel]()
}
// MARK: - 网络请求数据
extension XGTopicListViewModel
{
/// 获取自定义类型的帖子
///
/// - Parameters:
/// - type: 帖子类型
/// - isNewTopocList: 是否是新帖 默认false
/// - maxId: 帖子id 加载比此id小的帖子 加载更多数据
/// - minId: 帖子id 加载比此id大的帖子 加载最新数据
/// - completion: 完成回调
open func loadTopicList(type:XGTopicType,isNewTopicList:Bool = false, maxId:Int = 0, minId:Int = 0, completion:@escaping (Bool)-> Void) -> Void
{
XGTopicDAL.shared.loadTopicList(type: type, isNewTopicList: isNewTopicList, maxId: maxId, minId: minId) { (responseObject, error) in
if responseObject == nil || error != nil {
completion(false)
return
}
let topicModelArr = XGTopicModel.mj_objectArray(withKeyValuesArray: responseObject!) as? [XGTopicModel]
if minId != 0 {
// 下拉刷新 加载最新帖子 删除之前的帖子 加载最新数据
self.topicList.removeAll()
}
// 模型转视图模型
for topicModel in topicModelArr ?? [] {
self.topicList.append(XGTopicViewModel(model: topicModel))
}
// 完成回调
completion(true)
}
}
}
| [
-1
] |
8e650a225aa74070e888763506a6cc63550a2d72 | 556d521a9a5c75264af87ea87bbb02e0f9594328 | /BlockChainWallet/BlockChainWallet/AppDelegate.swift | c35e7d0dd348645ee3dd20522b827387d272848b | [
"Apache-2.0"
] | permissive | 20156284/Wallet | 83b60343ecea62865e76ab6cddee40451854d32c | 851508390f92c86e01d9a30179e4e46dd0429c0d | refs/heads/main | 2023-06-12T21:41:12.485642 | 2021-07-07T08:56:33 | 2021-07-07T08:56:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,334 | swift | //
// AppDelegate.swift
// BlockChainWallet
//
// Created by user on 2021/1/18.
//
import UIKit
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
LocalizationTool.shared.checkLanguage()
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,
376889,
385081,
393275,
376905,
254030,
368727,
180313,
368735,
180320,
376931,
368752,
417924,
262283,
377012,
327871,
180416,
377036,
377046,
418007,
418010,
377060,
205036,
393456,
393460,
336123,
418043,
385280,
336128,
262404,
180490,
164106,
368911,
262416,
262422,
262436,
262454,
393538,
262472,
344403,
213332,
65880,
262496,
418144,
262499,
213352,
262507,
262510,
213372,
385419,
393612,
262550,
262552,
385440,
385443,
385451,
262573,
393647,
385458,
262586,
344511,
262592,
360916,
369118,
328177,
328179,
328182,
328189,
328192,
164361,
410128,
393747,
254490,
188958,
385570,
33316,
377383,
352821,
197177,
418363,
188987,
369223,
385609,
385616,
352864,
369253,
262760,
352874,
352887,
254587,
377472,
148105,
352918,
98968,
344744,
361129,
385713,
434867,
164534,
336567,
164538,
352968,
352971,
418507,
352973,
385748,
361179,
369381,
361195,
418553,
344831,
336643,
344835,
344841,
336659,
418580,
418585,
434970,
418589,
262942,
418593,
336675,
418598,
418605,
336696,
361273,
361288,
328522,
426841,
197468,
361309,
254812,
361315,
361322,
377729,
222128,
345035,
386003,
345043,
386011,
386018,
386022,
435187,
361489,
386069,
336921,
386073,
345118,
377887,
345133,
345138,
386101,
361536,
345169,
361567,
148578,
386167,
361593,
410745,
214149,
345222,
386186,
345246,
214175,
337071,
337075,
345267,
386258,
66782,
222437,
328941,
386285,
386291,
345376,
345379,
410917,
345382,
345399,
378169,
369978,
337222,
337229,
337234,
263508,
402791,
271730,
378227,
271745,
181638,
353673,
181643,
181654,
230809,
181681,
181684,
361917,
337349,
271839,
329191,
361960,
116210,
329226,
419339,
419343,
419349,
419355,
370205,
419359,
419362,
394786,
370213,
419368,
419376,
206395,
214593,
419400,
419402,
353867,
419406,
419410,
345701,
394853,
222830,
370297,
353919,
403075,
198280,
345736,
403091,
345749,
345757,
345762,
419491,
345765,
419497,
419501,
370350,
419506,
419509,
337592,
419512,
419517,
337599,
419527,
419530,
419535,
272081,
394966,
419542,
419544,
181977,
345818,
419547,
419550,
419559,
419563,
370415,
337659,
337668,
362247,
395021,
362255,
116509,
345887,
378663,
345905,
354106,
354111,
247617,
354117,
370509,
354130,
247637,
337750,
313180,
354150,
354156,
345964,
345967,
345970,
345974,
403320,
354172,
247691,
337808,
247700,
436126,
436132,
362413,
337844,
346057,
346063,
346068,
329697,
354277,
190439,
247789,
354313,
436289,
378954,
395339,
338004,
100453,
329855,
346272,
362660,
100524,
387249,
379066,
387260,
256191,
395466,
346316,
411861,
411864,
411868,
411873,
379107,
387301,
387306,
387312,
436473,
379134,
411903,
379152,
395538,
387349,
338199,
387352,
395566,
248111,
362822,
436555,
190796,
379233,
354673,
420236,
379278,
272786,
354727,
338352,
330189,
338381,
256472,
338403,
248308,
199164,
330252,
199186,
330267,
354855,
10828,
199249,
174695,
191084,
338543,
191092,
346742,
330383,
354974,
150183,
174774,
248504,
174777,
223934,
355024,
273108,
355028,
264918,
183005,
256734,
436962,
338660,
338664,
264941,
207619,
264964,
338700,
256786,
199452,
363293,
396066,
396069,
215853,
355122,
355131,
355140,
355143,
355150,
330580,
355166,
265055,
355175,
387944,
355179,
330610,
355218,
330642,
412599,
207808,
379848,
396245,
330710,
248792,
248798,
347105,
257008,
183282,
265207,
265214,
330768,
248862,
396328,
158761,
347176,
199728,
330800,
396336,
396339,
339001,
388154,
388161,
347205,
248904,
248914,
412764,
339036,
257120,
265320,
248951,
420984,
330889,
248985,
339097,
44197,
380070,
339112,
249014,
126144,
330965,
388319,
388347,
175375,
175396,
208166,
273708,
372015,
347441,
372018,
199988,
44342,
175415,
396600,
437566,
175423,
437570,
437575,
437583,
331088,
437587,
331093,
396633,
175450,
437595,
175457,
208227,
175460,
175463,
437620,
175477,
249208,
175483,
175486,
249214,
175489,
249218,
249227,
175513,
175516,
396705,
175522,
355748,
380332,
396722,
208311,
372163,
380360,
216522,
339404,
372176,
208337,
339412,
413141,
339417,
339420,
339424,
339428,
339434,
249328,
69113,
372228,
208398,
380432,
265778,
265795,
396872,
265805,
224853,
224857,
257633,
224870,
257646,
372337,
224887,
224890,
372353,
224897,
216707,
126596,
421508,
224904,
224909,
159374,
11918,
126610,
126616,
224926,
257704,
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,
167700,
372499,
225048,
257819,
225053,
225058,
339747,
257833,
225066,
257836,
413484,
225070,
225073,
372532,
257845,
225079,
397112,
225082,
397115,
225087,
225092,
225096,
257868,
225103,
257871,
397139,
225108,
225112,
257883,
257886,
225119,
257890,
225127,
257896,
274280,
257901,
225137,
257908,
225141,
257912,
257916,
225148,
257920,
225155,
339844,
225165,
397200,
225170,
380822,
225175,
225180,
184244,
372664,
372702,
372706,
356335,
380918,
405533,
430129,
266294,
266297,
421960,
356439,
430180,
421990,
266350,
266362,
381068,
225423,
250002,
250004,
225429,
356506,
225437,
135327,
225441,
438433,
192673,
225444,
438436,
225447,
438440,
225450,
258222,
225455,
225458,
225461,
225466,
389307,
225470,
381120,
372929,
430274,
225475,
389320,
225484,
225487,
225490,
225493,
266453,
225496,
225499,
225502,
225505,
356578,
217318,
225510,
225514,
225518,
372976,
381176,
389380,
61722,
356637,
356640,
356643,
356646,
266536,
356649,
356655,
332080,
397622,
332090,
225597,
332097,
348488,
250199,
332125,
332152,
250238,
389502,
356740,
373145,
340379,
389550,
266687,
160234,
127471,
340472,
324094,
266754,
324111,
381481,
356907,
324142,
356916,
324149,
324155,
348733,
324164,
348743,
381512,
324173,
324176,
389723,
332380,
373343,
340627,
373398,
184982,
258721,
332453,
332459,
389805,
332463,
381617,
332471,
332483,
332486,
373449,
332493,
357069,
357073,
332511,
332520,
340718,
332533,
348924,
389926,
152370,
340789,
348982,
398139,
127814,
357201,
357206,
389978,
430939,
357211,
357214,
201579,
201582,
349040,
340849,
430965,
381813,
324472,
398201,
119674,
324475,
340858,
340861,
324478,
430972,
324481,
373634,
398211,
324484,
324487,
381833,
324492,
324495,
430995,
324501,
324510,
422816,
324513,
398245,
324524,
324538,
324541,
398279,
340939,
340941,
209873,
340957,
431072,
398306,
340963,
209895,
201711,
349172,
349180,
439294,
431106,
209943,
357410,
250914,
185380,
357418,
209965,
209971,
209975,
209979,
209987,
209990,
341071,
349267,
250967,
210010,
341091,
210025,
210030,
210036,
210039,
349308,
210044,
160895,
349311,
210052,
349319,
210055,
210077,
210080,
251044,
210084,
185511,
210095,
210098,
210107,
210115,
210127,
333009,
210131,
333014,
210138,
210143,
218354,
218360,
275712,
275715,
275721,
349459,
333078,
251160,
349484,
349491,
415033,
357708,
210260,
259421,
365921,
333154,
333162,
234866,
390516,
333175,
357755,
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,
415278,
415281,
415285,
210487,
415290,
415293,
349761,
415300,
366172,
333413,
423528,
423532,
210544,
415353,
333439,
415361,
267909,
153227,
333498,
210631,
333511,
259788,
358099,
153302,
333534,
366311,
431851,
366318,
210672,
366321,
366325,
210695,
268041,
210698,
366348,
210706,
399128,
358191,
210739,
366387,
399159,
358200,
325440,
366401,
341829,
325446,
341834,
341838,
341843,
415573,
341851,
350045,
399199,
259938,
399206,
268143,
358255,
399215,
358259,
341876,
333689,
325504,
333708,
382890,
350146,
358371,
350193,
350202,
350206,
350213,
268298,
350224,
333850,
350244,
350248,
178218,
350251,
350271,
243781,
342111,
374902,
432271,
260289,
260298,
211160,
334045,
375026,
358644,
375053,
268559,
432405,
325914,
194852,
358700,
391468,
358704,
358713,
358716,
383306,
383321,
383330,
383333,
391530,
383341,
334203,
268668,
194941,
391563,
366990,
268701,
416157,
342430,
375208,
375216,
334275,
326084,
358856,
195039,
334304,
334311,
375277,
350723,
391690,
186897,
334358,
342550,
342554,
334363,
358941,
350761,
252461,
334384,
358961,
383536,
334394,
252482,
219718,
334407,
350822,
375400,
334465,
334468,
162445,
342679,
342683,
260766,
342710,
244409,
260797,
260801,
350917,
391894,
154328,
416473,
64230,
342766,
203506,
342776,
391937,
391948,
375568,
375571,
162591,
383793,
326451,
326454,
260924,
375612,
244540,
326460,
326467,
244551,
326473,
326477,
416597,
326485,
326490,
375656,
433000,
211831,
392060,
351104,
400259,
342930,
392091,
400285,
252836,
359334,
400306,
351168,
359361,
359366,
326598,
359382,
359388,
383967,
343015,
359407,
261108,
244726,
261111,
383997,
261129,
359451,
261147,
211998,
261153,
261159,
359470,
359476,
343131,
384098,
384101,
367723,
384107,
187502,
343154,
384114,
212094,
351364,
384135,
384139,
384143,
351381,
384160,
351397,
384168,
367794,
384181,
367800,
351423,
384191,
384198,
326855,
253130,
343244,
146642,
359649,
343270,
351466,
351479,
384249,
343306,
261389,
359694,
253200,
261393,
384275,
245020,
245029,
171302,
351534,
376110,
245040,
384314,
425276,
384323,
212291,
343365,
212303,
367965,
343393,
367980,
425328,
343409,
253303,
154999,
343417,
245127,
384397,
245136,
343450,
245151,
245154,
245157,
245162,
359865,
384443,
146876,
384453,
327110,
327115,
359886,
359890,
343507,
368092,
343539,
368119,
343544,
368122,
409091,
359947,
359955,
359983,
343630,
327275,
245357,
138864,
155254,
155273,
368288,
425638,
425649,
155322,
425662,
155327,
155351,
155354,
212699,
155363,
155371,
245483,
409335,
155393,
155403,
245525,
155422,
360223,
155438,
155442,
155447,
417595,
155461,
360261,
376663,
155482,
261981,
425822,
155487,
376671,
155490,
155491,
327531,
261996,
376685,
261999,
262002,
327539,
425845,
262005,
147317,
262008,
262011,
155516,
155521,
155525,
360326,
376714,
262027,
155531,
262030,
262033,
262036,
262039,
262042,
155549,
262045,
262048,
262051,
327589,
155559,
155562,
155565,
393150,
384977,
393169,
155611,
155619,
253923,
155621,
253926,
393203,
360438,
253943,
393206,
393212,
155646
] |
53c94a3f85db1ef509545d3b16c333fb6e863441 | 9207e2c35ecd0671c2b82786819b985d54695245 | /View/MacawChartView.swift | 4465258ea1c7ba338c6ed7e23df68d59c7c20af2 | [] | no_license | Marcus-C137/Cessabit_IOS | a5cc49f3aa18f84b397e8f635c9a642db8b535c0 | f0de5a195021d52e83231d57e5b42beb77f45bce | refs/heads/master | 2023-02-27T21:27:42.440129 | 2021-02-06T18:21:00 | 2021-02-06T18:21:00 | 207,922,124 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 4,418 | swift | //
// MacawChartView.swift
// Cessabit
//
// Created by Marcus Houtzager on 9/21/19.
// Copyright © 2019 Marcus Houtzager. All rights reserved.
//
import Foundation
import Macaw
class MacawChartView: MacawView{
static let portTempsData = createDummyData()
static let portTempsData2 = createDummyData2()
static let maxValue = 150
static let lineWidth: Double = 225
static let TemperatureData: [Double] = portTempsData.map({ $0.temp })
static let TemperatureData2: [Double] = portTempsData2.map({ $0.temp })
static var animations: [Animation] = []
required init?(coder aDecoder: NSCoder){
super.init(node: MacawChartView.createChart(), coder: aDecoder)
backgroundColor = .clear
}
private static func createChart() -> Group {
var items: [Node] = addYAxisItems() + addXAxisItems()
items.append(createBars())
return Group(contents: items, place: .identity)
}
private static func addYAxisItems() -> [Node]{
let yTicks = 5
let lineInterval = Int(maxValue/yTicks)
let yAxisHeigth: Double = 150
let lineSpacing: Double = 30
var newNodes:[Node] = []
for i in 1...yTicks{
let y = yAxisHeigth - (Double(i)*lineSpacing)
let valueText = Text(text: "\(i*lineInterval)", align: .max, baseline: .mid, place: .move(dx: -10, dy: y))
valueText.fill = Color.white
newNodes.append(valueText)
}
let yAxis = Line(x1: 0, y1: 0, x2: 0, y2: yAxisHeigth).stroke(fill: Color.white.with(a:0.25))
newNodes.append(yAxis)
return newNodes
}
private static func addXAxisItems() -> [Node]{
let chartBaseY: Double = 150
var newNodes: [Node] = []
for i in 0...TemperatureData.count-1{
let x = (Double(i) * 50)
let valueText = Text(text: portTempsData[i].port, align: .max, baseline: .mid, place: .move(dx: x + 40, dy: chartBaseY + 15))
valueText.fill = Color.white
newNodes.append(valueText)
}
let xAxis = Line(x1: 0, y1: chartBaseY, x2: lineWidth, y2: chartBaseY).stroke(fill: Color.white.with(a: 0.25))
newNodes.append(xAxis)
return newNodes
}
private static func createBars() -> Group{
let fill = LinearGradient(degree: 45, from: Color(val: 0x58B8BF), to: Color(val: 0x58B8BF).with(a:0.33))
let items = TemperatureData.map { _ in Group()}
animations = items.enumerated().map{(i: Int, item: Group) in
item.contentsVar.animation(delay: Double(i) * 0.1){ t in
let height = TemperatureData[i] * t
let rect = Rect(x: Double(i) * 50 + 25, y: 150-height, w: 30, h: height)
return [rect.fill(with: fill)]
}
}
return items.group()
}
static func playAnimations(){
animations.combine().play()
}
static func morphToNew(){
let inFill = LinearGradient(degree: 45, from: Color(val: 0x58B8BF), to: Color(val: 0x58B8BF).with(a:0.33))
var prevBars: [Shape] = []
var nexBars: [Shape] = []
for i in 0...3{
let rect1 = Rect(x: Double(i) * 50 + 25, y: 0, w:30, h: TemperatureData[i])
let rect2 = Rect(x: Double(i) * 50 + 25, y: 0, w:30, h: TemperatureData2[i])
let prevBar = Shape(form: rect1, fill: inFill)
let nexBar = Shape(form: rect2, fill: inFill)
prevBars.append(prevBar)
nexBars.append(nexBar)
}
let group = prevBars.group()
let animation = group.contentsVar.animation(to: nexBars)
animation.play()
}
private static func createDummyData() -> [portTemps]{
let one = portTemps(port: "1", temp: 90.0)
let two = portTemps(port: "2", temp: 0.0)
let three = portTemps(port: "3", temp: 110.0)
let four = portTemps(port: "4", temp: 80.0)
return [one, two, three, four]
}
private static func createDummyData2() -> [portTemps]{
let one = portTemps(port: "1", temp: 80.0)
let two = portTemps(port: "2", temp: 90.0)
let three = portTemps(port: "3", temp: 110.0)
let four = portTemps(port: "4", temp: 30.0)
return [one, two, three, four]
}
}
| [
-1
] |
e92294b7fc39b4bb4bae1a4f3d746ba3a1883a08 | 17a76dadf240299c2314925b5d4f03af0e3692bf | /CarSample/App/Views/Manufacture List View Controller/ManufactureListDelegate.swift | df429a2d98e1972e81e197a71fd1b2a74c8e9c3f | [] | no_license | Rash-ML/carTest | 577dd6f320f4713819bf5fc3ceeb0e51f3267a16 | ea12cd1a34524158e16fdf3b48882575072253fd | refs/heads/master | 2020-04-17T10:45:20.443258 | 2019-01-19T06:12:07 | 2019-01-19T06:12:07 | 166,512,934 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 842 | swift | //
// ManufactureListDelegate.swift
// CarSample
//
// Created by Admin on 1/18/19.
// Copyright © 2019 Arash. All rights reserved.
//
import Foundation
import UIKit
class ManufactureListDelegate: NSObject, UITableViewDelegate {
unowned var vc: ManufactureListViewController
init(viewController: ManufactureListViewController) {
self.vc = viewController
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let manufacture = vc.tableDataSource.dataSource[indexPath.row]
let cell = tableView.cellForRow(at: indexPath)
cell?.setSelected(true, animated: true)
vc.delegate?.didSelectManufacture(manufacture)
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 100.0
}
}
| [
-1
] |
e5169a886d92322d7f9eadf97f1cc7e3ea7c20b5 | 52e91db188f33a06f7b50e7bbb810b4f23422c85 | /Movies/ViewModel/PopularTopSearchPopularViewModel.swift | 51d97a1abe65592fb2247b0675b6706bd1bdaa2a | [] | no_license | HHP5/Movies | f51f516a93ff6b5212057ae73a499adefc07e984 | a96eb6beb87ef075212f614bef3456605a5bc364 | refs/heads/main | 2023-06-11T09:16:36.198504 | 2021-07-07T10:35:59 | 2021-07-07T10:35:59 | 383,720,467 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 3,315 | swift | //
// PopularViewModel.swift
// Movies
//
// Created by Екатерина Григорьева on 03.07.2021.
//
import UIKit
protocol PopularTopSearchViewModelType {
typealias ProgressHandler = (Float) -> ()
var onProgress : ProgressHandler? {get set}
var numberOfRow: Int? {get set}
var image: [URL] {get set}
var didUpdateData: (() -> Void)? {get set}
var didFinishRequest: (() -> Void)? {get set}
func fetching()
func loadMore()
func refresh()
var didFoundError: ((UIAlertController) -> Void)? {get set}
func search(_ query: String)
func clear()
func saveNewFavouriteMovie(movie posterURL: URL, completion: @escaping (UIAlertController) -> Void)
}
class PopularTopSearchViewModel: PopularTopSearchViewModelType {
var movies: [Movie] = []
var didUpdateData: (() -> Void)?
var didFinishRequest: (() -> Void)?
var image: [URL] = []
var type: ViewModelType!
var currentPage = 1
var didFoundError: ((UIAlertController) -> Void)?
var query: String?
typealias ProgressHandler = (Float) -> ()
var onProgress : ProgressHandler?
private var coreDataManager = CoreDataManager()
init(type: ViewModelType) {
self.type = type
}
func loadMore() {
self.currentPage += 1
fetching()
}
func refresh() {
self.movies = []
self.currentPage = 1
self.fetching()
}
func fetching() {
var router: Router!
switch type {
case .popular:
router = Router.popular
case .top:
router = Router.top
case .search:
router = Router.search
default:
return
}
let model = ServiceLayer<APIResponse>()
model.request(router: router, page: self.currentPage, query: self.query)
model.result = { [weak self] result in
self?.handle(result: result.results)
self?.didFinishRequest?()
}
model.error = { [weak self] error in
let alert = AlertService.alert(message: error.localizedDescription)
self?.didFoundError?(alert)
}
model.onProgress = { [weak self] progress in
self?.onProgress?(progress)
}
}
var numberOfRow: Int?
func handle(result: [Movie]) {
result.forEach { movie in
if !movies.contains(movie) {
self.movies.append(movie)
if let poster = movie.posterPath, let url = URL(string: "https://image.tmdb.org/t/p/w500/" + poster) {
image.append(url)
} else {
if let url = NoImage.url {
image.append(url)
}
}
}
}
self.numberOfRow = movies.count
self.didUpdateData?()
}
func search(_ query: String) {
self.refreshArray()
self.query = query
self.fetching()
}
func clear() {
self.refreshArray()
}
private func refreshArray() {
self.numberOfRow = 0
self.image = []
self.movies = []
}
func saveNewFavouriteMovie(movie posterURL: URL, completion: @escaping (UIAlertController) -> Void ) {
let favMovies = coreDataManager.loadFavoriteMovies()
self.movies.forEach { movie in
if posterURL.absoluteString != NoImage.url?.absoluteString {
if posterURL.absoluteString.contains(movie.posterPath!) {
if !favMovies.contains(movie) {
coreDataManager.saveFavoriteMovie(movie: movie) {
let alert = AlertService.alert(message: "Saved")
completion(alert)
}
} else {
let alert = AlertService.alert(message: "Already in favourites")
completion(alert)
}
}
}
}
}
}
| [
-1
] |
bc411e1c0c96589b6f3419674afaeeac180c19b7 | 259481e76dfa52567aa32205b9e067ce0a5b2a62 | /CollectionView/CollectionView/Prefetch/PrefetchVC.swift | f35c9d24dec08159d524eb9426fea776ad8a806a | [] | no_license | wickysi/iOSAPI | f002bf6dd18fd46ec6fc2efdd7be7fb6db46c112 | e67d008cd3253e65e5ec01a6b46339166da3680e | refs/heads/main | 2023-09-04T20:55:51.168591 | 2021-11-04T12:03:12 | 2021-11-04T12:03:12 | 419,913,649 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 6,264 | swift | //
// PrefetchVC.swift
// CollectionView
//
// Created by user on 11/2/21.
//
/*
Prefetching 预加载,是Apple在iOS10为Tableview 和 CollectionView 引入的一项优化视图滑动性能的机制。
*/
// 宝可梦图片下载地址:https://raw.githubusercontent.com/onevcat/pokemaster-images/master/images/Pokemon-\(id).png
import UIKit
class PrefetchVC: UIViewController {
let imagePrePath = "https://raw.githubusercontent.com/onevcat/pokemaster-images/master/images/Pokemon-"
var mcv: UICollectionView!
var datas: [String] = []
var iconDict: [String:String] = [:]
override func viewDidLoad() {
super.viewDidLoad()
setupData()
setupUI()
}
private func setupData() {
// datas = (1...30).map{ "\(imagePrePath)" + "\($0)" + ".png"}
datas = (1...30).map{ "Pokemon-" + "\($0)"}
}
private func setupUI() {
view.backgroundColor = .white
setupCollectionView()
}
private func setupCollectionView() {
let layout = UICollectionViewFlowLayout()
layout.itemSize = CGSize(width: 150, height: 150)
mcv = UICollectionView(frame: view.bounds, collectionViewLayout:layout)
mcv.backgroundColor = .cyan
mcv.dataSource = self
// collectionView.delegate = self
mcv.register(PrefetchCell.self, forCellWithReuseIdentifier: "PrefetchCell_id")
//MARK: - 设置实现了预加载协议的数据源对象,通常使用当前viewController对象
mcv.prefetchDataSource = self
view.addSubview(mcv)
}
private func mockImageRequest(index: Int) {
DispatchQueue.global().asyncAfter(deadline: .now() + 2) {
self.iconDict[String(index)] = "Pokemon-" + "\(index)"
}
}
}
//MARK: - UICollectionViewDataSource
extension PrefetchVC: UICollectionViewDataSource {
// 返回每一分段的cell数量
@available(iOS 6.0, *)
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return datas.count
}
// 返回每一个indexPath位置上的cell视图
// The cell that is returned must be retrieved from a call to -dequeueReusableCellWithReuseIdentifier:forIndexPath:
@available(iOS 6.0, *)
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "PrefetchCell_id", for: indexPath) as! PrefetchCell
// cell.titleLabel.text = datas[indexPath.row]
// cell.iconView.image = UIImage(named: datas[indexPath.row])
let index = indexPath.row + 1
// DispatchQueue.global().asyncAfter(deadline: .now() + 2) {
//// self.iconDict["\(index)"] = "Pokemon-" + "\(index)"
// DispatchQueue.main.async {
// self.iconDict["\(index)"] = "Pokemon-" + "\(index)"
// if let icon = self.iconDict["\(index)"] {
// cell.iconView.image = UIImage(named: icon)
// }
//// cell.iconView.image = UIImage(named: self.datas[indexPath.row])
// }
// }
// cell.iconView.image = UIImage(named: datas[indexPath.row])
// cell.iconView.image = UIImage(named: datas[indexPath.row])
if let icon = self.iconDict["\(index)"] {
cell.iconView.image = UIImage(named: icon)
}
return cell
}
}
//MARK: - 实现预加载数据源协议
extension PrefetchVC: UICollectionViewDataSourcePrefetching {
/*
执行预加载:
该方法提供一组即将显示的cell的indexPath,供你提前请求数据。
*/
// indexPaths are ordered ascending by geometric distance from the collection view
@available(iOS 10.0, *)
func collectionView(_ collectionView: UICollectionView, prefetchItemsAt indexPaths: [IndexPath]) {
for indexPath in indexPaths {
let index = indexPath.row + 1
DispatchQueue.global().asyncAfter(deadline: .now() + 2) {
// self.iconDict["\(index)"] = "Pokemon-" + "\(index)"
DispatchQueue.main.async {
self.iconDict["\(index)"] = "Pokemon-" + "\(index)"
}
}
}
}
/*
取消预加载:
该方法将在 collection view 判断当前预加载操作是冗余优化任务时被调用。比如,如果滚动速度放缓或者完全反转方向,那些已经请求过的预加载 cell 可能永远都不会确切地显示。它提供一个indexPaths数组,供你取消任何有必要结束的请求。
*/
// indexPaths that previously were considered as candidates for pre-fetching, but were not actually used; may be a subset of the previous call to -collectionView:prefetchItemsAtIndexPaths:
@available(iOS 10.0, *)
func collectionView(_ collectionView: UICollectionView, cancelPrefetchingForItemsAt indexPaths: [IndexPath]) {
}
}
class PrefetchCell: UICollectionViewCell {
var titleLabel: UILabel!
var iconView: UIImageView!
/** 初始化方法 **/
override init(frame: CGRect) {
super.init(frame: frame)
/** 自定义代码写在这 **/
setupUI()
}
/** 这个方法是必须的 **/
required init?(coder: NSCoder) {
super.init(coder: coder)
}
private func setupUI() {
backgroundColor = .orange
// setupLabel_title()
setupImageView_()
}
private func setupLabel_title() {
let lb = UILabel(frame: self.bounds)
lb.backgroundColor = .clear
lb.font = UIFont.boldSystemFont(ofSize: 16)
lb.textColor = .black
lb.textAlignment = .center
lb.numberOfLines = 0
lb.lineBreakMode = .byWordWrapping
lb.text = ""
titleLabel = lb
contentView.addSubview(titleLabel)
}
func setupImageView_() {
let iv = UIImageView(frame: self.bounds)
// iv.image = UIImage(named: "")
iconView = iv
contentView.addSubview(iconView)
}
}
| [
-1
] |
035bcd29cbd089a592f9d5fbad22994fb98a8b1d | 944236c4d05a97bdc0c445c6b48e9486dafd4c08 | /Drive/API/Responses/GetDrivesResponse.swift | b4a4b8e84b4f8b73ff9db7dafdd4529869af83cf | [] | no_license | Drive-iOS/Drive | 9e4922d06fd43639fd0ae989a3402f12a09d2e69 | 68a202484f3f810440f56076f73763ea6c2a501c | refs/heads/main | 2023-02-15T00:52:43.094507 | 2021-01-10T03:14:48 | 2021-01-10T03:14:48 | 282,110,404 | 0 | 0 | null | 2021-01-10T03:14:49 | 2020-07-24T03:10:54 | Swift | UTF-8 | Swift | false | false | 560 | swift | //
// DrivesResponse.swift
// Drive
//
// Created by Amanuel Ketebo on 10/2/20.
// Copyright © 2020 com.amanjosh. All rights reserved.
//
import Foundation
struct GetDriveReponse: Decodable {
let userID: String
let driveID: String
let startTime: String
let endTime: String
enum CodingKeys: String, CodingKey {
case userID = "user_id"
case driveID = "drive_id"
case startTime = "start_time"
case endTime = "end_time"
}
}
struct GetDrivesResponse: Decodable {
let results: [GetDriveReponse]
}
| [
-1
] |
e1b7b6d356371545284b96e656abf8e7d7759d6b | b09ce622adf145635859e162ac505d22f89feb3d | /Daily/Daily/Views/Diary/ListOfTasks/DiaryModels/DiaryTableHeader.swift | 56915269a2bf57aa8d73dd00569afbfa3d93e58f | [] | no_license | LDK28/Daily | 177109cc3754c48df631aad4475943bda6f0079d | f3c7e419bb91827fade78c1701110372906e958e | refs/heads/main | 2023-03-11T12:50:51.506202 | 2020-12-29T14:31:55 | 2020-12-29T14:31:55 | 303,095,039 | 1 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,286 | swift | import Foundation
import UIKit
class DiaryHeader: UITableViewHeaderFooterView {
static let identifier = "TaskCustomHeader"
let title: UILabel = {
let label = UILabel()
label.textColor = .dailyTaskTimeColor
label.font = UIFont(name: "Stolzl-Bold", size: 22)
label.textAlignment = .left
return label
}()
override init(reuseIdentifier: String?) {
super.init(reuseIdentifier: reuseIdentifier)
configureContents()
self.tintColor = .clear
}
func configureContents() {
title.translatesAutoresizingMaskIntoConstraints = false
contentView.addSubview(title)
NSLayoutConstraint.activate([
title.leadingAnchor.constraint(equalTo: contentView.leadingAnchor, constant: 5),
title.trailingAnchor.constraint(equalTo: contentView.trailingAnchor),
title.topAnchor.constraint(equalTo: contentView.topAnchor),
title.bottomAnchor.constraint(equalTo: contentView.bottomAnchor)
])
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
// func setup(data: DiaryCellModel) {
// title.text = data.time
// }
}
| [
-1
] |
7f3feb8d09b03868d3d2974358dff59eeb894234 | 7a58afd3c0b71ba68bbee6773f64d0c5d8985ea4 | /WhereIsISS/SceneDelegate.swift | 9547c8613b5e0a16cac28b1b9c71622dc467e2d3 | [] | no_license | mikekavouras/where-is-iss-swift | e020a67903fa79f42034403a7af6cd826a82447f | ceb5ed23fc1a67aefb51a5bf38ba563d229d47be | refs/heads/master | 2020-07-31T19:32:19.379272 | 2019-09-25T01:31:36 | 2019-09-25T01:31:36 | 210,729,844 | 2 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 2,334 | swift | //
// SceneDelegate.swift
// WhereIsISS
//
// Created by Mike on 9/24/19.
// Copyright © 2019 Mike. All rights reserved.
//
import UIKit
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
guard let _ = (scene as? UIWindowScene) else { return }
}
func sceneDidDisconnect(_ scene: UIScene) {
// Called as the scene is being released by the system.
// This occurs shortly after the scene enters the background, or when its session is discarded.
// Release any resources associated with this scene that can be re-created the next time the scene connects.
// The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead).
}
func sceneDidBecomeActive(_ scene: UIScene) {
// Called when the scene has moved from an inactive state to an active state.
// Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
}
func sceneWillResignActive(_ scene: UIScene) {
// Called when the scene will move from an active state to an inactive state.
// This may occur due to temporary interruptions (ex. an incoming phone call).
}
func sceneWillEnterForeground(_ scene: UIScene) {
// Called as the scene transitions from the background to the foreground.
// Use this method to undo the changes made on entering the background.
}
func sceneDidEnterBackground(_ scene: UIScene) {
// Called as the scene transitions from the foreground to the background.
// Use this method to save data, release shared resources, and store enough scene-specific state information
// to restore the scene back to its current state.
}
}
| [
393221,
163849,
393228,
393231,
393251,
352294,
344103,
393260,
393269,
213049,
376890,
385082,
16444,
393277,
376906,
327757,
254032,
286804,
368728,
180314,
254045,
368736,
180322,
376932,
286833,
286845,
286851,
417925,
262284,
360598,
286880,
286889,
377003,
377013,
164029,
327872,
180418,
377030,
377037,
180432,
377047,
418008,
385243,
418012,
377063,
327915,
205037,
393457,
393461,
393466,
418044,
336124,
385281,
336129,
262405,
180491,
336140,
164107,
262417,
368913,
262423,
377118,
377121,
262437,
254253,
336181,
262455,
393539,
262473,
344404,
213333,
418135,
270687,
262497,
418145,
262501,
213354,
246124,
262508,
262512,
213374,
385420,
262551,
262553,
385441,
385444,
262567,
385452,
262574,
393649,
385460,
262587,
344512,
262593,
336326,
360917,
369119,
328178,
328180,
328183,
328190,
254463,
328193,
98819,
164362,
328207,
410129,
393748,
377372,
188959,
385571,
377384,
197160,
33322,
352822,
270905,
197178,
418364,
188990,
369224,
385610,
270922,
352844,
385617,
352865,
262761,
352875,
344694,
352888,
336513,
377473,
336517,
344710,
385671,
148106,
377485,
352919,
98969,
336549,
344745,
361130,
336556,
434868,
164535,
336568,
164539,
328379,
328387,
352969,
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,
271154,
328498,
369464,
361274,
328516,
336709,
328520,
336712,
361289,
328523,
336715,
361300,
213848,
426842,
361307,
197469,
361310,
254813,
361318,
344936,
361323,
361335,
328574,
369544,
361361,
222129,
345036,
115661,
386004,
345046,
386012,
386019,
386023,
328690,
435188,
328703,
328710,
418822,
377867,
328715,
361490,
386070,
271382,
336922,
345119,
377888,
328747,
214060,
345134,
345139,
361525,
386102,
361537,
377931,
197708,
189525,
156762,
402523,
361568,
148580,
345200,
361591,
386168,
361594,
410746,
214150,
345224,
386187,
337048,
345247,
361645,
345268,
337076,
402615,
361657,
337093,
402636,
328925,
165086,
165092,
328933,
222438,
328942,
386286,
386292,
206084,
115973,
328967,
345377,
345380,
353572,
345383,
263464,
337207,
345400,
378170,
369979,
386366,
337224,
337230,
337235,
263509,
353634,
337252,
402792,
345449,
99692,
271731,
378232,
337278,
271746,
181639,
353674,
181644,
361869,
181650,
181655,
230810,
181671,
181674,
181679,
181682,
337330,
181687,
370105,
181691,
181697,
361922,
337350,
181704,
337366,
271841,
329192,
361961,
329195,
116211,
337399,
402943,
337416,
329227,
419341,
419345,
329234,
419351,
345626,
419357,
345631,
419360,
370208,
394787,
419363,
370214,
419369,
394796,
419377,
419386,
206397,
214594,
419401,
353868,
419404,
173648,
419408,
214611,
419412,
403040,
345702,
222831,
370298,
353920,
403076,
345737,
198282,
403085,
403092,
345750,
419484,
345758,
345763,
419492,
345766,
419498,
419502,
370351,
419507,
337588,
419510,
419513,
419518,
337601,
403139,
337607,
419528,
419531,
419536,
272083,
394967,
419543,
419545,
345819,
419548,
181982,
419551,
345829,
419560,
337643,
419564,
337647,
370416,
141052,
337661,
337671,
362249,
362252,
395022,
362256,
321300,
345888,
116512,
362274,
378664,
354107,
354112,
247618,
370504,
329545,
345932,
354124,
370510,
354132,
247639,
337751,
370520,
313181,
182110,
354143,
354157,
345965,
345968,
345971,
345975,
182136,
403321,
1914,
354173,
395148,
247692,
337809,
247701,
329625,
436127,
436133,
247720,
337834,
362414,
337845,
190393,
346059,
247760,
346064,
346069,
419810,
329699,
354275,
190440,
247790,
354314,
346140,
337980,
436290,
395340,
378956,
436307,
338005,
329816,
100454,
329833,
329853,
329857,
329868,
411806,
329886,
346273,
362661,
100525,
387250,
379067,
387261,
256193,
395467,
346317,
411862,
411865,
411869,
411874,
379108,
411877,
387303,
346344,
395496,
338154,
387307,
346350,
338161,
436474,
321787,
379135,
411905,
411917,
43279,
379154,
395539,
387350,
387353,
338201,
182559,
338212,
248112,
362823,
436556,
321880,
362844,
379234,
354674,
182642,
321911,
420237,
379279,
272787,
354728,
338353,
338363,
338382,
272849,
248279,
256474,
182755,
338404,
338411,
330225,
248309,
199165,
248332,
330254,
199182,
199189,
420377,
330268,
191012,
330320,
199250,
191069,
346722,
248427,
191085,
338544,
191093,
346743,
330384,
346769,
150184,
174775,
248505,
174778,
363198,
223936,
355025,
273109,
355029,
264919,
256735,
338661,
264942,
330479,
363252,
338680,
207620,
264965,
191240,
338701,
256787,
363294,
199455,
396067,
346917,
396070,
215854,
355123,
355141,
355144,
338764,
355151,
330581,
330585,
387929,
355167,
265056,
265059,
355176,
355180,
355185,
330612,
330643,
412600,
207809,
379849,
347082,
396246,
330711,
248794,
248799,
347106,
437219,
257009,
265208,
330750,
265215,
199681,
338951,
330761,
330769,
330775,
248863,
158759,
396329,
347178,
404526,
396337,
330803,
396340,
339002,
388155,
339010,
347208,
248905,
330827,
330830,
248915,
183384,
339037,
412765,
257121,
322660,
265321,
330869,
248952,
420985,
330886,
347288,
248986,
44199,
380071,
339118,
249018,
339133,
126148,
322763,
330959,
330966,
265433,
265438,
388320,
363757,
339199,
396552,
175376,
175397,
208167,
273709,
372016,
437553,
347442,
199989,
175416,
396601,
208189,
437567,
175425,
437571,
126279,
437576,
437584,
331089,
331094,
396634,
175451,
437596,
429408,
175458,
208228,
175461,
175464,
265581,
331124,
175478,
249210,
175484,
175487,
249215,
175491,
249219,
249225,
249228,
249235,
175514,
175517,
396703,
396706,
175523,
355749,
396723,
388543,
380353,
216518,
339401,
380364,
339406,
372177,
339414,
249303,
413143,
339418,
339421,
249310,
339425,
249313,
339429,
339435,
249329,
69114,
372229,
339464,
249355,
208399,
380433,
175637,
134689,
339504,
265779,
421442,
413251,
265796,
265806,
224854,
224858,
339553,
257636,
224871,
372328,
257647,
372338,
339572,
224885,
224888,
224891,
224895,
372354,
126597,
421509,
224905,
11919,
224911,
224914,
126611,
224917,
224920,
126618,
208539,
224923,
224927,
224930,
224933,
257705,
224939,
224943,
257713,
224949,
257717,
257721,
224954,
257725,
224960,
257733,
224966,
224970,
257740,
224976,
257745,
339664,
257748,
224982,
257752,
224987,
257762,
224996,
225000,
339696,
225013,
257788,
225021,
339711,
257791,
225027,
257796,
339722,
257802,
257805,
225039,
257808,
249617,
225044,
167701,
372500,
257815,
225049,
257820,
225054,
184096,
397089,
257825,
225059,
339748,
225068,
257837,
413485,
225071,
225074,
257843,
225077,
257846,
225080,
397113,
225083,
397116,
257853,
225088,
225094,
225097,
323404,
257869,
257872,
225105,
339795,
397140,
225109,
225113,
257881,
257884,
257887,
225120,
257891,
413539,
225128,
257897,
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,
225451,
258223,
225456,
430257,
225459,
225462,
225468,
389309,
225472,
372931,
225476,
430275,
389322,
225485,
225488,
225491,
266454,
225494,
225497,
225500,
225503,
225506,
356580,
225511,
217319,
225515,
225519,
381177,
397572,
389381,
356631,
356638,
356641,
356644,
356647,
266537,
389417,
356650,
356656,
332081,
307507,
340276,
356662,
397623,
332091,
225599,
332098,
201030,
348489,
332107,
151884,
430422,
348503,
332118,
250201,
250203,
332130,
250211,
340328,
250217,
348523,
348528,
332153,
356734,
389503,
332158,
438657,
250239,
332162,
348548,
356741,
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,
340639,
258723,
332455,
332460,
389806,
332464,
332473,
381626,
332484,
332487,
332494,
357070,
357074,
332512,
332521,
340724,
332534,
373499,
348926,
389927,
348979,
152371,
340792,
398141,
127815,
357202,
389971,
357208,
136024,
389979,
430940,
357212,
357215,
439138,
201580,
201583,
349041,
340850,
201589,
381815,
430967,
324473,
398202,
119675,
340859,
324476,
430973,
324479,
340863,
324482,
324485,
324488,
185226,
381834,
324493,
324496,
324499,
430996,
324502,
324511,
422817,
324514,
201638,
373672,
324525,
5040,
111539,
324534,
5047,
324539,
324542,
398280,
349129,
340940,
340942,
209874,
340958,
431073,
398307,
340964,
209896,
201712,
209904,
349173,
381947,
201724,
349181,
431100,
431107,
349203,
209944,
209948,
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,
333010,
210132,
333016,
210139,
210144,
218355,
251123,
218361,
275709,
128254,
275713,
242947,
275717,
275723,
333075,
349460,
333079,
251161,
349486,
349492,
415034,
251211,
210261,
365912,
259423,
374113,
251236,
374118,
333164,
234867,
390518,
357756,
374161,
112021,
349591,
357793,
333222,
210357,
259516,
415168,
366035,
415187,
366039,
415192,
415194,
415197,
415200,
333285,
415208,
366057,
366064,
415217,
415225,
423424,
415258,
415264,
366118,
415271,
382503,
349739,
144940,
415279,
415282,
415286,
210488,
415291,
415295,
333387,
333396,
333400,
366173,
333415,
423529,
423533,
333423,
210547,
415354,
333440,
267910,
267929,
333472,
333512,
259789,
358100,
366301,
333535,
153311,
366308,
366312,
431852,
399086,
366319,
210673,
366322,
399092,
366326,
333566,
268042,
210700,
366349,
210707,
399129,
333593,
333595,
210720,
366384,
358192,
210740,
366388,
358201,
399166,
325441,
366403,
325447,
341831,
341835,
341839,
341844,
415574,
358235,
341852,
350046,
399200,
399208,
268144,
358256,
358260,
341877,
399222,
325494,
186233,
333690,
243584,
325505,
333699,
399244,
333709,
333725,
333737,
382891,
382898,
333767,
350153,
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,
342113,
252021,
342134,
374904,
268435,
333989,
333998,
334012,
260299,
350411,
350417,
350423,
350426,
334047,
350449,
375027,
358645,
350454,
350459,
350462,
350465,
350469,
325895,
268553,
194829,
350477,
268560,
350481,
432406,
350487,
350491,
325915,
350494,
325918,
325920,
350500,
350505,
358701,
391469,
350510,
358705,
358714,
358717,
383307,
358738,
334162,
383331,
383334,
391531,
383342,
334204,
268669,
194942,
391564,
366991,
334224,
268702,
342431,
375209,
326059,
375220,
342453,
334263,
326087,
358857,
195041,
334312,
104940,
375279,
350724,
186898,
342546,
350740,
342551,
334359,
342555,
334364,
416294,
350762,
252463,
358962,
334386,
334397,
358973,
252483,
219719,
399957,
244309,
334425,
326240,
375401,
334466,
334469,
391813,
162446,
326291,
342680,
342685,
260767,
342711,
244410,
260798,
334530,
260802,
350918,
154318,
342737,
391895,
154329,
416476,
64231,
113389,
342769,
203508,
375541,
342777,
391938,
391949,
375569,
326417,
375572,
375575,
375580,
162592,
334633,
326444,
383794,
326452,
326455,
375613,
244542,
260925,
375616,
326463,
326468,
244552,
342857,
326474,
326479,
326486,
416599,
342875,
244572,
326494,
326503,
433001,
326508,
400238,
326511,
211826,
211832,
392061,
351102,
359296,
252801,
260993,
351105,
400260,
211846,
342921,
342931,
252823,
400279,
392092,
400286,
252838,
359335,
211885,
400307,
351169,
359362,
351172,
170950,
187335,
326599,
359367,
359383,
359389,
383968,
343018,
359411,
261109,
261112,
244728,
383999,
261130,
261148,
359452,
211999,
261155,
261160,
261166,
359471,
375868,
343132,
384099,
384102,
384108,
367724,
326764,
187503,
343155,
384115,
212095,
384136,
384140,
384144,
384152,
384158,
384161,
351399,
384169,
367795,
244917,
384182,
367801,
384189,
384192,
351424,
343232,
244934,
367817,
244938,
384202,
253132,
326858,
343246,
384209,
146644,
351450,
384225,
359650,
343272,
351467,
359660,
384247,
351480,
384250,
351483,
351492,
343307,
384270,
359695,
261391,
253202,
261395,
384276,
384284,
245021,
384290,
253218,
245032,
171304,
384299,
351535,
376111,
245042,
326970,
384324,
343366,
212296,
212304,
367966,
343394,
343399,
367981,
343410,
155000,
327035,
245121,
245128,
253321,
155021,
384398,
245137,
245143,
245146,
245149,
343453,
245152,
245155,
155045,
245158,
40358,
245163,
114093,
327090,
343478,
359867,
384444,
146878,
327108,
327112,
384457,
327118,
359887,
359891,
343509,
368093,
155103,
343535,
343540,
368120,
343545,
409092,
359948,
359951,
245295,
359984,
400977,
400982,
179803,
155241,
245358,
138865,
155255,
155274,
368289,
245410,
425639,
245415,
425652,
425663,
155328,
245463,
155352,
155356,
212700,
155364,
245477,
155372,
245487,
212723,
245495,
409336,
155394,
155404,
245528,
155423,
360224,
155439,
204592,
155444,
155448,
417596,
384829,
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,
212945,
393170,
155604,
155620,
253924,
155622,
253927,
327655,
360432,
393204,
360439,
253944,
393209,
155647
] |
d9d7da2a16b3d896afc69f165411a42ed40276b5 | bc94f5f0ce3182f7fdd2d4184a4af87e92c19140 | /GHFollowers/Views/ViewControllers/ItemInfoVCs/GFRepoItemVC.swift | 1ae8f1a5ffee42327b4148d9d8de114d57270d0f | [] | no_license | TobiasRuano/GHFollowers | a67e983fbeefaa1fa26969ca580bb5c282fcb946 | 905351ef96baa5564a78e396ff354d1d61fc431c | refs/heads/master | 2022-11-17T21:53:14.432079 | 2020-06-30T22:40:35 | 2020-06-30T22:40:35 | 274,700,132 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,054 | swift | //
// GFRepoItemVC.swift
// GHFollowers
//
// Created by Tobias Ruano on 26/06/2020.
// Copyright © 2020 Tobias Ruano. All rights reserved.
//
import UIKit
protocol GFRepoItemVCDelegate: class {
func didTapGithubProfile(for user: User)
}
class GFRepoItemVC: GFItemInfoVC {
weak var delegate: GFRepoItemVCDelegate!
override func viewDidLoad() {
super.viewDidLoad()
configureItems()
}
init(user: User, delegate: GFRepoItemVCDelegate) {
super.init(user: user)
self.delegate = delegate
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
private func configureItems() {
itemInfoViewOne.set(itemInfoType: .repos, withCount: user.publicRepos)
itemInfoViewTwo.set(itemInfoType: .gist, withCount: user.publicGists)
actionButton.set(background: .systemPurple, title: "Github Profile")
}
override func actionButtonTapped() {
delegate.didTapGithubProfile(for: user)
}
}
| [
-1
] |
ea047f032283f00ca6331581e9481a214bfe52e4 | e2c00a848f52f5c9a1a7c0d753d7197454b1a89d | /ModelOfbmi.swift | 60b183c71ecd013f36ecad9a5efd171ca055d809 | [] | no_license | alanturker/Angela-Yu-Bootcamp | 84bfeedf51718006b902d92f6a959b98569ebc4e | e7435502ff341bb09b4b89cbbf172fce550eb17d | refs/heads/main | 2023-07-25T15:44:55.340853 | 2021-09-10T08:19:13 | 2021-09-10T08:19:13 | 405,001,561 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 183 | swift | //
// ModelOfbmi.swift
// BMI-Calculator-LayoutPractice
//
// Created by Gülşah Alan on 28.07.2021.
// Copyright © 2021 App Brewery. All rights reserved.
//
import Foundation
| [
-1
] |
5659285bffc98465aad67bb753025ac5a721fb34 | eddf74c09794470c6da4fd9047df247b8d9f73e3 | /YQueue/CustomerHomeTutorialVC.swift | c7d501cc566a9173f3606f08ec1cccd0f9a47a5f | [] | no_license | toshioazuma/yqueue | 5f1b648f631dd2a4ddabde2aebfc6538f2fba6b3 | 6e0aff9fc35058df3397c3367878d7d52fcfc31f | refs/heads/master | 2020-12-03T00:41:14.975069 | 2017-07-17T04:02:39 | 2017-07-17T04:02:39 | 96,060,799 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 616 | swift | //
// CustomerHomeTutorialVC.swift
// YQueue
//
// Created by Toshio on 20/11/2016.
// Copyright © 2016 YQueue. All rights reserved.
//
import UIKit
class CustomerHomeTutorialVC: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
}
@IBAction func takeAwayButtonClicked() {
self.dismiss(animated: false, completion: {
Storyboard.openSearch(newDineIn: false)
})
}
@IBAction func dineInButtonClicked() {
self.dismiss(animated: false, completion: {
Storyboard.openSearch(newDineIn: true)
})
}
}
| [
-1
] |
a417f11c36e3eebe6141196adb3160ab4a5cd4ce | 6d68d3aedd159f896e7bcd3e05eee58df8d2f259 | /testIgnoreFile/testIgnoreFile/ViewController.swift | dc6ce7da73c380555a72a6c625c75a871a08b1f4 | [] | no_license | ICloud0114/Demo | ed5482114ad611ef5ae36d7a93180933d642eeee | 59e2e9b7677ae347a734fc5f0b36ccbdffb40b80 | refs/heads/master | 2021-07-01T06:02:20.726183 | 2020-08-20T16:31:24 | 2020-08-20T16:31:24 | 141,997,350 | 1 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 519 | swift | //
// ViewController.swift
// testIgnoreFile
//
// Created by ICloud on 2018/9/8.
// Copyright © 2018年 ICloud. 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.
}
//sssssss
}
| [
279041,
279046,
277512,
215562,
275466,
278543,
281107,
279064,
281118,
284197,
289318,
296487,
296489,
304174,
309807,
300086,
234551,
279096,
286775,
300089,
234043,
288827,
238653,
226878,
288321,
129604,
301637,
226887,
293961,
286796,
158285,
226896,
212561,
284242,
292435,
300629,
276054,
237655,
307288,
40545,
200802,
284261,
281703,
306791,
286314,
296042,
164974,
307311,
281202,
284275,
277108,
300149,
314996,
276087,
234619,
284287,
284289,
276612,
280710,
284298,
303242,
278157,
311437,
226447,
234641,
349332,
117399,
280219,
282270,
285855,
228000,
282275,
278693,
287399,
100521,
313007,
277171,
307379,
284341,
286390,
300727,
282301,
277696,
285377,
280770,
227523,
302788,
228551,
279751,
280775,
279754,
282311,
230604,
284361,
276686,
298189,
282320,
229585,
302286,
307410,
189655,
302295,
226009,
282329,
363743,
282338,
228585,
282346,
358127,
312049,
286963,
280821,
120054,
226038,
234232,
282357,
280826,
286965,
358139,
282365,
286462,
280832,
282368,
358147,
226055,
282377,
299786,
312586,
300817,
282389,
282393,
329499,
228127,
315170,
282403,
281380,
233767,
283433,
130346,
282411,
293682,
159541,
282426,
289596,
283453,
307516,
279360,
289088,
293700,
234829,
307029,
241499,
308064,
227688,
313706,
290303,
306540,
299374,
162672,
199024,
276849,
292730,
333179,
303998,
290175,
275842,
224643,
304008,
324491,
304012,
304015,
300432,
226705,
310673,
277406,
285087,
234402,
289187,
284580,
276396,
286126,
277935,
324528,
282035,
292277,
296374,
130487,
234423,
277432,
278968,
293308,
278973,
295874,
299973,
165832,
306633,
286158,
280015,
310734,
301016,
163289,
286175,
234465,
168936,
294889,
231405,
183278,
282095,
227315,
296436,
281078,
290299,
233980,
287231
] |
414d7ae954fe8070178b95d947ebd6c6877c6be0 | 51a4cfd702a42305f3a82f13ada9f72c335116ed | /UIday2/NewUI/ViewController.swift | 9a3a412b92d34eee43e3681a211aacc1b5dc5ce4 | [] | no_license | toanphan1302/Swift_Bootcamp | a1f9b7b2d0f2082a07f879dc2171b800665a6270 | ba3e55d83c453155a414550e20152b16401a9efc | refs/heads/main | 2023-07-30T02:49:25.163045 | 2021-09-06T07:49:54 | 2021-09-06T07:49:54 | 387,958,741 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,344 | swift | //
// ViewController.swift
// NewUI
//
// Created by Toan on 8/18/21.
// Copyright © 2021 Toan. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var yoLabel: UILabel!
@IBOutlet weak var anotherLabel: UILabel!
@IBOutlet weak var moreLabel: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
yoLabel.backgroundColor = .black
anotherLabel.backgroundColor = .clear
moreLabel.backgroundColor = .cyan
yoLabel.layer.cornerRadius = 10.0
moreLabel.lineBreakMode = .byWordWrapping
yoLabel.clipsToBounds = true
anotherLabel.layer.cornerRadius = 5.0
anotherLabel.font = UIFont(name: "Helvetica", size: 21
)
anotherLabel.alpha = 0.5
let url = URL(string: "www.google.com")
let attributes: [NSAttributedString.Key: Any] = [
.font: UIFont.systemFont(ofSize:25),
.foregroundColor: UIColor.red,
.link: url!]
anotherLabel.attributedText = NSAttributedString(string: "I am writing something", attributes: attributes)
moreLabel.layer.cornerRadius = 3.0
moreLabel.lineBreakMode = .byWordWrapping
}
}
| [
-1
] |
3175880f5b65d85f617868715bed08f53be04f19 | 7fc3042d5ece80bfb79e337887af9610d3378fb3 | /Trade Me Task/TmtHomeViewController.swift | 2702cd4aff14a071ad058fb44f5d70f0a877fa18 | [] | no_license | pengyanb/Trade-Me-Task | f44404cb78419a8d1694800b5ba1ff60749cbe95 | a87ed26696852163b236befd4265c9178b5a2007 | refs/heads/master | 2016-09-13T22:11:08.689937 | 2016-04-23T02:29:45 | 2016-04-23T02:29:49 | 56,691,263 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 14,635 | swift | //
// ViewController.swift
// Trade Me Task
//
// Created by Yanbing Peng on 18/04/16.
// Copyright © 2016 Yanbing Peng. All rights reserved.
//
import UIKit
class TmtHomeViewController: UIViewController, UITextFieldDelegate {
// MARK: - Constants
private let CONST_CANCEL_BUTTON_EDIT_MODE_SIZE : CGFloat = 60
private let CONST_CANCEL_BUTTON_NORMAL_MODE_SIZE : CGFloat = 0
private let CONST_SEARCH_SECTION_EDIT_MODE_HEIGHT_PROPORTION : CGFloat = 0.1
private let CONST_SEARCH_SECTION_NORMAL_MODE_HEIGHT_PROPORTION : CGFloat = 1 / 3
private let CONST_SEARCH_SECTION_EDIT_MODE_WIDTH_PROPORTION : CGFloat = 0.9
private let CONST_SEARCH_SECTION_NORMAL_MODE_WIDTH_PROPORTION : CGFloat = 0.7
private let CONST_SECTION_CHANGE_ANIMATION_PERIOD = 0.5
private let oauthHelper = TradeMeOauthHelper()
private var isInIPadViewContainer = false
private var ipadViewContainerPreviousVC : UIViewController? = nil
// MARK: - Variables
private var scrollViewLastContentOffset : CGFloat = 0
var tmtModel = TradeMeTaskApiAccessModel()
// MARK: - Outlets
@IBOutlet weak var searchSectionHeightLayoutConstraint: NSLayoutConstraint?
@IBOutlet weak var searchSectionWidthLayoutConstraint: NSLayoutConstraint?
@IBOutlet weak var cancelButtonWidthLayoutConstraint: NSLayoutConstraint?
@IBOutlet weak var searchTextField: UITextField?
@IBOutlet weak var scrollView: UIScrollView?
@IBOutlet weak var scrollableContentView: UIView?
@IBOutlet weak var loginButton: UIBarButtonItem!
@IBOutlet weak var menuButton: UIBarButtonItem!
@IBOutlet weak var menuContainerWidthLayoutConstraint: NSLayoutConstraint?
@IBOutlet weak var ipadDetailVcContainer: UIView?
@IBOutlet weak var ipadSearchTextField: UITextField?
// MARK: - Target Actions
@IBAction func cancelButtonPressed(sender: UIButton) {
searchTextField?.resignFirstResponder()
displayNormalModeSearchSection()
}
@IBAction func loginButtonPressed(sender: UIBarButtonItem) {
let userDefault = NSUserDefaults.standardUserDefaults()
if let finalTokenDictionary = userDefault.objectForKey(Constants.NSUSER_DEFAULT_FINAL_TOKEN_KEY) as? [String:String]{
if let _ = finalTokenDictionary["oauth_token"], _ = finalTokenDictionary["oauth_token_secret"]{
loginButton.title = "Login"
userDefault.removeObjectForKey(Constants.NSUSER_DEFAULT_FINAL_TOKEN_KEY)
userDefault.removeObjectForKey(Constants.NSUSER_DEFAULT_TEMP_TOKEN_KEY)
userDefault.synchronize()
}
else{
handleUserAuthentication()
}
}
else{
handleUserAuthentication()
}
}
@IBAction func scrollViewTapped(sender: UITapGestureRecognizer) {
displayNormalModeSearchSection()
self.view.endEditing(true)
}
@IBAction func menuButtonPressed(sender: UIBarButtonItem) {
if menuContainerWidthLayoutConstraint?.constant == 0{
menuContainerWidthLayoutConstraint?.constant = 300
}
else{
menuContainerWidthLayoutConstraint?.constant = 0
}
UIView.animateWithDuration(0.5) { [weak self] in
self?.view.layoutIfNeeded()
}
}
// MARK: - View Life cycle
override func viewDidLoad() {
super.viewDidLoad()
searchTextField?.delegate = self
ipadSearchTextField?.delegate = self
hideMenuButton()
}
override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated)
print("[viewWillAppear]")
scrollViewLastContentOffset = 0
displayNormalModeSearchSection()
registerNotifications()
handleUserAuthentication()
let userDefault = NSUserDefaults.standardUserDefaults()
if isInIPadViewContainer{
showMenuButton()
}
if let finalTokenDictionary = userDefault.objectForKey(Constants.NSUSER_DEFAULT_FINAL_TOKEN_KEY) as? [String:String]{
if let _ = finalTokenDictionary["oauth_token"], _ = finalTokenDictionary["oauth_token_secret"]{
//print("[Final Token]: \(token) [Final TokenSecret]: \(tokenSecret)")
loginButton.title = "Logout"
}
else{
loginButton.title = "Login"
}
}
else{
loginButton.title = "Login"
}
}
override func viewWillDisappear(animated: Bool) {
super.viewWillDisappear(animated)
deregisterNotifications()
}
// MARK: - Notification related
private func registerNotifications(){
NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(appDidBecomeActive(_:)), name: UIApplicationDidBecomeActiveNotification, object: nil)
NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(handleOauthNotification(_:)), name: Constants.NOTI_IDENTIFIER_OAUTH_UPDATE, object: nil)
NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(handleDetailedContentSwithNotification(_:)), name: Constants.NOTI_NEED_SWITCH_IPAD_DETAILED_CONTENT, object: nil)
}
private func deregisterNotifications(){
NSNotificationCenter.defaultCenter().removeObserver(self)
}
func handleDetailedContentSwithNotification(notification:NSNotification){
print("[handleDetailedContentSwithNotification]")
if let userInfo = notification.userInfo{
if let segueIdentifier = userInfo["segueIdentifier"] as? String{
switch segueIdentifier {
case Constants.SEGUE_SHOW_SUB_CATEGORIES:
if let cateNumber = userInfo["cateNumber"] as? String{
if let subCategoriesViewController = self.storyboard?.instantiateViewControllerWithIdentifier("TmtSubCategoriesTableViewController") as? TmtSubCategoriesTableViewController{
subCategoriesViewController.tmtModel = tmtModel
subCategoriesViewController.subCategoryNumber = cateNumber
subCategoriesViewController.isInIPadViewContainer = true
swithToContentViewController(subCategoriesViewController)
}
}
case Constants.SEGUE_SHOW_LISTINGS:
if let cateNumber = userInfo["selectedCategoryNumber"] as? String{
if let listingTableViewController = self.storyboard?.instantiateViewControllerWithIdentifier("TmtListingsTableViewController") as? TmtListingsTableViewController{
listingTableViewController.tmtModel = tmtModel
listingTableViewController.tmtSelectedCategoryNumber = cateNumber
listingTableViewController.isInIPadViewContainer = true
swithToContentViewController(listingTableViewController)
}
}
case Constants.SEGUE_SHOW_LISTING_DETAILS:
if let listingId = userInfo["listingId"] as? Int{
if let listingDetailViewController = self.storyboard?.instantiateViewControllerWithIdentifier("TmtListingDetailsViewController") as? TmtListingDetailsViewController{
listingDetailViewController.tmtModel = tmtModel
listingDetailViewController.ldListingId = listingId
listingDetailViewController.isInIPadViewContainer = true
swithToContentViewController(listingDetailViewController)
}
}
default:
break
}
}
}
}
func appDidBecomeActive(notification:NSNotification){
//print("[appDidBecomeActive]")
handleUserAuthentication()
}
func handleOauthNotification(notification:NSNotification){
//print("[Received Oauth Notification]")
dispatch_async(dispatch_get_main_queue()) { [weak self] in
if self != nil{
let userDefault = NSUserDefaults.standardUserDefaults()
if let finalTokenDictionary = userDefault.objectForKey(Constants.NSUSER_DEFAULT_FINAL_TOKEN_KEY) as? [String:String]{
if let _ = finalTokenDictionary["oauth_token"], _ = finalTokenDictionary["oauth_token_secret"]{
//print("[Final Token]: \(token) [Final TokenSecret]: \(tokenSecret)")
self!.loginButton.title = "Logout"
}
else{
self!.loginButton.title = "Login"
}
}
else{
self!.loginButton.title = "Login"
}
}
}
}
// MARK: - Segue
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if let identifier = segue.identifier{
if identifier == Constants.SEGUE_SHOW_BROWSE_CATEGORIES{
var destVc = segue.destinationViewController
if let naviVc = destVc as? UINavigationController{
if let tableVc = naviVc.viewControllers.first as? TmtBrowseCategoriesTableViewController{
destVc = tableVc
}
}
if let tableVc = destVc as? TmtBrowseCategoriesTableViewController{
tableVc.tmtModel = tmtModel
}
}
else if identifier == Constants.SEGUE_SEARCH_LISTINGS{
if let destVc = segue.destinationViewController as? TmtListingsTableViewController{
destVc.tmtModel = tmtModel
destVc.searchString = searchTextField?.text
}
}
else if identifier == Constants.SEGUE_SHOW_IPAD_BROWSE_CATEGORIES_MENU{
//showMenuButton()
isInIPadViewContainer = true
if let destVc = segue.destinationViewController as? TmtIpadBrowseCategoriesViewController{
destVc.tmtModel = tmtModel
}
}
}
}
// MARK: - delegate methods [UITextField]
func textFieldShouldBeginEditing(textField: UITextField) -> Bool {
displayEditModeSearchSection()
ipadSearchTextField?.textAlignment = NSTextAlignment.Left
return true
}
func textFieldShouldReturn(textField: UITextField) -> Bool {
textField.resignFirstResponder()
displayNormalModeSearchSection()
if textField == searchTextField{
self.performSegueWithIdentifier(Constants.SEGUE_SEARCH_LISTINGS, sender: self)
}
if textField == ipadSearchTextField{
ipadSearchTextField?.textAlignment = NSTextAlignment.Center
if let listingTableViewController = self.storyboard?.instantiateViewControllerWithIdentifier("TmtListingsTableViewController") as? TmtListingsTableViewController{
listingTableViewController.tmtModel = tmtModel
listingTableViewController.searchString = ipadSearchTextField?.text
listingTableViewController.isInIPadViewContainer = true
swithToContentViewController(listingTableViewController)
}
}
return true
}
// MARK: - private func
private func swithToContentViewController(content:UIViewController){
print("[swithToContentViewController]")
self.addChildViewController(content)
content.view.frame = self.ipadDetailVcContainer!.bounds
if ipadViewContainerPreviousVC != nil{
ipadViewContainerPreviousVC?.removeFromParentViewController()
ipadViewContainerPreviousVC = content
}
ipadDetailVcContainer!.addSubview(content.view)
content.didMoveToParentViewController(self)
}
private func moveToViewController(viewController: UIViewController){
}
private func handleUserAuthentication(){
oauthHelper.handleUserAuthentication(Constants.CREDENTIAL_TRADEME_CONSUMER_KEY, consumerSecret: Constants.CREDENTIAL_TRADEME_CONSUMER_SECRET)
}
private func displayNormalModeSearchSection(){
if searchTextField == nil || cancelButtonWidthLayoutConstraint == nil || searchSectionWidthLayoutConstraint == nil || searchSectionHeightLayoutConstraint == nil{
return
}
searchTextField?.textAlignment = NSTextAlignment.Center
cancelButtonWidthLayoutConstraint?.constant = CONST_CANCEL_BUTTON_NORMAL_MODE_SIZE
searchSectionWidthLayoutConstraint = searchSectionWidthLayoutConstraint?.setMultiplier(CONST_SEARCH_SECTION_NORMAL_MODE_WIDTH_PROPORTION)
searchSectionHeightLayoutConstraint = searchSectionHeightLayoutConstraint?.setMultiplier(CONST_SEARCH_SECTION_NORMAL_MODE_HEIGHT_PROPORTION)
UIView.animateWithDuration(CONST_SECTION_CHANGE_ANIMATION_PERIOD) { [weak self] in
if self != nil{
self!.view.layoutIfNeeded()
}
}
}
private func displayEditModeSearchSection(){
if searchTextField == nil || cancelButtonWidthLayoutConstraint == nil || searchSectionWidthLayoutConstraint == nil || searchSectionHeightLayoutConstraint == nil{
return
}
searchTextField?.textAlignment = NSTextAlignment.Left
cancelButtonWidthLayoutConstraint?.constant = CONST_CANCEL_BUTTON_EDIT_MODE_SIZE
searchSectionWidthLayoutConstraint = searchSectionWidthLayoutConstraint?.setMultiplier(CONST_SEARCH_SECTION_EDIT_MODE_WIDTH_PROPORTION)
searchSectionHeightLayoutConstraint = searchSectionHeightLayoutConstraint?.setMultiplier(CONST_SEARCH_SECTION_EDIT_MODE_HEIGHT_PROPORTION)
UIView.animateWithDuration(CONST_SECTION_CHANGE_ANIMATION_PERIOD) { [weak self] in
if self != nil{
self!.view.layoutIfNeeded()
}
}
}
private func hideMenuButton(){
menuButton.enabled = false
menuButton.tintColor = UIColor.clearColor()
}
private func showMenuButton(){
print("[ShowMenuButton]")
menuButton.enabled = true
menuButton.tintColor = nil
}
}
| [
-1
] |
3d1781b5cba863d2ad202d0f3ae501c12bd98418 | 9e64aa59f40a2b113133cf3322fbe20bcf000b0a | /Realm9/Setting.swift | 37e487aa2485f7f00215517fb3814e457edd6030 | [] | no_license | Hiroki73LS/todotest | f2e36ed22f7a0eb548836c1fc20aee40fbceec4b | 1c26d9dda07bf6e94c351490c85d716943a1c38f | refs/heads/master | 2023-07-10T01:37:37.752030 | 2021-08-08T13:43:29 | 2021-08-08T13:43:29 | 391,491,724 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 2,466 | swift | import SwiftUI
struct Setting: View {
@ObservedObject var profile = UserProfile()
let backGroundColor = LinearGradient(gradient: Gradient(colors: [Color.white, Color.green]), startPoint: .top, endPoint: .bottom)
init() {
UITableView.appearance().backgroundColor = .clear
UITableViewCell.appearance().backgroundColor = .clear
}
var body: some View {
NavigationView {
ZStack{
backGroundColor.edgesIgnoringSafeArea(.all)
Form {
Section(header: Text("UserDetting")) {
TextField("選択肢1", text: $profile.username)
TextField("選択肢2", text: $profile.username2)
TextField("選択肢3", text: $profile.username3)
// Stepper(value: $profile.level, in: 1...10) {
// Text("Level : \(profile.level)")
// }
}
}
.navigationTitle("Setting")
}} .background(NavigationConfigurator { nc in
nc.navigationBar.barTintColor = #colorLiteral(red: 0.9033463001, green: 0.9756388068, blue: 0.9194290638, alpha: 1)
nc.navigationBar.titleTextAttributes = [.foregroundColor : UIColor.white]
})
}
}
class UserProfile: ObservableObject {
/// 選択肢1
@Published var username: String {
didSet {
UserDefaults.standard.set(username, forKey: "username")
}
}
/// 選択肢2
@Published var username2: String {
didSet {
UserDefaults.standard.set(username2, forKey: "username2")
}
}
/// 選択肢3
@Published var username3: String {
didSet {
UserDefaults.standard.set(username3, forKey: "username3")
}
}
/// レベル
@Published var level: Int {
didSet {
UserDefaults.standard.set(level, forKey: "level")
}
}
/// 初期化処理
init() {
username = UserDefaults.standard.string(forKey: "username") ?? ""
username2 = UserDefaults.standard.string(forKey: "username2") ?? ""
username3 = UserDefaults.standard.string(forKey: "username3") ?? ""
level = UserDefaults.standard.object(forKey: "level") as? Int ?? 1
}
}
struct Setting_Previews: PreviewProvider {
static var previews: some View {
Setting()
}
}
| [
-1
] |
d507e8049b2eefaa9f6153d1a15bd20dfcf999d5 | 5fddbce020cbff00ad75f56d927d97c53b970d01 | /MoviesLib/AppDelegate.swift | 1af59af3ec99f20cc4738ec69e56d3a945ca518d | [] | no_license | matheusfusco/Movies-Maps3 | 239ff5ce5162fe881a45f9cc225e728cc31801e5 | 2395980f13042649191b58c8c306ea84a6a15202 | refs/heads/master | 2020-03-09T15:18:15.466266 | 2018-04-10T01:39:15 | 2018-04-10T01:39:15 | 128,855,650 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 2,481 | swift | //
// AppDelegate.swift
// MoviesLib
//
// Created by Eric on 06/03/17.
// Copyright © 2017 EricBrito. All rights reserved.
//
import UIKit
import CoreData
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}
func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
//MARK: - CoreData Stack
lazy var persistentContainer: NSPersistentContainer = {
let container = NSPersistentContainer(name: "MoviesLib")
container.loadPersistentStores(completionHandler: { (storeDescription, error) in
})
return container
}()
}
| [
229380,
229383,
229385,
294924,
229388,
229391,
327695,
229394,
229397,
229399,
229402,
229405,
229408,
229411,
294950,
229415,
229417,
237613,
229422,
229426,
237618,
229428,
286774,
319544,
229432,
286776,
286778,
286783,
286791,
237640,
286797,
237646,
311375,
163920,
196692,
311383,
319590,
311400,
303212,
131192,
237693,
327814,
303241,
311436,
319633,
311444,
311449,
286873,
286876,
311460,
311469,
286896,
32944,
327862,
286906,
180413,
286910,
131264,
286916,
286922,
286924,
286926,
131278,
319694,
131281,
278743,
278747,
311516,
295133,
155872,
131299,
319716,
311525,
237807,
303345,
286962,
131314,
229622,
327930,
278781,
278783,
278785,
237826,
319751,
278792,
286987,
319757,
311569,
286999,
319770,
287003,
287006,
287009,
287012,
287014,
287019,
311598,
287032,
155966,
278849,
319809,
319810,
319814,
311628,
229709,
287054,
319822,
278865,
229717,
196963,
196969,
139638,
213367,
106872,
196988,
319872,
311683,
311693,
65943,
311719,
278952,
139689,
278957,
311728,
278967,
319932,
180668,
311741,
278975,
319938,
98756,
278980,
319945,
278986,
319947,
278990,
278994,
172512,
287202,
279010,
279015,
172520,
319978,
172526,
311791,
279023,
172529,
279027,
319989,
180727,
164343,
311804,
287230,
279040,
303617,
287234,
172550,
320007,
320008,
303623,
287238,
279051,
172552,
320014,
172558,
303632,
279058,
303637,
279063,
279067,
139803,
172572,
279072,
172577,
295459,
172581,
295461,
279082,
311850,
279084,
172591,
172598,
279095,
172607,
172612,
377413,
172614,
172618,
303690,
33357,
287309,
279124,
344661,
172634,
262752,
311911,
295533,
172655,
172656,
352880,
295538,
172660,
287349,
287355,
287360,
295553,
295557,
311942,
303751,
287365,
352905,
311946,
279178,
287371,
311951,
287377,
172691,
287381,
311957,
221850,
287386,
230045,
172702,
303773,
164509,
172705,
287394,
172707,
287390,
303780,
287398,
205479,
279208,
287400,
172714,
295595,
279212,
189102,
287409,
172721,
303797,
189114,
287419,
303804,
328381,
287423,
328384,
279231,
287427,
312005,
312006,
287436,
107212,
172748,
172751,
287440,
295633,
172755,
303827,
279255,
172760,
279258,
303835,
287450,
213724,
303838,
189149,
312035,
279267,
295654,
279272,
230128,
312048,
312050,
230131,
205564,
303871,
230146,
295685,
328453,
230154,
312077,
295695,
230169,
369433,
295707,
328476,
295710,
295720,
303914,
279340,
205613,
279353,
230202,
312124,
222018,
295755,
377676,
287569,
230241,
279394,
303976,
336744,
303985,
303987,
328563,
279413,
303991,
303997,
295806,
303999,
295808,
295813,
304005,
213895,
304007,
304009,
320391,
304011,
230284,
304013,
295822,
279438,
295825,
189329,
189331,
58262,
279452,
410526,
279461,
304042,
213931,
304055,
230327,
230334,
304063,
304065,
213954,
295873,
189378,
213963,
197580,
312272,
304084,
304090,
320481,
304106,
320490,
312302,
328687,
320496,
320498,
295928,
312321,
295945,
230413,
197645,
295949,
320528,
140312,
238620,
197663,
304164,
304170,
238641,
312374,
238652,
238655,
230465,
238658,
296004,
336964,
320582,
238666,
296021,
402518,
336987,
230497,
296036,
296040,
361576,
296043,
205931,
164973,
312432,
279669,
337018,
222340,
205968,
296084,
238745,
304285,
238756,
205991,
222377,
165035,
337067,
238766,
165038,
238770,
304311,
230592,
312518,
279750,
230600,
230607,
148690,
320727,
279769,
320730,
304348,
279777,
304354,
296163,
279781,
304360,
279788,
304365,
320748,
279790,
320756,
296189,
320771,
312585,
296202,
296205,
230674,
320786,
230677,
296213,
296215,
320792,
230681,
173350,
312622,
296243,
312630,
222522,
230718,
296255,
312639,
296259,
378181,
296262,
230727,
238919,
296264,
296267,
296271,
222545,
230739,
312663,
230748,
337244,
222556,
312676,
230760,
173418,
230763,
230768,
296305,
230773,
304505,
304506,
181631,
312711,
296331,
288140,
288144,
230800,
304533,
288154,
337306,
288160,
288162,
279975,
304555,
370092,
279983,
173488,
312755,
296373,
312759,
279991,
288185,
337335,
222652,
312766,
173507,
296389,
222665,
230860,
312783,
288208,
230865,
148946,
370130,
222676,
288210,
280021,
288212,
288214,
239064,
288217,
288218,
329177,
288220,
239070,
288224,
280034,
288226,
280036,
288229,
280038,
288230,
288232,
320998,
288234,
370146,
288238,
288240,
288242,
296435,
288244,
288246,
288250,
402942,
321022,
148990,
296446,
296450,
206336,
230916,
230919,
214535,
304651,
304653,
288275,
222752,
108066,
296486,
296488,
230961,
288306,
288320,
288325,
288329,
124489,
280140,
280145,
288338,
280149,
231000,
288344,
239194,
280152,
181854,
280158,
370272,
403039,
239202,
312938,
280183,
280185,
280188,
280191,
116354,
280194,
312970,
280208,
280211,
288408,
280218,
280222,
190118,
198310,
321195,
321200,
337585,
296634,
296637,
296641,
280260,
280264,
206541,
206543,
280276,
313044,
321239,
280283,
18140,
313052,
288478,
313055,
321252,
288489,
313066,
288494,
280302,
280304,
313073,
419570,
288499,
288502,
288510,
124671,
67330,
280324,
198416,
280337,
296723,
321304,
329498,
296731,
313116,
313121,
313123,
304932,
313125,
321316,
280363,
141101,
165678,
321336,
296767,
288576,
345921,
304968,
280393,
280402,
173907,
321364,
313176,
280419,
321381,
296812,
313201,
124796,
1920,
255873,
305028,
247688,
280464,
124817,
239510,
280473,
124827,
214940,
247709,
214944,
313250,
280487,
313258,
321458,
296883,
124853,
214966,
296888,
10170,
296890,
288700,
296894,
190403,
296900,
280515,
337862,
165831,
280521,
296921,
239586,
313320,
231404,
124913,
165876,
321528,
239612,
288764,
239617,
313347,
288773,
313358,
329747,
305176,
321560,
313371,
354338,
305191,
313386,
354348,
124978,
215090,
124980,
288824,
288826,
321595,
313406,
288831,
67654,
280651,
354382,
288848,
354390,
280669,
223327,
280671,
321634,
149603,
329830,
280681,
313451,
280687,
215154,
280691,
313458,
313464,
321659,
280702,
288895,
141446,
215175,
321670,
141455,
141459,
280725,
313498,
100520,
288936,
280747,
288940,
321717,
125111,
280764,
280769,
280771,
280774,
313548,
280783,
280786,
280793,
280796,
338147,
280804,
280807,
157930,
280811,
125167,
280817,
125171,
157940,
182517,
280825,
280827,
280830,
280831,
125187,
280835,
125191,
321801,
125194,
125201,
125207,
125209,
321817,
125218,
321842,
223539,
125239,
305464,
280888,
313660,
289087,
280897,
239944,
305480,
239947,
305485,
305489,
379218,
280919,
354653,
313700,
280937,
199020,
190832,
280946,
223606,
313720,
280956,
239997,
280959,
313731,
240011,
199051,
289166,
240017,
190868,
240021,
297365,
297368,
297372,
141725,
297377,
289186,
297391,
289201,
240052,
289207,
305594,
289210,
281024,
289221,
289227,
281045,
281047,
240098,
166378,
248299,
305647,
281075,
174580,
240124,
281084,
305662,
305664,
240129,
305666,
240132,
305668,
281095,
223752,
150025,
338440,
223757,
281102,
289300,
223765,
281113,
322074,
281116,
322080,
281121,
322083,
182819,
281127,
322092,
150066,
158262,
158266,
289342,
281154,
322115,
281163,
281179,
338528,
338532,
281190,
281196,
19053,
158317,
313973,
297594,
281210,
158347,
133776,
240275,
117398,
314007,
289436,
174754,
330404,
289448,
174764,
314029,
314033,
240309,
133817,
314045,
314047,
314051,
199364,
297671,
158409,
289493,
363234,
289513,
289522,
289525,
322299,
289532,
322303,
289537,
322310,
264969,
322314,
322318,
281372,
322341,
289577,
215850,
281388,
281401,
289601,
281410,
281413,
281414,
240458,
281420,
240468,
281430,
322393,
297818,
281435,
281438,
281442,
174955,
224110,
207733,
207737,
314241,
183172,
158596,
338823,
240519,
314249,
322440,
322448,
289687,
240535,
289694,
289696,
289712,
289724,
52163,
281567,
289762,
322534,
297961,
183277,
314357,
322550,
134142,
322563,
314372,
322580,
175134,
322599,
322610,
314421,
281654,
314427,
314433,
207937,
314441,
207949,
322642,
281691,
314461,
281702,
281704,
314474,
281708,
281711,
314487,
314491,
248995,
306341,
306344,
306347,
306354,
142531,
289991,
289997,
249045,
363742,
363745,
298210,
298216,
290025,
330988,
126190,
216303,
322801,
306424,
257302,
363802,
199976,
199978,
314671,
298292,
257334,
216376,
298306,
380226,
224584,
224587,
224594,
216404,
306517,
150870,
224603,
314718,
265568,
281960,
306539,
290161,
216436,
306549,
298358,
306552,
290171,
306555,
298365,
290174,
224641,
281987,
298372,
314756,
265604,
224647,
281990,
298377,
142733,
298381,
314768,
224657,
306581,
314773,
314779,
314793,
282025,
282027,
241068,
306605,
241070,
241072,
282034,
241077,
298424,
306618,
282044,
323015,
306635,
306640,
290263,
290270,
339431,
282089,
191985,
282098,
290291,
282101,
241142,
290298,
151036,
290302,
282111,
290305,
175621,
306694,
192008,
323084,
257550,
290321,
282130,
323090,
282133,
290326,
241175,
290328,
290325,
282137,
290332,
241181,
282144,
306721,
306726,
290344,
306731,
290349,
290351,
290356,
224849,
282195,
282199,
282201,
306778,
159330,
314979,
224875,
241260,
323181,
257658,
315016,
282249,
290445,
282261,
298651,
282269,
323229,
298655,
323231,
61092,
282277,
298662,
306856,
282295,
282300,
323260,
323266,
282310,
323273,
282319,
306897,
241362,
298709,
282328,
298714,
241371,
52959,
216801,
282337,
241380,
216806,
323304,
282345,
12011,
323310,
282356,
323318,
282364,
282367,
306945,
241410,
241412,
323333,
282376,
216842,
323345,
282388,
323349,
282392,
184090,
315167,
282402,
315174,
323367,
241448,
241450,
282410,
306991,
315184,
323376,
315190,
241464,
282425,
298811,
307009,
241475,
307012,
315211,
282446,
315221,
323414,
315223,
241496,
241498,
307035,
298844,
307040,
110433,
241509,
110438,
110445,
282478,
282481,
110450,
315249,
315251,
315253,
315255,
339838,
282499,
315267,
315269,
241544,
282505,
241546,
241548,
298896,
282514,
298898,
44948,
241556,
298901,
241560,
241563,
241565,
298910,
241567,
241569,
241574,
282537,
298922,
36779,
241581,
282542,
241583,
323504,
200625,
241586,
282547,
241588,
290739,
241590,
241592,
241598,
290751,
241600,
241605,
298950,
151495,
241610,
298975,
241632,
323555,
298984,
241640,
241643,
298988,
241646,
241649,
241652,
323574,
290807,
299006,
282623,
315397,
241669,
282632,
282639,
290835,
282645,
241693,
282654,
102438,
217127,
282669,
323630,
282681,
290877,
282687,
159811,
315463,
315466,
192589,
192596,
176213,
307287,
315482,
315483,
192605,
233567,
200801,
217188,
299109,
307303,
356457,
45163,
307307,
315502,
307314,
323700,
299126,
233591,
299136,
307329,
307338,
233613,
307352,
299164,
299167,
315557,
184486,
307370,
184492,
307372,
307374,
307376,
299191,
176311,
307385,
184503,
307386,
307388,
258235,
307390,
176316,
299200,
184512,
307394,
307396,
299204,
184518,
307399,
323784,
233679,
307409,
307411,
176343,
299225,
233701,
307432,
307436,
184572,
184579,
282893,
291089,
282906,
291104,
233766,
241971,
176435,
315701,
332086,
168245,
307510,
307515,
307518,
282942,
282957,
110926,
323917,
233808,
323921,
315733,
233815,
315739,
323932,
258397,
299357,
242018,
242024,
299373,
315757,
250231,
242043,
315771,
299388,
299391,
242050,
299398,
242057,
291212,
299405,
291222,
283033,
242075,
291231,
61855,
283042,
291238,
291241,
127403,
127405,
324015,
291247,
324017,
127407,
299444,
291254,
127417,
291260,
127421,
127429,
315856,
315860,
176597,
127447,
127449,
299481,
160221,
176605,
127455,
242143,
127457,
291299,
242152,
291305,
176620,
291314,
291317,
135672,
127480,
291323,
233979,
127485,
291330,
127494,
283142,
127497,
233994,
135689,
127500,
291341,
233998,
127506,
234003,
234006,
127511,
152087,
234010,
135707,
242206,
135710,
291361,
242220,
291378,
152118,
234038,
70213,
242250,
111193,
242275,
299620,
168562,
184952,
291450,
135805,
135808,
291456,
299655,
373383,
135820,
316051,
225941,
316054,
299672,
135834,
373404,
225948,
135839,
299680,
225954,
135844,
299684,
242343,
242345,
373421,
299706,
135870,
135873,
135876,
135879,
299720,
299723,
299726,
225998,
226002,
226005,
226008,
357083,
242396,
299740,
201444,
299750,
283368,
234219,
283372,
226037,
283382,
234231,
234236,
242431,
209665,
299778,
234242,
242436,
234246,
226056,
234248,
291593,
242443,
242445,
234254,
291601,
234258,
242450,
242452,
234264,
201496,
234266,
234269,
234272,
234274,
152355,
299814,
234278,
283432,
234281,
234284,
234287,
283440,
185138,
242483,
234292,
234296,
160572,
283452,
234302,
234307,
242499,
234309,
234313,
316235,
234316,
283468,
234319,
242511,
234321,
234324,
201557,
234329,
234333,
308063,
234336,
234338,
242530,
349027,
234344,
177004,
234350,
324464,
234353,
152435,
177011,
234356,
234358,
234362,
291711,
234368,
291714,
234370,
291716,
234373,
226182,
234375,
308105,
226185,
234384,
308114,
234388,
234390,
226200,
234393,
308123,
234396,
324508,
291742,
234401,
291748,
234405,
324518,
291750,
234407,
324520,
291754,
226220,
291756,
234414,
291760,
299952,
201650,
226230,
234422,
275384,
234428,
291773,
242623,
226239,
234431,
234434,
324548,
226245,
234437,
234439,
234443,
291788,
193486,
234446,
193488,
234449,
316370,
275406,
234452,
234455,
234459,
234461,
234464,
234467,
234470,
168935,
5096,
324585,
234478,
316400,
234481,
234484,
234485,
234487,
234493,
234496,
316416,
308226,
234501,
308231,
234504,
234507,
234515,
300054,
234519,
234520,
316439,
234523,
234526,
234528,
300066,
234532,
300069,
234535,
234537,
308266,
234540,
234543,
316465,
234546,
275508,
300085,
234549,
324663,
300088,
234553,
234558,
316479,
234561,
160835,
234563,
308291,
316483,
234568,
234570,
316491,
234572,
300108,
234574,
300115,
234580,
234581,
234585,
242777,
275545,
234595,
234597,
300133,
300139,
234605,
160879,
234607,
275569,
234610,
300148,
234614,
144506,
234618,
234620,
275579,
234623,
226433,
234627,
275588,
234634,
234636,
234640,
275602,
234643,
308373,
324757,
234647,
226453,
275606,
234648,
308379,
275608,
234650,
324766,
234653,
283805,
119967,
300194,
300189,
242852,
300197,
234657,
275626,
234667,
300208,
316596,
234677,
308414,
234687,
300226,
308418,
308420,
300229,
234692,
283844,
300234,
283850,
300238,
300241,
316625,
300243,
300245,
316630,
300248,
300253,
300256,
300258,
300260,
234726,
300263,
300265,
300267,
161003,
300270,
300272,
120053,
300278,
316663,
300284,
275710,
300287,
292097,
300289,
300292,
300294,
275719,
234760,
234763,
177419,
242957,
300301,
300299,
177424,
275725,
283917,
349464,
283939,
259367,
292143,
283951,
300344,
226617,
243003,
226628,
300357,
177482,
283983,
316758,
357722,
316766,
292192,
218464,
316768,
292197,
243046,
316774,
218473,
136562,
292212,
275834,
333178,
275836,
243072,
275840,
316803,
316806,
226696,
226699,
316811,
316814,
300433,
234899,
357783,
316826,
300448,
144810,
144812,
144814,
144820,
284084,
284087,
292279,
144826,
144828,
144830,
292288,
144832,
144835,
144837,
144839,
144841,
144844,
144847,
144852,
144855,
300507,
103899,
333280,
292329,
300523,
259565,
300527,
308720,
259567,
316917,
292343,
308727,
300537,
300540,
308757,
308762,
284194,
284196,
235045,
284199,
284206,
284209,
284211,
194101,
308790,
194103,
316983,
284213,
284215,
284218,
226877,
284223,
284226,
284228,
292421,
226886,
284231,
284234,
276043,
317004,
366155,
284238,
226895,
292433,
194130,
284241,
300628,
284243,
284245,
317015,
276053,
284247,
284249,
243290,
284253,
300638,
243293,
284255,
284258,
325220,
292452,
177766,
292454,
292458,
284267,
292461,
284272,
292466,
284274,
284278,
276086,
292470,
292473,
284283,
276093,
284286,
292479,
284288,
276098,
284290,
284292,
292485,
325250,
284297,
317066,
284299,
317068,
284301,
284303,
276114,
284306,
284308,
284312,
284314,
284316,
276127,
284322,
284327,
276137,
284329,
284331,
317098,
284333,
284335,
284337,
284339,
300726,
284343,
284346,
284350,
284352,
358080,
284354,
358083,
276160,
284358,
284360,
358089,
284362,
276170,
276175,
284368,
276177,
284370,
358098,
317138,
284372,
284374,
284377,
358116,
276197,
317158,
325353,
358122,
276206,
358126,
358128,
358133,
358135,
276216,
358138,
300795,
358140,
284413,
358142,
284418,
317187,
358146,
317191,
284428,
300816,
300819,
317207,
300828,
300830,
276255,
300832,
300836,
227109,
317221,
358183,
186151,
276268,
300845,
243504,
300850,
284469,
276280,
325436,
358206,
276291,
366406,
276295,
300872,
153417,
358224,
284499,
276308,
178006,
284502,
317271,
276315,
292700,
317279,
284511,
227175,
292715,
300912,
292721,
284529,
300915,
284533,
317306,
284540,
292734,
325509,
325512,
169868,
317332,
358292,
350106,
284572,
276386,
284579,
276388,
358312,
292776,
284585,
276395,
276402,
300979,
358326,
161718,
358330,
300987,
276411,
276425,
301009,
301011,
301013,
292823,
301015,
301017,
358360,
292828,
153568,
292839,
292843,
227314,
325624,
317435,
243717,
317446,
292876,
317456,
276496,
317458,
243733,
317468,
243740,
317472,
325666,
243751,
292904,
292907,
276528,
243762,
309298,
325685,
325689,
235579,
276539,
325692,
178238,
243785,
309337,
227418,
309342,
227423,
178273,
227426,
276579,
194660,
227430,
292968,
309352,
309354,
276586,
301163,
301167,
227440,
284786,
276595,
292985,
301178,
292989,
292993,
301185,
317573,
333957,
301199,
350354,
350359,
276638,
153765,
284837,
227520,
227522,
301252,
227529,
301258,
276685,
309455,
276689,
301272,
276699,
194780,
309468,
309471,
317665,
301283,
317672,
243948,
194801,
309494,
243960,
227583,
276735,
276739,
211204,
309509,
276742,
227596,
325910,
309530,
342298,
211232,
211241,
325937,
325943,
260421,
285002,
276811,
235853,
276816,
235858,
276829,
276833,
391523,
276836,
293227,
276843,
293232,
276848,
186744,
211324,
317833,
178572,
285070,
178583,
227738,
317853,
317858,
342434,
285093,
285098,
276907,
235955,
293304,
293307,
293314,
293325,
317910,
293336,
235994,
235996,
317917,
293343,
358880,
276961,
293346,
276964,
293352,
236013,
293364,
301562,
293370,
317951,
309764,
301575,
236043,
317963,
342541,
55822,
113167,
309779,
317971,
309781,
55837,
227879,
293417,
227882,
309804,
293421,
105007,
236082,
285236,
23094,
277054,
244288,
301636,
301639,
301643,
285265,
277080,
309849,
285277,
285282,
326244,
277100,
309871,
121458,
170618,
170619,
309885,
309888,
277122,
227975,
277128,
285320,
301706,
318092,
334476,
326285,
318094,
277136,
277139,
227992,
285340,
318108,
318110,
227998,
137889,
383658,
285357,
318128,
277170,
293555,
318132,
154292,
277173,
342707,
277177,
277181,
318144,
277187,
277191,
277194,
277196,
277201,
137946,
113378,
203491,
228069,
277223,
342760,
56041,
285417,
277232,
228081,
56059,
310015,
310020,
310029,
228113,
285459,
277273,
326430,
326434,
228135,
318248,
277291,
318253,
285489,
293685,
285494,
301880,
285499,
301884,
293696,
310080,
301893,
277317,
293706,
277329,
162643,
310100,
301911,
277337,
301921,
400236,
293741,
236397,
162671,
326514,
244598,
15224,
236408,
277368,
416639,
416640,
113538,
310147,
293767,
416648,
39817,
187274,
277385,
301972,
424853,
310179,
293798,
293802,
236460,
293811,
293817,
293820,
203715,
326603,
293849,
293861,
228327,
228328,
318442,
277486,
326638,
326640,
203761,
318450,
293876,
293877,
285686,
302073,
293882,
302075,
121850,
293887,
277504,
277507,
277511,
293899,
277519,
293908,
293917,
293939,
318516,
277561,
277564,
310336,
7232,
293956,
277573,
228422,
293960,
277577,
310344,
277583,
203857,
293971,
310359,
236632,
277594,
138332,
277598,
203872,
277601,
285792,
310374,
203879,
310376,
228460,
318573,
203886,
187509,
285815,
367737,
285817,
302205,
294026,
285835,
302218,
162964,
384148,
294038,
187542,
302231,
285849,
302233,
285852,
302237,
285854,
285856,
302241,
285862,
277671,
302248,
64682,
277678,
294063,
294065,
302258,
294070,
294072,
318651,
294076,
277695,
318657,
302275,
130244,
302282,
310476,
302285,
302288,
310481,
302290,
203987,
302292,
302294,
302296,
384222,
310498,
285927,
318698,
302315,
228592,
294132,
138485,
204026,
302332,
228606,
204031,
64768,
310531,
138505,
228617,
318742,
204067,
277801,
277804,
285997,
277807,
285999,
113969,
277811,
318773,
277816,
318776,
286010,
277819,
294204,
277822,
417086,
294211,
302403,
277832,
277836,
294223,
277839,
326991,
277842,
277847,
277850,
179547,
277853,
294238,
277857,
277860,
302436,
294246,
327015,
310632,
277864,
327017,
351594,
277869,
277872,
351607,
310648,
277880,
310651,
277884,
277888,
310657,
310659,
277892,
294276,
277894,
327046,
253320,
310665,
277898,
318858,
351619,
277903,
310672,
277905,
351633,
277908,
277917,
310689,
277921,
130468,
277928,
277932,
310703,
277937,
130486,
310710,
310712,
277944,
310715,
277947,
277950,
277953,
64966,
310727,
245191,
277959,
302534,
277963,
277966,
302543,
310737,
277971,
310740,
228825,
277978,
310749,
277981,
277984,
310755,
277989,
277991,
277995,
286188,
310764,
278000,
228851,
310772,
278003,
278006,
40440,
212472,
278009,
40443,
286203,
310782,
228864,
294405,
286214,
302603,
302614,
302617,
286233,
302621,
286240,
146977,
187939,
40484,
294435,
40486,
286246,
40488,
294439,
294440,
40491,
294443,
294445,
286248,
310831,
40499,
40502,
212538,
40507,
40511,
40513,
327240,
40521,
286283,
40525,
40527,
212560,
196177,
400976,
228944,
40533,
40537,
212571,
40541,
278109,
40544,
40548,
40550,
40552,
286313,
40554,
310892,
40557,
40560,
188022,
122488,
294521,
343679,
294537,
310925,
286354,
278163,
302740,
278168,
327333,
229030,
212648,
278188,
302764,
319153,
278196,
319171,
302787,
302789,
294599,
278216,
294601,
302793,
319181,
319187,
286420,
229076,
286425,
319194,
229086,
286432,
294625,
294634,
302838,
286455,
319226,
319228,
286460,
319231,
311043,
302852,
302854,
294664,
311048,
319243,
311053,
294682,
278306,
188199,
294701,
278320,
319280,
319290,
229192,
302925,
237409,
319342,
360317,
294785,
327554,
40840,
40851,
294803,
188312,
294811,
319390,
40865,
294817,
319394,
294821,
311209,
180142,
188340,
40886,
319419,
294844,
294847,
24528,
393177,
294876,
294879,
294883,
319465,
294890,
311279,
278513,
237555,
311283,
278516,
237562
] |
ba4ab9893a22fabae5bf7f718bcf69ef5cf7485a | 13b9728dc1cc78178103bb6695549c04169c4c79 | /ABCFramework/SourceCode/Page/ABCPageProtocol.swift | f82fe1035aa3cfe834030d7a7c254356acb29eeb | [
"MIT"
] | permissive | AKACoder/ABCFramework | b0d914d3ed3fdb0abd04c3efba27a10fbad95e28 | f3572553edf496eebb465af283be19ef1272876e | refs/heads/master | 2020-03-22T00:12:43.221080 | 2018-06-30T09:02:04 | 2018-06-30T09:02:04 | 98,610,657 | 2 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 769 | swift | //
// ABCPageProtocol.swift
// ABCFramework
//
// Created by AKACoder on 2018/6/30.
// Copyright © 2018年 AKACoder. All rights reserved.
//
import Foundation
import UIKit
public protocol ABCPageProtocol {
var PageData: Any? {get set}
var StatusBarRect: CGRect {get}
mutating func SetPageData(data: Any?)
func GetPageData() -> Any?
func Layout()
func Release()
func Refresh()
}
extension ABCPageProtocol {
public var StatusBarRect: CGRect {
get {
return UIApplication.shared.statusBarFrame
}
}
public mutating func SetPageData(data: Any?) {
PageData = data
}
public func Refresh() {}
public func GetPageData() -> Any? {
return PageData
}
}
| [
-1
] |
3f01b43779ce70df847b15523932f8e25b75d024 | 4c00746fda9ce58be466604354ad5647193fffad | /Package.swift | 14bf1059b14f03b91bd482ab7357921b84921276 | [] | no_license | nneuberger1/SwiftLogFirebaseEvents | 47bb0737a371130f68a8d2a110ca67648185dd0b | 36168f22871f92687c488f5ac29048f7ecd77fd0 | refs/heads/master | 2023-02-11T21:02:28.660847 | 2021-01-08T05:32:23 | 2021-01-08T05:32:23 | 327,807,548 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,094 | swift | // swift-tools-version:5.3
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "SwiftLogFirebaseEvents",
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "SwiftLogFirebaseEvents",
targets: ["SwiftLogFirebaseEvents"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.target(
name: "SwiftLogFirebaseEvents",
dependencies: []),
.testTarget(
name: "SwiftLogFirebaseEventsTests",
dependencies: ["SwiftLogFirebaseEvents"]),
]
)
| [
415748,
415758,
214553,
237593,
369691,
192028,
217118,
201762,
201764,
224295,
201769,
140330,
201770,
201771,
201773,
402986,
213040,
201777,
385074,
321590,
33336,
162361,
415804,
123965,
54335,
173122,
389700,
201285,
159303,
378952,
389705,
339016,
168017,
254035,
376917,
385112,
141913,
384092,
395359,
160864,
392291,
261220,
374373,
343654,
258151,
345190,
194154,
66668,
62572,
362606,
373359,
2161,
2164,
253045,
346745,
347258,
201851,
2172,
2173,
2174,
2175,
201856,
2177,
160385,
201858,
339072,
204420,
339075,
339078,
357000,
204425,
339087,
339090,
258708,
2199,
264857,
176794,
380058,
2204,
44192,
222881,
393379,
2212,
181928,
248488,
260266,
222381,
336559,
388788,
173752,
153273,
350908,
295100,
373948,
357568,
222400,
315584,
66756,
389316,
211655,
66762,
257228,
66765,
159439,
265424,
256720,
253649,
66770,
366292,
385237,
426197,
223959,
266456,
254172,
266463,
317666,
411879,
264939,
409324,
360178,
337650,
379128,
353017,
388858,
393979,
395512,
425724,
178430,
388864,
388865,
371971,
388867,
192774,
388870,
343308,
136461,
153870,
249101,
267024,
365842,
347417,
379673,
348960,
134433,
342306,
255782,
52520,
259368,
136489,
248106,
273707,
325932,
341807,
347440,
388916,
188727,
388920,
388921,
377150,
250175,
384329,
344393,
25422,
384848,
134482,
253781,
339800,
253785,
253789,
416093,
111456,
253793,
198498,
211813,
357222,
385896,
253801,
151919,
1905,
362866,
1907,
337271,
357752,
249211,
189309,
259455,
299394,
390020,
269190,
420230,
271482,
106889,
373131,
214412,
106891,
349583,
215442,
355220,
355224,
1945,
393626,
1947,
355228,
1948,
253341,
1951,
1952,
355233,
1950,
1955,
1956,
1957,
354214,
1959,
178087,
258475,
355243,
1963,
158640,
355249,
235957,
1975,
1976,
201144,
398776,
225211,
219072,
344514,
254407,
1996,
372174,
1998,
355281,
184787,
338388,
380372,
2006,
2011,
262620,
208354,
241122,
416228,
380902,
351206,
145899,
350701,
256494,
372722,
347124,
200181,
247797,
411133
] |
0c9cf944d86c60eb756b42ea6b830540d86f958b | 72d022b40a894f658b1a47b87e3f247cfa4dd8f4 | /Rickety Kate/GameViewController.swift | 767fe594344cbfb4dbf8fffeadea8be871b2a784 | [
"CC-BY-3.0"
] | permissive | GeoffBurns/Rickety-Kate | a95156d638cc9248d33933797ffd391a5368c573 | e98dcb71217ecf78778cf4fbc5de25d6e06780b2 | refs/heads/master | 2021-06-03T22:55:04.583071 | 2019-11-29T00:27:33 | 2019-11-29T00:27:33 | 42,398,907 | 5 | 2 | null | 2015-10-11T03:48:09 | 2015-09-13T14:30:20 | Swift | UTF-8 | Swift | false | false | 8,094 | swift | //
// GameViewController.swift
// Rickety Kate
//
// Created by Geoff Burns on 10/09/2015.
// Copyright (c) 2015 Geoff Burns. All rights reserved.
//
import UIKit
import SpriteKit
//import iAd
import Cards
class GameViewController: UIViewController //, ADBannerViewDelegate
{
//var adBannerView: ADBannerView = ADBannerView(frame: CGRect.zero)
// iAds Depreciated
/*
func loadAds(){
adBannerView.center = CGPoint(x: adBannerView.center.x, y: view.bounds.size.height - adBannerView.frame.size.height / 2)
adBannerView.delegate = self
adBannerView.isHidden = true
view.addSubview(adBannerView)
// set self.canDisplayBannerAds to true
// or use ADBannerView and ADBannerViewDelegate
// don't do both
// self.canDisplayBannerAds = true
}
*/
override func viewDidLoad() {
super.viewDidLoad()
let value = UIInterfaceOrientation.landscapeLeft.rawValue
UIDevice.current.setValue(value, forKey: "orientation")
// Detect the screensize
let sizeRect = Game.screen
let scale = UIScreen.main.scale
let width = sizeRect.size.width * scale
let height = sizeRect.size.height * scale
let size = CGSize(width: width, height: height)
NotificationCenter.default .
addObserver(self, selector:
#selector(GameViewController.showAuthenticationViewController), name:
NSNotification.Name(rawValue: PresentAuthenticationViewController), object: nil)
GameKitHelper.sharedInstance.authenticateLocalPlayer()
GameKitHelper.sharedInstance.gameView = self.view as? SKView
Game.settings.isFoolATrump = false
Game.settings.isAceHigh = true
Game.settings.noOfSuitesDefault = 5
Game.settings.options = [
Options.noOfSuites,
Options.noOfCards,
Options.noOfPlayers,
Options.noOfHumans,
Options.jokers,
Options.trumps,
Options.passCard,
MoreOptions.winningScore,
Options.speed,
MoreOptions.ruleSet,
MoreOptions.hooligan,
MoreOptions.omnibus,
Options.showTips,
MoreOptions.allowBreaking,
Options.useNumbers
]
Game.settings.audioOptions = [
Options.music,
Options.musicVolume,
Options.credit,
Options.sound,
Options.soundVolume
]
Options.speed.onValueChanged = Game.settings.cacheSpeed
MoreOptions.ruleSet.onValueChanged = Game.settings.clearData
Tip.setup()
SoundManager.sharedInstance.playlist = ["Monkeys","Happy","Dark","Kool", "Hitman", "Sneaky", "Amok", "Monkeys"]
ScoreDisplay.scoreToString = {(name,wins,score) in
if wins==0
{
return "%@ score is %d".with.sayTo(name).using(score).localize
}
return "%@ Score %d n %d %@".with.sayTo(name).using(score).pluralizeUnit(wins, unit: "Win").localize
}
/* ScoreDisplay.bottom = DeviceSettings.isPortrait ? 0.12 :
(DeviceSettings.isPhone
? (DeviceSettings.isPhoneX || DeviceSettings.isPhone55inch ? 0.25 : 0.19)
: 0.22)
ScoreDisplay._bottom = { return DeviceSettings.isPortrait ? 0.115 :
(DeviceSettings.isPhone
? 0.19 //(DeviceSettings.isPhoneX ? 0.19 : 0.19)
: 0.23) }
*/
ScoreDisplay._bottom = {
let isBig = DeviceSettings.isBigPro
let bottom : CGFloat = DeviceSettings.isPortrait ? ( isBig ? 0.09 : 0.115) :
(DeviceSettings.isPhone
? (DeviceSettings.isPhoneX || DeviceSettings.isPhone55inch ? 0.235 : 0.19)
: ( isBig ? 0.16 : 0.23))
return bottom
}
/* ScoreDisplay.bottom = DeviceSettings.isPortrait ? 0.12 :
(DeviceSettings.isPhone
? (DeviceSettings.isPhoneX || DeviceSettings.isPhone55inch ? 0.25 : 0.19)
: 0.22) */
// Scene should be shown in fullscreen mode
let scene = RicketyKateGameScene(size: size)
scene.tableSize = size
// Configure the view.
let skView = self.view as! SKView
skView.showsFPS = false
skView.showsNodeCount = false
/* Sprite Kit applies additional optimizations to improve rendering performance */
skView.ignoresSiblingOrder = true
/* Set the scale mode to manually resize */
scene.scaleMode = .resizeFill
scene.table = RicketyKateCardTable.makeDemo(scene)
skView.presentScene(scene)
// iAds Depreciated
//loadAds()
}
@objc func showAuthenticationViewController() {
let gameKitHelper = GameKitHelper.sharedInstance
if let authenticationViewController =
gameKitHelper.authenticationViewController {
self .
present(authenticationViewController,
animated: true,
completion: nil)
}
}
deinit {
NotificationCenter.default.removeObserver(self)
}
override var shouldAutorotate : Bool {
return true
}
override var supportedInterfaceOrientations : UIInterfaceOrientationMask {
return UIInterfaceOrientationMask.landscapeLeft
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
Game.settings.memoryWarning = true
}
override var prefersStatusBarHidden : Bool {
return true
}
override func viewWillTransition( to size: CGSize,
with coordinator: UIViewControllerTransitionCoordinator)
{
resize(
//adBannerView,
size: size);
}
func resize(
// _ banner: ADBannerView?,
size:CGSize = Game.screen.size) {
let adHeight = CGFloat()
/* if let b = banner, b.isHidden == false
{
adHeight = b.frame.size.height
}*/
if let uiView = self.view,
let skView = uiView as? SKView,
let scene = skView.scene as? RicketyKateGameScene
{
scene.adHeight = adHeight
scene.arrangeLayoutFor(size,bannerHeight: adHeight)
return
}
let skViews = self.view.subviews.filter { $0 is SKView }
if let uiView = skViews.first,
let skView = uiView as? SKView,
let scene = skView.scene as? RicketyKateGameScene
{
scene.adHeight = adHeight
scene.arrangeLayoutFor(size,bannerHeight: adHeight)
}
}
override func didRotate(from fromInterfaceOrientation: UIInterfaceOrientation) {
// resize(adBannerView);
}
//iAd
/*
func bannerViewWillLoadAd(_ banner: ADBannerView) {
NSLog("banner will load");
}
func bannerViewDidLoadAd(_ banner: ADBannerView) {
adBannerView.isHidden = false
resize(banner);
NSLog("banner loaded");
}
func bannerViewActionDidFinish(_ banner: ADBannerView) {
// resize(banner);
NSLog("banner Action Did Finish");
}
func bannerViewActionShouldBegin(_ banner: ADBannerView, willLeaveApplication willLeave: Bool) -> Bool {
return true
}
func bannerView(_ banner: ADBannerView, didFailToReceiveAdWithError error: Error) {
adBannerView.isHidden = true
let status = banner.isBannerLoaded ? "error but banner loaded" :"banner unloaded"
NSLog(status);
resize(banner);
if let oldError = error as NSError?
{
let errorString = oldError.debugDescription
NSLog(errorString);
}
}
*/
}
| [
-1
] |
23d400539c5f4dd8e68edd30e0eda1370209dad3 | 1e33d26f3bd9cbac140fc8b0e856e15b6b1cf6a0 | /InstagramClone/InstagramClone/AddPhotoView/PhotoSelectorCell.swift | f46439c4e6c7f9e7ec1874e432ec604132ab994a | [] | no_license | vfa-cuongtt/InstagramClone | a3b4b28052645167483be724f2ee958765327acc | 942e51f95d13edaac7bd643e9d875864f7b70d8c | refs/heads/master | 2022-12-03T05:57:30.840105 | 2020-08-18T21:59:34 | 2020-08-18T21:59:34 | 268,577,088 | 1 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 880 | swift | //
// PhotoSelectorCell.swift
// InstagramClone
//
// Created by vfa on 6/24/20.
// Copyright © 2020 Tuan Cuong. All rights reserved.
//
import UIKit
class PhotoSelectorCell: UICollectionViewCell {
let photoImageView: UIImageView = {
let iv = UIImageView()
iv.backgroundColor = .lightGray
iv.contentMode = .scaleAspectFill
iv.clipsToBounds = true
return iv
}()
override init(frame: CGRect) {
super.init(frame: frame)
addSubview(photoImageView)
UIView.anchor(uiv: photoImageView, top: topAnchor, bottom: bottomAnchor, left: leftAnchor, right: rightAnchor, paddingTop: 0, paddingBottom: 0, paddingLeft: 0, paddingRight: 0, width: 0, height: 0)
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
| [
-1
] |
15c20bf598d1d9dde9d97f474455e830c9225064 | 8e7a13ac7c4d7cb3150bc3388ae6870c3f777f15 | /mojo_test/Views/ChatRequestInputTextView.swift | cda938b17733beac4584a3c9792e0b0ac8a83b28 | [] | no_license | mojodating/mojoapp-ios | 00b9e342b5ac86d8b3cec1c68e492febfade4abe | bb491481e83e45249c3289a7ad23cbdf68c5d24a | refs/heads/master | 2022-01-10T09:11:31.731840 | 2019-05-03T16:02:04 | 2019-05-03T16:02:04 | 159,722,179 | 0 | 1 | null | null | null | null | UTF-8 | Swift | false | false | 1,267 | swift | //
// MarketPlaceInputTextView.swift
// mojo_test
//
// Created by Yunyun Chen on 1/29/19.
// Copyright © 2019 Yunyun Chen. All rights reserved.
//
import UIKit
class ChatRequestInputTextView: UITextView {
fileprivate let placeholderLabel: UILabel = {
let label = UILabel()
label.text = "Add a message - show you like them! "
label.textColor = .lightGray
return label
}()
func showPlaceHolderLabel() {
placeholderLabel.isHidden = false
}
override init(frame: CGRect, textContainer: NSTextContainer?) {
super.init(frame: frame, textContainer: textContainer)
NotificationCenter.default.addObserver(self, selector: #selector(handleTextChange), name: UITextView.textDidChangeNotification , object: nil)
addSubview(placeholderLabel)
placeholderLabel.anchor(top: topAnchor, leading: leadingAnchor, bottom: bottomAnchor, trailing: trailingAnchor, padding: .init(top: 12, left: 12, bottom: 0, right: 0))
}
@objc fileprivate func handleTextChange() {
placeholderLabel.isHidden = !self.text.isEmpty
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
| [
-1
] |
0edca26605cf7d747fa0bf4364d87adbaf507090 | a59f0ae2b897fab19a673215a945d88118f18145 | /shopping list/Shopping List/Shopping List/ListViewController.swift | 9f457ec6a330df9826198d55dfb25d74d351e575 | [] | no_license | bold99/swift | 51a372f3bedfc724d2a3ae645313b29141a5c99d | 1d26e32cdeb00f4c305c5a9fb135a11e7da62661 | refs/heads/master | 2020-03-17T08:10:22.631544 | 2018-05-15T19:56:45 | 2018-05-15T19:56:45 | 133,427,080 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 3,139 | swift | //
// ListViewController.swift
// Shopping List
//
// Created by Bold Chuluunbaatar on 5/15/18.
// Copyright © 2018 Bold Chuluunbaatar. All rights reserved.
//
import UIKit
class ListViewController: UITableViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Uncomment the following line to preserve selection between presentations
// self.clearsSelectionOnViewWillAppear = false
// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
// self.navigationItem.rightBarButtonItem = self.editButtonItem()
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
// MARK: - Table view data source
override func numberOfSections(in tableView: UITableView) -> Int {
// #warning Incomplete implementation, return the number of sections
return 0
}
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
// #warning Incomplete implementation, return the number of rows
return 0
}
/*
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "reuseIdentifier", for: indexPath)
// Configure the cell...
return cell
}
*/
/*
// Override to support conditional editing of the table view.
override func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool {
// Return false if you do not want the specified item to be editable.
return true
}
*/
/*
// Override to support editing the table view.
override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) {
if editingStyle == .delete {
// Delete the row from the data source
tableView.deleteRows(at: [indexPath], with: .fade)
} else if editingStyle == .insert {
// Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
}
}
*/
/*
// Override to support rearranging the table view.
override func tableView(_ tableView: UITableView, moveRowAt fromIndexPath: IndexPath, to: IndexPath) {
}
*/
/*
// Override to support conditional rearranging of the table view.
override func tableView(_ tableView: UITableView, canMoveRowAt indexPath: IndexPath) -> Bool {
// Return false if you do not want the item to be re-orderable.
return true
}
*/
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destinationViewController.
// Pass the selected object to the new view controller.
}
*/
}
| [
294401,
253315,
278662,
302858,
374286,
312591,
374289,
336148,
319773,
248990,
279327,
332323,
227493,
282918,
287271,
292141,
281139,
281140,
316725,
303542,
125110,
343225,
292155,
285243,
288190,
290167,
277184,
176710,
283462,
283465,
322635,
302924,
180690,
207957,
310741,
357080,
357084,
253309,
167390,
312673,
307041,
340709,
357093,
357094,
295784,
340712,
292333,
292334,
290158,
228206,
292337,
290162,
125175,
213880,
294525,
124670
] |
c2e4e1a84fab24508857c577885bd1105d920f8b | c328b9dfed17485ce2c5d2ed9040126c721947a7 | /Pods/Instructions/Sources/Protocols/Public/CoachMarkBodyHighlightArrowDelegate.swift | 3d144257269eed31ae403a301ae018e38284a98a | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | SandcastleApps/partyup | 16e0c913e6c73525e10f7b531e71aa6655321cf1 | 02d5301f969e9fc4ad66c80f734c19a493b47470 | refs/heads/master | 2020-07-03T14:14:53.319546 | 2016-12-08T22:43:00 | 2016-12-08T22:43:00 | 74,166,128 | 6 | 2 | null | null | null | null | UTF-8 | Swift | false | false | 1,692 | swift | // CoachMarkBodyHighlightArrowDelegate.swift
//
// Copyright (c) 2015, 2016 Frédéric Maquin <[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
/// Delegate the hilight mecanism of the arrow. This protocol is
/// useful in case the whole body itself is the active control and
/// we want the arrow to looks like it is part of this control.
public protocol CoachMarkBodyHighlightArrowDelegate : class {
/// Set wethe ror not the arrow should get in its
/// highlighted state.
///
/// - Parameters highlighted: `true` if the arrow should be highlighted, `false` otherwise.
func highlightArrow(highlighted: Bool)
}
| [
244480,
54678,
312478,
312479,
54692,
98347,
23469,
185264,
23473,
23474,
23475,
312501,
189622,
189624,
341055,
290126,
290130,
290131,
290135,
141272,
290137,
312412,
157151,
141284,
203755,
244469
] |
fa298fa28948492dfe485948eda8b5f4b1882eee | daded1e477905aa7d62668e8c6f0f8dea46256e8 | /Homesterdam/Listing/Presenter/ListingPresenter.swift | a3166fbaee7e2cfe6760d48a87ef3db5f5e84565 | [] | no_license | rajeevcbhatia/Homesterdam | ee0f7afc74dc20e31e940a1c5ef879c848097a17 | b655485a675ef50f2a5fc4c84f8d83f7a9424de3 | refs/heads/master | 2020-05-29T17:29:39.929616 | 2019-06-03T10:22:08 | 2019-06-03T10:22:08 | 189,279,134 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 2,090 | swift | //
// ListingPresenter.swift
// Homesterdam
//
// Created by Rajeev Bhatia on 30/05/19.
// Copyright © 2019 rajeev. All rights reserved.
//
import Foundation
class ListingPresenter: ListingPresentable {
var currentPageNumber = 1
private var hasTuin = false
internal let listingService: ListingService
weak private var listingView: ListingView?
required init(listingService: ListingService) {
self.listingService = listingService
}
var shouldNotifyOnScrollToEnd = true
func attach(view: ListingView) {
listingView = view
listingView?.showLoader()
fetchNextPage()
}
func didScrollToLastRows() {
fetchNextPage()
}
func toggleTuinAction(isOn: Bool) {
hasTuin = isOn
currentPageNumber = 1
listingView?.clearListings()
listingView?.showLoader()
fetchNextPage()
}
func viewMakelaarsAction() {
listingView?.showMakelaars()
}
private func fetchNextPage() {
shouldNotifyOnScrollToEnd = false
listingService.fetchListings(pageNumber: currentPageNumber, hasTuin: hasTuin) { [weak self] (result) in
self?.listingView?.hideLoader()
guard let response = try? result.get() else {
self?.showAlertWithRetry()
self?.shouldNotifyOnScrollToEnd = true
return
}
let listings = response.listings
if let _ = response.paging.volgendeURL {
self?.currentPageNumber += 1
}
self?.shouldNotifyOnScrollToEnd = response.paging.volgendeURL != nil
self?.listingView?.add(listings: listings)
}
}
private func showAlertWithRetry() {
listingView?.showRetryAlert(title: "Alert", message: "Could not fetch data. Please try again", callback: { [weak self] in
self?.listingView?.showLoader()
self?.fetchNextPage()
})
}
}
| [
-1
] |
eafdcef7b7775f8e21209cae609a9c485e6f6e84 | 575a883f70159e953958ea6d46a225f153d5247b | /Sources/AsyncNinja/EventSource_Merge2Unrelated.swift | 6527604d3f6539a7c052c4c690389ea39860536c | [
"MIT"
] | permissive | AsyncNinja/AsyncNinja | 3c5928bfcaff24c4d7aeefff7f0872338bfd4673 | 12887fc0a02425aebb177becfd63c54dbc69356d | refs/heads/master | 2021-10-13T06:43:47.091073 | 2021-10-03T20:19:53 | 2021-10-03T20:19:53 | 65,158,825 | 163 | 18 | MIT | 2021-01-05T23:03:44 | 2016-08-07T23:29:44 | Swift | UTF-8 | Swift | false | false | 4,781 | swift | //
// Copyright (c) 2016-2017 Anton Mironov
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom
// the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//
import Dispatch
/// Merges channels with completely unrelated types into one
public func merge<LeftSource: EventSource, RightSource: EventSource>(
_ leftSource: LeftSource,
_ rightSource: RightSource,
cancellationToken: CancellationToken? = nil,
bufferSize: DerivedChannelBufferSize = .default
) -> Channel<Either<LeftSource.Update, RightSource.Update>, (LeftSource.Success, RightSource.Success)> {
// Test: EventSource_Merge2Tests.testMergeIntsAndStrings
typealias DestinationUpdate = Either<LeftSource.Update, RightSource.Update>
typealias ResultungSuccess = (LeftSource.Success, RightSource.Success)
typealias Destination = Producer<DestinationUpdate, ResultungSuccess>
let producer = Destination(bufferSize: bufferSize.bufferSize(leftSource, rightSource))
cancellationToken?.add(cancellable: producer)
let helper = Merge2UnrelatesEventSourcesHelper<LeftSource, RightSource, Destination>(destination: producer)
producer._asyncNinja_retainHandlerUntilFinalization(helper.makeHandler(leftSource: leftSource))
producer._asyncNinja_retainHandlerUntilFinalization(helper.makeHandler(rightSource: rightSource))
return producer
}
/// **internal use only**
/// Encapsulates merging behavior
private class Merge2UnrelatesEventSourcesHelper<
LeftSource: EventSource, RightSource: EventSource, Destination: EventDestination> where
Destination.Update == Either<LeftSource.Update, RightSource.Update>,
Destination.Success == (LeftSource.Success, RightSource.Success) {
var locking = makeLocking()
var leftSuccess: LeftSource.Success?
var rightSuccess: RightSource.Success?
weak var destination: Destination?
init(destination: Destination) {
self.destination = destination
}
func makeHandlerBlock<Update, Success>(
updateHandler: @escaping (_ update: Update, _ originalExecutor: Executor) -> Void,
successHandler: @escaping (_ success: Success) -> (LeftSource.Success, RightSource.Success)?
) -> (_ event: ChannelEvent<Update, Success>, _ originalExecutor: Executor) -> Void {
// `self` is being captured but it is okay
// because it does not retain valuable resources
return { (event, originalExecutor) in
switch event {
case let .update(update):
updateHandler(update, originalExecutor)
case let .completion(.failure(error)):
self.destination?.fail(error, from: originalExecutor)
case let .completion(.success(localSuccess)):
self.locking.lock()
defer { self.locking.unlock() }
if let success = successHandler(localSuccess) {
self.destination?.succeed(success, from: originalExecutor)
}
}
}
}
func makeHandler(leftSource: LeftSource) -> AnyObject? {
func handleUpdate(update: LeftSource.Update, originalExecutor: Executor) {
self.destination?.update(.left(update), from: originalExecutor)
}
let handlerBlock = makeHandlerBlock(updateHandler: handleUpdate) { (success: LeftSource.Success) in
self.leftSuccess = success
return self.rightSuccess.map { (success, $0) }
}
return leftSource.makeHandler(executor: .immediate, handlerBlock)
}
func makeHandler(rightSource: RightSource) -> AnyObject? {
func handleUpdate(update: RightSource.Update, originalExecutor: Executor) {
self.destination?.update(.right(update), from: originalExecutor)
}
let handlerBlock = makeHandlerBlock(updateHandler: handleUpdate) { (success: RightSource.Success) in
self.rightSuccess = success
return self.leftSuccess.map { ($0, success) }
}
return rightSource.makeHandler(executor: .immediate, handlerBlock)
}
}
| [
-1
] |
07f41dc146b9d5e14fcde2407fd47f37af911167 | af8affb262f89c6f6ce95437b1097fa699101aa8 | /CardDIY/CardDIY/Main/Home/View/SHMagicTypeView.swift | 849504b156e9f8f22865e66dfe40270b814b4589 | [] | no_license | Shvier/CardDIY | e77b1092329b6611d141919752f862bdd12263f3 | 2fa078f8e1b7c91083b30c6d1b9d2feaf1464262 | refs/heads/master | 2020-12-02T22:49:56.601229 | 2018-05-04T11:01:58 | 2018-05-04T11:01:58 | 96,186,093 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 5,180 | swift | //
// SHMagicTypeView.swift
// CardDIY
//
// Created by shvier on 04/07/2017.
// Copyright © 2017 Shvier. All rights reserved.
//
import UIKit
class SHMagicTypeView: SHBaseView {
let buttonMargin: CGFloat = 10
let buttonLength: CGFloat = 30
let buttonCorner: CGFloat = 15
lazy var buttons: [UIButton] = {
return Array<UIButton>()
}()
var infButton: UIButton?
var thunderButton: UIButton?
var crossButton: UIButton?
var compassButton: UIButton?
var fireButton: UIButton?
weak var delegate: SHYGOMagicTypeViewDelegate?
func unselectButton(exclude: UIButton) {
for button in buttons {
if button.isEqual(exclude) {
button.isSelected = true
} else {
button.isSelected = false
}
}
}
@objc func buttonAction(sender: UIButton) {
delegate?.magicTypeView(magicTypeView: self, buttonClicked: sender)
}
func initUI() {
infButton = ({
let button = UIButton(type: .custom)
button.setImage(UIImage(named: "inf_normal"), for: .normal)
button.setImage(UIImage(named: "inf_selected"), for: .selected)
button.layer.masksToBounds = true
button.layer.cornerRadius = buttonCorner
button.addTarget(self, action: #selector(self.buttonAction(sender:)), for: .touchUpInside)
return button
})()
addSubview(infButton!)
buttons.append(infButton!)
thunderButton = ({
let button = UIButton(type: .custom)
button.setImage(UIImage(named: "thunder_normal"), for: .normal)
button.setImage(UIImage(named: "thunder_selected"), for: .selected)
button.layer.masksToBounds = true
button.layer.cornerRadius = buttonCorner
button.addTarget(self, action: #selector(self.buttonAction(sender:)), for: .touchUpInside)
return button
})()
addSubview(thunderButton!)
buttons.append(thunderButton!)
crossButton = ({
let button = UIButton(type: .custom)
button.setImage(UIImage(named: "cross_normal"), for: .normal)
button.setImage(UIImage(named: "cross_selected"), for: .selected)
button.layer.masksToBounds = true
button.layer.cornerRadius = buttonCorner
button.addTarget(self, action: #selector(self.buttonAction(sender:)), for: .touchUpInside)
return button
})()
addSubview(crossButton!)
buttons.append(crossButton!)
compassButton = ({
let button = UIButton(type: .custom)
button.setImage(UIImage(named: "compass_normal"), for: .normal)
button.setImage(UIImage(named: "compass_selected"), for: .selected)
button.layer.masksToBounds = true
button.layer.cornerRadius = buttonCorner
button.addTarget(self, action: #selector(self.buttonAction(sender:)), for: .touchUpInside)
return button
})()
addSubview(compassButton!)
buttons.append(compassButton!)
fireButton = ({
let button = UIButton(type: .custom)
button.setImage(UIImage(named: "fire_normal"), for: .normal)
button.setImage(UIImage(named: "fire_selected"), for: .selected)
button.layer.masksToBounds = true
button.layer.cornerRadius = buttonCorner
button.addTarget(self, action: #selector(self.buttonAction(sender:)), for: .touchUpInside)
return button
})()
addSubview(fireButton!)
buttons.append(fireButton!)
}
func makeConstraints() {
infButton?.snp.makeConstraints({ (make) in
make.left.top.bottom.equalTo(self)
make.width.height.equalTo(buttonLength)
})
thunderButton?.snp.makeConstraints({ (make) in
make.left.equalTo((infButton?.snp.right)!).offset(buttonMargin)
make.top.bottom.equalTo(infButton!)
make.width.equalTo(buttonLength)
})
crossButton?.snp.makeConstraints({ (make) in
make.left.equalTo((thunderButton?.snp.right)!).offset(buttonMargin)
make.top.bottom.equalTo(infButton!)
make.width.equalTo(buttonLength)
})
compassButton?.snp.makeConstraints({ (make) in
make.left.equalTo((crossButton?.snp.right)!).offset(buttonMargin)
make.top.bottom.equalTo(infButton!)
make.width.equalTo(buttonLength)
})
fireButton?.snp.makeConstraints({ (make) in
make.left.equalTo((compassButton?.snp.right)!).offset(buttonMargin)
make.top.bottom.equalTo(infButton!)
make.width.equalTo(buttonLength)
make.right.equalTo(self)
})
}
override init(frame: CGRect) {
super.init(frame: frame)
initUI()
makeConstraints()
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
}
| [
-1
] |
063046d3ce7dc2f1fa16641a46f70f5001b6202e | 347113587490b90e5b58395aa2b3a8616992e1d8 | /BookMyChef/AppDelegate.swift | c778624dfb079a339fe35347e41306a1d2db79b5 | [] | no_license | hash678/BookMyChef | 6a4c7dd47fd0ca0e8251b4fd5cfb8a90ea0922c2 | 97734fdfea0a2598cb911471b2fa38ea963c9e7e | refs/heads/master | 2020-09-13T03:45:23.792665 | 2019-12-29T13:07:31 | 2019-12-29T13:07:31 | 222,647,234 | 1 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 2,291 | swift | //
// AppDelegate.swift
// BookMyChef
//
// Created by Hassan Abbasi on 07/11/2019.
// Copyright © 2019 Rove. All rights reserved.
//
import UIKit
import Firebase
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate,UNUserNotificationCenterDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
//MAPS API KEY
//AIzaSyCXZTD1-k5bxnLKlaALi5LDsHIht1E_xYo
// Override point for customization after application launch.
FirebaseApp.configure()
UIViewController.swizzlePresent()
if #available(iOS 10.0, *) {
// For iOS 10 display notification (sent via APNS)
UNUserNotificationCenter.current().delegate = self
let authOptions: UNAuthorizationOptions = [.alert, .badge, .sound]
UNUserNotificationCenter.current().requestAuthorization(
options: authOptions,
completionHandler: {_, _ in })
} else {
let settings: UIUserNotificationSettings =
UIUserNotificationSettings(types: [.alert, .badge, .sound], categories: nil)
application.registerUserNotificationSettings(settings)
}
application.registerForRemoteNotifications()
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.
}
}
| [
334098
] |
f0473ed89ea7187b889b870f81a042914da77741 | 43b8f5320790d8d9e4a228247e0ea34226ff2b32 | /social/classes/User_Data.swift | 573367cae18cfd938331bb537a7e5cf0ee39c781 | [] | no_license | Roman7799/swift-social | 63f0f19202704a3cc5e99246bce00340db8101b0 | aad8a98428f09be74ae825e7964aaa6a022e896a | refs/heads/master | 2022-08-15T01:18:35.573538 | 2019-10-17T09:42:31 | 2019-10-17T09:42:31 | 195,408,734 | 0 | 0 | null | 2022-07-22T03:32:33 | 2019-07-05T12:50:43 | HTML | UTF-8 | Swift | false | false | 874 | swift | //
// User_Data.swift
// social
//
// Created by Denis Vesnin on 7/26/19.
// Copyright © 2019 Geolance. All rights reserved.
//
import UIKit
class User_Data{
var id = String()
var avatar_url = String()
var avatar = UIImage()
var avatar_is_cached = false
var cover_url = String()
var cover = UIImage()
var cover_is_cached = false
var first_name = String()
var last_name = String()
var fullname = String()
var biography = String()
var allow_friends = String()
var allow_follow = String()
var is_followed = false
var is_friend_requested = false
var frindship_status = 0 // 0 - default, not interacted
// 1 - request SENT BY this user
// 2 - request RECIEVED by this user
// 3 - this user is a friend
}
| [
-1
] |
3ec18e2bdec673c112e4f5d5f730db251dc44bf3 | e18aba7906f9438287a2b7090596b5c51c532929 | /UberByElgendy/Features/TripSearch/Enums/TimeOption.swift | dcdd21992ad1faeec88d6a79c632185a798a4c48 | [] | no_license | ahmedelgendy/UberByElgendy | 692386cdf72c46bd3c339fc40765d3cddbfe695b | 6ea27d5d0e2f88ce5ac8c29044a6f18e2c533211 | refs/heads/master | 2020-12-29T07:59:30.725577 | 2020-02-05T19:14:02 | 2020-02-05T19:14:02 | 238,525,162 | 1 | 0 | null | 2020-02-05T19:14:04 | 2020-02-05T18:57:05 | Swift | UTF-8 | Swift | false | false | 641 | swift | //
// TimeOption.swift
// Uber
//
// Created by Elgendy on 3.01.2020.
// Copyright © 2020 Ahmed Elgendy. All rights reserved.
//
import Foundation
enum TimeOption: Int, CaseIterable {
case any = 0, under5min, between5And10min, between10And20min, moreThan20min
var title: String {
switch self {
case .any:
return "Any"
case .under5min:
return "Under 5 min"
case .between5And10min:
return "5 to 10 min"
case .between10And20min:
return "10 to 20 min"
case .moreThan20min:
return "More than 20 min"
}
}
}
| [
-1
] |
59a7252fc04285a5a70d740e61b69412fde3a8d6 | e6783be2a02d9f923e59ff8c05899a38d611076c | /Sources/Dummy/Child710.swift | 3ee64f991717c3cd057613ab6ecdf21a663e0ea4 | [] | no_license | Fryie/Sourcekitten-Bug | cf16f783857bd28b30f1091fc26fa01a47dd47ee | 4ae309b9ecce913e5522ed1cc3a950289159f614 | refs/heads/master | 2020-03-30T10:02:43.401433 | 2019-09-16T16:36:14 | 2019-09-16T16:45:37 | 151,103,426 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 24 | swift | class Child710: Base {}
| [
-1
] |
80891706c08fa6dc09b3245a21c15e674312e84d | 2ab5af438ee000672c03907af5f5d3c51534455d | /TestProject/TestProject/AppDelegate.swift | 5a3265ce1990513191378ddb06a5075df217590e | [] | no_license | will1858/test-proj | 2243b463f057c05659f07a4aff0f106ec6b39167 | 3146c67e1d8124f6ca66de011161b9c7947f0809 | refs/heads/master | 2020-03-24T21:45:55.663695 | 2018-07-31T18:31:06 | 2018-07-31T18:31:06 | 143,048,960 | 0 | 0 | null | 2018-07-31T18:31:07 | 2018-07-31T17:58:10 | null | UTF-8 | Swift | false | false | 2,175 | swift | //
// AppDelegate.swift
// TestProject
//
// Created by Agodu, Will on 7/31/18.
// Copyright © 2018 Agodu, Will. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}
func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
}
| [
229380,
229383,
229385,
278539,
294924,
229388,
278542,
229391,
327695,
278545,
229394,
278548,
229397,
229399,
229402,
352284,
229405,
278556,
278559,
229408,
278564,
294950,
229415,
229417,
327722,
237613,
229422,
360496,
229426,
237618,
229428,
311349,
286774,
286776,
319544,
286778,
229432,
204856,
352318,
286791,
237640,
286797,
278605,
311375,
163920,
237646,
196692,
319573,
311383,
278623,
278626,
319590,
311400,
278635,
303212,
278639,
131192,
278648,
237693,
303230,
327814,
303241,
131209,
417930,
303244,
311436,
319633,
286873,
286876,
311460,
311469,
32944,
327862,
286906,
327866,
180413,
286910,
131264,
286916,
295110,
286922,
286924,
286926,
319694,
286928,
131281,
278743,
278747,
295133,
155872,
319716,
237807,
303345,
286962,
131314,
229622,
327930,
278781,
278783,
278785,
237826,
319751,
278792,
286987,
319757,
311569,
286999,
319770,
287003,
287006,
287009,
287012,
287014,
287016,
287019,
311598,
287023,
262448,
311601,
295220,
287032,
155966,
319809,
319810,
278849,
319814,
311623,
319818,
311628,
229709,
319822,
287054,
278865,
229717,
196963,
196969,
139638,
213367,
106872,
319872,
311683,
319879,
311693,
65943,
319898,
311719,
278952,
139689,
278957,
311728,
278967,
180668,
311741,
278975,
319938,
278980,
98756,
278983,
319945,
278986,
319947,
278990,
278994,
311767,
279003,
279006,
188895,
172512,
287202,
279010,
279015,
172520,
319978,
279020,
172526,
311791,
279023,
172529,
279027,
319989,
172534,
180727,
164343,
279035,
311804,
287230,
279040,
303617,
287234,
279045,
172550,
303623,
172552,
287238,
320007,
279051,
172558,
279055,
303632,
279058,
303637,
279063,
279067,
172572,
279072,
172577,
295459,
172581,
295461,
279082,
311850,
279084,
172591,
172598,
279095,
172607,
172609,
172612,
377413,
172614,
172618,
303690,
33357,
287309,
303696,
279124,
172634,
262752,
254563,
172644,
311911,
189034,
295533,
172655,
172656,
352880,
295538,
189039,
172660,
287349,
189040,
189044,
287355,
287360,
295553,
172675,
295557,
287365,
311942,
303751,
352905,
279178,
287371,
311946,
311951,
287377,
172691,
287381,
311957,
221850,
287386,
230045,
172702,
164509,
303773,
172705,
287394,
172707,
303780,
287390,
287398,
205479,
279208,
287400,
172714,
295595,
279212,
189102,
172721,
287409,
66227,
303797,
189114,
287419,
303804,
328381,
287423,
328384,
172737,
279231,
287427,
312005,
312006,
107208,
172748,
287436,
107212,
172751,
287440,
295633,
172755,
303827,
279255,
172760,
287450,
303835,
279258,
189149,
303838,
213724,
312035,
279267,
295654,
279272,
230128,
312048,
312050,
230131,
189169,
205564,
303871,
230146,
328453,
295685,
230154,
33548,
312077,
295695,
295701,
230169,
369433,
295707,
328476,
295710,
230175,
295720,
303914,
279340,
205613,
279353,
230202,
312124,
328508,
222018,
295755,
377676,
148302,
287569,
303959,
230237,
279390,
230241,
279394,
303976,
336744,
303985,
328563,
303987,
279413,
303991,
303997,
295806,
295808,
295813,
304005,
320391,
213895,
304007,
304009,
304011,
230284,
304013,
295822,
279438,
189325,
189329,
295825,
304019,
213902,
189331,
58262,
304023,
304027,
279452,
410526,
279461,
279462,
304042,
213931,
230327,
304055,
287675,
230334,
304063,
238528,
304065,
213954,
189378,
156612,
295873,
213963,
197580,
312272,
304084,
304090,
320481,
304106,
320490,
312302,
328687,
320496,
304114,
295928,
320505,
312321,
295945,
230413,
295949,
197645,
320528,
140312,
295961,
238620,
197663,
304164,
304170,
304175,
238641,
312374,
238652,
238655,
230465,
238658,
336964,
296004,
205895,
320584,
238666,
296021,
402518,
336987,
230497,
296036,
296040,
361576,
205931,
296044,
279661,
205934,
164973,
312432,
279669,
337018,
189562,
279679,
304258,
279683,
222340,
66690,
205968,
296084,
238745,
304285,
238756,
205991,
222377,
165035,
337067,
238766,
165038,
230576,
238770,
304311,
230592,
312518,
279750,
230600,
230607,
148690,
320727,
279769,
304348,
279777,
304354,
296163,
320740,
279781,
304360,
320748,
279788,
279790,
304370,
296189,
320771,
312585,
296202,
296205,
230674,
320786,
230677,
296213,
296215,
320792,
230681,
230679,
214294,
304416,
230689,
173350,
312622,
296243,
312630,
222522,
296253,
222525,
296255,
312639,
230718,
296259,
378181,
296262,
230727,
238919,
296264,
320840,
296267,
296271,
222545,
230739,
312663,
222556,
337244,
230752,
312676,
230760,
173418,
148843,
410987,
230763,
230768,
296305,
312692,
230773,
304505,
304506,
181626,
279929,
181631,
148865,
312711,
312712,
296331,
288140,
288144,
230800,
304533,
337306,
288154,
288160,
173472,
288162,
288164,
279975,
304555,
370092,
279983,
173488,
288176,
279985,
312755,
296373,
312759,
279991,
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,
296446,
321022,
402942,
148990,
296450,
206336,
230916,
230919,
214535,
230923,
304651,
304653,
370187,
402969,
230940,
222752,
108066,
296486,
296488,
157229,
239152,
230961,
157236,
288320,
288325,
124489,
280140,
280145,
288338,
280149,
288344,
280152,
239194,
280158,
403039,
370272,
181854,
239202,
370279,
312938,
280183,
280185,
280188,
280191,
116354,
280194,
280208,
280211,
288408,
280218,
280222,
419489,
190118,
198310,
321195,
296622,
321200,
337585,
296626,
296634,
296637,
419522,
313027,
280260,
419525,
206536,
280264,
206539,
206541,
206543,
263888,
313044,
280276,
321239,
280283,
313052,
18140,
288478,
313055,
419555,
321252,
313066,
288494,
280302,
280304,
313073,
321266,
288499,
419570,
288502,
280314,
288510,
124671,
67330,
280324,
198405,
288519,
280331,
198416,
280337,
296723,
116503,
321304,
329498,
296731,
321311,
313121,
313123,
304932,
321316,
280363,
141101,
165678,
280375,
321336,
296767,
288576,
345921,
280388,
337732,
304968,
280393,
280402,
173907,
313171,
313176,
42842,
280419,
321381,
296809,
296812,
313201,
1920,
255873,
305028,
280454,
247688,
280464,
124817,
280468,
239510,
280473,
124827,
214940,
247709,
214944,
280487,
313258,
321458,
296883,
124853,
214966,
296890,
10170,
288700,
296894,
190403,
296900,
280515,
337862,
165831,
280521,
231379,
296921,
354265,
354270,
239586,
313320,
354281,
231404,
124913,
165876,
321528,
239612,
313340,
288764,
239617,
313347,
288773,
313358,
305176,
321560,
313371,
354338,
305191,
223273,
313386,
354348,
124978,
215090,
124980,
288824,
288826,
321595,
378941,
313406,
288831,
288836,
67654,
280651,
354382,
288848,
280658,
215123,
354390,
288855,
288859,
280669,
313438,
149599,
280671,
149601,
321634,
149603,
223327,
329830,
280681,
313451,
223341,
280687,
149618,
215154,
313458,
280691,
313464,
329850,
321659,
280702,
288895,
321670,
215175,
141446,
141455,
141459,
280725,
313498,
100520,
288936,
280747,
288940,
288947,
280755,
321717,
280759,
280764,
280769,
280771,
280774,
280776,
313548,
321740,
280783,
280786,
280788,
313557,
280793,
280796,
280798,
338147,
280804,
280807,
157930,
280811,
280817,
125171,
157940,
280819,
182517,
280823,
280825,
280827,
280830,
280831,
280833,
125187,
280835,
125191,
125207,
125209,
321817,
125218,
321842,
223539,
125239,
280888,
280891,
289087,
280897,
280900,
305480,
239944,
280906,
239947,
305485,
305489,
379218,
280919,
248153,
215387,
354653,
313700,
280937,
313705,
190832,
280946,
223606,
313720,
280956,
239997,
280959,
313731,
199051,
240011,
289166,
240017,
297363,
190868,
240021,
297365,
297368,
297372,
141725,
297377,
289186,
297391,
289201,
240052,
289207,
289210,
305594,
281024,
289218,
289221,
289227,
436684,
281045,
281047,
215526,
166378,
305647,
281075,
174580,
240124,
281084,
305662,
305664,
240129,
305666,
305668,
223749,
330244,
281095,
223752,
150025,
338440,
240132,
223757,
281102,
223763,
223765,
281113,
322074,
281116,
281121,
182819,
281127,
281135,
150066,
158262,
158266,
289342,
281154,
322115,
158283,
281163,
281179,
338528,
338532,
281190,
199273,
281196,
19053,
158317,
313973,
297594,
281210,
158347,
264845,
182926,
133776,
182929,
314003,
117398,
314007,
289436,
174754,
330404,
289448,
133801,
174764,
314029,
314033,
240309,
133817,
314045,
314047,
314051,
199364,
297671,
158409,
256716,
289493,
363234,
289513,
289522,
289525,
289532,
322303,
289537,
322310,
264969,
322314,
322318,
281361,
281372,
322341,
215850,
281388,
289593,
281401,
289601,
281410,
281413,
281414,
240458,
281420,
240468,
281430,
322393,
297818,
281435,
281438,
281442,
174955,
224110,
207733,
207737,
158596,
183172,
240519,
322440,
314249,
338823,
183184,
142226,
289687,
224151,
240535,
297883,
289694,
289696,
289700,
289712,
281529,
289724,
52163,
183260,
420829,
281567,
289762,
322534,
297961,
183277,
281581,
322550,
134142,
322563,
314372,
330764,
175134,
322599,
322610,
314421,
281654,
314427,
314433,
207937,
314441,
207949,
322642,
314456,
281691,
314461,
281702,
281704,
314474,
281708,
281711,
289912,
248995,
306341,
306344,
306347,
322734,
306354,
142531,
199877,
289991,
306377,
289997,
249045,
363742,
363745,
298216,
330988,
126190,
216303,
322801,
388350,
257302,
363802,
199976,
199978,
314671,
298292,
298294,
257334,
216376,
380226,
298306,
224584,
224587,
224594,
216404,
306517,
150870,
314714,
224603,
159068,
314718,
265568,
314723,
281960,
150890,
306539,
314732,
314736,
290161,
216436,
306549,
298358,
314743,
306552,
290171,
314747,
298365,
290174,
306555,
224641,
281987,
298372,
314756,
281990,
224647,
265604,
298377,
314763,
142733,
298381,
314768,
224657,
306581,
314773,
314779,
314785,
314793,
282025,
282027,
241068,
241070,
241072,
282034,
241077,
150966,
298424,
306618,
282044,
323015,
306635,
306640,
290263,
290270,
290275,
339431,
282089,
191985,
282098,
290291,
282101,
241142,
191992,
290298,
151036,
290302,
282111,
290305,
175621,
306694,
192008,
323084,
257550,
282127,
290321,
282130,
323090,
290325,
282133,
241175,
290328,
282137,
290332,
241181,
282142,
282144,
290344,
306731,
290349,
290351,
290356,
282186,
224849,
282195,
282199,
282201,
306778,
159324,
159330,
314979,
298598,
323176,
224875,
241260,
323181,
257658,
315016,
282249,
290445,
282255,
282261,
175770,
298651,
282269,
323229,
298655,
323231,
61092,
282277,
306856,
196133,
282295,
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,
118593,
307009,
413506,
307012,
241475,
148946,
315211,
282446,
307027,
315221,
323414,
315223,
241496,
241498,
307035,
307040,
110433,
282465,
241509,
110438,
298860,
110445,
282478,
315249,
110450,
315251,
282481,
315253,
315255,
339838,
315267,
282499,
315269,
241544,
282505,
241546,
241548,
298896,
298898,
282514,
241556,
44948,
298901,
241560,
282520,
241563,
241565,
241567,
241569,
282531,
241574,
282537,
298922,
36779,
241581,
282542,
241583,
323504,
241586,
282547,
241588,
290739,
241590,
241592,
241598,
290751,
241600,
241605,
151495,
241610,
298975,
241632,
298984,
241640,
241643,
298988,
241646,
241649,
241652,
323574,
290807,
299003,
241661,
299006,
282623,
315396,
241669,
315397,
282632,
282639,
290835,
282645,
241693,
282654,
241701,
102438,
217127,
282669,
323630,
282681,
290877,
282687,
159811,
315463,
315466,
192589,
307278,
192596,
176213,
307287,
307290,
217179,
315482,
192605,
315483,
233567,
299105,
200801,
217188,
299109,
307303,
315495,
356457,
45163,
307307,
315502,
192624,
307314,
323700,
299126,
233591,
299136,
307329,
307338,
233613,
241813,
307352,
299164,
241821,
299167,
315552,
184479,
184481,
315557,
184486,
307370,
307372,
184492,
307374,
307376,
299185,
323763,
184503,
176311,
299191,
307385,
307386,
307388,
258235,
307390,
176316,
299200,
184512,
307394,
299204,
307396,
184518,
307399,
323784,
233679,
307409,
307411,
176343,
299225,
233701,
307432,
184572,
282881,
184579,
282893,
291089,
282906,
291104,
233766,
295583,
176435,
307508,
315701,
332086,
307510,
307512,
168245,
307515,
307518,
282942,
282947,
323917,
110926,
282957,
233808,
323921,
315733,
323926,
233815,
276052,
315739,
323932,
299357,
242018,
242024,
299373,
315757,
250231,
242043,
315771,
299388,
299391,
291202,
299398,
242057,
291212,
299405,
291222,
315801,
283033,
242075,
291226,
194654,
61855,
291231,
283042,
291238,
291241,
127403,
127405,
291247,
299440,
127407,
299444,
127413,
283062,
291254,
127417,
291260,
283069,
127421,
127424,
299457,
127429,
127431,
127434,
315856,
176592,
315860,
176597,
283095,
127447,
299481,
176605,
242143,
127457,
291299,
340454,
127463,
242152,
291305,
127466,
176620,
127469,
127474,
291314,
291317,
127480,
135672,
291323,
233979,
127485,
291330,
283142,
127494,
127497,
233994,
135689,
127500,
291341,
233998,
127506,
234003,
234006,
127511,
152087,
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,
299684,
135844,
242343,
209576,
242345,
373421,
135870,
135873,
135876,
135879,
299720,
299723,
299726,
225998,
226002,
119509,
226005,
226008,
299740,
242396,
201444,
299750,
283368,
234219,
283372,
185074,
226037,
283382,
316151,
234231,
234236,
226045,
242431,
234239,
209665,
234242,
299778,
242436,
226053,
234246,
226056,
234248,
291593,
242443,
234252,
242445,
234254,
291601,
234258,
242450,
242452,
234261,
348950,
201496,
234264,
234266,
234269,
283421,
234272,
234274,
152355,
299814,
234278,
283432,
234281,
234284,
234287,
283440,
185138,
242483,
234292,
234296,
234298,
160572,
283452,
234302,
234307,
242499,
234309,
292433,
316233,
234313,
316235,
234316,
283468,
234319,
242511,
234321,
234324,
185173,
201557,
234329,
234333,
308063,
234336,
242530,
349027,
234338,
234341,
234344,
234347,
177004,
234350,
324464,
234353,
152435,
177011,
234356,
234358,
234362,
226171,
291711,
234368,
291714,
234370,
291716,
234373,
201603,
226182,
234375,
308105,
226185,
234379,
324490,
234384,
234388,
234390,
324504,
234393,
209818,
308123,
324508,
234396,
291742,
226200,
234398,
234401,
291747,
291748,
234405,
291750,
234407,
324520,
324518,
324522,
234410,
291756,
226220,
291754,
324527,
291760,
234417,
201650,
324531,
234414,
234422,
226230,
275384,
324536,
234428,
291773,
242623,
324544,
234431,
234434,
324546,
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,
234487,
324599,
234490,
234493,
316416,
234496,
308226,
234501,
275462,
308231,
234504,
234507,
234510,
234515,
300054,
316439,
234520,
234519,
234523,
234526,
234528,
300066,
234532,
300069,
234535,
234537,
234540,
144430,
234543,
234546,
275508,
300085,
234549,
300088,
234553,
234556,
234558,
316479,
234561,
316483,
160835,
234563,
308291,
234568,
234570,
316491,
234572,
300108,
234574,
300115,
234580,
234581,
242777,
234585,
275545,
234590,
234593,
234595,
234597,
300133,
234601,
300139,
234605,
160879,
234607,
275569,
234610,
316530,
300148,
234614,
398455,
144506,
234618,
234620,
275579,
234623,
226433,
234627,
275588,
234629,
242822,
234634,
234636,
177293,
234640,
275602,
234643,
308373,
226453,
234647,
275606,
275608,
234650,
324757,
308379,
300189,
324766,
119967,
234653,
234648,
283805,
234657,
242852,
300197,
234661,
283813,
234664,
324768,
275626,
234667,
177318,
316596,
308414,
234687,
300226,
308418,
234692,
300229,
308420,
308422,
226500,
283844,
300234,
283850,
300238,
300241,
316625,
300243,
300245,
316630,
300248,
300253,
300256,
300258,
300260,
234726,
300263,
300265,
300267,
161003,
300270,
300272,
120053,
300278,
275703,
316663,
300284,
275710,
300287,
292097,
300289,
161027,
300292,
300294,
275719,
234760,
177419,
300299,
242957,
300301,
283917,
177424,
349451,
275725,
349464,
415009,
283939,
259367,
292143,
283951,
300344,
226617,
243003,
283963,
226628,
300357,
283973,
177482,
283983,
316758,
357722,
316766,
292192,
316768,
218464,
292197,
316774,
243046,
218473,
284010,
136562,
324978,
275834,
333178,
275836,
275840,
316803,
316806,
226696,
316811,
226699,
316814,
226703,
300433,
234899,
300436,
226709,
357783,
316824,
316826,
144796,
300448,
144807,
144810,
144812,
284076,
144814,
144820,
374196,
284084,
292279,
284087,
144826,
144828,
144830,
144832,
144835,
144837,
38342,
144839,
144841,
144844,
144847,
144852,
144855,
103899,
300507,
333280,
226787,
218597,
292329,
300523,
259565,
300527,
308720,
259567,
292338,
226802,
227440,
316917,
308727,
292343,
300537,
316933,
316947,
308757,
308762,
284191,
316959,
284194,
284196,
235045,
284199,
284204,
284206,
284209,
284211,
194101,
284213,
316983,
194103,
284215,
308790,
284218,
226877,
292414,
284223,
284226,
284228,
292421,
226886,
284231,
128584,
243268,
284234,
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,
284278,
292470,
276086,
292473,
284283,
276093,
284286,
276095,
284288,
292481,
284290,
325250,
284292,
292485,
292479,
276098,
284297,
317066,
284299,
317068,
284301,
276109,
284303,
284306,
276114,
284308,
284312,
284314,
284316,
276127,
284320,
284322,
284327,
284329,
317098,
284331,
276137,
284333,
284335,
276144,
284337,
284339,
300726,
284343,
284346,
284350,
276160,
358080,
284354,
358083,
284358,
276166,
358089,
284362,
276170,
284365,
276175,
284368,
276177,
284370,
358098,
284372,
317138,
284377,
276187,
284379,
284381,
284384,
358114,
284386,
358116,
276197,
317158,
358119,
284392,
325353,
358122,
284394,
284397,
358126,
284399,
358128,
276206,
358133,
358135,
276216,
358138,
300795,
358140,
284413,
358142,
358146,
317187,
284418,
317189,
317191,
284428,
300816,
300819,
317207,
284440,
300828,
300830,
276255,
300832,
325408,
300834,
317221,
227109,
358183,
186151,
276268,
300845,
243504,
300850,
284469,
276280,
325436,
358206,
276291,
366406,
276295,
300872,
292681,
153417,
358224,
284499,
276308,
284502,
317271,
178006,
276315,
292700,
317279,
284511,
227175,
292715,
300912,
292721,
284529,
300915,
284533,
292729,
317306,
284540,
292734,
325512,
169868,
276365,
317332,
358292,
284564,
399252,
284566,
350106,
284572,
276386,
284579,
276388,
358312,
317353,
284585,
276395,
292776,
292784,
276402,
358326,
161718,
358330,
276410,
276411,
276418,
276425,
301009,
301011,
301013,
292823,
358360,
301017,
301015,
292828,
276446,
153568,
276448,
276452,
292839,
276455,
350186,
292843,
276460,
292845,
276464,
178161,
227314,
276466,
325624,
350200,
276472,
317435,
276476,
276479,
276482,
350210,
276485,
317446,
178181,
276490,
350218,
292876,
350222,
317456,
276496,
317458,
178195,
243733,
243740,
317468,
317472,
325666,
243751,
292904,
276528,
178224,
243762,
309298,
325685,
325689,
235579,
325692,
235581,
178238,
276539,
276544,
243779,
325700,
284739,
292934,
243785,
276553,
350293,
350295,
309337,
194649,
227418,
350302,
227423,
350304,
178273,
309346,
194657,
194660,
350308,
309350,
309348,
292968,
309352,
227426,
276579,
227430,
276583,
309354,
301167,
276590,
350321,
350313,
350316,
284786,
350325,
252022,
276595,
350328,
292985,
301178,
350332,
292989,
301185,
292993,
350339,
317570,
317573,
350342,
350345,
350349,
301199,
317584,
325777,
350354,
350357,
350359,
350362,
350366,
276638,
284837,
153765,
350375,
350379,
350381,
350383,
129200,
350385,
350387,
350389,
350395,
350397,
350399,
227520,
350402,
227522,
301252,
350406,
227529,
301258,
309450,
276685,
309455,
276689,
309462,
301272,
276699,
194780,
309468,
309471,
301283,
317672,
317674,
325867,
243948,
194801,
227571,
309491,
309494,
243960,
276735,
227583,
227587,
276739,
211204,
276742,
227593,
227596,
325910,
309530,
342298,
211232,
317729,
276775,
211241,
325937,
325943,
211260,
260421,
276809,
285002,
276811,
235853,
276816,
235858,
276829,
276833,
391523,
276836,
293227,
276843,
293232,
276848,
186744,
211324,
227709,
285061,
366983,
317833,
178572,
285070,
285077,
178583,
227738,
317853,
276896,
317858,
342434,
285093,
317864,
285098,
276907,
235955,
276917,
293304,
293307,
293314,
309707,
293325,
129486,
317910,
293336,
235996,
317917,
293343,
358880,
276961,
227810,
293346,
276964,
293352,
236013,
293364,
301562,
293370,
317951,
309764,
301575,
121352,
293387,
236043,
342541,
317963,
113167,
55822,
309779,
317971,
309781,
277011,
55837,
227877,
227879,
293417,
227882,
309804,
293421,
105007,
236082,
285236,
23094,
277054,
244288,
219714,
129603,
301636,
318020,
301639,
301643,
277071,
285265,
399955,
309844,
277080,
309849,
285277,
285282,
326244,
318055,
277100,
309871,
121458,
277106,
170618,
170619,
309885,
309888,
277122,
227975,
277128,
285320,
301706,
318092,
326285,
334476,
318094,
277136,
277139,
227992,
334488,
318108,
285340,
318110,
227998,
137889,
383658,
285357,
318128,
277170,
293555,
342707,
154292,
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,
285474,
293666,
228135,
318248,
277291,
318253,
293677,
285489,
301876,
293685,
285494,
301880,
285499,
301884,
310080,
293696,
277317,
277322,
277329,
162643,
310100,
301911,
301913,
277337,
301921,
400236,
236397,
162671,
326514,
310134,
236408,
15224,
277368,
416639,
416640,
113538,
310147,
416648,
39817,
187274,
277385,
301972,
424853,
277405,
277411,
310179,
293798,
293802,
236460,
277426,
293811,
293817,
293820,
203715,
326603,
342994,
276586,
293849,
293861,
228327,
228328,
318442,
228330,
228332,
326638,
277486,
351217,
318450,
293876,
293877,
285686,
302073,
121850,
293882,
302075,
285690,
244731,
293887,
277504,
277507,
277511,
293899,
277519,
293908,
302105,
293917,
293939,
318516,
277561,
277564,
310336,
7232,
293956,
277573,
228422,
293960,
310344,
277577,
277583,
203857,
293971,
310355,
310359,
236632,
277594,
138332,
277598,
203872,
277601,
285792,
310374,
203879,
310376,
228460,
318573,
203886,
187509,
285815,
367737,
285817,
302205,
285821,
392326,
285831,
253064,
294026,
302218,
285835,
162964,
384148,
187542,
302231,
285849,
302233,
285852,
302237,
285854,
285856,
302241,
285862,
277671,
302248,
64682,
277678,
294063,
294065,
302258,
277687,
294072,
318651,
294076,
277695,
318657,
244930,
302275,
130244,
302277,
228550,
302282,
310476,
302285,
302288,
310481,
302290,
203987,
302292,
302294,
310486,
302296,
384222,
310498,
285927,
318698,
302315,
195822,
228592,
294132,
138485,
228601,
204026,
228606,
204031,
64768,
310531,
285958,
138505,
228617,
318742,
204067,
277798,
130345,
277801,
113964,
285997,
384302,
285999,
277804,
113969,
277807,
277811,
318773,
318776,
277816,
286010,
277819,
294204,
417086,
277822,
286016,
302403,
294211,
384328,
277832,
277836,
294221,
146765,
294223,
326991,
277839,
277842,
277847,
277850,
179547,
277853,
146784,
277857,
302436,
277860,
294246,
327015,
310632,
327017,
351594,
277864,
277869,
277872,
351607,
310648,
277880,
310651,
277884,
277888,
310657,
351619,
294276,
310659,
327046,
277892,
253320,
310665,
318858,
277894,
277898,
277903,
310672,
351633,
277905,
277908,
277917,
310689,
277921,
130468,
228776,
277928,
277932,
310703,
277937,
310710,
130486,
310712,
277944,
310715,
277947,
302526,
228799,
277950,
277953,
302534,
310727,
64966,
245191,
163272,
277959,
277963,
302541,
277966,
302543,
310737,
277971,
228825,
163290,
277978,
310749,
277981,
277984,
310755,
277989,
277991,
187880,
277995,
310764,
286188,
278000,
228851,
310772,
278003,
278006,
40440,
212472,
278009,
40443,
286203,
310780,
40448,
228864,
286214,
228871,
302603,
65038,
302614,
286233,
302617,
302621,
286240,
146977,
187936,
187939,
40484,
294435,
40486,
286246,
294440,
40488,
294439,
294443,
40491,
294445,
278057,
310831,
245288,
286248,
40499,
40502,
212538,
40507,
40511,
40513,
228933,
327240,
40521,
286283,
40525,
40527,
212560,
400976,
228944,
40533,
147032,
40537,
40539,
40541,
278109,
40544,
40548,
40550,
40552,
286313,
40554,
286312,
310892,
40557,
40560,
188022,
122488,
294521,
343679,
294537,
310925,
286354,
278163,
302740,
122517,
278168,
179870,
327333,
229030,
212648,
278188,
302764,
278192,
319153,
278196,
302781,
319171,
302789,
294599,
278216,
294601,
302793,
343757,
212690,
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,
237470,
319390,
40865,
319394,
294817,
294821,
311209,
180142,
343983,
294831,
188340,
40886,
319419,
294844,
294847,
393177,
294876,
294879,
294883,
393190,
294890,
311279,
278513,
237555,
278516,
311283,
278519,
237562
] |
58d01f0d90b2a560fcae5d2feee3567314f3cffb | c63ba09841d7a3e0579be21be22ba75690aa09f9 | /Note/Cells/ImageCell.swift | 2d8b61b6f0f599c76fc5648118b2d024dc837c37 | [] | no_license | AlexandrPotapov/Note | 9b07d335e27b0545cac78db809396b398c43a8ec | 851ea38dc4248a31568666b1e3a4f354dadd8393 | refs/heads/master | 2023-04-20T20:48:50.383381 | 2021-05-04T18:42:05 | 2021-05-04T18:42:05 | 351,055,118 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 108 | swift | import UIKit
class ImageCell: UICollectionViewCell {
@IBOutlet weak var imageView: UIImageView!
}
| [
310295
] |
fee7c54b4225704c50864d70a9c281d6058c3f3c | 7c514bf24edde07696e28e53044087497cc0c150 | /SpriteKitSimpleGameUITests/SpriteKitSimpleGameUITests.swift | c72f83919f72a4108729446ede3b2c0f5e655f53 | [] | no_license | adriannsaa/PigTales | 3ab2c2a862492fa5b0ba5d9e16d56e26dccfd5ba | eccec8339796e05bc18b9768fc54b4a8c9081bf6 | refs/heads/master | 2021-01-25T04:41:47.119674 | 2017-06-23T17:36:18 | 2017-06-23T17:36:18 | 93,467,397 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,292 | swift | //
// SpriteKitSimpleGameUITests.swift
// SpriteKitSimpleGameUITests
//
// Created by Adrian Nuñez Saa on 25/5/17.
// Copyright © 2017 Adrian Nuñez Saa. All rights reserved.
//
import XCTest
class SpriteKitSimpleGameUITests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
// In UI tests it is usually best to stop immediately when a failure occurs.
continueAfterFailure = false
// UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method.
XCUIApplication().launch()
// In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}
func testExample() {
// Use recording to get started writing UI tests.
// Use XCTAssert and related functions to verify your tests produce the correct results.
}
}
| [
155665,
237599,
229414,
278571,
229425,
180279,
229431,
319543,
213051,
286787,
237638,
311373,
196687,
278607,
311377,
368732,
180317,
278637,
319599,
278642,
131190,
131199,
278669,
278676,
327834,
278684,
278690,
311459,
278698,
278703,
278707,
278713,
180409,
295099,
139459,
131270,
229591,
147679,
311520,
147680,
295147,
286957,
319764,
278805,
311582,
278817,
311596,
336177,
98611,
278843,
287040,
319812,
311622,
229716,
278895,
287089,
139641,
311679,
311692,
106893,
156069,
311723,
377265,
311739,
319931,
278974,
336319,
311744,
278979,
336323,
278988,
278992,
279000,
279009,
369121,
279014,
319976,
279017,
311787,
319986,
279030,
311800,
279033,
279042,
287237,
377352,
279053,
303634,
303635,
279060,
279061,
279066,
188954,
279092,
377419,
303693,
115287,
189016,
287319,
295518,
287327,
279143,
279150,
287345,
287348,
189054,
303743,
287359,
164487,
311944,
279176,
344714,
311948,
311950,
311953,
287379,
336531,
295575,
303772,
205469,
221853,
279207,
295591,
295598,
279215,
279218,
164532,
287412,
287418,
303802,
66243,
287434,
287438,
164561,
303826,
279249,
369365,
369366,
279253,
230105,
295653,
230120,
279278,
312046,
230133,
279293,
205566,
295688,
312076,
295698,
221980,
336678,
262952,
279337,
262957,
164655,
328495,
303921,
230198,
295745,
222017,
279379,
295769,
230238,
230239,
279393,
303973,
279398,
295797,
295799,
279418,
336765,
287623,
279434,
320394,
189327,
189349,
279465,
304050,
189373,
345030,
213961,
279499,
304086,
304104,
123880,
320492,
320495,
287730,
312313,
214009,
312315,
312317,
328701,
328705,
418819,
320520,
230411,
320526,
238611,
140311,
238617,
197658,
336930,
189487,
312372,
238646,
238650,
320571,
336962,
238663,
296023,
205911,
156763,
214116,
230500,
279659,
279666,
312435,
230514,
238706,
279686,
222344,
337037,
296091,
238764,
148674,
312519,
279752,
148687,
189651,
279766,
189656,
279775,
304352,
304353,
279780,
279789,
279803,
320769,
312588,
320795,
320802,
304422,
312628,
345398,
222523,
279872,
181568,
279874,
304457,
230730,
345418,
337228,
296269,
222542,
238928,
296274,
230757,
296304,
312688,
230772,
337280,
296328,
296330,
304523,
9618,
279955,
148899,
279979,
279980,
279988,
173492,
280003,
370122,
280011,
337359,
329168,
312785,
222674,
329170,
280020,
280025,
239069,
320997,
280042,
280043,
329198,
337391,
296434,
288248,
288252,
312830,
230922,
304655,
329231,
230933,
222754,
312879,
230960,
288305,
239159,
157246,
288319,
288322,
280131,
124486,
288328,
239192,
99937,
312937,
312941,
206447,
288377,
337533,
280193,
239238,
288391,
239251,
280217,
198304,
337590,
296636,
280252,
280253,
321217,
280259,
321220,
296649,
239305,
280266,
9935,
313042,
280279,
18139,
280285,
321250,
337638,
181992,
288492,
34547,
67316,
313082,
288508,
288515,
280326,
116491,
280333,
124691,
116502,
321308,
321309,
280373,
280377,
321338,
280381,
345918,
280391,
280396,
18263,
370526,
296807,
296815,
313200,
313204,
124795,
280451,
305032,
67464,
124816,
337816,
214936,
124826,
239515,
214943,
313257,
288698,
214978,
280517,
280518,
214983,
231382,
329696,
190437,
313322,
329707,
174058,
296942,
124912,
239610,
313338,
182277,
313356,
305173,
223269,
354342,
354346,
313388,
124974,
215095,
288829,
288835,
313415,
239689,
354386,
329812,
223317,
321632,
280676,
313446,
215144,
288878,
288890,
215165,
329884,
215204,
125108,
280761,
223418,
280767,
338118,
280779,
321744,
280792,
280803,
338151,
125166,
125170,
395511,
313595,
125180,
125184,
125192,
338196,
125204,
338217,
125225,
321839,
280903,
289109,
379224,
239973,
280938,
321901,
354671,
199030,
223611,
248188,
313726,
240003,
158087,
313736,
240020,
190870,
190872,
289185,
305572,
289195,
338359,
289229,
281038,
281039,
281071,
322057,
182802,
322077,
289328,
338491,
322119,
281165,
281170,
281200,
313970,
297600,
289435,
314020,
248494,
166581,
314043,
363212,
158424,
322269,
338658,
289511,
330473,
330476,
289517,
215790,
125683,
199415,
289534,
322302,
35584,
322312,
346889,
264971,
322320,
166677,
207639,
281378,
289580,
281407,
289599,
281426,
281434,
322396,
281444,
207735,
314240,
158594,
330627,
240517,
289691,
240543,
289699,
289704,
289720,
289723,
281541,
19398,
191445,
183254,
207839,
314343,
183276,
289773,
248815,
240631,
330759,
330766,
281647,
322609,
314437,
207954,
339031,
314458,
281698,
281699,
322664,
314493,
347286,
330912,
339106,
306339,
249003,
208044,
322733,
3243,
339131,
290001,
339167,
298209,
290030,
208123,
322826,
126229,
298290,
208179,
159033,
216387,
372039,
224591,
331091,
314708,
150868,
314711,
314721,
281958,
314727,
134504,
306541,
314734,
314740,
314742,
224637,
306558,
314759,
298378,
314765,
314771,
306580,
224662,
314776,
282008,
282013,
290206,
314788,
298406,
314790,
282023,
241067,
314797,
306630,
306634,
339403,
191980,
282097,
306678,
191991,
290304,
323079,
323083,
323088,
282132,
282135,
175640,
290359,
323132,
282182,
224848,
224852,
290391,
306777,
323171,
282214,
224874,
314997,
290425,
339579,
282244,
282248,
323226,
282272,
282279,
298664,
298666,
306875,
282302,
323262,
323265,
282309,
306891,
241360,
282321,
241366,
282330,
282336,
12009,
282347,
282349,
323315,
200444,
282366,
249606,
282375,
323335,
282379,
216844,
118549,
282390,
282399,
241440,
282401,
339746,
315172,
216868,
241447,
282418,
282424,
282428,
413500,
315209,
159563,
307024,
241494,
307030,
307038,
282471,
282476,
339840,
315265,
282503,
315272,
315275,
184207,
282517,
298912,
118693,
298921,
126896,
200628,
282572,
282573,
323554,
298987,
282634,
241695,
315431,
102441,
315433,
102446,
282671,
241717,
307269,
315468,
233548,
315477,
200795,
323678,
315488,
315489,
45154,
233578,
217194,
307306,
241809,
323730,
299166,
233635,
299176,
184489,
323761,
184498,
258233,
299197,
299202,
176325,
299208,
282832,
356575,
307431,
184574,
217352,
315674,
282908,
299294,
282912,
233761,
282920,
315698,
332084,
282938,
168251,
127292,
323914,
201037,
250196,
168280,
323934,
381286,
242027,
242028,
250227,
315768,
315769,
291194,
291193,
291200,
242059,
315798,
291225,
242079,
283039,
299449,
291266,
283088,
283089,
242138,
176602,
160224,
291297,
242150,
283138,
233987,
324098,
340489,
283154,
291359,
283185,
234037,
340539,
234044,
332379,
111197,
242274,
291455,
316044,
184974,
316048,
316050,
340645,
176810,
299698,
291529,
225996,
135888,
242385,
299737,
234216,
234233,
242428,
291584,
299777,
291591,
283418,
234276,
283431,
234290,
201534,
283466,
201562,
234330,
275294,
349025,
357219,
177002,
308075,
242540,
242542,
201590,
177018,
308093,
291713,
340865,
299912,
316299,
234382,
308111,
308113,
209820,
283551,
177074,
127945,
340960,
234469,
340967,
324587,
234476,
201721,
234499,
316441,
300087,
21567,
308288,
160834,
349254,
300109,
234578,
250965,
250982,
300145,
300147,
234626,
234635,
177297,
308375,
324761,
119965,
234655,
300192,
234662,
300200,
324790,
300215,
283841,
283846,
283849,
316628,
251124,
234741,
316661,
283894,
292092,
234756,
242955,
177420,
292145,
300342,
333114,
333115,
193858,
300354,
300355,
234830,
283990,
357720,
300378,
300379,
292194,
284015,
234864,
316786,
243073,
292242,
112019,
234902,
333224,
284086,
259513,
284090,
54719,
415170,
292291,
300488,
300490,
234957,
144862,
300526,
308722,
300539,
210429,
292359,
218632,
316951,
374297,
235069,
349764,
194118,
292424,
292426,
333389,
349780,
235096,
128600,
300643,
300645,
243306,
325246,
333438,
235136,
317102,
300729,
333508,
333522,
325345,
153318,
333543,
284410,
284425,
300810,
300812,
284430,
161553,
284436,
325403,
341791,
325411,
186148,
186149,
333609,
284460,
300849,
325444,
153416,
325449,
317268,
325460,
341846,
284508,
300893,
284515,
276326,
292713,
292719,
325491,
333687,
317305,
317308,
333700,
325508,
243590,
243592,
325514,
350091,
350092,
350102,
333727,
333734,
219046,
284584,
292783,
300983,
153553,
292835,
6116,
292838,
317416,
325620,
333827,
243720,
292901,
325675,
243763,
325695,
333902,
194667,
284789,
284790,
194692,
235661,
333968,
153752,
284827,
333990,
284840,
284843,
227517,
309443,
227525,
301255,
227536,
301270,
301271,
325857,
334049,
317676,
309504,
194832,
227601,
325904,
211239,
334121,
317738,
325930,
227655,
383309,
391521,
285031,
416103,
227702,
211327,
227721,
227730,
285074,
293275,
285083,
317851,
227743,
293281,
285089,
301482,
375211,
334259,
293309,
317889,
326083,
129484,
326093,
285152,
195044,
334315,
236020,
293368,
317949,
342537,
309770,
334345,
342560,
227881,
293420,
236080,
23093,
244279,
244280,
301635,
309831,
55880,
301647,
326229,
244311,
309847,
244326,
301688,
244345,
301702,
334473,
326288,
227991,
285348,
318127,
285360,
293552,
342705,
285362,
154295,
342757,
285419,
170735,
342775,
375552,
228099,
285443,
285450,
326413,
285457,
285467,
326428,
318247,
293673,
318251,
301872,
285493,
285496,
301883,
342846,
293702,
244569,
301919,
293729,
351078,
310132,
228214,
269179,
228232,
416649,
252812,
293780,
310166,
310177,
293801,
326571,
326580,
326586,
359365,
211913,
56270,
203758,
293894,
293911,
326684,
113710,
318515,
203829,
285795,
228457,
318571,
187508,
302202,
285819,
285823,
285833,
318602,
285834,
228492,
162962,
187539,
326803,
285850,
302239,
302251,
294069,
294075,
64699,
228541,
343230,
310496,
228587,
302319,
228608,
318732,
245018,
318746,
130342,
130344,
130347,
286012,
294210,
294220,
318804,
294236,
327023,
327030,
310650,
179586,
294278,
368012,
318860,
318876,
343457,
245160,
286128,
286133,
310714,
302523,
228796,
302530,
228804,
310731,
302539,
327122,
310747,
286176,
187877,
310758,
40439,
286201,
359931,
245249,
228868,
302602,
294413,
359949,
302613,
302620,
245291,
310853,
286281,
196184,
212574,
204386,
204394,
138862,
310896,
294517,
286344,
179853,
286351,
188049,
229011,
179868,
229021,
302751,
245413,
212649,
286387,
286392,
302778,
286400,
212684,
302798,
286419,
294621,
294629,
286457,
286463,
319232,
278292,
278294,
294699,
286507,
319289,
237397,
188250,
237411,
327556,
188293,
311183,
294806,
294808,
319393,
294820,
294824,
343993,
98240,
294849,
24531,
294887,
278507,
311277,
327666
] |
856ae97d70bd9461774ec44be87977809ccd1346 | 523a488fff3a31a7ab310c521234f5795f50e399 | /MoviesApp/MoviesApp/Delegates/FilterTableDelegate.swift | 93b3bbd267585ecdd733d9d588b53a4c9926cd1c | [] | no_license | cs-nicholas-babo/ios-recruiting-brazil | 4b0b1e9190486357ff4ce6ae4152a7f88d032e95 | 6ac36b5a883e22dd9297d2d5c59b68389f74a234 | refs/heads/master | 2020-12-28T13:44:11.558768 | 2018-11-25T20:36:37 | 2018-11-25T20:36:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 677 | swift | //
// FilterTableDelegate.swift
// MoviesApp
//
// Created by Nicholas Babo on 23/11/18.
// Copyright © 2018 Nicholas Babo. All rights reserved.
//
import UIKit
class FilterTableDelegate: NSObject {
weak var tableView:UITableView?
weak var dataSource:UITableViewDataSource?
override init() {
super.init()
}
}
extension FilterTableDelegate: UITableViewDelegate{
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 50
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView(frame: .zero)
}
}
| [
-1
] |
c801f3107fed750f3c6af6cde241896b42e528e2 | 83cad669cf6028213ed318e503ee348f62d0c029 | /Sources/PiuPiu/Extensions/URL+Extensions.swift | 98e7af11ff7cdb919d85ffe3e5f44747828e4e22 | [
"Apache-2.0",
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | cuba/PiuPiu | 6abf231a58507f5b8894c2559aac7ee6e5177060 | 214f9991147491fba6e7400e8e075d2a90e168ed | refs/heads/master | 2022-06-26T09:26:07.570145 | 2022-06-17T21:52:15 | 2022-06-17T21:52:15 | 181,377,310 | 4 | 0 | MIT | 2020-11-13T03:21:41 | 2019-04-14T22:39:55 | Swift | UTF-8 | Swift | false | false | 3,589 | swift | //
// URL+Extensions.swift
// PiuPiu iOS
//
// Created by Jacob Sikorski on 2019-07-12.
// Copyright © 2019 Jacob Sikorski. All rights reserved.
//
import Foundation
// MARK: - Testing Extensions
public extension URL {
static var temporaryDirectory: URL {
return URL(fileURLWithPath: NSTemporaryDirectory(), isDirectory: true)
}
/// Returns values extracted from the path. The path must match exactly.
///
/// - Parameter pattern: The pattern to match which must be exactly the same.
/// - Returns: The matched path values. Any incosistency will return nil. The size of the array will always be the number of wildcards passed.
func pathValues(matching pattern: [PathComponent]) -> [PathValue]? {
let pathStringComponents = path.components(separatedBy: "/").filter({ !$0.isEmpty })
// Check the counts are the same
guard pattern.count == pathStringComponents.count else { return nil }
var values: [PathValue] = []
for (index, pathComponent) in pattern.enumerated() {
switch pathComponent {
case .constant(let value):
guard value == pathStringComponents[index] else { return nil }
values.append(.string(pathStringComponents[index]))
case .wildcard(let type):
switch type {
case .integer:
guard let value = Int(pathStringComponents[index]) else { return nil }
values.append(.integer(value))
case .string:
values.append(.string(pathStringComponents[index]))
}
}
}
return values
}
/// Returns true if the path mathes the given pattern.
///
/// - Parameter pattern: The pattern to match
/// - Returns: true if the path mathes the given pattern.
func pathMatches(pattern: [PathComponent]) -> Bool {
return pathValues(matching: pattern) != nil
}
/// Returns an integer value from the extracted path values (`PathValue`) at the given index.
///
/// - Parameters:
/// - index: The index of the extracted value. Needs to be within the bounds of the pattern or the application will crash.
/// - pattern: The pattern used to extract the values
/// - Returns: An integer value if found in the exact position of the extracted pattern.
func integerValue(atIndex index: Int, matching pattern: [PathComponent]) -> Int? {
if let pathValues = pathValues(matching: pattern) {
switch pathValues[index] {
case .integer(let value):
return value
default:
return nil
}
} else {
return nil
}
}
/// Returns an string value from the extracted path values (`PathValue`) at the given index.
///
/// - Parameters:
/// - index: The index of the extracted value. Needs to be within the bounds of the pattern or the application will crash.
/// - pattern: The pattern used to extract the values
/// - Returns: An integer value if found in the exact position of the extracted pattern.
func stringValue(atIndex index: Int, matching pattern: [PathComponent]) -> String? {
if let pathValues = pathValues(matching: pattern) {
switch pathValues[index] {
case .string(let value):
return value
default:
return nil
}
} else {
return nil
}
}
}
| [
-1
] |
340f785da9656d5b534a609fa86a3ab559c9a4c9 | f204319a35dc216d64fa31e0b64c88f5c007bf67 | /Coin Man/Coin Man/AppDelegate.swift | ab93dbceb176d9763f39c3ce7b004b5e08dbe139 | [] | no_license | Shadman-aziz/coin-man | 0982204aa8a8a2ffdd9c1a134641f2f80772a4d4 | c6e445a52489c205369402c95ede73eb773a2c49 | refs/heads/master | 2020-03-29T04:48:18.292213 | 2018-09-20T04:07:34 | 2018-09-20T04:07:34 | 149,549,232 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 2,072 | swift | //
// AppDelegate.swift
// Coin Man
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}
func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
}
| [
229380,
229383,
229385,
278539,
294924,
229388,
278542,
229391,
327695,
278545,
229394,
278548,
229397,
229399,
229402,
352284,
229405,
278556,
278559,
229408,
278564,
294950,
229415,
229417,
327722,
237613,
229422,
360496,
229426,
237618,
229428,
311349,
286774,
286776,
319544,
286778,
204856,
229432,
352318,
286791,
237640,
286797,
278605,
311375,
163920,
237646,
196692,
319573,
311383,
278623,
278626,
319590,
311400,
278635,
303212,
278639,
131192,
278648,
237693,
303230,
327814,
303241,
131209,
417930,
303244,
311436,
319633,
286873,
286876,
311460,
311469,
32944,
327862,
286906,
327866,
180413,
286910,
131264,
286916,
286922,
286924,
286926,
319694,
286928,
131281,
278743,
278747,
295133,
155872,
319716,
237807,
303345,
286962,
303347,
131314,
229622,
327930,
278781,
278783,
278785,
237826,
319751,
278792,
286987,
319757,
311569,
286999,
319770,
287003,
287006,
287009,
287012,
287014,
287016,
287019,
311598,
287023,
262448,
311601,
295220,
287032,
155966,
319809,
319810,
278849,
319814,
311623,
319818,
311628,
229709,
319822,
287054,
278865,
229717,
196963,
196969,
139638,
213367,
106872,
319872,
311683,
319879,
311693,
65943,
319898,
311719,
278952,
139689,
278957,
311728,
278967,
180668,
311741,
278975,
319938,
278980,
98756,
278983,
319945,
278986,
319947,
278990,
278994,
311767,
279003,
279006,
188895,
172512,
287202,
279010,
279015,
172520,
319978,
279020,
172526,
311791,
279023,
172529,
279027,
319989,
172534,
180727,
164343,
279035,
311804,
287230,
279040,
303617,
287234,
279045,
172550,
303623,
172552,
320007,
287238,
279051,
172558,
279055,
303632,
279058,
303637,
279063,
279067,
172572,
279072,
172577,
295459,
172581,
295461,
279082,
311850,
279084,
172591,
172598,
279095,
172607,
172609,
172612,
377413,
172614,
213575,
172618,
303690,
33357,
287309,
303696,
279124,
172634,
262752,
254563,
172644,
311911,
189034,
295533,
172655,
172656,
352880,
295538,
189039,
172660,
287349,
189040,
189044,
287355,
287360,
295553,
172675,
295557,
311942,
303751,
287365,
352905,
311946,
279178,
287371,
311951,
287377,
172691,
287381,
311957,
221850,
287386,
230045,
172702,
287390,
303773,
172705,
287394,
172707,
303780,
164509,
287398,
205479,
279208,
287400,
172714,
295595,
279212,
189102,
172721,
287409,
66227,
303797,
189114,
287419,
303804,
328381,
287423,
328384,
172737,
279231,
287427,
312005,
312006,
107208,
172748,
287436,
107212,
172751,
287440,
295633,
172755,
303827,
279255,
172760,
287450,
303835,
279258,
189149,
303838,
213724,
312035,
279267,
295654,
279272,
230128,
312048,
312050,
230131,
189169,
205564,
303871,
230146,
328453,
295685,
230154,
33548,
312077,
295695,
295701,
230169,
369433,
295707,
328476,
295710,
230175,
295720,
303914,
279340,
205613,
279353,
230202,
312124,
328508,
222018,
295755,
377676,
148302,
287569,
303959,
230237,
279390,
230241,
279394,
303976,
336744,
303981,
303985,
303987,
328563,
279413,
303991,
303997,
295806,
295808,
295813,
304005,
320391,
304007,
213895,
304009,
304011,
230284,
304013,
295822,
279438,
189325,
189329,
295825,
304019,
189331,
213902,
58262,
304023,
304027,
279452,
234648,
410526,
279461,
279462,
304042,
213931,
230327,
304055,
287675,
197564,
230334,
304063,
238528,
304065,
213954,
189378,
156612,
295873,
213963,
197580,
312272,
304084,
304090,
320481,
304106,
320490,
312302,
328687,
320496,
304114,
295928,
320505,
312321,
295945,
230413,
295949,
197645,
320528,
140312,
295961,
238620,
197663,
304164,
304170,
304175,
238641,
312374,
238652,
238655,
230465,
238658,
336964,
132165,
296004,
205895,
320584,
238666,
296021,
402518,
336987,
230497,
296036,
296040,
361576,
205931,
296044,
279661,
205934,
164973,
312432,
279669,
337018,
189562,
279679,
304258,
279683,
222340,
66690,
205968,
296084,
238745,
304285,
238756,
205991,
222377,
165035,
337067,
238766,
165038,
230576,
238770,
304311,
230592,
312518,
279750,
230600,
230607,
148690,
320727,
279769,
304348,
279777,
304354,
296163,
320740,
279781,
304360,
320748,
279788,
279790,
304370,
296189,
320771,
312585,
296202,
296205,
230674,
320786,
230677,
296213,
296215,
320792,
230681,
230679,
214294,
304416,
230689,
173350,
312622,
296243,
312630,
222522,
296253,
222525,
296255,
312639,
230718,
296259,
378181,
296262,
230727,
238919,
296264,
320840,
296267,
296271,
222545,
230739,
312663,
222556,
337244,
230752,
312676,
230760,
173418,
148843,
410987,
230763,
230768,
296305,
312692,
230773,
304505,
304506,
181626,
279929,
181631,
148865,
312711,
312712,
296331,
288140,
288144,
230800,
304533,
337306,
288154,
288160,
173472,
288162,
288164,
279975,
304555,
370092,
279983,
173488,
288176,
279985,
312755,
296373,
312759,
337335,
288185,
279991,
222652,
312766,
173507,
296389,
222665,
230860,
312783,
288208,
230865,
288210,
370130,
288212,
222676,
148946,
288214,
239064,
329177,
288217,
280027,
288220,
288218,
239070,
288224,
280034,
288226,
280036,
288229,
280038,
288230,
288232,
370146,
288234,
320998,
288236,
288238,
288240,
288242,
296435,
288244,
288250,
296446,
321022,
402942,
148990,
296450,
206336,
230916,
230919,
214535,
230923,
304651,
304653,
370187,
402969,
230940,
222752,
108066,
296486,
296488,
157229,
230961,
157236,
288320,
288325,
124489,
280140,
280145,
288338,
280149,
288344,
280152,
239194,
280158,
403039,
370272,
181854,
239202,
370279,
312938,
280183,
280185,
280188,
280191,
116354,
280194,
280208,
280211,
288408,
280218,
280222,
419489,
190118,
198310,
321195,
296622,
321200,
337585,
296626,
296634,
296637,
419522,
313027,
280260,
419525,
206536,
280264,
206539,
206541,
206543,
263888,
313044,
280276,
321239,
280283,
313052,
18140,
288478,
313055,
419555,
321252,
313066,
288494,
280302,
280304,
313073,
321266,
419570,
288499,
288502,
280314,
288510,
124671,
67330,
280324,
198405,
288519,
280331,
198416,
280337,
296723,
116503,
321304,
329498,
296731,
321311,
313121,
313123,
304932,
321316,
280363,
141101,
165678,
280375,
321336,
296767,
288576,
345921,
280388,
337732,
304968,
280393,
280402,
173907,
313171,
313176,
42842,
280419,
321381,
296809,
296812,
313201,
1920,
255873,
305028,
280454,
247688,
280464,
124817,
280468,
239510,
280473,
124827,
214940,
247709,
214944,
280487,
313258,
321458,
296883,
124853,
214966,
296890,
10170,
288700,
296894,
190403,
296900,
280515,
337862,
165831,
280521,
231379,
296921,
354265,
354270,
239586,
313320,
354281,
231404,
124913,
165876,
321528,
239612,
313340,
288764,
239617,
313347,
288773,
313358,
305176,
321560,
313371,
354338,
305191,
223273,
313386,
354348,
124978,
215090,
124980,
288824,
288826,
321595,
378941,
313406,
288831,
288836,
67654,
280651,
354382,
288848,
280658,
215123,
354390,
288855,
288859,
280669,
313438,
149599,
280671,
149601,
321634,
149603,
223327,
329830,
280681,
313451,
223341,
280687,
149618,
215154,
313458,
280691,
313464,
329850,
321659,
280702,
288895,
321670,
215175,
141446,
288909,
141455,
141459,
280725,
313498,
100520,
288936,
280747,
288940,
288947,
280755,
321717,
280759,
280764,
280769,
280771,
280774,
280776,
313548,
321740,
280783,
280786,
280788,
313557,
280793,
280796,
280798,
338147,
280804,
280807,
157930,
280811,
280817,
125171,
157940,
280819,
182517,
280823,
280825,
280827,
280830,
280831,
280833,
125187,
280835,
125191,
125207,
125209,
321817,
125218,
321842,
223539,
125239,
280888,
305464,
280891,
289087,
280897,
280900,
305480,
239944,
280906,
239947,
305485,
305489,
379218,
280919,
248153,
215387,
354653,
354656,
313700,
313705,
280937,
190832,
280946,
223606,
313720,
280956,
239997,
280959,
313731,
199051,
240011,
289166,
240017,
297363,
190868,
240021,
297365,
297368,
297372,
141725,
297377,
289186,
297391,
289201,
240052,
289207,
289210,
305594,
281024,
289218,
289221,
289227,
436684,
281045,
281047,
215526,
166378,
305647,
281075,
174580,
240124,
281084,
305662,
305664,
240129,
305666,
305668,
223749,
330244,
281095,
223752,
150025,
338440,
240132,
223757,
281102,
223763,
223765,
281113,
322074,
281116,
281121,
182819,
281127,
281135,
150066,
158262,
158266,
289342,
281154,
322115,
158283,
281163,
281179,
338528,
338532,
281190,
199273,
281196,
19053,
158317,
313973,
297594,
281210,
158347,
264845,
182926,
133776,
182929,
314003,
117398,
314007,
289436,
174754,
330404,
289448,
133801,
174764,
314029,
314033,
240309,
133817,
314045,
314047,
314051,
199364,
297671,
158409,
256716,
289493,
363234,
289513,
289522,
289525,
289532,
322303,
289537,
322310,
264969,
322314,
322318,
281361,
281372,
322341,
215850,
281388,
289593,
281401,
289601,
281410,
281413,
281414,
240458,
281420,
240468,
281430,
322393,
297818,
281435,
281438,
281442,
174955,
224110,
207733,
207737,
158596,
183172,
338823,
322440,
314249,
240519,
183184,
289687,
240535,
224151,
297883,
289694,
289696,
289700,
289712,
281529,
289724,
52163,
183260,
420829,
281567,
289762,
322534,
297961,
183277,
281581,
322550,
134142,
322563,
314372,
330764,
175134,
322599,
322610,
314421,
281654,
314427,
314433,
207937,
314441,
207949,
322642,
314456,
281691,
314461,
281702,
281704,
314474,
281708,
281711,
289912,
248995,
306341,
306344,
306347,
322734,
306354,
142531,
199877,
289991,
306377,
289997,
249045,
363742,
363745,
298216,
330988,
126190,
216303,
322801,
388350,
257302,
363802,
199976,
199978,
314671,
298292,
298294,
257334,
216376,
380226,
298306,
224584,
224587,
224594,
216404,
306517,
150870,
314714,
224603,
159068,
314718,
265568,
314723,
281960,
150890,
306539,
314732,
314736,
290161,
216436,
306549,
298358,
314743,
306552,
290171,
314747,
306555,
298365,
290174,
224641,
281987,
298372,
314756,
281990,
224647,
265604,
298377,
314763,
142733,
298381,
314768,
224657,
306581,
314773,
314779,
314785,
314793,
282025,
282027,
241068,
241070,
241072,
282034,
241077,
150966,
298424,
306618,
282044,
323015,
306635,
306640,
290263,
290270,
290275,
339431,
282089,
191985,
282098,
290291,
282101,
241142,
191992,
290298,
151036,
290302,
282111,
290305,
175621,
306694,
192008,
323084,
257550,
282127,
290321,
282130,
323090,
290325,
282133,
241175,
290328,
282137,
290332,
241181,
282142,
282144,
290344,
306731,
290349,
290351,
290356,
28219,
282186,
224849,
282195,
282199,
282201,
306778,
159324,
159330,
314979,
298598,
323176,
224875,
241260,
323181,
257658,
315016,
282249,
290445,
282255,
282261,
175770,
298651,
282269,
323229,
298655,
323231,
61092,
282277,
306856,
282295,
323260,
282300,
323266,
282310,
323273,
282319,
306897,
241362,
306904,
282328,
298714,
52959,
216801,
282337,
241380,
216806,
323304,
282345,
12011,
282356,
323318,
282364,
282367,
306945,
241412,
323333,
282376,
216842,
323345,
282388,
323349,
282392,
184090,
315167,
315169,
282402,
315174,
323367,
241448,
315176,
241450,
282410,
306988,
306991,
315184,
323376,
315190,
241464,
159545,
282425,
298811,
118593,
307009,
413506,
307012,
241475,
298822,
315211,
282446,
307027,
315221,
323414,
315223,
241496,
241498,
307035,
307040,
110433,
282465,
241509,
110438,
298860,
110445,
282478,
315249,
110450,
315251,
282481,
315253,
315255,
339838,
315267,
282499,
315269,
241544,
282505,
241546,
241548,
298896,
298898,
282514,
241556,
298901,
44948,
241560,
282520,
241563,
241565,
241567,
241569,
282531,
241574,
282537,
298922,
36779,
241581,
282542,
241583,
323504,
241586,
282547,
241588,
290739,
241590,
241592,
241598,
290751,
241600,
241605,
151495,
241610,
298975,
241632,
298984,
241640,
241643,
298988,
241646,
241649,
241652,
323574,
290807,
299003,
241661,
299006,
282623,
315396,
241669,
315397,
282632,
307211,
282639,
290835,
282645,
241693,
282654,
241701,
102438,
217127,
282669,
323630,
282681,
290877,
282687,
159811,
315463,
315466,
192589,
307278,
192596,
176213,
307287,
307290,
217179,
315482,
192605,
315483,
233567,
299105,
200801,
217188,
299109,
307303,
315495,
356457,
45163,
307307,
315502,
192624,
307314,
323700,
299126,
233591,
299136,
307329,
315524,
307338,
233613,
241813,
307352,
299164,
241821,
299167,
315552,
184479,
184481,
315557,
184486,
307370,
307372,
184492,
307374,
307376,
299185,
323763,
184503,
176311,
299191,
307386,
258235,
307388,
307385,
307390,
176316,
299200,
184512,
307394,
299204,
307396,
184518,
307399,
323784,
233679,
307409,
307411,
176343,
299225,
233701,
307432,
184572,
282881,
184579,
282893,
323854,
291089,
282906,
291104,
233766,
295583,
176435,
307508,
315701,
332086,
307510,
307512,
168245,
307515,
307518,
282942,
282947,
323917,
110926,
282957,
233808,
323921,
315733,
323926,
233815,
276052,
315739,
323932,
299357,
242018,
242024,
299373,
315757,
250231,
242043,
315771,
299388,
299391,
291202,
299398,
242057,
291212,
299405,
291222,
315801,
283033,
242075,
291226,
194654,
61855,
291231,
283042,
291238,
291241,
127403,
127405,
291247,
299440,
127407,
299444,
127413,
283062,
291254,
127417,
291260,
283069,
127421,
127424,
299457,
127429,
127431,
127434,
315856,
176592,
127440,
315860,
176597,
127447,
283095,
299481,
127449,
176605,
242143,
127455,
127457,
291299,
340454,
127463,
242152,
291305,
127466,
176620,
127469,
127474,
291314,
291317,
127480,
135672,
291323,
233979,
127485,
291330,
127490,
283142,
127494,
127497,
233994,
135689,
127500,
291341,
233998,
127506,
234003,
127509,
234006,
127511,
152087,
283161,
242202,
234010,
135707,
135710,
242206,
242208,
291361,
242220,
291378,
152118,
234038,
234041,
315961,
70213,
242250,
111193,
242275,
299620,
242279,
168562,
184952,
135805,
135808,
291456,
373383,
299655,
135820,
316051,
225941,
316054,
299672,
135834,
373404,
299677,
225948,
135839,
299680,
225954,
299684,
135844,
242343,
209576,
242345,
373421,
135870,
135873,
135876,
135879,
299720,
299723,
299726,
225998,
226002,
119509,
226005,
226008,
299740,
242396,
201444,
299750,
283368,
234219,
283372,
185074,
226037,
283382,
316151,
234231,
234236,
226045,
242431,
234239,
209665,
234242,
299778,
242436,
226053,
234246,
226056,
234248,
291593,
242443,
234252,
242445,
234254,
291601,
234258,
242450,
242452,
234261,
348950,
201496,
234264,
234266,
234269,
283421,
234272,
234274,
152355,
299814,
234278,
283432,
234281,
234284,
234287,
283440,
185138,
242483,
234292,
234296,
234298,
160572,
283452,
234302,
234307,
242499,
234309,
316233,
234313,
316235,
234316,
283468,
234319,
242511,
234321,
234324,
185173,
201557,
234329,
234333,
308063,
234336,
242530,
349027,
234338,
234341,
234344,
234347,
177004,
234350,
324464,
234353,
152435,
177011,
234356,
234358,
234362,
226171,
234364,
291711,
234368,
291714,
234370,
291716,
234373,
316294,
201603,
226182,
308105,
234375,
226185,
234379,
324490,
234384,
234388,
234390,
324504,
234393,
209818,
308123,
324508,
234396,
291742,
226200,
234398,
234401,
291747,
291748,
234405,
291750,
234407,
324520,
324518,
324522,
234410,
291756,
291754,
226220,
324527,
291760,
234417,
201650,
324531,
234414,
234422,
226230,
324536,
275384,
234428,
291773,
242623,
324544,
234431,
234434,
324546,
324548,
234437,
226245,
234439,
226239,
234443,
291788,
234446,
275406,
193486,
234449,
316370,
193488,
234452,
234455,
234459,
234461,
234464,
234467,
234470,
168935,
5096,
324585,
234475,
234478,
316400,
234481,
316403,
234484,
234485,
234487,
324599,
234490,
234493,
316416,
234496,
308226,
234501,
275462,
308231,
234504,
234507,
234510,
234515,
300054,
316439,
234520,
234519,
234523,
234526,
234528,
300066,
234532,
300069,
234535,
234537,
234540,
144430,
234543,
234546,
275508,
300085,
234549,
300088,
234553,
234556,
234558,
316479,
234561,
316483,
160835,
234563,
308291,
234568,
234570,
316491,
234572,
300108,
234574,
300115,
234580,
234581,
242777,
234585,
275545,
234590,
234593,
234595,
234597,
300133,
234601,
300139,
234605,
160879,
234607,
275569,
234610,
316530,
300148,
234614,
398455,
144506,
234618,
234620,
275579,
234623,
226433,
234627,
275588,
234629,
242822,
234634,
234636,
177293,
234640,
275602,
234643,
308373,
226453,
234647,
275606,
275608,
234650,
308379,
324757,
300189,
324766,
119967,
234653,
324768,
283805,
234657,
242852,
300197,
234661,
283813,
234664,
177318,
275626,
234667,
316596,
308414,
234687,
300223,
300226,
308418,
234692,
300229,
308420,
308422,
283844,
226500,
300234,
283850,
300238,
300241,
316625,
300243,
300245,
316630,
300248,
300253,
300256,
300258,
300260,
234726,
300263,
300265,
300267,
161003,
300270,
300272,
120053,
300278,
275703,
316663,
300284,
275710,
300287,
292097,
300289,
161027,
300292,
300294,
275719,
234760,
177419,
300299,
242957,
300301,
283917,
177424,
349451,
275725,
349464,
415009,
283939,
259367,
292143,
283951,
300344,
226617,
243003,
283963,
226628,
300357,
283973,
177482,
283983,
316758,
357722,
316766,
316768,
292192,
218464,
292197,
316774,
243046,
218473,
284010,
136562,
324978,
275834,
333178,
275836,
275840,
316803,
316806,
226696,
316811,
226699,
316814,
226703,
300433,
234899,
300436,
226709,
357783,
316824,
316826,
144796,
300448,
144807,
144810,
144812,
284076,
144814,
227426,
144820,
374196,
284084,
292279,
284087,
144826,
144828,
144830,
144832,
144835,
284099,
144837,
38342,
144839,
144841,
144844,
144847,
144852,
144855,
103899,
300507,
333280,
226787,
218597,
292329,
300523,
259565,
300527,
308720,
259567,
292338,
226802,
316917,
292343,
308727,
300537,
316933,
316947,
308757,
308762,
284191,
316959,
284194,
284196,
235045,
284199,
284204,
284206,
284209,
284211,
194101,
284213,
316983,
194103,
284215,
308790,
284218,
226877,
292414,
284223,
284226,
284228,
292421,
226886,
284231,
128584,
243268,
284234,
366155,
317004,
276043,
284238,
226895,
284241,
194130,
284243,
300628,
284245,
292433,
284247,
317015,
235097,
243290,
276053,
284249,
284251,
300638,
284253,
284255,
243293,
284258,
292452,
292454,
284263,
177766,
284265,
292458,
284267,
292461,
284272,
284274,
284278,
292470,
276086,
292473,
284283,
276093,
284286,
292479,
284288,
292481,
284290,
325250,
284292,
292485,
325251,
276095,
276098,
284297,
317066,
284299,
317068,
284301,
276109,
284303,
284306,
276114,
284308,
284312,
284314,
284316,
276127,
284320,
284322,
284327,
284329,
317098,
284331,
276137,
284333,
284335,
276144,
284337,
284339,
300726,
284343,
284346,
284350,
358080,
276160,
284354,
358083,
284358,
276166,
358089,
284362,
276170,
284365,
276175,
284368,
276177,
284370,
358098,
284372,
317138,
284377,
276187,
284379,
284381,
284384,
358114,
284386,
358116,
276197,
317158,
358119,
284392,
325353,
358122,
284394,
284397,
358126,
284399,
358128,
276206,
358133,
358135,
276216,
358138,
300795,
358140,
284413,
358142,
358146,
317187,
284418,
317189,
317191,
284428,
300816,
300819,
317207,
284440,
300828,
300830,
276255,
300832,
325408,
300834,
317221,
227109,
358183,
186151,
276268,
300845,
243504,
300850,
284469,
276280,
325436,
358206,
276291,
366406,
276295,
300872,
292681,
153417,
358224,
284499,
276308,
284502,
317271,
178006,
276315,
292700,
317279,
284511,
227175,
292715,
300912,
292721,
284529,
300915,
284533,
292729,
317306,
284540,
292734,
325512,
169868,
276365,
317332,
358292,
284564,
399252,
284566,
350106,
284572,
276386,
284579,
276388,
358312,
317353,
284585,
276395,
292776,
292784,
276402,
358326,
161718,
358330,
276410,
276411,
276418,
276425,
301009,
301011,
301013,
292823,
358360,
301017,
301015,
292828,
276446,
153568,
276448,
276452,
292839,
276455,
350186,
292843,
276460,
276464,
178161,
227314,
276466,
325624,
350200,
276472,
317435,
276476,
276479,
276482,
350210,
276485,
317446,
178181,
276490,
350218,
292876,
350222,
317456,
276496,
317458,
178195,
243733,
243740,
317468,
317472,
325666,
243751,
292904,
276528,
178224,
243762,
309298,
325685,
325689,
235579,
325692,
235581,
178238,
276539,
276544,
243779,
325700,
284739,
292934,
243785,
276553,
350293,
350295,
309337,
194649,
227418,
350299,
350302,
227423,
350304,
178273,
309346,
194657,
194660,
350308,
309350,
309348,
292968,
309352,
309354,
301163,
350313,
350316,
227430,
301167,
276583,
350321,
276590,
284786,
276595,
350325,
252022,
227440,
350328,
292985,
301178,
350332,
292989,
301185,
292993,
350339,
317570,
317573,
350342,
350345,
350349,
301199,
317584,
325777,
350354,
350357,
350359,
350362,
350366,
276638,
284837,
153765,
350375,
350379,
350381,
350383,
129200,
350385,
350387,
350389,
350395,
350397,
350399,
227520,
350402,
227522,
301252,
350406,
227529,
301258,
309450,
276685,
309455,
276689,
309462,
301272,
276699,
194780,
309468,
309471,
301283,
317672,
317674,
325867,
243948,
194801,
309491,
227571,
309494,
243960,
276735,
227583,
227587,
276739,
211204,
276742,
227593,
227596,
325910,
309530,
342298,
211232,
317729,
276775,
211241,
325937,
325943,
211260,
260421,
276809,
285002,
276811,
235853,
276816,
235858,
276829,
276833,
391523,
276836,
293227,
276843,
293232,
276848,
186744,
211324,
227709,
285061,
366983,
317833,
178572,
285070,
285077,
178583,
227738,
317853,
276896,
317858,
342434,
285093,
317864,
285098,
276907,
235955,
276917,
293304,
293307,
293314,
309707,
293325,
129486,
317910,
293336,
235996,
317917,
293343,
358880,
276961,
227810,
293346,
276964,
293352,
236013,
293364,
301562,
293370,
317951,
309764,
301575,
121352,
293387,
236043,
342541,
317963,
113167,
55822,
309779,
317971,
309781,
277011,
55837,
227877,
227879,
293417,
227882,
309804,
293421,
105007,
236082,
285236,
23094,
277054,
244288,
219714,
129603,
301636,
318020,
301639,
301643,
277071,
285265,
399955,
309844,
277080,
309849,
285277,
285282,
326244,
318055,
277100,
309871,
121458,
277106,
170618,
170619,
309885,
309888,
277122,
227975,
277128,
285320,
301706,
318092,
326285,
334476,
318094,
277136,
277139,
227992,
318108,
285340,
318110,
227998,
137889,
383658,
285357,
318128,
277170,
293555,
318132,
342707,
154292,
277173,
285368,
277177,
277181,
318144,
277187,
277191,
277194,
277196,
277201,
342745,
137946,
342747,
342749,
113378,
203491,
228069,
277223,
342760,
285417,
56041,
56043,
56045,
277232,
228081,
56059,
310015,
285441,
310020,
285448,
310029,
228113,
285459,
277273,
293659,
326430,
228128,
285474,
293666,
228135,
318248,
277291,
318253,
293677,
285489,
301876,
293685,
285494,
301880,
285499,
301884,
310080,
293696,
277317,
277322,
293706,
277329,
162643,
310100,
301911,
301913,
277337,
301921,
400236,
236397,
162671,
326514,
310134,
236408,
15224,
277368,
416639,
416640,
113538,
310147,
416648,
39817,
187274,
277385,
301972,
424853,
277405,
277411,
310179,
293798,
293802,
236460,
277426,
276579,
293811,
293817,
293820,
203715,
326603,
342994,
276586,
293849,
293861,
228327,
228328,
318442,
228330,
228332,
326638,
277486,
351217,
318450,
293876,
293877,
285686,
302073,
121850,
293882,
302075,
285690,
244731,
293887,
277504,
277507,
277511,
293899,
277519,
293908,
302105,
293917,
293939,
318516,
277561,
277564,
310336,
7232,
293956,
277573,
228422,
293960,
310344,
277577,
277583,
203857,
293971,
310355,
310359,
236632,
277594,
138332,
277598,
203872,
277601,
285792,
310374,
203879,
310376,
228460,
318573,
203886,
187509,
285815,
367737,
285817,
302205,
285821,
392326,
285831,
253064,
294026,
302218,
285835,
162964,
384148,
187542,
302231,
285849,
302233,
285852,
302237,
285854,
285856,
302241,
285862,
277671,
302248,
64682,
277678,
294063,
294065,
302258,
277687,
294072,
318651,
294076,
277695,
318657,
244930,
302275,
130244,
302277,
228550,
302282,
310476,
302285,
302288,
310481,
302290,
203987,
302292,
302294,
310486,
302296,
384222,
310498,
285927,
318698,
302315,
195822,
228592,
294132,
138485,
228601,
204026,
228606,
204031,
64768,
310531,
285958,
138505,
228617,
318742,
204067,
277798,
130345,
277801,
113964,
285997,
384302,
285999,
277804,
113969,
277807,
277811,
318773,
318776,
277816,
286010,
277819,
294204,
417086,
277822,
286016,
302403,
294211,
384328,
277832,
277836,
294221,
146765,
294223,
326991,
277839,
277842,
277847,
277850,
179547,
277853,
146784,
277857,
302436,
277860,
294246,
327015,
310632,
327017,
351594,
277864,
277869,
277872,
351607,
310648,
277880,
310651,
277884,
277888,
310657,
351619,
294276,
310659,
327046,
277892,
253320,
310665,
318858,
277894,
277898,
277903,
310672,
351633,
277905,
277908,
277917,
310689,
277921,
130468,
228776,
277928,
277932,
310703,
277937,
310710,
130486,
310712,
277944,
310715,
277947,
302526,
228799,
277950,
277953,
302534,
310727,
245191,
64966,
163272,
277959,
277963,
302541,
277966,
302543,
310737,
277971,
228825,
163290,
277978,
310749,
277981,
277984,
310755,
277989,
277991,
187880,
277995,
310764,
286188,
278000,
228851,
310772,
278003,
278006,
40440,
212472,
278009,
40443,
286203,
310780,
40448,
228864,
286214,
228871,
302603,
65038,
302614,
302617,
286233,
302621,
286240,
146977,
187936,
187939,
40484,
294435,
40486,
286246,
294440,
40488,
294439,
294443,
40491,
294445,
278057,
310831,
245288,
286248,
40499,
40502,
212538,
40507,
40511,
40513,
228933,
327240,
40521,
286283,
40525,
40527,
212560,
400976,
228944,
40533,
147032,
40537,
40539,
40541,
278109,
40544,
40548,
40550,
40552,
286312,
40554,
286313,
310892,
40557,
40560,
188022,
122488,
294521,
343679,
294537,
310925,
286354,
278163,
302740,
122517,
278168,
179870,
327333,
229030,
212648,
278188,
302764,
278192,
319153,
278196,
302781,
319171,
302789,
294599,
278216,
294601,
302793,
343757,
212690,
319187,
286420,
278227,
229076,
286425,
319194,
278235,
278238,
229086,
286432,
294625,
294634,
302838,
319226,
286460,
278274,
302852,
278277,
302854,
294664,
311048,
352008,
319243,
311053,
302862,
319251,
294682,
278306,
188199,
294701,
319280,
278320,
319290,
229192,
302925,
188247,
280021,
188252,
237409,
294776,
360317,
294785,
327554,
360322,
40840,
40851,
294803,
188312,
294811,
237470,
319390,
40865,
319394,
294817,
294821,
311209,
180142,
343983,
294831,
188340,
40886,
319419,
294844,
294847,
237508,
393177,
294876,
294879,
294883,
393190,
294890,
311279,
278513,
237555,
311283,
278516,
278519,
237562
] |
068cc7790efa36fa86f4eb1a0e55c55d470217f5 | 9f6df45a8f44d34301f9d5a2714b893c1691fab4 | /Sources/App/Models/RSSFeeds.swift | 51ca9ea67fbc916d0e811689663f3efafbcd1321 | [] | no_license | brien84/NaujienosServer | 32a153215dbc93d38d4b505975ee61ee6597d999 | 3ceed55cc2a67da9866c8aa9b0515df0b703f5da | refs/heads/master | 2020-05-07T16:02:42.841183 | 2019-10-28T18:23:51 | 2019-10-28T18:23:51 | 179,851,070 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 2,157 | swift | //
// RSSFeeds.swift
// App
//
// Created by Marius on 29/03/2019.
//
import Vapor
struct RSSFeed {
let provider: String
let category: String
let url: String
}
/// Decodes RSSFeeds.plist into array of RSSFeed.
struct RSSFeeds {
var all = [RSSFeed]()
init() {
guard let data = try? Data(contentsOf: Constants.URLs.rssFeed) else {
print("Could not find RSSFeeds.plist. Check URL in Constants!")
return
}
let decoder = PropertyListDecoder()
do {
self = try decoder.decode(RSSFeeds.self, from: data)
} catch {
print("Error decoding RSSFeeds: \(error)")
}
}
private init(feeds: [RSSFeed]) {
self.all = feeds
}
}
extension RSSFeeds: Decodable {
private struct ProviderKey: CodingKey {
var stringValue: String
init?(stringValue: String) {
self.stringValue = stringValue
}
var intValue: Int? { return nil }
init?(intValue: Int) { return nil }
}
private struct CategoryKey: CodingKey {
var stringValue: String
init?(stringValue: String) {
self.stringValue = stringValue
}
var intValue: Int? { return nil }
init?(intValue: Int) { return nil }
}
/// The initializer loops over all of the keys of the first (provider) and second (categories) levels of nesting.
init(from decoder: Decoder) throws {
var feeds = [RSSFeed]()
let providers = try decoder.container(keyedBy: ProviderKey.self)
for providerKey in providers.allKeys {
let categories = try providers.nestedContainer(keyedBy: CategoryKey.self, forKey: providerKey)
for categoryKey in categories.allKeys {
let url = try categories.decode(String.self, forKey: categoryKey)
let feed = RSSFeed(provider: providerKey.stringValue, category: categoryKey.stringValue, url: url)
feeds.append(feed)
}
}
self.init(feeds: feeds)
}
}
| [
-1
] |
1f03e9bf24c2b2b68435924b6c21991ddae6b08a | 06a83edf8d0bf6d0ef5651203a83805fe4333adb | /Tests/RxReachabilityTests/XCTestManifests.swift | 018715a4d4be10e9b6d0e661629e8ad9ac3168ed | [
"MIT"
] | permissive | newscorp-ghfb/RxReachability | 7582ee66b8ade6effad1efac4a8ac99c6013ef66 | 74b064cc3f5530fb3d85dda16f00fd7c8271b66a | refs/heads/develop | 2020-12-04T06:07:59.367505 | 2020-07-27T18:02:55 | 2020-07-27T18:02:55 | 231,648,294 | 0 | 1 | MIT | 2020-05-05T23:07:09 | 2020-01-03T19:04:27 | Ruby | UTF-8 | Swift | false | false | 163 | swift | import XCTest
#if !canImport(ObjectiveC)
public func allTests() -> [XCTestCaseEntry] {
return [
testCase(RxReachabilityTests.allTests)
]
}
#endif
| [
324611,
254468,
45060,
222726,
35348,
35357,
323614,
192030,
217122,
342563,
438821,
333350,
30252,
118828,
35376,
199217,
321586,
347127,
168502,
162364,
162369,
35394,
242243,
54338,
339018,
187475,
332372,
332374,
184407,
341079,
327257,
248926,
343657,
139369,
343148,
333426,
192629,
343159,
339575,
54903,
346747,
347260,
323712,
245379,
186514,
326294,
258711,
330392,
315550,
343207,
248490,
181930,
352943,
351418,
326337,
323780,
225988,
357065,
351437,
339670,
223964,
354013,
254175,
352994,
344805,
329454,
378096,
211188,
337652,
353015,
65273,
194811,
353020,
356606,
126214,
319238,
374026,
202507,
148238,
136464,
353049,
353562,
347419,
150815,
198431,
321824,
192290,
348962,
342309,
334118,
325415,
254247,
341800,
342832,
347445,
354105,
368447,
166727,
244558,
345424,
251217,
253784,
337755,
339803,
253788,
240480,
253792,
246118,
253799,
211816,
244582,
253804,
253807,
106864,
253811,
243572,
337273,
359290,
151933,
325523,
200088,
327064,
321439,
254368,
141736,
178089,
354216,
222125,
344505,
201146,
150971,
343998,
326593,
329153,
343489,
344516,
373201,
355283,
340947,
338390,
363480,
343521,
343524,
241125,
319463,
351208,
340971,
6124,
330221,
145903,
343028,
200183,
219130,
10239
] |
035ce1ad8026c70bd03270e43aec5989dc1daada | 9a9dd91b9e47dfd93a830299ae578892830fa6c6 | /Ones/PromptHUD.swift | ec71e3580a832c7c744e7c5646b3dbb5bb9804b2 | [] | no_license | AsTryE/Ones | 15e890962af7e35558eb64dba935b21a12dbdccc | 4a9a1a433651235bacf879732f38bf680280b195 | refs/heads/master | 2021-05-30T09:06:41.301953 | 2015-10-23T15:01:29 | 2015-10-23T15:01:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,797 | swift | //
// PromptHUD.swift
// Ones
//
// Created by Bers on 15/3/13.
// Copyright (c) 2015年 Bers. All rights reserved.
//
import UIKit
enum PromptHUDStyle {
case CheckMark
case Warning
case SoundEnabled
case SoundDisabled
}
class PromptHUD: UIWindow {
var promptText : String = ""
var promptImg : UIImage!
var rootVC : HUDViewController!
class var sharedPromptHUD: PromptHUD {
return sharedInstance
}
override init(frame: CGRect) {
super.init(frame: frame)
let screenCenter = CGPoint(x: UIScreen.mainScreen().bounds.size.width / 2, y: UIScreen.mainScreen().bounds.size.height / 2)
self.center = screenCenter
self.windowLevel = 2001
self.backgroundColor = UIColor.clearColor()
rootVC = HUDViewController(nibName: nil, bundle: nil)
rootViewController = rootVC
}
required init(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func showWithStyle(style: PromptHUDStyle){
rootVC.showWithStyle(style)
self.makeKeyWindow()
self.hidden = false
UIView.animateWithDuration(0.5, animations: { () -> Void in
self.rootVC.view.alpha = 1.0
}) { (finished:Bool) -> Void in
}
var timer = NSTimer.scheduledTimerWithTimeInterval(0.5, target: self, selector: Selector("dismiss"), userInfo: nil, repeats: false)
}
func dismiss(){
UIView.animateWithDuration(0.5, animations: { () -> Void in
self.rootVC.view.alpha = 0.0
}) { (finished:Bool) -> Void in
self.hidden = true
self.resignKeyWindow()
}
}
}
private let sharedInstance = PromptHUD(frame: CGRectMake(0, 0, 110, 110))
| [
-1
] |
278f83b7627e8eff875d8ca3658dbc3d88fd2cd2 | 300700b402cd3bffe5ff01215fba6fd2c49152b1 | /EyeCritic/features/reviews/presentation/components/ReviewFavoriteUpdateAlert.swift | 132db3ba2cf9c48227f7f1faa28f5236dda53cda | [] | no_license | PedroSchwarz/EyeCritic-iOS | e4d65334aa92086383a0fd91ec0bb09686ae57df | 3ba5929f6b0118b3719c18c9f56c4bb5b121cd10 | refs/heads/main | 2023-06-29T11:15:29.081557 | 2021-08-11T01:59:07 | 2021-08-11T01:59:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 928 | swift | //
// ReviewFavoriteUpdateAlert.swift
// EyeCritic
//
// Created by Pedro Rodrigues on 09/08/21.
//
import SwiftUI
struct ReviewFavoriteUpdateAlert: View {
var show: Bool = false
var state: ReviewDetailsState = .idle
var body: some View {
FloatingAlert(message: self.mapStateToMessage())
.offset(
y: self.show ? 0 : 150
)
.animation(.spring(response: 0.6, dampingFraction: 0.5))
}
// Map favorite state to message
func mapStateToMessage() -> String {
if self.state == .failure {
return "An error occurred, please try again later"
} else if self.state == .success {
return "Review updated"
} else {
return ""
}
}
}
struct ReviewFavoriteUpdateAlert_Previews: PreviewProvider {
static var previews: some View {
ReviewFavoriteUpdateAlert()
}
}
| [
-1
] |
229c30085cd9720ebbb3f3bce4b327255a14f5cc | 816adec89575f6fe6d7323f6e3def5dd4b01d853 | /InStat/Support/Helpers/GDAudioPlayer/GDPlayer.swift | eba791a4db93f3a02b328be9f47bcd41422777ee | [] | no_license | GDDeveloper/instat | cff30bc37e802a2a0ef2166ff4746b915e568c58 | fefd8e7554b8e5004858b57d6f2a0b28e52df3a1 | refs/heads/main | 2023-04-03T02:25:24.974789 | 2021-03-25T17:27:07 | 2021-03-25T17:27:07 | 349,948,473 | 1 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,216 | swift |
import UIKit
import AVKit
class GDPlayer: UIView {
//MARK: - Private
private var playerLayer = AVPlayerLayer()
private let urlPlayers = GDURLPlayers()
private let setupPlayer = GDSetupPlayer()
//MARK: - Public
public var player = AVPlayer()
public let control = GDPlayerControl()
public var videoGravity : AVLayerVideoGravity = .resizeAspect
public var contentsGravity: CALayerContentsGravity = .resizeAspect
public func load(urlPlayer: TypePlayerURL, typeURL: TypeURL = .mp4){
//create url video
guard let url = self.urlPlayers.change(urlPlayer: urlPlayer, typeURL: typeURL) else { return }
//create video
self.player = AVPlayer(url: url)
self.playerLayer = AVPlayerLayer(player: self.player)
//add video player
self.layer.addSublayer(self.playerLayer)
//setup video control
self.control.setup(player: self.player)
}
override func layoutSubviews() {
super.layoutSubviews()
self.playerLayer.frame = CGRect(x: 0, y: 0, width: self.frame.width, height: self.frame.height)
self.playerLayer.videoGravity = self.videoGravity
self.playerLayer.contentsGravity = self.contentsGravity
}
}
| [
-1
] |
9805c0644ca773741cae0aa4582d4b98b459b7f5 | d530a1869c922b4964700e229088eabf1d9209af | /Heuristics/Scenes/AhmedZaghloul/Models/User.swift | 9b3d539fde2d185e393c521c041e2785a7d43731 | [] | no_license | AhmedZaghloul19/Heu | a54f23b246f5c46fe4017bbc8c087d804a7e645a | ddff4759cc9bd10ed5f935dbfedd76d961a17933 | refs/heads/master | 2021-04-28T02:19:35.647855 | 2018-02-21T06:26:32 | 2018-02-21T06:26:32 | 122,300,221 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,818 | swift | //
// Error.swift
// Clinic System
//
// Created by Ahmed_OS on 5/10/17.
// Copyright © 2017 Ahmed_OS. All rights reserved.
//
import Foundation
/**
User Model .
````
public var id : Int?
public var name : String?
public var image : String?
````
- id: ID of the Object.
- name: Name of the object.
- image: Image Path (url) for the image of the object.
## Important Notes ##
- This Class inherits from **BaseModel Class**
*/
class User : BaseModel {
public var email : String?
public var mobile : String?
public var gender : Gender?
public var languages : String?
public var birthday : String?
public var address : String?
public var is_active : Bool?
public var role : Role?
public var bio : String?
public var username : String?
public var userId : String?
override init(data:AnyObject){
super.init(data: data)
if let data = data as? NSDictionary {
email = data.getValueForKey(key: "Email", callback: "")
mobile = data.getValueForKey(key: "mobile", callback: "")
gender = Gender(rawValue: data.getValueForKey(key: "gender", callback: 0))
role = Role(rawValue: data.getValueForKey(key: "role_id", callback: 3))
languages = data.getValueForKey(key: "languages", callback: "")
is_active = data.getValueForKey(key: "is_active", callback: 0) == 1
birthday = data.getValueForKey(key: "birthday", callback: "")
address = data.getValueForKey(key: "address", callback: "")
userId = data.getValueForKey(key: "userId", callback: "")
bio = data.getValueForKey(key: "bio", callback: "")
username = data.getValueForKey(key: "username", callback: "")
}
}
override init() {
super.init()
}
}
| [
-1
] |
7daf39027e2c33f1221aa110a5b6b80a78aee522 | 95882c18b75d8d359a053811ed3fe22f6d691ab5 | /AppSharkUITests/AppSharkUITests.swift | 68c3fbc14d93a13bc39f2511655b2e477030b9b9 | [] | no_license | SatishKumar475/SwiftExamples | adc608322404ffdf874e0a59b1c05a4012633324 | e4dc8d39d062a57ef9553f35546c1174b8d2dd60 | refs/heads/master | 2016-08-12T13:12:44.183928 | 2016-01-28T13:30:22 | 2016-01-28T13:30:22 | 50,585,421 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,238 | swift | //
// AppSharkUITests.swift
// AppSharkUITests
//
// Created by satish on 09/12/15.
// Copyright © 2015 Satish. All rights reserved.
//
import XCTest
class AppSharkUITests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
// In UI tests it is usually best to stop immediately when a failure occurs.
continueAfterFailure = false
// UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method.
XCUIApplication().launch()
// In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}
func testExample() {
// Use recording to get started writing UI tests.
// Use XCTAssert and related functions to verify your tests produce the correct results.
}
}
| [
155665,
237599,
229414,
278571,
229425,
180279,
229431,
319543,
213051,
286787,
237638,
311373,
196687,
278607,
311377,
368732,
180317,
278637,
319599,
278642,
131190,
131199,
278669,
278676,
311447,
327834,
278684,
278690,
311459,
278698,
278703,
278707,
278713,
180409,
295099,
139459,
131270,
229591,
147679,
311520,
147680,
319719,
295147,
286957,
319764,
278805,
311582,
278817,
311596,
336177,
98611,
278843,
287040,
319812,
311622,
319816,
229716,
278895,
287089,
139641,
311679,
311692,
106893,
156069,
311723,
377265,
319931,
311739,
278974,
336319,
311744,
336323,
278979,
278988,
278992,
279000,
279009,
369121,
188899,
279014,
319976,
279017,
311787,
319986,
279030,
311800,
279033,
279042,
287237,
279053,
303634,
303635,
279060,
279061,
279066,
188954,
279092,
377419,
303693,
115287,
189016,
287319,
295518,
287327,
279143,
279150,
287345,
287348,
189054,
303743,
287359,
279176,
311944,
344714,
311948,
311950,
311953,
287379,
336531,
295575,
303772,
205469,
221853,
279207,
295591,
295598,
279215,
279218,
164532,
287412,
303802,
287418,
66243,
287434,
287438,
279249,
303826,
369365,
369366,
279253,
230105,
295653,
230120,
279278,
312046,
230133,
279293,
205566,
295688,
312076,
295698,
221980,
336678,
262952,
279337,
262953,
262957,
164655,
328495,
303921,
230198,
222017,
295745,
279379,
295769,
230238,
230239,
279393,
303973,
279398,
295797,
295799,
279418,
336765,
287623,
279434,
320394,
189327,
189349,
279465,
304050,
189373,
213956,
345030,
213961,
279499,
304086,
123880,
304104,
320492,
320495,
287730,
320504,
214009,
312313,
312317,
418819,
320520,
230411,
320526,
238611,
140311,
238617,
197658,
336930,
132140,
189487,
312372,
238646,
238650,
320571,
336962,
238663,
205911,
296023,
156763,
230500,
279659,
230514,
238706,
312435,
279666,
279686,
222344,
337037,
296091,
238764,
148674,
312519,
279752,
148687,
189651,
279766,
189656,
279775,
304352,
304353,
279780,
279789,
279803,
312588,
320795,
320802,
304422,
312628,
345398,
222523,
181568,
279872,
279874,
304457,
230730,
345418,
337228,
296269,
222542,
238928,
296274,
230757,
296304,
312688,
230772,
337280,
296328,
296330,
304523,
9618,
279955,
148899,
279979,
279980,
173492,
279988,
280003,
280011,
337359,
329168,
312785,
222674,
329170,
280020,
280025,
239069,
320997,
280042,
280043,
329198,
337391,
296434,
288248,
288252,
312830,
230922,
304655,
329231,
230933,
222754,
312879,
230960,
288305,
239159,
157246,
288319,
288322,
280131,
124486,
288328,
230999,
239192,
345697,
312937,
312941,
206447,
288377,
337533,
280193,
239238,
288391,
239251,
280217,
198304,
280252,
280253,
296636,
321217,
280259,
239305,
296649,
280266,
9935,
313042,
280279,
18139,
280285,
321250,
337638,
181992,
288492,
34547,
67316,
313082,
288508,
288515,
280326,
116491,
280333,
124691,
116502,
321308,
321309,
280367,
280373,
280377,
321338,
280381,
345918,
280386,
280391,
280396,
18263,
370526,
296807,
296815,
313200,
313204,
280451,
67464,
305032,
214936,
337816,
239515,
214943,
313257,
288698,
214978,
280517,
280518,
214983,
231382,
190437,
174058,
313322,
296942,
124912,
239610,
313338,
182277,
313356,
305173,
223269,
354342,
354346,
313388,
124974,
321589,
215095,
288829,
288835,
313415,
239689,
354386,
280660,
223317,
321632,
280674,
280676,
313446,
215144,
288878,
288890,
215165,
280708,
329884,
215204,
280761,
223418,
280767,
338118,
280779,
280792,
280803,
338151,
182503,
125166,
125170,
395511,
313595,
125184,
125192,
125197,
125200,
338196,
125204,
125215,
338217,
125225,
321839,
125236,
280903,
289109,
379224,
239973,
313703,
280938,
321901,
354671,
199030,
223611,
313726,
240003,
158087,
313736,
240020,
190870,
190872,
289185,
305572,
289195,
338359,
289229,
281038,
281039,
281071,
322057,
182802,
322077,
289328,
338491,
322119,
281165,
281170,
281200,
313970,
297600,
289435,
314020,
248494,
166581,
314043,
363212,
158424,
322269,
338658,
289511,
330473,
330476,
289517,
215790,
125683,
199415,
289534,
322302,
35584,
322312,
346889,
166677,
207639,
281378,
289580,
289599,
281407,
281426,
281434,
322396,
281444,
207735,
314240,
158594,
330627,
240517,
289691,
240543,
289699,
289704,
289720,
289723,
281541,
19398,
191445,
183254,
207839,
142309,
314343,
183276,
289773,
248815,
240631,
330759,
322571,
330766,
281647,
322609,
314437,
207954,
339031,
314458,
281698,
281699,
322664,
314493,
347286,
330912,
339106,
306339,
249003,
208044,
3243,
322733,
339131,
290001,
339167,
298209,
290030,
208123,
322826,
126229,
298290,
208179,
159033,
216387,
372039,
224591,
331091,
150868,
314708,
314711,
314721,
281958,
314727,
134504,
306541,
314740,
314742,
290170,
224637,
306558,
290176,
306561,
314752,
298378,
314765,
314771,
306580,
224662,
282008,
314776,
282013,
290206,
314788,
298406,
282023,
241067,
314797,
306630,
306634,
339403,
191980,
282097,
306678,
191991,
290304,
323079,
323083,
323088,
282132,
282135,
175640,
306730,
290359,
323132,
282182,
224848,
224852,
290391,
306777,
282214,
224874,
314997,
290425,
339579,
282244,
282248,
323208,
323226,
282272,
282279,
298664,
298666,
306875,
282302,
323262,
323265,
282309,
306891,
241360,
282321,
241366,
282330,
282336,
12009,
282347,
282349,
323315,
200444,
282366,
249606,
323335,
282375,
282379,
216844,
118549,
282390,
282399,
241440,
282401,
339746,
216868,
315172,
241447,
282418,
282424,
282428,
413500,
241471,
315209,
159563,
307024,
241494,
307038,
282471,
282476,
339840,
315265,
282503,
315272,
315275,
184207,
282517,
298912,
118693,
298921,
126896,
282572,
282573,
323554,
298987,
282634,
241695,
315431,
102441,
315433,
102446,
282671,
241717,
307269,
233548,
315468,
315477,
323678,
315488,
315489,
45154,
307306,
233578,
241809,
323730,
299166,
233635,
299176,
184489,
323761,
184498,
258233,
299197,
299202,
176325,
299208,
282832,
356575,
307431,
184574,
217352,
315674,
282908,
299294,
282912,
233761,
282920,
315698,
282938,
307514,
127292,
168251,
323914,
201037,
282959,
250196,
168280,
323934,
381286,
242027,
242028,
250227,
315768,
291193,
291194,
291200,
242059,
315798,
291225,
242079,
283039,
299449,
291266,
283088,
283089,
176602,
242138,
160224,
291297,
283138,
233987,
324098,
340489,
283154,
291359,
283185,
234037,
340539,
234044,
332379,
111197,
242274,
291455,
316044,
184974,
316048,
340645,
176810,
299698,
291529,
225996,
135888,
242385,
299737,
234216,
234233,
242428,
291584,
299777,
291591,
291605,
283418,
234276,
283431,
234290,
201534,
283466,
234330,
201562,
275294,
349025,
357219,
177002,
308075,
242540,
201590,
177018,
308093,
291713,
340865,
299912,
316299,
234382,
308111,
308113,
209820,
283551,
177074,
127945,
340960,
234469,
340967,
324587,
234476,
201721,
234499,
234513,
316441,
300087,
21567,
308288,
160834,
349254,
300109,
234578,
250965,
234588,
250982,
234606,
300147,
234626,
234635,
177297,
308375,
324761,
119965,
234655,
300192,
234662,
300200,
324790,
300215,
283841,
283846,
283849,
316628,
316661,
234741,
283894,
292092,
234756,
242955,
177420,
292145,
300342,
193858,
300355,
300354,
234830,
283990,
357720,
300378,
300379,
316764,
292194,
284015,
234864,
316786,
243073,
292242,
112019,
234902,
284086,
259513,
284090,
54719,
415170,
292291,
300488,
300490,
234957,
144862,
300526,
308722,
300539,
210429,
292359,
218632,
316951,
374297,
235069,
349764,
194118,
292424,
292426,
333389,
349780,
128600,
235096,
300643,
300645,
243306,
325246,
333438,
235136,
317102,
300725,
300729,
333522,
325345,
153318,
333543,
284410,
284425,
300810,
300812,
284430,
161553,
284436,
325403,
341791,
186148,
186149,
333609,
284460,
300849,
325444,
153416,
325449,
325460,
317268,
341846,
284508,
300893,
284515,
276326,
292713,
292719,
325491,
317305,
317308,
325508,
333700,
243592,
325514,
350091,
350092,
350102,
333727,
219046,
333734,
284584,
292783,
300983,
153553,
292835,
292838,
317416,
325620,
333827,
243720,
292901,
325675,
243763,
325695,
227432,
194667,
284789,
292987,
227459,
194692,
235661,
333968,
153752,
284827,
333990,
284840,
284843,
227517,
309443,
227525,
301255,
227536,
301270,
301271,
325857,
317676,
309504,
194832,
227601,
334104,
211239,
334121,
317738,
325930,
227655,
383309,
391521,
285031,
416103,
227702,
211327,
227721,
227730,
285074,
285083,
317851,
293275,
227743,
285089,
293281,
301482,
375211,
334259,
293309,
317889,
129484,
326093,
285152,
195044,
334315,
236020,
293368,
317949,
334345,
309770,
342537,
342560,
227881,
293420,
236080,
23093,
244279,
244280,
301635,
309831,
55880,
301647,
326229,
244311,
309847,
244326,
277095,
301688,
301702,
334473,
326288,
227991,
285348,
293552,
342705,
285362,
285360,
154295,
342757,
285419,
170735,
342775,
375552,
228099,
285443,
285450,
326413,
285457,
285467,
318247,
203560,
293673,
318251,
301872,
285493,
285496,
301883,
342846,
293702,
318279,
244569,
301919,
293729,
351078,
310132,
228214,
269179,
228232,
416649,
252812,
293780,
310166,
310177,
293801,
326571,
326580,
326586,
359365,
211913,
56270,
203758,
293894,
293911,
326684,
113710,
318515,
203829,
285795,
228457,
318571,
187508,
302202,
285819,
285823,
285833,
285834,
318602,
228492,
162962,
187539,
285850,
302239,
302251,
294069,
294075,
64699,
228541,
343230,
310496,
228587,
302319,
228608,
318732,
318746,
130342,
130344,
130347,
286012,
294210,
294220,
318804,
294236,
327023,
327030,
310650,
179586,
294278,
318860,
368012,
318876,
343457,
245160,
286128,
286133,
310714,
302523,
228796,
302530,
228804,
310725,
302539,
310731,
310735,
310747,
286176,
187877,
310758,
40439,
286201,
359931,
245249,
228868,
302602,
294413,
359949,
302613,
302620,
130622,
286281,
196184,
212574,
204386,
204394,
138862,
310896,
294517,
286344,
179853,
286351,
188049,
229011,
179868,
229021,
302751,
245413,
212649,
286387,
286392,
302778,
286400,
212684,
302798,
286419,
278232,
278237,
294621,
278241,
294629,
286457,
286463,
319232,
278292,
278294,
294699,
319289,
237397,
188250,
237411,
327556,
188293,
311183,
294806,
294808,
319393,
294820,
294824,
343993,
98240,
294849,
24531,
294887,
278507,
311277,
327666,
278515
] |
6a037ee0f3d0b85f7a51788bf70d308e92559f22 | ba89ccdf044eb2231222211660c3295651867668 | /PlantManager/Views/PlantSearchView.swift | ec1cfdc6811ec688910f9aab7e5dc9e00ca5aff0 | [] | no_license | Joshua-McCord/Plant-Manager | a2d7d547be8014075be1dea96e41465c63c0dc1d | 1ee7d39fb0f56bc347fff78fe1e3bc99e5ff39c9 | refs/heads/master | 2023-04-28T08:11:00.894290 | 2021-05-01T05:56:24 | 2021-05-01T05:56:24 | 336,978,255 | 1 | 0 | null | 2021-04-04T13:40:01 | 2021-02-08T06:13:52 | Swift | UTF-8 | Swift | false | false | 3,559 | swift | //
// PlantSearchView.swift
// PlantManager
//
// Created by Joshua Cole McCord on 2/4/21.
//
import Foundation
import SwiftUI
struct PlantSearchView: View {
@Environment(\.presentationMode) var presentationMode: Binding<PresentationMode>
@State private var searchText = ""
@State private var showGoButton: Bool = false
@ObservedObject var searchVM = PlantSearchViewModel()
private var room: Room
init(room: Room) {
self.room = room
}
var body: some View {
let searchResults = searchVM.searchList
VStack {
ZStack {
ToolbarView(title: "Search")
.padding(.top)
Button("<") {
presentationMode.wrappedValue.dismiss()
}
.buttonStyle(SmallBackButton())
.offset(x: -145.0, y: 20.0)
}
// Search view
HStack {
VStack {
HStack {
Image("search-flower")
.scaleEffect(1.5)
TextField("Enter plant name...", text: $searchText, onEditingChanged: { isEditing in
self.showGoButton = true
}, onCommit: {
searchVM.searchForPlants(plantName: searchText)
})
.autocapitalization(.none)
.padding(.leading, 10)
Button(action: {
self.searchText = ""
}) {
Image(systemName: "xmark.circle.fill").opacity(searchText == "" ? 0 : 1)
.foregroundColor(.secondary)
}
}
Divider()
.background(Color.black)
.padding(.vertical, 2)
}
.padding(.leading)
if self.showGoButton && self.searchText != "" {
Button("Go") {
UIApplication.shared.endEditing(true) // this must be placed before the other commands here
searchVM.searchForPlants(plantName: searchText)
}
.buttonStyle(LongGreenButton())
.padding(.horizontal)
} else {
Button("Go"){}
.buttonStyle(LongGreenButton())
.padding(.horizontal)
.opacity(0.5)
}
}
.padding(.top, 30)
.padding(.horizontal, 20)
.navigationBarHidden(self.showGoButton)
// Make each plant in search result list clickable
// and add it to the users plants.
List {
ForEach(searchResults, id:\.self) {
searchResult in //Text(searchResult)
Button(action: {
searchVM.addPlant(plantSearchResult: searchResult, currRoomId: room.rid!)
}) {
Text(searchResult.plantName)
}
}
}
.padding(.horizontal)
.padding(.trailing)
}
.navigationBarTitle("")
.navigationBarHidden(true)
.resignKeyboardOnDragGesture()
}
}
| [
-1
] |
7bc2e44c230e8a6058b90848d631fe79b4e3180c | 0112afcf786801377ab711bf4298b777dee70631 | /Sources/FioriIntegrationCards/Components/Timeline/UI/TimelineItemView.swift | ab819405a973a4675aaf3bae1b7392c9313b9034 | [
"Apache-2.0"
] | permissive | anruf/cloud-sdk-ios-fiori | e9d2716745ccbd430dc0b1155bce4c0682b8c634 | cef2b73a9582d9c96849988a08e029c739cbaa71 | refs/heads/main | 2023-08-23T21:40:41.065098 | 2021-10-04T09:13:17 | 2021-10-04T09:13:17 | 413,349,957 | 0 | 0 | Apache-2.0 | 2021-10-04T09:09:41 | 2021-10-04T09:09:40 | null | UTF-8 | Swift | false | false | 4,824 | swift | import SwiftUI
struct TimelineItemView: View {
var model: TimelineItem
let isLast: Bool
@State private var lineHeight: CGFloat = 100.0
private let iconWidth: CGFloat = 24.0
init(model: TimelineItem, isLast: Bool) {
self.model = model
self.isLast = isLast
self.model.icon?.size = self.iconWidth
}
var body: some View {
HStack(alignment: .top) {
VStack {
SafeView(self.model.icon)
.padding(.bottom, -30)
.frame(width: iconWidth, height: iconWidth, alignment: .top)
if !self.isLast {
VerticalLine()
.stroke(Color.darkGray, lineWidth: 0.6)
.frame(height: self.lineHeight)
}
}
.frame(width: iconWidth)
.padding(EdgeInsets(top: 6, leading: 6, bottom: 0, trailing: 12))
VStack(alignment: .leading, spacing: 0) {
HStack {
VStack(alignment: .leading) {
AsyncImageView(url: self.model.ownerImage?.value).frame(width: 45, height: 45, alignment: .center)
}
VStack(alignment: .leading, spacing: 0) {
self.SafeText(self.model.owner?.value)
.font(Font.body.bold())
.padding(.bottom, 4)
self.SafeText(self.model.title?.value).font(.body)
.padding(.bottom, 4)
self.SafeText(self.model.dateTime?.value).font(.footnote).foregroundColor(.gray)
.padding(.bottom, 8)
}
}
self.SafeText(self.model.description?.value).font(.body)
}
.frame(maxWidth: .greatestFiniteMagnitude, alignment: .leading)
.padding(8)
.overlay(Bubble(borderColor: Color.lightGray))
.alignmentGuide(VerticalAlignment.center) { (dimension) -> CGFloat in
DispatchQueue.main.async {
self.lineHeight = dimension.height
}
return dimension[.leading]
}
}
}
}
struct VerticalLine: Shape {
func path(in rect: CGRect) -> Path {
var path = Path()
let startPoint = CGPoint(x: (rect.minX + rect.maxX) / 2, y: rect.minY)
let endPoint = CGPoint(x: (rect.minX + rect.maxX) / 2, y: rect.maxY)
path.move(to: startPoint)
path.addLine(to: endPoint)
return path
}
}
struct Bubble: View {
let borderColor: Color
var body: some View {
BubbleShape(cornerRadius: 3)
.stroke(borderColor, style: StrokeStyle(lineWidth: 0.6, lineCap: .round, lineJoin: .round, miterLimit: 0, dash: [], dashPhase: 0))
}
}
struct BubbleShape: Shape {
let cornerRadius: CGFloat
let triangleSide: CGFloat
init(cornerRadius: CGFloat = 3, sideLength: CGFloat = 10) {
self.cornerRadius = cornerRadius
self.triangleSide = sideLength
}
func path(in rect: CGRect) -> Path {
var path = Path()
let leftTop = CGPoint(x: rect.minX + self.cornerRadius, y: rect.minY + self.cornerRadius)
let rightTop = CGPoint(x: rect.maxX - self.cornerRadius, y: rect.minY + self.cornerRadius)
let rightBottom = CGPoint(x: rect.maxX - self.cornerRadius, y: rect.maxY - self.cornerRadius)
let leftBottom = CGPoint(x: rect.minX + self.cornerRadius, y: rect.maxY - self.cornerRadius)
let triangleTop = CGPoint(x: rect.minX, y: rect.minY + self.cornerRadius + self.triangleSide)
let triangleBottom = CGPoint(x: rect.minX, y: rect.minY + self.cornerRadius + self.triangleSide * 3)
let triangleLeft = CGPoint(x: rect.minX - self.triangleSide, y: rect.minY + self.cornerRadius + self.triangleSide * 2)
// draw rounded rectangle, closewise
path.addArc(center: leftTop, radius: self.cornerRadius, startAngle: .radians(.pi), endAngle: .radians(-.pi / 2), clockwise: false)
path.addArc(center: rightTop, radius: self.cornerRadius, startAngle: .radians(-.pi / 2), endAngle: .radians(0), clockwise: false)
path.addArc(center: rightBottom, radius: self.cornerRadius, startAngle: .radians(0), endAngle: .radians(.pi / 2), clockwise: false)
path.addArc(center: leftBottom, radius: self.cornerRadius, startAngle: .radians(.pi / 2), endAngle: .radians(.pi), clockwise: false)
// draw triangle
path.addLine(to: triangleBottom)
path.addLine(to: triangleLeft)
path.addLine(to: triangleTop)
path.closeSubpath()
return path
}
}
| [
-1
] |
c8b910e87160d4e4254195ceea50b88f9e789ab6 | 0cc0cc5b3b6ec641eb0fd0ba30b5098b11938e04 | /Functions.playground/Contents.swift | deb3091ec7ede4260ed50265443c49038281a53a | [] | no_license | nabendu82/MyPlaygrounds | 94c210853687b2eb9279543b0dafcd7b3bc45f21 | d50e3fd8806cda22f69a15cfe24a9af680b45658 | refs/heads/master | 2021-05-04T06:29:38.499741 | 2017-05-26T06:08:25 | 2017-05-26T06:08:25 | 70,467,566 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,016 | swift | //: Playground - noun: a place where people can play
import UIKit
var str = "Hello, playground"
func calculateArea(length: Int, width: Int) -> Int {
//let area = length * width
//return area
return length * width
}
let shape1 = calculateArea(length: 5, width: 4)
let shape2 = calculateArea(length: 10, width: 8)
let shape3 = calculateArea(length: 12, width: 7)
//-------------------------------------------//
var bankAccountBalance = 100000.00
var MacMini = 35000.00
func purchaseItem(currentBalance: Double, itemPrice: Double) -> Double {
if itemPrice <= currentBalance {
print("Purchased item for : Rs. \(itemPrice)")
return currentBalance - itemPrice
} else {
print("First save money to buy it.")
return currentBalance
}
}
bankAccountBalance = purchaseItem(currentBalance: bankAccountBalance, itemPrice: MacMini)
var MacBookPro = 80000.00
bankAccountBalance = purchaseItem(currentBalance: bankAccountBalance, itemPrice: MacBookPro)
| [
-1
] |
b85e89a2d3ceac2b075ba9dd2557522c46ab5515 | be3b1beea0528d26f271b66f77e052e9ef2c1aa5 | /MyTools/MyTools/Base/MainTabBarViewController.swift | 3e8e24f95e5ee25723ea0bec083cacd3c4434310 | [
"MIT"
] | permissive | NUKisZ/MyTools | b069a4b9426acbeabe1a365fdc201e8e2d783df6 | 08564613c7b5c35fc8b8ad8f66cb82e521720a52 | refs/heads/master | 2021-01-23T01:26:21.781243 | 2018-02-05T12:07:18 | 2018-02-05T12:07:18 | 85,907,510 | 1 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 3,685 | swift | //
// MainTabBarViewController.swift
// MengWuShe
//
// Created by zhangk on 16/10/17.
// Copyright © 2016年 zhangk. All rights reserved.
//
import UIKit
class MainTabBarViewController: UITabBarController {
private var beforeTag = 0
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
createViewControllers()
}
override func loadView() {
super.loadView()
var i = 0
for tabbarItemButton in tabBar.subviews {
if (tabbarItemButton.isKind(of: NSClassFromString("UITabBarButton")!)){
tabbarItemButton.tag = i;
i = i + 1
let btn = tabbarItemButton as! UIButton
btn.addTarget(self, action: #selector(tabbarButtonClick(tabbarBtn:)), for: .touchUpInside)
}
}
}
func tabbarButtonClick(tabbarBtn:UIButton){
}
private func createViewControllers() {
UITabBarItem.appearance().setTitleTextAttributes([NSFontAttributeName:UIFont.systemFont(ofSize: 11),NSForegroundColorAttributeName:UIColor.colorWithRGBA(red: 44, green: 185, blue: 176, alpha: 1.0)], for: .normal)
UITabBarItem.appearance().setTitleTextAttributes([NSFontAttributeName:UIFont.systemFont(ofSize: 11),NSForegroundColorAttributeName:UIColor.colorWithRGBA(red: 44, green: 185, blue: 176, alpha: 1.0)], for: .selected)
//标题
let titleArray = ["一","二","三"]
//图片
let imageArray = ["home_selected","all_selected","myinfo_selected"]
//选中时的图片
let selectImageArray = ["home_unselected","all_unselected","myinfo_unselected"]
//视图控制器
//let ctrlNameArray = ["MyTools.FirstViewController","MyTools.SecondViewController","MyTools.ThirdViewController"]
let ctrlNameArray = ["MyTools.FirstViewController","MyTools.SecondViewController","MyTools.BKHomeViewController"]
var array = Array<UINavigationController>()
//循环创建视图控制器
for i in 0..<titleArray.count{
//视图控制器
let clsName = ctrlNameArray[i]
let cls = NSClassFromString(clsName) as! UIViewController.Type
let vc = cls.init()
vc.tabBarItem.title = titleArray[i]
tabBar.tintColor = UIColor(colorLiteralRed: 225/255.0, green: 105/255.0, blue: 144/255.0, alpha: 1.0)
vc.tabBarItem.image = UIImage(named: imageArray[i])?.withRenderingMode(.alwaysOriginal)
vc.tabBarController?.tabBar.backgroundColor = UIColor.black
vc.tabBarItem.selectedImage = UIImage(named: selectImageArray[i])?.withRenderingMode(.alwaysOriginal)
//导航
let navCtrl = RTRootNavigationController(rootViewController: vc)
//let navCtrl = BearNavigationViewController(rootViewController: vc)
array.append(navCtrl)
}
self.viewControllers = array
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destinationViewController.
// Pass the selected object to the new view controller.
}
*/
}
| [
-1
] |
a7e4ecd3ea24c94c97a57e526023a108486a0fb2 | 55b8227bd4ac39437b0125df65adaf54caad8059 | /JenkinsMonitor/Controller/DashboardListDataSource.swift | 8ae9e37cf622e719c02fa12b5c6d761b9390c896 | [
"Apache-2.0"
] | permissive | luizmb/Jenkins-Monitor-tvOS | 319ae17a3001b949ba36ef9570d2bd1a924e951c | 9b0ce85dee6011037e3ce75b02aff9135050a730 | refs/heads/master | 2021-01-18T16:26:11.983943 | 2017-03-08T18:50:18 | 2017-03-08T18:50:18 | 84,351,404 | 6 | 1 | null | null | null | null | UTF-8 | Swift | false | false | 1,479 | swift | import UIKit
protocol DashboardCellCreator: class {
func configureCell(indexPath: IndexPath, from dashboard: MonitorDashboard?) -> UITableViewCell
}
class DashboardListDataSource: NSObject, UITableViewDataSource {
weak var dashboardCellCreator: DashboardCellCreator?
weak var delegate: DataSourceDelegate?
var dashboardList: [MonitorDashboard] = []
func numberOfSections(in tableView: UITableView) -> Int {
return 1
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return dashboardList.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
guard let dashboardCellCreator = dashboardCellCreator else {
return UITableViewCell()
}
return dashboardCellCreator.configureCell(indexPath: indexPath, from: dashboardList[indexPath.row])
}
func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) {
if editingStyle != .delete {
return
}
let monitor = self.dashboardList[indexPath.row]
MonitorDashboardService().delete(monitor)
dashboardList.remove(at: indexPath.row)
tableView.deleteRows(at: [indexPath], with: .fade)
}
func refreshData() {
self.dashboardList = MonitorDashboardService().all()
self.delegate?.dataSourceDidRefreshItems()
}
}
| [
-1
] |
98b1909ca5357e57a96a49e0bb6e547481b5c1da | 0d948d3068f38beb097feb0488fcef074937984b | /MultiConfigurationExample/Extensions/UITableView+Extensions.swift | 97e17a4571556f753fcb461d57cdabc6c1d2e696 | [] | no_license | glisovicp/MultiConfigurationExample | 0e23cd0641c4dc80b06b7221116b1b029bff99be | 30952c023459c66d171b0ed89b1548c53ca3c8d1 | refs/heads/master | 2022-07-15T18:54:20.702213 | 2020-05-20T18:11:20 | 2020-05-20T18:11:20 | 265,644,773 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,839 | swift | //
// UITableView+Extensions.swift
// MultiConfigurationExample
//
// Created by Petar Glisovic on 5/19/20.
// Copyright © 2020 Petar Glisovic. All rights reserved.
//
import Foundation
import UIKit
// MRAK: TableView
extension UITableView {
func addTableHeaderViewFromNibWithName(_ name: String) -> UIView {
let headerView: UIView = Bundle.main.loadNibNamed(name, owner: self, options: nil)?.first as! UIView
let headerFrame = CGRect(x: 0, y: 0, width: headerView.frame.size.width, height: headerView.frame.size.height)
let parentView = UIView(frame: headerFrame)
parentView.addSubview(headerView)
self.tableHeaderView = parentView
return headerView
}
func addTableFooterViewFromNibWithName(_ name: String) -> UIView {
let footerView: UIView = Bundle.main.loadNibNamed(name, owner: self, options: nil)?.first as! UIView
let footerFrame = CGRect(x: 0, y: 0, width: footerView.frame.size.width, height: footerView.frame.size.height)
let parentView = UIView(frame: footerFrame)
parentView.addSubview(footerView)
self.tableFooterView = parentView
return footerView
}
/// Check if cell at the specific section and row is visible
/// - Parameters:
/// - section: an Int reprenseting a UITableView section
/// - row: and Int representing a UITableView row
/// - Returns: True if cell at section and row is visible, False otherwise
func isCellVisible(section:Int, row: Int) -> Bool {
guard let indexes = self.indexPathsForVisibleRows else {
return false
}
return indexes.contains {$0.section == section && $0.row == row }
}
}
// MRAK: Cell
extension UITableViewCell {
class var identifier : String {
return "\(self)"
}
}
| [
-1
] |
36cea6c102362057cc117041061cec12a715d1ab | d90e59093d4b400b4c87cb62cf1899c4c81ae5ed | /CoreData-FavoriteActors/PlainFavoriteActors/FavoriteActors/TheMovieDB/Movie.swift | 6a4f1c74a093e6f38947069c9eb588a90892d5ab | [] | no_license | omatveyuk/CS212 | e41e169cce0a75405cef2a57ac61381242c5bd71 | ba43acb18a9ebbce333c5f9c95e830cf63e491d3 | refs/heads/master | 2020-12-03T05:35:13.718044 | 2015-05-03T17:20:27 | 2015-05-03T17:20:27 | 34,471,985 | 0 | 0 | null | 2015-04-23T17:45:27 | 2015-04-23T17:45:27 | null | UTF-8 | Swift | false | false | 2,665 | swift | //
// Movie.swift
// TheMovieDB
//
// Created by Jason on 1/11/15.
//
import UIKit
import CoreData
@objc(Movie)
class Movie : NSManagedObject {
struct Keys {
static let Title = "title"
static let PosterPath = "poster_path"
static let ReleaseDate = "release_date"
static let ID = "id"
}
@NSManaged var title: String
@NSManaged var id: Int
@NSManaged var posterPath: String?
@NSManaged var releaseDate: NSDate?
// @NSManaged var actor: Person
@NSManaged var actor: Person
override init(entity: NSEntityDescription, insertIntoManagedObjectContext context: NSManagedObjectContext?) {
super.init(entity: entity, insertIntoManagedObjectContext: context)
}
convenience init(context: NSManagedObjectContext) {
let entity = NSEntityDescription.entityForName("Movie", inManagedObjectContext: context)!
self.init(entity: entity, insertIntoManagedObjectContext: context)
}
/*
// Step 6: Override the two argument init method
override init(entity: NSEntityDescription, insertIntoManagedObjectContext context: NSManagedObjectContext?) {
super.init(entity: entity, insertIntoManagedObjectContext: context)
}
// Step 7: Create the convenience init that accepts a context and a dictionary
convenience init(context: NSManagedObjectContext, dictionary: [String : AnyObject]) {
let entity = NSEntityDescription.entityForName("Movie", inManagedObjectContext: context)!
self.init(entity: entity, insertIntoManagedObjectContext: context)
title = dictionary[Keys.Title] as! String
id = dictionary[Keys.ID] as! Int
posterPath = dictionary[Keys.PosterPath] as? String
releaseDate = dictionary[Keys.ReleaseDate] as? NSDate
}
*/
/*
init(dictionary: [String : AnyObject]) {
// Dictionary
title = dictionary[Keys.Title] as! String
id = dictionary[TheMovieDB.Keys.ID] as! Int
posterPath = dictionary[Keys.PosterPath] as? String
if let dateString = dictionary[Keys.ReleaseDate] as? String {
if let date = TheMovieDB.sharedDateFormatter.dateFromString(dateString) {
releaseDate = date
}
}
}
*/
var posterImage: UIImage? {
get {
return TheMovieDB.Caches.imageCache.imageWithIdentifier(posterPath)
}
set {
TheMovieDB.Caches.imageCache.storeImage(newValue, withIdentifier: posterPath!)
}
}
}
| [
-1
] |
6060f2b03dfd2c490704e59939e4a8c639d0372c | 18e670a5b0ffc1ae57d6b45552e9c38f5bced1db | /SettingsSample/AppDelegate.swift | 81fa1ca873309e85e6203ac75d1825072a8d53b3 | [] | no_license | TDCIAN/SettingViewSample | 82da5906869c7d70acb9c8bafc349b88929a1259 | 19e2f0b4d17f9037a8bb0ac7997e8b7b2271dd1c | refs/heads/master | 2020-12-07T16:08:30.171425 | 2020-01-09T07:29:52 | 2020-01-09T07:29:52 | 232,748,873 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,422 | swift | //
// AppDelegate.swift
// SettingsSample
//
// Created by hexlant_01 on 2020/01/09.
// Copyright © 2020 hexlant_01. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
// MARK: UISceneSession Lifecycle
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
// Called when a new scene session is being created.
// Use this method to select a configuration to create the new scene with.
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
}
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
// Called when the user discards a scene session.
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
}
}
| [
393222,
393224,
393230,
393250,
344102,
393261,
393266,
163891,
213048,
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,
377060,
327914,
205036,
393456,
393460,
336123,
418043,
336128,
385280,
262404,
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,
385451,
262573,
393647,
385458,
262586,
344511,
262592,
360916,
369118,
328177,
328179,
328182,
328189,
328192,
164361,
328206,
410128,
393747,
254490,
188958,
385570,
33316,
197159,
377383,
352821,
188987,
418363,
369223,
385609,
385616,
352856,
352864,
369253,
262760,
352874,
352887,
254587,
377472,
336512,
148105,
377484,
352918,
98968,
344744,
361129,
336555,
385713,
434867,
164534,
336567,
328378,
164538,
328386,
352968,
344776,
418507,
352971,
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,
336711,
361288,
328522,
336714,
426841,
197468,
254812,
361309,
361315,
361322,
328573,
377729,
369542,
222128,
345035,
345043,
386003,
386011,
386018,
386022,
435187,
328702,
328714,
361489,
386069,
336921,
386073,
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,
181654,
230809,
181670,
181673,
181678,
337329,
181681,
181684,
181690,
361917,
181696,
337349,
181703,
337365,
271839,
329191,
361960,
329194,
116210,
337398,
337415,
329226,
419339,
419343,
419349,
345625,
419355,
370205,
419359,
419362,
394786,
370213,
419368,
419376,
206395,
214593,
419400,
419402,
353867,
419406,
419410,
345701,
394853,
222830,
370297,
353919,
403075,
345736,
198280,
403091,
345749,
345757,
345762,
419491,
345765,
419497,
419501,
370350,
419506,
419509,
337592,
419512,
419517,
337599,
419527,
419530,
419535,
272081,
394966,
419542,
419544,
181977,
345818,
419547,
419550,
419559,
337642,
419563,
337645,
370415,
141051,
337659,
337668,
362247,
395021,
362255,
321299,
116509,
345887,
378663,
345905,
354106,
354111,
247617,
354117,
370503,
329544,
370509,
354130,
247637,
337750,
370519,
313180,
354142,
345964,
345967,
345970,
345974,
403320,
354172,
247691,
337808,
247700,
329623,
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,
321879,
379233,
354673,
321910,
248186,
420236,
379278,
272786,
354727,
338352,
330189,
338381,
338386,
256472,
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,
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,
158761,
396336,
199728,
330800,
396339,
339001,
388154,
388161,
347205,
248904,
330826,
248914,
339036,
412764,
257120,
265320,
248951,
420984,
330889,
347287,
248985,
339097,
44197,
380070,
339112,
249014,
330958,
330965,
265432,
265436,
388319,
388347,
175375,
159005,
175396,
208166,
273708,
372015,
347441,
372018,
199988,
44342,
175415,
396600,
437566,
175423,
437570,
437575,
437583,
331088,
437587,
331093,
396633,
175450,
437595,
175457,
208227,
175460,
175463,
265580,
437620,
175477,
249208,
175483,
175486,
249214,
175489,
249218,
249224,
249227,
249234,
175513,
175516,
396705,
175522,
355748,
380332,
396722,
208311,
372163,
216517,
380360,
216522,
339404,
372176,
208337,
339412,
413141,
339417,
249308,
339420,
249312,
339424,
339428,
339434,
249328,
69113,
372228,
339461,
208398,
380432,
175635,
339503,
265778,
265795,
396872,
265805,
224853,
224857,
257633,
224870,
372327,
257646,
372337,
224884,
224887,
224890,
224894,
224897,
372353,
216707,
339588,
126596,
421508,
224904,
224909,
159374,
11918,
339601,
224913,
126610,
224916,
224919,
126616,
208538,
224922,
224926,
224929,
224932,
224936,
257704,
224942,
257712,
224947,
257716,
257720,
224953,
257724,
224959,
257732,
224965,
224969,
339662,
224975,
257747,
224981,
224986,
224993,
257761,
257764,
224999,
339695,
225012,
257787,
225020,
339710,
257790,
225025,
257794,
339721,
257801,
257804,
225038,
257807,
372499,
167700,
225043,
225048,
257819,
225053,
184094,
225058,
339747,
339749,
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,
217157,
421960,
356439,
421990,
266350,
356466,
266362,
381068,
225423,
250002,
250004,
225429,
356506,
225437,
135327,
225441,
438433,
225444,
438436,
225447,
438440,
225450,
258222,
225455,
430256,
225458,
225461,
225466,
389307,
225470,
381120,
372929,
430274,
225475,
389320,
225484,
225487,
225490,
266453,
225493,
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,
250199,
250202,
332125,
250210,
348522,
348525,
348527,
332152,
250238,
389502,
332161,
356740,
332172,
373145,
340379,
389550,
324030,
266687,
340451,
160234,
127471,
340472,
324094,
266754,
324099,
324102,
324111,
340500,
324117,
324131,
332324,
381481,
324139,
356907,
324142,
356916,
324149,
324155,
348733,
324160,
324164,
356934,
348743,
381512,
324170,
324173,
324176,
389723,
332380,
373343,
381545,
340627,
184982,
373398,
258721,
332453,
332459,
389805,
332463,
381617,
332471,
332483,
332486,
373449,
332493,
357069,
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,
324472,
398201,
119674,
324475,
430972,
340861,
324478,
340858,
324481,
373634,
398211,
324484,
324487,
381833,
324492,
324495,
324498,
430995,
324501,
324510,
422816,
324513,
398245,
201637,
324524,
340909,
324533,
5046,
324538,
324541,
398279,
340939,
340941,
209873,
340957,
431072,
398306,
340963,
209895,
201711,
349172,
349180,
439294,
209943,
250914,
357410,
185380,
357418,
209965,
209968,
209971,
209975,
209979,
209987,
209990,
341071,
349267,
250967,
210010,
341091,
210025,
210027,
210030,
210036,
210039,
341113,
210044,
349308,
152703,
160895,
349311,
210052,
210055,
349319,
210067,
210071,
210077,
210080,
210084,
251044,
185511,
210088,
210095,
210098,
210107,
210115,
332997,
210127,
333009,
210131,
333014,
210138,
210143,
218354,
251128,
218360,
275706,
275712,
275715,
275721,
349459,
333078,
251160,
349484,
349491,
251189,
415033,
251210,
357708,
210260,
259421,
365921,
333154,
251235,
374117,
333162,
234866,
390516,
333175,
357755,
251271,
136590,
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,
333399,
366172,
333413,
423528,
423532,
210544,
415353,
333439,
415361,
267909,
153227,
333498,
333511,
210631,
259788,
358099,
333534,
366307,
366311,
431851,
366318,
210672,
366321,
366325,
210695,
268041,
210698,
366348,
210706,
399128,
333594,
210719,
358191,
210739,
366387,
399159,
358200,
325440,
366401,
341829,
325446,
46920,
341834,
341838,
341843,
415573,
358234,
341851,
350045,
399199,
259938,
399206,
358255,
399215,
268143,
358259,
341876,
333689,
243579,
325504,
333698,
333708,
333724,
382890,
350146,
358339,
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,
350410,
260298,
350416,
350422,
350425,
268507,
334045,
350445,
375026,
358644,
350458,
350461,
350464,
325891,
350467,
350475,
375053,
268559,
350480,
432405,
350486,
350490,
325914,
325917,
350493,
350498,
350504,
358700,
350509,
391468,
358704,
358713,
358716,
383306,
334161,
383321,
383330,
383333,
391530,
383341,
334203,
268668,
194941,
391563,
366990,
416157,
268701,
342430,
375208,
326058,
375216,
334262,
334275,
326084,
358856,
195039,
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,
334528,
260801,
350917,
154317,
391894,
154328,
416473,
64230,
113388,
342766,
375535,
203506,
342776,
391937,
391948,
326416,
375568,
375571,
375574,
162591,
326441,
326451,
326454,
244540,
326460,
375612,
260924,
326467,
244551,
326473,
326477,
326485,
416597,
326490,
342874,
326502,
375656,
433000,
326507,
326510,
211825,
211831,
351097,
392060,
359295,
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,
359451,
261147,
211998,
261153,
261159,
359470,
359476,
343131,
384098,
384101,
367723,
384107,
187502,
384114,
343154,
212094,
351364,
384135,
384139,
384143,
351381,
384151,
384160,
384168,
367794,
244916,
384181,
367800,
384188,
351423,
384191,
384198,
326855,
244937,
384201,
253130,
343244,
384208,
146642,
384224,
359649,
343270,
351466,
384246,
351479,
384249,
343306,
261389,
359694,
253200,
261393,
384275,
384283,
245020,
384288,
245029,
171302,
351534,
376110,
245040,
384314,
425276,
384323,
212291,
343365,
212303,
367965,
343393,
343398,
367980,
425328,
343409,
154999,
253303,
343417,
327034,
245127,
384397,
245136,
245142,
245145,
343450,
245148,
245151,
245154,
245157,
245162,
327084,
359865,
384443,
146876,
327107,
384453,
327110,
327115,
327117,
359886,
359890,
343507,
368092,
343534,
343539,
368119,
343544,
368122,
409091,
359947,
359955,
359983,
343630,
327275,
245357,
138864,
155254,
155273,
368288,
245409,
425638,
425649,
155322,
425662,
155327,
245460,
155351,
155354,
212699,
245475,
155363,
245483,
155371,
409335,
155393,
155403,
245525,
155422,
360223,
155438,
155442,
155447,
155461,
360261,
376663,
155482,
261981,
425822,
155487,
376671,
155490,
155491,
327531,
261996,
376685,
261999,
262002,
327539,
262005,
147317,
425845,
262008,
262011,
155516,
155521,
155525,
360326,
155531,
262027,
262030,
262033,
262036,
262039,
262042,
155549,
262045,
262048,
262051,
327589,
155559,
155562,
155565,
393150,
393169,
384977,
155611,
155619,
253923,
155621,
327654,
253926,
204784,
393203,
360438,
253943,
393206,
393212,
155646
] |
6971bc26ae38d87c1e787f195171305403f8ecec | 95bc5dd26299ce88d5711936bc96ab44e2520a61 | /EngineMacTests/T1007_SnakeFifo.swift | 518549322976813b5f1d5207ec25aa24255d6226 | [
"MIT"
] | permissive | neoneye/SwiftSnakeEngine | 0ba4f19453a000a92c967392d5d557e2b94684e4 | cc42b99a6b4a5ae1b98f16f9b06dc76ce4f7da61 | refs/heads/develop | 2023-06-10T16:44:19.582429 | 2020-12-22T21:27:37 | 2020-12-22T21:27:37 | 237,633,117 | 16 | 1 | MIT | 2023-06-06T11:53:13 | 2020-02-01T15:16:03 | Swift | UTF-8 | Swift | false | false | 1,304 | swift | // MIT license. Copyright (c) 2020 Simon Strandgaard. All rights reserved.
import XCTest
@testable import EngineMac
class T1007_SnakeFifo: XCTestCase {
typealias SnakeFifoString = SnakeFifo<String>
func test0_equatable() {
var fifo0 = SnakeFifoString()
fifo0.appendAndGrow("a")
fifo0.appendAndGrow("b")
fifo0.appendAndGrow("c")
XCTAssertEqual(fifo0, fifo0)
var fifo1 = SnakeFifoString()
fifo1.appendAndGrow("a")
fifo1.appendAndGrow("b")
XCTAssertNotEqual(fifo0, fifo1)
fifo1.appendAndGrow("c")
XCTAssertEqual(fifo0, fifo1)
fifo1.appendAndGrow("d")
XCTAssertNotEqual(fifo0, fifo1)
}
func test1_hashable() {
var fifo0 = SnakeFifoString(array: ["a", "b", "c"])
let fifo1a = SnakeFifoString(array: ["b", "c", "d"])
let fifo1b = SnakeFifoString(array: ["b", "c", "d"])
var set0 = Set<SnakeFifoString>()
XCTAssertFalse(set0.contains(fifo0))
XCTAssertFalse(set0.contains(fifo1a))
XCTAssertFalse(set0.contains(fifo1b))
set0.insert(fifo0)
set0.insert(fifo1a)
XCTAssertEqual(set0.count, 2)
XCTAssertTrue(set0.contains(fifo0))
XCTAssertTrue(set0.contains(fifo1a))
XCTAssertTrue(set0.contains(fifo1b))
fifo0.append("x")
XCTAssertFalse(set0.contains(fifo0))
set0.insert(fifo0)
XCTAssertEqual(set0.count, 3)
XCTAssertTrue(set0.contains(fifo0))
}
}
| [
-1
] |
d81d920f39693a4713dd10cc1d8d6248f4ca3606 | bb21f9d789c65d461f3c734ef2f05da3c08bbc6f | /FZBuildingBlock/Tools/Classes/AssociatedObjects/FZAssociationPolicyType.swift | e074faac0f7d4de3b52cf1d8efad5774f59188c4 | [
"MIT"
] | permissive | FranZhou/FZBuildingBlock | e174cec8887da8ba40b2c3b13bdd94cc1ee73d75 | 6a2dd1e9244ab0917e880c0ede99de67c4c6d3c8 | refs/heads/master | 2021-07-23T09:10:29.077423 | 2021-07-06T08:55:43 | 2021-07-06T08:55:43 | 171,595,670 | 22 | 2 | null | null | null | null | UTF-8 | Swift | false | false | 234 | swift | //
// FZAssociationPolicyType.swift
// FZBuildingBlock
//
// Created by FranZhou on 2020/9/4.
//
import Foundation
public enum FZAssociationPolicyType: NSString, CaseIterable {
case normal = "normal"
case weak = "weak"
}
| [
-1
] |
e218cb1f6ac456433d49d457fa1a225e9bf1f6ff | 9b7b36c02b5731d570cb711cd123f75ecdb754d6 | /Pupillometer/Pupillometer/PersonPageViewController.swift | 416105f9d45e7c6c5ef32f3d38ccb353cf197125 | [] | no_license | cwhurley/PupillometerIOS | 9418b9a459f463b6e48fca9912a81c1224231c54 | 89ab4291a8989b43c7ef777ad523950aa4e24d82 | refs/heads/master | 2020-06-25T02:36:30.051786 | 2017-10-06T10:10:49 | 2017-10-06T10:10:49 | 96,952,512 | 0 | 0 | null | 2017-09-29T07:30:11 | 2017-07-12T01:33:24 | Swift | UTF-8 | Swift | false | false | 4,097 | swift | //
// PersonPageViewController.swift
// Pupillometer
//
// Created by Chris Hurley on 20/8/17.
// Copyright © 2017 Chris Hurley. All rights reserved.
//
//https://stackoverflow.com/questions/40887721/sending-an-email-from-swift-3
//https://stackoverflow.com/questions/34929932/round-up-double-to-2-decimal-places
import Foundation
import UIKit
import MessageUI
class PersonPageViewController: UIViewController, MFMailComposeViewControllerDelegate {
// Outlets
@IBOutlet var nameLabel: UILabel!
@IBOutlet var genderLabel: UILabel!
@IBOutlet var eyeLabel: UILabel!
@IBOutlet var ageLabel: UILabel!
@IBOutlet var notesLabel: UILabel!
@IBOutlet var firstImage: UIImageView!
@IBOutlet var secondImage: UIImageView!
@IBOutlet weak var resultsLabel: UILabel!
@IBOutlet weak var scrollView: UIScrollView!
@IBOutlet weak var differenceLabel: UILabel!
// Variables
var personData: Person!
var email = String()
var subject = String()
var first = String()
var second = String()
var diff = String()
override var preferredStatusBarStyle: UIStatusBarStyle {
return .lightContent
}
override func viewDidLoad() {
super.viewDidLoad()
first = String(format: "%.2f mm", personData.firstResult)
second = String(format: "%.2f mm", personData.secondResult)
diff = String(format: "%.2f mm", personData.difference)
nameLabel.text = personData.name
genderLabel.text = personData.gender
eyeLabel.text = personData.eye
ageLabel.text = personData.age
notesLabel.text = personData.notes
resultsLabel.text = "First: " + first + "\nSecond: " + second
differenceLabel.text = diff
firstImage.image = personData.firstImage as! UIImage
secondImage.image = personData.secondImage as! UIImage
// Do any additional setup after loading the view.
}
// Scroll view settings
func scrollViewDidScroll(scrollView: UIScrollView) {
if scrollView.contentOffset.x>0 {
scrollView.contentOffset.x = 0
}
}
override var prefersStatusBarHidden: Bool {
return true
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
// Email button
@IBAction func sendEmailButtonTapped(sender: AnyObject) {
if !MFMailComposeViewController.canSendMail()
{
print("Mail services are not available")
return
}
let composeVC = MFMailComposeViewController()
composeVC.mailComposeDelegate = self
// Configure the fields of the interface.
composeVC.setToRecipients([""])
composeVC.setSubject("")
composeVC.setMessageBody(
"To \n \n Name: \(personData.name!) \n Date: \(personData.date!) \n Age: \(personData.age!) \n Gender: \(personData.gender!) \n Eye: \(personData.eye!) \n First: \(first) \n Second: \(second) \n Difference: \(diff) \n Notes: \(personData.notes!) \n The first and second images are added to this email." ,
isHTML: false)
let imageData: NSData = UIImagePNGRepresentation(firstImage.image!)! as NSData
let imageData2: NSData = UIImagePNGRepresentation(secondImage.image!)! as NSData
composeVC.addAttachmentData(imageData as Data, mimeType: "image/png", fileName: "firstImage")
composeVC.addAttachmentData(imageData2 as Data, mimeType: "image/png", fileName: "secondImage")
// Present the view controller modally.
self.present(composeVC, animated: true, completion: nil)
}
// Calling email function
func mailComposeController(_ controller: MFMailComposeViewController,
didFinishWith result: MFMailComposeResult, error: Error?) {
// Dismiss the mail compose view controller.
controller.dismiss(animated: true, completion: nil)
}
}
| [
-1
] |
0041cc9d9442eb1339c439ed29f9f5e0e5c39a1b | fdd62a9c1e2f0382f7447f68eeb7d0296972fb78 | /RecursionExample/Operator+Overflow.swift | 88295a1b7b516a8bf692d493d8fabb10f4645f8b | [] | no_license | 1985wasagoodyear/FibTest | 3101f6c26a06fdd83b314297ca25b18306fbc965 | bac41f20bacd8c9ca4ea4a6858326b4cf1c3290e | refs/heads/master | 2021-07-25T02:09:54.354462 | 2020-05-13T22:28:55 | 2020-05-13T22:28:55 | 170,217,677 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 528 | swift | //
// Operator+Overflow.swift
// Created 5/13/20
// Using Swift 5.0
//
// Copyright © 2020 Kevin Yu. All rights reserved.
//
// https://github.com/1985wasagoodyear
//
import Foundation
infix operator ?+
func ?+<T: AdditiveArithmetic & BinaryInteger>(lhs: T, rhs: T) -> T? {
if (lhs > Int.max - Int(rhs)) {
return nil
}
return lhs + rhs
}
func ?+<T: AdditiveArithmetic & UnsignedInteger>(lhs: T, rhs: T) -> T? {
if (lhs > UInt.max - UInt(rhs)) {
return nil
}
return lhs + rhs
}
| [
-1
] |
1b643826eb8d643b9265156654b7bdc68f8d435e | 3251ad5aa143a252275f5515b5445d33be965dfe | /Carthage/Checkouts/Bond/Tests/BondTests/NSObjectTests.swift | 14afc1f6d99acc3c521561657b3deffa77c80ffb | [
"MIT"
] | permissive | romanmiller/boar-ios | 940614d8fdb742ad4b20979e83794068c6c7d91f | c148804dd5d846b4686c87df7aeeec730e448e0d | refs/heads/master | 2021-04-28T15:39:04.896869 | 2018-03-24T16:48:45 | 2018-03-24T16:48:45 | 121,993,503 | 0 | 0 | null | 2018-02-18T21:44:01 | 2018-02-18T21:44:01 | null | UTF-8 | Swift | false | false | 5,212 | swift | //
// NSObjectTests.swift
// Bond
//
// Created by Srdan Rasic on 23/10/2016.
// Copyright © 2016 Swift Bond. All rights reserved.
//
@testable import Bond
import ReactiveKit
import XCTest
class NSObjectTests: XCTestCase {
class TestObject: NSObject {
}
var object: TestObject!
override func setUp() {
super.setUp()
object = TestObject()
}
func testBndDeallocated() {
object.deallocated.expect([.completed], expectation: expectation(description: #function))
object = nil
waitForExpectations(timeout: 1)
}
func testBndBag() {
let d1 = SimpleDisposable()
let d2 = SimpleDisposable()
object.bag.add(disposable: d1)
d2.dispose(in: object.bag)
object = nil
XCTAssert(d1.isDisposed)
XCTAssert(d2.isDisposed)
}
}
class NSObjectKVOTests: XCTestCase {
class TestObject: NSObject, BindingExecutionContextProvider {
@objc dynamic var property: Any! = "a"
@objc dynamic var propertyString: String = "a"
var bindingExecutionContext: ExecutionContext {
return .immediate
}
}
var object: TestObject!
override func setUp() {
super.setUp()
object = TestObject()
}
// func testObservation() {
// let subject = object.reactive.keyPath("property", ofType: String.self)
// subject.expectNext(["a", "b", "c"])
// object.property = "b"
// object.property = "c"
// }
//
// func testBinding() {
// let subject = object.reactive.keyPath("property", ofType: String.self)
// subject.expectNext(["a", "b", "c"])
// SafeSignal.just("b").bind(to: subject)
// XCTAssert((object.property as! String) == "b")
// SafeSignal.just("c").bind(to: subject)
// XCTAssert((object.property as! String) == "c")
// }
//
// func testOptionalObservation() {
// let subject = object.reactive.keyPath("property", ofType: Optional<String>.self)
// subject.expectNext(["a", "b", nil, "c"])
// object.property = "b"
// object.property = nil
// object.property = "c"
// }
//
// func testOptionalBinding() {
// let subject = object.reactive.keyPath("property", ofType: Optional<String>.self)
// subject.expectNext(["a", "b", nil, "c"])
// SafeSignal.just("b").bind(to: subject)
// XCTAssert((object.property as! String) == "b")
// SafeSignal.just(nil).bind(to: subject)
// XCTAssert(object.property == nil)
// SafeSignal.just("c").bind(to: subject)
// XCTAssert((object.property as! String) == "c")
// }
func testExpectedTypeObservation() {
let subject = object.reactive.keyPath("property", ofExpectedType: String.self)
subject.expectNext(["a", "b", "c"])
object.property = "b"
object.property = "c"
}
func testExpectedTypeBinding() {
let subject = object.reactive.keyPath("property", ofExpectedType: String.self)
subject.expectNext(["a", "b", "c"])
SafeSignal.just("b").bind(to: subject)
XCTAssert((object.property as! String) == "b")
SafeSignal.just("c").bind(to: subject)
XCTAssert((object.property as! String) == "c")
}
func testExpectedTypeFailure() {
let subject = object.reactive.keyPath("property", ofExpectedType: String.self)
subject.expect([.next("a"), .failed(NSObject.KVOError.notConvertible(""))])
object.property = 5
}
func testExpectedTypeOptionalObservation() {
let subject = object.reactive.keyPath("property", ofExpectedType: Optional<String>.self)
subject.expectNext(["a", "b", nil, "c"])
object.property = "b"
object.property = nil
object.property = "c"
}
func testExpectedTypeOptionalBinding() {
let subject = object.reactive.keyPath("property", ofExpectedType: Optional<String>.self)
subject.expectNext(["a", "b", nil, "c"])
SafeSignal.just("b").bind(to: subject)
XCTAssert((object.property as! String) == "b")
SafeSignal.just(nil).bind(to: subject)
XCTAssert(object.property == nil)
SafeSignal.just("c").bind(to: subject)
XCTAssert((object.property as! String) == "c")
}
func testExpectedTypeOptionalFailure() {
let subject = object.reactive.keyPath("property", ofExpectedType: Optional<String>.self)
subject.expect([.next("a"), .failed(NSObject.KVOError.notConvertible(""))])
object.property = 5
}
func testDeallocation() {
let subject = object.reactive.keyPath("property", ofExpectedType: String.self)
subject.expect([.next("a"), .completed], expectation: expectation(description: #function))
weak var weakObject = object
object = nil
XCTAssert(weakObject == nil)
waitForExpectations(timeout: 1)
}
func testSwift4Observation() {
object.reactive.keyPath(\.propertyString).expectNext(["a", "b", "c"])
object.propertyString = "b"
SafeSignal.just("c").bind(to: object, keyPath: \.propertyString)
XCTAssert(object.propertyString == "c")
}
}
| [
296670
] |
44571a91f545d3e171796c49dac198f90636bd2f | eff62713406a8b321d7580bc26e1ddf3cec97fe3 | /Swift/Problems/797_AllPathsFromSourceToTarget.playground/Contents.swift | fa53aecc750f88b455c6d1430aa8329bde47d203 | [
"MIT"
] | permissive | milanpanchal/LeetCode | 4097d6a260ac46c18e820f790cc8a47d563b8c83 | 5ba7a7427ce4d8a994dd1ff3d04474b075be6552 | refs/heads/master | 2022-12-10T07:44:20.782450 | 2020-09-07T04:06:27 | 2020-09-07T04:06:27 | 260,590,675 | 13 | 2 | null | null | null | null | UTF-8 | Swift | false | false | 2,475 | swift | /*:
# 797. All Paths From Source to Target (Medium)
https://leetcode.com/problems/all-paths-from-source-to-target/
---
### Problem Statement:
Given a directed, acyclic graph of `N` nodes. Find all possible paths from node `0` to node `N-1`, and return them in any order.
The graph is given as follows: the nodes are 0, 1, ..., graph.length - 1. graph[i] is a list of all nodes j for which the edge (i, j) exists.
### Example:
```
Input: [[1,2], [3], [3], []]
Output: [[0,1,3],[0,2,3]]
Explanation: The graph looks like this:
0--->1
| |
v v
2--->3
There are two paths: 0 -> 1 -> 3 and 0 -> 2 -> 3.
```
### Notes:
+ The number of nodes in the graph will be in the range `[2, 15]`.
+ You can print different paths in any order, but you should keep the order of nodes inside one path.
*/
import UIKit
// 26 / 26 test cases passed.
// Status: Accepted
// Runtime: 152 ms
// Memory Usage: 21.7 MB
class Solution {
func allPathsSourceTarget(_ graph: [[Int]]) -> [[Int]] {
var result = [[Int]]()
var path = [0] // path always starts from node 0
dfs(graph, 0, &path, &result)
return result
}
private func dfs(_ graph: [[Int]], _ node: Int, _ path: inout [Int], _ result: inout [[Int]]) {
if node == graph.count - 1 { // path ends at node N - 1
result.append(path)
}
for n in graph[node] {
path.append(n)
dfs(graph, n, &path, &result)
path.removeLast() // backtracking
}
}
}
class Solution1 {
var seenPaths = [Int: [[Int]]]()
func allPathsSourceTarget(_ graph: [[Int]]) -> [[Int]] {
guard graph.count > 0 else {
return [[]]
}
return allPaths(from: 0, to: graph.count - 1, graph: graph)
}
func allPaths(from: Int, to: Int, graph: [[Int]]) -> [[Int]] {
if from == to {
return [[to]]
}
if let paths = seenPaths[from] {
return paths
}
var paths = [[Int]]()
for next in graph[from] {
let nextPaths = allPaths(from: next, to: to, graph:graph)
paths += nextPaths
}
let fromPaths = paths.map { [from] + $0 }
seenPaths[from] = fromPaths
return fromPaths
}
}
let sol = Solution()
sol.allPathsSourceTarget([[1,2],[3],[3],[]]) // [[0,1,3], [0,2,3]]
| [
-1
] |
7eb448595464ce95242a565f5fdd17bd5f1e7cb2 | c4227ad3083296fa88ce54f1b03e0afdeb489a58 | /FSNotes iOS/CloudDriveManager.swift | 57c8da15070332d3a926167527cd3e351fd76186 | [
"MIT"
] | permissive | renesugar/fsnotes | 9c59cb9a573fa5b58626af0ec9fbbe36831d47c9 | b062f56e2ece7dbdb33cf9f64ef271994c1d293b | refs/heads/master | 2021-05-21T23:14:22.047262 | 2020-04-02T21:20:02 | 2020-04-02T21:20:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 12,753 | swift | //
// CloudDriveManager.swift
// FSNotes iOS
//
// Created by Oleksandr Glushchenko on 6/13/18.
// Copyright © 2018 Oleksandr Glushchenko. All rights reserved.
//
import Foundation
import UIKit
class CloudDriveManager {
private var cloudDriveResults = [URL]()
private var delegate: ViewController
private var storage: Storage
private var currentDownloadingList = [URL]()
private var resultsDict: [Int: URL] = [:]
private var contentDateDict: [Int: Date] = [:]
private var fileNameDict: [Int: String] = [:]
private var whiteList = [Int]()
private let workerQueue: OperationQueue = {
let workerQueue = OperationQueue()
workerQueue.name = "co.fluder.fsnotes.manager.browserdatasource.workerQueue"
workerQueue.maxConcurrentOperationCount = 1
workerQueue.qualityOfService = .background
return workerQueue
}()
public let metadataQuery = NSMetadataQuery()
init(delegate: ViewController, storage: Storage) {
metadataQuery.operationQueue = workerQueue
metadataQuery.searchScopes = [
NSMetadataQueryUbiquitousDocumentsScope
]
metadataQuery.notificationBatchingInterval = 1
metadataQuery.predicate = NSPredicate(format: "%K LIKE '*'", NSMetadataItemFSNameKey)
metadataQuery.sortDescriptors = [NSSortDescriptor(key: NSMetadataItemFSContentChangeDateKey, ascending: false)]
self.delegate = delegate
self.storage = storage
}
@objc func queryDidFinishGathering(notification: NSNotification) {
let query = notification.object as? NSMetadataQuery
if let results = query?.results as? [NSMetadataItem] {
self.saveCloudDriveResultsCache(results: results)
}
self.metadataQuery.enableUpdates()
}
@objc func handleMetadataQueryUpdates(notification: NSNotification) {
guard let metadataQuery = notification.object as? NSMetadataQuery else { return }
metadataQuery.disableUpdates()
self.change(notification: notification)
self.download(notification: notification)
self.remove(notification: notification)
if let results = metadataQuery.results as? [NSMetadataItem] {
self.saveCloudDriveResultsCache(results: results)
}
self.delegate.updateNotesCounter()
metadataQuery.enableUpdates()
}
private var lastChangeDate = Date.init(timeIntervalSince1970: .zero)
private func saveCloudDriveResultsCache(results: [NSMetadataItem]) {
print("Gathering results saving")
for result in results {
let key = metadataQuery.index(ofResult: result)
if let url = result.value(forAttribute: NSMetadataItemURLKey) as? URL {
if resultsDict[key] == nil {
resultsDict[key] = url.resolvingSymlinksInPath()
}
}
if let date = result.value(forAttribute: NSMetadataItemFSContentChangeDateKey) as? Date {
contentDateDict[key] = date
}
if let name = result.value(forAttribute: NSMetadataItemFSNameKey) as? String {
fileNameDict[key] = name
}
}
var quantity = 0
for result in results {
if let status = result.value(forAttribute: NSMetadataUbiquitousItemDownloadingStatusKey) as? String, status != NSMetadataUbiquitousItemDownloadingStatusCurrent,
let url = (result.value(forAttribute: NSMetadataItemURLKey) as? URL)?.resolvingSymlinksInPath(), !currentDownloadingList.contains(url) {
do {
try FileManager.default.startDownloadingUbiquitousItem(at: url)
currentDownloadingList.append(url)
quantity += 1
print("DL starts at url: \(url)")
} catch {
print("DL starts failed at url: \(url) – \(error)")
}
}
}
print("Finish iCloud Drive results saving. DL started for: \(quantity) items")
}
private func change(notification: NSNotification) {
guard let changedMetadataItems = notification.userInfo?[NSMetadataQueryUpdateChangedItemsKey] as? [NSMetadataItem] else { return }
print("Changed: \(changedMetadataItems.count)")
for item in changedMetadataItems {
let index = metadataQuery.index(ofResult: item)
let date = item.value(forAttribute: NSMetadataItemFSContentChangeDateKey) as? Date
let fileName = item.value(forAttribute: NSMetadataItemFSNameKey) as? String
guard let url = (item.value(forAttribute: NSMetadataItemURLKey) as? URL)?.resolvingSymlinksInPath() else { continue }
if contentDateDict[index] == date
&& resultsDict[index] == url
&& fileNameDict[index] == fileName
&& changedMetadataItems.count != 1
&& !whiteList.contains(index) {
continue
}
guard self.storage.allowedExtensions.contains(url.pathExtension) else {
continue
}
if let note = storage.getBy(url: url) {
if note.isTextBundle() && !note.isFullLoadedTextBundle() {
continue
}
guard let date = note.getFileModifiedDate() else { continue }
if note.loadTags() {
DispatchQueue.main.async {
self.delegate.sidebarTableView.loadAllTags()
}
}
if changedMetadataItems.count == 1 {
_ = CoreNote(fileURL: note.url)
}
note.forceReload()
if let editorNote = EditTextView.note, editorNote.isEqualURL(url: url), date > note.modifiedLocalAt {
note.modifiedLocalAt = date
self.delegate.refreshTextStorage(note: note)
}
note.invalidateCache()
self.delegate.notesTable.reloadRow(note: note)
self.resolveConflict(url: url)
continue
}
if let prevNote = getOldNote(item: item, url: url) {
print("Found old, renamed: \(url)")
DispatchQueue.main.async {
self.delegate.notesTable.removeByNotes(notes: [prevNote])
prevNote.url = url
if prevNote.loadTags() {
DispatchQueue.main.async {
self.delegate.sidebarTableView.loadAllTags()
}
}
prevNote.parseURL()
self.resultsDict[index] = url
self.delegate.notesTable.insertRow(note: prevNote)
}
continue
}
if isDownloaded(url: url), storage.allowedExtensions.contains(url.pathExtension) {
self.add(url: url)
}
}
}
private func getOldNote(item: NSMetadataItem, url: URL) -> Note? {
let index = self.metadataQuery.index(ofResult: item)
guard let prevURL = resultsDict[index] else { return nil }
if resultsDict[index] != url {
if let note = storage.getBy(url: prevURL) {
return note
}
}
return nil
}
private func download(notification: NSNotification) {
if let addedMetadataItems = notification.userInfo?[NSMetadataQueryUpdateAddedItemsKey] as? [NSMetadataItem] {
for item in addedMetadataItems {
guard let url = (item.value(forAttribute: NSMetadataItemURLKey) as? URL)?.resolvingSymlinksInPath() else { continue }
if isDownloaded(url: url), storage.allowedExtensions.contains(url.pathExtension) {
self.add(url: url)
continue
}
if FileManager.default.isUbiquitousItem(at: url) {
try? FileManager.default.startDownloadingUbiquitousItem(at: url)
let index = metadataQuery.index(ofResult: item)
if !whiteList.contains(index) {
whiteList.append(index)
}
}
}
}
}
private func remove(notification: NSNotification) {
if let removedMetadataItems = notification.userInfo?[NSMetadataQueryUpdateRemovedItemsKey] as? [NSMetadataItem] {
for item in removedMetadataItems {
guard let url = (item.value(forAttribute: NSMetadataItemURLKey) as? URL)?.resolvingSymlinksInPath(), let note = storage.getBy(url: url) else { continue }
self.storage.removeNotes(notes: [note], completely: true) {_ in
DispatchQueue.main.async {
self.delegate.notesTable.removeByNotes(notes: [note])
}
}
}
}
}
private func isDownloaded(url: URL) -> Bool {
var isDownloaded: AnyObject? = nil
do {
try (url as NSURL).getResourceValue(&isDownloaded, forKey: URLResourceKey.ubiquitousItemDownloadingStatusKey)
} catch _ {}
if isDownloaded as? URLUbiquitousItemDownloadingStatus == URLUbiquitousItemDownloadingStatus.current {
return true
}
return false
}
public func add(url: URL) {
guard self.storage.getBy(url: url) == nil, let note = self.storage.initNote(url: url) else { return }
if note.isTextBundle() && !note.isFullLoadedTextBundle() {
return
}
if note.loadTags() {
DispatchQueue.main.async {
self.delegate.sidebarTableView.loadAllTags()
}
}
_ = note.reload()
print("New note imported: \(url)")
self.storage.noteList.append(note)
self.delegate.notesTable.insertRow(note: note)
}
public func resolveConflict(url: URL) {
if let conflicts = NSFileVersion.unresolvedConflictVersionsOfItem(at: url as URL) {
for conflict in conflicts {
guard let localizedName = conflict.localizedName else {
continue
}
let localizedUrl = URL(fileURLWithPath: localizedName)
let ext = url.pathExtension
let name = localizedUrl.deletingPathExtension().lastPathComponent
let date = Date.init()
let dateFormatter = ISO8601DateFormatter()
dateFormatter.formatOptions = [
.withYear,
.withMonth,
.withDay,
.withTime
]
let dateString: String = dateFormatter.string(from: date)
let conflictName = "\(name) (CONFLICT \(dateString)).\(ext)"
let to = url.deletingLastPathComponent().appendingPathComponent(conflictName)
let project = Storage.sharedInstance().getMainProject()
let note = Note(url: conflict.url, with: project)
guard let conflictNote = Storage.sharedInstance().initNote(url: to) else { continue }
note.load(tags: false)
if note.content.length > 0 {
conflictNote.content = note.content
conflictNote.write()
}
conflict.isResolved = true
}
}
}
private func moveToTrash(note: Note, url: URL) {
note.url = url
DispatchQueue.main.async {
var isTrash = false
let sidebarItem = self.delegate.sidebarTableView.getSidebarItem()
if let sidebarItem = sidebarItem, sidebarItem.isTrash() {
isTrash = true
}
if !isTrash,
self.delegate.isFit(note: note, sidebarItem: sidebarItem),
let i = self.delegate.notesTable.notes.firstIndex(where: {$0 === note}) {
self.delegate.notesTable.notes.remove(at: i)
self.delegate.notesTable.deleteRows(at: [IndexPath(row: i, section: 0)], with: .automatic)
}
if isTrash {
self.delegate.notesTable.notes.insert(note, at: 0)
self.delegate.notesTable.insertRows(at: [IndexPath(row: 0, section: 0)], with: .automatic)
}
note.parseURL()
}
}
}
| [
-1
] |
104616f0103535d9cea4f5f2a199e40bfdf73f8b | 65fd9537c6651c6276ae15f4489ecb36a60cded1 | /FIT/View/EventTableViewCell.swift | 1f92ed6d7facdce89d89e2bbed3aaca6a705c927 | [] | no_license | Akarys94/FIT01 | 99e2db039b9751e6c4e8cbbe593ef5551713ee04 | 120273f6c9cf732dc1c9f19576c07f69355c10a7 | refs/heads/master | 2020-09-08T00:43:47.410999 | 2019-11-11T10:55:31 | 2019-11-11T10:55:31 | 220,960,467 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 912 | swift | //
// EventTableViewCell.swift
// FIT
//
// Created by Aka on 29.10.19.
// Copyright © 2019 Aka. All rights reserved.
//
import UIKit
class EventTableViewCell: UITableViewCell {
@IBOutlet weak var titleLabel: UILabel!
@IBOutlet weak var eventImage: UIImageView!
@IBOutlet weak var timeLabel: UILabel!
@IBOutlet weak var subTitleLabel: UILabel!
func setData(event: Event){
let data = event.title
let a = data.replacingOccurrences(of: "<[^>]+>", with: "", options: String.CompareOptions.regularExpression, range: nil)
let b = a.replacingOccurrences(of: "&[^;]+;", with: "", options: String.CompareOptions.regularExpression, range: nil)
print(b)
titleLabel.text = b
timeLabel.text = event.time
subTitleLabel.text = event.subtitle
eventImage.image = UIImage(named: event.type)
}
}
| [
-1
] |
d7805a1b23d607825749e7c66d6b70d4b90900c0 | f3e70c613b8acd009dea411ae185c48da705e361 | /Quiz/ViewController.swift | e0ca8c594d9662dba31d3e938fc9baa59ffd77f4 | [] | no_license | drewhagen/iOS-application-fun | ab91dba70342e1eb494f67109a55c94914fe4e1c | fb35129af587d1a4a3d97ce6b2fb87a27cf6e839 | refs/heads/master | 2021-01-10T12:18:56.939662 | 2016-02-10T02:30:16 | 2016-02-10T02:30:16 | 50,887,874 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 502 | swift | //
// ViewController.swift
// Quiz
//
// Created by Drew Hagen on 2/9/16.
// Copyright © 2016 Big Nerd Ranch. 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.
}
}
| [
307212,
278543,
309264,
317473,
292915,
286775,
237624,
288827,
290875,
286786,
284740,
243786,
286796,
278606,
237655,
307288,
200802,
309347,
309349,
309351,
309353,
356460,
307311,
278657,
276612,
280710,
303242,
311437,
278675,
307353,
299165,
278686,
278693,
100521,
307379,
280760,
184504,
280770,
227523,
280772,
280775,
280777,
313550,
276686,
229585,
307410,
280797,
278749,
278752,
301284,
280808,
280810,
286963,
280821,
286965,
280826,
280832,
276736,
309506,
278791,
287004,
287005,
287007,
282917,
233767,
282922,
282926,
307516,
278845,
289088,
311624,
287055,
289112,
311645,
289120,
289121,
227688,
313706,
299374,
199024,
276849,
280947,
313733,
233869,
227740,
285087,
289187,
289190,
289191,
305577,
289196,
305582,
285103,
278968,
127418,
293308,
278973,
289224,
279011,
281078,
236022,
233980,
287231,
279041,
279046,
215562,
281107,
279064,
236057,
281118,
295460,
289318,
309807,
281142,
279096,
234043,
277057,
129604,
301637,
158285,
311913,
281202,
277108,
287350,
281218,
281221,
227984,
303760,
117399,
228000,
295586,
287399,
277171,
277180,
285377,
285378,
287437,
299727,
226009,
277224,
199402,
234223,
312049,
289524,
226038,
234232,
230147,
226055,
299786,
295696,
295699,
281373,
295711,
228127,
281380,
234279,
283433,
289578,
312107,
293682,
285495,
289596,
283453,
289600,
279360,
293700,
283461,
279380,
295766,
279386,
308064,
293742,
162672,
277364,
207738,
291709,
303998,
183173,
304008,
324491,
304012,
234380,
304015,
226196,
275358,
277406,
289697,
234402,
291755,
277420,
277422,
297903,
324528,
230323,
277429,
277430,
234423,
277432,
277433,
277434,
230328,
293816,
281530,
291774,
295874,
299973,
234465,
168936,
289771,
183278,
277487,
293874,
293875,
293888,
277508,
277512,
275466,
234511,
300057,
197664,
197677,
304174,
300086,
234551,
300089,
238653,
293961,
300107,
203858,
300116,
281703,
296042,
277612,
164974,
312433,
300149,
189557,
234619,
285837,
226447,
234641,
349332,
226454,
226455,
226456,
226458,
302235,
285855,
234665,
283839,
277696,
228551,
279751,
279754,
230604,
298189,
302286,
230608,
290004,
290006,
189655,
302295,
298202,
298204,
298206,
298207,
290016,
363743,
298211,
290020,
228585,
120054,
333048,
292102,
312586,
296216,
130346,
113972,
300358,
238920,
234829,
296272,
230737,
230745,
306540,
300400,
216433,
290166,
333179,
290175,
275842,
224643,
298375,
300432,
310673,
226705,
304531,
304536,
304540,
288165,
304550,
304551,
144811,
370093,
279982,
286126,
277935,
282035,
292277,
296374,
130487,
144822,
292280,
306633,
288205,
286158,
280015,
310734,
286162,
163289,
280029,
280030,
286175,
280031,
286189,
282095,
308721,
302580,
292341,
310773,
296436,
290299,
286204,
288251,
290303,
294411,
286234,
284192,
294433,
282145,
284197,
296487,
286249,
296489,
226878,
288321,
228932,
226887,
284235,
288332,
284236,
288331,
284239,
284240,
212561,
284242,
292435,
226896,
300629,
276054,
228945,
280146,
212573,
40545,
284261,
306791,
286314,
284275,
284276,
284277,
294518,
314996,
276087,
284279,
292478,
284287,
284289,
284293,
284298,
278157,
282262,
280219,
284315,
284317,
282270,
284323,
282275,
284328,
198315,
313007,
284336,
302767,
284341,
286390,
300727,
276150,
282301,
296638,
302788,
282311,
294600,
284361,
239310,
282320,
317137,
239314,
284373,
282329,
282338,
284391,
282346,
358127,
288501,
282357,
358139,
282365,
286462,
282368,
358147,
282377,
300817,
282389,
282393,
278298,
329499,
315170,
282403,
304933,
315177,
282411,
159541,
282426,
288579,
298830,
307029,
298843,
241499,
188253,
292701,
200549,
296811,
315250,
284534,
292730,
284570,
294812,
284574,
284576,
284577,
284580,
284586,
276396,
282548,
296901,
298951,
165832,
301012,
301016,
292824,
294877,
294889,
298989,
231405,
227315,
237556
] |
9c520ef22f85965e1d0af232c759b0639ef22b88 | ab7e0c8bc5dc77a438b752bb76a3eddc7093dfa5 | /XSwiftTemplate/Model/CategoryModel.swift | 3368cb79d6a245aeec0fefff604b87cd144c0c44 | [] | no_license | xpf0000/CityQ | 87628a55f7169af053a7e8c99cd305444b71853a | 23fcae2a292cde27a270e89700f28fd10e95cd70 | refs/heads/master | 2020-04-16T02:24:40.303662 | 2017-02-15T15:08:37 | 2017-02-15T15:08:37 | 61,472,111 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 569 | swift | //
// CategoryModel.swift
// chengshi
//
// Created by X on 15/11/23.
// Copyright © 2015年 XSwiftTemplate. All rights reserved.
//
import UIKit
class CategoryModel: Reflect {
var id=""
var title=""
var url=""
var name = ""
override func setValue(value: AnyObject?, forKey key: String) {
if(value == nil)
{
return
}
super.setValue(value, forKey: key)
}
override func setValue(value: AnyObject?, forUndefinedKey key: String) {
}
}
| [
-1
] |
bc23ea1eca560fcccc838da9fa3a9cb72698a045 | 3697a2f8517aa5040de5c5af6ae142396d51facf | /BasketballApp/src/main.page.swift | b105bdeeb80c705a42f38780c7d8b08e98d8bdb7 | [] | no_license | bulantsevajo/basketball-app | 01e8963360a32440d36881ea6d78ec78ebe6856e | 9af3916702b66b887173fd5a58841276659abd17 | refs/heads/master | 2022-10-27T17:36:32.315020 | 2019-04-05T13:25:36 | 2019-04-05T13:25:36 | 66,064,792 | 1 | 1 | null | 2022-10-23T10:08:21 | 2016-08-19T08:05:01 | Objective-C | UTF-8 | Swift | false | false | 568 | swift | import ScadeKit
class MainPageAdapter: SCDLatticePageAdapter {
// page adapter initialization
override func load(path: String) {
super.load(path)
let button1 = self.page.getWidgetByName("button1") as! SCDWidgetsButton
button1.OnClick.append(SCDWidgetsEventHandler{event in
self.navigation.go("training.page", transition: "FORWARD_PUSH")
})
let button2 = self.page.getWidgetByName("button2") as! SCDWidgetsButton
button2.OnClick.append(SCDWidgetsEventHandler{event in
self.navigation.go("trips.page", transition: "FORWARD_PUSH")
})
}
}
| [
-1
] |
deafc3171bed208d9eac9dd9767000f1d08e0831 | 64d2f1f3f9b2523a7ea00e466242a2c6a3474625 | /FoodieExplorer/ContentView.swift | ab0b8771d768b8258acd156210aa494b0feb098a | [] | no_license | roy8965/FoodieExplorer | ef2998da8037938da70a540f1bfc12286546ec47 | 5baa11588bdf5e63ccb2e3427effdde35db687c1 | refs/heads/master | 2020-09-02T09:00:15.295265 | 2019-11-02T17:04:03 | 2019-11-02T17:04:03 | 219,185,295 | 1 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 352 | swift | //
// ContentView.swift
// FoodieExplorer
//
// Created by Roy on 11/2/19.
// Copyright © 2019 Roy. All rights reserved.
//
import SwiftUI
struct ContentView: View {
var body: some View {
Text("Hello, World!")
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
| [
33292,
343054,
386582,
370198,
267800,
398870,
357409,
264739,
252964,
153644,
372271,
375348,
343100,
377406,
214591,
349760,
147012,
368710,
345165,
356437,
260702,
377438,
345188,
168045,
377982,
369287,
126601,
192656,
347284,
374935,
356504,
176806,
337594,
325307,
384701,
374977,
333510,
204999,
356551,
333514,
379094,
327382,
352984,
379103,
355043,
264933,
66799,
369905,
108815,
108816,
326415,
108818,
260372,
369946,
66845,
378669,
353585,
307506,
180531,
372030,
420678,
323401,
272204,
353614,
391504,
385889,
357220,
359786,
207725,
361325,
276339,
24462,
256912,
337812,
341916,
254374,
412588,
372654,
223152,
342451,
375227,
208320,
362436,
393669,
373194,
208332,
357838,
208339,
212948,
208343,
398298,
194525,
162298,
360956
] |
0959cd38508cfcc8d5531ddca4c4c82857672f9b | 58472e4b557ceb85d8c6578a8ab4e0502056dcc3 | /Demo_iOS13_SearchBar/Demo_iOS13_SearchBar/ViewController.swift | 7e7a8bfb0d42a3e52f644a925e20c00a318a3d10 | [] | no_license | bhargavthakkarPromact/Demo_iOS13_SearchBar | d42a4f655f68b5700befec9db5aba3a0867fc1d0 | a38f92e6da4e4c483513dd8a279c502c19d7458b | refs/heads/master | 2020-11-25T20:31:38.773154 | 2019-12-18T12:38:36 | 2019-12-18T12:38:36 | 228,832,923 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,407 | swift | //
// ViewController.swift
// Demo_iOS13_SearchBar
//
// Created by Bhargav Thakkar on 18/12/19.
// Copyright © 2019 Bhargav Thakkar. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
let search = UISearchController(searchResultsController: nil)
search.obscuresBackgroundDuringPresentation = false
search.searchBar.placeholder = "Type something here..."
search.searchBar.scopeButtonTitles = ["Title", "Genre", "Rating", "Actor"]
navigationItem.searchController = search
//Adding token to the search bar using Search Token Class
let iosToken = UISearchToken(icon: UIImage(systemName: "tag"), text: "iOS")
let shopToken = UISearchToken(icon: UIImage(systemName: "cart.fill"), text: "Shop")
search.searchBar.searchTextField.insertToken(iosToken, at: 0)
search.searchBar.searchTextField.insertToken(shopToken, at: 1)
search.searchBar.searchTextField.tokenBackgroundColor = .systemBlue
//disable the copying and deletion of search
search.searchBar.searchTextField.allowsCopyingTokens = false
search.searchBar.searchTextField.allowsDeletingTokens = false
search.searchBar.searchTextField.clearButtonMode = .never
}
}
| [
-1
] |
f5e37313a7753f231aeee841c42514d6c9539f9e | 3bc8ff277138d0f023c8cb90f91af7846e620e4c | /SesameWatchKit Extension/View/HostingController.swift | 76292a3e7fe91c8470d74d44887d43628c067131 | [
"MIT"
] | permissive | sasayoshi/SesameSDK_iOS_with_DemoApp | ba7f04a67efd318ed0b318c5b66dd0d6afa4ef88 | bb4d02ec135bc6fe3d64a54601eaaa64bcc2772b | refs/heads/master | 2022-11-21T18:02:26.361649 | 2020-07-26T16:45:53 | 2020-07-26T16:45:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 599 | swift | //
// HostingController.swift
// SesameWatchKit Extension
//
// Created by YuHan Hsiao on 2020/5/30.
// Copyright © 2020 CandyHouse. All rights reserved.
//
import WatchKit
import Foundation
import SwiftUI
class HostingController: WKHostingController<ContentView<DeviceModelProvider>> {
override var body: ContentView<DeviceModelProvider> {
return ContentView(viewModel: .init())
}
}
//struct HostingController_Previews: PreviewProvider {
// static var previews: some View {
// return ContentView(viewModel: .init(deviceProvider: MockDeviceProvider()))
// }
//}
| [
-1
] |
4dc4e08c9f920a86486d87ac7157de1bdefcae04 | f429b9a13d9d7fa0fcffdb7d74fb46b275aeb142 | /Table/SimpleDataManager.swift | a45862a5b520d0acd5d22f8222d95824f684d706 | [] | no_license | zoejessica/Furnish | 0eefeab5dab53b8017315c081c00360ff69b1851 | c867bc6798791e476125b08a97f98545c4743685 | refs/heads/master | 2021-01-10T01:47:12.868768 | 2016-01-16T22:51:29 | 2016-01-16T22:51:29 | 49,648,477 | 1 | 2 | null | null | null | null | UTF-8 | Swift | false | false | 1,546 | swift | //
// SquirrelsDataManager.swift
// Frozen
//
// Created by Zoë Smith on 13/01/2016.
// Copyright © 2016 Hot Beverage. All rights reserved.
//
import UIKit
public class SimpleDataManager<T> : DataFurnisher {
public typealias ItemType = T
public typealias Transform = (T, NSIndexPath) -> CellFurnisherType?
public var transform : Transform?
public var items : [T]?
public init() {}
public
func numberOfItemsInSection(section: Int) -> Int {
return items?.count ?? 0
}
public
func furnisherForIndexPath(indexPath: NSIndexPath) -> CellFurnisherType? {
if let i = items?[indexPath.row], t = transform {
return t(i, indexPath)
} else {
return nil
}
}
}
/*
In Andy's implementation this is a fetched results controller.
- It handles creating Tasks from their NSManagedObject equivalents in Core Data
private func managedTaskForTask(task: Task) -> NSManagedObject {
// uses the id property in a predicate to retrieve the task
}
For example, you can create a Task from a ManagedTask:
extension Task {
init(managedTask: NSManagedObject) {
self.id = managedTask.valueForKey("id") as! String
self.title = managedTask.valueForKey("title") as! String
self.dueDate = managedTask.valueForKey("dueDate") as! NSDate
}
}
The question here is whether to use the Squirrel model as the [items] or whether to use another struct that knows how to configure a cell
*/
| [
-1
] |
31211de3290271d4e6b4e48ddb1e6ae67d9d06a0 | 8f92e3b1c62853299471bb230c5ca2bcdcf66421 | /MarsMission/Repository/ForecastRepositoryImplemantation.swift | 46f67c2b2fe6c07ca65bf939a05861982d1b22c7 | [] | no_license | ThanyaniDev/MarsMission | 5e2fc64044fbf4c6684039ecf4e4a7c66517c5dd | 5f3c01613a7178e7dce2bf0617e31d870a9b2939 | refs/heads/main | 2023-01-20T11:52:52.773564 | 2020-11-30T12:42:16 | 2020-11-30T12:42:16 | 309,339,888 | 1 | 0 | null | 2020-12-03T09:05:16 | 2020-11-02T10:47:27 | Swift | UTF-8 | Swift | false | false | 616 | swift | //
// ForecastRepositoryImplementation.swift
// MarsMission
//
// Created by Thanyani on 2020/11/04.
//
import Foundation
class ForecastRepositoryImplementation: ForecastRepository {
let forecastService: ForecastService
init(forecastService: ForecastService) {
self.forecastService = forecastService
}
func fetchForecast(completion: @escaping (Result<Forecast, Error>) -> Void) {
forecastService.fetchForecast { result in
switch result {
case .success(let forecast):
completion(Result.success(forecast))
case .failure(let error):
completion(Result.failure(error))
}
}
}
}
| [
-1
] |
1d2a150e94c8cbc273f6bb4b9bc86858141795c4 | 7dc4a56d306b4b160ce1aeeeda48ced63f24f072 | /Catalogr/Extensions/UIImageExtension.swift | e27daf111a6dab75cd1742998735ec3cd830bb75 | [
"MIT"
] | permissive | jfeigel/Catalogr | 7928865215e0f3a2c515b31840514eab81914f8b | 608cba856f9b0634a3260b90ee35e28d413a0c18 | refs/heads/master | 2022-11-11T09:48:39.829010 | 2020-06-26T20:36:24 | 2020-06-26T20:36:24 | 250,938,879 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,017 | swift | //
// UIImageExtension.swift
// Catalogr
//
// Created by jfeigel on 4/21/20.
// Copyright © 2020 jfeigel. All rights reserved.
//
import UIKit
extension UIImage {
func resize(_ maxDimension: CGFloat, contentMode: UIView.ContentMode = .scaleAspectFit) -> UIImage {
var width: CGFloat
var height: CGFloat
var newImage: UIImage
let size = self.size
let aspectRatio: CGFloat = size.width / size.height
switch contentMode {
case .scaleAspectFit:
if aspectRatio > 1 {
width = maxDimension
height = maxDimension / aspectRatio
} else {
width = maxDimension * aspectRatio
height = maxDimension
}
default:
fatalError("UIImage.resize(): FATAL: Unimplemented ContentMode")
}
let renderer = UIGraphicsImageRenderer(size: CGSize(width: width, height: height))
newImage = renderer.image { context in
self.draw(in: CGRect(x: 0, y: 0, width: width, height: height))
}
return newImage
}
}
| [
-1
] |
d0d920cef578861b650c3585f3fbe50db4bfa5bb | 274510c850f0d90c8bbe7629b971a2c68418d4bf | /CS_001/CS_001/ViewController.swift | 687dd906f9daf4670909f05bbeaebbcbfafac36a | [] | no_license | WillOfTheWang/PersonalProject | 72b398b31849c5ba0da92af5bcb36970f876ec8e | 16c277c4424fa90f16410e6bd2e912893aa27be7 | refs/heads/master | 2020-04-07T01:02:09.510460 | 2018-11-16T22:34:58 | 2018-11-16T22:34:58 | 157,928,333 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 499 | swift | //
// ViewController.swift
// CS_001
//
// Created by William W. on 11/16/18.
// Copyright © 2018 Draphix. 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.
}
}
| [
307212,
278543,
292915,
286775,
288827,
290875,
243786,
286796,
237655,
307288,
200802,
307311,
292990,
278657,
276612,
280710,
303242,
311437,
278675,
307353,
278693,
100521,
307379,
184504,
280760,
280770,
227523,
280772,
280775,
276686,
229585,
307410,
280790,
280797,
286963,
280821,
286965,
280824,
280826,
280832,
309506,
278791,
287007,
282917,
233767,
307516,
289088,
311624,
289120,
289121,
227688,
313706,
299374,
199024,
276849,
278897,
311684,
313733,
285087,
289187,
305582,
285103,
278968,
293308,
278973,
311761,
279011,
276965,
281078,
236022,
233980,
287231,
279041,
279046,
215562,
281107,
279064,
281118,
295460,
289318,
309807,
279096,
234043,
277057,
129604,
301637,
158285,
281202,
277108,
281205,
287350,
285321,
117399,
228000,
225955,
287399,
326311,
277171,
285377,
285378,
287437,
299727,
226009,
277224,
199402,
234223,
312049,
289524,
226038,
234232,
230147,
226055,
299786,
295699,
295711,
228127,
281380,
152356,
283433,
293682,
285495,
289596,
283453,
279360,
293700,
283461,
308064,
293742,
162672,
277364,
207738,
291709,
303998,
183173,
304008,
324491,
304012,
304015,
277406,
289697,
234402,
283556,
324528,
230323,
234423,
277432,
291774,
295874,
299973,
234465,
168936,
183278,
293874,
293875,
277512,
275466,
293909,
304174,
300086,
234551,
300089,
238653,
293961,
300107,
281701,
281703,
296042,
277612,
164974,
312433,
300149,
189557,
234619,
226447,
234641,
349332,
285855,
283839,
277696,
228548,
228551,
279751,
279754,
230604,
298189,
302286,
230608,
290006,
302295,
189655,
363743,
290020,
228585,
120054,
300288,
292102,
312586,
130346,
300358,
238920,
234829,
296272,
230737,
230745,
306540,
300400,
216433,
333179,
290175,
275842,
224643,
298375,
300432,
226705,
310673,
304531,
304536,
304540,
304550,
304551,
286126,
277935,
282035,
292277,
296374,
130487,
144822,
292280,
306633,
286158,
280015,
310734,
286162,
163289,
286175,
282095,
308721,
296436,
302580,
310773,
288251,
290299,
290303,
286234,
282143,
294433,
284197,
296487,
296489,
226878,
288321,
226887,
284235,
288331,
226896,
212561,
284242,
292435,
300629,
276054,
282202,
212573,
40545,
284261,
306791,
286314,
284275,
314996,
294518,
276087,
292478,
284287,
284289,
276099,
284298,
278157,
280219,
282270,
282275,
284328,
198315,
313007,
302767,
284336,
284341,
286390,
300727,
282301,
302788,
282311,
284361,
239310,
282320,
239314,
282329,
282338,
282346,
358127,
282357,
358139,
282365,
286462,
282368,
358147,
282377,
300817,
282389,
282393,
278298,
329499,
315170,
282403,
282411,
159541,
282426,
288577,
288579,
307029,
241499,
296811,
315250,
284534,
292730,
294812,
284576,
284580,
284586,
276396,
10179,
296901,
165832,
301012,
301016,
292824,
294889,
231405,
227315,
237556,
237564
] |
5dee0c2b22550ee38acd98b6849c0e5204194a80 | 5aea6f6f75c3ce762988cadd7c7950180123a52f | /LiquidMeister v2/Data/Managers/DataManager.swift | 2a71da33dd8b436ef0beb93bccb7ff4fdce4a71b | [] | no_license | Michaelcraun/LiquidMeister | 95af4a87ce17644866abd489973b2b0ce3d55605 | e5fa3ea721e30c4071aa525e7db38a63cb85a8e9 | refs/heads/master | 2023-01-27T16:59:18.463471 | 2020-12-06T19:54:31 | 2020-12-06T19:54:31 | 319,118,377 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 13,967 | swift | //
// DataManager.swift
// LiquidMeister v2
//
// Created by Michael Craun on 6/24/18.
// Copyright © 2018 CraunicProductions. All rights reserved.
//
import Foundation
import Firebase
enum FIRKey: String {
case sharedRecipes
case users
case usernames
enum UserKey: String {
case customers
case inventory
case items
case providerID
case recipes
case username
enum CustomerKey: String {
case email
case id
case lastBottle
case name
case notes
case nicotine
case pg
case vg
}
enum InventoryKey: String {
case id
case manufacturer
case name
case orderAt
case stock
case pg
case vg
}
enum ItemKey: String {
case id
case name
case price
case size
}
enum RecipeKey: String {
case favorite
case id
case ingredients
case name
case notes
case rating
case username
}
}
}
class DataManager {
static var instance = DataManager()
// MARK: - Completion handlers
typealias Authorization = (Bool) -> Void
typealias BottleInitialized = (Bool) -> Void
typealias UserData = ([String : Any]) -> Void
typealias Usernames = ([String]) -> Void
// MARK: - Data variables
var bottle = Bottle()
var currentUserID: String?
var delegate: UIViewController!
var username: String?
var missingIngredient: InventoryItem?
var inventoryItemToDelete: InventoryItem?
var affectedRecipes = [PersonalRecipe]()
var customers = [Customer]() {
didSet {
customers = customers.sortByName()
}
}
var inventory = [InventoryItem]() {
didSet {
inventory = inventory.sortByName()
}
}
var items = [Item]() {
didSet {
items = items.sortByName()
}
}
var recipes = [PersonalRecipe]() {
didSet {
recipes = recipes.sortByName()
}
}
var sharedRecipes = [SharedRecipe]() {
didSet {
}
}
var REF_DATABASE: DatabaseReference
var REF_USERS: DatabaseReference
var REF_SHARED_RECIPES: DatabaseReference
init() {
currentUserID = Auth.auth().currentUser?.uid
REF_DATABASE = Database.database().reference()
REF_USERS = REF_DATABASE.child(FIRKey.users.rawValue)
REF_SHARED_RECIPES = REF_DATABASE.child(FIRKey.sharedRecipes.rawValue)
fetchUserData { (finished) in
self.bottle.ingredients = self.bottle.fetchBaseIngredients()
}
}
// MARK: - Data initialization functions
func fetchUserData(_ completion: @escaping BottleInitialized) {
guard let userID = currentUserID else { return }
customers = []
inventory = []
items = []
recipes = []
fetchUserData(with: userID) { (userData) in
let userCustomers = userData[FIRKey.UserKey.customers.rawValue] as? [String : Any] ?? [ : ]
let userInventory = userData[FIRKey.UserKey.inventory.rawValue] as? [String : Any] ?? [ : ]
let userItems = userData[FIRKey.UserKey.items.rawValue] as? [String : Any] ?? [ : ]
let userRecipes = userData[FIRKey.UserKey.recipes.rawValue] as? [String : Any] ?? [ : ]
let userUsername = userData[FIRKey.UserKey.username.rawValue] as? String ?? "No username listed"
self.username = userUsername
for value in userCustomers.values {
if let dictionary = value as? [String : Any] {
let customer = dictionary.customer()
var shouldAdd = true
for value in self.customers {
if value.id == customer.id {
shouldAdd = false
break
}
}
if shouldAdd {
self.customers.append(dictionary.customer())
}
}
}
for value in userInventory.values {
if let dictionary = value as? [String : Any] {
let inventoryItem = dictionary.inventoryItem()
var shouldAdd = true
for value in self.inventory {
if value.id == inventoryItem.id {
shouldAdd = false
break
}
}
if shouldAdd {
self.inventory.append(dictionary.inventoryItem())
}
}
}
for value in userItems.values {
if let dictionary = value as? [String : Any] {
let item = dictionary.item()
var shouldAdd = true
for value in self.items {
if value.id == item.id {
shouldAdd = false
break
}
}
if shouldAdd {
self.items.append(dictionary.item())
}
}
}
for value in userRecipes.values {
if let dictionary = value as? [String : Any] {
let recipe = dictionary.personalRecipe()
var shouldAdd = true
for value in self.recipes {
if value.id == recipe.id {
shouldAdd = false
break
}
}
if shouldAdd {
self.recipes.append(dictionary.personalRecipe())
}
}
}
completion(true)
}
}
//--------------------------------
// MARK: - Authorization functions
//--------------------------------
func registerViaFirebase(email: String, password: String, username: String) {
fetchUsernamesForRegistration({ (usernames) in
if usernames.contains(username) {
self.delegate.showAlert(.usernameExists)
} else {
Auth.auth().createUser(withEmail: email, password: password) { (user, error) in
if error == nil {
guard let user = user else { return }
let nicotine = InventoryItem(name: "Nicotine", orderAt: 125.0, stock: 0.0, pgPercentage: 50.0, vgPercentage: 50.0)
let pg = InventoryItem(name: "Propylene Glycol", orderAt: 250.0, stock: 0.0, pgPercentage: 100.0, vgPercentage: 0.0)
let vg = InventoryItem(name: "Vegetable Glycerin", orderAt: 250.0, stock: 0.0, pgPercentage: 0.0, vgPercentage: 100.0)
let userData: [String : Any] = [FIRKey.UserKey.providerID.rawValue : user.user.providerID,
FIRKey.UserKey.username.rawValue : username,
FIRKey.UserKey.inventory.rawValue: [nicotine.dictionary(), pg.dictionary(), vg.dictionary()]]
self.REF_USERS.child(user.user.uid).updateChildValues(userData)
self.updateUsernamesWithUsername(username)
self.delegate.performSegue(withIdentifier: SegueID.showHome.rawValue, sender: nil)
} else {
self.handleFIRAuthError(error)
}
}
}
})
}
func loginViaFirebase(email: String, password: String) {
Auth.auth().signIn(withEmail: email, password: password) { (user, error) in
if error == nil {
guard let user = user else { return }
let userData: [String : Any] = [FIRKey.UserKey.providerID.rawValue : user.user.providerID]
self.REF_USERS.child(user.user.uid).updateChildValues(userData)
self.delegate.performSegue(withIdentifier: SegueID.showHome.rawValue, sender: nil)
} else {
self.handleFIRAuthError(error)
}
}
}
private func fetchUsernamesForRegistration(_ completion: @escaping Usernames) {
var usernames = [String]()
REF_DATABASE.observeSingleEvent(of: .value) { (snapshot) in
guard let databaseSnapshot = snapshot.children.allObjects as? [DataSnapshot] else { return }
for child in databaseSnapshot {
if child.key == FIRKey.usernames.rawValue {
usernames = child.value as? [String] ?? [ ]
}
}
completion(usernames)
}
}
private func updateUsernamesWithUsername(_ username: String) {
fetchUsernamesForRegistration { (usernames) in
var takenUsernames = usernames
takenUsernames.append(username)
self.REF_DATABASE.updateChildValues([FIRKey.usernames.rawValue : [takenUsernames]])
}
}
func logout() {
do {
try Auth.auth().signOut()
delegate.performSegue(withIdentifier: SegueID.showLogin.rawValue, sender: nil)
} catch let error {
handleFIRAuthError(error)
}
}
//---------------------------
// MARK: - Database functions
//---------------------------
func updateFirebaseCustomer(_ customer: Customer) {
REF_USERS.child(currentUserID!).child(FIRKey.UserKey.customers.rawValue).updateChildValues(customer.dictionary())
delegate.dismiss(animated: true, completion: nil)
}
func updateFirebaseInventoryItem(_ inventoryItem: InventoryItem) {
REF_USERS.child(currentUserID!).child(FIRKey.UserKey.inventory.rawValue).updateChildValues(inventoryItem.dictionary())
delegate.dismiss(animated: true, completion: nil)
}
func updateFirebaseItem(_ item: Item) {
REF_USERS.child(currentUserID!).child(FIRKey.UserKey.items.rawValue).updateChildValues(item.dictionary())
delegate.dismiss(animated: true, completion: nil)
}
func updateFirebasePersonalRecipe(_ personalRecipe: PersonalRecipe) {
REF_USERS.child(currentUserID!).child(FIRKey.UserKey.recipes.rawValue).updateChildValues(personalRecipe.dictionary())
guard let _ = delegate as? LibraryVC else {
delegate.dismiss(animated: true, completion: nil)
return
}
}
func removeFirebaseCustomer(_ customer: Customer) {
REF_USERS.child(currentUserID!).child(FIRKey.UserKey.customers.rawValue).child(customer.id!).removeValue()
}
func removeFirebaseInventoryItem(_ inventoryItem: InventoryItem) {
for recipe in affectedRecipes {
var newIngredients = [Ingredient]()
for ingredient in recipe.ingredients {
if ingredient.item.id != inventoryItem.id {
newIngredients.append(ingredient)
}
}
recipe.ingredients = newIngredients
updateFirebasePersonalRecipe(recipe)
}
REF_USERS.child(currentUserID!).child(FIRKey.UserKey.inventory.rawValue).child(inventoryItem.id!).removeValue()
inventoryItemToDelete = nil
affectedRecipes = [ ]
}
func removeFirebaseItem(_ item: Item) {
REF_USERS.child(currentUserID!).child(FIRKey.UserKey.items.rawValue).child(item.id!).removeValue()
}
func removeFirebasePersonalRecipe(_ personalRecipe: PersonalRecipe) {
REF_USERS.child(currentUserID!).child(FIRKey.UserKey.recipes.rawValue).child(personalRecipe.id!).removeValue()
}
//---------------------------
// MARK: - Observer functions
//---------------------------
private func fetchSharedRecipes() {
REF_SHARED_RECIPES.observeSingleEvent(of: .value) { (snapshot) in
// TODO: Fetch shared recipes from database
}
}
// MARK: - Observers
private func fetchUserData(with id: String, completion: @escaping UserData) {
REF_USERS.observeSingleEvent(of: .value) { (snapshot) in
guard let userSnapshot = snapshot.children.allObjects as? [DataSnapshot] else { return }
for user in userSnapshot {
if user.key == id {
let userData = user.value as? [String : Any] ?? [ : ]
completion(userData)
}
}
}
}
//-----------------------
// MARK: - Error handling
//-----------------------
private func handleFIRAuthError(_ error: Error?) {
guard let errorCode = AuthErrorCode(rawValue: error!._code) else {
delegate.showAlert(.firebaseError)
return
}
switch errorCode {
case .emailAlreadyInUse: delegate.showAlert(.firEmailAlreadyInUse)
case .wrongPassword: delegate.showAlert(.firWrongPassword)
case .invalidEmail: delegate.showAlert(.firInvalidEmail)
case .userNotFound: delegate.showAlert(.firUserNotFound)
default: delegate.showAlert(.firebaseError)
}
}
}
| [
-1
] |
8089d3e5e1c9a8857d4fd4bb3fe3a0d01a28d800 | f68d0eb36f219c75af9b6fe497754364f90bf133 | /Meme2.0/AppDelegate.swift | 6bd9c09e6717b9f55c9cb1907a72f6a6ebf82880 | [] | no_license | MohammedAlaqil/Meme-2.0 | 5dd8d267bebfadc49f6244fa70dc0c3fe28c945c | 8ed59562cd52116654a7f85715802935990d4094 | refs/heads/master | 2022-11-13T22:07:23.052710 | 2020-06-28T22:37:22 | 2020-06-28T22:37:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 2,194 | swift | //
// AppDelegate.swift
// Meme 2.0
//
// Created by M7md on 08/04/2019.
// Copyright © 2019 Udacity. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
var memes = [Meme]()
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}
func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
}
| [
229380,
229383,
229385,
278539,
294924,
229388,
278542,
229391,
327695,
229394,
278548,
229397,
229399,
229402,
352284,
229405,
278556,
278559,
229408,
278564,
294950,
229415,
229417,
327722,
237613,
229422,
360496,
229426,
237618,
229428,
311349,
286774,
286776,
319544,
286778,
204856,
229432,
352318,
286791,
237640,
286797,
278605,
311375,
163920,
237646,
196692,
319573,
311383,
278623,
278626,
319590,
311400,
278635,
303212,
278639,
131192,
278648,
237693,
303230,
327814,
303241,
131209,
417930,
303244,
311436,
319633,
286873,
286876,
311460,
311469,
32944,
327862,
286906,
327866,
180413,
286910,
131264,
286916,
295110,
286922,
286924,
286926,
319694,
286928,
131281,
278743,
278747,
295133,
155872,
319716,
237807,
303345,
286962,
303347,
131314,
229622,
327930,
278781,
278783,
278785,
237826,
319751,
278792,
286987,
319757,
311569,
286999,
319770,
287003,
287006,
287009,
287012,
287014,
287016,
287019,
311598,
287023,
262448,
311601,
295220,
287032,
155966,
319809,
319810,
278849,
319814,
311623,
319818,
311628,
229709,
319822,
287054,
278865,
229717,
196963,
196969,
139638,
213367,
106872,
319872,
311683,
319879,
311693,
65943,
319898,
311719,
278952,
139689,
278957,
311728,
278967,
180668,
311741,
278975,
319938,
278980,
98756,
278983,
319945,
278986,
319947,
278990,
278994,
311767,
279003,
279006,
188895,
172512,
287202,
279010,
279015,
172520,
319978,
279020,
172526,
311791,
279023,
172529,
279027,
319989,
172534,
180727,
164343,
279035,
311804,
287230,
279040,
303617,
287234,
279045,
172550,
303623,
172552,
320007,
287238,
279051,
172558,
279055,
303632,
279058,
303637,
279063,
279067,
172572,
279072,
172577,
295459,
172581,
295461,
279082,
311850,
279084,
172591,
172598,
279095,
172607,
172609,
172612,
377413,
172614,
213575,
172618,
303690,
33357,
287309,
303696,
279124,
172634,
262752,
172644,
311911,
189034,
295533,
172655,
172656,
352880,
295538,
189039,
172660,
287349,
189040,
189044,
287355,
287360,
295553,
172675,
295557,
311942,
303751,
287365,
352905,
311946,
279178,
287371,
311951,
287377,
172691,
287381,
311957,
221850,
287386,
230045,
172702,
287390,
303773,
172705,
287394,
172707,
303780,
164509,
287398,
205479,
279208,
287400,
172714,
295595,
279212,
189102,
172721,
287409,
66227,
303797,
189114,
287419,
303804,
328381,
287423,
328384,
172737,
279231,
287427,
312005,
312006,
107208,
172748,
287436,
107212,
172751,
287440,
295633,
172755,
303827,
279255,
172760,
287450,
303835,
279258,
189149,
303838,
213724,
312035,
279267,
295654,
279272,
230128,
312048,
312050,
230131,
205564,
303871,
230146,
328453,
295685,
230154,
33548,
312077,
295695,
295701,
230169,
369433,
295707,
328476,
295710,
230175,
295720,
303914,
279340,
205613,
279353,
230202,
312124,
328508,
222018,
295755,
377676,
148302,
287569,
303959,
230237,
279390,
230241,
279394,
303976,
336744,
303981,
303985,
303987,
328563,
279413,
303991,
303997,
295806,
295808,
295813,
304005,
320391,
304007,
213895,
304009,
304011,
230284,
304013,
295822,
279438,
189325,
189329,
295825,
304019,
189331,
213902,
58262,
304023,
304027,
279452,
234648,
410526,
279461,
279462,
304042,
213931,
230327,
304055,
287675,
197564,
230334,
304063,
238528,
304065,
213954,
189378,
156612,
295873,
213963,
197580,
312272,
304084,
304090,
320481,
304106,
320490,
312302,
328687,
320496,
304114,
295928,
320505,
312321,
295945,
230413,
295949,
197645,
320528,
140312,
295961,
238620,
197663,
304164,
304170,
304175,
238641,
312374,
238652,
238655,
230465,
238658,
336964,
132165,
296004,
205895,
320584,
238666,
296021,
402518,
336987,
230497,
296036,
296040,
361576,
205931,
296044,
279661,
205934,
164973,
312432,
279669,
337018,
189562,
279679,
304258,
279683,
222340,
205968,
296084,
238745,
304285,
238756,
205991,
222377,
165035,
337067,
238766,
165038,
230576,
238770,
304311,
230592,
312518,
279750,
230600,
230607,
148690,
320727,
279769,
304348,
279777,
304354,
296163,
320740,
279781,
304360,
320748,
279788,
279790,
304370,
296189,
320771,
312585,
296202,
296205,
230674,
320786,
230677,
296213,
296215,
320792,
230681,
230679,
214294,
304416,
230689,
173350,
312622,
296243,
312630,
222522,
296253,
222525,
296255,
312639,
230718,
296259,
378181,
296262,
230727,
238919,
296264,
320840,
296267,
296271,
222545,
230739,
312663,
222556,
337244,
230752,
312676,
230760,
173418,
148843,
410987,
230763,
230768,
296305,
312692,
230773,
304505,
304506,
181626,
279929,
181631,
148865,
312711,
312712,
296331,
288140,
288144,
230800,
304533,
337306,
288154,
288160,
173472,
288162,
288164,
279975,
304555,
370092,
279983,
173488,
288176,
279985,
312755,
296373,
312759,
337335,
288185,
279991,
222652,
312766,
173507,
296389,
222665,
230860,
312783,
288208,
230865,
288210,
370130,
288212,
222676,
148946,
288214,
239064,
329177,
288217,
280027,
288220,
288218,
239070,
288224,
280034,
288226,
280036,
288229,
280038,
288230,
288232,
370146,
288234,
320998,
288236,
288238,
288240,
288242,
296435,
288244,
288250,
296446,
321022,
402942,
148990,
296450,
206336,
230916,
230919,
214535,
230923,
304651,
304653,
370187,
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,
313044,
280276,
321239,
280283,
313052,
18140,
288478,
313055,
321252,
313066,
288494,
280302,
280304,
313073,
321266,
419570,
288499,
288502,
280314,
288510,
124671,
67330,
280324,
198405,
288519,
280331,
198416,
280337,
296723,
116503,
321304,
329498,
296731,
321311,
313121,
313123,
304932,
321316,
280363,
141101,
165678,
280375,
321336,
296767,
288576,
345921,
280388,
337732,
304968,
280393,
280402,
173907,
313171,
313176,
42842,
280419,
321381,
296809,
296812,
313201,
1920,
255873,
305028,
280454,
247688,
280464,
124817,
280468,
239510,
280473,
124827,
214940,
247709,
214944,
280487,
313258,
321458,
296883,
124853,
214966,
296890,
10170,
288700,
296894,
190403,
296900,
280515,
337862,
165831,
280521,
231379,
296921,
354265,
354270,
239586,
313320,
354281,
231404,
124913,
165876,
321528,
239612,
313340,
288764,
239617,
313347,
288773,
313358,
305176,
321560,
313371,
354338,
305191,
223273,
313386,
354348,
124978,
215090,
124980,
288824,
288826,
321595,
378941,
313406,
288831,
288836,
67654,
280651,
354382,
288848,
280658,
215123,
354390,
288855,
288859,
280669,
313438,
149599,
280671,
149601,
321634,
149603,
223327,
329830,
280681,
313451,
223341,
280687,
149618,
215154,
313458,
280691,
313464,
329850,
321659,
280702,
288895,
321670,
215175,
141446,
288909,
141455,
141459,
280725,
313498,
100520,
288936,
280747,
288940,
288947,
280755,
321717,
280759,
280764,
280769,
280771,
280774,
280776,
313548,
321740,
280783,
280786,
280788,
313557,
280793,
280796,
280798,
338147,
280804,
280807,
157930,
280811,
280817,
125171,
157940,
280819,
182517,
280823,
280825,
280827,
280830,
280831,
280833,
125187,
280835,
125191,
125207,
125209,
321817,
125218,
321842,
223539,
125239,
280888,
280891,
289087,
280897,
280900,
305480,
239944,
280906,
239947,
305485,
305489,
379218,
280919,
248153,
215387,
354653,
354656,
313700,
313705,
280937,
190832,
280946,
223606,
313720,
280956,
239997,
280959,
313731,
199051,
240011,
289166,
240017,
297363,
190868,
240021,
297365,
297368,
297372,
141725,
297377,
289186,
297391,
289201,
240052,
289207,
289210,
305594,
281024,
289218,
289221,
289227,
436684,
281045,
281047,
215526,
166378,
305647,
281075,
174580,
240124,
281084,
305662,
305664,
240129,
305666,
305668,
223749,
330244,
281095,
223752,
150025,
338440,
240132,
223757,
281102,
223763,
223765,
281113,
322074,
281116,
281121,
182819,
281127,
281135,
150066,
158262,
158266,
289342,
281154,
322115,
158283,
281163,
281179,
338528,
338532,
281190,
199273,
281196,
19053,
158317,
313973,
297594,
281210,
158347,
264845,
182926,
133776,
182929,
314003,
117398,
314007,
289436,
174754,
330404,
289448,
133801,
174764,
314029,
314033,
240309,
133817,
314045,
314047,
314051,
199364,
297671,
158409,
289493,
363234,
289513,
289522,
289525,
289532,
322303,
289537,
322310,
264969,
322314,
322318,
281361,
281372,
322341,
215850,
281388,
289593,
281401,
289601,
281410,
281413,
281414,
240458,
281420,
240468,
281430,
322393,
297818,
281435,
281438,
281442,
174955,
224110,
207733,
207737,
158596,
183172,
338823,
322440,
314249,
240519,
183184,
142226,
289687,
240535,
224151,
297883,
289694,
289696,
289700,
289712,
281529,
289724,
52163,
183260,
420829,
281567,
289762,
322534,
297961,
183277,
281581,
322550,
134142,
322563,
314372,
330764,
175134,
322599,
322610,
314421,
281654,
314427,
314433,
207937,
314441,
207949,
322642,
314456,
281691,
314461,
281702,
281704,
314474,
281708,
281711,
289912,
248995,
306341,
306344,
306347,
322734,
306354,
142531,
199877,
289991,
306377,
289997,
249045,
363742,
363745,
298216,
330988,
126190,
216303,
322801,
388350,
257302,
363802,
199976,
199978,
314671,
298292,
298294,
257334,
216376,
380226,
298306,
224584,
224587,
224594,
216404,
306517,
150870,
314714,
224603,
159068,
314718,
265568,
314723,
281960,
150890,
306539,
314732,
314736,
290161,
216436,
306549,
298358,
314743,
306552,
290171,
314747,
306555,
298365,
290174,
224641,
281987,
298372,
314756,
281990,
224647,
265604,
298377,
314763,
142733,
298381,
314768,
224657,
306581,
314773,
314779,
314785,
314793,
282025,
282027,
241068,
241070,
241072,
282034,
241077,
150966,
298424,
306618,
282044,
323015,
306635,
306640,
290263,
290270,
290275,
339431,
282089,
191985,
282098,
290291,
282101,
241142,
191992,
290298,
151036,
290302,
282111,
290305,
175621,
306694,
192008,
323084,
257550,
282127,
290321,
282130,
323090,
290325,
282133,
241175,
290328,
282137,
290332,
241181,
282142,
282144,
290344,
306731,
290349,
290351,
290356,
28219,
282186,
224849,
282195,
282199,
282201,
306778,
159324,
159330,
314979,
298598,
323176,
224875,
241260,
323181,
257658,
315016,
282249,
290445,
282255,
282261,
175770,
298651,
282269,
323229,
298655,
323231,
61092,
282277,
306856,
196133,
282295,
323260,
282300,
323266,
282310,
323273,
282319,
306897,
241362,
306904,
282328,
298714,
52959,
216801,
282337,
241380,
216806,
323304,
282345,
12011,
282356,
323318,
282364,
282367,
306945,
241412,
323333,
282376,
216842,
323345,
282388,
323349,
282392,
184090,
315167,
315169,
282402,
315174,
323367,
241448,
315176,
241450,
282410,
306988,
306991,
315184,
323376,
315190,
241464,
159545,
282425,
298811,
118593,
307009,
413506,
307012,
241475,
298822,
315211,
282446,
307027,
315221,
323414,
315223,
241496,
241498,
307035,
307040,
110433,
282465,
241509,
110438,
298860,
110445,
282478,
315249,
110450,
315251,
282481,
315253,
315255,
339838,
315267,
282499,
315269,
241544,
282505,
241546,
241548,
298896,
298898,
282514,
241556,
298901,
44948,
241560,
282520,
241563,
241565,
241567,
241569,
282531,
241574,
282537,
298922,
36779,
241581,
282542,
241583,
323504,
241586,
282547,
241588,
290739,
241590,
241592,
241598,
290751,
241600,
241605,
151495,
241610,
298975,
241632,
298984,
241640,
241643,
298988,
241646,
241649,
241652,
323574,
290807,
299003,
241661,
299006,
282623,
315396,
241669,
315397,
282632,
282639,
290835,
282645,
241693,
282654,
241701,
102438,
217127,
282669,
323630,
282681,
290877,
282687,
159811,
315463,
315466,
192589,
307278,
192596,
176213,
307287,
307290,
217179,
315482,
192605,
315483,
233567,
299105,
200801,
217188,
299109,
307303,
315495,
356457,
45163,
307307,
315502,
192624,
307314,
323700,
299126,
233591,
299136,
307329,
315524,
307338,
233613,
241813,
307352,
299164,
299167,
315552,
184479,
184481,
315557,
184486,
307370,
307372,
184492,
307374,
307376,
299185,
323763,
184503,
176311,
299191,
307386,
258235,
307388,
307385,
307390,
176316,
299200,
184512,
307394,
299204,
307396,
184518,
307399,
323784,
233679,
307409,
307411,
176343,
299225,
233701,
307432,
184572,
282881,
184579,
282893,
323854,
291089,
282906,
291104,
233766,
295583,
176435,
307508,
315701,
332086,
307510,
307512,
168245,
307515,
307518,
282942,
282947,
323917,
110926,
282957,
233808,
323921,
315733,
323926,
233815,
276052,
315739,
323932,
299357,
242018,
242024,
299373,
315757,
250231,
242043,
315771,
299388,
299391,
291202,
299398,
242057,
291212,
299405,
291222,
315801,
283033,
242075,
291226,
194654,
61855,
291231,
283042,
291238,
291241,
127403,
127405,
291247,
299440,
127407,
299444,
127413,
283062,
291254,
127417,
291260,
283069,
127421,
127424,
299457,
127429,
127431,
127434,
315856,
176592,
127440,
315860,
176597,
127447,
283095,
299481,
127449,
176605,
242143,
127455,
127457,
291299,
340454,
127463,
242152,
291305,
127466,
176620,
127469,
127474,
291314,
291317,
127480,
135672,
291323,
233979,
127485,
291330,
283142,
127494,
127497,
233994,
135689,
127500,
291341,
233998,
127506,
234003,
234006,
127511,
152087,
283161,
242202,
234010,
135707,
135710,
242206,
242208,
291361,
242220,
291378,
152118,
234038,
234041,
315961,
70213,
242250,
111193,
242275,
299620,
242279,
168562,
184952,
135805,
135808,
291456,
373383,
299655,
135820,
316051,
225941,
316054,
299672,
135834,
373404,
299677,
225948,
135839,
299680,
225954,
299684,
135844,
242343,
209576,
242345,
373421,
135870,
135873,
135876,
135879,
299720,
299723,
299726,
225998,
226002,
119509,
226005,
226008,
299740,
242396,
201444,
299750,
283368,
234219,
283372,
185074,
226037,
283382,
316151,
234231,
234236,
226045,
242431,
234239,
209665,
234242,
299778,
242436,
226053,
234246,
226056,
234248,
291593,
242443,
234252,
242445,
234254,
291601,
234258,
242450,
242452,
234261,
348950,
201496,
234264,
234266,
234269,
283421,
234272,
234274,
152355,
299814,
234278,
283432,
234281,
234284,
234287,
283440,
185138,
242483,
234292,
234296,
234298,
160572,
283452,
234302,
234307,
242499,
234309,
316233,
234313,
316235,
234316,
283468,
234319,
242511,
234321,
234324,
185173,
201557,
234329,
234333,
308063,
234336,
242530,
349027,
234338,
234341,
234344,
234347,
177004,
234350,
324464,
234353,
152435,
177011,
234356,
234358,
234362,
226171,
234364,
291711,
234368,
291714,
234370,
291716,
234373,
316294,
201603,
226182,
308105,
234375,
226185,
234379,
324490,
234384,
234388,
234390,
324504,
234393,
209818,
308123,
324508,
234396,
291742,
226200,
234398,
234401,
291747,
291748,
234405,
291750,
234407,
324520,
324518,
324522,
234410,
291756,
291754,
226220,
324527,
291760,
234417,
201650,
324531,
234414,
234422,
226230,
324536,
275384,
234428,
291773,
242623,
324544,
234431,
234434,
324546,
324548,
234437,
226245,
234439,
226239,
234443,
291788,
234446,
275406,
193486,
234449,
316370,
193488,
234452,
234455,
234459,
234461,
234464,
234467,
234470,
168935,
5096,
324585,
234475,
234478,
316400,
234481,
316403,
234484,
234485,
234487,
324599,
234490,
234493,
316416,
234496,
234501,
275462,
308231,
234504,
234507,
234510,
234515,
300054,
316439,
234520,
234519,
234523,
234526,
234528,
300066,
234532,
300069,
234535,
234537,
234540,
144430,
234543,
234546,
275508,
300085,
234549,
300088,
234553,
234556,
234558,
316479,
234561,
316483,
160835,
234563,
308291,
234568,
234570,
316491,
234572,
300108,
234574,
300115,
234580,
234581,
242777,
234585,
275545,
234590,
234593,
234595,
234597,
300133,
234601,
300139,
234605,
160879,
234607,
275569,
234610,
316530,
300148,
234614,
398455,
144506,
234618,
234620,
275579,
234623,
226433,
234627,
275588,
234629,
242822,
234634,
234636,
177293,
234640,
275602,
234643,
308373,
226453,
234647,
275606,
275608,
234650,
308379,
324757,
300189,
324766,
119967,
234653,
324768,
283805,
234657,
242852,
300197,
234661,
283813,
234664,
275626,
234667,
316596,
308414,
234687,
300223,
300226,
308418,
234692,
300229,
308420,
308422,
283844,
226500,
300234,
283850,
300238,
300241,
316625,
300243,
300245,
316630,
300248,
300253,
300256,
300258,
300260,
234726,
300263,
300265,
300267,
161003,
300270,
300272,
120053,
300278,
275703,
316663,
300284,
275710,
300287,
292097,
300289,
161027,
300292,
300294,
275719,
234760,
177419,
300299,
242957,
300301,
283917,
177424,
349451,
275725,
349464,
415009,
283939,
259367,
292143,
283951,
300344,
226617,
243003,
283963,
226628,
300357,
283973,
177482,
283983,
316758,
357722,
316766,
316768,
292192,
218464,
292197,
316774,
243046,
218473,
284010,
136562,
324978,
275834,
333178,
275836,
275840,
316803,
316806,
226696,
316811,
226699,
316814,
226703,
300433,
234899,
300436,
226709,
357783,
316824,
316826,
144796,
300448,
144807,
144810,
144812,
284076,
144814,
227426,
144820,
374196,
284084,
292279,
284087,
144826,
144828,
144830,
144832,
144835,
144837,
38342,
144839,
144841,
144844,
144847,
144852,
144855,
103899,
300507,
333280,
226787,
218597,
292329,
300523,
259565,
300527,
308720,
259567,
292338,
226802,
316917,
292343,
308727,
300537,
316933,
316947,
308757,
308762,
284191,
316959,
284194,
284196,
235045,
284199,
284204,
284206,
284209,
284211,
194101,
284213,
316983,
194103,
284215,
308790,
284218,
226877,
292414,
284223,
284226,
284228,
292421,
226886,
284231,
128584,
243268,
284234,
366155,
317004,
276043,
284238,
226895,
284241,
194130,
284243,
300628,
284245,
292433,
284247,
317015,
235097,
243290,
276053,
284249,
284251,
300638,
284253,
284255,
243293,
284258,
292452,
292454,
284263,
177766,
284265,
292458,
284267,
292461,
284272,
284274,
284278,
292470,
276086,
292473,
284283,
276093,
284286,
292479,
284288,
292481,
284290,
325250,
284292,
292485,
325251,
276095,
276098,
284297,
317066,
284299,
317068,
284301,
276109,
284303,
284306,
276114,
284308,
284312,
284314,
284316,
276127,
284320,
284322,
284327,
284329,
317098,
284331,
276137,
284333,
284335,
276144,
284337,
284339,
300726,
284343,
284346,
284350,
358080,
276160,
284354,
358083,
284358,
276166,
358089,
284362,
276170,
284365,
276175,
284368,
276177,
284370,
358098,
284372,
317138,
284377,
276187,
284379,
284381,
284384,
358114,
284386,
358116,
276197,
317158,
358119,
284392,
325353,
358122,
284394,
284397,
358126,
284399,
358128,
276206,
358133,
358135,
276216,
358138,
300795,
358140,
284413,
358142,
358146,
317187,
284418,
317189,
317191,
284428,
300816,
300819,
317207,
284440,
300828,
300830,
276255,
300832,
325408,
300834,
317221,
227109,
358183,
186151,
276268,
300845,
243504,
300850,
284469,
276280,
325436,
358206,
276291,
366406,
276295,
300872,
292681,
153417,
358224,
284499,
276308,
178006,
317271,
284502,
276315,
292700,
317279,
284511,
227175,
292715,
300912,
292721,
284529,
300915,
284533,
292729,
317306,
284540,
292734,
325512,
169868,
276365,
317332,
358292,
284564,
399252,
284566,
350106,
284572,
276386,
284579,
276388,
358312,
317353,
284585,
276395,
292776,
292784,
276402,
358326,
161718,
358330,
276410,
276411,
276418,
276425,
301009,
301011,
301013,
292823,
358360,
301017,
301015,
292828,
276446,
153568,
276448,
276452,
292839,
276455,
350186,
292843,
276460,
292845,
276464,
178161,
227314,
276466,
325624,
350200,
276472,
317435,
276476,
276479,
276482,
350210,
276485,
317446,
178181,
276490,
350218,
292876,
350222,
317456,
276496,
317458,
178195,
243733,
243740,
317468,
317472,
325666,
243751,
292904,
276528,
178224,
243762,
309298,
325685,
325689,
235579,
325692,
235581,
178238,
276539,
276544,
243779,
325700,
284739,
292934,
243785,
276553,
350293,
350295,
309337,
194649,
227418,
350299,
350302,
227423,
350304,
178273,
309346,
194657,
194660,
350308,
309350,
309348,
292968,
309352,
309354,
301163,
350313,
350316,
227430,
301167,
276583,
350321,
276590,
284786,
276595,
350325,
252022,
227440,
350328,
292985,
301178,
350332,
292989,
301185,
292993,
350339,
317570,
317573,
350342,
350345,
350349,
301199,
317584,
325777,
350354,
194708,
350357,
350359,
350362,
350366,
276638,
284837,
153765,
350375,
350379,
350381,
350383,
129200,
350385,
350387,
350389,
350395,
350397,
350399,
227520,
350402,
227522,
301252,
350406,
227529,
301258,
309450,
276685,
309455,
276689,
309462,
301272,
276699,
194780,
309468,
309471,
301283,
317672,
317674,
325867,
243948,
194801,
309491,
227571,
309494,
243960,
276735,
227583,
227587,
276739,
211204,
276742,
227593,
227596,
325910,
309530,
342298,
211232,
317729,
276775,
211241,
325937,
325943,
211260,
260421,
276809,
285002,
276811,
235853,
276816,
235858,
276829,
276833,
391523,
276836,
293227,
276843,
293232,
276848,
186744,
211324,
227709,
285061,
366983,
317833,
178572,
285070,
285077,
178583,
227738,
317853,
276896,
317858,
342434,
285093,
317864,
285098,
276907,
235955,
276917,
293304,
293307,
293314,
309707,
293325,
129486,
317910,
293336,
235996,
317917,
293343,
358880,
276961,
227810,
293346,
276964,
293352,
236013,
293364,
301562,
293370,
317951,
309764,
301575,
121352,
293387,
236043,
342541,
317963,
113167,
55822,
309779,
317971,
309781,
277011,
55837,
227877,
227879,
293417,
227882,
309804,
293421,
105007,
236082,
285236,
23094,
277054,
244288,
219714,
129603,
301636,
318020,
301639,
301643,
277071,
285265,
399955,
309844,
277080,
309849,
285277,
285282,
326244,
318055,
277100,
309871,
121458,
277106,
170618,
170619,
309885,
309888,
277122,
227975,
277128,
285320,
301706,
318092,
326285,
334476,
318094,
277136,
277139,
227992,
334488,
318108,
285340,
318110,
227998,
137889,
383658,
285357,
318128,
277170,
293555,
318132,
342707,
154292,
277173,
277177,
277181,
318144,
277187,
277191,
277194,
277196,
277201,
342745,
137946,
342747,
113378,
203491,
228069,
277223,
342760,
285417,
56041,
56043,
56045,
277232,
228081,
56059,
310015,
285441,
310020,
285448,
310029,
228113,
285459,
277273,
293659,
326430,
228128,
285474,
293666,
228135,
318248,
277291,
318253,
293677,
285489,
301876,
293685,
285494,
301880,
285499,
301884,
310080,
293696,
277317,
277322,
293706,
277329,
162643,
310100,
301911,
301913,
277337,
301921,
400236,
236397,
162671,
326514,
310134,
236408,
15224,
277368,
416639,
416640,
113538,
310147,
416648,
39817,
187274,
277385,
301972,
424853,
277405,
277411,
310179,
293798,
293802,
236460,
277426,
276579,
293811,
293817,
293820,
203715,
326603,
342994,
276586,
293849,
293861,
228327,
228328,
318442,
228330,
228332,
326638,
277486,
351217,
318450,
293876,
293877,
285686,
302073,
121850,
293882,
302075,
285690,
244731,
293887,
277504,
277507,
277511,
293899,
277519,
293908,
302105,
293917,
293939,
318516,
277561,
277564,
310336,
7232,
293956,
277573,
228422,
293960,
310344,
277577,
277583,
203857,
293971,
310355,
310359,
236632,
277594,
138332,
277598,
203872,
277601,
285792,
310374,
203879,
310376,
228460,
318573,
203886,
187509,
285815,
367737,
285817,
302205,
285821,
392326,
285831,
253064,
294026,
302218,
285835,
162964,
384148,
187542,
302231,
285849,
302233,
285852,
302237,
285854,
285856,
302241,
285862,
277671,
302248,
64682,
277678,
294063,
294065,
302258,
277687,
294072,
318651,
294076,
277695,
318657,
244930,
302275,
130244,
302277,
228550,
302282,
310476,
302285,
302288,
310481,
302290,
203987,
302292,
302294,
310486,
302296,
384222,
310498,
285927,
318698,
302315,
195822,
228592,
294132,
138485,
228601,
204026,
228606,
204031,
64768,
310531,
285958,
138505,
228617,
318742,
204067,
277798,
130345,
277801,
113964,
285997,
384302,
285999,
277804,
113969,
277807,
277811,
318773,
318776,
277816,
286010,
277819,
294204,
417086,
277822,
286016,
302403,
294211,
384328,
277832,
277836,
294221,
146765,
294223,
326991,
277839,
277842,
277847,
277850,
179547,
277853,
146784,
277857,
302436,
277860,
294246,
327015,
310632,
327017,
351594,
277864,
277869,
277872,
351607,
310648,
277880,
310651,
277884,
277888,
310657,
351619,
294276,
310659,
327046,
277892,
253320,
310665,
318858,
277894,
277898,
277903,
310672,
351633,
277905,
277908,
277917,
310689,
277921,
130468,
228776,
277928,
277932,
310703,
277937,
310710,
130486,
310712,
277944,
310715,
277947,
302526,
228799,
277950,
277953,
302534,
310727,
245191,
64966,
163272,
277959,
277963,
302541,
277966,
302543,
310737,
277971,
228825,
163290,
277978,
310749,
277981,
277984,
310755,
277989,
277991,
187880,
277995,
310764,
286188,
278000,
228851,
310772,
278003,
278006,
40440,
212472,
278009,
40443,
286203,
310780,
40448,
228864,
286214,
228871,
302603,
65038,
302614,
302617,
286233,
302621,
286240,
146977,
187936,
187939,
40484,
294435,
40486,
286246,
294440,
40488,
294439,
294443,
40491,
294445,
278057,
310831,
245288,
286248,
40499,
40502,
212538,
40507,
40511,
40513,
228933,
327240,
40521,
286283,
40525,
40527,
212560,
400976,
228944,
40533,
147032,
40537,
40539,
40541,
278109,
40544,
40548,
40550,
40552,
286312,
40554,
286313,
310892,
40557,
40560,
188022,
122488,
294521,
343679,
294537,
310925,
286354,
278163,
302740,
122517,
278168,
179870,
327333,
229030,
212648,
278188,
302764,
278192,
319153,
278196,
319163,
302781,
319171,
302789,
294599,
278216,
294601,
302793,
343757,
212690,
319187,
286420,
278227,
229076,
286425,
319194,
278235,
278238,
229086,
286432,
294625,
294634,
302838,
319226,
286460,
278274,
302852,
278277,
302854,
294664,
311048,
352008,
319243,
311053,
302862,
319251,
294682,
278306,
188199,
294701,
319280,
278320,
319290,
229192,
302925,
188247,
280021,
188252,
237409,
229233,
294776,
360317,
294785,
327554,
360322,
40840,
40851,
294803,
188312,
294811,
237470,
319390,
40865,
319394,
294817,
294821,
311209,
180142,
343983,
294831,
188340,
40886,
319419,
294844,
294847,
237508,
393177,
294876,
294879,
294883,
393190,
294890,
311279,
278513,
237555,
311283,
278516,
278519,
237562
] |
4f57276a46d5818cef639a7f6ff595695d615e53 | bfeb9765298676f745617764d063d23d65dbd025 | /Instagram/AppDelegate.swift | 0dd0b85a3fd7e449569d6824bd689ac65689440f | [] | no_license | Eshaan-Lumba/Instagram | bcd911192082de3c348da129b0ac0046da93dda8 | 5e2c25a83f3ceefc3f9c1334c135f438b4a2ed7c | refs/heads/main | 2023-06-30T10:05:38.002787 | 2021-07-30T11:10:24 | 2021-07-30T11:10:24 | 349,588,663 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 2,094 | swift | //
// AppDelegate.swift
// Instagram
//
// Created by Eshaan Lumba on 19/03/2021.
//
import UIKit
import Parse
@main
class AppDelegate: UIResponder, UIApplicationDelegate, UIWindowSceneDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
let parseConfig = ParseClientConfiguration {
$0.applicationId = "6RZDqnpSCTzIwtLL9ZUV3dRMbHHmDWtZIrqX94Le"
$0.clientKey = "DiRoMfb9cii6O8vwKtqCIZRGvnIlI16KrsgmVPIY"
$0.server = "https://parseapi.back4app.com"
}
Parse.initialize(with: parseConfig)
// // if the user is already logged in
// if PFUser.current() != nil {
// let main = UIStoryboard(name: "Main", bundle: nil)
// let feedNavigationController = main.instantiateViewController(identifier: "FeedNavigationController")
//
// window?.rootViewController = feedNavigationController
// }
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.
}
}
| [
-1
] |
b1674b4c81f33f02f1b5092c7583af82f7555c07 | ebb0a47ce1ebe10bba82b5f6c336a37bf88d2cc7 | /UIActivityHW/ViewController.swift | 2720aad88352d0ee4cc80617b6dfae83c642a10d | [] | no_license | ivansavkov1387/UIActivityHW | 34628c3d3f4f00b3377c059c92c9ad09a76870b6 | dddc080602e445796daeea769d23731c23341960 | refs/heads/main | 2023-04-17T06:16:02.205028 | 2021-05-02T10:06:38 | 2021-05-02T10:06:38 | 363,091,214 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 2,839 | swift | //
// ViewController.swift
// UIActivityHW
//
// Created by Иван on 4/30/21.
//
import UIKit
class ViewController: UIViewController {
var textField = UITextField()
var button = UIButton()
var pickerView = UIPickerView()
private var pickerViewArray = ["nothing", "nothing", "share"]
override func viewDidLoad() {
super.viewDidLoad()
createTextField()
createButton()
createPickerView()
}
private func createTextField() {
textField = UITextField(frame: CGRect(x: 50, y: 340, width: 320, height: 50))
textField.layer.cornerRadius = 10
textField.layer.borderWidth = 1
textField.layer.borderColor = CGColor(red: 0, green: 0, blue: 0, alpha: 1)
view.addSubview(textField)
}
private func createButton() {
button = UIButton(frame: CGRect(x: 110, y: 450, width: 200, height: 80))
button.backgroundColor = .cyan
button.setTitleColor(.black, for: .normal)
button.layer.cornerRadius = 10
button.layer.borderWidth = 1
button.layer.borderColor = CGColor(red: 0, green: 0, blue: 0, alpha: 1)
button.setTitle("Share", for: .normal)
button.addTarget(self, action: #selector(buttontapped), for: .allTouchEvents)
view.addSubview(button)
}
private func createPickerView() {
pickerView = UIPickerView(frame: CGRect(x: 110, y: 550, width: 200, height: 100))
pickerView.layer.cornerRadius = 10
pickerView.backgroundColor = .systemGray5
pickerView.dataSource = self
pickerView.delegate = self
view.addSubview(pickerView)
}
@objc private func buttontapped() {
showActivityController()
}
private func showActivityController() {
let objectsToShare: [Any] = [textField.text ?? ""]
let activityController = UIActivityViewController(activityItems: objectsToShare, applicationActivities: nil)
self.present(activityController, animated: true)
textField.text = ""
}
}
extension ViewController: UIPickerViewDelegate,UIPickerViewDataSource {
func numberOfComponents(in pickerView: UIPickerView) -> Int {
1
}
func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int {
pickerViewArray.count
}
func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? {
return pickerViewArray[row]
}
func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) {
switch pickerViewArray[row] {
case "share":
showActivityController()
default:
break
}
}
}
| [
-1
] |
e9a0828f7f18fa6f9320d78602aa136f0a2eee73 | 16574615c626206b49968732012310d4f7424496 | /Roshambo/ViewController.swift | b650626fbaea652ec7e38f1e0cef0c5a29eeab7b | [] | no_license | wqc3241/RockScissorPaper | 5d759320fc1edb936266e39224adddb60956090e | e12087cdd342abd0e86ea27a1dc70d55ec07b0bc | refs/heads/master | 2020-12-25T18:42:31.437531 | 2017-06-11T02:23:55 | 2017-06-11T02:23:55 | 93,974,379 | 0 | 0 | null | null | null | null | UTF-8 | Swift | false | false | 1,336 | swift | //
// ViewController.swift
// Roshambo
//
// Created by Qichao Wang on 2017/6/10.
// Copyright © 2017年 Qichao Wang. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
//rock:1 scissor:2 paper:3
@IBOutlet weak var rock: UIButton!
@IBOutlet weak var scissor: UIButton!
@IBOutlet weak var paper: UIButton!
@IBAction func userRock(){
performSegue(withIdentifier: "segueRock", sender: self)
}
@IBAction func userScissor(){
performSegue(withIdentifier: "segueScissor", sender: self)
}
@IBAction func userPaper(){
performSegue(withIdentifier: "seguePaper", sender: self)
}
override func viewDidLoad() {
super.viewDidLoad()
}
func generateAi() -> Int{
return Int(arc4random_uniform(3)+1)
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
let controller = segue.destination as! ResultViewController
if segue.identifier == "segueRock"{
controller.user = 1
}
else if segue.identifier == "segueScissor"{
controller.user = 2
}
else if segue.identifier == "seguePaper"{
controller.user = 3
}
controller.ai = self.generateAi()
}
}
| [
-1
] |
99e79a37748c5eac24c805dc990d496589b791b1 | d939d631b0986d8708f44a7c624ea7facc7d545d | /ipad/ipad/Models/DrawingInfoModel.swift | 53ffb41a9a5f39bccd6f0d7c155e8be87f140b70 | [
"MIT",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | Remi05/PolyPaintPro | e40ed0cf8181ca8f00a6ca2f938116e5bdac6e8c | e90e5c8fba7dab33f9faf61155e019b7ad353dcd | refs/heads/main | 2022-12-12T23:05:49.115913 | 2021-02-02T06:27:36 | 2021-02-02T06:27:36 | 130,281,442 | 1 | 1 | null | 2022-12-08T01:48:07 | 2018-04-19T23:03:02 | C# | UTF-8 | Swift | false | false | 1,358 | swift | import Foundation
class DrawingInfoModel {
var id: String
var previewUrl: String
var thumbnailUrl: String
var nsfw: Bool
var timestamp: Date
var owner: String
init(data: [String:Any]?) {
self.id = data?["id"] as? String ?? ""
self.previewUrl = data?["previewUrl"] as? String ?? ""
self.thumbnailUrl = data?["thumbnailUrl"] as? String ?? ""
self.nsfw = data?["nsfw"] as? Bool ?? false
let date = data?["last_modified_on"] as? String ?? ""
let timestamp = date == "" ? Date(timeIntervalSinceReferenceDate: -123456789.0) : Formatter.date(date: date)
self.timestamp = timestamp
self.owner = data?["owner"] as? String ?? ""
}
init(id: String, previewUrl: String, thumbnailUrl: String, nsfw: Bool, timestamp: Date, owner: String) {
self.id = id
self.previewUrl = previewUrl
self.nsfw = nsfw
self.thumbnailUrl = thumbnailUrl
self.timestamp = timestamp
self.owner = owner
}
func toDictionnary() -> [String:Any] {
return [
"id": id,
"previewUrl": previewUrl,
"thumbnailUrl": thumbnailUrl,
"nsfw": nsfw,
"last_modified_on": Formatter.dateString(date: timestamp),
"owner": owner
] as [String:Any]
}
}
| [
-1
] |
5974391f9cce9737882f161a716c3747194ff273 | 3539bc0b66823841a4742d2c6b4c040e09064e11 | /Sources/Outlaw/Types/Value/Array+Value.swift | b74b41c140b3204d408f2f3dac8431e8efddb74f | [
"MIT"
] | permissive | hadanischal/Outlaw | 3206adb13d3f75855bf62e8c6d1bda5bae48b2b2 | d178c20059613a4f198215577844e69976f7b15e | refs/heads/master | 2020-03-23T05:14:42.675625 | 2018-05-28T04:24:20 | 2018-05-28T04:24:20 | 141,132,551 | 1 | 0 | MIT | 2018-07-16T11:58:22 | 2018-07-16T11:58:21 | null | UTF-8 | Swift | false | false | 3,444 | swift | //
// Array+Value.swift
// Outlaw
//
// Created by Brian Mullen on 11/6/16.
// Copyright © 2016 Molbie LLC. All rights reserved.
//
import Foundation
public extension Array {
public static func mappedValue<Element: Value>(from object: Any) throws -> [Element] {
guard let anyArray = object as? [Any] else {
throw OutlawError.typeMismatch(expected: self, actual: type(of: object))
}
return try anyArray.map {
let value = try Element.value(from: $0)
guard let element = value as? Element else {
throw OutlawError.typeMismatch(expected: Element.self, actual: type(of: object))
}
return element
}
}
public static func mappedValue<Element: Value>(from object: Any) throws -> [Element?] {
guard let anyArray = object as? [Any?] else {
throw OutlawError.typeMismatch(expected: self, actual: type(of: object))
}
return anyArray.map {
guard let rawValue = $0 else { return nil }
let value = try? Element.value(from: rawValue)
return value as? Element
}
}
}
// MARK: -
// MARK: Transforms
public extension Array {
public static func mappedValue<Element: Value, T>(from object: Any, with transform:(Element) throws -> T) throws -> [T] {
guard let anyArray = object as? [Any] else {
throw OutlawError.typeMismatch(expected: self, actual: type(of: object))
}
return try anyArray.map {
let value = try Element.value(from: $0)
guard let element = value as? Element else {
throw OutlawError.typeMismatch(expected: Element.self, actual: type(of: object))
}
return try transform(element)
}
}
public static func mappedValue<Element: Value, T>(from object: Any, with transform:(Element?) throws -> T) throws -> [T] {
guard let anyArray = object as? [Any?] else {
throw OutlawError.typeMismatch(expected: self, actual: type(of: object))
}
return try anyArray.map {
guard let rawValue = $0 else { return try transform(nil) }
let value = try? Element.value(from: rawValue)
return try transform(value as? Element)
}
}
public static func mappedValue<Element: Value, T>(from object: Any, with transform:(Element) -> T?) throws -> [T?] {
guard let anyArray = object as? [Any?] else {
throw OutlawError.typeMismatch(expected: self, actual: type(of: object))
}
return anyArray.map {
guard let rawValue = $0 else { return nil }
let value = try? Element.value(from: rawValue)
guard let element = value as? Element else { return nil }
return transform(element)
}
}
public static func mappedValue<Element: Value, T>(from object: Any, with transform:(Element?) -> T?) throws -> [T?] {
guard let anyArray = object as? [Any?] else {
throw OutlawError.typeMismatch(expected: self, actual: type(of: object))
}
return anyArray.map {
guard let rawValue = $0 else { return transform(nil) }
let value = try? Element.value(from: rawValue)
return transform(value as? Element)
}
}
}
| [
-1
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.