blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
2
625
content_id
stringlengths
40
40
detected_licenses
sequencelengths
0
47
license_type
stringclasses
2 values
repo_name
stringlengths
5
116
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
643 values
visit_date
timestamp[ns]
revision_date
timestamp[ns]
committer_date
timestamp[ns]
github_id
int64
80.4k
689M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
16 values
gha_event_created_at
timestamp[ns]
gha_created_at
timestamp[ns]
gha_language
stringclasses
85 values
src_encoding
stringclasses
7 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
1 class
length_bytes
int64
4
6.44M
extension
stringclasses
17 values
content
stringlengths
4
6.44M
duplicates
sequencelengths
1
9.02k
bc30f508d0aac252da89767cc6bb3d0d11f78732
c681e3391e2b4c2a180b1439d6d25bfe1e71fe40
/WWDC/AppDelegate.swift
d9eb12656ab25361281e2c45060354347b0639b3
[ "BSD-2-Clause" ]
permissive
Manfred-Wang/WWDC
dc01697c68fd9db89e7633343172a1ff40a588bd
c4c95d3ddf79d5e91fe72016fc76365cac53b92a
refs/heads/master
2021-05-18T08:56:38.612001
2021-01-26T07:42:36
2021-01-26T07:42:36
61,280,459
0
0
BSD-2-Clause
2021-01-26T07:42:37
2016-06-16T09:35:27
Swift
UTF-8
Swift
false
false
7,434
swift
// // AppDelegate.swift // WWDC // // Created by Guilherme Rambo on 05/02/17. // Copyright © 2017 Guilherme Rambo. All rights reserved. // import Cocoa import Sparkle import Siesta @_exported import ConfUIFoundation import ConfCore import RealmSwift import SwiftUI extension Notification.Name { static let openWWDCURL = Notification.Name(rawValue: "OpenWWDCURLNotification") } class AppDelegate: NSObject, NSApplicationDelegate { private(set) var coordinator: AppCoordinator? func applicationWillFinishLaunching(_ notification: Notification) { NSAppleEventManager.shared().setEventHandler(self, andSelector: #selector(handleURLEvent(_:replyEvent:)), forEventClass: UInt32(kInternetEventClass), andEventID: UInt32(kAEGetURL)) NSApplication.shared.appearance = NSAppearance(named: .darkAqua) } private var urlObservationToken: NSObjectProtocol? private let boot = Boot() private var migrationSplashScreenWorkItem: DispatchWorkItem? private let slowMigrationToleranceInSeconds: TimeInterval = 1.5 func applicationDidFinishLaunching(_ notification: Notification) { UserDefaults.standard.register(defaults: ["NSApplicationCrashOnExceptions": false]) NSApp.registerForRemoteNotifications(matching: []) #if DEBUG if UserDefaults.standard.bool(forKey: "WWDCEnableNetworkDebugging") { SiestaLog.Category.enabled = .all } #endif urlObservationToken = NotificationCenter.default.addObserver(forName: .openWWDCURL, object: nil, queue: .main) { [weak self] note in guard let url = note.object as? URL else { return } self?.openURL(url) } let item = DispatchWorkItem(block: showMigrationSplashScreen) migrationSplashScreenWorkItem = item DispatchQueue.main.asyncAfter(deadline: .now() + slowMigrationToleranceInSeconds, execute: item) boot.bootstrapDependencies { [unowned self] result in self.migrationSplashScreenWorkItem?.cancel() self.migrationSplashScreenWorkItem = nil self.hideMigrationSplash() switch result { case .failure(let error): self.handleBootstrapError(error) case .success(let dependencies): self.startupUI(using: dependencies.storage, syncEngine: dependencies.syncEngine) } } ImageDownloadCenter.shared.deleteLegacyImageCacheIfNeeded() } private func startupUI(using storage: Storage, syncEngine: SyncEngine) { coordinator = AppCoordinator( windowController: MainWindowController(), storage: storage, syncEngine: syncEngine ) coordinator?.windowController.showWindow(self) coordinator?.startup() } private func handleBootstrapError(_ error: Boot.BootstrapError) { if error.code == .unusableStorage { handleStorageError(error) } else { let alert = NSAlert() alert.messageText = "Failed to start" alert.informativeText = error.localizedDescription alert.addButton(withTitle: "Quit") alert.runModal() NSApp.terminate(nil) } } private func handleStorageError(_ error: Boot.BootstrapError) { let alert = NSAlert() alert.messageText = "Failed to start" alert.informativeText = error.localizedDescription alert.addButton(withTitle: "Quit") alert.runModal() NSApp.terminate(self) } private lazy var slowMigrationController: NSWindowController = { let viewController = NSHostingController(rootView: SlowMigrationView()) let windowController = NSWindowController(window: NSWindow(contentRect: .zero, styleMask: [.titled, .fullSizeContentView], backing: .buffered, defer: false)) windowController.contentViewController = viewController windowController.window?.center() windowController.window?.isReleasedWhenClosed = true windowController.window?.titlebarAppearsTransparent = true return windowController }() private var migrationSplashShown = false private func showMigrationSplashScreen() { migrationSplashShown = true slowMigrationController.showWindow(self) } private func hideMigrationSplash() { guard migrationSplashShown else { return } slowMigrationController.close() } func application(_ application: NSApplication, didReceiveRemoteNotification userInfo: [String: Any]) { coordinator?.receiveNotification(with: userInfo) } @objc func handleURLEvent(_ event: NSAppleEventDescriptor?, replyEvent: NSAppleEventDescriptor?) { guard let event = event else { return } guard let urlString = event.paramDescriptor(forKeyword: UInt32(keyDirectObject))?.stringValue else { return } guard let url = URL(string: urlString) else { return } openURL(url) } private func openURL(_ url: URL) { guard let link = DeepLink(url: url) else { NSWorkspace.shared.open(url) return } coordinator?.handle(link: link, deferIfNeeded: true) } func application(_ application: NSApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([NSUserActivityRestoring]) -> Void) -> Bool { guard userActivity.activityType == NSUserActivityTypeBrowsingWeb else { return false } guard let url = userActivity.webpageURL else { return false } guard let link = DeepLink(url: url) else { return false } coordinator?.handle(link: link, deferIfNeeded: true) return true } @IBAction func showPreferences(_ sender: Any) { coordinator?.showPreferences(sender) } @IBAction func reload(_ sender: Any) { coordinator?.refresh(sender) } @IBAction func showAboutWindow(_ sender: Any) { coordinator?.showAboutWindow() } @IBAction func viewFeatured(_ sender: Any) { coordinator?.showFeatured() } @IBAction func viewSchedule(_ sender: Any) { coordinator?.showSchedule() } @IBAction func viewVideos(_ sender: Any) { coordinator?.showVideos() } @IBAction func viewCommunity(_ sender: Any) { coordinator?.showCommunity() } @IBAction func viewHelp(_ sender: Any) { if let helpUrl = URL(string: "https://github.com/insidegui/WWDC/issues") { NSWorkspace.shared.open(helpUrl) } } func applicationWillBecomeActive(_ notification: Notification) { // Switches to app via application switcher if !NSApp.windows.contains(where: { $0.isVisible }) { coordinator?.windowController.showWindow(self) } } func applicationShouldHandleReopen(_ sender: NSApplication, hasVisibleWindows flag: Bool) -> Bool { // User clicks dock item, double clicks app in finder, etc if !flag { coordinator?.windowController.showWindow(sender) return true } return false } } extension AppDelegate: SUUpdaterDelegate { func updaterMayCheck(forUpdates updater: SUUpdater) -> Bool { #if DEBUG return ProcessInfo.processInfo.arguments.contains("--enable-updates") #else return true #endif } }
[ -1 ]
da314dd60d5ef0e5a678ce4a593c3efc8bcc2444
4ff16983094d77df4459d440129f05309c4bd0c7
/StackO/StackO/SceneDelegate.swift
3627f0a3b77db13ce9b77d923ed99e2c2375cf20
[]
no_license
AmandaU/StackO
d03733f518d232f26916cb2496c9f0b7e23f6ce3
c5bd6eca6bba59aff78d494688c5cf76ba799c15
refs/heads/master
2023-04-02T23:07:40.467861
2021-04-12T07:17:44
2021-04-12T07:17:44
356,570,426
0
0
null
null
null
null
UTF-8
Swift
false
false
2,798
swift
// // SceneDelegate.swift // StackQ // // Created by Amanda Baret on 2021/04/12. // import UIKit import SwiftUI class SceneDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow? func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). // Create the SwiftUI view that provides the window contents. let contentView = ContentView() .environmentObject(NavigationStore()) .environmentObject(StackStore()) // Use a UIHostingController as window root view controller. if let windowScene = scene as? UIWindowScene { let window = UIWindow(windowScene: windowScene) window.rootViewController = UIHostingController(rootView: contentView) self.window = window window.makeKeyAndVisible() } } func sceneDidDisconnect(_ scene: UIScene) { // Called as the scene is being released by the system. // This occurs shortly after the scene enters the background, or when its session is discarded. // Release any resources associated with this scene that can be re-created the next time the scene connects. // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead). } func sceneDidBecomeActive(_ scene: UIScene) { // Called when the scene has moved from an inactive state to an active state. // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. } func sceneWillResignActive(_ scene: UIScene) { // Called when the scene will move from an active state to an inactive state. // This may occur due to temporary interruptions (ex. an incoming phone call). } func sceneWillEnterForeground(_ scene: UIScene) { // Called as the scene transitions from the background to the foreground. // Use this method to undo the changes made on entering the background. } func sceneDidEnterBackground(_ scene: UIScene) { // Called as the scene transitions from the foreground to the background. // Use this method to save data, release shared resources, and store enough scene-specific state information // to restore the scene back to its current state. } }
[ 372739, 393221, 350214, 219144, 354314, 268299, 393228, 393231, 350225, 186388, 354143, 350241, 374819, 393251, 350245, 352294, 344103, 350249, 350252, 393260, 393269, 213049, 385082, 16444, 393277, 350272, 436290, 254020, 217158, 350281, 376906, 421961, 378956, 254032, 436307, 286804, 356440, 368728, 254045, 342113, 389979, 376932, 430181, 100454, 286833, 368753, 356467, 374904, 329853, 266365, 192640, 262284, 381069, 225425, 268435, 225430, 360598, 356507, 411806, 225439, 286880, 346273, 225442, 438434, 225445, 362661, 225448, 286889, 356521, 438441, 225451, 377003, 377013, 225462, 379067, 225468, 164029, 387261, 389309, 225472, 372931, 225476, 377030, 389322, 350411, 346317, 225485, 377037, 180432, 350417, 225488, 225491, 368854, 350423, 225494, 377047, 350426, 411862, 225497, 411865, 225500, 334047, 225503, 225506, 411874, 356580, 379108, 411877, 217319, 225511, 377063, 387303, 225515, 387307, 205037, 395496, 225519, 350449, 387314, 375027, 393457, 358645, 393461, 381177, 436474, 350459, 321787, 336124, 350462, 379135, 350465, 336129, 385281, 411905, 350469, 389381, 325895, 397572, 262405, 268553, 350477, 43279, 350481, 262417, 368913, 379154, 387350, 356631, 350487, 262423, 432406, 325915, 350491, 381212, 325918, 350494, 258333, 182559, 387353, 356638, 350500, 356641, 377121, 356644, 262437, 350505, 194854, 356647, 389417, 356650, 350510, 395567, 248112, 254253, 391469, 307507, 356656, 262455, 397623, 358714, 358717, 225599, 332098, 201030, 362823, 262473, 348489, 151884, 190797, 334162, 344404, 430422, 418135, 250201, 362844, 332126, 262497, 332130, 250211, 379234, 383331, 418145, 262501, 383334, 250217, 213354, 391531, 262508, 383342, 262512, 182642, 268669, 194942, 250239, 213374, 356734, 389503, 389507, 438657, 356741, 385420, 393613, 420237, 383375, 366991, 379279, 262553, 373146, 340380, 373149, 268702, 416159, 385444, 262567, 354728, 326059, 385452, 262574, 373169, 393649, 375220, 385460, 262587, 266688, 201158, 358857, 272849, 338387, 360917, 195041, 334306, 182755, 162289, 328178, 127473, 217590, 199165, 416255, 254463, 350724, 266757, 164362, 350740, 199189, 393748, 334359, 262679, 420377, 334364, 377372, 188959, 385571, 416294, 377384, 33322, 381483, 350762, 356908, 252463, 334386, 358962, 356917, 352822, 197178, 418364, 358973, 348734, 252483, 356935, 369224, 348745, 381513, 385610, 352844, 385617, 199250, 244309, 399957, 389724, 373344, 346722, 375401, 262761, 381546, 352875, 191085, 346736, 191093, 346743, 352888, 268922, 377473, 385671, 119432, 213642, 330384, 346769, 326291, 184983, 352919, 373399, 340639, 260767, 332455, 150184, 344745, 271018, 361130, 389806, 385714, 434868, 342711, 336568, 381626, 164539, 350207, 260798, 363198, 260802, 350918, 344777, 373450, 372598, 418508, 385743, 273109, 385749, 264919, 391895, 416476, 183006, 139998, 338661, 369382, 332521, 338665, 418540, 361196, 113389, 330479, 264942, 342769, 203508, 363252, 375541, 418555, 348926, 391938, 207620, 344837, 191240, 344843, 391949, 361231, 326417, 375569, 394002, 375572, 418581, 375575, 338712, 418586, 434971, 369436, 375580, 363294, 199455, 418591, 369439, 162592, 418594, 389927, 418600, 418606, 383794, 152371, 326452, 348979, 355123, 326455, 340792, 348983, 369464, 361274, 375613, 398141, 326463, 326468, 355141, 127815, 355144, 361289, 326474, 355151, 326479, 357202, 389971, 326486, 136024, 213848, 357208, 387929, 342875, 357212, 326494, 197469, 254813, 355167, 439138, 357215, 361307, 361310, 361318, 326503, 355176, 375657, 433001, 361323, 326508, 355180, 400238, 326511, 201583, 355185, 349041, 330612, 361335, 211832, 430967, 398202, 119675, 392061, 359296, 351105, 252801, 373635, 260993, 400260, 211846, 342921, 381834, 236432, 361361, 330643, 342931, 430996, 400279, 392092, 400286, 422817, 252838, 359335, 373672, 252846, 222129, 111539, 400307, 412600, 351169, 359362, 170950, 187335, 398280, 359367, 347082, 379849, 340940, 345036, 209874, 386004, 359383, 359389, 248799, 431073, 398307, 437219, 386023, 209896, 201712, 209904, 257009, 359411, 435188, 261109, 261112, 201724, 431100, 330750, 265215, 383999, 431107, 418822, 261130, 326669, 361490, 349203, 386070, 261148, 359452, 357411, 250915, 261155, 158759, 261160, 396329, 347178, 357419, 404526, 359471, 361525, 386102, 388155, 209980, 375868, 361537, 347208, 377931, 197708, 209996, 431180, 341072, 345172, 189525, 349268, 156762, 210011, 343132, 373853, 402523, 412765, 361568, 257121, 322660, 148580, 384102, 210026, 367724, 384108, 326767, 187503, 210032, 349296, 343155, 210037, 386168, 248952, 420985, 361599, 212095, 349313, 351366, 330886, 214150, 210056, 345224, 386187, 384144, 259217, 210068, 351382, 337048, 345247, 251045, 44199, 351399, 380071, 361645, 337072, 367795, 337076, 402615, 367801, 361657, 210108, 351424, 337093, 367817, 326858, 322763, 253132, 402636, 343246, 333010, 210132, 351450, 165086, 66783, 210144, 388320, 328933, 363757, 386286, 218355, 386292, 218361, 351483, 388348, 275713, 275717, 343307, 261391, 175376, 359695, 253202, 349460, 333079, 251161, 345377, 253218, 345380, 175397, 353572, 208167, 263464, 345383, 384299, 273709, 349486, 372016, 437553, 347442, 175416, 396601, 378170, 369979, 415034, 386366, 437567, 175425, 437571, 384324, 343366, 126279, 337224, 212296, 437576, 251211, 357710, 212304, 331089, 437584, 437588, 210261, 331094, 365912, 396634, 175451, 437596, 367966, 259423, 429408, 374113, 365922, 353634, 208228, 374118, 343399, 430940, 345449, 333164, 99692, 367981, 234867, 271731, 390518, 249210, 175484, 175487, 271746, 175491, 181639, 361869, 155021, 136591, 384398, 374161, 349591, 230810, 399200, 343453, 175517, 263585, 396706, 175523, 155045, 40358, 245163, 114093, 337330, 181682, 396723, 343478, 370105, 359867, 259516, 146878, 388543, 415168, 380353, 361922, 327116, 380364, 327118, 359887, 372177, 208338, 359891, 415187, 343509, 249303, 413143, 155103, 271841, 366057, 343535, 366064, 249329, 116211, 368120, 343545, 69114, 402943, 423424, 409092, 253445, 372229, 339464, 249355, 359948, 419341, 208399, 359951, 419345, 419351, 405017, 419357, 345631, 370208, 134689, 419360, 394787, 419363, 370214, 382503, 349739, 144940, 339504, 359984, 419377, 349748, 343610, 419386, 206397, 349762, 214594, 413251, 419401, 333387, 353868, 400977, 419412, 224854, 374359, 400982, 224858, 366173, 403040, 343650, 345702, 224871, 423529, 423533, 245358, 222831, 257647, 138865, 372338, 210547, 155255, 370298, 415354, 353920, 403073, 372354, 403076, 421509, 267910, 339593, 224905, 155274, 198282, 345737, 403085, 159375, 339602, 345750, 403321, 126618, 419484, 345758, 333472, 368289, 345766, 425639, 257705, 419498, 419502, 370351, 257713, 419507, 425652, 224949, 257717, 419510, 257721, 224954, 155323, 333499, 257725, 425663, 155328, 337601, 403139, 257733, 224966, 333512, 210632, 419528, 224970, 419531, 257740, 259789, 339664, 224976, 257745, 272083, 358100, 257748, 419543, 155352, 257752, 419545, 345819, 212700, 155356, 181982, 153311, 366301, 419548, 419551, 257762, 155364, 345829, 366308, 419560, 155372, 419564, 399086, 366319, 339696, 370416, 210673, 366322, 212723, 431852, 366326, 245495, 409336, 257788, 337661, 257791, 155394, 257796, 362249, 257802, 155404, 366349, 210700, 395022, 257805, 225039, 257808, 362252, 362256, 210707, 225044, 167701, 372500, 257815, 399129, 257820, 155423, 210720, 257825, 362274, 360224, 378664, 257837, 413485, 155439, 204592, 366384, 257843, 155444, 372533, 210740, 225077, 257846, 155448, 225080, 358201, 345916, 354107, 257853, 384831, 384829, 397113, 247618, 354112, 397116, 366403, 225094, 155463, 360262, 225097, 341835, 354124, 323404, 345932, 337743, 257869, 370510, 341839, 257872, 354132, 225105, 155477, 225109, 415574, 370520, 225113, 376665, 341852, 155484, 257884, 261982, 425823, 257887, 155488, 413539, 225120, 350046, 257891, 155492, 399208, 376672, 339818, 225128, 257897, 261997, 376686, 345965, 358256, 354157, 268144, 339827, 345968, 341877, 399222, 225138, 262003, 425846, 345971, 257909, 225142, 262006, 345975, 262009, 243584, 257914, 262012, 333699, 155517, 225150, 257922, 155523, 225156, 380803, 155526, 257927, 376715, 155532, 262028, 399244, 262031, 262034, 380823, 225176, 329625, 262040, 262043, 155550, 253854, 262046, 262049, 155560, 155563, 382891, 155566, 362414, 382898, 184245, 350153, 346059, 311244, 393170, 155604, 346069, 399318, 372698, 372704, 419810, 354275, 155620, 253924, 155622, 253927, 190440, 372707, 247790, 356336, 204785, 350194, 393204, 360439, 253944, 393209, 393215, 350204, 155647 ]
347d7585ac870b27be87aa216eb70644d2143c55
b0c5dd9ffe3e296fbd10871f78b5724e8220dbdd
/ChatInGroupPrototype/ChatViewController.swift
e4145e14eb27fab8c11e466dd93e3b8db7139e5b
[]
no_license
casparhendrik/POCChat
6d1fb60fbb915d84a2baf2d28ab27a5c8b7ba5d9
218fc13752c2da352b2fec34645726e46b3937a1
refs/heads/master
2020-09-14T17:21:11.802298
2019-11-21T14:59:50
2019-11-21T14:59:50
223,198,633
0
0
null
null
null
null
UTF-8
Swift
false
false
6,153
swift
// // ChatViewController.swift // ChatInGroupPrototype // // Created by Caspar van Boom on 21/11/2019. // Copyright © 2019 Caspar van Boom. All rights reserved. // import UIKit class ChatViewController: UIViewController, UICollectionViewDelegate, UICollectionViewDataSource { @IBOutlet weak var collectionView: UICollectionView! @IBOutlet weak var currentMessage: UITextField! var messages: [Message] = [] var sender: Bool = true var receiver: Bool = false override func viewDidLoad() { super.viewDidLoad() collectionView.contentInset = UIEdgeInsets(top: 8, left: 0, bottom: 8, right: 0) collectionView.alwaysBounceVertical = true collectionView.backgroundColor = UIColor.white collectionView.keyboardDismissMode = .interactive collectionView.backgroundColor = UIColor.white collectionView.reloadData() } func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return messages.count } func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "cell", for: indexPath) as! ChatLogMessageCell cell.bubbleWidthAnchor?.constant = estimateFrameForText(messages[indexPath.item].text).width + 32 cell.textView.text = self.messages[indexPath.item].text setupCell(cell, message: self.messages[indexPath.item]) return cell } func setupCell(_ cell: ChatLogMessageCell, message: Message) { cell.bubbleView.backgroundColor = UIColor(red: 175/255, green: 249/255, blue: 109/255, alpha: 1) cell.textView.textColor = UIColor.white cell.bubbleViewRightAnchor?.isActive = true cell.bubbleViewLeftAnchor?.isActive = false // } else if receiver { // cell.bubbleView.backgroundColor = UIColor(red: 201/255, green: 201/255, blue: 201/255, alpha: 1) // cell.textView.textColor = UIColor.black // // cell.bubbleViewRightAnchor?.isActive = false // cell.bubbleViewLeftAnchor?.isActive = true // } } func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { print(indexPath.item) } func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { let height = estimateFrameForText(messages[indexPath.item].text).height + 20 let width = UIScreen.main.bounds.width return CGSize(width: width, height: height) } @IBAction func sendMessage(_ sender: Any) { self.messages.append(Message(senderId: "1", text: currentMessage.text!, receiverId: "2")) currentMessage.text = "" self.collectionView.reloadData() } fileprivate func estimateFrameForText(_ text: String) -> CGRect { let size = CGSize(width: 200, height: 1000) let options = NSStringDrawingOptions.usesFontLeading.union(.usesLineFragmentOrigin) return NSString(string: text).boundingRect(with: size, options: options, attributes: convertToOptionalNSAttributedStringKeyDictionary([convertFromNSAttributedStringKey(NSAttributedString.Key.font): UIFont.systemFont(ofSize: 16)]), context: nil) } } class ChatLogMessageCell: UICollectionViewCell { override init(frame: CGRect) { super.init(frame: frame) setupView() } required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) setupView() } func setupView() { addSubview(bubbleView) addSubview(textView) bubbleViewRightAnchor = bubbleView.rightAnchor.constraint(equalTo: self.rightAnchor, constant: -8) bubbleViewRightAnchor?.isActive = true bubbleViewLeftAnchor = bubbleView.leftAnchor.constraint(equalTo: self.leftAnchor, constant: 8) bubbleView.topAnchor.constraint(equalTo: self.topAnchor).isActive = true bubbleWidthAnchor = bubbleView.widthAnchor.constraint(equalToConstant: 200) bubbleWidthAnchor?.isActive = true bubbleView.heightAnchor.constraint(equalTo: self.heightAnchor).isActive = true textView.leftAnchor.constraint(equalTo: bubbleView.leftAnchor, constant: 8).isActive = true textView.topAnchor.constraint(equalTo: self.topAnchor).isActive = true textView.rightAnchor.constraint(equalTo: bubbleView.rightAnchor).isActive = true textView.heightAnchor.constraint(equalTo: self.heightAnchor).isActive = true } let textView: UITextView = { let tv = UITextView() tv.text = "" tv.font = UIFont.systemFont(ofSize: 16) tv.translatesAutoresizingMaskIntoConstraints = false tv.backgroundColor = UIColor.clear tv.textColor = .white tv.isEditable = false return tv }() let bubbleView: UIView = { let view = UIView() // view.backgroundColor = UIColor.blue view.translatesAutoresizingMaskIntoConstraints = false view.layer.cornerRadius = 16 view.layer.masksToBounds = true return view }() var bubbleWidthAnchor: NSLayoutConstraint? var bubbleViewRightAnchor: NSLayoutConstraint? var bubbleViewLeftAnchor: NSLayoutConstraint? } fileprivate func convertToOptionalNSAttributedStringKeyDictionary(_ input: [String: Any]?) -> [NSAttributedString.Key: Any]? { guard let input = input else { return nil } return Dictionary(uniqueKeysWithValues: input.map { key, value in (NSAttributedString.Key(rawValue: key), value)}) } // Helper function inserted by Swift 4.2 migrator. fileprivate func convertFromNSAttributedStringKey(_ input: NSAttributedString.Key) -> String { return input.rawValue }
[ -1 ]
7c9658aba9449fc5b1a32ffa6c2c9a15d13d07c6
bac5fc66b2afafaae5c7f5f4a53b6ba055aaf34d
/Curah/Controllers/Rate & Review Popup/RateReviewPopUpVC.swift
d5509a2a506b89cfeaabff6809a65d3f9bf1aeb6
[]
no_license
ikramaroc/curah
898c1c646e2b82dab29e29221a636b766c45879d
e94a34d1a4634095c6d333e1702ba356f67c6bd9
refs/heads/master
2022-06-30T08:11:21.994490
2019-02-25T06:19:29
2019-02-25T06:19:29
260,384,302
0
0
null
null
null
null
UTF-8
Swift
false
false
2,010
swift
// // RateReviewPopUpVC.swift // QurahApp // // Created by netset on 7/23/18. // Copyright © 2018 netset. All rights reserved. // import UIKit import FloatRatingView import KMPlaceholderTextView protocol reloadServiceDataProtocol { func reloadData() } class RateReviewPopUpVC: UIViewController { @IBOutlet weak var textVwMessage: KMPlaceholderTextView! @IBOutlet var ratingVw: FloatRatingView! var otherUserId = Int() var bookingId = Int() var delegate : reloadServiceDataProtocol! override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } func validation(){ if textVwMessage.text.count == 0{ Progress.instance.displayAlert(userMessage:Validation.call.enterDescriptionText) }else{ self.submitRatingApi() } } func submitRatingApi(){ APIManager.sharedInstance.giveRatingAPI(otherUserId: otherUserId, bookingId: bookingId, ratingValue: Int(ratingVw.rating), description: textVwMessage.text!) { (response) in self.delegate.reloadData() Progress.instance.displayAlert(userMessage: response.message!) self.dismiss(animated: true, completion: nil) } } /* // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepare(for segue: UIStoryboardSegue, sender: Any?) { // Get the new view controller using segue.destinationViewController. // Pass the selected object to the new view controller. } */ @IBAction func btnCancelAct(_ sender: Any) { dismiss(animated: true, completion: nil) } @IBAction func btnSubmitAct(_ sender: Any) { validation() } }
[ -1 ]
c12e17f6bb6e18b539d8767483dfbd82c5c89853
ece956a43a5e1407c834815f23707e8700931240
/CocktailApp/CocktailApp/Extension/UIColorExtension.swift
abeb660706fb223c6a256efc17f8d881de52e9d0
[]
no_license
zxc1460/CocktailApp
f579de8b17916afabc7bc0483dc83f2df86ed396
a4bbb282bbcb5ab6fd01a7031b9a56489d077294
refs/heads/master
2023-08-23T17:44:53.723097
2021-10-27T04:50:16
2021-10-27T04:50:16
409,509,722
2
0
null
null
null
null
UTF-8
Swift
false
false
768
swift
// // UIColor.swift // CocktailApp // // import UIKit extension UIColor { convenience init(hex: String, alpha: CGFloat = 1.0) { var hexString: String = hex.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines) if hexString.hasPrefix("#") { hexString = String(hexString.dropFirst()) } assert(hexString.count == 6, "Invalid hex code used.") var rgbValue: UInt64 = 0 Scanner(string: hexString).scanHexInt64(&rgbValue) self.init( red: CGFloat((rgbValue & 0xFF0000) >> 16) / 255.0, green: CGFloat((rgbValue & 0x00FF00) >> 8) / 255.0, blue: CGFloat((rgbValue & 0x0000FF)) / 255.0, alpha: alpha ) } }
[ -1 ]
dea35e582a87d8602dd70ea5bd2ebf33b14e3e00
1e853723da05891564fd711c13e1b77c8e64b7e0
/Swiftagram/Controllers/CameraViewController.swift
acddefd9850a196ee038ba01ec39b53fdf074007
[]
no_license
jonabantao/swiftagram
f982d5eadd3f275141a1d2c2184ff81ea2c5e4e1
c5757a57ed6bc2df5cbfba1f57eac60fa4ff79f0
refs/heads/master
2020-09-06T23:43:34.582597
2019-11-22T03:47:42
2019-11-22T03:47:42
220,591,391
0
0
null
null
null
null
UTF-8
Swift
false
false
2,390
swift
// // CameraViewController.swift // Swiftagram // // Created by Jonathan Abantao on 11/13/19. // Copyright © 2019 Jonathan Abantao. All rights reserved. // import UIKit import AlamofireImage import Parse class CameraViewController: UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate { @IBOutlet weak var imageView: UIImageView! @IBOutlet weak var commentField: UITextField! override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. } @IBAction func onCameraButton(_ sender: Any) { let picker = UIImagePickerController() picker.delegate = self picker.allowsEditing = true if UIImagePickerController.isSourceTypeAvailable(.camera) { picker.sourceType = .camera } else { picker.sourceType = .photoLibrary } present(picker, animated: true, completion: nil) } func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) { let image = info[.editedImage] as! UIImage let size = CGSize(width: 300, height: 300) let scaledImage = image.af_imageAspectScaled(toFill: size) imageView.image = scaledImage dismiss(animated: true, completion: nil) } @IBAction func onSubmitImage(_ sender: Any) { let post = PFObject(className: "Posts") post["caption"] = commentField.text! post["author"] = PFUser.current()! let imageData = imageView.image!.pngData() let file = PFFileObject(data: imageData!) post["image"] = file post.saveInBackground { (success, error) in if (success) { self.dismiss(animated: true, completion: nil) } else { print("\(String(describing: error))") } } } /* // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepare(for segue: UIStoryboardSegue, sender: Any?) { // Get the new view controller using segue.destination. // Pass the selected object to the new view controller. } */ }
[ 403071 ]
d9a82a096800269547dab68e7b237798e1b5a75f
0890647075acc77fc01818a1ae4b514909500476
/ZipzSDK/AWARequest/Service/NetworkRouter.swift
90f4d9f7a7796d608d9bf15e35e28d63c7c3e959
[]
no_license
Zipz-App/zipz-sdk-ios
9e81b9d2c07c1b2039895def75c5d59fa69329c7
8b5b17d8b4cdffe1451f1ded9debcd6d636c9ec4
refs/heads/master
2022-12-13T02:55:28.955450
2020-08-26T00:32:12
2020-08-26T00:32:12
286,765,529
0
0
null
null
null
null
UTF-8
Swift
false
false
1,149
swift
// // NetworkRouter.swift // Networking // // Created by Mirko Trkulja on 16/04/2018. // Copyright © 2018 Mirko Trkulja. All rights reserved. // import Foundation public typealias NetworkRouterCompletion = (_ data: Data?, _ response: URLResponse?, _ error: Error?)->() protocol NetworkRouter: class { associatedtype Endpoint: EndpointProtocol func request(_ route: Endpoint, completion: @escaping NetworkRouterCompletion) func cancel() } public enum NetworkEnvironment { case development case production case staging } public enum NetworkResponse: String { // TODO: - Write better and more helpful response error messages case success case authenticationError = "You need to authenticate first." case badRequest = "Bad request." case failed = "Network request failed." case outdated = "The url you requested is outdated." case unableToDecode = "We could not decode the response." case noData = "Response returned with no data to decode." } public enum Result<String> { case success case failure(String) }
[ -1 ]
216c39c17b6d934b131d50d3892026500b019cfe
ca612bb20ab3b0641a3fa06001a7fc1eaaa3766a
/ItemManager/AppDelegate.swift
4e23bcbc92c9aabff818b5e8231f4604f6fa49bc
[]
no_license
min0727/ItemManager
957cbe46b08522f56c17b5a8f75ae15463a55955
2848a1ff405c78fc0212e03ef42b0a821d380550
refs/heads/master
2021-01-18T22:29:32.356079
2017-04-03T09:36:33
2017-04-03T09:36:33
87,056,967
0
0
null
null
null
null
UTF-8
Swift
false
false
2,164
swift
// // AppDelegate.swift // ItemManager // // Created by 松崎 勝治 on 2017/03/27. // Copyright (c) 2017 ___松崎 勝治___. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } func applicationWillResignActive(_ application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. } func applicationDidEnterBackground(_ application: UIApplication) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } func applicationWillEnterForeground(_ application: UIApplication) { // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. } func applicationDidBecomeActive(_ application: UIApplication) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } }
[ 229380, 229383, 229385, 278539, 294924, 229388, 278542, 229391, 327695, 229394, 278548, 229397, 229399, 229402, 352284, 229405, 278556, 278559, 278564, 294950, 229415, 229417, 327722, 237613, 229422, 360496, 229426, 237618, 229428, 311349, 286774, 286776, 319544, 286778, 229432, 204856, 286791, 237640, 286797, 278605, 311375, 163920, 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, 286916, 295110, 286922, 286924, 286926, 319694, 286928, 131281, 278743, 278747, 295133, 155872, 319716, 237807, 303345, 286962, 303347, 131314, 229622, 327930, 278781, 278783, 278785, 237826, 319751, 286987, 319757, 311569, 286999, 319770, 287003, 287006, 287009, 287012, 287014, 287016, 287019, 311598, 287023, 262448, 311601, 295220, 155966, 319809, 319810, 278849, 319814, 311623, 319818, 311628, 319822, 287054, 278865, 229717, 196963, 196969, 139638, 213367, 106872, 319872, 311683, 319879, 311693, 65943, 319898, 311719, 278952, 139689, 278957, 311728, 278967, 180668, 311741, 278975, 319938, 278980, 278983, 319945, 278986, 278990, 278994, 311767, 279003, 279006, 188895, 172512, 287202, 279010, 279015, 172520, 319978, 279020, 172526, 311791, 279023, 172529, 279027, 319989, 172534, 180727, 164343, 279035, 311804, 287230, 279040, 303617, 287234, 279045, 172550, 303623, 172552, 287238, 320007, 279051, 172558, 279055, 303632, 279058, 303637, 279063, 279067, 172572, 279072, 172577, 295459, 172581, 295461, 279082, 279084, 172591, 172598, 279095, 172607, 172609, 172612, 377413, 172614, 213575, 172618, 303690, 33357, 303696, 279124, 172634, 262752, 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, 172751, 287440, 295633, 172755, 303827, 279255, 287450, 303835, 279258, 189149, 303838, 213724, 312035, 279267, 295654, 279272, 230128, 312048, 312050, 230131, 205564, 303871, 230146, 328453, 295685, 230154, 33548, 312077, 295695, 295701, 230169, 369433, 295707, 328476, 295710, 230175, 295720, 303914, 279340, 279353, 230202, 312124, 328508, 222018, 295755, 377676, 148302, 287569, 303959, 230237, 279390, 230241, 279394, 303976, 336744, 303981, 303985, 328563, 303987, 303991, 303997, 295806, 295808, 295813, 304005, 320391, 213895, 304007, 304009, 304011, 304013, 295822, 279438, 213902, 189329, 295825, 304019, 189331, 58262, 304023, 304027, 279452, 279461, 279462, 304042, 213931, 230327, 304055, 287675, 197564, 230334, 304063, 238528, 304065, 213954, 189378, 156612, 197580, 312272, 304084, 304090, 320481, 304106, 320490, 312302, 328687, 320496, 304114, 295928, 320505, 295945, 230413, 295949, 197645, 320528, 140312, 295961, 238620, 304164, 304170, 304175, 238641, 312374, 238652, 238655, 230465, 238658, 336964, 296004, 205895, 320584, 238666, 296021, 402518, 336987, 230497, 296036, 296040, 361576, 205931, 296044, 279661, 205934, 164973, 312432, 279669, 337018, 189562, 279679, 304258, 279683, 222340, 205968, 296084, 238745, 304285, 238756, 205991, 222377, 165035, 337067, 238766, 165038, 230576, 238770, 304311, 230592, 312518, 279750, 230600, 230607, 148690, 320727, 279769, 304348, 279777, 304354, 296163, 320740, 279781, 304360, 320748, 279788, 279790, 304370, 296189, 320771, 312585, 296202, 296205, 230674, 320786, 230677, 296213, 296215, 320792, 230681, 214294, 304416, 230689, 173350, 312622, 296243, 312630, 222522, 296253, 222525, 296255, 312639, 296259, 378181, 296262, 230727, 238919, 296264, 320840, 296267, 296271, 222545, 230739, 312663, 222556, 337244, 230752, 312676, 230760, 173418, 148843, 410987, 230763, 230768, 296305, 312692, 230773, 304505, 304506, 279929, 181626, 181631, 148865, 312711, 312712, 296331, 288140, 288144, 230800, 337306, 288154, 288160, 173472, 288162, 288164, 279975, 304555, 370092, 279983, 173488, 288176, 279985, 312755, 296373, 312759, 279991, 288185, 337335, 222652, 312766, 173507, 296389, 222665, 230860, 312783, 288208, 230865, 288210, 370130, 222676, 288212, 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, 230923, 304651, 304653, 370187, 230940, 222752, 108066, 296486, 296488, 157229, 239152, 230961, 157236, 288320, 288325, 124489, 280145, 288338, 280149, 288344, 280152, 239194, 280158, 403039, 370272, 239202, 312938, 280183, 280185, 280191, 116354, 280194, 280208, 280211, 288408, 280222, 190118, 198310, 321195, 296622, 321200, 337585, 296626, 296634, 296637, 313027, 280260, 206536, 280264, 206539, 206541, 206543, 313044, 280276, 321239, 280283, 313052, 18140, 288478, 313055, 321252, 313066, 288494, 280302, 321266, 288499, 419570, 288502, 280314, 288510, 124671, 67330, 280324, 198405, 288519, 280331, 198416, 296723, 116503, 321304, 329498, 296731, 321311, 313121, 313123, 304932, 321316, 280363, 141101, 165678, 280375, 321336, 296767, 288576, 345921, 280388, 337732, 304968, 280393, 280402, 173907, 313171, 313176, 42842, 280419, 321381, 296809, 296812, 313201, 1920, 255873, 305028, 280454, 247688, 124817, 280468, 239510, 280473, 124827, 214940, 247709, 214944, 313258, 321458, 296883, 124853, 214966, 296890, 10170, 288700, 296894, 190403, 296900, 280515, 337862, 165831, 280521, 231379, 296921, 239586, 313320, 231404, 124913, 165876, 321528, 239612, 313340, 288764, 239617, 313347, 288773, 313358, 305176, 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, 280681, 313451, 223341, 280687, 149618, 215154, 313458, 280691, 313464, 329850, 321659, 288895, 321670, 215175, 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, 280919, 354653, 313700, 280937, 313705, 190832, 280946, 223606, 313720, 280956, 239997, 280959, 313731, 199051, 240011, 289166, 240017, 297363, 190868, 240021, 297365, 297368, 297372, 141725, 297377, 289186, 297391, 289201, 240052, 289207, 289210, 305594, 281024, 289218, 289227, 281047, 215526, 166378, 305647, 281075, 174580, 240124, 281084, 305662, 305664, 240129, 305666, 305668, 223749, 240132, 281095, 223752, 150025, 338440, 330244, 223757, 281102, 223763, 223765, 281113, 322074, 281116, 281121, 182819, 281127, 281135, 150066, 158262, 158266, 289342, 281154, 322115, 158283, 338528, 338532, 281190, 199273, 281196, 19053, 158317, 313973, 297594, 281210, 158347, 182926, 133776, 314003, 117398, 314007, 289436, 174754, 330404, 289448, 133801, 174764, 314029, 314033, 240309, 314045, 314047, 314051, 199364, 297671, 158409, 289493, 363234, 289513, 289522, 289525, 289532, 322303, 289537, 322310, 264969, 322314, 322318, 281361, 281372, 322341, 215850, 281388, 289593, 281401, 289601, 281410, 281413, 281414, 240458, 281420, 240468, 281430, 322393, 297818, 281435, 281438, 174955, 224110, 207733, 207737, 158596, 183172, 240519, 322440, 314249, 338823, 183184, 142226, 289687, 240535, 297883, 289694, 289696, 289700, 289712, 281529, 289724, 52163, 183260, 281567, 289762, 322534, 297961, 183277, 281581, 322550, 134142, 322563, 314372, 330764, 175134, 322599, 322610, 314421, 281654, 314427, 314433, 207937, 314441, 322642, 314456, 281691, 314461, 281702, 281704, 314474, 281711, 289912, 248995, 306341, 306344, 306347, 322734, 306354, 142531, 199877, 289991, 306377, 289997, 249045, 363742, 363745, 298216, 330988, 216303, 322801, 388350, 257302, 363802, 199976, 199978, 314671, 298292, 298294, 216376, 380226, 298306, 224587, 224594, 216404, 306517, 150870, 314714, 224603, 159068, 314718, 265568, 314723, 281960, 150890, 306539, 314732, 314736, 290161, 216436, 306549, 298358, 314743, 306552, 290171, 314747, 306555, 290174, 298365, 224641, 281987, 298372, 314756, 281990, 224647, 298377, 314763, 314768, 224657, 306581, 314773, 314779, 314785, 314793, 282025, 282027, 241068, 241070, 241072, 282034, 150966, 298424, 306618, 282044, 323015, 306635, 306640, 290263, 290270, 290275, 339431, 282089, 191985, 282098, 290291, 282101, 241142, 191992, 290298, 151036, 290302, 290305, 306694, 192008, 323084, 257550, 282127, 290321, 282130, 290325, 282133, 241175, 290328, 290332, 241181, 282142, 282144, 290344, 306731, 290349, 290351, 290356, 282186, 224849, 282195, 282201, 306778, 159324, 159330, 314979, 298598, 323176, 224875, 241260, 323181, 257658, 315016, 282249, 290445, 324757, 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, 298822, 315211, 307027, 315221, 315223, 241496, 241498, 307035, 307040, 110433, 282465, 241509, 110438, 298860, 110445, 282478, 315249, 110450, 315251, 315253, 315255, 339838, 315267, 315269, 241544, 282505, 241546, 241548, 298896, 298898, 282514, 241556, 44948, 298901, 241560, 282520, 241563, 241565, 241567, 241569, 282531, 241574, 282537, 298922, 241581, 241583, 323504, 241586, 290739, 241588, 282547, 241590, 241592, 241598, 290751, 241600, 241605, 151495, 241610, 298975, 241632, 298984, 241643, 298988, 241646, 241649, 241652, 323574, 290807, 299003, 241661, 299006, 282623, 315396, 241669, 315397, 282632, 282639, 290835, 282645, 241693, 241701, 102438, 217127, 282669, 323630, 282681, 290877, 282687, 159811, 315463, 315466, 192589, 307278, 192596, 307287, 307290, 217179, 315482, 192605, 315483, 233567, 299105, 200801, 217188, 299109, 307303, 315495, 356457, 45163, 307307, 315502, 192624, 307314, 323700, 299126, 233591, 299136, 307329, 315524, 307338, 233613, 241813, 307352, 299164, 299167, 315552, 184479, 184481, 315557, 184486, 307370, 307372, 307374, 307376, 299185, 323763, 184503, 299191, 176311, 307385, 307386, 307388, 258235, 307390, 176316, 299200, 307394, 299204, 307396, 184518, 307399, 323784, 233679, 307409, 307411, 299225, 233701, 307432, 282881, 184586, 282893, 323854, 291089, 282906, 291104, 233766, 299304, 295583, 307508, 315701, 332086, 307510, 307512, 307515, 307518, 282942, 282947, 323917, 110926, 282957, 233808, 323921, 315733, 323926, 233815, 315739, 299357, 242018, 242024, 299373, 315757, 250231, 242043, 315771, 299391, 291202, 299398, 242057, 291212, 299405, 291222, 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, 127431, 127434, 315856, 127440, 176592, 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, 127494, 283142, 127497, 233994, 135689, 127500, 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, 135820, 316051, 225941, 316054, 299672, 135834, 373404, 299677, 135839, 299680, 225954, 299684, 135844, 242343, 209576, 242345, 373421, 299706, 135870, 135873, 135876, 135879, 299720, 299723, 299726, 225998, 226002, 119509, 226005, 299740, 201444, 299750, 283368, 234219, 283372, 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, 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, 234364, 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, 234449, 316370, 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, 308379, 300189, 324766, 119967, 234653, 283805, 234657, 324768, 242852, 300197, 234661, 283813, 234664, 275626, 234667, 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, 275725, 349464, 283939, 259367, 292143, 283951, 300344, 243003, 283963, 226628, 300357, 283973, 283983, 316758, 357722, 316766, 292192, 316768, 218464, 292197, 316774, 218473, 284010, 136562, 324978, 275834, 275836, 275840, 316803, 316806, 316811, 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, 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, 276052, 284253, 300638, 284255, 235097, 284258, 292452, 292454, 284263, 284265, 292458, 284267, 292461, 284272, 284274, 284278, 292470, 276086, 292473, 284283, 276093, 284286, 292479, 284288, 292481, 284290, 325250, 284292, 292485, 276095, 276098, 284297, 317066, 284299, 317068, 284301, 276109, 284303, 284306, 276114, 284308, 284312, 284314, 284316, 276127, 284320, 284322, 284327, 284329, 317098, 284331, 276137, 284333, 284335, 276144, 284337, 284339, 300726, 284343, 284346, 284350, 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, 276268, 300845, 243504, 300850, 284469, 276280, 325436, 358206, 276291, 366406, 276295, 292681, 153417, 358224, 276308, 178006, 317271, 284502, 276315, 292700, 317279, 284511, 227175, 292715, 300912, 292721, 284529, 300915, 292729, 317306, 284540, 292734, 325512, 276365, 317332, 358292, 284564, 284566, 350106, 284572, 276386, 284579, 276388, 358312, 317353, 292776, 284585, 276395, 292784, 358326, 161718, 358330, 276410, 276411, 276418, 301009, 301011, 301013, 292823, 358360, 301017, 301015, 292828, 276446, 153568, 276448, 276452, 292839, 276455, 292843, 276460, 292845, 276464, 178161, 227314, 276466, 325624, 276472, 317435, 276476, 276479, 276482, 276485, 317446, 276490, 292876, 317456, 276496, 317458, 178195, 243733, 243740, 317468, 317472, 325666, 243751, 292904, 276528, 243762, 309298, 325685, 325689, 235579, 325692, 235581, 178238, 276539, 276544, 284739, 325700, 243779, 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, 350375, 350379, 350381, 350383, 129200, 350385, 350387, 350389, 350395, 350397, 350399, 227520, 350402, 227522, 301252, 350406, 227529, 301258, 309450, 276685, 309455, 276689, 309462, 301272, 194780, 309468, 309471, 301283, 317672, 317674, 325867, 309491, 227571, 309494, 243960, 276735, 227583, 227587, 276739, 276742, 227593, 227596, 325910, 309530, 342298, 211232, 317729, 276775, 211241, 325937, 325943, 211260, 260421, 276809, 285002, 276811, 235853, 235858, 276829, 276833, 391523, 276836, 293227, 276843, 293232, 276848, 186744, 211324, 227709, 285061, 317833, 178572, 285070, 285077, 227738, 317853, 276896, 317858, 342434, 285093, 317864, 276907, 235955, 276917, 293304, 293307, 293314, 309707, 293325, 317910, 293336, 235996, 317917, 293343, 358880, 276961, 227810, 293346, 276964, 293352, 236013, 293364, 301562, 293370, 317951, 309764, 301575, 121352, 293387, 236043, 342541, 113167, 309779, 317971, 309781, 277011, 55837, 227877, 227879, 293417, 227882, 309804, 293421, 105007, 236082, 23094, 277054, 219714, 129603, 301636, 318020, 301639, 301643, 277071, 285265, 399955, 309844, 277080, 309849, 285277, 285282, 326244, 318055, 277100, 121458, 277106, 170619, 309885, 309888, 277122, 277128, 285320, 301706, 318092, 326285, 334476, 318094, 277136, 277139, 227992, 334488, 318108, 285340, 318110, 227998, 137889, 383658, 285357, 318128, 277170, 293555, 342707, 154292, 318132, 277173, 277177, 277181, 318144, 277187, 277191, 277194, 277196, 277201, 137946, 113378, 228069, 277223, 342760, 285417, 56043, 277232, 228081, 56059, 310015, 285441, 310020, 285448, 310029, 228113, 285459, 277273, 293659, 326430, 228128, 285474, 293666, 228135, 318248, 277291, 318253, 293677, 285489, 301876, 293685, 285494, 301880, 301884, 293696, 310080, 277317, 277322, 293706, 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, 276586, 293849, 293861, 228327, 228328, 318442, 228330, 228332, 326638, 277486, 318450, 293876, 293877, 285686, 302073, 121850, 293882, 302075, 244731, 285690, 293887, 277504, 277507, 277511, 293899, 277519, 293908, 302105, 293917, 293939, 318516, 277561, 277564, 310336, 293956, 277573, 228422, 293960, 310344, 277577, 277583, 203857, 293971, 310355, 310359, 236632, 277594, 138332, 277598, 203872, 277601, 285792, 310374, 203879, 310376, 228460, 318573, 203886, 187509, 285815, 367737, 285817, 302205, 285821, 392326, 285831, 253064, 294026, 302218, 285835, 162964, 384148, 187542, 302231, 285849, 302233, 285852, 302237, 285854, 285856, 302241, 277671, 302248, 64682, 277678, 294063, 294065, 302258, 277687, 294072, 318651, 294076, 277695, 318657, 244930, 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, 64768, 310531, 285958, 138505, 228617, 318742, 277798, 130345, 113964, 285997, 285999, 113969, 318773, 318776, 286010, 417086, 286016, 302403, 294211, 384328, 294221, 294223, 326991, 179547, 146784, 302436, 294246, 327015, 310632, 327017, 351594, 351607, 310648, 310651, 310657, 351619, 294276, 310659, 327046, 253320, 310665, 318858, 310672, 351633, 310689, 130468, 228776, 277932, 310703, 310710, 130486, 310712, 310715, 302526, 228799, 302534, 310727, 64966, 245191, 163272, 302541, 302543, 310737, 228825, 163290, 310749, 310755, 187880, 310764, 286188, 310772, 40440, 212472, 40443, 286203, 40448, 228864, 286214, 228871, 302603, 65038, 302614, 286233, 302617, 302621, 286240, 146977, 187939, 40484, 294435, 40486, 286246, 294440, 40488, 294439, 294443, 40491, 294445, 278057, 310831, 245288, 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, 294521, 343679, 294537, 310925, 286354, 278163, 302740, 122517, 278168, 179870, 327333, 229030, 278188, 302764, 278192, 319153, 278196, 302781, 319171, 302789, 294599, 278216, 294601, 302793, 343757, 212690, 319187, 278227, 286420, 229076, 286425, 319194, 278235, 301163, 278238, 229086, 294625, 294634, 302838, 319226, 286460, 278274, 302852, 278277, 302854, 294664, 311048, 352008, 319243, 311053, 302862, 319251, 294682, 278306, 188199, 294701, 278320, 319280, 319290, 229192, 302925, 188247, 188252, 237409, 229233, 294776, 360317, 294785, 327554, 40851, 294811, 237470, 319390, 40865, 319394, 294817, 294821, 311209, 180142, 343983, 294831, 188340, 40886, 319419, 294844, 294847, 393177, 294876, 294879, 294883, 311279, 278513, 237555, 278516, 311283, 278519, 237562 ]
987463003a87f1a7ff362dfe861ab12ab8f341cf
f2de064c38a5823c22e63f6a45df3f76e21c9bd4
/Cryptohopper-iOS-SDK/API/Hopper/Subscription/ReAssignSubscription/HopperAPIReassignSubsriptionRequest.swift
2bb0ab3863f0a6eb904d3457d69a58f3ac0c5674
[ "MIT" ]
permissive
mabeljarsdel/cryptohopper-ios-sdk
a30283085de972abdfe8632347930de7c6e9e4dc
43dd7177502b9294719d94f8da242661394a28c2
refs/heads/master
2023-06-20T16:38:17.421589
2021-07-27T06:39:32
2021-07-27T06:39:32
null
0
0
null
null
null
null
UTF-8
Swift
false
false
703
swift
// // HopperAPIReassignSubsriptionRequest.swift // Cryptohopper-iOS-SDK // // Created by Kaan Baris Bayrak on 28/10/2020. // import Foundation import UIKit class HopperAPIReassignSubsriptionRequest: HopperAPIRequest<HopperCommonMessageResponse> { convenience init(hopperId : String,subscriptionId: String) { self.init() self.changeUrlPath(path: "/v1" + "/subscription/assign") addBodyItem(name: "hopper_id", value: hopperId) addBodyItem(name: "subscription_id", value: subscriptionId) } override var httpMethod: HopperAPIHttpMethod { return .POST } override var needsAuthentication: Bool { return true } }
[ -1 ]
992813d68bd4553d089151418ac4d117f0feb667
d8c5b321d0d3197371fb466637ef2b212a97df0c
/Figofy/LoggedInUser.swift
f756e5619a3eccaa6a450649a10fac4d4163cf93
[]
no_license
TommyFrederiksen/Dissertation
0e3b9db37e8f39426bb15689fd115c27accf63ba
a0d51578c42735fac5fe2a0cba5086c96cc3788c
refs/heads/master
2021-07-16T06:34:29.631422
2016-10-02T10:22:21
2016-10-02T10:22:21
56,581,650
0
0
null
null
null
null
UTF-8
Swift
false
false
780
swift
// // LoggedInUser.swift // Figofy // // Created by Tommy on 14/03/2016. // Copyright © 2016 Tommy. All rights reserved. // import UIKit import Foundation import FBSDKCoreKit import FBSDKLoginKit class LoggedInUser { var _id:String var _firstName: String init(id: String?, firstName: String?) { _id = id! _firstName = firstName! } private static var CLoggedInUser: LoggedInUser? static func CurrentLoggedInUser(Id: String,FirstName: String) -> LoggedInUser{ if CLoggedInUser == nil{ CLoggedInUser = LoggedInUser(id: Id,firstName: FirstName) } return CLoggedInUser! } static func CurrentLoggedInUser() -> LoggedInUser{ return CLoggedInUser! } }
[ -1 ]
1fdf381856d5171224892e7f4baefd9c00564ea5
aabdb7e59c1036e405ae99af58602ae632d9a96b
/HatchingTests/CircleTests.swift
c1f4430ff7a9a453e7610e3035bc5afa583d41e0
[]
no_license
vytis/Circlone
c0a5ecc095544a2c4f0aa535e4620fb1dc4d0fe7
0db70c2449d779a714b852e4615861d5efc75176
refs/heads/master
2021-01-19T04:38:48.833468
2018-05-30T17:17:06
2018-05-30T17:17:06
51,283,317
4
0
null
2022-10-21T15:34:18
2016-02-08T06:55:15
Swift
UTF-8
Swift
false
false
1,130
swift
// // CircleTests.swift // Circlone // // Created by Vytis ⚫ on 2016-08-12. // Copyright © 2016 🗿. All rights reserved. // import XCTest @testable import Hatching class CircleTests: XCTestCase { func testCircleEqualWhenAllValuesAreEqual() { XCTAssertEqual(one, one) XCTAssertNotEqual(one, two) XCTAssertNotEqual(two, three) } func testCircleIsBiggerWhenRadiusIsBigger() { XCTAssertLessThan(one, three) XCTAssertLessThan(two, three) XCTAssertLessThanOrEqual(one, one) } func testContainsPointWhenPointIsInside() { XCTAssertTrue(one.containsPoint(x: 1, y: 2)) XCTAssertTrue(one.containsPoint(x: 2, y: 3)) XCTAssertFalse(one.containsPoint(x: 4, y: 5)) } func testCollidesWhenThereIsOverlappingArea() { XCTAssertTrue(one.collides(one)) XCTAssertTrue(one.collides(three)) XCTAssertFalse(one.collides(two)) } func testCollidesWhenAtLeastOneCircleCollides() { XCTAssertTrue(one.collides([two, three])) XCTAssertFalse(one.collides([two, four])) } }
[ -1 ]
9d62e977459da831168063242fee9951a59af3ac
97882e64d3e51a296b66310889b181009ada25bb
/DecodableMVVM/Extensions.swift
828ce0938585b00503c166f6d9af6d6fa93d53f0
[]
no_license
talipboke/DecodableMVVM
d1add8753d5b046bdddaf4f4da4b76b7ad97ad5e
b3f512da336aa71a39f73c307bcc48a564cf7d5e
refs/heads/master
2020-03-14T04:37:29.199264
2018-04-28T21:35:06
2018-04-28T21:35:06
131,445,459
5
0
null
null
null
null
UTF-8
Swift
false
false
410
swift
// // Extensions.swift // DecodableMVVM // // Created by a on 4/28/18. // Copyright © 2018 Talip. All rights reserved. // import Foundation extension NSObject { var className: String { return String(describing: type(of: self)).components(separatedBy: ".").last! } class var className: String { return String(describing: self).components(separatedBy: ".").last! } }
[ -1 ]
51156cdd5d95bc9cce087c463ccaf766b19f9cf6
2c89fd48ae01638edf64384b1f96f5c822e68b96
/Unrepeatable/Unrepeatable/CrossFunctional/Extensions/JSONDecoder/JSONDecoder+Extension.swift
10665f519978dc965cb51721983b08f806260f94
[ "MIT" ]
permissive
inahuelzapata/Unrepeatable
8a79f9ebc949fa8301f8528bc0f950759e80b4d5
29e8e6854f9069384bde9fc2c6912c0903ba6d05
refs/heads/master
2020-05-29T15:24:00.172060
2019-05-29T18:12:48
2019-05-29T18:12:48
189,219,102
0
0
null
null
null
null
UTF-8
Swift
false
false
552
swift
// // JSONDecoder+Extension.swift // Unrepeatable // // Created by Nahuel Zapata on 5/11/19. // Copyright © 2019 iNahuelZapata. All rights reserved. // import Foundation extension JSONDecoder { func decode<T: Decodable>(_ type: T.Type, withJSONObject object: Any, options opt: JSONSerialization.WritingOptions = .prettyPrinted) throws -> T { let data = try JSONSerialization.data(withJSONObject: object, options: opt) return try decode(T.self, from: data) } }
[ -1 ]
2b3fc379b6226f1d34d6abba0f3d75906ff66f53
9809c8c30cd11f96de9c4dea2b222d62d5ae6d26
/Tests/SwiftLintFrameworkTests/UnusedOptionalBindingRuleTests.swift
8cc20f0b06be297e10851da1482d4376145a3205
[ "MIT" ]
permissive
417-72KI/SwiftLint
156dc6da7faceebd5e7d15f0b145506594dafa5f
d6ff2a7f37dbc211f4bd219f3e52946fbb50772d
refs/heads/master
2023-04-18T12:46:33.653463
2023-01-01T22:23:50
2023-01-01T22:23:50
221,587,004
1
0
MIT
2023-04-04T01:31:34
2019-11-14T01:42:35
Swift
UTF-8
Swift
false
false
1,028
swift
@testable import SwiftLintFramework import XCTest class UnusedOptionalBindingRuleTests: XCTestCase { func testDefaultConfiguration() { let baseDescription = UnusedOptionalBindingRule.description let triggeringExamples = baseDescription.triggeringExamples + [ Example("guard let _ = try? alwaysThrows() else { return }") ] let description = baseDescription.with(triggeringExamples: triggeringExamples) verifyRule(description) } func testIgnoreOptionalTryEnabled() { // Perform additional tests with the ignore_optional_try settings enabled. let baseDescription = UnusedOptionalBindingRule.description let nonTriggeringExamples = baseDescription.nonTriggeringExamples + [ Example("guard let _ = try? alwaysThrows() else { return }") ] let description = baseDescription.with(nonTriggeringExamples: nonTriggeringExamples) verifyRule(description, ruleConfiguration: ["ignore_optional_try": true]) } }
[ 169967 ]
624467177daa421a1501491bf7184e4429f1b61c
233c646536bbb8f8953980e119008004b20a3f23
/ApresCuisine/DishItem.swift
6323b2e73a548c4484a75dd372eac6e6a41406c4
[]
no_license
yogione/ApresCuisineDeux
0f1d41676b3d76103cebc53fc8add0d1954a6888
1b7dd397a124c135c46065d5ce2beb33956884d9
refs/heads/master
2020-12-24T18:41:55.071607
2017-04-04T01:10:42
2017-04-04T01:10:42
86,154,298
0
0
null
null
null
null
UTF-8
Swift
false
false
1,103
swift
// // DishItem.swift // ApresCuisine // // Created by Srini Motheram on 2/26/17. // Copyright © 2017 Srini Motheram. All rights reserved. // import Foundation import Parse class DishItem:PFObject, PFSubclassing { @NSManaged var dishName :String! @NSManaged var dateEaten :Date? @NSManaged var rating :Int @NSManaged var reviewText :String! @NSManaged var imageFileName :String! @NSManaged var lat :String! @NSManaged var long :String! convenience init(dishname: String, rating: Int, review: String, imageFileName: String, lat: String, long: String){ self.init() self.dishName = dishname self.dateEaten = NSDate() as Date self.rating = rating self.reviewText = review self.imageFileName = imageFileName self.lat = lat self.long = long } static func parseClassName() -> String { return "DishItem" } }
[ -1 ]
811641908269ce4786f7c3168ee4fcfcf53db52a
931ee1b78864b0635389833588922d8be96162c7
/Source/BMPlayerControlView.swift
bd455a1a168b0382a4b2a819f9bd1758e1449407
[ "MIT" ]
permissive
amirriyadh/BMPlayer
a839cb51e7ad20dd682e4d4cfb80d58d5aed5265
44365db976386f6972f7ad22d69af601427b4277
refs/heads/master
2021-10-07T10:32:36.448227
2021-09-29T10:07:35
2021-09-29T10:07:35
165,479,650
0
0
null
2019-01-13T07:50:17
2019-01-13T07:50:17
null
UTF-8
Swift
false
false
27,750
swift
// // BMPlayerControlView.swift // Pods // // Created by BrikerMan on 16/4/29. // // import UIKit import NVActivityIndicatorView @objc public protocol BMPlayerControlViewDelegate: class { /** call when control view choose a definition - parameter controlView: control view - parameter index: index of definition */ func controlView(controlView: BMPlayerControlView, didChooseDefinition index: Int) /** call when control view pressed an button - parameter controlView: control view - parameter button: button type */ func controlView(controlView: BMPlayerControlView, didPressButton button: UIButton) /** call when slider action trigged - parameter controlView: control view - parameter slider: progress slider - parameter event: action */ func controlView(controlView: BMPlayerControlView, slider: UISlider, onSliderEvent event: UIControl.Event) /** call when needs to change playback rate - parameter controlView: control view - parameter rate: playback rate */ @objc optional func controlView(controlView: BMPlayerControlView, didChangeVideoPlaybackRate rate: Float) } open class BMPlayerControlView: UIView { open weak var delegate: BMPlayerControlViewDelegate? open weak var player: BMPlayer? // MARK: Variables open var resource: BMPlayerResource? open var selectedIndex = 0 open var isFullscreen = false open var isMaskShowing = true open var totalDuration: TimeInterval = 0 open var delayItem: DispatchWorkItem? open var playerLastState: BMPlayerState = .notSetURL fileprivate var isSelectDefinitionViewOpened = false // MARK: UI Components /// main views which contains the topMaskView and bottom mask view open var mainMaskView = UIView() open var topMaskView = UIView() open var bottomMaskView = UIView() /// Image view to show video cover open var maskImageView = UIImageView() /// top views open var topWrapperView = UIView() open var backButton = UIButton(type : UIButton.ButtonType.custom) open var titleLabel = UILabel() open var chooseDefinitionView = UIView() /// bottom view open var bottomWrapperView = UIView() open var currentTimeLabel = UILabel() open var totalTimeLabel = UILabel() /// Progress slider open var timeSlider = BMTimeSlider() /// load progress view open var progressView = UIProgressView() /* play button playButton.isSelected = player.isPlaying */ open var playButton = UIButton(type: UIButton.ButtonType.custom) /* fullScreen button fullScreenButton.isSelected = player.isFullscreen */ open var fullscreenButton = UIButton(type: UIButton.ButtonType.custom) open var subtitleLabel = UILabel() open var subtitleBackView = UIView() open var subtileAttribute: [NSAttributedString.Key : Any]? /// Activty Indector for loading open var loadingIndicator = NVActivityIndicatorView(frame: CGRect(x: 0, y: 0, width: 30, height: 30)) open var seekToView = UIView() open var seekToViewImage = UIImageView() open var seekToLabel = UILabel() open var replayButton = UIButton(type: UIButton.ButtonType.custom) /// Gesture used to show / hide control view open var tapGesture: UITapGestureRecognizer! open var doubleTapGesture: UITapGestureRecognizer! // MARK: - handle player state change /** call on when play time changed, update duration here - parameter currentTime: current play time - parameter totalTime: total duration */ open func playTimeDidChange(currentTime: TimeInterval, totalTime: TimeInterval) { currentTimeLabel.text = BMPlayer.formatSecondsToString(currentTime) totalTimeLabel.text = BMPlayer.formatSecondsToString(totalTime) timeSlider.value = Float(currentTime) / Float(totalTime) showSubtile(from: resource?.subtitle, at: currentTime) } /** change subtitle resource - Parameter subtitles: new subtitle object */ open func update(subtitles: BMSubtitles?) { resource?.subtitle = subtitles } /** call on load duration changed, update load progressView here - parameter loadedDuration: loaded duration - parameter totalDuration: total duration */ open func loadedTimeDidChange(loadedDuration: TimeInterval, totalDuration: TimeInterval) { progressView.setProgress(Float(loadedDuration)/Float(totalDuration), animated: true) } open func playerStateDidChange(state: BMPlayerState) { switch state { case .readyToPlay: hideLoader() case .buffering: showLoader() case .bufferFinished: hideLoader() case .playedToTheEnd: playButton.isSelected = false showPlayToTheEndView() controlViewAnimation(isShow: true) default: break } playerLastState = state } /** Call when User use the slide to seek function - parameter toSecound: target time - parameter totalDuration: total duration of the video - parameter isAdd: isAdd */ open func showSeekToView(to toSecound: TimeInterval, total totalDuration:TimeInterval, isAdd: Bool) { seekToView.isHidden = false seekToLabel.text = BMPlayer.formatSecondsToString(toSecound) let rotate = isAdd ? 0 : CGFloat(Double.pi) seekToViewImage.transform = CGAffineTransform(rotationAngle: rotate) let targetTime = BMPlayer.formatSecondsToString(toSecound) timeSlider.value = Float(toSecound / totalDuration) currentTimeLabel.text = targetTime } // MARK: - UI update related function /** Update UI details when player set with the resource - parameter resource: video resouce - parameter index: defualt definition's index */ open func prepareUI(for resource: BMPlayerResource, selectedIndex index: Int) { self.resource = resource self.selectedIndex = index titleLabel.text = resource.name prepareChooseDefinitionView() autoFadeOutControlViewWithAnimation() } open func playStateDidChange(isPlaying: Bool) { autoFadeOutControlViewWithAnimation() playButton.isSelected = isPlaying } /** auto fade out controll view with animtion */ open func autoFadeOutControlViewWithAnimation() { cancelAutoFadeOutAnimation() delayItem = DispatchWorkItem { [weak self] in if self?.playerLastState != .playedToTheEnd { self?.controlViewAnimation(isShow: false) } } DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + BMPlayerConf.animateDelayTimeInterval, execute: delayItem!) } /** cancel auto fade out controll view with animtion */ open func cancelAutoFadeOutAnimation() { delayItem?.cancel() } /** Implement of the control view animation, override if need's custom animation - parameter isShow: is to show the controlview */ open func controlViewAnimation(isShow: Bool) { let alpha: CGFloat = isShow ? 1.0 : 0.0 self.isMaskShowing = isShow UIApplication.shared.setStatusBarHidden(!isShow, with: .fade) UIView.animate(withDuration: 0.3, animations: {[weak self] in guard let wSelf = self else { return } wSelf.topMaskView.alpha = alpha wSelf.bottomMaskView.alpha = alpha wSelf.mainMaskView.backgroundColor = UIColor(white: 0, alpha: isShow ? 0.4 : 0.0) if isShow { if wSelf.isFullscreen { wSelf.chooseDefinitionView.alpha = 1.0 } } else { wSelf.replayButton.isHidden = true wSelf.chooseDefinitionView.snp.updateConstraints { (make) in make.height.equalTo(35) } wSelf.chooseDefinitionView.alpha = 0.0 } wSelf.layoutIfNeeded() }) { [weak self](_) in if isShow { self?.autoFadeOutControlViewWithAnimation() } } } /** Implement of the UI update when screen orient changed - parameter isForFullScreen: is for full screen */ open func updateUI(_ isForFullScreen: Bool) { isFullscreen = isForFullScreen fullscreenButton.isSelected = isForFullScreen chooseDefinitionView.isHidden = !BMPlayerConf.enableChooseDefinition || !isForFullScreen if isForFullScreen { if BMPlayerConf.topBarShowInCase.rawValue == 2 { topMaskView.isHidden = true } else { topMaskView.isHidden = false } } else { if BMPlayerConf.topBarShowInCase.rawValue >= 1 { topMaskView.isHidden = true } else { topMaskView.isHidden = false } } } /** Call when video play's to the end, override if you need custom UI or animation when played to the end */ open func showPlayToTheEndView() { replayButton.isHidden = false } open func hidePlayToTheEndView() { replayButton.isHidden = true } open func showLoader() { loadingIndicator.isHidden = false loadingIndicator.startAnimating() } open func hideLoader() { loadingIndicator.isHidden = true } open func hideSeekToView() { seekToView.isHidden = true } open func showCoverWithLink(_ cover:String) { self.showCover(url: URL(string: cover)) } open func showCover(url: URL?) { if let url = url { DispatchQueue.global(qos: .default).async { [weak self] in let data = try? Data(contentsOf: url) DispatchQueue.main.async(execute: { [weak self] in guard let `self` = self else { return } if let data = data { self.maskImageView.image = UIImage(data: data) } else { self.maskImageView.image = nil } self.hideLoader() }); } } } open func hideCoverImageView() { self.maskImageView.isHidden = true } open func prepareChooseDefinitionView() { guard let resource = resource else { return } for item in chooseDefinitionView.subviews { item.removeFromSuperview() } for i in 0..<resource.definitions.count { let button = BMPlayerClearityChooseButton() if i == 0 { button.tag = selectedIndex } else if i <= selectedIndex { button.tag = i - 1 } else { button.tag = i } button.setTitle("\(resource.definitions[button.tag].definition)", for: UIControl.State()) chooseDefinitionView.addSubview(button) button.addTarget(self, action: #selector(self.onDefinitionSelected(_:)), for: UIControl.Event.touchUpInside) button.snp.makeConstraints({ [weak self](make) in guard let `self` = self else { return } make.top.equalTo(chooseDefinitionView.snp.top).offset(35 * i) make.width.equalTo(50) make.height.equalTo(25) make.centerX.equalTo(chooseDefinitionView) }) if resource.definitions.count == 1 { button.isEnabled = false button.isHidden = true } } } open func prepareToDealloc() { self.delayItem = nil } // MARK: - Action Response /** Call when some action button Pressed - parameter button: action Button */ @objc open func onButtonPressed(_ button: UIButton) { autoFadeOutControlViewWithAnimation() if let type = ButtonType(rawValue: button.tag) { switch type { case .play, .replay: if playerLastState == .playedToTheEnd { hidePlayToTheEndView() } default: break } } delegate?.controlView(controlView: self, didPressButton: button) } /** Call when the tap gesture tapped - parameter gesture: tap gesture */ @objc open func onTapGestureTapped(_ gesture: UITapGestureRecognizer) { if playerLastState == .playedToTheEnd { return } controlViewAnimation(isShow: !isMaskShowing) } @objc open func onDoubleTapGestureRecognized(_ gesture: UITapGestureRecognizer) { guard let player = player else { return } guard playerLastState == .readyToPlay || playerLastState == .buffering || playerLastState == .bufferFinished else { return } if player.isPlaying { player.pause() } else { player.play() } } // MARK: - handle UI slider actions @objc open func progressSliderTouchBegan(_ sender: UISlider) { delegate?.controlView(controlView: self, slider: sender, onSliderEvent: .touchDown) } @objc open func progressSliderValueChanged(_ sender: UISlider) { hidePlayToTheEndView() cancelAutoFadeOutAnimation() let currentTime = Double(sender.value) * totalDuration currentTimeLabel.text = BMPlayer.formatSecondsToString(currentTime) delegate?.controlView(controlView: self, slider: sender, onSliderEvent: .valueChanged) } @objc open func progressSliderTouchEnded(_ sender: UISlider) { autoFadeOutControlViewWithAnimation() delegate?.controlView(controlView: self, slider: sender, onSliderEvent: .touchUpInside) } // MARK: - private functions fileprivate func showSubtile(from subtitle: BMSubtitles?, at time: TimeInterval) { if let subtitle = subtitle, let group = subtitle.search(for: time) { subtitleBackView.isHidden = false subtitleLabel.attributedText = NSAttributedString(string: group.text, attributes: subtileAttribute) } else { subtitleBackView.isHidden = true } } @objc fileprivate func onDefinitionSelected(_ button:UIButton) { let height = isSelectDefinitionViewOpened ? 35 : resource!.definitions.count * 40 chooseDefinitionView.snp.updateConstraints { (make) in make.height.equalTo(height) } UIView.animate(withDuration: 0.3, animations: {[weak self] in self?.layoutIfNeeded() }) isSelectDefinitionViewOpened = !isSelectDefinitionViewOpened if selectedIndex != button.tag { selectedIndex = button.tag delegate?.controlView(controlView: self, didChooseDefinition: button.tag) } prepareChooseDefinitionView() } @objc fileprivate func onReplyButtonPressed() { replayButton.isHidden = true } // MARK: - Init override public init(frame: CGRect) { super.init(frame: frame) setupUIComponents() addSnapKitConstraint() customizeUIComponents() } required public init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) setupUIComponents() addSnapKitConstraint() customizeUIComponents() } /// Add Customize functions here open func customizeUIComponents() { } func setupUIComponents() { // Subtile view subtitleLabel.numberOfLines = 0 subtitleLabel.textAlignment = .center subtitleLabel.textColor = UIColor.white subtitleLabel.adjustsFontSizeToFitWidth = true subtitleLabel.minimumScaleFactor = 0.5 subtitleLabel.font = UIFont.systemFont(ofSize: 13) subtitleBackView.layer.cornerRadius = 2 subtitleBackView.backgroundColor = UIColor.black.withAlphaComponent(0.4) subtitleBackView.addSubview(subtitleLabel) subtitleBackView.isHidden = true addSubview(subtitleBackView) // Main mask view addSubview(mainMaskView) mainMaskView.addSubview(topMaskView) mainMaskView.addSubview(bottomMaskView) mainMaskView.insertSubview(maskImageView, at: 0) mainMaskView.clipsToBounds = true mainMaskView.backgroundColor = UIColor(white: 0, alpha: 0.4 ) // Top views topMaskView.addSubview(topWrapperView) topWrapperView.addSubview(backButton) topWrapperView.addSubview(titleLabel) topWrapperView.addSubview(chooseDefinitionView) backButton.tag = BMPlayerControlView.ButtonType.back.rawValue backButton.setImage(BMImageResourcePath("Pod_Asset_BMPlayer_back"), for: .normal) backButton.addTarget(self, action: #selector(onButtonPressed(_:)), for: .touchUpInside) titleLabel.textColor = UIColor.white titleLabel.text = "" titleLabel.font = UIFont.systemFont(ofSize: 16) chooseDefinitionView.clipsToBounds = true // Bottom views bottomMaskView.addSubview(bottomWrapperView) bottomWrapperView.addSubview(playButton) bottomWrapperView.addSubview(currentTimeLabel) bottomWrapperView.addSubview(totalTimeLabel) bottomWrapperView.addSubview(progressView) bottomWrapperView.addSubview(timeSlider) bottomWrapperView.addSubview(fullscreenButton) playButton.tag = BMPlayerControlView.ButtonType.play.rawValue playButton.setImage(BMImageResourcePath("Pod_Asset_BMPlayer_play"), for: .normal) playButton.setImage(BMImageResourcePath("Pod_Asset_BMPlayer_pause"), for: .selected) playButton.addTarget(self, action: #selector(onButtonPressed(_:)), for: .touchUpInside) currentTimeLabel.textColor = UIColor.white currentTimeLabel.font = UIFont.systemFont(ofSize: 12) currentTimeLabel.text = "00:00" currentTimeLabel.textAlignment = NSTextAlignment.center totalTimeLabel.textColor = UIColor.white totalTimeLabel.font = UIFont.systemFont(ofSize: 12) totalTimeLabel.text = "00:00" totalTimeLabel.textAlignment = NSTextAlignment.center timeSlider.maximumValue = 1.0 timeSlider.minimumValue = 0.0 timeSlider.value = 0.0 timeSlider.setThumbImage(BMImageResourcePath("Pod_Asset_BMPlayer_slider_thumb"), for: .normal) timeSlider.maximumTrackTintColor = UIColor.clear timeSlider.minimumTrackTintColor = BMPlayerConf.tintColor timeSlider.addTarget(self, action: #selector(progressSliderTouchBegan(_:)), for: UIControl.Event.touchDown) timeSlider.addTarget(self, action: #selector(progressSliderValueChanged(_:)), for: UIControl.Event.valueChanged) timeSlider.addTarget(self, action: #selector(progressSliderTouchEnded(_:)), for: [UIControl.Event.touchUpInside,UIControl.Event.touchCancel, UIControl.Event.touchUpOutside]) progressView.tintColor = UIColor ( red: 1.0, green: 1.0, blue: 1.0, alpha: 0.6 ) progressView.trackTintColor = UIColor ( red: 1.0, green: 1.0, blue: 1.0, alpha: 0.3 ) fullscreenButton.tag = BMPlayerControlView.ButtonType.fullscreen.rawValue fullscreenButton.setImage(BMImageResourcePath("Pod_Asset_BMPlayer_fullscreen"), for: .normal) fullscreenButton.setImage(BMImageResourcePath("Pod_Asset_BMPlayer_portialscreen"), for: .selected) fullscreenButton.addTarget(self, action: #selector(onButtonPressed(_:)), for: .touchUpInside) mainMaskView.addSubview(loadingIndicator) loadingIndicator.type = BMPlayerConf.loaderType loadingIndicator.color = BMPlayerConf.tintColor // View to show when slide to seek addSubview(seekToView) seekToView.addSubview(seekToViewImage) seekToView.addSubview(seekToLabel) seekToLabel.font = UIFont.systemFont(ofSize: 13) seekToLabel.textColor = UIColor ( red: 0.9098, green: 0.9098, blue: 0.9098, alpha: 1.0 ) seekToView.backgroundColor = UIColor ( red: 0.0, green: 0.0, blue: 0.0, alpha: 0.7 ) seekToView.layer.cornerRadius = 4 seekToView.layer.masksToBounds = true seekToView.isHidden = true seekToViewImage.image = BMImageResourcePath("Pod_Asset_BMPlayer_seek_to_image") addSubview(replayButton) replayButton.isHidden = true replayButton.setImage(BMImageResourcePath("Pod_Asset_BMPlayer_replay"), for: .normal) replayButton.addTarget(self, action: #selector(onButtonPressed(_:)), for: .touchUpInside) replayButton.tag = ButtonType.replay.rawValue tapGesture = UITapGestureRecognizer(target: self, action: #selector(onTapGestureTapped(_:))) addGestureRecognizer(tapGesture) if BMPlayerManager.shared.enablePlayControlGestures { doubleTapGesture = UITapGestureRecognizer(target: self, action: #selector(onDoubleTapGestureRecognized(_:))) doubleTapGesture.numberOfTapsRequired = 2 addGestureRecognizer(doubleTapGesture) tapGesture.require(toFail: doubleTapGesture) } } func addSnapKitConstraint() { // Main mask view mainMaskView.snp.makeConstraints { [unowned self](make) in make.edges.equalTo(self) } maskImageView.snp.makeConstraints { [unowned self](make) in make.edges.equalTo(self.mainMaskView) } topMaskView.snp.makeConstraints { [unowned self](make) in make.top.left.right.equalTo(self.mainMaskView) } topWrapperView.snp.makeConstraints { [unowned self](make) in make.height.equalTo(50) if #available(iOS 11.0, *) { make.top.left.right.equalTo(self.topMaskView.safeAreaLayoutGuide) make.bottom.equalToSuperview() } else { make.top.equalToSuperview().offset(15) make.bottom.left.right.equalToSuperview() } } bottomMaskView.snp.makeConstraints { [unowned self](make) in make.bottom.left.right.equalTo(self.mainMaskView) } bottomWrapperView.snp.makeConstraints { [unowned self](make) in make.height.equalTo(50) if #available(iOS 11.0, *) { make.bottom.left.right.equalTo(self.bottomMaskView.safeAreaLayoutGuide) make.top.equalToSuperview() } else { make.edges.equalToSuperview() } } // Top views backButton.snp.makeConstraints { (make) in make.width.height.equalTo(50) make.left.bottom.equalToSuperview() } titleLabel.snp.makeConstraints { [unowned self](make) in make.left.equalTo(self.backButton.snp.right) make.centerY.equalTo(self.backButton) } chooseDefinitionView.snp.makeConstraints { [unowned self](make) in make.right.equalToSuperview().offset(-20) make.top.equalTo(self.titleLabel.snp.top).offset(-4) make.width.equalTo(60) make.height.equalTo(30) } // Bottom views playButton.snp.makeConstraints { (make) in make.width.equalTo(50) make.height.equalTo(50) make.left.bottom.equalToSuperview() } currentTimeLabel.snp.makeConstraints { [unowned self](make) in make.left.equalTo(self.playButton.snp.right) make.centerY.equalTo(self.playButton) make.width.equalTo(40) } timeSlider.snp.makeConstraints { [unowned self](make) in make.centerY.equalTo(self.currentTimeLabel) make.left.equalTo(self.currentTimeLabel.snp.right).offset(10).priority(750) make.height.equalTo(30) } progressView.snp.makeConstraints { [unowned self](make) in make.centerY.left.right.equalTo(self.timeSlider) make.height.equalTo(2) } totalTimeLabel.snp.makeConstraints { [unowned self](make) in make.centerY.equalTo(self.currentTimeLabel) make.left.equalTo(self.timeSlider.snp.right).offset(5) make.width.equalTo(40) } fullscreenButton.snp.makeConstraints { [unowned self](make) in make.width.equalTo(50) make.height.equalTo(50) make.centerY.equalTo(self.currentTimeLabel) make.left.equalTo(self.totalTimeLabel.snp.right) make.right.equalToSuperview() } loadingIndicator.snp.makeConstraints { [unowned self](make) in make.center.equalTo(self.mainMaskView) } // View to show when slide to seek seekToView.snp.makeConstraints { [unowned self](make) in make.center.equalTo(self.snp.center) make.width.equalTo(100) make.height.equalTo(40) } seekToViewImage.snp.makeConstraints { [unowned self](make) in make.left.equalTo(self.seekToView.snp.left).offset(15) make.centerY.equalTo(self.seekToView.snp.centerY) make.height.equalTo(15) make.width.equalTo(25) } seekToLabel.snp.makeConstraints { [unowned self](make) in make.left.equalTo(self.seekToViewImage.snp.right).offset(10) make.centerY.equalTo(self.seekToView.snp.centerY) } replayButton.snp.makeConstraints { [unowned self](make) in make.center.equalTo(self.mainMaskView) make.width.height.equalTo(50) } subtitleBackView.snp.makeConstraints { [unowned self](make) in make.bottom.equalTo(self.snp.bottom).offset(-5) make.centerX.equalTo(self.snp.centerX) make.width.lessThanOrEqualTo(self.snp.width).offset(-10).priority(750) } subtitleLabel.snp.makeConstraints { [unowned self](make) in make.left.equalTo(self.subtitleBackView.snp.left).offset(10) make.right.equalTo(self.subtitleBackView.snp.right).offset(-10) make.top.equalTo(self.subtitleBackView.snp.top).offset(2) make.bottom.equalTo(self.subtitleBackView.snp.bottom).offset(-2) } } fileprivate func BMImageResourcePath(_ fileName: String) -> UIImage? { let bundle = Bundle(for: BMPlayer.self) return UIImage(named: fileName, in: bundle, compatibleWith: nil) } }
[ -1 ]
2d65be8ee7c72bcbe78c4e6dda0008d20d5bc118
d16c369cfa2383ea8471e22dd149caffee1bf7c6
/SwiftTableViewDemo/TypeAliasesViewController.swift
dd01e0b20fc8815dd9732801dfadb3edc0d2656a
[]
no_license
MrZhangy/SwiftTableViewDemo
f5c425360e92fba87326094dbb6a39f1ddd97a6a
159ad91c3b0c630485d48b13e2e14b8db713886f
refs/heads/master
2016-09-06T05:53:37.253160
2015-10-08T02:58:16
2015-10-08T02:58:16
39,023,807
0
0
null
null
null
null
UTF-8
Swift
false
false
1,952
swift
// // TypeAliasesViewController.swift // SwiftTableViewDemo // // Created by 张亚丰 on 15/7/20. // Copyright (c) 2015年 zhangyafeng. All rights reserved. // import UIKit typealias AudioSample = UInt16 class TypeAliasesViewController: UIViewController { var maxAmplitudeFound = AudioSample.min override func viewDidLoad() { super.viewDidLoad() self.view.backgroundColor = UIColor.whiteColor() println("\(maxAmplitudeFound)") //创建一个label // CGRect frame = let label = ControlUtil().createAutoWrapLabelWithFrame(CGRectMake(5, 64, self.view.frame.size.width - 10, 500), text: "类型别名(type aliases)就是给现有类型定义另一个名字。你可以使用 typealias 关键字来定 义类型别名。", font: UIFont.systemFontOfSize(16)) self.view.addSubview(label) // var label = UILabel(frame: ) // label.text = "类型别名(type aliases)就是给现有类型定义另一个名字。你可以使用 typealias 关键字来定 义类型别名。" // label.textColor = UIColor.redColor() // label.textAlignment = NSTextAlignment.Left // label.font = UIFont.systemFontOfSize(16) // label.numberOfLines = 0 // label.sizeToFit() // self.view.addSubview(label) // Do any additional setup after loading the view. } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } /* // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { // Get the new view controller using segue.destinationViewController. // Pass the selected object to the new view controller. } */ }
[ -1 ]
783391b71b49380422989c75cc1cd9c51a109829
2df8d0c73bab03515648295422a106a26bc15a96
/PokeDex/Constants.swift
593fbc7efbea591529db971591d4d38ed6beb950
[]
no_license
telmetwally/PokeDex
e6ab6f8342d07297a3270937717274ddec2def71
726fa8ad6f426bb62784f45dc5c11941f29f9a97
refs/heads/master
2021-01-10T02:58:25.153164
2015-10-20T00:50:19
2015-10-20T00:50:19
44,238,458
0
0
null
null
null
null
UTF-8
Swift
false
false
278
swift
// // Constants.swift // PokeDex // // Created by Tamer ElMetwally on 10/17/15. // Copyright © 2015 Tamer ElMetwally. All rights reserved. // import Foundation let URL_BASE = "http://pokeapi.co/" let URL_POKEMON = "/api/v1/pokemon/" typealias DownloadComplete = () -> ()
[ 286793, 291250 ]
b669ea94655bcbcf02233d5551455f21be5ada60
18245b44a75062d2868c9547d80b173a2e495941
/weather/Sources/App/Weather Module /DetailDay/Cell/DetailDayTableViewCell.swift
a3504fea44c8f9c102776c68b60b68eedb5278b7
[]
no_license
Lauriane75/WeatherP12
4913bde5234beae7b1dcc446fc6aafb9a6daf935
f46e1072509e256b2dd88d5f5e97e3ee6144a969
refs/heads/master
2021-01-07T04:09:06.990735
2020-03-10T09:55:43
2020-03-10T09:55:43
241,574,209
0
0
null
null
null
null
UTF-8
Swift
false
false
1,282
swift
// // DetailWeatherTableViewCell.swift // weather // // Created by Lauriane Haydari on 12/02/2020. // Copyright © 2020 Lauriane Haydari. All rights reserved. // import UIKit final class DetailDayTableViewCell: UITableViewCell { // MARK: - Outlet @IBOutlet private weak var tempMinLabel: UILabel! @IBOutlet private weak var tempMaxLabel: UILabel! @IBOutlet private weak var pressureLabel: UILabel! @IBOutlet private weak var feelsLikeLabel: UILabel! @IBOutlet private weak var humidityLabel: UILabel! @IBOutlet private weak var timeLabel: UILabel! // MARK: - Configure func configure(with visibleWeather: WeatherItem) { tempMinLabel.text = visibleWeather.temperatureMin tempMaxLabel.text = visibleWeather.temperatureMax pressureLabel.text = visibleWeather.pressure feelsLikeLabel.text = visibleWeather.feelsLike humidityLabel.text = visibleWeather.humidity timeLabel.text = "\(visibleWeather.time.hourFormat)h" } override func prepareForReuse() { super.prepareForReuse() tempMinLabel.text = nil tempMaxLabel.text = nil pressureLabel.text = nil feelsLikeLabel.text = nil humidityLabel.text = nil timeLabel.text = nil } }
[ -1 ]
02ea57c6b06934ad6046b08ecd2850ccbe0514ab
e36272609278619d9dba01e5b5f3940d08b5612b
/E8/Source/ShiftHH/ByType/ShiftHHElem08c.swift
cffc5e00130d0519f5faa14c33463023d894e984
[]
no_license
pigmasha/test
937174f8c093b6153b277d55ad2bb2d3d6b5d3fe
8f9ec72cf57ccaa722ef6386cd83c51bb5c1cfb6
refs/heads/master
2023-04-08T02:13:11.846541
2023-03-27T19:27:07
2023-03-27T19:27:07
46,409,986
0
0
null
null
null
null
UTF-8
Swift
false
false
27,179
swift
// // Created by M on 22/03/2020. // import Foundation //#if SHIFTS final class ShiftHHElem08c : ShiftHHElem { override func shift0(_ hhElem: HHElem, s: Int, m: Int, ell: Int) { hhElem.makeZeroMatrix(16*s, h:8*s) let j = 0 HHElem.addElemToHH(hhElem, i:j, j:j, leftFrom:8*(j+m), leftTo:8*(j+m)+7, rightFrom:8*j, rightTo:8*j, koef:-1) } override func oddShift0(_ hhElem: HHElem, s: Int, m: Int, ell: Int) { hhElem.makeZeroMatrix(16*s, h:8*s) let j = myModS(3) HHElem.addElemToHH(hhElem, i:j, j:j, leftFrom:8*(j+m), leftTo:8*(j+m)+7, rightFrom:8*j, rightTo:8*j, koef:-1) } override func oddShift1(_ hhElem: HHElem, s: Int, m: Int, ell: Int) { hhElem.makeZeroMatrix(16*s, h:9*s) var j = 5*s + myModS(2) HHElem.addElemToHH(hhElem, i:s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+5, leftTo:8*(j+m+1)+7, rightFrom:8*j+2, rightTo:8*(j+1), koef:-1) j += s HHElem.addElemToHH(hhElem, i:s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+5, leftTo:8*(j+m+2), rightFrom:8*j+3, rightTo:8*(j+1), koef:-1) j += 2*s HHElem.addElemToHH(hhElem, i:+myModS(j+1), j:j, leftFrom:8*(j+m+1)+1, leftTo:8*(j+m+1)+7, rightFrom:8*j+5, rightTo:8*(j+1), koef:1) } override func oddShift2(_ hhElem: HHElem, s: Int, m: Int, ell: Int) { hhElem.makeZeroMatrix(19*s, h:8*s) var j = myModS(2) HHElem.addElemToHH(hhElem, i:+myModS(j+1), j:j, leftFrom:8*(j+m)+7, leftTo:8*(j+m)+7, rightFrom:8*j, rightTo:8*(j+1), koef:-1, noZeroLenR:true) j += s HHElem.addElemToHH(hhElem, i:+myModS(j+1), j:j, leftFrom:8*(j+m)+7, leftTo:8*(j+m+1), rightFrom:8*j, rightTo:8*(j+1), koef:-1, noZeroLenR:true) j += 6*s HHElem.addElemToHH(hhElem, i:+myModS(j+1), j:j, leftFrom:8*(j+m)+7, leftTo:8*(j+m+1)+5, rightFrom:8*j+3, rightTo:8*(j+1), koef:1) } override func oddShift3(_ hhElem: HHElem, s: Int, m: Int, ell: Int) { hhElem.makeZeroMatrix(18*s, h:10*s) var j = s + myModS(2) HHElem.addElemToHH(hhElem, i:s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+6, leftTo:8*(j+m+1)+6, rightFrom:8*j, rightTo:8*(j+1), koef:-1, noZeroLenR:true) j += s HHElem.addElemToHH(hhElem, i:+myModS(j+1), j:j, leftFrom:8*(j+m+1)+2, leftTo:8*(j+m+1)+4, rightFrom:8*j, rightTo:8*(j+1), koef:-1, noZeroLenR:true) j += 5*s HHElem.addElemToHH(hhElem, i:s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+6, leftTo:8*(j+m+1)+7, rightFrom:8*j+3, rightTo:8*(j+1), koef:-1) } override func oddShift4(_ hhElem: HHElem, s: Int, m: Int, ell: Int) { hhElem.makeZeroMatrix(19*s, h:11*s) var j = s + myModS(2) HHElem.addElemToHH(hhElem, i:+myModS(j+1), j:j, leftFrom:8*(j+m)+7, leftTo:8*(j+m+1), rightFrom:8*j, rightTo:8*(j+1), koef:-1, noZeroLenR:true) HHElem.addElemToHH(hhElem, i:s+myModS(j+1), j:j, leftFrom:8*(j+m+1), leftTo:8*(j+m+1), rightFrom:8*j, rightTo:8*(j+1), koef:-1, noZeroLenR:true) j += s HHElem.addElemToHH(hhElem, i:+myModS(j+1), j:j, leftFrom:8*(j+m)+7, leftTo:8*(j+m)+7, rightFrom:8*j, rightTo:8*(j+1), koef:-1, noZeroLenR:true) j += 5*s HHElem.addElemToHH(hhElem, i:s+myModS(j+1), j:j, leftFrom:8*(j+m+1), leftTo:8*(j+m+1)+6, rightFrom:8*j+3, rightTo:8*(j+1), koef:-1) } override func oddShift5(_ hhElem: HHElem, s: Int, m: Int, ell: Int) { hhElem.makeZeroMatrix(18*s, h:11*s) var j = myModS(2) HHElem.addElemToHH(hhElem, i:2*s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+1, leftTo:8*(j+m+1)+2, rightFrom:8*j, rightTo:8*(j+1), koef:1, noZeroLenR:true) j += 2*s HHElem.addElemToHH(hhElem, i:+myModS(j+1), j:j, leftFrom:8*(j+m+1)+5, leftTo:8*(j+m+1)+6, rightFrom:8*j, rightTo:8*(j+1), koef:-1, noZeroLenR:true) j += s HHElem.addElemToHH(hhElem, i:+myModS(j+1), j:j, leftFrom:8*(j+m+1)+5, leftTo:8*(j+m+1)+5, rightFrom:8*j, rightTo:8*(j+1), koef:-1, noZeroLenR:true) j += 3*s HHElem.addElemToHH(hhElem, i:2*s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+1, leftTo:8*(j+m+1)+7, rightFrom:8*j+3, rightTo:8*(j+1), koef:-1) j += s HHElem.addElemToHH(hhElem, i:2*s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+1, leftTo:8*(j+m+2), rightFrom:8*j+3, rightTo:8*(j+1), koef:-1) } override func oddShift6(_ hhElem: HHElem, s: Int, m: Int, ell: Int) { hhElem.makeZeroMatrix(20*s, h:13*s) var j = 2*s + myModS(2) HHElem.addElemToHH(hhElem, i:+myModS(j+1), j:j, leftFrom:8*(j+m)+7, leftTo:8*(j+m+1), rightFrom:8*j, rightTo:8*(j+1), koef:-1, noZeroLenR:true) HHElem.addElemToHH(hhElem, i:s+myModS(j+1), j:j, leftFrom:8*(j+m+1), leftTo:8*(j+m+1), rightFrom:8*j, rightTo:8*(j+1), koef:-1, noZeroLenR:true) j += 6*s HHElem.addElemToHH(hhElem, i:j-3*s, j:j, leftFrom:8*(j+m)+1, leftTo:8*(j+m+1)+1, rightFrom:8*j+3, rightTo:8*j+3, koef:1, noZeroLenL:true) } override func oddShift7(_ hhElem: HHElem, s: Int, m: Int, ell: Int) { hhElem.makeZeroMatrix(18*s, h:14*s) var j = s + myModS(2) HHElem.addElemToHH(hhElem, i:2*s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+6, leftTo:8*(j+m+1)+6, rightFrom:8*j, rightTo:8*(j+1), koef:-1, noZeroLenR:true) HHElem.addElemToHH(hhElem, i:3*s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+5, leftTo:8*(j+m+1)+6, rightFrom:8*j, rightTo:8*(j+1), koef:-1, noZeroLenR:true) j += 2*s HHElem.addElemToHH(hhElem, i:j+2*s, j:j, leftFrom:8*(j+m+1), leftTo:8*(j+m+1)+1, rightFrom:8*j, rightTo:8*j+2, koef:-1) } override func oddShift8(_ hhElem: HHElem, s: Int, m: Int, ell: Int) { hhElem.makeZeroMatrix(19*s, h:16*s) var j = myModS(2) HHElem.addElemToHH(hhElem, i:j+4*s, j:j, leftFrom:8*(j+m)+6, leftTo:8*(j+m)+7, rightFrom:8*j, rightTo:8*j+2, koef:-1) j = 6*s + myModS(1) HHElem.addElemToHH(hhElem, i:2*s+myModS(j+1), j:j, leftFrom:8*(j+m+1), leftTo:8*(j+m+1)+1, rightFrom:8*j+2, rightTo:8*(j+1), koef:-1) j += s HHElem.addElemToHH(hhElem, i:2*s+myModS(j+1), j:j, leftFrom:8*(j+m+1), leftTo:8*(j+m+1)+2, rightFrom:8*j+3, rightTo:8*(j+1), koef:-1) HHElem.addElemToHH(hhElem, i:6*s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+2, leftTo:8*(j+m+1)+2, rightFrom:8*j+3, rightTo:8*(j+1)+3, koef:1, noZeroLenR:true) } override func oddShift9(_ hhElem: HHElem, s: Int, m: Int, ell: Int) { hhElem.makeZeroMatrix(18*s, h:16*s) var j = 4*s + myModS(1) HHElem.addElemToHH(hhElem, i:+myModS(j+1), j:j, leftFrom:8*(j+m+1)+5, leftTo:8*(j+m+1)+7, rightFrom:8*j+1, rightTo:8*(j+1), koef:1) HHElem.addElemToHH(hhElem, i:s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+3, leftTo:8*(j+m+1)+7, rightFrom:8*j+1, rightTo:8*(j+1), koef:-1) HHElem.addElemToHH(hhElem, i:2*s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+6, leftTo:8*(j+m+1)+7, rightFrom:8*j+1, rightTo:8*(j+1), koef:1) j += s HHElem.addElemToHH(hhElem, i:+myModS(j+1), j:j, leftFrom:8*(j+m+1)+5, leftTo:8*(j+m+2), rightFrom:8*j+1, rightTo:8*(j+1), koef:1) HHElem.addElemToHH(hhElem, i:2*s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+6, leftTo:8*(j+m+2), rightFrom:8*j+1, rightTo:8*(j+1), koef:1) j += s HHElem.addElemToHH(hhElem, i:+myModS(j+1), j:j, leftFrom:8*(j+m+1)+5, leftTo:8*(j+m+2), rightFrom:8*j+2, rightTo:8*(j+1), koef:1) HHElem.addElemToHH(hhElem, i:2*s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+6, leftTo:8*(j+m+2), rightFrom:8*j+2, rightTo:8*(j+1), koef:1) j += s HHElem.addElemToHH(hhElem, i:+myModS(j+1), j:j, leftFrom:8*(j+m+1)+5, leftTo:8*(j+m+1)+7, rightFrom:8*j+3, rightTo:8*(j+1), koef:-1) HHElem.addElemToHH(hhElem, i:s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+3, leftTo:8*(j+m+1)+7, rightFrom:8*j+3, rightTo:8*(j+1), koef:1) HHElem.addElemToHH(hhElem, i:2*s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+6, leftTo:8*(j+m+1)+7, rightFrom:8*j+3, rightTo:8*(j+1), koef:-1) } override func oddShift10(_ hhElem: HHElem, s: Int, m: Int, ell: Int) { hhElem.makeZeroMatrix(19*s, h:19*s) var j = s + myModS(1) HHElem.addElemToHH(hhElem, i:s+myModS(j+1), j:j, leftFrom:8*(j+m+1), leftTo:8*(j+m+1), rightFrom:8*j, rightTo:8*(j+1), koef:1, noZeroLenR:true) j += 6*s HHElem.addElemToHH(hhElem, i:j-s, j:j, leftFrom:8*(j+m)+3, leftTo:8*(j+m+1)+3, rightFrom:8*j+3, rightTo:8*j+3, koef:1, noZeroLenL:true) } override func oddShift11(_ hhElem: HHElem, s: Int, m: Int, ell: Int) { hhElem.makeZeroMatrix(16*s, h:18*s) var j = myModS(1) HHElem.addElemToHH(hhElem, i:+myModS(j+1), j:j, leftFrom:8*(j+m+1)+2, leftTo:8*(j+m+1)+3, rightFrom:8*j, rightTo:8*(j+1), koef:-1, noZeroLenR:true) HHElem.addElemToHH(hhElem, i:j+5*s, j:j, leftFrom:8*(j+m)+7, leftTo:8*(j+m+1)+3, rightFrom:8*j, rightTo:8*j+1, koef:1) j += 3*s HHElem.addElemToHH(hhElem, i:4*s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+5, leftTo:8*(j+m+1)+5, rightFrom:8*j, rightTo:8*(j+1), koef:1, noZeroLenR:true) } override func oddShift12(_ hhElem: HHElem, s: Int, m: Int, ell: Int) { hhElem.makeZeroMatrix(16*s, h:19*s) var j = myModS(1) HHElem.addElemToHH(hhElem, i:j+3*s, j:j, leftFrom:8*(j+m)+2, leftTo:8*(j+m)+7, rightFrom:8*j, rightTo:8*j+1, koef:-1) HHElem.addElemToHH(hhElem, i:j+5*s, j:j, leftFrom:8*(j+m)+5, leftTo:8*(j+m)+7, rightFrom:8*j, rightTo:8*j+2, koef:1) j += s HHElem.addElemToHH(hhElem, i:s+myModS(j+1), j:j, leftFrom:8*(j+m+1), leftTo:8*(j+m+1), rightFrom:8*j, rightTo:8*(j+1), koef:-1, noZeroLenR:true) HHElem.addElemToHH(hhElem, i:2*s+myModS(j+1), j:j, leftFrom:8*(j+m)+7, leftTo:8*(j+m+1), rightFrom:8*j, rightTo:8*(j+1), koef:-1, noZeroLenR:true) j = 4*s HHElem.addElemToHH(hhElem, i:+myModS(j+1), j:j, leftFrom:8*(j+m)+7, leftTo:8*(j+m+1)+3, rightFrom:8*j+2, rightTo:8*(j+1), koef:-1) j += s HHElem.addElemToHH(hhElem, i:+myModS(j+1), j:j, leftFrom:8*(j+m)+7, leftTo:8*(j+m+1)+4, rightFrom:8*j+3, rightTo:8*(j+1), koef:1) HHElem.addElemToHH(hhElem, i:6*s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+4, leftTo:8*(j+m+1)+4, rightFrom:8*j+3, rightTo:8*(j+1)+3, koef:1, noZeroLenR:true) } override func oddShift13(_ hhElem: HHElem, s: Int, m: Int, ell: Int) { hhElem.makeZeroMatrix(14*s, h:18*s) var j = myModS(1) HHElem.addElemToHH(hhElem, i:j+4*s, j:j, leftFrom:8*(j+m+1), leftTo:8*(j+m+1)+2, rightFrom:8*j, rightTo:8*j+1, koef:1) j += s HHElem.addElemToHH(hhElem, i:+myModS(j+1), j:j, leftFrom:8*(j+m+1)+2, leftTo:8*(j+m+1)+4, rightFrom:8*j, rightTo:8*(j+1), koef:1, noZeroLenR:true) HHElem.addElemToHH(hhElem, i:s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+3, leftTo:8*(j+m+1)+4, rightFrom:8*j, rightTo:8*(j+1), koef:-1, noZeroLenR:true) j += s HHElem.addElemToHH(hhElem, i:2*s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+6, leftTo:8*(j+m+1)+6, rightFrom:8*j, rightTo:8*(j+1), koef:1, noZeroLenR:true) HHElem.addElemToHH(hhElem, i:3*s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+5, leftTo:8*(j+m+1)+6, rightFrom:8*j, rightTo:8*(j+1), koef:1, noZeroLenR:true) j = 3*s HHElem.addElemToHH(hhElem, i:s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+3, leftTo:8*(j+m+1)+7, rightFrom:8*j+1, rightTo:8*(j+1), koef:-1) j += s HHElem.addElemToHH(hhElem, i:+myModS(j+1), j:j, leftFrom:8*(j+m+1)+2, leftTo:8*(j+m+2), rightFrom:8*j+2, rightTo:8*(j+1), koef:1) HHElem.addElemToHH(hhElem, i:3*s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+5, leftTo:8*(j+m+2), rightFrom:8*j+2, rightTo:8*(j+1), koef:1) j += s HHElem.addElemToHH(hhElem, i:s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+3, leftTo:8*(j+m+1)+7, rightFrom:8*j+3, rightTo:8*(j+1), koef:1) HHElem.addElemToHH(hhElem, i:5*s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+7, leftTo:8*(j+m+1)+7, rightFrom:8*j+3, rightTo:8*(j+1)+2, koef:-1) j += 8*s HHElem.addElemToHH(hhElem, i:4*s+myModS(j+1), j:j, leftFrom:8*(j+m+2), leftTo:8*(j+m+2)+5, rightFrom:8*j+7, rightTo:8*(j+1)+1, koef:-1) } override func oddShift14(_ hhElem: HHElem, s: Int, m: Int, ell: Int) { hhElem.makeZeroMatrix(13*s, h:20*s) var j = myModS(1) HHElem.addElemToHH(hhElem, i:+myModS(j+1), j:j, leftFrom:8*(j+m)+7, leftTo:8*(j+m+1), rightFrom:8*j, rightTo:8*(j+1), koef:-1, noZeroLenR:true) HHElem.addElemToHH(hhElem, i:2*s+myModS(j+1), j:j, leftFrom:8*(j+m+1), leftTo:8*(j+m+1), rightFrom:8*j, rightTo:8*(j+1), koef:1, noZeroLenR:true) HHElem.addElemToHH(hhElem, i:j+4*s, j:j, leftFrom:8*(j+m)+5, leftTo:8*(j+m+1), rightFrom:8*j, rightTo:8*j+1, koef:-1) j = 0 HHElem.addElemToHH(hhElem, i:+myModS(j+1), j:j, leftFrom:8*(j+m)+7, leftTo:8*(j+m+1), rightFrom:8*j, rightTo:8*(j+1), koef:1, noZeroLenR:true) HHElem.addElemToHH(hhElem, i:s+myModS(j+1), j:j, leftFrom:8*(j+m+1), leftTo:8*(j+m+1), rightFrom:8*j, rightTo:8*(j+1), koef:1, noZeroLenR:true) HHElem.addElemToHH(hhElem, i:2*s+myModS(j+1), j:j, leftFrom:8*(j+m+1), leftTo:8*(j+m+1), rightFrom:8*j, rightTo:8*(j+1), koef:-1, noZeroLenR:true) j = s + myModS(1) HHElem.addElemToHH(hhElem, i:+myModS(j+1), j:j, leftFrom:8*(j+m)+7, leftTo:8*(j+m)+7, rightFrom:8*j, rightTo:8*(j+1), koef:1, noZeroLenR:true) j = 2*s HHElem.addElemToHH(hhElem, i:+myModS(j+1), j:j, leftFrom:8*(j+m)+7, leftTo:8*(j+m+1)+3, rightFrom:8*j+1, rightTo:8*(j+1), koef:-1) HHElem.addElemToHH(hhElem, i:s+myModS(j+1), j:j, leftFrom:8*(j+m+1), leftTo:8*(j+m+1)+3, rightFrom:8*j+1, rightTo:8*(j+1), koef:-1) j += s HHElem.addElemToHH(hhElem, i:+myModS(j+1), j:j, leftFrom:8*(j+m)+7, leftTo:8*(j+m+1)+4, rightFrom:8*j+2, rightTo:8*(j+1), koef:1) j += s HHElem.addElemToHH(hhElem, i:+myModS(j+1), j:j, leftFrom:8*(j+m)+7, leftTo:8*(j+m+1)+5, rightFrom:8*j+2, rightTo:8*(j+1), koef:1) HHElem.addElemToHH(hhElem, i:s+myModS(j+1), j:j, leftFrom:8*(j+m+1), leftTo:8*(j+m+1)+5, rightFrom:8*j+2, rightTo:8*(j+1), koef:1) HHElem.addElemToHH(hhElem, i:2*s+myModS(j+1), j:j, leftFrom:8*(j+m+1), leftTo:8*(j+m+1)+5, rightFrom:8*j+2, rightTo:8*(j+1), koef:-1) j += s HHElem.addElemToHH(hhElem, i:+myModS(j+1), j:j, leftFrom:8*(j+m)+7, leftTo:8*(j+m+1)+6, rightFrom:8*j+3, rightTo:8*(j+1), koef:-1) HHElem.addElemToHH(hhElem, i:s+myModS(j+1), j:j, leftFrom:8*(j+m+1), leftTo:8*(j+m+1)+6, rightFrom:8*j+3, rightTo:8*(j+1), koef:-1) HHElem.addElemToHH(hhElem, i:2*s+myModS(j+1), j:j, leftFrom:8*(j+m+1), leftTo:8*(j+m+1)+6, rightFrom:8*j+3, rightTo:8*(j+1), koef:1) HHElem.addElemToHH(hhElem, i:4*s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+5, leftTo:8*(j+m+1)+6, rightFrom:8*j+3, rightTo:8*(j+1)+1, koef:1) j += 6*s HHElem.addElemToHH(hhElem, i:3*s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+3, leftTo:8*(j+m+1)+7, rightFrom:8*j+7, rightTo:8*(j+1)+1, koef:1) } override func oddShift15(_ hhElem: HHElem, s: Int, m: Int, ell: Int) { hhElem.makeZeroMatrix(11*s, h:18*s) var j = myModS(1) HHElem.addElemToHH(hhElem, i:3*s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+1, leftTo:8*(j+m+1)+3, rightFrom:8*j, rightTo:8*(j+1), koef:-1, noZeroLenR:true) j = 0 HHElem.addElemToHH(hhElem, i:3*s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+1, leftTo:8*(j+m+1)+3, rightFrom:8*j, rightTo:8*(j+1), koef:1, noZeroLenR:true) j = s + myModS(1) HHElem.addElemToHH(hhElem, i:j+4*s, j:j, leftFrom:8*(j+m)+7, leftTo:8*(j+m+1)+5, rightFrom:8*j, rightTo:8*j+1, koef:1) HHElem.addElemToHH(hhElem, i:j+6*s, j:j, leftFrom:8*(j+m+1), leftTo:8*(j+m+1)+5, rightFrom:8*j, rightTo:8*j+2, koef:1) j = 2*s HHElem.addElemToHH(hhElem, i:4*s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+5, leftTo:8*(j+m+2), rightFrom:8*j+1, rightTo:8*(j+1), koef:-1) j += s HHElem.addElemToHH(hhElem, i:+myModS(j+1), j:j, leftFrom:8*(j+m+1)+3, leftTo:8*(j+m+1)+7, rightFrom:8*j+2, rightTo:8*(j+1), koef:-1) HHElem.addElemToHH(hhElem, i:3*s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+1, leftTo:8*(j+m+1)+7, rightFrom:8*j+2, rightTo:8*(j+1), koef:2) HHElem.addElemToHH(hhElem, i:4*s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+5, leftTo:8*(j+m+1)+7, rightFrom:8*j+2, rightTo:8*(j+1), koef:-1) j += s HHElem.addElemToHH(hhElem, i:+myModS(j+1), j:j, leftFrom:8*(j+m+1)+3, leftTo:8*(j+m+2), rightFrom:8*j+3, rightTo:8*(j+1), koef:-1) HHElem.addElemToHH(hhElem, i:3*s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+1, leftTo:8*(j+m+2), rightFrom:8*j+3, rightTo:8*(j+1), koef:1) j += s HHElem.addElemToHH(hhElem, i:5*s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+7, leftTo:8*(j+m+2)+1, rightFrom:8*j+4, rightTo:8*(j+1)+1, koef:1) j += 3*s HHElem.addElemToHH(hhElem, i:5*s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+7, leftTo:8*(j+m+2)+2, rightFrom:8*j+7, rightTo:8*(j+1)+1, koef:-1) } override func oddShift16(_ hhElem: HHElem, s: Int, m: Int, ell: Int) { hhElem.makeZeroMatrix(11*s, h:19*s) var j = myModS(1) HHElem.addElemToHH(hhElem, i:+myModS(j+1), j:j, leftFrom:8*(j+m)+7, leftTo:8*(j+m+1), rightFrom:8*j, rightTo:8*(j+1), koef:1, noZeroLenR:true) HHElem.addElemToHH(hhElem, i:s+myModS(j+1), j:j, leftFrom:8*(j+m+1), leftTo:8*(j+m+1), rightFrom:8*j, rightTo:8*(j+1), koef:-1, noZeroLenR:true) HHElem.addElemToHH(hhElem, i:2*s+myModS(j+1), j:j, leftFrom:8*(j+m)+7, leftTo:8*(j+m+1), rightFrom:8*j, rightTo:8*(j+1), koef:-1, noZeroLenR:true) HHElem.addElemToHH(hhElem, i:j+4*s, j:j, leftFrom:8*(j+m)+6, leftTo:8*(j+m+1), rightFrom:8*j, rightTo:8*j+1, koef:1) j = 2*s HHElem.addElemToHH(hhElem, i:2*s+myModS(j+1), j:j, leftFrom:8*(j+m)+7, leftTo:8*(j+m+1)+5, rightFrom:8*j+1, rightTo:8*(j+1), koef:1) j += s HHElem.addElemToHH(hhElem, i:s+myModS(j+1), j:j, leftFrom:8*(j+m+1), leftTo:8*(j+m+1)+6, rightFrom:8*j+2, rightTo:8*(j+1), koef:1) HHElem.addElemToHH(hhElem, i:2*s+myModS(j+1), j:j, leftFrom:8*(j+m)+7, leftTo:8*(j+m+1)+6, rightFrom:8*j+2, rightTo:8*(j+1), koef:1) j += s HHElem.addElemToHH(hhElem, i:+myModS(j+1), j:j, leftFrom:8*(j+m)+7, leftTo:8*(j+m+1)+1, rightFrom:8*j+3, rightTo:8*(j+1), koef:1) } override func oddShift17(_ hhElem: HHElem, s: Int, m: Int, ell: Int) { hhElem.makeZeroMatrix(10*s, h:18*s) var j = myModS(1) HHElem.addElemToHH(hhElem, i:+myModS(j+1), j:j, leftFrom:8*(j+m+1)+2, leftTo:8*(j+m+1)+4, rightFrom:8*j, rightTo:8*(j+1), koef:1, noZeroLenR:true) j += s HHElem.addElemToHH(hhElem, i:3*s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+5, leftTo:8*(j+m+1)+6, rightFrom:8*j, rightTo:8*(j+1), koef:1, noZeroLenR:true) HHElem.addElemToHH(hhElem, i:j+3*s, j:j, leftFrom:8*(j+m)+7, leftTo:8*(j+m+1)+6, rightFrom:8*j, rightTo:8*j+1, koef:1) j = s HHElem.addElemToHH(hhElem, i:3*s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+5, leftTo:8*(j+m+1)+6, rightFrom:8*j, rightTo:8*(j+1), koef:-1, noZeroLenR:true) j += s HHElem.addElemToHH(hhElem, i:3*s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+5, leftTo:8*(j+m+1)+7, rightFrom:8*j+1, rightTo:8*(j+1), koef:1) j += s HHElem.addElemToHH(hhElem, i:2*s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+6, leftTo:8*(j+m+2), rightFrom:8*j+2, rightTo:8*(j+1), koef:1) HHElem.addElemToHH(hhElem, i:3*s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+5, leftTo:8*(j+m+2), rightFrom:8*j+2, rightTo:8*(j+1), koef:1) } override func oddShift18(_ hhElem: HHElem, s: Int, m: Int, ell: Int) { hhElem.makeZeroMatrix(8*s, h:19*s) var j = myModS(1) HHElem.addElemToHH(hhElem, i:j+3*s, j:j, leftFrom:8*(j+m)+5, leftTo:8*(j+m)+7, rightFrom:8*j, rightTo:8*j+1, koef:1) HHElem.addElemToHH(hhElem, i:j+4*s, j:j, leftFrom:8*(j+m)+1, leftTo:8*(j+m)+7, rightFrom:8*j, rightTo:8*j+1, koef:-1) HHElem.addElemToHH(hhElem, i:j+5*s, j:j, leftFrom:8*(j+m)+2, leftTo:8*(j+m)+7, rightFrom:8*j, rightTo:8*j+2, koef:-1) j = s HHElem.addElemToHH(hhElem, i:+myModS(j+1), j:j, leftFrom:8*(j+m)+7, leftTo:8*(j+m+1)+6, rightFrom:8*j+1, rightTo:8*(j+1), koef:-1) } override func oddShift19(_ hhElem: HHElem, s: Int, m: Int, ell: Int) { hhElem.makeZeroMatrix(9*s, h:16*s) var j = 0 HHElem.addElemToHH(hhElem, i:s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+6, leftTo:8*(j+m+1)+7, rightFrom:8*j, rightTo:8*(j+1), koef:-1, noZeroLenR:true) HHElem.addElemToHH(hhElem, i:2*s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+1, leftTo:8*(j+m+1)+7, rightFrom:8*j, rightTo:8*(j+1), koef:-1, noZeroLenR:true) j += s HHElem.addElemToHH(hhElem, i:s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+6, leftTo:8*(j+m+2), rightFrom:8*j+1, rightTo:8*(j+1), koef:-1) HHElem.addElemToHH(hhElem, i:2*s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+1, leftTo:8*(j+m+2), rightFrom:8*j+1, rightTo:8*(j+1), koef:-1) j += s HHElem.addElemToHH(hhElem, i:+myModS(j+1), j:j, leftFrom:8*(j+m+1)+3, leftTo:8*(j+m+2)+1, rightFrom:8*j+2, rightTo:8*(j+1), koef:-1) j += s HHElem.addElemToHH(hhElem, i:4*s+myModS(j+1), j:j, leftFrom:8*(j+m+2), leftTo:8*(j+m+2)+2, rightFrom:8*j+3, rightTo:8*(j+1)+1, koef:-1) } override func oddShift20(_ hhElem: HHElem, s: Int, m: Int, ell: Int) { hhElem.makeZeroMatrix(8*s, h:16*s) var j = s HHElem.addElemToHH(hhElem, i:+myModS(j+1), j:j, leftFrom:8*(j+m)+7, leftTo:8*(j+m+1)+1, rightFrom:8*j+1, rightTo:8*(j+1), koef:-1) j += s HHElem.addElemToHH(hhElem, i:s+myModS(j+1), j:j, leftFrom:8*(j+m+1), leftTo:8*(j+m+1)+2, rightFrom:8*j+2, rightTo:8*(j+1), koef:1) j += s HHElem.addElemToHH(hhElem, i:+myModS(j+1), j:j, leftFrom:8*(j+m)+7, leftTo:8*(j+m+1)+3, rightFrom:8*j+3, rightTo:8*(j+1), koef:1) HHElem.addElemToHH(hhElem, i:s+myModS(j+1), j:j, leftFrom:8*(j+m+1), leftTo:8*(j+m+1)+3, rightFrom:8*j+3, rightTo:8*(j+1), koef:-1) HHElem.addElemToHH(hhElem, i:4*s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+3, leftTo:8*(j+m+1)+3, rightFrom:8*j+3, rightTo:8*(j+1)+2, koef:-1) } override func oddShift21(_ hhElem: HHElem, s: Int, m: Int, ell: Int) { hhElem.makeZeroMatrix(8*s, h:14*s) var j = 2*s HHElem.addElemToHH(hhElem, i:+myModS(j+1), j:j, leftFrom:8*(j+m+1)+2, leftTo:8*(j+m+2)+2, rightFrom:8*j+2, rightTo:8*(j+1), koef:-1, noZeroLenL:true) HHElem.addElemToHH(hhElem, i:s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+4, leftTo:8*(j+m+2)+2, rightFrom:8*j+2, rightTo:8*(j+1), koef:-1) j += s HHElem.addElemToHH(hhElem, i:3*s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+7, leftTo:8*(j+m+2)+3, rightFrom:8*j+3, rightTo:8*(j+1)+1, koef:-1) } override func oddShift22(_ hhElem: HHElem, s: Int, m: Int, ell: Int) { hhElem.makeZeroMatrix(9*s, h:13*s) var j = 2*s HHElem.addElemToHH(hhElem, i:+myModS(j+1), j:j, leftFrom:8*(j+m+1), leftTo:8*(j+m+1)+2, rightFrom:8*j+1, rightTo:8*(j+1), koef:1) j += s HHElem.addElemToHH(hhElem, i:s+myModS(j+1), j:j, leftFrom:8*(j+m)+7, leftTo:8*(j+m+1)+3, rightFrom:8*j+2, rightTo:8*(j+1), koef:-1) j += s HHElem.addElemToHH(hhElem, i:+myModS(j+1), j:j, leftFrom:8*(j+m+1), leftTo:8*(j+m+1)+4, rightFrom:8*j+3, rightTo:8*(j+1), koef:-1) HHElem.addElemToHH(hhElem, i:s+myModS(j+1), j:j, leftFrom:8*(j+m)+7, leftTo:8*(j+m+1)+4, rightFrom:8*j+3, rightTo:8*(j+1), koef:1) HHElem.addElemToHH(hhElem, i:3*s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+4, leftTo:8*(j+m+1)+4, rightFrom:8*j+3, rightTo:8*(j+1)+2, koef:1) } override func oddShift23(_ hhElem: HHElem, s: Int, m: Int, ell: Int) { hhElem.makeZeroMatrix(8*s, h:11*s) var j = 2*s HHElem.addElemToHH(hhElem, i:+myModS(j+1), j:j, leftFrom:8*(j+m+1)+3, leftTo:8*(j+m+2)+3, rightFrom:8*j+2, rightTo:8*(j+1), koef:-1, noZeroLenL:true) HHElem.addElemToHH(hhElem, i:2*s+myModS(j+1), j:j, leftFrom:8*(j+m+2), leftTo:8*(j+m+2)+3, rightFrom:8*j+2, rightTo:8*(j+1)+1, koef:-1) j += s HHElem.addElemToHH(hhElem, i:2*s+myModS(j+1), j:j, leftFrom:8*(j+m+2), leftTo:8*(j+m+2)+4, rightFrom:8*j+3, rightTo:8*(j+1)+1, koef:-1) } override func oddShift24(_ hhElem: HHElem, s: Int, m: Int, ell: Int) { hhElem.makeZeroMatrix(10*s, h:11*s) var j = 2*s HHElem.addElemToHH(hhElem, i:+myModS(j+1), j:j, leftFrom:8*(j+m+1), leftTo:8*(j+m+1)+3, rightFrom:8*j+1, rightTo:8*(j+1), koef:1) j += 2*s HHElem.addElemToHH(hhElem, i:2*s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+5, leftTo:8*(j+m+1)+7, rightFrom:8*j+3, rightTo:8*(j+1)+1, koef:-1) } override func oddShift25(_ hhElem: HHElem, s: Int, m: Int, ell: Int) { hhElem.makeZeroMatrix(11*s, h:10*s) var j = 0 HHElem.addElemToHH(hhElem, i:+myModS(j+1), j:j, leftFrom:8*(j+m+1)+4, leftTo:8*(j+m+1)+7, rightFrom:8*j, rightTo:8*(j+1), koef:1, noZeroLenR:true) j += 4*s HHElem.addElemToHH(hhElem, i:s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+6, leftTo:8*(j+m+2)+5, rightFrom:8*j+3, rightTo:8*(j+1), koef:1) HHElem.addElemToHH(hhElem, i:3*s+myModS(j+1), j:j, leftFrom:8*(j+m+2), leftTo:8*(j+m+2)+5, rightFrom:8*j+3, rightTo:8*(j+1)+2, koef:1) } override func oddShift26(_ hhElem: HHElem, s: Int, m: Int, ell: Int) { hhElem.makeZeroMatrix(11*s, h:8*s) var j = 0 HHElem.addElemToHH(hhElem, i:+myModS(j+1), j:j, leftFrom:8*(j+m)+7, leftTo:8*(j+m+1)+5, rightFrom:8*j, rightTo:8*(j+1), koef:1, noZeroLenR:true) j += s HHElem.addElemToHH(hhElem, i:+myModS(j+1), j:j, leftFrom:8*(j+m)+7, leftTo:8*(j+m+1)+3, rightFrom:8*j, rightTo:8*(j+1), koef:1, noZeroLenR:true) j += 3*s HHElem.addElemToHH(hhElem, i:+myModS(j+1), j:j, leftFrom:8*(j+m)+7, leftTo:8*(j+m+1)+7, rightFrom:8*j+2, rightTo:8*(j+1), koef:1, noZeroLenL:true) HHElem.addElemToHH(hhElem, i:s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+6, leftTo:8*(j+m+1)+7, rightFrom:8*j+2, rightTo:8*(j+1)+1, koef:-1) j += s HHElem.addElemToHH(hhElem, i:s+myModS(j+1), j:j, leftFrom:8*(j+m+1)+6, leftTo:8*(j+m+2), rightFrom:8*j+3, rightTo:8*(j+1)+1, koef:1) } override func oddShift27(_ hhElem: HHElem, s: Int, m: Int, ell: Int) { hhElem.makeZeroMatrix(13*s, h:9*s) var j = 0 HHElem.addElemToHH(hhElem, i:+myModS(j+1), j:j, leftFrom:8*(j+m+1)+7, leftTo:8*(j+m+1)+7, rightFrom:8*j, rightTo:8*(j+1), koef:-1, noZeroLenR:true) j += 4*s HHElem.addElemToHH(hhElem, i:+myModS(j+1), j:j, leftFrom:8*(j+m+1)+7, leftTo:8*(j+m+2)+6, rightFrom:8*j+3, rightTo:8*(j+1), koef:-1) } override func oddShift28(_ hhElem: HHElem, s: Int, m: Int, ell: Int) { hhElem.makeZeroMatrix(14*s, h:8*s) var j = 0 HHElem.addElemToHH(hhElem, i:+myModS(j+1), j:j, leftFrom:8*(j+m+1), leftTo:8*(j+m+1)+2, rightFrom:8*j, rightTo:8*(j+1), koef:-1, noZeroLenR:true) j += 6*s HHElem.addElemToHH(hhElem, i:j+s, j:j, leftFrom:8*(j+m)+7, leftTo:8*(j+m+1)+7, rightFrom:8*j+3, rightTo:8*j+7, koef:-1, noZeroLenL:true) } override func koef29(ell: Int) -> Int { return minusDeg(ell) } } //#endif /* SHIFTS */
[ -1 ]
62a00fdd814c65179fca7ad43a94e2b2a1f4e27d
c7f41014083644a1fc04debba6ebfd8e480507fa
/Package.swift
47a58c7c559b2b2429117b39d3cd6a0e990d28ec
[]
no_license
msgpo/cSwiftImporter
4b9d1bc4f256daa05dfca145bf899a72b8115aec
dc22d124329878805951c94d9b92d8c511557d88
refs/heads/master
2022-03-25T22:24:24.602480
2019-10-04T01:21:49
2019-10-04T01:21:49
null
0
0
null
null
null
null
UTF-8
Swift
false
false
855
swift
// swift-tools-version:5.0 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription let package = Package( name: "swiftPackageIn", dependencies: [ // Dependencies declare other packages that this package depends on. .package(url: "https://github.com/kevinvandenbreemen/cHelloPackage", 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 which this package depends on. .target( name: "swiftPackageIn", dependencies: ["CCode"]), .testTarget( name: "swiftPackageInTests", dependencies: ["swiftPackageIn"]), ] )
[ 431973, 316779, 431731, 315574, 323612 ]
85b98fb5b03766e7330b380822042a7e896a44a9
f159a11399bd49a63e5d041c4be01eaec1f3206c
/OtusHomeWork/OtusHomeWork/Teams/TeamsViewModel.swift
0f8e54d743244d71c4b5df9be40c75ce5e850e45
[]
no_license
kravik/otus-ios-pro
95d4ff90edbece604f90b4c415dfae30c426fb87
07c38d396559a57a896c0f8f493d1752698a4067
refs/heads/main
2023-03-14T23:31:03.348973
2021-02-24T19:19:07
2021-02-24T19:19:07
321,779,135
0
0
null
null
null
null
UTF-8
Swift
false
false
946
swift
// // File.swift // OtusHomeWork // // Created by Igor Kravtcov on 20.12.2020. // import Foundation import Combine import FootballService final class TeamsViewModel: ObservableObject { let competition: Competition @Published private(set) var teams: [Team] = [] @Published private(set) var isPageLoading: Bool = false private let footballService: FootballService private var store = Set<AnyCancellable>() init(footballService: FootballService, competition: Competition) { self.footballService = footballService self.competition = competition } func load() { isPageLoading = true footballService .teams(competition: competition) .receive(on: DispatchQueue.main) .sink { (_) in } receiveValue: { teams in self.teams.append(contentsOf: teams) self.isPageLoading = false }.store(in: &store) } }
[ -1 ]
100819e15454ff6bb24b7e58fee327ed0b7da880
86e8053d749eb574f28944c1eccc218a6017cfaf
/ProductMarket/CompaniesViewController.swift
93ac117e7e22bcf89c752a57f4741ed9528233ec
[]
no_license
jamalzare/iOS-Product-Market
fcda007c21471e8161d70d53bb72ec65427ff4d9
5538bb7b52359fdcd12348d561b2c8fdd5bc9beb
refs/heads/master
2021-01-21T07:13:59.777624
2017-05-20T18:53:11
2017-05-20T18:53:11
91,606,444
0
0
null
null
null
null
UTF-8
Swift
false
false
2,961
swift
// // CompaniesViewController.swift // ProductMarket // // Created by Jamal on 5/8/17. // Copyright © 2017 In10min. All rights reserved. // import UIKit class CompaniesViewController: UIViewController, UICollectionViewDataSource { @IBOutlet weak var companyCollectionView: UICollectionView! private var companies = [Company]() override func viewDidLoad() { super.viewDidLoad() loadStores() setNavigationTitle() } func setNavigationTitle() { UIApplication.sharedApplication().setStatusBarStyle(UIStatusBarStyle.LightContent, animated: true) let titleLabel : UILabel = UILabel(frame: CGRect(x: 0, y: 0, width: 120, height: 32)) titleLabel.text = "کمپانی ها" titleLabel.font = UIFont(name: "HelvaticaNeue-UltraLight", size: 30.0) self.navigationItem.titleView = titleLabel } func loadStores() { print("uhdf dfg hrtr here") RestApiManager.singletonInstance.loadCompanies{json in let data = json for(_, item) in data{ let company = Company(name: item["name"].string!, totalProductCount: item["productCount"].int!) self.companies.append(company) } dispatch_async(dispatch_get_main_queue(), { self.companyCollectionView.reloadData() }) } } internal func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int{ return companies.count } func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell{ let cell = collectionView.dequeueReusableCellWithReuseIdentifier("cell", forIndexPath: indexPath) as! CustomCompanyCell cell.arm.image = UIImage(named: companies[indexPath.row].name ) return cell } func collectionView(collectionView: UICollectionView, layout collectionViewLayout:UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize{ let totalWidth: CGFloat = self.view.frame.size.width/2 let totalHeight: CGFloat = self.view.frame.size.width/2 return CGSize(width: totalWidth - 20, height: totalHeight - 20) } override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { if segue.identifier == "ShowProducts"{ if let cell = sender as? CustomCompanyCell{ let index = companyCollectionView.indexPathForCell(cell) if let destinactionVC = segue.destinationViewController as? CompanyProductsViewController{ destinactionVC.companyName = self.companies[index!.row].name } } } } }
[ -1 ]
dab002167617fd02582bdc4d8ba2fe9a3282022d
1c3c4d29ee0ebd2793d6af9507a769f320626f0f
/App/SemesterScoreViewController.swift
1c275d9d33e0b9bd05f08c133f6b068ed8761430
[]
no_license
imcloudwu/SwiftTest
206062e758cc7308e014b6553c6f41ce5f39c5e4
25cf64a67d155e779cd13c99e6e6710afd55f6fd
refs/heads/master
2020-05-17T03:17:20.439760
2014-10-23T03:58:06
2014-10-23T03:58:06
null
0
0
null
null
null
null
UTF-8
Swift
false
false
5,713
swift
// // FirstViewController.swift // App // // Created by Cloud on 10/1/14. // Copyright (c) 2014 Cloud. All rights reserved. // import UIKit class SemesterScoreViewController: UIViewController,UIAlertViewDelegate,UITabBarDelegate,UITableViewDelegate,UITableViewDataSource { var _lastChild:Child! var _sysm:[SYSM]! var _items:[UITabBarItem]! var _data:[SemsScore]! @IBOutlet weak var tabBar: UITabBar! @IBOutlet weak var tableView: UITableView! @IBOutlet weak var Name: UILabel! @IBAction func changeChild(sender: AnyObject) { Global.Selector.Show() } override func viewDidLoad() { super.viewDidLoad() _sysm = [SYSM]() _items = [UITabBarItem]() _data = [SemsScore]() if Global.CurrentChild == nil && Global.ChildList.count > 0{ Global.CurrentChild = Global.ChildList[0] } // Do any additional setup after loading the view, typically from a nib. } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int{ return _data.count } func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell{ var cell = UITableViewCell(style: UITableViewCellStyle.Value2, reuseIdentifier: "test") cell.textLabel?.text = _data[indexPath.row].Name cell.detailTextLabel?.text = _data[indexPath.row].Score return cell } func tableView(tableView: UITableView!, didSelectRowAtIndexPath indexPath: NSIndexPath!) { let alert = UIAlertView() alert.title = "Info" alert.message = _data[indexPath.row].Credit alert.addButtonWithTitle("OK") alert.show() } // Called when a button is clicked. The view will be automatically dismissed after this call returns func alertView(alertView: UIAlertView, clickedButtonAtIndex buttonIndex: Int){ Global.connector.SendRequest("semesterScoreSH.GetChildSemsScore", body: "<Request><RefStudentId>\(Global.CurrentChild.ID)</RefStudentId></Request>") { (response) -> () in self.Name.text = Global.CurrentChild.Name self.tabBar.setItems([], animated: true) self._items.removeAll(keepCapacity: false) self._sysm.removeAll(keepCapacity: false) var xml = SWXMLHash.parse(response) for elem in xml["Envelope"]["Body"]["Response"]["SemsSubjScore"] { var school_year = elem.element?.attributes["SchoolYear"] var semester = elem.element?.attributes["Semester"] if school_year != nil && semester != nil{ self._sysm.append(SYSM(SchoolYear: school_year!, Semester: semester!)) } } var font = UIFont(name: "HelveticaNeue-Light", size: 16.0) var index = 0 for sysm in self._sysm{ var title = sysm.SchoolYear + sysm.Semester var item = UITabBarItem(title: title, image: nil, tag: index) item.setTitlePositionAdjustment(UIOffsetMake(0.0, -20.0)) item.setTitleTextAttributes([NSFontAttributeName:font], forState: UIControlState.Normal) index++ self._items.append(item) } self.tabBar.setItems(self._items, animated: true) if self._items.count > 0{ self.tabBar.selectedItem = self._items[0] self.tabBar(self.tabBar, didSelectItem: self._items[0]) } } } func tabBar(tabBar: UITabBar, didSelectItem item: UITabBarItem!) { var sy = _sysm[item.tag].SchoolYear var sm = _sysm[item.tag].Semester Global.connector.SendRequest("semesterScoreSH.GetChildSemsScore", body: "<Request><ScoreInfo/><RefStudentId>\(Global.CurrentChild.ID)</RefStudentId><SchoolYear>\(sy)</SchoolYear><Semester>\(sm)</Semester></Request>") { (response) -> () in self._data.removeAll(keepCapacity: false) var xml = SWXMLHash.parse(response) for elem in xml["Envelope"]["Body"]["Response"]["SemsSubjScore"]["ScoreInfo"] { var info = elem.element?.text var data = SWXMLHash.parse(info!) for ele in data["SemesterSubjectScoreInfo"]["Subject"] { var name = ele.element?.attributes["科目"] var score = ele.element?.attributes["原始成績"] var credit = ele.element?.attributes["開課學分數"] var ss = SemsScore(Name: name, Score: score, Credit: credit) self._data.append(ss) } } self.tableView.reloadData() } } //切到該功能畫面時呼叫 override func viewWillAppear(animated: Bool){ Global.Selector.promp.delegate = self if _lastChild?.Name == Global.CurrentChild.Name && _lastChild?.ID == Global.CurrentChild.ID { return } if Global.CurrentChild != nil { alertView(Global.Selector.promp,clickedButtonAtIndex: 0) } } //離開畫面前記錄最後的小孩 override func viewDidDisappear(animated: Bool){ _lastChild = Global.CurrentChild } }
[ -1 ]
ddbdb94b33956b2c4f28edde654acb83fc66e852
db08ded9108819c907b85dfb3fa2df77901c7ebf
/HelloFresh/Constants.swift
9d2d3932ffa44bdaa91755fffa180fda8bbaf9c8
[]
no_license
DajePepo/Recipe
1eee6c41d27c7f9e0e6fdab9c4d13cfa4c6bf1c8
92e8ff6985bd29e39415836c9d4b39b2f7690826
refs/heads/master
2021-06-21T20:56:38.898372
2017-08-29T07:10:23
2017-08-29T07:10:23
null
0
0
null
null
null
null
UTF-8
Swift
false
false
710
swift
// // Constants.swift // HelloFresh // // Created by Pietro Santececca on 31/01/17. // Copyright © 2017 Tecnojam. All rights reserved. // struct Constants { // Is User Logged static let userWillBeLogged = false static let fakeUserId: String? = "ID_000" // Log in static let logInWillFail = false // Retrieve User Love static let retrieveUserLoveWillFail = false static let wasThereUserLove = false // Love Recipe static let loveRecipeWillFail = false // Retrieve User Rating static let retrieveUserRatingWillFail = false static let wasThereUserRating = false // Rate Recipe static let rateRecipeWillFail = false }
[ -1 ]
626b714bf9a63f1b5b675cc1172f08c4728302e9
3b6480a77d479e3ce4b9f0f8dafb1ccb8c3335f9
/Weather/Resources/Networking/Responses/WeeklyForecastResponse.swift
5c2b9b4e062de4ad6a6e5e88d12a6345bbc7cd7d
[]
no_license
thanhdolong/Weather
eb18fa43c18b63baa38db87d30ec47cc1b3f2f69
6c8821d5842ccc0f64272987d8b7279ce3000bc7
refs/heads/master
2020-07-16T19:26:52.421927
2019-09-28T21:19:51
2019-09-28T21:19:51
205,852,289
0
0
null
null
null
null
UTF-8
Swift
false
false
754
swift
// // WeeklyForecastResponse.swift // Weather // // Created by Thành Đỗ Long on 06/09/2019. // Copyright © 2019 Thành Đỗ Long. All rights reserved. // import Foundation struct WeeklyForecastResponse: Codable { let list: [Item] struct Item: Codable { let date: Date let main: MainClass let weather: [WeeklyForecastResponse.Weather] enum CodingKeys: String, CodingKey { case date = "dt" case main case weather } } struct MainClass: Codable { let temp: Double } struct Weather: Codable { let weatherDescription: String let icon: String enum CodingKeys: String, CodingKey { case weatherDescription = "description" case icon } } }
[ -1 ]
e9fa96d4288e898bed3ded667e3bd66c6db03109
90e48db1c9a1ab61c880deca111825925516cb85
/KAI Membership/MVVM/ViewControllers/Controllers/Password/Update/View Model/PasswordViewModel.swift
9fa5244828744528f799ce37e39819906970087b
[ "MIT" ]
permissive
trungthaihieu93-dev/kai-membership-swift
dceb4a7653644591b52f9d5ae15b56b45a874c03
aa56a7ac2f64f8d7da74c5826aaa4f4dd0ba34ba
refs/heads/main
2023-04-07T02:12:19.101313
2021-04-11T15:13:22
2021-04-11T15:13:22
359,314,723
0
1
MIT
2021-04-19T03:15:36
2021-04-19T03:15:36
null
UTF-8
Swift
false
false
1,623
swift
// // PasswordViewModel.swift // KAI Membership // // Created by DAKiet on 10/03/2021. // import RxSwift import RxRelay class PasswordViewModel { // MARK: Life cycle's let showLoading = BehaviorRelay<Bool>(value: false) // MARK: Methods func confirmPassword(with token: String, password: String) -> Observable<Void> { showLoading.accept(true) return Observable.create { [weak self] observer -> Disposable in UserServices.confirmPassword(with: token, password: password) { switch $0 { case .success: observer.onNext(()) observer.onCompleted() case .failure(let error): observer.onError(error) } self?.showLoading.accept(false) } return Disposables.create() } } func changePassword(password: String, newPassword: String) -> Observable<Void> { showLoading.accept(true) return Observable.create { [weak self] observer -> Disposable in UserServices.changePassword(password: password, newPassword: newPassword) { switch $0 { case .success: observer.onNext(()) observer.onCompleted() case .failure(let error): observer.onError(error) } self?.showLoading.accept(false) } return Disposables.create() } } }
[ -1 ]
11ca74d98c71a147c35985d7345678c9d8e2394a
30e40f9094f1a0aed908d65b1572a569c169118c
/Visa Card Calculation/main.swift
965279244e53ee1dfc82a5e1f955a2b6116a05ee
[]
no_license
Arsalan134/Visa-Card-Calculation
671b5f3569da27a4fc49bfbff57a137fa69b7af8
85553a20674974b301be738ddb30186a72708489
refs/heads/master
2022-11-17T11:09:37.213290
2020-07-16T10:59:27
2020-07-16T10:59:27
280,129,947
0
0
null
null
null
null
UTF-8
Swift
false
false
3,267
swift
// // main.swift // Visa Card Calculation // // Created by Arsalan Iravani on 11.08.2017. // Copyright © 2017 Arsalan Iravani. All rights reserved. // import Foundation func eleminateSpaces(number: String) -> String { var number = number for char in number { if char == " " { number.remove(at: number.index(of: char)!) } } return number } func check(number: String) -> Bool { let string = eleminateSpaces(number: number) var numbers: [Int] = [] var result = 0 for e in string { numbers.append(Int(String(e)) ?? 0) } var i = 0 // every 1st x2 for _ in numbers { if i % 2 == 0 { numbers[i] = numbers[i] * 2 if numbers[i] > 9 { var num = numbers[i]; numbers[i] = 0; while (num > 0) { numbers[i] = numbers[i] + num % 10; num = num / 10; } } } result += numbers[i] i += 1 } return result % 10 == 0 } //print(code) //print(check(number: code)) let array = ["a", "b", "c", "d"] let numbers = [0,1,2,3,4,5,6,7,8,9] var newArray: [String] = [] /// Creates all possible combinations func bruteforce(prefix: String = "", startIndex: Int = 0) { for i in startIndex ..< array.count { let newString = prefix + array[i] newArray.append(newString) print(newString) bruteforce(prefix: newString, startIndex: i + 1) } } func permutate<T>(array: [T], prefix: String = "", lengthOfArray: Int, k: Int) { if (k == 0) { // print(prefix) newArray.append(prefix) return } for i in 0 ..< lengthOfArray { permutate(array: array, prefix: "\(prefix)\(array[i])", lengthOfArray: lengthOfArray, k: k - 1) } } //42038221269535?9 let sequence = Array("4203822125?14085") //print(stringArray) //print(isCorrect(sequence: stringArray)) print(String(sequence).formatVisa()) var counter = 0 func printCompletedCardNumbers(sequence: [Character]) { print("Found:") var sum = 0 var numberOfAbsentNumbers = 0 // Calculate sum and number of absent numbers for i in 0 ..< sequence.count { if var number: Int = Int("\(sequence[i])") { if i % 2 == 0 { if number * 2 > 9 { number = number * 2 - 9 } else { number *= 2 } } sum += number } else { numberOfAbsentNumbers += 1 } } newArray = [] permutate(array: numbers, lengthOfArray: numbers.count, k: numberOfAbsentNumbers) for possibleCombination in 0 ..< newArray.count { var tempSequence = sequence for characterIndex in 0 ..< tempSequence.count { if tempSequence[characterIndex] == "?" { tempSequence[characterIndex] = newArray[possibleCombination].removeFirst() } } if isCorrect(sequence: tempSequence) { print(String(tempSequence).formatVisa()) counter += 1 } } } printCompletedCardNumbers(sequence: sequence) print("Number of combinations:\t", counter)
[ -1 ]
f41ba5a0add50ebdc26a1cafc3e3a0ad07cc940d
f5f312a5384afe9ad3d7f2f765b570e6c5a5b9f1
/CollectionDisplayCOn/CollectionDisplayCOn/DataFetcher.swift
f78c79cc6fbefd978262c1dafa5651c31401b567
[ "MIT" ]
permissive
starxor/UICollectionView-content-management
60447cc83b9c014aa184dca8834ad5b6614d477a
0a4c2b9190c1bbc513ecee786993e06741ee30e4
refs/heads/master
2021-01-18T16:11:26.862770
2017-03-31T13:44:14
2017-03-31T13:44:14
86,722,377
0
0
null
null
null
null
UTF-8
Swift
false
false
301
swift
// // DataFetcher.swift // CollectionDisplayCOn // // Created by Stanislav Starzhevskiy on 30.03.17. // Copyright © 2017 Stanislav Starzhevskiy. All rights reserved. // protocol DataFetcher { typealias CompletionHandler = (Error) -> Void func updateData(completion:CompletionHandler?) }
[ -1 ]
c4d05f3fb66d88ea7b3c1e83fe04463baedf1736
d1bdd681e048944618bb7f8ebb54b8d101ac4c05
/MatchGameApp/CardView.swift
2a53fad1157f6de76f0dc79c3c8beae057fc992f
[]
no_license
Jimin731/MatchGameApp
b54e749b10fb012a039d62df26942e4feb3e8366
d4a6cc3efc9e92da5363ed894ebf8c028f4cd3fb
refs/heads/main
2023-06-16T01:49:23.425275
2021-07-09T06:49:41
2021-07-09T06:49:41
384,302,200
0
0
null
null
null
null
UTF-8
Swift
false
false
1,832
swift
// // CardView.swift // MatchGameApp // // Created by 박지영 and 윤지민 on 2021/07/09. // import SwiftUI struct CardView: View { let card: Card let prefix: String var timer = Timer.publish(every: 0.1, on: .main, in: .common).autoconnect() @State var frameIndex = 1 let count : Int init(card: Card, prefix: String){ self.card = card self.prefix = prefix self.count = ImageAssetHelper.count(prefix: prefix, number: card.number) } var body: some View { if let open = card.open { Image(open ? String(format :"\(prefix)_%02d_%02d",card.number,frameIndex) : "\(prefix)_back") .resizable() .aspectRatio(1, contentMode: .fit) .onReceive(timer) { _ in frameIndex = frameIndex < count ? frameIndex + 1 : 1 } }else { Image(systemName: "x.circle") .resizable() .aspectRatio(contentMode: .fit) .opacity(0.1) } } } struct CardView_Previews: PreviewProvider { static var previews: some View { HStack { VStack { CardView(card: Card(open:false, number: 1), prefix: "f") CardView(card: Card(open:nil, number: 1), prefix: "f") CardView(card: Card(open:true, number: 1), prefix: "f") CardView(card: Card(open:true, number: 2), prefix: "f") } VStack { CardView(card: Card(open:false, number: 1), prefix: "t") CardView(card: Card(open:nil, number: 1), prefix: "t") CardView(card: Card(open:true, number: 1), prefix: "t") CardView(card: Card(open:true, number: 2), prefix: "t") } } } }
[ -1 ]
9cd6f31651723f419733b84677feaa6dca13a32f
3d144a23e67c839a4df1c073c6a2c842508f16b2
/test/AutoDiff/validation-test/property_wrappers.swift
4f102acc5d8c63a3798bff7226eec2a91079fc7c
[ "Apache-2.0", "Swift-exception" ]
permissive
apple/swift
c2724e388959f6623cf6e4ad6dc1cdd875fd0592
98ada1b200a43d090311b72eb45fe8ecebc97f81
refs/heads/main
2023-08-16T10:48:25.985330
2023-08-16T09:00:42
2023-08-16T09:00:42
44,838,949
78,897
15,074
Apache-2.0
2023-09-14T21:19:23
2015-10-23T21:15:07
C++
UTF-8
Swift
false
false
6,083
swift
// RUN: %target-run-simple-swift // TODO(TF-1254): Support and test forward-mode differentiation. // TODO(TF-1254): %target-run-simple-swift(-Xfrontend -enable-experimental-forward-mode-differentiation) // REQUIRES: executable_test import StdlibUnittest import DifferentiationUnittest var PropertyWrapperTests = TestSuite("PropertyWrapperDifferentiation") @propertyWrapper struct SimpleWrapper<Value> { var wrappedValue: Value // stored property } @propertyWrapper struct Wrapper<Value> { private var value: Value var wrappedValue: Value { // computed property get { value } set { value = newValue } } init(wrappedValue: Value) { self.value = wrappedValue } } struct Struct: Differentiable { @Wrapper @SimpleWrapper var x: Tracked<Float> = 10 @SimpleWrapper @Wrapper var y: Tracked<Float> = 20 var z: Tracked<Float> = 30 } PropertyWrapperTests.test("SimpleStruct") { func getter(_ s: Struct) -> Tracked<Float> { return s.x } expectEqual(.init(x: 1, y: 0, z: 0), gradient(at: Struct(), of: getter)) func setter(_ s: Struct, _ x: Tracked<Float>) -> Tracked<Float> { var s = s s.x = s.x * x * s.z return s.x } expectEqual((.init(x: 60, y: 0, z: 20), 300), gradient(at: Struct(), 2, of: setter)) // TODO: Support `modify` accessors (https://github.com/apple/swift/issues/55084). /* func modify(_ s: Struct, _ x: Tracked<Float>) -> Tracked<Float> { var s = s s.x *= x * s.z return s.x } expectEqual((.init(x: 60, y: 0, z: 20), 300), gradient(at: Struct(), 2, of: modify)) */ } struct GenericStruct<T> { @Wrapper var x: Tracked<Float> = 10 @Wrapper @Wrapper @Wrapper var y: T var z: Tracked<Float> = 30 } extension GenericStruct: Differentiable where T: Differentiable {} PropertyWrapperTests.test("GenericStruct") { func getter<T>(_ s: GenericStruct<T>) -> T { return s.y } expectEqual(.init(x: 0, y: 1, z: 0), gradient(at: GenericStruct<Tracked<Float>>(y: 20), of: getter)) func getter2<T>(_ s: GenericStruct<T>) -> Tracked<Float> { return s.x * s.z } expectEqual(.init(x: 30, y: 0, z: 10), gradient(at: GenericStruct<Tracked<Float>>(y: 20), of: getter2)) func setter<T>(_ s: GenericStruct<T>, _ x: Tracked<Float>) -> Tracked<Float> { var s = s s.x = s.x * x * s.z return s.x } expectEqual((.init(x: 60, y: 0, z: 20), 300), gradient(at: GenericStruct<Tracked<Float>>(y: 20), 2, of: setter)) // TODO: Support `modify` accessors (https://github.com/apple/swift/issues/55084). /* func modify<T>(_ s: GenericStruct<T>, _ x: Tracked<Float>) -> Tracked<Float> { var s = s s.x *= x * s.z return s.x } expectEqual((.init(x: 60, y: 0, z: 20), 300), gradient(at: GenericStruct<Tracked<Float>>(y: 1), 2, of: modify)) */ } // TF-1149: Test class with loadable type but address-only `TangentVector` type. class Class: Differentiable { @differentiable(reverse) @Wrapper @Wrapper var x: Tracked<Float> = 10 @differentiable(reverse) @Wrapper var y: Tracked<Float> = 20 @differentiable(reverse) var z: Tracked<Float> = 30 } PropertyWrapperTests.test("SimpleClass") { func getter(_ c: Class) -> Tracked<Float> { return c.x } expectEqual(.init(x: 1, y: 0, z: 0), gradient(at: Class(), of: getter)) func setter(_ c: Class, _ x: Tracked<Float>) -> Tracked<Float> { var c = c c.x = c.x * x * c.z return c.x } // FIXME(TF-1175): Class operands should always be marked active. // This is relevant for `Class.x.setter`, which has type // `$@convention(method) (@in Tracked<Float>, @guaranteed Class) -> ()`. expectEqual((.init(x: 1, y: 0, z: 0), 0), gradient(at: Class(), 2, of: setter)) /* expectEqual((.init(x: 60, y: 0, z: 20), 300), gradient(at: Class(), 2, of: setter)) */ // TODO: Support `modify` accessors (https://github.com/apple/swift/issues/55084). /* func modify(_ c: Class, _ x: Tracked<Float>) -> Tracked<Float> { var c = c c.x *= x * c.z return c.x } expectEqual((.init(x: 60, y: 0, z: 20), 300), gradient(at: Class(), 2, of: modify)) */ } // From: https://github.com/apple/swift-evolution/blob/master/proposals/0258-property-wrappers.md#proposed-solution // Tests the following functionality: // - Enum property wrapper. @propertyWrapper enum Lazy<Value> { case uninitialized(() -> Value) case initialized(Value) init(wrappedValue: @autoclosure @escaping () -> Value) { self = .uninitialized(wrappedValue) } var wrappedValue: Value { // TODO(TF-1250): Replace with actual mutating getter implementation. // Requires differentiation to support functions with multiple results. get { switch self { case .uninitialized(let initializer): let value = initializer() // NOTE: Actual implementation assigns to `self` here. return value case .initialized(let value): return value } } set { self = .initialized(newValue) } } } // From: https://github.com/apple/swift-evolution/blob/master/proposals/0258-property-wrappers.md#clamping-a-value-within-bounds @propertyWrapper struct Clamping<V: Comparable> { var value: V let min: V let max: V init(wrappedValue: V, min: V, max: V) { value = wrappedValue self.min = min self.max = max assert(value >= min && value <= max) } var wrappedValue: V { get { return value } set { if newValue < min { value = min } else if newValue > max { value = max } else { value = newValue } } } } struct RealPropertyWrappers: Differentiable { @Lazy var x: Float = 3 @Clamping(min: -10, max: 10) var y: Float = 4 } PropertyWrapperTests.test("RealPropertyWrappers") { @differentiable(reverse) func multiply(_ s: RealPropertyWrappers) -> Float { return s.x * s.y } expectEqual(.init(x: 4, y: 3), gradient(at: RealPropertyWrappers(x: 3, y: 4), of: multiply)) } runAllTests()
[ 85353 ]
27d712906355da1f1a9b6e0a83c2b7efe544a917
ae7fcb14a42338d9a556bf526a6b655a6e36f607
/Source/Definitions/ServiceFeatureInfo.swift
7138642ac513611b3d2c04b86c1a55f14f2799d6
[ "MIT" ]
permissive
PacoVu/ringcentral-swift
07ecab52ea86e8e74180b393ead52fd447fbc50e
2b3658d5446eb9542abcc15eb530d9d8648a0a55
refs/heads/master
2021-01-01T18:26:24.448435
2018-07-11T21:51:13
2018-07-11T21:51:13
98,340,830
0
0
null
2017-07-25T19:07:20
2017-07-25T19:07:20
null
UTF-8
Swift
false
false
678
swift
import Foundation import ObjectMapper open class ServiceFeatureInfo: Mappable { /* Feature name, see all available values in Service Feature List */ open var `featureName`: String? /* Feature status, shows feature availability for the extension */ open var `enabled`: Bool? public init() { } required public init?(map: Map) { } convenience public init(featureName: String? = nil, enabled: Bool? = nil) { self.init() self.featureName = `featureName` self.enabled = `enabled` } open func mapping(map: Map) { `featureName` <- map["featureName"] `enabled` <- map["enabled"] } }
[ -1 ]
51ddc63b72e0880ccb8e010cc3a51e8987aeaf59
e78c04a1a8d665d04c3c82b3a16d949e3e03aef2
/CarbonVisualizer/UserDetailsViewController.swift
d526970bb76a63103dfb275f9a8538505ffdbc44
[]
no_license
akmar1984/phonefashion
0e2a2cc7f112ab25441ab2a47005bb41460b5af1
ef82c41477fa45e4934e53a48146035719dfe0cf
refs/heads/master
2021-03-16T08:42:42.896098
2016-07-04T16:39:07
2016-07-04T16:39:07
46,788,272
0
0
null
null
null
null
UTF-8
Swift
false
false
851
swift
// // UserDetailsViewController.swift // PhoneFashionApp // // Created by Marek Tomaszewski on 27/06/2016. // // import UIKit class UserDetailsViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } /* // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { // Get the new view controller using segue.destinationViewController. // Pass the selected object to the new view controller. } */ }
[ 300288, 278016, 292096, 292102, 284577, 289190, 287399, 289191, 198315, 277420, 277421, 277427, 277433, 288827, 292156, 296638, 285378, 283461, 288332, 292429, 288847, 292432, 229585, 175826, 289234, 279380, 283093, 173531, 280029, 298206, 280030, 281959, 290160, 166642, 280435, 280434, 290166, 280445, 278015 ]
fd37ebb64842a11b607300453dba01e3b98e90af
fc2125255a8ed33e3da1c340f73a158379e90d93
/MapDemo/DepartementOverlay.swift
fa20210a6f30cb54c0569d53eac463b5540b7e43
[]
no_license
pierrem/MapDemo
c874e05c559df1d715b49b770c9629df472776ab
c081d704b8c6beb753ad1f687d616dbd950f4bbd
refs/heads/master
2021-01-24T06:14:07.210854
2015-10-04T19:58:42
2015-10-04T19:58:42
30,876,289
2
0
null
null
null
null
UTF-8
Swift
false
false
1,143
swift
// // DepartementOverlay.swift // MapDemo // // Created by Pierre Marty on 18/02/2015. // Copyright (c) 2015 Pierre Marty. All rights reserved. // import UIKit import MapKit class DepartementOverlay : NSObject, MKOverlay { // MARK:MKOverlay protocol // MKAnnotation protocol (MKOverlay is an MKAnnotation): for areas this should return the centroid of the area. // any meaning in our case ? let coordinate = CLLocationCoordinate2D(latitude:0, longitude:0) var boundingMapRect:MKMapRect { // France: NE 51.089062, 9.559320, SW 41.333740, -5.140600 let topLeft = CLLocationCoordinate2D(latitude:51.089062, longitude:-5.140600) let bottomRight = CLLocationCoordinate2D(latitude:41.333740, longitude:9.559320) let MKupperLeft = MKMapPointForCoordinate(topLeft) // project on map let MKlowerRight = MKMapPointForCoordinate(bottomRight) let width = MKlowerRight.x - MKupperLeft.x; let height = MKlowerRight.y - MKupperLeft.y; let bounds = MKMapRectMake (MKupperLeft.x, MKupperLeft.y, width, height); return bounds; } }
[ -1 ]
ac4d2df984d0d095df0e92d67291a91864a604f1
f411db6d8ea70c667038ae2bc6076eb372436f03
/Kawaguchi/ViewController.swift
00111f7e51a78dba5f001817b1c6094d5d952703
[]
no_license
tichinose1/Kawaguchi
cfa4545e35ebc2d1978c36257dbdddd53e487721
f7a2e359eb84e8c6660f4131ecaa9f72e82da53d
refs/heads/master
2022-10-22T19:50:13.114818
2020-06-06T19:41:59
2020-06-06T19:41:59
158,114,283
0
0
null
null
null
null
UTF-8
Swift
false
false
336
swift
// // ViewController.swift // Kawaguchi // // Created by tichinose1 on 2020/06/07. // Copyright © 2020 tichinose1dev. All rights reserved. // import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. } }
[ 327555, 398203, 356742, 384145, 391441, 375576, 384153, 399130, 258589, 254494, 254495, 245024, 436128, 254497, 397091, 155551, 351400, 356652, 319284, 383797, 396725, 402616, 397114, 111292, 384447, 266816, 360903, 359368, 437582, 330960, 146645, 399958, 402524, 362845, 332513, 399201, 384103, 374122, 352876, 349297, 210674, 320506, 361595 ]
1fae53d989afd1039fbc5cc5f7e9f55e25484c09
d926829da82c13c3fdc1f6a5f249caa4808a8046
/Memorize/Grid.swift
bb4c3e8e90b390e9224319b95b1246b0e80d9517
[]
no_license
RichardMEN11/stanford-ios-course
bce36776d0d24f473c595d25ee8ac4fb860fef87
e2084fea5066459616b766da7f9713d27fb9535c
refs/heads/master
2022-12-30T01:43:08.260419
2020-10-19T20:41:32
2020-10-19T20:41:32
298,685,270
0
0
null
2020-10-10T20:40:37
2020-09-25T21:43:21
Swift
UTF-8
Swift
false
false
1,104
swift
// // Grid.swift // Memorize // // Created by Richard Menning on 07.10.20. // Copyright © 2020 Richard Menning. All rights reserved. // import SwiftUI struct Grid<Item, ItemView>: View where Item: Identifiable, ItemView: View { private var items: [Item] private var viewForItem: (Item) -> ItemView init(_ items: [Item], viewForItem: @escaping (Item) -> ItemView){ self.items = items self.viewForItem = viewForItem } var body: some View { GeometryReader { geometry in self.body(for: GridLayout(itemCount: self.items.count, in: geometry.size)) } } private func body(for layout: GridLayout) -> some View { ForEach(items) { item in self.body(for: item, in: layout) } } private func body(for item: Item, in layout: GridLayout) -> some View { let index = items.firstIndex(matching: item)! return viewForItem(item) .frame(width: layout.itemSize.width, height: layout.itemSize.height) .position(layout.location(ofItemAt: index)) } }
[ -1 ]
7ff021bd57577e69f0db60f1fcd78e4e74914839
19537752adfe9cf1da16fe943a7af7d7b67417ee
/Sources/XcodeProj+FilePath.swift
86ccc70eb3c38cc13e01784dbcb2d4954fcaa515
[ "MIT" ]
permissive
gugengxin/XcodeProjKit
9b0f805dcfd742360df12b5a2bb82f71266f6a23
49c520e0ff9607ee83dc3cb2e3a42680f6c2f526
refs/heads/master
2020-09-11T02:26:13.706233
2019-09-02T16:28:42
2019-09-02T16:28:42
221,910,237
0
0
MIT
2019-11-15T11:26:17
2019-11-15T11:26:16
null
UTF-8
Swift
false
false
2,061
swift
// // XcodeProj+FilePath.swift // XcodeProjKitTests // // Created by Eric Marchand on 02/08/2017. // Copyright © 2017 AnOrgaName. All rights reserved. // import Foundation extension XcodeProj { func paths(_ current: PBXGroup, prefix: String) -> [String: PathType] { var paths: [String: PathType] = [:] for file in current.fileRefs { if let path = file.path, let sourceTree = file.sourceTree { switch sourceTree { case .group: switch sourceTree { case .absolute: paths[file.ref] = .absolute(prefix + "/" + path) case .group: paths[file.ref] = .relativeTo(.sourceRoot, prefix + "/" + path) case .relativeTo(let sourceTreeFolder): paths[file.ref] = .relativeTo(sourceTreeFolder, prefix + "/" + path) } case .absolute: paths[file.ref] = .absolute(path) case let .relativeTo(sourceTreeFolder): paths[file.ref] = .relativeTo(sourceTreeFolder, path) } } } for group in current.subGroups { if let path = group.path, let sourceTree = group.sourceTree { let str: String switch sourceTree { case .absolute: str = path case .group: str = prefix + "/" + path case .relativeTo(.sourceRoot): str = path case .relativeTo(.buildProductsDir): str = path case .relativeTo(.developerDir): str = path case .relativeTo(.sdkRoot): str = path } paths += self.paths(group, prefix: str) } else { paths += self.paths(group, prefix: prefix) } } return paths } }
[ -1 ]
fc2dee0d68ccae5d2b7f0f8ee20cba88d58f0ff6
aa347d1291b6a69bb5bb6f53f5949578746b3d06
/Example/Tests/Tests.swift
cf07602314850db4c42ae859d95f5d851ce78ebe
[ "MIT" ]
permissive
nouf92/NTFormValidator
1982f6441408bdd782ffff5f872df16ff4b15990
48c5170cbf49c661b56a0ab40d3914d6edbbd500
refs/heads/master
2021-06-25T23:38:53.997416
2017-09-13T13:18:52
2017-09-13T13:18:52
103,137,521
0
1
null
null
null
null
UTF-8
Swift
false
false
770
swift
/*import UIKit import XCTest import NTFormValidator class Tests: 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.measure() { // Put the code you want to measure the time of here. } } } */
[ 18165 ]
c0bfdbb3f033fc3252be990b29c9a380fb316908
34b01e319a9225b958448a816d86292653e0967b
/Tests/SQLHttpTests/TestSupport.swift
938e51ccebee6c48b8bc44c37cc1e7f2671fee0c
[ "MIT" ]
permissive
kperson/sql-http-swift
4869ba6819e36ebcbab3d159101086febdd0a19e
782d330d32316ec167447a135280ef013c58aa20
refs/heads/master
2023-04-14T01:53:48.363105
2021-04-28T00:30:13
2021-04-28T00:30:13
362,272,812
0
0
null
null
null
null
UTF-8
Swift
false
false
198
swift
import Foundation import SQLHttp extension JSONEncoder { func asString<T: Encodable>(_ value: T) -> String { return try! String(data: encode(value), encoding: .utf8)! } }
[ -1 ]
67b5bad496959ae670f98db994d9c8460b2c7711
0cfa0cd82087006d9a70bd6bb0bd2221c5c23ad7
/Delivery/Helpers/DeliveriesStorageManager.swift
04d3cdf3e2e2348029f00c9ecd6fc2fb8cdb563c
[]
no_license
hemant3370/Delivery_iOS_App
9d7e0d99edd98d584eb5894f5816ef21ef954cdd
3162fc6080d884d2836917f8972684888a18d4c9
refs/heads/master
2020-07-01T14:21:37.456814
2019-08-14T05:22:58
2019-08-14T05:22:58
201,195,325
1
1
null
null
null
null
UTF-8
Swift
false
false
3,726
swift
import CoreData class DeliveriesStorageManager { let persistentContainer: NSPersistentContainer! lazy var backgroundContext: NSManagedObjectContext = { return self.persistentContainer.newBackgroundContext() }() init(container: NSPersistentContainer) { self.persistentContainer = container self.persistentContainer.viewContext.automaticallyMergesChangesFromParent = true } convenience init() { guard let appDelegate = AppDelegate.shared else { fatalError("Can not get shared app delegate") } self.init(container: appDelegate.persistentContainer) } func getSavedDeliveries() -> DeliveryViewModels { guard Defaults.canCache() else { return [] } var savedDeliveries = DeliveryViewModels() let context = backgroundContext let deliveriesFetch: NSFetchRequest<DeliveryEntity> = DeliveryEntity.fetchRequest() do { let fetchedDeliveries = try context.fetch(deliveriesFetch) for deliveryEntity in fetchedDeliveries { let location = Location(lat: deliveryEntity.deliveryLocation?.latitude, lng: deliveryEntity.deliveryLocation?.longitude, address: deliveryEntity.deliveryLocation?.address) let delivery = Delivery(id: Int(deliveryEntity.id), deliveryDescription: deliveryEntity.deliveryDescription, imageURL: deliveryEntity.imageUrl, location: location) savedDeliveries.append(DeliveryCellViewModel(delivery: delivery)) } } catch { print("Failed to fetch deliveries: \(error)") } return savedDeliveries } func saveDeliveries(deliveries: Deliveries?) { guard Defaults.canCache() else { return } func saveLocation(location: Location, context: NSManagedObjectContext) -> LocationEntity? { if let locationEntity = NSEntityDescription.insertNewObject(forEntityName: String(describing: LocationEntity.self), into: context) as? LocationEntity { locationEntity.latitude = location.lat ?? 0 locationEntity.longitude = location.lng ?? 0 locationEntity.address = location.address return locationEntity } return nil } if let deliveriesToSave = deliveries { let context = backgroundContext for delivery in deliveriesToSave { if let deliveryEntity = NSEntityDescription.insertNewObject(forEntityName: String(describing: DeliveryEntity.self), into: context) as? DeliveryEntity { deliveryEntity.id = Int16(delivery.id ?? 0) deliveryEntity.deliveryDescription = delivery.deliveryDescription deliveryEntity.imageUrl = delivery.imageURL if let deliveryLocation = delivery.location { deliveryEntity.deliveryLocation = saveLocation(location: deliveryLocation, context: context) } } } do { try context.save() } catch { print("Failed to save deliveries: \(error)") } } } func deleteAllDeliveries() { if persistentContainer.persistentStoreDescriptions.first?.type != NSInMemoryStoreType { let fetchRequest = NSFetchRequest<NSFetchRequestResult>(entityName: String(describing: DeliveryEntity.self)) let deleteRequest = NSBatchDeleteRequest(fetchRequest: fetchRequest) _ = try? backgroundContext.execute(deleteRequest) } } }
[ -1 ]
a2c8955adf0d815e57772138467afdcfd0a5f2bf
e12f33130d99034204506ac4745627d3ae153ed9
/Hacktechproj/ViewController.swift
15864b06b25d46b3325b9e59b74a05b5925326a8
[]
no_license
Mohit-Doshi/Hacktech2019
d6cb6f6087cea08b17f241ff0e2e0d8c458c58e9
cacc689fece3a27139c5e460c2f68f632068fc48
refs/heads/master
2020-04-26T11:16:42.585197
2019-03-06T09:05:45
2019-03-06T09:05:45
173,511,076
1
0
null
null
null
null
UTF-8
Swift
false
false
4,037
swift
// // ViewController.swift // Hacktechproj // // Created by Mohit on 02/03/19. // Copyright © 2019 Mohit D. All rights reserved. // import UIKit import SCSDKLoginKit import SCSDKBitmojiKit // for bitmojis class ViewController: UIViewController { @IBOutlet weak var StartButton: UIButton! @IBOutlet weak var BitmojiImageView: UIImageView! var snapname:String = "modo85271" var avatarstringname:String = "" override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. StartButton.isHidden = true StartButton.isEnabled = false /* let loginButton = SCSDKLoginButton() { (success : Bool, error : Error?) in // do something //make the buttons visible and seek the bitmoji user icon key } self.view.addSubview(loginButton!)*/ } // end of viewDidLoad /* override func viewDidAppear(_ animated: Bool) { StartButton.isHidden = false StartButton.isEnabled = true } */ private func goToLoginConfirm(_ entity: UserEntity){ /* let storyboard = UIStoryboard(name: "LoginConfirm", bundle: nil) let vc = storyboard.instantiateInitialViewController() as! LoginConfirmViewController vc.userEntity = entity present(vc, animated: true, completion: nil)*/ self.StartButton.isHidden = false self.StartButton.isEnabled = true guard let avatarString = entity.avatar else { return } BitmojiImageView.load(from: avatarString) self.avatarstringname = avatarString self.snapname = entity.displayName! } @IBAction func snapchatLoginAction(_ sender: Any) { SCSDKLoginClient.login(from: self, completion: { success, error in if let error = error { print(error.localizedDescription) return } if success { print("issa success") self.fetchSnapUserInfo() //example code } }) } private func fetchSnapUserInfo(){ let graphQLQuery = "{me{displayName, bitmoji{avatar}}}" SCSDKLoginClient .fetchUserData( withQuery: graphQLQuery, variables: nil, success: { userInfo in if let userInfo = userInfo, let data = try? JSONSerialization.data(withJSONObject: userInfo, options: .prettyPrinted), let userEntity = try? JSONDecoder().decode(UserEntity.self, from: data) { DispatchQueue.main.async { self.goToLoginConfirm(userEntity) self.StartButton.isHidden = false // call function and send userEntity value // } } }) { (error, isUserLoggedOut) in print(error?.localizedDescription ?? "") print("I'm here~!") } } // 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?) { if(segue.identifier == "HometoGame") { // Get the new view controller using segue.destination. var obj = segue.destination as! GameViewController // Pass the selected object to the new view controller. if snapname != nil && snapname != "" { obj.snapun = snapname } else { obj.snapun = "modo85271" } obj.avstring = avatarstringname } } @IBAction func fromResultsViewController(segue: UIStoryboardSegue) // unwind segue method { } }
[ -1 ]
2ba8658be31b0ad5196e71b0bdd9f1c444b85302
643c7b988d07572144eb176d05af15bf1e470aec
/d03/APM/APM/ViewController.swift
9d3dbf4b3ee4b06cced4b93d84d1b1c822e48bb3
[]
no_license
Hohenfels/PiscineSwift
e83d914690d48af6ba854b551d70f2d5897dcec0
311f2d2e00e4f7674bcfefdd13f5fc9405869750
refs/heads/master
2020-05-02T21:18:56.816452
2019-04-02T15:15:41
2019-04-02T15:15:41
178,216,569
0
0
null
null
null
null
UTF-8
Swift
false
false
3,496
swift
// // ViewController.swift // APM // // Created by Felicien RENAUD on 1/24/19. // Copyright © 2019 Felicien RENAUD. All rights reserved. // import UIKit class ViewController: UIViewController, UICollectionViewDataSource, UICollectionViewDelegate { @IBOutlet weak var collectionView: UICollectionView! var flowLayout: UICollectionViewFlowLayout { let _flowLayout = UICollectionViewFlowLayout() _flowLayout.itemSize = CGSize(width: 160, height: 160) return _flowLayout } override func viewDidLoad() { super.viewDidLoad() self.collectionView.collectionViewLayout = flowLayout self.collectionView.register(UINib.init(nibName : "CustomCollectionViewCell", bundle: nil), forCellWithReuseIdentifier: "myCell") self.collectionView.dataSource = self } override func viewWillAppear(_ animated: Bool) { self.collectionView.reloadData() } override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if segue.identifier == "showImageSegue" { let dstVc = segue.destination as? ShowImageController let cell = sender as! CustomCollectionViewCell if let dst = dstVc { dst.photo = cell.imgView.image } } } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() } func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return DataImg.allPics.count } func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "myCell", for: indexPath) as! CustomCollectionViewCell let imageUrl = URL(string: DataImg.allPics[indexPath.row].rawValue) cell.showActivityIndicator(activityIndicator: true) URLSession.shared.dataTask(with: imageUrl!) { (data, response, error) in if error != nil { let alert = UIAlertController(title: "Woops !", message: "\(String(describing: error))", preferredStyle: .alert) alert.addAction(UIAlertAction(title: "Ok", style: .default, handler: nil)) self.present(alert, animated: true) } if let httpResponse = response as? HTTPURLResponse { if httpResponse.statusCode == 404 { let alert = UIAlertController(title: "Woops !", message: "Error HTTP response code : \(httpResponse.statusCode) on URL : \(DataImg.allPics[indexPath.row].rawValue)", preferredStyle: .alert) alert.addAction(UIAlertAction(title: "Ok", style: .default, handler: nil)) self.present(alert, animated: true) } } DispatchQueue.main.async { cell.imgView.image = UIImage(data: data!) cell.showActivityIndicator(activityIndicator: false) } }.resume() return cell } func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { performSegue(withIdentifier: "showImageSegue", sender: collectionView.cellForItem(at: indexPath)) } }
[ -1 ]
4b9f2b02c56ebe4db65f78a79dfc3e61806287e9
d14363a9441db8e2d3a488505600d8db315ec517
/SwiftStudy/Moya资料/MoyaNetworkTool-master/GHMoyaNetWorkTest/GHMoyaNetWorkTest/HandyJSON/NominalType.swift
f41cfe3da9a90c18d736125c286a8e77c6c7c782
[ "MIT" ]
permissive
kk-laoguo/KKSwiftPractice
a2c585f02c94d93f52b20ef83379ddff06b9a4d8
f99663075410286d133ec5a36dca774456ed3370
refs/heads/master
2022-12-05T16:23:15.615667
2020-08-25T00:46:16
2020-08-25T00:46:16
282,766,058
1
0
null
null
null
null
UTF-8
Swift
false
false
3,627
swift
/* * Copyright 1999-2101 Alibaba Group. * * 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. */ // // Created by zhouzhuo on 07/01/2017. // protocol NominalType : MetadataType { var nominalTypeDescriptorOffsetLocation: Int { get } } extension NominalType { var nominalTypeDescriptor: NominalTypeDescriptor? { let pointer = UnsafePointer<Int>(self.pointer) let base = pointer.advanced(by: nominalTypeDescriptorOffsetLocation) if base.pointee == 0 { // swift class created dynamically in objc-runtime didn't have valid nominalTypeDescriptor return nil } #if swift(>=4.1) return NominalTypeDescriptor(pointer: relativePointer(base: base, offset: base.pointee - base.hashValue)) #else return NominalTypeDescriptor(pointer: relativePointer(base: base, offset: base.pointee)) #endif } var fieldTypes: [Any.Type]? { guard let nominalTypeDescriptor = self.nominalTypeDescriptor else { return nil } guard let function = nominalTypeDescriptor.fieldTypesAccessor else { return nil } return (0..<nominalTypeDescriptor.numberOfFields).map { return unsafeBitCast(function(UnsafePointer<Int>(pointer)).advanced(by: $0).pointee, to: Any.Type.self) } } var fieldOffsets: [Int]? { guard let nominalTypeDescriptor = self.nominalTypeDescriptor else { return nil } let vectorOffset = nominalTypeDescriptor.fieldOffsetVector guard vectorOffset != 0 else { return nil } return (0..<nominalTypeDescriptor.numberOfFields).map { return UnsafePointer<Int>(pointer)[vectorOffset + $0] } } } struct NominalTypeDescriptor : PointerType { public var pointer: UnsafePointer<_NominalTypeDescriptor> var mangledName: String { return String(cString: relativePointer(base: pointer, offset: pointer.pointee.mangledName) as UnsafePointer<CChar>) } var numberOfFields: Int { return Int(pointer.pointee.numberOfFields) } var fieldOffsetVector: Int { return Int(pointer.pointee.fieldOffsetVector) } var fieldNames: [String] { let p = UnsafePointer<Int32>(self.pointer) return Array(utf8Strings: relativePointer(base: p.advanced(by: 3), offset: self.pointer.pointee.fieldNames)) } typealias FieldsTypeAccessor = @convention(c) (UnsafePointer<Int>) -> UnsafePointer<UnsafePointer<Int>> var fieldTypesAccessor: FieldsTypeAccessor? { let offset = pointer.pointee.fieldTypesAccessor guard offset != 0 else { return nil } let p = UnsafePointer<Int32>(self.pointer) let offsetPointer: UnsafePointer<Int> = relativePointer(base: p.advanced(by: 4), offset: offset) return unsafeBitCast(offsetPointer, to: FieldsTypeAccessor.self) } } struct _NominalTypeDescriptor { var mangledName: Int32 var numberOfFields: Int32 var fieldOffsetVector: Int32 var fieldNames: Int32 var fieldTypesAccessor: Int32 }
[ 294252, 166654 ]
704562edfeb7a821208f3c2e55f7d2913613069d
ebf53c0f387a06fd18e4f14b72dc6379fd935fd6
/parsers/test_Freddy_20160830/test_Freddy/JSONDecodable.swift
2da9bae044094f89b0857f943e9af4fb08a94618
[ "MIT" ]
permissive
ashutoshvarma/JSONTestSuite
3158ba6bd61e80ee0b40f89803653cd2039d63bb
269364065cba221dafbc67587780c4f1eff88599
refs/heads/master
2023-04-18T22:58:45.111387
2021-03-18T00:41:50
2021-03-18T00:41:50
348,677,923
0
0
MIT
2023-04-03T23:50:37
2021-03-17T11:04:21
C++
UTF-8
Swift
false
false
7,173
swift
// // JSONDecodable.swift // Freddy // // Created by Matthew D. Mathias on 3/24/15. // Copyright © 2015 Big Nerd Ranch. Licensed under MIT. // /// A protocol to provide functionality for creating a model object with a `JSON` /// value. public protocol JSONDecodable { /// Creates an instance of the model with a `JSON` instance. /// - parameter json: An instance of a `JSON` value from which to /// construct an instance of the implementing type. /// - throws: Any `JSON.Error` for errors derived from inspecting the /// `JSON` value, or any other error involved in decoding. init(json: JSON) throws } extension Double: JSONDecodable { /// An initializer to create an instance of `Double` from a `JSON` value. /// - parameter json: An instance of `JSON`. /// - throws: The initializer will throw an instance of `JSON.Error` if /// an instance of `Double` cannot be created from the `JSON` value that was /// passed to this initializer. public init(json: JSON) throws { switch json { case let .Double(double): self = double case let .Int(int): self = Swift.Double(int) default: throw JSON.Error.ValueNotConvertible(value: json, to: Swift.Double) } } } extension Int: JSONDecodable { /// An initializer to create an instance of `Int` from a `JSON` value. /// - parameter json: An instance of `JSON`. /// - throws: The initializer will throw an instance of `JSON.Error` if /// an instance of `Int` cannot be created from the `JSON` value that was /// passed to this initializer. public init(json: JSON) throws { switch json { case let .Double(double) where double <= Double(Swift.Int.max): self = Swift.Int(double) case let .Int(int): self = int default: throw JSON.Error.ValueNotConvertible(value: json, to: Swift.Int) } } } extension String: JSONDecodable { /// An initializer to create an instance of `String` from a `JSON` value. /// - parameter json: An instance of `JSON`. /// - throws: The initializer will throw an instance of `JSON.Error` if /// an instance of `String` cannot be created from the `JSON` value that was /// passed to this initializer. public init(json: JSON) throws { switch json { case let .String(string): self = string case let .Int(int): self = String(int) case let .Bool(bool): self = String(bool) case let .Double(double): self = String(double) default: throw JSON.Error.ValueNotConvertible(value: json, to: Swift.String) } } } extension Bool: JSONDecodable { /// An initializer to create an instance of `Bool` from a `JSON` value. /// - parameter json: An instance of `JSON`. /// - throws: The initializer will throw an instance of `JSON.Error` if /// an instance of `Bool` cannot be created from the `JSON` value that was /// passed to this initializer. public init(json: JSON) throws { guard case let .Bool(bool) = json else { throw JSON.Error.ValueNotConvertible(value: json, to: Swift.Bool) } self = bool } } extension RawRepresentable where RawValue: JSONDecodable { /// An initializer to create an instance of `RawRepresentable` from a `JSON` value. /// - parameter json: An instance of `JSON`. /// - throws: The initializer will throw an instance of `JSON.Error` if /// an instance of `RawRepresentable` cannot be created from the `JSON` value that was /// passed to this initializer. public init(json: JSON) throws { let raw = try json.decode(type: RawValue.self) guard let value = Self(rawValue: raw) else { throw JSON.Error.ValueNotConvertible(value: json, to: Self.self) } self = value } } internal extension JSON { /// Retrieves a `[JSON]` from the JSON. /// - parameter: A `JSON` to be used to create the returned `Array`. /// - returns: An `Array` of `JSON` elements /// - throws: Any of the `JSON.Error` cases thrown by `decode(type:)`. /// - seealso: `JSON.decode(_:type:)` static func getArray(json: JSON) throws -> [JSON] { // Ideally should be expressed as a conditional protocol implementation on Swift.Array. guard case let .Array(array) = json else { throw Error.ValueNotConvertible(value: json, to: Swift.Array<JSON>) } return array } /// Retrieves a `[String: JSON]` from the JSON. /// - parameter: A `JSON` to be used to create the returned `Dictionary`. /// - returns: An `Dictionary` of `String` mapping to `JSON` elements /// - throws: Any of the `JSON.Error` cases thrown by `decode(type:)`. /// - seealso: `JSON.decode(_:type:)` static func getDictionary(json: JSON) throws -> [Swift.String: JSON] { // Ideally should be expressed as a conditional protocol implementation on Swift.Dictionary. guard case let .Dictionary(dictionary) = json else { throw Error.ValueNotConvertible(value: json, to: Swift.Dictionary<Swift.String, JSON>) } return dictionary } /// Attempts to decode many values from a descendant JSON array at a path /// into JSON. /// - parameter: A `JSON` to be used to create the returned `Array` of some type conforming to `JSONDecodable`. /// - returns: An `Array` of `Decoded` elements. /// - throws: Any of the `JSON.Error` cases thrown by `decode(type:)`, as /// well as any error that arises from decoding the contained values. /// - seealso: `JSON.decode(_:type:)` static func getArrayOf<Decoded: JSONDecodable>(json: JSON) throws -> [Decoded] { // Ideally should be expressed as a conditional protocol implementation on Swift.Dictionary. // This implementation also doesn't do the `type = Type.self` trick. return try getArray(json).map(Decoded.init) } /// Attempts to decode many values from a descendant JSON object at a path /// into JSON. /// - returns: A `Dictionary` of string keys and `Decoded` values. /// - throws: One of the `JSON.Error` cases thrown by `decode(_:type:)` or /// any error that arises from decoding the contained values. /// - seealso: `JSON.decode(_:type:)` static func getDictionaryOf<Decoded: JSONDecodable>(json: JSON) throws -> [Swift.String: Decoded] { guard case let .Dictionary(dictionary) = json else { throw Error.ValueNotConvertible(value: json, to: Swift.Dictionary<Swift.String, Decoded>) } var decodedDictionary = Swift.Dictionary<Swift.String, Decoded>(minimumCapacity: dictionary.count) for (key, value) in dictionary { decodedDictionary[key] = try Decoded(json: value) } return decodedDictionary } }
[ 228299, 116654 ]
ab92a40e229a568df46c094dbb4abfecb6e85b77
78baf23f376f9d24a5676f959f9a55fc860a450c
/duru/Components/SubmitButton.swift
6a72090c349a2edac0cf7b4d0c3faed92faa9340
[]
no_license
Do-Log/duru-ios
09cf47b4aacefea5dbf2d50b646bfbee4efec4c6
90c29c952b33eec015477e377a946b03fe789344
refs/heads/main
2023-04-18T21:14:28.527051
2021-04-22T13:08:51
2021-04-22T13:08:51
350,544,912
0
1
null
2021-04-22T13:08:52
2021-03-23T01:40:29
Swift
UTF-8
Swift
false
false
764
swift
// // SubmitButton.swift // duru // // Created by 양원준 on 2021/04/16. // import SwiftUI struct SubmitButton: View { @Binding var isButtonActive: Bool var body: some View { GeometryReader{ geometry in VStack{ Spacer() Button(action: { }, label: { Text("확인") .foregroundColor(Color(hex: self.isButtonActive ? "#ffffff" : "#878787")) .font(.system(size: 20)) }) .frame(width: geometry.size.width, height: 65, alignment: .center) .background(Color(hex: self.isButtonActive ? "#9abcff" : "#e8e8e8")) } } } }
[ -1 ]
6c4519444cb1dd989eb3114ec0c4bc8896ae5793
c8ac673bff8afcb339a7d1ff1e4fabec5474c6e3
/opus-interface/AudioAdapter.swift
a59ffbae1c5ef6ca5651176b71e0dff27c33a4a3
[ "MIT" ]
permissive
SDooman/opus
51dad96a51361202fca460fef0c5563260f6728f
d1bd81e2991faa946ce31d317e0cea728f3a5a2a
refs/heads/master
2021-01-21T15:43:41.680855
2016-07-05T18:36:23
2016-07-05T18:36:23
36,826,270
1
0
null
null
null
null
UTF-8
Swift
false
false
2,122
swift
// // AudioManager.swift // opus-interface // // Created by Samuel Dooman on 6/9/15. // Copyright (c) 2015 Sam Dooman. All rights reserved. // import AudioToolbox class AudioAdapter { var _audioGraph: OpusAUGraph var _midiSequenceEditor: OpusMIDIAdapter var _midiPlayer: OpusAudioPlayer //MARK: Lifecycle init() { _audioGraph = OpusAUGraph() _midiSequenceEditor = OpusMIDIAdapter(auGraph: _audioGraph.getAUGraph()) _midiPlayer = OpusAudioPlayer(sequence: _midiSequenceEditor.getSequence()) } deinit { } //MARK: Edit MIDI Sequence func insert( noteInformation: (UInt8, Float32, MusicTimeStamp)) -> Bool { return _midiSequenceEditor.insertNote(noteInformation.0, duration: noteInformation.1, time: noteInformation.2) } func edit(oldNoteInformation: (UInt8, Float32, MusicTimeStamp), newNoteInformation: (UInt8, Float32, MusicTimeStamp)) -> Bool { return _midiSequenceEditor.editNote(oldNoteInformation.0, duration: oldNoteInformation.1, time: oldNoteInformation.2, newNote: newNoteInformation.0, newDuration: newNoteInformation.1, newTime: newNoteInformation.2) } func remove(noteInformation: (UInt8, Float32, MusicTimeStamp)) -> Bool { return _midiSequenceEditor.deleteNote(noteInformation.0, duration: noteInformation.1, time: noteInformation.2) } //MARK: Music Playback func preparePlayback() -> Bool { return _midiPlayer.preparePlayback() } func startPlayback() -> Bool { return _midiPlayer.startPlaybackFromBeginning() } func stopPlayback() -> Bool { return _midiPlayer.stopPlayback() } func resumePlayback() -> Bool { return _midiPlayer.resetPlayback() } func getPlaybackTime() -> MusicTimeStamp { return _midiPlayer.getPlaybackTime() } func setPlaybackTime(intime: MusicTimeStamp) -> Bool { return _midiPlayer.setPlaybackTime(intime) } func resetPlaybackTime() -> Bool { return _midiPlayer.resetPlayback() } func isPlaying() -> Bool { return _midiPlayer.isPlaying() } }
[ -1 ]
6f39dccd74919783e6b4bfb476a38817591d0b93
fb7f6cb6aa6f0315e8fa708195f7acac46fb54ab
/ShoppinGO/CardCollectionViewCell.swift
64468b3828eb0c7bc952b95d3f505027f980fee9
[]
no_license
eDickC/ShoppinGO
764ca6765bc158fe8634915551e709579d5e2585
2bdaa65283a848398bae913a4f23f4a9108c66ed
refs/heads/master
2021-01-13T03:51:07.877216
2017-01-21T13:04:22
2017-01-21T13:04:22
78,427,453
0
0
null
null
null
null
UTF-8
Swift
false
false
508
swift
// // CardCollectionViewCell.swift // ShoppinGO // // Created by Eduard Cihuňka on 21/01/2017. // Copyright © 2017 Eduard Cihuňka. All rights reserved. // import UIKit class CardCollectionViewCell: UICollectionViewCell { @IBOutlet weak var cardholderName: UILabel! @IBOutlet weak var cardCode: UILabel! func cofigureCell(card: Card) { cardholderName.text = card.cardHolderName cardCode.text = card.cardCode self.layer.cornerRadius = 10 } }
[ -1 ]
2cd41933f8eff4abd653bcac4e80b913c15dd01b
49535fbbae2862c3d8788ccfc73b5df0ab9795d4
/#4_Find_Vowels.playground/Contents.swift
68d46eb439d33c42f3ce9984c372d18a5daae780
[]
no_license
andrey-zelenin/swift-coding-challenges
c9414321b6dd2b1a8595d38eae3c47b827b64b83
7705afd9b2db19367cbf459e896038f3b28e1e63
refs/heads/master
2020-05-05T12:30:08.790920
2019-04-07T22:31:22
2019-04-07T22:31:22
180,031,408
0
0
null
null
null
null
UTF-8
Swift
false
false
873
swift
import UIKit /* #4 Find the Vowels This is probably one of the less challenging challenges (no pun intended) — in terms of difficulty — but that doesn’t detract from the fact that you could come across it during a job interview. It goes like this. */ func findVowels(_ input: String) -> Int { let regex = try! NSRegularExpression(pattern: "[aeiou]", options: [.caseInsensitive]) return regex.matches(in: input, options: [], range: NSRange(location: 0, length: input.count)).count } // test let testData: [String] = [ "Test", // 1 "Anna", // 2 "Top spot", // 2 "character", // 3 "Eve", // 2 "Step on no pets", // 4 "Right", // 1 "The word palindrome", // 6 "Qqqqqq" // 0 ]; for str in testData { print(findVowels(str)) }
[ -1 ]
92cd1c1d60c231e19207b531e12e41f280933d84
e4c947c8b535973ea6b616315e6b48f89303ac19
/DayPlanner/Classes/DayViewController.swift
a2318f4d4cbf5e7560021dabbd24a53831ce39ca
[ "MIT" ]
permissive
rlasante/DayPlanner
e11273057fecb75f4141f0b09a1be50ecbc9cdc8
85f04d7ac74e3367b202214f5310f68c3a4549e5
refs/heads/master
2021-01-20T20:53:13.420186
2016-08-04T22:40:20
2016-08-04T22:40:20
64,971,531
0
0
null
2016-08-04T22:40:21
2016-08-04T22:33:40
null
UTF-8
Swift
false
false
2,434
swift
// // DayViewController.swift // DayPlanner // // Created by Ryan LaSante on 7/7/16. // Copyright © 2016 rlasante. All rights reserved. // import UIKit import CoreData class DayViewController: UIViewController, ContextConfigurable { var context: NSManagedObjectContext! { didSet { fetchDay() } } var date: NSDate! { didSet { fetchDay() } } private var day: Day! { didSet { configureGoals() } } @IBOutlet weak var goalsView: UIStackView! @IBOutlet weak var tasksView: UIStackView! @IBOutlet weak var thoughtsView: UIStackView! override func viewDidLoad() { super.viewDidLoad() } override func viewWillAppear(animated: Bool) { super.viewWillAppear(animated) configureGoals() } func fetchDay() { guard let context = context, date = date where day == nil else { return } do { guard let day = try context.executeFetchRequest(Day.fetchRequest(for: date)).first as? Day else { self.day = Day(on: context, with: date) return } self.day = day } catch { assertionFailure("We were unable to fetch or create a day object") } } override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { super.prepareForSegue(segue, sender: sender) if var goalController = segue.destinationViewController as? GoalsViewController { goalController.day = day goalController.prepare(with: context) } } func configureGoals() { guard let day = day, let goalsView = goalsView else { return } for view in goalsView.subviews { view.removeFromSuperview() } let sortedGoals = day.goals.sort { (firstGoal, secondGoal) -> Bool in let priorityOrder = firstGoal.priority >= secondGoal.priority let dateOrdering = firstGoal.creationDate.compare(secondGoal.creationDate) == .OrderedDescending return priorityOrder && dateOrdering } for goal in sortedGoals { let goalLabel = UILabel() goalLabel.text = goal.text goalsView.addArrangedSubview(goalLabel) } if sortedGoals.count == 0 { goalsView.setNeedsLayout() } } }
[ -1 ]
7041d6818f3fe54d680e29c54ac387f0e76fecfc
403c2a87993755a1dd7244c042da23487b63a5cd
/Tella/Utils/Localizable/LocalizableVault.swift
4535b2b4ed576f433f0d60e979473b2ddd2dc9cc
[]
no_license
Horizontal-org/Tella-iOS
6690a807de3ad5c3a0fd4b73894d9c80f7bc2b5b
0446783983a2502ce90e0b612a2542bd61f6d908
refs/heads/master
2023-08-16T12:34:12.774332
2023-06-27T17:09:35
2023-06-27T17:09:35
238,504,704
12
13
null
2023-09-14T05:18:07
2020-02-05T17:09:08
Swift
UTF-8
Swift
false
false
4,936
swift
// Tella // // Copyright © 2022 INTERNEWS. All rights reserved. // enum LocalizableVault: String, LocalizableDelegate { // Sort By case rootDirectoryName = "Vault_RootDirectoryName" case SortBySheetTitle = "Vault_SortBy_SheetTitle" case sortByName = "Vault_SortBy_Name" case sortByDate = "Vault_SortBy_Date" case sortByAscendingNameSheetSelect = "Vault_SortBy_AscendingName_SheetSelect" case sortByDescendingNameSheetSelect = "Vault_SortBy_DescendingName_SheetSelect" case sortByAscendingDateSheetSelect = "Vault_SortBy_AscendingDate_SheetSelect" case sortByDescendingDateSheetSelect = "Vault_SortBy_DescendingDate_SheetSelect" case itemsAppBar = "Vault_Items_AppBar" case itemAppBar = "Vault_Item_AppBar" // Manage Files case manageFilesSheetTitle = "Vault_ManageFiles_SheetTitle" case manageFilesTakePhotoVideoSheetSelect = "Vault_ManageFiles_TakePhotoVideo_SheetSelect" case manageFilesRecordAudioSheetSelect = "Vault_ManageFiles_RecordAudio_SheetSelect" case manageFilesImportFromDeviceSheetSelect = "Vault_ManageFiles_ImportFromDevice_SheetSelect" case manageFilesCreateNewFolderSheetSelect = "Vault_ManageFiles_CreateNewFolder_SheetSelect" case manageFilesPhotoLibrarySheetSelect = "Vault_ManageFiles_PhotoLibrary_SheetSelect" case manageFilesDocumentSheetSelect = "Vault_ManageFiles_Document_SheetSelect" // File actions case moreActionsShareSheetSelect = "Vault_MoreActions_Share_SheetSelect" case moreActionsMoveSheetSelect = "Vault_MoreActions_Move_SheetSelect" case moreActionsRenameSheetSelect = "Vault_MoreActions_Rename_SheetSelect" case moreActionsSaveSheetSelect = "Vault_MoreActions_Save_SheetSelect" case moreActionsFileInformationSheetSelect = "Vault_MoreActions_FileInformation_SheetSelect" case moreActionsDeleteSheetSelect = "Vault_MoreActions_Delete_SheetSelect" case renameFileSheetTitle = "Vault_RenameFile_SheetTitle" case renameFileCancelSheetAction = "Vault_RenameFile_Cancel_SheetAction" case renameFileSaveSheetAction = "Vault_RenameFile_Save_SheetAction" case createNewFolderSheetTitle = "Vault_CreateNewFolder_SheetTitle" case createNewFolderCancelSheetAction = "Vault_CreateNewFolder_Cancel_SheetAction" case createNewFolderCreateSheetAction = "Vault_CreateNewFolder_Create_SheetAction" case deleteFileSheetTitle = "Vault_DeleteFile_SheetTitle" case deleteFilesSheetTitle = "Vault_DeleteFiles_SheetTitle" case deleteFileSheetExpl = "Vault_DeleteFile_SheetExpl" case deleteFilesSheetExpl = "Vault_DeleteFiles_SheetExpl" case deleteFileCancelSheetAction = "Vault_DeleteFile_Cancel_SheetAction" case deleteFileDeleteSheetAction = "Vault_DeleteFile_Delete_SheetAction" case saveToDeviceSheetTitle = "Vault_SaveToDevice_SheetTitle" case saveToDeviceSheetExpl = "Vault_SaveToDevice_SheetExpl" case saveToDeviceSaveSheetAction = "Vault_SaveToDevice_Save_SheetAction" case saveToDeviceCancelSheetAction = "Vault_SaveToDevice_Cancel_SheetAction" case importDeleteTitle = "Vault_ImportDelete_Title" case importDeleteContent = "Vault_ImportDelete_Content" case importDeleteSubcontent = "Vault_ImportDelete_SubContent" case importDeleteKeepOriginal = "Vault_ImportDelete_KeepOriginal" case importDeleteDeleteOriginal = "Vault_ImportDelete_DeleteOriginal" // Move File case moveFileAppBar = "Vault_MoveFile_AppBar" case moveFileActionCancel = "Vault_MoveFile_Action_Cancel" case moveFileActionMove = "Vault_MoveFile_Action_Move" // File Info case verifInfoAppBar = "Vault_VerifInfo_AppBar" case verifInfoFileName = "Vault_VerifInfo_FileName" case verifInfoSize = "Vault_VerifInfo_Size" case verifInfoFormat = "Vault_VerifInfo_Format" case verifInfoCreated = "Vault_VerifInfo_Created" case verifInfoResolution = "Vault_VerifInfo_Resolution" case verifInfoLength = "Vault_VerifInfo_Length" case verifInfoFilePath = "Vault_VerifInfo_FilePath" // Import Progress case importProgressSheetTitle = "Vault_ImportProgress_SheetTitle" case importProgressSheetExpl = "Vault_ImportProgress_SheetExpl" case importProgressCancelSheetAction = "Vault_ImportProgress_Cancel_SheetAction" // Cancel Import File case cancelImportFileSheetTitle = "Vault_CancelImportFile_SheetTitle" case cancelImportFileSheetExpl = "Vault_CancelImportFile_SheetExpl" case cancelImportFileBackSheetAction = "Vault_CancelImportFile_Back_SheetAction" case cancelImportFileCancelImportSheetAction = "Vault_CancelImportFile_CancelImport_SheetAction" // Empty File Message case emptyAllFilesExpl = "Vault_EmptyAllFiles_Expl" case emptyFolderExpl = "Vault_EmptyFolder_Expl" case fileAudioUpdateSecondTime = "Vault_FileAudio_UpdateSecondTime" }
[ -1 ]
ba9f6ee5694765530e4268c3336bab2cebd7b2bf
cc464eefc77e411af7347e375593b4612aace94a
/Lecteur Youtube/VideoController.swift
59746651eea4a2f9a57ac82542f11e9a74c2d36e
[]
no_license
TiehouaSarah/Lecteur-Youtube
61801fc0dda4d11edfca1b0db14dc3358bb1e4f5
cf4c61c8bd4c722b02b14ce2742fcad8f35d404a
refs/heads/master
2020-04-01T20:55:17.403596
2018-10-18T17:04:19
2018-10-18T17:04:19
153,626,850
0
0
null
null
null
null
UTF-8
Swift
false
false
644
swift
// // VideoController.swift // Lecteur Youtube // // Created by Ecole NaN on 18/10/2018. // Copyright © 2018 Ecole NaN. All rights reserved. // import UIKit import WebKit class VideoController: UIViewController { @IBOutlet weak var webView: WKWebView! var chanson: Chanson? override func viewDidLoad() { super.viewDidLoad() if chanson != nil{ chargerVideo(chanson: chanson!) } } func chargerVideo(chanson: Chanson){ if let url = URL(string: chanson.videoUrl){ let requete = URLRequest(url: url) webView.load(requete) } } }
[ -1 ]
c74c0d8d17934b4d2bcc89adabe5ef87ab86eed5
fbdb1e84627cd1e3f5f2a1ab898c4bdbce19c65d
/PersonalityQuizUITests/PersonalityQuizUITests.swift
6ba7703b22f8a7030ff994686e7ae5318653d315
[]
no_license
Michaelkenber/PersonalityQuiz
0b8666b353cc2812b2b2827df39f5765a6d712b6
5904ca02466874a97d5ddf750948a3e404ccc871
refs/heads/master
2021-04-27T07:48:33.275790
2018-02-26T11:33:14
2018-02-26T11:33:14
122,638,533
0
0
null
null
null
null
UTF-8
Swift
false
false
1,277
swift
// // PersonalityQuizUITests.swift // PersonalityQuizUITests // // Created by Michael Berend on 22/02/2018. // Copyright © 2018 Michael Berend. All rights reserved. // import XCTest class PersonalityQuizUITests: XCTestCase { override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. // In UI tests it is usually best to stop immediately when a failure occurs. continueAfterFailure = false // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. XCUIApplication().launch() // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. super.tearDown() } func testExample() { // Use recording to get started writing UI tests. // Use XCTAssert and related functions to verify your tests produce the correct results. } }
[ 333827, 243720, 282634, 313356, 155665, 305173, 241695, 237599, 223269, 292901, 315431, 354342, 229414, 315433, 325675, 354346, 278571, 124974, 102446, 282671, 229425, 102441, 243763, 321589, 241717, 180279, 215095, 229431, 213051, 288829, 325695, 286787, 288835, 307269, 237638, 313415, 239689, 233548, 315468, 333902, 196687, 278607, 311377, 354386, 311373, 329812, 315477, 223317, 200795, 323678, 315488, 315489, 45154, 321632, 280676, 313446, 215144, 217194, 194667, 233578, 278637, 307306, 319599, 288878, 278642, 284789, 284790, 131190, 249976, 288890, 215165, 131199, 194692, 235661, 278669, 241809, 323730, 278676, 311447, 153752, 327834, 284827, 329884, 278684, 299166, 278690, 233635, 215204, 311459, 284840, 299176, 278698, 284843, 184489, 184498, 278707, 125108, 180409, 280761, 258233, 295099, 227517, 278713, 280767, 223418, 299197, 299202, 139459, 309443, 176325, 131270, 301255, 299208, 227525, 280779, 233678, 282832, 321744, 227536, 301270, 301271, 229591, 280792, 356575, 311520, 325857, 334049, 280803, 182503, 338151, 307431, 295147, 317676, 286957, 125166, 125170, 313595, 184574, 125184, 125192, 217352, 125200, 194832, 227601, 325904, 125204, 319764, 278805, 334104, 315674, 282908, 311582, 125215, 282912, 278817, 233761, 299294, 211239, 282920, 125225, 317738, 325930, 311596, 321839, 315698, 98611, 125236, 332084, 282938, 278843, 168251, 287040, 319812, 311622, 227655, 280903, 323914, 282959, 229716, 289109, 168280, 379224, 323934, 391521, 239973, 381286, 285031, 416103, 313703, 280938, 242027, 242028, 321901, 354671, 354672, 287089, 278895, 227702, 199030, 315768, 315769, 291194, 223611, 248188, 139641, 313726, 211327, 291200, 311679, 291193, 240003, 158087, 313736, 227721, 242059, 311692, 285074, 227730, 240020, 190870, 315798, 190872, 291225, 285083, 293275, 317851, 242079, 227743, 285089, 293281, 283039, 289185, 156069, 301482, 311723, 289195, 234957, 377265, 338359, 299449, 311739, 319931, 293309, 278974, 311744, 317889, 291266, 278979, 326083, 278988, 289229, 281038, 326093, 278992, 283089, 373196, 283088, 281039, 279000, 242138, 285152, 369121, 279009, 291297, 195044, 160224, 242150, 279014, 319976, 279017, 281071, 319986, 236020, 279030, 311800, 279033, 317949, 279042, 283138, 233987, 287237, 377352, 322057, 309770, 342537, 279053, 283154, 303635, 303634, 279061, 182802, 279060, 279066, 322077, 291359, 227881, 293420, 289328, 236080, 283185, 279092, 23093, 234037, 244279, 244280, 338491, 234044, 301635, 322119, 55880, 309831, 377419, 281165, 303693, 301647, 281170, 326229, 115287, 189016, 309847, 287319, 332379, 111197, 295518, 287327, 306634, 242274, 244326, 279143, 279150, 281200, 287345, 313970, 287348, 301688, 244345, 189054, 287359, 291455, 297600, 303743, 301702, 164487, 279176, 311944, 334473, 316044, 311948, 311950, 316048, 311953, 316050, 336531, 287379, 326288, 227991, 295575, 289435, 303772, 221853, 205469, 285348, 314020, 279207, 295591, 248494, 318127, 293552, 279215, 285362, 295598, 299698, 164532, 166581, 342705, 154295, 285360, 287418, 314043, 303802, 287412, 66243, 291529, 287434, 363212, 225996, 287438, 242385, 164561, 303826, 279253, 158424, 230105, 299737, 342757, 295653, 289511, 230120, 330473, 234216, 285419, 330476, 289517, 215790, 170735, 312046, 279278, 125683, 230133, 199415, 234233, 242428, 279293, 205566, 289534, 322302, 299777, 291584, 285443, 228099, 291591, 295688, 346889, 285450, 322312, 264971, 326413, 312076, 322320, 285457, 295698, 166677, 283418, 285467, 326428, 221980, 281378, 234276, 283431, 262952, 262953, 279337, 318247, 318251, 262957, 293673, 164655, 328495, 289580, 301872, 303921, 234290, 285493, 230198, 285496, 301883, 201534, 281407, 289599, 222017, 295745, 342846, 293702, 318279, 283466, 281426, 279379, 244569, 281434, 295769, 322396, 201562, 230238, 275294, 301919, 230239, 279393, 293729, 349025, 281444, 279398, 303973, 351078, 308075, 242540, 242542, 310132, 295797, 201590, 207735, 228214, 295799, 177018, 269179, 279418, 308093, 314240, 291713, 158594, 330627, 240517, 287623, 299912, 416649, 279434, 236427, 316299, 252812, 228232, 189327, 308111, 308113, 320394, 293780, 310166, 289691, 209820, 240543, 283551, 310177, 289699, 189349, 289704, 293801, 279465, 326571, 177074, 304050, 326580, 289720, 326586, 289723, 189373, 281541, 345030, 19398, 213961, 326602, 279499, 56270, 191445, 183254, 304086, 234469, 340967, 304104, 314343, 324587, 183276, 289773, 203758, 320492, 320495, 234476, 287730, 240631, 214009, 312317, 328701, 328705, 234499, 293894, 320520, 230411, 322571, 320526, 330766, 234513, 238611, 140311, 293911, 238617, 316441, 197658, 330789, 248871, 113710, 189487, 281647, 322609, 312372, 203829, 238646, 300087, 238650, 320571, 21567, 308288, 160834, 336962, 314437, 349254, 238663, 300109, 207954, 234578, 205911, 296023, 314458, 156763, 281698, 281699, 230500, 285795, 214116, 322664, 228457, 279659, 318571, 234606, 300145, 279666, 300147, 312435, 187508, 230514, 238706, 302202, 285819, 314493, 285823, 150656, 234626, 279686, 222344, 285833, 318602, 234635, 228492, 337037, 177297, 162962, 187539, 326803, 308375, 324761, 285850, 296091, 119965, 302239, 330912, 300192, 339106, 306339, 234662, 300200, 249003, 208044, 238764, 322733, 3243, 302251, 294069, 300215, 294075, 339131, 228541, 64699, 283841, 148674, 283846, 312519, 279752, 283849, 148687, 290001, 189651, 316628, 279766, 189656, 279775, 304352, 298209, 310496, 304353, 279780, 228587, 279789, 290030, 302319, 251124, 234741, 316661, 283894, 279803, 292092, 208123, 228608, 320769, 234756, 242955, 177420, 312588, 318732, 245018, 320795, 320802, 304422, 130342, 130344, 292145, 298290, 312628, 345398, 300342, 159033, 333114, 333115, 286012, 181568, 279872, 279874, 193858, 216387, 300354, 300355, 372039, 294210, 304457, 345418, 230730, 294220, 296269, 234830, 224591, 238928, 222542, 296274, 314708, 318804, 283990, 314711, 357720, 300378, 300379, 316764, 294236, 314721, 292194, 230757, 281958, 314727, 134504, 306541, 314734, 284015, 234864, 312688, 316786, 296304, 314740, 230772, 314742, 327030, 327023, 314745, 290170, 310650, 224637, 306558, 243073, 294278, 314759, 296328, 296330, 298378, 368012, 314765, 292242, 279955, 306580, 314771, 112019, 224662, 282008, 314776, 234902, 318876, 282013, 148899, 314788, 314790, 282023, 333224, 298406, 245160, 241067, 279980, 314797, 279979, 286128, 173492, 279988, 284086, 286133, 310714, 284090, 228796, 54719, 415170, 292291, 302530, 228804, 306630, 280003, 300488, 300490, 339403, 280011, 310731, 370122, 302539, 329168, 312785, 327122, 222674, 280020, 329170, 310735, 280025, 310747, 239069, 144862, 286176, 320997, 310758, 187877, 280042, 280043, 191980, 300526, 329198, 337391, 282097, 308722, 296434, 306678, 40439, 191991, 288248, 286201, 300539, 288252, 312830, 290304, 245249, 228868, 292359, 323079, 218632, 230922, 302602, 323083, 294413, 329231, 304655, 323088, 282132, 230933, 302613, 316951, 282135, 374297, 302620, 313338, 222754, 245291, 312879, 230960, 288305, 239159, 290359, 323132, 235069, 157246, 288319, 288322, 280131, 349764, 310853, 124486, 194118, 282182, 286281, 292426, 288328, 333389, 224848, 224852, 290391, 196184, 239192, 306777, 128600, 235096, 212574, 99937, 204386, 323171, 345697, 300645, 282214, 300643, 204394, 312941, 206447, 310896, 294517, 314997, 288377, 290425, 325246, 333438, 235136, 280193, 282244, 239238, 288391, 323208, 282248, 286344, 179853, 286351, 188049, 239251, 229011, 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, 323265, 321217, 296636, 333508, 321220, 282309, 296649, 239305, 306891, 212684, 280266, 302798, 9935, 241360, 282321, 333522, 286419, 313042, 241366, 280279, 282330, 18139, 280285, 294621, 282336, 325345, 321250, 294629, 153318, 333543, 181992, 12009, 337638, 282347, 288492, 282349, 323315, 67316, 286457, 284410, 288508, 282366, 286463, 319232, 288515, 280326, 282375, 323335, 284425, 300810, 116491, 216844, 280333, 300812, 284430, 282379, 161553, 124691, 278292, 118549, 278294, 282390, 116502, 284436, 325403, 321308, 321309, 282399, 241440, 282401, 325411, 186148, 186149, 315172, 241447, 333609, 294699, 286507, 284460, 280367, 300849, 282418, 280373, 282424, 280377, 321338, 282428, 280381, 345918, 241471, 413500, 280386, 325444, 280391, 153416, 325449, 315209, 159563, 280396, 307024, 337746, 317268, 325460, 307030, 237397, 18263, 241494, 188250, 284508, 300893, 307038, 237411, 284515, 276326, 282471, 296807, 292713, 282476, 292719, 296815, 313200, 325491, 313204, 333687, 317305, 124795, 317308, 339840, 182145, 315265, 280451, 325508, 333700, 243590, 282503, 67464, 243592, 305032, 188293, 315272, 315275, 325514, 184207, 311183, 282517, 294806, 214936, 337816, 294808, 329627, 239515, 214943, 298912, 319393, 333727, 294820, 219046, 333734, 294824, 298921, 284584, 313257, 292783, 126896, 200628, 300983, 343993, 288698, 294849, 214978, 280517, 280518, 214983, 282572, 282573, 153553, 24531, 231382, 329696, 323554, 292835, 6116, 190437, 292838, 294887, 317416, 313322, 278507, 329707, 311277, 296942, 298987, 124912, 327666, 278515, 325620, 239610 ]
c4ff1df7aac6c069bafea31875d1f65f039847b6
91cd31689b90d2ec7e07b64f228ef95138954e5f
/NewsApp Project/NewsApp/NewsApp/Model/NewsCode.swift
c0e77e294a910e855d0fe53857aea9cb4a8d4776
[]
no_license
rksaipujithreddy/NewsApp
4a54db4bc73400f1afb308251dffabda07265058
3b798d52623991c817062223bcdb6340d59a2230
refs/heads/main
2023-04-15T18:03:56.743903
2021-04-28T10:07:22
2021-04-28T10:07:22
362,421,042
0
0
null
null
null
null
UTF-8
Swift
false
false
712
swift
// // NewsCode.swift // NewsApp // // Created by Saipujith on 28/03/21. // import Foundation struct NewsCode : Codable { let status : String? let code : String? let message : String? enum CodingKeys: String, CodingKey { case status = "status" case code = "code" case message = "message" } init(from decoder: Decoder) throws { let values = try decoder.container(keyedBy: CodingKeys.self) status = try values.decodeIfPresent(String.self, forKey: .status) code = try values.decodeIfPresent(String.self, forKey: .code) message = try values.decodeIfPresent(String.self, forKey: .message) } }
[ -1 ]
a38ca4f32ef23c0a2321c42be308cb1f0c6d7b34
07e77db850528fc74ccd69f7dce059ab0eb3f585
/Sources/SwiftKueryORM/DatabaseDecoder.swift
867a5cb324e2f238d842660e23c64b6c1daed669
[ "Apache-2.0" ]
permissive
jaredanderton/Swift-Kuery-ORM
72d13ac7d42e12087a7b6dc5b044d7336c1feff4
afad5dd5a930d3c4fdd323697d561c6d5894a4d7
refs/heads/master
2020-04-17T03:00:58.391747
2019-01-25T01:03:30
2019-01-25T01:03:30
166,162,781
0
0
Apache-2.0
2019-01-17T04:57:10
2019-01-17T04:57:09
null
UTF-8
Swift
false
false
17,121
swift
/** Copyright IBM Corporation 2018 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 SwiftKuery import Foundation import KituraContracts /// Class used to construct a Model from a row in the database open class DatabaseDecoder { fileprivate let decoder = _DatabaseDecoder() /// Decode from a dictionary [String: Any] to a Decodable type open func decode<T : Decodable>(_ type: T.Type, _ values: [String : Any?]) throws -> T { decoder.values = values return try T(from: decoder) } fileprivate class _DatabaseDecoder : Decoder { public var codingPath: [CodingKey] public var userInfo: [CodingUserInfoKey:Any] = [:] public var values = [String:Any?]() fileprivate init(at codingPath: [CodingKey] = []){ self.codingPath = codingPath } public func container<Key>(keyedBy type: Key.Type) throws -> KeyedDecodingContainer<Key> { return KeyedDecodingContainer<Key>(_DatabaseKeyedDecodingContainer<Key>(decoder: self, codingPath: self.codingPath)) } public func unkeyedContainer() throws -> UnkeyedDecodingContainer { return _UnKeyedDecodingContainer(decoder: self) } public func singleValueContainer() throws -> SingleValueDecodingContainer { return _SingleValueDecodingContainer(decoder: self) } } fileprivate struct _DatabaseKeyedDecodingContainer<K : CodingKey> : KeyedDecodingContainerProtocol { typealias Key = K private let decoder: _DatabaseDecoder private let container: [String : Any] = [:] public var codingPath: [CodingKey] fileprivate init(decoder: _DatabaseDecoder, codingPath: [CodingKey]){ self.decoder = decoder self.codingPath = codingPath } public var allKeys: [Key] { return [] } public func contains(_ key: Key) -> Bool { return false } public func decodeNil(forKey key: Key) throws -> Bool { return true } /// Check that value exists in the data return from the database private func checkValueExitence(_ key: Key) throws -> Any? { let keyName = key.stringValue guard let value = decoder.values[keyName] else { throw DecodingError.keyNotFound(key, DecodingError.Context( codingPath: [key], debugDescription: "No value for property with this key" )) } return value } /// Unwrap value from database private func unwrapValue(_ key: Key, _ value: Any?) throws -> Any? { guard let unwrappedValue = value as Any? else { throw DecodingError.valueNotFound(Any.self, DecodingError.Context( codingPath: [key], debugDescription: "Null value in table for non-optional property" )) } return unwrappedValue } /// Cast value from database to expect type in the model private func castedValue<T : Any>(_ value: Any?, _ type: T.Type, _ key: Key) throws -> T { guard let castedValue = value as? T else { throw DecodingError.typeMismatch(type, DecodingError.Context( codingPath: [key], debugDescription: "Could not cast " + String(describing: value) )) } return castedValue } /// Special case for integer, no integer type in database public func decode(_ type: Int.Type, forKey key: Key) throws -> Int { let unwrappedValue = try unwrapValue(key, checkValueExitence(key)) let returnValue: Int switch(unwrappedValue) { case let v as Int16: returnValue = Int(v) case let v as Int32: returnValue = Int(v) case let v as Int64: returnValue = Int(v) default: throw DecodingError.typeMismatch(type, DecodingError.Context( codingPath: [key], debugDescription: "Could not convert " + String(describing: unwrappedValue) )) } return returnValue } public func decode(_ type: Int8.Type, forKey key: Key) throws -> Int8 { let unwrappedValue = try unwrapValue(key, checkValueExitence(key)) return try castedValue(unwrappedValue, type, key) } public func decode(_ type: Int16.Type, forKey key: Key) throws -> Int16 { let unwrappedValue = try unwrapValue(key, checkValueExitence(key)) return try castedValue(unwrappedValue, type, key) } public func decode(_ type: Int32.Type, forKey key: Key) throws -> Int32 { let unwrappedValue = try unwrapValue(key, checkValueExitence(key)) return try castedValue(unwrappedValue, type, key) } public func decode(_ type: Int64.Type, forKey key: Key) throws -> Int64 { let unwrappedValue = try unwrapValue(key, checkValueExitence(key)) return try castedValue(unwrappedValue, type, key) } public func decode(_ type: UInt.Type, forKey key: Key) throws -> UInt { let unwrappedValue = try unwrapValue(key, checkValueExitence(key)) return try castedValue(unwrappedValue, type, key) } public func decode(_ type: UInt8.Type, forKey key: Key) throws -> UInt8 { let unwrappedValue = try unwrapValue(key, checkValueExitence(key)) return try castedValue(unwrappedValue, type, key) } public func decode(_ type: UInt16.Type, forKey key: Key) throws -> UInt16 { let unwrappedValue = try unwrapValue(key, checkValueExitence(key)) return try castedValue(unwrappedValue, type, key) } public func decode(_ type: UInt32.Type, forKey key: Key) throws -> UInt32 { let unwrappedValue = try unwrapValue(key, checkValueExitence(key)) return try castedValue(unwrappedValue, type, key) } public func decode(_ type: UInt64.Type, forKey key: Key) throws -> UInt64 { let unwrappedValue = try unwrapValue(key, checkValueExitence(key)) return try castedValue(unwrappedValue, type, key) } public func decode(_ type: Double.Type, forKey key: Key) throws -> Double { let unwrappedValue = try unwrapValue(key, checkValueExitence(key)) return try castedValue(unwrappedValue, type, key) } public func decode(_ type: Float.Type, forKey key: Key) throws -> Float { let unwrappedValue = try unwrapValue(key, checkValueExitence(key)) return try castedValue(unwrappedValue, type, key) } public func decode(_ type: String.Type, forKey key: Key) throws -> String { let unwrappedValue = try unwrapValue(key, checkValueExitence(key)) return try castedValue(unwrappedValue, type, key) } public func decode(_ type: Bool.Type, forKey key: Key) throws -> Bool { let unwrappedValue = try unwrapValue(key, checkValueExitence(key)) return try castedValue(unwrappedValue, type, key) } public func decode<T : Decodable>(_ type: T.Type, forKey key: Key) throws -> T { let value = try checkValueExitence(key) if type is Data.Type && value != nil { let castValue = try castedValue(value, String.self, key) guard let data = Data(base64Encoded: castValue) else { throw RequestError(.ormCodableDecodingError, reason: "Error decoding value of Data Type for Key: \(String(describing: key)) , value: \(String(describing: value)) is not base64encoded") } return try castedValue(data, type, key) } else if type is URL.Type && value != nil { let castValue = try castedValue(value, String.self, key) let url = URL(string: castValue) return try castedValue(url, type, key) } else if type is UUID.Type && value != nil { let castValue = try castedValue(value, String.self, key) let uuid = UUID(uuidString: castValue) return try castedValue(uuid, type, key) } else if type is Date.Type && value != nil { let castValue = try castedValue(value, Date.self, key) return try castedValue(castValue, type, key) } else { throw RequestError(.ormDatabaseDecodingError, reason: "Unsupported type: \(String(describing: type)) for value: \(String(describing: value))") } } public func decodeIfPresent(_ type: Int.Type, forKey key: Key) throws -> Int? { let value = try checkValueExitence(key) if value == nil { return nil} let returnValue: Int switch(value){ case let v as Int16: returnValue = Int(v) case let v as Int32: returnValue = Int(v) case let v as Int64: returnValue = Int(v) default: throw DecodingError.typeMismatch(type, DecodingError.Context( codingPath: [key], debugDescription: "Could not convert " + String(describing: value) )) } return returnValue } public func decodeIfPresent(_ type: Int8.Type, forKey key: Key) throws -> Int8? { let value = try checkValueExitence(key) if value == nil {return nil} return try castedValue(value, type, key) } public func decodeIfPresent(_ type: Int16.Type, forKey key: Key) throws -> Int16? { let value = try checkValueExitence(key) if value == nil {return nil} return try castedValue(value, type, key) } public func decodeIfPresent(_ type: Int32.Type, forKey key: Key) throws -> Int32? { let value = try checkValueExitence(key) if value == nil {return nil} return try castedValue(value, type, key) } public func decodeIfPresent(_ type: Int64.Type, forKey key: Key) throws -> Int64? { let value = try checkValueExitence(key) if value == nil {return nil} return try castedValue(value, type, key) } public func decodeIfPresent(_ type: UInt.Type, forKey key: Key) throws -> UInt? { let value = try checkValueExitence(key) if value == nil {return nil} return try castedValue(value, type, key) } public func decodeIfPresent(_ type: UInt8.Type, forKey key: Key) throws -> UInt8? { let value = try checkValueExitence(key) if value == nil {return nil} return try castedValue(value, type, key) } public func decodeIfPresent(_ type: UInt16.Type, forKey key: Key) throws -> UInt16? { let value = try checkValueExitence(key) if value == nil {return nil} return try castedValue(value, type, key) } public func decodeIfPresent(_ type: UInt32.Type, forKey key: Key) throws -> UInt32? { let value = try checkValueExitence(key) if value == nil {return nil} return try castedValue(value, type, key) } public func decodeIfPresent(_ type: UInt64.Type, forKey key: Key) throws -> UInt64? { let value = try checkValueExitence(key) if value == nil {return nil} return try castedValue(value, type, key) } public func decodeIfPresent(_ type: Double.Type, forKey key: Key) throws -> Double? { let value = try checkValueExitence(key) if value == nil {return nil} return try castedValue(value, type, key) } public func decodeIfPresent(_ type: Float.Type, forKey key: Key) throws -> Float? { let value = try checkValueExitence(key) if value == nil {return nil} return try castedValue(value, type, key) } public func decodeIfPresent(_ type: String.Type, forKey key: Key) throws -> String? { let value = try checkValueExitence(key) if value == nil {return nil} return try castedValue(value, type, key) } public func decodeIfPresent(_ type: Bool.Type, forKey key: Key) throws -> Bool? { let value = try checkValueExitence(key) if value == nil {return nil} return try castedValue(value, type, key) } public func decodeIfPresent<T : Decodable>(_ type: T.Type, forKey key: Key) throws -> T? { let value = try checkValueExitence(key) if value == nil {return nil} if type is Data.Type { let castValue = try castedValue(value, String.self, key) guard let data = Data(base64Encoded: castValue) else { throw RequestError(.ormCodableDecodingError, reason: "Error decoding value of Data Type for Key: \(String(describing: key)) , value: \(String(describing: value)) is not base64encoded") } return data as? T } else if type is URL.Type { let castValue = try castedValue(value, String.self, key) let url = URL(string: castValue) return try castedValue(url, type, key) } else if type is UUID.Type { let castValue = try castedValue(value, String.self, key) let uuid = UUID(uuidString: castValue) return try castedValue(uuid, type, key) } else if type is Date.Type { let castValue = try castedValue(value, Double.self, key) let date = Date(timeIntervalSinceReferenceDate: castValue) return try castedValue(date, type, key) } else { throw RequestError(.ormDatabaseDecodingError, reason: "Unsupported type: \(String(describing: type)) for value: \(String(describing: value))") } } public func nestedContainer<NestedKey>(keyedBy: NestedKey.Type, forKey: Key) throws -> KeyedDecodingContainer<NestedKey> { return KeyedDecodingContainer<NestedKey>(_DatabaseKeyedDecodingContainer<NestedKey>(decoder: decoder, codingPath: codingPath)) } public func nestedUnkeyedContainer(forKey: Key) throws -> UnkeyedDecodingContainer { return _UnKeyedDecodingContainer(decoder: decoder) } public func superDecoder() throws -> Decoder { return decoder } public func superDecoder(forKey: Key) throws -> Decoder { return decoder } } fileprivate class _SingleValueDecodingContainer : SingleValueDecodingContainer { var codingPath: [CodingKey] { return [] } var decoder: _DatabaseDecoder fileprivate init(decoder: _DatabaseDecoder){ self.decoder = decoder } public func decodeNil() -> Bool { return true } public func decode<T: Decodable>(_ type: T.Type) throws -> T { let child = _DatabaseDecoder() let result = try T(from: child) return result } } fileprivate class _UnKeyedDecodingContainer: UnkeyedDecodingContainer { var codingPath: [CodingKey] { return decoder.codingPath } public var count: Int? { return 1 } var isAtEnd: Bool = true public var currentIndex: Int = 0 private let decoder: _DatabaseDecoder fileprivate init(decoder: _DatabaseDecoder){ self.decoder = decoder } public func decodeNil() -> Bool { return true } public func decode<T: Decodable>(_ type: T.Type) throws -> T { return try T(from: decoder) } public func nestedContainer<NestedKey>(keyedBy: NestedKey.Type) throws -> KeyedDecodingContainer<NestedKey> { return KeyedDecodingContainer<NestedKey>(_DatabaseKeyedDecodingContainer<NestedKey>(decoder: decoder, codingPath: codingPath)) } public func nestedUnkeyedContainer() throws -> UnkeyedDecodingContainer { return self } public func superDecoder() throws -> Decoder { return decoder } } }
[ -1 ]
b57ff505c7afafc14df771b103901b265af77743
4c996fac2410a222b2e50b85a2a9ae143b9cca84
/Masari/Controller/MainVCs/Home/Sports/Basket _ ball/Today/BasketballTodayMatchVC.swift
6b8f53a65acd8ba1cf70d982bf3335ee7f79e46c
[]
no_license
hamzashahbaz0714/Masari_iOS_App
c5e968325ef917f26d184d7257013d7042458383
b27262e957bab684d5ba941b2d7382cb1f4722cd
refs/heads/main
2023-05-03T04:16:32.999649
2021-05-18T12:18:53
2021-05-18T12:18:53
null
0
0
null
null
null
null
UTF-8
Swift
false
false
3,729
swift
// // BasketballViewController.swift // Masari // // Created by Hamza Shahbaz on 04/05/2021. // import UIKit class BasketballTodayMatchVC: UIViewController { //MARK:- Properties @IBOutlet weak var tableView: UITableView! @IBOutlet weak var noDataSatck: UIStackView! var basket: BasketballModel? //MARK:- Controller Life Cycle override func viewDidLoad() { super.viewDidLoad() ConfigureCell(tableView: tableView, collectionView: nil, nibName: "FootballCell", reuseIdentifier: "FootballCell", cellType: .tblView) } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) getMatch() } //MARK:- Supporting Functions func getMatch(){ showLoader() BasketballManager.instance.getBasketBallTodayMatch {[weak self] (success, baseball, error) in if success { self?.hideLoader() if baseball?.response?.count == 0 { self?.noDataSatck.isHidden = false } else { self?.basket = baseball self?.noDataSatck.isHidden = true DispatchQueue.main.async { self?.tableView.reloadData() } } } else { self?.hideLoader() Alert.showMsg(msg: error?.localizedDescription ?? "") } } } @objc func handleBetNoWTapped(sender: UIButton) { let betPopUp = PopUpBet() betPopUp.modalPresentationStyle = .overFullScreen betPopUp.modalTransitionStyle = .crossDissolve self.present(betPopUp, animated: true, completion: nil) } } extension BasketballTodayMatchVC: UITableViewDelegate, UITableViewDataSource { func numberOfSections(in tableView: UITableView) -> Int { return 1 } func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return basket?.response?.count ?? 0 } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "FootballCell", for: indexPath) as! FootballCell let data = basket?.response cell.team1ImgView.sd_setImage(with: URL(string: data?[indexPath.row].teams?.home?.logo ?? ""), placeholderImage: placeHolderLeage, options: .forceTransition, context: nil) cell.team2ImgView.sd_setImage(with: URL(string: data?[indexPath.row].teams?.away?.logo ?? ""), placeholderImage: placeHolderLeage, options: .forceTransition, context: nil) cell.LblTeam1.text = data?[indexPath.row].teams?.home?.name cell.LblTeam2.text = data?[indexPath.row].teams?.away?.name cell.btnBetNow.addTarget(self, action: #selector(handleBetNoWTapped(sender:)), for: .touchUpInside) cell.btnBetNow.tag = indexPath.row if data?[indexPath.row].status?.long == "Game Finished" || data?[indexPath.row].status?.long == "Not Started" || data?[indexPath.row].status?.long == "Game Postponed"{ cell.lblRemainingTime.text = data?[indexPath.row].status?.long cell.betNowView.isHidden = true } else { cell.betNowView.isHidden = false cell.lblRemainingTime.text = data?[indexPath.row].time cell.lblScore.text = data?[indexPath.row].status?.long } return cell } func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { return 220 } }
[ -1 ]
c60ae7734a436f691e6c10e25802f3abc9df80df
c7c7db4972405035a246f576dfcc214a6cb65120
/Swift/676.实现一个魔法字典.swift
a1f4342f9490a488f8405d35dd276c93aca11663
[]
no_license
kwdx/LeetCode-Practise
9bc9a06c8f74f14ca03723f45b26b737d7345682
f10b42a7568136d592398e31d264b83bad8da9ee
refs/heads/master
2023-02-22T13:29:40.569907
2023-02-21T14:31:48
2023-02-21T14:31:48
224,830,532
0
1
null
null
null
null
UTF-8
Swift
false
false
2,221
swift
/* * @lc app=leetcode.cn id=676 lang=swift * * [676] 实现一个魔法字典 */ // @lc code=start class MagicDictionary { private var dict: [Int: [String]] = [:] init() { } func buildDict(_ dictionary: [String]) { for word in dictionary { if dict[word.count] == nil { dict[word.count] = [] } dict[word.count]?.append(word) } } func search(_ searchWord: String) -> Bool { guard let words = dict[searchWord.count] else { return false } let searches = Array(searchWord) for word in words { var diff = 0 let chars = Array(word) for i in 0..<chars.count { if chars[i] == searches[i] { continue } diff += 1 } if diff == 1 { return true } } return false } } /** * Your MagicDictionary object will be instantiated and called as such: * let obj = MagicDictionary() * obj.buildDict(dictionary) * let ret_2: Bool = obj.search(searchWord) */ // @lc code=end func main() { /** 输入 ["MagicDictionary", "buildDict", "search", "search", "search", "search"] [[], [["hello", "leetcode"]], ["hello"], ["hhllo"], ["hell"], ["leetcoded"]] 输出 [null, null, false, true, false, false] 解释 MagicDictionary magicDictionary = new MagicDictionary(); magicDictionary.buildDict(["hello", "leetcode"]); magicDictionary.search("hello"); // 返回 False magicDictionary.search("hhllo"); // 将第二个 'h' 替换为 'e' 可以匹配 "hello" ,所以返回 True magicDictionary.search("hell"); // 返回 False magicDictionary.search("leetcoded"); // 返回 False */ let obj = MagicDictionary() obj.buildDict(["hello", "leetcode"]) assert(false == obj.search("hello")) // 返回 False assert(true == obj.search("hhllo")) // 将第二个 'h' 替换为 'e' 可以匹配 "hello" ,所以返回 True assert(false == obj.search("hell")) // 返回 False assert(false == obj.search("leetcoded")) // 返回 False }
[ -1 ]
acd340ec9702fcd1187009c9027971a616983ff5
7af576910f49609324328d2250777248c1cf6429
/ios_client4/kdweibo_xuntong/xuntong/View/Chat/KDChatNotraceMaskView.swift
9599ea6a18518fc582953875de1621bb3fe5e244
[]
no_license
sengeiou/zhonghai
c14213b17f65570fb5ba70ebd544b3bf52bf8e85
534c3854303466c69351d9372a434835b2b70307
refs/heads/master
2022-12-08T05:53:54.341723
2020-09-07T03:32:43
2020-09-07T03:32:43
293,458,930
1
0
null
2020-09-07T07:50:27
2020-09-07T07:50:26
null
UTF-8
Swift
false
false
947
swift
// // KDChatNotraceMaskView.swift // kdweibo // // Created by Darren Zheng on 16/4/1. // Copyright © 2016年 www.kingdee.com. All rights reserved. // final class KDChatNotraceMaskView: UIView { lazy var imageView: UIImageView = { let imageView = UIImageView() imageView.image = UIImage(named:"message_bg_traceless_popup") return imageView }() override init(frame: CGRect) { super.init(frame: frame) backgroundColor = KDCOLOR_POPUP addSubview(imageView) imageView.mas_makeConstraints { make in make?.centerX.equalTo()(self.imageView.superview!.centerX) make?.centerY.equalTo()(self.imageView.superview!.centerY) return() } } override func draw(_ rect: CGRect) { super.draw(rect) } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } }
[ -1 ]
8a35bc234328ed94d37287eadec4fa7b834144e9
d4029fdf72b4421338a61d3295742e2b7a8646cf
/BrnFinal/Practice/autolayoutsPractice/autolayoutsPractice/AppDelegate.swift
736bd105b3addc47224e43e92baf1421431a1c6c
[]
no_license
varalakshmi-iOS/lucky-projects
788bbdd85f50b2b09a979cf0c5c3c24a54d6b7c3
33f1ed5e8570ec1eb014d948f835d082ba7fdfe9
refs/heads/master
2020-12-21T02:19:11.067711
2020-01-26T07:07:51
2020-01-26T07:07:51
236,276,745
0
0
null
2020-01-26T06:53:52
2020-01-26T06:38:33
null
UTF-8
Swift
false
false
2,203
swift
// // AppDelegate.swift // autolayoutsPractice // // Created by Varalakshmi Kacherla on 11/16/19. // Copyright © 2019 Varalakshmi Kacherla. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } func applicationWillResignActive(_ application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. } func applicationDidEnterBackground(_ application: UIApplication) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } func applicationWillEnterForeground(_ application: UIApplication) { // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. } func applicationDidBecomeActive(_ application: UIApplication) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } }
[ 229380, 229383, 229385, 229388, 294924, 278542, 229391, 327695, 278545, 229394, 278548, 229397, 229399, 229402, 278556, 229405, 278559, 229408, 278564, 294950, 229415, 229417, 327722, 237613, 229422, 360496, 229426, 237618, 229428, 286774, 319544, 204856, 229432, 286776, 286778, 286791, 237640, 278605, 286797, 311375, 163920, 237646, 196692, 319573, 311383, 319590, 311400, 278635, 303212, 278639, 131192, 278648, 237693, 327814, 131209, 303241, 417930, 303244, 311436, 319633, 286873, 286876, 311460, 311469, 32944, 327862, 286906, 327866, 180413, 286910, 131264, 286916, 295110, 286922, 286924, 286926, 319694, 286928, 131281, 278743, 278747, 295133, 155872, 319716, 237807, 303345, 286962, 131314, 229622, 327930, 278781, 278783, 278785, 237826, 319751, 278792, 286987, 319757, 311569, 286999, 319770, 287003, 287006, 287009, 287012, 287014, 287016, 287019, 311598, 287023, 262448, 311601, 287032, 155966, 319809, 319810, 278849, 319814, 311623, 319818, 311628, 229709, 319822, 287054, 278865, 229717, 196963, 196969, 139638, 213367, 106872, 319872, 311683, 319879, 311693, 65943, 319898, 311719, 278952, 139689, 278957, 311728, 278967, 180668, 311741, 278975, 319938, 278980, 98756, 278983, 319945, 278986, 319947, 278990, 278994, 311767, 279003, 279006, 188895, 172512, 287202, 279010, 279015, 172520, 319978, 279020, 172526, 311791, 279023, 172529, 279027, 319989, 180727, 164343, 279035, 311804, 287230, 279040, 303617, 287234, 279045, 172550, 303623, 320007, 287238, 172552, 279051, 172558, 279055, 303632, 279058, 303637, 279063, 279067, 172572, 279072, 172577, 295459, 172581, 295461, 279082, 311850, 279084, 172591, 172598, 279095, 172607, 172609, 172612, 377413, 172614, 172618, 303690, 33357, 287309, 303696, 279124, 172634, 262752, 172644, 311911, 189034, 295533, 172655, 172656, 352880, 189039, 295538, 172660, 189040, 189044, 287349, 287355, 287360, 295553, 295557, 311942, 303751, 287365, 352905, 311946, 279178, 287371, 311951, 287377, 287381, 311957, 221850, 287386, 230045, 287390, 303773, 164509, 172705, 287394, 172707, 303780, 295583, 287398, 172702, 279208, 287400, 172714, 295595, 279212, 189102, 172721, 287409, 66227, 303797, 189114, 287419, 303804, 328381, 287423, 328384, 279231, 287427, 312005, 312006, 107208, 107212, 172748, 287436, 172751, 287440, 295633, 172755, 303827, 279255, 172760, 287450, 303835, 279258, 189149, 303838, 213724, 279267, 312035, 295654, 279272, 312048, 230128, 312050, 230131, 205564, 303871, 230146, 328453, 295685, 230154, 33548, 312077, 295695, 295701, 230169, 369433, 295707, 328476, 295710, 230175, 303914, 279340, 205613, 279353, 230202, 312124, 328508, 222018, 295755, 377676, 148302, 287569, 303959, 230237, 279390, 230241, 279394, 303976, 336744, 303985, 303987, 328563, 279413, 303991, 303997, 295806, 295808, 304005, 295813, 304007, 320391, 213895, 304009, 304011, 230284, 304013, 279438, 295822, 189329, 295825, 189331, 304019, 58262, 304023, 279452, 234648, 410526, 279461, 279462, 304042, 213931, 304055, 230327, 287675, 304063, 238528, 304065, 213954, 189378, 156612, 295873, 213963, 312272, 304084, 304090, 320481, 304106, 320490, 312302, 328687, 320496, 304114, 295928, 320505, 312321, 295945, 295949, 230413, 197645, 320528, 140312, 295961, 238620, 197663, 304164, 304170, 238641, 312374, 238652, 238655, 230465, 238658, 296004, 132165, 336964, 205895, 320584, 238666, 296021, 402518, 336987, 230497, 296036, 361576, 296040, 205931, 296044, 279661, 205934, 164973, 312432, 279669, 337018, 189562, 279679, 279683, 222340, 205968, 296084, 238745, 304285, 238756, 205991, 222377, 165035, 337067, 165038, 238766, 230576, 238770, 304311, 230592, 312518, 279750, 230600, 230607, 148690, 320727, 279769, 304348, 279777, 304354, 296163, 320740, 279781, 304360, 320748, 279788, 279790, 304370, 296189, 320771, 312585, 296202, 296205, 230674, 320786, 230677, 296213, 296215, 320792, 230681, 230679, 214294, 304416, 230689, 173350, 312622, 296243, 312630, 222522, 296253, 222525, 296255, 312639, 230718, 296259, 378181, 296262, 230727, 296264, 238919, 320840, 296267, 296271, 222545, 230739, 312663, 337244, 222556, 230752, 312676, 230760, 173418, 410987, 230763, 148843, 230768, 296305, 312692, 230773, 304505, 181626, 304506, 181631, 312711, 312712, 296331, 288140, 288144, 230800, 304533, 337306, 288154, 288160, 173472, 288162, 288164, 279975, 304555, 370092, 279983, 173488, 288176, 279985, 312755, 296373, 312759, 337335, 288185, 279991, 222652, 312766, 173507, 296389, 222665, 230860, 312783, 288208, 230865, 288210, 370130, 288212, 148946, 222676, 288214, 239064, 329177, 288217, 280027, 288220, 288218, 239070, 288224, 280034, 288226, 280036, 288229, 280038, 288230, 288232, 370146, 320998, 288234, 288236, 288238, 288240, 288242, 296435, 288244, 288250, 148990, 321022, 206336, 402942, 296450, 296446, 230916, 230919, 214535, 304651, 370187, 304653, 230923, 230940, 222752, 108066, 296486, 296488, 157229, 239152, 230961, 157236, 288320, 288325, 124489, 280140, 280145, 288338, 280149, 288344, 280152, 239194, 280158, 403039, 370272, 181854, 239202, 312938, 280183, 280185, 280188, 280191, 116354, 280194, 280208, 280211, 288408, 280218, 280222, 190118, 321195, 296622, 321200, 337585, 296626, 296634, 296637, 313027, 280260, 206536, 280264, 206539, 206541, 206543, 280276, 313044, 321239, 280283, 18140, 313052, 288478, 313055, 321252, 313066, 280302, 288494, 280304, 313073, 419570, 288499, 321266, 288502, 280314, 288510, 124671, 67330, 280324, 198405, 288519, 280331, 198416, 280337, 296723, 116503, 321304, 329498, 296731, 321311, 313121, 313123, 304932, 321316, 280363, 141101, 165678, 280375, 321336, 296767, 288576, 345921, 280388, 337732, 304968, 280393, 280402, 173907, 313176, 280419, 321381, 296809, 296812, 313201, 1920, 255873, 305028, 280454, 247688, 280464, 124817, 280468, 239510, 280473, 124827, 214940, 247709, 214944, 280487, 313258, 321458, 296883, 124853, 214966, 10170, 296890, 288700, 296894, 190403, 296900, 280515, 337862, 165831, 280521, 231379, 296921, 239586, 313320, 231404, 124913, 165876, 321528, 313340, 239612, 288764, 239617, 313347, 288773, 313358, 305176, 321560, 313371, 354338, 305191, 223273, 313386, 354348, 124978, 215090, 124980, 288824, 288826, 321595, 378941, 313406, 288831, 288836, 67654, 280651, 354382, 288848, 280658, 215123, 354390, 288855, 288859, 280669, 313438, 149599, 280671, 149601, 321634, 149603, 223327, 329830, 280681, 313451, 223341, 280687, 215154, 313458, 280691, 149618, 313464, 329850, 321659, 280702, 288895, 321670, 215175, 141446, 288909, 141455, 141459, 280725, 313498, 100520, 288936, 280747, 288940, 280755, 288947, 321717, 280759, 280764, 280769, 280771, 280774, 280776, 321740, 313548, 280783, 280786, 280788, 313557, 280793, 280796, 280798, 338147, 280804, 280807, 157930, 280811, 280817, 125171, 157940, 280819, 182517, 280823, 280825, 280827, 280830, 280831, 280833, 125187, 280835, 125191, 125207, 125209, 321817, 125218, 321842, 223539, 125239, 280888, 305464, 280891, 289087, 280897, 280900, 239944, 305480, 280906, 239947, 305485, 305489, 379218, 280919, 354653, 354656, 313700, 313705, 280937, 190832, 280946, 223606, 313720, 280956, 239997, 280959, 313731, 240011, 199051, 289166, 240017, 297363, 190868, 297365, 240021, 297368, 297372, 141725, 297377, 289186, 297391, 289201, 240052, 289207, 305594, 289210, 281024, 289218, 289221, 289227, 281045, 281047, 215526, 166378, 305647, 281075, 174580, 240124, 281084, 305662, 305664, 240129, 305666, 305668, 223749, 240132, 281095, 223752, 338440, 150025, 330244, 223757, 281102, 223763, 223765, 281113, 322074, 281116, 281121, 182819, 281127, 150066, 158262, 158266, 289342, 281154, 322115, 158283, 281163, 281179, 338528, 338532, 281190, 199273, 281196, 158317, 19053, 313973, 297594, 281210, 158347, 182926, 133776, 314003, 117398, 314007, 289436, 174754, 330404, 289448, 133801, 174764, 314029, 314033, 240309, 133817, 314045, 314047, 314051, 199364, 297671, 158409, 289493, 363234, 289513, 289522, 289525, 289532, 322303, 289537, 322310, 264969, 322314, 322318, 281361, 281372, 322341, 215850, 281388, 289593, 281401, 289601, 281410, 281413, 281414, 240458, 281420, 240468, 281430, 322393, 297818, 281435, 281438, 281442, 174955, 224110, 207733, 207737, 183172, 158596, 338823, 322440, 314249, 240519, 183184, 142226, 240535, 289687, 297883, 289694, 289696, 289700, 289712, 281529, 289724, 52163, 183260, 281567, 289762, 322534, 297961, 183277, 281581, 322550, 134142, 322563, 330764, 175134, 322599, 322610, 314421, 281654, 314427, 314433, 207937, 314441, 207949, 322642, 314456, 281691, 314461, 281702, 281704, 314474, 281708, 281711, 289912, 248995, 306341, 306344, 306347, 322734, 306354, 142531, 199877, 289991, 306377, 289997, 249045, 363742, 363745, 298216, 330988, 126190, 216303, 322801, 388350, 257302, 363802, 199976, 199978, 314671, 298292, 298294, 257334, 216376, 298306, 380226, 224584, 224587, 224594, 216404, 306517, 150870, 314714, 224603, 159068, 314718, 265568, 314723, 281960, 150890, 306539, 314732, 314736, 290161, 216436, 306549, 298358, 314743, 306552, 306555, 314747, 298365, 290171, 290174, 224641, 281987, 314756, 298372, 281990, 224647, 265604, 298377, 314763, 142733, 298381, 314768, 224657, 306581, 314773, 314779, 314785, 314793, 282025, 282027, 241068, 241070, 241072, 282034, 241077, 150966, 298424, 306618, 282044, 323015, 306635, 306640, 290263, 290270, 290275, 339431, 282089, 191985, 282098, 290291, 282101, 241142, 191992, 290298, 151036, 290302, 282111, 290305, 175621, 192008, 323084, 257550, 290321, 282130, 323090, 282133, 290325, 241175, 290328, 282137, 290332, 241181, 282142, 282144, 290344, 306731, 290349, 290351, 290356, 28219, 282186, 224849, 282195, 282199, 282201, 306778, 159324, 159330, 314979, 298598, 323176, 224875, 241260, 323181, 257658, 315016, 282249, 290445, 282261, 175770, 298651, 323229, 282269, 298655, 323231, 61092, 282277, 306856, 196133, 282295, 323260, 282300, 323266, 282310, 323273, 282319, 306897, 241362, 306904, 282328, 298714, 52959, 216801, 282337, 241380, 216806, 323304, 282345, 12011, 282356, 323318, 282364, 282367, 306945, 241412, 323333, 282376, 216842, 323345, 282388, 323349, 282392, 184090, 315167, 315169, 282402, 315174, 323367, 241448, 315176, 241450, 282410, 306988, 306991, 315184, 323376, 315190, 241464, 159545, 282425, 298811, 307009, 413506, 241475, 307012, 298822, 315211, 282446, 307027, 315221, 323414, 315223, 241496, 241498, 307035, 307040, 110433, 282465, 241509, 110438, 298860, 110445, 282478, 315249, 110450, 315251, 282481, 315253, 315255, 339838, 315267, 282499, 315269, 241544, 282505, 241546, 241548, 298896, 298898, 282514, 241556, 298901, 44948, 241560, 282520, 241563, 241565, 241567, 241569, 282531, 241574, 282537, 298922, 36779, 241581, 282542, 241583, 323504, 241586, 282547, 241588, 290739, 241590, 241592, 241598, 290751, 241600, 241605, 151495, 241610, 298975, 241632, 298984, 241640, 241643, 298988, 241646, 241649, 241652, 323574, 290807, 241661, 299006, 282623, 315396, 241669, 315397, 282632, 307211, 282639, 290835, 282645, 241693, 282654, 241701, 102438, 217127, 282669, 323630, 282681, 290877, 282687, 159811, 315463, 315466, 192589, 307278, 192596, 176213, 307287, 315482, 315483, 217179, 192605, 233567, 200801, 299105, 217188, 299109, 307303, 315495, 356457, 307307, 45163, 315502, 192624, 307314, 323700, 299126, 233591, 299136, 307329, 307338, 233613, 241813, 307352, 299164, 184479, 299167, 184481, 315557, 184486, 307370, 307372, 184492, 307374, 307376, 299185, 323763, 176311, 299191, 307385, 307386, 258235, 307388, 176316, 307390, 184503, 299200, 184512, 307394, 307396, 299204, 184518, 307399, 323784, 307409, 307411, 176343, 299225, 233701, 307432, 184572, 282881, 184579, 282893, 291089, 282906, 291104, 233766, 176435, 307508, 315701, 332086, 307510, 307512, 168245, 307515, 307518, 282942, 282947, 323917, 110926, 282957, 233808, 323921, 315733, 323926, 233815, 315739, 323932, 299357, 242018, 242024, 299373, 315757, 250231, 242043, 315771, 299388, 299391, 291202, 299398, 242057, 291212, 299405, 291222, 315801, 283033, 242075, 291226, 291231, 61855, 283042, 291238, 291241, 127403, 127405, 127407, 291247, 299440, 299444, 127413, 283062, 291254, 127417, 291260, 283069, 127421, 127424, 299457, 127429, 127431, 315856, 176592, 127440, 315860, 176597, 283095, 127447, 299481, 127449, 176605, 242143, 127455, 291299, 340454, 127463, 242152, 291305, 127466, 176620, 127469, 127474, 291314, 291317, 135672, 127480, 233979, 291323, 127485, 291330, 127490, 283142, 127494, 135689, 233994, 127497, 127500, 291341, 233998, 127506, 234003, 127509, 234006, 127511, 152087, 283161, 242202, 234010, 135707, 135710, 242206, 242208, 291361, 242220, 291378, 152118, 234038, 234041, 315961, 70213, 242250, 111193, 242275, 299620, 242279, 168562, 184952, 135805, 135808, 291456, 373383, 299655, 135820, 316051, 225941, 316054, 299672, 135834, 373404, 299677, 225948, 135839, 299680, 225954, 135844, 299684, 242343, 209576, 242345, 373421, 135870, 135873, 135876, 135879, 299720, 299723, 225998, 299726, 226002, 119509, 226005, 226008, 242396, 299740, 201444, 299750, 283368, 234219, 283372, 226037, 283382, 316151, 234231, 234236, 226045, 242431, 234239, 209665, 234242, 299778, 242436, 226053, 234246, 226056, 234248, 291593, 242443, 234252, 242445, 234254, 291601, 242450, 234258, 242452, 234261, 348950, 201496, 234264, 234266, 234269, 283421, 234272, 234274, 152355, 234278, 299814, 283432, 234281, 234284, 234287, 283440, 185138, 242483, 234292, 234296, 234298, 160572, 283452, 234302, 234307, 242499, 234309, 316233, 234313, 316235, 234316, 283468, 242511, 234319, 234321, 234324, 201557, 185173, 234329, 234333, 308063, 234336, 234338, 349027, 242530, 234341, 234344, 234347, 177004, 234350, 324464, 234353, 152435, 177011, 234356, 234358, 234362, 234364, 291711, 234368, 234370, 201603, 291714, 234373, 316294, 226182, 234375, 308105, 226185, 234379, 291716, 234384, 234388, 234390, 324504, 234393, 209818, 308123, 324508, 226200, 291742, 234396, 234398, 234401, 291747, 291748, 234405, 291750, 234407, 324520, 324518, 234410, 291754, 291756, 324522, 226220, 324527, 291760, 234417, 201650, 324531, 234414, 234422, 226230, 324536, 275384, 234428, 291773, 234431, 242623, 324544, 324546, 226239, 324548, 234437, 226245, 234439, 234434, 234443, 291788, 234446, 275406, 193486, 234449, 316370, 193488, 234452, 234455, 234459, 234461, 234464, 234467, 234470, 168935, 5096, 324585, 234475, 234478, 316400, 234481, 316403, 234484, 234485, 324599, 234487, 234490, 234493, 234496, 316416, 234501, 308231, 234504, 234507, 234510, 234515, 300054, 234519, 316439, 234520, 234523, 234526, 234528, 300066, 234532, 300069, 234535, 234537, 234540, 144430, 234543, 234546, 275508, 234549, 300085, 300088, 234553, 234556, 234558, 316479, 234561, 308291, 316483, 160835, 234563, 234568, 234570, 316491, 300108, 234572, 234574, 300115, 234580, 234581, 242777, 234585, 275545, 234590, 234593, 234595, 300133, 234597, 234601, 300139, 234605, 160879, 234607, 275569, 234610, 316530, 300148, 234614, 398455, 144506, 234618, 275579, 234620, 234623, 226433, 234627, 275588, 234629, 242822, 234634, 234636, 177293, 234640, 275602, 234643, 308373, 226453, 234647, 275606, 275608, 234650, 308379, 324757, 234653, 300189, 119967, 324766, 324768, 234657, 283805, 242852, 234661, 283813, 300197, 234664, 275626, 234667, 316596, 308414, 300223, 234687, 300226, 308418, 283844, 300229, 308420, 308422, 226500, 234692, 283850, 300234, 300238, 300241, 316625, 300243, 300245, 316630, 300248, 300253, 300256, 300258, 300260, 234726, 300263, 300265, 300267, 161003, 300270, 300272, 120053, 300278, 316663, 275703, 300284, 275710, 300287, 300289, 292097, 161027, 300292, 300294, 275719, 300299, 177419, 242957, 283917, 300301, 177424, 275725, 349464, 283939, 259367, 292143, 283951, 300344, 226617, 243003, 283963, 226628, 283973, 300357, 177482, 283983, 316758, 357722, 316766, 316768, 292192, 218464, 292197, 316774, 243046, 218473, 284010, 324978, 136562, 275834, 333178, 275836, 275840, 316803, 316806, 226696, 316811, 226699, 316814, 226703, 300433, 234899, 226709, 357783, 316824, 316826, 144796, 300448, 144807, 144810, 144812, 284076, 144814, 144820, 284084, 374196, 284087, 292279, 144826, 144828, 144830, 144832, 144835, 144837, 38342, 144839, 144841, 144844, 144847, 144852, 144855, 103899, 300507, 333280, 218597, 292329, 300523, 259565, 300527, 308720, 259567, 226802, 292338, 316917, 292343, 308727, 300537, 316933, 316947, 308757, 308762, 284191, 316959, 284194, 284196, 235045, 284199, 284204, 284206, 284209, 284211, 284213, 194101, 284215, 316983, 194103, 284218, 226877, 284223, 284226, 284228, 292421, 226886, 284231, 128584, 243268, 284234, 366155, 317004, 276043, 284238, 226895, 284241, 292433, 284243, 300628, 284245, 194130, 284247, 317015, 235097, 243290, 276053, 284249, 284251, 300638, 284253, 284255, 243293, 284258, 292452, 292454, 284263, 177766, 284265, 292458, 284267, 292461, 284272, 284274, 276086, 284278, 292470, 292473, 284283, 276093, 284286, 292479, 284288, 292481, 284290, 325250, 284292, 292485, 325251, 276095, 276098, 284297, 317066, 284299, 317068, 276109, 284301, 284303, 284306, 276114, 284308, 284312, 284314, 284316, 276127, 284320, 284322, 284327, 284329, 317098, 284331, 276137, 284333, 284335, 276144, 284337, 284339, 300726, 284343, 284346, 284350, 358080, 276160, 284354, 358083, 276166, 284358, 358089, 284362, 276170, 276175, 284368, 276177, 284370, 358098, 284372, 317138, 284377, 276187, 284379, 284381, 284384, 358114, 284386, 358116, 276197, 317158, 358119, 284392, 325353, 358122, 284394, 284397, 358126, 276206, 358128, 284399, 358133, 358135, 276216, 358138, 300795, 358140, 284413, 358142, 358146, 317187, 284418, 317189, 317191, 284428, 300816, 300819, 317207, 284440, 300828, 300830, 276255, 325408, 300832, 300834, 317221, 227109, 358183, 186151, 276268, 300845, 243504, 300850, 284469, 276280, 325436, 358206, 276291, 366406, 276295, 300872, 153417, 292681, 284499, 276308, 284502, 317271, 178006, 276315, 292700, 284511, 227175, 292715, 300912, 284529, 292721, 300915, 284533, 292729, 317306, 284540, 292734, 325512, 169868, 276365, 358292, 284564, 317332, 284566, 350106, 284572, 276386, 284579, 276388, 358312, 284585, 317353, 276395, 292776, 292784, 276402, 358326, 161718, 276410, 276411, 358330, 276418, 276425, 301009, 301011, 301013, 292823, 301015, 301017, 358360, 292828, 276446, 153568, 276448, 276452, 292839, 276455, 292843, 276460, 292845, 276464, 178161, 227314, 276466, 325624, 276472, 317435, 276476, 276479, 276482, 276485, 317446, 276490, 292876, 317456, 276496, 317458, 243733, 243740, 317468, 317472, 325666, 243751, 292904, 276528, 243762, 309298, 325685, 325689, 235579, 325692, 235581, 178238, 276539, 276544, 284739, 243779, 292934, 243785, 276553, 350293, 350295, 309337, 194649, 227418, 350299, 350302, 227423, 194654, 178273, 309346, 194657, 309348, 350308, 309350, 227426, 309352, 350313, 309354, 301163, 350316, 194660, 227430, 276583, 276590, 350321, 284786, 276595, 301167, 350325, 227440, 350328, 292985, 301178, 350332, 292989, 301185, 292993, 350339, 317570, 317573, 350342, 350345, 350349, 301199, 317584, 325777, 350354, 350357, 350359, 350362, 350366, 276638, 284837, 153765, 350375, 350379, 350381, 350383, 129200, 350385, 350387, 350389, 350395, 350397, 350399, 227520, 350402, 227522, 301252, 350406, 227529, 309450, 301258, 276685, 309455, 276689, 309462, 301272, 276699, 309468, 194780, 309471, 301283, 317672, 317674, 325867, 243948, 194801, 227571, 309491, 309494, 243960, 276735, 227583, 227587, 276739, 211204, 276742, 227593, 227596, 325910, 309530, 342298, 211232, 317729, 276775, 211241, 325937, 325943, 211260, 260421, 276809, 285002, 276811, 235853, 276816, 235858, 276829, 276833, 391523, 276836, 276843, 293227, 276848, 293232, 186744, 211324, 227709, 285061, 317833, 178572, 285070, 285077, 178583, 227738, 317853, 276896, 317858, 342434, 285093, 317864, 285098, 276907, 235955, 276917, 293304, 293307, 293314, 309707, 293325, 317910, 293336, 235996, 317917, 293343, 358880, 276961, 227810, 293346, 276964, 293352, 236013, 293364, 301562, 317951, 309764, 301575, 121352, 236043, 317963, 342541, 55822, 113167, 309779, 317971, 309781, 277011, 55837, 227877, 227879, 293417, 227882, 309804, 293421, 105007, 236082, 285236, 23094, 277054, 244288, 129603, 318020, 301636, 301639, 301643, 277071, 285265, 399955, 309844, 277080, 309849, 285277, 285282, 326244, 318055, 277100, 309871, 121458, 277106, 170618, 170619, 309885, 309888, 277122, 227975, 277128, 285320, 301706, 318092, 326285, 334476, 318094, 277136, 277139, 227992, 334488, 318108, 285340, 318110, 227998, 137889, 383658, 285357, 318128, 277170, 342707, 318132, 154292, 293555, 277173, 285368, 277177, 277181, 318144, 277187, 277191, 277194, 277196, 277201, 137946, 113378, 203491, 228069, 277223, 342760, 285417, 56041, 56043, 277232, 228081, 56059, 310015, 285441, 310020, 285448, 310029, 228113, 285459, 277273, 293659, 326430, 228128, 293666, 285474, 228135, 318248, 277291, 318253, 293677, 285489, 301876, 293685, 285494, 301880, 285499, 301884, 310080, 293696, 277317, 277322, 277329, 162643, 310100, 301911, 277337, 301913, 301921, 400236, 236397, 162671, 326514, 310134, 15224, 236408, 277368, 416639, 416640, 113538, 310147, 416648, 39817, 187274, 277385, 301972, 424853, 277405, 277411, 310179, 293798, 293802, 236460, 277426, 276579, 293811, 293817, 293820, 203715, 326603, 276586, 293849, 293861, 228327, 228328, 228330, 318442, 228332, 326638, 277486, 318450, 293876, 293877, 285686, 302073, 285690, 293882, 244731, 121850, 302075, 293887, 277504, 277507, 277511, 277519, 293908, 293917, 293939, 318516, 277561, 277564, 310336, 7232, 293956, 277573, 228422, 310344, 277577, 293960, 277583, 203857, 310355, 293971, 310359, 236632, 277594, 138332, 277598, 203872, 277601, 285792, 310374, 203879, 310376, 228460, 318573, 203886, 187509, 285815, 285817, 367737, 302205, 285821, 392326, 285831, 253064, 302218, 285835, 294026, 384148, 162964, 187542, 302231, 285849, 302233, 285852, 302237, 285854, 285856, 302241, 285862, 277671, 302248, 64682, 277678, 294063, 294065, 302258, 277687, 294072, 318651, 294076, 277695, 318657, 244930, 302275, 130244, 302277, 228550, 302282, 310476, 302285, 302288, 310481, 302290, 203987, 302292, 302294, 302296, 384222, 310498, 285927, 318698, 302315, 195822, 228592, 294132, 138485, 228601, 204026, 228606, 204031, 64768, 310531, 285958, 138505, 228617, 318742, 204067, 277798, 130345, 277801, 113964, 285997, 277804, 285999, 277807, 113969, 277811, 318773, 318776, 277816, 286010, 277819, 294204, 417086, 277822, 286016, 302403, 294211, 384328, 277832, 277836, 294221, 326991, 294223, 277839, 277842, 277847, 277850, 179547, 277853, 146784, 277857, 302436, 277860, 294246, 327015, 310632, 327017, 351594, 277864, 277869, 277872, 351607, 310648, 277880, 310651, 277884, 277888, 310657, 310659, 351619, 294276, 327046, 277892, 253320, 310665, 318858, 277894, 277898, 277903, 310672, 351633, 277905, 277908, 277917, 310689, 277921, 130468, 228776, 277928, 277932, 310703, 277937, 310710, 130486, 310712, 277944, 310715, 277947, 302526, 228799, 277950, 277953, 302534, 245191, 310727, 64966, 163272, 277959, 292968, 302541, 277963, 302543, 277966, 310737, 277971, 228825, 163290, 277978, 310749, 277981, 277984, 310755, 277989, 277991, 187880, 277995, 310764, 286188, 278000, 228851, 310772, 278003, 278006, 40440, 212472, 278009, 40443, 286203, 310780, 40448, 228864, 286214, 228871, 302603, 65038, 302614, 302617, 286233, 302621, 286240, 146977, 187939, 40484, 294435, 40486, 286246, 40488, 278057, 294439, 40491, 294440, 294443, 294445, 310831, 245288, 286248, 40499, 40502, 212538, 40507, 40511, 40513, 228933, 40521, 286283, 40525, 40527, 400976, 212560, 228944, 40533, 147032, 40537, 40539, 40541, 278109, 40544, 40548, 40550, 40552, 286312, 40554, 286313, 310892, 40557, 40560, 188022, 122488, 294521, 343679, 294537, 310925, 286354, 278163, 302740, 122517, 278168, 179870, 327333, 229030, 212648, 278188, 302764, 278192, 319153, 278196, 319163, 302781, 319171, 302789, 294599, 278216, 302793, 294601, 343757, 212690, 278227, 286420, 319187, 229076, 286425, 319194, 278235, 278238, 229086, 286432, 294625, 294634, 302838, 319226, 286460, 278274, 302852, 278277, 302854, 311048, 294664, 352008, 319243, 311053, 302862, 319251, 294682, 278306, 188199, 294701, 319280, 278320, 319290, 229192, 302925, 188247, 280021, 188252, 237409, 229233, 294776, 360317, 294785, 327554, 40840, 40851, 294803, 188312, 294811, 319390, 40865, 319394, 294817, 294821, 311209, 180142, 343983, 294831, 188340, 40886, 319419, 294844, 294847, 237508, 393177, 294876, 294879, 294883, 294890, 311279, 278513, 237555, 311283, 278516, 278519, 237562 ]
9095a8db6213a9bea050a276867fee3912232683
a43b54475e55f1fb437adc5778a1dbb8facee32b
/Sources/OpenAPIDiff/ApiComparable.swift
fd025ef6729fde35405b5b881f383e9a3b9cde38
[ "MIT" ]
permissive
mattpolzin/OpenAPIDiff
ca66954a615a6f554b119e74738b2134b8ad4fd9
c92c6870b4a8505dd901ebb69e48c4d556c786a0
refs/heads/main
2023-01-28T09:29:05.726138
2023-01-14T05:08:50
2023-01-14T05:08:50
240,452,059
6
1
MIT
2023-01-14T05:08:51
2020-02-14T07:29:05
Swift
UTF-8
Swift
false
false
136
swift
import Foundation import OpenAPIKit public protocol ApiComparable { func compare(to other: Self, in context: String?) -> ApiDiff }
[ -1 ]
72ecc0dbd908600e871223a90d3a042ac386971a
8603b93e760c02857d12e0bb692493a71c4dc235
/PecodeTestTask/Settings.swift
2a4737b0eb5d46a788138f0a90831ea004ad099c
[]
no_license
ddanilyuk/PecodeTestTask
cee530c3598c86f66a1f765509714f6952984a0e
eb831c6dbdb65a03a0da306f869e743329883049
refs/heads/main
2022-12-22T01:09:13.162952
2020-09-06T12:06:40
2020-09-06T12:06:40
292,659,007
0
0
null
null
null
null
UTF-8
Swift
false
false
1,465
swift
// // Settings.swift // PecodeTestTask // // Created by Денис Данилюк on 05.09.2020. // import Foundation public class Settings { private var userDefaults = UserDefaults.standard static let shared = Settings() var isFirstLaunch: Bool { get { return userDefaults.bool(forKey: "isFirstLaunch2") } set { userDefaults.set(newValue, forKey: "isFirstLaunch2") } } var selectedFilter: Filter { get { let selectedFilterData = userDefaults.data(forKey: "selectedFilter") ?? Data() let filter = try? JSONDecoder().decode(Filter.self, from: selectedFilterData) return filter != nil ? filter! : Filter(category: .allCategories, country: .ua, sources: nil) } set { let selectedFilterData = try? JSONEncoder().encode(newValue) userDefaults.set(selectedFilterData, forKey: "selectedFilter") } } var allSources: [Source] { get { let selectedSourcesData = userDefaults.data(forKey: "allSources") ?? Data() let sources = try? JSONDecoder().decode([Source].self, from: selectedSourcesData) return sources != nil ? sources! : [] } set { let selectedSourcesData = try? JSONEncoder().encode(newValue) userDefaults.set(selectedSourcesData, forKey: "allSources") } } }
[ -1 ]
dd1ff3c284ca7647e9422e4e0fe2e03d5231f0e3
bb0ff544c73bcf92f3d296d7233ea7fafc7d12c9
/UPN/VIEW/DetailCampusTableViewCell.swift
9ca55518fc583b3f85e5e05e81df5d1b69656b40
[]
no_license
isalgithub/UPN
3e59a6373e14a18acd9d456ba09070c95092bc3f
0181686e8c589a5b933f898f1b305947aa4cd27b
refs/heads/master
2020-03-28T12:08:15.316308
2018-09-11T06:38:35
2018-09-11T06:38:35
148,272,119
0
0
null
null
null
null
UTF-8
Swift
false
false
504
swift
// // DetailCampusTableViewCell.swift // UPN // // Created by Faishal Alif on 8/18/18. // Copyright © 2018 Faishal Alif. All rights reserved. // import UIKit class DetailCampusTableViewCell: UITableViewCell { override func awakeFromNib() { super.awakeFromNib() // Initialization code } override func setSelected(_ selected: Bool, animated: Bool) { super.setSelected(selected, animated: animated) // Configure the view for the selected state } }
[ 172545, 384002, 206343, 241159, 241160, 283145, 418826, 287242, 34318, 34319, 34320, 372750, 372753, 372754, 307218, 398865, 328220, 328221, 366111, 345634, 345635, 356391, 278567, 305202, 292919, 310839, 289336, 123451, 66109, 332882, 215125, 115311, 115313, 213105, 222836, 213115, 403072, 259202, 131721, 230545, 123541, 139419, 131745, 131748, 148647, 300206, 327344, 313522, 64691, 166583, 313528, 313529, 313530, 313546, 239306, 278220, 278231, 290007, 291544, 131808, 131814, 131817, 375532, 228599, 298746, 228602, 283900, 322306, 307465, 298255, 225040, 161041, 298258, 245522, 312598, 320790, 320793, 67356, 336156, 123678, 336159, 336160, 336161, 336158, 123681, 336164, 349477, 293674, 287022, 110387, 282934, 399679, 200513, 300356, 157512, 302922, 380242, 200542, 350050, 317283, 37218, 179567, 317296, 112499, 258931, 317302, 177015, 177014, 244599, 244602, 233853, 233857, 277904, 320404, 317336, 337318, 337321, 311211, 337324, 258998, 281014, 155576, 300986, 306623, 306625, 306626, 306627, 317377, 317378, 317379, 201155, 180676, 311754, 311755, 311756, 311757, 311759, 430546, 430547, 358870, 289245, 346078, 317933, 167415, 310778, 305659, 196093, 201727 ]
214a8a80133f23e02437d437ea1f7fdfeeab7871
f8cb445aeccd2e0d635dd22e2ee74e0a1bcde1ba
/app-swoosh/Enum/ProffLevel.swift
2d95cddd9741f8aa8336c8dcde0ead0746947fc1
[]
no_license
RanaAhmedHamdy/app-swoosh
ef19bc4abde7df1f7d9aaf8f273d63f1b9d09a1f
c6c9b575498a6a544e81f92518d00b5c2457de3c
refs/heads/master
2021-08-26T08:36:03.993940
2017-11-22T15:18:02
2017-11-22T15:18:02
110,087,126
0
0
null
null
null
null
UTF-8
Swift
false
false
208
swift
// // ProffLevel.swift // app-swoosh // // Created by Hazem Mohamed Magdy on 11/22/17. // Copyright © 2017 Rana. All rights reserved. // import Foundation enum ProffLevel { case beginner, baller }
[ -1 ]
9c24e9fa3503543d1686b65c13fd8588d2e5aa64
b2566c1c65cf023e46a4ecc8114e8de396267a9d
/07Big Nerd Ranch/11TableViewEdit/Homepwner_Abel/Homepwner_Abel/item.swift
01be5a7456c729fe2e873698c551c1fb37e6d225
[]
no_license
greatabel/SwiftRepository
558e442cf0071aa287fef1a580e29c3c969327cf
7f0c76ccc5a2f25ac1ccf7744d5abdf7a75fb7b9
refs/heads/master
2021-04-18T23:38:06.225653
2020-12-04T15:55:59
2020-12-04T15:55:59
31,019,504
24
7
null
null
null
null
UTF-8
Swift
false
false
1,323
swift
import Foundation class Item: NSObject { var name: String var valueInDollars: Int var serialNumber: String? let dateCreated: Date init(name: String, serialNumber: String?, valueInDollars: Int) { self.name = name self.serialNumber = serialNumber self.valueInDollars = valueInDollars self.dateCreated = Date() super.init() } convenience init(random: Bool = false) { if random { let adjectives = ["Fluffy", "Rusty", "Shiny"] let nouns = ["Bear", "Spork", "Mac"] var idx = arc4random_uniform(UInt32(adjectives.count)) let randomAdjective = adjectives[Int(idx)] idx = arc4random_uniform(UInt32(nouns.count)) let randomNoun = nouns[Int(idx)] let randomName = "\(randomAdjective) \(randomNoun)" let randomValue = Int(arc4random_uniform(100)) print("randomValue: \(randomValue)") let randomSerialNumber = UUID().uuidString.components(separatedBy: "-").first! self.init(name: randomName, serialNumber: randomSerialNumber, valueInDollars: randomValue) } else { self.init(name: "", serialNumber: nil, valueInDollars: 0) } } }
[ 280745, 280740, 280686 ]
2bddfa2d0bd94c580b471b1654e0acb83eacaee3
9c8ea2a3d4a467f75edf9f10e0e6f2f0da9e7ee2
/CheersTests/CheersTests.swift
307ab038d97c5b3e15fa9cda15a34bd64bd56bd1
[]
no_license
usd-cs/comp495-sp18-happy-hour
fde977e87a6f664bb461d640967d75555806fe27
9087f66ebdfe01e837298e76ed0404cc607e4538
refs/heads/develop
2021-01-24T16:15:20.250541
2018-05-16T22:46:19
2018-05-16T22:46:19
123,179,011
3
2
null
2018-05-16T22:46:20
2018-02-27T19:42:23
Swift
UTF-8
Swift
false
false
969
swift
// // CheersTests.swift // CheersTests // // Created by Will on 3/6/18. // Copyright © 2018 University of San Diego. All rights reserved. // import XCTest @testable import Cheers class CheersTests: XCTestCase { override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. super.tearDown() } func testExample() { // This is an example of a functional test case. // Use XCTAssert and related functions to verify your tests produce the correct results. } func testPerformanceExample() { // This is an example of a performance test case. self.measure { // Put the code you want to measure the time of here. } } }
[ 282633, 313357, 182296, 241692, 98333, 16419, 229413, 102437, 354343, 292902, 354345, 278570, 204840, 223274, 233517, 344107, 309295, 229424, 282672, 124975, 253999, 237620, 346162, 229430, 319542, 124984, 358456, 288833, 288834, 352326, 311372, 354385, 196691, 315476, 280661, 329814, 278615, 338007, 354393, 307289, 200794, 315487, 237663, 45153, 309345, 280675, 280677, 313447, 278634, 315498, 319598, 288879, 352368, 299121, 284788, 233589, 280694, 131191, 333940, 237689, 215164, 313469, 215166, 278655, 292992, 333955, 280712, 215178, 311438, 241808, 323729, 325776, 317587, 278677, 284825, 284826, 278685, 346271, 311458, 278691, 49316, 233636, 333991, 333992, 284842, 323236, 32941, 278704, 239793, 299187, 278708, 125109, 131256, 182456, 280762, 223419, 184505, 299198, 379071, 280768, 299203, 227524, 309444, 301251, 338119, 280778, 282831, 321745, 254170, 280795, 227548, 311519, 356576, 280802, 338150, 176362, 286958, 125169, 338164, 327929, 184570, 243962, 125183, 309503, 125188, 313608, 125193, 375051, 278797, 180493, 125198, 325905, 254226, 125203, 125208, 325912, 282909, 299293, 278816, 237857, 125217, 211235, 217380, 233762, 211238, 305440, 151847, 282919, 125235, 332085, 280887, 125240, 332089, 278842, 282939, 315706, 287041, 260418, 241986, 311621, 332101, 182598, 323916, 319821, 254286, 348492, 250192, 6481, 323920, 344401, 348500, 366929, 155990, 366930, 379225, 6489, 272729, 323935, 106847, 391520, 321894, 416104, 280939, 242029, 246127, 285040, 242033, 354676, 139640, 246136, 246137, 291192, 311681, 362881, 248194, 225670, 395659, 227725, 395661, 240016, 291224, 285084, 317852, 283038, 61857, 285090, 61859, 289189, 375207, 340398, 377264, 61873, 293303, 61880, 283064, 278970, 319930, 336317, 293310, 278978, 127427, 283075, 291267, 127428, 188871, 324039, 278989, 317901, 281040, 278993, 326100, 278999, 328152, 176601, 242139, 369116, 285150, 287198, 279008, 358882, 342498, 242148, 279013, 195045, 279018, 291311, 281072, 309744, 279029, 279032, 233978, 279039, 342536, 287241, 279050, 340490, 303631, 279057, 283153, 279062, 289304, 279065, 342553, 291358, 182817, 375333, 377386, 283182, 283184, 23092, 315960, 352829, 70209, 309830, 301638, 348742, 55881, 322120, 348749, 281166, 281171, 287318, 309846, 244310, 295519, 354911, 436832, 66150, 111208, 344680, 279146, 191082, 313966, 281199, 287346, 301689, 279164, 189057, 311941, 348806, 279177, 369289, 330379, 344715, 184973, 287374, 311949, 330387, 330388, 352917, 227990, 230040, 314009, 271000, 303771, 221852, 342682, 279206, 295590, 279210, 287404, 285361, 303793, 299699, 299700, 164533, 338613, 314040, 287417, 158394, 303803, 342713, 285373, 287422, 66242, 287433, 225995, 363211, 279252, 287452, 318173, 289502, 363230, 295652, 338662, 285415, 346858, 293612, 289518, 312047, 279280, 230134, 154359, 199414, 234234, 299770, 221948, 35583, 299776, 205568, 162561, 363263, 285444, 322313, 322319, 166676, 207640, 326429, 336671, 293664, 326433, 344865, 234277, 283430, 279336, 318250, 312108, 295724, 152365, 318252, 353069, 328499, 242485, 353078, 230199, 353079, 285497, 289598, 160575, 281408, 336702, 420677, 318278, 353094, 353095, 299849, 283467, 201551, 293711, 281427, 353109, 281433, 230234, 301918, 295776, 293730, 303972, 351077, 275303, 342887, 242541, 246641, 330609, 174963, 207732, 310131, 246648, 209785, 279417, 269178, 308092, 177019, 361337, 158593, 254850, 359298, 113542, 240518, 287622, 228233, 228234, 308107, 56208, 295824, 308112, 293781, 209817, 324506, 324507, 318364, 189348, 324517, 289703, 279464, 353195, 140204, 353197, 353216, 349121, 363458, 213960, 279498, 316364, 183248, 338899, 340955, 248797, 207838, 50143, 130016, 340961, 64485, 314342, 234472, 234473, 123881, 324586, 289774, 304110, 320494, 340974, 287731, 316405, 240630, 295927, 201720, 304122, 314362, 320507, 328700, 328706, 234500, 320516, 230410, 320527, 146448, 324625, 234514, 316437, 418837, 197657, 281626, 201755, 175132, 336929, 300068, 357414, 248872, 345132, 238639, 252980, 300084, 322612, 359478, 324666, 238651, 302139, 308287, 21569, 359495, 238664, 300111, 314448, 341073, 353367, 234587, 156764, 277597, 304222, 156765, 281697, 302177, 314467, 281700, 250981, 322663, 300136, 316520, 228458, 207979, 279660, 316526, 15471, 144496, 234609, 312434, 357486, 187506, 353397, 285814, 300151, 279672, 160891, 341115, 363644, 300158, 150657, 187521, 234625, 285828, 302213, 285830, 248961, 302216, 349316, 279685, 228491, 349318, 222343, 234638, 228493, 285838, 169104, 162961, 177296, 308372, 185493, 326804, 238743, 296086, 283802, 285851, 300187, 119962, 296092, 300188, 339102, 302240, 343203, 234663, 300201, 249002, 300202, 253099, 238765, 279728, 238769, 367799, 208058, 339130, 64700, 228540, 228542, 283840, 302274, 148675, 343234, 367810, 259268, 283847, 353479, 62665, 353481, 353482, 283852, 244940, 283853, 290000, 228563, 279765, 296153, 357595, 279774, 304351, 304356, 298212, 330984, 228588, 234733, 253167, 279792, 353523, 298228, 302325, 216315, 208124, 316669, 363771, 388349, 228609, 279814, 322824, 242954, 292107, 312587, 328971, 251153, 245019, 320796, 126237, 339234, 130338, 130343, 351537, 345396, 300343, 116026, 222524, 286013, 286018, 279875, 193859, 230729, 224586, 372043, 177484, 222541, 251213, 238927, 296273, 120148, 318805, 283991, 357719, 222559, 314720, 292195, 230756, 281957, 294243, 163175, 333160, 230765, 284014, 279920, 243056, 312689, 314739, 116084, 327025, 327031, 181625, 306559, 224640, 378244, 298374, 314758, 314760, 142729, 388487, 368011, 314766, 296335, 112017, 112018, 234898, 306579, 282007, 357786, 318875, 290207, 314783, 310692, 333220, 282022, 314789, 279974, 282024, 241066, 316842, 286129, 173491, 304564, 210358, 284089, 228795, 292283, 302529, 302531, 163268, 380357, 415171, 300487, 296392, 361927, 300489, 370123, 302540, 280013, 312782, 306639, 310736, 148940, 310732, 64975, 327121, 222675, 366037, 210390, 210391, 353750, 210393, 228827, 239068, 286172, 310757, 316902, 187878, 280041, 361963, 54765, 191981, 321009, 251378, 308723, 306677, 343542, 280055, 300536, 288249, 286202, 343543, 286205, 290301, 210433, 282114, 228867, 306692, 306693, 366083, 323080, 230921, 253452, 323087, 304656, 282129, 329232, 316946, 308756, 146964, 398869, 282136, 308764, 349726, 302623, 282146, 306723, 245287, 245292, 349741, 169518, 230959, 286254, 288309, 290358, 235070, 288318, 349763, 124485, 56902, 282183, 218696, 288327, 292425, 288326, 243274, 128587, 333388, 286288, 333393, 290390, 235095, 306776, 300630, 196187, 343647, 286306, 374372, 282213, 323178, 54893, 138863, 222832, 314998, 247416, 288378, 366203, 175741, 337535, 294529, 282245, 282246, 224901, 288392, 229001, 290443, 310923, 188048, 323217, 239250, 282259, 345752, 229020, 282273, 302754, 255649, 282276, 40613, 40614, 40615, 229029, 245412, 300714, 298667, 282280, 298661, 286391, 321207, 296632, 319162, 280251, 282303, 286399, 218819, 321219, 306890, 280267, 302797, 212685, 333517, 333520, 241361, 302802, 245457, 333521, 333523, 280278, 282327, 298712, 278233, 278234, 280280, 18138, 294622, 321247, 278240, 282339, 12010, 280300, 282348, 212716, 212717, 284401, 282355, 282358, 229113, 300794, 313081, 286459, 325371, 124669, 194303, 278272, 288512, 311042, 175873, 288516, 319233, 323331, 216839, 323332, 280329, 300811, 284429, 284431, 278291, 278293, 294678, 321302, 366360, 116505, 249626, 284442, 325404, 321310, 282400, 313120, 241441, 315171, 325410, 339745, 341796, 247590, 257830, 284459, 280366, 300848, 282417, 200498, 317232, 280372, 321337, 282427, 360252, 325439, 282434, 315202, 307011, 280390, 282438, 345929, 341836, 325457, 18262, 370522, 188251, 284507, 345951, 284512, 362337, 284514, 345955, 296806, 276327, 292712, 288619, 325484, 280430, 282480, 292720, 362352, 313203, 325492, 241528, 194429, 124798, 325503, 182144, 305026, 253829, 333701, 67463, 282504, 243591, 243597, 325518, 184208, 282518, 282519, 124824, 214937, 239514, 329622, 118685, 298909, 319392, 292771, 354212, 294823, 333735, 284587, 124852, 243637, 288697, 214977, 294850, 163781, 280519, 247757, 344013, 212946, 219101, 280541, 292836, 298980, 294886, 337895, 247785, 253929, 327661, 362480, 325619, 333817, 313339 ]
02f4aa148e44d446e23ad44427cba512fa31d477
72686ed986835f727d30a1b7036fb46fcf8cd304
/Bazis MADI/Student/UspevView/View/UspevByObjTableViewCell.swift
22a400065ec985fca2e60cc9e4aec88aba8a1bb8
[]
no_license
vsevolod997/Bazis-MADI
e7ad90c8fe35542bbc9d6cf33fec4d3cd08709a1
aec330eb04f14d180407dd99f2b08fcd8edcb441
refs/heads/master
2022-09-28T17:48:47.846106
2020-06-04T09:52:40
2020-06-04T09:52:40
224,703,904
0
0
null
null
null
null
UTF-8
Swift
false
false
2,209
swift
// // UspevByObjTableViewCell.swift // Bazis MADI // // Created by Всеволод Андрющенко on 31.01.2020. // Copyright © 2020 Всеволод Андрющенко. All rights reserved. // import UIKit class UspevByObjTableViewCell: UITableViewCell { @IBOutlet weak var markLabel: Title5LabelUILabel! @IBOutlet weak var typeLabel: Title5LabelUILabel! @IBOutlet weak var dateLabel: TitleT1WLabelUILabel! @IBOutlet weak var hourLabel: TitleT1WLabelUILabel! @IBOutlet weak var topView: UIView! @IBOutlet weak var botomView: UIView! var data: UspevModel! { didSet { if let obj = data { if let hour = obj.hour { if hour != "" { hourLabel.text = "Часы: " + hour } else { hourLabel.text = "Часы: -" } } if let mark = obj.ocenka { if mark != "" { if mark == "+" { markLabel.text = "Оценка: Зачтено " } else { markLabel.text = "Оценка: " + mark } } else { markLabel.text = "Оценка: -" } } if let date = obj.date { if date != "" { dateLabel.text = "Дата: " + date } else { hourLabel.text = "Дата: -" } } typeLabel.text = obj.vid + " (сем. \(obj.sem))" } } } override func awakeFromNib() { super.awakeFromNib() botomView.alpha = 0.0 } override func setSelected(_ selected: Bool, animated: Bool) { super.setSelected(selected, animated: animated) } public func showFull(isShow: Bool) { if isShow { topView.alpha = 0.0 botomView.alpha = 0.8 } else { topView.alpha = 0.8 botomView.alpha = 0.0 } } }
[ -1 ]
a7b16f7f8bf4a822cc23052480565d71c0f2bafa
3fcfa474e368f5fb7e739eaaf23d7ab79ca2e625
/TableFeatures/Views/Extensions/BaseView.swift
eb32ac9bbb218cad1ccdc27784f360b34fb7cf01
[]
no_license
MasterVivi/iOSTableFeatures
c3858e2fc15ca8da1e71220f26e527fc9da68757
bac69c53a8ff28605c65094e411451cccc5ce76f
refs/heads/master
2020-03-30T20:25:12.452178
2018-10-04T14:54:13
2018-10-04T14:54:13
151,587,274
0
0
null
null
null
null
UTF-8
Swift
false
false
1,383
swift
// // BaseView.swift // TableFeatures // // Created by John Paul Costello on 04/10/2018. // Copyright © 2018 John Paul Costello. All rights reserved. // import UIKit class BaseView: UIView { var view: UIView! override init(frame: CGRect) { super.init(frame: frame) // Attach related xib attachXib() } required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) // Attach related xib attachXib() } private func attachXib() { backgroundColor = UIColor.clear view = loadNib() view.frame = bounds addSubview(view) view.translatesAutoresizingMaskIntoConstraints = false addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "H:|[childView]|", options: [], metrics: nil, views: ["childView": view])) addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "V:|[childView]|", options: [], metrics: nil, views: ["childView": view])) } }
[ -1 ]
450cc0cfccbeacd8d420ad35451a531595155ee5
011c77411a0b2f9362728fe0fb58f4bfc7a356e2
/TinderCat/LogIn/LogInTests/LogInTests.swift
2964737f74ea01a386298d81cd10b0e614ec5430
[]
no_license
mroncalloCondor/TinderCat
4ba044f03d901441e5c25b57cdb85ea6c5fee600
c8f345355c57ef90032ad39f84c6990b5aca9e09
refs/heads/master
2020-09-08T22:12:25.444737
2019-12-02T20:09:42
2019-12-02T20:09:42
221,256,524
0
0
null
null
null
null
UTF-8
Swift
false
false
902
swift
// // LogInTests.swift // LogInTests // // Created by Miguel Roncallo on 12/2/19. // Copyright © 2019 Miguel Roncallo. All rights reserved. // import XCTest @testable import LogIn class LogInTests: 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. } } }
[ 282633, 313357, 182296, 241692, 98333, 16419, 102437, 229413, 292902, 315432, 204840, 325674, 354345, 223274, 278570, 344107, 243759, 233517, 124975, 253999, 346162, 319542, 229430, 124984, 358456, 288833, 286788, 352326, 313416, 311372, 354385, 196691, 315476, 280661, 329814, 278615, 338007, 307289, 200794, 354393, 309345, 280675, 321637, 329829, 319591, 280677, 313447, 278634, 315498, 319598, 288879, 352368, 299121, 284788, 233589, 233590, 280694, 333940, 237689, 215164, 313469, 215166, 278655, 292992, 333955, 280712, 215178, 241808, 323729, 325776, 317587, 278677, 284826, 278685, 346271, 311458, 278691, 49316, 233636, 333991, 333992, 284842, 32941, 278704, 239793, 241843, 278708, 125109, 180408, 131256, 182456, 184505, 299198, 258239, 379071, 299203, 301251, 309444, 338119, 282831, 321745, 254170, 356576, 338150, 176362, 286958, 125169, 338164, 327929, 184570, 243962, 125183, 309503, 194820, 125188, 313608, 321800, 125193, 375051, 180493, 125198, 325905, 254226, 319763, 125203, 334103, 325912, 315673, 125208, 299293, 237856, 278816, 125217, 233762, 211235, 217380, 305440, 151847, 282919, 332083, 125235, 332085, 280887, 125240, 332089, 278842, 282939, 315706, 287041, 241986, 260418, 332101, 182598, 323916, 319821, 254286, 348492, 325968, 250192, 323920, 366929, 6481, 344401, 348500, 155990, 366930, 6489, 272729, 332123, 379225, 106847, 391520, 323935, 321894, 242023, 280939, 242029, 246127, 354676, 139640, 246136, 246137, 291192, 211326, 313727, 362881, 240002, 248194, 225670, 332167, 311691, 395659, 227725, 395661, 240016, 291224, 317852, 283038, 61857, 285090, 61859, 289189, 375207, 108972, 340398, 311727, 377264, 61873, 61880, 283064, 319930, 278970, 336317, 293310, 278978, 127427, 127428, 283075, 324039, 188871, 317901, 281040, 278993, 326100, 278999, 328152, 176601, 242139, 369116, 285150, 287198, 279008, 342498, 242148, 242149, 195045, 279013, 127465, 279018, 319981, 281072, 109042, 319987, 279029, 279032, 233978, 279039, 342536, 287241, 279050, 340490, 289304, 279065, 342553, 322078, 291358, 182817, 375333, 377386, 283184, 23092, 315960, 242237, 352829, 301638, 348742, 322120, 55881, 348749, 281166, 244310, 354911, 139872, 436832, 242277, 66150, 244327, 111208, 344680, 191082, 313966, 281199, 313971, 139892, 244347, 279164, 189057, 311941, 348806, 279177, 369289, 330379, 344715, 184973, 311949, 326287, 316049, 311954, 330387, 330388, 352917, 227990, 230040, 271000, 111258, 111259, 342682, 279206, 295590, 352937, 287404, 303793, 318130, 299699, 299700, 164533, 338613, 314040, 109241, 287417, 158394, 342713, 285373, 66242, 363211, 287439, 279252, 318173, 289502, 363230, 295652, 338662, 285415, 330474, 346858, 289518, 322291, 312052, 199414, 154359, 35583, 205568, 162561, 299776, 363263, 285444, 322316, 117517, 322319, 166676, 207640, 326429, 336671, 326433, 344865, 279336, 318250, 295724, 353069, 152365, 312108, 318252, 328499, 242485, 353078, 230199, 353079, 336702, 420677, 353094, 353095, 299849, 283467, 293711, 281427, 353109, 244568, 281433, 244570, 230234, 109409, 293730, 303972, 351077, 275303, 342887, 201577, 326505, 242541, 246641, 330609, 246648, 209785, 269178, 177019, 279417, 361337, 254850, 359298, 240518, 109447, 287622, 228233, 228234, 308107, 236428, 56208, 295824, 308112, 209817, 324506, 324507, 318364, 127902, 240544, 189348, 324517, 289703, 353195, 140204, 316333, 353197, 316343, 353216, 349121, 363458, 213960, 279498, 316364, 338899, 340955, 248797, 207838, 50143, 130016, 340961, 64485, 314342, 123881, 324586, 289774, 304110, 320494, 340974, 316405, 240630, 295927, 201720, 304122, 320507, 314362, 328700, 328706, 320516, 230410, 320527, 146448, 324625, 316437, 418837, 320536, 197657, 281626, 201755, 336929, 300068, 357414, 248872, 345132, 238639, 252980, 300084, 322612, 359478, 324666, 238651, 302139, 21569, 214086, 359495, 238664, 300111, 314448, 341073, 353367, 156764, 156765, 314467, 281700, 250981, 322663, 300136, 316520, 228458, 207979, 318572, 316526, 357486, 187506, 353397, 160891, 341115, 363644, 150657, 187521, 248961, 349316, 279685, 349318, 222343, 228491, 228493, 285838, 177296, 169104, 162961, 326804, 308372, 296086, 119962, 300187, 296092, 300188, 339102, 302240, 343203, 300201, 300202, 253099, 238765, 3246, 318639, 279728, 367799, 339130, 64700, 322749, 343234, 367810, 259268, 353479, 353480, 283847, 62665, 353481, 244940, 283853, 353482, 283852, 290000, 228563, 296153, 357595, 279774, 298212, 304356, 330984, 328940, 234733, 228588, 253167, 279792, 353523, 353524, 298228, 216315, 208124, 316669, 363771, 388349, 228609, 279814, 322824, 242954, 292107, 312587, 318733, 328971, 251153, 245019, 320796, 126237, 130338, 208164, 130343, 351537, 345396, 300343, 345402, 116026, 222524, 286013, 216386, 193859, 286018, 279875, 345415, 312648, 230729, 224586, 372043, 177484, 251213, 238927, 296273, 120148, 318805, 283991, 222559, 314720, 292195, 230756, 294243, 333160, 230765, 327024, 327025, 243056, 316787, 116084, 314741, 279920, 312689, 314739, 327031, 306559, 337281, 378244, 298374, 314758, 314760, 388487, 368011, 304524, 314766, 296335, 112017, 112018, 234898, 306579, 282007, 357786, 290207, 314783, 333220, 314789, 279974, 282024, 316842, 241066, 286129, 173491, 150965, 210358, 284089, 228795, 292283, 302529, 302531, 163268, 380357, 415171, 300487, 361927, 300489, 370123, 148940, 280013, 310732, 64975, 312782, 327121, 222675, 366037, 210390, 210391, 353750, 210393, 228827, 286172, 310757, 187878, 280041, 361963, 54765, 191981, 329200, 321009, 251378, 343542, 280055, 300536, 288249, 343543, 286205, 302590, 290301, 210433, 282114, 228867, 366083, 323080, 329225, 230921, 253452, 323087, 304656, 329232, 316946, 146964, 398869, 175639, 308764, 349726, 282146, 306723, 245287, 245292, 349741, 169518, 230959, 286254, 288309, 290358, 235070, 288318, 349763, 124485, 56902, 288326, 288327, 292425, 243274, 128587, 333388, 333393, 290390, 235095, 300630, 196187, 343647, 333408, 345700, 374372, 282213, 323178, 243307, 312940, 54893, 138863, 222832, 314998, 247416, 366203, 323196, 325245, 175741, 337535, 294529, 312965, 224901, 282245, 288392, 282246, 229001, 310923, 188048, 323217, 239250, 282259, 345752, 229020, 255649, 245412, 40613, 40614, 40615, 229029, 282280, 298661, 323236, 61101, 321199, 321207, 296632, 319162, 280251, 282303, 323264, 286399, 218819, 321219, 319177, 306890, 280267, 212685, 333517, 333520, 333521, 241361, 333523, 245457, 241365, 302802, 280278, 280280, 298712, 18138, 278234, 294622, 321247, 278240, 12010, 212716, 212717, 280300, 282348, 284401, 282358, 313081, 286459, 325371, 124669, 194303, 278272, 175873, 319233, 323331, 323332, 280329, 284429, 278291, 321302, 294678, 366360, 116505, 249626, 284442, 325404, 321310, 282400, 241441, 241442, 325410, 339745, 341796, 247590, 257830, 333610, 317232, 282417, 321337, 282427, 319292, 360252, 325439, 315202, 307011, 325445, 153415, 345929, 341836, 325457, 18262, 370522, 188251, 345951, 362337, 284514, 345955, 296806, 292712, 288619, 325484, 313199, 292720, 362352, 313203, 325492, 317304, 333688, 241528, 194429, 124798, 325503, 182144, 339841, 305026, 327557, 253829, 333701, 67463, 243591, 325515, 243597, 325518, 329622, 337815, 282518, 282519, 124824, 214937, 118685, 298909, 319392, 292771, 354212, 313254, 333735, 294823, 284587, 317360, 124852, 243637, 288697, 214977, 163781, 247757, 344013, 212946, 219101, 280541, 292836, 298980, 294886, 337895, 247785, 253929, 327661, 329712, 362480, 325619, 333817, 313339 ]
6418de9afe4c5c33573268091309dd096cfd9799
22eeca4bbdfcd9c3446d504dd366c693414bb13b
/MVVMC_KakaoImage/Favorite/Coordinator/FavoriteCoordinator.swift
c90620321b2c7b0302bc92c70377d15ac4bd619b
[]
no_license
HanHyungLee/MVVMC_KakaoImage
4f2fda5627af704399bc8df28219f0f4cebf031a
4e818c0546329c75c358d7fff15f7418c6f40a73
refs/heads/master
2022-11-23T13:23:41.130508
2020-07-29T08:09:32
2020-07-29T08:09:32
276,670,821
0
0
null
null
null
null
UTF-8
Swift
false
false
1,066
swift
// // FavoriteCoordinator.swift // MVVMC_KakaoImage // // Created by Hanhyung Lee on 2020/06/27. // Copyright © 2020 Hanhyung Lee. All rights reserved. // import UIKit protocol FavoriteCoordinatorProtocol: class { func showDetail(_ cellViewModel: SearchItemCellViewModelProtocol, type: TransitionType) } final class FavoriteCoordinator: FavoriteCoordinatorProtocol { weak var navigationController: UINavigationController? func showDetail(_ cellViewModel: SearchItemCellViewModelProtocol, type: TransitionType) { let coordinator = DetailCoordinator(navigationController: navigationController) let viewModel: DetailViewModel = .init(model: cellViewModel, coordinator: coordinator) let detailScene: Scene = .detial(viewModel) switch type { case .push: navigationController?.pushViewController(detailScene.instantiate(), animated: true) case .modal: navigationController?.present(detailScene.instantiate(), animated: true, completion: nil) } } }
[ -1 ]
45839051f7c1cce1dc836161bf08e5cd0d5d488b
979fb0ba23abe67d064c78b3d43ea8e1a7bb2703
/sphinx/Core Data/CoreDataManager.swift
5c65e0481b490e7f412ee18abaacbb8f9799eba5
[ "MIT" ]
permissive
stakwork/sphinx-ios
3c4071847266e09a02399423c608d65bc3d330c7
0aa456c8ef74ac432cdae58777b4092909cfe99a
refs/heads/master
2023-08-31T00:34:52.624508
2021-07-01T19:23:19
2021-07-01T19:23:19
250,094,234
14
3
MIT
2023-09-13T17:40:55
2020-03-25T21:22:16
Swift
UTF-8
Swift
false
false
6,836
swift
// // CoreDataManager.swift // sphinx // // Created by Tomas Timinskas on 12/09/2019. // Copyright © 2019 Sphinx. All rights reserved. // import Foundation import CoreData import UIKit class CoreDataManager { static let sharedManager = CoreDataManager() private init() {} lazy var persistentContainer: NSPersistentContainer = { let container = NSPersistentContainer(name: "sphinx") container.loadPersistentStores(completionHandler: { (storeDescription, error) in if let error = error as NSError? { fatalError("Unresolved error \(error), \(error.userInfo)") } }) return container }() func saveContext() { let context = CoreDataManager.sharedManager.persistentContainer.viewContext if context.hasChanges { do { try context.save() } catch { let nserror = error as NSError fatalError("Unresolved error \(nserror), \(nserror.userInfo)") } } } func clearCoreDataStore() { let context = CoreDataManager.sharedManager.persistentContainer.viewContext context.performAndWait { context.deleteAllObjects() do { try context.save() } catch { print("Error on deleting CoreData entities") } } } func deleteExpiredInvites() { for contact in UserContact.getPendingContacts() { if let invite = contact.invite, !contact.isOwner, !contact.isConfirmed() && invite.isExpired() { invite.removeFromPaymentProcessed() API.sharedInstance.deleteContact(id: contact.id, callback: { _ in }) deleteContactObjectsFor(contact) } } saveContext() } func deleteContactObjectsFor(_ contact: UserContact) { if let chat = contact.getConversation() { for message in chat.getAllMessages(limit: nil) { MediaLoader.clearMessageMediaCache(message: message) deleteObject(object: message) } chat.deleteColor() deleteObject(object: chat) } if let subscription = contact.getCurrentSubscription() { deleteObject(object: subscription) } if let invite = contact.invite { invite.removeFromPaymentProcessed() } contact.deleteColor() deleteObject(object: contact) CoreDataManager.sharedManager.saveContext() } func deleteChatObjectsFor(_ chat: Chat) { if let messagesSet = chat.messages, let groupMessages = Array<Any>(messagesSet) as? [TransactionMessage] { for m in groupMessages { MediaLoader.clearMessageMediaCache(message: m) deleteObject(object: m) } } deleteObject(object: chat) saveContext() } func getAllOfType<T>(entityName: String, sortDescriptors: [NSSortDescriptor]? = nil) -> [T] { let managedContext = persistentContainer.viewContext var objects:[T] = [T]() let fetchRequest = NSFetchRequest<NSFetchRequestResult>(entityName:"\(entityName)") fetchRequest.sortDescriptors = sortDescriptors ?? [NSSortDescriptor(key: "id", ascending: false)] do { try objects = managedContext.fetch(fetchRequest) as! [T] } catch let error as NSError { print("Error: " + error.localizedDescription) } return objects } func getObjectOfTypeWith<T>(id: Int, entityName: String) -> T? { let managedContext = persistentContainer.viewContext var objects:[T] = [T]() let fetchRequest = NSFetchRequest<NSFetchRequestResult>(entityName:"\(entityName)") let predicate = NSPredicate(format: "id == %d", id) fetchRequest.predicate = predicate fetchRequest.sortDescriptors = [NSSortDescriptor(key: "id", ascending: false)] fetchRequest.fetchLimit = 1 do { try objects = managedContext.fetch(fetchRequest) as! [T] } catch let error as NSError { print("Error: " + error.localizedDescription) } if objects.count > 0 { return objects[0] } return nil } func getObjectsOfTypeWith<T>(predicate: NSPredicate, sortDescriptors: [NSSortDescriptor], entityName: String, fetchLimit: Int? = nil) -> [T] { let managedContext = persistentContainer.viewContext var objects:[T] = [T]() let fetchRequest = NSFetchRequest<NSFetchRequestResult>(entityName:"\(entityName)") fetchRequest.predicate = predicate fetchRequest.sortDescriptors = sortDescriptors if let fetchLimit = fetchLimit { fetchRequest.fetchLimit = fetchLimit } do { try objects = managedContext.fetch(fetchRequest) as! [T] } catch let error as NSError { print("Error: " + error.localizedDescription) } return objects } func getObjectsCountOfTypeWith(predicate: NSPredicate? = nil, entityName: String) -> Int { let managedContext = persistentContainer.viewContext var count:Int = 0 let fetchRequest = NSFetchRequest<NSFetchRequestResult>(entityName:"\(entityName)") if let predicate = predicate { fetchRequest.predicate = predicate } do { try count = managedContext.count(for: fetchRequest) } catch let error as NSError { print("Error: " + error.localizedDescription) } return count } func getObjectOfTypeWith<T>(predicate: NSPredicate, sortDescriptors: [NSSortDescriptor], entityName: String) -> T? { let managedContext = persistentContainer.viewContext var objects:[T] = [T]() let fetchRequest = NSFetchRequest<NSFetchRequestResult>(entityName:"\(entityName)") fetchRequest.predicate = predicate fetchRequest.sortDescriptors = sortDescriptors fetchRequest.fetchLimit = 1 do { try objects = managedContext.fetch(fetchRequest) as! [T] } catch let error as NSError { print("Error: " + error.localizedDescription) } if objects.count > 0 { return objects[0] } return nil } func deleteObject(object: NSManagedObject) { let managedContext = persistentContainer.viewContext managedContext.delete(object) saveContext() } }
[ -1 ]
f93d68df188fcbd3b97c4822a66f53d79aac4c42
3b088fafdc3b6e045aba516e858eb05edb5b4992
/WhatFlower/SceneDelegate.swift
9a17185e653ad4d500a317c5f046604e53a9d814
[]
no_license
JiXiangChua/iOS-tutorial-WhatFlowerApp-ML
826b667765259a9049dc625d0808d1b05a94bf6b
6679b09cf9b9d6488df4e9f7813c70ffa1adc48e
refs/heads/main
2023-06-30T12:04:50.656094
2021-07-31T16:13:32
2021-07-31T16:13:32
391,404,500
0
0
null
null
null
null
UTF-8
Swift
false
false
2,288
swift
// // SceneDelegate.swift // WhatFlower // // Created by JI XIANG on 31/7/21. // import UIKit class SceneDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow? func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). guard let _ = (scene as? UIWindowScene) else { return } } func sceneDidDisconnect(_ scene: UIScene) { // Called as the scene is being released by the system. // This occurs shortly after the scene enters the background, or when its session is discarded. // Release any resources associated with this scene that can be re-created the next time the scene connects. // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead). } func sceneDidBecomeActive(_ scene: UIScene) { // Called when the scene has moved from an inactive state to an active state. // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. } func sceneWillResignActive(_ scene: UIScene) { // Called when the scene will move from an active state to an inactive state. // This may occur due to temporary interruptions (ex. an incoming phone call). } func sceneWillEnterForeground(_ scene: UIScene) { // Called as the scene transitions from the background to the foreground. // Use this method to undo the changes made on entering the background. } func sceneDidEnterBackground(_ scene: UIScene) { // Called as the scene transitions from the foreground to the background. // Use this method to save data, release shared resources, and store enough scene-specific state information // to restore the scene back to its current state. } }
[ 393221, 163849, 393228, 393231, 393251, 352294, 344103, 393260, 393269, 213049, 376890, 385082, 393277, 376906, 327757, 254032, 368728, 180314, 254045, 180322, 376932, 286833, 286845, 286851, 417925, 262284, 360598, 286880, 377003, 377013, 164029, 327872, 180418, 377030, 377037, 377047, 418008, 418012, 377063, 327915, 205037, 393457, 393461, 393466, 418044, 385281, 336129, 262405, 180491, 336140, 164107, 262417, 368913, 262423, 377118, 377121, 262437, 254253, 336181, 262455, 393539, 262473, 344404, 213333, 418135, 270687, 262497, 418145, 262501, 213354, 246124, 262508, 262512, 213374, 385420, 393613, 262551, 262553, 385441, 385444, 262567, 385452, 262574, 393649, 385460, 262587, 344512, 262593, 360917, 369119, 328178, 328180, 328183, 328190, 254463, 328193, 164362, 328207, 410129, 393748, 262679, 377372, 188959, 385571, 377384, 197160, 33322, 352822, 270905, 197178, 418364, 188990, 369224, 385610, 270922, 352844, 385617, 352865, 262761, 352875, 344694, 352888, 336513, 377473, 385671, 148106, 213642, 377485, 352919, 98969, 344745, 361130, 336556, 385714, 434868, 164535, 336568, 164539, 328379, 328387, 352969, 344777, 418508, 385743, 385749, 139998, 189154, 369382, 361196, 418555, 344832, 336644, 344837, 344843, 328462, 361231, 394002, 336660, 418581, 418586, 434971, 369436, 262943, 369439, 418591, 418594, 336676, 418600, 418606, 369464, 361274, 328516, 336709, 328520, 336712, 361289, 328523, 336715, 361300, 213848, 426842, 361307, 197469, 361310, 254813, 361318, 344936, 361323, 361335, 328574, 369544, 361361, 222129, 345036, 386004, 345046, 386012, 386019, 386023, 328690, 435188, 328703, 328710, 418822, 377867, 328715, 361490, 386070, 336922, 345119, 377888, 214060, 345134, 345139, 361525, 386102, 361537, 377931, 345172, 189525, 156762, 402523, 361568, 148580, 345200, 361591, 386168, 361594, 410746, 214150, 345224, 386187, 345247, 361645, 345268, 402615, 361657, 337093, 402636, 328925, 165086, 66783, 165092, 328933, 222438, 328942, 386286, 386292, 206084, 328967, 345377, 345380, 353572, 345383, 263464, 337207, 345400, 378170, 369979, 386366, 337224, 337230, 337235, 263509, 353634, 337252, 402792, 271731, 378232, 337278, 271746, 181639, 353674, 181644, 361869, 181650, 181655, 230810, 181671, 181674, 181679, 181682, 337330, 181687, 370105, 181691, 181697, 361922, 337350, 181704, 337366, 271841, 329192, 361961, 329195, 116211, 337399, 402943, 337416, 329227, 419341, 419345, 329234, 419351, 345626, 419357, 345631, 419360, 370208, 394787, 419363, 370214, 419369, 394796, 419377, 419386, 206397, 214594, 419401, 353868, 419404, 173648, 419408, 214611, 419412, 403040, 345702, 222831, 370298, 353920, 403073, 403076, 345737, 198282, 403085, 403092, 345750, 419484, 345758, 345763, 419492, 345766, 419498, 419502, 370351, 419507, 337588, 419510, 419513, 337601, 403139, 337607, 419528, 419531, 272083, 394967, 419543, 419545, 345819, 419548, 419551, 345829, 419560, 337643, 419564, 337647, 370416, 337671, 362249, 362252, 395022, 362256, 321300, 345888, 362274, 378664, 354107, 345916, 354112, 370504, 329545, 345932, 370510, 354132, 247639, 337751, 370520, 313181, 182110, 354143, 354157, 345965, 345968, 345971, 345975, 403321, 1914, 354173, 395148, 247692, 337809, 247701, 329625, 436127, 436133, 247720, 337834, 362414, 337845, 190393, 346059, 247760, 346064, 346069, 419810, 329699, 354275, 190440, 354314, 346140, 436290, 395340, 378956, 436307, 338005, 100454, 329833, 329853, 329857, 329868, 411806, 329886, 346273, 362661, 100525, 387250, 379067, 387261, 256193, 395467, 346317, 411862, 256214, 411865, 411869, 411874, 379108, 411877, 387303, 346344, 395496, 338154, 387307, 346350, 338161, 387314, 436474, 321787, 379135, 411905, 411917, 379154, 395539, 387350, 387353, 338201, 182559, 338212, 395567, 248112, 362823, 436556, 321880, 362844, 379234, 354674, 321911, 420237, 379279, 272787, 354728, 338353, 338382, 272849, 248279, 256474, 182755, 338404, 338411, 330225, 248309, 248332, 330254, 199189, 420377, 330268, 191012, 330320, 199250, 191069, 346722, 248427, 191085, 338544, 346736, 191093, 346743, 346769, 150184, 174775, 248505, 174778, 363198, 223936, 355025, 273109, 355029, 264919, 338661, 264942, 363252, 338680, 264965, 338701, 256787, 363294, 199455, 396067, 346917, 396070, 215854, 355123, 355141, 355144, 338764, 355151, 330581, 330585, 387929, 355167, 265056, 265059, 355176, 355180, 355185, 412600, 207809, 379849, 347082, 396246, 330711, 248794, 248799, 347106, 437219, 257009, 265208, 265215, 199681, 338951, 330761, 330769, 330775, 248863, 158759, 396329, 347178, 404526, 396337, 330803, 396340, 339002, 388155, 339010, 347208, 248905, 330827, 248915, 183384, 339037, 412765, 257121, 322660, 265321, 248952, 420985, 330886, 330890, 347288, 248986, 44199, 380071, 339118, 249018, 339133, 126148, 322763, 330959, 330966, 265433, 265438, 388320, 363757, 388348, 339199, 396552, 175376, 175397, 273709, 372016, 437553, 347442, 199989, 175416, 396601, 208189, 437567, 175425, 437571, 126279, 437576, 437584, 331089, 437588, 331094, 396634, 175451, 437596, 429408, 175458, 175461, 175464, 265581, 331124, 175478, 249210, 175484, 175487, 249215, 175491, 249219, 249225, 249228, 249235, 175514, 175517, 396703, 396706, 175523, 355749, 396723, 388543, 380353, 216518, 380364, 339406, 372177, 339414, 249303, 413143, 339418, 339421, 249310, 339425, 249313, 339429, 339435, 249329, 69114, 372229, 208399, 175637, 405017, 134689, 339504, 265779, 421442, 413251, 265796, 265806, 224854, 224858, 339553, 257636, 224871, 372328, 257647, 372338, 224885, 224888, 224891, 224895, 372354, 126597, 421509, 224905, 11919, 224911, 224914, 126611, 224917, 224920, 126618, 208539, 224923, 224927, 224930, 224933, 257705, 224939, 224943, 257713, 224949, 257717, 257721, 224954, 257725, 224960, 257733, 224966, 224970, 257740, 224976, 257745, 339664, 257748, 224982, 257752, 224987, 257762, 224996, 225000, 225013, 257788, 225021, 339711, 257791, 225027, 257796, 339722, 257802, 257805, 225039, 257808, 249617, 225044, 167701, 372500, 257815, 225049, 257820, 225054, 184096, 397089, 257825, 225059, 339748, 225068, 257837, 413485, 225071, 225074, 257843, 225077, 257846, 225080, 397113, 225083, 397116, 257853, 225088, 225094, 225097, 257869, 257872, 225105, 397140, 225109, 225113, 257881, 257884, 257887, 225120, 257891, 413539, 225128, 257897, 339818, 225138, 339827, 257909, 225142, 372598, 257914, 257917, 225150, 257922, 380803, 225156, 339845, 257927, 225166, 397201, 225171, 380823, 225176, 225183, 372698, 372704, 372707, 356336, 380919, 393215, 372739, 405534, 266295, 266298, 217158, 421961, 200786, 356440, 217180, 430181, 266351, 356467, 266365, 192640, 266375, 381069, 225425, 250003, 225430, 250008, 356507, 250012, 225439, 135328, 192674, 225442, 438434, 225445, 438438, 225448, 438441, 356521, 225451, 258223, 225456, 430257, 225459, 225462, 225468, 389309, 225472, 372931, 225476, 430275, 389322, 225485, 225488, 225491, 266454, 225494, 225497, 225500, 225503, 225506, 356580, 225511, 217319, 225515, 225519, 381177, 397572, 389381, 381212, 356638, 356641, 356644, 356647, 266537, 389417, 356650, 356656, 332081, 307507, 340276, 356662, 397623, 332091, 225599, 201030, 348489, 332107, 151884, 430422, 348503, 332118, 250201, 250211, 340328, 250217, 348523, 348528, 332153, 356734, 389503, 332158, 438657, 332162, 389507, 348548, 356741, 250239, 332175, 160152, 373146, 340380, 373149, 70048, 356783, 373169, 266688, 324032, 201158, 127473, 217590, 340473, 324095, 324100, 324103, 324112, 340501, 324118, 324122, 340512, 332325, 324134, 381483, 356908, 324141, 324143, 356917, 324150, 324156, 168509, 348734, 324161, 324165, 356935, 348745, 381513, 324171, 324174, 324177, 389724, 332381, 373344, 340580, 348777, 381546, 119432, 340628, 184983, 373399, 258723, 332455, 332460, 389806, 332464, 332473, 381626, 332484, 332487, 332494, 357070, 357074, 332512, 332521, 340724, 332534, 348926, 389927, 348979, 152371, 348983, 340792, 398141, 357202, 389971, 357208, 389979, 430940, 357212, 357215, 439138, 201580, 201583, 349041, 340850, 381815, 430967, 324473, 398202, 119675, 340859, 324476, 430973, 324479, 340863, 324482, 373635, 324485, 324488, 185226, 381834, 324493, 324496, 324499, 430996, 324502, 324511, 422817, 324514, 201638, 398246, 373672, 324525, 5040, 111539, 324534, 5047, 324539, 324542, 398280, 349129, 340940, 340942, 209874, 340958, 431073, 398307, 340964, 209896, 201712, 209904, 349173, 381947, 201724, 349181, 431100, 431107, 349203, 209944, 209948, 357411, 250915, 250917, 169002, 357419, 209966, 209969, 209973, 209976, 209980, 209988, 209991, 431180, 209996, 341072, 349268, 177238, 250968, 210011, 373853, 341094, 210026, 210028, 210032, 349296, 210037, 210042, 210045, 349309, 152704, 349313, 160896, 210053, 210056, 349320, 259217, 373905, 210068, 210072, 210078, 210081, 210085, 210089, 210096, 210100, 324792, 210108, 357571, 210116, 210128, 210132, 333016, 210139, 210144, 218355, 218361, 275709, 128254, 275713, 242947, 275717, 275723, 333075, 349460, 333079, 251161, 349486, 349492, 415034, 210261, 365912, 259423, 374113, 251236, 374118, 333164, 234867, 390518, 357756, 374161, 112021, 349591, 357793, 333222, 259516, 415168, 366035, 415187, 366039, 415192, 415194, 415197, 415200, 333285, 415208, 366057, 366064, 415217, 415225, 423424, 415258, 415264, 366118, 415271, 382503, 349739, 144940, 415279, 415282, 415286, 210488, 415291, 415295, 349762, 333396, 374359, 333400, 366173, 423529, 423533, 210547, 415354, 333440, 267910, 267929, 333512, 259789, 366301, 333535, 153311, 366308, 366312, 431852, 399086, 366319, 210673, 366322, 399092, 366326, 333566, 268042, 210700, 366349, 210707, 399129, 333595, 210720, 366384, 358192, 210740, 366388, 358201, 325441, 366403, 325447, 341831, 341835, 341839, 341844, 415574, 358235, 341852, 350046, 399200, 399208, 268144, 358256, 358260, 341877, 399222, 325494, 333690, 325505, 333699, 399244, 333709, 333725, 333737, 382891, 382898, 350153, 358348, 333777, 219094, 399318, 358372, 350190, 350194, 333819, 350204, 350207, 325633, 325637, 350214, 219144, 268299, 333838, 350225, 186388, 350232, 333851, 350238, 350241, 374819, 350245, 350249, 350252, 178221, 350257, 350260, 350272, 243782, 350281, 350286, 374865, 342113, 252021, 342134, 374904, 268435, 333998, 334012, 260299, 350411, 350417, 350423, 211161, 350426, 350449, 375027, 358645, 350459, 350462, 350465, 350469, 268553, 350477, 268560, 350481, 432406, 350487, 325915, 350491, 325918, 350494, 325920, 350500, 194854, 350505, 358701, 391469, 350510, 358705, 358714, 358717, 383307, 358738, 334162, 383331, 383334, 391531, 383342, 334204, 268669, 194942, 391564, 366991, 334224, 268702, 342431, 375209, 375220, 334263, 326087, 358857, 195041, 334312, 104940, 375279, 416255, 350724, 186898, 342546, 350740, 342551, 334359, 342555, 334364, 416294, 350762, 252463, 358962, 334386, 334397, 358973, 252483, 219719, 399957, 334425, 326240, 375401, 334466, 334469, 162446, 326291, 342680, 342685, 260767, 342711, 244410, 260798, 334530, 260802, 350918, 154318, 342737, 391895, 154329, 416476, 64231, 113389, 342769, 203508, 375541, 342777, 391938, 391949, 375569, 326417, 375572, 375575, 375580, 162592, 334633, 326444, 383794, 326452, 326455, 375613, 244542, 326463, 375616, 326468, 342857, 326474, 326479, 326486, 416599, 342875, 244572, 326494, 433001, 400238, 326511, 211826, 211832, 392061, 351102, 359296, 252801, 260993, 351105, 400260, 211846, 342921, 342931, 252823, 400279, 392092, 400286, 252838, 359335, 211885, 252846, 400307, 351169, 359362, 351172, 170950, 187335, 326599, 359367, 359383, 359389, 383968, 343018, 359411, 261109, 261112, 244728, 383999, 261130, 261148, 359452, 211999, 261155, 261160, 261166, 359471, 375868, 343132, 384099, 384102, 384108, 367724, 187503, 343155, 384115, 212095, 351366, 384136, 384140, 384144, 351382, 384152, 384158, 384161, 351399, 384169, 367795, 384182, 367801, 384189, 384192, 351424, 343232, 367817, 244938, 384202, 253132, 326858, 384209, 146644, 351450, 384225, 359650, 343272, 351467, 359660, 384247, 351480, 384250, 351483, 351492, 343307, 384270, 359695, 261391, 253202, 261395, 384276, 384284, 245021, 384290, 253218, 245032, 171304, 384299, 351535, 376111, 245042, 326970, 384324, 343366, 212296, 212304, 367966, 343394, 367981, 343410, 155000, 327035, 245121, 245128, 253321, 155021, 384398, 245137, 245143, 245146, 245149, 343453, 245152, 245155, 155045, 245158, 40358, 245163, 114093, 327090, 343478, 359867, 384444, 146878, 327108, 327112, 384457, 359887, 359891, 368093, 155103, 343535, 343540, 368120, 343545, 409092, 253445, 359948, 359951, 245295, 359984, 343610, 400977, 400982, 179803, 245358, 155255, 155274, 368289, 245410, 425639, 425652, 425663, 155328, 245463, 155352, 155356, 212700, 155364, 245477, 155372, 245487, 212723, 409336, 155394, 155404, 245528, 155423, 360224, 155439, 204592, 155444, 155448, 417596, 384829, 384831, 360262, 155463, 155477, 376665, 155484, 261982, 425823, 155488, 376672, 155492, 327532, 261997, 376686, 262000, 262003, 425846, 262006, 147319, 262009, 327542, 262012, 155517, 155523, 155526, 360327, 376715, 155532, 262028, 262031, 262034, 262037, 262040, 262043, 155550, 253854, 262046, 262049, 262052, 327590, 155560, 155563, 155566, 327613, 393152, 311244, 393170, 155604, 155620, 253924, 155622, 253927, 327655, 360432, 393204, 360439, 253944, 393209, 155647 ]
621f5224145e235fa9623a9489c9c3482150908b
3a58133e59b2df327cd9bc3299bf27f4b864e6aa
/Right on target/SceneDelegate.swift
6e0eca9b0133182d7ec7095e0a09b03f61a8b84c
[]
no_license
firmfreez/Right-on-target
f3a5001617aa7d596900bb17260643af30f14db9
2a450d1cc207529b837ce65e4bb7be5a4bf654d5
refs/heads/main
2023-07-02T06:31:49.288290
2021-08-07T10:19:42
2021-08-07T10:19:42
393,501,407
0
0
null
null
null
null
UTF-8
Swift
false
false
2,317
swift
// // SceneDelegate.swift // Right on target // // Created by Леон Алексанянц on 05.08.2021. // import UIKit class SceneDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow? func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). guard let _ = (scene as? UIWindowScene) else { return } } func sceneDidDisconnect(_ scene: UIScene) { // Called as the scene is being released by the system. // This occurs shortly after the scene enters the background, or when its session is discarded. // Release any resources associated with this scene that can be re-created the next time the scene connects. // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead). } func sceneDidBecomeActive(_ scene: UIScene) { // Called when the scene has moved from an inactive state to an active state. // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. } func sceneWillResignActive(_ scene: UIScene) { // Called when the scene will move from an active state to an inactive state. // This may occur due to temporary interruptions (ex. an incoming phone call). } func sceneWillEnterForeground(_ scene: UIScene) { // Called as the scene transitions from the background to the foreground. // Use this method to undo the changes made on entering the background. } func sceneDidEnterBackground(_ scene: UIScene) { // Called as the scene transitions from the foreground to the background. // Use this method to save data, release shared resources, and store enough scene-specific state information // to restore the scene back to its current state. } }
[ 393221, 163849, 393228, 393231, 393251, 352294, 344103, 393260, 393269, 213049, 376890, 385082, 393277, 376906, 327757, 254032, 368728, 180314, 254045, 180322, 376932, 286833, 286845, 286851, 417925, 262284, 360598, 286880, 377003, 377013, 164029, 327872, 180418, 377030, 377037, 377047, 418008, 418012, 377063, 327915, 205037, 393457, 393461, 393466, 418044, 385281, 336129, 262405, 180491, 336140, 164107, 262417, 368913, 262423, 377118, 377121, 262437, 254253, 336181, 262455, 393539, 262473, 344404, 213333, 418135, 270687, 262497, 418145, 262501, 213354, 246124, 262508, 262512, 213374, 385420, 393613, 262551, 262553, 385441, 385444, 262567, 385452, 262574, 393649, 385460, 262587, 344512, 262593, 360917, 369119, 328178, 328180, 328183, 328190, 254463, 328193, 164362, 328207, 410129, 393748, 262679, 377372, 188959, 385571, 377384, 197160, 33322, 352822, 270905, 197178, 418364, 188990, 369224, 270922, 385610, 352844, 385617, 352865, 262761, 352875, 344694, 352888, 336513, 377473, 385671, 148106, 213642, 377485, 352919, 98969, 344745, 361130, 336556, 434868, 164535, 336568, 164539, 328379, 328387, 352969, 344777, 418508, 385743, 385749, 139998, 189154, 369382, 361196, 418555, 344832, 336644, 344837, 344843, 328462, 361231, 394002, 336660, 418581, 418586, 434971, 369436, 262943, 369439, 418591, 418594, 336676, 418600, 418606, 369464, 361274, 328516, 336709, 328520, 336712, 361289, 328523, 336715, 361300, 213848, 426842, 361307, 197469, 361310, 254813, 361318, 344936, 361323, 361335, 328574, 369544, 361361, 222129, 345036, 115661, 386004, 345046, 386012, 386019, 386023, 328690, 435188, 328703, 328710, 418822, 377867, 328715, 361490, 386070, 271382, 336922, 345119, 377888, 214060, 345134, 345139, 361525, 386102, 361537, 377931, 345172, 189525, 156762, 402523, 361568, 148580, 345200, 361591, 386168, 361594, 410746, 214150, 345224, 386187, 345247, 361645, 345268, 402615, 361657, 337093, 402636, 328925, 165086, 66783, 165092, 328933, 222438, 328942, 386286, 386292, 206084, 328967, 345377, 345380, 353572, 345383, 263464, 337207, 345400, 378170, 369979, 386366, 337224, 337230, 337235, 263509, 353634, 337252, 402792, 271731, 378232, 337278, 271746, 181639, 353674, 181644, 361869, 181650, 181655, 230810, 181671, 181674, 181679, 181682, 337330, 181687, 370105, 181691, 181697, 361922, 337350, 181704, 337366, 271841, 329192, 361961, 329195, 116211, 337399, 402943, 337416, 329227, 419341, 419345, 329234, 419351, 345626, 419357, 345631, 419360, 370208, 394787, 419363, 370214, 419369, 394796, 419377, 419386, 206397, 214594, 419401, 353868, 419404, 173648, 419408, 214611, 419412, 403040, 345702, 222831, 370298, 353920, 403073, 403076, 345737, 198282, 403085, 403092, 345750, 419484, 345758, 345763, 419492, 345766, 419498, 419502, 370351, 419507, 337588, 419510, 419513, 419518, 337601, 403139, 337607, 419528, 419531, 419536, 272083, 394967, 419543, 419545, 345819, 419548, 419551, 345829, 419560, 337643, 419564, 337647, 370416, 337671, 362249, 362252, 395022, 362256, 321300, 345888, 362274, 378664, 354107, 345916, 354112, 370504, 329545, 345932, 370510, 354132, 247639, 337751, 370520, 313181, 182110, 354143, 354157, 345965, 345968, 345971, 345975, 403321, 1914, 354173, 395148, 247692, 337809, 247701, 329625, 436127, 436133, 247720, 337834, 362414, 337845, 190393, 346059, 247760, 346064, 346069, 419810, 329699, 354275, 190440, 354314, 346140, 436290, 395340, 378956, 436307, 338005, 100454, 329833, 329853, 329857, 329868, 411806, 329886, 346273, 362661, 100525, 387250, 379067, 387261, 256193, 395467, 346317, 411862, 411865, 411869, 411874, 379108, 411877, 387303, 346344, 395496, 338154, 387307, 346350, 338161, 387314, 436474, 321787, 379135, 411905, 411917, 379154, 395539, 387350, 387353, 338201, 182559, 338212, 248112, 362823, 436556, 321880, 362844, 379234, 354674, 321911, 420237, 379279, 272787, 354728, 338353, 338382, 272849, 248279, 256474, 182755, 338404, 330225, 248309, 330254, 199189, 420377, 330268, 191012, 330320, 199250, 191069, 346722, 248427, 191085, 338544, 346736, 191093, 346743, 346769, 150184, 174775, 248505, 174778, 363198, 223936, 355025, 273109, 355029, 264919, 256735, 338661, 264942, 363252, 338680, 264965, 338701, 256787, 363294, 199455, 396067, 346917, 396070, 215854, 355123, 355141, 355144, 338764, 355151, 330581, 387929, 330585, 355167, 265056, 265059, 355176, 355180, 355185, 412600, 207809, 379849, 347082, 396246, 330711, 248794, 248799, 347106, 437219, 257009, 265208, 265215, 199681, 338951, 330761, 330769, 330775, 248863, 158759, 396329, 347178, 404526, 396337, 330803, 396340, 339002, 388155, 339010, 347208, 248905, 330827, 248915, 183384, 412765, 339037, 257121, 322660, 265321, 248952, 420985, 330886, 347288, 248986, 44199, 380071, 339118, 249018, 339133, 126148, 322763, 330959, 330966, 265433, 265438, 388320, 363757, 388348, 339199, 396552, 175376, 175397, 273709, 372016, 437553, 347442, 199989, 175416, 396601, 208189, 437567, 175425, 437571, 126279, 437576, 437584, 331089, 437588, 331094, 396634, 175451, 437596, 429408, 175458, 175461, 175464, 265581, 331124, 175478, 249210, 175484, 175487, 249215, 175491, 249219, 249225, 249228, 249235, 175514, 175517, 396703, 396706, 175523, 355749, 396723, 388543, 380353, 216518, 380364, 339406, 372177, 339414, 249303, 413143, 339418, 339421, 249310, 339425, 249313, 339429, 339435, 249329, 69114, 372229, 208399, 380433, 175637, 405017, 134689, 339504, 265779, 421442, 413251, 265796, 265806, 224854, 224858, 339553, 257636, 224871, 372328, 257647, 372338, 224885, 224888, 224891, 224895, 372354, 126597, 421509, 224905, 11919, 224911, 224914, 126611, 224917, 224920, 126618, 208539, 224923, 224927, 224930, 224933, 257705, 224939, 224943, 257713, 224949, 257717, 257721, 224954, 257725, 224960, 257733, 224966, 224970, 257740, 224976, 257745, 339664, 257748, 224982, 257752, 224987, 257762, 224996, 225000, 225013, 257788, 225021, 339711, 257791, 225027, 257796, 257802, 339722, 257805, 225039, 257808, 249617, 225044, 167701, 372500, 257815, 225049, 257820, 225054, 184096, 397089, 257825, 225059, 339748, 225068, 257837, 413485, 225071, 225074, 257843, 225077, 257846, 225080, 397113, 225083, 397116, 257853, 225088, 225094, 225097, 257869, 257872, 225105, 397140, 225109, 225113, 257881, 257884, 257887, 225120, 257891, 413539, 225128, 257897, 339818, 225138, 339827, 257909, 225142, 372598, 257914, 257917, 225150, 257922, 380803, 225156, 339845, 257927, 225166, 397201, 225171, 380823, 225176, 225183, 372698, 372704, 372707, 356336, 380919, 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, 225448, 438441, 356521, 225451, 258223, 225456, 430257, 225459, 225462, 225468, 389309, 225472, 372931, 225476, 389322, 225485, 225488, 225491, 266454, 225494, 225497, 225500, 225503, 225506, 356580, 225511, 217319, 225515, 225519, 381177, 397572, 389381, 381212, 356638, 356641, 356644, 356647, 266537, 389417, 356650, 356656, 332081, 307507, 340276, 356662, 397623, 332091, 225599, 201030, 348489, 332107, 151884, 430422, 348503, 250203, 250211, 340328, 250217, 348523, 348528, 332153, 356734, 389503, 332158, 438657, 250239, 389507, 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, 258723, 332455, 332460, 332464, 332473, 381626, 332484, 332487, 332494, 357070, 357074, 332512, 332521, 340724, 332534, 155647, 373499, 348926, 389927, 348979, 152371, 348983, 340792, 398141, 357202, 389971, 357208, 389979, 430940, 357212, 357215, 439138, 201580, 201583, 349041, 340850, 381815, 430967, 324473, 398202, 119675, 340859, 324476, 430973, 324479, 340863, 324482, 373635, 324485, 324488, 185226, 381834, 324493, 324496, 324499, 430996, 324502, 324511, 422817, 324514, 201638, 373672, 324525, 111539, 324534, 5047, 324539, 324542, 398280, 349129, 340940, 340942, 209874, 340958, 431073, 398307, 340964, 209896, 201712, 209904, 349173, 381947, 201724, 349181, 431100, 431107, 349203, 209944, 209948, 357411, 250915, 250917, 169002, 357419, 209966, 209969, 209973, 209976, 209980, 209988, 209991, 431180, 209996, 341072, 349268, 177238, 250968, 210011, 373853, 341094, 210026, 210028, 210032, 349296, 210037, 210042, 210045, 349309, 160896, 349313, 152704, 210053, 210056, 349320, 259217, 373905, 210068, 210072, 210078, 210081, 210085, 210089, 210096, 210100, 324792, 210108, 357571, 210116, 210128, 210132, 333016, 210139, 210144, 218355, 218361, 275709, 128254, 275713, 242947, 275717, 275723, 333075, 349460, 333079, 251161, 349486, 349492, 415034, 210261, 365912, 259423, 374113, 251236, 374118, 333164, 234867, 390518, 357756, 374161, 112021, 349591, 357793, 333222, 259516, 415168, 366035, 415187, 366039, 415192, 415194, 415197, 415200, 333285, 415208, 366057, 366064, 415217, 415225, 423424, 415258, 415264, 366118, 415271, 382503, 349739, 144940, 415279, 415282, 415286, 210488, 415291, 415295, 349762, 333396, 374359, 333400, 366173, 423529, 423533, 210547, 415354, 333440, 267910, 267929, 333512, 259789, 366301, 333535, 153311, 366308, 366312, 431852, 399086, 366319, 210673, 366322, 399092, 366326, 333566, 268042, 210700, 366349, 210707, 399129, 333595, 210720, 366384, 358192, 210740, 366388, 358201, 325441, 366403, 325447, 341831, 341835, 341839, 341844, 415574, 358235, 341852, 350046, 399200, 399208, 268144, 358256, 358260, 341877, 399222, 325494, 333690, 325505, 333699, 399244, 333709, 333725, 333737, 382891, 350153, 358348, 333777, 219094, 399318, 358372, 350190, 350194, 333819, 350204, 350207, 325633, 325637, 350214, 219144, 268299, 333838, 350225, 186388, 350232, 333851, 350238, 350241, 374819, 350245, 350249, 350252, 178221, 350257, 350260, 350272, 243782, 350281, 350286, 374865, 342113, 252021, 342134, 374904, 268435, 333998, 334012, 260299, 350411, 350417, 350423, 350426, 350449, 375027, 358645, 350459, 350462, 350465, 350469, 268553, 350477, 268560, 350481, 432406, 350487, 325915, 350491, 325918, 350494, 325920, 350500, 194854, 350505, 358701, 391469, 350510, 358705, 358714, 358717, 383307, 358738, 334162, 383331, 383334, 391531, 383342, 334204, 268669, 194942, 391564, 366991, 334224, 268702, 342431, 375209, 375220, 334263, 326087, 358857, 195041, 334312, 104940, 375279, 416255, 350724, 186898, 342546, 350740, 342551, 334359, 342555, 334364, 416294, 350762, 252463, 358962, 334386, 334397, 358973, 252483, 219719, 399957, 334425, 326240, 375401, 334466, 334469, 391813, 162446, 326291, 342680, 342685, 260767, 342711, 244410, 260798, 334530, 260802, 350918, 154318, 342737, 391895, 154329, 416476, 64231, 113389, 342769, 203508, 375541, 342777, 391938, 391949, 375569, 326417, 375572, 375575, 375580, 162592, 334633, 326444, 383794, 326452, 326455, 375613, 244542, 260925, 375616, 326463, 326468, 342857, 326474, 326479, 326486, 416599, 342875, 244572, 326494, 433001, 400238, 326511, 211826, 211832, 392061, 351102, 359296, 252801, 260993, 351105, 400260, 211846, 342921, 342931, 252823, 400279, 392092, 400286, 252838, 359335, 211885, 252846, 400307, 351169, 359362, 351172, 170950, 187335, 326599, 359367, 359383, 359389, 383968, 343018, 359411, 261109, 261112, 244728, 383999, 261130, 261148, 359452, 211999, 261155, 261160, 261166, 359471, 375868, 343132, 384099, 384102, 384108, 367724, 187503, 343155, 384115, 212095, 351366, 384136, 384140, 384144, 384152, 384158, 384161, 351399, 384169, 367795, 244917, 384182, 367801, 384189, 384192, 351424, 343232, 367817, 244938, 384202, 253132, 326858, 384209, 146644, 351450, 384225, 359650, 343272, 351467, 359660, 384247, 351480, 384250, 351483, 351492, 343307, 384270, 359695, 261391, 253202, 261395, 384276, 384284, 245021, 384290, 253218, 245032, 171304, 384299, 351535, 376111, 245042, 326970, 384324, 343366, 212296, 212304, 367966, 343394, 367981, 343410, 155000, 327035, 245121, 245128, 253321, 155021, 384398, 245137, 245143, 245146, 245149, 343453, 245152, 245155, 155045, 245158, 40358, 245163, 114093, 327090, 343478, 359867, 384444, 146878, 327108, 327112, 384457, 359887, 359891, 368093, 155103, 343535, 343540, 368120, 343545, 409092, 253445, 359948, 359951, 245295, 359984, 343610, 400977, 400982, 179803, 155241, 245358, 155255, 155274, 368289, 245410, 425639, 425652, 425663, 155328, 245463, 155352, 155356, 212700, 155364, 245477, 155372, 245487, 212723, 409336, 155394, 155404, 245528, 155423, 360224, 155439, 204592, 155444, 155448, 417596, 384829, 384831, 360262, 155463, 155477, 376665, 155484, 261982, 425823, 155488, 376672, 155492, 327532, 261997, 376686, 262000, 262003, 425846, 262006, 147319, 262009, 327542, 262012, 155517, 155523, 155526, 360327, 376715, 155532, 262028, 262031, 262034, 262037, 262040, 262043, 155550, 253854, 262046, 262049, 262052, 327590, 155560, 155563, 155566, 327613, 393152, 311244, 393170, 155604, 155620, 253924, 155622, 253927, 327655, 360432, 393204, 360439, 253944, 393209, 393215 ]
45450d81c4dfc701072137b5fe77b1b195eb914d
a83d75991442ae5c1850e8de67d0ec851e4afd6a
/RequestKitTests/JSONPostRouterTests.swift
00ed163d2905f301e138b4976c90db23085c40f3
[ "MIT" ]
permissive
BernardTolosajr/RequestKit
5023ed3f06b148ef1ab6bf52a07b10bf9a791c47
f0b4ff2f0ff95da2f474d04516a997417f89346b
refs/heads/master
2021-04-12T11:47:05.221331
2018-03-01T18:47:37
2018-03-01T18:47:37
126,802,862
0
0
null
2018-03-26T09:09:38
2018-03-26T09:09:38
null
UTF-8
Swift
false
false
1,961
swift
import RequestKit import XCTest class JSONPostRouterTests: XCTestCase { func testJSONPostJSONError() { let jsonDict = ["message": "Bad credentials", "documentation_url": "https://developer.github.com/v3"] let jsonString = String(data: try! JSONSerialization.data(withJSONObject: jsonDict, options: JSONSerialization.WritingOptions()), encoding: String.Encoding.utf8) let session = RequestKitURLTestSession(expectedURL: "https://example.com/some_route", expectedHTTPMethod: "POST", response: jsonString, statusCode: 401) let task = TestInterface().postJSON(session) { response in switch response { case .success: XCTAssert(false, "should not retrieve a succesful response") case .failure(let error as NSError): XCTAssertEqual(error.code, 401) XCTAssertEqual(error.domain, "com.nerdishbynature.RequestKitTests") XCTAssertEqual((error.userInfo[RequestKitErrorKey] as? [String: String]) ?? [:], jsonDict) } } XCTAssertNotNil(task) XCTAssertTrue(session.wasCalled) } func testJSONPostStringError() { let errorString = "Just nope" let session = RequestKitURLTestSession(expectedURL: "https://example.com/some_route", expectedHTTPMethod: "POST", response: errorString, statusCode: 401) let task = TestInterface().postJSON(session) { response in switch response { case .success: XCTAssert(false, "should not retrieve a succesful response") case .failure(let error as NSError): XCTAssertEqual(error.code, 401) XCTAssertEqual(error.domain, "com.nerdishbynature.RequestKitTests") XCTAssertEqual((error.userInfo[RequestKitErrorKey] as? String) ?? "", errorString) } } XCTAssertNotNil(task) XCTAssertTrue(session.wasCalled) } }
[ -1 ]
4ac59bd7e81eef9962d02b03b583bdc7293e5fc2
47b40cff443a363c7c39203b57c7ca205774a3d6
/Pictogram/Pictogram/View Controllers/RecentPhotosViewController.swift
0e21f44cc470980efdded6882ed11194d0e8b915
[]
no_license
voxqhuy/iOS-MediumApps
41f265d1ff9549ab80b65b75c15b5c1bd5bb6810
5daccb712af1b8377944edafd5b759627798fd29
refs/heads/master
2021-10-10T00:06:46.560336
2019-01-04T22:32:51
2019-01-04T22:32:51
null
0
0
null
null
null
null
UTF-8
Swift
false
false
3,694
swift
// // RecentPhotosViewController.swift // Pictogram // // Created by Vo Huy on 5/25/18. // Copyright © 2018 Vo Huy. All rights reserved. // import UIKit class RecentPhotosViewController: UIViewController { // MARK: - Properties var photoStore: PhotoStore! let recentDataSource = RecentPhotoDataSource() // MARK: Outlets @IBOutlet var recentCollectionView: UICollectionView! // MARK: - View life cycle override func viewDidLoad() { super.viewDidLoad() recentCollectionView.dataSource = recentDataSource recentCollectionView.delegate = self // load whatever the app has loaded currently self.updateDataSource() // Kick off the web service photoStore.fetchRecentPhotos() { (photosResult) in self.updateDataSource() } } // MARK: - Segue override func prepare(for segue: UIStoryboardSegue, sender: Any?) { switch segue.identifier { case "showRecentImage"?: if let selectedIndexPath = recentCollectionView.indexPathsForSelectedItems?.first { let photo = recentDataSource.photos[selectedIndexPath.row] let destinationVC = segue.destination as! PhotoInfoViewController destinationVC.photo = photo destinationVC.store = photoStore } default: print("Unexpected segue identifier") } } // MARK: - Private methods private func updateDataSource() { photoStore.fetchAllPhotos{ (photosResult) in switch photosResult { case let .success(photos): self.recentDataSource.photos = photos case .failure: self.recentDataSource.photos.removeAll() } self.recentCollectionView.reloadSections(IndexSet(integer: 0)) } } } extension RecentPhotosViewController: UICollectionViewDelegate { func collectionView(_ collectionView: UICollectionView, willDisplay cell: UICollectionViewCell, forItemAt indexPath: IndexPath) { let photo = recentDataSource.photos[indexPath.row] photoStore.fetchImage(for: photo) { (result) in // The index path for the photo might have been changed between // the time request started and finished, just find the most recent // index path guard let photoIndex = self.recentDataSource.photos.index(of: photo), case let .success(image) = result else { return } // The request finishes, update the cell if it is still visible let photoIndexPath = IndexPath(item: photoIndex, section: 0) if let cell = self.recentCollectionView.cellForItem(at: photoIndexPath) as? PhotoCollectionViewCell { cell.update(with: image) } } } } // The UI extension RecentPhotosViewController: UICollectionViewDelegateFlowLayout { func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { let collectionViewWidth = recentCollectionView.bounds.size.width let numberOfItemsPerRow: CGFloat = 4 let itemWidth = collectionViewWidth / numberOfItemsPerRow return CGSize(width: itemWidth, height: itemWidth) } override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) { recentCollectionView.reloadData() } }
[ -1 ]
01c26f7d798126de308bc094a0a6d0379b04fff6
a5021f94a2903a8808edfa98d3fcf30bf84eef9d
/PanModal/Controller/PanModalPresentationController.swift
ce7a812511acfeea9068f420469c713121142703
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
Lizonlin/PanModal
f6a854f789b8cae0153ed217f8afe0752c5f5733
103ca8255da8cc1ec645bad7da1a77f61b64bad1
refs/heads/master
2021-07-20T13:53:29.918439
2020-08-17T15:11:25
2020-08-17T15:11:25
204,854,227
0
0
MIT
2019-08-28T13:22:19
2019-08-28T05:22:19
null
UTF-8
Swift
false
false
30,868
swift
// // PanModalPresentationController.swift // PanModal // // Copyright © 2019 Tiny Speck, Inc. All rights reserved. // #if os(iOS) import UIKit /** The PanModalPresentationController is the middle layer between the presentingViewController and the presentedViewController. It controls the coordination between the individual transition classes as well as provides an abstraction over how the presented view is presented & displayed. For example, we add a drag indicator view above the presented view and a background overlay between the presenting & presented view. The presented view's layout configuration & presentation is defined using the PanModalPresentable. By conforming to the PanModalPresentable protocol & overriding values the presented view can define its layout configuration & presentation. */ open class PanModalPresentationController: UIPresentationController { /** Enum representing the possible presentation states */ public enum PresentationState { case shortForm case longForm } /** Constants */ struct Constants { static let indicatorYOffset = CGFloat(8.0) static let snapMovementSensitivity = CGFloat(0.7) static let dragIndicatorSize = CGSize(width: 36.0, height: 5.0) } // MARK: - Properties /** A flag to track if the presented view is animating */ private var isPresentedViewAnimating = false /** A flag to determine if scrolling should seamlessly transition from the pan modal container view to the scroll view once the scroll limit has been reached. */ private var extendsPanScrolling = true /** A flag to determine if scrolling should be limited to the longFormHeight. Return false to cap scrolling at .max height. */ private var anchorModalToLongForm = true /** The y content offset value of the embedded scroll view */ private var scrollViewYOffset: CGFloat = 0.0 /** An observer for the scroll view content offset */ private var scrollObserver: NSKeyValueObservation? // store the y positions so we don't have to keep re-calculating /** The y value for the short form presentation state */ private var shortFormYPosition: CGFloat = 0 /** The y value for the long form presentation state */ private var longFormYPosition: CGFloat = 0 /** Determine anchored Y postion based on the `anchorModalToLongForm` flag */ private var anchoredYPosition: CGFloat { let defaultTopOffset = presentable?.topOffset ?? 0 return anchorModalToLongForm ? longFormYPosition : defaultTopOffset } /** Configuration object for PanModalPresentationController */ private var presentable: PanModalPresentable? { return presentedViewController as? PanModalPresentable } // MARK: - Views /** Background view used as an overlay over the presenting view */ private lazy var backgroundView: DimmedView = { let view: DimmedView if let color = presentable?.panModalBackgroundColor { view = DimmedView(dimColor: color) } else { view = DimmedView() } view.didTap = { [weak self] _ in if self?.presentable?.allowsTapToDismiss == true { self?.presentedViewController.dismiss(animated: true) } } return view }() /** A wrapper around the presented view so that we can modify the presented view apperance without changing the presented view's properties */ private lazy var panContainerView: PanContainerView = { let frame = containerView?.frame ?? .zero return PanContainerView(presentedView: presentedViewController.view, frame: frame) }() /** Drag Indicator View */ private lazy var dragIndicatorView: UIView = { let view = UIView() view.backgroundColor = presentable?.dragIndicatorBackgroundColor view.layer.cornerRadius = Constants.dragIndicatorSize.height / 2.0 return view }() /** Override presented view to return the pan container wrapper */ public override var presentedView: UIView { return panContainerView } // MARK: - Gesture Recognizers /** Gesture recognizer to detect & track pan gestures */ private lazy var panGestureRecognizer: UIPanGestureRecognizer = { let gesture = UIPanGestureRecognizer(target: self, action: #selector(didPanOnPresentedView(_ :))) gesture.minimumNumberOfTouches = 1 gesture.maximumNumberOfTouches = 1 gesture.delegate = self return gesture }() // MARK: - Deinitializers deinit { scrollObserver?.invalidate() } // MARK: - Lifecycle override public func containerViewWillLayoutSubviews() { super.containerViewWillLayoutSubviews() configureViewLayout() } override public func presentationTransitionWillBegin() { guard let containerView = containerView else { return } layoutBackgroundView(in: containerView) layoutPresentedView(in: containerView) configureScrollViewInsets() guard let coordinator = presentedViewController.transitionCoordinator else { backgroundView.dimState = .max return } coordinator.animate(alongsideTransition: { [weak self] _ in self?.backgroundView.dimState = .max self?.presentedViewController.setNeedsStatusBarAppearanceUpdate() }) } override public func presentationTransitionDidEnd(_ completed: Bool) { if completed { return } backgroundView.removeFromSuperview() } override public func dismissalTransitionWillBegin() { presentable?.panModalWillDismiss() guard let coordinator = presentedViewController.transitionCoordinator else { backgroundView.dimState = .off return } /** Drag indicator is drawn outside of view bounds so hiding it on view dismiss means avoiding visual bugs */ coordinator.animate(alongsideTransition: { [weak self] _ in self?.dragIndicatorView.alpha = 0.0 self?.backgroundView.dimState = .off self?.presentingViewController.setNeedsStatusBarAppearanceUpdate() }) } override public func dismissalTransitionDidEnd(_ completed: Bool) { if !completed { return } presentable?.panModalDidDismiss() } /** Update presented view size in response to size class changes */ override public func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) { super.viewWillTransition(to: size, with: coordinator) coordinator.animate(alongsideTransition: { [weak self] _ in guard let self = self, let presentable = self.presentable else { return } self.adjustPresentedViewFrame() if presentable.shouldRoundTopCorners { self.addRoundedCorners(to: self.presentedView) } }) } } // MARK: - Public Methods public extension PanModalPresentationController { /** Transition the PanModalPresentationController to the given presentation state */ func transition(to state: PresentationState) { guard presentable?.shouldTransition(to: state) == true else { return } presentable?.willTransition(to: state) switch state { case .shortForm: snap(toYPosition: shortFormYPosition) case .longForm: snap(toYPosition: longFormYPosition) } } /** Operations on the scroll view, such as content height changes, or when inserting/deleting rows can cause the pan modal to jump, caused by the pan modal responding to content offset changes. To avoid this, you can call this method to perform scroll view updates, with scroll observation temporarily disabled. */ func performUpdates(_ updates: () -> Void) { guard let scrollView = presentable?.panScrollable else { return } // Pause scroll observer scrollObserver?.invalidate() scrollObserver = nil // Perform updates updates() // Resume scroll observer trackScrolling(scrollView) observe(scrollView: scrollView) } /** Updates the PanModalPresentationController layout based on values in the PanModalPresentable - Note: This should be called whenever any pan modal presentable value changes after the initial presentation */ func setNeedsLayoutUpdate() { configureViewLayout() adjustPresentedViewFrame() observe(scrollView: presentable?.panScrollable) configureScrollViewInsets() } } // MARK: - Presented View Layout Configuration private extension PanModalPresentationController { /** Boolean flag to determine if the presented view is anchored */ var isPresentedViewAnchored: Bool { if !isPresentedViewAnimating && extendsPanScrolling && presentedView.frame.minY.rounded() <= anchoredYPosition.rounded() { return true } return false } /** Adds the presented view to the given container view & configures the view elements such as drag indicator, rounded corners based on the pan modal presentable. */ func layoutPresentedView(in containerView: UIView) { /** If the presented view controller does not conform to pan modal presentable don't configure */ guard let presentable = presentable else { return } /** ⚠️ If this class is NOT used in conjunction with the PanModalPresentationAnimator & PanModalPresentable, the presented view should be added to the container view in the presentation animator instead of here */ containerView.addSubview(presentedView) containerView.addGestureRecognizer(panGestureRecognizer) if presentable.showDragIndicator { addDragIndicatorView(to: presentedView) } if presentable.shouldRoundTopCorners { addRoundedCorners(to: presentedView) } setNeedsLayoutUpdate() adjustPanContainerBackgroundColor() } /** Reduce height of presentedView so that it sits at the bottom of the screen */ func adjustPresentedViewFrame() { guard let frame = containerView?.frame else { return } let adjustedSize = CGSize(width: frame.size.width, height: frame.size.height - anchoredYPosition) let panFrame = panContainerView.frame panContainerView.frame.size = frame.size if ![shortFormYPosition, longFormYPosition].contains(panFrame.origin.y) { // if the container is already in the correct position, no need to adjust positioning // (rotations & size changes cause positioning to be out of sync) let yPosition = panFrame.origin.y - panFrame.height + frame.height presentedView.frame.origin.y = max(yPosition, anchoredYPosition) } panContainerView.frame.origin.x = frame.origin.x presentedViewController.view.frame = CGRect(origin: .zero, size: adjustedSize) } /** Adds a background color to the pan container view in order to avoid a gap at the bottom during initial view presentation in longForm (when view bounces) */ func adjustPanContainerBackgroundColor() { panContainerView.backgroundColor = presentedViewController.view.backgroundColor ?? presentable?.panScrollable?.backgroundColor } /** Adds the background view to the view hierarchy & configures its layout constraints. */ func layoutBackgroundView(in containerView: UIView) { containerView.addSubview(backgroundView) backgroundView.translatesAutoresizingMaskIntoConstraints = false backgroundView.topAnchor.constraint(equalTo: containerView.topAnchor).isActive = true backgroundView.leadingAnchor.constraint(equalTo: containerView.leadingAnchor).isActive = true backgroundView.trailingAnchor.constraint(equalTo: containerView.trailingAnchor).isActive = true backgroundView.bottomAnchor.constraint(equalTo: containerView.bottomAnchor).isActive = true } /** Adds the drag indicator view to the view hierarchy & configures its layout constraints. */ func addDragIndicatorView(to view: UIView) { view.addSubview(dragIndicatorView) dragIndicatorView.translatesAutoresizingMaskIntoConstraints = false dragIndicatorView.bottomAnchor.constraint(equalTo: view.topAnchor, constant: -Constants.indicatorYOffset).isActive = true dragIndicatorView.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true dragIndicatorView.widthAnchor.constraint(equalToConstant: Constants.dragIndicatorSize.width).isActive = true dragIndicatorView.heightAnchor.constraint(equalToConstant: Constants.dragIndicatorSize.height).isActive = true } /** Calculates & stores the layout anchor points & options */ func configureViewLayout() { guard let layoutPresentable = presentedViewController as? PanModalPresentable.LayoutType else { return } shortFormYPosition = layoutPresentable.shortFormYPos longFormYPosition = layoutPresentable.longFormYPos anchorModalToLongForm = layoutPresentable.anchorModalToLongForm extendsPanScrolling = layoutPresentable.allowsExtendedPanScrolling containerView?.isUserInteractionEnabled = layoutPresentable.isUserInteractionEnabled } /** Configures the scroll view insets */ func configureScrollViewInsets() { guard let scrollView = presentable?.panScrollable, !scrollView.isScrolling else { return } /** Disable vertical scroll indicator until we start to scroll to avoid visual bugs */ scrollView.showsVerticalScrollIndicator = false scrollView.scrollIndicatorInsets = presentable?.scrollIndicatorInsets ?? .zero /** Set the appropriate contentInset as the configuration within this class offsets it */ scrollView.contentInset.bottom = presentingViewController.bottomLayoutGuide.length /** As we adjust the bounds during `handleScrollViewTopBounce` we should assume that contentInsetAdjustmentBehavior will not be correct */ if #available(iOS 11.0, *) { scrollView.contentInsetAdjustmentBehavior = .never } } } // MARK: - Pan Gesture Event Handler private extension PanModalPresentationController { /** The designated function for handling pan gesture events */ @objc func didPanOnPresentedView(_ recognizer: UIPanGestureRecognizer) { guard shouldRespond(to: recognizer), let containerView = containerView else { recognizer.setTranslation(.zero, in: recognizer.view) return } switch recognizer.state { case .began, .changed: /** Respond accordingly to pan gesture translation */ respond(to: recognizer) /** If presentedView is translated above the longForm threshold, treat as transition */ if presentedView.frame.origin.y == anchoredYPosition && extendsPanScrolling { presentable?.willTransition(to: .longForm) } default: /** Use velocity sensitivity value to restrict snapping */ let velocity = recognizer.velocity(in: presentedView) if isVelocityWithinSensitivityRange(velocity.y) { /** If velocity is within the sensitivity range, transition to a presentation state or dismiss entirely. This allows the user to dismiss directly from long form instead of going to the short form state first. */ if velocity.y < 0 { transition(to: .longForm) } else if (nearest(to: presentedView.frame.minY, inValues: [longFormYPosition, containerView.bounds.height]) == longFormYPosition && presentedView.frame.minY < shortFormYPosition) || presentable?.allowsDragToDismiss == false { transition(to: .shortForm) } else { presentedViewController.dismiss(animated: true) } } else { /** The `containerView.bounds.height` is used to determine how close the presented view is to the bottom of the screen */ let position = nearest(to: presentedView.frame.minY, inValues: [containerView.bounds.height, shortFormYPosition, longFormYPosition]) if position == longFormYPosition { transition(to: .longForm) } else if position == shortFormYPosition || presentable?.allowsDragToDismiss == false { transition(to: .shortForm) } else { presentedViewController.dismiss(animated: true) } } } } /** Determine if the pan modal should respond to the gesture recognizer. If the pan modal is already being dragged & the delegate returns false, ignore until the recognizer is back to it's original state (.began) ⚠️ This is the only time we should be cancelling the pan modal gesture recognizer */ func shouldRespond(to panGestureRecognizer: UIPanGestureRecognizer) -> Bool { guard presentable?.shouldRespond(to: panGestureRecognizer) == true || !(panGestureRecognizer.state == .began || panGestureRecognizer.state == .cancelled) else { panGestureRecognizer.isEnabled = false panGestureRecognizer.isEnabled = true return false } return !shouldFail(panGestureRecognizer: panGestureRecognizer) } /** Communicate intentions to presentable and adjust subviews in containerView */ func respond(to panGestureRecognizer: UIPanGestureRecognizer) { presentable?.willRespond(to: panGestureRecognizer) var yDisplacement = panGestureRecognizer.translation(in: presentedView).y /** If the presentedView is not anchored to long form, reduce the rate of movement above the threshold */ if presentedView.frame.origin.y < longFormYPosition { yDisplacement /= 2.0 } adjust(toYPosition: presentedView.frame.origin.y + yDisplacement) panGestureRecognizer.setTranslation(.zero, in: presentedView) } /** Determines if we should fail the gesture recognizer based on certain conditions We fail the presented view's pan gesture recognizer if we are actively scrolling on the scroll view. This allows the user to drag whole view controller from outside scrollView touch area. Unfortunately, cancelling a gestureRecognizer means that we lose the effect of transition scrolling from one view to another in the same pan gesture so don't cancel */ func shouldFail(panGestureRecognizer: UIPanGestureRecognizer) -> Bool { /** Allow api consumers to override the internal conditions & decide if the pan gesture recognizer should be prioritized. ⚠️ This is the only time we should be cancelling the panScrollable recognizer, for the purpose of ensuring we're no longer tracking the scrollView */ guard !shouldPrioritize(panGestureRecognizer: panGestureRecognizer) else { presentable?.panScrollable?.panGestureRecognizer.isEnabled = false presentable?.panScrollable?.panGestureRecognizer.isEnabled = true return false } guard isPresentedViewAnchored, let scrollView = presentable?.panScrollable, scrollView.contentOffset.y > 0 else { return false } let loc = panGestureRecognizer.location(in: presentedView) return (scrollView.frame.contains(loc) || scrollView.isScrolling) } /** Determine if the presented view's panGestureRecognizer should be prioritized over embedded scrollView's panGestureRecognizer. */ func shouldPrioritize(panGestureRecognizer: UIPanGestureRecognizer) -> Bool { return panGestureRecognizer.state == .began && presentable?.shouldPrioritize(panModalGestureRecognizer: panGestureRecognizer) == true } /** Check if the given velocity is within the sensitivity range */ func isVelocityWithinSensitivityRange(_ velocity: CGFloat) -> Bool { return (abs(velocity) - (1000 * (1 - Constants.snapMovementSensitivity))) > 0 } func snap(toYPosition yPos: CGFloat) { PanModalAnimator.animate({ [weak self] in self?.adjust(toYPosition: yPos) self?.isPresentedViewAnimating = true }, config: presentable) { [weak self] didComplete in self?.isPresentedViewAnimating = !didComplete } } /** Sets the y position of the presentedView & adjusts the backgroundView. */ func adjust(toYPosition yPos: CGFloat) { presentedView.frame.origin.y = max(yPos, anchoredYPosition) guard presentedView.frame.origin.y > shortFormYPosition else { backgroundView.dimState = .max return } let yDisplacementFromShortForm = presentedView.frame.origin.y - shortFormYPosition /** Once presentedView is translated below shortForm, calculate yPos relative to bottom of screen and apply percentage to backgroundView alpha */ if let color = presentable?.panModalBackgroundColor { backgroundView.backgroundColor = color } backgroundView.dimState = .percent(1.0 - (yDisplacementFromShortForm / presentedView.frame.height)) } /** Finds the nearest value to a given number out of a given array of float values - Parameters: - number: reference float we are trying to find the closest value to - values: array of floats we would like to compare against */ func nearest(to number: CGFloat, inValues values: [CGFloat]) -> CGFloat { guard let nearestVal = values.min(by: { abs(number - $0) < abs(number - $1) }) else { return number } return nearestVal } } // MARK: - UIScrollView Observer private extension PanModalPresentationController { /** Creates & stores an observer on the given scroll view's content offset. This allows us to track scrolling without overriding the scrollView delegate */ func observe(scrollView: UIScrollView?) { scrollObserver?.invalidate() scrollObserver = scrollView?.observe(\.contentOffset, options: .old) { [weak self] scrollView, change in /** Incase we have a situation where we have two containerViews in the same presentation */ guard self?.containerView != nil else { return } self?.didPanOnScrollView(scrollView, change: change) } } /** Scroll view content offset change event handler Also when scrollView is scrolled to the top, we disable the scroll indicator otherwise glitchy behaviour occurs This is also shown in Apple Maps (reverse engineering) which allows us to seamlessly transition scrolling from the panContainerView to the scrollView */ func didPanOnScrollView(_ scrollView: UIScrollView, change: NSKeyValueObservedChange<CGPoint>) { guard !presentedViewController.isBeingDismissed, !presentedViewController.isBeingPresented else { return } if !isPresentedViewAnchored && scrollView.contentOffset.y > 0 { /** Hold the scrollView in place if we're actively scrolling and not handling top bounce */ haltScrolling(scrollView) } else if scrollView.isScrolling || isPresentedViewAnimating { if isPresentedViewAnchored { /** While we're scrolling upwards on the scrollView, store the last content offset position */ trackScrolling(scrollView) } else { /** Keep scroll view in place while we're panning on main view */ haltScrolling(scrollView) } } else if presentedViewController.view.isKind(of: UIScrollView.self) && !isPresentedViewAnimating && scrollView.contentOffset.y <= 0 { /** In the case where we drag down quickly on the scroll view and let go, `handleScrollViewTopBounce` adds a nice elegant touch. */ handleScrollViewTopBounce(scrollView: scrollView, change: change) } else { trackScrolling(scrollView) } } /** Halts the scroll of a given scroll view & anchors it at the `scrollViewYOffset` */ func haltScrolling(_ scrollView: UIScrollView) { scrollView.setContentOffset(CGPoint(x: 0, y: scrollViewYOffset), animated: false) scrollView.showsVerticalScrollIndicator = false } /** As the user scrolls, track & save the scroll view y offset. This helps halt scrolling when we want to hold the scroll view in place. */ func trackScrolling(_ scrollView: UIScrollView) { scrollViewYOffset = max(scrollView.contentOffset.y, 0) scrollView.showsVerticalScrollIndicator = true } /** To ensure that the scroll transition between the scrollView & the modal is completely seamless, we need to handle the case where content offset is negative. In this case, we follow the curve of the decelerating scroll view. This gives the effect that the modal view and the scroll view are one view entirely. - Note: This works best where the view behind view controller is a UIScrollView. So, for example, a UITableViewController. */ func handleScrollViewTopBounce(scrollView: UIScrollView, change: NSKeyValueObservedChange<CGPoint>) { guard let oldYValue = change.oldValue?.y, scrollView.isDecelerating else { return } let yOffset = scrollView.contentOffset.y let presentedSize = containerView?.frame.size ?? .zero /** Decrease the view bounds by the y offset so the scroll view stays in place and we can still get updates on its content offset */ presentedView.bounds.size = CGSize(width: presentedSize.width, height: presentedSize.height + yOffset) if oldYValue > yOffset { /** Move the view in the opposite direction to the decreasing bounds until half way through the deceleration so that it appears as if we're transferring the scrollView drag momentum to the entire view */ presentedView.frame.origin.y = longFormYPosition - yOffset } else { scrollViewYOffset = 0 snap(toYPosition: longFormYPosition) } scrollView.showsVerticalScrollIndicator = false } } // MARK: - UIGestureRecognizerDelegate extension PanModalPresentationController: UIGestureRecognizerDelegate { /** Do not require any other gesture recognizers to fail */ public func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldBeRequiredToFailBy otherGestureRecognizer: UIGestureRecognizer) -> Bool { return false } /** Allow simultaneous gesture recognizers only when the other gesture recognizer's view is the pan scrollable view */ public func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool { return otherGestureRecognizer.view == presentable?.panScrollable } } // MARK: - UIBezierPath private extension PanModalPresentationController { /** Draws top rounded corners on a given view We have to set a custom path for corner rounding because we render the dragIndicator outside of view bounds */ func addRoundedCorners(to view: UIView) { let radius = presentable?.cornerRadius ?? 0 let path = UIBezierPath(roundedRect: view.bounds, byRoundingCorners: [.topLeft, .topRight], cornerRadii: CGSize(width: radius, height: radius)) // Draw around the drag indicator view, if displayed if presentable?.showDragIndicator == true { let indicatorLeftEdgeXPos = view.bounds.width/2.0 - Constants.dragIndicatorSize.width/2.0 drawAroundDragIndicator(currentPath: path, indicatorLeftEdgeXPos: indicatorLeftEdgeXPos) } view.layer.cornerRadius = radius view.clipsToBounds = true } /** Draws a path around the drag indicator view */ func drawAroundDragIndicator(currentPath path: UIBezierPath, indicatorLeftEdgeXPos: CGFloat) { let totalIndicatorOffset = Constants.indicatorYOffset + Constants.dragIndicatorSize.height // Draw around drag indicator starting from the left path.addLine(to: CGPoint(x: indicatorLeftEdgeXPos, y: path.currentPoint.y)) path.addLine(to: CGPoint(x: path.currentPoint.x, y: path.currentPoint.y - totalIndicatorOffset)) path.addLine(to: CGPoint(x: path.currentPoint.x + Constants.dragIndicatorSize.width, y: path.currentPoint.y)) path.addLine(to: CGPoint(x: path.currentPoint.x, y: path.currentPoint.y + totalIndicatorOffset)) } } // MARK: - Helper Extensions private extension UIScrollView { /** A flag to determine if a scroll view is scrolling */ var isScrolling: Bool { return isDragging && !isDecelerating || isTracking } } #endif
[ 354905, 167137, 173606 ]
bd42c30b585358b65430f2b205d3eafddbd169e1
1532cce0c5704d7c0c8e07f0ca4ea3f5733c555a
/testloop.playground/section-1.swift
2432895547bd23945c2f3c278c117f9676859f0b
[]
no_license
55011212144kong/55011212144_kittaphart
052a06506c30e1dc5b9fee6d78d3b0731cf0832b
82b06058ab20f0ce2173363a6646ec5131caa19d
refs/heads/master
2016-09-10T00:20:41.369532
2014-12-17T11:43:04
2014-12-17T11:43:04
null
0
0
null
null
null
null
UTF-8
Swift
false
false
854
swift
//loop var i = 1 println("start\(i)") while i < 5{ println("round\(i)") i = i+1 } let m=2 var im=1 while im <= 12{ var av = m*im println("\(m) * \(im) = \(av)") im = im+1 } //do while var r = 1 println("startdo \(r)") do { println("rounddo \(r)") r = r+1 } while r < 5 let mdo = 2 var imdo = 1 do{ var avdo = mdo*imdo println("\(mdo) * \(imdo) = \(avdo)") imdo += 1 } while imdo <= 12 //for var first = 1 println("startforround \(first)") for i in 0..<4 { println("forround \(first) i \(i)") first += 1 } var first2 = 1 println("startfortwo \(first2)") for var i = 0; i < 4;++i { println("forroundtwo \(first2)") first2 += 1 } var num = 2 for i = 1;i <= 12; ++i { var av = num*i println("\(num) * \(i) = \(av)") } for i=5; i>=1;--i{ println("i : \(i)") }
[ -1 ]
eba8fa569d292765dc15cca0438fb242a2dd5b14
b274697c6087be20aad843fe25665c6c33273095
/B2BSimpleApp/B2BSimpleApp/LevelThreeCatRemoteManagerImpl.swift
51b33be542578cd0e024a5a72d9c363cf7a4093e
[ "MIT" ]
permissive
philipgreat/b2b-swift-app
fce12f94bb3b5364b3c2ed39daab9a4c715d5d1c
a21c39df2d96b2eb285404791fbe8a995d701728
refs/heads/master
2020-04-06T06:53:31.614701
2016-08-26T14:56:34
2016-08-26T14:56:34
65,030,311
0
0
null
null
null
null
UTF-8
Swift
false
false
2,376
swift
//Domain B2B/LevelThreeCat/ import SwiftyJSON import Alamofire import ObjectMapper class LevelThreeCatRemoteManagerImpl:RemoteManagerImpl,CustomStringConvertible{ override init(){ //lazy load for all the properties //This is good for UI applications as it might saves RAM which is very expensive in mobile devices } override var remoteURLPrefix:String{ //Every manager need to config their own URL return "https://philipgreat.github.io/naf/levelThreeCatManager/" } func loadLevelThreeCatDetail(levelThreeCatId:String, levelThreeCatSuccessAction: (LevelThreeCat)->String, levelThreeCatErrorAction: (String)->String){ let methodName = "loadLevelThreeCatDetail" let parameters = [levelThreeCatId] let url = compositeCallURL(methodName, parameters: parameters) Alamofire.request(.GET, url).validate().responseJSON { response in switch response.result { case .Success: if let value = response.result.value { let json = JSON(value) if let levelThreeCat = self.extractLevelThreeCatFromJSON(json){ levelThreeCatSuccessAction(levelThreeCat) } } case .Failure(let error): print(error) levelThreeCatErrorAction("\(error)") } } } func extractLevelThreeCatFromJSON(json:JSON) -> LevelThreeCat?{ let jsonTool = SwiftyJSONTool() let levelThreeCat = jsonTool.extractLevelThreeCat(json) return levelThreeCat } //Confirming to the protocol CustomStringConvertible of Foundation var description: String{ //Need to find out a way to improve this method performance as this method might called to //debug or log, using + is faster than \(var). let result = "LevelThreeCatRemoteManagerImpl, V1" return result } static var CLASS_VERSION = 1 //This value is for serializer like message pack to identify the versions match between //local and remote object. } //Reference http://grokswift.com/simple-rest-with-swift/ //Reference https://github.com/SwiftyJSON/SwiftyJSON //Reference https://github.com/Alamofire/Alamofire //Reference https://github.com/Hearst-DD/ObjectMapper //let remote = RemoteManagerImpl() //let result = remote.compositeCallURL(methodName: "getDetail",parameters:["O0000001"]) //print(result)
[ -1 ]
4ea787d673ae7646414fd721a628193dcf21fce8
47de88b54e5d2da7e633f1a5593445a5e1d37566
/H4X0R News/Views/ContentView.swift
06b099e78672f255c3e561367b9bbffe6f3bcbf4
[]
no_license
artem-tkachuk/H4X0R-News
6436a1ffeaf552846d1188b50404b7d0ffcfbbf9
f40b644a379d86fd6d6aff461243364ff6a967a0
refs/heads/master
2022-11-25T23:23:58.813317
2020-07-31T03:41:31
2020-07-31T03:41:31
283,853,837
0
0
null
null
null
null
UTF-8
Swift
false
false
857
swift
// // ContentView.swift // H4X0R News // // Created by Artem Tkachuk on 7/29/20. // Copyright © 2020 Artem Tkachuk. All rights reserved. // import SwiftUI struct ContentView: View { @ObservedObject var networkManager = NetworkManager() var body: some View { NavigationView { List(networkManager.posts) { post in NavigationLink(destination: DetailView(url: post.url)) { HStack { Text(String(post.points)) Text(post.title) } } } .navigationBarTitle("H4X0R NEWS") } .onAppear { self.networkManager.fetchData() } } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } }
[ 352911 ]
cb4cb7653b6718e0d0f03eb006981cc576c1cfe4
ac1b628a32d38f842b54a61733896fc57df08160
/rigestrationUITests/rigestrationUITests.swift
d2ebc30850ef749a4acfacfd72cec0a709071fcb
[]
no_license
minamonz/rigestration
a87c8783bc6df56dd3e6cc81e0937dec8785fff9
7a30d43d712946015c045b6e67eace09e8169a03
refs/heads/master
2020-03-13T07:05:34.899470
2018-04-29T19:29:57
2018-04-29T19:29:57
null
0
0
null
null
null
null
UTF-8
Swift
false
false
1,244
swift
// // rigestrationUITests.swift // rigestrationUITests // // Created by Mac on 3/20/18. // Copyright © 2018 mina. All rights reserved. // import XCTest class rigestrationUITests: 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, 241695, 237599, 223269, 229414, 292901, 315431, 102441, 315433, 278571, 313388, 325675, 102446, 282671, 354346, 229425, 124974, 243763, 241717, 180279, 229431, 215095, 319543, 213051, 288829, 325695, 288835, 286787, 307269, 237638, 313415, 239689, 233548, 311373, 315468, 196687, 278607, 311377, 354386, 223317, 315477, 368732, 180317, 323678, 315488, 321632, 45154, 280676, 313446, 307306, 217194, 194667, 233578, 278637, 288878, 319599, 278642, 284789, 131190, 288890, 215165, 131199, 278669, 235661, 333968, 241809, 323730, 278676, 311447, 153752, 327834, 284827, 278684, 329884, 299166, 278690, 233635, 311459, 215204, 333990, 284840, 299176, 184489, 284843, 323761, 184498, 278713, 223418, 280761, 258233, 295099, 180409, 227517, 299197, 280767, 299202, 139459, 309443, 176325, 338118, 131270, 299208, 227525, 301255, 280779, 227536, 282832, 301270, 229591, 301271, 280792, 147679, 147680, 325857, 311520, 356575, 280803, 307431, 338151, 182503, 319719, 295147, 317676, 286957, 125166, 125170, 395511, 313595, 184574, 309504, 125184, 217352, 125192, 125197, 194832, 227601, 125200, 319764, 278805, 338196, 125204, 334104, 315674, 282908, 299294, 125215, 282912, 233761, 278817, 311582, 211239, 282920, 334121, 317738, 325930, 311596, 338217, 125225, 321839, 336177, 315698, 98611, 125236, 282938, 307514, 127292, 278843, 168251, 287040, 319812, 311622, 280903, 227655, 323914, 201037, 383309, 282959, 229716, 250196, 289109, 168280, 323934, 391521, 239973, 381286, 285031, 313703, 416103, 280938, 242027, 242028, 321901, 354671, 278895, 287089, 250227, 199030, 315768, 291193, 139641, 223611, 291194, 313726, 311679, 211327, 291200, 240003, 158087, 313736, 227721, 242059, 311692, 106893, 227730, 285074, 240020, 190870, 315798, 190872, 291225, 293275, 285083, 317851, 242079, 227743, 285089, 293281, 289185, 305572, 156069, 283039, 301482, 289195, 375211, 311723, 377265, 334259, 338359, 299449, 319931, 311739, 293309, 278974, 336319, 311744, 317889, 291266, 336323, 278979, 278988, 129484, 281038, 281039, 278992, 283089, 283088, 289229, 326093, 279000, 176602, 242138, 160224, 279009, 291297, 285152, 369121, 188899, 279014, 242150, 195044, 279017, 319976, 311787, 334315, 302539, 281071, 319986, 236020, 279030, 311800, 293368, 279033, 317949, 322396, 279042, 283138, 233987, 324098, 287237, 334345, 309770, 340489, 342537, 279053, 322057, 283154, 303634, 279060, 279061, 303635, 182802, 279066, 322077, 291359, 342560, 293420, 236080, 283185, 289328, 279092, 23093, 234037, 244279, 244280, 338491, 234044, 340539, 301635, 309831, 55880, 322119, 377419, 303693, 281165, 301647, 281170, 326229, 115287, 189016, 309847, 244311, 332379, 111197, 295518, 287327, 283431, 242274, 244326, 279143, 279150, 281200, 287345, 313970, 301688, 189054, 303743, 297600, 287359, 291455, 301702, 279176, 311944, 334473, 344714, 316044, 311948, 311950, 316048, 326288, 316050, 311953, 287379, 336531, 295575, 227991, 289435, 303772, 205469, 221853, 285348, 314020, 340645, 279207, 295591, 176810, 248494, 279215, 293552, 295598, 285362, 299698, 279218, 166581, 164532, 342705, 285360, 287412, 303802, 314043, 287418, 154295, 66243, 291529, 287434, 363212, 225996, 135888, 279249, 242385, 164561, 303826, 369365, 369366, 279253, 158424, 230105, 299737, 322269, 338658, 342757, 295653, 289511, 230120, 234216, 330473, 285419, 330476, 289517, 279278, 312046, 215790, 170735, 125683, 230133, 199415, 342775, 234233, 242428, 279293, 289534, 205566, 35584, 299777, 322302, 228099, 285443, 375552, 291584, 291591, 322312, 346889, 285450, 295688, 312076, 326413, 285457, 295698, 291605, 166677, 207639, 283418, 285467, 221980, 281378, 234276, 336678, 318247, 203560, 279337, 293673, 262952, 289580, 318251, 262957, 164655, 328495, 301872, 234290, 303921, 285493, 230198, 285496, 301883, 201534, 289599, 342846, 222017, 295745, 281407, 293702, 318279, 283466, 281426, 279379, 244569, 234330, 281434, 295769, 201562, 275294, 301919, 230238, 279393, 293729, 357219, 281444, 303973, 279398, 351078, 349025, 177002, 308075, 242540, 242542, 310132, 295797, 228214, 207735, 201590, 295799, 177018, 279418, 269179, 308093, 336765, 314240, 291713, 158594, 330627, 340865, 240517, 228232, 416649, 279434, 320394, 316299, 252812, 234382, 308111, 189327, 308113, 293780, 310166, 289691, 209820, 240543, 283551, 310177, 289704, 293801, 279465, 326571, 177074, 304050, 326580, 289720, 326586, 289723, 189373, 213956, 359365, 19398, 345030, 281541, 213961, 127945, 279499, 211913, 56270, 191445, 304086, 183254, 207839, 340960, 234469, 314343, 123880, 340967, 324587, 234476, 320492, 203758, 320495, 248815, 289773, 287730, 240631, 214009, 201721, 312313, 312317, 354342, 234499, 418819, 293894, 330759, 320520, 322571, 230411, 330766, 320526, 234513, 238611, 293911, 140311, 238617, 197658, 316441, 326684, 336930, 132140, 113710, 189487, 281647, 322609, 318515, 312372, 203829, 238646, 300087, 238650, 320571, 21567, 308288, 336962, 160834, 314437, 349254, 238663, 300109, 234578, 207954, 250965, 205911, 339031, 296023, 314458, 156763, 281698, 285795, 230500, 281699, 250982, 322664, 228457, 279659, 318571, 234606, 230514, 238706, 187508, 312435, 279666, 300147, 302202, 285819, 314493, 285823, 234626, 279686, 222344, 285833, 285834, 234635, 228492, 318602, 337037, 177297, 187539, 347286, 324761, 285850, 296091, 119965, 234655, 300192, 302239, 339106, 306339, 234662, 300200, 302251, 208044, 238764, 249003, 3243, 322733, 294069, 324790, 300215, 64699, 294075, 228541, 339131, 343230, 283841, 148674, 283846, 312519, 279752, 283849, 148687, 290001, 189651, 316628, 279766, 189656, 279775, 304352, 339167, 310496, 298209, 304353, 279780, 228587, 279789, 290030, 302319, 234741, 316661, 208123, 292092, 279803, 228608, 320769, 322826, 242955, 312588, 177420, 318732, 126229, 318746, 320795, 320802, 130342, 304422, 130344, 130347, 292145, 298290, 208179, 312628, 345398, 300342, 159033, 222523, 286012, 181568, 279872, 279874, 300355, 193858, 294210, 216387, 372039, 300354, 304457, 230730, 345418, 337228, 296269, 222542, 224591, 234830, 238928, 296274, 331091, 318804, 150868, 314708, 283990, 357720, 314711, 300378, 300379, 294236, 316764, 314721, 230757, 281958, 314727, 134504, 306541, 314734, 327023, 312688, 234864, 296304, 316786, 230772, 314740, 314742, 327030, 284015, 310650, 224637, 306558, 337280, 306561, 243073, 314752, 179586, 294278, 314759, 296328, 296330, 298378, 368012, 314765, 318860, 304523, 9618, 279955, 306580, 314771, 224662, 112019, 314776, 234902, 282008, 292242, 318876, 282013, 290206, 343457, 148899, 314788, 298406, 282023, 245160, 279979, 279980, 241067, 314797, 286128, 173492, 279988, 286133, 284086, 259513, 310714, 284090, 228796, 302523, 54719, 302530, 280003, 228804, 292291, 306630, 415170, 300488, 310725, 306634, 300490, 280011, 310731, 339403, 337359, 329168, 312785, 222674, 329170, 280020, 234957, 310735, 280025, 310747, 239069, 144862, 286176, 187877, 310758, 320997, 280042, 280043, 191980, 300526, 329198, 337391, 282097, 296434, 308722, 40439, 191991, 286201, 300539, 288252, 210429, 359931, 312830, 290304, 245249, 228868, 292359, 218632, 323079, 302602, 230922, 323083, 294413, 359949, 304655, 323088, 329231, 282132, 302613, 316951, 175640, 374297, 282135, 302620, 222754, 306730, 312879, 230960, 288305, 290359, 239159, 323132, 235069, 157246, 288319, 288322, 280131, 349764, 282182, 194118, 288328, 292424, 292426, 286281, 124486, 333389, 224848, 349780, 290391, 128600, 235096, 239192, 196184, 306777, 212574, 99937, 204386, 300643, 323171, 300645, 282214, 294220, 345697, 312937, 204394, 224874, 243306, 312941, 138862, 206447, 310896, 314997, 294517, 290425, 339579, 337533, 325246, 333438, 280193, 282244, 239238, 288391, 282248, 286344, 323208, 286351, 188049, 229011, 239251, 280217, 323226, 229021, 302751, 198304, 282272, 245413, 282279, 298664, 298666, 317102, 286387, 300725, 286392, 300729, 302778, 306875, 280252, 280253, 282302, 323262, 286400, 321217, 296636, 323265, 321220, 282309, 280259, 239305, 296649, 306891, 212684, 241360, 282321, 313042, 286419, 333522, 241366, 280279, 282330, 18139, 280285, 294621, 282336, 325345, 321250, 294629, 153318, 337638, 333543, 12009, 181992, 282347, 288492, 34547, 67316, 323315, 286457, 284410, 313082, 200444, 288508, 282366, 286463, 319232, 288515, 249606, 323335, 282375, 284425, 300810, 282379, 216844, 116491, 284430, 300812, 161553, 124691, 278292, 118549, 278294, 282390, 116502, 284436, 325403, 321308, 321309, 341791, 241440, 282401, 339746, 282399, 186148, 186149, 216868, 241447, 315172, 333609, 294699, 284460, 280367, 300849, 282418, 280373, 280377, 319289, 321338, 282428, 280381, 345918, 413500, 241471, 280386, 325444, 280391, 153416, 315209, 325449, 159563, 280396, 307024, 325460, 237397, 341846, 18263, 317268, 241494, 284508, 300893, 307038, 370526, 237411, 284515, 276326, 282471, 296807, 292713, 282476, 292719, 296815, 313200, 325491, 313204, 317305, 317308, 339840, 315265, 280451, 325508, 327556, 333700, 282503, 67464, 243592, 305032, 325514, 350091, 350092, 188293, 311183, 184207, 315272, 315275, 282517, 294806, 350102, 214936, 294808, 337816, 239515, 333727, 298912, 319393, 214943, 294820, 118693, 333734, 219046, 284584, 294824, 313257, 292783, 126896, 300983, 343993, 288698, 98240, 294849, 214978, 280517, 280518, 214983, 282572, 282573, 153553, 24531, 231382, 323554, 292835, 190437, 292838, 294887, 317416, 174058, 278507, 313322, 311277, 296942, 298987, 124912, 327666, 278515, 325620, 239610 ]
3da75f92dec42390ad5b4a0d72525028a496501f
8b4c0a72f9ba38416d0a333622d1b781009b2558
/ImportantMessages/ViewController.swift
9beaae7efcbcf40dcd3b2c2d04e75f2c3478f6b1
[ "MIT" ]
permissive
HybridFast/ImportantMessages
2faebcc04a7518bae33bc4a2a71d5c828877eae1
b36c075bac323630cb66375ba208bff24f6f412a
refs/heads/master
2020-06-20T15:20:09.704705
2019-06-24T15:48:21
2019-06-24T15:48:21
null
0
0
null
null
null
null
UTF-8
Swift
false
false
1,063
swift
// // ViewController.swift // ImportantMessages // // Created by Matthew Waller on 4/26/19. // Copyright © 2019 Matthew Waller. All rights reserved. // import UIKit import NaturalLanguage class ViewController: UIViewController { @IBOutlet weak var sentimentTextField: UITextField! @IBOutlet weak var sentimentLabel: UILabel! override func viewDidLoad() { super.viewDidLoad() sentimentTextField.delegate = self } @IBAction func checkImportanceTapped(_ sender: UIButton) { guard let text = sentimentTextField.text, text.isEmpty == false else { return } // guard let languageModel = try? NLModel(mlModel: sentimentModel.model) else { // return // } // // sentimentLabel.text = languageModel.predictedLabel(for: text) } } extension ViewController: UITextFieldDelegate { func textFieldShouldReturn(_ textField: UITextField) -> Bool { textField.resignFirstResponder() return true } }
[ -1 ]
8ab8e1509289ccade64cd9d87f7dca919eed7648
71d699fc15d724c4a9f9c3efde5384c5e52e60cb
/FriendlyChatSwift/SignInViewController.swift
8d75bc9644d0401e3565ad2ecdae382fe7112936
[]
no_license
petrovrus/FirebaseGoogleCodelab
9b9b13bef3d1129dcbc938cdf12d66fed7afc698
9f82fdf0afdf79caa0d6889120923931c906bfb7
refs/heads/master
2021-01-23T08:29:54.230874
2017-09-05T22:30:20
2017-09-05T22:30:20
102,529,890
1
1
null
null
null
null
UTF-8
Swift
false
false
1,376
swift
// // Copyright (c) 2015 Google 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 UIKit import Firebase import GoogleSignIn @objc(SignInViewController) class SignInViewController: UIViewController, GIDSignInUIDelegate { @IBOutlet weak var signInButton: GIDSignInButton! var handle: AuthStateDidChangeListenerHandle? override func viewDidLoad() { super.viewDidLoad() GIDSignIn.sharedInstance().uiDelegate = self GIDSignIn.sharedInstance().signInSilently() handle = Auth.auth().addStateDidChangeListener() { (auth, user) in if user != nil { MeasurementHelper.sendLoginEvent() self.performSegue(withIdentifier: Constants.Segues.SignInToFp, sender: nil) } } } deinit { if let handle = handle { Auth.auth().removeStateDidChangeListener(handle) } } }
[ 301750 ]
e414b873f5cc4f23f9696b427bae9acfa6f0d1b8
ca0db83aef442a0dee4cae39169f05ccd43466e8
/iDownloader/IDMProRow.swift
a1cea533ed8bbd459fa7251d3f8607bfd0201db2
[]
no_license
abhpan27/downloader
53a97932cf93f5fb339e05a27da845496cd9c8d0
41198e04c64c3e77e89de510fd7b4900b8675049
refs/heads/master
2021-01-22T20:55:12.469611
2017-05-07T09:29:07
2017-05-07T09:29:07
85,377,090
0
0
null
null
null
null
UTF-8
Swift
false
false
2,319
swift
// // IDMProRow.swift // iDownloader // // Created by Abhishek Pandey on 29/04/17. // Copyright © 2017 Abhishek Pandey. All rights reserved. // import Cocoa protocol IDMShowProProtocol:class { func didSelectedShowPro() } class IDMProRow: NSView { static let IDMViewName = "IDMProRow" static func createView() -> IDMProRow { var array = NSArray() let nibContent = AutoreleasingUnsafeMutablePointer<NSArray>?(&array) Bundle.main.loadNibNamed(IDMViewName, owner: nil, topLevelObjects: nibContent) let view = nibContent!.pointee.filter { $0 is IDMProRow }.first as! IDMProRow return view } @IBOutlet weak var rocketContainer: NSView! @IBOutlet weak var container: NSView! override func viewDidMoveToWindow() { container.wantsLayer = true container.layer?.borderWidth = 1.0 container.layer?.borderColor = NSColor(IDMr: 178, g: 164, b: 164).cgColor container.layer?.backgroundColor = NSColor.white.cgColor rocketContainer.wantsLayer = true rocketContainer.layer?.borderWidth = 1.0 rocketContainer.layer?.borderColor = NSColor(IDMr: 79, g: 79, b: 79).cgColor rocketContainer.layer?.cornerRadius = rocketContainer.frame.width/2 } weak var delegate:IDMShowProProtocol? fileprivate var trackingArea:NSTrackingArea? override func updateTrackingAreas() { if (self.trackingArea != nil) { self.removeTrackingArea(trackingArea!) } self.trackingArea = NSTrackingArea( rect: self.visibleRect, options: [NSTrackingAreaOptions.activeInActiveApp, NSTrackingAreaOptions.cursorUpdate], owner: self, userInfo: nil ) if (self.trackingArea != nil) { self.addTrackingArea(self.trackingArea!) } super.updateTrackingAreas() } override func mouseDown(with event: NSEvent) { delegate?.didSelectedShowPro() } override func cursorUpdate(with event: NSEvent) { NSCursor.pointingHand().set() } override func resetCursorRects() { self.addCursorRect(self.visibleRect, cursor: NSCursor.pointingHand()) } }
[ -1 ]
974d622748c277dfc2ec80d3be89c71768285e7c
b3e9f083d71cdb553b95fafd9c31e97fcd94b268
/Model/DataSink.swift
80d75125fff055a2ad26dbfd75ca44e966c62494
[]
no_license
mynguyen5194/WarcraftOSX
b569cae7997149a1f4c66ed6509cb632cc4ca2b1
d32af9cbae88be3ac69e1a27580053df1a535199
refs/heads/master
2021-01-18T22:17:09.925216
2017-03-01T06:17:08
2017-03-01T06:17:08
87,041,604
0
0
null
null
null
null
UTF-8
Swift
false
false
322
swift
// // DataSink.swift // Warcraft // // Created by My Nguyen on 1/24/17. // Copyright © 2017 My Nguyen. All rights reserved. // import Foundation //import Model.DataContainer protocol CDataSink { func Write(data:Any.Type, length:Int) -> Int func Container() -> AnyClass //FIXME: CDataContainer }
[ -1 ]
01bed08880d4ffabf6cb6a40b9abc7331f9924bf
2481a8b9782d8a0bbb181ab0a6b06659d6d8aa1e
/PokeClient/Networking/ApiClient.swift
ca6b0a8556d9239f58ddbf3d0539bf24b6811942
[]
no_license
TiagoSantosSilva/PokeClient
c0294a3111df6e5a2baf6e87fab9331d5b4e138c
21419a4fe7e950a41c8738a0e7a2a016d58d665c
refs/heads/master
2021-05-05T11:35:40.341118
2018-05-09T11:02:35
2018-05-09T11:02:35
118,143,826
0
0
null
null
null
null
UTF-8
Swift
false
false
1,207
swift
// // ApiClient.swift // PokeClient // // Created by Tiago Santos on 23/01/18. // Copyright © 2018 Tiago Santos. All rights reserved. // import Foundation typealias ImageDataCompletion = (Data?, DataManagerError?) -> () class ApiClient { let baseUrl: URL init(baseUrl: URL) { self.baseUrl = baseUrl } func getImageData(pokemonNumber: String, completion: @escaping ImageDataCompletion) { guard let url = setImageRequestUrl(pokemonNumber: pokemonNumber) else { completion(nil, nil) return } URLSession.shared.dataTask(with: url) { (data, response, error) in guard error == nil else { completion(nil, .InvalidResponse) return } completion(data, nil) }.resume() } func setImageRequestUrl(pokemonNumber: String) -> URL? { var baseUri = self.baseUrl.absoluteString baseUri = baseUri.replacingOccurrences(of: "pokemon_id", with: pokemonNumber) baseUri = baseUri.replacingOccurrences(of: "pokemon_number", with: pokemonNumber) return URL(string: baseUri)! } }
[ -1 ]
3f712e9e1a2d6d094541c2a142f61bea86a2ee76
d55e8494c7379b5e318f053e6462dbeb672c8587
/SwiftStorageExample/Swift学习/SwiftLearnViewController.swift
a378aee7123fc43a9a72eb2d7c7bab3a13c0108b
[]
no_license
zhaixingxing0501/SwiftStorageExample
b2677107dbc38567b3edd90a6b3fa2afc4a38578
ac110185d984260bde165c409859071323163d1c
refs/heads/master
2023-02-02T18:37:32.319833
2020-12-23T08:44:11
2020-12-23T08:44:11
323,822,483
0
0
null
null
null
null
UTF-8
Swift
false
false
698
swift
// // SwiftLearnViewController.swift // SwiftStorageExample // // Created by nucarf on 2020/12/23. // import UIKit class SwiftLearnViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() _ = HigherOrderFunction() // Do any additional setup after loading the view. } /* // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepare(for segue: UIStoryboardSegue, sender: Any?) { // Get the new view controller using segue.destination. // Pass the selected object to the new view controller. } */ }
[ -1 ]
c5a114bcad6ea96fa9989c83c3ae5eec61bb596c
6240787fd67205cdfc30fbbdd91e615be76a2405
/Rainstorm/View Controllers/Weather View Controllers/Week View Controller/View Models/WeekViewModel.swift
1189d0cf2e7bd30763dea73badc120dbcb1c64be
[]
no_license
nstandage/rainstorm
4c1798beccb7dc7d2fc21c91c4eadde5f7728a2d
c98f1a81254da998e36835f624c7546be25460e5
refs/heads/master
2020-03-26T10:06:14.933297
2018-08-22T00:45:32
2018-08-22T00:45:32
144,781,336
0
0
null
null
null
null
UTF-8
Swift
false
false
252
swift
// // WeekViewModel.swift // Rainstorm // // Created by Nathan Standage on 8/20/18. // Copyright © 2018 Nathan Standage. All rights reserved. // import Foundation struct WeekViewModel { let weatherData: [ForecastWeatherConditions] }
[ -1 ]
d6e4c45a642c8e056ac4d679a7ce956b477c85f9
ac45ff14fdaf14732b579802f4893f57ecb6ad1b
/PokeDBUITests/PokeDBUITests.swift
75a9c4b2cbe99e3e5a2d22dc9e1c956b723bade5
[]
no_license
artbleymy/PokeDB
93afb3810cd2bf0bebed7eeb0660e29b640aa79c
564e90d5196d35c2805a5b53c4527a1548c9cb9f
refs/heads/develop
2022-12-14T10:54:19.572513
2020-09-08T08:15:56
2020-09-08T08:15:56
288,506,544
0
0
null
2020-09-08T08:15:57
2020-08-18T16:23:46
Swift
UTF-8
Swift
false
false
524
swift
// // PokeDBUITests.swift // PokeDBUITests // // Created by Станислав Козлов on 18.08.2020. // Copyright © 2020 stanislavkozlov. All rights reserved. // import XCTest final class PokeDBUITests: XCTestCase { override func setUpWithError() throws { continueAfterFailure = false } override func tearDownWithError() throws { } func testUIExample1() throws { // let app = XCUIApplication() // app.launch() } func testUIExample2() throws { // let app = XCUIApplication() // app.launch() } }
[ -1 ]
9afe077b8871da6a8b724d0011c9cf50ded30b81
8a60fd59428a6ae6ebbf4743c04bf97acb22f842
/Ruidai/Product.swift
82fb147406cad8d8ee211fefdc20f63947a7baab
[]
no_license
WatermelonPrince/rdaikuan
0174fb6df71d88a079622c62d9771f55345b8c7a
708e6dd8a7ed962be175f0eda4fb6649e3fc54bc
refs/heads/master
2021-04-15T12:59:54.194521
2018-03-22T11:50:47
2018-03-22T11:50:47
126,327,629
0
0
null
null
null
null
UTF-8
Swift
false
false
1,134
swift
// // Product.swift // Loan // // Created by admin on 2017/8/17. // Copyright © 2017年 caipiao. All rights reserved. // import UIKit class Product: BaseModel { var productId: String?; var productName: String?; var productLogo: String?; var featureTagsList: Array<Tags>?; var recommendTagsList: Array<Tags>?; var authorizeTagsList: Array<Tags>?; var loanAmount: String?; var loanAmountTagsList: Array<Tags>?; var repayDays: String?; var repayDaysTagsList: Array<Tags>?; var monthRate: Double?; var dayRate: Double?; var averageAmount: String?; var requirements: String?; var applyFlowTagsList: Array<Tags>?; var auditDetail: String?; var guide: String?; var advantage: String?; var applyInterface : String?; var maxLoanAmount: String?; var positiveRate: String?; var productCount: String?; var strategyLink: String? var strategyImage: String? } class ProductDetailComponent : BaseModel{ var titleStr : String? var contentStr : String? var applyFlowTagsList: Array<Tags>?; var type : Int? }
[ -1 ]
5517c9a4408ca2849bcbd5bd5ba446d675305e59
32a06070d39e5db02629f8b20024fca96072fd0a
/lAzR4t watchOS App Extension/ExtensionDelegate.swift
9113389783aea789d32304b652c72d94e4e2105f
[ "MIT" ]
permissive
Jakobeha/lAzR4t
b3233c80245be68bf08de6abb31351143323d402
ad2d9569db69a055649e0e762b4dfbeae1dde3e3
refs/heads/master
2021-07-07T16:56:31.971535
2017-10-02T21:08:05
2017-10-02T21:08:05
105,447,380
1
0
null
null
null
null
UTF-8
Swift
false
false
2,514
swift
// // ExtensionDelegate.swift // lAzR4t watchOS App Extension // // Created by Jakob Hain on 9/29/17. // Copyright © 2017 Jakob Hain. All rights reserved. // import WatchKit class ExtensionDelegate: NSObject, WKExtensionDelegate { func applicationDidFinishLaunching() { // Perform any final initialization of your application. } func applicationDidBecomeActive() { // 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 applicationWillResignActive() { // 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, etc. } func handle(_ backgroundTasks: Set<WKRefreshBackgroundTask>) { // Sent when the system needs to launch the application in the background to process tasks. Tasks arrive in a set, so loop through and process each one. for task in backgroundTasks { // Use a switch statement to check the task type switch task { case let backgroundTask as WKApplicationRefreshBackgroundTask: // Be sure to complete the background task once you’re done. backgroundTask.setTaskCompletedWithSnapshot(false) case let snapshotTask as WKSnapshotRefreshBackgroundTask: // Snapshot tasks have a unique completion call, make sure to set your expiration date snapshotTask.setTaskCompleted(restoredDefaultState: true, estimatedSnapshotExpiration: Date.distantFuture, userInfo: nil) case let connectivityTask as WKWatchConnectivityRefreshBackgroundTask: // Be sure to complete the connectivity task once you’re done. connectivityTask.setTaskCompletedWithSnapshot(false) case let urlSessionTask as WKURLSessionRefreshBackgroundTask: // Be sure to complete the URL session task once you’re done. urlSessionTask.setTaskCompletedWithSnapshot(false) default: // make sure to complete unhandled task types task.setTaskCompletedWithSnapshot(false) } } } }
[ 313604, 286341, 312968, 302729, 330506, 177291, 179598, 205971, 316820, 333717, 292374, 320539, 324764, 218523, 399006, 205983, 216863, 36769, 241445, 266917, 168102, 192042, 140077, 40493, 61871, 164399, 219697, 108210, 238648, 228666, 159036, 312895, 159809, 15683, 309448, 298954, 193483, 19915, 310349, 196689, 377684, 259412, 196055, 241501, 200799, 234975, 224638, 166372, 157285, 177125, 286180, 350310, 229222, 175742, 318446, 287728, 108912, 328946, 299765, 144503, 234743, 153086 ]
a94cc6fafb582283db1cefccaffd3b89996abde6
dcde5b49bb7b012774a2df83a2a676c9184a2c96
/ruby-china-ios/Controllers/RootViewController.swift
47f9762dd895ad92b2a2a6d7d258e28a0023a72b
[ "MIT" ]
permissive
guoyu07/ruby-china-ios
489b7415882e393c660719ff2f5a668bdfef6cf8
dbebf9f78320f09bed169141c70b59251dd30de3
refs/heads/master
2021-05-14T09:37:50.750285
2017-10-01T05:19:06
2017-10-01T05:19:06
null
0
0
null
null
null
null
UTF-8
Swift
false
false
7,052
swift
// // RootViewController.swift // ruby-china-ios // // Created by 柯磊 on 16/8/2. // Copyright © 2016年 ruby-china. All rights reserved. // import UIKit import SideMenu class RootViewController: UITabBarController { fileprivate let kTopicsTag = 0 fileprivate let kWikiTag = 1 fileprivate let kFavoritesTag = 2 fileprivate let kNotificationsTag = 99 fileprivate var isDidAppear = false fileprivate var needDisplayNotifications = false fileprivate func setupSideMenu() { SideMenuManager.menuLeftNavigationController = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "sideMenuController") as? UISideMenuNavigationController SideMenuManager.menuFadeStatusBar = false SideMenuManager.menuPresentMode = .viewSlideOut SideMenuManager.menuAnimationBackgroundColor = UIColor.gray } fileprivate func setupViewControllers() { let topicsController = RootTopicsViewController() topicsController.tabBarItem = UITabBarItem(title: "topics".localized, image: UIImage(named: "topic"), tag: kTopicsTag) let pagesController = WebViewController(path: "/wiki") pagesController.tabBarItem = UITabBarItem(title: "wiki".localized, image: UIImage(named: "wiki"), tag: kWikiTag) let favoritesController = FavoriteTopicsViewController() favoritesController.tabBarItem = UITabBarItem(title: "favorites".localized, image: UIImage(named: "favorites"), tag: kFavoritesTag) let notificationsController = NotificationsViewController(path: "/notifications") notificationsController.tabBarItem = UITabBarItem(title: "notifications".localized, image: UIImage(named: "notifications"), tag: kNotificationsTag) viewControllers = [topicsController, pagesController, favoritesController, notificationsController] viewControllers?.forEach({ (viewController) in let oldImage = viewController.tabBarItem.image viewController.tabBarItem.image = oldImage?.imageWithColor(BLACK_COLOR)?.withRenderingMode(.alwaysOriginal) }) } @objc func displaySideMenu() { let presentSideMenuController = { if let sideMenuController = SideMenuManager.menuLeftNavigationController { self.present(sideMenuController, animated: true, completion: nil) } } presentSideMenuController() } @objc func actionMenuClicked(_ note: Notification) { let path = (note as NSNotification).userInfo![NOTICE_MENU_CLICKED_PATH] as! String if let url = URL(string: path), let host = url.host , host != URL(string: ROOT_URL)!.host! { TurbolinksSessionLib.shared.safariOpen(url) } else { TurbolinksSessionLib.shared.action(.Advance, path: path) } } override func viewDidLoad() { super.viewDidLoad() navigationItem.leftBarButtonItems = [ UIBarButtonItem.fixNavigationSpacer(), UIBarButtonItem.narrowButtonItem(image: UIImage(named: "menu"), target: self, action: #selector(displaySideMenu)) ] delegate = self setupSideMenu() setupViewControllers() NotificationCenter.default.addObserver(self, selector: #selector(displaySideMenu), name: NSNotification.Name(NOTICE_DISPLAY_MENU), object: nil) NotificationCenter.default.addObserver(self, selector: #selector(actionMenuClicked), name: NSNotification.Name(NOTICE_MENU_CLICKED), object: nil) NotificationCenter.default.addObserver(self, selector: #selector(updateLoginState), name: NSNotification.Name(NOTICE_USER_CHANGED), object: nil) resetNavigationItem(viewControllers![selectedIndex]) } override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) isDidAppear = true if let app = UIApplication.shared.delegate as? AppDelegate { app.refreshUnreadNotificationCount() } if needDisplayNotifications { needDisplayNotifications = false displayNotifications() } } fileprivate func resetNavigationItem(_ viewController: UIViewController) { navigationItem.title = viewController.navigationItem.title navigationItem.titleView = viewController.navigationItem.titleView navigationItem.rightBarButtonItems = viewController.navigationItem.rightBarButtonItems } @objc func updateLoginState() { if let viewController = selectedViewController , OAuth2.shared.currentUser == nil { switch viewController.tabBarItem.tag { case kFavoritesTag, kNotificationsTag: let topicsController = viewControllers![0] selectedViewController = topicsController resetNavigationItem(topicsController) default: break } } if let app = UIApplication.shared.delegate as? AppDelegate { app.refreshUnreadNotificationCount() } } func displayNotifications() { if !isDidAppear { needDisplayNotifications = true return } if presentedViewController != nil { dismiss(animated: false, completion: nil) } if let viewController = navigationController?.viewControllers.last , viewController != self { _ = navigationController?.popToViewController(self, animated: false) } guard let notificationsController = viewControllers!.last as? NotificationsViewController else { return } if selectedViewController == notificationsController { return } if tabBarController(self, shouldSelect: notificationsController) { selectedViewController = notificationsController resetNavigationItem(notificationsController) } } } extension RootViewController: UITabBarControllerDelegate { func tabBarController(_ tabBarController: UITabBarController, shouldSelect viewController: UIViewController) -> Bool { let tag = viewController.tabBarItem.tag if (tag == kFavoritesTag || tag == kNotificationsTag) && !OAuth2.shared.isLogined { SignInViewController.show().onDidAuthenticate = { [weak self] (sender) in self?.selectedViewController = viewController self?.resetNavigationItem(viewController) } return false } if let webViewController = viewController as? WebViewController , webViewController == selectedViewController { TurbolinksSessionLib.shared.visitableDidRequestRefresh(webViewController) } return true } func tabBarController(_ tabBarController: UITabBarController, didSelect viewController: UIViewController) { resetNavigationItem(viewController) } }
[ -1 ]
99d0ddc3b2971d2e8c6bcfc4279504425f5586a0
3e3fa2f066134f4a0e16ef2bb48206a334bef7bd
/walker/AppDelegate.swift
55f443d2fad6f7976fb9634f59e63daf058d79b3
[]
no_license
kevinlin505/MyBlock
71ada244c1f99557573d38836068b728972a5e3b
121400b54cd36c2f320af85af465afc5777bb20c
refs/heads/master
2021-01-10T23:07:20.481952
2016-10-11T17:00:59
2016-10-11T17:00:59
70,615,742
0
0
null
null
null
null
UTF-8
Swift
false
false
4,773
swift
// // AppDelegate.swift // walker // // Created by Kevin Lin on 10/11/16. // Copyright © 2016 klin. 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. self.window = UIWindow(frame: UIScreen.main.bounds) self.window?.rootViewController = TabBarViewController(); self.window?.makeKeyAndVisible() 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:. // Saves changes in the application's managed object context before the application terminates. self.saveContext() } // MARK: - Core Data stack lazy var persistentContainer: NSPersistentContainer = { /* The persistent container for the application. This implementation creates and returns a container, having loaded the store for the application to it. This property is optional since there are legitimate error conditions that could cause the creation of the store to fail. */ let container = NSPersistentContainer(name: "walker") container.loadPersistentStores(completionHandler: { (storeDescription, error) in if let error = error as NSError? { // Replace this implementation with code to handle the error appropriately. // fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. /* Typical reasons for an error here include: * The parent directory does not exist, cannot be created, or disallows writing. * The persistent store is not accessible, due to permissions or data protection when the device is locked. * The device is out of space. * The store could not be migrated to the current model version. Check the error message to determine what the actual problem was. */ fatalError("Unresolved error \(error), \(error.userInfo)") } }) return container }() // MARK: - Core Data Saving support func saveContext () { let context = persistentContainer.viewContext if context.hasChanges { do { try context.save() } catch { // Replace this implementation with code to handle the error appropriately. // fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. let nserror = error as NSError fatalError("Unresolved error \(nserror), \(nserror.userInfo)") } } } }
[ 294405, 243717, 163848, 313353, 320008, 320014, 313360, 288275, 322580, 289300, 290326, 329747, 139803, 103964, 322080, 306721, 229408, 296483, 322083, 229411, 306726, 309287, 308266, 292907, 217132, 322092, 40495, 316465, 288306, 322102, 324663, 308281, 322109, 286783, 315457, 313409, 313413, 349765, 320582, 309832, 288329, 242250, 215117, 196177, 241746, 344661, 231000, 212571, 300124, 287323, 309342, 325220, 306790, 310378, 296043, 311914, 322666, 334446, 239726, 307310, 292466, 314995, 307315, 314487, 291450, 314491, 222846, 288383, 318599, 312970, 239252, 311444, 294038, 311449, 323739, 300194, 298662, 233638, 233644, 286896, 295600, 300208, 286389, 294070, 125111, 234677, 321212, 309439, 235200, 284352, 296641, 242371, 302787, 284360, 321228, 319181, 298709, 284374, 189654, 182486, 320730, 241371, 311516, 357083, 179420, 317665, 298210, 311525, 288489, 290025, 229098, 307436, 304365, 323310, 125167, 313073, 286455, 306424, 322299, 319228, 302332, 319231, 184576, 309505, 241410, 311043, 366339, 309509, 318728, 125194, 234763, 125201, 296218, 313116, 237858, 326434, 295716, 313125, 300836, 289577, 125226, 133421, 317233, 241971, 316726, 318264, 201530, 313660, 159549, 287038, 292159, 182079, 218943, 288578, 301893, 234828, 292172, 300882, 321364, 243032, 201051, 230748, 258397, 294238, 298844, 300380, 291169, 199020, 293741, 266606, 319342, 292212, 313205, 244598, 316788, 124796, 196988, 305022, 317821, 243072, 314241, 303999, 242050, 325509, 293767, 316300, 306576, 322448, 308114, 319900, 298910, 313250, 308132, 316327, 306605, 316334, 324015, 324017, 200625, 300979, 316339, 322998, 296888, 316345, 67000, 300987, 319932, 310718, 292288, 317888, 323520, 312772, 298950, 306632, 310733, 289744, 310740, 235994, 286174, 315359, 240098, 323555, 236008, 319465, 248299, 311789, 326640, 188913, 203761, 320498, 314357, 288246, 309243, 300540, 310782 ]
7d1be87ffe0682d0602da3130ee970223148216a
fdab80910921c336e66f0852d7d1517f38ebbfbe
/Memorize/EmojiMemoryGame.swift
a2df4c7cc2890a1b2150f824abae41b65d6f42fc
[]
no_license
LovreAB17/Memorize
c18a93025da1d34f5708f04c79093bbb2b298946
38a2a12cab6aeb3ad07e89d8d674077a7a3adc0b
refs/heads/main
2023-03-28T18:09:04.641261
2021-04-04T19:49:04
2021-04-04T19:49:04
354,627,899
0
0
null
null
null
null
UTF-8
Swift
false
false
1,141
swift
// // EmojiMemoryGame.swift // Memorize // // Created by Lovre Budimir on 28/10/2020. // import SwiftUI func createCardContent(pairIndex: Int) -> String { return "😃" } class EmojiMemoryGame: ObservableObject { @Published private var memoryGame: MemoryGame<String> = EmojiMemoryGame.createMemoryGame() private static func createMemoryGame() -> MemoryGame<String> { var emojis: Array<String> = ["👻", "😃", "🕷", "💀", "🎃", "🧟", "🧛🏼", "👽"] emojis.shuffle() let numberOfPairsOfCards = Int.random(in: 2...5) return MemoryGame<String>(numberOfPairsOfCards: numberOfPairsOfCards) { pairIndex in return emojis[pairIndex] } // Model } // MARK: - Access to the Model var cards: Array<MemoryGame<String>.Card> { memoryGame.cards //or return memoryGame.cards } // MARK: - Intent(s) func choose(card: MemoryGame<String>.Card){ memoryGame.choose(card: card) } func resetGame() { memoryGame = EmojiMemoryGame.createMemoryGame() } }
[ -1 ]
8cde574f7c438e5e2abfbdb6bb7058e6d43a51b3
b17f7e1df6720e7e152100126792f71a0811491f
/Calculator/AppDelegate.swift
e6c4cb1adb21c9b8892cce0577159ea20b6dca73
[]
no_license
Marquis-H/calculator
6fac1f25b9301d1a3c7089fe4e209539b4dfb362
8f5e4bd6da9e788f1cd5f9cb5e7c861e498cba4a
refs/heads/master
2021-06-01T12:27:58.930327
2015-09-09T11:09:24
2015-09-09T11:09:24
null
0
0
null
null
null
null
UTF-8
Swift
false
false
2,141
swift
// // AppDelegate.swift // Calculator // // Created by Marquis on 15/8/26. // Copyright (c) 2015年 Marquis. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { // Override point for customization after application launch. return true } func applicationWillResignActive(application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. } func applicationDidEnterBackground(application: UIApplication) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } func applicationWillEnterForeground(application: UIApplication) { // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. } func applicationDidBecomeActive(application: UIApplication) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } func applicationWillTerminate(application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } }
[ 229380, 229383, 229385, 278539, 229388, 294924, 278542, 229391, 327695, 278545, 229394, 278548, 229397, 229399, 229402, 278556, 229405, 352284, 278559, 229408, 278564, 294950, 229415, 229417, 327722, 237613, 229422, 360496, 229426, 237618, 229428, 286774, 229432, 286776, 286778, 319544, 204856, 286791, 237640, 278605, 286797, 311375, 163920, 237646, 196692, 319573, 311383, 278623, 278626, 319590, 311400, 278635, 303212, 278639, 278648, 131192, 237693, 327814, 131209, 417930, 303241, 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, 278760, 237807, 303345, 286962, 131314, 229622, 327930, 278781, 278783, 278785, 237826, 319751, 278792, 286987, 319757, 311569, 286999, 319770, 287003, 287006, 287009, 287012, 287014, 287016, 287019, 311598, 287023, 262448, 311601, 287032, 155966, 278849, 319809, 319810, 319814, 311623, 319818, 311628, 229709, 287054, 319822, 278865, 229717, 196963, 196969, 139638, 213367, 106872, 319872, 311683, 319879, 311693, 65943, 319898, 311719, 278952, 139689, 278957, 311728, 278967, 180668, 311741, 278975, 319938, 278980, 98756, 278983, 319945, 278986, 319947, 278990, 278994, 311767, 279003, 279006, 188895, 172512, 279010, 287202, 279015, 172520, 319978, 279020, 172526, 279023, 311791, 172529, 279027, 319989, 164343, 180727, 279035, 311804, 287230, 279040, 303617, 287234, 279045, 172550, 287238, 172552, 303623, 320007, 279051, 172558, 279055, 303632, 279058, 303637, 279063, 279067, 172572, 279072, 172577, 295459, 172581, 295461, 279082, 311850, 279084, 172591, 172598, 279095, 172607, 172609, 172612, 377413, 172614, 172618, 303690, 33357, 287309, 279124, 172634, 262752, 172644, 311911, 189034, 295533, 189039, 189040, 172655, 172656, 295538, 189044, 172660, 287349, 352880, 287355, 287360, 295553, 287365, 311942, 303751, 295557, 352905, 279178, 287371, 311946, 311951, 287377, 172691, 287381, 311957, 221850, 287386, 164509, 303773, 295583, 172702, 230045, 287394, 287390, 303780, 172705, 287398, 172707, 279208, 287400, 172714, 295595, 279212, 189102, 172721, 287409, 66227, 303797, 189114, 287419, 303804, 328381, 279231, 287423, 328384, 287427, 312006, 107208, 172748, 287436, 107212, 172751, 287440, 295633, 172755, 303827, 279255, 172760, 279258, 303835, 213724, 189149, 303838, 287450, 279267, 312035, 295654, 279272, 230128, 312048, 312050, 230131, 205564, 303871, 230146, 328453, 295685, 230154, 33548, 312077, 295695, 295701, 369433, 230169, 295707, 328476, 295710, 230175, 303914, 279340, 205613, 279353, 230202, 312124, 222018, 295755, 377676, 148302, 287569, 279383, 303959, 230237, 279390, 230241, 279394, 303976, 336744, 303985, 328563, 303987, 279413, 303991, 303997, 295806, 295808, 304005, 295813, 213895, 320391, 304007, 304009, 304011, 230284, 304013, 213902, 279438, 295822, 189329, 295825, 304019, 189331, 279445, 58262, 279452, 410526, 279461, 279462, 304042, 213931, 230327, 304055, 287675, 197564, 304063, 238528, 304065, 189378, 213954, 156612, 295873, 213963, 312272, 304084, 304090, 320481, 304106, 320490, 312302, 328687, 320496, 304114, 295928, 320505, 312321, 295945, 197645, 295949, 230413, 320528, 140312, 295961, 238620, 197663, 304164, 189479, 304170, 238641, 312374, 238652, 238655, 230465, 238658, 336964, 296004, 205895, 320584, 238666, 296021, 402518, 336987, 230497, 296036, 296040, 361576, 205931, 296044, 164973, 279661, 205934, 312432, 279669, 337018, 189562, 279679, 279683, 222340, 205968, 296084, 238745, 304285, 238756, 205991, 222377, 165035, 337067, 238766, 165038, 230576, 238770, 304311, 350308, 230592, 279750, 312518, 230600, 230607, 148690, 320727, 279769, 304348, 279777, 304354, 296163, 320740, 279781, 304360, 279788, 320748, 279790, 304370, 296189, 320771, 312585, 296202, 296205, 230674, 320786, 230677, 296213, 296215, 320792, 230681, 230679, 214294, 304416, 230689, 173350, 312622, 296243, 312630, 222522, 222525, 296253, 312639, 296255, 230718, 296259, 378181, 230727, 238919, 320840, 296264, 296267, 296271, 222545, 230739, 312663, 337244, 222556, 230752, 312676, 230760, 173418, 410987, 230763, 230768, 296305, 312692, 230773, 279929, 304506, 304505, 181626, 181631, 312711, 312712, 296331, 288140, 288144, 230800, 304533, 337306, 288154, 288160, 173472, 288162, 288164, 279975, 304555, 370092, 279983, 288176, 279985, 173488, 312755, 296373, 279991, 312759, 288185, 337335, 222652, 312766, 173507, 296389, 222665, 230860, 280014, 312783, 288208, 230865, 370130, 288210, 288212, 280021, 288214, 222676, 239064, 288217, 288218, 280027, 329177, 288220, 239070, 288224, 370146, 280034, 280036, 288226, 280038, 288229, 288230, 288232, 288234, 320998, 288236, 288238, 288240, 291754, 288242, 296435, 288244, 296439, 288250, 402942, 148990, 296446, 206336, 296450, 321022, 230916, 230919, 214535, 370187, 304651, 304653, 230940, 222752, 108066, 296486, 296488, 157229, 230961, 288320, 288325, 124489, 280140, 280145, 288338, 280149, 280152, 288344, 239194, 280158, 403039, 370272, 181854, 239202, 312938, 280183, 280185, 280188, 280191, 280194, 116354, 280208, 280211, 288408, 280218, 280222, 190118, 321195, 296622, 321200, 337585, 296626, 296634, 296637, 313027, 280260, 206536, 280264, 206539, 206541, 206543, 280276, 313044, 321239, 280283, 313052, 288478, 313055, 321252, 313066, 280302, 288494, 280304, 313073, 321266, 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, 304968, 280393, 280402, 313176, 42842, 280419, 321381, 296812, 313201, 1920, 255873, 305028, 280454, 247688, 280458, 280464, 124817, 280468, 239510, 280473, 124827, 214940, 247709, 214944, 280487, 313258, 321458, 296883, 124853, 214966, 10170, 296890, 288700, 296894, 280515, 190403, 296900, 337862, 165831, 280521, 231379, 296921, 239586, 313320, 231404, 124913, 165876, 321528, 239612, 313340, 288764, 239617, 313347, 288773, 313358, 321560, 305176, 313371, 354338, 305191, 223273, 313386, 354348, 124978, 215090, 124980, 288824, 288826, 321595, 378941, 313406, 288831, 288836, 67654, 223303, 280651, 354382, 288848, 280658, 215123, 354390, 288855, 288859, 280669, 313438, 223327, 280671, 149599, 321634, 149601, 149603, 329830, 280681, 313451, 223341, 280687, 313458, 280691, 215154, 313464, 329850, 321659, 280702, 288895, 321670, 215175, 141446, 141455, 141459, 280725, 313498, 288936, 100520, 280747, 288940, 280755, 288947, 321717, 280759, 280764, 280769, 280771, 280774, 280776, 313548, 321740, 280783, 280786, 280788, 313557, 280793, 280796, 280798, 338147, 280804, 280807, 157930, 280811, 280817, 280819, 157940, 125171, 182517, 280823, 280825, 280827, 280830, 280831, 280833, 280835, 125187, 125191, 125207, 125209, 321817, 125218, 321842, 223539, 125239, 280888, 280891, 289087, 280897, 280900, 239944, 305480, 280906, 239947, 305485, 305489, 379218, 280919, 354653, 313700, 280937, 313705, 280940, 190832, 280946, 223606, 313720, 280956, 239997, 280959, 313731, 199051, 240011, 289166, 240017, 297363, 190868, 297365, 240021, 297368, 297372, 141725, 297377, 289186, 297391, 289201, 240052, 289207, 305594, 289210, 281024, 289218, 289221, 289227, 281045, 281047, 215526, 166378, 305647, 281075, 174580, 281084, 240124, 305662, 305664, 240129, 305666, 305668, 240132, 223749, 281095, 338440, 150025, 223752, 223757, 281102, 223763, 223765, 281113, 322074, 281116, 281121, 182819, 281127, 281135, 150066, 158262, 158266, 289342, 281154, 322115, 158283, 281163, 281179, 199262, 338528, 338532, 281190, 199273, 281196, 158317, 19053, 313973, 281210, 297594, 158347, 133776, 314003, 117398, 314007, 289436, 174754, 330404, 289448, 133801, 174764, 314029, 314033, 240309, 133817, 314045, 314047, 314051, 199364, 297671, 199367, 158409, 289493, 363234, 289513, 289522, 289525, 289532, 322303, 289537, 322310, 264969, 322314, 322318, 281361, 281372, 322341, 215850, 281388, 281401, 289593, 289601, 281410, 281413, 281414, 240458, 281420, 240468, 281430, 322393, 297818, 281435, 281438, 281442, 174955, 224110, 207733, 207737, 183172, 158596, 240519, 322440, 338823, 314249, 183184, 289687, 240535, 297883, 289694, 289696, 289700, 289712, 281529, 289724, 52163, 183260, 281567, 289762, 322534, 297961, 281581, 183277, 322550, 134142, 322563, 175134, 322599, 322610, 314421, 281654, 314427, 207937, 314433, 314441, 207949, 322642, 314456, 281691, 314461, 281702, 281704, 314474, 281708, 281711, 289912, 248995, 306341, 306344, 306347, 306354, 142531, 199877, 289991, 306377, 289997, 249045, 363742, 363745, 298216, 330988, 126190, 216303, 322801, 388350, 257302, 363802, 199976, 199978, 314671, 298292, 298294, 257334, 216376, 298306, 380226, 281923, 224584, 224587, 224594, 216404, 306517, 150870, 314714, 224603, 159068, 314718, 265568, 314723, 281960, 150890, 306539, 314732, 314736, 290161, 216436, 306549, 298358, 314743, 306552, 290171, 314747, 306555, 290174, 298365, 224641, 281987, 298372, 314756, 281990, 224647, 265604, 298377, 314763, 142733, 298381, 224657, 306581, 314779, 314785, 282025, 314793, 282027, 241068, 241070, 241072, 282034, 241077, 150966, 298424, 306618, 282044, 323015, 306635, 306640, 290263, 290270, 290275, 339431, 282089, 191985, 282098, 290291, 282101, 241142, 191992, 290298, 151036, 290302, 282111, 290305, 175621, 192008, 323084, 257550, 282127, 290321, 282130, 323090, 282133, 290325, 241175, 290328, 282137, 290332, 241181, 282142, 282144, 290344, 306731, 290349, 290351, 290356, 282186, 224849, 282195, 282199, 282201, 306778, 159324, 159330, 314979, 298598, 323176, 224875, 241260, 323181, 257658, 315016, 282249, 290445, 324757, 282261, 298651, 282269, 323229, 298655, 323231, 61092, 282277, 306856, 282295, 282300, 323260, 323266, 282310, 323273, 282319, 306897, 241362, 282328, 298714, 52959, 216801, 282337, 241380, 216806, 323304, 282345, 12011, 282356, 323318, 282364, 282367, 306945, 241412, 323333, 282376, 216842, 323345, 282388, 323349, 282392, 184090, 315167, 315169, 282402, 315174, 323367, 241448, 315176, 282410, 241450, 306988, 306991, 315184, 323376, 315190, 241464, 282425, 159545, 298811, 307009, 413506, 241475, 307012, 148946, 315211, 282446, 307027, 315221, 282454, 315223, 241496, 323414, 241498, 307035, 307040, 282465, 110433, 241509, 110438, 298860, 110445, 282478, 315249, 110450, 315251, 282481, 315253, 315255, 339838, 282499, 315267, 315269, 241544, 282505, 241546, 241548, 298896, 298898, 282514, 44948, 298901, 241556, 282520, 241560, 241563, 241565, 241567, 241569, 282531, 241574, 282537, 298922, 36779, 241581, 282542, 241583, 323504, 241586, 282547, 241588, 290739, 241590, 241592, 241598, 290751, 241600, 241605, 151495, 241610, 298975, 241632, 298984, 241640, 241643, 298988, 241646, 241649, 241652, 323574, 290807, 241661, 299006, 282623, 315396, 241669, 315397, 282632, 282639, 290835, 282645, 241693, 282654, 241701, 102438, 217127, 282669, 323630, 282681, 290877, 282687, 159811, 315463, 315466, 192589, 307278, 192596, 176213, 307287, 315482, 315483, 217179, 192605, 233567, 200801, 299105, 217188, 299109, 307303, 315495, 356457, 45163, 307307, 315502, 192624, 307314, 323700, 299126, 233591, 299136, 307329, 307338, 233613, 241813, 307352, 299164, 184479, 299167, 184481, 315557, 184486, 307370, 307372, 184492, 307374, 307376, 323763, 176311, 299191, 307385, 307386, 258235, 176316, 307388, 307390, 184503, 299200, 184512, 307394, 307396, 299204, 184518, 307399, 323784, 307409, 307411, 176343, 299225, 233701, 307432, 184572, 282881, 184579, 282893, 291089, 282906, 291104, 233766, 282931, 307508, 315701, 307510, 332086, 307512, 151864, 176435, 307515, 168245, 282942, 307518, 151874, 282947, 282957, 323917, 110926, 233808, 323921, 315733, 323926, 233815, 315739, 323932, 299357, 242018, 242024, 299373, 315757, 250231, 242043, 315771, 299388, 299391, 291202, 299398, 242057, 291212, 299405, 291222, 283033, 291226, 242075, 315801, 291231, 61855, 283042, 291238, 291241, 127403, 127405, 291247, 127407, 299440, 299444, 127413, 283062, 291254, 127417, 291260, 283069, 127421, 127424, 299457, 127429, 127431, 283080, 176592, 315856, 315860, 176597, 127447, 283095, 299481, 176605, 242143, 291299, 127463, 242152, 291305, 127466, 176620, 127474, 291314, 291317, 135672, 233979, 291323, 291330, 283142, 127497, 233994, 135689, 291341, 233998, 234003, 234006, 152087, 127511, 283161, 242202, 234010, 135707, 242206, 135710, 242208, 291361, 242220, 291378, 234038, 152118, 234041, 70213, 242250, 111193, 242275, 299620, 242279, 168562, 184952, 135805, 291456, 135808, 373383, 299655, 135820, 316051, 225941, 316054, 299672, 135834, 373404, 299677, 225948, 135839, 299680, 225954, 299684, 242343, 209576, 242345, 373421, 135870, 135873, 135876, 135879, 299720, 299723, 225998, 299726, 226002, 226005, 119509, 226008, 242396, 299740, 201444, 299750, 283368, 234219, 283372, 381677, 226037, 283382, 234231, 316151, 234236, 226045, 234239, 242431, 209665, 234242, 299778, 242436, 226053, 234246, 226056, 234248, 291593, 242443, 234252, 242445, 234254, 291601, 234258, 242450, 242452, 234261, 348950, 201496, 234264, 234266, 234269, 283421, 234272, 234274, 152355, 234278, 299814, 283432, 234281, 234284, 234287, 283440, 185138, 242483, 234292, 234296, 234298, 283452, 160572, 234302, 234307, 242499, 234309, 292433, 234313, 316233, 316235, 234316, 283468, 242511, 234319, 234321, 234324, 185173, 201557, 234329, 234333, 308063, 234336, 234338, 242530, 349027, 234341, 234344, 234347, 177004, 234350, 324464, 234353, 152435, 177011, 234356, 234358, 234362, 226171, 234364, 291711, 234368, 234370, 201603, 291714, 234373, 226182, 234375, 291716, 226185, 308105, 234379, 234384, 234388, 234390, 226200, 324504, 234393, 209818, 308123, 324508, 234398, 234396, 291742, 234401, 291747, 291748, 234405, 291750, 234407, 324518, 324520, 234410, 324522, 226220, 291756, 234414, 324527, 291760, 234417, 201650, 324531, 226230, 234422, 275384, 324536, 234428, 291773, 234431, 242623, 324544, 324546, 226239, 324548, 226245, 234437, 234439, 234434, 234443, 291788, 275406, 234446, 193486, 234449, 316370, 193488, 234452, 234455, 234459, 234461, 234464, 234467, 234470, 168935, 5096, 324585, 234475, 234478, 316400, 234481, 316403, 234484, 234485, 324599, 234487, 234490, 234493, 234496, 316416, 234501, 275462, 308231, 234504, 234507, 234510, 234515, 300054, 234519, 316439, 234520, 234523, 234526, 234528, 300066, 234532, 300069, 234535, 234537, 234540, 144430, 234543, 234546, 275508, 234549, 300085, 300088, 234553, 234556, 234558, 316479, 234561, 316483, 234563, 308291, 234568, 234570, 316491, 300108, 234572, 234574, 300115, 234580, 234581, 275545, 242777, 234585, 234590, 234593, 234595, 300133, 234597, 234601, 300139, 234605, 234607, 160879, 275569, 234610, 300148, 234614, 398455, 144506, 275579, 234618, 234620, 234623, 226433, 234627, 275588, 234629, 242822, 234634, 275594, 234636, 177293, 234640, 275602, 234643, 226453, 275606, 234647, 275608, 308373, 234650, 234648, 308379, 283805, 234653, 324766, 119967, 234657, 300189, 324768, 242852, 283813, 234661, 300197, 234664, 275626, 234667, 316596, 308414, 234687, 300226, 308418, 226500, 234692, 300229, 308420, 283844, 283850, 300234, 300238, 300241, 316625, 300243, 300245, 316630, 300248, 300253, 300256, 300258, 300260, 234726, 300263, 300265, 161003, 300267, 300270, 300272, 120053, 300278, 316663, 275703, 300284, 275710, 300287, 283904, 300289, 292097, 300292, 300294, 275719, 300299, 177419, 283917, 300301, 242957, 177424, 275725, 349464, 283939, 259367, 283951, 292143, 300344, 226617, 283963, 243003, 226628, 283973, 300357, 177482, 283983, 316758, 357722, 316766, 292192, 316768, 218464, 292197, 316774, 243046, 218473, 284010, 136562, 324978, 275834, 333178, 275836, 275840, 316803, 316806, 226696, 316811, 226699, 316814, 226703, 300433, 234899, 226709, 357783, 316824, 316826, 144796, 300448, 144807, 144810, 284076, 144812, 144814, 144820, 284084, 284087, 292279, 144826, 144828, 144830, 144832, 144835, 284099, 144837, 38342, 144839, 144841, 144844, 144847, 144852, 144855, 103899, 300507, 333280, 226787, 218597, 292329, 300523, 259565, 300527, 308720, 259567, 226802, 316917, 308727, 292343, 300537, 316947, 308757, 308762, 284191, 284194, 284196, 235045, 284199, 284204, 284206, 284209, 284211, 284213, 194101, 284215, 194103, 284218, 226877, 284223, 284226, 243268, 292421, 226886, 284231, 128584, 284228, 284234, 276043, 317004, 366155, 284238, 226895, 284241, 194130, 284243, 276052, 276053, 284245, 284247, 317015, 284249, 243290, 284251, 300628, 284253, 235097, 284255, 300638, 243293, 284258, 292452, 292454, 284263, 177766, 284265, 292458, 284267, 292461, 284272, 284274, 276086, 284278, 292470, 292473, 284283, 276093, 284286, 276095, 284288, 292481, 276098, 284290, 325250, 284292, 292479, 292485, 284297, 317066, 284299, 317068, 276109, 284301, 284303, 276114, 284306, 284308, 284312, 284314, 284316, 276127, 284320, 284322, 284327, 276137, 284329, 284331, 317098, 284333, 284335, 276144, 284337, 284339, 300726, 284343, 284346, 284350, 276160, 358080, 284354, 358083, 276166, 284358, 358089, 276170, 284362, 276175, 284368, 276177, 284370, 317138, 284372, 358098, 284377, 276187, 284379, 284381, 284384, 284386, 358114, 358116, 276197, 317158, 358119, 284392, 325353, 284394, 358122, 284397, 276206, 284399, 358126, 358128, 358133, 358135, 276216, 358138, 300795, 358140, 284413, 358142, 284418, 358146, 317187, 317189, 317191, 284428, 300816, 300819, 317207, 284440, 186139, 300828, 300830, 276255, 325408, 284449, 300834, 300832, 227109, 317221, 358183, 186151, 276268, 300845, 194351, 243504, 300850, 284469, 276280, 325436, 358206, 276291, 366406, 276295, 300872, 153417, 284499, 276308, 284502, 317271, 178006, 276315, 292700, 284511, 227175, 292715, 300912, 284529, 292721, 300915, 284533, 292729, 317306, 284540, 292734, 325512, 169868, 276365, 284564, 358292, 284566, 350106, 284572, 276386, 284579, 276388, 358312, 284585, 317353, 276395, 292776, 292784, 276402, 358326, 161718, 276410, 276411, 358330, 276418, 276425, 301009, 301011, 301013, 292823, 301015, 301017, 358360, 292828, 276446, 153568, 276448, 276452, 276455, 292839, 292843, 276460, 276464, 178161, 227314, 276466, 276472, 325624, 317435, 276476, 276479, 276482, 276485, 317446, 276490, 292876, 276496, 317456, 317458, 243733, 243740, 317468, 317472, 325666, 243751, 292904, 276528, 243762, 309298, 325685, 325689, 276539, 235579, 235581, 325692, 178238, 276544, 284739, 292934, 276553, 243785, 350293, 350295, 194649, 227418, 309337, 350302, 227423, 194654, 194657, 178273, 276579, 227426, 194660, 227430, 276583, 309346, 309348, 276586, 309350, 309352, 309354, 276590, 350313, 350316, 350321, 284786, 276595, 227440, 301167, 350325, 350328, 292985, 301178, 292989, 292993, 301185, 350339, 317570, 317573, 350342, 227463, 350345, 350349, 301199, 317584, 325777, 350354, 350357, 350359, 350362, 276638, 350366, 284837, 153765, 350375, 350379, 350381, 350383, 129200, 350385, 350387, 350389, 350395, 350397, 350399, 227520, 350402, 227522, 301252, 350406, 227529, 309450, 301258, 276685, 276689, 309462, 301272, 276699, 309468, 194780, 309471, 301283, 317672, 276713, 317674, 325867, 243948, 194801, 227571, 309491, 276725, 309494, 243960, 276735, 227583, 227587, 276739, 211204, 276742, 227593, 227596, 325910, 309530, 342298, 276766, 211232, 317729, 276775, 211241, 325937, 276789, 325943, 211260, 260421, 276809, 285002, 276811, 235853, 276816, 235858, 276829, 276833, 391523, 276836, 276843, 293227, 276848, 293232, 186744, 285051, 211324, 227709, 285061, 317833, 178572, 285070, 178575, 285077, 178583, 227738, 317853, 276896, 317858, 342434, 285093, 317864, 285098, 276907, 235955, 276917, 293304, 293307, 293314, 309707, 293325, 317910, 293336, 235996, 317917, 293343, 358880, 276961, 227810, 293346, 276964, 293352, 236013, 293364, 301562, 317951, 309764, 301575, 121352, 236043, 317963, 342541, 55822, 113167, 277011, 317971, 309781, 309779, 55837, 227877, 227879, 293417, 227882, 309804, 293421, 105007, 236082, 285236, 23094, 277054, 244288, 129603, 318020, 301636, 301639, 301643, 277071, 285265, 399955, 309844, 277080, 309849, 285277, 285282, 326244, 318055, 277100, 277106, 121458, 170618, 170619, 309885, 309888, 277122, 227975, 277128, 285320, 301706, 318092, 326285, 318094, 334476, 277136, 277139, 227992, 285340, 318108, 227998, 318110, 137889, 383658, 285357, 318128, 277170, 342707, 154292, 277173, 293555, 318132, 285368, 277177, 277181, 318144, 277187, 277191, 277194, 277196, 277201, 137946, 113378, 203491, 228069, 277223, 342760, 285417, 56041, 56043, 277232, 228081, 56059, 310015, 285441, 310020, 285448, 310029, 228113, 285459, 277273, 293659, 326430, 228128, 293666, 285474, 228135, 318248, 277291, 293677, 318253, 285489, 293685, 285494, 301880, 285499, 301884, 310080, 293696, 277314, 277317, 277322, 277329, 162643, 310100, 301911, 277337, 301913, 301921, 400236, 236397, 162671, 326514, 310134, 277368, 15224, 236408, 416639, 416640, 113538, 310147, 416648, 277385, 39817, 187274, 301972, 424853, 277405, 277411, 310179, 293798, 293802, 236460, 277426, 293811, 293817, 293820, 203715, 326603, 293849, 293861, 228327, 228328, 228330, 318442, 228332, 277486, 326638, 318450, 293876, 293877, 285686, 302073, 285690, 121850, 302075, 244731, 293882, 293887, 277504, 277507, 277511, 277519, 293908, 277526, 293917, 293939, 318516, 277561, 277564, 310336, 7232, 293956, 277573, 228422, 310344, 277577, 293960, 277583, 203857, 310355, 293971, 310359, 236632, 277594, 138332, 277598, 285792, 277601, 203872, 310374, 203879, 277608, 310376, 228460, 318573, 203886, 187509, 285815, 285817, 367737, 285821, 302205, 285824, 392326, 285831, 253064, 302218, 285835, 294026, 384148, 162964, 187542, 302231, 285849, 302233, 285852, 302237, 285854, 285856, 285862, 277671, 302248, 64682, 277678, 228526, 294063, 294065, 302258, 277687, 294072, 318651, 294076, 277695, 318657, 244930, 302275, 130244, 302277, 228550, 302282, 310476, 302285, 302288, 310481, 302290, 203987, 302292, 302294, 302296, 384222, 310498, 285927, 318698, 302315, 195822, 228592, 294132, 138485, 204023, 228601, 204026, 228606, 204031, 64768, 310531, 285958, 228617, 138505, 318742, 204067, 277798, 130345, 277801, 113964, 285997, 277804, 285999, 277807, 113969, 277811, 318773, 318776, 277816, 286010, 277819, 294204, 417086, 277822, 286016, 294211, 302403, 384328, 277832, 277836, 294221, 326991, 294223, 277839, 277842, 277847, 277850, 179547, 277853, 146784, 277857, 302436, 277860, 294246, 327015, 310632, 327017, 351594, 277864, 277869, 277872, 351607, 310648, 277880, 310651, 277884, 277888, 310657, 351619, 294276, 310659, 277892, 327046, 253320, 310665, 318858, 277898, 277894, 277903, 310672, 351633, 277905, 277908, 277917, 310689, 277921, 277923, 130468, 228776, 277928, 277932, 310703, 277937, 310710, 130486, 310712, 277944, 310715, 277947, 302526, 228799, 277950, 277953, 64966, 245191, 163272, 302534, 310727, 277959, 292968, 302541, 277966, 302543, 277963, 310737, 277971, 277975, 228825, 163290, 277978, 310749, 277981, 277984, 310755, 277989, 277991, 187880, 277995, 286188, 310764, 278000, 278003, 310772, 228851, 278006, 40440, 278009, 212472, 40443, 286203, 228864, 40448, 286214, 228871, 302603, 65038, 302614, 286233, 302617, 302621, 286240, 146977, 187939, 294435, 40484, 286246, 294439, 286248, 278057, 294440, 294443, 40486, 294445, 40488, 310831, 40491, 40499, 40502, 212538, 40507, 40511, 40513, 228933, 40521, 286283, 40525, 40527, 228944, 212560, 400976, 40533, 147032, 40537, 40539, 278109, 40541, 40544, 40548, 40550, 286312, 286313, 40554, 40552, 310892, 40557, 40560, 188022, 122488, 294521, 343679, 278150, 310925, 286354, 278163, 302740, 122517, 278168, 327333, 229030, 212648, 278188, 302764, 278192, 319153, 278196, 302781, 319171, 302789, 294599, 278216, 294601, 302793, 343757, 212690, 278227, 229076, 286420, 319187, 286425, 319194, 278235, 301163, 229086, 278238, 286432, 294625, 294634, 302838, 319226, 286460, 171774, 278274, 302852, 278277, 302854, 294664, 311048, 352008, 319243, 311053, 302862, 319251, 294682, 278306, 188199, 294701, 278320, 319280, 319290, 229192, 302925, 188247, 237409, 294776, 360317, 294785, 327554, 40840, 40851, 294803, 188312, 294811, 319390, 294817, 319394, 40865, 294821, 311209, 180142, 294831, 188340, 40886, 319419, 294844, 294847, 393177, 294876, 294879, 294883, 294890, 311279, 278513, 237555, 278516, 311283, 278519, 237562 ]
7a1b07e62956ba9d30782b21b61811489d8a985e
50a04eb6f42546f50e645a41b5c79c3fbe2a3faf
/Zelda/Zelda/CustomImageView.swift
830d52340e85bd95d69bd275f7fbad937fce7e7d
[ "MIT" ]
permissive
AkselKantar/Zelda
8d6bba17cbd8c61a9aea1884d86f4054d0c274b1
050a21decb818ab1b92b930ff280345edcb7ff3c
refs/heads/master
2020-09-17T06:03:22.316768
2019-11-25T18:23:29
2019-11-25T18:23:29
224,013,315
0
0
null
null
null
null
UTF-8
Swift
false
false
1,673
swift
// // Created by Aksel Kantar on 2019-04-11. // Copyright (c) 2019 Aksel Kantar. All rights reserved. // import UIKit let imageCache = NSCache<AnyObject, AnyObject>() class CustomImageView: UIImageView { var task: URLSessionDataTask! let spinner = UIActivityIndicatorView(style: .gray) func loadImage(from url: URL ) { image = nil addSpinner() if let task = task { task.cancel() } if let imageFromCache = imageCache.object(forKey: url.absoluteString as AnyObject) as? UIImage { removeSpinner() image = imageFromCache return } task = URLSession.shared.dataTask(with: url) { (data: Data?, response: URLResponse?, error: Error?) -> Void in guard let data = data, let newImage = UIImage(data: data) else { print("couldn't load image from url \(url)") return } imageCache.setObject(newImage, forKey: url.absoluteString as AnyObject) DispatchQueue.main.async { self.removeSpinner() self.image = newImage } } task.resume() } func addSpinner() { addSubview(spinner) spinner.translatesAutoresizingMaskIntoConstraints = false spinner.centerYAnchor.constraint(equalTo: centerYAnchor).isActive = true spinner.centerXAnchor.constraint(equalTo: centerXAnchor).isActive = true spinner.startAnimating() } func removeSpinner() { spinner.removeFromSuperview() } }
[ -1 ]
c3952031947c550c040b943508bf7de00d8bfb12
5c5c6ff23f90f6f64c49be6b9598e3383d4b5b1e
/CHQiitaApiClient/Classes/Swaggers/APIs.swift
62bcb01ccde927aa47423485747e01f0a836c06b
[]
no_license
chuross/CHQiitaApiClient
bee1798a7b1024eb945fc935387f619644b7a144
9fffe140be2a304044446e6c4cf15c487338518c
refs/heads/master
2021-04-26T08:18:38.832804
2017-10-14T06:42:29
2017-10-14T06:42:29
106,901,829
0
0
null
null
null
null
UTF-8
Swift
false
false
2,254
swift
// APIs.swift // // Generated by swagger-codegen // https://github.com/swagger-api/swagger-codegen // import Foundation open class CHQiitaApiClientAPI { open static var basePath = "https://qiita.com/api/v2/" open static var credential: URLCredential? open static var customHeaders: [String:String] = [:] open static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() } open class APIBase { func toParameters(_ encodable: JSONEncodable?) -> [String: Any]? { let encoded: Any? = encodable?.encodeToJSON() if encoded! is [Any] { var dictionary = [String:Any]() for (index, item) in (encoded as! [Any]).enumerated() { dictionary["\(index)"] = item } return dictionary } else { return encoded as? [String:Any] } } } open class RequestBuilder<T> { var credential: URLCredential? var headers: [String:String] let parameters: [String:Any]? let isBody: Bool let method: String let URLString: String /// Optional block to obtain a reference to the request's progress instance when available. public var onProgressReady: ((Progress) -> ())? required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters self.isBody = isBody self.headers = headers addHeaders(CHQiitaApiClientAPI.customHeaders) } open func addHeaders(_ aHeaders:[String:String]) { for (header, value) in aHeaders { headers[header] = value } } open func execute(_ completion: @escaping (_ response: Response<T>?, _ error: Error?) -> Void) { } public func addHeader(name: String, value: String) -> Self { if !value.isEmpty { headers[name] = value } return self } open func addCredential() -> Self { self.credential = CHQiitaApiClientAPI.credential return self } } public protocol RequestBuilderFactory { func getBuilder<T>() -> RequestBuilder<T>.Type }
[ 319073, 289126, 296591 ]
c0acdc521f768da9fb3ff7fce0b6abbd54684c86
aae6a7606c4f4a7d7bdbdbb032e9ab89b3f4bba8
/NennosPizzaTests/Models/IngredientTests.swift
9813f5b9f117bf7db83706cea15d1cfb2c062ff1
[]
no_license
adamBellaPrivate/code_snippet_nennos_pizza
46352443ca2c43e89a0707c5ddefc3a708735adb
47274ae1d0f639689f2d560c1da9d7dee68bc011
refs/heads/master
2020-04-17T08:02:04.921173
2019-01-18T11:31:49
2019-01-18T11:31:49
166,394,988
0
0
null
null
null
null
UTF-8
Swift
false
false
2,294
swift
// // IngredientTests.swift // NennosPizzaTests // // Created by Adam Bella on 1/17/19. // Copyright © 2019 Bella Ádám. All rights reserved. // import XCTest @testable import NennosPizza class IngredientTests: 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() { super.tearDown() // Put teardown code here. This method is called after the invocation of each test method in the class. } final func testIndividualIngredient() { let data = "{\"id\": 12, \"name\": \"Test Ingredient\", \"price\": 870}".data(using: .utf8) XCTAssertNotNil(data, "Resource error") let response = try? JSONDecoder().decode(Ingredient.self, from: data!) XCTAssertNotNil(response, "Parsing error") XCTAssertEqual(response?.name, "Test Ingredient", "Name mismatch") XCTAssertEqual(response?.id, 12, "Id mismatch") XCTAssertEqual(response?.price, 870, "Price mismatch") let data2 = "{\"name\": \"Test Ingredient\", \"price\": 870}".data(using: .utf8) XCTAssertNotNil(data2, "JSON error") let response2 = try? JSONDecoder().decode(Ingredient.self, from: data2!) XCTAssertNil(response2) } final func testListPizza() { let data = "[{\"id\": 12, \"name\": \"Test Ingredient\", \"price\": 870}, {\"id\": 21, \"name\": \"Test Ingredient 2\", \"price\": 1050}]".data(using: .utf8) XCTAssertNotNil(data, "Resource error") let response = try? JSONDecoder().decode([Ingredient].self, from: data!) // MARK: - First element XCTAssertNotNil(response?.first, "Parsing error") XCTAssertEqual(response?.first?.name, "Test Ingredient", "Name mismatch") XCTAssertEqual(response?.first?.id, 12, "Id mismatch") XCTAssertEqual(response?.first?.price, 870, "Price mismatch") // MARK: - Last element XCTAssertNotNil(response?.last, "Parsing error") XCTAssertEqual(response?.last?.name, "Test Ingredient 2", "Name mismatch") XCTAssertEqual(response?.last?.id, 21, "Id mismatch") XCTAssertEqual(response?.last?.price, 1050, "Price mismatch") } }
[ -1 ]
2a601eb57a1cc873e0a4c1929c4591adc4271b7f
0b3d683f650fb95fcd988a013ff0f613dc0e0b31
/DialPad/DialPad/DialPad.swift
0b1752d0ed30159c990c91ad366e7680f206d0b3
[ "Apache-2.0" ]
permissive
mankarth004/MyControls
b3d7c0ca24afd68e47161f5b51bcbb94cfbfaee1
5b8bc381ac0777d27d0b67b3fdc1a0fbd012ed0d
refs/heads/master
2020-03-31T13:00:45.197421
2018-10-10T03:54:30
2018-10-10T03:54:30
152,238,320
3
0
null
null
null
null
UTF-8
Swift
false
false
5,915
swift
// // DialPad.swift // DialPad // // Created by SmartNet-MacBookPro on 10/8/18. // Copyright © 2018 kartheek.in. All rights reserved. // import UIKit protocol DialPadDelegate: class { func dialPadNumberDidChange(_ number: String?) } @IBDesignable class DialPad: UIView, UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout, DialPadCellDelegate { fileprivate let buttonTitles = ["1","2","3","4","5","6","7","8","9","","0",""] var delegate: DialPadDelegate! fileprivate weak var collectionView: UICollectionView! @IBInspectable var buttonTitleColor: UIColor! = UIColor.black { didSet { setNeedsDisplay() } } @IBInspectable var buttonBackground: UIColor! = UIColor.lightGray { didSet { setNeedsDisplay() } } @IBInspectable var lineColor: UIColor! = UIColor.lightGray { didSet { setNeedsDisplay() } } @IBInspectable var showLines: Bool = false { didSet { setNeedsDisplay() } } var dialedNumber = "" { didSet { } } override func awakeFromNib() { super.awakeFromNib() setNeedsDisplay() } override func prepareForInterfaceBuilder() { setNeedsDisplay() } override func draw(_ rect: CGRect) { updateUI() } func updateUI() { if collectionView == nil { let layout = UICollectionViewFlowLayout() layout.minimumLineSpacing = 0.0 layout.minimumInteritemSpacing = 0.0 let collectionView = UICollectionView.init(frame: CGRect(x: 0, y: 0, width: frame.width, height: frame.height), collectionViewLayout: layout) collectionView.backgroundColor = UIColor.clear addSubview(collectionView) collectionView.translatesAutoresizingMaskIntoConstraints = false collectionView.autoresizingMask = [.flexibleWidth, .flexibleHeight] let bundle = Bundle(for: DialPad.self) collectionView.register(UINib.init(nibName: "DialPadCell", bundle: bundle), forCellWithReuseIdentifier: "Cell") collectionView.delegate = self collectionView.dataSource = self self.collectionView = collectionView } if showLines { // Draw vertical lines let yPos: CGFloat = 16.0 let width = frame.width/3.0 for index in 1...2 { let path = UIBezierPath() path.move(to: CGPoint(x: width*CGFloat(index), y: yPos)) path.addLine(to: CGPoint(x: width*CGFloat(index), y: frame.height-yPos)) let shapeLayer = CAShapeLayer() shapeLayer.path = path.cgPath shapeLayer.strokeColor = lineColor.cgColor shapeLayer.lineWidth = 0.3 layer.addSublayer(shapeLayer) } // Draw horizontal lines let xPos: CGFloat = 16.0 let height = frame.height/4.0 for index in 1...3 { let path = UIBezierPath() path.move(to: CGPoint(x: xPos, y: height*CGFloat(index))) path.addLine(to: CGPoint(x: frame.width-xPos, y: height*CGFloat(index))) let shapeLayer = CAShapeLayer() shapeLayer.path = path.cgPath shapeLayer.strokeColor = lineColor.cgColor shapeLayer.lineWidth = 0.3 layer.addSublayer(shapeLayer) } } } // MARK: - DialPadCellDelegate func buttonClicked(_ sender: UIButton) { if sender.tag == 12{ dialedNumber = dialedNumber.substring(to: dialedNumber.index(before: dialedNumber.endIndex)) }else if let buttonTitle = sender.title(for: .normal) { dialedNumber = dialedNumber+buttonTitle } delegate.dialPadNumberDidChange(dialedNumber) } // MARK: - UICollectionViewDataSource func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return buttonTitles.count } func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "Cell", for: indexPath) as? DialPadCell let index = indexPath.row if index == 11 { let bundle = Bundle(for: DialPad.self) cell?.btnNumber.setImage(UIImage.init(named: "delete", in: bundle, compatibleWith: nil), for: .normal) }else{ cell?.btnNumber.setImage(nil, for: .normal) } cell?.btnNumber.setTitle((index == 9 && index == 11) ? nil : buttonTitles[index], for: .normal) let width = frame.width/3 cell?.btnNumber.layer.cornerRadius = (width*0.5)/2 cell?.btnNumber.layer.masksToBounds = true cell?.btnNumber.backgroundColor = (index == 9 || index == 11) ? UIColor.clear : buttonBackground cell?.btnNumber.setTitleColor(buttonTitleColor, for: .normal) cell?.delegate = self cell?.btnNumber.tag = index+1 return cell! } // MARK: - UICollectionViewDelegateFlowLayout func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { let width = frame.width/3 return CGSize(width: width, height: frame.height/4) } // MARK: - UICollectionViewDelegate func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { } }
[ -1 ]
e9d93ae06685dbe674a826052286a7890a038003
85ea662079664504901d368f9eda6a075388a34d
/cognitive app/DetailViewController_BASE_4214.swift
acff2a4a12b32b920a3c49c9144473c34637d724
[]
no_license
LiQi811227/cognitive-app
fa048975e7a8fb2dfbdb369c95fc777a189f4652
577430c0e4087bdfc239bd087fb6dbcb60e7a378
refs/heads/master
2020-09-02T05:26:58.835933
2019-11-10T09:12:09
2019-11-10T09:12:09
219,142,028
1
0
null
null
null
null
UTF-8
Swift
false
false
1,903
swift
// // DetailViewController.swift // cognitive app // // Created by LiQi on 3/11/19. // Copyright © 2019 LiQi. All rights reserved. // import UIKit class DetailViewController: UIViewController { @IBOutlet weak var wordFrom: UILabel! @IBOutlet weak var wordTo: UILabel! @IBOutlet weak var image: UIImageView! //speech action @IBAction func speechAction(_ sender: UIButton) { speech(wordFrom.text ?? "not sure","from") } @IBAction func speechAction2(_ sender: UIButton) { speech(wordTo.text ?? "神马东东啊,俺不会念","to") } var segueSource:String = "list" var itemID:Int = 0 override func viewDidLoad() { super.viewDidLoad() if segueSource=="list" { print("From List page, itemID:\(itemID)") // display detail display(itemID) }else{ print("From Photo take page, itemID:\(itemID)") // display detail display(itemID) } } private func display(_ itemID:Int){ let itemList:[Item]? = readData() as? [Item] let item = itemList?.first(where:{$0.id==itemID}) print(item ?? "nothing getted.") wordFrom.text = item?.wordFrom wordTo.text = item?.wordTo //TODO:display image getting from maskdomain let imgPathFromSandBox:String = getImageFromSandBox(fileName:item?.image ?? "jodan.jpg") let img: UIImage = UIImage(contentsOfFile: imgPathFromSandBox)! //let img: UIImage = UIImage(named: item?.image ?? "no.jpg")! image.image = img } // private func speech(_ text:String?){ // if let textForSpeech = text{ // //TODO:call remote api // //TODO:call AVPlay // print(textForSpeech) // } // } }
[ -1 ]
a1185c2797f9383e6f12fc21539b203ae09a19bd
f3540ccd1504fe3b7c0d9e9d5c033fb3fd8e954b
/ECPlusApp/Database/Domain/RecursoAudioVisual+CoreDataClass.swift
50b7e4b024fd0466343f38481ab31c356509f822
[]
no_license
jfrchicanog/ECPlusAppIOS
73d643a71c988c075bd3e6f5ec0c829bc7654dab
9f698fb536b8bfd4516b1362de00c7c06334795e
refs/heads/master
2020-03-25T02:31:11.079042
2018-08-02T12:37:08
2018-08-02T12:37:08
143,293,561
0
0
null
null
null
null
UTF-8
Swift
false
false
295
swift
// // RecursoAudioVisual+CoreDataClass.swift // ECPlusApp // // Created by José Francisco Chicano García on 19/1/18. // Copyright © 2018 José Francisco Chicano García. All rights reserved. // // import Foundation import CoreData public class RecursoAudioVisual: NSManagedObject { }
[ -1 ]
a65676d1b12fd89308250c6ed7d35d8173d977ca
85a0a80ea25d647c48a59ef9fc5cf6881aff0697
/Pods/SwiftCharts/SwiftCharts/AxisValues/ChartAxisValueFloat.swift
f958470fe6261830e4833811918398b5772794b5
[ "LicenseRef-scancode-warranty-disclaimer", "Apache-2.0" ]
permissive
Jokerkras/FollowersCheck
c7f16f9de7e8d685a50d7ef2e02a613d974fa59f
845da98aeb502250c4f2be6116cbc91879ecf4b1
refs/heads/master
2021-08-30T21:37:20.626346
2017-12-19T14:07:14
2017-12-19T14:07:14
107,970,964
4
0
null
2017-12-19T13:49:07
2017-10-23T11:09:59
Swift
UTF-8
Swift
false
false
1,203
swift
// // ChartAxisValueFloat.swift // swift_charts // // Created by ischuetz on 15/03/15. // Copyright (c) 2015 ivanschuetz. All rights reserved. // import UIKit @available(*, deprecated: 0.2.5, message: "use ChartAxisValueDouble instead") open class ChartAxisValueFloat: ChartAxisValue { open let formatter: NumberFormatter open var float: CGFloat { return CGFloat(scalar) } public init(_ float: CGFloat, formatter: NumberFormatter = ChartAxisValueFloat.defaultFormatter, labelSettings: ChartLabelSettings = ChartLabelSettings()) { self.formatter = formatter super.init(scalar: Double(float), labelSettings: labelSettings) } override open func copy(_ scalar: Double) -> ChartAxisValueFloat { return ChartAxisValueFloat(CGFloat(scalar), formatter: formatter, labelSettings: labelSettings) } static var defaultFormatter: NumberFormatter = { let formatter = NumberFormatter() formatter.maximumFractionDigits = 2 return formatter }() // MARK: CustomStringConvertible override open var description: String { return formatter.string(from: NSNumber(value: Float(float)))! } }
[ 347390, 290095 ]
388edfcbdf3302f47018c46a7de9bc4ed8cab4be
c23ab8f6e9def73901688659f2837033470a9bb6
/Todoey/Model/Category.swift
0a536af6a2b7457a57f6048841194c2051f34438
[]
no_license
artbleymy/Todoey
81967a35cf140f5dabefbaafbb42e9f33cadaadf
320547562d8a96030dc3f3cb061ea8d00c1a8869
refs/heads/master
2020-04-24T14:16:57.709328
2019-02-25T16:54:37
2019-02-25T16:54:37
172,015,540
0
0
null
null
null
null
UTF-8
Swift
false
false
320
swift
// // Category.swift // Todoey // // Created by Stanislav on 24.02.2019. // Copyright © 2019 Stanislav Kozlov. All rights reserved. // import Foundation import RealmSwift class Category: Object{ @objc dynamic var name: String = "" @objc dynamic var colour: String = "" let items = List<Item>() }
[ -1 ]