blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
2
625
content_id
stringlengths
40
40
detected_licenses
listlengths
0
47
license_type
stringclasses
2 values
repo_name
stringlengths
5
116
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
643 values
visit_date
timestamp[ns]
revision_date
timestamp[ns]
committer_date
timestamp[ns]
github_id
int64
80.4k
689M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
16 values
gha_event_created_at
timestamp[ns]
gha_created_at
timestamp[ns]
gha_language
stringclasses
85 values
src_encoding
stringclasses
7 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
1 class
length_bytes
int64
4
6.44M
extension
stringclasses
17 values
content
stringlengths
4
6.44M
duplicates
listlengths
1
9.02k
14c3c6212cd8dbe193c2b2696e5f0cff44e26410
8113b15c921ebb3b8ff07b4f8a63d35e11d9c111
/Sticky/StickyApp.swift
d1a2c8abb1a93f6f5b6919dab7a32c0a09cc1ed0
[]
no_license
kor-Randy/Sticky_iOS
09645fe53cf5a295bf8500669b7cb8c4d2e06071
9a3d7719d1e2ac6f9ed3bc4842422cd81e2a55f1
refs/heads/main
2023-02-17T05:55:43.384655
2021-01-13T15:30:21
2021-01-13T15:30:21
330,316,720
0
0
null
2021-01-17T04:51:13
2021-01-17T04:51:13
null
UTF-8
Swift
false
false
214
swift
// // StickyApp.swift // Sticky // // Created by deo on 2021/01/13. // import SwiftUI @main struct StickyApp: App { var body: some Scene { WindowGroup { ContentView() } } }
[ 352896, 360961, 416512, 360963, 416516, 416520, 418569, 262672, 375441, 270738, 381458, 383636, 425873, 435226, 430235, 434973, 386462, 432288, 186913, 344610, 411042, 398372, 375590, 156460, 254895, 372655, 375601, 393905, 375603, 265397, 383610, 261943, 260919, 397881, 372031, 352323, 207812, 388164, 404552, 337865, 415051, 225228, 208333, 272205, 372940, 393168, 394960, 383954, 272211, 178132, 351443, 409423, 417998, 420817, 421334, 351067, 173919, 149473, 355044, 223975, 367722, 266348, 380652, 385908, 359285, 380917, 381050, 374140, 415357, 274174, 426879 ]
db6b508d34b07fd1a3dcb4c1e55a3e793fb114f3
776024b465128aa59e2cd6fed87150e4d83a2c3a
/ios/Classes/SwiftTwilioProgrammableVoicePlugin.swift
98654d4c4c39d757ae953066a503c67121fc2e33
[ "BSD-3-Clause" ]
permissive
Bilik-fr/twilio_programmable_voice
36986abdf84605ffaf35bc26b03a855a5b32b717
893bbce82e33d18ef30e282f04db3ae20148d5d5
refs/heads/master
2023-07-15T03:17:03.311955
2021-07-27T14:47:19
2021-07-27T14:47:19
364,564,263
0
3
null
null
null
null
UTF-8
Swift
false
false
6,491
swift
import Flutter import AVFoundation import TwilioVoice import CallKit /** Responsible of making the connection between Dart (flutter) and iOS native calls. */ public class SwiftTwilioProgrammableVoicePlugin: NSObject, FlutterPlugin { // Used to create singleton static let sharedInstance = SwiftTwilioProgrammableVoicePlugin() var methodChannel: FlutterMethodChannel? // interract with TwilioVoice API and hold calls states. var twilioProgrammableVoice: TwilioProgrammableVoice! // Initializer override init() { super.init() } static var appName: String { get { return (Bundle.main.infoDictionary!["CFBundleName"] as? String) ?? "Define CFBundleName" } } // Create a new singleton instance of the plugin class public static func register(with registrar: FlutterPluginRegistrar) { SwiftTwilioProgrammableVoicePlugin.sharedInstance.onRegister(registrar) } // Map dart method/events calls/stream to a defined methods/listeners (self.handle here) public func onRegister(_ registrar: FlutterPluginRegistrar) { self.twilioProgrammableVoice = TwilioProgrammableVoice.sharedInstance methodChannel = FlutterMethodChannel(name: "twilio_programmable_voice", binaryMessenger: registrar.messenger()) methodChannel?.setMethodCallHandler(self.handle) let eventChannel = FlutterEventChannel(name: "twilio_programmable_voice/call_status", binaryMessenger: registrar.messenger()) self.twilioProgrammableVoice.twilioVoiceDelegate = TwilioVoiceDelegate(eventChannel: eventChannel) } public func handle(_ flutterCall: FlutterMethodCall, result: @escaping FlutterResult) { var args: [String: AnyObject] = [:]; // we need this because sometimes arguments is nil and we unwrap a nil value, that throw an error and terminate the process :( if let flutterArgs = flutterCall.arguments { args = flutterArgs as! [String: AnyObject] } if flutterCall.method == "registerVoice" { guard let accessToken = args["accessToken"] as? String else { result(FlutterError(code: "MISSING-PARAMS", message: "Access token is missing", details: nil)); return } self.twilioProgrammableVoice.registerVoice(accessToken: accessToken, result: result); } else if flutterCall.method == "makeCall" { guard let callTo = args["to"] as? String, let callFrom = args["from"] as? String else { result(FlutterError(code: "MISSING-PARAMS", message: "from or to parameters are/is missing", details: nil)); return } guard let accessToken = args["accessToken"] as? String else { result(FlutterError(code: "MISSING-PARAMS", message: "accessToken is missing", details: nil)); return } // Note: Not sure we want to store the accessToken since the token might be not valid // At this stage. Also the accessToken might not be registered yet. self.twilioProgrammableVoice.tokenManager.accessToken = accessToken self.twilioProgrammableVoice.makeCall(to: callTo, from: callFrom, result: result) } else if flutterCall.method == "stopCall" { self.twilioProgrammableVoice.stopActiveCall(result: result) } else if flutterCall.method == "muteCall" { guard let setOn = args["setOn"] as? Bool else { result(FlutterError(code: "MISSING-PARAMS", message: "setOn is missing", details: nil)); return } self.twilioProgrammableVoice.muteActiveCall(setOn: setOn, result: result) } else if flutterCall.method == "toggleSpeaker" { guard let setOn = args["setOn"] as? Bool else { result(FlutterError(code: "MISSING-PARAMS", message: "setOn is missing", details: nil)); return } self.twilioProgrammableVoice.toggleAudioRoute(toSpeaker: setOn, result: result) } else if flutterCall.method == "isOnCall" { result(self.twilioProgrammableVoice.twilioVoiceDelegate!.call != nil) } else if flutterCall.method == "sendDigits" { guard let digits = args["digits"] as? String else { result(FlutterError(code: "MISSING-PARAMS", message: "digits is missing", details: nil)); return } guard self.twilioProgrammableVoice.twilioVoiceDelegate!.call != nil else { result(FlutterError(code: "PRECONDITION-FAILED", message: "cannot send digits, not on call", details: nil)); return } self.twilioProgrammableVoice.twilioVoiceDelegate!.call!.sendDigits(digits) } else if flutterCall.method == "holdCall" { guard let setOn = args["setOn"] as? Bool else { result(FlutterError(code: "MISSING-PARAMS", message: "setOn is missing", details: nil)); return } self.twilioProgrammableVoice.muteActiveCall(setOn: setOn, result: result) } else if flutterCall.method == "getCurrentCall" { self.twilioProgrammableVoice.getCurrentCall(result: result); } else if flutterCall.method == "answer" { result(true) /// do nothing } else if flutterCall.method == "unregister" { guard let token = args["accessToken"] as? String else { result(FlutterError(code: "MISSING-PARAMS", message: "accessToken is missing", details: nil)); return } guard let deviceToken = self.twilioProgrammableVoice.tokenManager.deviceToken else { result(FlutterError(code: "DTOKEN-MISSING", message: "Cannot find device token", details: nil)); return } self.twilioProgrammableVoice.tokenManager.unregisterTokens(token: token, deviceToken: deviceToken) } else if flutterCall.method == "reject"{ if self.twilioProgrammableVoice.twilioVoiceDelegate!.call != nil && self.twilioProgrammableVoice.twilioVoiceDelegate!.call?.state == .connected { self.twilioProgrammableVoice.twilioVoiceDelegate!.userInitiatedDisconnect = true self.twilioProgrammableVoice.performEndCallAction(uuid: self.twilioProgrammableVoice.twilioVoiceDelegate!.call!.uuid!) } } else { result(FlutterMethodNotImplemented) } } // TODO remove this and the FlutterStreamHandler implementation // problem, I can't make call when I remove Notification.default.addObserver // No error, the CXStartCallAction event isn't trigger public func onListen(withArguments arguments: Any?, eventSink: @escaping FlutterEventSink) -> FlutterError? { NotificationCenter.default.addObserver( self, selector: #selector(CallDelegate.callDidDisconnect), name: NSNotification.Name(rawValue: "PhoneCallEvent"), object: nil) return nil } public func onCancel(withArguments arguments: Any?) -> FlutterError? { NotificationCenter.default.removeObserver(self) return nil } }
[ -1 ]
ae9dde14939bc9072fbf2fd5c8898a8a78d76a97
b2be14df0e008ea9b2f7b66acd1602cf6f290e2d
/GameOfRunes/GameOfRunes/UI Nodes/Player Area/HealthBarNode.swift
c27fbebbcc502e8e4a30a688b8dad886554d8dd6
[ "MIT" ]
permissive
CS3217-Final-Project/TeamHoWan
dc757e27416349fa1265dddd7ad896128cfeb574
6153ef3e12e9a0270a93f254e6373c57ac5c035b
refs/heads/master
2021-02-28T02:54:10.776973
2020-08-06T10:04:01
2020-08-06T10:04:01
245,655,116
6
1
MIT
2020-04-26T11:38:23
2020-03-07T15:15:00
Swift
UTF-8
Swift
false
false
3,157
swift
// // HealthBarNode.swift // GameOfRunes // // Created by Jermy on 10/3/20. // Copyright © 2020 TeamHoWan. All rights reserved. // import SpriteKit class HealthBarNode: SKSpriteNode { private static let spacingBetweenHealthNodes: CGFloat = 10.0 private var _totalLives: Int { didSet { guard oldValue != _totalLives else { return } buildHealthNodes() // ensures _livesLeft <= new totalLives livesLeft = _livesLeft updateActiveLives() } } var totalLives: Int { get { _totalLives } set { _totalLives = max(1, newValue) } } private var _livesLeft: Int { didSet { guard oldValue != _livesLeft else { return } updateActiveLives() } } var livesLeft: Int { get { _livesLeft } set { _livesLeft = max(0, min(_totalLives, newValue)) } } private var healthNodes = [HealthNode]() override var size: CGSize { didSet { guard oldValue != size else { return } layoutHealthNodes() } } init(totalLives: Int = 3) { _totalLives = max(1, totalLives) _livesLeft = _totalLives let texture = SKTexture(imageNamed: "health-container") super.init(texture: texture, color: .clear, size: texture.size()) buildHealthNodes() } @available(*, unavailable) required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } private func updateActiveLives() { (0..<healthNodes.count).forEach { healthNodes[$0].active = $0 < _livesLeft } } private func buildHealthNodes() { healthNodes.forEach { $0.removeFromParent() } healthNodes = [] (0..<self._totalLives).forEach { _ in let healthNode = HealthNode() healthNode.zPosition = 1 healthNodes.append(healthNode) self.addChild(healthNode) } layoutHealthNodes() } private func layoutHealthNodes() { let numHealthNodes = healthNodes.count guard numHealthNodes > 0 else { return } let newHealthNodeSize = healthNodes[0].size.scaleTo(height: size.height * 0.65) healthNodes.forEach { $0.size = newHealthNodeSize } let newHealthNodeWidth = newHealthNodeSize.width let intervalVector = CGVector( dx: newHealthNodeWidth + Self.spacingBetweenHealthNodes, dy: 0.0 ) let numIntervalsPerSide = (numHealthNodes - 1) / 2 var healthNodePosition: CGPoint = .zero + .init(numIntervalsPerSide) * -intervalVector + .init(dx: numHealthNodes.isMultiple(of: 2) ? -newHealthNodeWidth / 2 : 0.0, dy: 0.0) healthNodes.forEach { $0.position = healthNodePosition healthNodePosition += intervalVector } } }
[ -1 ]
6b4f15b2d9bc888bfff8bb9f3a2ad9ce286edf97
1d0696d1acc1b14f7509c1bae388af7474239db1
/Instagram-Clone-iOS/Instagram-Clone-iOS/MainTabBarController.swift
7fccfbfd3dda3e2ffd8be1b058eb5fbab2f90c8d
[]
no_license
arthurj93/Instagram-Firebase-Clone-iOS
9f6e121aa591ebedd6d342b2a8dfcfdeebef327e
de8c1b13388731e1692c763cfdd5972dab4ba04c
refs/heads/master
2023-04-09T04:27:02.703481
2021-04-13T17:03:15
2021-04-13T17:03:15
355,579,968
0
0
null
null
null
null
UTF-8
Swift
false
false
3,499
swift
// // MainTabBarController.swift // Instagram-Clone-iOS // // Created by Arthur Octavio Jatobá Macedo Leite - ALE on 08/04/21. // import UIKit import Firebase class MainTabBarController: UITabBarController { override func viewDidLoad() { super.viewDidLoad() self.delegate = self if Auth.auth().currentUser == nil { DispatchQueue.main.async { let loginController: LoginController = .init() let navController: UINavigationController = .init(rootViewController: loginController) navController.modalPresentationStyle = .fullScreen self.present(navController, animated: true, completion: nil) } return } setupViewControllers() } func setupViewControllers() { let layout = UICollectionViewFlowLayout() let homeNavController = templateNavController(viewController: HomeController(), image: #imageLiteral(resourceName: "home_unselected"), selectedImage: #imageLiteral(resourceName: "home_selected")) let searchNavController = templateNavController(viewController: UserSearchController.init(collectionViewLayout: layout), image: #imageLiteral(resourceName: "search_unselected"), selectedImage: #imageLiteral(resourceName: "search_selected")) let userProfileNavController = templateNavController(viewController: UserProfileController.init(collectionViewLayout: layout), image: #imageLiteral(resourceName: "profile_unselected"), selectedImage: #imageLiteral(resourceName: "profile_selected")) let plusNavController = templateNavController(viewController: .init(), image: #imageLiteral(resourceName: "plus_unselected"), selectedImage: #imageLiteral(resourceName: "plus_unselected")) let likeNavController = templateNavController(viewController: .init(), image: #imageLiteral(resourceName: "like_unselected"), selectedImage: #imageLiteral(resourceName: "like_selected")) viewControllers = [ homeNavController, searchNavController, plusNavController, likeNavController, userProfileNavController ] guard let items = tabBar.items else { return } for item in items { item.imageInsets = .init(top: 4, left: 0, bottom: -4, right: 0) } } } extension MainTabBarController: UITabBarControllerDelegate { func tabBarController(_ tabBarController: UITabBarController, shouldSelect viewController: UIViewController) -> Bool { let index = viewControllers?.firstIndex(of: viewController) if index == 2 { let layout: UICollectionViewFlowLayout = .init() let photoSelectorController: PhotoSelectorController = .init(collectionViewLayout: layout) let navController: UINavigationController = .init(rootViewController: photoSelectorController) navController.modalPresentationStyle = .fullScreen present(navController, animated: true) return false } return true } } extension MainTabBarController { private func templateNavController(viewController: UIViewController = .init(), image: UIImage, selectedImage: UIImage) -> UINavigationController { let navController: UINavigationController = .init(rootViewController: viewController) viewController.tabBarItem.image = image viewController.tabBarItem.selectedImage = selectedImage return navController } }
[ -1 ]
020a034c74cceb3f367d90ca7f9e477131d2403e
c9dc7ac8b7614c8fa79559d0c0347b522609bf7d
/JRNetworkingFramework/Interface/ViewController/Main/Testing/Grid/GridViewTestingViewController.swift
38a169544dc7eedc68a5548f7042953048b58d0f
[]
no_license
h7a405/JRiOSAppFramework
683b070a93fa236a8906bf09d84fc1c0249d7c35
119783f61dd5ca6657e6e2e75af868b589c67e5a
refs/heads/master
2021-01-10T11:02:05.369759
2016-03-01T02:17:31
2016-03-01T02:17:31
44,148,814
8
0
null
null
null
null
UTF-8
Swift
false
false
3,603
swift
// // GridViewTestingViewController.swift // JRNetworkingFramework // // Created by SilversRayleigh on 20/10/15. // Copyright © 2015年 hSevenA405. All rights reserved. // import UIKit class GridViewTestingViewController: UIViewController { //MARK: - Parameter //MARK: Parameters - Constant //MARK: Parameters - Basic //MARK: Parameters - Foundation //MARK: Parameters - UIKit //MARK: Parameters - Other override func viewDidLoad() { super.viewDidLoad() self.setNavigationBarUncovered() let gridView = JRGridView(borderStyle: JRGridViewBorderStyle.Full, frame: UIScreen.mainScreen().bounds) gridView.dataSource = self gridView.delegate = self self.view.addSubview(gridView) } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) { super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil) } //MARK: Methods - Required required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) } //MARK: Methods - Convenience convenience init() { let nibNameOrNil = String?("GridViewTestingViewController") self.init(nibName: nibNameOrNil, bundle: nil) } //MARK: Methods - Other } //MARK: - Extension //MARK: Extensions - Initation & Setup //MARK: Extensions - Operation & Action //MARK: Extensions - Getter / Setter //MARK: Extensions - DataSource extension GridViewTestingViewController: JRGridViewDataSource { func numberOfSectionsInGridView(gridView: JRGridView) -> Int { return 2 } func gridView(gridView: JRGridView, numberOfRowsInSection section: Int) -> Int { switch section { case 0: return 5 case 1: return 10 default: return 0 } } func gridView(gridView: JRGridView, numberOfColumnsInSection section: Int) -> Int { switch section { case 0: return 5 case 1: return 10 default: return 0 } } func gridView(gridView: JRGridView, heightForRowAtIndexPath indexPath: GridIndexPath) -> Float { return 60.0 } func gridView(gridView: JRGridView, widthForColumnAtIndexPath indexPath: GridIndexPath) -> Float { return 60.0 } func gridView(gridView: JRGridView, heightForHeaderInSection section: Int) -> Float { return 30.0 } func gridView(gridView: JRGridView, heightForFooterInSection section: Int) -> Float { return 30.0 } func gridView(gridView: JRGridView, titleForHeaderInSection section: Int) -> String { return "header\(section)" } func gridView(gridView: JRGridView, titleForFooterInSection section: Int) -> String { return "footer\(section)" } func gridView(girdView: JRGridView, tileForItemAtIndexPath indexPath: GridIndexPath) -> JRGridViewTile { let tile = JRGridViewTile(tileStyle: JRGridViewTileStyle.Default) tile.textLabel!.text = "(\(indexPath.section),\(indexPath.row),\(indexPath.column))" return tile } } extension GridViewTestingViewController: JRGridViewDelegate { func gridView(gridView: JRGridView, didSelectItemAtIndexPath indexPath: GridIndexPath) { gridView.deSelectItemAtIndexPath(indexPath) } } //MARK: Extensions - Delegate //MARK: - Class //MARK: Classes - Other
[ -1 ]
3c8ec9b2b3247a26237c320a2066bd6727fedbd0
1405e2e0e6c71ad2363eab1650aa0191c41ca391
/PlusOne.playground/Contents.swift
b1e44d3d8268cfc39ff921fb7d3c1773b3a07bec
[]
no_license
nickgarkusha/LearningSwift
203438d3053ffa758e854855dd573f9f216726d9
6d6046e22ffa095c1b600ce3e6a725f0adfbb1d0
refs/heads/master
2021-01-09T19:37:20.984423
2019-02-15T22:41:19
2019-02-15T22:41:19
null
0
0
null
null
null
null
UTF-8
Swift
false
false
300
swift
import UIKit var arr = [2, 5, 7] func plusOne(givenArray: Array<Int>) { var arrayForWorking = givenArray let lastInt = arrayForWorking[arrayForWorking.count - 1] arrayForWorking.removeLast() arrayForWorking.append(lastInt + 1) print(arrayForWorking) } plusOne(givenArray: arr)
[ -1 ]
9d151cdb31009a93977eaca27511f8cd699ec535
bbcba71fd77918461f2f375fe976381d1003530c
/SwipeMatchFirestore/Controllers/MatchesMessages/ChatLogController.swift
457402507e322068a66f88ceeccd25926430329b
[]
no_license
MohammedHamdi/SwipeMatchFirestore
0ac824351d974db7c891b938b28e8f473c51403f
44bc3ff516509cb1336d87f9b900aa8728752062
refs/heads/master
2022-05-24T20:19:40.112960
2020-04-29T19:25:02
2020-04-29T19:25:02
259,954,212
2
0
null
null
null
null
UTF-8
Swift
false
false
8,280
swift
// // ChatLogController.swift // SwipeMatchFirestore // // Created by Mohammed Hamdi on 4/22/20. // Copyright © 2020 Mohammed Hamdi. All rights reserved. // import LBTATools import Firebase class ChatLogController: LBTAListController<MessageCell, Message>, UICollectionViewDelegateFlowLayout { var currentUser: User? fileprivate lazy var customNavBar = MessagesNavBar(match: match) fileprivate let navBarHeight: CGFloat = 120 fileprivate let match: Match // Input accessory view lazy var customInputView: CustomInputAccessoryView = { let civ = CustomInputAccessoryView(frame: .init(x: 0, y: 0, width: view.frame.width, height: 50)) civ.sendButton.addTarget(self, action: #selector(handleSend), for: .touchUpInside) return civ }() override var inputAccessoryView: UIView? { get { return customInputView } } override var canBecomeFirstResponder: Bool { return true } init(match: Match) { self.match = match super.init() } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } deinit { // print("Object is deinit") } override func viewDidLoad() { super.viewDidLoad() fetchCurrentUser() NotificationCenter.default.addObserver(self, selector: #selector(handleKeyboardShow), name: UIResponder.keyboardDidShowNotification, object: nil) collectionView.keyboardDismissMode = .interactive fetchMessages() setupUI() } override func viewWillDisappear(_ animated: Bool) { super.viewWillDisappear(animated) // Tells you if its being popped off the nav stack if isMovingFromParent { listener?.remove() } } fileprivate func fetchCurrentUser() { Firestore.firestore().collection("users").document(Auth.auth().currentUser?.uid ?? "").getDocument { (snapshot, error) in let data = snapshot?.data() ?? [:] self.currentUser = User(dictionary: data) } } private func setupUI() { collectionView.alwaysBounceVertical = true view.addSubview(customNavBar) customNavBar.anchor(top: view.safeAreaLayoutGuide.topAnchor, leading: view.leadingAnchor, bottom: nil, trailing: view.trailingAnchor, size: .init(width: 0, height: navBarHeight)) collectionView.contentInset.top = navBarHeight if #available(iOS 13.0, *) { collectionView.verticalScrollIndicatorInsets.top = navBarHeight } else { collectionView.scrollIndicatorInsets.top = navBarHeight } customNavBar.backButton.addTarget(self, action: #selector(handleBack), for: .touchUpInside) let statusBarCover = UIView(backgroundColor: .white) view.addSubview(statusBarCover) statusBarCover.anchor(top: view.topAnchor, leading: view.leadingAnchor, bottom: view.safeAreaLayoutGuide.topAnchor, trailing: view.trailingAnchor) } func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { let estimatedSizeCell = MessageCell(frame: .init(x: 0, y: 0, width: view.frame.width, height: 1000)) estimatedSizeCell.item = self.items[indexPath.item] estimatedSizeCell.layoutIfNeeded() let estimatedSize = estimatedSizeCell.systemLayoutSizeFitting(.init(width: view.frame.width, height: 1000)) return .init(width: view.frame.width, height: estimatedSize.height) } func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets { return .init(top: 16, left: 0, bottom: 16, right: 0) } @objc fileprivate func handleBack() { navigationController?.popViewController(animated: true) } @objc fileprivate func handleKeyboardShow() { self.collectionView.scrollToItem(at: [0, items.count - 1], at: .bottom, animated: true) } @objc fileprivate func handleSend() { saveToFromMessages() saveToFromRecentMessages() } fileprivate func saveToFromMessages() { guard let currentUserId = Auth.auth().currentUser?.uid else { return } let collection = Firestore.firestore().collection("matches_messages").document(currentUserId).collection(match.uid) let data = ["text": customInputView.textView.text ?? "", "fromId": currentUserId, "toId": match.uid, "timestamp": Timestamp(date: Date())] as [String : Any] collection.addDocument(data: data) { (error) in if let error = error { print("Failed to save message:", error) return } // print("Successfully saved message into firestore") self.customInputView.textView.text = nil self.customInputView.placeholderLabel.isHidden = false } let toCollection = Firestore.firestore().collection("matches_messages").document(match.uid).collection(currentUserId) toCollection.addDocument(data: data) { (error) in if let error = error { print("Failed to save message:", error) return } // print("Successfully saved message into firestore") self.customInputView.textView.text = nil self.customInputView.placeholderLabel.isHidden = false } } fileprivate func saveToFromRecentMessages() { guard let currentUserId = Auth.auth().currentUser?.uid else { return } let data = ["text": customInputView.textView.text ?? "", "name": match.name, "profileImageUrl": match.profileImageUrl, "timestamp": Timestamp(date: Date()), "uid": match.uid] as [String : Any] Firestore.firestore().collection("matches_messages").document(currentUserId).collection("recent_messages").document(match.uid).setData(data) { (error) in if let error = error { print("Failed to save recent message to Firestore:", error) return } // print("Saved recent message") } // Save to the other user guard let currentUser = self.currentUser else { return } let toData = ["text": customInputView.textView.text ?? "", "name": currentUser.name ?? "", "profileImageUrl": currentUser.imageUrl1 ?? "", "timestamp": Timestamp(date: Date()), "uid": currentUserId] as [String : Any] Firestore.firestore().collection("matches_messages").document(match.uid).collection("recent_messages").document(currentUserId).setData(toData) { (error) in if let error = error { print("Failed to save recent message to Firestore:", error) return } // print("Saved recent message") } } var listener: ListenerRegistration? fileprivate func fetchMessages() { // print("Fetching messages") guard let currentUserId = Auth.auth().currentUser?.uid else { return } let query = Firestore.firestore().collection("matches_messages").document(currentUserId).collection(match.uid).order(by: "timestamp") listener = query.addSnapshotListener { (querySnapshot, error) in if let error = error { print("Failed to fetch messages:", error) return } querySnapshot?.documentChanges.forEach({ (change) in if change.type == .added { let dictionary = change.document.data() self.items.append(.init(dictionary: dictionary)) } }) self.collectionView.reloadData() self.collectionView.scrollToItem(at: [0, self.items.count - 1], at: .bottom, animated: true) } } }
[ -1 ]
ae732fb78bf8a705949d9eb2f43652be7430645f
d902e4cc2ba2a9fdae2e69d6134c1a907102d22f
/master WatchKit Extension/NotificationController.swift
51a74e8dee21d1018f03920149361849eed1de6d
[]
no_license
JamesCookies/WatchSpring
82d65699cd92fc614917e1899a5be8122d65666f
1fddab4a079f8af6ad7981f1b2ee82c2a782fb37
refs/heads/master
2020-12-31T00:41:19.652291
2017-02-02T08:14:04
2017-02-02T08:14:04
80,645,325
0
0
null
null
null
null
UTF-8
Swift
false
false
1,304
swift
// // NotificationController.swift // master WatchKit Extension // // Created by Manil Belarbi on 01/02/2017. // Copyright © 2017 jamescookies. All rights reserved. // import WatchKit import Foundation import UserNotifications class NotificationController: WKUserNotificationInterfaceController { override init() { // Initialize variables here. super.init() // Configure interface objects here. } override func willActivate() { // This method is called when watch view controller is about to be visible to user super.willActivate() } override func didDeactivate() { // This method is called when watch view controller is no longer visible super.didDeactivate() } /* override func didReceive(_ notification: UNNotification, withCompletion completionHandler: @escaping (WKUserNotificationInterfaceType) -> Swift.Void) { // This method is called when a notification needs to be presented. // Implement it if you use a dynamic notification interface. // Populate your dynamic notification interface as quickly as possible. // // After populating your dynamic notification interface call the completion block. completionHandler(.custom) } */ }
[ 286339, 282371, 279688, 179597, 235663, 282385, 320538, 282395, 324762, 216859, 36767, 282405, 282413, 219696, 282420, 238647, 159034, 312892, 282305, 309446, 282314, 196688, 282323, 196054, 241500, 282332, 200798, 230109, 166370, 286178, 229221, 282341, 108910, 282351, 223346, 144501, 282360, 313597 ]
fe5146c806b6d902425b190687444cad1536de66
e3b2bba61f3bf9ea5c4e833fe541421ef3e531a5
/Surf/SFConfigManager.swift
d8c56b427062dfb50247edf9f12199f2470d6748
[ "BSD-3-Clause" ]
permissive
veibei/A.BIG.T
dd139b67d027aed51b239e49e85f7bafb940ea35
49db6179545461775f3ca644f19c89ad2d3a9d0f
refs/heads/master
2020-08-17T14:49:16.333006
2018-02-16T17:57:13
2018-02-16T17:57:13
null
0
0
null
null
null
null
UTF-8
Swift
false
false
7,605
swift
// // SFConfigManager.swift // Surf // // Created by 孔祥波 on 8/20/16. // Copyright © 2016 abigt. All rights reserved. // //这个类给主app 使用 import Foundation import SFSocket import XRuler class SFConfigManager { static let manager:SFConfigManager = SFConfigManager() func loadSettings() { //加载磁盘上的配置 } init(){ copyConfig() } var configs:[SFConfig] = [] var selectConfig:SFConfig? { get { let c = ProxyGroupSettings.share.config for cc in configs { if cc.configName + configExt == c { return cc } } return nil } set { ProxyGroupSettings.share.config = newValue!.configName + configExt writeToGroup(newValue!.configName) try! ProxyGroupSettings.share.save() } } var icloudSyncEnabled:Bool = false var storageURL:URL{ if icloudSyncEnabled { return applicationDocumentsDirectory }else { return applicationDocumentsDirectory } } func copyConfig(){ let firstOpen = UserDefaults.standard.bool(forKey: "firstOpen") if firstOpen == false { let c = ["surf.conf","Default.conf"]//逗比极客精简版.json","逗比极客全能版.json","abclite普通版.json","abclite去广告版.json","surf_main.json" for f in c { if let p = Bundle.main.path(forResource: f, ofType: nil){ //let u = groupContainerURL.appendingPathComponent(f) let u2 = applicationDocumentsDirectory.appendingPathComponent(f) do { // try fm.copyItemAtPath(p, toPath: u.path!) try fm.copyItem(atPath: p, toPath: u2.path) }catch let e as NSError { print("copy config file error \(e)") } } } do { let surf = "surf" let p = Bundle.main.path(forResource:surf + ".conf", ofType: nil) let u2 = groupContainerURL().appendingPathComponent("surf.conf") // try fm.copyItemAtPath(p, toPath: u.path!) try fm.copyItem(atPath: p!, toPath: u2.path) }catch let e as NSError { print("copy config file error \(e)") } ProxyGroupSettings.share.config = "surf.conf" UserDefaults.standard.set(true, forKey: "firstOpen") UserDefaults.standard.synchronize() }else { } } func loadConfigs() { if configs.count > 0 { configs.removeAll() //防止多次进入 } let settings = ProxyGroupSettings.share print(settings.proxys) //加载配置 let u = storageURL do { let fns = try fm.contentsOfDirectory(atPath: u.path) for f in fns { if f.hasSuffix(".conf") { let dest = u.appendingPathComponent(f) let c = SFConfig.init(path:dest.path , loadRule: true) configs.append(c) if f == ProxyGroupSettings.share.config { selectConfig = c } } } } catch let e as NSError { print(e.localizedDescription) } } func reloadConfig(_ name:String){ // //重新加载配置,刷新Proxy 信息 let fn = name + configExt let u = storageURL.appendingPathComponent(fn) let config = SFConfig.init(path:u.path , loadRule: true) var found = false var idx = 0 for i in 0 ..< configs.count{ let c = configs[i] if c.configName == name { found = true idx = i break } } if found { //let fn = c.configName + configExt //removeConfigFile(fn) configs.remove(at: idx) configs.insert(config, at: idx) }else { configs.append(config) } if let s = selectConfig { if s.configName == name { selectConfig = config } } //print("\(ProxyGroupSettings.share.config):\(f)") //if f == ProxyGroupSettings.share.config { // selectConfig = c //} } func addConfig(_ config:SFConfig) { configs.append(config) } var configCount:Int { return configs.count } func configAtInde(_ index:Int) ->SFConfig { return configs[index] } func delConfig(_ config:SFConfig) { for i in 0 ..< configs.count{ let c = configs[i] if c == config { let fn = c.configName + configExt removeConfigFile(fn) configs.remove(at: i) } } } func delConfigAtIndex(_ index:Int) { if index < configs.count { let c = configs[index] let fn = c.configName + configExt removeConfigFile(fn) configs.remove(at: index) } } func removeConfigFile(_ fn:String){ let u = storageURL.appendingPathComponent(fn) do { try fm.removeItem(at: u) }catch let e as NSError { print("error :\(e.localizedDescription)") } } func writeConfig(_ config:SFConfig) { //将某个config 写入文件 } func urlForConfig(_ config:SFConfig) ->URL { let fn = config.configName + configExt let u = storageURL.appendingPathComponent(fn) return u } func writeToGroup(_ configName:String) { let fn = configName + configExt do { let p = storageURL.appendingPathComponent(fn) let u2 = groupContainerURL().appendingPathComponent(fn) // try fm.copyItemAtPath(p, toPath: u.path!) if fm.fileExists(atPath: u2.path) { try fm.removeItem(atPath: u2.path) } try fm.copyItem(atPath: p.path, toPath: u2.path) }catch let e as NSError { print("copy config file error \(e)") } } func selectedIndex() ->Int{ //缺省0 var r = 0 let fn = ProxyGroupSettings.share.config if !fn.isEmpty { for x in configs { let fnx = x.configName + configExt if fnx == fn { break } r += 1 } } return r } func addRule(_ r:SFRuler) ->Bool{ //从rule test result 添加 var result = false if let s = selectConfig{ if r.type == .ipcidr { s.ipcidrRulers.append(r) result = true }else if r.type == .domainsuffix { s.sufixRulers.append(r) result = true }else { } if result { writeConfig(s) } } return result } }
[ -1 ]
e533238568c548ccc74abb4b2dfd6308e3301410
560f148699233faf0b051d7f053df7625306ae61
/ContainerViewTutorial/ContainerViewTutorial/View/Shared/NavigationLazyView.swift
46138f63e891c4d56bb2374b49a1ae402def8495
[ "MIT" ]
permissive
deoliveira-filemon/ContainerViewState
6a835346d40a05d8c970bb6c2326f1fbdfe41889
402fcf3a582112b2cd9378bf34734c3d1b57d2e3
refs/heads/main
2023-03-23T20:31:11.479001
2021-03-16T20:14:26
2021-03-16T20:14:26
347,049,718
1
0
null
null
null
null
UTF-8
Swift
false
false
212
swift
import SwiftUI struct NavigationLazyView<T: View>: View { let build: () -> T init(_ build: @autoclosure @escaping () -> T) { self.build = build } var body: T { build() } }
[ 384587 ]
dc1be6d3a27856d565d9aae7998044c0c238ae77
775c2672b7953e79c1ba16ff79450b305b6f69c2
/App/ShopSmart/ShopSmart/Constant.swift
ef283fa4ecbde38bc32a229cb1e977b50c712afb
[]
no_license
shahmansi279/CMPE295Project
32c4793aca7230522587da10918951f485acb103
97ecda28f285e1ab66e113cee51de27e60b456d2
refs/heads/master
2021-01-21T13:20:54.936587
2016-04-17T23:10:31
2016-04-17T23:10:31
47,715,536
0
0
null
null
null
null
UTF-8
Swift
false
false
362
swift
// // Constant.swift // ShopSmart // // Created by Jessie Deot on 4/3/16. // Copyright © 2016 Mansi Modi. All rights reserved. // import Foundation struct Constant { //static let baseURL = "http://127.0.0.1:8000" //static let baseURL = "http://54.153.9.205:8000" static let baseURL = "http://ec2-54-153-9-205.us-west-1.compute.amazonaws.com" }
[ -1 ]
697af40071f159433582481dcede33c7c770a466
1cc9d2342e77fac0f13286cce51124728c2c7a9d
/FootballList/ViewControllers/UserNameViewController/UserNameViewController.swift
3127c855543e294ae7b623bb52a202dc13507acf
[]
no_license
Alexsmile2010/FootballApp
ea9e9370d89020429991bdc7175858599cc30abd
64b1f3a0b8de676c3d50a09e29ec2c2708ff8579
refs/heads/master
2021-01-11T13:55:05.448988
2017-06-20T13:25:12
2017-06-20T13:25:12
94,893,835
0
0
null
null
null
null
UTF-8
Swift
false
false
2,943
swift
// // UserNameViewController.swift // FootballList // // Created by Олексій on 01.05.17. // Copyright © 2017 AlexeyZayakin. All rights reserved. // import UIKit import Firebase import IQKeyboardManagerSwift class UserNameViewController: BaseViewController { @IBOutlet weak var userNameTextField:UITextField? @IBOutlet weak var warningLabel:UILabel? override func viewDidLoad() { super.viewDidLoad() self.userNameTextField?.becomeFirstResponder() IQKeyboardManager.sharedManager().keyboardDistanceFromTextField = 75 } override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) } fileprivate func showWarning(text: String) { self.warningLabel?.text = text self.warningLabel?.isHidden = false } fileprivate func writeUserNameAndLaunch() { let username = self.userNameTextField?.text AuthManager.shared.saveUser(username: username!) Storyboard.showRootViewController(.NewsFeedSwiperNavigationViewController) } @IBAction func nextTaped() { let username = self.userNameTextField?.text if username?.isEmpty == true { let alert = UIAlertController(title: "Ой! Что-то не так!", message: "Так нельзя! Мы хотим чтобы вы были личностью в нашем приложении", preferredStyle: .alert) let action = UIAlertAction(title: "Попробовать снова", style: .default, handler: nil) alert.addAction(action) self.presentVC(alert) } else { AuthManager.shared.checkUserNameDuplicate(username: username!) { (exist) in if exist == true { self.writeUserNameAndLaunch() } else { self.showWarning(text: STRINGS.WARNINGS.NAME_EXIST) } } } } @IBAction func continueButtonTapped(_ sender: AnyObject) { self.nextTaped() } @IBAction func textFieldDidChanged() { self.warningLabel?.isHidden = true if((self.userNameTextField?.text?.length)! > 4) { self.navigationItem.rightBarButtonItem?.isEnabled = true } else { self.navigationItem.rightBarButtonItem?.isEnabled = false } } } //MARK: UITextFieldDelegate extension UserNameViewController: UITextFieldDelegate { public func textFieldShouldReturn(_ textField: UITextField) -> Bool { if((self.userNameTextField?.text?.length)! > 4) { self.nextTaped() } else { self.showWarning(text: STRINGS.WARNINGS.NAME_TOO_SHORT) } return true } }
[ -1 ]
69b4e22845d29398fe547dc097fe7f5c6d3ef050
1a0a44e05cc193f6d923ca34cf883149ddca948b
/Hafta4/TheMovieDB/TheMovieDB/SceneDelegate.swift
b50e998593dd7b17c547078b762a0a95e858cbdc
[ "MIT" ]
permissive
Yemeksepeti-Mobil-iOS-Bootcamp/egemen_inceler
21873ac9893d8ab9fc3ddbb709e5e51ea2c24821
f28d52690e991d0377b8b1258ca1a3d8e7cf42f3
refs/heads/main
2023-07-04T21:37:26.266276
2021-07-30T16:16:06
2021-07-30T16:16:06
380,024,309
0
0
null
null
null
null
UTF-8
Swift
false
false
2,297
swift
// // SceneDelegate.swift // TheMovieDB // // Created by Egemen Inceler on 12.07.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, 344103, 393260, 393269, 213049, 376890, 385082, 393277, 376906, 327757, 254032, 368728, 254045, 180322, 376932, 286845, 286851, 417925, 262284, 360598, 377003, 377013, 164029, 327872, 180418, 377030, 377037, 377047, 418008, 418012, 377063, 327915, 205037, 393457, 393461, 393466, 418044, 385281, 262405, 180491, 164107, 336140, 262417, 368913, 262423, 377118, 377121, 262437, 254253, 336181, 262455, 393539, 262473, 344404, 213333, 418135, 270687, 262497, 418145, 262501, 213354, 262508, 246124, 262512, 213374, 385420, 262551, 262553, 385441, 385444, 262567, 385452, 262574, 393649, 385460, 262587, 344512, 262593, 360917, 369119, 328180, 328183, 328190, 254463, 328193, 328207, 410129, 393748, 377372, 188959, 385571, 377384, 197160, 33322, 352822, 270905, 197178, 418364, 188990, 369224, 385610, 270922, 352844, 385617, 352865, 262761, 352875, 344694, 352888, 377473, 336513, 385671, 148106, 377485, 352919, 98969, 344745, 361130, 336556, 434868, 164535, 164539, 328379, 328387, 352969, 385743, 385749, 189154, 369382, 361196, 418555, 344832, 336644, 344837, 344843, 328462, 361231, 394002, 336660, 418581, 418586, 434971, 369436, 369439, 418591, 262943, 418594, 336676, 418600, 418606, 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, 328690, 435188, 328703, 328710, 418822, 328715, 377867, 361490, 386070, 271382, 336922, 345119, 377888, 345134, 345139, 361525, 361537, 377931, 189525, 402523, 361568, 148580, 345200, 361591, 386168, 410746, 361594, 214150, 345224, 386187, 345247, 361645, 345268, 402615, 361657, 402636, 328925, 165086, 165092, 222438, 386286, 328942, 386292, 206084, 328967, 345377, 353572, 345380, 345383, 263464, 337207, 345400, 378170, 369979, 337230, 337235, 353634, 337252, 402792, 271731, 378232, 337278, 271746, 181639, 353674, 181644, 361869, 181650, 181655, 230810, 181671, 181674, 181679, 181682, 181687, 370105, 181691, 181697, 337350, 181704, 337366, 271841, 329192, 361961, 329195, 116211, 337399, 402943, 337416, 329227, 419341, 419345, 329234, 419351, 345626, 419357, 345631, 370208, 419360, 394787, 419363, 370214, 419369, 394796, 419377, 419386, 214594, 419401, 419404, 353868, 419408, 214611, 419412, 403040, 345702, 370298, 353920, 403073, 403076, 345737, 198282, 403085, 403092, 345750, 419484, 345758, 345763, 419492, 419498, 419502, 370351, 419507, 337588, 419510, 419513, 419518, 403139, 337607, 419528, 419531, 419536, 272083, 394967, 419545, 345819, 419548, 419551, 345829, 419560, 337643, 419564, 337647, 370416, 337671, 362249, 362252, 395022, 362256, 321300, 345888, 362274, 378664, 354107, 354112, 370504, 329545, 345932, 370510, 337751, 370520, 247639, 313181, 182110, 354143, 354157, 345965, 345968, 345971, 345975, 403321, 1914, 354173, 395148, 247692, 337809, 247701, 436127, 436133, 247720, 337834, 362414, 337845, 190393, 346064, 247760, 346069, 329699, 354275, 190440, 354314, 346140, 436290, 378956, 395340, 436307, 338005, 100454, 329833, 329853, 329857, 329868, 411806, 329886, 346273, 362661, 100525, 379067, 387261, 256193, 395467, 411862, 411865, 411869, 411874, 379108, 411877, 387303, 346344, 395496, 338154, 387307, 346350, 338161, 436474, 379135, 411905, 411917, 379154, 395539, 387350, 387353, 338201, 338212, 248112, 362823, 436556, 321880, 362844, 379234, 354674, 321911, 420237, 379279, 354728, 338353, 338382, 272849, 248279, 256474, 182755, 338404, 338411, 330225, 248309, 330254, 199189, 420377, 330268, 191012, 330320, 199250, 191069, 346722, 248427, 338544, 191093, 346743, 346769, 150184, 174775, 248505, 174778, 363198, 223936, 355025, 355029, 273109, 264919, 256735, 264942, 363252, 338680, 264965, 338701, 256787, 396067, 346917, 396070, 215854, 355123, 355141, 355144, 338764, 330581, 330585, 387929, 355167, 265056, 265059, 355176, 355180, 412600, 207809, 379849, 347082, 396246, 330711, 248794, 248799, 347106, 437219, 257009, 265208, 199681, 338951, 330761, 330769, 330775, 248863, 396329, 347178, 404526, 396337, 330803, 396340, 339002, 388155, 339010, 248905, 330827, 248915, 183384, 339037, 412765, 257121, 265321, 248952, 420985, 347288, 248986, 44199, 380071, 339118, 249018, 339133, 330959, 330966, 265433, 265438, 388320, 363757, 339199, 396552, 175376, 175397, 273709, 372016, 437553, 347442, 199989, 175416, 396601, 208189, 437567, 175425, 437571, 437576, 437584, 396634, 175451, 437596, 429408, 175458, 175461, 175464, 265581, 175478, 175487, 249215, 249219, 175491, 249225, 249228, 249235, 175514, 175517, 396703, 175523, 355749, 396723, 388543, 380353, 216518, 380364, 339406, 372177, 339414, 413143, 249303, 339418, 339421, 249310, 339425, 249313, 339429, 339435, 249329, 69114, 372229, 208399, 380433, 175637, 134689, 265779, 421442, 413251, 265796, 265806, 224854, 224858, 339553, 257636, 224871, 372328, 257647, 372338, 224885, 224888, 224891, 224895, 372354, 421509, 126597, 224905, 11919, 224911, 224914, 126611, 224917, 224920, 126618, 208539, 224923, 224927, 224930, 224933, 257705, 224939, 224943, 257713, 224949, 257717, 257721, 224954, 257725, 224960, 257733, 224966, 224970, 257740, 224976, 257745, 257748, 224982, 257752, 224987, 257762, 224996, 225000, 225013, 257788, 225021, 339711, 257791, 225027, 257796, 339722, 257802, 257805, 225039, 257808, 249617, 225044, 167701, 372500, 257815, 225049, 257820, 225054, 184096, 257825, 225059, 339748, 225068, 257837, 413485, 225071, 225074, 257843, 225077, 257846, 225080, 397113, 225083, 397116, 257853, 225088, 225094, 225097, 257869, 257872, 225105, 397140, 225109, 225113, 257881, 257884, 257887, 225120, 257891, 225128, 257897, 225138, 257909, 225142, 372598, 257914, 257917, 225150, 257922, 380803, 225156, 339845, 257927, 225166, 397201, 225171, 380823, 225176, 225183, 372698, 372704, 372707, 356336, 380919, 372739, 405534, 266295, 266298, 421961, 200786, 356440, 217180, 430181, 266351, 356467, 266365, 192640, 266375, 381069, 225425, 250003, 225430, 250008, 356507, 250012, 225439, 135328, 225442, 438434, 192674, 225445, 438438, 225448, 438441, 225451, 258223, 225456, 430257, 225459, 225462, 225468, 389309, 225472, 372931, 225476, 430275, 389322, 225485, 225488, 225491, 266454, 225494, 225497, 225500, 225503, 225506, 225511, 217319, 225515, 225519, 381177, 389381, 356638, 356641, 356644, 356647, 266537, 356650, 389417, 356656, 332081, 340276, 356662, 397623, 332091, 225599, 348489, 332107, 151884, 430422, 348503, 250201, 250203, 250211, 340328, 250217, 348523, 348528, 332153, 356734, 389503, 332158, 438657, 348548, 356741, 332175, 160152, 373146, 373149, 70048, 356783, 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, 381513, 348745, 324171, 324174, 324177, 389724, 332381, 373344, 340580, 348777, 381546, 340628, 184983, 373399, 258723, 332460, 389806, 332464, 332473, 381626, 332484, 332487, 332494, 357070, 357074, 332512, 340724, 332534, 155647, 373499, 348926, 389927, 348979, 398141, 357202, 389971, 357208, 389979, 430940, 357212, 357215, 439138, 349041, 340850, 381815, 430967, 324473, 398202, 119675, 324476, 430973, 340859, 324479, 340863, 324482, 324485, 324488, 185226, 381834, 324493, 324496, 324499, 430996, 324502, 324511, 422817, 324514, 201638, 373672, 324525, 5040, 111539, 324534, 5047, 324539, 324542, 398280, 349129, 340942, 209874, 340958, 431073, 398307, 340964, 209896, 201712, 209904, 381947, 201724, 431100, 349181, 431107, 349203, 209944, 209948, 250917, 357419, 209966, 209969, 209973, 209976, 209980, 209988, 209991, 209996, 431180, 349268, 250968, 210011, 373853, 341094, 210026, 210028, 210032, 349296, 210037, 210042, 210045, 349309, 152704, 160896, 349313, 210053, 210056, 349320, 259217, 373905, 210068, 210072, 210078, 210081, 210085, 210089, 210096, 210100, 324792, 210108, 357571, 210116, 210128, 210132, 333016, 210139, 210144, 218355, 218361, 275709, 128254, 275713, 242947, 275717, 275723, 333075, 349460, 349486, 349492, 415034, 210261, 365912, 259423, 374113, 251236, 374118, 390518, 357756, 374161, 112021, 349591, 357793, 333222, 259516, 415168, 366035, 415187, 366039, 415192, 415194, 415197, 415200, 333285, 415208, 366057, 366064, 415217, 415225, 423424, 415258, 415264, 366118, 415271, 382503, 349739, 144940, 415279, 415282, 415286, 210488, 415291, 415295, 333396, 333400, 366173, 423529, 423533, 210547, 415354, 333440, 267910, 267929, 259789, 366301, 333535, 366308, 366312, 431852, 399086, 366319, 210673, 366322, 399092, 366326, 333566, 268042, 210700, 366349, 210707, 399129, 333595, 358192, 366384, 210740, 366388, 358201, 325441, 366403, 325447, 341831, 341839, 341844, 415574, 358235, 350046, 399200, 399208, 358256, 268144, 358260, 325494, 399222, 333690, 325505, 399244, 333709, 333725, 333737, 382891, 382898, 358348, 333777, 219094, 399318, 358372, 350190, 350194, 333819, 350204, 350207, 325633, 325637, 350214, 268299, 333838, 350225, 350232, 333851, 350238, 350241, 374819, 350245, 350249, 350252, 178221, 350257, 350260, 350272, 243782, 350281, 350286, 374865, 252021, 342134, 374904, 333998, 334012, 260299, 358645, 268553, 268560, 432406, 325920, 358701, 391469, 358705, 358714, 358717, 383307, 358738, 383331, 383334, 391531, 383342, 334204, 391564, 366991, 334224, 342431, 375209, 375220, 334263, 326087, 358857, 195041, 334312, 104940, 375279, 350724, 186898, 342546, 350740, 342551, 342555, 416294, 350762, 252463, 358962, 334397, 252483, 219719, 399957, 334425, 326240, 334466, 334469, 391813, 162446, 342680, 342685, 260767, 342711, 244410, 260798, 260802, 350918, 154318, 342737, 391895, 154329, 416476, 64231, 113389, 203508, 375541, 342777, 391938, 391949, 375569, 375572, 375575, 375580, 162592, 334633, 326444, 383794, 375613, 244542, 260925, 375616, 342857, 416599, 342875, 244572, 433001, 400238, 211826, 211832, 392061, 351102, 260993, 400260, 211846, 342921, 342931, 400279, 252823, 392092, 400286, 359335, 211885, 400307, 351169, 359362, 351172, 170950, 359367, 326599, 187335, 359383, 359389, 383968, 261109, 244728, 261112, 383999, 261130, 261148, 359452, 211999, 261155, 261160, 261166, 359471, 375868, 384099, 384102, 367724, 384108, 343155, 384115, 212095, 384136, 384140, 384144, 384152, 384158, 384161, 351399, 384169, 367795, 244917, 384182, 384189, 351424, 384192, 343232, 367817, 244938, 384202, 253132, 384209, 146644, 351450, 384225, 359650, 343272, 351467, 359660, 384247, 351480, 384250, 351483, 351492, 384270, 261391, 359695, 253202, 261395, 384276, 384284, 245021, 384290, 253218, 245032, 171304, 384299, 351535, 245042, 326970, 384324, 212296, 212304, 367966, 343394, 367981, 343410, 155000, 327035, 245121, 245128, 253321, 155021, 384398, 245137, 245143, 245146, 245149, 245152, 245155, 155045, 245158, 114093, 327090, 343478, 359867, 384444, 327108, 327112, 384457, 359887, 359891, 368093, 155103, 343535, 343540, 368120, 409092, 359948, 359951, 359984, 400977, 400982, 179803, 155241, 155255, 155274, 368289, 245410, 425652, 425663, 155328, 245463, 155352, 155356, 155364, 245477, 155372, 245487, 212723, 409336, 155394, 155404, 245528, 155423, 360224, 155439, 204592, 155444, 155448, 417596, 384829, 360262, 155463, 155477, 376665, 155484, 261982, 425823, 376672, 155488, 155492, 327532, 261997, 376686, 262000, 262003, 327542, 147319, 262006, 262009, 425846, 262012, 155517, 155523, 155526, 360327, 376715, 155532, 262028, 262031, 262034, 262037, 262040, 262043, 155550, 253854, 262046, 262049, 262052, 327590, 155560, 155563, 155566, 327613, 393152, 393170, 155604, 155620, 253924, 155622, 327655, 253927, 360432, 393204, 360439, 253944, 393209, 393215 ]
c096bb1d98d4d0530210288bace5753b1929bb5e
253dc7a653d45b7a4dfd461d26c750e83cba0cf8
/Example/SettingsItems.swift
da18af78afc127e20d3cd0dc5902a3c99dd3e895
[ "LicenseRef-scancode-unknown-license-reference", "MIT", "ISC" ]
permissive
Trapster223/mapbox-navigation-ios
e05e2f3da38a38976b6a8caa09ac568be5fa229c
5b842cb2b633ed5251f6a73ab5fa262d4dc1a3ff
refs/heads/master
2022-09-05T00:33:11.865858
2020-06-01T04:20:50
2020-06-01T04:20:50
268,423,766
2
0
NOASSERTION
2020-06-01T04:19:37
2020-06-01T04:19:36
null
UTF-8
Swift
false
false
4,297
swift
import UIKit import MapboxDirections import MapboxCoreNavigation typealias Payload = () -> () let MBSelectedOfflineVersion = "MBSelectedOfflineVersion" protocol ItemProtocol { var title: String { get } var subtitle: String? { get } // View controller to present on SettingsViewController.tableView(_:didSelectRowAt:) var viewControllerType: UIViewController.Type? { get } // Closure to call on SettingsViewController.tableView(_:didSelectRowAt:) var payload: Payload? { get } // SettingsViewController.tableView(_:canEditRowAt:) var canEditRow: Bool { get } } struct Item: ItemProtocol { let title: String let subtitle: String? let viewControllerType: UIViewController.Type? let payload: Payload? var canEditRow: Bool init(title: String, subtitle: String? = nil, viewControllerType: UIViewController.Type? = nil, payload: Payload? = nil, canEditRow: Bool = false) { self.title = title self.subtitle = subtitle self.viewControllerType = viewControllerType self.payload = payload self.canEditRow = canEditRow } } struct OfflineVersionItem: ItemProtocol { var title: String var subtitle: String? var viewControllerType: UIViewController.Type? var payload: Payload? var canEditRow: Bool init(title: String, subtitle: String? = nil, viewControllerType: UIViewController.Type? = nil, payload: Payload? = nil, canEditRow: Bool = false) { self.title = title self.subtitle = subtitle self.viewControllerType = viewControllerType self.payload = payload self.canEditRow = canEditRow } } class OfflineSwitch: UISwitch { var payload: Payload? var item: OfflineVersionItem? override init(frame: CGRect) { super.init(frame: frame) } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } } struct Section { let title: String let items: [ItemProtocol] } extension SettingsViewController { func sections() -> [Section] { let offlineItem = Item(title: NSLocalizedString("SETTINGS_ITEM_DOWNLOAD_REGION_TITLE", value: "Download Region", comment: "Title of table view item that downloads a new offline region"), viewControllerType: OfflineViewController.self, payload: nil) let offlineSection = Section(title: NSLocalizedString("SETTINGS_SECTION_OFFLINE_EXAMPLES", value: "Offline Examples", comment: "Section of offline settings table view"), items: [offlineItem]) let versionSection = Section(title: NSLocalizedString("SETTINGS_SECTION_DOWNLOADED_VERSIONS", value: "Downloaded Versions", comment: "Section of offline settings table view"), items: versionDirectories()) return [offlineSection, versionSection] } func versionDirectories() -> [ItemProtocol] { var versions = [OfflineVersionItem]() let directories = try? FileManager.default.contentsOfDirectory(atPath: Bundle.mapboxCoreNavigation.suggestedTileURL!.path) let byteCountFormatter = ByteCountFormatter() byteCountFormatter.allowedUnits = .useMB byteCountFormatter.countStyle = .file let filteredDirectories = directories?.filter { $0 != ".DS_Store" } filteredDirectories?.forEach { var subtitle: String? = nil let path = Bundle.mapboxCoreNavigation.suggestedTileURL!.appendingPathComponent($0) if let directorySize = path.directorySize { subtitle = byteCountFormatter.string(fromByteCount: Int64(directorySize)) } versions.append(OfflineVersionItem(title: $0, subtitle: subtitle, canEditRow: true)) } return versions } } extension URL { var directorySize: Int? { guard (try? resourceValues(forKeys: [.isDirectoryKey]).isDirectory) as Bool?? != nil else { return nil } var directorySize = 0 (FileManager.default.enumerator(at: self, includingPropertiesForKeys: nil)?.allObjects as? [URL])?.lazy.forEach { directorySize += (try? $0.resourceValues(forKeys: [.totalFileAllocatedSizeKey]))?.totalFileAllocatedSize ?? 0 } return directorySize } }
[ -1 ]
278a757fdb857149492877055bab140728f91291
08ab42705d24bc689b2480dcb96259ab382d064f
/Pod/Classes/SwiftBeaker.swift
9da5dbcbf87b774b4658bfa782ab3e14a425373c
[ "MIT" ]
permissive
banjun/SwiftBeaker
b4cc58f8e3c15967a70535c04774cae69b44ff20
b0d53925d90d3f004b0bd18cc58589d0212b8691
refs/heads/master
2023-04-07T13:20:34.894449
2023-01-22T14:18:28
2023-01-22T14:18:28
87,050,738
6
0
MIT
2023-03-17T06:09:48
2017-04-03T07:54:48
Swift
UTF-8
Swift
false
false
70
swift
import APIKit import URITemplate // no common implementation so far
[ -1 ]
04d2f41519653f0601938b89d4d3f14baea7bbe3
f4a67327808436bef5d1fa46d4246bd21aafad0b
/UISplitViewController_HelloWorld/UISplitViewController_HelloWorld/Utility/Protocol+.swift
59969b9d147553e64561bee590cd8430b452ad52
[ "MIT" ]
permissive
William-Weng/Swift-5
43279821a46d7c4aa14ec7fe72bec9c0f184d172
5cde923d46c14c31b792e116b10e9a8ae9afbf31
refs/heads/master
2023-01-14T07:21:52.564739
2022-12-30T03:41:30
2022-12-30T03:41:30
387,373,214
7
0
null
null
null
null
UTF-8
Swift
false
false
777
swift
import UIKit // MARK: - 可重複使用的Cell (UITableViewCell / UICollectionViewCell) protocol CellReusable: class { static var identifier: String { get } /// Cell的Identifier var indexPath: IndexPath { get } /// Cell的IndexPath /// Cell的相關設定 func configure(with indexPath: IndexPath) } // MARK: - 預設 identifier = class name (初值) extension CellReusable { static var identifier: String { return String(describing: Self.self) } var indexPath: IndexPath { return [] } } // MARK: - 設定狀態列的顯示或隱藏 // - override var prefersStatusBarHidden: Bool { return isStatusBarHidden } protocol StatusBarHideable where Self: UIViewController { var isStatusBarHidden: Bool { get set } }
[ -1 ]
cb84128b0c9d059527745e1c38baf2ea4e6cb860
2186d933f4ec8f27d9bf56013f9891ab4838f602
/Higher Order Functions/Map.playground/Contents.swift
702cc7005fc71e71d9f057adfe5688293cb54522
[]
no_license
MallikarjunH/Swift_Concepts
db5645aded60e686fe7662e27ee3b5cc63374f76
9874e372233f35c877c1590f6a8f75d52fc331d1
refs/heads/master
2022-11-28T11:37:08.286774
2022-11-23T05:56:13
2022-11-23T05:56:13
200,162,697
0
0
null
null
null
null
UTF-8
Swift
false
false
2,981
swift
import UIKit var greeting = "Hello, playground" //Map - map(), flatMap(), compactMap() //Mapping is similar to sort in that it iterates through the array that is calling it, but instead of sorting it changes each element of the array based on the closure passed to the method. //(OR - map will iterate through all elements in an array and will return an updated array.) var numArray = [8,2,3,7,9,1,5,2,4,6] //numArray.map(<#T##(Self.Element) -> T#>) //numArray.flatMap(<#T##(Self.Element) -> SegmentOfResult#>) //numArray.compactMap(<#T##(Self.Element) -> ElementOfResult?#>) let stringArray1 = numArray.map { (a) -> String in return String(a) } print(stringArray1) //["8", "2", "3", "7", "9", "1", "5", "2", "4", "6"] //it changes each element of the array based on the closure passed to the method. let stringArray2 = numArray.map { String($0) } print(stringArray2) //["8", "2", "3", "7", "9", "1", "5", "2", "4", "6"] let nameArray = ["AJUN", "KARAN", "SAGAR", "C SHIVAJI", "B THAKARE"] let smallCaseNameArray = nameArray.map { (name) -> String in return name.lowercased() // name.uppercased() } print("Lower Case Name Array: \(smallCaseNameArray)") //["ajun", "karan", "sagar", "c shivaji", "b thakare"] let smallCaseNameArray2 = nameArray.map { $0.uppercased() } print(smallCaseNameArray2) //["AJUN", "KARAN", "SAGAR", "C SHIVAJI", "B THAKARE"] let smallCaseNameArray3 = nameArray.map { $0.lowercased() } print(smallCaseNameArray3) //["ajun", "karan", "sagar", "c shivaji", "b thakare"] //2. compactMap - compactMap will iterate through all elements in an array and will return an updated array only with the elements which satisfied the condition written inside the body of compactMap //Any element which resulting in a nil value will be excluded(removed/skipped) from the updated array. //following case "$" - this item is excluded let coins = ["1", "5", "$", "10", "6"] //coins.compactMap(<#T##transform: (String) throws -> ElementOfResult?##(String) throws -> ElementOfResult?#>) let validCoinsUsingCompactMap = coins.compactMap { coin in Int(coin) } print("Output 1: \(validCoinsUsingCompactMap)") //[1, 5, 10, 6] let validCoinsUsingCompactMapSyantax2 = coins.compactMap { Int($0) } print("Output 2: \(validCoinsUsingCompactMapSyantax2)") //[1, 5, 10, 6] //3. flatMap - It allows us to transform a set of arrays into a single set that contains all the elements. //OR - flatMap converts 2D array to one dimensional array. let words: [[String]] = [["room", "home"], ["train", "green"], ["heroe"]] //words.flatMap(<#T##transform: ([String]) throws -> Sequence##([String]) throws -> Sequence#>) let singleArray1 = words.flatMap {(array) in array } print("Output1 of flatMap: \(singleArray1)") //'flatMap' is deprecated: Please use compactMap(_:) for the case where closure returns an optional value let singleArray2 = words.flatMap { $0 } print("Output2 of flatMap: \(singleArray2)") //["room", "home", "train", "green", "heroe"]
[ -1 ]
ee8954c779d429729f3cdc588ed0f4743b60d60f
a1b2c64b11d406cc7ebcddc0609fee41214e3f96
/CallKitPOC/Service/SQLRepresentable.swift
bfad5cb9bffce08c48f32d1a504f49aa5c249f67
[]
no_license
chillxcode/CallKitPOC
dd6ab7dad93760f4520e512a409ab24bd2404236
6f4fc92b0d0b4c9f3010c4242d2233ccd7de843c
refs/heads/master
2021-02-06T23:56:57.319627
2020-02-29T11:47:53
2020-02-29T11:47:53
243,958,653
0
0
null
null
null
null
UTF-8
Swift
false
false
441
swift
// // SQLRepresentable.swift // CallKitPOC // // Created by Emre Celik on 13.02.2020. // Copyright © 2020 Emre Celik. All rights reserved. // import Foundation import SQLite protocol SQLRepresentable { associatedtype Model var table: Table { get } func createTable() func insert(model: Model) func selectAll() -> [Model] func select(model: Model) -> Model? func deleteAll() func delete(model: Model) }
[ -1 ]
13208c18ba02d3a2c8f5e8981fe24ac3ef87f593
f895ee37467ad19e77175ef611926a1f916f6ba1
/tests dev/Grimm-Starter/Grimm/StoryViewController.swift
aca965e3632a2e42689a7f1bd8974278b786ca62
[]
no_license
BaptisteLanusse/whateverCodeSwift
1b7dcc4b70dd3466e7034c42bf7af80913a766a8
bcada182ca4c3bdc057fca4dbf258189af1bf944
refs/heads/master
2021-01-25T03:26:51.986899
2016-01-12T10:29:17
2016-01-12T10:29:17
33,257,701
0
0
null
null
null
null
UTF-8
Swift
false
false
4,430
swift
/* * Copyright (c) 2014 Razeware LLC * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ import UIKit class StoryViewController: UIViewController, ThemeAdopting { @IBOutlet weak var scrollView: UIScrollView! @IBOutlet weak var storyView: StoryView! @IBOutlet weak var optionsContainerView: UIView! @IBOutlet weak var optionsContainerViewBottomConstraint: NSLayoutConstraint! var showingOptions = false var blurView = UIImageView() var story: Story? required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) NSNotificationCenter.defaultCenter().addObserver(self, selector: Selector("themeDidChange:"), name: ThemeDidChangeNotification, object: nil) } deinit { NSNotificationCenter.defaultCenter().removeObserver(self) } override func viewDidLoad() { super.viewDidLoad() let image = UIImage(named: "Bull") let imageView = UIImageView(image: image) navigationItem.titleView = imageView reloadTheme() if story != nil { storyView.story = story } //optionsContainerView.subviews[0].insertSubview(blurView, atIndex: 0) } override func viewWillTransitionToSize(size: CGSize, withTransitionCoordinator coordinator: UIViewControllerTransitionCoordinator) { coordinator.animateAlongsideTransition(nil, completion: { context in self.updateBlur() }) } override func viewWillAppear(animated: Bool) { super.viewWillAppear(animated) setOptionsHidden(true, animated: false) } @IBAction func optionsButtonTapped(_: AnyObject) { setOptionsHidden(showingOptions, animated: true) } func updateBlur(){ optionsContainerView.hidden = true UIGraphicsBeginImageContextWithOptions(self.view.bounds.size, true, 1) self.view.drawViewHierarchyInRect(self.view.bounds, afterScreenUpdates: true) let screenshot = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext() let blur = screenshot.applyLightEffect() blurView.frame = optionsContainerView.bounds blurView.image = blur blurView.contentMode = .Bottom optionsContainerView.hidden = false } private func setOptionsHidden(hidden: Bool, animated: Bool) { if !hidden { //updateBlur() } showingOptions = !hidden; let height = CGRectGetHeight(optionsContainerView.bounds) var constant = optionsContainerViewBottomConstraint.constant constant = hidden ? (constant - height) : (constant + height) view.layoutIfNeeded() if animated { UIView.animateWithDuration(0.2, delay: 0, usingSpringWithDamping: 0.95, initialSpringVelocity: 1, options: [.AllowUserInteraction, .BeginFromCurrentState], animations: { self.optionsContainerViewBottomConstraint.constant = constant self.view.layoutIfNeeded() }, completion: nil) } else { optionsContainerViewBottomConstraint.constant = constant } } func themeDidChange(notification: NSNotification!) { reloadTheme() storyView.reloadTheme() } func reloadTheme() { let theme = Theme.sharedInstance scrollView.backgroundColor = theme.textBackgroundColor for viewController in childViewControllers { let controller = viewController as UIViewController controller.view.tintColor = theme.tintColor } } }
[ -1 ]
af5a2cf90be21e7512bbe90b3afac0f20b52e7ce
78dd1ee402e5befd6dab537ddd9c43002aee59c0
/Now>Later>Never/Views & Custom Views/TaskUITextField.swift
f1d13eadea8ff57a04f040b172941773cc0e257b
[]
no_license
goldena/Now-Later-Never
55b2c272d9622147e9f1bf67f91d7ed2228d35f1
5654fc5ba1f6fb1f525ca87efb86db3be3fb79b6
refs/heads/main
2023-03-05T18:10:18.749226
2021-02-14T21:50:49
2021-02-14T21:50:49
326,523,131
0
0
null
null
null
null
UTF-8
Swift
false
false
646
swift
// // TaskUITextField.swift // Now>Later>Never // // Created by Denis Goloborodko on 8.02.21. // import UIKit class TaskUITextField: UITextField { override init(frame: CGRect) { super.init(frame: frame) translatesAutoresizingMaskIntoConstraints = false font = UIFont.systemFont(ofSize: 20) backgroundColor = .placeholderText layer.cornerRadius = 8 } required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } convenience init(placeholder: String) { self.init() self.placeholder = placeholder } }
[ -1 ]
61db10d222289badd2cc8c7027b889ecb9c768a1
5c721a05e7038264c9fb4d28452ee0230359b626
/源代码/7.3.2UILabel_SizingText1/7.3.2UILabel_SizingText1/AppDelegate.swift
27215ad743ed22c19eb1139683f8f419456a6989
[ "MIT" ]
permissive
CoderDream/iOS_Development_From_Entry_To_Master
c7f9fb02999d8f7309c2662d7bf8ab0c775c969d
80f63e27834302a1d85118178e2458ef89fc54c3
refs/heads/master
2020-04-24T12:56:11.555558
2019-05-27T13:15:39
2019-05-27T13:15:39
171,971,097
4
1
null
null
null
null
UTF-8
Swift
false
false
2,174
swift
// // AppDelegate.swift // 7.3.2UILabel_SizingText1 // // Created by 王亮 on 16/7/10. // Copyright © 2016年 www.coolketang.com. 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 active state; here you can undo many of the changes made on entering the background. } func applicationDidBecomeActive(_ application: UIApplication) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } }
[ 229380, 229383, 229385, 278539, 229388, 294924, 278542, 229391, 327695, 278545, 229394, 278548, 229397, 229399, 229402, 278556, 229405, 352284, 278559, 229408, 278564, 229415, 229417, 327722, 237613, 229422, 229426, 237618, 229428, 286774, 229432, 286776, 286778, 319544, 204856, 286791, 237640, 278605, 286797, 311375, 196692, 319573, 311383, 278623, 278626, 319590, 311400, 278635, 303212, 278639, 278648, 131192, 237693, 327814, 131209, 417930, 303241, 311436, 303244, 319633, 286873, 286876, 311460, 311469, 32944, 327862, 286906, 327866, 180413, 286910, 286916, 286922, 286924, 286926, 319694, 286928, 131281, 278743, 278747, 295133, 155872, 319716, 278760, 237807, 303345, 286962, 229622, 327930, 278781, 278783, 278785, 237826, 319751, 278792, 286987, 319757, 311569, 286999, 319770, 287003, 287006, 287009, 287012, 287014, 287016, 287019, 311598, 287023, 262448, 311601, 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, 278983, 319945, 278986, 278990, 278994, 311767, 279003, 279006, 188895, 279010, 287202, 279015, 172520, 319978, 279020, 279023, 311791, 172529, 279027, 319989, 164343, 180727, 279035, 311804, 287230, 279040, 303617, 287234, 279045, 287238, 172550, 172552, 303623, 320007, 279051, 172558, 279055, 303632, 279058, 303637, 279063, 279067, 172572, 279072, 172577, 295459, 172581, 295461, 279082, 279084, 172591, 172598, 279095, 172607, 172609, 172612, 377413, 172614, 172618, 303690, 33357, 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, 287390, 295583, 303773, 172702, 287394, 230045, 303780, 172705, 287398, 172707, 287400, 279208, 172714, 295595, 279212, 189102, 172721, 287409, 66227, 303797, 189114, 287419, 328381, 279231, 287423, 328384, 287427, 312005, 312006, 107208, 107212, 172748, 287436, 287440, 295633, 172755, 303827, 279255, 279258, 303835, 213724, 189149, 303838, 287450, 279267, 295654, 279272, 230128, 312048, 312050, 230131, 205564, 303871, 230146, 328453, 295685, 230154, 33548, 312077, 295695, 295701, 369433, 230169, 295707, 328476, 295710, 230175, 303914, 279340, 279353, 230202, 312124, 222018, 295755, 377676, 148302, 287569, 303959, 230237, 279390, 230241, 279394, 303976, 336744, 303985, 328563, 303987, 303991, 303997, 295806, 295808, 304005, 320391, 213895, 304007, 304009, 304011, 304013, 213902, 279438, 295822, 189329, 295825, 304019, 279445, 58262, 304023, 279452, 279461, 279462, 304042, 213931, 230327, 304055, 287675, 304063, 238528, 304065, 189378, 213954, 156612, 312272, 304084, 304090, 320481, 304106, 320490, 312302, 328687, 320496, 304114, 295928, 320505, 295945, 197645, 295949, 230413, 320528, 140312, 295961, 238620, 304164, 189479, 304170, 238641, 238652, 238655, 230465, 238658, 296004, 336964, 205895, 320584, 238666, 296021, 402518, 336987, 230497, 296036, 296040, 361576, 205931, 296044, 164973, 205934, 279661, 312432, 279669, 337018, 189562, 279679, 279683, 222340, 205968, 296084, 238745, 304285, 238756, 205991, 222377, 165035, 337067, 165038, 238766, 230576, 238770, 304311, 350308, 230592, 279750, 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, 214294, 304416, 230689, 173350, 312622, 296243, 312630, 222522, 222525, 296253, 312639, 296255, 296259, 378181, 296262, 230727, 238919, 320840, 296264, 296267, 296271, 222545, 230739, 312663, 337244, 222556, 230752, 312676, 230760, 173418, 410987, 230763, 230768, 296305, 312692, 230773, 279929, 181626, 304506, 304505, 181631, 312711, 312712, 296331, 288140, 230800, 288144, 337306, 288160, 173472, 288162, 288164, 279975, 304555, 370092, 279983, 288176, 279985, 173488, 312755, 296373, 279991, 312759, 288185, 337335, 222652, 312766, 173507, 296389, 222665, 230860, 312783, 288208, 230865, 288210, 370130, 288212, 280021, 288214, 148946, 239064, 288217, 288218, 280027, 288220, 329177, 239070, 288224, 288226, 370146, 280036, 288229, 280038, 288230, 288232, 280034, 288234, 288236, 288238, 288240, 291754, 288242, 296435, 288244, 288250, 402942, 148990, 296446, 206336, 296450, 230916, 230919, 370187, 304651, 304653, 230940, 222752, 108066, 296486, 296488, 157229, 230961, 157236, 288320, 288325, 124489, 280140, 280145, 288338, 280149, 280152, 288344, 239194, 280158, 403039, 370272, 239202, 312938, 280183, 280185, 280188, 280191, 280194, 116354, 280208, 280211, 288408, 280218, 280222, 321195, 296622, 321200, 337585, 296626, 296634, 296637, 313027, 280260, 280264, 206536, 206539, 206541, 206543, 280276, 321239, 280283, 313052, 288478, 313055, 321252, 313066, 280302, 288494, 419570, 321266, 288499, 288502, 280314, 288510, 124671, 67330, 280324, 198405, 288519, 280331, 198416, 296723, 116503, 321304, 329498, 296731, 321311, 313121, 313123, 304932, 321316, 280363, 141101, 165678, 280375, 321336, 288576, 345921, 280388, 304968, 280393, 280402, 173907, 313176, 42842, 280419, 321381, 296812, 313201, 1920, 255873, 305028, 280454, 247688, 124817, 280468, 239510, 280473, 124827, 247709, 214944, 313258, 321458, 296883, 124853, 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, 280651, 354382, 288848, 280658, 215123, 354390, 288855, 288859, 280669, 313438, 280671, 223327, 149599, 321634, 149601, 149603, 280681, 313451, 223341, 280687, 313458, 280691, 149618, 215154, 313464, 329850, 321659, 280702, 288895, 321670, 215175, 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, 305464, 280891, 289087, 280897, 280900, 239944, 305480, 280906, 239947, 305485, 305489, 280919, 354653, 354656, 313700, 280937, 313705, 190832, 280946, 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, 338532, 281190, 199273, 281196, 158317, 313973, 281210, 297594, 158347, 133776, 314003, 117398, 314007, 289436, 174754, 330404, 289448, 133801, 314029, 314033, 240309, 314047, 314051, 199364, 297671, 158409, 289493, 363234, 289513, 289522, 289525, 289532, 322303, 322310, 264969, 322314, 322318, 281361, 281372, 322341, 215850, 281388, 207661, 289593, 281401, 289601, 281410, 281413, 281414, 240458, 281420, 240468, 281430, 322393, 297818, 281435, 281438, 281442, 174955, 224110, 207737, 183172, 240519, 322440, 338823, 314249, 183184, 289687, 240535, 297883, 289694, 289696, 289700, 289712, 281529, 289724, 52163, 183260, 281567, 289762, 322534, 297961, 281581, 183277, 322550, 134142, 175134, 322599, 322610, 314421, 281654, 314427, 207937, 314433, 207949, 322642, 314456, 281691, 314461, 281702, 281704, 281711, 289912, 248995, 306341, 306347, 306354, 142531, 199877, 289991, 306377, 289997, 363742, 363745, 298216, 330988, 216303, 322801, 388350, 363802, 199976, 199978, 314671, 298292, 298294, 216376, 298306, 380226, 224584, 224587, 224594, 216404, 306517, 150870, 314714, 224603, 159068, 314718, 314723, 281960, 150890, 306539, 314732, 314736, 290161, 308418, 216436, 306549, 298358, 314743, 306552, 290171, 314747, 306555, 290174, 224641, 281987, 298372, 314756, 281990, 224647, 298377, 314763, 224657, 306581, 314773, 314779, 314785, 282025, 314793, 282027, 241068, 241070, 241072, 282034, 150966, 298424, 306618, 282044, 323015, 306635, 306640, 290263, 290270, 290275, 339431, 282089, 191985, 282098, 282101, 241142, 191992, 290298, 151036, 290302, 290305, 175621, 192008, 323084, 282127, 290321, 282130, 282133, 290325, 241175, 290328, 290332, 241181, 282142, 282144, 290344, 306731, 290349, 290351, 290356, 282186, 224849, 282195, 282201, 306778, 159324, 159330, 314979, 298598, 323176, 224875, 241260, 257658, 315016, 282249, 290445, 324757, 282261, 298651, 282269, 323229, 298655, 323231, 61092, 282277, 282295, 282300, 323260, 323266, 282310, 323273, 282319, 306897, 241362, 282328, 306904, 298714, 52959, 216801, 282337, 241380, 216806, 323304, 282345, 12011, 282356, 323318, 282364, 282367, 306945, 241412, 323333, 282376, 216842, 323345, 282388, 282392, 184090, 315167, 315169, 282402, 315174, 323367, 241448, 315176, 282410, 241450, 306988, 306991, 315184, 315190, 241464, 282425, 159545, 298811, 307009, 413506, 307012, 315211, 307027, 315221, 282454, 315223, 241496, 241498, 307035, 307040, 282465, 241509, 110438, 298860, 110445, 282478, 282481, 110450, 315251, 315249, 315253, 315255, 339838, 282499, 315267, 315269, 241544, 282505, 241546, 241548, 298896, 282514, 298898, 44948, 298901, 241556, 282520, 241560, 241563, 241565, 241567, 241569, 282531, 241574, 282537, 298922, 241581, 241583, 323504, 241586, 282547, 241588, 241590, 241592, 241598, 290751, 241600, 241605, 151495, 241610, 298975, 241632, 298984, 241643, 298988, 241646, 241649, 241652, 323574, 290807, 241661, 299006, 282623, 315396, 241669, 315397, 282632, 282639, 282645, 241693, 282654, 241701, 102438, 217127, 282669, 323630, 282681, 290877, 282687, 159811, 315463, 315466, 192589, 307278, 307287, 315482, 217179, 315483, 192605, 233567, 200801, 299105, 217188, 299109, 307303, 315495, 356457, 45163, 307307, 315502, 192624, 307314, 323700, 299126, 233591, 307329, 307338, 233613, 241813, 307352, 299164, 184479, 299167, 184481, 184486, 307370, 307372, 307374, 307376, 323763, 176311, 299191, 307385, 307386, 258235, 176316, 307388, 307390, 184503, 299200, 307394, 307396, 299204, 184518, 307399, 323784, 307409, 307411, 176343, 299225, 233701, 307432, 282881, 282893, 291089, 282906, 291104, 233766, 307508, 315701, 307510, 332086, 151864, 307512, 307515, 282942, 307518, 151874, 282947, 282957, 323917, 110926, 233808, 323921, 315733, 323926, 233815, 315739, 299357, 242018, 242024, 299373, 315757, 250231, 242043, 315771, 299391, 291202, 299398, 242057, 291212, 299405, 291222, 283033, 291226, 242075, 315801, 291231, 61855, 283042, 291238, 291241, 127403, 127405, 291247, 127407, 299440, 299444, 127413, 283062, 291254, 127417, 291260, 283069, 127421, 127424, 299457, 291269, 127431, 176592, 127440, 315856, 315860, 176597, 283095, 127447, 299481, 127449, 176605, 242143, 127455, 291299, 127463, 242152, 291305, 127466, 176620, 127474, 291314, 291317, 135672, 127480, 233979, 291323, 127485, 291330, 283142, 127494, 135689, 233994, 127497, 127500, 233998, 234003, 234006, 152087, 127511, 283161, 242202, 234010, 135707, 242206, 135710, 242208, 291361, 242220, 291378, 234038, 152118, 234041, 315961, 70213, 242250, 111193, 242275, 299620, 242279, 168562, 184952, 135805, 291456, 135808, 373383, 135820, 316051, 225941, 316054, 299672, 135834, 373404, 299677, 135839, 299680, 225954, 135844, 299684, 242343, 209576, 242345, 373421, 135870, 135873, 135876, 135879, 299720, 299723, 225998, 299726, 226002, 226005, 119509, 226008, 201444, 299750, 283368, 234219, 283372, 226037, 283382, 316151, 234231, 234236, 226045, 234239, 242431, 209665, 234242, 299778, 242436, 226053, 234246, 226056, 234248, 291593, 242443, 234252, 242445, 234254, 291601, 234258, 242450, 242452, 234261, 348950, 201496, 234264, 234266, 283421, 234269, 234272, 234274, 152355, 234278, 299814, 283432, 234281, 234284, 234287, 283440, 185138, 242483, 234292, 234296, 234298, 283452, 160572, 234302, 234307, 242499, 234309, 292433, 234313, 316233, 316235, 234316, 283468, 242511, 234319, 234321, 234324, 185173, 201557, 234329, 234333, 308063, 234336, 234338, 242530, 349027, 234341, 234344, 234347, 177004, 234350, 324464, 234353, 152435, 177011, 234356, 234358, 234362, 226171, 291711, 234368, 234370, 201603, 234373, 226182, 234375, 226185, 308105, 234379, 234384, 234388, 234390, 226200, 324504, 234393, 209818, 308123, 324508, 234398, 291742, 234396, 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, 193486, 275406, 193488, 234446, 234449, 316370, 234452, 234455, 234459, 234461, 234467, 234470, 168935, 5096, 324585, 234475, 234478, 316400, 234481, 316403, 234484, 234485, 324599, 234487, 234490, 234493, 234496, 316416, 234501, 275462, 308231, 234504, 234507, 234510, 234515, 300054, 234519, 316439, 234520, 234523, 234526, 234528, 300066, 234532, 300069, 234535, 234537, 234540, 144430, 234543, 234546, 275508, 234549, 300085, 300088, 234553, 234556, 234558, 316479, 234561, 316483, 308291, 160835, 234563, 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, 234636, 177293, 234640, 275602, 234643, 226453, 275606, 234647, 275608, 308373, 234650, 308379, 234648, 283805, 234653, 324766, 119967, 234657, 300189, 324768, 242852, 283813, 234661, 300197, 234664, 275626, 234667, 316596, 308414, 234687, 316610, 300226, 226500, 234692, 300229, 308420, 308422, 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, 300289, 292097, 300292, 300294, 275719, 300299, 177419, 283917, 300301, 242957, 177424, 275725, 349464, 283939, 259367, 283951, 292143, 300344, 283963, 243003, 226628, 283973, 300357, 283983, 316758, 357722, 316766, 292192, 316768, 218464, 292197, 316774, 284010, 136562, 324978, 275834, 333178, 275836, 275840, 316803, 316806, 316811, 316814, 226703, 300433, 234899, 226709, 357783, 316824, 316826, 144796, 300448, 144807, 144810, 284076, 144812, 144814, 144820, 284084, 284087, 292279, 144826, 144828, 144830, 144832, 284099, 144835, 144837, 38342, 144839, 144841, 144844, 144847, 144852, 144855, 103899, 300507, 333280, 226787, 218597, 292329, 300523, 259565, 259567, 300527, 308720, 226802, 292338, 316917, 308727, 292343, 300537, 316947, 308757, 284191, 284194, 284196, 235045, 284199, 284204, 284206, 284209, 284211, 284213, 316983, 284215, 194103, 284218, 226877, 284223, 284226, 243268, 292421, 226886, 284231, 128584, 284228, 284234, 366155, 276043, 317004, 284238, 226895, 284241, 194130, 284243, 276052, 276053, 284245, 284247, 317015, 284249, 243290, 284251, 300628, 284253, 235097, 284255, 300638, 284258, 292452, 292454, 284263, 284265, 292458, 284267, 292461, 284272, 284274, 276086, 284278, 292470, 292473, 284283, 276093, 284286, 276095, 284288, 292481, 276098, 284290, 325250, 284292, 292485, 292479, 325251, 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, 358140, 284413, 358142, 284418, 358146, 317187, 317189, 317191, 284428, 300816, 300819, 317207, 284440, 186139, 300828, 300830, 276255, 325408, 284449, 300834, 300832, 227109, 317221, 358183, 276268, 300845, 194351, 243504, 300850, 284469, 276280, 325436, 358206, 276291, 366406, 276295, 153417, 292681, 276308, 284502, 317271, 276315, 292700, 284511, 227175, 292715, 300912, 284529, 292721, 300915, 292729, 317306, 284540, 292734, 325512, 276365, 284564, 358292, 284566, 350106, 284572, 276386, 284579, 276388, 358312, 284585, 317353, 276395, 292784, 358326, 161718, 276410, 276411, 358330, 276418, 301009, 301011, 301013, 292823, 301015, 301017, 358360, 292828, 276446, 153568, 276448, 276452, 276455, 292839, 292843, 276460, 276464, 178161, 276466, 227314, 276472, 325624, 317435, 276476, 276479, 276482, 276485, 317446, 276490, 292876, 276496, 317456, 317458, 243733, 317468, 243740, 317472, 325666, 243751, 292904, 276528, 243762, 309298, 325685, 325689, 276539, 235579, 235581, 178238, 325692, 276544, 284739, 292934, 276553, 243785, 222676, 350293, 350295, 194649, 227418, 309337, 194654, 227423, 350302, 194657, 227426, 276579, 178273, 194660, 227430, 276583, 309346, 309348, 276586, 309350, 309352, 309354, 276590, 350313, 227440, 350316, 284786, 350321, 276595, 301167, 350325, 350328, 292985, 301178, 292989, 292993, 301185, 350339, 317570, 317573, 350342, 350345, 350349, 301199, 317584, 325777, 350354, 350357, 350359, 350362, 276638, 350366, 284837, 350375, 350379, 350381, 350383, 129200, 350385, 350387, 350389, 350395, 350397, 350399, 227520, 350402, 227522, 301252, 350406, 227529, 309450, 301258, 276685, 276689, 309462, 301272, 309468, 194780, 309471, 301283, 317672, 317674, 325867, 227571, 309491, 309494, 243960, 227583, 276735, 227587, 276739, 276742, 227593, 227596, 325910, 309530, 342298, 276766, 211232, 317729, 276775, 325937, 325943, 211260, 260421, 276809, 285002, 276811, 235853, 235858, 276829, 276833, 391523, 276836, 276843, 293227, 276848, 293232, 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, 317951, 309764, 301575, 121352, 236043, 342541, 113167, 277011, 317971, 309781, 309779, 227877, 227879, 293417, 227882, 309804, 293421, 105007, 236082, 285236, 23094, 277054, 129603, 318020, 301636, 301639, 301643, 277071, 285265, 399955, 309844, 277080, 309849, 285277, 285282, 326244, 318055, 277100, 309871, 277106, 121458, 170619, 309885, 309888, 277122, 285320, 277128, 301706, 318092, 326285, 318094, 334476, 277136, 277139, 227992, 285340, 318108, 227998, 318110, 137889, 383658, 285357, 318128, 277170, 342707, 154292, 277173, 293555, 318132, 277177, 277181, 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, 293677, 318253, 285489, 293685, 285494, 301880, 301884, 310080, 293696, 277317, 277322, 301911, 301913, 277337, 301921, 400236, 236397, 162671, 310134, 277368, 15224, 236408, 416639, 416640, 113538, 416648, 39817, 187274, 277385, 301972, 424853, 277405, 277411, 310179, 293798, 293802, 236460, 277426, 293811, 293820, 203715, 293849, 293861, 228327, 228328, 228330, 318442, 228332, 277486, 326638, 318450, 293876, 293877, 285686, 302073, 285690, 244731, 293882, 121850, 302075, 293887, 277504, 277507, 277511, 277519, 293908, 293917, 293939, 277561, 277564, 310336, 293956, 277573, 228422, 310344, 277577, 293960, 277583, 203857, 310355, 293971, 310359, 236632, 277594, 138332, 277598, 285792, 277601, 203872, 310374, 203879, 310376, 228460, 318573, 203886, 187509, 285815, 285817, 367737, 285821, 302205, 285824, 392326, 285831, 253064, 302218, 285835, 384148, 162964, 187542, 302231, 285849, 302233, 285852, 302237, 285854, 285856, 302241, 277671, 302248, 64682, 277678, 294063, 294065, 302258, 277687, 294072, 318651, 294076, 277695, 318657, 244930, 302275, 130244, 302277, 228550, 302282, 310476, 302285, 302288, 310481, 302290, 203987, 302292, 302294, 302296, 384222, 310498, 285927, 318698, 302315, 195822, 228592, 294132, 138485, 228601, 204026, 228606, 204031, 64768, 310531, 285958, 228617, 138505, 318742, 204067, 277798, 130345, 113964, 285997, 285999, 113969, 318773, 318776, 286010, 417086, 286016, 294211, 302403, 384328, 294221, 326991, 294223, 179547, 146784, 302436, 294246, 327015, 310632, 327017, 351594, 351607, 310648, 310651, 310657, 351619, 294276, 310659, 327046, 253320, 310665, 318858, 310672, 351633, 310689, 130468, 228776, 277932, 310703, 310710, 130486, 310712, 310715, 302526, 228799, 64966, 245191, 163272, 302534, 310727, 292968, 302541, 302543, 310737, 286169, 228825, 163290, 310749, 310755, 187880, 286188, 310764, 310772, 40440, 212472, 40443, 286203, 310780, 228864, 40448, 286214, 228871, 302603, 65038, 302614, 286233, 302617, 302621, 146977, 187939, 40484, 294435, 286246, 40486, 286248, 278057, 40488, 40491, 294439, 294440, 294443, 310831, 294445, 40499, 40502, 212538, 40507, 40511, 228933, 40521, 286283, 40525, 40527, 228944, 212560, 400976, 40533, 147032, 40537, 40539, 278109, 40541, 40550, 286312, 286313, 40554, 40552, 310892, 40557, 294521, 343679, 310925, 286354, 278163, 122517, 278168, 179870, 327333, 229030, 212648, 278188, 278192, 319153, 278196, 302781, 319171, 302789, 294599, 278216, 294601, 302793, 343757, 212690, 278227, 229076, 286420, 319187, 286425, 319194, 278235, 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, 188252, 237409, 294776, 294785, 327554, 40851, 294811, 319390, 294817, 319394, 40865, 311209, 180142, 294831, 188340, 294844, 294847, 393177, 294876, 294879, 294883, 294890, 311279, 278513, 237555, 278516, 311283, 278519, 237562 ]
3aa16c13de533993c07871fcbd4dc069dc5c6aeb
031fd0179f0070a2a08546132d672d118194343e
/TestWork/TestWork/FoursquareTableViewController.swift
308ecb81ade4edb567720337cca758547e462329
[]
no_license
sadgb/TestWork
dcb7adf9f4c5bce3a8ab180d1116e302f50a340b
4bbdb4301972bedc590171db7da98dabc0a4bf46
refs/heads/master
2020-12-24T19:18:15.718677
2015-03-05T14:51:09
2015-03-05T14:51:09
null
0
0
null
null
null
null
UTF-8
Swift
false
false
9,877
swift
// // FoursquareTableViewController.swift // TestWork // // Created by Anton Bednarzh on 27.02.15. // Copyright (c) 2015 Anton Bednarzh. All rights reserved. // import UIKit import CoreLocation import Alamofire import CoreData var jsonArray = Array<String>() var searchArray = Array<String>() var sidebarIsOpen: Bool? var selectedArray = Array(count: jsonArray.count, repeatedValue: false) var isSearching: Bool = false protocol FoursquareTableViewControllerDelegate{ func toggleLeftPanel() func collapseSidePanels() } class FoursquareTableViewController: UITableViewController, CLLocationManagerDelegate, UITableViewDelegate, UITableViewDataSource, UISearchBarDelegate, UISearchControllerDelegate, LeftViewControllerDelegate { @IBOutlet var mainView: UITableView! @IBOutlet weak var searchBar: UISearchBar! var actInd : UIActivityIndicatorView = UIActivityIndicatorView(frame: CGRectMake(0,0, 60, 60)) as UIActivityIndicatorView let locationManager = CLLocationManager() let token = "RCUZDDM4FF2IPQHBHQ51RKJMFMMY1WBM3UVXFGAVN2DICCAA" let versionAPI = 20150227 var coordinate: String = "" var tableData: Array<AnyObject> = [] var delegate: FoursquareTableViewControllerDelegate? // override func viewWillAppear(animated: Bool) { super.viewWillAppear(true) var contentOffset: CGPoint = self.tableView.contentOffset contentOffset.y += CGRectGetHeight(self.tableView.tableHeaderView!.frame) self.tableView.contentOffset = contentOffset; // Search as headerView var AppDel: AppDelegate = (UIApplication.sharedApplication().delegate as! AppDelegate) var context: NSManagedObjectContext = AppDel.managedObjectContext! var request = NSFetchRequest(entityName: "Favorite") request.returnsObjectsAsFaults = false var results: NSArray = context.executeFetchRequest(request, error: nil)! if results.count > 0 { for res in results { if (res.valueForKey("namePlace") != nil){ let a = res.valueForKey("namePlace") as! String? if (find(favoritePlaces, res.valueForKey("namePlace") as! String) == nil){ favoritePlaces.append(res.valueForKey("namePlace") as! String) } } } } else { println("0 Results return") } } override func viewDidLoad() { super.viewDidLoad() sidebarIsOpen = false isSearching = false self.tableView.tableHeaderView = searchBar if CLLocationManager.authorizationStatus() == .NotDetermined { locationManager.requestWhenInUseAuthorization() } busyIndicatorActive() findMyNewLocation() var refreshControl = UIRefreshControl() refreshControl.addTarget(self, action: Selector("findMyNewLocation"), forControlEvents: UIControlEvents.ValueChanged) self.refreshControl = refreshControl self.searchBar.delegate = self self.tableView.delaysContentTouches = false } @IBAction func settings_clicked(sender: AnyObject) { delegate?.toggleLeftPanel() } func findMyNewLocation(){ //println("Обновление местоположения") locationManager.delegate = self locationManager.desiredAccuracy = kCLLocationAccuracyNearestTenMeters locationManager.requestWhenInUseAuthorization() locationManager.startUpdatingLocation() tableView.reloadData() refreshControl?.endRefreshing() } func busyIndicatorActive(){ // let actFrame : CGRect = CGRectMake(0,80,80,80) // var actView : UIView = UIView(frame: actFrame) // actView.center = self.view.center // actView.backgroundColor = UIColor(red: 0.5, green: 0.5, blue: 0.5, alpha: 1.0) // actView.alpha=0.5 // self.view.addSubview(actView) actInd.center = self.view.center actInd.hidesWhenStopped = true actInd.activityIndicatorViewStyle = UIActivityIndicatorViewStyle.WhiteLarge actInd.color = UIColor(red:0.14, green:0.6, blue:0.7, alpha:1.0) view.addSubview(actInd) actInd.startAnimating() } func foursquareRequestWith(coordinates:String, token: String) { UIApplication.sharedApplication().networkActivityIndicatorVisible = true Alamofire.request(.GET, "https://api.foursquare.com/v2/venues/search", parameters: ["ll": coordinate, "oauth_token": token, "v": versionAPI]) .responseJSON { (req, res, json, error) in if(error != nil) { println("Error: \(error)") //println(req) //println(res) } else { UIApplication.sharedApplication().networkActivityIndicatorVisible = false jsonArray.removeAll(keepCapacity: true) //println("Success: (url)") for var i = 0; i < 19 ;i++ { jsonArray.insert((JSON(json!)["response"]["venues"][i]["name"].string)!,atIndex: i) } self.actInd.stopAnimating() self.tableView.reloadData() } } } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } // MARK: - Table view data source override func numberOfSectionsInTableView(tableView: UITableView) -> Int { // #warning Potentially incomplete method implementation. // Return the number of sections. return 1 } override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { if isSearching == true { return searchArray.count } else { return jsonArray.count } } override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let cell:FoursquareTableViewCell! = tableView.dequeueReusableCellWithIdentifier("FoursqareCell", forIndexPath: indexPath) as? FoursquareTableViewCell cell.favouriteButton.frame.origin.x = mainView.frame.size.width - 40 cell.placesNameLabel.frame.size.width = mainView.frame.size.width - 60 if isSearching == true { cell.placesNameLabel?.text = searchArray[indexPath.row] if find(favoritePlaces, searchArray[indexPath.row]) != nil { cell.favouriteButton.selected = true } else { cell.favouriteButton.selected = false } } else { cell.placesNameLabel?.text = jsonArray[indexPath.row] cell.favouriteButton.tag = indexPath.row // if find(favoritePlaces, jsonArray[indexPath.row]) != nil { cell.favouriteButton.selected = true } else { cell.favouriteButton.selected = false } } //println(jsonArray[indexPath.row]) return cell } // Search Controller func searchBar(searchBar: UISearchBar, textDidChange searchText: String){ if searchBar.text.isEmpty{ isSearching = false tableView.reloadData() } else { isSearching = true searchArray.removeAll() for var index = 0; index < jsonArray.count; index++ { var currentString = jsonArray[index] as String if currentString.lowercaseString.rangeOfString(searchText.lowercaseString) != nil { searchArray.append(currentString) } } tableView.reloadData() } } func locationManager(manager: CLLocationManager!, didUpdateLocations locations: [AnyObject]!) { CLGeocoder().reverseGeocodeLocation(manager.location, completionHandler: {(placemarks, error)->Void in if (error != nil) { println("Reverse geocoder failed with error" + error.localizedDescription) return } if placemarks.count > 0 { let pm = placemarks[0] as! CLPlacemark self.displayLocationInfo(pm) } else { println("Problem with the data received from geocoder") } }) } func displayLocationInfo(placemark: CLPlacemark?) { if let containsPlacemark = placemark { locationManager.stopUpdatingLocation() let locality = (containsPlacemark.locality != nil) ? containsPlacemark.locality : "" let postalCode = (containsPlacemark.postalCode != nil) ? containsPlacemark.postalCode : "" let administrativeArea = (containsPlacemark.administrativeArea != nil) ? containsPlacemark.administrativeArea : "" let country = (containsPlacemark.country != nil) ? containsPlacemark.country : "" coordinate = String(format: "%f,%f", containsPlacemark.location.coordinate.latitude, containsPlacemark.location.coordinate.longitude) //println(coordinate) foursquareRequestWith(coordinate,token: token) } } func locationManager(manager: CLLocationManager!, didFailWithError error: NSError!) { println("Error while updating location " + error.localizedDescription) } override func scrollViewWillBeginDragging(scrollView: UIScrollView) { tableView.endEditing(true) } }
[ -1 ]
fe435febcbd71817d9f2078135c9becf9a99c4c4
1c8059dc4ae5f09a6de874867153943cc1a80e7d
/Pods/IBMWatsonNaturalLanguageUnderstandingV1/Source/NaturalLanguageUnderstandingV1/Models/SentimentOptions.swift
a2e49be36de9e496d271479af25748f40375112e
[ "Apache-2.0" ]
permissive
indiamela/WatsonBig5App
f2a6f008140093c96370393021a4187d55931aa9
b17a2f649006320b8f8e19d1fd7440d11d9b0a48
refs/heads/master
2023-02-07T20:53:02.831870
2021-01-01T08:51:22
2021-01-01T08:51:22
325,936,314
0
0
null
null
null
null
UTF-8
Swift
false
false
1,983
swift
/** * (C) Copyright IBM Corp. 2017, 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 Foundation /** Analyzes the general sentiment of your content or the sentiment toward specific target phrases. You can analyze sentiment for detected entities with `entities.sentiment` and for keywords with `keywords.sentiment`. Supported languages: Arabic, English, French, German, Italian, Japanese, Korean, Portuguese, Russian, Spanish. */ public struct SentimentOptions: Codable, Equatable { /** Set this to `false` to hide document-level sentiment results. */ public var document: Bool? /** Sentiment results will be returned for each target string that is found in the document. */ public var targets: [String]? // Map each property name to the key that shall be used for encoding/decoding. private enum CodingKeys: String, CodingKey { case document = "document" case targets = "targets" } /** Initialize a `SentimentOptions` with member variables. - parameter document: Set this to `false` to hide document-level sentiment results. - parameter targets: Sentiment results will be returned for each target string that is found in the document. - returns: An initialized `SentimentOptions`. */ public init( document: Bool? = nil, targets: [String]? = nil ) { self.document = document self.targets = targets } }
[ 308952, 308960 ]
b21a93fb9e23ab138f22f085f33cf256df14c2e6
48a9495cd258d927c6db7e336f53ede1213853ef
/altimeter/ViewController.swift
e5040bb3eb1ba060d4cfb88df4140b8302860c35
[]
no_license
jdpdev/non-qualified-altimeter
fb9c9ba7bcdef7acf9e2c41d5ad1d1a159c272bb
795a21726fd6b52ade99d21358a3ec5a20138a34
refs/heads/master
2020-04-21T06:06:09.596752
2019-04-13T00:41:39
2019-04-13T00:41:39
null
0
0
null
null
null
null
UTF-8
Swift
false
false
5,415
swift
// // ViewController.swift // altimeter // // Created by Jason DuPertuis on 2/5/19. // Copyright © 2019 jdp. All rights reserved. // import Foundation import UIKit class ViewController: UIViewController, UIPickerViewDelegate, UIPickerViewDataSource { @IBOutlet weak var kpaValue: UILabel! @IBOutlet weak var inhgValue: UILabel! @IBOutlet weak var qnhValue: UILabel! @IBOutlet weak var altitudeValue: UILabel! @IBOutlet weak var pressureValues: UIPickerView! let metarService = METARService() let barometerService = BarometerService() var pressureValueList: [Int] = [] var selectedPressureValue = 182; override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. pressureValues.delegate = self pressureValues.dataSource = self var altSetting = 2810 while altSetting <= 3100 { pressureValueList.append(altSetting) altSetting += 1; } pressureValues.selectRow(selectedPressureValue, inComponent: 0, animated: false) do { try barometerService.observeBarometer() { (data: AltitudeData) in self.applyAltitudeData(data: data) } } catch BarometerError.notAvailable { print("Barometer not available") } catch { print("Unable to run barometer") } } func applyAltitudeData(data: AltitudeData) { self.kpaValue.text = String(data.kpa) self.qnhValue.text = inHgToString(inhg: data.qnh) self.inhgValue.text = inHgToString(inhg: data.inHg) if let altitude = data.altitude { self.altitudeValue.text = altitudeToString(altitude: altitude) } else { self.altitudeValue.text = "--" } } @IBAction func submitQNH(_ sender: Any) { let altimeter = barometerService.setQNH(qnh: pressureValueList[selectedPressureValue]) applyAltitudeData(data: altimeter) } @IBAction func submitDebugPressure(_ sender: Any) { let altimeter = barometerService.setIndicatedPressure(inHg: pressureValueList[selectedPressureValue]) applyAltitudeData(data: altimeter) } func setQNH(qnh: Double) { let altimeter = barometerService.setIndicatedPressure(inHg: Int(qnh * 100)) DispatchQueue.main.async() { self.applyAltitudeData(data: altimeter) } } func setQNH(qnh: Int) { let altimeter = barometerService.setIndicatedPressure(inHg: qnh) DispatchQueue.main.async() { self.applyAltitudeData(data: altimeter) } } func convertPressureText(text: String) -> Double { let scale: Int16 = 2 let behavior = NSDecimalNumberHandler(roundingMode: .plain, scale: scale, raiseOnExactness: false, raiseOnOverflow: false, raiseOnUnderflow: false, raiseOnDivideByZero: true) let dn = NSDecimalNumber(string: text).rounding(accordingToBehavior: behavior) return Double(truncating: dn) } func numberOfComponents(in pickerView: UIPickerView) -> Int { return 1 } func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int { return pressureValueList.count } func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? { return inHgToString(inhg: pressureValueList[row]) //String(pressureValueList[row]) } func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) { selectedPressureValue = row; } func inHgToString(inhg: Int) -> String { let fraction = inhg % 100 return "\(inhg / 100).\(fraction >= 10 ? String(fraction) : "0\(fraction)")" } func inHgToString(inhg: Double) -> String { let fraction = Int(inhg * 100) % 100 return "\(inhg / 100).\(fraction >= 10 ? String(fraction) : "0\(fraction)")" } func altitudeToString(altitude: Double) -> String { if (altitude < 0) { return "0"; } let formatter = NumberFormatter() formatter.usesGroupingSeparator = true return formatter.string(for: Int(altitude)) ?? "--" } @IBAction func onMetarSearch(_ sender: Any) { makeMETARRequest() } func makeMETARRequest() { metarService.getNearby() { metars in var closest: METAR? = nil for metar in metars { print("\(metar.value.distance)nm \(metar.value.raw)" ?? "Raw METAR not available") if closest == nil { closest = metar.value } else if (metar.value.distance < closest!.distance) { closest = metar.value } } if closest != nil { self.setQNH(qnh: closest!.qnh) } } } } extension Double { func roundToDecimal(_ fractionDigits: Int) -> Double { let multiplier = pow(10, Double(fractionDigits)) return Darwin.round(self * multiplier) / multiplier } }
[ -1 ]
ec3000765aef39a516f405fcea0c6c21d2e7e2f3
9bb87e5a9d1146ae08eff4d1620c8daa13c63304
/HomeWork1/AppDelegate.swift
a0e6d612475679e07f0db71fc71a5c42438a2223
[]
no_license
AlekseyMalashenkov/AutoLayout
d6f077ac51533c6ba4aa4bfc05ccc859354312b3
03949cdfce127719086d8004adf9bb0224276b6b
refs/heads/master
2021-06-08T21:28:39.140531
2016-11-26T20:35:51
2016-11-26T20:35:51
null
0
0
null
null
null
null
UTF-8
Swift
false
false
2,222
swift
// // AppDelegate.swift // HomeWork1 // // Created by Алексей Малашенков on 26.11.16. // Copyright © 2016 Алексей Малашенков. 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, 294924, 229388, 278542, 327695, 229391, 278545, 229394, 278548, 229397, 229399, 229402, 278556, 229405, 278559, 229408, 294950, 229415, 229417, 327722, 237613, 229422, 360496, 229426, 237618, 229428, 286774, 286776, 319544, 286778, 204856, 229432, 352318, 286791, 237640, 286797, 278605, 311375, 163920, 237646, 196692, 319573, 311383, 319590, 311400, 278635, 303212, 278639, 131192, 278648, 237693, 303230, 327814, 303241, 131209, 303244, 311436, 319633, 286873, 286876, 311460, 311469, 32944, 327862, 286906, 327866, 180413, 286910, 131264, 286916, 286922, 286924, 286926, 319694, 131281, 278743, 278747, 295133, 155872, 319716, 237807, 303345, 286962, 131314, 229622, 327930, 278781, 278783, 278785, 237826, 319751, 278792, 286987, 319757, 311569, 286999, 319770, 287003, 287006, 287009, 287012, 287014, 287016, 287019, 311598, 287023, 262448, 311601, 287032, 155966, 319809, 319810, 278849, 319814, 311623, 319818, 311628, 229709, 319822, 287054, 278865, 229717, 196963, 196969, 139638, 213367, 106872, 319872, 311683, 311693, 65943, 319898, 311719, 278952, 139689, 278957, 311728, 278967, 180668, 311741, 278975, 319938, 98756, 278980, 278983, 319945, 278986, 319947, 278990, 278994, 279003, 279006, 188895, 172512, 287202, 279010, 279015, 172520, 319978, 279020, 172526, 311791, 279023, 172529, 279027, 319989, 172534, 180727, 164343, 311804, 287230, 279040, 303617, 287234, 279045, 172550, 303623, 172552, 320007, 287238, 279051, 172558, 279055, 303632, 279058, 303637, 279063, 279067, 172572, 279072, 172577, 295459, 172581, 295461, 279082, 311850, 279084, 172591, 172598, 279095, 172607, 172609, 172612, 377413, 172614, 172618, 303690, 33357, 287309, 303696, 279124, 172634, 262752, 254563, 172644, 311911, 189034, 295533, 172655, 172656, 352880, 295538, 189039, 172660, 287349, 189044, 287355, 287360, 295553, 172675, 295557, 311942, 303751, 287365, 352905, 311946, 287371, 279178, 311951, 287377, 172691, 287381, 311957, 221850, 287386, 230045, 172702, 287390, 303773, 172705, 287394, 172707, 303780, 164509, 287398, 205479, 287400, 279208, 172714, 295595, 279212, 189102, 172721, 287409, 66227, 303797, 189114, 287419, 303804, 328381, 287423, 328384, 172737, 279231, 287427, 312005, 312006, 172748, 287436, 107212, 172751, 287440, 295633, 172755, 303827, 279255, 172760, 287450, 303835, 279258, 189149, 303838, 213724, 312035, 279267, 295654, 279272, 230128, 312048, 312050, 230131, 189169, 205564, 303871, 230146, 328453, 295685, 230154, 33548, 312077, 295695, 295701, 230169, 369433, 295707, 328476, 295710, 230175, 295720, 303914, 279340, 205613, 279353, 230202, 312124, 328508, 222018, 295755, 377676, 148302, 287569, 303959, 230237, 230241, 279394, 303976, 336744, 303985, 303987, 328563, 279413, 303991, 303997, 295806, 295808, 295813, 304005, 320391, 304007, 304009, 213895, 304011, 230284, 304013, 295822, 189325, 279438, 189329, 295825, 304019, 189331, 58262, 304023, 304027, 279452, 410526, 279461, 304042, 213931, 230327, 304055, 287675, 230334, 304063, 304065, 213954, 295873, 156612, 189378, 213963, 197580, 312272, 304084, 304090, 320481, 304106, 320490, 312302, 328687, 320496, 304114, 295928, 320505, 312321, 295945, 230413, 197645, 295949, 320528, 140312, 295961, 238620, 197663, 304164, 304170, 238641, 312374, 238652, 238655, 230465, 238658, 336964, 132165, 296004, 205895, 320584, 238666, 296021, 402518, 336987, 230497, 296036, 296040, 361576, 205931, 164973, 205934, 279661, 312432, 279669, 337018, 66690, 279683, 222340, 205968, 296084, 238745, 304285, 238756, 205991, 222377, 165035, 337067, 238766, 165038, 230576, 238770, 304311, 230592, 312518, 279750, 230600, 230607, 148690, 320727, 279769, 304348, 279777, 304354, 296163, 320740, 279781, 304360, 320748, 279788, 279790, 304370, 296189, 320771, 312585, 296202, 296205, 230674, 320786, 230677, 296213, 230679, 320792, 230681, 296215, 230689, 173350, 312622, 296243, 312630, 222522, 296253, 230718, 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, 181626, 181631, 312711, 312712, 296331, 288140, 288144, 230800, 304533, 288154, 337306, 288160, 288162, 288164, 279975, 304555, 370092, 279983, 173488, 288176, 312755, 296373, 312759, 337335, 288185, 279991, 222652, 312766, 173507, 296389, 222665, 230860, 312783, 288208, 230865, 288210, 370130, 222676, 288212, 288214, 148946, 239064, 329177, 288218, 280021, 288220, 288217, 239070, 288224, 288226, 370146, 280034, 288229, 280038, 288230, 288232, 320998, 280036, 288234, 288236, 288238, 288240, 288242, 296435, 288244, 288250, 296446, 321022, 402942, 148990, 296450, 206336, 230916, 230919, 214535, 230923, 304651, 304653, 402969, 230940, 222752, 108066, 296486, 296488, 157229, 230961, 157236, 288320, 288325, 124489, 280140, 280145, 288338, 280149, 288344, 280152, 239194, 181854, 403039, 280158, 370272, 239202, 370279, 312938, 280183, 280185, 280188, 280191, 116354, 280194, 280208, 280211, 288408, 280218, 280222, 419489, 190118, 198310, 321195, 296622, 321200, 337585, 296626, 296634, 296637, 419522, 280260, 419525, 206536, 280264, 206539, 206541, 206543, 263888, 313044, 280276, 321239, 280283, 313052, 18140, 288478, 313055, 419555, 321252, 313066, 288494, 280302, 280304, 313073, 321266, 419570, 288499, 288502, 280314, 288510, 124671, 67330, 280324, 198405, 288519, 198416, 280337, 296723, 116503, 321304, 329498, 296731, 321311, 313121, 313123, 304932, 321316, 280363, 141101, 165678, 321336, 296767, 288576, 345921, 337732, 304968, 280393, 280402, 173907, 313171, 313176, 280419, 321381, 296812, 313201, 1920, 255873, 305028, 280454, 247688, 280464, 124817, 280468, 239510, 280473, 124827, 214940, 247709, 214944, 280487, 313258, 321458, 296883, 124853, 214966, 296890, 10170, 288700, 296894, 190403, 296900, 280515, 337862, 165831, 280521, 231379, 296921, 354265, 354270, 239586, 313320, 354281, 231404, 124913, 165876, 321528, 239612, 313340, 288764, 239617, 313347, 288773, 313358, 305176, 313371, 354338, 305191, 223273, 313386, 354348, 124978, 215090, 124980, 288824, 288826, 321595, 313406, 288831, 288836, 67654, 280651, 354382, 288848, 280658, 215123, 354390, 288855, 288859, 280669, 313438, 149599, 280671, 149601, 321634, 149603, 223327, 329830, 280681, 313451, 223341, 280687, 149618, 215154, 313458, 280691, 313464, 329850, 321659, 280702, 288895, 321670, 215175, 141446, 288909, 141455, 141459, 275606, 280725, 313498, 100520, 288936, 280747, 288940, 288947, 321717, 280759, 280764, 280769, 280771, 280774, 313548, 321740, 280783, 280786, 313557, 280793, 280796, 338147, 280804, 280807, 157930, 280811, 280817, 125171, 157940, 182517, 280825, 280827, 280830, 280831, 125187, 280835, 125191, 125207, 125209, 321817, 125218, 321842, 223539, 125239, 305464, 280888, 280891, 289087, 280897, 305480, 239944, 280906, 239947, 305485, 305489, 379218, 280919, 248153, 215387, 354653, 313700, 313705, 280937, 190832, 280946, 223606, 313720, 280956, 239997, 280959, 313731, 199051, 240011, 289166, 240017, 297363, 190868, 240021, 297365, 297368, 297372, 141725, 297377, 289186, 297391, 289201, 240052, 289207, 289210, 305594, 281024, 289218, 289221, 289227, 436684, 281045, 281047, 166378, 305647, 281075, 174580, 240124, 281084, 305662, 305664, 240129, 305666, 305668, 223749, 330244, 240132, 223752, 150025, 338440, 281095, 223757, 281102, 223763, 223765, 281113, 322074, 281116, 281121, 182819, 281127, 150066, 158262, 158266, 289342, 281154, 322115, 158283, 281163, 281179, 338528, 338532, 281190, 199273, 281196, 19053, 158317, 313973, 297594, 281210, 158347, 264845, 182926, 133776, 182929, 314003, 117398, 314007, 289436, 174754, 330404, 289448, 133801, 174764, 314029, 314033, 240309, 133817, 314045, 314047, 314051, 199364, 297671, 158409, 256716, 289493, 363234, 289513, 289522, 289525, 289532, 322303, 289537, 322310, 264969, 322314, 322318, 281372, 322341, 215850, 281388, 289593, 281401, 289601, 281410, 281413, 281414, 240458, 281420, 240468, 281430, 322393, 297818, 281435, 281438, 281442, 174955, 224110, 207733, 207737, 158596, 183172, 338823, 322440, 314249, 240519, 183184, 289687, 240535, 224151, 297883, 289694, 289696, 289700, 289712, 281529, 289724, 52163, 183260, 420829, 281567, 289762, 322534, 297961, 183277, 322550, 134142, 322563, 314372, 330764, 175134, 322599, 322610, 314421, 281654, 314427, 314433, 207937, 314441, 207949, 322642, 314456, 281691, 314461, 281702, 281704, 314474, 281708, 281711, 248995, 306341, 306344, 306347, 322734, 306354, 142531, 199877, 289991, 306377, 289997, 249045, 363742, 363745, 298216, 330988, 126190, 216303, 322801, 388350, 257302, 363802, 199976, 199978, 314671, 298292, 298294, 257334, 216376, 380226, 298306, 224584, 224587, 224594, 216404, 306517, 150870, 314714, 224603, 314718, 265568, 314723, 281960, 150890, 306539, 314732, 314736, 290161, 216436, 306549, 298358, 314743, 306552, 290171, 314747, 306555, 298365, 290174, 224641, 281987, 298372, 314756, 281990, 224647, 265604, 298377, 314763, 142733, 298381, 314768, 224657, 306581, 314773, 314779, 314785, 314793, 282025, 282027, 241068, 241070, 241072, 282034, 241077, 150966, 298424, 306618, 282044, 323015, 306635, 306640, 290263, 290270, 290275, 339431, 282089, 191985, 282098, 290291, 282101, 241142, 191992, 290298, 151036, 290302, 282111, 290305, 175621, 306694, 192008, 323084, 257550, 290321, 282130, 323090, 290325, 282133, 241175, 290328, 282137, 290332, 241181, 282142, 282144, 290344, 306731, 290349, 290351, 290356, 28219, 224849, 282195, 282199, 282201, 306778, 159324, 159330, 314979, 298598, 323176, 224875, 241260, 323181, 257658, 315016, 282249, 290445, 282255, 282261, 175770, 298651, 282269, 323229, 298655, 323231, 61092, 282277, 306856, 282295, 323260, 282300, 323266, 282310, 323273, 282319, 306897, 241362, 306904, 282328, 298714, 52959, 216801, 282337, 241380, 216806, 323304, 282345, 12011, 282356, 323318, 282364, 282367, 306945, 241412, 323333, 282376, 216842, 323345, 282388, 323349, 282392, 184090, 315167, 315169, 282402, 315174, 323367, 241448, 315176, 241450, 282410, 306988, 306991, 315184, 323376, 315190, 241464, 159545, 282425, 298811, 118593, 307009, 413506, 307012, 241475, 298822, 315211, 282446, 307027, 315221, 323414, 315223, 241496, 241498, 307035, 307040, 110433, 241509, 110438, 298860, 110445, 282478, 315249, 282481, 110450, 315251, 315253, 315255, 339838, 315267, 282499, 315269, 241544, 282505, 241546, 241548, 298896, 298898, 282514, 241556, 298901, 44948, 241560, 282520, 241563, 241565, 241567, 241569, 282531, 241574, 282537, 298922, 36779, 241581, 282542, 241583, 323504, 241586, 282547, 241588, 290739, 241590, 241592, 241598, 290751, 241600, 241605, 151495, 241610, 298975, 241632, 298984, 241640, 241643, 298988, 241646, 241649, 241652, 323574, 290807, 299003, 241661, 299006, 282623, 315396, 241669, 315397, 282632, 307211, 282639, 290835, 282645, 241693, 282654, 241701, 102438, 217127, 282669, 323630, 282681, 290877, 282687, 159811, 315463, 315466, 192589, 307278, 192596, 176213, 307287, 307290, 217179, 315482, 192605, 315483, 233567, 299105, 200801, 217188, 299109, 307303, 315495, 356457, 45163, 307307, 315502, 192624, 307314, 323700, 299126, 233591, 299136, 307329, 307338, 233613, 241813, 307352, 299164, 241821, 299167, 315552, 315557, 184486, 307370, 307372, 184492, 307374, 307376, 299185, 323763, 184503, 176311, 307385, 307386, 258235, 307388, 176316, 307390, 299200, 184512, 307394, 299204, 307396, 184518, 307399, 323784, 233679, 307409, 307411, 176343, 299225, 233701, 307432, 184572, 184579, 282893, 291089, 282906, 291104, 233766, 176435, 307508, 315701, 332086, 307510, 307512, 168245, 307515, 307518, 282942, 323917, 282957, 110926, 233808, 323921, 315733, 323926, 233815, 315739, 323932, 299357, 242018, 242024, 299373, 315757, 250231, 242043, 315771, 299388, 299391, 291202, 299398, 242057, 291212, 299405, 291222, 315801, 291226, 242075, 283033, 61855, 291231, 283042, 291238, 291241, 127403, 127405, 291247, 299440, 127407, 299444, 127413, 291254, 283062, 127417, 291260, 127421, 127424, 299457, 127429, 127434, 315856, 315860, 176597, 283095, 127447, 299481, 176605, 242143, 291299, 340454, 127463, 242152, 291305, 127466, 176620, 127474, 291314, 291317, 127480, 135672, 291323, 233979, 127485, 291330, 127490, 283142, 127497, 233994, 135689, 127500, 291341, 233998, 127506, 234003, 127509, 234006, 127511, 152087, 242202, 234010, 135707, 135710, 242206, 242208, 291361, 242220, 291378, 152118, 234038, 234041, 315961, 70213, 242250, 111193, 242275, 299620, 242279, 168562, 184952, 135805, 135808, 291456, 373383, 299655, 135820, 316051, 225941, 316054, 299672, 135834, 373404, 299677, 225948, 135839, 299680, 225954, 299684, 135844, 242343, 242345, 373421, 135870, 135873, 135876, 135879, 299720, 299723, 299726, 225998, 226002, 119509, 226005, 226008, 299740, 242396, 201444, 299750, 283368, 234219, 283372, 185074, 226037, 283382, 316151, 234231, 234236, 226045, 242431, 209665, 234242, 299778, 242436, 234246, 226056, 291593, 234248, 242443, 234252, 242445, 234254, 291601, 234258, 242450, 242452, 234261, 201496, 234264, 234266, 234269, 234272, 234274, 152355, 299814, 234278, 283432, 234281, 234284, 234287, 283440, 185138, 242483, 234292, 234296, 234298, 160572, 283452, 234302, 234307, 242499, 234309, 316233, 234313, 316235, 234316, 283468, 234319, 242511, 234321, 234324, 185173, 201557, 234329, 234333, 308063, 234336, 242530, 349027, 234338, 234341, 234344, 234347, 177004, 234350, 324464, 234353, 152435, 177011, 234356, 234358, 234362, 234364, 291711, 234368, 291714, 234370, 291716, 234373, 316294, 234375, 226182, 308105, 226185, 234379, 234384, 234388, 234390, 226200, 234393, 209818, 308123, 234396, 324508, 291742, 324504, 234398, 234401, 291748, 234405, 291750, 324518, 324520, 234407, 324522, 234410, 291756, 291754, 226220, 324527, 291760, 234417, 201650, 324531, 234414, 234422, 226230, 324536, 275384, 234428, 291773, 242623, 324544, 234431, 234434, 324546, 324548, 234437, 226239, 226245, 234439, 234443, 291788, 234446, 193486, 193488, 234449, 316370, 275406, 234452, 234455, 234459, 234461, 234464, 234467, 234470, 168935, 5096, 324585, 234475, 234478, 316400, 234481, 316403, 234484, 234485, 234487, 324599, 234490, 234493, 316416, 234496, 308226, 234501, 308231, 234504, 234507, 234510, 234515, 300054, 316439, 234520, 234519, 234523, 234526, 234528, 300066, 234532, 300069, 234535, 234537, 234540, 234543, 234546, 275508, 300085, 234549, 300088, 234553, 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, 324757, 234647, 226453, 275608, 234650, 308379, 234648, 300189, 324766, 119967, 234653, 324768, 234657, 283805, 242852, 300197, 234661, 177318, 234664, 275626, 234667, 316596, 308414, 234687, 300223, 300226, 308418, 234692, 300229, 308420, 308422, 283844, 300234, 283850, 300238, 300241, 316625, 300243, 300245, 316630, 300248, 300253, 300256, 300258, 300260, 234726, 300263, 300265, 300267, 161003, 300270, 300272, 120053, 300278, 275703, 316663, 300284, 275710, 300287, 292097, 300289, 161027, 300292, 300294, 275719, 234760, 177419, 300299, 242957, 300301, 349451, 177424, 275725, 283917, 349464, 415009, 283939, 259367, 292143, 283951, 300344, 226617, 243003, 283963, 226628, 300357, 283973, 177482, 283983, 316758, 357722, 316766, 316768, 292192, 218464, 292197, 316774, 243046, 218473, 284010, 136562, 324978, 333178, 275834, 275836, 275840, 316803, 316806, 226696, 316811, 226699, 316814, 226703, 300433, 234899, 300436, 357783, 316824, 316826, 300448, 144807, 144810, 144812, 144814, 227426, 144820, 374196, 284084, 292279, 284087, 144826, 144828, 144830, 144832, 227430, 144835, 144837, 38342, 144839, 144841, 144844, 144847, 144852, 144855, 103899, 300507, 333280, 218597, 292329, 300523, 259565, 300527, 308720, 259567, 292338, 316917, 292343, 308727, 300537, 316933, 316947, 308757, 308762, 316959, 284194, 284196, 235045, 284199, 284204, 284206, 284209, 284211, 194101, 284213, 316983, 194103, 284215, 308790, 284218, 226877, 284223, 284226, 284228, 243268, 292421, 284231, 226886, 284234, 366155, 317004, 276043, 284238, 226895, 284241, 194130, 284243, 300628, 284245, 292433, 284247, 317015, 235097, 243290, 284249, 276053, 284253, 300638, 243293, 284255, 284258, 292452, 292454, 284263, 177766, 292458, 284267, 292461, 284272, 284274, 284278, 292470, 276086, 292473, 284283, 276093, 284286, 276095, 284288, 292479, 284290, 325250, 284292, 292485, 292481, 276098, 284297, 317066, 284299, 317068, 284301, 276109, 284303, 284306, 276114, 284308, 284312, 284314, 284316, 276127, 284320, 284322, 284327, 284329, 317098, 284331, 276137, 284333, 284335, 284337, 284339, 300726, 284343, 284346, 284350, 358080, 276160, 284354, 358083, 284358, 358089, 284362, 276170, 284365, 276175, 284368, 276177, 284370, 358098, 284372, 317138, 284377, 284379, 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, 300832, 325408, 300834, 317221, 227109, 358183, 186151, 276268, 300845, 243504, 300850, 284469, 276280, 325436, 358206, 276291, 366406, 276295, 300872, 292681, 153417, 358224, 284499, 276308, 284502, 317271, 178006, 276315, 292700, 317279, 284511, 227175, 292715, 300912, 292721, 284529, 300915, 284533, 292729, 317306, 284540, 292734, 325512, 169868, 276365, 317332, 358292, 284564, 399252, 284566, 350106, 284572, 276386, 284579, 276388, 358312, 317353, 292776, 276395, 284585, 292784, 276402, 358326, 161718, 358330, 276411, 276425, 301009, 301011, 301013, 292823, 358360, 301017, 301015, 292828, 276446, 153568, 276452, 292839, 276455, 350186, 292843, 276460, 178161, 227314, 325624, 350200, 276472, 317435, 276479, 350210, 276482, 178181, 317446, 276485, 350218, 276490, 292876, 350222, 317456, 276496, 317458, 178195, 243733, 243740, 317468, 317472, 325666, 243751, 292904, 178224, 276528, 243762, 309298, 325685, 325689, 235579, 325692, 235581, 178238, 276539, 243779, 325700, 284739, 292934, 243785, 276553, 350293, 350295, 309337, 227418, 350299, 350302, 194654, 350304, 178273, 309346, 227423, 194660, 350308, 309350, 309348, 292968, 309352, 309354, 301163, 350313, 350316, 276583, 301167, 276586, 350321, 227440, 284786, 276595, 350325, 252022, 350328, 292985, 301178, 292989, 301185, 292993, 350339, 317570, 317573, 350342, 350345, 350349, 301199, 317584, 325777, 350354, 350357, 350359, 350362, 350366, 276638, 153765, 284837, 350375, 350379, 350381, 350383, 350385, 350387, 350389, 350395, 350397, 350399, 227520, 350402, 227522, 301252, 350406, 227529, 301258, 309450, 276685, 309455, 276689, 309462, 301272, 276699, 194780, 309468, 309471, 301283, 317672, 317674, 325867, 243948, 194801, 309494, 243960, 227583, 276735, 276739, 211204, 276742, 227596, 325910, 309530, 342298, 211232, 317729, 276775, 211241, 325937, 325943, 211260, 260421, 285002, 276811, 235853, 276816, 235858, 276829, 276833, 391523, 276836, 293227, 276843, 293232, 276848, 186744, 211324, 227709, 285061, 366983, 317833, 178572, 285070, 285077, 178583, 227738, 317853, 276896, 317858, 342434, 285093, 317864, 285098, 276907, 235955, 276917, 293304, 293307, 293314, 309707, 293325, 129486, 317910, 293336, 235996, 317917, 293343, 358880, 276961, 293346, 276964, 293352, 236013, 293364, 301562, 293370, 317951, 309764, 301575, 121352, 293387, 236043, 342541, 317963, 113167, 55822, 309779, 317971, 309781, 55837, 227879, 293417, 227882, 309804, 293421, 105007, 236082, 285236, 23094, 277054, 244288, 219714, 129603, 301636, 318020, 301639, 301643, 285265, 309844, 277080, 309849, 285277, 285282, 326244, 318055, 277100, 309871, 121458, 277106, 170618, 170619, 309885, 309888, 277122, 227975, 277128, 285320, 301706, 318092, 326285, 334476, 318094, 277136, 277139, 227992, 318108, 285340, 318110, 227998, 137889, 383658, 285357, 318128, 277170, 293555, 318132, 342707, 154292, 277173, 285368, 277177, 277181, 318144, 277187, 277191, 277194, 277196, 277201, 342745, 137946, 342747, 342749, 113378, 203491, 228069, 277223, 342760, 56041, 285417, 56043, 56045, 277232, 228081, 56059, 310015, 310020, 310029, 228113, 285459, 277273, 293659, 326430, 228128, 285474, 293666, 228135, 318248, 277291, 318253, 293677, 285489, 301876, 293685, 285494, 301880, 285499, 301884, 293696, 310080, 277317, 277329, 162643, 310100, 301911, 277337, 301921, 400236, 236397, 162671, 326514, 310134, 236408, 15224, 277368, 416639, 416640, 113538, 310147, 416648, 39817, 187274, 277385, 301972, 424853, 277405, 277411, 310179, 293798, 293802, 236460, 277426, 293811, 276579, 293817, 293820, 203715, 326603, 342994, 293849, 293861, 228327, 228328, 318442, 228332, 326638, 277486, 351217, 318450, 293876, 293877, 285686, 302073, 121850, 293882, 302075, 285690, 293887, 277504, 277507, 277511, 293899, 277519, 293908, 293917, 293939, 318516, 277561, 277564, 310336, 7232, 293956, 277573, 228422, 293960, 310344, 277577, 277583, 203857, 293971, 310355, 310359, 236632, 277594, 138332, 277598, 203872, 285792, 277601, 310374, 203879, 310376, 228460, 318573, 203886, 187509, 285815, 367737, 285817, 302205, 285821, 392326, 294026, 302218, 285835, 162964, 384148, 187542, 302231, 285849, 302233, 285852, 302237, 285854, 285856, 302241, 285862, 277671, 302248, 64682, 277678, 294063, 294065, 302258, 277687, 294072, 318651, 294076, 277695, 318657, 244930, 302275, 130244, 302277, 228550, 302282, 310476, 302285, 302288, 310481, 302290, 203987, 302292, 302294, 310486, 302296, 384222, 310498, 285927, 318698, 302315, 228592, 294132, 138485, 204026, 228606, 204031, 64768, 310531, 138505, 228617, 318742, 204067, 277798, 130345, 277801, 277804, 285997, 384302, 285999, 277807, 113969, 277811, 318773, 318776, 277816, 286010, 277819, 294204, 417086, 277822, 302403, 294211, 384328, 277832, 277836, 294221, 146765, 294223, 326991, 277839, 277842, 277847, 277850, 179547, 277853, 277857, 302436, 277860, 294246, 327015, 310632, 327017, 351594, 277864, 277869, 277872, 351607, 310648, 277880, 310651, 277884, 277888, 310657, 351619, 294276, 310659, 327046, 277892, 253320, 310665, 318858, 277894, 277898, 277903, 310672, 351633, 277905, 277908, 277917, 310689, 277921, 130468, 277928, 277932, 310703, 277937, 310710, 130486, 310712, 277944, 310715, 277947, 302526, 228799, 277950, 277953, 302534, 310727, 245191, 64966, 277959, 277963, 302541, 277966, 302543, 310737, 277971, 228825, 277978, 310749, 277981, 277984, 310755, 277989, 277991, 187880, 277995, 310764, 286188, 278000, 228851, 310772, 278003, 278006, 40440, 212472, 278009, 40443, 286203, 310780, 40448, 228864, 286214, 302603, 302614, 302617, 286233, 302621, 286240, 146977, 187936, 187939, 40484, 294435, 40486, 286246, 294440, 40488, 294439, 294443, 40491, 294445, 245288, 310831, 286248, 40499, 40502, 212538, 40507, 40511, 40513, 228933, 40521, 286283, 40525, 40527, 212560, 400976, 228944, 40533, 40537, 40539, 40541, 278109, 40544, 40548, 40550, 40552, 286312, 40554, 286313, 310892, 40557, 40560, 188022, 122488, 294521, 343679, 294537, 310925, 286354, 278163, 302740, 122517, 278168, 179870, 327333, 229030, 212648, 302764, 278188, 319153, 278196, 302781, 319171, 302789, 294599, 278216, 294601, 302793, 343757, 212690, 319187, 286420, 229076, 286425, 319194, 278235, 278238, 229086, 286432, 294625, 294634, 302838, 319226, 286460, 278274, 302852, 278277, 302854, 294664, 311048, 352008, 319243, 311053, 302862, 319251, 294682, 278306, 188199, 294701, 319280, 278320, 319290, 229192, 302925, 188247, 188252, 237409, 294776, 360317, 294785, 327554, 360322, 40840, 40851, 294803, 188312, 294811, 237470, 319390, 40865, 319394, 294817, 294821, 311209, 180142, 343983, 188340, 40886, 319419, 294844, 294847, 237508, 393177, 294876, 294879, 294883, 393190, 294890, 311279, 278513, 237555, 311283, 278516, 278519, 237562 ]
a4acd1a5cd13cc50011ca6a1a8516102d9258555
852c819161c8aaafa0e413527384ef187f608c81
/Sources/TableRowBuilder.swift
23158c20cf0329cf04caeef8c04ab227ecea5a98
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
Florelit/TableKit
520bd51d2f4c9d9327b155e2e99880d5b09e0191
e23892e33ecd30e92370f4e9d3e89b8069917d8f
refs/heads/master
2020-12-28T22:00:48.979096
2016-07-15T22:54:19
2016-07-15T22:54:19
63,864,737
0
0
null
2016-07-21T11:44:08
2016-07-21T11:44:08
null
UTF-8
Swift
false
false
2,088
swift
// // Copyright (c) 2015 Max Sokolov https://twitter.com/max_sokolov // // Permission is hereby granted, free of charge, to any person obtaining a copy of // this software and associated documentation files (the "Software"), to deal in // the Software without restriction, including without limitation the rights to // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of // the Software, and to permit persons to whom the Software is furnished to do so, // subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. import UIKit public protocol RowBuilder { func rows() -> [Row]? } public class TableRowBuilder<ItemType, CellType: ConfigurableCell where CellType.T == ItemType, CellType: UITableViewCell>: RowBuilder { public var items: [ItemType]? public var actions: [TableRowAction<ItemType, CellType>]? public init(handler: (TableRowBuilder) -> ()) { handler(self) } public init(items: [ItemType], actions: [TableRowAction<ItemType, CellType>]? = nil) { self.items = items self.actions = actions } // MARK: - RowBuilder - public func rows() -> [Row]? { return items?.map { TableRow<ItemType, CellType>(item: $0, actions: actions) } } } public extension TableSection { public func append(builder builder: RowBuilder) { if let rows = builder.rows() { append(rows: rows) } } }
[ -1 ]
c2100c27d58d8aa643a2cd4499f854b8b5670c73
5dcc39c0d35b77fefc355aa32582e6e5794cd27a
/Parstagram/FeedViewController.swift
a2c1f7994a8ecb09e719ff379e054f5c2a3e0048
[]
no_license
ccunnin8/parstegram
69d29ad0275d9bd7649677c49ffbf42925cb955f
be62c560a18bb1ce6370febc61248c738fc99290
refs/heads/master
2023-03-27T13:43:46.097014
2021-03-23T18:10:21
2021-03-23T18:10:21
349,501,175
0
0
null
null
null
null
UTF-8
Swift
false
false
5,556
swift
// // FeedViewController.swift // Parstagram // // Created by Corey Cunningham MacbookAir on 3/17/21. // Copyright © 2021 Corey Cunningham MacbookAir. All rights reserved. // import UIKit import Parse import MessageInputBar class FeedViewController: UIViewController, UITableViewDataSource, UITableViewDelegate, MessageInputBarDelegate{ let commentBar = MessageInputBar() var showsCommentBar = false var selectedPost: PFObject! @IBAction func onLogout(_ sender: Any) { PFUser.logOut() let main = UIStoryboard(name: "Main", bundle: nil) let loginController = main.instantiateViewController(identifier: "loginController") let delegate = self.view.window?.windowScene?.delegate as! SceneDelegate delegate.window?.rootViewController = loginController } override var inputAccessoryView: UIView? { return commentBar } override var canBecomeFirstResponder: Bool { return showsCommentBar } var posts = [PFObject]() func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { let post = posts[section] let comments = (post["Comments"] as? [PFObject]) ?? [] return 2 + comments.count } func numberOfSections(in tableView: UITableView) -> Int { return posts.count } func messageInputBar(_ inputBar: MessageInputBar, didPressSendButtonWith text: String) { // create the comment let comment = PFObject(className: "Comments") comment["text"] = text comment["post"] = selectedPost comment["author"] = PFUser.current()! selectedPost.add(comment, forKey: "Comments") selectedPost.saveInBackground { (success, error) in if success { print("comment saved!") } else { print("Error saving comment!") } } tableView.reloadData() // clear and dismiss commentBar.inputTextView.text = nil showsCommentBar = false becomeFirstResponder() commentBar.inputTextView.resignFirstResponder() } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let post = posts[indexPath.section] let comments = (post["Comments"] as? [PFObject]) ?? [] if indexPath.row == 0 { let cell = tableView.dequeueReusableCell(withIdentifier: "postCell") as! PostCell let user = post["author"] as! PFUser let username = user.username cell.postAuthor.text = username cell.postComment.text = post["comment"] as? String let imageFile = post["image"] as! PFFileObject let urlString = imageFile.url! let url = URL(string: urlString)! cell.postImage.af_setImage(withURL: url) return cell } else if indexPath.row <= comments.count { let cell = tableView.dequeueReusableCell(withIdentifier: "commentCell") as! CommentCell let comment = comments[indexPath.row - 1] cell.commentLabel.text = comment["text"] as! String let user = PFUser.current()!.username cell.nameLabel.text = user return cell } else { let cell = tableView.dequeueReusableCell(withIdentifier: "AddCommentCell")! return cell } } func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { let post = posts[indexPath.section] let comments = (post["Comments"] as? [PFObject]) ?? [] if indexPath.row == comments.count + 1 { showsCommentBar = true becomeFirstResponder() commentBar.inputTextView.becomeFirstResponder() selectedPost = post } } @IBOutlet weak var tableView: UITableView! override func viewDidLoad() { super.viewDidLoad() commentBar.inputTextView.placeholder = "Add a comment..." commentBar.sendButton.title = "Post" commentBar.delegate = self tableView.delegate = self tableView.dataSource = self // Do any additional setup after loading the view. tableView.keyboardDismissMode = .interactive let center = NotificationCenter.default center.addObserver(self, selector: #selector(keyboardWillBeHidden(note:)), name: UIResponder.keyboardWillHideNotification, object: nil) } @objc func keyboardWillBeHidden(note: Notification) { commentBar.inputTextView.text = nil showsCommentBar = false becomeFirstResponder() } override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) let query = PFQuery(className: "Posts") query.includeKeys(["author", "Comments", "Comments.author"]) query.limit = 20 query.findObjectsInBackground { (posts, err) in if posts != nil { self.posts = posts! self.tableView.reloadData() } } } /* // 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. } */ }
[ 403074 ]
72d6f54beea30e68c8a572248f2baefac18c637e
fd32a09aff494280773074c3fd99bf0e1dee0b8c
/SwiftUIDemo/Views/Category/CategoryHome.swift
9693971d3727ee11422ef5bcb2b8ce6fc1becd21
[ "MIT" ]
permissive
Quincy-QC/SwiftUIDemo
2ca28a459d5e57f1dfdf82211226c308be34db55
e1076a029f7eba55d7dadb8346390c15105a5167
refs/heads/master
2020-11-26T22:25:42.742077
2020-01-16T08:37:33
2020-01-16T08:37:33
229,217,680
0
0
null
null
null
null
UTF-8
Swift
false
false
2,289
swift
// // CategoryHome.swift // SwiftUIDemo // // Created by Quincy-QC on 2020/1/7. // Copyright © 2020 Quincy-QC. All rights reserved. // import SwiftUI struct CategoryHome: View { var categories: [String: [Landmark]] { Dictionary( grouping: landmarkData, by: { $0.category.rawValue } ) } var featured: [Landmark] { landmarkData.filter { $0.isFeatured } } @State var showingProfile = false @EnvironmentObject var userData: UserData var profileButton: some View { Button(action: { self.showingProfile.toggle() }) { Image(systemName: "person.crop.circle") .imageScale(.large) .accessibility(label: Text("User Profile")) .padding() } } var body: some View { NavigationView { List { NavigationLink( destination: PageView( featured.map { FeatureCard(landmark: $0) }) .aspectRatio(3/2, contentMode: .fit)) { FeaturedLandmarks(landmarks: self.featured) .scaledToFill() .frame(height: 200) .clipped() .listRowInsets(EdgeInsets()) } ForEach(self.categories.keys.sorted(), id: \.self) { key in CategoryRow(categoryName: key, items: self.categories[key]!) } .listRowInsets(EdgeInsets()) NavigationLink(destination: LandmarkList()) { Text("See All") } } .navigationBarTitle(Text("Featured")) .navigationBarItems(trailing: profileButton) .sheet(isPresented: $showingProfile) { ProfileHost() .environmentObject(self.userData) } } } } struct FeaturedLandmarks: View { var landmarks: [Landmark] var body: some View { landmarkData[0].image.resizable() } } struct CategoryHome_Previews: PreviewProvider { static var previews: some View { CategoryHome() .environmentObject(UserData()) } }
[ -1 ]
48ad305efc11eccd93f2930bffb2dd27a05902ea
65524ca01493a9e2094ec4ee027d1e29a898caec
/Source/InputMask/InputMaskTests/Classes/Mask/SillyEllipticalCase.swift
757c311b9f92621a23dabdba6fdd68d646514fef
[ "MIT" ]
permissive
kubilaykiymaci/input-mask-ios
c18be81b70a0d3b39ad6ded19937279732500790
e4516bbb7c71498a4e6eb468af0cd4925a3924d0
refs/heads/master
2020-08-13T16:06:22.114330
2019-09-24T20:17:17
2019-09-24T20:17:17
214,997,944
1
0
MIT
2019-10-14T09:09:29
2019-10-14T09:09:28
null
UTF-8
Swift
false
false
9,580
swift
// // Project «InputMask» // Created by Jeorge Taflanidi // import XCTest @testable import InputMask class SillyEllipticalCase: MaskTestCase { override func format() -> String { return "[0…][AAA]" } func testInit_correctFormat_maskInitialized() { XCTAssertNotNil(try self.mask()) } func testInit_correctFormat_measureTime() { self.measure { var masks: [Mask] = [] for _ in 1...1000 { masks.append( try! self.mask() ) } } } func testGetOrCreate_correctFormat_measureTime() { self.measure { var masks: [Mask] = [] for _ in 1...1000 { masks.append( try! Mask.getOrCreate(withFormat: self.format()) ) } } } func testGetPlaceholder_allSet_returnsCorrectPlaceholder() { let placeholder: String = try! self.mask().placeholder XCTAssertEqual(placeholder, "0") } func testAcceptableTextLength_allSet_returnsCorrectCount() { let acceptableTextLength: Int = try! self.mask().acceptableTextLength XCTAssertEqual(acceptableTextLength, 2) } func testTotalTextLength_allSet_returnsCorrectCount() { let totalTextLength: Int = try! self.mask().totalTextLength XCTAssertEqual(totalTextLength, 2) } func testAcceptableValueLength_allSet_returnsCorrectCount() { let acceptableValueLength: Int = try! self.mask().acceptableValueLength XCTAssertEqual(acceptableValueLength, 2) } func testTotalValueLength_allSet_returnsCorrectCount() { let totalValueLength: Int = try! self.mask().totalValueLength XCTAssertEqual(totalValueLength, 2) } func testApply_J_returns_emptyString() { let inputString: String = "J" let inputCaret: String.Index = inputString.endIndex let expectedString: String = "" let expectedCaret: String.Index = expectedString.endIndex let expectedValue: String = expectedString let result: Mask.Result = try! self.mask().apply( toText: CaretString( string: inputString, caretPosition: inputCaret, caretGravity: .forward ) ) XCTAssertEqual(expectedString, result.formattedText.string) XCTAssertEqual(expectedCaret, result.formattedText.caretPosition) XCTAssertEqual(expectedValue, result.extractedValue) XCTAssertEqual(false, result.complete) } func testApply_Je_returns_emptyString() { let inputString: String = "Je" let inputCaret: String.Index = inputString.endIndex let expectedString: String = "" let expectedCaret: String.Index = expectedString.endIndex let expectedValue: String = expectedString let result: Mask.Result = try! self.mask().apply( toText: CaretString( string: inputString, caretPosition: inputCaret, caretGravity: .forward ) ) XCTAssertEqual(expectedString, result.formattedText.string) XCTAssertEqual(expectedCaret, result.formattedText.caretPosition) XCTAssertEqual(expectedValue, result.extractedValue) XCTAssertEqual(false, result.complete) } func testApply_Jeo_returns_emptyString() { let inputString: String = "Jeo" let inputCaret: String.Index = inputString.endIndex let expectedString: String = "" let expectedCaret: String.Index = expectedString.endIndex let expectedValue: String = expectedString let result: Mask.Result = try! self.mask().apply( toText: CaretString( string: inputString, caretPosition: inputCaret, caretGravity: .forward ) ) XCTAssertEqual(expectedString, result.formattedText.string) XCTAssertEqual(expectedCaret, result.formattedText.caretPosition) XCTAssertEqual(expectedValue, result.extractedValue) XCTAssertEqual(false, result.complete) } func testApply_1_returns_1() { let inputString: String = "1" let inputCaret: String.Index = inputString.endIndex let expectedString: String = "1" let expectedCaret: String.Index = expectedString.endIndex let expectedValue: String = expectedString let result: Mask.Result = try! self.mask().apply( toText: CaretString( string: inputString, caretPosition: inputCaret, caretGravity: .forward ) ) XCTAssertEqual(expectedString, result.formattedText.string) XCTAssertEqual(expectedCaret, result.formattedText.caretPosition) XCTAssertEqual(expectedValue, result.extractedValue) XCTAssertEqual(true, result.complete) } func testApply_12_returns_12() { let inputString: String = "12" let inputCaret: String.Index = inputString.endIndex let expectedString: String = "12" let expectedCaret: String.Index = expectedString.endIndex let expectedValue: String = expectedString let result: Mask.Result = try! self.mask().apply( toText: CaretString( string: inputString, caretPosition: inputCaret, caretGravity: .forward ) ) XCTAssertEqual(expectedString, result.formattedText.string) XCTAssertEqual(expectedCaret, result.formattedText.caretPosition) XCTAssertEqual(expectedValue, result.extractedValue) XCTAssertEqual(true, result.complete) } func testApply_123_returns_123() { let inputString: String = "123" let inputCaret: String.Index = inputString.endIndex let expectedString: String = "123" let expectedCaret: String.Index = expectedString.endIndex let expectedValue: String = expectedString let result: Mask.Result = try! self.mask().apply( toText: CaretString( string: inputString, caretPosition: inputCaret, caretGravity: .forward ) ) XCTAssertEqual(expectedString, result.formattedText.string) XCTAssertEqual(expectedCaret, result.formattedText.caretPosition) XCTAssertEqual(expectedValue, result.extractedValue) XCTAssertEqual(true, result.complete) } func testApply_1Jeorge2_returns_12() { let inputString: String = "1Jeorge2" let inputCaret: String.Index = inputString.endIndex let expectedString: String = "12" let expectedCaret: String.Index = expectedString.endIndex let expectedValue: String = expectedString let result: Mask.Result = try! self.mask().apply( toText: CaretString( string: inputString, caretPosition: inputCaret, caretGravity: .forward ) ) XCTAssertEqual(expectedString, result.formattedText.string) XCTAssertEqual(expectedCaret, result.formattedText.caretPosition) XCTAssertEqual(expectedValue, result.extractedValue) XCTAssertEqual(true, result.complete) } func testApply_1Jeorge23_returns_123() { let inputString: String = "1Jeorge23" let inputCaret: String.Index = inputString.endIndex let expectedString: String = "123" let expectedCaret: String.Index = expectedString.endIndex let expectedValue: String = expectedString let result: Mask.Result = try! self.mask().apply( toText: CaretString( string: inputString, caretPosition: inputCaret, caretGravity: .forward ) ) XCTAssertEqual(expectedString, result.formattedText.string) XCTAssertEqual(expectedCaret, result.formattedText.caretPosition) XCTAssertEqual(expectedValue, result.extractedValue) XCTAssertEqual(true, result.complete) } func testApply_1234Jeorge56_returns_123456() { let inputString: String = "1234Jeorge56" let inputCaret: String.Index = inputString.endIndex let expectedString: String = "123456" let expectedCaret: String.Index = expectedString.endIndex let expectedValue: String = expectedString let result: Mask.Result = try! self.mask().apply( toText: CaretString( string: inputString, caretPosition: inputCaret, caretGravity: .forward ) ) XCTAssertEqual(expectedString, result.formattedText.string) XCTAssertEqual(expectedCaret, result.formattedText.caretPosition) XCTAssertEqual(expectedValue, result.extractedValue) XCTAssertEqual(true, result.complete) } }
[ -1 ]
5651b57aea376cc8165b4aa56ec5c4817721387f
7b5fba0950b7d6db86b402a3dc6b335d7a9e4686
/funcMajorApp/ViewController.swift
c4337d98f9fefc12085c516391919cd87a4e2581
[]
no_license
BryanPatato/funcMajorApp
e67d8a17d8dddba26f2ecad5459bac6383d9f931
3c45452ab465fb40d1a26314c7e3747c44c0b513
refs/heads/main
2023-07-18T03:57:54.085673
2021-09-10T18:50:33
2021-09-10T18:50:33
405,181,266
0
0
null
null
null
null
UTF-8
Swift
false
false
362
swift
// // ViewController.swift // funcMajorApp // // Created by BRYAN RUIZ on 9/10/21. // import UIKit class ViewController: UIViewController { @IBOutlet weak var textField: UITextField! var haha = "hehehehehehehe" override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. } }
[ -1 ]
f68582a42d69f917c9bf8e13e1a57b73937c5de0
b1a84f5b4c5eeb62c0e288bb0d17ed98fb37f717
/Concentration/Concentration/SceneDelegate.swift
6454fdd89677dcf5e3cf23f236f012ab0c98572a
[]
no_license
MoSourang/Stanford_CS193P
b060926f4e2583c2a7b63d8687bc7c22eb1da967
517febad94202b88c7dc7afbbd62ec555ce90a91
refs/heads/main
2023-05-02T07:18:52.497848
2021-04-24T23:42:02
2021-04-24T23:42:02
301,291,090
0
0
null
null
null
null
UTF-8
Swift
false
false
2,361
swift
// // SceneDelegate.swift // Concentration // // Created by Mouhamed Sourang on 10/1/20. // Copyright © 2020 Mouhamed Sourang. All rights reserved. // import UIKit class SceneDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow? func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). guard let _ = (scene as? UIWindowScene) else { return } } func sceneDidDisconnect(_ scene: UIScene) { // Called as the scene is being released by the system. // This occurs shortly after the scene enters the background, or when its session is discarded. // Release any resources associated with this scene that can be re-created the next time the scene connects. // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). } func sceneDidBecomeActive(_ scene: UIScene) { // Called when the scene has moved from an inactive state to an active state. // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. } func sceneWillResignActive(_ scene: UIScene) { // Called when the scene will move from an active state to an inactive state. // This may occur due to temporary interruptions (ex. an incoming phone call). } func sceneWillEnterForeground(_ scene: UIScene) { // Called as the scene transitions from the background to the foreground. // Use this method to undo the changes made on entering the background. } func sceneDidEnterBackground(_ scene: UIScene) { // Called as the scene transitions from the foreground to the background. // Use this method to save data, release shared resources, and store enough scene-specific state information // to restore the scene back to its current state. } }
[ 393221, 163849, 393228, 393231, 393251, 352294, 344103, 393260, 393269, 213049, 376890, 385082, 393277, 376906, 327757, 254032, 368728, 254045, 180322, 376932, 286845, 286851, 417925, 262284, 360598, 377003, 377013, 164029, 327872, 180418, 377030, 377037, 377047, 418008, 418012, 377063, 327915, 205037, 393457, 393461, 393466, 418044, 385281, 262405, 180491, 336140, 164107, 262417, 368913, 262423, 377118, 377121, 262437, 254253, 336181, 262455, 393539, 262473, 344404, 213333, 418135, 262497, 418145, 262501, 213354, 246124, 262508, 262512, 213374, 385420, 262551, 262553, 385441, 385444, 262567, 385452, 262574, 393649, 385460, 262587, 344512, 262593, 360917, 369119, 328180, 328183, 328190, 254463, 328193, 328207, 410129, 393748, 377372, 188959, 385571, 377384, 197160, 33322, 352822, 270905, 197178, 418364, 188990, 369224, 385610, 270922, 352844, 385617, 352865, 262761, 352875, 344694, 352888, 336513, 377473, 385671, 148106, 377485, 352919, 98969, 344745, 361130, 336556, 385714, 434868, 164535, 164539, 328379, 328387, 352969, 418508, 385743, 385749, 189154, 369382, 361196, 418555, 344832, 336644, 344837, 344843, 328462, 361231, 394002, 336660, 418581, 418586, 434971, 369436, 262943, 369439, 418591, 418594, 336676, 418600, 418606, 369464, 361274, 328516, 336709, 328520, 336712, 361289, 328523, 336715, 361300, 213848, 426842, 361307, 197469, 361310, 254813, 361318, 344936, 361323, 361335, 328574, 369544, 361361, 222129, 345036, 115661, 386004, 345046, 386012, 386019, 386023, 328690, 435188, 328703, 328710, 418822, 377867, 328715, 361490, 386070, 271382, 336922, 345119, 377888, 214060, 345134, 345139, 361525, 361537, 377931, 189525, 402523, 361568, 148580, 345200, 361591, 386168, 361594, 410746, 214150, 345224, 386187, 345247, 361645, 345268, 402615, 361657, 402636, 328925, 165086, 328933, 222438, 328942, 386286, 386292, 206084, 328967, 345377, 345380, 353572, 345383, 263464, 337207, 345400, 378170, 369979, 386366, 337230, 337235, 263509, 353634, 337252, 402792, 271731, 378232, 337278, 271746, 181639, 353674, 181644, 361869, 181650, 181655, 230810, 181671, 181674, 181679, 181682, 337330, 181687, 370105, 181691, 181697, 361922, 337350, 181704, 337366, 271841, 329192, 361961, 329195, 116211, 337399, 402943, 337416, 329227, 419341, 419345, 329234, 419351, 345626, 419357, 345631, 419360, 370208, 394787, 419363, 370214, 419369, 394796, 419377, 419386, 214594, 419401, 353868, 419404, 173648, 419408, 214611, 419412, 403040, 345702, 370298, 353920, 403073, 403076, 345737, 198282, 403085, 403092, 345750, 419484, 345758, 345763, 419492, 345766, 419498, 419502, 370351, 419507, 337588, 419510, 419513, 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, 247639, 337751, 370520, 313181, 354143, 354157, 345965, 345968, 345971, 345975, 403321, 1914, 354173, 395148, 247692, 337809, 247701, 436127, 436133, 247720, 337834, 362414, 337845, 190393, 247760, 346064, 346069, 329699, 354275, 190440, 354314, 346140, 436290, 395340, 378956, 436307, 338005, 100454, 329833, 329853, 329857, 329868, 411806, 329886, 346273, 362661, 100525, 387250, 379067, 387261, 256193, 395467, 346317, 411862, 256214, 411865, 411869, 411874, 379108, 411877, 387303, 346344, 395496, 338154, 387307, 346350, 338161, 436474, 379135, 411905, 411917, 379154, 395539, 387350, 387353, 338201, 338212, 395567, 248112, 362823, 436556, 321880, 362844, 379234, 354674, 321911, 420237, 379279, 272787, 354728, 338353, 338382, 272849, 248279, 256474, 182755, 338404, 338411, 330225, 248309, 248332, 330254, 199189, 420377, 330268, 191012, 330320, 199250, 191069, 346722, 248427, 338544, 191093, 346743, 346769, 150184, 174775, 248505, 174778, 363198, 223936, 355025, 273109, 264919, 256735, 264942, 363252, 338680, 264965, 338701, 256787, 363294, 396067, 346917, 396070, 215854, 355123, 355141, 355144, 338764, 330581, 330585, 387929, 355167, 265056, 265059, 355176, 355180, 355185, 412600, 207809, 379849, 347082, 396246, 330711, 248794, 248799, 347106, 437219, 257009, 265208, 199681, 338951, 330761, 330769, 330775, 248863, 396329, 347178, 404526, 396337, 330803, 396340, 339002, 388155, 339010, 347208, 248905, 330827, 248915, 183384, 339037, 412765, 257121, 265321, 248952, 420985, 330890, 347288, 248986, 44199, 380071, 339118, 249018, 339133, 126148, 330959, 330966, 265433, 265438, 388320, 363757, 388348, 339199, 396552, 175376, 175397, 273709, 372016, 437553, 347442, 199989, 175416, 396601, 208189, 437567, 175425, 437571, 437576, 437584, 437588, 396634, 175451, 437596, 429408, 175458, 175461, 175464, 265581, 175478, 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, 265779, 421442, 413251, 265796, 265806, 224854, 224858, 339553, 257636, 224871, 372328, 257647, 372338, 224885, 224888, 224891, 224895, 372354, 126597, 421509, 224905, 11919, 224911, 224914, 126611, 224917, 224920, 126618, 208539, 224923, 224927, 224930, 224933, 257705, 224939, 224943, 257713, 224949, 257717, 257721, 224954, 257725, 224960, 257733, 224966, 224970, 257740, 224976, 257745, 257748, 224982, 257752, 224987, 257762, 224996, 225000, 225013, 257788, 225021, 339711, 257791, 225027, 257796, 339722, 257802, 257805, 225039, 257808, 249617, 225044, 167701, 372500, 257815, 225049, 257820, 225054, 184096, 397089, 257825, 225059, 339748, 225068, 257837, 413485, 225071, 225074, 257843, 225077, 257846, 225080, 397113, 225083, 397116, 257853, 225088, 225094, 225097, 257869, 257872, 225105, 397140, 225109, 225113, 257881, 257884, 257887, 225120, 257891, 225128, 257897, 225138, 257909, 225142, 372598, 257914, 257917, 225150, 257922, 380803, 225156, 339845, 257927, 225166, 397201, 225171, 380823, 225176, 225183, 372698, 372704, 372707, 356336, 380919, 393215, 372739, 405534, 266295, 266298, 421961, 200786, 356440, 217180, 430181, 266351, 356467, 266365, 192640, 266375, 381069, 225425, 250003, 225430, 250008, 356507, 225439, 135328, 192674, 225442, 438434, 225445, 438438, 225448, 438441, 225451, 258223, 225456, 430257, 225459, 225462, 225468, 389309, 225472, 372931, 225476, 430275, 389322, 225485, 225488, 225491, 266454, 225494, 225497, 225500, 225503, 225506, 225511, 217319, 225515, 225519, 381177, 397572, 389381, 356638, 356641, 356644, 356647, 266537, 389417, 356650, 356656, 332081, 340276, 356662, 397623, 332091, 225599, 348489, 332107, 151884, 430422, 348503, 332118, 250201, 250203, 250211, 340328, 250217, 348523, 348528, 332153, 356734, 389503, 332158, 438657, 332162, 389507, 348548, 356741, 332175, 160152, 373146, 373149, 70048, 356783, 266688, 324032, 201158, 340452, 127473, 217590, 340473, 324095, 324100, 324103, 324112, 340501, 324118, 324122, 340512, 332325, 324134, 381483, 356908, 324141, 324143, 356917, 324150, 324156, 168509, 348734, 324161, 324165, 356935, 348745, 381513, 324171, 324174, 324177, 389724, 332381, 373344, 340580, 381546, 340628, 184983, 373399, 258723, 332455, 332460, 389806, 332464, 332473, 381626, 332484, 332487, 332494, 357070, 357074, 332512, 340724, 332534, 373499, 348926, 389927, 348979, 398141, 357202, 389971, 357208, 389979, 430940, 357212, 357215, 439138, 349041, 340850, 381815, 430967, 324473, 398202, 119675, 340859, 324476, 430973, 324479, 340863, 324482, 324485, 324488, 185226, 381834, 324493, 324496, 324499, 430996, 324502, 324511, 422817, 324514, 201638, 398246, 373672, 324525, 5040, 111539, 324534, 5047, 324539, 324542, 398280, 349129, 340942, 209874, 340958, 431073, 398307, 340964, 209896, 201712, 209904, 349173, 381947, 201724, 349181, 431100, 431107, 349203, 209944, 209948, 250917, 357419, 209966, 209969, 209973, 209976, 209980, 209988, 209991, 431180, 209996, 349268, 250968, 210011, 373853, 341094, 210026, 210028, 210032, 349296, 210037, 210042, 210045, 349309, 152704, 349313, 160896, 210053, 210056, 259217, 373905, 210068, 210072, 210078, 210081, 210085, 210089, 210096, 210100, 324792, 210108, 357571, 210116, 210128, 210132, 333016, 210139, 210144, 218355, 218361, 275709, 275713, 242947, 275717, 275723, 333075, 349460, 349486, 349492, 415034, 210261, 365912, 259423, 374113, 251236, 374118, 390518, 357756, 374161, 112021, 349591, 357793, 333222, 259516, 415168, 366035, 415187, 366039, 415192, 415194, 415197, 415200, 333285, 415208, 366057, 366064, 415217, 415225, 423424, 415258, 415264, 366118, 415271, 349739, 144940, 415279, 415282, 415286, 210488, 415291, 415295, 333396, 333400, 366173, 423529, 423533, 210547, 415354, 333440, 267910, 267929, 259789, 366301, 333535, 366308, 366312, 431852, 399086, 366319, 210673, 366322, 399092, 366326, 333566, 268042, 210700, 366349, 210707, 399129, 333595, 210720, 366384, 358192, 210740, 366388, 358201, 325441, 366403, 325447, 341831, 341839, 341844, 415574, 358235, 350046, 399200, 399208, 268144, 358256, 358260, 399222, 325494, 333690, 325505, 399244, 333709, 333725, 333737, 382891, 382898, 358348, 333777, 219094, 399318, 358372, 350190, 350194, 333819, 350204, 350207, 325633, 325637, 350214, 268299, 333838, 350225, 350232, 333851, 350238, 350241, 374819, 350245, 350249, 350252, 178221, 350257, 350260, 350272, 243782, 350281, 350286, 374865, 252021, 342134, 374904, 268435, 333998, 334012, 260299, 211161, 375027, 358645, 268553, 268560, 432406, 325920, 358701, 391469, 358705, 358714, 358717, 383307, 358738, 383331, 383334, 391531, 383342, 334204, 268669, 194942, 391564, 366991, 334224, 342431, 375209, 375220, 334263, 326087, 358857, 195041, 334312, 104940, 375279, 350724, 186898, 342546, 350740, 342551, 342555, 416294, 350762, 252463, 358962, 334397, 358973, 252483, 219719, 399957, 334425, 326240, 375401, 334466, 334469, 162446, 342680, 342685, 260767, 342711, 244410, 260798, 334530, 260802, 350918, 154318, 342737, 391895, 154329, 416476, 64231, 113389, 203508, 375541, 342777, 391938, 391949, 375569, 375572, 375575, 375580, 162592, 334633, 326444, 383794, 375613, 244542, 260925, 375616, 342857, 416599, 342875, 244572, 433001, 400238, 211826, 211832, 392061, 351102, 252801, 260993, 400260, 211846, 342921, 342931, 252823, 400279, 392092, 400286, 359335, 211885, 400307, 351169, 359362, 351172, 170950, 187335, 326599, 359367, 359383, 359389, 383968, 343018, 261109, 261112, 244728, 383999, 261130, 261148, 359452, 211999, 261155, 261160, 359471, 375868, 384099, 384102, 384108, 367724, 187503, 343155, 384115, 212095, 384136, 384140, 384144, 351382, 384152, 384158, 384161, 351399, 384169, 367795, 244917, 384182, 384189, 384192, 351424, 343232, 367817, 244938, 384202, 253132, 384209, 146644, 351450, 384225, 343272, 351467, 359660, 384247, 351480, 384250, 351483, 351492, 384270, 359695, 261391, 253202, 261395, 384276, 384284, 245021, 384290, 253218, 245032, 171304, 384299, 351535, 245042, 326970, 384324, 212296, 212304, 367966, 343394, 367981, 343410, 155000, 327035, 245121, 245128, 253321, 155021, 384398, 245137, 245143, 245146, 245149, 245152, 245155, 155045, 245158, 114093, 327090, 343478, 359867, 384444, 327108, 327112, 384457, 359887, 359891, 368093, 155103, 343535, 343540, 368120, 409092, 359948, 359951, 359984, 400977, 400982, 179803, 155241, 155255, 155274, 368289, 245410, 425639, 425652, 425663, 155328, 245463, 155352, 155356, 155364, 245477, 155372, 245487, 212723, 409336, 155394, 155404, 245528, 155423, 360224, 155439, 204592, 155444, 155448, 417596, 384829, 360262, 155463, 155477, 376665, 155484, 261982, 425823, 155488, 376672, 155492, 327532, 261997, 376686, 262000, 262003, 425846, 262006, 147319, 262009, 327542, 262012, 155517, 155523, 155526, 360327, 376715, 155532, 262028, 262031, 262034, 262037, 262040, 262043, 155550, 253854, 262046, 262049, 262052, 327590, 155560, 155563, 155566, 327613, 393152, 393170, 155604, 155620, 253924, 155622, 253927, 327655, 360432, 393204, 360439, 253944, 393209, 155647 ]
687906b50ca73607f2848b376d9ddd263ac81848
69b9a00694013fbf7582dd5450a21596dbce47f0
/Tests/PullToDismissTests/PullToDismissTests.swift
d4656dec82a129ee2f410c238452d66e04d246a9
[]
permissive
longvt-1468/PullToDismiss
87ff862b0ae20434b13d00145903715d5e6e91cd
4cdab6d22c66e0af56b405dc31a636ca2dbb30e8
refs/heads/master
2023-06-16T22:01:12.758057
2021-07-12T14:18:13
2021-07-12T14:18:13
385,088,590
0
0
MIT
2021-07-12T01:13:44
2021-07-12T01:13:44
null
UTF-8
Swift
false
false
391
swift
import XCTest @testable import PullToDismiss final class PullToDismissTests: XCTestCase { func testExample() { // This is an example of a functional test case. // Use XCTAssert and related functions to verify your tests produce the correct // results. XCTAssertEqual(PullToDismiss().text, "Hello, World!") } }
[ 396930, 415749, 106890, 378251, 415759, 201362, 400020, 162969, 425887, 355234, 259369, 261420, 187576, 398777, 363322, 187579, 48188, 415805, 356801, 201162, 372175, 392271, 362592, 396000, 198499, 265444, 176748, 379122, 273526, 271483 ]
0ea027e5ff81720d985df94a8acf3774e3246bc7
b89fa5174662ead9b302094bf91714a89ecfa5ef
/tcc-treinamento-ios/StoryboardManager.swift
c1b0f9b188ffd0c48825d509c239ef4e8273b806
[]
no_license
kleinbruno/wall-pictures
9d1b412b4676d084666596fb11113d453e41f80a
e04d3a84d27a06110b780c4040d2d6555d5b9dbc
refs/heads/master
2020-07-17T18:37:09.727848
2019-07-06T02:34:17
2019-07-06T02:34:17
206,073,780
0
0
null
null
null
null
UTF-8
Swift
false
false
783
swift
// // UpdateRoot.swift // tcc-treinamento-ios // // Created by Bruno Klein on 22/06/19. // Copyright © 2019 CWI software. All rights reserved. // import Foundation import UIKit class StoryboardManager { static func updateViewController() { // let status = UserDefaults.standard.bool(forKey: "status") var root : UIViewController? if let userUID = UserDefaults.standard.string(forKey: "userUID"), !userUID.isEmpty { root = ViewController.instantiate(fromAppStoryboard: .Main) } else { root = LoginViewController.instantiate(fromAppStoryboard: .Login) } let appDelegate = UIApplication.shared.delegate as! AppDelegate appDelegate.window?.rootViewController = root } }
[ -1 ]
f078152497e6485b027d253cd64e11e81b1d4dd0
1d72725e752c38ebae641fc9a05792940a4e2d52
/SmartTrash/models/response_models/Bin.swift
12c76d7524473c8a6bae5850d5c16e3c763379d4
[]
no_license
anudaweerasinghe/smarttrash-iOS
db126566a3634474357b3fc0bedd24f70ca37b5a
dd1c463f61a791d0707d5543e4ce4cef3ac05450
refs/heads/master
2023-02-24T07:30:33.892705
2018-06-20T06:24:34
2018-06-20T06:24:34
334,481,572
0
0
null
null
null
null
UTF-8
Swift
false
false
1,840
swift
import Foundation import ObjectMapper class Bin : NSObject, NSCoding, Mappable{ var activeStatus : Int? var id : Int? var info : String? var lat : Double? var lng : Double? var name : String? class func newInstance(map: Map) -> Mappable?{ return Bin() } required init?(map: Map){} private override init(){} func mapping(map: Map) { activeStatus <- map["activeStatus"] id <- map["id"] info <- map["info"] lat <- map["lat"] lng <- map["lng"] name <- map["name"] } /** * NSCoding required initializer. * Fills the data from the passed decoder */ @objc required init(coder aDecoder: NSCoder) { activeStatus = aDecoder.decodeObject(forKey: "activeStatus") as? Int id = aDecoder.decodeObject(forKey: "id") as? Int info = aDecoder.decodeObject(forKey: "info") as? String lat = aDecoder.decodeObject(forKey: "lat") as? Double lng = aDecoder.decodeObject(forKey: "lng") as? Double name = aDecoder.decodeObject(forKey: "name") as? String } /** * NSCoding required method. * Encodes mode properties into the decoder */ @objc func encode(with aCoder: NSCoder) { if activeStatus != nil{ aCoder.encode(activeStatus, forKey: "activeStatus") } if id != nil{ aCoder.encode(id, forKey: "id") } if info != nil{ aCoder.encode(info, forKey: "info") } if lat != nil{ aCoder.encode(lat, forKey: "lat") } if lng != nil{ aCoder.encode(lng, forKey: "lng") } if name != nil{ aCoder.encode(name, forKey: "name") } } }
[ -1 ]
b5d152e87d70ceeb746e0e91574f654c7de116ef
0cee57fedafcecf206380148b8f05e5f1f6d3ded
/Movie/View/DesignableX/UITextFieldX.swift
924e1642fa2399b61a878ee3082983c9e9b462ec
[]
no_license
iGoLDeNZz/Movie
fde61df853a4c2e33ee74f115d18155d1418a184
dfcf00ca9b436b5ea6409f067e273557f02c93b2
refs/heads/master
2020-04-17T23:41:31.639182
2019-01-26T15:50:28
2019-01-26T15:50:28
167,044,933
0
0
null
null
null
null
UTF-8
Swift
false
false
3,815
swift
// // DesignableUITextField.swift // SkyApp // // Created by Mark Moeykens on 12/16/16. // Copyright © 2016 Mark Moeykens. All rights reserved. // import UIKit @IBDesignable class UITextFieldX: UITextField { @IBInspectable var leftImage: UIImage? { didSet { updateView() } } @IBInspectable var leftPadding: CGFloat = 0 { didSet { updateView() } } @IBInspectable var rightImage: UIImage? { didSet { updateView() } } @IBInspectable var rightPadding: CGFloat = 0 { didSet { updateView() } } private var _isRightViewVisible: Bool = true var isRightViewVisible: Bool { get { return _isRightViewVisible } set { _isRightViewVisible = newValue updateView() } } func updateView() { setLeftImage() setRightImage() // Placeholder text color attributedPlaceholder = NSAttributedString(string: placeholder != nil ? placeholder! : "", attributes:[NSAttributedString.Key.foregroundColor: tintColor]) } func setLeftImage() { leftViewMode = UITextField.ViewMode.always var view: UIView if let image = leftImage { let imageView = UIImageView(frame: CGRect(x: leftPadding, y: 0, width: 20, height: 20)) imageView.image = image // Note: In order for your image to use the tint color, you have to select the image in the Assets.xcassets and change the "Render As" property to "Template Image". imageView.tintColor = tintColor var width = imageView.frame.width + leftPadding if borderStyle == UITextField.BorderStyle.none || borderStyle == UITextField.BorderStyle.line { width += 5 } view = UIView(frame: CGRect(x: 0, y: 0, width: width, height: 20)) view.addSubview(imageView) } else { view = UIView(frame: CGRect(x: 0, y: 0, width: leftPadding, height: 20)) } leftView = view } func setRightImage() { rightViewMode = UITextField.ViewMode.always var view: UIView if let image = rightImage, isRightViewVisible { let imageView = UIImageView(frame: CGRect(x: 0, y: 0, width: 20, height: 20)) imageView.image = image // Note: In order for your image to use the tint color, you have to select the image in the Assets.xcassets and change the "Render As" property to "Template Image". imageView.tintColor = tintColor var width = imageView.frame.width + rightPadding if borderStyle == UITextField.BorderStyle.none || borderStyle == UITextField.BorderStyle.line { width += 5 } view = UIView(frame: CGRect(x: 0, y: 0, width: width, height: 20)) view.addSubview(imageView) } else { view = UIView(frame: CGRect(x: 0, y: 0, width: rightPadding, height: 20)) } rightView = view } // MARK: - Corner Radius @IBInspectable var cornerRadius: CGFloat = 0 { didSet { self.layer.cornerRadius = cornerRadius } } @IBInspectable var borderWidth: CGFloat = 0.0 { didSet { layer.borderWidth = borderWidth } } @IBInspectable var borderColor: UIColor = UIColor.clear { didSet { layer.borderColor = borderColor.cgColor backgroundColor = UIColor.clear } } }
[ 311230 ]
68005c3ead39497be3f00bde6b44847e77b89b34
04fdc128a1a632d465d4a966ffd3152a320d60bf
/Fang0/HomeNewCollectionViewCell.swift
beaac39a6f4985504c1b3e9f99b7364ef0b0c1c7
[]
no_license
tinatien/swiftcourse_finalproject_group1
3944a063b3276aa455dfea49964a6325b271cf7f
a7f18c865665b14ff17d1fd82aba470fda3fcd5b
refs/heads/master
2020-12-25T14:38:52.748633
2016-06-23T05:32:11
2016-06-23T05:32:11
61,776,526
2
0
null
null
null
null
UTF-8
Swift
false
false
322
swift
// // HomeNewCollectionViewCell.swift // Fang0 // // Created by TinaTien on 2016/4/12. // Copyright © 2016年 TinaTien. All rights reserved. // import UIKit class HomeNewCollectionViewCell: UICollectionViewCell { @IBOutlet weak var newArticleTitle: UILabel! @IBOutlet weak var newImage: UIImageView! }
[ 245312, 209985, 324581, 325541, 276267, 328479, 289237, 141336, 213725, 150207 ]
5eeb005a96e732468af25b07c8b94a142bdcf552
45e585009cd36e9f51ff6055c05c3ac5f5ba832a
/UnstoppableWallet/UnstoppableWallet/Modules/Settings/Security/SecuritySettingsViewController.swift
41ced880a9a0a7d4df86a19cbd77426c24839d41
[ "MIT" ]
permissive
gotnull/unstoppable-wallet-ios
b7ff834ff846b247e19bd9e77566cd345f7ba7dc
9de65609d3e3e418d33d49d1f6286c767aee45d5
refs/heads/master
2023-05-29T13:26:58.940745
2021-06-10T07:03:19
2021-06-10T07:03:19
375,601,415
1
0
MIT
2021-06-10T07:03:19
2021-06-10T06:58:01
null
UTF-8
Swift
false
false
6,478
swift
import UIKit import UIExtensions import SectionsTableView import RxSwift import ThemeKit import PinKit import ComponentKit class SecuritySettingsViewController: ThemeViewController { private let delegate: ISecuritySettingsViewDelegate private let tableView = SectionsTableView(style: .grouped) private var backupAlertVisible = false private var pinSet = false private var editPinVisible = false private var biometryVisible = false private var biometryType: BiometryType? private var biometryEnabled = false init(delegate: ISecuritySettingsViewDelegate) { self.delegate = delegate super.init() hidesBottomBarWhenPushed = true } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } override func viewDidLoad() { super.viewDidLoad() title = "settings_security.title".localized navigationItem.backBarButtonItem = UIBarButtonItem(title: title, style: .plain, target: nil, action: nil) tableView.registerCell(forClass: A1Cell.self) tableView.registerCell(forClass: B1Cell.self) tableView.registerCell(forClass: A11Cell.self) tableView.sectionDataSource = self tableView.backgroundColor = .clear tableView.separatorStyle = .none view.addSubview(tableView) tableView.snp.makeConstraints { maker in maker.edges.equalToSuperview() } delegate.viewDidLoad() tableView.reload() } override func viewWillAppear(_ animated: Bool) { tableView.deselectCell(withCoordinator: transitionCoordinator, animated: animated) } private var privacyRows: [RowProtocol] { [ Row<A1Cell>( id: "privacy", height: .heightCell48, bind: { cell, _ in cell.set(backgroundStyle: .lawrence, isFirst: true, isLast: true) cell.titleImage = UIImage(named: "user_20") cell.title = "settings_security.privacy".localized }, action: { [weak self] _ in self?.delegate.didTapPrivacy() } ) ] } private var pinRows: [RowProtocol] { let attentionIcon = pinSet ? nil : UIImage(named: "warning_2_20") var rows: [RowProtocol] = [ Row<A11Cell>( id: "pin", height: .heightCell48, bind: { [unowned self] cell, _ in cell.set(backgroundStyle: .lawrence, isFirst: true, isLast: !editPinVisible) cell.titleImage = UIImage(named: "dialpad_alt_2_20") cell.title = "settings_security.passcode".localized cell.rightImage = attentionIcon?.withRenderingMode(.alwaysTemplate) cell.rightImageTintColor = .themeLucian cell.isOn = pinSet cell.onToggle = { [weak self] isOn in self?.delegate.didSwitch(pinSet: isOn) } } ) ] if editPinVisible { rows.append( Row<B1Cell>( id: "edit_pin", height: .heightCell48, autoDeselect: true, bind: { cell, _ in cell.set(backgroundStyle: .lawrence, isLast: true) cell.title = "settings_security.change_pin".localized }, action: { [weak self] _ in DispatchQueue.main.async { self?.delegate.didTapEditPin() } } ) ) } return rows } private var biometryRow: RowProtocol? { biometryType.flatMap { switch $0 { case .touchId: return createBiometryRow(title: "settings_security.touch_id".localized, icon: "touch_id_2_20") case .faceId: return createBiometryRow(title: "settings_security.face_id".localized, icon: "face_id_20") default: return nil } } } private func createBiometryRow(title: String, icon: String) -> RowProtocol { Row<A11Cell>( id: "biometry", height: .heightCell48, bind: { [unowned self] cell, _ in cell.set(backgroundStyle: .lawrence, isFirst: true, isLast: true) cell.titleImage = UIImage(named: icon) cell.title = title cell.rightImage = nil cell.isOn = biometryEnabled cell.onToggle = { [weak self] isOn in self?.delegate.didSwitch(biometryEnabled: isOn) } } ) } } extension SecuritySettingsViewController: SectionsDataSource { func buildSections() -> [SectionProtocol] { var sections: [SectionProtocol] = [ Section(id: "privacy", headerState: .margin(height: .margin3x), rows: privacyRows), Section(id: "pin", headerState: .margin(height: .margin8x), rows: pinRows) ] if biometryVisible, let biometryRow = biometryRow { sections.append(Section(id: "biometry", headerState: .margin(height: .margin8x), rows: [biometryRow])) } return sections } } extension SecuritySettingsViewController: ISecuritySettingsView { func refresh() { tableView.reload() } func set(backupAlertVisible: Bool) { self.backupAlertVisible = backupAlertVisible } func toggle(pinSet: Bool) { self.pinSet = pinSet } func set(editPinVisible: Bool) { self.editPinVisible = editPinVisible } func set(biometryVisible: Bool) { self.biometryVisible = biometryVisible } func set(biometryType: BiometryType?) { self.biometryType = biometryType } func toggle(biometryEnabled: Bool) { self.biometryEnabled = biometryEnabled } func show(error: Error) { HudHelper.instance.showError(title: error.smartDescription) } }
[ -1 ]
3707253f55cda9adae326253fd20a1025510074b
4fd3ed13c375b188a72465e597f3d308e84c7201
/iOS/Exercise 18, 20, 21, 22 Gallary App/Exercise 18, 20, 21, 22 Gallary App/Controller/GallaryController.swift
2f5572a06fb00603b6e64d8a809982f787e7387b
[ "Unlicense" ]
permissive
abhi21git/Bootcamp_Exercises
ba2b2432f51c6ab08e85799dd15cd58e9cfc290a
5024a0c4577dbb52796d176b580bfea3ee195955
refs/heads/master
2020-04-21T12:10:39.894241
2019-11-12T12:21:38
2019-11-12T12:21:38
169,554,419
2
0
null
null
null
null
UTF-8
Swift
false
false
5,211
swift
// // GallaryController.swift // Exercise 18, 20, 21, 22 Gallary App // // Created by Abhishek Maurya on 07/04/19. // Copyright © 2019 Abhishek Maurya. All rights reserved. // import UIKit class GallaryController: UIViewController { @IBOutlet weak var photoCollectionView: UICollectionView! @IBOutlet weak var customNavBar: CustomNavigationBar! var noOfItems = 16 var fetchingMore = false var arrayOfJSON = [jsonStructure]() override func viewDidLoad() { super.viewDidLoad() photoCollectionView.dataSource = self photoCollectionView.delegate = self customNavBar.leftButton.isHidden = true customNavBar.titleButton.addTarget(self, action: #selector(self.titleClicked), for: .touchUpInside) customNavBar.rightButton.addTarget(self, action: #selector(self.logoutClicked), for: .touchUpInside) let nib = UINib.init(nibName: "CustomCollectionCell", bundle: nil) photoCollectionView.register(nib, forCellWithReuseIdentifier: "CustomCollectionCell") loadData() } @objc func titleClicked() { photoCollectionView.reloadData() } @objc func logoutClicked() { // log out functionality here } func loadData() { let jsonURL = URL(string: "https://picsum.photos/list") let session = URLSession(configuration: .ephemeral) let sessionTask = session.dataTask(with: jsonURL!) {[weak self](data, response, error) in do { if error == nil { self?.arrayOfJSON = try JSONDecoder().decode([jsonStructure].self, from: data!) DispatchQueue.main.async { self?.photoCollectionView.reloadData() } } }catch { //Can't load data } } sessionTask.resume() } } extension GallaryController: UICollectionViewDelegate , UICollectionViewDataSource , UICollectionViewDelegateFlowLayout { func beginBatchFetch() { DispatchQueue.main.asyncAfter(deadline: .now() + 1, execute: { self.fetchingMore = true self.noOfItems += 16 self.photoCollectionView.reloadData() }) } func scrollViewDidScroll(_ scrollView: UIScrollView) { let offsetY = scrollView.contentOffset.y let contentHeight = scrollView.contentSize.height // print("offset = \(offsetY) | height = \(contentHeight)") if offsetY > contentHeight - scrollView.frame.height { if !fetchingMore { beginBatchFetch() } } } func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return arrayOfJSON.count // return noOfItems } func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "CustomCollectionCell", for: indexPath) as! CustomCollectionCell let cellWidth = cell.frame.width let cellHeight = cell.frame.height let url = "https://picsum.photos/id/\(arrayOfJSON[indexPath.row].id)/\(Int(cellWidth))/\(Int(cellHeight))" guard let imageURL = URL(string: url) else { return cell } UIImage.loadFrom(url: imageURL) { image in if let image = image { cell.loadImage(image: image) } } cell.loadAuthor(authorName: arrayOfJSON[indexPath.row].author) return cell } // to set height and width of cell in proportion to screen size and maintaning aspect ration of 3:4 func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { let cellWidth = (collectionView.bounds.width/2.0)-12 let cellHeight = cellWidth*(3/4) return CGSize(width: cellWidth, height: cellHeight) } func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { let storyBoard = UIStoryboard.init(name: "Main", bundle: nil) let controller = storyBoard.instantiateViewController(withIdentifier: "PicturePreviewController") as! PicturePreviewController let imageWidth = Int(self.view.bounds.width) let imageHeight = Int(self.view.bounds.height) let imageurl = "https://picsum.photos/id/\(arrayOfJSON[indexPath.row].id)/\(imageWidth)/\(imageHeight)" guard let url = URL(string: imageurl) else { return } UIImage.loadFrom(url: url) { image in controller.imageView.image = image controller.authorNameLabel.text = self.arrayOfJSON[indexPath.row].author as String controller.authorLink = URL(string: self.arrayOfJSON[indexPath.row].author_url) controller.loadingIndicator.isHidden = true } self.navigationController?.pushViewController(controller, animated: true) } }
[ -1 ]
4e5846481514cb4cd1695cce038ab873c73d4a76
5d0426e5fa048c0b170da53b9f8f41e3ef7b9eb3
/Tools/generate-manual/DSL/Core/Empty.swift
d681fcca738172f6c2bb75f9b80c0484303e72e9
[ "Apache-2.0", "Swift-exception" ]
permissive
apple/swift-argument-parser
8b8b5353f0a8cb62b7ee01bbb6c5eb1e14775077
8f4d2753f0e4778c76d5f05ad16c74f707390531
refs/heads/main
2023-08-29T03:14:02.855736
2023-08-15T19:01:35
2023-08-15T19:01:35
241,928,033
3,160
348
Apache-2.0
2023-09-02T15:57:07
2020-02-20T16:07:00
Swift
UTF-8
Swift
false
false
544
swift
//===----------------------------------------------------------*- swift -*-===// // // This source file is part of the Swift Argument Parser open source project // // Copyright (c) 2021 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information // //===----------------------------------------------------------------------===// struct Empty: MDocComponent { var ast: [MDocASTNode] { [] } var body: MDocComponent { self } }
[ 145664, 88256, 145582, 88273, 88115, 145845, 145878, 74170, 145885 ]
695b44f4c35060725af122de25de42378cfd4200
8faf14108aa27ff57f23f2f33eff7a61b00672e4
/MultiTabView/MultiTabControllerManage/MultiTabControllerManage/TestController2.swift
f022a5293815e77651a0d8813ae25beaac85b67e
[]
no_license
xiaohai-seasky/MultiTabControllerManager
f6ca84dce33bf06b656652a2ad5879e09033b13a
cc5300ca80a3ddf58bd9f440deeee194b5afee06
refs/heads/master
2021-01-20T20:28:32.846094
2016-06-16T02:23:22
2016-06-16T02:23:22
60,661,271
0
0
null
null
null
null
UTF-8
Swift
false
false
878
swift
// // TestController2.swift // MultiTabControllerManage // // Created by apple on 16/6/7. // Copyright © 2016年 XiaoHaiSeaSky. All rights reserved. // import UIKit class TestController2: UIViewController { override func viewDidLoad() { super.viewDidLoad() self.view.backgroundColor = UIColor.redColor() } 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 ]
7c573ccd8ca4a75cd60f539c88752949d7c956db
f519d175ee1a6a5d0e90aa2af66d4c10ddfdc1e4
/LibwallyDemo/SceneDelegate.swift
4e6231395067b0cee777c668c9b1f99b9d3246cf
[]
no_license
Fonta1n3/LibwallyDemo
0c49d325b9b0152c98208bc3b6e07c4a6ec44266
90e97350a01c0936cd48b44ed5c1b63f398f232e
refs/heads/main
2023-03-29T06:04:41.826479
2021-04-09T02:45:10
2021-04-09T02:45:10
355,742,368
1
0
null
null
null
null
UTF-8
Swift
false
false
2,293
swift
// // SceneDelegate.swift // LibwallyDemo // // Created by Peter Denton on 4/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, 254045, 180322, 376932, 286845, 286851, 417925, 262284, 360598, 377003, 377013, 164029, 327872, 180418, 377030, 377037, 377047, 418008, 418012, 377063, 327915, 205037, 393457, 393461, 393466, 418044, 385281, 262405, 180491, 336140, 164107, 262417, 368913, 262423, 377118, 377121, 262437, 254253, 336181, 262455, 393539, 262473, 344404, 213333, 418135, 270687, 262497, 418145, 262501, 213354, 246124, 262508, 262512, 213374, 385420, 393613, 262551, 262553, 385441, 385444, 262567, 385452, 262574, 393649, 385460, 262587, 344512, 262593, 360917, 369119, 328180, 328183, 328190, 254463, 328193, 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, 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, 402523, 361568, 148580, 345200, 361591, 386168, 361594, 410746, 214150, 345224, 386187, 345247, 361645, 345268, 402615, 361657, 402636, 328925, 165086, 66783, 165092, 328933, 222438, 328942, 386286, 386292, 206084, 328967, 345377, 345380, 353572, 345383, 263464, 337207, 345400, 378170, 369979, 386366, 337230, 337235, 263509, 353634, 337252, 402792, 271731, 378232, 337278, 271746, 181639, 353674, 181644, 361869, 181650, 181655, 230810, 181671, 181674, 181679, 181682, 337330, 181687, 370105, 181691, 181697, 361922, 337350, 181704, 337366, 271841, 329192, 361961, 329195, 116211, 337399, 402943, 337416, 329227, 419341, 419345, 329234, 419351, 345626, 419357, 345631, 419360, 370208, 394787, 419363, 370214, 419369, 394796, 419377, 419386, 214594, 419401, 353868, 419404, 173648, 419408, 214611, 419412, 403040, 345702, 370298, 353920, 403073, 403076, 345737, 198282, 403085, 403092, 345750, 419484, 345758, 345763, 419492, 345766, 419498, 419502, 370351, 419507, 337588, 419510, 419513, 419518, 403139, 337607, 419528, 419531, 419536, 272083, 394967, 419543, 419545, 345819, 419548, 419551, 345829, 419560, 337643, 419564, 337647, 370416, 337671, 362249, 362252, 395022, 362256, 321300, 345888, 362274, 378664, 354107, 345916, 354112, 370504, 329545, 345932, 370510, 354132, 247639, 337751, 370520, 313181, 182110, 354143, 354157, 345965, 345968, 345971, 345975, 403321, 1914, 354173, 395148, 247692, 337809, 247701, 436127, 436133, 247720, 337834, 362414, 337845, 190393, 247760, 346064, 346069, 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, 379135, 411905, 411917, 379154, 395539, 387350, 387353, 338201, 338212, 395567, 248112, 362823, 436556, 321880, 362844, 379234, 354674, 321911, 420237, 379279, 272787, 354728, 338353, 338382, 272849, 248279, 256474, 182755, 338404, 330225, 248309, 248332, 330254, 199189, 420377, 330268, 191012, 330320, 199250, 191069, 346722, 248427, 338544, 346736, 191093, 346743, 346769, 150184, 174775, 248505, 174778, 363198, 223936, 355025, 273109, 264919, 256735, 264942, 363252, 338680, 264965, 338701, 256787, 363294, 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, 199681, 338951, 330761, 330769, 330775, 248863, 396329, 347178, 404526, 396337, 330803, 396340, 339002, 388155, 339010, 347208, 248905, 330827, 248915, 183384, 339037, 412765, 257121, 265321, 248952, 420985, 330890, 347288, 248986, 44199, 380071, 339118, 249018, 339133, 126148, 330959, 330966, 265433, 265438, 388320, 363757, 388348, 339199, 396552, 175376, 175397, 273709, 372016, 437553, 347442, 199989, 175416, 396601, 208189, 437567, 175425, 437571, 437576, 437584, 437588, 396634, 175451, 437596, 429408, 175458, 175461, 175464, 265581, 331124, 175478, 175487, 249215, 175491, 249219, 249225, 249228, 249235, 175514, 175517, 396703, 396706, 175523, 355749, 396723, 388543, 380353, 216518, 380364, 339406, 372177, 339414, 249303, 413143, 339418, 339421, 249310, 339425, 249313, 339429, 339435, 249329, 69114, 372229, 208399, 380433, 175637, 405017, 134689, 265779, 421442, 413251, 265796, 265806, 224854, 224858, 339553, 257636, 224871, 372328, 257647, 372338, 224885, 224888, 224891, 224895, 126597, 421509, 224905, 11919, 224911, 224914, 126611, 224917, 224920, 126618, 208539, 224923, 224927, 224930, 224933, 257705, 224939, 224943, 257713, 224949, 257717, 257721, 224954, 257725, 224960, 257733, 224966, 224970, 257740, 224976, 257745, 257748, 224982, 257752, 224987, 257762, 224996, 225000, 225013, 257788, 225021, 339711, 257791, 225027, 257796, 339722, 257802, 257805, 225039, 257808, 249617, 225044, 167701, 372500, 257815, 225049, 257820, 225054, 184096, 397089, 257825, 225059, 339748, 225068, 257837, 413485, 225071, 225074, 257843, 225077, 257846, 225080, 397113, 225083, 397116, 257853, 225088, 225094, 225097, 257869, 257872, 225105, 397140, 225109, 225113, 257881, 257884, 257887, 225120, 257891, 225128, 257897, 225138, 257909, 225142, 372598, 257914, 257917, 225150, 257922, 380803, 225156, 339845, 257927, 225166, 397201, 225171, 380823, 225176, 225183, 372698, 372704, 372707, 356336, 380919, 393215, 372739, 405534, 266295, 266298, 421961, 200786, 356440, 217180, 430181, 266351, 356467, 266365, 192640, 266375, 381069, 225425, 250003, 225430, 250008, 356507, 250012, 225439, 135328, 192674, 225442, 438434, 225445, 225448, 438441, 356521, 225451, 258223, 225456, 430257, 225459, 225462, 225468, 389309, 225472, 372931, 225476, 389322, 225485, 225488, 225491, 266454, 225494, 225497, 225500, 225503, 225506, 225511, 217319, 225515, 225519, 381177, 397572, 389381, 381212, 356638, 356641, 356644, 356647, 266537, 389417, 356650, 356656, 332081, 340276, 356662, 397623, 332091, 225599, 348489, 332107, 151884, 430422, 348503, 332118, 250203, 250211, 340328, 250217, 348523, 348528, 332153, 356734, 389503, 332158, 438657, 332162, 389507, 348548, 356741, 332175, 160152, 373146, 340380, 373149, 70048, 356783, 266688, 324032, 201158, 340452, 127473, 217590, 340473, 324095, 324100, 324103, 324112, 340501, 324118, 324122, 340512, 332325, 324134, 381483, 356908, 324141, 324143, 356917, 324150, 324156, 168509, 348734, 324161, 324165, 356935, 348745, 381513, 324171, 324174, 324177, 389724, 332381, 373344, 340580, 348777, 381546, 340628, 184983, 373399, 258723, 332455, 332460, 332464, 332473, 381626, 332484, 332487, 332494, 357070, 357074, 332512, 340724, 332534, 373499, 348926, 389927, 348979, 348983, 398141, 357202, 389971, 357208, 389979, 430940, 357212, 357215, 439138, 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, 111539, 324534, 5047, 324539, 324542, 398280, 349129, 340942, 209874, 340958, 431073, 398307, 340964, 209896, 201712, 209904, 349173, 381947, 201724, 349181, 431100, 431107, 349203, 209944, 209948, 357411, 250917, 169002, 357419, 209966, 209969, 209973, 209976, 209980, 209988, 209991, 431180, 209996, 349268, 177238, 250968, 210011, 373853, 341094, 210026, 210028, 210032, 349296, 210037, 210042, 210045, 349309, 152704, 349313, 160896, 210053, 210056, 349320, 259217, 373905, 210068, 210072, 210078, 210081, 210085, 210089, 210096, 210100, 324792, 210108, 357571, 210116, 210128, 210132, 333016, 210139, 210144, 218355, 218361, 275709, 128254, 275713, 242947, 275717, 275723, 333075, 349460, 349486, 349492, 415034, 210261, 365912, 259423, 374113, 251236, 374118, 390518, 357756, 374161, 112021, 349591, 357793, 333222, 259516, 415168, 366035, 415187, 366039, 415192, 415194, 415197, 415200, 333285, 415208, 366057, 366064, 415217, 415225, 423424, 415258, 415264, 366118, 415271, 382503, 349739, 144940, 415279, 415282, 415286, 210488, 415291, 415295, 349762, 333396, 374359, 333400, 366173, 423529, 423533, 210547, 415354, 333440, 267910, 267929, 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, 341839, 341844, 415574, 358235, 350046, 399200, 399208, 268144, 358256, 358260, 399222, 325494, 333690, 325505, 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, 252021, 342134, 374904, 268435, 333998, 334012, 260299, 211161, 375027, 358645, 268553, 268560, 432406, 325920, 194854, 358701, 391469, 358705, 358714, 358717, 383307, 358738, 383331, 383334, 391531, 383342, 334204, 268669, 194942, 391564, 366991, 334224, 342431, 375209, 375220, 334263, 326087, 358857, 195041, 334312, 104940, 375279, 416255, 350724, 186898, 342546, 350740, 342551, 342555, 416294, 350762, 252463, 358962, 334397, 358973, 252483, 219719, 399957, 334425, 326240, 375401, 334466, 334469, 391813, 162446, 342680, 342685, 260767, 342711, 244410, 260798, 334530, 260802, 350918, 154318, 342737, 391895, 154329, 416476, 64231, 113389, 203508, 375541, 342777, 391938, 391949, 375569, 375572, 375575, 375580, 162592, 334633, 326444, 383794, 375613, 244542, 260925, 375616, 342857, 416599, 342875, 244572, 433001, 400238, 211826, 211832, 392061, 351102, 252801, 260993, 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, 261109, 261112, 244728, 383999, 261130, 261148, 359452, 211999, 261155, 261160, 261166, 359471, 375868, 343132, 384099, 384102, 384108, 367724, 187503, 343155, 384115, 212095, 351366, 384136, 384140, 384144, 351382, 384152, 384158, 384161, 351399, 384169, 367795, 244917, 384182, 367801, 384189, 384192, 351424, 343232, 367817, 244938, 384202, 253132, 384209, 146644, 351450, 384225, 359650, 343272, 351467, 359660, 384247, 351480, 384250, 351483, 351492, 384270, 359695, 261391, 253202, 261395, 384276, 384284, 245021, 384290, 253218, 245032, 171304, 384299, 351535, 245042, 326970, 384324, 212296, 212304, 367966, 343394, 367981, 343410, 155000, 327035, 245121, 245128, 253321, 155021, 384398, 245137, 245143, 245146, 245149, 245152, 245155, 155045, 245158, 114093, 327090, 343478, 359867, 384444, 327108, 327112, 384457, 359887, 359891, 368093, 155103, 343535, 343540, 368120, 409092, 253445, 359948, 359951, 245295, 359984, 343610, 400977, 400982, 179803, 155241, 155255, 155274, 368289, 245410, 425639, 425652, 425663, 155328, 245463, 155352, 155356, 155364, 245477, 155372, 245487, 212723, 409336, 155394, 155404, 245528, 155423, 360224, 155439, 204592, 155444, 155448, 417596, 384829, 360262, 155463, 155477, 376665, 155484, 261982, 425823, 155488, 376672, 155492, 327532, 261997, 376686, 262000, 262003, 425846, 262006, 147319, 262009, 327542, 262012, 155517, 155523, 155526, 360327, 376715, 155532, 262028, 262031, 262034, 262037, 262040, 262043, 155550, 253854, 262046, 262049, 262052, 327590, 155560, 155563, 155566, 327613, 393152, 393170, 155604, 155620, 253924, 155622, 253927, 327655, 360432, 393204, 360439, 253944, 393209, 155647 ]
c79ee5e0d94e94bda86bbefd7c6b3c478d99ab90
a0ea0fa071d76e426fd1042cdb828c098ad22128
/Teamwork/Views/Login/RKLoginViewController.swift
4d68ebab301866d973148771b258bfc697c2af1d
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
realm/realm-teamwork-MR
115191e9ac4a445a3bdcbc309d5f0382c80fadd5
c62ec2b95fa52802dd90bd82073e9a70f988d715
refs/heads/master
2023-06-13T00:15:34.643140
2017-09-15T07:27:13
2017-09-15T07:27:13
88,287,705
9
2
null
null
null
null
UTF-8
Swift
false
false
7,345
swift
//////////////////////////////////////////////////////////////////////////// // // Copyright 2016 Realm 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 RealmSwift import RealmLoginKit class RKLoginViewController: UIViewController { let loginToTabViewSegue = "loginToTabViewSegue" var token: NotificationToken! override func viewDidLoad() { super.viewDidLoad() self.view.backgroundColor = .darkGray // Do any additional setup after loading the view. self.setupErrorHandler() } override func viewDidAppear(_ animated: Bool) { if (SyncUser.current != nil) { // yup - we've got a stored session, so just go right to the UITabView setDefaultRealmConfigurationWithUser(user: SyncUser.current!) performSegue(withIdentifier: loginToTabViewSegue, sender: self) } else { // show the RealmLoginKit controller let loginViewController = LoginViewController(style: .lightOpaque) loginViewController.serverURL = TeamWorkConstants.syncHost // Set a closure that will be called on successful login loginViewController.loginSuccessfulHandler = { user in DispatchQueue.main.async { self.completeLogin(user: user) // connects the realm and looks up or creates a profile loginViewController.dismiss(animated: true, completion: nil) self.performSegue(withIdentifier: self.loginToTabViewSegue, sender: nil) } } present(loginViewController, animated: true, completion: nil) } } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } // MARK: - Navigation func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { if segue.identifier == loginToTabViewSegue { } } func completeLogin(user: SyncUser?) { //DispatchQueue.main.async { setDefaultRealmConfigurationWithUser(user: user!) // Next, see if our default Realm has a profile record for this user identity; make one if necessary, and update its presence time/date let rlm = try! Realm() let identity = (user!.identity)! var myPersonRecord = rlm.objects(Person.self).filter(NSPredicate(format: "id = %@", identity)).first try! rlm.write { if myPersonRecord == nil { print("\n\nCreating new user record for user id: \(identity)\n") myPersonRecord = rlm.create(Person.self, value: ["id": identity, "creationDate": Date()]) rlm.add(myPersonRecord!, update: true) } else { print("Found user record, details: \(String(describing: myPersonRecord))\n") } } // @TODO: As soon as permission_read API is available and only set it needed (and if we're an admin/manager) //if myPersonRecord!.role == .Manager || myPersonRecord!.role == .Admin { setupDefaultGlobalPermissions(user: user) //} // the CoreLocation shim will periodically get the users location, if they allowed the acces; // setting the identity property tells it which person record to update if CLManagerShim.sharedInstance.currentState != .running { let locationShim = CLManagerShim.sharedInstance if locationShim.identity == nil { locationShim.identity = identity } } //} } func setupDefaultGlobalPermissions(user: SyncUser?) { let managementRealm = try! user!.managementRealm() let theURL = TeamWorkConstants.commonRealmURL.absoluteString let permissionChange = SyncPermissionChange(realmURL: theURL, // The remote Realm URL on which to apply the changes userID: "*", // The user ID for which these permission changes should be applied mayRead: true, // Grant read access mayWrite: true, // Grant write access mayManage: false) // Grant management access token = managementRealm.objects(SyncPermissionChange.self).filter("id = %@", permissionChange.id).addNotificationBlock { notification in if case .update(let changes, _, _, _) = notification, let change = changes.first { // Object Server processed the permission change operation switch change.status { case .notProcessed: print("not processed.") case .success: print("succeeded.") // basically if you have privs on the sever, set privs in the app. // this isn't really idea, but until we have the new permission API it'll suffice self.setAdminPriv() case .error: print("Error.") } print("change notification: \(change.debugDescription)") } } try! managementRealm.write { print("Launching permission change request id: \(permissionChange.id)") managementRealm.add(permissionChange) } } // MARK: Admin Settinng func setAdminPriv() { let rlm = try! Realm() var myPersonRecord = rlm.objects(Person.self).filter(NSPredicate(format: "id = %@", SyncUser.current!.identity!)).first try! rlm.write { myPersonRecord?.role = .Manager rlm.add(myPersonRecord!, update: true) } } // MARK: Realm Connection Utils func configureDefaultRealm() -> Bool { if let user = SyncUser.current { setDefaultRealmConfigurationWithUser(user: user) return true } return false } func setDefaultRealmConfigurationWithUser(user: SyncUser) { Realm.Configuration.defaultConfiguration = TeamWorkConstants.commonRealmConfig } // MARK: Error Handlers func setupErrorHandler(){ SyncManager.shared.errorHandler = { error, session in let syncError = error as! SyncError switch syncError.code { case .clientResetError: if let (path, runClientResetNow) = syncError.clientResetInfo() { //closeRealmSafely() //saveBackupRealmPath(path) runClientResetNow() } default: break // Handle other errors } } } }
[ -1 ]
d84d0466dd28dca4c960b09607c00d9e5b78ece0
e06e66a1fe629674a2a64e284722efa692c52084
/dicegame/AppDelegate.swift
582adb22cab04645dec171d4912067b0b42c02ec
[]
no_license
Sambit650/iosDiceGame
44d8dea39d136263f34c59c617fda508797f7fc8
4d01113ee9ae6815b26a760719d8fceee24d2a8f
refs/heads/master
2020-05-09T15:13:57.602691
2019-04-13T20:41:43
2019-04-13T20:41:43
181,226,140
0
0
null
null
null
null
UTF-8
Swift
false
false
2,170
swift
// // AppDelegate.swift // dicegame // // Created by Sidhartha Das on 01/03/19. // Copyright © 2019 myOrg. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } func applicationWillResignActive(_ application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. } func applicationDidEnterBackground(_ application: UIApplication) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } func applicationWillEnterForeground(_ application: UIApplication) { // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. } func applicationDidBecomeActive(_ application: UIApplication) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } }
[ 229380, 229383, 229385, 278539, 294924, 229388, 278542, 327695, 229391, 278545, 229394, 278548, 229397, 229399, 229402, 352284, 229405, 278556, 278559, 229408, 294950, 229415, 229417, 327722, 237613, 229422, 360496, 229426, 237618, 229428, 311349, 286774, 286776, 319544, 286778, 204856, 229432, 352318, 286791, 237640, 286797, 278605, 311375, 163920, 237646, 196692, 319573, 311383, 278623, 278626, 319590, 311400, 278635, 303212, 278639, 131192, 278648, 237693, 303230, 327814, 303241, 131209, 417930, 303244, 311436, 319633, 286873, 286876, 311460, 311469, 32944, 327862, 286906, 327866, 180413, 286910, 131264, 286916, 295110, 286922, 286924, 286926, 319694, 286928, 131281, 278743, 278747, 295133, 155872, 319716, 237807, 303345, 286962, 131314, 229622, 327930, 278781, 278783, 278785, 237826, 319751, 278792, 286987, 319757, 311569, 286999, 319770, 287003, 287006, 287009, 287012, 287014, 287016, 287019, 311598, 287023, 262448, 311601, 295220, 287032, 155966, 319809, 319810, 278849, 319814, 311623, 319818, 311628, 229709, 319822, 287054, 278865, 229717, 196963, 196969, 139638, 213367, 106872, 319872, 311683, 319879, 311693, 65943, 319898, 311719, 278952, 139689, 278957, 311728, 278967, 180668, 311741, 278975, 319938, 278980, 98756, 278983, 319945, 278986, 319947, 278990, 278994, 311767, 279003, 279006, 188895, 172512, 287202, 279010, 279015, 172520, 319978, 279020, 172526, 311791, 279023, 172529, 279027, 319989, 172534, 180727, 164343, 279035, 311804, 287230, 279040, 303617, 287234, 279045, 172550, 303623, 172552, 320007, 287238, 279051, 172558, 279055, 303632, 279058, 303637, 279063, 279067, 172572, 279072, 172577, 295459, 172581, 295461, 279082, 311850, 279084, 172591, 172598, 279095, 172607, 172609, 172612, 377413, 172614, 172618, 303690, 33357, 287309, 303696, 279124, 172634, 262752, 172644, 311911, 189034, 295533, 172655, 172656, 352880, 295538, 189040, 172660, 287349, 189044, 189039, 287355, 287360, 295553, 172675, 295557, 311942, 303751, 287365, 352905, 311946, 287371, 279178, 311951, 287377, 172691, 287381, 311957, 221850, 287386, 230045, 172702, 287390, 303773, 172705, 287394, 172707, 303780, 164509, 287398, 205479, 287400, 279208, 172714, 295595, 279212, 189102, 172721, 287409, 66227, 303797, 189114, 287419, 303804, 328381, 287423, 328384, 172737, 279231, 287427, 312006, 107208, 172748, 287436, 107212, 172751, 287440, 295633, 172755, 303827, 279255, 172760, 287450, 303835, 279258, 189149, 303838, 213724, 312035, 279267, 295654, 279272, 230128, 312048, 312050, 230131, 205564, 303871, 230146, 328453, 295685, 230154, 33548, 312077, 295695, 295701, 230169, 369433, 295707, 328476, 295710, 230175, 295720, 303914, 279340, 205613, 279353, 230202, 312124, 328508, 222018, 295755, 377676, 148302, 287569, 303959, 230237, 279390, 230241, 279394, 303976, 336744, 303985, 303987, 328563, 279413, 303991, 303997, 295806, 295808, 295813, 304005, 320391, 304007, 304009, 213895, 304011, 230284, 304013, 295822, 189325, 213902, 189329, 295825, 304019, 189331, 279438, 58262, 304023, 304027, 279452, 410526, 279461, 279462, 304042, 213931, 230327, 304055, 287675, 230334, 304063, 238528, 304065, 213954, 189378, 156612, 295873, 213963, 197580, 312272, 304084, 304090, 320481, 304106, 320490, 312302, 328687, 320496, 304114, 295928, 320505, 312321, 295945, 230413, 197645, 295949, 320528, 140312, 295961, 238620, 197663, 304164, 304170, 304175, 238641, 312374, 238652, 238655, 230465, 238658, 336964, 132165, 296004, 205895, 320584, 238666, 296021, 402518, 336987, 230497, 296036, 296040, 361576, 205931, 296044, 164973, 205934, 279661, 312432, 279669, 337018, 189562, 279679, 304258, 279683, 222340, 205968, 296084, 238745, 304285, 238756, 205991, 222377, 165035, 337067, 238766, 165038, 230576, 238770, 304311, 230592, 312518, 279750, 230600, 230607, 148690, 320727, 279769, 304348, 279777, 304354, 296163, 320740, 279781, 304360, 320748, 279788, 279790, 304370, 296189, 320771, 312585, 296202, 296205, 230674, 320786, 230677, 296213, 230679, 320792, 230681, 296215, 214294, 304416, 230689, 173350, 312622, 296243, 312630, 222522, 296253, 222525, 296255, 312639, 230718, 296259, 378181, 296262, 230727, 238919, 296264, 320840, 296267, 296271, 222545, 230739, 312663, 222556, 337244, 230752, 312676, 230760, 173418, 148843, 410987, 230763, 230768, 296305, 312692, 230773, 304505, 304506, 181626, 279929, 181631, 148865, 312711, 312712, 296331, 288140, 288144, 230800, 304533, 288154, 337306, 288160, 173472, 288162, 288164, 279975, 304555, 370092, 279983, 173488, 288176, 279985, 312755, 296373, 312759, 337335, 288185, 279991, 222652, 312766, 173507, 296389, 222665, 230860, 312783, 288208, 230865, 288210, 370130, 222676, 288212, 288214, 280021, 239064, 329177, 288217, 288218, 280027, 288220, 239070, 288224, 280034, 288226, 280036, 288229, 280038, 288230, 288232, 370146, 288234, 320998, 288236, 288238, 288240, 288242, 296435, 288244, 288250, 296446, 321022, 402942, 148990, 296450, 206336, 230916, 230919, 214535, 230923, 304651, 304653, 370187, 402969, 230940, 222752, 108066, 296486, 296488, 157229, 239152, 230961, 157236, 288320, 288325, 124489, 280140, 280145, 288338, 280149, 288344, 280152, 239194, 280158, 403039, 370272, 181854, 239202, 370279, 312938, 280183, 280185, 280188, 280191, 116354, 280194, 280208, 280211, 288408, 280218, 280222, 419489, 190118, 321195, 296622, 321200, 337585, 296626, 296634, 296637, 419522, 280260, 419525, 206536, 280264, 206539, 206541, 206543, 313044, 280276, 321239, 280283, 313052, 18140, 288478, 313055, 321252, 313066, 288494, 280302, 280304, 313073, 321266, 419570, 288499, 288502, 280314, 288510, 124671, 67330, 280324, 198405, 280331, 198416, 280337, 296723, 116503, 321304, 329498, 296731, 321311, 313121, 313123, 304932, 321316, 280363, 141101, 165678, 280375, 321336, 296767, 288576, 345921, 337732, 280388, 304968, 280393, 280402, 173907, 313171, 313176, 42842, 280419, 321381, 296809, 296812, 313201, 1920, 255873, 305028, 280454, 247688, 280464, 124817, 280468, 239510, 280473, 124827, 214940, 247709, 214944, 280487, 313258, 321458, 296883, 124853, 214966, 296890, 10170, 288700, 296894, 190403, 296900, 280515, 337862, 165831, 280521, 231379, 296921, 354265, 354270, 239586, 313320, 354281, 231404, 124913, 165876, 321528, 239612, 313340, 288764, 239617, 313347, 288773, 313358, 305176, 321560, 313371, 354338, 305191, 223273, 313386, 354348, 124978, 215090, 124980, 288824, 288826, 321595, 378941, 313406, 288831, 288836, 67654, 280651, 354382, 288848, 280658, 215123, 354390, 288855, 288859, 280669, 313438, 149599, 280671, 149601, 321634, 149603, 223327, 329830, 280681, 313451, 223341, 280687, 149618, 215154, 313458, 280691, 313464, 329850, 321659, 280702, 288895, 321670, 215175, 141446, 288909, 141455, 275606, 141459, 280725, 313498, 100520, 288936, 280747, 288940, 288947, 280755, 321717, 280759, 280764, 280769, 280771, 280774, 280776, 313548, 321740, 280783, 280786, 280788, 313557, 280793, 280796, 280798, 338147, 280804, 280807, 157930, 280811, 280817, 125171, 280819, 157940, 182517, 280823, 280825, 280827, 280830, 280831, 280833, 125187, 280835, 125191, 125207, 125209, 321817, 125218, 321842, 223539, 125239, 280888, 280891, 289087, 280897, 280900, 305480, 239944, 280906, 239947, 305485, 305489, 379218, 280919, 248153, 215387, 354653, 313700, 313705, 280937, 190832, 280946, 223606, 313720, 280956, 280959, 313731, 199051, 240011, 289166, 240017, 297363, 190868, 240021, 297365, 297368, 297372, 141725, 297377, 289186, 297391, 289201, 240052, 289207, 289210, 305594, 281024, 289218, 289221, 289227, 436684, 281045, 281047, 166378, 305647, 281075, 174580, 240124, 281084, 305662, 305664, 240129, 305666, 305668, 223749, 330244, 240132, 223752, 150025, 338440, 281095, 223757, 281102, 223763, 223765, 281113, 322074, 281116, 281121, 182819, 281127, 281135, 150066, 158262, 158266, 289342, 281154, 322115, 158283, 281163, 281179, 338528, 338532, 281190, 199273, 281196, 19053, 158317, 313973, 297594, 281210, 158347, 264845, 182926, 133776, 182929, 314003, 117398, 314007, 289436, 174754, 330404, 289448, 133801, 174764, 314029, 314033, 240309, 133817, 314045, 314047, 314051, 199364, 297671, 158409, 289493, 363234, 289513, 289522, 289525, 289532, 322303, 289537, 322310, 264969, 322314, 322318, 281361, 281372, 322341, 215850, 281388, 289593, 281401, 289601, 281410, 281413, 281414, 240458, 281420, 240468, 281430, 322393, 297818, 281435, 281438, 281442, 174955, 224110, 207733, 207737, 158596, 183172, 338823, 322440, 314249, 240519, 183184, 142226, 289687, 240535, 224151, 297883, 289694, 289696, 289700, 289712, 281529, 289724, 52163, 183260, 420829, 281567, 289762, 322534, 297961, 183277, 322550, 134142, 322563, 314372, 330764, 175134, 322599, 322610, 314421, 281654, 314427, 314433, 207937, 314441, 207949, 322642, 314456, 281691, 314461, 281702, 281704, 314474, 281708, 281711, 289912, 248995, 306341, 306344, 306347, 322734, 306354, 142531, 199877, 289991, 306377, 289997, 249045, 363742, 363745, 298216, 330988, 126190, 216303, 322801, 388350, 257302, 363802, 199976, 199978, 314671, 298292, 298294, 257334, 216376, 380226, 298306, 224584, 224587, 224594, 216404, 306517, 150870, 314714, 224603, 159068, 314718, 265568, 314723, 281960, 150890, 306539, 314732, 314736, 290161, 216436, 306549, 298358, 314743, 306552, 290171, 314747, 306555, 298365, 290174, 224641, 281987, 298372, 314756, 281990, 224647, 265604, 298377, 314763, 142733, 298381, 314768, 224657, 306581, 314773, 314779, 314785, 314793, 282025, 282027, 241068, 241070, 241072, 282034, 241077, 150966, 298424, 306618, 282044, 323015, 306635, 306640, 290263, 290270, 290275, 339431, 282089, 191985, 282098, 290291, 282101, 241142, 191992, 290298, 151036, 290302, 282111, 290305, 175621, 306694, 192008, 323084, 257550, 282127, 290321, 282130, 323090, 290325, 282133, 241175, 290328, 282137, 290332, 241181, 282142, 282144, 290344, 306731, 290349, 290351, 290356, 28219, 282186, 224849, 282195, 282199, 282201, 306778, 159324, 159330, 314979, 298598, 323176, 224875, 241260, 323181, 257658, 315016, 282249, 290445, 282255, 282261, 175770, 298651, 282269, 323229, 298655, 323231, 61092, 282277, 306856, 196133, 282295, 323260, 282300, 323266, 282310, 323273, 282319, 306897, 241362, 306904, 282328, 298714, 52959, 216801, 282337, 241380, 216806, 323304, 282345, 12011, 282356, 323318, 282364, 282367, 306945, 241412, 323333, 282376, 216842, 323345, 282388, 323349, 282392, 184090, 315167, 315169, 282402, 315174, 323367, 241448, 315176, 241450, 282410, 306988, 306991, 315184, 323376, 315190, 241464, 159545, 282425, 298811, 118593, 307009, 413506, 307012, 241475, 298822, 148946, 315211, 282446, 307027, 315221, 323414, 315223, 241496, 241498, 307035, 307040, 110433, 282465, 241509, 110438, 298860, 110445, 282478, 315249, 282481, 110450, 315251, 315253, 315255, 339838, 315267, 282499, 315269, 241544, 282505, 241546, 241548, 298896, 298898, 282514, 241556, 298901, 44948, 241560, 282520, 241563, 241565, 241567, 241569, 282531, 241574, 282537, 298922, 36779, 241581, 282542, 241583, 323504, 241586, 290739, 241588, 282547, 241590, 241592, 241598, 290751, 241600, 241605, 151495, 241610, 298975, 241632, 298984, 241640, 241643, 298988, 241646, 241649, 241652, 323574, 290807, 299003, 241661, 299006, 282623, 315396, 241669, 315397, 282632, 282639, 290835, 282645, 241693, 282654, 241701, 102438, 217127, 282669, 323630, 282681, 290877, 282687, 159811, 315463, 315466, 192589, 307278, 192596, 176213, 307287, 307290, 217179, 315482, 192605, 315483, 233567, 299105, 200801, 217188, 299109, 307303, 315495, 356457, 45163, 307307, 315502, 192624, 307314, 323700, 299126, 233591, 299136, 307329, 307338, 233613, 241813, 307352, 299164, 299167, 315552, 184479, 184481, 315557, 184486, 307370, 307372, 184492, 307374, 307376, 299185, 323763, 184503, 176311, 307385, 307386, 258235, 307388, 176316, 307390, 299200, 184512, 307394, 299204, 307396, 184518, 307399, 323784, 233679, 307409, 307411, 176343, 299225, 233701, 307432, 184572, 282881, 184579, 282893, 291089, 282906, 291104, 233766, 295583, 176435, 307508, 315701, 332086, 307510, 307512, 168245, 307515, 307518, 282942, 282947, 323917, 282957, 110926, 233808, 323921, 315733, 323926, 233815, 315739, 323932, 299357, 242018, 242024, 299373, 315757, 250231, 242043, 315771, 299388, 299391, 291202, 299398, 242057, 291212, 299405, 291222, 315801, 291226, 242075, 283033, 61855, 291231, 283042, 291238, 291241, 127403, 127405, 291247, 299440, 127407, 299444, 127413, 291254, 283062, 127417, 291260, 127421, 127424, 299457, 127429, 127431, 127434, 315856, 176592, 315860, 176597, 283095, 127447, 299481, 176605, 242143, 127457, 291299, 340454, 127463, 242152, 291305, 127466, 176620, 127469, 127474, 291314, 291317, 127480, 135672, 291323, 233979, 127485, 291330, 127494, 283142, 127497, 233994, 135689, 127500, 291341, 233998, 127506, 234003, 234006, 127511, 152087, 283161, 242202, 234010, 135707, 135710, 242206, 242208, 291361, 242220, 291378, 152118, 234038, 234041, 315961, 70213, 111193, 242275, 299620, 242279, 168562, 184952, 135805, 135808, 291456, 373383, 299655, 135820, 316051, 225941, 316054, 299672, 135834, 373404, 299677, 225948, 135839, 299680, 225954, 299684, 135844, 242343, 209576, 242345, 373421, 135870, 135873, 135876, 135879, 299720, 299723, 299726, 225998, 226002, 119509, 226005, 226008, 299740, 242396, 201444, 299750, 283368, 234219, 283372, 185074, 226037, 283382, 316151, 234231, 234236, 226045, 242431, 234239, 209665, 234242, 299778, 242436, 234246, 226056, 291593, 234248, 242443, 234252, 242445, 234254, 291601, 234258, 242450, 242452, 234261, 348950, 201496, 234264, 234266, 234269, 283421, 234272, 234274, 152355, 299814, 234278, 283432, 234281, 234284, 234287, 283440, 185138, 242483, 234292, 234296, 234298, 160572, 283452, 234302, 234307, 242499, 234309, 316233, 234313, 316235, 234316, 283468, 234319, 242511, 234321, 234324, 185173, 201557, 234329, 234333, 308063, 234336, 242530, 349027, 234338, 234341, 234344, 234347, 177004, 234350, 324464, 234353, 152435, 177011, 234356, 234358, 234362, 226171, 234364, 291711, 234368, 291714, 234370, 291716, 234373, 316294, 226182, 234375, 308105, 226185, 234379, 201603, 324490, 234384, 234388, 234390, 226200, 234393, 209818, 308123, 234396, 324504, 324508, 234398, 291742, 234401, 291747, 291748, 234405, 291750, 324518, 324520, 234407, 324522, 234410, 291756, 291754, 226220, 324527, 234414, 234417, 201650, 324531, 291760, 234422, 226230, 324536, 275384, 234428, 291773, 242623, 324544, 234431, 234434, 324546, 324548, 234437, 226239, 226245, 234439, 234443, 291788, 234446, 193486, 193488, 234449, 275406, 234452, 234455, 234459, 234461, 234464, 234467, 234470, 168935, 5096, 324585, 234475, 234478, 316400, 234481, 316403, 234484, 234485, 234487, 324599, 234490, 234493, 316416, 234496, 234501, 275462, 308231, 234504, 234507, 234510, 234515, 300054, 316439, 234520, 234519, 234523, 234526, 234528, 300066, 234532, 300069, 234535, 234537, 234540, 234543, 234546, 275508, 300085, 234549, 300088, 234553, 234556, 234558, 316479, 234561, 316483, 160835, 234563, 308291, 234568, 234570, 316491, 234572, 300108, 234574, 300115, 234580, 234581, 234585, 275545, 242777, 234590, 234593, 234595, 234597, 300133, 234601, 300139, 234605, 160879, 234607, 275569, 234610, 316530, 300148, 234614, 398455, 144506, 234618, 234620, 275579, 234623, 226433, 234627, 275588, 234629, 242822, 234634, 234636, 177293, 234640, 275602, 234643, 308373, 324757, 234647, 226453, 234648, 234650, 308379, 275608, 300189, 324766, 119967, 234653, 324768, 283805, 234657, 242852, 300197, 234661, 283813, 234664, 275626, 234667, 316596, 308414, 234687, 300223, 300226, 308418, 234692, 300229, 308420, 308422, 283844, 300234, 283850, 300238, 300241, 316625, 300243, 300245, 316630, 300248, 300253, 300256, 300258, 300260, 234726, 300263, 300265, 300267, 161003, 300270, 300272, 120053, 300278, 275703, 316663, 300284, 275710, 300287, 292097, 300289, 161027, 300292, 300294, 275719, 234760, 177419, 300299, 242957, 300301, 349451, 177424, 275725, 283917, 349464, 415009, 283939, 259367, 292143, 283951, 300344, 226617, 243003, 283963, 226628, 300357, 283973, 177482, 283983, 316758, 357722, 316766, 316768, 292192, 218464, 292197, 316774, 243046, 218473, 284010, 136562, 324978, 333178, 275834, 275836, 275840, 316803, 316806, 226696, 316811, 226699, 316814, 226703, 300433, 234899, 300436, 226709, 357783, 316824, 316826, 300448, 144807, 144810, 144812, 284076, 144814, 227426, 144820, 374196, 284084, 292279, 284087, 144826, 144828, 144830, 144832, 144835, 144837, 38342, 144839, 144841, 144844, 144847, 144852, 144855, 103899, 300507, 333280, 226787, 218597, 292329, 300523, 259565, 300527, 308720, 259567, 292338, 226802, 316917, 292343, 308727, 300537, 316933, 316947, 308757, 308762, 316959, 284191, 284194, 284196, 235045, 284199, 284204, 284206, 284209, 284211, 194101, 284213, 316983, 194103, 284215, 308790, 284218, 226877, 292414, 284223, 284226, 284228, 243268, 292421, 284231, 226886, 128584, 284234, 366155, 317004, 276043, 284238, 226895, 284241, 194130, 284243, 300628, 284245, 292433, 284247, 317015, 235097, 243290, 284249, 276052, 276053, 300638, 284251, 284253, 284255, 284258, 243293, 292452, 292454, 284263, 177766, 284265, 292458, 284267, 292461, 284272, 284274, 284278, 292470, 276086, 292473, 284283, 276093, 284286, 276095, 284288, 292479, 284290, 325250, 284292, 292485, 276098, 292481, 284297, 317066, 284299, 317068, 284301, 276109, 284303, 284306, 276114, 284308, 284312, 284314, 284316, 276127, 284320, 284322, 284327, 284329, 317098, 284331, 276137, 284333, 284335, 276144, 284337, 284339, 300726, 284343, 284346, 284350, 358080, 276160, 284354, 358083, 284358, 276166, 358089, 284362, 276170, 284365, 276175, 284368, 276177, 284370, 358098, 284372, 317138, 284377, 284379, 284381, 284384, 358114, 284386, 358116, 276197, 317158, 358119, 284392, 325353, 358122, 284394, 284397, 358126, 284399, 358128, 276206, 358133, 358135, 276216, 358138, 300795, 358140, 284413, 358142, 358146, 317187, 284418, 317189, 317191, 284428, 300816, 300819, 317207, 284440, 300828, 300830, 276255, 300832, 325408, 300834, 317221, 227109, 358183, 186151, 276268, 300845, 243504, 300850, 284469, 276280, 325436, 358206, 276291, 366406, 276295, 300872, 292681, 153417, 358224, 284499, 276308, 284502, 317271, 178006, 276315, 292700, 317279, 284511, 227175, 292715, 300912, 292721, 284529, 300915, 284533, 292729, 317306, 284540, 292734, 325512, 169868, 276365, 317332, 358292, 284564, 399252, 284566, 350106, 284572, 276386, 284579, 276388, 358312, 317353, 284585, 276395, 292776, 292784, 276402, 358326, 161718, 358330, 276411, 276418, 276425, 301009, 301011, 301013, 292823, 358360, 301017, 301015, 292828, 276446, 153568, 276448, 276452, 292839, 276455, 350186, 292843, 276460, 292845, 178161, 227314, 276466, 325624, 350200, 276472, 317435, 276476, 276479, 350210, 276482, 178181, 317446, 276485, 350218, 276490, 292876, 350222, 317456, 276496, 317458, 178195, 243733, 243740, 317468, 317472, 325666, 243751, 292904, 178224, 276528, 243762, 309298, 325685, 325689, 235579, 325692, 235581, 178238, 276539, 276544, 243779, 325700, 284739, 292934, 243785, 276553, 350293, 350295, 309337, 227418, 194649, 350302, 194654, 350304, 178273, 309346, 227423, 194660, 350308, 309350, 309348, 292968, 309352, 309354, 301163, 350313, 350316, 227430, 301167, 276583, 350321, 276590, 284786, 276595, 350325, 252022, 227440, 350328, 292985, 301178, 350332, 292989, 301185, 292993, 350339, 317570, 317573, 350342, 350345, 350349, 301199, 317584, 325777, 350354, 350357, 350359, 350362, 350366, 276638, 153765, 284837, 350375, 350379, 350381, 350383, 129200, 350385, 350387, 350389, 350395, 350397, 350399, 227520, 350402, 227522, 301252, 350406, 227529, 301258, 309450, 276685, 309455, 276689, 309462, 301272, 276699, 194780, 309468, 309471, 301283, 317672, 317674, 325867, 243948, 194801, 227571, 309491, 309494, 243960, 227583, 276735, 227587, 276739, 211204, 276742, 227596, 325910, 309530, 342298, 211232, 317729, 276775, 211241, 325937, 325943, 211260, 260421, 276809, 285002, 276811, 235853, 276816, 235858, 276829, 276833, 391523, 276836, 293227, 276843, 293232, 276848, 186744, 211324, 227709, 285061, 366983, 317833, 178572, 285070, 285077, 178583, 227738, 317853, 276896, 317858, 342434, 285093, 317864, 285098, 276907, 235955, 276917, 293304, 293307, 293314, 309707, 293325, 129486, 317910, 293336, 235996, 317917, 293343, 358880, 276961, 293346, 227810, 276964, 293352, 236013, 293364, 301562, 293370, 317951, 309764, 301575, 121352, 293387, 236043, 342541, 317963, 113167, 55822, 309779, 317971, 309781, 277011, 55837, 227877, 227879, 293417, 227882, 309804, 293421, 105007, 236082, 285236, 23094, 277054, 244288, 219714, 129603, 301636, 318020, 301639, 301643, 285265, 399955, 309844, 277080, 309849, 285277, 285282, 326244, 318055, 277100, 309871, 121458, 277106, 170618, 170619, 309885, 309888, 277122, 227975, 277128, 285320, 301706, 318092, 326285, 334476, 318094, 277136, 277139, 227992, 334488, 318108, 285340, 318110, 227998, 137889, 383658, 285357, 318128, 277170, 293555, 318132, 342707, 154292, 277173, 285368, 277177, 277181, 318144, 277187, 277191, 277194, 277196, 277201, 342745, 137946, 342747, 113378, 203491, 228069, 277223, 342760, 285417, 56041, 56043, 56045, 277232, 228081, 56059, 310015, 285441, 310020, 285448, 310029, 228113, 285459, 277273, 293659, 326430, 228128, 285474, 293666, 228135, 318248, 277291, 318253, 293677, 285489, 301876, 293685, 285494, 301880, 285499, 301884, 293696, 310080, 277317, 277322, 277329, 162643, 310100, 301911, 301913, 277337, 301921, 400236, 236397, 162671, 326514, 310134, 236408, 15224, 277368, 416639, 416640, 113538, 310147, 416648, 39817, 187274, 277385, 301972, 424853, 277405, 277411, 310179, 293798, 293802, 236460, 277426, 293811, 276579, 293817, 293820, 203715, 326603, 342994, 276586, 293849, 293861, 228327, 228328, 318442, 228330, 228332, 326638, 277486, 351217, 318450, 293876, 293877, 285686, 302073, 121850, 293882, 302075, 285690, 244731, 293887, 277504, 277507, 277511, 293899, 277519, 293908, 302105, 293917, 293939, 318516, 277561, 277564, 310336, 7232, 293956, 277573, 228422, 293960, 310344, 277577, 277583, 203857, 293971, 310355, 310359, 236632, 277594, 138332, 277598, 203872, 277601, 285792, 310374, 203879, 310376, 228460, 318573, 203886, 187509, 285815, 367737, 285817, 302205, 285821, 392326, 285831, 253064, 294026, 302218, 285835, 162964, 384148, 187542, 302231, 285849, 302233, 285852, 302237, 285854, 285856, 302241, 285862, 277671, 302248, 64682, 277678, 294063, 294065, 302258, 277687, 294072, 318651, 294076, 277695, 318657, 244930, 302275, 130244, 302277, 228550, 302282, 310476, 302285, 302288, 310481, 302290, 203987, 302292, 302294, 310486, 302296, 384222, 310498, 285927, 318698, 302315, 228592, 294132, 138485, 228601, 204026, 228606, 204031, 64768, 310531, 138505, 228617, 318742, 204067, 277798, 130345, 277801, 113964, 285997, 384302, 285999, 277804, 113969, 277807, 277811, 318773, 318776, 277816, 286010, 277819, 294204, 417086, 277822, 286016, 302403, 294211, 384328, 277832, 277836, 294221, 146765, 294223, 326991, 277839, 277842, 277847, 277850, 179547, 277853, 146784, 277857, 302436, 277860, 294246, 327015, 310632, 327017, 351594, 277864, 277869, 277872, 351607, 310648, 277880, 310651, 277884, 277888, 310657, 351619, 294276, 310659, 327046, 277892, 253320, 310665, 318858, 277894, 277898, 277903, 310672, 351633, 277905, 277908, 277917, 310689, 277921, 130468, 228776, 277928, 277932, 310703, 277937, 310710, 130486, 310712, 277944, 310715, 277947, 302526, 228799, 277950, 277953, 302534, 310727, 245191, 64966, 277959, 277963, 302541, 277966, 302543, 310737, 277971, 228825, 163290, 277978, 310749, 277981, 277984, 310755, 277989, 277991, 187880, 277995, 310764, 286188, 278000, 228851, 310772, 278003, 278006, 40440, 212472, 278009, 40443, 286203, 310780, 40448, 228864, 286214, 228871, 302603, 302614, 302617, 286233, 302621, 286240, 146977, 187936, 187939, 40484, 294435, 40486, 286246, 294440, 40488, 294439, 294443, 40491, 294445, 245288, 310831, 286248, 40499, 40502, 212538, 40507, 40511, 40513, 228933, 327240, 40521, 286283, 40525, 40527, 212560, 400976, 228944, 40533, 147032, 40537, 40539, 40541, 278109, 40544, 40548, 40550, 40552, 286312, 40554, 286313, 310892, 40557, 40560, 188022, 122488, 294521, 343679, 294537, 310925, 286354, 278163, 302740, 122517, 278168, 179870, 327333, 229030, 212648, 302764, 278188, 278192, 319153, 278196, 319163, 302781, 319171, 302789, 294599, 278216, 294601, 302793, 343757, 212690, 319187, 286420, 278227, 229076, 286425, 319194, 278235, 229086, 278238, 286432, 294625, 294634, 302838, 319226, 286460, 278274, 302852, 278277, 302854, 294664, 311048, 352008, 319243, 311053, 302862, 319251, 294682, 278306, 188199, 294701, 319280, 278320, 319290, 229192, 302925, 188247, 188252, 237409, 229233, 294776, 360317, 294785, 327554, 360322, 40840, 40851, 294803, 188312, 294811, 237470, 319390, 40865, 319394, 294817, 294821, 311209, 180142, 343983, 294831, 188340, 40886, 319419, 294844, 294847, 237508, 393177, 294876, 294879, 294883, 393190, 294890, 311279, 278513, 237555, 311283, 278516, 278519, 237562 ]
970a4ec03740310294e417cd123e23857c5f6f70
53621543fdc0857a4ba66808ceef655c0703ee33
/Project7/Project7/Petition.swift
b65d9c4f709df0424c32f49da73cf679ab03ecff
[ "MIT" ]
permissive
nowo/100DaysOfSwift
3f8caab2fa4a5580ac66f66bab42d9f474971817
43e286a9cc74b8b23f4b84fd3464b0aa378b4132
refs/heads/main
2023-06-27T19:12:35.116738
2021-07-24T19:18:44
2021-07-24T19:18:44
377,454,304
1
0
null
null
null
null
UTF-8
Swift
false
false
198
swift
// // Petition.swift // Project7 // // Created by ecinar on 30.06.2021. // import Foundation struct Petition: Codable { var title: String var body: String var signatureCount: Int }
[ 350298 ]
d42b4df46f84e9e99f8aadf4611ef52c2e780eb0
3cbe832382cc12b190bb7325062b92640ffbe87c
/TicTacToe4/CaseView.swift
474200c0e10505dd169abe944ab9a821a4f5bd38
[]
no_license
migapple/TicTacToe4
6d729fd8e4726da460d3f767ceb964f6dca8cf32
08eb07b57ca300966fd19ace7146a9d9b34ce3ee
refs/heads/master
2022-10-22T18:03:30.905587
2020-06-17T07:54:01
2020-06-17T07:54:01
272,440,052
0
0
null
null
null
null
UTF-8
Swift
false
false
966
swift
// // CaseView.swift // TicTacToe4 // // Created by Michel Garlandat on 15/06/2020. // Copyright © 2020 Michel Garlandat. All rights reserved. // import SwiftUI // La représentation graphique finale est faite ici // en fonction du contenu de la case (.vide, .joueur, .ia) // Dictionnaire contenant les associations TypeCase-Couleur fileprivate let couleursCase:[TypeCase:Color] = [ .vide: Color.gray, .joueur: Color.blue, .ia: Color.red, .gagnant: Color.green ] /// Description /// Affichage d'une case du damier struct CaseView: View { var description: DescriptionCase var body: some View { Rectangle() .foregroundColor(couleursCase[description.contenu]) .frame(width: 80, height: 80) } } struct CaseView_Previews: PreviewProvider { static var previews: some View { CaseView(description: DescriptionCase(contenu:.vide, index: IndexCase(ligne: 0, colonne: 0))) } }
[ -1 ]
70241c474c052f06bc58a61065f4a0f02f85e539
b585a093ed30e08c9f78d3226c4d537dcf35bc26
/Signal/src/Jobs/SyncPushTokensJob.swift
08132ec80466382501f9f6179d40264aada92a67
[ "MIT", "GPL-3.0-only" ]
permissive
i-w-e-e-d/Secure-Signal
12b20cfd36e658f594cf0101a994b34c00c8d801
9d9d6ad3e95fc41c526cd0f4882996ff6af53bfe
refs/heads/master
2021-07-09T17:28:52.097054
2019-04-09T22:27:01
2019-04-09T22:27:01
180,458,917
1
0
MIT
2020-08-08T15:11:53
2019-04-09T22:29:01
Objective-C
UTF-8
Swift
false
false
4,127
swift
// // Copyright (c) 2019 Open Whisper Systems. All rights reserved. // import PromiseKit import SignalServiceKit @objc(OWSSyncPushTokensJob) class SyncPushTokensJob: NSObject { @objc public static let PushTokensDidChange = Notification.Name("PushTokensDidChange") // MARK: Dependencies let accountManager: AccountManager let preferences: OWSPreferences var pushRegistrationManager: PushRegistrationManager { return PushRegistrationManager.shared } @objc var uploadOnlyIfStale = true @objc required init(accountManager: AccountManager, preferences: OWSPreferences) { self.accountManager = accountManager self.preferences = preferences } class func run(accountManager: AccountManager, preferences: OWSPreferences) -> Promise<Void> { let job = self.init(accountManager: accountManager, preferences: preferences) return job.run() } func run() -> Promise<Void> { Logger.info("Starting.") let runPromise = firstly { return self.pushRegistrationManager.requestPushTokens() }.then { (pushToken: String, voipToken: String) -> Promise<Void> in Logger.info("finished: requesting push tokens") var shouldUploadTokens = false if self.preferences.getPushToken() != pushToken || self.preferences.getVoipToken() != voipToken { Logger.debug("Push tokens changed.") shouldUploadTokens = true } else if !self.uploadOnlyIfStale { Logger.debug("Forced uploading, even though tokens didn't change.") shouldUploadTokens = true } if AppVersion.sharedInstance().lastAppVersion != AppVersion.sharedInstance().currentAppVersion { Logger.info("Uploading due to fresh install or app upgrade.") shouldUploadTokens = true } guard shouldUploadTokens else { Logger.info("No reason to upload pushToken: \(redact(pushToken)), voipToken: \(redact(voipToken))") return Promise.value(()) } Logger.warn("uploading tokens to account servers. pushToken: \(redact(pushToken)), voipToken: \(redact(voipToken))") return firstly { self.accountManager.updatePushTokens(pushToken: pushToken, voipToken: voipToken) }.done { _ in self.recordPushTokensLocally(pushToken: pushToken, voipToken: voipToken) } }.done { Logger.info("completed successfully.") } runPromise.retainUntilComplete() return runPromise } // MARK: - objc wrappers, since objc can't use swift parameterized types @objc class func run(accountManager: AccountManager, preferences: OWSPreferences) -> AnyPromise { let promise: Promise<Void> = self.run(accountManager: accountManager, preferences: preferences) return AnyPromise(promise) } @objc func run() -> AnyPromise { let promise: Promise<Void> = self.run() return AnyPromise(promise) } // MARK: private func recordPushTokensLocally(pushToken: String, voipToken: String) { Logger.warn("Recording push tokens locally. pushToken: \(redact(pushToken)), voipToken: \(redact(voipToken))") var didTokensChange = false if (pushToken != self.preferences.getPushToken()) { Logger.info("Recording new plain push token") self.preferences.setPushToken(pushToken) didTokensChange = true } if (voipToken != self.preferences.getVoipToken()) { Logger.info("Recording new voip token") self.preferences.setVoipToken(voipToken) didTokensChange = true } if (didTokensChange) { NotificationCenter.default.postNotificationNameAsync(SyncPushTokensJob.PushTokensDidChange, object: nil) } } } private func redact(_ string: String) -> String { return OWSIsDebugBuild() ? string : "[ READACTED \(string.prefix(2))...\(string.suffix(2)) ]" }
[ 219530, 371327, 340151, 399543, 207226, 352702, 251711 ]
ce633e34d69a1a6ae8b1c6c2d172ed7df472f945
375a6c5ee9e2da46765063d582cce46badd85fef
/SwiftUI/Project/iDine/iDine/ItemRow.swift
49fa7e9ab4f417213427ea713dd0c356e595fce3
[]
no_license
yashjivani1/IOS
b9d332d7789a0e3783b2544c3837ab4e88676f58
fafe90b8b7b6ed54e6aff981d076de948f0035db
refs/heads/master
2023-03-26T08:49:20.225197
2021-03-30T05:46:10
2021-03-30T05:46:10
345,301,070
1
1
null
null
null
null
UTF-8
Swift
false
false
1,429
swift
// // ItemRow.swift // iDine // // Created by haco on 01/10/20. // Copyright © 2020 haco. All rights reserved. // import SwiftUI struct ItemRow: View { static let colors: [String: Color] = ["D": .purple, "G": .black, "N": .red, "S": .blue, "V": .green] var item: MenuItem var body: some View { NavigationLink(destination: ItemDetails(item: item)){ HStack{ Image(item.thumbnailImage) .clipShape(Circle()) .overlay(Circle().stroke(Color.gray, lineWidth: 2)) VStack(alignment: .leading){ Text(item.name) .font(.headline) Text("$\(item.price)") } Spacer() ForEach(item.restrictions, id: \.self){ restriction in Text(restriction) .font(.caption) .fontWeight(.black) .padding(5) .background(Self.colors[restriction, default: .black]) .clipShape(Circle()) .foregroundColor(.white) } } } } } struct ItemRow_Previews: PreviewProvider { static var previews: some View { ItemRow(item: MenuItem.example) } }
[ 265461, 343245, 333414 ]
2636c41b5ffd8af5fd714f105c1918c498aee7d9
f79ba9d732a573f930a842e1bd3ef2245dcadbbd
/MedicConnect/Views/TableViewCells/SearchTagCell.swift
48537f57741866ab6bb9475e725d980c87678b5a
[]
no_license
romtam1116/MedicalConsult
6e204e6c0d3408fcafcfbcfddbd6134781db37e9
4a1b6aa6d2da41ba4968e073e98c441845527620
refs/heads/master
2020-03-17T21:33:13.014567
2018-05-18T15:05:08
2018-05-18T15:05:08
133,963,877
0
0
null
null
null
null
UTF-8
Swift
false
false
846
swift
// // SearchTagCell.swift // MedicalConsult // // Created by Daniel Yang on 2017-08-09. // Copyright © 2017 Loewen-Daniel. All rights reserved. // import UIKit class SearchTagCell: UITableViewCell { // Labels @IBOutlet var lblHashtag: UILabel! @IBOutlet var lblBroadcastCount: UILabel! override func awakeFromNib() { super.awakeFromNib() // Initialization code } override func setSelected(_ selected: Bool, animated: Bool) { super.setSelected(selected, animated: animated) // Configure the view for the selected state } // MARK: Set Data func setHashtagData(hashtag: String) { // Customize Hashtag Data self.lblHashtag.text = hashtag self.lblBroadcastCount.text = "128 broadcasts" } }
[ -1 ]
d1efa6b61c00bb230546c8fe0de45eac80784601
30930ba656497fca9c80d79f167f7bfa3f561696
/Api-TMDB/Models/Movie.swift
7dc787a1e25560cc9fa88157e4b3f8cb121dd250
[]
no_license
PePacheco/TMDb-iOS
9b38250e6a1f406862fab06fb2ac8f4cf93adb75
3b19610e03bfe08f419d265073e05fe034c44cbe
refs/heads/main
2023-07-01T06:19:08.030898
2021-07-09T16:51:47
2021-07-09T16:51:47
382,055,440
0
0
null
null
null
null
UTF-8
Swift
false
false
537
swift
// // Movie.swift // Api-TMDB // // Created by Pedro Gomes Rubbo Pacheco on 30/06/21. // import UIKit class Movie { let id: Int let title: String let description: String let rating: Int let image: UIImage let genres: [Int] init(id: Int, title: String, description: String, rating: Int, image: UIImage, genres: [Int]) { self.id = id self.title = title self.description = description self.rating = rating self.image = image self.genres = genres } }
[ -1 ]
d425e5b410a71acba2c2de07a37618c19d0f89ab
a5640c57265067c01f586fc47191a80deb848872
/RcloneOSX/Model/Process/RestoreTask.swift
277de2212e547c2578b532674ef15025df318f24
[ "MIT" ]
permissive
danigunawan/rcloneosx
b8016537a42ecc5e5cfb5a11a8ca453a27335d18
f9faba1e2c1fb0b6dd43b98dd26334225e756104
refs/heads/master
2021-01-09T11:52:07.541298
2020-02-16T18:13:08
2020-02-16T18:13:08
null
0
0
null
null
null
null
UTF-8
Swift
false
false
2,073
swift
// // RestoreTask.swift // rcloneosx // // Created by Thomas Evensen on 09.08.2018. // Copyright © 2018 Thomas Evensen. All rights reserved. // import Foundation final class RestoreTask: SetConfigurations { var arguments: [String]? init(index: Int, outputprocess: OutputProcess?, dryrun: Bool, tmprestore: Bool, updateprogress: UpdateProgress?) { weak var setprocessDelegate: SendProcessreference? setprocessDelegate = ViewControllerReference.shared.getvcref(viewcontroller: .vctabmain) as? ViewControllerMain if dryrun { if tmprestore { self.arguments = self.configurations!.arguments4tmprestore(index: index, argtype: .argdryRun) // We have to check if remote (offsite) catalog is empty or not let config = self.configurations!.getConfigurations()[index] if config.offsiteCatalog.isEmpty { self.arguments?.insert(ViewControllerReference.shared.restorePath ?? "", at: 2) } } else { // Do a restore from destination to source self.arguments = self.configurations!.arguments4restore(index: index, argtype: .argdryRun) } } else { if tmprestore { self.arguments = self.configurations!.arguments4tmprestore(index: index, argtype: .arg) let config = self.configurations!.getConfigurations()[index] if config.offsiteCatalog.isEmpty { self.arguments?.insert(ViewControllerReference.shared.restorePath ?? "", at: 2) } } else { self.arguments = self.configurations!.arguments4restore(index: index, argtype: .arg) } } guard arguments != nil else { return } let process = Rclone(arguments: self.arguments) process.setdelegate(object: updateprogress!) process.executeProcess(outputprocess: outputprocess) setprocessDelegate?.sendprocessreference(process: process.getProcess()!) } }
[ -1 ]
c8815c69a01c0dacf1e35631da1390eecc465121
32b7374dcebd9b2a0e32fd74036fc6120c87e005
/TestingApp/TestingApp/AppDelegate.swift
5fc4d0eed2de9f2007b155355188db8a5e942ce8
[]
no_license
NYCgirlLearnsToCode/iOS-App-Projects
5ed6e6be93ee79a3a7e2614427740d34d3fdabb8
18c91bccb12f988d0d2e221851976420c3855f29
refs/heads/master
2021-04-26T02:29:52.149609
2018-06-07T21:34:35
2018-06-07T21:34:35
107,695,460
0
0
null
null
null
null
UTF-8
Swift
false
false
2,164
swift
// // AppDelegate.swift // TestingApp // // Created by Lisa J on 4/24/18. // Copyright © 2018 Lisa J. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } func applicationWillResignActive(_ application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. } func applicationDidEnterBackground(_ application: UIApplication) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } func applicationWillEnterForeground(_ application: UIApplication) { // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. } func applicationDidBecomeActive(_ application: UIApplication) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } }
[ 229380, 229383, 229385, 278539, 294924, 229388, 278542, 229391, 327695, 278545, 229394, 278548, 229397, 229399, 229402, 352284, 229405, 278556, 278559, 229408, 278564, 294950, 229415, 229417, 327722, 237613, 229422, 360496, 229426, 237618, 229428, 311349, 286774, 286776, 319544, 286778, 204856, 229432, 352318, 286791, 237640, 286797, 278605, 311375, 163920, 237646, 196692, 319573, 311383, 278623, 278626, 319590, 311400, 278635, 303212, 278639, 131192, 278648, 237693, 303230, 327814, 303241, 131209, 417930, 303244, 311436, 319633, 286873, 286876, 311460, 311469, 32944, 327862, 286906, 327866, 180413, 286910, 131264, 286916, 286922, 286924, 286926, 319694, 286928, 131281, 278743, 278747, 295133, 155872, 319716, 237807, 303345, 286962, 303347, 131314, 229622, 327930, 278781, 278783, 278785, 237826, 319751, 278792, 286987, 319757, 311569, 286999, 319770, 287003, 287006, 287009, 287012, 287014, 287016, 287019, 311598, 287023, 262448, 311601, 295220, 287032, 155966, 319809, 319810, 278849, 319814, 311623, 319818, 311628, 229709, 319822, 287054, 278865, 229717, 196963, 196969, 139638, 213367, 106872, 319872, 311683, 319879, 311693, 65943, 319898, 311719, 278952, 139689, 278957, 311728, 278967, 180668, 311741, 278975, 319938, 278980, 98756, 278983, 319945, 278986, 319947, 278990, 278994, 311767, 279003, 279006, 188895, 172512, 287202, 279010, 279015, 172520, 319978, 279020, 172526, 311791, 279023, 172529, 279027, 319989, 172534, 180727, 164343, 279035, 311804, 287230, 279040, 303617, 287234, 279045, 172550, 303623, 172552, 320007, 287238, 279051, 172558, 279055, 303632, 279058, 303637, 279063, 279067, 172572, 279072, 172577, 295459, 172581, 295461, 279082, 311850, 279084, 172591, 172598, 279095, 172607, 172609, 172612, 377413, 172614, 213575, 172618, 303690, 33357, 287309, 303696, 279124, 172634, 262752, 254563, 172644, 311911, 189034, 295533, 172655, 172656, 352880, 295538, 189039, 172660, 287349, 189040, 189044, 287355, 287360, 295553, 172675, 295557, 311942, 303751, 287365, 352905, 311946, 279178, 287371, 311951, 287377, 172691, 287381, 311957, 221850, 287386, 230045, 172702, 287390, 303773, 172705, 287394, 172707, 303780, 164509, 287398, 205479, 279208, 287400, 172714, 295595, 279212, 189102, 172721, 287409, 66227, 303797, 189114, 287419, 303804, 328381, 287423, 328384, 172737, 279231, 287427, 312006, 107208, 172748, 287436, 107212, 172751, 287440, 295633, 172755, 303827, 279255, 172760, 287450, 303835, 279258, 189149, 303838, 213724, 312035, 279267, 295654, 279272, 230128, 312048, 312050, 230131, 189169, 205564, 303871, 230146, 328453, 295685, 230154, 33548, 312077, 295695, 295701, 230169, 369433, 295707, 328476, 295710, 230175, 295720, 303914, 279340, 205613, 279353, 230202, 312124, 328508, 222018, 295755, 377676, 148302, 287569, 303959, 230237, 279390, 230241, 279394, 303976, 336744, 303981, 303985, 303987, 328563, 279413, 303991, 303997, 295806, 295808, 295813, 304005, 320391, 304007, 213895, 304009, 304011, 230284, 304013, 295822, 279438, 189325, 189329, 295825, 304019, 189331, 213902, 58262, 304023, 304027, 279452, 234648, 410526, 279461, 279462, 304042, 213931, 230327, 304055, 287675, 197564, 230334, 304063, 238528, 304065, 213954, 189378, 156612, 295873, 213963, 197580, 312272, 304084, 304090, 320481, 304106, 320490, 312302, 328687, 320496, 304114, 295928, 320505, 312321, 295945, 230413, 295949, 197645, 320528, 140312, 295961, 238620, 197663, 304164, 304170, 304175, 238641, 312374, 238652, 238655, 230465, 238658, 336964, 132165, 296004, 205895, 320584, 238666, 296021, 402518, 336987, 230497, 296036, 296040, 361576, 205931, 296044, 279661, 205934, 164973, 312432, 279669, 337018, 189562, 279679, 304258, 279683, 222340, 66690, 205968, 296084, 238745, 304285, 238756, 205991, 222377, 165035, 337067, 238766, 165038, 230576, 238770, 304311, 230592, 312518, 279750, 230600, 230607, 148690, 320727, 279769, 304348, 279777, 304354, 296163, 320740, 279781, 304360, 320748, 279788, 279790, 304370, 296189, 320771, 312585, 296202, 296205, 230674, 320786, 230677, 296213, 296215, 320792, 230681, 230679, 214294, 304416, 230689, 173350, 312622, 296243, 312630, 222522, 296253, 222525, 296255, 312639, 230718, 296259, 378181, 296262, 230727, 238919, 296264, 320840, 296267, 296271, 222545, 230739, 312663, 222556, 337244, 230752, 312676, 230760, 173418, 148843, 410987, 230763, 230768, 296305, 312692, 230773, 304505, 304506, 181626, 279929, 181631, 148865, 312711, 312712, 296331, 288140, 288144, 230800, 304533, 337306, 288154, 288160, 173472, 288162, 288164, 279975, 304555, 370092, 279983, 173488, 288176, 279985, 312755, 296373, 312759, 337335, 288185, 279991, 222652, 312766, 173507, 296389, 222665, 230860, 312783, 288208, 230865, 288210, 370130, 288212, 222676, 288214, 280021, 239064, 329177, 288217, 280027, 288220, 288218, 239070, 288224, 280034, 288226, 280036, 288229, 280038, 288230, 288232, 370146, 288234, 320998, 288236, 288238, 288240, 288242, 296435, 288244, 288250, 296446, 321022, 402942, 148990, 296450, 206336, 230916, 230919, 214535, 230923, 304651, 304653, 370187, 402969, 230940, 222752, 108066, 296486, 296488, 157229, 230961, 157236, 288320, 288325, 124489, 280140, 280145, 288338, 280149, 288344, 280152, 239194, 280158, 403039, 370272, 181854, 239202, 370279, 312938, 280183, 280185, 280188, 280191, 116354, 280194, 280208, 280211, 288408, 280218, 280222, 419489, 190118, 321195, 296622, 321200, 337585, 296626, 296634, 296637, 419522, 313027, 280260, 419525, 206536, 280264, 206539, 206541, 206543, 263888, 313044, 280276, 321239, 280283, 313052, 18140, 288478, 313055, 419555, 321252, 313066, 288494, 280302, 280304, 313073, 321266, 419570, 288499, 288502, 280314, 288510, 124671, 67330, 280324, 198405, 288519, 280331, 198416, 280337, 296723, 116503, 321304, 329498, 296731, 321311, 313121, 313123, 304932, 321316, 280363, 141101, 165678, 280375, 321336, 296767, 288576, 345921, 280388, 337732, 304968, 280393, 280402, 173907, 313171, 313176, 42842, 280419, 321381, 296809, 296812, 313201, 1920, 255873, 305028, 280454, 247688, 280464, 124817, 280468, 239510, 280473, 124827, 214940, 247709, 214944, 280487, 313258, 321458, 296883, 124853, 214966, 296890, 10170, 288700, 296894, 190403, 296900, 280515, 337862, 165831, 280521, 231379, 296921, 354265, 354270, 239586, 313320, 354281, 231404, 124913, 165876, 321528, 239612, 313340, 288764, 239617, 313347, 288773, 313358, 305176, 321560, 313371, 354338, 305191, 223273, 313386, 354348, 124978, 215090, 124980, 288824, 288826, 321595, 378941, 313406, 288831, 288836, 67654, 280651, 354382, 288848, 280658, 215123, 354390, 288855, 288859, 280669, 313438, 149599, 280671, 149601, 321634, 149603, 223327, 329830, 280681, 313451, 223341, 280687, 149618, 215154, 313458, 280691, 313464, 329850, 321659, 280702, 288895, 321670, 215175, 141446, 288909, 141455, 141459, 280725, 313498, 100520, 288936, 280747, 288940, 288947, 280755, 321717, 280759, 280764, 280769, 280771, 280774, 280776, 313548, 321740, 280783, 280786, 280788, 313557, 280793, 280796, 280798, 338147, 280804, 280807, 157930, 280811, 280817, 125171, 157940, 280819, 182517, 280823, 280825, 280827, 280830, 280831, 280833, 125187, 280835, 125191, 125207, 125209, 321817, 125218, 321842, 223539, 125239, 280888, 280891, 289087, 280897, 280900, 305480, 239944, 280906, 239947, 305485, 305489, 379218, 280919, 248153, 215387, 354653, 313700, 313705, 280937, 190832, 280946, 223606, 313720, 280956, 239997, 280959, 313731, 199051, 240011, 289166, 240017, 297363, 190868, 240021, 297365, 297368, 297372, 141725, 297377, 289186, 297391, 289201, 240052, 289207, 289210, 305594, 281024, 289218, 289221, 289227, 436684, 281045, 281047, 215526, 166378, 305647, 281075, 174580, 240124, 281084, 305662, 305664, 240129, 305666, 305668, 223749, 330244, 281095, 223752, 150025, 338440, 240132, 223757, 281102, 223763, 223765, 281113, 322074, 281116, 281121, 182819, 281127, 281135, 150066, 158262, 158266, 289342, 281154, 322115, 158283, 281163, 281179, 338528, 338532, 281190, 199273, 281196, 19053, 158317, 313973, 297594, 281210, 158347, 264845, 182926, 133776, 182929, 314003, 117398, 314007, 289436, 174754, 330404, 289448, 133801, 174764, 314029, 314033, 240309, 133817, 314045, 314047, 314051, 199364, 297671, 158409, 256716, 289493, 363234, 289513, 289522, 289525, 289532, 322303, 289537, 322310, 264969, 322314, 322318, 281361, 281372, 322341, 215850, 281388, 289593, 281401, 289601, 281410, 281413, 281414, 240458, 281420, 240468, 281430, 322393, 297818, 281435, 281438, 281442, 174955, 224110, 207733, 207737, 158596, 183172, 338823, 322440, 314249, 240519, 183184, 289687, 240535, 224151, 297883, 289694, 289696, 289700, 289712, 281529, 289724, 52163, 183260, 420829, 281567, 289762, 322534, 297961, 183277, 281581, 322550, 134142, 322563, 314372, 330764, 175134, 322599, 322610, 314421, 281654, 314427, 314433, 207937, 314441, 207949, 322642, 314456, 281691, 314461, 281702, 281704, 314474, 281708, 281711, 289912, 248995, 306341, 306344, 306347, 322734, 306354, 142531, 199877, 289991, 306377, 289997, 249045, 363742, 363745, 298216, 330988, 126190, 216303, 322801, 388350, 257302, 363802, 199976, 199978, 314671, 298292, 298294, 257334, 216376, 380226, 298306, 224584, 224587, 224594, 216404, 306517, 150870, 314714, 224603, 159068, 314718, 265568, 314723, 281960, 150890, 306539, 314732, 314736, 290161, 216436, 306549, 298358, 314743, 306552, 290171, 314747, 306555, 298365, 290174, 224641, 281987, 298372, 314756, 281990, 224647, 265604, 298377, 314763, 142733, 298381, 314768, 224657, 306581, 314773, 314779, 314785, 314793, 282025, 282027, 241068, 241070, 241072, 282034, 241077, 150966, 298424, 306618, 282044, 323015, 306635, 306640, 290263, 290270, 290275, 339431, 282089, 191985, 282098, 290291, 282101, 241142, 191992, 290298, 151036, 290302, 282111, 290305, 175621, 306694, 192008, 323084, 257550, 282127, 290321, 282130, 323090, 290325, 282133, 241175, 290328, 282137, 290332, 241181, 282142, 282144, 290344, 306731, 290349, 290351, 290356, 28219, 282186, 224849, 282195, 282199, 282201, 306778, 159324, 159330, 314979, 298598, 323176, 224875, 241260, 323181, 257658, 315016, 282249, 290445, 282255, 282261, 175770, 298651, 282269, 323229, 298655, 323231, 61092, 282277, 306856, 282295, 323260, 282300, 323266, 282310, 323273, 282319, 306897, 241362, 306904, 282328, 298714, 52959, 216801, 282337, 241380, 216806, 323304, 282345, 12011, 282356, 323318, 282364, 282367, 306945, 241412, 323333, 282376, 216842, 323345, 282388, 323349, 282392, 184090, 315167, 315169, 282402, 315174, 323367, 241448, 315176, 241450, 282410, 306988, 306991, 315184, 323376, 315190, 241464, 159545, 282425, 298811, 118593, 307009, 413506, 307012, 241475, 298822, 148946, 315211, 282446, 307027, 315221, 323414, 315223, 241496, 241498, 307035, 307040, 110433, 282465, 241509, 110438, 298860, 110445, 282478, 315249, 110450, 315251, 282481, 315253, 315255, 339838, 315267, 282499, 315269, 241544, 282505, 241546, 241548, 298896, 298898, 282514, 241556, 298901, 44948, 241560, 282520, 241563, 241565, 241567, 241569, 282531, 241574, 282537, 298922, 36779, 241581, 282542, 241583, 323504, 241586, 282547, 241588, 290739, 241590, 241592, 241598, 290751, 241600, 241605, 151495, 241610, 298975, 241632, 298984, 241640, 241643, 298988, 241646, 241649, 241652, 323574, 290807, 299003, 241661, 299006, 282623, 315396, 241669, 315397, 282632, 282639, 290835, 282645, 241693, 282654, 241701, 102438, 217127, 282669, 323630, 282681, 290877, 282687, 159811, 315463, 315466, 192589, 307278, 192596, 176213, 307287, 307290, 217179, 315482, 192605, 315483, 233567, 299105, 200801, 217188, 299109, 307303, 315495, 356457, 45163, 307307, 315502, 192624, 307314, 323700, 299126, 233591, 299136, 307329, 315524, 307338, 233613, 241813, 307352, 299164, 241821, 299167, 315552, 184479, 184481, 315557, 184486, 307370, 307372, 184492, 307374, 307376, 299185, 323763, 184503, 176311, 299191, 307386, 258235, 307388, 307385, 307390, 176316, 299200, 184512, 307394, 299204, 307396, 184518, 307399, 323784, 233679, 307409, 307411, 176343, 299225, 233701, 307432, 184572, 282881, 184579, 282893, 323854, 291089, 282906, 291104, 233766, 295583, 176435, 307508, 315701, 332086, 307510, 307512, 168245, 307515, 307518, 282942, 282947, 323917, 110926, 282957, 233808, 323921, 315733, 323926, 233815, 276052, 315739, 323932, 299357, 242018, 242024, 299373, 315757, 250231, 242043, 315771, 299388, 299391, 291202, 299398, 242057, 291212, 299405, 291222, 315801, 283033, 242075, 291226, 194654, 61855, 291231, 283042, 291238, 291241, 127403, 127405, 291247, 299440, 127407, 299444, 127413, 283062, 291254, 127417, 291260, 283069, 127421, 127424, 299457, 127429, 127431, 127434, 315856, 176592, 315860, 176597, 283095, 127447, 299481, 176605, 242143, 127457, 291299, 340454, 127463, 242152, 291305, 127466, 176620, 127469, 127474, 291314, 291317, 127480, 135672, 291323, 233979, 127485, 291330, 283142, 127494, 127497, 233994, 135689, 127500, 291341, 233998, 127506, 234003, 234006, 127511, 152087, 283161, 242202, 234010, 135707, 135710, 242206, 242208, 291361, 242220, 291378, 152118, 234038, 234041, 315961, 70213, 242250, 111193, 242275, 299620, 242279, 168562, 184952, 135805, 135808, 291456, 373383, 299655, 135820, 316051, 225941, 316054, 299672, 135834, 373404, 299677, 225948, 135839, 299680, 225954, 299684, 135844, 242343, 209576, 242345, 373421, 135870, 135873, 135876, 135879, 299720, 299723, 299726, 225998, 226002, 119509, 226005, 226008, 299740, 242396, 201444, 299750, 283368, 234219, 283372, 185074, 226037, 283382, 316151, 234231, 234236, 226045, 242431, 234239, 209665, 234242, 299778, 242436, 226053, 234246, 226056, 234248, 291593, 242443, 234252, 242445, 234254, 291601, 234258, 242450, 242452, 234261, 348950, 201496, 234264, 234266, 234269, 283421, 234272, 234274, 152355, 299814, 234278, 283432, 234281, 234284, 234287, 283440, 185138, 242483, 234292, 234296, 234298, 160572, 283452, 234302, 234307, 242499, 234309, 316233, 234313, 316235, 234316, 283468, 234319, 242511, 234321, 234324, 185173, 201557, 234329, 234333, 308063, 234336, 242530, 349027, 234338, 234341, 234344, 234347, 177004, 234350, 324464, 234353, 152435, 177011, 234356, 234358, 234362, 226171, 234364, 291711, 234368, 291714, 234370, 291716, 234373, 316294, 201603, 226182, 308105, 234375, 226185, 234379, 324490, 234384, 234388, 234390, 324504, 234393, 209818, 308123, 324508, 234396, 226200, 234398, 291742, 234401, 291747, 291748, 234405, 291750, 234407, 324520, 324518, 324522, 234410, 291756, 291754, 226220, 324527, 291760, 234417, 201650, 324531, 234414, 234422, 226230, 324536, 275384, 234428, 291773, 242623, 324544, 234431, 234434, 324546, 324548, 234437, 226245, 234439, 226239, 234443, 291788, 234446, 275406, 193486, 234449, 316370, 193488, 234452, 234455, 234459, 234461, 234464, 234467, 234470, 168935, 5096, 324585, 234475, 234478, 316400, 234481, 316403, 234484, 234485, 234487, 324599, 234490, 234493, 316416, 234496, 234501, 275462, 308231, 234504, 234507, 234510, 234515, 300054, 316439, 234520, 234519, 234523, 234526, 234528, 300066, 234532, 300069, 234535, 234537, 234540, 144430, 234543, 234546, 275508, 300085, 234549, 300088, 234553, 234556, 234558, 316479, 234561, 316483, 160835, 234563, 308291, 234568, 234570, 316491, 234572, 300108, 234574, 300115, 234580, 234581, 242777, 234585, 275545, 234590, 234593, 234595, 234597, 300133, 234601, 300139, 234605, 160879, 234607, 275569, 234610, 316530, 300148, 234614, 398455, 144506, 234618, 234620, 275579, 234623, 226433, 234627, 275588, 234629, 242822, 234634, 234636, 177293, 234640, 275602, 234643, 308373, 226453, 234647, 275606, 275608, 234650, 308379, 324757, 300189, 324766, 119967, 234653, 324768, 283805, 234657, 242852, 300197, 234661, 283813, 234664, 177318, 275626, 234667, 316596, 308414, 234687, 300223, 300226, 308418, 234692, 300229, 308420, 308422, 283844, 226500, 300234, 283850, 300238, 300241, 316625, 300243, 300245, 316630, 300248, 300253, 300256, 300258, 300260, 234726, 300263, 300265, 300267, 161003, 300270, 300272, 120053, 300278, 275703, 316663, 300284, 275710, 300287, 292097, 300289, 161027, 300292, 300294, 275719, 234760, 177419, 300299, 242957, 300301, 283917, 177424, 349451, 275725, 349464, 415009, 283939, 259367, 292143, 283951, 300344, 226617, 243003, 283963, 226628, 300357, 283973, 177482, 283983, 316758, 357722, 316766, 316768, 292192, 218464, 292197, 316774, 243046, 218473, 284010, 136562, 324978, 275834, 333178, 275836, 275840, 316803, 316806, 226696, 316811, 226699, 316814, 226703, 300433, 234899, 300436, 226709, 357783, 316824, 316826, 144796, 300448, 144807, 144810, 144812, 284076, 144814, 227426, 144820, 374196, 284084, 292279, 284087, 144826, 144828, 144830, 144832, 144835, 144837, 38342, 144839, 144841, 144844, 144847, 144852, 144855, 103899, 300507, 333280, 226787, 218597, 292329, 300523, 259565, 300527, 308720, 259567, 292338, 226802, 316917, 292343, 308727, 300537, 316933, 316947, 308757, 308762, 284191, 316959, 284194, 284196, 235045, 284199, 284204, 284206, 284209, 284211, 194101, 284213, 316983, 194103, 284215, 308790, 284218, 226877, 292414, 284223, 284226, 284228, 292421, 226886, 284231, 128584, 243268, 284234, 366155, 317004, 276043, 284238, 226895, 284241, 194130, 284243, 300628, 284245, 292433, 284247, 317015, 235097, 243290, 276053, 284249, 284251, 300638, 284253, 284255, 243293, 284258, 292452, 292454, 284263, 177766, 284265, 292458, 284267, 292461, 284272, 284274, 284278, 292470, 276086, 292473, 284283, 276093, 284286, 276095, 284288, 292481, 284290, 325250, 284292, 292485, 292479, 276098, 284297, 317066, 284299, 317068, 284301, 276109, 284303, 284306, 276114, 284308, 284312, 284314, 284316, 276127, 284320, 284322, 284327, 284329, 317098, 284331, 276137, 284333, 284335, 276144, 284337, 284339, 300726, 284343, 284346, 284350, 358080, 276160, 284354, 358083, 284358, 276166, 358089, 284362, 276170, 284365, 276175, 284368, 276177, 284370, 358098, 284372, 317138, 284377, 276187, 284379, 284381, 284384, 358114, 284386, 358116, 276197, 317158, 358119, 284392, 325353, 358122, 284394, 284397, 358126, 284399, 358128, 276206, 358133, 358135, 276216, 358138, 300795, 358140, 284413, 358142, 358146, 317187, 284418, 317189, 317191, 284428, 300816, 300819, 317207, 284440, 300828, 300830, 276255, 300832, 325408, 300834, 317221, 227109, 358183, 186151, 276268, 300845, 243504, 300850, 284469, 276280, 325436, 358206, 276291, 366406, 276295, 300872, 292681, 153417, 358224, 284499, 276308, 284502, 317271, 178006, 276315, 292700, 317279, 284511, 227175, 292715, 300912, 292721, 284529, 300915, 284533, 292729, 317306, 284540, 292734, 325512, 169868, 276365, 317332, 358292, 284564, 399252, 284566, 350106, 284572, 276386, 284579, 276388, 358312, 317353, 284585, 276395, 292776, 292784, 276402, 358326, 161718, 358330, 276410, 276411, 276418, 276425, 301009, 301011, 301013, 292823, 358360, 301017, 301015, 292828, 276446, 153568, 276448, 276452, 292839, 276455, 350186, 292843, 276460, 276464, 178161, 227314, 276466, 325624, 350200, 276472, 317435, 276476, 276479, 276482, 350210, 276485, 317446, 178181, 276490, 350218, 292876, 350222, 317456, 276496, 317458, 178195, 243733, 243740, 317468, 317472, 325666, 243751, 292904, 276528, 178224, 243762, 309298, 325685, 325689, 235579, 325692, 235581, 178238, 276539, 276544, 243779, 325700, 284739, 292934, 243785, 276553, 350293, 350295, 309337, 194649, 227418, 350299, 350302, 227423, 350304, 178273, 309346, 194657, 194660, 350308, 309350, 309348, 292968, 309352, 309354, 301163, 350313, 350316, 227430, 301167, 276583, 350321, 276590, 284786, 276595, 350325, 252022, 227440, 350328, 292985, 301178, 350332, 292989, 301185, 292993, 350339, 317570, 317573, 350342, 350345, 350349, 301199, 317584, 325777, 350354, 350357, 350359, 350362, 350366, 276638, 284837, 153765, 350375, 350379, 350381, 350383, 129200, 350385, 350387, 350389, 350395, 350397, 350399, 227520, 350402, 227522, 301252, 350406, 227529, 301258, 309450, 276685, 309455, 276689, 309462, 301272, 276699, 194780, 309468, 309471, 301283, 317672, 317674, 325867, 243948, 194801, 309491, 227571, 309494, 243960, 276735, 227583, 227587, 276739, 211204, 276742, 227593, 227596, 325910, 309530, 342298, 211232, 317729, 276775, 211241, 325937, 325943, 211260, 260421, 276809, 285002, 276811, 235853, 276816, 235858, 276829, 276833, 391523, 276836, 293227, 276843, 293232, 276848, 186744, 211324, 227709, 285061, 366983, 317833, 178572, 285070, 285077, 178583, 227738, 317853, 276896, 317858, 342434, 285093, 317864, 285098, 276907, 235955, 276917, 293304, 293307, 293314, 309707, 293325, 129486, 317910, 293336, 235996, 317917, 293343, 358880, 276961, 227810, 293346, 276964, 293352, 236013, 293364, 301562, 293370, 317951, 309764, 301575, 121352, 293387, 236043, 342541, 317963, 113167, 55822, 309779, 317971, 309781, 277011, 55837, 227877, 227879, 293417, 227882, 309804, 293421, 105007, 236082, 285236, 23094, 277054, 244288, 219714, 129603, 301636, 318020, 301639, 301643, 277071, 285265, 399955, 309844, 277080, 309849, 285277, 285282, 326244, 318055, 277100, 309871, 121458, 277106, 170618, 170619, 309885, 309888, 277122, 227975, 277128, 285320, 301706, 318092, 326285, 334476, 318094, 277136, 277139, 227992, 318108, 285340, 318110, 227998, 137889, 383658, 285357, 318128, 277170, 293555, 318132, 342707, 154292, 277173, 285368, 277177, 277181, 318144, 277187, 277191, 277194, 277196, 277201, 342745, 137946, 342747, 342749, 113378, 203491, 228069, 277223, 342760, 285417, 56041, 56043, 56045, 277232, 228081, 56059, 310015, 285441, 310020, 285448, 310029, 228113, 285459, 277273, 293659, 326430, 228128, 285474, 293666, 228135, 318248, 277291, 318253, 293677, 285489, 301876, 293685, 285494, 301880, 285499, 301884, 310080, 293696, 277317, 277322, 293706, 277329, 162643, 310100, 301911, 301913, 277337, 301921, 400236, 236397, 162671, 326514, 310134, 236408, 15224, 277368, 416639, 416640, 113538, 310147, 416648, 39817, 187274, 277385, 301972, 424853, 277405, 277411, 310179, 293798, 293802, 236460, 277426, 276579, 293811, 293817, 293820, 203715, 326603, 342994, 276586, 293849, 293861, 228327, 228328, 318442, 228330, 228332, 326638, 277486, 351217, 318450, 293876, 293877, 285686, 302073, 121850, 293882, 302075, 285690, 244731, 293887, 277504, 277507, 277511, 293899, 277519, 293908, 302105, 293917, 293939, 318516, 277561, 277564, 310336, 7232, 293956, 277573, 228422, 293960, 310344, 277577, 277583, 203857, 293971, 310355, 310359, 236632, 277594, 138332, 277598, 203872, 277601, 285792, 310374, 203879, 310376, 228460, 318573, 203886, 187509, 285815, 367737, 285817, 302205, 285821, 392326, 285831, 253064, 294026, 302218, 285835, 162964, 384148, 187542, 302231, 285849, 302233, 285852, 302237, 285854, 285856, 302241, 285862, 277671, 302248, 64682, 277678, 294063, 294065, 302258, 277687, 294072, 318651, 294076, 277695, 318657, 244930, 302275, 130244, 302277, 228550, 302282, 310476, 302285, 302288, 310481, 302290, 203987, 302292, 302294, 310486, 302296, 384222, 310498, 285927, 318698, 302315, 195822, 228592, 294132, 138485, 228601, 204026, 228606, 204031, 64768, 310531, 285958, 138505, 228617, 318742, 204067, 277798, 130345, 277801, 113964, 285997, 384302, 285999, 277804, 113969, 277807, 277811, 318773, 318776, 277816, 286010, 277819, 294204, 417086, 277822, 286016, 302403, 294211, 384328, 277832, 277836, 294221, 146765, 294223, 326991, 277839, 277842, 277847, 277850, 179547, 277853, 146784, 277857, 302436, 277860, 294246, 327015, 310632, 327017, 351594, 277864, 277869, 277872, 351607, 310648, 277880, 310651, 277884, 277888, 310657, 351619, 294276, 310659, 327046, 277892, 253320, 310665, 318858, 277894, 277898, 277903, 310672, 351633, 277905, 277908, 277917, 310689, 277921, 130468, 228776, 277928, 277932, 310703, 277937, 310710, 130486, 310712, 277944, 310715, 277947, 302526, 228799, 277950, 277953, 302534, 310727, 245191, 64966, 163272, 277959, 277963, 302541, 277966, 302543, 310737, 277971, 228825, 163290, 277978, 310749, 277981, 277984, 310755, 277989, 277991, 187880, 277995, 310764, 286188, 278000, 228851, 310772, 278003, 278006, 40440, 212472, 278009, 40443, 286203, 310780, 40448, 228864, 286214, 228871, 302603, 65038, 302614, 302617, 286233, 302621, 286240, 146977, 187936, 187939, 40484, 294435, 40486, 286246, 294440, 40488, 294439, 294443, 40491, 294445, 278057, 310831, 245288, 286248, 40499, 40502, 212538, 40507, 40511, 40513, 228933, 327240, 40521, 286283, 40525, 40527, 212560, 400976, 228944, 40533, 147032, 40537, 40539, 40541, 278109, 40544, 40548, 40550, 40552, 286312, 40554, 286313, 310892, 40557, 40560, 188022, 122488, 294521, 343679, 294537, 310925, 286354, 278163, 302740, 122517, 278168, 179870, 327333, 229030, 212648, 278188, 302764, 278192, 319153, 278196, 302781, 319171, 302789, 294599, 278216, 294601, 302793, 343757, 212690, 319187, 286420, 278227, 229076, 286425, 319194, 278235, 278238, 229086, 286432, 294625, 294634, 302838, 319226, 286460, 278274, 302852, 278277, 302854, 294664, 311048, 352008, 319243, 311053, 302862, 319251, 294682, 278306, 188199, 294701, 319280, 278320, 319290, 229192, 302925, 188247, 188252, 237409, 294776, 360317, 294785, 327554, 360322, 40840, 40851, 294803, 188312, 294811, 237470, 319390, 40865, 319394, 294817, 294821, 311209, 180142, 343983, 294831, 188340, 40886, 319419, 294844, 294847, 237508, 393177, 294876, 294879, 294883, 393190, 294890, 311279, 278513, 237555, 311283, 278516, 278519, 237562 ]
dbff67428f8973088d584e9a53eb4856ef0e13b3
4cb555d7e2e3961d59fdf3d97302c9c7da72942b
/Source/SwiftUI/Image.swift
736ae9f287784de5c1d4218ef21bac4beca10fbd
[ "MIT" ]
permissive
billp/TermiNetwork
39ead926e80ff9f5a6786a792f64945dd8139bde
bb5a3fe3eb4d0b2c032e7c9d6e2b74a78abac6a2
refs/heads/master
2023-04-29T00:37:59.341640
2023-04-24T10:02:08
2023-04-24T10:02:08
121,552,352
103
10
MIT
2023-08-20T06:41:06
2018-02-14T19:31:25
Swift
UTF-8
Swift
false
false
9,269
swift
// Image.swift // // Copyright © 2018-2023 Vassilis Panagiotopoulos. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy of // this software and associated documentation files (the "Software"), to deal in the // Software without restriction, including without limitation the rights to use, copy, // modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, // and to permit persons to whom the Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all copies // or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIESS FOR A PARTICULAR // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE // FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. import Foundation import Combine import SwiftUI #if os(macOS) /// The Image type depending on platform: UIImage for iOS or NSImage for macOS. public typealias ImageType = NSImage #elseif os(iOS) || os(watchOS) || os(tvOS) /// The Image type depending on platform: UIImage for iOS or NSImage for macOS. public typealias ImageType = UIImage #endif /// Callback type for image preprocess used in UIImageView|NSImage|WKInterfaceImage and Image (SwiftUI) helpers /// - parameters: /// - image: The downloaded image. /// - returns: The new transformed image. public typealias ImagePreprocessType = (_ image: ImageType) -> (ImageType) /// Callback type for image downloaded event. /// - parameters: /// - image: The downloaded image. /// - error: A TNError object if it fails to download. /// - returns: The new transformed image. public typealias ImageOnFinishCallbackType = (_ image: ImageType?, _ error: TNError?) -> Void @available(iOS 13.0, *) /// :nodoc: final class ImageLoader: ObservableObject { private var request: Request private var url: String? private var defaultImage: ImageType? private var resize: CGSize? private var preprocessImageClosure: ImagePreprocessType? private var onFinishImageClosure: ImageOnFinishCallbackType? @Published var image = ImageType() init(with url: String, configuration: Configuration? = nil, defaultImage: ImageType? = nil, resize: CGSize? = nil, preprocessImage: ImagePreprocessType? = nil, onFinish: ImageOnFinishCallbackType? = nil) { self.url = url self.request = Request(method: .get, url: url, configuration: configuration) self.defaultImage = defaultImage self.resize = resize self.preprocessImageClosure = preprocessImage self.onFinishImageClosure = onFinish } init(with request: Request, defaultImage: ImageType? = nil, resize: CGSize? = nil, preprocessImage: ImagePreprocessType? = nil, onFinish: ImageOnFinishCallbackType? = nil) { self.request = request self.defaultImage = defaultImage self.resize = resize self.preprocessImageClosure = preprocessImage self.onFinishImageClosure = onFinish self.url = try? request.asRequest().url?.absoluteString } func loadImage() { if let url = url, let cachedImageData = Cache.shared[url], let image = ImageType(data: cachedImageData) { self.image = image return } self.image = defaultImage ?? ImageType() request.success(responseType: ImageType.self) { [weak self] image in guard let self = self else { return } self.handlePreprocessImage(image: image) { [weak self] preprocessedImage in guard let self = self else { return } // Resize image only if preprocess image function is not present if preprocessedImage == nil { self.handleResizeImage(image: image) } } } .failure { [weak self] error in guard let self = self else { return } self.onFinishImageClosure?(nil, error) } } // MARK: Helpers private func updateImage(_ image: ImageType) { self.image = image if let url = url { DispatchQueue.global(qos: .utility).async { #if os(macOS) if let cgImage = image.cgImage(forProposedRect: nil, context: nil, hints: nil) { let bitmapRep = NSBitmapImageRep(cgImage: cgImage) bitmapRep.size = image.size Cache.shared[url] = bitmapRep.representation(using: .png, properties: [:]) } #else Cache.shared[url] = image.pngData() #endif } } } private func handlePreprocessImage(image: ImageType, onFinish: ((ImageType?) -> Void)? = nil) { var image = image if let preprocessImage = self.preprocessImageClosure { DispatchQueue.global(qos: .background).async { image = preprocessImage(image) DispatchQueue.main.async { self.updateImage(image) self.onFinishImageClosure?(image, nil) onFinish?(image) } } } else { onFinish?(nil) } } private func handleResizeImage(image: ImageType, onFinish: ((ImageType) -> Void)? = nil) { if let size = self.resize { DispatchQueue.global(qos: .userInteractive).async { let image = image.tn_resize(size) ?? image DispatchQueue.main.async { self.updateImage(image) onFinish?(image) } } } else { self.updateImage(image) onFinish?(image) } } } /// Image is a SwiftUI component for downloading images. @available(iOS 13.0, *) public struct Image: View { @ObservedObject var imageLoader: ImageLoader /// Main body public var body: some View { #if os(macOS) let image = SwiftUI.Image(nsImage: imageLoader.image) #else let image = SwiftUI.Image(uiImage: imageLoader.image) #endif image.resizable() } /// Download a remote image with the specified url. /// /// - parameters: /// - url: The url of the image. /// - configuration: A Configuration object that will be used to make the request. /// - defaultImage: A UIImage|NSImage to show before the is downloaded (optional) /// - resizeTo: Resizes the image to the given CGSize /// - preprocessImage: A block of code that preprocesses the after the download. /// This block will run in the background thread /// - onFinish: A block of code to execute after the completion of the request. /// If the request fails, an error will be returned public init(url: String, configuration: Configuration? = nil, defaultImage: ImageType? = nil, resizeTo size: CGSize? = nil, preprocessImage: ImagePreprocessType? = nil, onFinish: ImageOnFinishCallbackType? = nil) { self.imageLoader = ImageLoader(with: url, configuration: configuration, defaultImage: defaultImage, resize: size, preprocessImage: preprocessImage, onFinish: onFinish) self.imageLoader.loadImage() } /// Download a remote image with the specified url. /// /// - parameters: /// - request: A Request instance. /// - configuration: A Configuration object that will be used to make the request. /// - defaultImage: A UIImage|NSImage to show before the is downloaded (optional) /// - resizeTo: Resizes the image to the given CGSize /// - preprocessImage: A block of code that preprocesses the after the download. /// This block will run in the background thread (optional) public init(request: Request, defaultImage: ImageType? = nil, resizeTo size: CGSize? = nil, preprocessImage: ImagePreprocessType? = nil, onFinish: ImageOnFinishCallbackType? = nil) { self.imageLoader = ImageLoader(with: request, defaultImage: defaultImage, resize: size, preprocessImage: preprocessImage, onFinish: onFinish) self.imageLoader.loadImage() } }
[ -1 ]
3d923b24c644e57ba651349804b5583ac7e9c0cb
146bc44d7f4c8b7c0e471b5bab67bd15753699e9
/Transactions/Transactions/String+DateHelper.swift
5f281be34d607f863cb54afae669fe82ecbcc17d
[]
no_license
marcinhub/Transactions
819d5e8d1e68407cbd9953fd5dccec3aad278b21
9e14653924ac64a5a6963f5b08399b2eb668d125
refs/heads/master
2021-06-02T17:36:08.732904
2016-09-13T08:24:49
2016-09-13T08:24:49
null
0
0
null
null
null
null
UTF-8
Swift
false
false
1,258
swift
// // String+DateHelper.swift // Transactions // // Created by Marcin on 07/09/2016. // Copyright © 2016 MarcinSteciuk. All rights reserved. // import Foundation extension String { var toDate : NSDate? { let dateFormatter = NSDateFormatter().britishDateFormatter() if let date = dateFormatter.dateFromString(self) { return date } return nil } } extension String { var toDateOnly : NSDate? { let dateFormatter = NSDateFormatter().britishDateFormatter() if let date = dateFormatter.dateFromString(self) { return date } return nil } } extension NSDate: Comparable {} public func ==(lhs: NSDate, rhs: NSDate) -> Bool { return lhs.compare(rhs) == .OrderedSame } public func >(lhs: NSDate, rhs: NSDate) -> Bool { return lhs.compare(rhs) == .OrderedDescending } public func <(lhs: NSDate, rhs: NSDate) -> Bool { return lhs.compare(rhs) == NSComparisonResult.OrderedAscending } public func <=(lhs: NSDate, rhs: NSDate) -> Bool { return lhs < rhs || lhs == rhs } public func >=(lhs: NSDate, rhs: NSDate) -> Bool { return lhs > rhs || lhs == rhs }
[ -1 ]
fcedaa75a8561716ff375f563303052b39bc1f42
c70d56ae778e337bafad6d3cd38fcb163bc077be
/FFmpegAndKxmovieDemo/FFSlider.swift
7f7c9ee26e504a1a9eb9f5e17308df095055b087
[]
no_license
dujiepeng/FFmpegAndKxmovieDemo
2d056c1814aaad99249cd11c353fad04980b3db9
4ea27b7a0e122c2f7a6ee094341cc1d1d6fb2d70
refs/heads/master
2021-01-17T08:56:23.967924
2016-06-11T07:44:43
2016-06-11T07:44:43
62,215,941
2
0
null
2016-06-29T10:03:10
2016-06-29T10:03:10
null
UTF-8
Swift
false
false
354
swift
// // FFSlider.swift // FFmpegAndKxmovieDemo // // Created by 马超 on 16/6/4. // Copyright © 2016年 qq 714080794. All rights reserved. // import UIKit class FFSlider: UISlider { override func trackRectForBounds(bounds: CGRect) -> CGRect { return CGRectMake(bounds.origin.x, bounds.origin.y, bounds.size.width, 5) } }
[ -1 ]
cfcaeb093300a2d875b0e7fdaf0ab5a0b70e343f
15b4f3ccab87faf20f979fd1f09807c78ff9719e
/Home_Remote/BleScanController.swift
d8e407ecb9f7e20778b05d91a91d573b72680269
[]
no_license
Dong-Jun-Shin/Home_Remote_iOS
2557a824605ccf5f1e9865337148fb2149ad4421
52d02fdf0e47cd3d3abe0edec0ed86b41eb68b1a
refs/heads/main
2023-08-06T22:43:13.577517
2021-10-01T03:21:03
2021-10-01T03:21:03
374,635,685
0
0
null
null
null
null
UTF-8
Swift
false
false
5,220
swift
// // BleScanController.swift // Home_Remote // // Created by 임시 사용자 (DJ) on 2021/05/30. // import UIKit import CoreBluetooth import MyFrame class BleScanController: UIViewController { @IBOutlet weak var btnOfScan: UIButton! @IBOutlet weak var tblOfList: UITableView! var peripherals:[CBPeripheral] = [] var peripheralObj: CBPeripheral! var centralManager: CBCentralManager! var characteristic: CBCharacteristic! let deviceCharCBUUID = CBUUID(string: "FFE1") let data = NSMutableData() /*스캔 함수*/ @IBAction func btnScanClick( sender: Any) { if(centralManager.isScanning) { centralManager.stopScan() } centralManager?.scanForPeripherals(withServices: nil, options: nil) } /*NavBar 컬러 변경*/ override var preferredStatusBarStyle: UIStatusBarStyle{ return .lightContent } /*초기화 함수*/ override func viewDidLoad() { super.viewDidLoad() tblOfList.delegate = self tblOfList.dataSource = self self.tblOfList.tableFooterView = UIView() centralManager = CBCentralManager(delegate: self, queue: .main) } } /*테이블 뷰 관련 확장 BleScanController*/ extension BleScanController : UITableViewDelegate,UITableViewDataSource { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return peripherals.count } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = self.tblOfList.dequeueReusableCell(withIdentifier: "listCell", for: indexPath) let peripheral = peripherals[indexPath.row] cell.textLabel?.text = peripheral.name cell.textLabel?.font = UIFont.systemFont(ofSize: 18, weight: UIFont.Weight.regular) return cell } func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { let peripheral = peripherals[indexPath.row] peripheralObj = peripheral centralManager.connect(peripheralObj) } } /*블루투스 관련 확장 BleScanController*/ extension BleScanController : CBPeripheralDelegate, CBCentralManagerDelegate{ func centralManagerDidUpdateState(_ central: CBCentralManager) { } func centralManager(_ central: CBCentralManager, didDiscover peripheral: CBPeripheral, advertisementData: [String : Any], rssi RSSI: NSNumber) { if !(peripheral.name ?? "").isEmpty { var check:Bool = false for p in peripherals { if(p.name == peripheral.name) { check = true } } if(!check) { self.peripherals.append(peripheral) DispatchQueue.main.async(execute: { self.tblOfList.reloadData() self.tblOfList.contentOffset = .zero }) } } } func centralManager(_ central: CBCentralManager, didConnect peripheral: CBPeripheral) { centralManager?.stopScan() //연결 장치 설정 및 서비스 탐색 peripheralObj.delegate = self peripheralObj.discoverServices(nil) } func centralManager(_ central: CBCentralManager, didDisconnectPeripheral peripheral: CBPeripheral, error: Error?) { } func centralManager(_ central: CBCentralManager, didFailToConnect peripheral: CBPeripheral, error: Error?) { print(error!) } func peripheral(_ peripheral: CBPeripheral, didDiscoverServices error: Error?) { guard let services = peripheral.services else { return } for service in services { peripheral.discoverCharacteristics([deviceCharCBUUID], for: service) } } func peripheral(_ peripheral: CBPeripheral, didDiscoverCharacteristicsFor service: CBService, error: Error?) { guard let chars = service.characteristics else { return } for char in chars { characteristic = char if char.uuid.isEqual(deviceCharCBUUID) { peripheral.setNotifyValue(true, for: char) } } connectionObjSet() let content = "Connected to \(peripheralObj.name!)\nScanning stopped" alertConnection(title: "연결 성공", content: content) } /*공통으로 사용할 객체에 BLE객체 설정*/ func connectionObjSet(){ BleVO.setBleObj(peripheralObj: self.peripheralObj, centralManager: self.centralManager, characteristic: self.characteristic) } /*알림 팝업 호출 함수*/ func alertConnection(title: String, content: String){ let alert = UIAlertController(title: title, message: content, preferredStyle: UIAlertController.Style.alert) let okAction = UIAlertAction(title: "OK", style: .default) { (action) in self.navigationController?.popViewController(animated: true) } alert.addAction(okAction) present(alert, animated: false, completion: nil) } }
[ -1 ]
5d0c16ab82fa6feea4b4f663fad4821feb6cc4f0
79c7f6f4022ffa8eefc704c3cdf98d80b6a3ee8e
/iOS/VoiceTester/VoiceTester/MLAudioPlayer.swift
ebf70b5057636eefa0a459d3d2daea4ef674d524
[ "MIT" ]
permissive
mhplong/Projects
0574d9dcfcff940e74b21c1c0b40179d2529de67
4eb8982d53a6781c43ab2b0ade27a9b95f616ef8
refs/heads/master
2021-09-29T05:34:01.860276
2018-10-15T04:33:55
2018-10-15T04:33:55
37,733,885
0
0
null
2017-07-29T13:13:30
2015-06-19T16:40:03
Swift
UTF-8
Swift
false
false
5,540
swift
// // MLAudioPlayer.swift // VoiceTester // // Created by Mark Long on 6/5/16. // Copyright © 2016 Mark Long. All rights reserved. // import UIKit import AVFoundation protocol MLAudioPlayerDelegate : NSObjectProtocol { func AudioEnded() func RecordingEnded(data: [[Int16]]?) } class MLAudioPlayer: NSObject, AVAudioPlayerDelegate { private var recorder : AVAudioRecorder? private var player : AVAudioPlayer? private var engine : AVAudioPCMBuffer? private let recordingSettings : [String : AnyObject] = [AVFormatIDKey : Int(kAudioFormatMPEG4AAC), AVNumberOfChannelsKey : 1] private var recordURL : URL! private var timer : Timer? private var audioData = [[Int16]]() weak var delegate: MLAudioPlayerDelegate? override init() { super.init() let appDelegate = UIApplication.shared().delegate as! AppDelegate let documentsURL = appDelegate.applicationDocumentsDirectory recordURL = documentsURL.appendingPathComponent("recording.m4a") print(recordURL) do { let audioSession = AVAudioSession.sharedInstance() try audioSession.setCategory(AVAudioSessionCategoryPlayAndRecord) try audioSession.overrideOutputAudioPort(AVAudioSessionPortOverride.speaker) try audioSession.setActive(true) recorder = try AVAudioRecorder(url: recordURL, settings: recordingSettings) recorder?.isMeteringEnabled = true recorder?.prepareToRecord() } catch { print(error) } NotificationCenter.default().addObserver(self, selector: #selector(test), name: NSNotification.Name.AVAudioSessionRouteChange, object: nil) } func test(userInfo: AnyObject) { print("Testing") } func Record() { timer = Timer.scheduledTimer(timeInterval: 0.2, target: self, selector: #selector(updateMeters), userInfo: nil, repeats: true) recorder?.record() } func Play() { player?.play() } func Pause() { player?.pause() } func Stop() { let audioSession = AVAudioSession.sharedInstance() if recorder?.isRecording != nil { recorder?.stop() timer?.invalidate() do { player = try AVAudioPlayer(contentsOf: recordURL) testingBufferSamples() player?.delegate = self delegate?.RecordingEnded(data: audioData) } catch { } } if player?.isPlaying != nil { player?.stop() } do { try audioSession.setActive(false) } catch { } } func testingBufferSamples() { do { let test = AVAsset(url: recordURL) let testManager = try AVAssetReader(asset: test) let track = test.tracks[0] let trackOutput = AVAssetReaderTrackOutput(track: track, outputSettings: [AVFormatIDKey : Int(kAudioFormatLinearPCM)]) //print(trackOutput) testManager.add(trackOutput) testManager.startReading() //print(testManager.status) audioData.removeAll() var sample = trackOutput.copyNextSampleBuffer() while sample != nil { var bufferList = AudioBufferList(mNumberBuffers: 1, mBuffers: AudioBuffer(mNumberChannels: 0, mDataByteSize: 0, mData: nil)) var buffer : CMBlockBuffer? = nil CMSampleBufferGetAudioBufferListWithRetainedBlockBuffer(sample!, nil, &bufferList, sizeofValue(bufferList), nil, nil, kCMSampleBufferFlag_AudioBufferList_Assure16ByteAlignment, &buffer) let audioBuffers = UnsafeBufferPointer<AudioBuffer>(start: &bufferList.mBuffers, count: Int(bufferList.mNumberBuffers)) var sampleArray = [Int16]() for audioBuffer in audioBuffers { let samples = UnsafeMutableBufferPointer<Int16>(start: UnsafeMutablePointer(audioBuffer.mData), count: Int(audioBuffer.mDataByteSize)/sizeof(Int16)) sampleArray.append(contentsOf: samples) } audioData.append(sampleArray) sample = trackOutput.copyNextSampleBuffer() } } catch { } } func updateMeters() { recorder?.updateMeters() let power = recorder!.averagePower(forChannel: 0) + 160.0 print(power) delegate?.RecordingEnded(data: nil) } func audioPlayerDidFinishPlaying(_ player: AVAudioPlayer, successfully flag: Bool) { if flag { delegate?.AudioEnded() } } }
[ -1 ]
bac77a83a51ad7fd7b34c42b8cf9ac5056a159c3
696220c8b05101e3aad16bdaa59096d915052b91
/IOS-разработка для начинающих/7. Переходы и взаимодействие экранов/Homework/первый таб/GreenViewController.swift
3009da942adf9c4da10074da36737356e552096e
[]
no_license
MarinaLugova/Skillbox
82f9094a55c924d80d786f13fe899eac8df42d32
66c50f3f6a1106f29bcec8b105762f14670b23f8
refs/heads/master
2023-01-19T22:07:40.609378
2020-11-18T22:18:22
2020-11-18T22:18:22
null
0
0
null
null
null
null
UTF-8
Swift
false
false
164
swift
import UIKit class GreenViewController: ViewController { override func viewDidLoad() { super.viewDidLoad() } } // Skillbox // Скиллбокс
[ -1 ]
02234bf1ccf0f8be4ec77270ddd74aca4eaf280f
31efda14887f4f24c6112b40cb62f54997f6a4da
/Source/Charts/Data/ChartDataSet/RadarChartDataSet.swift
39734aceb243296257968df369ca6e53eb480e08
[ "Apache-2.0" ]
permissive
jjatie/Charts
ce7996348f8c2dff6a675e17a1651f7628376160
fd661f8f0566adeef5ad1c121e38567dd3f5d76e
refs/heads/master
2021-06-03T16:28:24.750205
2021-02-10T03:16:29
2021-02-10T03:16:29
335,353,565
0
0
Apache-2.0
2021-02-10T03:16:30
2021-02-02T16:31:42
Swift
UTF-8
Swift
false
false
1,384
swift
// // RadarChartDataSet.swift // Charts // // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda // A port of MPAndroidChart for iOS // Licensed under Apache License 2.0 // // https://github.com/danielgindi/Charts // import CoreGraphics import Foundation public class RadarChartDataSet: LineRadarChartDataSet, RadarChartDataSetProtocol { private func initialize() { style.valueFont = NSUIFont.systemFont(ofSize: 13.0) } public required init() { super.init() initialize() } override public required init(entries: [ChartDataEntry], label: String) { super.init(entries: entries, label: label) initialize() } // MARK: - Data functions and accessors // MARK: - Styling functions and accessors /// flag indicating whether highlight circle should be drawn or not /// **default**: false public var isDrawHighlightCircleEnabled = false public var highlightCircleFillColor: NSUIColor? = NSUIColor.white /// The stroke color for highlight circle. /// If `nil`, the color of the dataset is taken. public var highlightCircleStrokeColor: NSUIColor? public var highlightCircleStrokeAlpha: CGFloat = 0.3 public var highlightCircleInnerRadius: CGFloat = 3.0 public var highlightCircleOuterRadius: CGFloat = 4.0 public var highlightCircleStrokeWidth: CGFloat = 2.0 }
[ 54595, 180005, 39270, 248681, 67561, 185040, 215317 ]
67afb8f84fdf392408dd963fe515382092e81858
6670d8cbfc5d74113e3dd852c243e2b391867da7
/Examples/BasicRxSwift/02_Operators/Combining_Operators.playground/Contents.swift
f51d689db9e898674cbfc30bc5d980cb85c3a806
[ "Apache-2.0" ]
permissive
duydole/rxswift_notes
066cc3ffb1a46b89bebcb6ae0c7b10bc467a8efd
ab60c32bf002584846df3fd57d82b10220c41aff
refs/heads/master
2023-01-21T14:43:04.654967
2020-11-30T09:06:08
2020-11-30T09:06:08
null
0
0
null
null
null
null
UTF-8
Swift
false
false
7,901
swift
import UIKit import RxSwift example(of: "startWith") { let bag = DisposeBag() Observable.of("B", "C", "D", "E") .startWith("A", "A1", "A2") .subscribe(onNext: { value in print(value) }) .disposed(by: bag) } example(of: "Observable.concat") { let bag = DisposeBag() let first = Observable.of(1, 2, 3) let second = Observable.of(4, 5, 6) let observable = Observable.concat([first, second]) observable .subscribe(onNext: { value in print(value) }) .disposed(by: bag) } example(of: "concat") { let bag = DisposeBag() let first = Observable.of("A", "B", "C") let second = Observable.of("D", "E", "F") let observable = first.concat(second) observable .subscribe(onNext: { value in print(value) }) .disposed(by: bag) } example(of: "concatMap") { let bag = DisposeBag() let cities = [ "Mien Bac" : Observable.of("Ha Noi", "Hai Phong"), "Mien Trung" : Observable.of("Hue", "Da Nang"), "Mien Nam" : Observable.of("Ho Chi Minh", "Can Tho")] let observable = Observable.of("Mien Bac", "Mien Trung", "Mien Nam") .concatMap { name in cities[name] ?? .empty() } observable .subscribe(onNext: { (value) in print(value) }) .disposed(by: bag) } example(of: "merge") { let bag = DisposeBag() let chu = PublishSubject<String>() let so = PublishSubject<String>() let source = Observable.of(chu.asObserver(), so.asObserver()) let observable = source.merge() observable .subscribe(onNext: { (value) in print(value) }) .disposed(by: bag) chu.onNext("Một") so.onNext("1") chu.onNext("Hai") so.onNext("2") chu.onNext("Ba") so.onCompleted() so.onNext("3") chu.onNext("Bốn") chu.onCompleted() } example(of: "combinedLatest") { let bag = DisposeBag() let chu = PublishSubject<String>() let so = PublishSubject<String>() let observable = Observable.combineLatest(chu, so) { chu, so in "\(chu) : \(so)" } observable .subscribe(onNext: { (value) in print(value) }) .disposed(by: bag) chu.onNext("Một") chu.onNext("Hai") so.onNext("1") so.onNext("2") chu.onNext("Ba") so.onNext("3") chu.onCompleted() chu.onNext("Bốn") so.onNext("4") so.onNext("5") so.onNext("6") so.onCompleted() } example(of: "combine user choice and value") { let choice: Observable<DateFormatter.Style> = Observable.of(.short, .long) let dates = Observable.of(Date()) let observable = Observable.combineLatest(choice, dates) { format, when -> String in let formatter = DateFormatter() formatter.dateStyle = format return formatter.string(from: when) } _ = observable.subscribe(onNext: { value in print(value) }) } example(of: "zip") { let bag = DisposeBag() let chu = PublishSubject<String>() let so = PublishSubject<String>() let observable = Observable.zip(chu, so) { chu, so in "\(chu) : \(so)" } observable .subscribe(onNext: { (value) in print(value) }) .disposed(by: bag) chu.onNext("Một") chu.onNext("Hai") so.onNext("1") so.onNext("2") chu.onNext("Ba") so.onNext("3") chu.onCompleted() chu.onNext("Bốn") so.onNext("4") so.onNext("5") so.onNext("6") so.onCompleted() } example(of: "withLatestFrom") { let button = PublishSubject<Void>() let textField = PublishSubject<String>() let observable = button.withLatestFrom(textField) _ = observable .subscribe(onNext: { value in print(value) }) textField.onNext("Đa") textField.onNext("Đà Na") textField.onNext("Đà Nẵng") button.onNext(()) button.onNext(()) } example(of: "sample") { let button = PublishSubject<Void>() let textField = PublishSubject<String>() let observable = textField.sample(button) _ = observable .subscribe(onNext: { value in print(value) }) textField.onNext("Đa") textField.onNext("Đà Na") textField.onNext("Đà Nẵng") button.onNext(()) button.onNext(()) } example(of: "amb") { let bag = DisposeBag() let chu = PublishSubject<String>() let so = PublishSubject<String>() let observable = chu.amb(so) observable .subscribe(onNext: { (value) in print(value) }) .disposed(by: bag) so.onNext("1") so.onNext("2") so.onNext("3") chu.onNext("Một") chu.onNext("Hai") chu.onNext("Ba") so.onNext("4") so.onNext("5") so.onNext("6") chu.onNext("Bốn") chu.onNext("Năm") chu.onNext("Sáu") } example(of: "sưitchLatest") { let bag = DisposeBag() let chu = PublishSubject<String>() let so = PublishSubject<String>() let dau = PublishSubject<String>() let observable = PublishSubject<Observable<String>>() let subscription = observable .switchLatest() .subscribe(onNext: { (value) in print(value) }, onCompleted: { print("completed") }, onDisposed: { print("disposed") }) observable.onNext(so) so.onNext("1") so.onNext("2") so.onNext("3") observable.onNext(chu) chu.onNext("Một") chu.onNext("Hai") chu.onNext("Ba") so.onNext("4") so.onNext("5") so.onNext("6") observable.onNext(dau) dau.onNext("+") dau.onNext("-") observable.onNext(chu) chu.onNext("Bốn") chu.onNext("Năm") chu.onNext("Sáu") subscription.dispose() } example(of: "reduce") { let source = Observable.of(1, 2, 3, 4, 5, 6, 7, 8, 9) //let observable = source.reduce(0, accumulator: +) //let observable = source.reduce(0) { $0 + $1 } let observable = source.reduce(0) { summary, newValue in return summary + newValue } _ = observable .subscribe(onNext: { value in print(value) }) } example(of: "scan") { let source = Observable.of(1, 2, 3, 4, 5, 6, 7, 8, 9) //let observable = source.scan(0, accumulator: +) //let observable = source.scan(0) { $0 + $1 } let observable = source.scan(0) { summary, newValue in return summary + newValue } _ = observable .subscribe(onNext: { value in print(value) }) } example(of: "test scan") { struct Detail { var name: String } struct Master { var name: String var items = [Detail]() } let masters = [Master(name: "1"), Master(name: "2"), Master(name: "3"), Master(name: "4")] let details = [[Detail(name: "1-1"), Detail(name: "1-2"), Detail(name: "3-1") , Detail(name: "4-1")], [Detail(name: "2-1"), Detail(name: "2-2"), Detail(name: "3-2") , Detail(name: "4-2")], [Detail(name: "3-1"), Detail(name: "2-3"), Detail(name: "3-3") , Detail(name: "4-3")], [Detail(name: "4-1"), Detail(name: "2-4"), Detail(name: "3-4") , Detail(name: "4-4")]] let source = PublishSubject<[Master]>() let list = PublishSubject<[Detail]>() source.onNext(masters) list.onNext(details[0]) list.onNext(details[1]) list.onNext(details[2]) list.onNext(details[3]) }
[ -1 ]
eb616536bf3b025e38bcaef3fe9910eea4af14d3
7ccfa3904e9d2fed9dc2ebd0e90166ddbdde0fa6
/myclass/AssessmentsViewController.swift
4625eb981135df140126d30f59306e62d64238e0
[ "MIT" ]
permissive
preetcoder/myclass
a486f5f388a8790d1c08a4617928de0e661386fd
28fa9a3c489a91a418881dc2d8f760250a5048b7
refs/heads/master
2020-07-25T18:44:34.679118
2019-11-09T03:23:14
2019-11-09T03:23:14
208,390,127
0
0
null
null
null
null
UTF-8
Swift
false
false
721
swift
// // AssessmentsViewController.swift // myclass // // Created by Bhavesh Hingad on 15/9/19. // Copyright © 2019 Harpreetandbhavesh. All rights reserved. // import UIKit class AssessmentsViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. } /* // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepare(for segue: UIStoryboardSegue, sender: Any?) { // Get the new view controller using segue.destination. // Pass the selected object to the new view controller. } */ }
[ -1 ]
1f7ade6eb1bd1fed9186fe9f41cf0c4ac6bee591
faad2cc0f4b75d26826cd80ab07a4d5aee5c8578
/PaniniChecklist/Sticker.swift
0b09e7bc38f08a9abaf9f109e9a8773556f5b036
[]
no_license
stefandric/PaniniChecklist
f687bf56f81f485e155066a70a2e803c0d7a9b3e
9267cd77f04f80f263035f173417ca15cf178839
refs/heads/master
2020-03-10T22:55:00.337816
2018-04-15T16:23:50
2018-04-15T16:23:50
129,629,480
0
0
null
null
null
null
UTF-8
Swift
false
false
324
swift
// // Sticker.swift // PaniniChecklist // // Created by Stefan Andric on 4/15/18. // Copyright © 2018 stefandric. All rights reserved. // import UIKit import RealmSwift class Sticker: Object { @objc dynamic var elementId = 0 @objc dynamic var isSelected = false @objc dynamic var numberOfDuplicates = 0 }
[ -1 ]
e7ceb223a7ce1ddb7c8c1178ebec943cd5813a5f
0353ceefe86304716a878ca2f683135b6a22463f
/UISliderCustom/UISliderCustom.swift
98475db6ec2e69fc8939982075514a5a969a1a4c
[]
no_license
arclaire/UISliderCustom
f582c531347dbafcd8d02c1c21d2e4fc387d536c
86a252ef45248bc3f64530eae528d37931a606be
refs/heads/master
2020-11-30T22:07:15.740429
2016-09-02T10:48:37
2016-09-02T10:48:37
66,180,120
1
1
null
null
null
null
UTF-8
Swift
false
false
6,927
swift
// // UISliderCustom.swift // UISliderCustom // // Created by Lucy on 8/21/16. // Copyright © 2016 cy. All rights reserved. // import UIKit let COLOR_OPTION_BG = UIColor(red: 250.0/255.0, green: 250.0/255.0, blue: 250.0/255.0, alpha: 1.0) let COLOR_OPTION_TEXT = UIColor(red: 74.0/255.0, green: 74.0/255.0, blue: 74.0/255.0, alpha: 1.0) let COLOR_DUMMY = UIColor(red: 174.0/255.0, green: 94.0/255.0, blue: 24.0/255.0, alpha: 5.0) let IOS_VERSION: CGFloat = CGFloat((UIDevice.currentDevice().systemVersion as NSString).floatValue) protocol DelegateUISliderCustom: NSObjectProtocol { func valueDidChanged(value: Float) } class UISliderCustom: UISlider { lazy var vwTrackLeft: UIView = UIView() lazy var vwTrackRight: UIView = UIView() lazy var vwMaskLeft: UIView = UIView() lazy var vwMaskRight: UIView = UIView() lazy var vwDummy: UIView = UIView() lazy var layerMaskRight: CALayer = CALayer() lazy var layerMaskLeft: CALayer = CALayer() var colorUnfilled: UIColor = UIColor.grayColor() var colorStatic: UIColor = UIColor.clearColor() weak var delUISlidercustom: DelegateUISliderCustom? var lblIndicator: UILabel = UILabel() var floatHeight:CGFloat = 4.0 var floatDefaultValue: Float = 0 private let floatGap:CGFloat = 2.0 private var rectThumb: CGRect = CGRectMake(0, 0, 50, 50) override var value: Float { didSet { self.sliderValueChange() self.hideLabelIndicator() } } override func awakeFromNib() { super.awakeFromNib() self.vwTrackLeft.backgroundColor = COLOR_OPTION_TEXT self.vwTrackRight.backgroundColor = COLOR_OPTION_TEXT self.vwMaskRight.backgroundColor = UIColor.redColor() //colorUnfilled self.vwMaskLeft.backgroundColor = UIColor.blueColor() //colorUnfilled //self.vwDummy.backgroundColor = COLOR_DUMMY self.layerMaskLeft.backgroundColor = UIColor.blackColor().CGColor self.layerMaskRight.backgroundColor = UIColor.blackColor().CGColor self.thumbTintColor = COLOR_OPTION_TEXT if IOS_VERSION < 9 { self.setThumbImage(getImageWithColor(COLOR_OPTION_TEXT, size: CGSizeMake(20, 20)), forState: UIControlState.Normal) } self.addSubview(self.vwTrackLeft) self.addSubview(self.vwTrackRight) self.addSubview(self.vwMaskLeft) self.addSubview(self.vwMaskRight) self.addSubview(self.vwDummy) self.setMinimumTrackImage(UIImage(), forState: UIControlState.Normal) self.setMaximumTrackImage(UIImage(), forState: UIControlState.Normal) self.continuous = true self.tintColor = self.colorStatic self.addTarget(self, action: #selector(self.sliderValueChange), forControlEvents: UIControlEvents.ValueChanged) self.addTarget(self, action: #selector(self.hideLabelIndicator), forControlEvents: UIControlEvents.TouchUpInside) self.lblIndicator.textColor = UIColor.blackColor() self.lblIndicator.font = UIFont.systemFontOfSize(11) self.lblIndicator.hidden = true self.lblIndicator.textAlignment = NSTextAlignment.Center self.addSubview(self.lblIndicator) self.minimumValue = -0.5 self.maximumValue = 0.5 self.value = 0 self.floatDefaultValue = 0 } override func layoutSubviews() { super.layoutSubviews() var rect: CGRect = CGRect(x: self.floatGap, y: self.frame.size.height/2 - 1, width: self.frame.size.width/2, height: self.floatHeight) self.vwTrackLeft.frame = rect rect.origin.x = self.vwTrackLeft.frame.origin.x + self.vwTrackLeft.frame.size.width - self.floatGap - 2 rect.size.width = self.vwTrackLeft.frame.size.width - self.floatGap self.vwTrackRight.frame = rect self.vwMaskLeft.frame = self.vwTrackLeft.frame self.vwMaskRight.frame = self.vwTrackRight.frame //debugPrint("layout subviews") } func hideLabelIndicator() { if self.value > (self.floatDefaultValue - 0.05) && self.value < (self.floatDefaultValue + 0.05) && self.value != floatDefaultValue { self.value = self.floatDefaultValue } self.lblIndicator.hidden = true } func prepareMask() { self.layerMaskLeft.frame = CGRectMake(0, 0, self.vwTrackLeft.frame.size.width, self.vwTrackLeft.frame.size.height) self.layerMaskRight.frame = CGRectMake(0, 0, self.vwTrackLeft.frame.size.width, self.vwTrackLeft.frame.size.height) self.vwMaskLeft.layer.mask = self.layerMaskLeft self.vwMaskRight.layer.mask = self.layerMaskRight var rect: CGRect = CGRectZero rect.origin.y = self.vwTrackLeft.frame.origin.y - 35 rect.size.height = 14 rect.size.width = 100 self.lblIndicator.frame = rect } override func setValue(value: Float, animated: Bool) { super.setValue(value, animated: animated) } func sliderValueChange() { self.rectThumb = self.thumbRectForBounds(self.bounds, trackRect: self.frame, value: self.value) //self.vwDummy.frame = rectThumb self.lblIndicator.hidden = false var point: CGPoint = self.lblIndicator.center point.x = self.rectThumb.origin.x self.lblIndicator.center = point let floatx: CGFloat = self.rectThumb.origin.x - self.frame.origin.x + floatGap debugPrint(floatx) if floatx > self.vwTrackLeft.frame.size.width { var rect: CGRect = self.layerMaskLeft.frame rect.size.width = self.vwTrackLeft.frame.size.width self.layerMaskLeft.frame = rect rect = self.layerMaskRight.frame rect.origin.x = floatx - self.vwMaskRight.frame.size.width self.layerMaskRight.frame = rect //debugPrint("MASK LEFT", self.layerMaskLeft.frame) //debugPrint("MASK RIGHT", self.layerMaskRight.frame) } else { var rect: CGRect = self.layerMaskRight.frame rect.origin.x = 0 self.layerMaskRight.frame = rect rect = self.layerMaskLeft.frame rect.size.width = floatx self.layerMaskLeft.frame = rect //debugPrint("MASK LEFT", self.layerMaskLeft.frame) //debugPrint("MASK RIGHT", self.layerMaskRight.frame) } self.delUISlidercustom?.valueDidChanged(self.value) self.lblIndicator.text = String(format:"%d",Int(self.value)) } func getImageWithColor(color: UIColor, size: CGSize) -> UIImage { UIGraphicsBeginImageContextWithOptions(CGSizeMake(size.width , size.height), false, 0) let ctx = UIGraphicsGetCurrentContext() CGContextSaveGState(ctx) let rect = CGRectMake(0, 0, size.width, size.height) CGContextSetFillColorWithColor(ctx, color.CGColor) CGContextFillEllipseInRect(ctx, rect) CGContextRestoreGState(ctx) let img = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext() return img } // /* for custom its height override func trackRectForBounds(bounds: CGRect) -> CGRect { return CGRectMake(0, 0, 100, 10) } */ }
[ -1 ]
1ab487056cbb736362fc10b6274e41eded77a32a
a018c52178ee4dcb09a36c825042c26f0c44b86c
/TweetCellTableViewCell.swift
ecca69bbc6b68b2eb53f20ae43ae2ebfcb49aad3
[]
no_license
adancelcarlos/Twitter_1
94d606136f9a02e10805363b35ae4ac6e4faa301
fcea6dd0ed3da487ee1f92cafbc4b13706644461
refs/heads/master
2022-12-20T02:11:37.372862
2020-10-05T23:22:54
2020-10-05T23:22:54
299,203,052
0
0
null
null
null
null
UTF-8
Swift
false
false
1,290
swift
// // TweetCellTableViewCell.swift // Twitter // // Created by Aldrin Dancel Carlos on 9/27/20. // Copyright © 2020 Dan. All rights reserved. // import UIKit class TweetCellTableViewCell: UITableViewCell { @IBOutlet weak var profileImageView: UIImageView! @IBOutlet weak var userNameLabel: UILabel! @IBOutlet weak var tweetContent: UILabel! //@IBOutlet weak var retweetButton: UIButton! @IBAction func retweet(_ sender: Any) { } @IBOutlet weak var favButton: UIButton! @IBAction func favoriteTweet(_ sender: Any) { } var favorited:Bool = false // func setFavorite(_ isfavorited:Bool) { // favorited = isfavorited // if(favorited) { // favButton.setImage(UIImage(named:"favor-icon-red"), for: UIControl.State.normal) // } // else{ // favButton.setImage(UIImage(named:"favor-icon"), for: UIControl.State.normal //) // } // // } 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 } }
[ -1 ]
b7e5311405a4d73de5e07a25a6abd8a7d5be0300
f22b7c2738331988b2b017292d9d9b69c0c6950d
/Tests/NIOTransportServicesTests/NIOTSSocketOptionTests.swift
50ce0000d6d7d150efc30c1fa14f5ac68bc17749
[ "Apache-2.0" ]
permissive
apple/swift-nio-transport-services
8b4eb74d699551b1b217a6b86b1f6635022de359
251e9e76134570f0cc5c21e5c6ff3ccb247472ab
refs/heads/main
2023-09-04T11:50:51.066434
2023-09-04T10:28:27
2023-09-04T10:28:27
141,458,085
262
76
Apache-2.0
2023-09-04T10:28:28
2018-07-18T16:00:15
Swift
UTF-8
Swift
false
false
7,996
swift
//===----------------------------------------------------------------------===// // // This source file is part of the SwiftNIO open source project // // Copyright (c) 2017-2021 Apple Inc. and the SwiftNIO project authors // Licensed under Apache License v2.0 // // See LICENSE.txt for license information // See CONTRIBUTORS.txt for the list of SwiftNIO project authors // // SPDX-License-Identifier: Apache-2.0 // //===----------------------------------------------------------------------===// #if canImport(Network) import XCTest import NIOCore import Network @testable import NIOTransportServices @available(OSX 10.14, iOS 12.0, tvOS 12.0, *) class NIOTSSocketOptionTests: XCTestCase { private var options: NWProtocolTCP.Options! override func setUp() { self.options = NWProtocolTCP.Options() } override func tearDown() { self.options = nil } private func assertProperty<T: Equatable>(called path: KeyPath<NWProtocolTCP.Options, T>, correspondsTo socketOption: ChannelOptions.Types.SocketOption, defaultsTo defaultValue: T, and defaultSocketOptionValue: SocketOptionValue, canBeSetTo unusualValue: SocketOptionValue, whichLeadsTo newInnerValue: T) throws { // Confirm the default is right. let actualDefaultSocketOptionValue = try self.options.valueFor(socketOption: socketOption) XCTAssertEqual(self.options[keyPath: path], defaultValue) XCTAssertEqual(actualDefaultSocketOptionValue, defaultSocketOptionValue) // Confirm that we can set this to a new value, and that it leads to the right outcome. try self.options.applyChannelOption(option: socketOption, value: unusualValue) XCTAssertEqual(self.options[keyPath: path], newInnerValue) XCTAssertEqual(try self.options.valueFor(socketOption: socketOption), unusualValue) // And confirm that we can set it back to the default. try self.options.applyChannelOption(option: socketOption, value: actualDefaultSocketOptionValue) XCTAssertEqual(self.options[keyPath: path], defaultValue) XCTAssertEqual(actualDefaultSocketOptionValue, defaultSocketOptionValue) } func testReadingAndSettingNoDelay() throws { try self.assertProperty(called: \NWProtocolTCP.Options.noDelay, correspondsTo: ChannelOptions.Types.SocketOption(level: IPPROTO_TCP, name: TCP_NODELAY), defaultsTo: false, and: 0, canBeSetTo: 1, whichLeadsTo: true) } func testReadingAndSettingNoPush() throws { try self.assertProperty(called: \NWProtocolTCP.Options.noPush, correspondsTo: ChannelOptions.Types.SocketOption(level: IPPROTO_TCP, name: TCP_NOPUSH), defaultsTo: false, and: 0, canBeSetTo: 1, whichLeadsTo: true) } func testReadingAndSettingNoOpt() throws { try self.assertProperty(called: \NWProtocolTCP.Options.noOptions, correspondsTo: ChannelOptions.Types.SocketOption(level: IPPROTO_TCP, name: TCP_NOOPT), defaultsTo: false, and: 0, canBeSetTo: 1, whichLeadsTo: true) } func testReadingAndSettingKeepaliveCount() throws { try self.assertProperty(called: \NWProtocolTCP.Options.keepaliveCount, correspondsTo: ChannelOptions.Types.SocketOption(level: IPPROTO_TCP, name: TCP_KEEPCNT), defaultsTo: 0, and: 0, canBeSetTo: 5, whichLeadsTo: 5) } func testReadingAndSettingKeepaliveIdle() throws { try self.assertProperty(called: \NWProtocolTCP.Options.keepaliveIdle, correspondsTo: ChannelOptions.Types.SocketOption(level: IPPROTO_TCP, name: TCP_KEEPALIVE), defaultsTo: 0, and: 0, canBeSetTo: 5, whichLeadsTo: 5) } func testReadingAndSettingKeepaliveInterval() throws { try self.assertProperty(called: \NWProtocolTCP.Options.keepaliveInterval, correspondsTo: ChannelOptions.Types.SocketOption(level: IPPROTO_TCP, name: TCP_KEEPINTVL), defaultsTo: 0, and: 0, canBeSetTo: 5, whichLeadsTo: 5) } func testReadingAndSettingMaxSeg() throws { try self.assertProperty(called: \NWProtocolTCP.Options.maximumSegmentSize, correspondsTo: ChannelOptions.Types.SocketOption(level: IPPROTO_TCP, name: TCP_MAXSEG), defaultsTo: 0, and: 0, canBeSetTo: 5, whichLeadsTo: 5) } func testReadingAndSettingConnectTimeout() throws { try self.assertProperty(called: \NWProtocolTCP.Options.connectionTimeout, correspondsTo: ChannelOptions.Types.SocketOption(level: IPPROTO_TCP, name: TCP_CONNECTIONTIMEOUT), defaultsTo: 0, and: 0, canBeSetTo: 5, whichLeadsTo: 5) } func testReadingAndSettingConnectDropTime() throws { try self.assertProperty(called: \NWProtocolTCP.Options.connectionDropTime, correspondsTo: ChannelOptions.Types.SocketOption(level: IPPROTO_TCP, name: TCP_RXT_CONNDROPTIME), defaultsTo: 0, and: 0, canBeSetTo: 5, whichLeadsTo: 5) } func testReadingAndSettingFinDrop() throws { try self.assertProperty(called: \NWProtocolTCP.Options.retransmitFinDrop, correspondsTo: ChannelOptions.Types.SocketOption(level: IPPROTO_TCP, name: TCP_RXT_FINDROP), defaultsTo: false, and: 0, canBeSetTo: 1, whichLeadsTo: true) } func testReadingAndSettingAckStretching() throws { try self.assertProperty(called: \NWProtocolTCP.Options.disableAckStretching, correspondsTo: ChannelOptions.Types.SocketOption(level: IPPROTO_TCP, name: TCP_SENDMOREACKS), defaultsTo: false, and: 0, canBeSetTo: 1, whichLeadsTo: true) } func testReadingAndSettingKeepalive() throws { try self.assertProperty(called: \NWProtocolTCP.Options.enableKeepalive, correspondsTo: ChannelOptions.Types.SocketOption(level: SOL_SOCKET, name: SO_KEEPALIVE), defaultsTo: false, and: 0, canBeSetTo: 1, whichLeadsTo: true) } func testWritingNonexistentSocketOption() { let option = ChannelOptions.Types.SocketOption(level: Int32.max, name: Int32.max) do { try self.options.applyChannelOption(option: option, value: 0) } catch let err as NIOTSErrors.UnsupportedSocketOption { XCTAssertEqual(err.optionValue.level, Int32.max) XCTAssertEqual(err.optionValue.name, Int32.max) } catch { XCTFail("Unexpected error \(error)") } } func testReadingNonexistentSocketOption() { let option = ChannelOptions.Types.SocketOption(level: Int32.max, name: Int32.max) do { _ = try self.options.valueFor(socketOption: option) } catch let err as NIOTSErrors.UnsupportedSocketOption { XCTAssertEqual(err.optionValue.level, Int32.max) XCTAssertEqual(err.optionValue.name, Int32.max) } catch { XCTFail("Unexpected error \(error)") } } } #endif
[ -1 ]
89ada0257a65647db0b02a8ca4a59433339b20e8
ff71765557e5e9a58eae90c08d46843054aa5d42
/MapTests/MapTests.swift
ddfaeb45b94299136dcc6514192f39b21239e752
[]
no_license
tvluong1988/Map
0ca901d4893a44a51cbc641f639de82de6dfd284
ce5d9079ae2cfa59520f139cc6a6a55a665af6f2
refs/heads/master
2016-08-09T00:37:28.299146
2015-12-13T01:20:42
2015-12-13T01:20:42
47,839,279
1
0
null
null
null
null
UTF-8
Swift
false
false
2,750
swift
// // MapTests.swift // MapTests // // Created by Thinh Luong on 12/11/15. // Copyright © 2015 Thinh Luong. All rights reserved. // import XCTest import MapKit @testable import Map class MapTests: XCTestCase { // MARK: Tests func testUpdatingNewLocation() { let index = 0 var location = viewcontroller.locationDataManager.locations[index] XCTAssert(location.address == nil) XCTAssert(location.mapItem == nil) viewcontroller.locationDataManager.updateLocationAtIndex(index, address: testAddress, mapItem: testMapItem) location = viewcontroller.locationDataManager.locations[index] XCTAssert(location.address != nil) XCTAssert(location.mapItem != nil) } func testGetValidLocations() { for index in 0..<2 { viewcontroller.locationDataManager.updateLocationAtIndex(index, address: testAddress, mapItem: testMapItem) } var validLocations = viewcontroller.locationDataManager.getValidLocations() XCTAssert(validLocations.count == 3) viewcontroller.locationDataManager.updateLocationAtIndex(2, address: testAddress, mapItem: testMapItem) validLocations = viewcontroller.locationDataManager.getValidLocations() XCTAssert(validLocations.count == 4) } func testAreInputsValid() { let locationDataManager = viewcontroller.locationDataManager XCTAssert(locationDataManager.areInputsValid() == false) locationDataManager.updateLocationAtIndex(0, address: testAddress, mapItem: testMapItem) XCTAssert(locationDataManager.areInputsValid() == false) locationDataManager.updateLocationAtIndex(1, address: testAddress, mapItem: testMapItem) XCTAssert(locationDataManager.areInputsValid() == true) locationDataManager.updateLocationAtIndex(2, address: testAddress, mapItem: testMapItem) XCTAssert(locationDataManager.areInputsValid() == true) locationDataManager.updateLocationAtIndex(0, address: nil, mapItem: nil) XCTAssert(locationDataManager.areInputsValid() == false) } // MARK: Lifecycle override func setUp() { super.setUp() viewcontroller = UIStoryboard(name: "Main", bundle: nil).instantiateViewControllerWithIdentifier("ViewController") as! ViewController viewcontroller.viewDidLoad() directionViewController = UIStoryboard(name: "Main", bundle: nil).instantiateViewControllerWithIdentifier("DirectionViewController") as! DirectionViewController } override func tearDown() { super.tearDown() } // MARK: Properties var viewcontroller: ViewController! var directionViewController: DirectionViewController! let testAddress = "testAddress" let testMapItem = MKMapItem() }
[ -1 ]
b0977fe47c3e1a52bdeeae27ee5f210d67a007ab
7f3e7ff016fc9eb41a84be275b344286364bb81d
/ESense Application/ViewControllers/ConnectViewController.swift
e33a87b0b87ed572b86f2beb0c00caf75a1083f3
[]
no_license
weiwei-ww/ESenseApplication-iOS
c438994fea74e45c43fb91bfda2ae0cdfb434e3d
4bf2da2bd9bf0bd892717e77e4610e270b2ebd07
refs/heads/master
2022-11-14T09:07:33.924556
2020-07-06T07:34:05
2020-07-06T07:35:07
277,474,103
0
0
null
null
null
null
UTF-8
Swift
false
false
2,472
swift
// // ConnectViewController.swift // ESense Application // // Created by Wei Wei on 1/7/20. // Copyright © 2020 Wei Wei. All rights reserved. // import UIKit class ConnectViewController: UIViewController { @IBOutlet weak var deviceNameLabel: UILabel! @IBOutlet weak var connectStatusLabel: UILabel! @IBOutlet weak var connectButton: UIButton! @IBOutlet weak var nextStepButton: UIButton! var deviceName = "" var connectService: ConnectService! enum connectState: String{ case connecting = "connecting" case found = "device found, connecting" case notfound = "device not found, try again" case connected = "connected" case disconnected = "disconnected" } override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. print(#function, "deviceName = \(self.deviceName)") deviceNameLabel.text = self.deviceName self.connectService = ConnectService(connectViewController: self, deviceName: self.deviceName) } @IBAction func connectPressed(_ sender: Any) { print(#function) self.connectService.connect() } @IBAction func nextStepPressed(_ sender: Any) { print(#function) self.performSegue(withIdentifier: "connect2data", sender: self) } // pass the device name and the ESenseManager object override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if segue.identifier == "connect2data" { let dstViewController = segue.destination as! DataCollectionViewController dstViewController.deviceName = self.deviceName dstViewController.manager = self.connectService.manager } } // set the connectState, the label text and enable/disable the buttons func setConnectState(connectState: connectState){ print(#function, connectState) // set the label text self.connectStatusLabel.text = connectState.rawValue // enable/disable the buttons switch connectState { case .connecting: connectButton.isEnabled = false case .connected: nextStepButton.isEnabled = true case .found: break case .notfound: connectButton.isEnabled = true case .disconnected: connectButton.isEnabled = true } } }
[ -1 ]
dc000e6706d992425e70df0ff5e0ac3b12310eca
dab8734a9d1e03e56a171173a5d1cba84be08e8f
/Sources/PerformanceMonitor/Plugins/PerformanceMonitorPlugin.swift
4e5933484586eb9f7d234bf601eb7010f1ae5620
[ "MIT" ]
permissive
rosberry/Deboogger
9378a944c00b00b7708ba85ee76361a128bc464f
4743eb2e9c59a549f414565ed573d568d4bc9b76
refs/heads/master
2022-11-04T11:35:19.620413
2022-10-17T06:31:01
2022-10-17T06:31:01
171,634,430
6
0
MIT
2022-10-17T06:31:14
2019-02-20T08:43:44
Swift
UTF-8
Swift
false
false
795
swift
// // Copyright © 2019 Rosberry. All rights reserved. // import UIKit final class PerformanceMonitorPlugin: SwitchPlugin { var isOn: Bool { UserDefaults.standard.isPerformanceMonitorEnabled } let title: NSAttributedString = .init(string: "Performance monitor") init() { Deboogger.shared.shouldShowPerformanceMonitor = isOn } func switchStateChanged(_ sender: UISwitch) { UserDefaults.standard.isPerformanceMonitorEnabled = sender.isOn Deboogger.shared.updatePerformanceMonitor(hidden: sender.isOn == false) } } private extension UserDefaults { var isPerformanceMonitorEnabled: Bool { get { bool(forKey: #function) } set { set(newValue, forKey: #function) } } }
[ -1 ]
00645f447fabaff7f25c12d3b9f75b3286a10ef7
87b791c08195feafa7903baa4b667a846a69ff7e
/DemoApp/Extensions/DAUIView+Extensions.swift
360118998c7dadecf33edbe1eb87682fa21fd950
[]
no_license
mauli787/MVVMDemo
7cbc2e7fd6475d33b0f4f04e58bdc8d6f58e514e
af0cc7c9ce8f85a377614130f2fc3f213a5316d4
refs/heads/master
2023-02-13T14:52:05.366780
2021-01-16T06:19:52
2021-01-16T06:19:52
330,097,830
0
0
null
null
null
null
UTF-8
Swift
false
false
209
swift
// // DetailViewController.swift // DemoApp // // Created by Dnyaneshwar on 09/01/21. // import UIKit extension UIView { static var className: String { return String(describing: self) } }
[ -1 ]
7e352002bba8410796267b4b4e1438b35372edcd
8c1c140ac695505a146160f8615dc90c383f19f1
/xCode8GitTests/xCode8GitTests.swift
1de1504d8011e11291cc96638d64e871bd4d95d7
[]
no_license
Shutternick/xCode8Git
0b6d255b5b63d2dfe4b9d61483785db298ba8d33
1cf2644a69429710a874120711194affcd395c9f
refs/heads/master
2021-01-20T17:47:03.334215
2017-05-10T18:15:39
2017-05-10T18:15:39
90,887,130
0
0
null
null
null
null
UTF-8
Swift
false
false
985
swift
// // xCode8GitTests.swift // xCode8GitTests // // Created by Dominic Gadoury on 5/10/17. // Copyright © 2017 Dominic Gadoury. All rights reserved. // import XCTest @testable import xCode8Git class xCode8GitTests: 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, 245457, 313357, 182296, 145435, 241692, 98333, 278558, 16419, 102437, 229413, 292902, 204840, 354345, 227370, 278570, 223274, 233517, 155694, 344107, 229424, 124975, 253999, 346162, 229430, 319542, 180280, 124984, 358456, 213052, 325694, 288833, 286788, 352326, 311372, 311374, 354385, 196691, 223316, 280661, 315476, 329814, 278615, 307289, 338007, 200794, 354393, 315487, 237663, 309345, 280675, 227428, 280677, 307299, 313447, 278634, 194666, 315498, 319598, 288879, 352368, 299121, 284788, 233589, 223350, 233590, 280694, 204916, 237689, 333940, 215164, 313469, 131198, 215166, 292992, 278655, 194691, 227460, 333955, 280712, 215178, 235662, 311438, 241808, 323729, 325776, 317587, 278677, 284826, 278685, 346271, 311458, 278691, 233636, 49316, 299174, 333991, 333992, 284841, 233642, 284842, 278699, 32941, 323236, 278704, 239793, 278708, 125109, 131256, 182456, 278714, 223419, 280762, 295098, 299198, 184505, 379071, 299203, 301251, 309444, 338119, 280778, 282831, 321745, 254170, 280795, 227548, 229597, 301279, 356576, 280802, 338150, 176362, 286958, 125169, 338164, 327929, 184570, 243962, 227578, 125183, 309503, 125188, 184584, 313608, 125193, 375051, 278797, 180493, 125198, 325905, 254226, 125203, 361927, 125208, 325912, 299293, 278816, 282913, 125217, 233762, 217380, 211235, 211238, 305440, 151847, 282919, 125235, 332085, 280887, 125240, 332089, 278842, 315706, 282939, 307517, 287041, 241986, 287043, 260418, 139589, 280902, 319813, 332101, 182598, 323916, 319821, 254286, 348492, 250192, 6481, 323920, 344401, 348500, 366929, 289110, 155990, 366930, 6489, 272729, 379225, 323935, 106847, 391520, 321894, 416104, 280939, 242029, 246127, 285040, 313713, 354676, 291192, 139640, 246136, 246137, 313727, 311681, 362881, 248194, 311685, 225670, 395659, 227725, 227726, 395661, 240016, 190871, 291224, 317852, 283038, 61857, 285090, 381347, 61859, 289189, 375207, 289194, 340398, 377264, 299441, 61873, 283064, 61880, 278970, 319930, 336317, 293310, 299456, 278978, 127427, 127428, 283075, 188871, 324039, 278989, 317901, 281040, 278993, 326100, 278999, 328152, 176601, 242139, 369116, 188894, 287198, 279008, 227809, 160225, 285150, 342498, 242148, 195045, 279013, 279018, 311786, 291311, 281072, 279029, 293367, 279032, 233978, 279039, 291333, 342536, 287241, 279050, 340490, 283153, 289304, 279065, 342553, 291358, 182817, 180771, 375333, 377386, 293419, 244269, 283182, 283184, 236081, 234036, 23092, 279094, 315960, 352829, 242237, 70209, 115270, 70215, 293448, 309830, 301638, 348742, 322120, 55881, 348749, 281166, 281171, 244310, 285271, 297560, 295519, 354911, 436832, 242273, 66150, 111208, 344680, 279146, 191082, 313966, 281199, 295536, 287346, 287352, 301689, 279164, 291454, 189057, 311941, 348806, 279177, 369289, 152203, 330379, 344715, 184973, 311949, 311954, 330387, 330388, 117397, 352917, 227990, 230040, 271000, 289434, 303771, 342682, 221852, 205471, 279206, 295590, 287404, 205487, 295599, 303793, 285361, 299699, 299700, 342706, 166582, 164533, 314040, 287417, 158394, 285371, 338613, 285373, 287422, 342713, 230072, 66242, 225995, 154316, 363211, 333521, 287439, 279252, 333523, 96984, 318173, 289502, 363230, 295652, 279269, 338662, 285415, 342762, 346858, 330474, 289518, 299759, 279280, 312047, 199414, 154359, 230134, 299770, 234234, 353069, 35583, 205568, 291585, 295682, 242433, 299776, 162561, 363263, 285444, 291592, 322313, 322319, 295697, 285458, 291604, 166676, 310036, 207640, 291612, 326429, 336671, 326433, 344865, 234277, 283430, 289576, 279336, 262954, 293672, 295724, 318250, 152365, 301871, 164656, 295729, 303920, 262962, 285487, 312108, 234294, 230199, 328499, 242485, 353078, 353079, 285497, 293693, 336702, 342847, 281408, 295746, 420677, 318278, 353094, 353095, 299849, 283467, 201551, 293711, 281427, 353109, 281433, 230234, 301918, 295776, 279392, 293730, 349026, 303972, 351077, 275303, 230248, 177001, 342887, 308076, 242541, 400239, 246641, 330609, 207732, 209783, 246648, 209785, 279417, 269178, 177019, 361337, 158593, 254850, 359298, 113542, 287622, 240518, 228233, 228234, 308107, 295824, 56208, 308112, 234386, 293781, 209817, 324506, 324507, 318364, 310176, 289698, 310178, 189348, 324517, 283558, 289703, 279464, 293800, 353195, 140204, 236461, 293806, 353197, 304051, 189374, 289727, 353216, 349121, 363458, 19399, 213960, 279498, 316364, 338899, 340955, 248797, 207838, 50143, 130016, 340961, 64485, 314342, 123881, 324586, 289774, 183279, 304110, 320494, 340974, 287731, 314355, 316405, 240630, 295927, 201720, 304122, 314362, 320507, 328700, 328706, 330754, 234500, 320516, 134150, 322570, 230410, 320527, 146448, 324625, 234514, 316437, 140310, 418837, 197657, 281626, 201755, 336929, 189474, 300068, 330788, 357414, 248872, 345132, 238639, 300084, 252980, 322612, 359478, 324666, 302139, 238651, 308287, 21569, 359495, 238664, 300111, 314448, 234577, 341073, 296019, 353367, 234587, 156764, 277597, 304222, 156765, 113760, 281697, 302177, 314467, 281700, 250981, 300135, 300136, 322663, 228458, 316520, 279660, 207979, 316526, 15471, 357486, 300146, 187506, 353397, 285814, 300151, 279672, 291959, 160891, 341115, 363644, 300158, 150657, 187521, 248961, 285828, 279685, 302213, 222343, 302216, 349316, 349318, 228491, 330888, 228493, 234638, 285838, 169104, 162961, 177296, 308372, 185493, 296086, 238743, 326804, 119962, 300187, 296092, 300188, 339102, 302240, 306338, 343203, 234663, 300201, 249002, 300202, 253099, 238765, 3246, 279728, 238769, 367799, 294074, 339130, 230588, 64700, 283840, 302274, 279747, 343234, 367810, 259268, 283847, 353479, 62665, 353481, 353482, 244940, 283852, 283853, 279760, 290000, 228563, 189652, 279765, 189653, 333011, 296153, 357595, 279774, 304351, 298212, 298213, 304356, 330984, 279785, 228588, 234733, 328940, 253167, 279792, 353523, 298228, 302325, 234742, 228600, 216315, 292091, 208124, 316669, 363771, 388349, 228609, 234755, 279814, 322824, 242954, 292107, 312587, 328971, 251153, 173334, 245019, 320796, 126237, 339234, 130338, 304421, 130343, 279854, 351537, 345396, 300343, 116026, 222524, 286018, 113987, 193859, 279875, 300359, 304456, 230729, 294218, 234827, 224586, 372043, 296270, 234831, 238927, 296273, 177484, 251213, 120148, 318805, 357719, 283991, 222559, 314720, 234850, 292195, 294243, 230756, 281957, 163175, 333160, 230765, 284014, 306542, 279920, 296303, 243056, 296307, 312689, 314739, 116084, 327025, 327031, 111993, 290173, 306559, 148867, 179587, 378244, 298374, 314758, 314760, 142729, 388487, 368011, 314766, 296335, 318864, 112017, 234898, 306579, 112018, 282007, 357786, 318875, 290207, 314783, 310692, 333220, 282022, 314789, 282024, 279974, 241066, 316842, 310701, 279984, 286129, 173491, 279989, 210358, 284089, 228795, 292283, 302529, 415171, 302531, 163268, 380357, 300487, 306631, 296392, 280010, 284107, 310732, 302540, 312782, 64975, 306639, 300489, 370123, 222675, 148940, 280013, 327121, 366037, 210390, 210391, 353750, 228827, 286172, 210393, 239068, 280032, 144867, 310757, 187878, 280041, 361963, 54765, 191981, 306673, 321009, 308723, 251378, 306677, 343542, 300535, 300536, 280055, 288249, 286202, 290300, 286205, 302590, 228861, 294400, 230913, 282114, 300542, 306692, 306693, 290301, 210433, 228867, 230921, 366083, 323080, 253452, 296461, 323087, 304656, 282129, 329232, 316946, 308756, 146964, 398869, 282136, 308764, 282141, 349726, 230943, 282146, 306723, 286244, 245287, 313339, 245292, 349741, 169518, 230959, 286254, 288309, 290358, 312889, 288318, 235070, 280130, 349763, 124485, 56902, 282183, 218696, 288326, 288327, 292425, 243274, 128587, 333388, 228943, 286288, 333393, 280147, 290390, 300630, 235095, 306776, 196187, 239198, 343647, 286306, 374372, 282213, 317032, 310889, 323178, 54893, 138863, 222832, 325231, 314998, 247416, 366203, 175741, 337535, 294529, 239237, 224901, 286343, 288392, 229001, 282245, 290443, 310923, 282246, 188048, 323217, 239250, 302739, 282259, 345752, 229020, 298654, 282271, 282273, 302754, 255649, 282276, 40613, 40614, 40615, 282280, 290471, 300714, 298667, 298661, 245412, 229029, 286388, 318252, 286391, 321207, 296632, 319162, 280251, 282303, 286399, 280257, 218819, 321219, 306890, 280267, 212685, 282318, 333517, 212688, 9936, 302802, 9937, 333520, 241361, 280278, 286423, 280280, 278233, 278234, 298712, 67292, 18138, 294622, 321247, 278240, 229088, 298720, 153319, 12010, 280300, 239341, 212716, 212717, 282348, 284401, 282358, 313081, 229113, 286459, 325371, 124669, 194303, 194304, 288512, 278272, 175873, 288516, 319233, 323331, 280327, 323332, 280329, 300811, 284429, 321295, 278291, 294678, 321302, 366360, 116505, 284442, 249626, 325404, 286494, 321310, 282400, 241441, 325410, 339745, 341796, 241442, 247590, 257830, 294700, 280366, 317232, 282417, 200498, 296755, 280372, 280374, 319288, 321337, 282427, 280380, 360252, 325439, 282434, 307011, 315202, 280390, 282438, 280392, 345929, 341836, 304977, 307025, 413521, 325457, 18262, 216918, 307031, 280410, 284507, 370522, 188251, 300894, 245599, 237408, 284512, 284514, 302946, 345951, 362337, 296806, 276327, 345955, 292712, 282474, 288619, 288620, 325484, 313199, 282480, 292720, 362352, 313203, 325492, 300918, 241528, 194429, 124798, 325503, 182144, 305026, 253829, 333701, 67463, 282504, 315273, 315274, 243591, 243597, 325518, 110480, 184208, 282518, 282519, 124824, 214937, 214938, 294809, 239514, 329622, 294814, 118685, 298909, 319392, 300963, 292771, 354212, 294823, 298920, 333735, 284587, 292782, 323507, 124852, 243637, 288697, 294843, 98239, 214977, 280514, 343543, 163781, 280519, 344013, 247757, 231375, 301008, 153554, 194515, 24532, 212946, 280541, 219101, 292836, 292837, 298980, 294886, 337895, 247785, 253929, 296941, 327661, 362480, 311282, 325619, 333817, 292858, 290811 ]
2958b1aa3613627e1de6c1e250a607e541d5ccba
1a174ecf1716442dd202596eeab80cf80d013540
/SearchBarProshenjit/AppDelegate.swift
1f1bc396335a77d665bb487ec9d9b072227b3072
[]
no_license
Proshenjit123/Search
ee8cdff295d2d3c3b5a1bddefb8162a34baa0a50
8753ebd24a98f9ff6e5c367f7d070224bf4253bf
refs/heads/master
2021-01-06T08:59:26.425211
2020-02-18T04:18:18
2020-02-18T04:18:18
241,270,340
0
0
null
null
null
null
UTF-8
Swift
false
false
1,436
swift
// // AppDelegate.swift // SearchBarProshenjit // // Created by Proshenjit kumar on 17/2/20. // Copyright © 2020 Proshenjit kumar. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } // MARK: UISceneSession Lifecycle func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { // Called when a new scene session is being created. // Use this method to select a configuration to create the new scene with. return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) } func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) { // Called when the user discards a scene session. // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. // Use this method to release any resources that were specific to the discarded scenes, as they will not return. } }
[ 393222, 393224, 393230, 393250, 344102, 393261, 393266, 213048, 376889, 385081, 393275, 376905, 254030, 368727, 180313, 368735, 180320, 376931, 417924, 262283, 377012, 327871, 180416, 377036, 180431, 377046, 377060, 327914, 205036, 393456, 393460, 336123, 418043, 385280, 262404, 180490, 368911, 262422, 377117, 262436, 336180, 262454, 393538, 262472, 344403, 213332, 65880, 262496, 418144, 262499, 213352, 246123, 262507, 262510, 213372, 385419, 393612, 262550, 262552, 385440, 385443, 385451, 262573, 393647, 385458, 262586, 344511, 262592, 360916, 369118, 328177, 328179, 328182, 328189, 328192, 164361, 410128, 393747, 254490, 385570, 33316, 377383, 197159, 352821, 188987, 369223, 385616, 352864, 369253, 262760, 352874, 254587, 377472, 336512, 148105, 377484, 352918, 98968, 361129, 434867, 164534, 336567, 328378, 328386, 352968, 344776, 352971, 418507, 352973, 385742, 385748, 361179, 189153, 369381, 361195, 418553, 344831, 336643, 344835, 344841, 361230, 336659, 418580, 418585, 434970, 369435, 418589, 262942, 418593, 336675, 328484, 418598, 418605, 336696, 361273, 328515, 336708, 336711, 328519, 328522, 336714, 197468, 361309, 361315, 361322, 328573, 369542, 361360, 222128, 345035, 386003, 345043, 386011, 386018, 386022, 435187, 328714, 361489, 386069, 336921, 386073, 336925, 345118, 377887, 345133, 345138, 386101, 361536, 197707, 345169, 156761, 361567, 345199, 386167, 361593, 410745, 361598, 214149, 386186, 337047, 345246, 214175, 337071, 337075, 345267, 386258, 328924, 66782, 222437, 328941, 386285, 386291, 345376, 345379, 410917, 337205, 345399, 378169, 369978, 337222, 337229, 337234, 263508, 402791, 345448, 271730, 378227, 181638, 353673, 181643, 181654, 230809, 181673, 181681, 337329, 181684, 361917, 181696, 337349, 337365, 271839, 329191, 361960, 329194, 116210, 337398, 337415, 329226, 419339, 419343, 419349, 419355, 370205, 419359, 419362, 394786, 370213, 419368, 419376, 206395, 214593, 419400, 419402, 353867, 419406, 419410, 345701, 394853, 222830, 370297, 403070, 353919, 403075, 198280, 345736, 403091, 345762, 419491, 345765, 419497, 419501, 370350, 419509, 337592, 419512, 337599, 419527, 419530, 419535, 272081, 394966, 419542, 419544, 181977, 345818, 419547, 419550, 419559, 337642, 419563, 337645, 370415, 337659, 337668, 362247, 395021, 362255, 116509, 345887, 345905, 354111, 247617, 354117, 329544, 345930, 370509, 247637, 337750, 313180, 403320, 247691, 337808, 247700, 329623, 436126, 436132, 337833, 337844, 346057, 247759, 346063, 329697, 354277, 190439, 247789, 354313, 346139, 436289, 378954, 395339, 338004, 100453, 329832, 329855, 329867, 329885, 346272, 362660, 100524, 387249, 379066, 387260, 256191, 395466, 346316, 411861, 411864, 411868, 411873, 379107, 411876, 387301, 346343, 338152, 387306, 387312, 346355, 436473, 379134, 411903, 379152, 395538, 387349, 338199, 387352, 182558, 338211, 248111, 362822, 436555, 190796, 379233, 248186, 420236, 379278, 272786, 354727, 338352, 330189, 338386, 256472, 338403, 338409, 248308, 199164, 330252, 420376, 330267, 354855, 10828, 199249, 174695, 248425, 191084, 338543, 191092, 346742, 330383, 354974, 150183, 174774, 248504, 174777, 223934, 355024, 273108, 264918, 183005, 256734, 338660, 338664, 264941, 207619, 338700, 256786, 199452, 363293, 396066, 346916, 396069, 215853, 355122, 355131, 355140, 355143, 338763, 355150, 330580, 355166, 355175, 387944, 355179, 330610, 330642, 355218, 412599, 207808, 379848, 396245, 248792, 248798, 347105, 257008, 183282, 330748, 330760, 330768, 248862, 396328, 158761, 199728, 330800, 396336, 396339, 339001, 388154, 388161, 347205, 248904, 330826, 248914, 412764, 339036, 257120, 248951, 420984, 330889, 248985, 339097, 44197, 380070, 339112, 249014, 330965, 388319, 388347, 175375, 159005, 175396, 208166, 273708, 372015, 347441, 372018, 199988, 44342, 175415, 396600, 437566, 175423, 437570, 437575, 437583, 331088, 437587, 331093, 396633, 175450, 437595, 175457, 208227, 175460, 175463, 437620, 175477, 249208, 175483, 175486, 249214, 175489, 249218, 249227, 175513, 175516, 396705, 175522, 355748, 380332, 396722, 208311, 388542, 372163, 216517, 380360, 216522, 339404, 372176, 208337, 339412, 339417, 339420, 249308, 339424, 339428, 339434, 249328, 69113, 372228, 339461, 208398, 380432, 175635, 265778, 265795, 396872, 265805, 224853, 224857, 257633, 224870, 257646, 372337, 224884, 224887, 224890, 224894, 224897, 372353, 216707, 126596, 224904, 159374, 11918, 224913, 126610, 224916, 224919, 126616, 224922, 224926, 224929, 224932, 257704, 224936, 224942, 257712, 224947, 257716, 257720, 257724, 224959, 257732, 224965, 339662, 224975, 257747, 224981, 224986, 257761, 224993, 257764, 224999, 339695, 225012, 225020, 257790, 339710, 225025, 257794, 257801, 339721, 257804, 225038, 257807, 225043, 167700, 372499, 225048, 257819, 225053, 225058, 339747, 339749, 257833, 225066, 257836, 413484, 225070, 225073, 372532, 257845, 397112, 225082, 397115, 225087, 225092, 323402, 257868, 225103, 257871, 397139, 225108, 225112, 257883, 257886, 225119, 339814, 225127, 257896, 274280, 257901, 225137, 257908, 225141, 257912, 225148, 257916, 257920, 225155, 339844, 225165, 397200, 225170, 380822, 225175, 225180, 118691, 184244, 372664, 372702, 356335, 380918, 405533, 430129, 266294, 266297, 421960, 356439, 266350, 266362, 381068, 225423, 250002, 250004, 225429, 356506, 225437, 135327, 225441, 438433, 225444, 438436, 225447, 438440, 225450, 258222, 225455, 225458, 225461, 225466, 225470, 381120, 372929, 430274, 225475, 389320, 225484, 225487, 225490, 225493, 266453, 225496, 225499, 225502, 225505, 356578, 217318, 225510, 225514, 225518, 372976, 381176, 389380, 61722, 356637, 356640, 356643, 356646, 266536, 356649, 356655, 332080, 340275, 356660, 397622, 332090, 332097, 201028, 348488, 332106, 332117, 348502, 250199, 250202, 332125, 250210, 332152, 250238, 389502, 356740, 332172, 340379, 389550, 324030, 266687, 340451, 160234, 127471, 340472, 324094, 266754, 324099, 324102, 324111, 324117, 324131, 332324, 381481, 356907, 324139, 324142, 356916, 324149, 324155, 348733, 324160, 324164, 348743, 324170, 324173, 324176, 389723, 332380, 381545, 340627, 373398, 184982, 258721, 332453, 332459, 389805, 332463, 381617, 332471, 332483, 332486, 373449, 332493, 357069, 357073, 332511, 332520, 340718, 332533, 348924, 373510, 389926, 152370, 340789, 348982, 398139, 127814, 389978, 430939, 201579, 201582, 349040, 340849, 201588, 381813, 430965, 324472, 398201, 119674, 324475, 340858, 340861, 324478, 324481, 373634, 398211, 324484, 324487, 381833, 324492, 324495, 324498, 430995, 324501, 324510, 422816, 324513, 398245, 201637, 324524, 324533, 324538, 324541, 398279, 340939, 340941, 340957, 431072, 398306, 340963, 201711, 381946, 349180, 439294, 431106, 209943, 250914, 357410, 357418, 209965, 209968, 209971, 209987, 209990, 341071, 349267, 250967, 341091, 210027, 210039, 341113, 210044, 349308, 160895, 349311, 152703, 210052, 349319, 210067, 210071, 210077, 210080, 251044, 185511, 210088, 210095, 210098, 210115, 332997, 333009, 333014, 210138, 218354, 218360, 251128, 275706, 275712, 275715, 275721, 349459, 333078, 251160, 349484, 349491, 251189, 415033, 251210, 259421, 365921, 333154, 251235, 333162, 234866, 390516, 333175, 136590, 112020, 349590, 357792, 259515, 415166, 415185, 366034, 366038, 415193, 415199, 423392, 333284, 415207, 366056, 366061, 415216, 210420, 423423, 415257, 415263, 366117, 415270, 144939, 415278, 415281, 415285, 210487, 415290, 415293, 349761, 415300, 333386, 333399, 366172, 333413, 423528, 423532, 210544, 415353, 333439, 415361, 267909, 153227, 333498, 210631, 333511, 259788, 358099, 153302, 333534, 366311, 366318, 210672, 366321, 366325, 210695, 210698, 366348, 210706, 399128, 210719, 358191, 210739, 366387, 399159, 358200, 325440, 366401, 341829, 325446, 46920, 341834, 341838, 341843, 415573, 341851, 350045, 399199, 259938, 399206, 268143, 358255, 399215, 358259, 341876, 333689, 243579, 325504, 333698, 333708, 333724, 382890, 350146, 333774, 358371, 350189, 350193, 350202, 333818, 350206, 350213, 268298, 350224, 350231, 333850, 350237, 350244, 350248, 178218, 350251, 350256, 350271, 243781, 350285, 374864, 342111, 342133, 374902, 432271, 334011, 260289, 350410, 260298, 350416, 350422, 211160, 350425, 268507, 334045, 350445, 375026, 358644, 350458, 350461, 350464, 350467, 325891, 350475, 268559, 350480, 350486, 350490, 325914, 350493, 325917, 350498, 350504, 358700, 391468, 350509, 358704, 358713, 358716, 383306, 334161, 383321, 383330, 391530, 383341, 334203, 268668, 194941, 391563, 366990, 268701, 416157, 342430, 375208, 326058, 375216, 334262, 334275, 326084, 358856, 334304, 334311, 375277, 334321, 350723, 186897, 342545, 334358, 342550, 342554, 334363, 358941, 350761, 252461, 334384, 358961, 383536, 334394, 252482, 219718, 334407, 334420, 350822, 375400, 334465, 334468, 162445, 326290, 342679, 342683, 260766, 342710, 244409, 260797, 260801, 350917, 391894, 154328, 416473, 64230, 342766, 375535, 203506, 342776, 391937, 391948, 375568, 326416, 375571, 375574, 162591, 326441, 326451, 326454, 326460, 244540, 375612, 326467, 244551, 326473, 326477, 326485, 326490, 326502, 375656, 433000, 326507, 326510, 211825, 211831, 351097, 392060, 359295, 351104, 400259, 342915, 236430, 342930, 252822, 392091, 400285, 252836, 359334, 211884, 400306, 351168, 359361, 359366, 326598, 359382, 359388, 383967, 343015, 359407, 261108, 244726, 261111, 383997, 261129, 359451, 261147, 211998, 261153, 261159, 359470, 359476, 343131, 384098, 384101, 367723, 384107, 187502, 343154, 384114, 212094, 351364, 384135, 384139, 384143, 351381, 384160, 384168, 367794, 384181, 351423, 384191, 384198, 326855, 244937, 253130, 343244, 146642, 359649, 343270, 351466, 351479, 384249, 343306, 261389, 253200, 261393, 384275, 245020, 245029, 351534, 376110, 245040, 384314, 425276, 384323, 212291, 343365, 212303, 343393, 343398, 425328, 343409, 253303, 154999, 343417, 327034, 245127, 245136, 245142, 245145, 343450, 245148, 245151, 245154, 245157, 245162, 327084, 359865, 384443, 146876, 327107, 384453, 327110, 327115, 327117, 359886, 359890, 343507, 368092, 343534, 343539, 343544, 368122, 359947, 359955, 359983, 327275, 245357, 138864, 155254, 155273, 425638, 155322, 155327, 155351, 155354, 212699, 155363, 245475, 155371, 245483, 409335, 155393, 155403, 245525, 155422, 360223, 155438, 155442, 155447, 155461, 360261, 376663, 155482, 261981, 425822, 155487, 376671, 155490, 155491, 327531, 261996, 376685, 261999, 262002, 327539, 425845, 262005, 147317, 262008, 262011, 155516, 155521, 155525, 360326, 376714, 262027, 155531, 262030, 262036, 262039, 262042, 155549, 262045, 262048, 262051, 327589, 155559, 155562, 155565, 393150, 384977, 393169, 155611, 155619, 253923, 155621, 253926, 393203, 360438, 253943, 393206, 393212, 155646 ]
f85692d2b3837d13ed7ef07463a78a74a67e8771
21a47bcb0bf0a24fadefc8db00521ff9ea65e99f
/TimeTableTests/Models/BussinessModels/WorkTimes/WorkTimesParametersTests.swift
d898e0d2d94d44f7e89392ab8f29ab021a57600e
[]
no_license
sprzenus/timetable-ios
e76d93fa3f7e5d21f15b3ee7af242bf329ec672d
190d6acc05cb36b3c2112f7bfa00179bcb76809d
refs/heads/develop
2020-04-29T16:50:40.543278
2019-10-16T11:06:34
2019-10-16T11:06:34
176,275,433
0
0
null
2019-04-09T14:11:14
2019-03-18T12:06:36
Swift
UTF-8
Swift
false
false
10,181
swift
// // WorkTimesParametersTests.swift // TimeTableTests // // Created by Piotr Pawluś on 22/11/2018. // Copyright © 2018 Railwaymen. All rights reserved. // import XCTest @testable import TimeTable class WorkTimesParametersTests: XCTestCase { private var encoder: JSONEncoder = { let encoder = JSONEncoder() encoder.dateEncodingStrategy = .formatted(DateFormatter(type: .dateAndTimeExtended)) encoder.outputFormatting = .prettyPrinted return encoder }() private lazy var dateFormatter: DateFormatter = { return DateFormatter(type: .dateAndTimeExtended) }() func testWorkTimeRequest() throws { //Arrange let projectIdentifier = 3 var components = DateComponents(timeZone: TimeZone(secondsFromGMT: 3600), year: 2018, month: 11, day: 22, hour: 10, minute: 30) let fromDate = try Calendar.current.date(from: components).unwrap() components.hour = 12 components.minute = 0 let toDate = try Calendar.current.date(from: components).unwrap() let workTimesParameters = WorkTimesParameters(fromDate: fromDate, toDate: toDate, projectIdentifier: projectIdentifier) //Act let data = try encoder.encode(workTimesParameters) let requestDictionary = try JSONSerialization.jsonObject(with: data, options: .allowFragments) as? [AnyHashable: Any] //Assert XCTAssertEqual(try (requestDictionary?["project_id"] as? Int).unwrap(), projectIdentifier) let expectedFromDateString = try (requestDictionary?["from"] as? String).unwrap() let expectedFromDate = try dateFormatter.date(from: expectedFromDateString).unwrap() XCTAssertEqual(expectedFromDate, fromDate) let expectedToDateString = try (requestDictionary?["to"] as? String).unwrap() let expectedToDate = try dateFormatter.date(from: expectedToDateString).unwrap() XCTAssertEqual(expectedToDate, toDate) } func testWorkTimeRequestNullPorjectIdentifier() throws { //Arrange var components = DateComponents(timeZone: TimeZone(secondsFromGMT: 3600), year: 2018, month: 11, day: 22, hour: 10, minute: 30) let fromDate = try Calendar.current.date(from: components).unwrap() components.hour = 12 components.minute = 0 let toDate = try Calendar.current.date(from: components).unwrap() let workTimesParameters = WorkTimesParameters(fromDate: fromDate, toDate: toDate, projectIdentifier: nil) //Act let data = try encoder.encode(workTimesParameters) let requestDictionary = try JSONSerialization.jsonObject(with: data, options: .allowFragments) as? [AnyHashable: Any] //Assert XCTAssertNil(requestDictionary?["project_id"] as? Int) let expectedFromDateString = try (requestDictionary?["from"] as? String).unwrap() let expectedFromDate = try dateFormatter.date(from: expectedFromDateString).unwrap() XCTAssertEqual(expectedFromDate, fromDate) let expectedToDateString = try (requestDictionary?["to"] as? String).unwrap() let expectedToDate = try dateFormatter.date(from: expectedToDateString).unwrap() XCTAssertEqual(expectedToDate, toDate) } func testWorkTimeRequestNullFrom() throws { //Arrange let projectIdentifier = 3 let components = DateComponents(timeZone: TimeZone(secondsFromGMT: 3600), year: 2018, month: 11, day: 22, hour: 12, minute: 0) let toDate = try Calendar.current.date(from: components).unwrap() let workTimesParameters = WorkTimesParameters(fromDate: nil, toDate: toDate, projectIdentifier: projectIdentifier) //Act let data = try encoder.encode(workTimesParameters) let requestDictionary = try JSONSerialization.jsonObject(with: data, options: .allowFragments) as? [AnyHashable: Any] //Assert XCTAssertEqual(try (requestDictionary?["project_id"] as? Int).unwrap(), projectIdentifier) XCTAssertNil(requestDictionary?["from"] as? String) let expectedToDateString = try (requestDictionary?["to"] as? String).unwrap() let expectedToDate = try dateFormatter.date(from: expectedToDateString).unwrap() XCTAssertEqual(expectedToDate, toDate) } func testWorkTimeRequestNullTo() throws { //Arrange let projectIdentifier = 3 let components = DateComponents(timeZone: TimeZone(secondsFromGMT: 3600), year: 2018, month: 11, day: 22, hour: 10, minute: 30) let fromDate = try Calendar.current.date(from: components).unwrap() let workTimesParameters = WorkTimesParameters(fromDate: fromDate, toDate: nil, projectIdentifier: projectIdentifier) //Act let data = try encoder.encode(workTimesParameters) let requestDictionary = try JSONSerialization.jsonObject(with: data, options: .allowFragments) as? [AnyHashable: Any] //Assert XCTAssertEqual(try (requestDictionary?["project_id"] as? Int).unwrap(), projectIdentifier) let expectedFromDateString = try (requestDictionary?["from"] as? String).unwrap() let expectedFromDate = try dateFormatter.date(from: expectedFromDateString).unwrap() XCTAssertEqual(expectedFromDate, fromDate) XCTAssertNil(requestDictionary?["to"] as? String) } func testWorkTimesAreEquatbleWhileAllPrametersAreNil() { //Arrange let firstWorkTime = WorkTimesParameters(fromDate: nil, toDate: nil, projectIdentifier: nil) let secondWorkTime = WorkTimesParameters(fromDate: nil, toDate: nil, projectIdentifier: nil) //Assert XCTAssertEqual(firstWorkTime, secondWorkTime) } func testWorkTimesAreEquatbleWhileProjectIsThisSame() { //Arrange let firstWorkTime = WorkTimesParameters(fromDate: nil, toDate: nil, projectIdentifier: 1) let secondWorkTime = WorkTimesParameters(fromDate: nil, toDate: nil, projectIdentifier: 1) //Assert XCTAssertEqual(firstWorkTime, secondWorkTime) } func testWorkTimesAreNotEquatbleWhileProjectIsNotThisSame() { //Arrange let firstWorkTime = WorkTimesParameters(fromDate: nil, toDate: nil, projectIdentifier: 1) let secondWorkTime = WorkTimesParameters(fromDate: nil, toDate: nil, projectIdentifier: 2) //Assert XCTAssertNotEqual(firstWorkTime, secondWorkTime) } func testWorkTimesAreEquatbleWhileFromIsThisSame() throws { //Arrange let components = DateComponents(timeZone: TimeZone(secondsFromGMT: 3600), year: 2018, month: 11, day: 22, hour: 10, minute: 30) let fromDate = try Calendar.current.date(from: components).unwrap() let firstWorkTime = WorkTimesParameters(fromDate: fromDate, toDate: nil, projectIdentifier: nil) let secondWorkTime = WorkTimesParameters(fromDate: fromDate, toDate: nil, projectIdentifier: nil) //Assert XCTAssertEqual(firstWorkTime, secondWorkTime) } func testWorkTimesAreNotEquatbleWhileFromIsNotThisSame() throws { //Arrange let components = DateComponents(timeZone: TimeZone(secondsFromGMT: 3600), year: 2018, month: 11, day: 22, hour: 10, minute: 30) let fromDate = try Calendar.current.date(from: components).unwrap() let firstWorkTime = WorkTimesParameters(fromDate: fromDate, toDate: nil, projectIdentifier: nil) let secondWorkTime = WorkTimesParameters(fromDate: nil, toDate: nil, projectIdentifier: nil) //Assert XCTAssertNotEqual(firstWorkTime, secondWorkTime) } func testWorkTimesAreEquatbleWhileToDateIsThisSame() throws { //Arrange let components = DateComponents(timeZone: TimeZone(secondsFromGMT: 3600), year: 2018, month: 11, day: 22, hour: 10, minute: 30) let toDate = try Calendar.current.date(from: components).unwrap() let firstWorkTime = WorkTimesParameters(fromDate: nil, toDate: toDate, projectIdentifier: nil) let secondWorkTime = WorkTimesParameters(fromDate: nil, toDate: toDate, projectIdentifier: nil) //Assert XCTAssertEqual(firstWorkTime, secondWorkTime) } func testWorkTimesAreNotEquatbleWhileToDateIsNotThisSame() throws { //Arrange let components = DateComponents(timeZone: TimeZone(secondsFromGMT: 3600), year: 2018, month: 11, day: 22, hour: 10, minute: 30) let toDate = try Calendar.current.date(from: components).unwrap() let firstWorkTime = WorkTimesParameters(fromDate: nil, toDate: toDate, projectIdentifier: nil) let secondWorkTime = WorkTimesParameters(fromDate: nil, toDate: nil, projectIdentifier: nil) //Assert XCTAssertNotEqual(firstWorkTime, secondWorkTime) } func testWorkTimesAreEquatbleWhileAllParametersAreThisSame() throws { //Arrange var components = DateComponents(timeZone: TimeZone(secondsFromGMT: 3600), year: 2018, month: 11, day: 22, hour: 10, minute: 30) let fromDate = try Calendar.current.date(from: components).unwrap() components.hour = 11 let toDate = try Calendar.current.date(from: components).unwrap() let firstWorkTime = WorkTimesParameters(fromDate: fromDate, toDate: toDate, projectIdentifier: 1) let secondWorkTime = WorkTimesParameters(fromDate: fromDate, toDate: toDate, projectIdentifier: 1) //Assert XCTAssertEqual(firstWorkTime, secondWorkTime) } func testWorkTimesAreNotEquatbleWithDiffrenetParameters() throws { //Arrange var components = DateComponents(timeZone: TimeZone(secondsFromGMT: 3600), year: 2018, month: 11, day: 22, hour: 10, minute: 30) let fromDate = try Calendar.current.date(from: components).unwrap() components.hour = 11 let toDate = try Calendar.current.date(from: components).unwrap() let firstWorkTime = WorkTimesParameters(fromDate: fromDate, toDate: toDate, projectIdentifier: 1) let secondWorkTime = WorkTimesParameters(fromDate: nil, toDate: nil, projectIdentifier: nil) //Assert XCTAssertNotEqual(firstWorkTime, secondWorkTime) } }
[ -1 ]
22bd42d3ffc072fdd74bc04c619b000f12d92f64
dc8687ec042462520fd94b87a93a81ebb6fbbab6
/Sources/AutolayoutExtensions/UIImageViewExtensions.swift
a7db8071510008345c2f1904834b4740d02f9fff
[]
no_license
AdanVitor/AutolayoutExtensions
5ac7af0ae2ba680aaadc996422fdca91a383223a
6f30856642dca2100f86dda9689edeaebb88f1cc
refs/heads/master
2023-08-13T21:20:18.918398
2021-10-06T11:29:45
2021-10-06T11:29:45
369,001,828
1
0
null
null
null
null
UTF-8
Swift
false
false
676
swift
// // File.swift // // // Created by Adan on 27/05/21. // import Foundation import UIKit public extension UIImageView{ static func createImageView(image : UIImage?, contentMode : UIView.ContentMode = .scaleAspectFit) -> UIImageView{ let imageView = UIImageView() imageView.image = image imageView.contentMode = contentMode return imageView } static func createImageView(imageName : String, contentMode : UIView.ContentMode = .scaleAspectFit) -> UIImageView{ return createImageView(image: UIImage(named: imageName), contentMode: contentMode) } }
[ -1 ]
111bf558d3c7ee48b4731295d303fc05e533c801
2b87aa2c65fc8e719e6e09e247b3ef01269ec516
/ConvolutionMadness/ViewController.swift
01fb1b084b76840fcaa6d6f252d237c584a97950
[]
no_license
tothepoweroftom/ConvolutionMadness
ca66cf04dd53fcd709a265615b0f604042beba91
76e56e6ca26a872e979af42469616012c9d61ac2
refs/heads/master
2021-01-01T04:13:31.535256
2017-04-13T14:03:31
2017-04-13T14:03:31
97,142,266
0
0
null
null
null
null
UTF-8
Swift
false
false
5,792
swift
// // ViewController.swift // ConvolutionMadness // // Created by Tom Power on 05/04/2017. // Copyright © 2017 MOBGEN:Lab. All rights reserved. // import UIKit import AudioKit class ViewController: UIViewController, EffectBlokDelegate { var bloks = [EffectBlokView]() var blockSize = 200.0 var colors = [UIColor(rgb: 0xF62D48), UIColor(rgb: 0xFBCE09), UIColor(rgb: 0xAAE5BB)] var margin = 20.0 var convArray = [ConvBlok]() var volMixerArray = [AKMixer]() var conv: AKConvolution! var mixerArray = [AKDryWetMixer]() var vol : AKMixer! var urls = [URL]() var input: AKMicrophone! var booster: AKBooster! var audio: AKAudioPlayer! var dryWet: AKDryWetMixer! var mixloop: AKAudioFile! @IBOutlet weak var `switch`: UISwitch! @IBOutlet weak var volSlider: UISlider! override func viewDidLoad() { super.viewDidLoad() margin = (Double(view.frame.width) - blockSize*3)/4 // Do any additional setup after loading the view, typically from a nib. for i in 0...2 { var blok = EffectBlokView(frame: CGRect(x: margin + i*(blockSize + margin), y: Double(view.frame.height/2) - blockSize/2, width: blockSize, height: blockSize)) blok.setSliderWidth(blockSize - 20.0) blok.awakeFromNib() blok.setColor(colors[i]) blok.setID(i) blok.delegate = self bloks.append(blok) view.addSubview(bloks[i]) } for i in 0...2 { let urlpath = Bundle.main.path(forResource: "\(i+40)", ofType: ".wav") let fileURL = URL(fileURLWithPath: urlpath!) urls.append(fileURL) } do { let urlpath = Bundle.main.path(forResource: "Theme2", ofType: ".mp3") let fileURL = URL(fileURLWithPath: urlpath!) AKSettings.bufferLength = .long mixloop = try AKAudioFile(forReading: fileURL) audio = try AKAudioPlayer(file: mixloop, looping: true, completionHandler: nil) } catch { } print(urls) // do { //// try AKSettings.session.overrideOutputAudioPort(AVAudioSessionPortOverride.speaker) // try AKSettings.setSession(category: .playAndRecord, with: .defaultToSpeaker) // } catch { // // } for i in 0...2 { if (i==0){ let con = ConvBlok(input: audio, convFile: urls[i]) convArray.append(con) } else { let con = ConvBlok(input: audio, convFile: urls[i]) convArray.append(con) } } vol = AKMixer(convArray[0].mixer, convArray[1].mixer,convArray[2].mixer ) dryWet = AKDryWetMixer(audio, vol, balance: 0.5) vol.volume = 0.2 AudioKit.output = dryWet } override func viewDidAppear(_ animated: Bool) { } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(true) } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } func setupAudio() { } @IBAction func switchPressed(_ sender: UISwitch) { if sender.isOn { AudioKit.start() convArray[0].start() convArray[1].start() convArray[2].start() audio.play() } else { AudioKit.stop() for conv in convArray { conv.stop() } audio.stop() } } @IBAction func volSliderChanged(_ sender: UISlider) { dryWet.balance = Double(sender.value) } func sliderDidUpdate(_ sender: EffectBlokView) { switch sender.id { case 0: convArray[0].mixer.volume = Double(sender.slider.value) case 1: convArray[1].mixer.volume = Double(sender.slider.value) case 2: convArray[2].mixer.volume = Double(sender.slider.value) default: break } print(sender.slider.value) print(sender.id) } func slider2DidUpdate(_ sender: EffectBlokView) { switch sender.id { case 0: convArray[0].pitchShifter.shift = Double(sender.slider2.value) case 1: convArray[1].pitchShifter.shift = Double(sender.slider2.value) case 2: convArray[2].pitchShifter.shift = Double(sender.slider2.value) default: break } print(sender.slider.value) print(sender.id) } func bypass(_ sender: EffectBlokView) { switch sender.id { case 0: convArray[0].bypass(sender.isBypassed) case 1: convArray[1].bypass(sender.isBypassed) case 2: convArray[2].bypass(sender.isBypassed) default: break } } } extension UIColor { convenience init(red: Int, green: Int, blue: Int) { assert(red >= 0 && red <= 255, "Invalid red component") assert(green >= 0 && green <= 255, "Invalid green component") assert(blue >= 0 && blue <= 255, "Invalid blue component") self.init(red: CGFloat(red) / 255.0, green: CGFloat(green) / 255.0, blue: CGFloat(blue) / 255.0, alpha: 1.0) } convenience init(rgb: Int) { self.init( red: (rgb >> 16) & 0xFF, green: (rgb >> 8) & 0xFF, blue: rgb & 0xFF ) } }
[ -1 ]
ffe73cc43236b7806bc200b71d6efe584b7b15b7
b1d86708d96edb7517a8f08a2c2d206ffbadbcfc
/LTMap/LTLocationMap/LocationPick/Common/LTLocationCommon.swift
2cc8bb4e21de18a91b62b22943f1624dd5ae9335
[ "MIT" ]
permissive
leeaken/LTMap
abfca72f6944e33be9a126da769fc255589696a7
d2f7c09eef91ca2a3e2837d6f9a51ea2c99b9de2
refs/heads/master
2021-05-15T03:04:21.830130
2017-09-19T03:20:49
2017-09-19T03:20:49
104,019,217
2
1
null
null
null
null
UTF-8
Swift
false
false
881
swift
// // LTLocationCommon.swift // LTMap // // Created by aken on 2017/6/16. // Copyright © 2017年 LTMap. All rights reserved. // import Foundation let cellIdentifier = "cellIdentifier" struct LTLocationCommon { static let MapDefaultWidth = UIScreen.main.bounds.size.width static let MapDefaultHeight = (UIScreen.main.bounds.size.height - 64)/2 - 44 static let MapAfterAnimationsDefaultHeight = (UIScreen.main.bounds.size.height - 64)/2 - 132 - 44 static let TableViewDefaultHeight = (UIScreen.main.bounds.size.height - 64)/2 static let TableViewAfterAnimationsDefaultHeight = (UIScreen.main.bounds.size.height - 64)/2 + 132 static let POISearchPageSize = 20 static let POISearchRadius = 1000 } enum MXPickLocationType: String { case LTPickMix // 地图和列表混合 case LTPickMap // 地图 case LTPickList // 列表 }
[ -1 ]
60174aed7c233bd045d2e22731a70a58ff082479
fd61beed813d37f1c632c7ee209696c2f2abd676
/区帮/sportsCell.swift
117f1fa89c7842dfd655b1ce771e20c99778f36d
[]
no_license
jiahonggg/neighbour
4baea4b1f6fd7e7ef6ac23203bc0960cc641c823
57123a204ea4905c181e99ff02919a4d60aea21c
refs/heads/master
2021-01-12T08:55:34.323506
2016-12-17T12:41:10
2016-12-17T12:41:10
76,720,993
1
0
null
null
null
null
UTF-8
Swift
false
false
849
swift
// // sportsCell.swift // 区帮 // // Created by apple on 2016/9/28. // Copyright © 2016年 zoujiahong. All rights reserved. // import UIKit class sportsCell: UITableViewCell { @IBOutlet weak var sportsimage: UIImageView! @IBOutlet weak var titlelabel: UILabel! @IBOutlet weak var addressimage: UIImageView! @IBOutlet weak var dateimage: UIImageView! @IBOutlet weak var datelabel: UILabel! @IBOutlet weak var addresslabel: UILabel! @IBOutlet weak var numberlabel: UILabel! @IBOutlet weak var profileimage: UIImageView! 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 } }
[ -1 ]
7c04ab06d0da879584e2cbeaef41b969f4c800bd
9dd007cf197bed2ce6e618ea21fc17e69c5843f5
/Iceberg/Interface/Generated/swiftgen/assets-images.swift
7f10bb6c44304091b978840a1ca1701cdb21c8e2
[]
no_license
IanLuo/nebula-note
3b3391d1aa87eb8a9ad9ba88cd732b122f047585
a7d8860fbe66c433104c2e9fa1228e31cda44a97
refs/heads/master
2023-07-19T05:09:26.863539
2021-08-16T12:59:36
2021-08-16T12:59:36
null
0
0
null
null
null
null
UTF-8
Swift
false
false
4,317
swift
// swiftlint:disable all // Generated using SwiftGen, by O.Halligon — https://github.com/SwiftGen/SwiftGen #if os(OSX) import AppKit.NSImage public typealias AssetColorTypeAlias = NSColor public typealias AssetImageTypeAlias = NSImage #elseif os(iOS) || os(tvOS) || os(watchOS) import UIKit.UIImage public typealias AssetColorTypeAlias = UIColor public typealias AssetImageTypeAlias = UIImage #endif // swiftlint:disable superfluous_disable_command // swiftlint:disable file_length // MARK: - Asset Catalogs // swiftlint:disable identifier_name line_length nesting type_body_length type_name public enum Asset { public static let add = ImageAsset(name: "add") public static let agenda = ImageAsset(name: "agenda") public static let camera = ImageAsset(name: "camera") public static let capture = ImageAsset(name: "capture") public static let checkMark = ImageAsset(name: "check-mark") public static let cross = ImageAsset(name: "cross") public static let document = ImageAsset(name: "document") public static let down = ImageAsset(name: "down") public static let due = ImageAsset(name: "due") public static let enter = ImageAsset(name: "enter") public static let imageLibrary = ImageAsset(name: "image library") public static let `left` = ImageAsset(name: "left") public static let master = ImageAsset(name: "master") public static let minus = ImageAsset(name: "minus") public static let more = ImageAsset(name: "more") public static let `right` = ImageAsset(name: "right") public static let scheduled = ImageAsset(name: "scheduled") public static let tag = ImageAsset(name: "tag") public static let trash = ImageAsset(name: "trash") public static let up = ImageAsset(name: "up") public static let zoom = ImageAsset(name: "zoom") } // swiftlint:enable identifier_name line_length nesting type_body_length type_name // MARK: - Implementation Details public struct ColorAsset { public fileprivate(set) var name: String @available(iOS 11.0, tvOS 11.0, watchOS 4.0, OSX 10.13, *) public var color: AssetColorTypeAlias { return AssetColorTypeAlias(asset: self) } } public extension AssetColorTypeAlias { @available(iOS 11.0, tvOS 11.0, watchOS 4.0, OSX 10.13, *) convenience init!(asset: ColorAsset) { let bundle = Bundle(for: BundleToken.self) #if os(iOS) || os(tvOS) self.init(named: asset.name, in: bundle, compatibleWith: nil) #elseif os(OSX) self.init(named: NSColor.Name(asset.name), bundle: bundle) #elseif os(watchOS) self.init(named: asset.name) #endif } } public struct DataAsset { public fileprivate(set) var name: String #if os(iOS) || os(tvOS) || os(OSX) @available(iOS 9.0, tvOS 9.0, OSX 10.11, *) public var data: NSDataAsset { return NSDataAsset(asset: self) } #endif } #if os(iOS) || os(tvOS) || os(OSX) @available(iOS 9.0, tvOS 9.0, OSX 10.11, *) public extension NSDataAsset { convenience init!(asset: DataAsset) { let bundle = Bundle(for: BundleToken.self) #if os(iOS) || os(tvOS) self.init(name: asset.name, bundle: bundle) #elseif os(OSX) self.init(name: NSDataAsset.Name(asset.name), bundle: bundle) #endif } } #endif public struct ImageAsset { public fileprivate(set) var name: String public var image: AssetImageTypeAlias { let bundle = Bundle(for: BundleToken.self) #if os(iOS) || os(tvOS) let image = AssetImageTypeAlias(named: name, in: bundle, compatibleWith: nil) #elseif os(OSX) let image = bundle.image(forResource: NSImage.Name(name)) #elseif os(watchOS) let image = AssetImageTypeAlias(named: name) #endif guard let result = image else { fatalError("Unable to load image named \(name).") } return result } } public extension AssetImageTypeAlias { @available(iOS 1.0, tvOS 1.0, watchOS 1.0, *) @available(OSX, deprecated, message: "This initializer is unsafe on macOS, please use the ImageAsset.image property") convenience init!(asset: ImageAsset) { #if os(iOS) || os(tvOS) let bundle = Bundle(for: BundleToken.self) self.init(named: asset.name, in: bundle, compatibleWith: nil) #elseif os(OSX) self.init(named: NSImage.Name(asset.name)) #elseif os(watchOS) self.init(named: asset.name) #endif } } private final class BundleToken {}
[ 116188 ]
094a007628426c17b95f24960432880684068443
38ffb7bc9a760bf1ffad3ebe4e19550604c6bace
/PostsTestMVC/Model/WorkWithDocumentsFolder/DocumentsFolderWriter.swift
61ebe6458d334fb061a0bb4ba7be98f130d0971f
[]
no_license
Massmaker/MVC-Network-test
e283850a433c61330473cad0127c0118cf69b01d
135a4e216442d8ea2946fb945d63bc5e0a6f6437
refs/heads/main
2023-01-24T09:03:23.031990
2020-12-04T19:32:50
2020-12-04T19:32:50
318,322,677
0
0
null
null
null
null
UTF-8
Swift
false
false
664
swift
// // DocumentsFolderWriter.swift // PostsTestMVC // // Created by Ivan Yavorin on 04.12.2020. // import Foundation class DocumentsFolderWriter { class func writeEntity<T:Encodable>(_ entity:T, toURL:URL) -> Bool { var didWrite = false do { let encodedPostsData = try JSONEncoder().encode(entity) try encodedPostsData.write(to: toURL) didWrite = true } catch (let encodeError) { #if DEBUG print("DocumentsFolderWriter -> Encoding \(entity.self) error: \(encodeError.localizedDescription)") #endif } return didWrite } }
[ -1 ]
9752e2f2350e102518d77c03cae3887a84999079
4062d77efc2c779a38ef31b8bef550be7fb9a9a6
/GameOfLife/GameOfLife/Manager.swift
dd6d9c05612a77183fe90f1e72082c1929533bb0
[]
no_license
lffattori/ConwayGameOfLife
57bccb003bf3d7675e16c3f25c4415c3dc6ec3be
261abc2cab9c1ab3e1e75322ad85f593541aa596
refs/heads/master
2020-09-01T21:44:30.352588
2019-11-01T21:39:30
2019-11-01T21:39:30
219,066,040
0
0
null
null
null
null
UTF-8
Swift
false
false
623
swift
// // Manager.swift // GameOfLife // // Created by Luiza Fattori on 01/11/19. // Copyright © 2019 Luiza Fattori. All rights reserved. // import Foundation import SceneKit // Cuidar das regras do jogo // Verificar quais células estão vivas // Mudar o estado das células // Matar as células class Managers { var individuals = [Individuals]() // Carcereiro = ele mata ou aviva algum indivíduo func jailor() { } // Zelador = cuidar dos vizinhos - verificar os vizinhos vivos func janitor() { } // Mafioso = vai mandar matar ou avivar func godfatherMobster() { } }
[ -1 ]
001a6f7aca8fc72920c0796022cc03198febc5dd
33551a9b170893703e6db2a35e05174bd5b2374e
/Donaid/SearchViewController.swift
9d96c8f41c0c7a53f0d9a67e60fc0f74882c6e4c
[ "Apache-2.0" ]
permissive
DonaidCodepath/donaid
cd5db24163a02924e3e0122dfbe64c2e2961f677
317bfbbac251eb317a28970ccb2b5b45b4329ff6
refs/heads/master
2021-01-20T01:38:42.643417
2017-05-18T01:41:32
2017-05-18T01:41:32
89,312,724
1
1
null
2017-05-18T01:41:33
2017-04-25T03:20:25
Swift
UTF-8
Swift
false
false
4,859
swift
// // SearchViewController.swift // Donaid // // Created by Mendoza, Alejandro on 4/30/17. // Copyright © 2017 Donaid Codepath. All rights reserved. // import UIKit class SearchViewController: UIViewController, UISearchBarDelegate, UITableViewDataSource, UITableViewDelegate { @IBOutlet weak var tableView: UITableView! var searchBar: UISearchBar? var fullProjects: [HDXProject]! var filteredProjects: [HDXProject]! var showSearchResults = false override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. initSearchBar() initTableView() HDXClient.sharedInstance?.getHDXProjectByYear(year: "2016", success: { (projects: [HDXProject]) in if (self.fullProjects != nil) { self.fullProjects = self.fullProjects + projects } else { self.fullProjects = projects } self.tableView.reloadData() }) { (error: Error) in print("HDX Client error") } HDXClient.sharedInstance?.getHDXProjectByYear(year: "2017", success: { (projects: [HDXProject]) in if (self.fullProjects != nil) { self.fullProjects = self.fullProjects + projects } else { self.fullProjects = projects } self.tableView.reloadData() }) { (error: Error) in print("HDX Client error") } } func initSearchBar() { searchBar = UISearchBar() searchBar?.placeholder = "Search World Events" searchBar?.delegate = self navigationItem.titleView = searchBar } func initTableView() { tableView.delegate = self tableView.dataSource = self tableView.rowHeight = UITableViewAutomaticDimension tableView.estimatedRowHeight = 120 } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } // MARK: - Table View functionality func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "ProjectCell", for: indexPath) as! ProjectCell cell.project = filteredProjects[indexPath.row] return cell } func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { if filteredProjects != nil { if showSearchResults { return filteredProjects.count } else { return 0 } } else { return 0 } } func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { tableView.deselectRow(at: indexPath, animated: false) } // MARK: - Search Bar Functionality func searchBar(_ searchBar: UISearchBar, textDidChange searchText: String) { if (fullProjects != nil) { self.filteredProjects = self.fullProjects.filter({ (project: HDXProject) -> Bool in let country = project.country let continent = project.continent let agency = project.agencyName let emergencyType = project.emergencyType let grouping = project.groupingName return ( (emergencyType!.lowercased().range(of: searchText, options: .caseInsensitive) != nil) || (agency!.lowercased().range(of: searchText, options: .caseInsensitive) != nil) || (continent!.lowercased().range(of: searchText, options: .caseInsensitive) != nil) || (country!.lowercased().range(of: searchText, options: .caseInsensitive) != nil) || (grouping!.lowercased().range(of: searchText, options: .caseInsensitive) != nil)) }) if (searchText != "") { showSearchResults = true self.tableView.reloadData() } else { showSearchResults = false self.tableView.reloadData() } } } func searchBarSearchButtonClicked(_ searchBar: UISearchBar) { showSearchResults = true searchBar.endEditing(true) self.tableView.reloadData() } /* // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepare(for segue: UIStoryboardSegue, sender: Any?) { // Get the new view controller using segue.destinationViewController. // Pass the selected object to the new view controller. } */ }
[ -1 ]
4af3e8a8c5fe136345aefdcffe29e6a61f42ffa7
7399056c4e95593e8ae9ec45bfab1c0db78f3654
/ReMVVMCore/Sources/Redux/Reducer/ComposedReducer.swift
4ba70f28167709dae85a9d33d80de13e0eea464d
[ "MIT" ]
permissive
hanny-ph/ReMVVM
e90045fc7d75b1ed4f8faaff4bf49a09104defb1
06447046511361dec81c718ecea2427a61a65f4d
refs/heads/master
2023-08-05T06:11:48.681052
2021-09-14T07:32:51
2021-09-14T07:32:51
null
0
0
null
null
null
null
UTF-8
Swift
false
false
1,373
swift
// // ComposedReducer.swift // // // Created by Dariusz Grzeszczak on 06/08/2021. // import Foundation /** Reducer that combines other reducers for the same State but different Actions #Example public enum NavigationReducer: Reducer { static let composed = PushReducer .compose(with: PopReducer.self) .compose(with: ShowReducer.self) public static func reduce(state: Navigation, with action: StoreAction) -> Navigation { return composed.reduce(state: state, with: action) } } */ public enum ComposedReducer<R1, R2>: Reducer where R1: Reducer, R2: Reducer, R1.State == R2.State { /// Pure function that returns new state based on current state and the action /// - Parameters: /// - state: current state /// - action: action used for creating new state public static func reduce(state: R1.State, with action: StoreAction) -> R1.State { let state = R1.reduce(state: state, with: action) return R2.reduce(state: state, with: action) } } extension Reducer { /// Combine reducer with other reducer for the same State type. /// - Parameters: /// - reducer: reducer to combine with public static func compose<R>(with reducer: R.Type) -> ComposedReducer<Self, R>.Type where R: Reducer, State == R.State { return ComposedReducer<Self, R>.self } }
[ -1 ]
8b645bc3f6e4ff5e46db8bf1abf6553a29c3c747
f42887b96aedf407fb5da6a413477b3fbc23a3b6
/HouseworkRevolution/Extension/UIView+Extension.swift
8fb55c427b26d369d72bf81a21cbd4ab6001540d
[]
no_license
Sylviajiafen/HouseworkRevolution
e0a50cbcba026505bd46e884bd1adf35b7da6507
c47612ee63628ccce335f06ed2ad305cd1fc7720
refs/heads/master
2020-07-13T12:38:50.456497
2019-09-30T01:48:54
2019-09-30T01:48:54
205,084,596
1
1
null
2019-10-04T04:24:55
2019-08-29T05:05:45
Swift
UTF-8
Swift
false
false
606
swift
// // UIView + Extension.swift // HouseworkRevolution // // Created by Sylvia Jia Fen on 2019/8/28. // Copyright © 2019 Sylvia Jia Fen . All rights reserved. // import UIKit extension UIView { func rotate() { let rotation: CABasicAnimation = CABasicAnimation(keyPath: "transform.rotation") rotation.fromValue = -Double.pi / 8 rotation.toValue = Double.pi / 8 rotation.duration = 0.005 rotation.repeatCount = 60 self.layer.add(rotation, forKey: nil) } }
[ -1 ]
a251214bfe9c0007810088dfc615de6139171417
bcb9c61a318bf5a62860d7a961f30dc7e2259e66
/TestUITests/TestUITestsLaunchTests.swift
47ca3c93df902d114a243ef2dc63e3bdcdfeb171
[]
no_license
tnthanh47/SingYourSong
54b5ac4a56dfe172fcd5f8187d8d4428fed1e995
1e8bf8a2f87dc2526976a2b82d41ba5526d8829e
refs/heads/main
2023-08-24T11:41:38.387901
2021-10-14T16:09:34
2021-10-14T16:09:34
412,677,024
0
0
null
null
null
null
UTF-8
Swift
false
false
797
swift
// // TestUITestsLaunchTests.swift // TestUITests // // Created by Thành Nguyễn Lê on 10/10/2021. // import XCTest class TestUITestsLaunchTests: XCTestCase { override class var runsForEachTargetApplicationUIConfiguration: Bool { true } override func setUpWithError() throws { continueAfterFailure = false } func testLaunch() throws { let app = XCUIApplication() app.launch() // Insert steps here to perform after app launch but before taking a screenshot, // such as logging into a test account or navigating somewhere in the app let attachment = XCTAttachment(screenshot: app.screenshot()) attachment.name = "Launch Screen" attachment.lifetime = .keepAlways add(attachment) } }
[ 274433, 372737, 403464, 399371, 436236, 436247, 430119, 272431, 405553, 378932, 403508, 385077, 378935, 436282, 32828, 376893, 403523, 225348, 421959, 163915, 368718, 53333, 104535, 397410, 176230, 438379, 260205, 395374, 421999, 376946, 211064, 374912, 374915, 168068, 422021, 168071, 415882, 426123, 381072, 436373, 430230, 196759, 200857, 422043, 49309, 362657, 258212, 436389, 49318, 377007, 211122, 377011, 430264, 104634, 266426, 268287, 260286, 268480, 377026, 133314, 374985, 164042, 377034, 436428, 417995, 372942, 266448, 368848, 368851, 139477, 268505, 268516, 379111, 383207, 205033, 379119, 149744, 260336, 438513, 260339, 389360, 389363, 381174, 135415, 375041, 432386, 147715, 260356, 436481, 272643, 266503, 385289, 368907, 395537, 262420, 379156, 391447, 389405, 268577, 186659, 260395, 358699, 438574, 131375, 418096, 432434, 397619, 358708, 180533, 266548, 358711, 379194, 14653, 268608, 438593, 270662, 368968, 383310, 397651, 389466, 436571, 383326, 418143, 416102, 110956, 362865, 272754, 385406, 432510, 438654, 385410, 436610, 436612, 270734, 385424, 272785, 420242, 373140, 373143, 213401, 194979, 385450, 115115, 176564, 129462, 266683, 436678, 416202, 195022, 416207, 262618, 377308, 184798, 377311, 369123, 391653, 270822, 432617, 201196, 213487, 360946, 375282, 139765, 377336, 393720, 182778, 410107, 410110, 262658, 432651, 410127, 397840, 393746, 262674, 420375, 410137, 258585, 377375, 350757, 350760, 393776, 418353, 432693, 33338, 266813, 385602, 438851, 385613, 416333, 385619, 416339, 270934, 436830, 260704, 416352, 375395, 268900, 184939, 176750, 420462, 184943, 209528, 420472, 422528, 373376, 430723, 385668, 201349, 369286, 375439, 377488, 422546, 363156, 264854, 426647, 180887, 377498, 363162, 363165, 275103, 436898, 176804, 176811, 383669, 160442, 377532, 377533, 39615, 377535, 422592, 385738, 385746, 369364, 369367, 385752, 361177, 436956, 363229, 383709, 436961, 264930, 418530, 385762, 369384, 361193, 269035, 373484, 373487, 432882, 21238, 418551, 203512, 275192, 416510, 162560, 213761, 197378, 133888, 434955, 62221, 418578, 197397, 426773, 363296, 197413, 400167, 391981, 189230, 197423, 197427, 191284, 152373, 273208, 377657, 273210, 375611, 430908, 160570, 160577, 197452, 439117, 385879, 363352, 197466, 363355, 420701, 375645, 363360, 381792, 363363, 412517, 385894, 439146, 420721, 271218, 381810, 392056, 164731, 398204, 392066, 271236, 369540, 265093, 400263, 387976, 172937, 392072, 424843, 396172, 426893, 400270, 392079, 381841, 390035, 224148, 224147, 430998, 373654, 256921, 377753, 400281, 381855, 207775, 211872, 398243, 207784, 422824, 172972, 273328, 271282, 189363, 439227, 377788, 398276, 379846, 420807, 273352, 373704, 433105, 418775, 386008, 433113, 433117, 418782, 271327, 398304, 418794, 398314, 134123, 412652, 435184, 127991, 271352, 183290, 435196, 271358, 386048, 171010, 410628, 189449, 433167, 386067, 375847, 410666, 273459, 361523, 412726, 398404, 404549, 261192, 377928, 361546, 218188, 265304, 375901, 439392, 392289, 375904, 265319, 402537, 396394, 265324, 404588, 138355, 273524, 384121, 363642, 222329, 66685, 384126, 377987, 402569, 140427, 373901, 386190, 144534, 380068, 367790, 367793, 373938, 367797, 402617, 218300, 40125, 361669, 113862, 402631, 402642, 419027, 421080, 195810, 421101, 369911, 271608, 386295, 128250, 363770, 369914, 419065, 439549, 412927, 437503, 369928, 439564, 259345, 380177, 259348, 367896, 367899, 382242, 412964, 271655, 369965, 273712, 261427, 386362, 193854, 257352, 146761, 378185, 257355, 146764, 367949, 259407, 367957, 374111, 372065, 271715, 265578, 388459, 425326, 425332, 163191, 259448, 421239, 384378, 384392, 388489, 263560, 411027, 370067, 398741, 396696, 370073, 365986, 380330, 374190, 380336, 359859, 359862, 259512, 380349, 425416, 413139, 425433, 271851, 271852, 259568, 116208, 411120, 386552, 265721, 398845, 216576, 366082, 437765, 271881, 208396, 146957, 146958, 267792, 65042, 413203, 413205, 388631, 370201, 153114, 423452, 372262, 431661, 370232, 374328, 163386, 421436, 396866, 413254, 265799, 273993, 128588, 265808, 396884, 265815, 396888, 179799, 378458, 388700, 396897, 155237, 415333, 388711, 384617, 388714, 54896, 403058, 188020, 366199, 210557, 210560, 370308, 419461, 149126, 194182, 149129, 214666, 431755, 411276, 267915, 415377, 274072, 425625, 208546, 153253, 208549, 388776, 210602, 364203, 202414, 421555, 376501, 384694, 272056, 415418, 409276, 110269, 259779, 267977, 409290, 425681, 274132, 370389, 272086, 155361, 372459, 397039, 12016, 370418, 431860, 161540, 274181, 395017, 409354, 395020, 186128, 155409, 395025, 366359, 421656, 411416, 435994, 431900, 409382, 257832, 167721, 202540, 399149, 431919, 403247, 153393, 421681, 409395, 421687, 204601, 431934, 415554, 409415, 272202, 415565, 272206, 272209, 431954, 395091, 425819, 370525, 378719, 274275, 368485, 382821, 425831, 409445, 415591, 362350, 417647, 214897, 272246, 276342, 274295, 417657, 112511, 372624, 425874, 376734, 204703, 436129, 10152, 415656, 436136, 438187, 362412, 370605, 204723, 362419, 411588, 151493, 380875, 436188, 360415, 403424, 436200, 380909, 436210, 432115, 385010, 380921, 196603, 380924, 415743 ]
e83b4123c2017a2e742da425e967554fb5ce84da
8941ce87565052aa73181eed317972c5285ad775
/WatchKitTableDemo WatchKit Extension/MinionDetailInterfaceController.swift
e7df7edae7e718a8f89e8d769373da70f4855f98
[]
no_license
matcho3/WatchKitTableDemo
5a0dff07578b01cba5e3a8da3be83eb1124d20b0
e5ceb5e3870083f77bacd3223aaaf12452329c75
refs/heads/master
2020-04-14T21:23:48.511315
2014-11-20T09:57:27
2014-11-20T09:57:27
null
0
0
null
null
null
null
UTF-8
Swift
false
false
654
swift
// // MinionDetailInterfaceController.swift // WatchKitTableDemo // // Created by Natasha Murashev on 11/19/14. // Copyright (c) 2014 NatashaTheRobot. All rights reserved. // import WatchKit class MinionDetailInterfaceController: WKInterfaceController { @IBOutlet weak var interfaceLabel: WKInterfaceLabel! @IBOutlet weak var interfaceImage: WKInterfaceImage! override init(context: AnyObject?) { super.init(context: context) if let minionName = context as? String { interfaceLabel.setText(minionName) interfaceImage.setImage(UIImage(named: minionName)) } } }
[ -1 ]
bed7681720df2e77405ada0bd4cad7e2ab5dae0e
cecdc75968c65bfd5399c078faaf8880657c8145
/SideSwiftUITests/SideSwiftUITests.swift
aab3a3585db6257bdb7c2aafe938b2c37b29350a
[]
no_license
lichunfei369/SideSwiftUI
8802ba5c555db31a85a56af827a1e02816a734b5
6a9f49709951fbf40c0e622f4db649de8a904ecd
refs/heads/master
2023-07-19T23:41:21.336167
2021-09-04T14:58:23
2021-09-04T14:58:23
402,685,019
0
0
null
null
null
null
UTF-8
Swift
false
false
903
swift
// // SideSwiftUITests.swift // SideSwiftUITests // // Created by Apple on 2021/9/3. // import XCTest @testable import SideSwiftUI class SideSwiftUITests: XCTestCase { override func setUpWithError() throws { // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDownWithError() throws { // Put teardown code here. This method is called after the invocation of each test method in the class. } func testExample() throws { // This is an example of a functional test case. // Use XCTAssert and related functions to verify your tests produce the correct results. } func testPerformanceExample() throws { // This is an example of a performance test case. self.measure { // Put the code you want to measure the time of here. } } }
[ 333828, 346118, 43014, 358410, 354316, 313357, 360462, 399373, 317467, 145435, 16419, 229413, 204840, 315432, 325674, 344107, 102445, 155694, 176175, 233517, 346162, 129076, 241716, 229430, 243767, 358456, 163896, 180280, 288828, 436285, 376894, 288833, 288834, 436292, 403525, 352326, 225351, 315465, 436301, 338001, 196691, 338003, 280661, 329814, 307289, 385116, 237663, 254048, 315487, 356447, 280675, 280677, 43110, 319591, 321637, 436329, 194666, 221290, 438377, 260207, 352368, 432240, 204916, 233589, 266357, 131191, 215164, 215166, 422019, 280712, 415881, 104587, 235662, 241808, 381073, 196760, 284826, 426138, 346271, 436383, 362659, 299174, 333991, 32941, 239793, 377009, 405687, 182456, 295098, 258239, 379071, 389313, 299203, 417988, 149703, 299209, 346314, 417994, 372941, 266449, 321745, 139479, 254170, 229597, 194782, 301279, 311519, 317664, 280802, 379106, 387296, 346346, 205035, 307435, 321772, 438511, 389362, 381172, 436470, 327929, 243962, 344313, 184575, 149760, 375039, 411906, 147717, 368905, 180493, 325905, 254226, 272658, 272660, 368916, 262421, 325912, 381208, 377114, 151839, 237856, 237857, 233762, 211235, 217380, 432421, 211238, 151847, 338218, 254251, 311597, 358703, 321840, 98610, 332083, 379186, 332085, 358709, 180535, 336183, 332089, 321860, 332101, 438596, 323913, 348492, 383311, 323920, 344401, 366930, 377169, 348500, 368981, 155990, 289110, 368984, 215385, 272729, 168281, 332123, 332127, 98657, 383332, 242023, 383336, 270701, 160110, 242033, 270706, 354676, 139640, 291192, 315770, 211326, 436608, 362881, 240002, 436611, 311685, 225670, 317831, 106888, 340357, 242058, 395659, 385417, 395661, 373134, 385422, 108944, 252308, 190871, 213403, 39324, 149916, 121245, 242078, 420253, 141728, 315810, 315811, 381347, 289189, 108972, 272813, 340398, 385454, 377264, 342450, 338356, 436661, 293303, 311738, 33211, 293310, 336320, 311745, 127427, 416197, 254406, 188871, 324039, 129483, 342476, 373197, 289232, 328152, 256477, 287198, 160225, 342498, 358882, 334309, 391655, 432618, 375276, 319981, 291311, 254456, 377338, 377343, 254465, 174593, 291333, 340490, 139792, 420369, 303636, 258581, 393751, 416286, 377376, 207393, 375333, 358954, 377386, 244269, 197167, 375343, 385588, 289332, 234036, 375351, 174648, 338489, 338490, 244281, 348732, 315960, 242237, 70209, 115270, 70215, 293448, 55881, 301638, 309830, 348742, 348749, 381517, 385615, 426576, 369235, 416341, 297560, 332378, 201308, 354911, 436832, 416351, 139872, 436834, 268899, 111208, 39530, 184940, 373358, 420463, 346737, 389745, 313971, 346740, 139892, 420471, 344696, 287352, 209530, 244347, 356989, 373375, 152195, 311941, 348806, 336518, 311945, 369289, 330379, 344715, 311949, 287374, 326287, 375440, 316049, 311954, 334481, 117396, 111253, 316053, 346772, 230040, 264856, 111258, 346779, 111259, 271000, 289434, 303771, 205471, 318106, 318107, 342682, 139939, 344738, 176808, 352937, 205487, 303793, 318130, 299699, 293556, 336564, 383667, 314040, 342713, 287417, 39614, 287422, 377539, 422596, 422599, 291530, 225995, 363211, 164560, 242386, 385747, 361176, 418520, 422617, 287452, 363230, 264928, 422626, 375526, 234217, 330474, 342762, 293612, 342763, 289518, 299759, 369385, 377489, 312052, 154359, 172792, 344827, 221948, 432893, 205568, 162561, 291585, 295682, 430849, 291592, 197386, 383754, 62220, 117517, 434957, 322319, 422673, 377497, 430865, 166676, 291604, 310036, 197399, 207640, 422680, 426774, 426775, 326429, 293664, 344865, 377500, 326433, 342820, 197411, 400166, 289576, 293672, 189228, 295724, 152365, 197422, 353070, 355121, 164656, 295729, 422703, 191283, 422709, 152374, 197431, 273207, 355130, 375609, 160571, 336702, 289598, 160575, 430910, 355139, 160580, 252741, 348998, 420677, 381773, 201551, 293711, 355152, 355154, 353109, 377686, 244568, 230234, 189275, 244570, 435039, 295776, 242529, 357218, 349026, 303972, 385893, 275303, 342887, 355178, 308076, 242541, 207727, 330609, 246643, 207732, 211829, 295798, 361337, 177019, 185211, 308092, 398206, 400252, 291712, 158593, 254850, 359299, 260996, 359298, 113542, 369538, 381829, 316298, 349067, 392074, 295824, 224145, 349072, 355217, 256922, 289690, 318364, 390045, 310176, 185250, 310178, 420773, 185254, 289703, 293800, 140204, 236461, 363438, 347055, 377772, 304051, 326581, 373687, 326587, 230332, 377790, 289727, 273344, 349121, 330689, 353215, 363458, 379844, 213957, 19399, 326601, 345033, 373706, 316364, 359381, 386006, 418776, 433115, 248796, 343005, 207838, 347103, 50143, 64485, 123881, 326635, 187374, 383983, 347123, 240630, 271350, 201720, 127992, 295927, 349175, 328700, 318461, 293886, 257024, 328706, 357379, 330754, 320516, 293893, 295942, 386056, 410627, 353290, 254987, 330763, 377869, 433165, 384016, 238610, 308243, 418837, 140310, 433174, 252958, 369701, 357414, 248872, 357423, 238639, 252980, 300084, 359478, 312373, 203830, 238651, 308287, 377926, 359495, 361543, 218186, 314448, 341073, 339030, 439384, 304222, 392290, 253029, 257125, 300135, 316520, 273515, 349294, 173166, 357486, 144496, 187506, 351344, 404593, 377972, 285814, 291959, 300150, 300151, 363641, 160891, 363644, 300158, 377983, 392318, 150657, 248961, 384131, 349316, 402565, 349318, 302216, 330888, 386189, 373903, 169104, 177296, 347283, 326804, 363669, 238743, 119962, 300187, 300188, 339100, 351390, 199839, 380061, 429214, 343203, 265379, 300201, 249002, 253099, 253100, 238765, 3246, 300202, 306346, 238769, 318639, 402613, 367799, 421048, 373945, 113850, 294074, 302274, 367810, 259268, 253125, 265412, 353479, 113861, 62665, 402634, 283852, 259280, 290000, 316627, 333011, 189653, 419029, 148696, 296153, 333022, 304351, 195808, 298208, 310497, 298212, 298213, 222440, 330984, 328940, 298221, 253167, 298228, 302325, 234742, 386294, 128251, 386301, 261377, 320770, 351490, 386306, 437505, 322824, 369930, 439562, 292107, 328971, 414990, 353551, 251153, 177428, 349462, 257305, 320796, 222494, 253216, 339234, 372009, 412971, 353584, 351537, 261425, 382258, 345396, 300343, 386359, 378172, 286013, 306494, 382269, 216386, 312648, 337225, 304456, 230729, 146762, 224586, 177484, 294218, 259406, 234831, 238927, 294219, 331090, 353616, 406861, 318805, 314710, 372054, 425304, 159066, 374109, 314720, 378209, 163175, 333160, 386412, 380271, 327024, 296307, 116084, 208244, 249204, 316787, 290173, 306559, 314751, 318848, 337281, 148867, 378244, 357762, 253317, 298374, 314758, 314760, 142729, 296329, 368011, 384393, 388487, 314766, 296335, 318864, 112017, 234898, 9619, 259475, 275859, 318868, 370071, 357786, 290207, 314783, 251298, 310692, 314789, 333220, 314791, 396711, 245161, 396712, 374191, 286129, 380337, 173491, 286132, 150965, 304564, 353719, 380338, 228795, 425405, 302531, 163268, 380357, 339398, 361927, 300489, 425418, 148940, 306639, 413137, 23092, 210390, 210391, 210393, 286172, 144867, 271843, 366053, 429542, 361963, 296433, 251378, 308723, 300536, 286202, 359930, 302590, 210433, 372227, 323080, 329225, 253451, 253452, 296461, 359950, 259599, 304656, 329232, 146964, 308756, 370197, 253463, 175639, 374296, 388632, 374299, 308764, 396827, 134686, 431649, 355876, 286244, 245287, 402985, 394794, 245292, 169518, 347694, 431663, 288309, 312889, 194110, 425535, 349763, 196164, 265798, 288327, 218696, 292425, 128587, 265804, 333388, 396882, 349781, 128599, 179801, 44635, 239198, 343647, 333408, 396895, 99938, 374372, 300644, 323172, 310889, 415338, 243307, 312940, 54893, 204397, 138863, 188016, 222832, 325231, 224883, 314998, 370296, 323196, 325245, 337534, 337535, 339584, 263809, 294529, 194180, 288392, 229001, 415375, 188048, 239250, 419478, 345752, 425626, 255649, 302754, 153251, 298661, 40614, 300714, 210603, 364207, 224946, 337591, 384695, 110268, 415420, 224958, 327358, 333503, 274115, 259781, 306890, 403148, 212685, 333517, 9936, 9937, 241361, 302802, 333520, 272085, 345814, 370388, 384720, 345821, 321247, 298720, 321249, 325346, 153319, 325352, 345833, 345834, 212716, 212717, 360177, 67315, 173814, 325371, 288512, 175873, 319233, 360195, 339715, 288516, 339720, 243472, 372496, 323346, 321302, 345879, 366360, 169754, 398869, 325404, 286494, 321310, 255776, 339745, 257830, 421672, 362283, 378668, 399147, 431916, 300848, 409394, 296755, 259899, 360252, 319292, 325439, 345919, 436031, 403267, 153415, 360264, 345929, 341836, 415567, 325457, 317269, 18262, 216918, 241495, 341847, 362327, 350044, 376669, 128862, 245599, 345951, 362337, 425825, 345955, 296806, 368488, 292712, 425833, 423789, 214895, 313199, 362352, 325492, 276341, 417654, 341879, 241528, 317304, 333688, 112509, 55167, 182144, 325503, 305026, 339841, 188292, 253829, 333701, 243591, 315273, 315274, 350093, 325518, 372626, 380821, 329622, 294807, 337815, 333722, 376732, 118685, 298909, 311199, 253856, 319392, 350109, 292771, 436131, 294823, 415655, 436137, 327596, 438191, 362417, 323507, 243637, 290745, 294843, 188348, 362431, 237504, 294850, 274371, 384964, 214984, 151497, 362443, 344013, 212942, 301008, 153554, 24532, 219101, 372701, 329695, 354272, 436191, 292836, 292837, 298980, 337895, 354280, 313319, 317415, 380908, 436205, 311281, 311282, 325619, 432116, 292858, 415741, 352917 ]
30cb2a325222db6762416e13d0d8497a8377a6df
6b13d0f82ad71698625aa7949a102f62fef0746d
/CareKitStore/CareKitStore/Structs/Queries/OCKOutcomeQuery.swift
7bd58db6a2813079c13255ad80d6d82c13797084
[ "LicenseRef-scancode-bsd-3-clause-no-trademark", "BSD-3-Clause" ]
permissive
giaoshbuging/CareKit
1ee909f5db86f7a18de88d335dba9bbcf8e36582
348b1936df649ec33e32b9691dbcdbbe3e7fa10d
refs/heads/main
2023-05-11T08:53:47.159034
2021-06-01T17:59:52
2021-06-01T17:59:52
373,340,026
1
0
NOASSERTION
2021-06-03T00:45:38
2021-06-03T00:45:37
null
UTF-8
Swift
false
false
3,243
swift
/* Copyright (c) 2019, Apple Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder(s) nor the names of any contributors may be used to endorse or promote products derived from this software without specific prior written permission. No license is granted to the trademarks of the copyright holders even if such marks are included in this software. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ import Foundation /// A query that limits which outcomes will be returned when fetching. public struct OCKOutcomeQuery: Equatable, OCKQueryProtocol { /// Specifies the order in which query results will be sorted. public enum SortDescriptor: Equatable { case date(ascending: Bool) } /// An array of task identifiers to match against. public var taskIDs: [String] = [] /// An array of universally unique identifiers of tasks for which outcomes should be returned. public var taskUUIDs: [UUID] = [] /// An array of remote IDs of tasks for which outcomes should be returned. public var taskRemoteIDs: [String] = [] /// The order in which the results will be sorted when returned from the query. public var sortDescriptors: [SortDescriptor] = [] // MARK: OCKQuery public var ids: [String] = [] public var uuids: [UUID] = [] public var groupIdentifiers: [String?] = [] public var tags: [String] = [] public var remoteIDs: [String?] = [] public var dateInterval: DateInterval? public var limit: Int? public var offset: Int = 0 public init() {} public init(dateInterval: DateInterval? = nil) { self.dateInterval = dateInterval } /// Create a query with that spans the entire day on the date given. public init(for date: Date) { let startOfDay = Calendar.current.startOfDay(for: date) let endOfDay = Calendar.current.date(byAdding: DateComponents(day: 1, second: -1), to: startOfDay)! self = Self(dateInterval: DateInterval(start: startOfDay, end: endOfDay)) } }
[ 420158, 420159 ]
bbe868624331a212a270ca1b886793979b831ef0
7e53b23027bb320f59fcec1686b312edd20debcc
/GamesOfChats/LoginController+handlers.swift
519b04b37e3bbcd9ef37c490a56e29c88ea8a832
[]
no_license
jorgecasariego/GameOfChats
785a2a440aeea05f7ee6c4d7c6af581678d6188c
ac15c08b3b8bf2ac67e80216114b7d47fb425625
refs/heads/master
2020-07-21T18:48:01.429441
2016-11-15T18:19:48
2016-11-15T18:19:48
73,842,589
0
0
null
null
null
null
UTF-8
Swift
false
false
817
swift
// // LoginController+handlers.swift // GamesOfChats // // Created by Jorge Casariego on 10/11/16. // Copyright © 2016 Jorge Casariego. All rights reserved. // import UIKit extension LoginController: UIImagePickerControllerDelegate, UINavigationControllerDelegate { func handleSelectProfileImage() { let picker = UIImagePickerController() picker.delegate = self present(picker, animated: true, completion: nil) } func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) { } func imagePickerControllerDidCancel(_ picker: UIImagePickerController) { print("Cancel Picker") dismiss(animated: true, completion: nil) } }
[ -1 ]
6ae1cd42d31278f82148d80ce12a7188105bd1c4
0225a1fb4e8bfd022a992a751c9ae60722f9ca0d
/iphone/Maps/Classes/Widgets/DownloadBanner/BookmarksBannerViewController.swift
faf2c8189065fbb29469789b1f07ffd496ac2f50
[ "Apache-2.0" ]
permissive
organicmaps/organicmaps
fb2d86ea12abf5aab09cd8b7c55d5d5b98f264a1
76016d6ce0be42bfb6ed967868b9bd7d16b79882
refs/heads/master
2023-08-16T13:58:16.223655
2023-08-15T20:16:15
2023-08-15T20:16:15
324,829,379
6,981
782
Apache-2.0
2023-09-14T21:30:12
2020-12-27T19:02:26
C++
UTF-8
Swift
false
false
75
swift
final class BookmarksBannerViewController: DownloadBannerViewController {}
[ -1 ]
5ec0b61722feaea7ad7cdf39794cbdfcef5a0385
c06d049a0d6f5e57a7010cdc189972be35d1cba3
/Joinan/LoginViewController.swift
2e7944258f2cc4a3d8dc9071c6a8547118b089de
[]
no_license
IskandarHerputra97/Joinan
0767c7542e5e5c407d3e9276374481b4a4360597
9200cf69fb759fdd2acc507052eea859f7e42aa1
refs/heads/master
2022-11-05T21:05:58.855084
2020-06-18T09:13:05
2020-06-18T09:13:05
273,125,931
0
0
null
2020-06-18T09:13:07
2020-06-18T02:45:23
Swift
UTF-8
Swift
false
false
2,969
swift
// // LoginViewController.swift // Joinan // // Created by Iskandar Herputra Wahidiyat on 17/06/20. // Copyright © 2020 Iskandar Herputra Wahidiyat. All rights reserved. // import UIKit import Firebase class LoginViewController: UIViewController { //MARK: - PROPERTIES let emailTextField = UITextField() let passwordTextField = UITextField() let loginButton = UIButton() let stackView = UIStackView() override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. view.backgroundColor = .white title = "Login Page" setupEmailTextField() setupPasswordTextField() setupLoginButton() setupStackView() } //MARK: - SETUP UI func setupEmailTextField() { emailTextField.borderStyle = .bezel emailTextField.placeholder = "Email" } func setupPasswordTextField() { passwordTextField.borderStyle = .bezel passwordTextField.placeholder = "Password" passwordTextField.isSecureTextEntry = true } func setupLoginButton() { loginButton.setTitle("LOGIN", for: .normal) loginButton.setTitleColor(.white, for: .normal) loginButton.backgroundColor = .blue loginButton.addTarget(self, action: #selector(loginButtonTapped), for: .touchUpInside) } func setupStackView() { view.addSubview(stackView) stackView.axis = .vertical stackView.spacing = 20 stackView.addArrangedSubview(emailTextField) stackView.addArrangedSubview(passwordTextField) stackView.addArrangedSubview(loginButton) setStackViewConstraints() } //MARK: - SET CONSTRAINTS func setStackViewConstraints() { stackView.translatesAutoresizingMaskIntoConstraints = false stackView.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor, constant: 20).isActive = true stackView.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true stackView.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor, constant: -20).isActive = true } //MARK: - ACTIONS @objc func loginButtonTapped() { guard let email = emailTextField.text, let password = passwordTextField.text else {return} Auth.auth().signIn(withEmail: email, password: password) { (user, error) in if let error = error { print(error.localizedDescription) } else if let user = user { print("user: \(user)") let homeViewController = HomeViewController() let navigationController = UINavigationController(rootViewController: homeViewController) self.navigationController?.present(navigationController, animated: true, completion: nil) } } } }
[ -1 ]
603edd0e6040de2e71d139268cef6bf6c21a3c3c
4f3c535c83b0a127d0cce0246bd455b932780893
/DereGuide/View/Option/SwitchOption.swift
26234c465dec261cb737a1ac0c867f279c6c8df3
[ "MIT" ]
permissive
tsekityam/DereGuide
13bb09e9c9f1e99a642347c03c91032a485c42de
8d5cef3b1c4b297034edfcdf48cb25494ed16575
refs/heads/master
2022-04-28T16:15:26.309647
2019-08-03T04:38:39
2019-08-03T04:38:39
259,046,330
0
0
MIT
2020-04-26T14:08:11
2020-04-26T14:08:10
null
UTF-8
Swift
false
false
1,562
swift
// // SwitchOption.swift // DereGuide // // Created by zzk on 2017/5/31. // Copyright © 2017 zzk. All rights reserved. // import UIKit import SnapKit class SwitchOption: UIControl { let `switch`: UISwitch let label: UILabel override init(frame: CGRect) { `switch` = UISwitch() label = UILabel() super.init(frame: frame) `switch`.isOn = false addSubview(`switch`) `switch`.snp.makeConstraints { (make) in make.top.equalToSuperview() make.right.equalToSuperview() make.bottom.equalToSuperview() } addSubview(label) label.numberOfLines = 2 label.adjustsFontSizeToFitWidth = true label.baselineAdjustment = .alignCenters label.font = UIFont.systemFont(ofSize: 14) label.snp.makeConstraints { (make) in make.centerY.equalTo(`switch`) make.left.equalToSuperview() make.right.lessThanOrEqualTo(`switch`.snp.left) } `switch`.setContentCompressionResistancePriority(UILayoutPriority.defaultHigh, for: .horizontal) label.setContentCompressionResistancePriority(UILayoutPriority.defaultLow, for: .horizontal) } override func addTarget(_ target: Any?, action: Selector, for controllEvents: UIControl.Event) { `switch`.addTarget(target, action: action, for: controllEvents) } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } }
[ -1 ]
2a69d4d84b8c5abaa3eda6f25632d50ce8eebb13
2e3b135ea6767ad24b53b51fc2616c9c8deb45e7
/variableName/Test/Test.swift
3a6fbc8f63d81cb3a9e610841d2b235eb62471dd
[]
no_license
swift-develop/algorithms_playgrounds_swift
4a1042cb9965f913620bce2014f6e543954fe8b4
1c0b05a311b66727f48ef664e51328fc2331e01e
refs/heads/master
2020-07-01T20:26:16.958079
2020-04-22T22:03:17
2020-04-22T22:03:17
201,290,293
2
0
null
null
null
null
UTF-8
Swift
false
false
794
swift
// // Test.swift // Test // // Created by Tom Grant on 8/10/19. // Copyright © 2019 Tom Grant. All rights reserved. // import XCTest class Test: XCTestCase { let s = Solution() var r:Any = 0 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 testExample0() { // This is an example of a functional test case. // Use XCTAssert and related functions to verify your tests produce the correct results. measure { r = s.variableName(name: "Sample123") } print ( r ) } }
[ 353480, 323913, 214154, 277325, 363438, 310014, 316604, 67315, 308243, 353108, 191446, 281523, 184760, 185211, 346779, 12542, 33215 ]
4d706a2eeb51448c7b50daec13ccc158a4cd6186
fbc304b6b1362f3648829b34282d06c768570927
/sampleSwipeRecognizer/ViewController.swift
dcf1702720627c89343efc6b1672266b83889006
[]
no_license
huro3h/nexios
2d46e7209772c58e8b624861915a08af318818cf
2e39ce9b4d8eca36f63dbf0ddb8f8de8c228694b
refs/heads/master
2020-05-26T14:12:52.880894
2017-03-28T21:31:00
2017-03-28T21:31:00
85,004,544
0
0
null
null
null
null
UTF-8
Swift
false
false
973
swift
// // ViewController.swift // sampleSwipeRecognizer // // Created by satoshiii on 2016/05/03. // Copyright © 2016年 satoshiii. All rights reserved. // import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. } // 右上の選択欄からどの方向からスワイプするか // 指定が可能 @IBAction func swipeView(sender: UISwipeGestureRecognizer) { print("スワイプされました") } // TODO:色つきのビューを追加して、上スワイプを感知し、 // "上スワイプされました"と表示しましょう。 @IBAction func swipeViewUP(sender: UISwipeGestureRecognizer) { print("うえにすわいぷされました") } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } }
[ -1 ]
0e0808347e83b4c47d830d8723140ce591e84c44
370214940bcae1cbf46afe59943213a9c7f20f12
/Chat/Chat/ChatViewController.swift
ba1dd1fd65d471b6fae2c520d10098b262c9ee95
[]
no_license
Benny-iPhone/hackeru_mar_2017_chat_demo
2592197393011bf93fd025c309b04e2bfff8c73e
0adda3aca9f24293398434ff5c98eac92f1da2a8
refs/heads/master
2021-01-23T06:21:13.755794
2017-03-27T17:48:54
2017-03-27T17:48:54
86,361,115
0
0
null
null
null
null
UTF-8
Swift
false
false
4,134
swift
// // ChatViewController.swift // Chat // // Created by hackeru on 27/03/2017. // Copyright © 2017 hackeru. All rights reserved. // import UIKit import JSQMessagesViewController class ChatViewController: JSQMessagesViewController { var messages : [JSQMessage] = [] lazy var outgoingBubbleImageView: JSQMessagesBubbleImage = self.setupOutgoingBubble() lazy var incomingBubbleImageView: JSQMessagesBubbleImage = self.setupIncomingBubble() override func viewDidLoad() { super.viewDidLoad() self.senderDisplayName = "user" self.senderId = "123" collectionView.collectionViewLayout.incomingAvatarViewSize = .zero collectionView.collectionViewLayout.outgoingAvatarViewSize = .zero } override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) testRecevingMessages() } //MARK: - My Methods func testRecevingMessages(){ func addMessage(withId id: String, name: String, text: String) { if let message = JSQMessage(senderId: id, displayName: name, text: text) { messages.append(message) } } // messages from someone else addMessage(withId: "foo", name: "Mr.Bolt", text: "I am so fast!") // messages sent from local sender addMessage(withId: senderId, name: "Me", text: "I bet I can run faster than you!") addMessage(withId: senderId, name: "Me", text: "I like to run!") // animates the receiving of a new message on the view finishReceivingMessage() } func addTextMessage(with text : String){ guard let msg = JSQMessage(senderId: self.senderId, displayName: self.senderDisplayName, text: text) else{ return } messages.append(msg) JSQSystemSoundPlayer.jsq_playMessageSentSound() finishSendingMessage() } //MARK: - Support JSQ override func didPressSend(_ button: UIButton!, withMessageText text: String!, senderId: String!, senderDisplayName: String!, date: Date!) { addTextMessage(with: text) } private func setupOutgoingBubble() -> JSQMessagesBubbleImage { let bubbleImageFactory = JSQMessagesBubbleImageFactory() return bubbleImageFactory!.outgoingMessagesBubbleImage(with: UIColor.jsq_messageBubbleBlue()) } private func setupIncomingBubble() -> JSQMessagesBubbleImage { let bubbleImageFactory = JSQMessagesBubbleImageFactory() return bubbleImageFactory!.incomingMessagesBubbleImage(with: UIColor.jsq_messageBubbleLightGray()) } override func collectionView(_ collectionView: JSQMessagesCollectionView!, messageDataForItemAt indexPath: IndexPath!) -> JSQMessageData! { return messages[indexPath.item] } override func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return messages.count } override func collectionView(_ collectionView: JSQMessagesCollectionView!, messageBubbleImageDataForItemAt indexPath: IndexPath!) -> JSQMessageBubbleImageDataSource! { let msg = messages[indexPath.item] if msg.senderId == self.senderId{ return outgoingBubbleImageView } else { return incomingBubbleImageView } } override func collectionView(_ collectionView: JSQMessagesCollectionView!, avatarImageDataForItemAt indexPath: IndexPath!) -> JSQMessageAvatarImageDataSource! { return nil } override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let cell = super.collectionView(collectionView, cellForItemAt: indexPath) as! JSQMessagesCollectionViewCell let msg = messages[indexPath.item] let isOutgoing = msg.senderId == self.senderId cell.textView.textColor = isOutgoing ? .white : .black return cell } }
[ -1 ]
ba62058fc0d56a11dbfef15b0a5bc884c38ddfb7
dac5120a1229784126dcf2a73150b3d63bd1ddb2
/Pokeedex/PokemonImageStyle.swift
930cd1204b79e1b74d455457101cc51bdd0f15f7
[]
no_license
MacVit/Pokeedex
01f41389f04500f6e69e416dc7b876cf747c0be6
404898f535f52b88f2dd2db24b7deda0cb398896
refs/heads/master
2021-01-02T22:41:36.058693
2017-08-24T11:16:01
2017-08-24T11:16:01
99,369,304
0
0
null
null
null
null
UTF-8
Swift
false
false
352
swift
// // PokemonImageStyle.swift // Pokeedex // // Created by Vitalik Maksymlyuk on 09.08.17. // Copyright © 2017 Vitalik Maksymlyuk. All rights reserved. // import UIKit class PokemonImageStyle: UIImageView { required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) layer.cornerRadius = 5.0 } }
[ -1 ]
dc5ece75ba08cdfecb4ef5b4fa4e48d492cd1352
5f3cbec81721f51992983a2dbdc5b3adef97d824
/RandoPeiTests/RandoPeiTests.swift
492363d0290a54a0379f971ea8432608e78f1a97
[]
no_license
36003569/RandoPei-ios
cb0bb45c1eb434f01bbc2f58d65a206d390e415e
c71cfabbfe62f38ed139f1cbbf4bfe67e1b3930d
refs/heads/master
2020-09-03T16:12:28.828313
2019-11-04T13:00:37
2019-11-04T13:00:37
219,506,502
0
0
null
null
null
null
UTF-8
Swift
false
false
970
swift
// // RandoPeiTests.swift // RandoPeiTests // // Created by etudiant on 04/11/2019. // Copyright © 2019 etudiant. All rights reserved. // import XCTest @testable import RandoPei class RandoPeiTests: XCTestCase { override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. super.tearDown() } func testExample() { // This is an example of a functional test case. // Use XCTAssert and related functions to verify your tests produce the correct results. } func testPerformanceExample() { // This is an example of a performance test case. self.measure { // Put the code you want to measure the time of here. } } }
[ 360462, 98333, 278558, 16419, 229413, 204840, 278570, 344107, 155694, 253999, 229424, 229430, 319542, 180280, 163896, 213052, 376894, 286788, 352326, 254027, 311372, 196691, 278615, 180311, 180312, 385116, 237663, 254048, 319591, 278634, 221290, 319598, 352368, 204916, 131191, 237689, 131198, 278655, 311438, 278677, 196760, 426138, 278685, 311458, 278691, 49316, 278699, 32941, 278704, 377009, 278708, 131256, 278714, 295098, 139479, 254170, 229597, 311519, 205035, 286958, 327929, 344313, 147717, 368905, 278797, 180493, 254226, 319763, 368916, 262421, 377114, 278816, 237856, 237857, 311597, 98610, 180535, 336183, 278842, 287041, 139589, 319813, 319821, 254286, 344401, 377169, 368981, 155990, 368984, 106847, 98657, 270701, 246127, 270706, 139640, 246136, 246137, 311681, 311685, 106888, 385417, 385422, 213403, 246178, 385454, 377264, 278970, 311738, 33211, 319930, 336317, 336320, 311745, 278978, 254406, 188871, 278989, 278993, 278999, 328152, 369116, 188894, 287198, 279008, 279013, 279018, 311786, 319981, 279029, 254456, 279032, 377338, 377343, 279039, 254465, 287241, 279050, 139792, 303636, 393751, 279065, 377376, 180771, 377386, 197167, 385588, 279094, 352829, 115270, 385615, 426576, 369235, 295519, 139872, 66150, 344680, 279146, 295536, 287346, 139892, 287352, 344696, 279164, 189057, 311941, 336518, 311945, 369289, 344715, 279177, 311949, 287374, 377489, 311954, 352917, 230040, 271000, 377497, 303771, 377500, 295576, 221852, 205471, 344738, 139939, 279206, 295590, 287404, 205487, 295599, 303793, 336564, 164533, 287417, 287422, 66242, 377539, 287439, 164560, 385747, 279252, 361176, 418520, 287452, 295652, 279269, 369385, 230125, 279280, 312052, 230134, 172792, 344827, 221948, 205568, 295682, 197386, 434957, 295697, 426774, 197399, 426775, 336671, 344865, 197411, 279336, 262954, 295724, 312108, 197422, 353070, 164656, 295729, 303920, 262962, 353069, 328499, 353078, 230199, 197431, 353079, 336702, 295744, 353094, 353095, 353109, 377686, 230234, 189275, 435039, 295776, 279392, 303972, 385893, 230248, 246641, 246643, 295798, 246648, 279417, 361337, 254850, 369538, 287622, 295824, 189348, 279464, 353195, 140204, 377772, 353197, 304051, 230332, 189374, 377790, 353215, 353216, 213957, 213960, 345033, 279498, 386006, 418776, 50143, 123881, 304110, 320494, 287731, 271350, 295927, 304122, 320507, 328700, 328706, 410627, 320516, 295942, 386056, 353290, 230410, 377869, 320527, 238610, 418837, 140310, 230423, 320536, 197657, 336929, 189474, 369701, 345132, 238639, 312373, 238651, 377926, 238664, 296019, 353367, 156764, 156765, 304222, 279660, 173166, 377972, 353397, 279672, 377983, 279685, 402565, 222343, 386189, 296086, 238743, 296092, 238765, 279728, 238769, 402613, 279747, 353479, 353481, 402634, 353482, 279760, 189652, 279765, 189653, 419029, 148696, 296153, 279774, 304351, 304356, 222440, 279785, 328940, 279792, 353523, 386294, 386301, 320770, 386306, 279814, 328971, 312587, 353551, 173334, 320796, 222494, 304421, 279854, 353584, 345396, 386359, 116026, 378172, 222524, 279875, 304456, 312648, 337225, 230729, 296270, 238927, 353616, 296273, 222559, 378209, 230756, 386412, 230765, 296303, 279920, 312689, 296307, 116084, 181625, 337281, 148867, 378244, 296329, 296335, 9619, 370071, 279974, 279984, 173491, 304564, 279989, 353719, 361927, 296392, 280010, 370123, 148940, 280013, 312782, 222675, 329173, 353750, 280032, 271843, 280041, 361963, 296433, 321009, 280055, 288249, 230913, 329225, 230921, 296461, 304656, 329232, 370197, 230943, 402985, 394794, 230959, 288309, 312889, 288318, 280130, 124485, 288326, 288327, 280147, 239198, 99938, 312940, 222832, 247416, 337534, 337535, 263809, 239237, 288392, 239250, 419478, 345752, 255649, 337591, 321207, 296632, 280251, 280257, 321219, 280267, 403148, 9936, 9937, 370388, 272085, 345814, 280278, 280280, 18138, 67292, 345821, 321247, 321249, 345833, 345834, 280300, 239341, 67315, 173814, 313081, 124669, 288512, 67332, 288516, 280327, 280329, 321302, 345879, 116505, 321310, 313120, 255776, 247590, 362283, 378668, 280366, 296755, 280372, 321337, 280380, 345919, 436031, 403267, 280390, 345929, 304977, 18262, 362327, 280410, 370522, 345951, 362337, 345955, 296806, 288619, 288620, 280430, 214895, 313199, 362352, 296814, 313203, 124798, 182144, 305026, 67463, 329622, 337815, 124824, 214937, 214938, 436131, 354212, 436137, 362417, 124852, 288697, 362431, 214977, 280514, 280519, 214984, 362443, 247757, 231375, 280541, 329695, 436191, 313319, 337895, 247785, 296941, 436205, 362480, 313339, 43014, 354316, 313357, 182296, 354345, 223274, 124975, 346162, 124984, 288828, 436285, 288833, 288834, 436292, 403525, 436301, 338001, 354385, 338003, 223316, 280661, 329814, 338007, 354393, 280675, 280677, 43110, 313447, 321637, 436329, 329829, 288879, 223350, 280694, 288889, 215164, 313469, 215166, 280712, 215178, 346271, 436383, 362659, 239793, 125109, 182456, 280762, 223419, 379071, 149703, 338119, 280778, 346314, 321745, 280795, 387296, 280802, 379106, 338150, 346346, 321772, 125169, 338164, 436470, 125183, 149760, 411906, 125188, 313608, 125193, 125198, 272658, 125203, 125208, 305440, 125217, 338218, 321840, 379186, 125235, 280887, 125240, 321860, 280902, 182598, 289110, 305495, 215385, 272729, 379225, 321894, 280939, 313713, 354676, 199029, 436608, 362881, 240002, 436611, 248194, 395659, 395661, 240016, 108944, 190871, 149916, 420253, 141728, 289189, 289194, 108972, 272813, 338356, 436661, 281040, 289232, 256477, 281072, 174593, 420369, 289304, 207393, 182817, 289332, 174648, 338489, 338490, 322120, 281166, 281171, 297560, 354911, 436832, 436834, 191082, 313966, 281199, 420463, 346737, 313971, 346740, 420471, 330379, 330387, 117396, 346772, 330388, 117397, 264856, 289434, 346779, 338613, 166582, 289462, 314040, 158394, 363211, 363230, 289502, 264928, 338662, 330474, 346858, 289518, 199414, 35583, 363263, 322313, 117517, 322319, 166676, 207640, 281377, 289576, 191283, 273207, 289598, 281408, 420677, 281427, 281433, 330609, 207732, 158593, 240518, 224145, 355217, 256922, 289690, 289698, 420773, 289703, 363438, 347055, 289727, 273344, 330689, 363458, 379844, 19399, 338899, 248796, 248797, 207838, 347103, 314342, 52200, 289774, 183279, 347123, 314355, 240630, 314362, 257024, 330754, 134150, 322570, 330763, 281626, 248872, 322612, 314448, 339030, 281697, 314467, 281700, 257125, 322663, 281706, 273515, 207979, 404593, 363641, 363644, 150657, 248961, 330888, 363669, 339100, 380061, 429214, 199839, 339102, 306338, 265379, 249002, 306346, 3246, 421048, 339130, 208058, 322749, 265412, 290000, 298208, 298212, 298213, 290022, 330984, 298221, 298228, 216315, 208124, 363771, 388349, 437505, 322824, 257305, 126237, 339234, 372009, 412971, 298291, 306494, 216386, 224586, 372043, 331090, 314709, 314710, 372054, 159066, 314720, 281957, 134506, 380271, 314739, 208244, 249204, 290173, 306559, 306560, 314751, 298374, 314758, 314760, 142729, 388487, 314766, 306579, 224661, 282007, 290207, 314783, 314789, 282022, 314791, 282024, 396711, 396712, 241066, 380337, 380338, 150965, 380357, 339398, 306631, 306639, 413137, 429542, 191981, 282096, 306673, 306677, 191990, 290300, 290301, 282114, 372227, 306692, 306693, 323080, 323087, 282129, 175639, 282136, 388632, 396827, 282141, 134686, 282146, 306723, 347694, 290358, 265798, 282183, 265804, 396882, 290390, 306776, 44635, 396895, 323172, 282213, 323178, 224883, 314998, 323196, 175741, 339584, 224901, 282245, 282246, 290443, 323217, 282259, 298654, 282271, 282273, 282276, 298661, 323236, 290471, 282280, 298667, 224946, 110268, 224958, 282303, 274115, 306890, 282318, 241361, 241365, 298712, 298720, 282339, 12010, 282348, 282355, 282358, 175873, 339715, 323331, 323332, 339720, 372496, 323346, 282391, 249626, 282400, 339745, 241441, 257830, 421672, 282409, 282417, 282427, 282434, 307011, 315202, 282438, 323406, 307025, 413521, 216918, 307031, 241495, 282474, 282480, 241528, 339841, 241540, 282504, 315273, 315274, 110480, 184208, 372626, 380821, 282518, 282519, 298909, 118685, 298920, 323507, 282549, 290745, 290746, 274371, 151497, 372701, 298980, 380908, 290811, 282633, 241692, 102437, 315432, 233517, 102445, 176175, 241716, 225351, 315465, 315476, 307289, 200794, 315487, 356447, 307299, 438377, 315498, 299121, 233589, 233590, 266357, 422019, 241808, 381073, 323729, 233636, 299174, 233642, 323762, 299187, 405687, 184505, 299198, 258239, 389313, 299203, 299209, 372941, 282831, 266449, 356576, 176362, 307435, 438511, 381172, 184570, 184575, 381208, 282909, 299293, 151839, 233762, 217380, 151847, 282919, 332083, 332085, 332089, 315706, 282939, 307517, 241986, 438596, 332101, 323913, 348492, 323916, 323920, 250192, 348500, 168281, 332123, 323935, 332127, 242023, 242029, 160110, 242033, 291192, 340357, 225670, 242058, 373134, 291224, 242078, 283038, 61857, 315810, 61859, 315811, 381347, 340398, 299441, 61873, 283064, 61880, 127427, 127428, 291267, 283075, 324039, 373197, 176601, 242139, 160225, 242148, 291311, 233978, 291333, 340490, 283153, 258581, 291358, 283182, 283184, 234036, 315960, 348732, 242237, 70209, 348742, 70215, 348749, 381517, 332378, 201308, 111208, 184940, 373358, 389745, 209530, 373375, 152195, 348806, 152203, 184973, 316049, 111253, 316053, 111258, 111259, 176808, 299699, 299700, 422596, 422599, 291530, 225995, 242386, 422617, 422626, 234217, 299759, 299770, 234234, 299776, 242433, 291585, 430849, 291592, 62220, 422673, 430865, 291604, 422680, 234277, 283430, 152365, 422703, 422709, 152374, 234294, 242485, 160571, 430910, 160575, 160580, 299849, 283467, 381773, 201551, 242529, 349026, 357218, 275303, 177001, 201577, 308076, 242541, 209783, 209785, 177019, 185211, 308092, 398206, 291712, 381829, 316298, 308107, 308112, 349072, 234386, 209817, 324506, 324507, 390045, 185250, 324517, 283558, 185254, 373687, 349121, 373706, 316364, 340955, 340961, 324586, 340974, 316405, 349175, 201720, 127992, 357379, 234500, 324625, 234514, 308243, 316437, 201755, 300068, 357414, 300084, 324666, 308287, 21569, 218186, 300111, 234577, 341073, 439384, 234587, 250981, 300135, 316520, 300136, 357486, 316526, 144496, 300146, 300150, 300151, 291959, 160891, 341115, 300158, 349316, 349318, 234638, 373903, 169104, 177296, 308372, 185493, 119962, 283802, 300187, 300188, 234663, 300201, 300202, 373945, 283840, 259268, 283847, 62665, 283852, 283853, 259280, 316627, 333011, 357595, 234733, 234742, 292091, 128251, 316669, 234755, 439562, 292107, 242954, 414990, 251153, 177428, 349462, 382258, 300343, 382269, 333117, 193859, 300359, 234827, 177484, 406861, 259406, 234831, 251213, 120148, 283991, 374109, 234850, 292195, 333160, 284014, 243056, 316787, 111993, 357762, 112017, 234898, 259475, 275859, 112018, 357786, 251298, 333220, 316842, 374191, 210358, 284089, 292283, 415171, 300487, 300489, 284107, 366037, 210390, 210391, 210393, 144867, 316902, 54765, 251378, 308723, 333300, 300535, 300536, 333303, 300542, 210433, 366083, 259599, 316946, 308756, 398869, 374296, 374299, 308764, 349726, 333343, 431649, 349741, 169518, 431663, 194110, 235070, 349763, 218696, 292425, 243274, 128587, 333388, 333393, 300630, 128599, 235095, 333408, 300644, 374372, 317032, 415338, 243307, 54893, 325231, 366203, 325245, 194180, 415375, 153251, 300714, 210603, 415420, 333503, 218819, 259781, 333517, 333520, 333521, 333523, 325346, 153319, 325352, 284401, 325371, 194303, 194304, 300811, 284429, 284431, 243472, 366360, 284442, 325404, 325410, 341796, 333610, 284459, 399147, 431916, 300848, 317232, 259899, 325439, 153415, 341836, 415567, 325457, 317269, 341847, 284507, 350044, 300894, 128862, 284512, 284514, 276327, 292712, 325484, 423789, 292720, 325492, 276341, 300918, 341879, 317304, 333688, 194429, 112509, 55167, 325503, 333701, 243591, 325515, 243597, 325518, 333722, 350109, 300963, 292771, 415655, 333735, 284587, 292782, 243637, 284619, 301008, 153554, 194515, 219101, 292836, 292837, 317415, 325619, 432116, 333817, 292858, 415741, 333828, 358410, 399373, 317467, 145435, 292902, 227370, 325674, 129076, 243767, 358456, 309345, 227428, 194666, 260207, 432240, 284788, 333940, 292988, 292992, 194691, 227460, 333955, 415881, 104587, 235662, 325776, 317587, 284826, 333991, 333992, 284842, 301251, 309444, 227524, 227548, 194782, 301279, 317664, 243962, 375039, 309503, 375051, 325905, 325912, 309529, 227616, 211235, 432421, 211238, 358703, 358709, 260418, 6481, 366930, 366929, 6489, 391520, 383332, 383336, 416104, 285040, 211326, 317831, 227725, 227726, 252308, 178582, 293274, 317852, 121245, 285090, 375207, 342450, 293303, 293310, 416197, 129483, 342476, 317901, 326100, 285150, 342498, 358882, 334309, 195045, 391655, 432618, 375276, 342536, 342553, 416286, 375333, 244269, 375343, 236081, 23092, 375351, 244281, 301638, 309830, 293448, 55881, 416341, 244310, 285271, 416351, 268899, 39530, 301689, 244347, 326287, 375440, 334481, 227990, 318106, 318107, 342682, 285361, 342706, 318130, 293556, 383667, 342713, 285373, 39614, 154316, 96984, 318173, 375526, 285415, 342762, 342763, 293612, 154359, 432893, 162561, 285444, 383754, 285458, 310036, 326429, 293664, 326433, 400166, 293672, 318250, 318252, 301871, 285487, 375609, 285497, 293693, 252741, 318278, 293711, 244568, 244570, 301918, 293730, 351077, 342887, 400239, 269178, 400252, 359298, 359299, 260996, 113542, 228233, 228234, 392074, 56208, 293781, 318364, 310176, 310178, 293800, 236461, 293806, 326581, 326587, 326601, 359381, 433115, 343005, 130016, 64485, 326635, 203757, 187374, 383983, 277492, 318461, 293886, 277509, 293893, 433165, 384016, 146448, 433174, 252958, 252980, 203830, 359478, 302139, 359495, 392290, 253029, 228458, 15471, 351344, 187506, 285814, 285820, 392318, 187521, 384131, 285828, 302213, 302216, 228491, 228493, 285838, 162961, 326804, 351390, 302240, 343203, 253099, 253100, 318639, 367799, 113850, 294074, 64700, 228542, 302274, 367810, 343234, 244940, 228563, 195808, 310497, 228588, 253167, 302325, 261377, 228609, 245019, 253216, 130338, 130343, 261425, 351537, 286013, 286018, 113987, 294218, 146762, 294219, 318805, 425304, 294243, 163175, 327024, 327025, 327031, 318848, 179587, 253317, 384393, 368011, 318864, 318868, 318875, 310692, 245161, 286129, 286132, 228795, 425405, 302529, 302531, 163268, 425418, 310732, 302540, 64975, 327121, 228827, 286172, 310757, 187878, 343542, 343543, 286202, 359930, 286205, 302590, 228861, 294400, 228867, 253451, 253452, 359950, 146964, 253463, 286244, 245287, 245292, 286254, 196164, 56902, 228943, 286288, 179801, 196187, 343647, 286306, 310889, 204397, 138863, 188016, 294529, 286343, 229001, 310923, 188048, 425626, 229020, 302754, 245412, 40613, 40614, 40615, 229029, 286388, 286391, 384695, 319162, 327358, 286399, 212685, 384720, 212688, 302802, 245457, 286423, 278233, 278234, 294622, 278240, 229088, 212716, 212717, 360177, 229113, 286459, 278272, 319233, 360195, 278291, 294678, 286494, 294700, 409394, 319292, 360252, 360264, 188251, 376669, 245599, 237408, 425825, 302946, 425833, 417654, 188292, 253829, 294807, 294809, 376732, 294814, 311199, 319392, 294823, 327596, 294843, 188348, 98239, 237504, 294850, 384964, 163781, 344013, 212942, 212946, 24532, 294886, 253929, 327661, 311281, 311282 ]
e90760ff15cb19f5d49d76003fd9f511c5a2110f
a0b85cafab336ce618494c7644cbc905c811f1d5
/Unit 1 Assignment/MovieGridCell.swift
f71cefa84d58290d2c76034547d878b183803ea7
[]
no_license
angel0basa/Unit-1-Assignment
36a0628d6a69ee081aaee254849a18bd4f790481
173eb9e93a1caedcc355eb41e7217c55d2af36f8
refs/heads/master
2022-04-21T23:55:55.528590
2020-04-20T22:04:04
2020-04-20T22:04:04
256,116,322
0
0
null
null
null
null
UTF-8
Swift
false
false
264
swift
// // MovieGridCell.swift // Unit 1 Assignment // // Created by Angelo Basa on 4/20/20. // Copyright © 2020 Angelo Basa. All rights reserved. // import UIKit class MovieGridCell: UICollectionViewCell { @IBOutlet weak var posterView: UIImageView! }
[ 245312, 324581, 325541, 276267, 328479, 289237, 141336, 213725, 150207 ]
f21c2187f39c408c1dffd24f97bfbc1dd64b93f0
7957a5fc6d06f570b71bf6f17a449b85ec3ecbed
/zhihuDaily 2.0/LaunchViewController.swift
0ba857f7670f664d75ee713bb41ea350325490f1
[ "MIT" ]
permissive
gengjf/NirZhihuDaily2.0
d1bd4890251fffd37e1d7a3e4ad48f2e8da77240
c812ec88971bfa1646ac9747df3480b089d8a9f8
refs/heads/master
2021-01-18T00:18:53.580886
2015-10-24T14:46:58
2015-10-24T14:46:58
null
0
0
null
null
null
null
UTF-8
Swift
false
false
3,527
swift
// // LaunchViewController.swift // zhihuDaily 2.0 // // Created by Nirvana on 10/1/15. // Copyright © 2015 NSNirvana. All rights reserved. // import UIKit import Alamofire import SwiftyJSON class LaunchViewController: UIViewController, JSAnimatedImagesViewDataSource { @IBOutlet weak var animatedImagesView: JSAnimatedImagesView! @IBOutlet weak var text: UILabel! let launchImgKey = "launchImgKey" let launchTextKey = "launchTextKey" override func viewDidLoad() { super.viewDidLoad() //如果已有下载好的文字则使用 if NSUserDefaults.standardUserDefaults().objectForKey(launchTextKey) != nil { text.text = NSUserDefaults.standardUserDefaults().objectForKey(launchTextKey) as! String } //下载下一次所需的启动页数据 Alamofire.request(.GET, "http://news-at.zhihu.com/api/4/start-image/1080*1776").responseJSON { (_, _, dataResult) -> Void in guard dataResult.error == nil else { print("获取数据失败") return } //拿到text并保存 let text = JSON(dataResult.value!)["text"].string! self.text.text = text NSUserDefaults.standardUserDefaults().setObject(text, forKey: self.launchTextKey) //拿到图像URL后取出图像并保存 let launchImageURL = JSON(dataResult.value!)["img"].string! Alamofire.request(.GET, launchImageURL).responseData({ (_, _, imgResult) -> Void in let imgData = imgResult.value! NSUserDefaults.standardUserDefaults().setObject(imgData, forKey: self.launchImgKey) }) } //设置自己为JSAnimatedImagesView的数据源 animatedImagesView.dataSource = self //半透明遮罩层 let blurView = UIView(frame: CGRectMake(0, 0, self.view.frame.width, self.view.frame.height)) blurView.backgroundColor = UIColor.blackColor().colorWithAlphaComponent(0.21) animatedImagesView.addSubview(blurView) //渐变遮罩层 let gradientView = GradientView(frame: CGRectMake(0, self.view.frame.height / 3 * 2, self.view.frame.width, self.view.frame.height / 3 ), type: TRANSPARENT_GRADIENT_TYPE) animatedImagesView.addSubview(gradientView) //遮罩层透明度渐变 UIView.animateWithDuration(2.5) { () -> Void in blurView.backgroundColor = UIColor.clearColor() } } func animatedImagesNumberOfImages(animatedImagesView: JSAnimatedImagesView!) -> UInt { return 2 } func animatedImagesView(animatedImagesView: JSAnimatedImagesView!, imageAtIndex index: UInt) -> UIImage! { //如果已有下载好的图片则使用 if NSUserDefaults.standardUserDefaults().objectForKey(launchImgKey) != nil { return UIImage(data: NSUserDefaults.standardUserDefaults().objectForKey(launchImgKey) as! NSData) } return UIImage(named: "DemoLaunchImage") } /* // 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 ]
62f51d900af8625eb445f986e3c117820bbaaafd
e7c47bdbca53a752067f962d983064ec59476f62
/CoreDataExmpleTests/CoreDataExmpleTests.swift
2a41863609ae5186aa238deb1b242f92a8bd7a75
[]
no_license
azimTalukdar/Core-Data-Example
3a9c8f4b3b0fb676eecc6629beb4183e1e08c662
426c27cf184deb2560ea21cf80af440b834b3f98
refs/heads/master
2020-03-25T07:16:11.902068
2018-08-04T17:56:15
2018-08-04T17:56:15
143,551,006
0
0
null
null
null
null
UTF-8
Swift
false
false
993
swift
// // CoreDataExmpleTests.swift // CoreDataExmpleTests // // Created by Apple on 28/07/18. // Copyright © 2018 AzimTalukdar. All rights reserved. // import XCTest @testable import CoreDataExmple class CoreDataExmpleTests: XCTestCase { override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. super.tearDown() } func testExample() { // This is an example of a functional test case. // Use XCTAssert and related functions to verify your tests produce the correct results. } func testPerformanceExample() { // This is an example of a performance test case. self.measure { // Put the code you want to measure the time of here. } } }
[ 360462, 98333, 278558, 229413, 204840, 278570, 344107, 155694, 229424, 237620, 229430, 180280, 163896, 376894, 286788, 352326, 311372, 196691, 278615, 385116, 237663, 254048, 319591, 131178, 278634, 221290, 278638, 204916, 131191, 237689, 131198, 311438, 278677, 196760, 426138, 311458, 278691, 377009, 278714, 295098, 139479, 229597, 311519, 205035, 286958, 327929, 344313, 147717, 368905, 278797, 254226, 368916, 262421, 377114, 278816, 237856, 237857, 311597, 98610, 180535, 336183, 278842, 287041, 287043, 311621, 139589, 319813, 344401, 377169, 311636, 368981, 155990, 368984, 98657, 270701, 270706, 139640, 311681, 311685, 106888, 385417, 385422, 213403, 385454, 377264, 278970, 311738, 33211, 336320, 311745, 278978, 254406, 188871, 278989, 278999, 328152, 188894, 287198, 279008, 279013, 279018, 311786, 319981, 279029, 254456, 279032, 377338, 377343, 279039, 254465, 287241, 279050, 303631, 139792, 279057, 303636, 279062, 393751, 279065, 377376, 180771, 377386, 197167, 385588, 279094, 115270, 377418, 385615, 426576, 369235, 287318, 295519, 139872, 66150, 279146, 295536, 287346, 139892, 287352, 344696, 279164, 189057, 311941, 336518, 311945, 369289, 344715, 311949, 287374, 377489, 311954, 352917, 230040, 377497, 271000, 303771, 221852, 377500, 205471, 344738, 139939, 279206, 279210, 287404, 295599, 205487, 303793, 336564, 287417, 303803, 287422, 66242, 377539, 287433, 287439, 164560, 385747, 279252, 361176, 418520, 287452, 279269, 369385, 230125, 312047, 279280, 312052, 230134, 172792, 344827, 221948, 279294, 205568, 295682, 197386, 434957, 295697, 426774, 197399, 426775, 197411, 262951, 279336, 262954, 295724, 312108, 197422, 353070, 164656, 303920, 262962, 295729, 230199, 197431, 336702, 295744, 295746, 353109, 377686, 230234, 189275, 435039, 295776, 279392, 303972, 385893, 230248, 246643, 295798, 279417, 361337, 254850, 369538, 287622, 295824, 279464, 140204, 377772, 304051, 230332, 189374, 377790, 353215, 213957, 213960, 345033, 279498, 386006, 418776, 50143, 123881, 304110, 287731, 271350, 295927, 304122, 312314, 328700, 328706, 410627, 320516, 295942, 386056, 230410, 353290, 377869, 238610, 418837, 140310, 230423, 197657, 238623, 189474, 369701, 238639, 312373, 238651, 377926, 238664, 296019, 304222, 230499, 279660, 173166, 312434, 377972, 279672, 377983, 279685, 402565, 222343, 386189, 296086, 238743, 296092, 238765, 279728, 238769, 402613, 279747, 353479, 402634, 279760, 189652, 279765, 189653, 419029, 148696, 296153, 279774, 304351, 304356, 222440, 279785, 328940, 279792, 386294, 386301, 320770, 386306, 328971, 312587, 353551, 173334, 320796, 222494, 353584, 345396, 386359, 378172, 279875, 304456, 230729, 312648, 337225, 222541, 296270, 238927, 353616, 378209, 230756, 386412, 230765, 296303, 279920, 296307, 116084, 181625, 337281, 148867, 296329, 296335, 9619, 370071, 279974, 173491, 304564, 279989, 353719, 361927, 296392, 280010, 280013, 312782, 222675, 239068, 280032, 271843, 280041, 296433, 280055, 288249, 296448, 230913, 329225, 296461, 304656, 329232, 370197, 402985, 394794, 288309, 312889, 288318, 280130, 288326, 288327, 239198, 99938, 312940, 222832, 288378, 337534, 337535, 263809, 239237, 288392, 239250, 419478, 337591, 280251, 280257, 280267, 403148, 9936, 9937, 370388, 272085, 345814, 280278, 18138, 67292, 345821, 321247, 321249, 345833, 345834, 288491, 280300, 239341, 67315, 173814, 313081, 288512, 67332, 288516, 280327, 280329, 321295, 321302, 345879, 321310, 313120, 255776, 362283, 378668, 280366, 296755, 280372, 345919, 436031, 403267, 280390, 280392, 345929, 304977, 18262, 362327, 280410, 345951, 362337, 345955, 296806, 288619, 288620, 280430, 214895, 313199, 362352, 313203, 182144, 305026, 67463, 329622, 337815, 214937, 214938, 239514, 436131, 436137, 362417, 288697, 362431, 214977, 280514, 280519, 214984, 362443, 329695, 436191, 313319, 296941, 436205, 43014, 354316, 313357, 305179, 354343, 354345, 223274, 346162, 288828, 436285, 288833, 288834, 436292, 403525, 436301, 338001, 338003, 223316, 280661, 329814, 354393, 280675, 280677, 43110, 313447, 321637, 436329, 288879, 223350, 280694, 215164, 215166, 280712, 215178, 346271, 436383, 362659, 239793, 182456, 280762, 223419, 379071, 280768, 149703, 280778, 346314, 321745, 280795, 387296, 280802, 379106, 346346, 321772, 436470, 149760, 411906, 272658, 338218, 321840, 379186, 280887, 321860, 280902, 289110, 305495, 215385, 379225, 321894, 280939, 313713, 354676, 199029, 436608, 362881, 240002, 436611, 240016, 108944, 190871, 149916, 420253, 141728, 289189, 108972, 272813, 338356, 436661, 281037, 281040, 289232, 256477, 281072, 174593, 420369, 207393, 289332, 174648, 338489, 338490, 281166, 281171, 297560, 436832, 436834, 313966, 281199, 420463, 346737, 313971, 346740, 420471, 330379, 117396, 117397, 346772, 264856, 314009, 289434, 346779, 166582, 289462, 314040, 158394, 363211, 289502, 363230, 264928, 330474, 289518, 199414, 322313, 117517, 322319, 166676, 207640, 289576, 191283, 273207, 289598, 281408, 281427, 281433, 330609, 174963, 207732, 158593, 224145, 355217, 256922, 289690, 420773, 289703, 363438, 347055, 289727, 273344, 330689, 363458, 379844, 19399, 183248, 248796, 347103, 314342, 289774, 183279, 347123, 240630, 257024, 330754, 322570, 330763, 281626, 175132, 248872, 314448, 339030, 281697, 281700, 257125, 322663, 281706, 207979, 273515, 404593, 363641, 363644, 150657, 248961, 330888, 363669, 339100, 380061, 429214, 199839, 330913, 306338, 265379, 249002, 306346, 3246, 421048, 208058, 265412, 290000, 298208, 298212, 298213, 290022, 330984, 298221, 298228, 216315, 208124, 437505, 322824, 257305, 339234, 372009, 412971, 298291, 306494, 216386, 224586, 331090, 314709, 314710, 372054, 159066, 314720, 281957, 306542, 380271, 208244, 249204, 290173, 306559, 306560, 314751, 224640, 298374, 314758, 314760, 142729, 388487, 314766, 306579, 224661, 282007, 290207, 314783, 314789, 282022, 314791, 282024, 396711, 396712, 380337, 380338, 150965, 380357, 339398, 306631, 306639, 413137, 429542, 282096, 306673, 306677, 290300, 290301, 282114, 372227, 306692, 306693, 323080, 282129, 175639, 282136, 388632, 396827, 282141, 134686, 306723, 347694, 290358, 265798, 282183, 265804, 396882, 290390, 306776, 44635, 396895, 323172, 282213, 224883, 314998, 323196, 339584, 282245, 282246, 290443, 323217, 282259, 298654, 282271, 282273, 282276, 298661, 290471, 282280, 298667, 224946, 306874, 110268, 224958, 282303, 274115, 306890, 241361, 282327, 298712, 298720, 282339, 282348, 282355, 323316, 282358, 339715, 216839, 339720, 282378, 372496, 323346, 282391, 282400, 339745, 315171, 257830, 421672, 282409, 282417, 200498, 282427, 282434, 282438, 307025, 413521, 216918, 307031, 241495, 282474, 282480, 241528, 339841, 282504, 315273, 315274, 110480, 184208, 372626, 380821, 282518, 282519, 298909, 118685, 298920, 323507, 290745, 290746, 274371, 151497, 372701, 298980, 380908, 290811, 102437, 315432, 233517, 102445, 176175, 282672, 241716, 225351, 315465, 315476, 307289, 315487, 356447, 45153, 307301, 438377, 299121, 233589, 233590, 266357, 422019, 241808, 381073, 233636, 299174, 233642, 299187, 405687, 184505, 299198, 258239, 389313, 299203, 299209, 372941, 282831, 266449, 176362, 307435, 438511, 381172, 184570, 184575, 381208, 282909, 299293, 151839, 282913, 233762, 217380, 332083, 332085, 332089, 315706, 282939, 307517, 438596, 332101, 323913, 348492, 323920, 348500, 168281, 332123, 323935, 332127, 242023, 160110, 242033, 291192, 340357, 225670, 242058, 373134, 242078, 61857, 315810, 61859, 315811, 381347, 340398, 299441, 283064, 291267, 127427, 127428, 283075, 324039, 373197, 176601, 160225, 291311, 233978, 291333, 340490, 283153, 258581, 291358, 283182, 283184, 234036, 315960, 348732, 242237, 70209, 348742, 70215, 348749, 381517, 332378, 201308, 111208, 184940, 373358, 389745, 209530, 373375, 152195, 348806, 152203, 316049, 111253, 316053, 111258, 111259, 176808, 299699, 422596, 422599, 291530, 225995, 242386, 422617, 422626, 234217, 299759, 299770, 234234, 299776, 242433, 291585, 430849, 291592, 62220, 422673, 430865, 291604, 422680, 283419, 234277, 283430, 152365, 422703, 422709, 152374, 160571, 430910, 160575, 160580, 381773, 201551, 242529, 349026, 357218, 177001, 308076, 242541, 209783, 209785, 177019, 185211, 308092, 398206, 291712, 381829, 316298, 308107, 308112, 349072, 234386, 324506, 324507, 390045, 185250, 283558, 185254, 373687, 373706, 316364, 234472, 234473, 349175, 201720, 127992, 357379, 234500, 234514, 308243, 300068, 357414, 300084, 308287, 218186, 234577, 341073, 439384, 234587, 300135, 316520, 357486, 144496, 234609, 300150, 300151, 291959, 160891, 300158, 234625, 349316, 349318, 234638, 373903, 169104, 177296, 308372, 185493, 119962, 283802, 300187, 300188, 234663, 300201, 300202, 373945, 283840, 259268, 283847, 283852, 259280, 316627, 333011, 234733, 234742, 292091, 128251, 234755, 439562, 292107, 414990, 251153, 177428, 349462, 382258, 300343, 382269, 300359, 234827, 177484, 406861, 259406, 234831, 357719, 283991, 374109, 292195, 333160, 284014, 316787, 357762, 112017, 234898, 259475, 275859, 357786, 251298, 333220, 374191, 292283, 292292, 300487, 300489, 210390, 210391, 210393, 144867, 316902, 251378, 308723, 300535, 300536, 292356, 259599, 308756, 398869, 374296, 374299, 308764, 431649, 169518, 431663, 194110, 349763, 218696, 292425, 128587, 333388, 300630, 128599, 235095, 333408, 300644, 317032, 415338, 243307, 54893, 325231, 325245, 194180, 415375, 153251, 300714, 210603, 300728, 415420, 333503, 218819, 259781, 333517, 333520, 325346, 153319, 325352, 284401, 300794, 325371, 194303, 194304, 300811, 284431, 243472, 366360, 284442, 325404, 284459, 399147, 431916, 300848, 259899, 325439, 153415, 341836, 415567, 325457, 317269, 341847, 284507, 350044, 300894, 128862, 284512, 284514, 276327, 292712, 423789, 325492, 276341, 300918, 341879, 317304, 333688, 194429, 112509, 55167, 325503, 333701, 243591, 243597, 325518, 333722, 350109, 300963, 292771, 415655, 284587, 292782, 243637, 301008, 153554, 194515, 292836, 292837, 317415, 325619, 432116, 292858, 415741, 333828, 358410, 399373, 317467, 145435, 292902, 227370, 325674, 309295, 129076, 243767, 358456, 309345, 227428, 194666, 260207, 432240, 284788, 292988, 292992, 194691, 227460, 415881, 104587, 235662, 284825, 284826, 333991, 284842, 153776, 227513, 227524, 309444, 227548, 194782, 301279, 317664, 227578, 243962, 375039, 325905, 325912, 211235, 432421, 211238, 358703, 358709, 260418, 227654, 6481, 366930, 6489, 383332, 416104, 383336, 285040, 211326, 317831, 227725, 252308, 178582, 285084, 121245, 285090, 342450, 293303, 293306, 293310, 416197, 129483, 342476, 326100, 285150, 342498, 358882, 334309, 391655, 432618, 375276, 309744, 416286, 375333, 293419, 244269, 375343, 236081, 23092, 375351, 244281, 309830, 301638, 293448, 55881, 416341, 309846, 285271, 416351, 268899, 39530, 301689, 244347, 326287, 375440, 334481, 318106, 318107, 342682, 285361, 342706, 318130, 293556, 383667, 285371, 285372, 285373, 285374, 39614, 154316, 96984, 375526, 285415, 342762, 342763, 293612, 154359, 228088, 432893, 162561, 285444, 383754, 310036, 326429, 293664, 326433, 400166, 293672, 285487, 301871, 375609, 285497, 293693, 252741, 318278, 293711, 244568, 244570, 301918, 293730, 342887, 400239, 310131, 228215, 400252, 359298, 359299, 260996, 113542, 228233, 228234, 392074, 56208, 293781, 318364, 310176, 310178, 310182, 293800, 236461, 293806, 326581, 326587, 326601, 359381, 433115, 343005, 326635, 203757, 187374, 383983, 277492, 318461, 293886, 277509, 293893, 433165, 384016, 277524, 293910, 433174, 252958, 203830, 359478, 277597, 302177, 392290, 253029, 285798, 228458, 15471, 351344, 285814, 285820, 392318, 187521, 384131, 285828, 302213, 285830, 302216, 228491, 326804, 187544, 285851, 351390, 302240, 253099, 253100, 318639, 367799, 294074, 113850, 64700, 228540, 228542, 302274, 367810, 195808, 310497, 228588, 302325, 228600, 261377, 228609, 253216, 130338, 130343, 261425, 351537, 286013, 286018, 113987, 294218, 146762, 294219, 318805, 425304, 294243, 163175, 327024, 318848, 179587, 294275, 253317, 384393, 368011, 318864, 318868, 318875, 310692, 245161, 310701, 286129, 286132, 228795, 425405, 302531, 425418, 310732, 302540, 64975, 310736, 228827, 286172, 187878, 286202, 359930, 286205, 302590, 294400, 253451, 359950, 146964, 253463, 302623, 286244, 245287, 245292, 196164, 228943, 286288, 179801, 343647, 286306, 310889, 204397, 138863, 188016, 294529, 286343, 229001, 310923, 188048, 425626, 229020, 302754, 40613, 40614, 40615, 229029, 286388, 286391, 384695, 327358, 286399, 212685, 302797, 212688, 384720, 302802, 286423, 278233, 278234, 294622, 278240, 212716, 212717, 360177, 229113, 286459, 278272, 319233, 311042, 360195, 278291, 278293, 286494, 294700, 409394, 319292, 360252, 360264, 188251, 376669, 245599, 237408, 425825, 425833, 417654, 188292, 294807, 294809, 376732, 294814, 311199, 319392, 294823, 327596, 294843, 188348, 98239, 237504, 294850, 384964, 163781, 344013, 212942, 24532, 294886, 311281, 311282 ]
5987d8bf4b1de7edc5306a71f7e33844039d7b00
a54e28ffa5be9df3f4acc24000b3d0fcc416320d
/Scoreboard/PreviousGamesView.swift
e94a3a2b73b4fcc0c93ee75ae70f1baa3adcb484
[]
no_license
steve3424/Scoreboard
3be8ba54dd464fa2ea26b39a3936563b20dcd812
e07a8a001c663d4585c7a74d73170dea800c9151
refs/heads/master
2022-12-24T22:11:05.473933
2020-10-01T01:30:14
2020-10-01T01:30:14
300,106,232
0
0
null
null
null
null
UTF-8
Swift
false
false
3,009
swift
// // PreviousGamesView.swift // Scoreboard // // Created by user179118 on 9/9/20. // Copyright © 2020 stevef. All rights reserved. // import SwiftUI struct PreviousGamesView: View { // core data @Environment(\.managedObjectContext) var managed_object_context @FetchRequest(fetchRequest: GameStateSaved.GetGames()) var games:FetchedResults<GameStateSaved> // custom navigation @Environment(\.presentationMode) var presentationMode: Binding<PresentationMode> @Binding var root_view: Bool @State var load_game_nav: Bool = false @State var game_to_load: GameStateSaved? = nil @State var save_failed: Bool = false var date_formatter: DateFormatter { let formatter = DateFormatter() formatter.dateStyle = .short return formatter } init(root_view: Binding<Bool>) { self._root_view = root_view } var body: some View { VStack(spacing: 0) { // NAV BAR HStack { Button(action: { self.presentationMode.wrappedValue.dismiss() }) { HStack { Text("back") } } Spacer() } .padding() List { ForEach(self.games) { game in HStack(alignment: .bottom, spacing: 10) { Text(game.game_name) Spacer() Text(self.date_formatter.string(from: game.end_date)) } .contentShape(Rectangle()) .onTapGesture(perform: { self.game_to_load = game self.load_game_nav = true }) } .onDelete(perform: { index_set in let delete_item = self.games[index_set.first!] self.managed_object_context.delete(delete_item) do { try self.managed_object_context.save() } catch { self.save_failed = true } }) } .alert(isPresented: $save_failed) { Alert(title: Text("Save Game Failed!"), message: Text("Something went wrong and this game did not save. Sorry."), dismissButton: .default(Text("OK"))) } NavigationLink(destination: CreateGameView(game_to_load: self.game_to_load, root_view: self.$load_game_nav), isActive: $load_game_nav) { EmptyView() } .isDetailLink(false) } .navigationBarTitle("") .navigationBarHidden(true) } } struct PreviousGamesView_Previews: PreviewProvider { static var previews: some View { PreviousGamesView(root_view: .constant(true)) } }
[ -1 ]
6f3c196ab60eed5bbcc1cdec27830f870e13cfcc
e0f5dd708689b01588209f4d3897abac1876d059
/Tests/MetadataTests.swift
2126c23672b5cccbae9fa0707e11f944bb094956
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
Rich2k/push-notifications-swift
e679ccd411aec1a0a9fde9a89cbc7f1c0aaf9afb
9a5e695eacd58677f54ba8572eab460b0d84626f
refs/heads/master
2023-04-06T11:48:39.175111
2019-02-20T16:53:11
2019-02-20T16:53:11
null
0
0
null
null
null
null
UTF-8
Swift
false
false
4,364
swift
import XCTest @testable import PushNotifications class MetadataTests: XCTestCase { var metadata: Metadata! override func setUp() { #if os(iOS) self.metadata = Metadata(sdkVersion: "0.9.2", iosVersion: "10.2", macosVersion: nil) #elseif os(OSX) self.metadata = Metadata(sdkVersion: "0.9.2", iosVersion: nil, macosVersion: "10.0") #endif super.setUp() } override func tearDown() { self.metadata = nil super.tearDown() } #if os(iOS) func testMetadataModel() { XCTAssertNotNil(self.metadata) XCTAssertNotNil(self.metadata.sdkVersion) XCTAssertNotNil(self.metadata.iosVersion) XCTAssertNil(self.metadata.macosVersion) XCTAssert(self.metadata.sdkVersion == "0.9.2") XCTAssert(self.metadata.iosVersion == "10.2") XCTAssert(self.metadata.macosVersion == nil) } func testPropertyListRepresentation() { let propertyListRepresentation = self.metadata.propertyListRepresentation() XCTAssertNotNil(propertyListRepresentation) XCTAssertNotNil(propertyListRepresentation["sdkVersion"]) XCTAssertNotNil(propertyListRepresentation["iosVersion"]) XCTAssertNotNil(propertyListRepresentation["macosVersion"]) XCTAssert(propertyListRepresentation["sdkVersion"] as! String == "0.9.2") XCTAssert(propertyListRepresentation["iosVersion"] as? String == "10.2") XCTAssert(propertyListRepresentation["macosVersion"] as? String == "") } func testSaveAndLoadFromUserDefaults() { self.metadata.save() guard let metadataDictionary = Metadata.load() else { XCTFail() return } let metadata = Metadata(propertyListRepresentation: metadataDictionary) XCTAssertNotNil(metadata.sdkVersion) XCTAssertNotNil(metadata.iosVersion) XCTAssertNotNil(metadata.macosVersion) XCTAssert(metadata.sdkVersion == "0.9.2") XCTAssert(metadata.iosVersion == "10.2") XCTAssert(metadata.macosVersion == "") } #elseif os(OSX) func testMetadataModel() { XCTAssertNotNil(self.metadata) XCTAssertNotNil(self.metadata.sdkVersion) XCTAssertNil(self.metadata.iosVersion) XCTAssertNotNil(self.metadata.macosVersion) XCTAssert(self.metadata.sdkVersion == "0.9.2") XCTAssert(self.metadata.iosVersion == nil) XCTAssert(self.metadata.macosVersion == "10.0") } func testPropertyListRepresentation() { let propertyListRepresentation = self.metadata.propertyListRepresentation() XCTAssertNotNil(propertyListRepresentation) XCTAssertNotNil(propertyListRepresentation["sdkVersion"]) XCTAssertNotNil(propertyListRepresentation["iosVersion"]) XCTAssertNotNil(propertyListRepresentation["macosVersion"]) XCTAssert(propertyListRepresentation["sdkVersion"] as! String == "0.9.2") XCTAssert(propertyListRepresentation["iosVersion"] as? String == "") XCTAssert(propertyListRepresentation["macosVersion"] as? String == "10.0") } func testSaveAndLoadFromUserDefaults() { self.metadata.save() guard let metadataDictionary = Metadata.load() else { XCTFail() return } let metadata = Metadata(propertyListRepresentation: metadataDictionary) XCTAssertNotNil(metadata.sdkVersion) XCTAssertNotNil(metadata.iosVersion) XCTAssertNotNil(metadata.macosVersion) XCTAssert(metadata.sdkVersion == "0.9.2") XCTAssert(metadata.iosVersion == "") XCTAssert(metadata.macosVersion == "10.0") } #endif func testMetadataIsOutdated() { XCTAssertTrue(self.metadata.hasChanged()) } func testMetadataUpdate() { let updatedMetadata = Metadata.update() XCTAssertNotNil(updatedMetadata) XCTAssertFalse(updatedMetadata.hasChanged()) guard let metadataDictionary = Metadata.load() else { XCTFail() return } let metadata = Metadata(propertyListRepresentation: metadataDictionary) XCTAssertNotNil(metadata.sdkVersion) XCTAssertNotNil(metadata.iosVersion) XCTAssertNotNil(metadata.macosVersion) XCTAssert(metadata.sdkVersion == "1.2.0") } }
[ -1 ]
b6b3a9fb0d5fe1b421b816d218cf5ab187cd8c23
e8a45807b78147200db724adff7166c8f341e9ba
/3/DependencyInjection-Start/DependencyInjection/Book.swift
aed56737a36b33b183c491763e4a6a3c9aa20727
[]
no_license
f1l0s0l/iosint-code
9f82cab557763cc7ac86e1c9a2d4fdef187bb741
8745baa3c2b1dc886957d985c0100b27604cd1ee
refs/heads/main
2023-06-08T17:14:53.373777
2021-06-21T17:13:56
2021-06-21T17:13:56
null
0
0
null
null
null
null
UTF-8
Swift
false
false
126
swift
// // Copyright © 2021 Netology. All rights reserved. // struct Book { let author: String let title: String }
[ -1 ]