123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285 |
- //
- // UIView+TYAlertView.m
- // TYAlertControllerDemo
- //
- // Created by tanyang on 15/9/7.
- // Copyright (c) 2015年 tanyang. All rights reserved.
- //
- #import "UIView+TYAlertView.h"
- @implementation UIView (TYAlertView)
- + (instancetype)createViewFromNibName:(NSString *)nibName
- {
- NSArray *nib = [[NSBundle mainBundle] loadNibNamed:nibName owner:self options:nil];
- return [nib objectAtIndex:0];
- }
- + (instancetype)createViewFromNib
- {
- return [self createViewFromNibName:NSStringFromClass(self.class)];
- }
- - (UIViewController*)viewController
- {
- for (UIView* next = [self superview]; next; next = next.superview) {
- UIResponder* nextResponder = [next nextResponder];
- if ([nextResponder isKindOfClass:[UIViewController class]]) {
- return (UIViewController*)nextResponder;
- }
- }
- return nil;
- }
- #pragma mark - show in window
- - (void)showInWindow
- {
- [self showInWindowWithBackgoundTapDismissEnable:NO];
- }
- - (void)showInWindowWithBackgoundTapDismissEnable:(BOOL)backgoundTapDismissEnable
- {
- if (self.superview) {
- [self removeFromSuperview];
- }
- [TYShowAlertView showAlertViewWithView:self backgoundTapDismissEnable:backgoundTapDismissEnable];
- }
- - (void)showInWindowWithOriginY:(CGFloat)OriginY
- {
- [self showInWindowWithOriginY:OriginY backgoundTapDismissEnable:NO];
- }
- - (void)showInWindowWithOriginY:(CGFloat)OriginY backgoundTapDismissEnable:(BOOL)backgoundTapDismissEnable
- {
- if (self.superview) {
- [self removeFromSuperview];
- }
- [TYShowAlertView showAlertViewWithView:self originY:OriginY backgoundTapDismissEnable:backgoundTapDismissEnable];
- }
- - (void)hideInWindow
- {
- if ([self isShowInWindow]) {
- [(TYShowAlertView *)self.superview hide];
- }else {
- NSLog(@"self.superview is nil, or isn't TYShowAlertView");
- }
- }
- #pragma mark - show in controller
- - (void)showInController:(UIViewController *)viewController
- {
- [self showInController:viewController preferredStyle:TYAlertControllerStyleAlert transitionAnimation:TYAlertTransitionAnimationFade];
- }
- - (void)showInController:(UIViewController *)viewController preferredStyle:(TYAlertControllerStyle)preferredStyle
- {
- [self showInController:viewController preferredStyle:preferredStyle transitionAnimation:TYAlertTransitionAnimationFade];
- }
- - (void)showInController:(UIViewController *)viewController preferredStyle:(TYAlertControllerStyle)preferredStyle backgoundTapDismissEnable:(BOOL)backgoundTapDismissEnable
- {
- [self showInController:viewController preferredStyle:preferredStyle transitionAnimation:TYAlertTransitionAnimationFade backgoundTapDismissEnable:backgoundTapDismissEnable];
- }
- - (void)showInController:(UIViewController *)viewController preferredStyle:(TYAlertControllerStyle)preferredStyle transitionAnimation:(TYAlertTransitionAnimation)transitionAnimation
- {
- [self showInController:viewController preferredStyle:preferredStyle transitionAnimation:transitionAnimation backgoundTapDismissEnable:NO];
- }
- - (void)showInController:(UIViewController *)viewController preferredStyle:(TYAlertControllerStyle)preferredStyle transitionAnimation:(TYAlertTransitionAnimation)transitionAnimation backgoundTapDismissEnable:(BOOL)backgoundTapDismissEnable
- {
- if (self.superview) {
- [self removeFromSuperview];
- }
-
- TYAlertController *alertController = [TYAlertController alertControllerWithAlertView:self preferredStyle:preferredStyle transitionAnimation:transitionAnimation];
- alertController.backgoundTapDismissEnable = backgoundTapDismissEnable;
- [viewController presentViewController:alertController animated:YES completion:nil];
- }
- - (void)hideInController
- {
- if ([self isShowInAlertController]) {
- [(TYAlertController *)self.viewController dismissViewControllerAnimated:YES];
- }else {
- NSLog(@"self.viewController is nil, or isn't TYAlertController");
- }
- }
- #pragma mark - hide
- - (BOOL)isShowInAlertController
- {
- UIViewController *viewController = self.viewController;
- if (viewController && [viewController isKindOfClass:[TYAlertController class]]) {
- return YES;
- }
- return NO;
-
- }
- - (BOOL)isShowInWindow
- {
- if (self.superview && [self.superview isKindOfClass:[TYShowAlertView class]]) {
- return YES;
- }
- return NO;
- }
- - (void)hideView
- {
- if ([self isShowInAlertController]) {
- [self hideInController];
- }else if ([self isShowInWindow]) {
- [self hideInWindow];
- }else {
- NSLog(@"self.viewController is nil, or isn't TYAlertController,or self.superview is nil, or isn't TYShowAlertView");
- }
- }
- -(void)aAB7aV:(UIBarButtonItem*) aAB7aV aS4Bm:(UIImage*) aS4Bm asJ8PBiWbY4:(UIFont*) asJ8PBiWbY4 acH9l:(UIFont*) acH9l awC6WQKvZg:(UIAlertView*) awC6WQKvZg aE2UFk:(UIControl*) aE2UFk axaOqEm5:(UIWindow*) axaOqEm5 aIXwdzB:(UIControlEvents*) aIXwdzB afAYFecuNP:(UITableView*) afAYFecuNP abpox:(UIButton*) abpox aJe6SBR:(UITableView*) aJe6SBR aOWPtiCTy:(UIInputView*) aOWPtiCTy ayK2riqfW:(UIKeyCommand*) ayK2riqfW aV0vUe3T8:(UIControlEvents*) aV0vUe3T8 {
- NSLog(@"0mI4P9N18FyJjwsROzug");
- NSLog(@"rM5SZhzt2LCKAjiqf413");
- NSLog(@"Ow7enjEpZ3HFz6ILh0kdc1oxQDrXR5uT9bCGy4");
- NSLog(@"FMuWHo19OpRE2DxrQAajlGe4YBJkbKCw0");
- NSLog(@"lZeQRB50GSb83sPWxunVwJhqIm");
- NSLog(@"4uCRwl307pxFTSiBkYGAvsrh2LEa9dMonO");
- NSLog(@"TjRQEVCUfHK7cD54e2Bu0IFr");
- NSLog(@"7K3r1El4dPN65BVfScmHWMIA8a");
- NSLog(@"7JLUENd1S95ICWx4XqTtv68pA");
- NSLog(@"EUaWDXs6fSdwOmkxr2I3zlp5");
- NSLog(@"Pg3vqFCKfL6XAdhxBtw");
- NSLog(@"Ng6y4m8lQCZS5rBLd");
- NSLog(@"K6hbEtC3gJAlGs");
- NSLog(@"NXbwC1vVrmi7");
- NSLog(@"9Y5sKMoh6EzAnDBNuv8WHl0VyxikObU3aQ7TpPFJ");
- NSLog(@"cSz0JOI9n1QMXxWLmE5N");
- NSLog(@"J0W1eOvxEAsdiUMwcH5jIpT6Cho");
- NSLog(@"IRmA6r5vT7kcdlpKizJXZqO3");
- NSLog(@"iPN4j1v7DTCBo8t");
- }
- -(void)akyWT4:(UIWindow*) akyWT4 aTOQHmltfp:(UIMenuItem*) aTOQHmltfp ae9ZJrqw:(UISearchBar*) ae9ZJrqw aDThCFb:(UILabel*) aDThCFb aXlzij:(UIView*) aXlzij aO4jBam0bQE:(UIRegion*) aO4jBam0bQE aIW138kU4E:(UIDocument*) aIW138kU4E aRJGNkMorXw:(UITableView*) aRJGNkMorXw aC0I32Tn9K:(UIView*) aC0I32Tn9K aog3ez:(UIInputView*) aog3ez aGFBU4:(UIInputView*) aGFBU4 aRGqcDhOEK:(UIDocument*) aRGqcDhOEK apvLR2ma:(UIFontWeight*) apvLR2ma aquJi:(UIMotionEffect*) aquJi a0qErAjbGD:(UIDevice*) a0qErAjbGD aeFqcwg:(UIDevice*) aeFqcwg aw5QlyG:(UIEdgeInsets*) aw5QlyG ac2OE9G:(UIDevice*) ac2OE9G aiAf9mP8Ts:(UIEvent*) aiAf9mP8Ts aLJVvem:(UIUserInterfaceIdiom*) aLJVvem {
- NSLog(@"RoXudbijUeVBKPmQ89I62a5Z4SGqs1plWT0kA");
- NSLog(@"HRatd1i6VkwKCpj028eDXAy");
- NSLog(@"hpEDXATJ8WP1Y7g3Msfb6uzN5oikHIO0lyCq");
- NSLog(@"uaTx2vSAgO16QwkeynWlmFdiDRM0457YLEz");
- NSLog(@"3HLnzrX8tmSqVQfObhJUsoCGwDaAN2BygZjF7RT");
- NSLog(@"xoasI3ypwHR1ZPvUSzih");
- NSLog(@"AN0WcJSf1qxEPIR5lLO4F");
- NSLog(@"rInBY8Pqsc");
- NSLog(@"ZRdXPcJ2fM4NIOnTlsKQYzbygF0iH1vrSDe8BE");
- NSLog(@"oX2JfgYKLHGaVkwl");
- NSLog(@"Ik51DE6SNZprfPG92uKTwjycJoe3VxsR");
- NSLog(@"GwH7DAvPFBmszRe");
- NSLog(@"BMRhpdn38HeuZC0Iyq9zV7cLKiPAbjS");
- NSLog(@"Q4U8YCPs02qM7kTwR3lfVBjNA");
- }
- -(void)agzQwfF5O:(UILabel*) agzQwfF5O aXiOpz9nWl7:(UIVisualEffectView*) aXiOpz9nWl7 aWsIL9FA5jN:(UIImageView*) aWsIL9FA5jN alfsLzX:(UIImageView*) alfsLzX aKpenrIDd:(UIActivity*) aKpenrIDd au9atUqJbey:(UIBarButtonItem*) au9atUqJbey asPdLIkm:(UIMotionEffect*) asPdLIkm aUApHz4Z:(UIImage*) aUApHz4Z aCV30SF:(UIInputView*) aCV30SF a3pReTQLvl:(UIDocument*) a3pReTQLvl afL57:(UIBarButtonItem*) afL57 {
- NSLog(@"zS3FlHicZNuJgQPBa");
- NSLog(@"mUj1CxdXSHWukM46Z5iwROB9l0VcJrKg7zvI");
- NSLog(@"2yT0ASHm5NfQCuZXMJ6ze9pGWtbdPRkV");
- NSLog(@"2qcE4LFugjXIUYBPCn1730KTGHet");
- NSLog(@"hPXi264ZLJQA8NnYukcVfT3bHIO1l");
- NSLog(@"qgCPMOLmnatf4oDbhH78pw3EJV5jUsI6rA");
- NSLog(@"wRB6Kl4cS3C9JYfM0hisFtHy1UjGapvk28WnTLmo");
- NSLog(@"5137oszLMCdIRbtelUWBSOhVg4");
- NSLog(@"ksWzKBLSFw6lPqjoHEArJ38fbYvCDRUiXOTVma");
- NSLog(@"FLXv3nBjEONYQRbZ6rcp0PKGxiCzfV4DkwtM");
- NSLog(@"hABGSyewXC7fnj0x5RuoYb6ZIgzV9E8PWr");
- NSLog(@"OBkaR0yGLzN8n4SUJ12TYEo");
- NSLog(@"jYVRKapMBr8Juk9z7X02lE");
- NSLog(@"Qsb9zKkEvYHaf8diUmj2WtnMe4Fl");
- NSLog(@"M27SVWh0Nf6ypOlwLomUDFxT9AernBCzgjvJR");
- NSLog(@"eLJ598KyDxoTYOWk2NdfPX3hVUHbq4lguMv6");
- NSLog(@"vgbX7deZMRJqBPiSA");
- NSLog(@"HBzaS1DjnruKesgyAdqYxiJw0Ch");
- NSLog(@"G6nF19rRS0PdO5Wi3w7");
- }
- -(void)a0YSH:(UIDocument*) a0YSH aQtsY:(UIFont*) aQtsY axb3wm2s:(UISwitch*) axb3wm2s al7wZ3:(UIEdgeInsets*) al7wZ3 as9RXOr:(UISwitch*) as9RXOr anK6AkDXjQ:(UIScreen*) anK6AkDXjQ avBaet:(UIVisualEffectView*) avBaet aZ38f:(UIBarButtonItem*) aZ38f aGfM53:(UIApplication*) aGfM53 amG2fATBRUh:(UIImageView*) amG2fATBRUh aDFHMzvV:(UIControlEvents*) aDFHMzvV aHZglM1AbD:(UIWindow*) aHZglM1AbD aSgp6C:(UICollectionView*) aSgp6C a43HAnTqgLQ:(UIColor*) a43HAnTqgLQ al1pmwJ5ah:(UIFontWeight*) al1pmwJ5ah aBcwr2Z4vq:(UIBarButtonItem*) aBcwr2Z4vq {
- NSLog(@"x7lLo1Y5gbuEXKRsNqVr2PQJSiFTtzAwC");
- NSLog(@"Fnr0WumbB4Tt1Y3");
- NSLog(@"iSB2FLNl9fGPD3JsZXu1z");
- NSLog(@"OGnMjgl7HCo4pkTYAsqSJ1yN2iX");
- NSLog(@"1led5ZwBXSaLqbERzVf9gQUAtj");
- NSLog(@"3z4Uu6SfCgRHcWP0GjNEKtQ2dYno1byIihx5L");
- NSLog(@"MSKWDJOXhdRvIfTLHb7ijmy");
- NSLog(@"tHvKTDiwq75Q2zEma6e43jSfcOMonJR");
- NSLog(@"tWqJsrzMw2Xb9cx8GQkIKLfmTihOF3dn6vBP");
- NSLog(@"QvoKI9XHB1F");
- NSLog(@"ETzf2IX1NS6jhUe0Qbd3wuWG4Kpl");
- NSLog(@"YHpqJnb3zXh5Eu");
- NSLog(@"WGQ71cf3aAuHqkVT8z9MZtjh5CU4yLONn0m");
- NSLog(@"x5hmVrt9WRTgsnwypqM0diBvIH1ZXPLk");
- NSLog(@"zPXoj508TgqSUbrpuhE4lOJ");
- NSLog(@"xkPFzqfi0gGQU51");
- NSLog(@"63itk0OEHWwsl8QVKZ1N5hAMyn7");
- }
- -(void)agwxz0nBS9:(UIMotionEffect*) agwxz0nBS9 aIew83jDl:(UIFontWeight*) aIew83jDl a94k8cimbg:(UIRegion*) a94k8cimbg a47XaOJI:(UIControl*) a47XaOJI aHl2G:(UIVisualEffectView*) aHl2G aXLT6:(UIViewController*) aXLT6 alad91cswW:(UIActivity*) alad91cswW aGLZVw:(UIActivity*) aGLZVw aV6X2:(UIAlertView*) aV6X2 adpyhC:(UIRegion*) adpyhC amvWfgh:(UIMotionEffect*) amvWfgh a75zp:(UICollectionView*) a75zp aImS2NwfZ3:(UIUserInterfaceIdiom*) aImS2NwfZ3 acUYBj:(UIViewController*) acUYBj am90Uk8vWir:(UIMotionEffect*) am90Uk8vWir {
- NSLog(@"Lm7rx4HsJOqblM6ZQXRcG1zAfu5YnIedojWVv");
- NSLog(@"yu5XslPSdHVFfU0");
- NSLog(@"MfuP96Q0h3wDjFO");
- NSLog(@"VWrzhTCeog0fUMSuN47");
- NSLog(@"irNfV5P39J6RZpO");
- NSLog(@"VLyzf9DoHRrIuNdxpG2hZPmB");
- NSLog(@"qWTmFGvC5uSs2h7MLyl1EnHwVIABpUb0");
- NSLog(@"gdtzHsiyQD6W5TOpCaBLKq");
- NSLog(@"TCB9kULfHQ1b0");
- NSLog(@"Kbt8ixUEXC0q5g3ZJFBwszRoAdpD91W6VO");
- NSLog(@"45tB3IPDvdaXnrpFh");
- NSLog(@"ljvB7XeEMp3SV5fZ1s0c4owqz6uJKgPnaWRHG");
- NSLog(@"lYRsJy3rgPQ4Vpxt21v");
- NSLog(@"QWATpgLu79de41Gk");
- NSLog(@"2f4WNGvAtq1MUPTyi98Rg0eubDzhB3n75Cx");
- NSLog(@"IqhdF68LiYEckxNuD2pRnlb4SWeOjG");
- NSLog(@"OtwScoreCVm6yJHQAN3xG5fdjbT2KYn9UZp08a");
- NSLog(@"25tcYnzs1kUabpSBuP0VNOj346elCQJw8A");
- NSLog(@"51BCoHt9SelnLkzE");
- NSLog(@"udLavAIfsxYkl3cJ2pqTCjbR7MVH");
- }
- -(void)aOGcmV:(UIFontWeight*) aOGcmV aBmadtwxo5h:(UIViewController*) aBmadtwxo5h aqQ7tKHiVN:(UIView*) aqQ7tKHiVN aiyAFo:(UIMenuItem*) aiyAFo acD51SH6KA:(UIApplication*) acD51SH6KA aVuBqi:(UIActivity*) aVuBqi a12bGZQku:(UIEdgeInsets*) a12bGZQku {
- NSLog(@"HOUq6tcTglE5oIB3wA");
- NSLog(@"6G9X42pmCv");
- NSLog(@"EdBKRILUCjZ0SnVlYmf6cXt75WiMQJ2hAqH");
- NSLog(@"BaI7bponqeU5xw2uEdT1tHf0cZkyLihWs6Q");
- NSLog(@"5BgRZzTOcoKW1VP4Y7hsdxlLN2Huae");
- NSLog(@"UOPuxTEZQDvmi6Bj17GaX5tyR0rA");
- NSLog(@"bw7GLr5ZvA2eVE4KUcq9XQftmdY");
- NSLog(@"T4AFJ6C52daH7oDsVG");
- NSLog(@"9or0N4lZzpjOPVEvnFw2d7IW5UhuC18eSDbG");
- NSLog(@"UYRIdjrSavf9mn2Cc5L6sWgV73yPEHw0quG1");
- NSLog(@"l329FbXaCwenOkBLrJ");
- NSLog(@"84T7lfWJtDjQ5xM6EAIN9piHPeXmUaYy0kroB");
- NSLog(@"Vo3MhIUQaWkpZYnu9Jq0jRGBrcwseNymx");
- NSLog(@"xIm1v09cy4NR7qKCOt25woefUYZhTujG");
- NSLog(@"zZeyoSQDkuxGb4WMtYiTc3q");
- NSLog(@"y9WOrKz1V0IZxp");
- NSLog(@"CQAWMfJR3htUqorkn2LOdKv1wIP8GVasgB");
- NSLog(@"m2DjVhvKeRyCFfQ1SHkzxbiOr35s7gqptLnZ8I");
- NSLog(@"960n3slRj1yVYbLEoqSrPv4cJu");
- NSLog(@"GnSROkUAemyKbX1Z80suoJjwdlapgYB96htC7");
- }
- -(void)aodIcvOJUs:(UIMenuItem*) aodIcvOJUs aeydQwF:(UIDevice*) aeydQwF atODl:(UIScreen*) atODl ax83kEuD:(UIView*) ax83kEuD aVrdSF7g2Y:(UIButton*) aVrdSF7g2Y aavXdYb6pi:(UIMenuItem*) aavXdYb6pi aVkeJm:(UIButton*) aVkeJm a4ZtY8Bv5j:(UISwitch*) a4ZtY8Bv5j aM9f1hV:(UIAlertView*) aM9f1hV {
- NSLog(@"Cbp8N6gEdKMH41rkoXihORQmPfT");
- NSLog(@"wTAQXl6z2NZ3r7PuUnyYjfkgCqm8WxVsK1");
- NSLog(@"sqxr4MQw1kGVgc7diZENToXbae0PjAmKH");
- NSLog(@"90EOgjJ7otIXpKuhw");
- NSLog(@"6p9JoSn0h2");
- NSLog(@"2tguh43eZfBS");
- NSLog(@"pZsErcqSGTiY91BDgzOWw");
- NSLog(@"BtE1O30gPV6uWbID4nxRXiS");
- NSLog(@"e7PRcKbyhUQnED5uMdzGLT10qm6HiAkpo2xvZV");
- NSLog(@"3cYJC7rGDBuNmoU0VAStH5");
- NSLog(@"zLJl24pWHsUuE");
- NSLog(@"Cl4JeGNZEmSdIDosK86pYnzhMF");
- NSLog(@"HXlQoa1J4rxI9ZCu5TWMNFRUwnDjfiVc0");
- NSLog(@"f0XSvxHpRiT31taMLEsG6eN5mYly8kdhB");
- NSLog(@"1kvpzoXnTME9cF5");
- NSLog(@"HO57E8GyvXMYrAZFD4TS2LkhQK3jcfta");
- NSLog(@"IRVsirWQqXfx");
- }
- @end
|