This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (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){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma --- | |
#pragma YTPlayerView Delegates | |
- (void)playerViewDidBecomeReady:(YTPlayerView *)playerView | |
{ | |
NSLog(@"YTPlayerView : playerViewDidBecomeReady"); | |
NSArray *qualityLevels = [self.mYTPlayerView availableQualityLevels]; | |
NSLog(@"quality levels available:- %@", qualityLevels); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)printQualityLevel | |
{ | |
NSLog(@"current playback quality:- "); | |
switch (self.mYTPlayerView.playbackQuality) { | |
case kYTPlaybackQualitySmall: | |
NSLog(@"kYTPlaybackQualitySmall"); | |
break; | |
case kYTPlaybackQualityMedium: | |
NSLog(@"kYTPlaybackQualityMedium"); | |
break; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UNUserNotificationCenter* center = [UNUserNotificationCenter currentNotificationCenter]; | |
[center requestAuthorizationWithOptions:(UNAuthorizationOptionAlert + UNAuthorizationOptionSound) | |
completionHandler:^(BOOL granted, NSError * _Nullable error) { | |
// Enable or disable features based on authorization. | |
}]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let center = UNUserNotificationCenter.currentNotificationCenter() | |
center.requestAuthorizationWithOptions([.Alert, .Sound]) { (granted, error) in | |
// Enable or disable features based on authorization. | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
class SessionManager { | |
public static let sharedInstance = SessionManager() | |
let dataManager: StoreDataManager | |
private init() { | |
self.dataManager = StoreDataManager() | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
enum AssetIdentifier: String { | |
case ImageIconOne = "icon_image_1" | |
case ImageIconTwo = "icon_image_2" | |
case ImageIconThree = "icon_image_3" | |
} | |
extension UIImage { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let image1 = UIImage(named: "icon_image_1")! | |
let image2 = UIImage(named: "icon_image_2")! | |
let image3 = UIImage(named: "icon_image_3")! |