Latest 0.1.1
Homepage https://github.com/ablettchen/ATPopupView
License MIT
Platforms ios 8.0, requires ARC
Dependencies Masonry, YYText, ATCategories
Frameworks UIKit, Foundation
Authors

CI Status
Version
License
Platform

介绍

MMPopupView 的基础上稍作修改,感谢 adad184 原作者无私奉献 !

Example

ATPopupView

#import <ATPopupHeader.h>

一、ATAlertView

  • Default
NSString *detail = @"neach button take one row if there are more than 2 items";
NSArray *actions = @[ATPopupActionMake(@"Done", ATPopupActionStyleNormal, block),
                     ATPopupActionMake(@"Save", ATPopupActionStyleHighlighted, block),
                     ATPopupActionMake(@"Cancel", ATPopupActionStyleNormal, block)];
ATAlertView.build.withTitle(title).withDetail(detail).withActions(actions).showInWindow();
  • Confirm
ATAlertView.build.withTitle(title).withDetail(@"Confirm Dialog").showInWindow();
  • Confirm / Without Title
NSString *detail = @"您的班级信息数据已更新完成,请重新刷新列表查看最新数据.";
NSArray *actions = @[ATPopupActionMake(@"知道了", ATPopupActionStyleHighlighted, block)];
ATPopupCompletionBlock didHideBlock = ^ (__kindof ATPopupView * _Nonnull popupView, BOOL finished) {
    if (finished) {NSLog(@"didDisApper");}
};
ATAlertView.build.withDetail(detail).withActions(actions).withDidHide(didHideBlock).showInWindow();
  • Link
NSString *detail = @"尊敬的用户,为给您提供更好的服务,本应用会使用到一些您的个人信息。不过请放心,我们非常重视您的个人信息和隐私保护,您的信息将仅用于为您提供服务或改善服务体验。请您在使用本应用之前仔细阅读《用户隐私政策》,如同意此政策,请点击“同意”并开始使用我们的产品和服务。";
NSURL *url = [NSURL URLWithString:@"https://github.com/ablettchen/ATPopupView"];
NSArray *links = @[ATPopupLinkMake(@"《用户隐私政策》", url, ^(ATPopupLink * _Nonnull link) {
    NSLog(@"%@", link.url);
})];
NSArray *actions = @[ATPopupActionMake(@"退出", ATPopupActionStyleNormal, block),
                     ATPopupActionMake(@"同意", ATPopupActionStyleHighlighted, block)];
ATAlertView.build.withTitle(@"温馨提示").withDetail(detail).withActions(actions).withLinks(links).showInWindow();
  • Input
ATPopupInputCompletionBlock didEndInputBlock = ^ (NSString *_Nonnull text) {
    NSLog(@"didEndInput, text:%@", text);
};
ATAlertView.build.withTitle(title).withDetail(@"Input Dialog").
withInputPlaceholder(@"Your placeholder").withDidEndInput(didEndInputBlock).showInWindow();

二、ATSheetView

  • Default
NSArray *actions = @[ATPopupActionMake(@"Normal", ATPopupActionStyleNormal, block),
                     ATPopupActionMake(@"Highlighted", ATPopupActionStyleHighlighted, block),
                     ATPopupActionMake(@"Disabled", ATPopupActionStyleDisabled, block)];
ATSheetView *view = 
ATSheetView.build.withTitle(title).withActions(actions);
view.showInWindow();

三、ATPickerView

  • Default
NSArray *items = @[@"语法课", @"自然拼读", @"阅读练习"];
ATPickerView *view = 
ATPickerView.build.withTitle(title).withItems(items).showInWindow();
view.confirmBlock = ^(NSInteger index) {
    NSLog(@"selected:%@", items[index]);
};

四、ATToastView

  • Default
ATToastView.build.withDetail(@"This description is used to generate tags and improve search results.").showInWindow();
  • Title, detail
ATToastView.build.withTitle(@"连续学习达10分钟").withDetail(@"+15 贝乐币").showIn(self.view);

五、ATLoadView

  • Default
ATLoadView *view = ATLoadView.build.showIn(self.view);
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
    [view hide];
});

Requirements

Installation

ATPopupView is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'ATPopupView'

Author

ablett, [email protected]

License

ATPopupView is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "ATPopupView",
    "version": "0.1.1",
    "summary": "u5f39u51fau89c6u56feuff1aalertViewu3001actionSheetu3001messageViewu3001loadingViewu3001u5176u4ed6...",
    "description": "TODO: Add long description of the pod here.",
    "homepage": "https://github.com/ablettchen/ATPopupView",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "ablett": "[email protected]"
    },
    "source": {
        "git": "https://github.com/ablettchen/ATPopupView.git",
        "tag": "0.1.1"
    },
    "social_media_url": "https://twitter.com/ablettchen",
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "ATPopupView/**/*.{h,m}",
    "public_header_files": "ATPopupView/**/*.{h}",
    "requires_arc": true,
    "frameworks": [
        "UIKit",
        "Foundation"
    ],
    "dependencies": {
        "Masonry": [],
        "YYText": [],
        "ATCategories": []
    }
}

Pin It on Pinterest

Share This