CocoaPods trunk is moving to be read-only. Read more on the blog, there are 16 months to go.

DPWidgetSum 2.6.2

DPWidgetSum 2.6.2

Maintained by 涂鸦.



 
Depends on:
MBProgressHUD>= 0
ReactiveObjC~> 3.1.1
TTTAttributedLabel~> 2.0.0
SDWebImage= 3.8.2
WebViewJavascriptBridge~> 6.0.3
SBJson~> 5.0.0
AFNetworking>= 0
UMCommon>= 0
UMDevice>= 0
UMAPM>= 0
UMShare/UI>= 0
UMShare>= 0
UMShare/Social/WeChat>= 0
 

  • By
  • 涂鸦

Features

  • An UIButton custom class

Requirements

  • iOS 7.0 or later
  • tvOS 9.0 or later
  • watchOS 2.0 or later
  • OS X 10.8 or later
  • Xcode 8.0 or later

Getting Started

Who Uses It

Communication

  • If you need help, use Stack Overflow. (Tag 'DPWidgetSum')
  • If you'd like to ask a general question, use Stack Overflow.
  • If you found a bug, open an issue.
  • If you have a feature request, open an issue.
  • If you want to contribute, submit a pull request.

How To Use

Objective-C:

#import "ReactiveObjC.h"
#import "DPWidgetSum.h"
#import "DPDefaultView.h"
#import "DPMessageAlertView.h"
#import "DPTimeAlertPickerView.h"
...
- (void)viewDidLoad {
    [super viewDidLoad];

    UIButton *msgBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    msgBtn.frame = CGRectMake(0, DP_StatusbarHeight+DP_FrameHeight(10), self.view.dp_width, 40);
    msgBtn.backgroundColor = [UIColor orangeColor];
    [msgBtn setTitle:@"消息弹框-DPMessageAlert" forState:UIControlStateNormal];
    dp_arc_block(self);
    [[msgBtn rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(__kindof UIControl * _Nullable x) {
        [ZCWAlertView showDPMessageAlertViewForTitle:@"警告" content:@"网络请求失败!" buttonTitles:@[@"取消", @"重新请求"] buttonBlock:nil];
    }];
    [self.view addSubview:msgBtn];
    
    UIButton *defaultBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    defaultBtn.frame = CGRectMake(0, msgBtn.dp_yMax+DP_FrameHeight(10), self.view.dp_width, 40);
    defaultBtn.backgroundColor = [UIColor purpleColor];
    [defaultBtn setTitle:@"默认显示框-DPDefaultView" forState:UIControlStateNormal];
    [[defaultBtn rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(__kindof UIControl * _Nullable x) {
        [DPDefaultView showDefaulTSuperView:weak_self.view topImage:nil title:nil btnTitle:nil btnBlock:^(DPDefaultView *aObject, UIButton *aButton) {
            [aObject hiddenDefaulTSuperView];
        }];
    }];
    [self.view addSubview:defaultBtn];
    
    dateLab = [[UILabel alloc] init];
    dateLab.userInteractionEnabled = YES;
    dateLab.frame = CGRectMake(0, defaultBtn.dp_yMax+DP_FrameHeight(10), self.view.dp_width, DP_FrameHeight(40));
    dateLab.backgroundColor = [UIColor greenColor];
    dateLab.text = @"选择时间:";
    [self.view addSubview:dateLab];
    
    UITapGestureRecognizer *dateLabelTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dateLabelTapAction:)];
    [dateLab addGestureRecognizer:dateLabelTap];
}

- (void)dateLabelTapAction:(UITapGestureRecognizer *)tap {
    DPTimeAlertPickerView *datePickerView = [DPTimeAlertPickerView alertViewForParent:self.view uuid:0 alertViewStyle:DPTimeViewStyleOne level:1 AlertBlock:^(DPTimeAlertPickerView *aObject) {
        NSString *dateStr = [NSDate dp_getStrForDateOrStr:aObject.selectDate formatter:@"yyyy-MM-dd" isIntercept:NO];
        if (dateStr.length) {
            self->dateLab.text = [@"选择时间: " stringByAppendingString:dp_notEmptyStr(dateStr)];
        }
    }];
    NSDate *maxDate = [NSDate date];
    NSDate *minDate = [NSDate dp_getPriousorLaterDateFromDate:maxDate withMonth:-3];
    datePickerView.minDate = minDate;
    datePickerView.maxDate = maxDate;
    [datePickerView showTypeAlertViewForIsShow:YES];
}
...

Installation

There are three ways to use DPWidgetSum in your project:

  • using CocoaPods
  • using Carthage
  • by cloning the project into your repository

Installation with CocoaPods

CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries in your projects. See the Get Started section for more details.

Podfile

platform :ios, '7.0'
pod 'DPWidgetSum', '~> 1.0.5'

If you are using Swift, be sure to add use_frameworks! and set your target to iOS 8+:

platform :ios, '8.0'
use_frameworks!

Build Project

At this point your workspace should build without error. If you are having problem, post to the Issue and the community can help you solve it.

Collaborators

Licenses

All source code is licensed under the MIT License.

Pictures show