Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
73f22e0
commit e457cc0
Showing
3 changed files
with
138 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
Pod::Spec.new do |s| | ||
s.name = "WZMarqueeViewer" | ||
s.version = "1.0.0" | ||
s.summary = "A marquee view used on iOS." | ||
s.description = '<<-DESC | ||
It is a marquee view used on iOS, which implement by Objective-C. | ||
DESC' | ||
|
||
s.homepage = "https://github.com/wanghongli123/WZMarqueeViewer" | ||
# s.screenshots = "www.example.com/screenshots_1", "www.example.com/screenshots_2" | ||
s.license = 'MIT' | ||
s.author = { "王XX" => "619152022@163.com" } | ||
s.source = { :git => "https://github.com/wanghongli123/WZMarqueeViewer.git", :tag => s.version.to_s } | ||
# s.social_media_url = 'https://twitter.com/NAME' | ||
|
||
s.platform = :ios, '7.0' | ||
# s.ios.deployment_target = '5.0' | ||
# s.osx.deployment_target = '10.7' | ||
s.requires_arc = true | ||
|
||
s.source_files = 'WZMarqueeViewer/*' | ||
# s.resources = 'Assets' | ||
|
||
# s.ios.exclude_files = 'Classes/osx' | ||
# s.osx.exclude_files = 'Classes/ios' | ||
# s.public_header_files = 'Classes/**/*.h' | ||
s.frameworks = 'Foundation', 'CoreGraphics', 'UIKit' | ||
|
||
end |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// | ||
// AlertProgress.h | ||
// ZengQiangHaoMa | ||
// | ||
// Created by apple on 11-12-13. | ||
// Copyright (c) 2011年 __MyCompanyName__. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
@interface AlertProgress : NSObject <UIAlertViewDelegate> { | ||
UIAlertView *alertView; | ||
} | ||
|
||
+(id)sharedAlertProgress; | ||
|
||
-(void)showAlertWithMessage:(NSString*)msg; | ||
-(void)closeAlert; | ||
|
||
-(void)messageBoxWithConfirm:(NSString*)msg; | ||
|
||
- (void)showAutoDismissMessage:(NSString*)msg time:(float)time; | ||
|
||
@end |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
// | ||
// AlertProgress.m | ||
// ZengQiangHaoMa | ||
// | ||
// Created by apple on 11-12-13. | ||
// Copyright (c) 2011年 __MyCompanyName__. All rights reserved. | ||
// | ||
|
||
#import "AlertProgress.h" | ||
|
||
@implementation AlertProgress | ||
|
||
static id shared = nil; | ||
|
||
+(id)sharedAlertProgress{ | ||
if (shared == nil) { | ||
shared = [[AlertProgress alloc] init]; | ||
} | ||
return shared; | ||
} | ||
|
||
-(void)showAlertWithMessage:(NSString*)msg{ | ||
if ([NSThread isMainThread]) { | ||
if (alertView == nil) { | ||
alertView = [[UIAlertView alloc] initWithTitle:msg message:@"" delegate:nil cancelButtonTitle:nil otherButtonTitles:nil]; | ||
[alertView show]; | ||
|
||
UIActivityIndicatorView *activityView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge]; | ||
[activityView setCenter:CGPointMake(alertView.bounds.size.width/2, alertView.bounds.size.height/2+15)]; | ||
[alertView addSubview:activityView]; | ||
[activityView startAnimating]; | ||
} | ||
} | ||
else { | ||
[self performSelectorOnMainThread:@selector(showAlertWithMessage:) withObject:msg waitUntilDone:YES]; | ||
} | ||
} | ||
|
||
-(void)closeAlert{ | ||
if ([NSThread isMainThread]) { | ||
if (alertView) { | ||
[alertView dismissWithClickedButtonIndex:0 animated:YES]; | ||
alertView = nil; | ||
} | ||
} | ||
else { | ||
[self performSelectorOnMainThread:@selector(closeAlert) withObject:nil waitUntilDone:YES]; | ||
} | ||
} | ||
|
||
|
||
static UIAlertView *alertMsgbox = nil; | ||
|
||
-(void)messageBoxWithConfirm:(NSString*)msg{ | ||
if (alertMsgbox) return; | ||
if ([NSThread isMainThread]) { | ||
if ([msg length] > 50) { | ||
alertMsgbox = [[UIAlertView alloc] initWithTitle:@"提示" message:msg delegate:nil cancelButtonTitle:@"确认" otherButtonTitles:nil]; | ||
[alertMsgbox setDelegate:self]; | ||
[alertMsgbox show]; | ||
} | ||
else { | ||
alertMsgbox = [[UIAlertView alloc] initWithTitle:msg message:nil delegate:nil cancelButtonTitle:@"确认" otherButtonTitles:nil]; | ||
[alertMsgbox setDelegate:self]; | ||
[alertMsgbox show]; | ||
} | ||
} | ||
else { | ||
[self performSelectorOnMainThread:@selector(messageBoxWithConfirm:) withObject:msg waitUntilDone:YES]; | ||
} | ||
} | ||
|
||
-(void)alertView:(UIAlertView *)alert didDismissWithButtonIndex:(NSInteger)buttonIndex{ | ||
if (alert == alertMsgbox) { | ||
alertMsgbox = nil; | ||
} | ||
} | ||
|
||
- (void)showAutoDismissMessage:(NSString*)msg time:(float)time{ | ||
UIAlertView *autoAlertView = [[UIAlertView alloc] initWithTitle:msg message:nil delegate:nil cancelButtonTitle:nil otherButtonTitles:nil, nil]; | ||
[autoAlertView show]; | ||
[autoAlertView performSelector:@selector(dismissWithClickedButtonIndex:animated:) withObject:nil afterDelay:time<=0?0.3:time]; | ||
} | ||
|
||
@end |