@available(iOS 10.0, *)
import UserNotifications
NSUserNotification API Reference
UNNotificationSound API Reference
UNUserNotificationCenter API Reference
| extension UITabBarController { | |
| /** | |
| Show or hide the tab bar. | |
| - Parameter hidden: `true` if the bar should be hidden. | |
| - Parameter animated: `true` if the action should be animated. | |
| - Parameter transitionCoordinator: An optional `UIViewControllerTransitionCoordinator` to perform the animation | |
| along side with. For example during a push on a `UINavigationController`. | |
| */ |
| // The MIT License (MIT) | |
| // | |
| // Copyright (c) 2017 Alexander Grebenyuk (github.com/kean). | |
| import Foundation | |
| import RxSwift | |
| import RxCocoa | |
| extension ObservableType { |
| let badwork = { (queue: DispatchQueue) in | |
| queue.async { | |
| let app = UIApplication.shared | |
| for index in 0..<100000 { | |
| let name = "Yolo \(index)" | |
| let identifier = app.beginBackgroundTask(withName: name, expirationHandler: { | |
| print("Expired") | |
| }); |
| call in viewDidLoad | |
| setUpNavBar(bottomBorderColor: .white, opacity: 0.4, height: 1) | |
| func setUpNavBar(bottomBorderColor:UIColor,opacity:Float,height:CGFloat){ | |
| self.navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default) | |
| let navLabel = UILabel(frame: CGRect.zero) | |
| navLabel.backgroundColor = UIColor.clear | |
| navLabel.font = UIFont.systemFont(ofSize: 18) | |
| navLabel.textAlignment = NSTextAlignment.center |
| // | |
| // UserInfoCell.swift | |
| // | |
| // Created by Mathias Claassen on 30/8/16. | |
| // Copyright © 2016 Xmartlabs. All rights reserved. | |
| // | |
| import Foundation | |
| import Eureka |
@available(iOS 10.0, *)
import UserNotifications
NSUserNotification API Reference
UNNotificationSound API Reference
UNUserNotificationCenter API Reference
| /// | |
| // AppDelegate.swift | |
| // ZeroToApp | |
| // | |
| import UIKit | |
| import Firebase | |
| import FBSDKCoreKit | |
| @UIApplicationMain |
| import UIKit | |
| // If you enjoyed this talk (video link will be up soon), then you might also enjoy our book Advanced Swift: http://www.objc.io/books/advanced-swift | |
| struct Person { | |
| let name: String | |
| let city: String | |
| } | |
| let people = [ |
| /** | |
| * Demonstrates how to use Apple's CloudKit server-to-server authentication | |
| * | |
| * Create private key with: `openssl ecparam -name prime256v1 -genkey -noout -out eckey.pem` | |
| * Generate the public key to register at the CloudKit dashboard: `openssl ec -in eckey.pem -pubout` | |
| * | |
| * @see https://developer.apple.com/library/prerelease/ios/documentation/DataManagement/Conceptual/CloutKitWebServicesReference/SettingUpWebServices/SettingUpWebServices.html#//apple_ref/doc/uid/TP40015240-CH24-SW6 | |
| * | |
| * @author @spllr | |
| */ |
| <?php | |
| // Constants | |
| $KEY_ID = 'YOUR_KEY_ID'; | |
| $CONTAINER = 'YOUR_CONTAINER'; | |
| $PRIVATE_PEM_LOCATION = 'eckey.pem'; // Store this file outside the public folder! | |
| // Config | |
| $url = 'https://api.apple-cloudkit.com/database/1/' . $CONTAINER . '/development/public/records/query'; | |
| $body = '{"query":{"recordType":"Articles"}}'; |