用swift5 新写一个app需要用到需要考虑的

1.扩展left right top bottom

7.swift类似massory  masmake

4.如何重写  TextField()方法  :网上都有  就是init方法

6 get set 

   var clickEvent:clickViewEvent? {

        get {

  }        set {

}

8.类似pch的全局访问变量

14单例

9.swift发接口 ,封装

10 类方法

open class func

11如何打印

print 打印任何对象

 debugPrint  

Swift.Result<Swift.Optional<Foundation.Data>, Alamofire.AFError>.success(Optional(129 bytes))

12.data 转json  相互转   

swift json解析 JSONSerialization_路过火车的博客-CSDN博客_jsonserialization

                let data:Data = response.data!
                    do {
                        let ok =  try JSONSerialization.jsonObject(with: data, options: .mutableContainers) as AnyObject

                        let stautd :NSNumber = ok["status"] as! NSNumber

                        if stautd.stringValue != "200000" {
                            print(ok)
                        }
                        success(ok as AnyObject)
                    } catch {
                    }

13弹框

15 string判空  string为空 怎么判断

17 NSDictionary 空怎么写 

        var paramters: [String: Any]? = nil

16 如何present一个页面

在viewDidAppear   而不是viewWillAppear


 

18  label

        //立即開通,
        let label = UILabel()
        let attrString = NSMutableAttributedString(string: "立即開通,")
        label.text = "立即開通,"
        label.frame = CGRect(x: 14 * 2, y: 110 * 2, width: 159.5 * 2 , height: 23 * 2)
        label.numberOfLines = 0
        let attr: [NSAttributedString.Key : Any] = [.font: UIFont.systemFont(ofSize: 17 * 2),.foregroundColor: UIColor(red: 1, green: 1, blue: 1,alpha:1), ]
        attrString.addAttributes(attr, range: NSRange(location: 0, length: attrString.length))
        label.attributedText = attrString
        contentScrollow.addSubview(label)
        label.alpha = 1;
        

19 imageview 

        let backgimageView :UIImageView = UIImageView.init(image: UIImage.init(named: "bg_pic"))
        backgimageView.frame = self.view.frame
        backgimageView.isUserInteractionEnabled = true
        backgimageView.masmakeS { (make) in
//            make.left = 200
        }
        self.view.addSubview(backgimageView)
        

20轮播图  jxBanner

21加载网络image   Kingfisher

22接收网络数组

    var imageSource:Array<Any> = []

    self.imageSource = json["banners"] as! Array

取数组的值

    var imageSource:Array< [String:String] > = []

     let dict  =   self.imageSource[index]

        let ss:String = dict["url"] ?? ""

        

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Author:Wallace Wang ISBN-10:1484248643 Year:2019 Pages:648 Language:English File size:23.1 MB Learn how to integrate all the interface elements iOS users have come to know and love, such as buttons, switches, pickers, toolbars, and sliders. In this edition of the best selling book, you’ll also learn about touch gestures, table views, and collection views for displaying data on a user interface. Assuming little or no working knowledge of the Swift programming language, and written in a friendly, easy-to-follow style, this book offers a comprehensive course in iPhone and iPad programming. The book starts with a gentle introduction to using Xcode and then guides you though the creation of your first simple application. You’ll start with designing basic user interfaces and then explore more sophisticated ones that involve multiple screens such as navigation controllers, tab bars, tool bars, page views, and split views that are particularly useful on the larger screens of the iPad and certain iPhone models. And there’s much more! Beginning iPhone Development with Swift 5 covers the basic information you need to get up and running quickly to turn your great ideas into working iOS apps. Once you’re ready, move on to Pro iPhone Development with Swift 5 to learn more of the really unique aspects of iOS programming and the Swift language. What You Will Learn Discover what data persistence is, and why it’s important Build cool, crisp user interfaces Display data in Table Views Work with all the most commonly used iOS Frameworks Who This Book is For Aspiring iOS app developers new to the Apple Swift programming language and/or the iOS SDK.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值