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
| @interface HysteriaPlayerManager : NSObject | |
| + (instancetype)sharedInstance; | |
| - (void)setupNewSourceGetter:(id)responseObject; | |
| @end |
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 "PlayingItems.h" | |
| #import "Song.h" | |
| #import <HysteriaPlayer.h> | |
| @implementation HysteriaPlayerManager | |
| static HysteriaPlayerManager *_sharedInstance = nil; | |
| static dispatch_once_t onceToken; | |
| + (instancetype)sharedInstance |
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 <HysteriaPlayer.h> | |
| @interface PlayerViewController : UIViewController <HysteriaPlayerDelegate> | |
| @end |
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)viewDidAppear:(BOOL)animated | |
| { | |
| [super viewDidAppear:animated]; | |
| [[HysteriaPlayer sharedInstance] addDelegate:self]; | |
| } | |
| - (void)viewDidDisappear:(BOOL)animated | |
| { | |
| [super viewDidDisappear:animated]; |
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)hysteriaPlayerCurrentItemChanged:(AVPlayerItem *)item | |
| { | |
| [self updateCurrentItem]; | |
| } | |
| - (void)hysteriaPlayerRateChanged:(BOOL)isPlaying | |
| { | |
| [self updateInterfaceState:isPlaying]; | |
| } |
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 lldb | |
| import re | |
| import shlex | |
| # This script allows Xcode to selectively ignore Obj-C exceptions | |
| # based on any selector on the NSException instance | |
| def getRegister(target): | |
| if target.triple.startswith('x86_64'): | |
| return "rdi" |
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
| #!/bin/sh | |
| # xcode-build-number-generator.sh | |
| # @desc Automaticvally create build number every time using curent day, month and year | |
| # @usage | |
| # 1. Select: your Target in Xcode | |
| # 2. Select: Build Phases Tab | |
| # 3. Select: Add Build Phase -> Add Run Script | |
| # 4. Paste code below in to new "Run Script" section | |
| # 5. Drag the "Run Script" below "Link Binaries With Libraries" |
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)findMisbehavingScrollViews | |
| { | |
| UIView *view = [[UIApplication sharedApplication] keyWindow]; | |
| [self findMisbehavingScrollViewsIn:view]; | |
| } | |
| - (void)findMisbehavingScrollViewsIn:(UIView *)view | |
| { | |
| if ([view isKindOfClass:[UIScrollView class]]) | |
| { |
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
| - (NSDictionary *)groupByKey:(NSString *)key | |
| { | |
| NSMutableDictionary *dictionary = [NSMutableDictionary dictionary]; | |
| for (id obj in self) { | |
| id keyValue = [obj valueForKey:key]; | |
| if (keyValue) { | |
| NSMutableArray *array = dictionary[keyValue]; | |
| if (!array) { | |
| array = [NSMutableArray array]; |
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
| - (NSArray *)shuffle | |
| { | |
| NSUInteger count = [self count]; | |
| NSMutableArray *mutableArray = [NSMutableArray arrayWithArray:self]; | |
| for (NSUInteger i = 0; i < count; ++i) { | |
| NSInteger remainingCount = count - i; | |
| NSInteger exchangeIndex = i + arc4random_uniform((u_int32_t )remainingCount); | |
| [mutableArray exchangeObjectAtIndex:i withObjectAtIndex:exchangeIndex]; | |
| } | |