Skip to content

Instantly share code, notes, and snippets.

View RameshAran's full-sized avatar

Arangott Ramesh Chandran RameshAran

View GitHub Profile
- (IBAction)pause:(id)sender
{
if(self.mYTPlayerView.playerState == kYTPlayerStatePlaying){
[self.mYTPlayerView pauseVideo];
}
}
- (IBAction)stop:(id)sender
{
if(self.mYTPlayerView.playerState == kYTPlayerStatePlaying || self.mYTPlayerView.playerState == kYTPlayerStatePaused){
#pragma ---
#pragma YTPlayerView Delegates
- (void)playerViewDidBecomeReady:(YTPlayerView *)playerView
{
NSLog(@"YTPlayerView : playerViewDidBecomeReady");
NSArray *qualityLevels = [self.mYTPlayerView availableQualityLevels];
NSLog(@"quality levels available:- %@", qualityLevels);
}
- (void)printQualityLevel
{
NSLog(@"current playback quality:- ");
switch (self.mYTPlayerView.playbackQuality) {
case kYTPlaybackQualitySmall:
NSLog(@"kYTPlaybackQualitySmall");
break;
case kYTPlaybackQualityMedium:
NSLog(@"kYTPlaybackQualityMedium");
break;
UNUserNotificationCenter* center = [UNUserNotificationCenter currentNotificationCenter];
[center requestAuthorizationWithOptions:(UNAuthorizationOptionAlert + UNAuthorizationOptionSound)
completionHandler:^(BOOL granted, NSError * _Nullable error) {
// Enable or disable features based on authorization.
}];
let center = UNUserNotificationCenter.currentNotificationCenter()
center.requestAuthorizationWithOptions([.Alert, .Sound]) { (granted, error) in
// Enable or disable features based on authorization.
}
UNMutableNotificationContent* content = [[UNMutableNotificationContent alloc] init];
content.title = [NSString localizedUserNotificationStringForKey:@"Hello!"
arguments:nil];
content.body = [NSString localizedUserNotificationStringForKey:@"Hello_message_body"
arguments:nil];
content.sound = [UNNotificationSound defaultSound];
UNTimeIntervalNotificationTrigger* trigger = [UNTimeIntervalNotificationTrigger triggerWithTimeInterval:5
let content = UNMutableNotificationContent()
content.title = NSString.localizedUserNotificationString(forKey: "Hello!", arguments: nil)
content.body = NSString.localizedUserNotificationString(forKey: "Hello_message_body", arguments: nil)
content.sound = UNNotificationSound.default()
// Deliver the notification in five seconds.
let trigger = UNTimeIntervalNotificationTrigger.init(timeInterval: 5, repeats: false)
let request = UNNotificationRequest.init(identifier: "notification_sample_2", content: content, trigger: trigger)
// Schedule the notification.
import Foundation
class SessionManager {
public static let sharedInstance = SessionManager()
let dataManager: StoreDataManager
private init() {
self.dataManager = StoreDataManager()
}
import UIKit
enum AssetIdentifier: String {
case ImageIconOne = "icon_image_1"
case ImageIconTwo = "icon_image_2"
case ImageIconThree = "icon_image_3"
}
extension UIImage {
let image1 = UIImage(named: "icon_image_1")!
let image2 = UIImage(named: "icon_image_2")!
let image3 = UIImage(named: "icon_image_3")!