Skip to content

Commit

Permalink
李鹏飞
Browse files Browse the repository at this point in the history
alertController 弹框的封装
  • Loading branch information
pengfei923 committed Jun 13, 2019
1 parent 0a9576d commit 53c18e0
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
4 changes: 4 additions & 0 deletions OHFinancialServices.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
B2B5A67B2293CDF900F6F235 /* SystomContactCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2B5A6792293CDF900F6F235 /* SystomContactCell.swift */; };
B2B5A67C2293CDF900F6F235 /* SystomContactCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = B2B5A67A2293CDF900F6F235 /* SystomContactCell.xib */; };
B2B843B7227ECA1E009EC329 /* BaseLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2B843B6227ECA1E009EC329 /* BaseLabel.swift */; };
B2BE10DC22B1DF94006A4AE2 /* PublicAlertController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2BE10DB22B1DF94006A4AE2 /* PublicAlertController.swift */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand Down Expand Up @@ -204,6 +205,7 @@
B2B5A6792293CDF900F6F235 /* SystomContactCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SystomContactCell.swift; sourceTree = "<group>"; };
B2B5A67A2293CDF900F6F235 /* SystomContactCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SystomContactCell.xib; sourceTree = "<group>"; };
B2B843B6227ECA1E009EC329 /* BaseLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseLabel.swift; sourceTree = "<group>"; };
B2BE10DB22B1DF94006A4AE2 /* PublicAlertController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublicAlertController.swift; sourceTree = "<group>"; };
D336CA1D3001864F070163EC /* Pods-OHFinancialServices.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-OHFinancialServices.debug.xcconfig"; path = "Target Support Files/Pods-OHFinancialServices/Pods-OHFinancialServices.debug.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -549,6 +551,7 @@
B203D7AA22758B780067359C /* Common.swift */,
B201635D2283D6D500DD50C5 /* DeviceAuthorizationHelper.swift */,
B201635F2283D7D600DD50C5 /* AuthorizationTool.swift */,
B2BE10DB22B1DF94006A4AE2 /* PublicAlertController.swift */,
);
path = Public;
sourceTree = "<group>";
Expand Down Expand Up @@ -1166,6 +1169,7 @@
B239937822827EED0006B5EE /* BaseTableViewCell.swift in Sources */,
B2782EAF228ABDD500D7BF2D /* BaseFuncViewController.swift in Sources */,
B2B18D0E228544E0005745D5 /* QRCodeViewController.swift in Sources */,
B2BE10DC22B1DF94006A4AE2 /* PublicAlertController.swift in Sources */,
B29BD03622B0A5A000F4835E /* OHRepayFirstViewController.swift in Sources */,
B282CD5D2276F36700E87249 /* BannerViewModel.swift in Sources */,
B201636222841CB800DD50C5 /* Float-Extension.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class ThirdViewController: BaseSwiftViewController {
return helper
}()

private lazy var dataArray : [String] = ["测试webView","测试登录界面细节","测试bar按钮","测试倒计时按钮","测试保存数据","测试删除数据","测试获取数据","测试二维码的生成","获取定位权限","基础方法的调用","获取产品列表"]
private lazy var dataArray : [String] = ["测试webView","测试登录界面细节","测试bar按钮","测试倒计时按钮","测试保存数据","测试删除数据","测试获取数据","测试二维码的生成","获取定位权限","基础方法的调用","内容提示信息"]

override func viewDidLoad() {
super.viewDidLoad()
Expand Down Expand Up @@ -134,6 +134,9 @@ extension ThirdViewController:UITableViewDelegate,UITableViewDataSource {
vc.hidesBottomBarWhenPushed = true
self.navigationController?.pushViewController(vc, animated: true)
}
if indexPath.row == 10 {

}
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//
// PublicAlertController.swift
// OHFinancialServices
//
// Created by hoomsun on 2019/6/13.
// Copyright © 2019 hoomsun. All rights reserved.
//

import UIKit

class PublicAlertController: NSObject {
/// 正常弹框展示信息(有确认和取消)
class func showAlertController(title:String?,message:String?,preferredStyle:UIAlertController.Style,sureAction:String?,cancleAction:String?,handler:((UIAlertAction)->Void)?,finishedBack:((UIAlertController)->())?) {
let alertController = UIAlertController(title: title, message: message, preferredStyle: preferredStyle)
let doAction = UIAlertAction(title: sureAction, style: .default, handler: handler)
let cancleAction = UIAlertAction(title: cancleAction, style: .cancel, handler: nil)
alertController.addAction(doAction)
alertController.addAction(cancleAction)
finishedBack!(alertController)
}
/// 只有一个确认按钮的框
class func showOneSureButtonAlertControlle(title:String?,message:String?,sureAction:String?,handler:((UIAlertAction)->Void)?,finishedBack:((UIAlertController)->())?) {
let alertController = UIAlertController(title: title, message: message, preferredStyle: .alert)
let doAction = UIAlertAction(title: sureAction, style: .default, handler: handler)
alertController.addAction(doAction)
finishedBack!(alertController)
}
}

0 comments on commit 53c18e0

Please sign in to comment.