iOS Swift 模块练习/swift基础学习
2017-06-01 12:04
627 查看
SWIFT项目练习1 SWIFT项目练习2
0.swift中的宏定义(使用方法代替宏)
一、视图 +控件
1、UIImageView + UIImage
2、 UIView+UILabel
UIbutton
3、Swift UITableView
4、Swift3.0 UITextField
5/Swift tableview自带的刷新控件
二、代码设计:继承扩展封装
1、swift实现单例的四种方式
2、实例方法和类型方法
三、三方使用
1、Cocoapods 使用 与OC大致一样,只有在podfile 开始的注释中有一点更改
iOS Swift基础知识代码
推荐:Swift学习使用知识代码软件0.swift中的宏定义(使用方法代替宏)
一、视图 +控件
1、UIImageView + UIImage
2、 UIView+UILabel
UIbutton
//button let butt = UIButton(frame: CGRect(x: 150, y: 300, width: 100, height: 30)) butt.setTitle("tiaozhuan", for: .normal) butt.layer.cornerRadius = 5 butt.addTarget(self, action:#selector(buttonaction(sender:)), for: .touchUpInside) self.view.addSubview(butt) } //button 事件 func buttonaction(sender:UIButton) { self.present(buttonViewController(), animated: true, completion: nil) }
3、Swift UITableView
4、Swift3.0 UITextField
5/Swift tableview自带的刷新控件
二、代码设计:继承扩展封装
1、swift实现单例的四种方式
2、实例方法和类型方法
三、三方使用
1、Cocoapods 使用 与OC大致一样,只有在podfile 开始的注释中有一点更改
Swift使用时: 注意:你不能使用TextEdit来编辑Podfile,因为它有可能用图形化的更有吸引力的typeset quotes代替standard quotes,这可能导致CocoaPods不能理解并抛出错误,所以最好用Xcode或者别的编程文本编辑器来编辑你的Podfile。 默认的podFile看起来是这样的: # Uncomment this line to define a global platform for your project# platform :ios, '6.0' target 'IceCreamShop' do end target 'IceCreamShopTests' do end 将注释的内容替换成下面的两行: 1 platform :ios, "8.0"use_frameworks! 这就告诉了CocoaPods--你的项目使用的是iOS 8.0,并且将使用框架来代替静态库。 想要在Swift中使用CocoaPods,你必须明确的写出use_frameworks! 来选择使用框架。如果你忘了写这个,CocoaPods能检测到你使用使用Swift CocoaPods,你安装pods的时候就会报错。
相关文章推荐
- ios swift学习日记2-基础部分
- iOS开发-swift基础学习三
- Ios Swift学习之一基础知识
- ios开发学习----swift学习之(一)基础数据类型
- iOS学习笔记41-Swift(一)基础部分
- IOS之Foundation之探究学习Swift实用基础整理<一>
- fileinput模块 分类: python基础学习 python 小练习 python Module 2013-08-15 17:18 417人阅读 评论(0) 收藏
- iOS开发-swift基础学习二
- iOS学习笔记41-Swift(一)基础部分
- iOS swift零基础学习心得
- iOS学习笔记41-Swift(一)基础部分
- IOS之Foundation之探究学习Swift实用基础整理<一>
- IOS之Foundation之探究学习Swift实用基础整理<一>
- S008 - iOS 应用基础 swift版 - 系统学习 iOS 界面编程
- python数据持久存储:pickle模块的基本使用 分类: python python基础学习 python 小练习 2013-06-17 14:41 209人阅读 评论(0) 收藏
- IOS开发-Swift-基础知识学习笔记
- iOS学习基础学习之动态添加Button和监听UIAlertView按钮
- IOS6.0 学习第1篇,基础的IOs框架
- 0基础学习iOS的一些感想
- ios学习一:objective-c面向对象的一些术语(来源objective-c基础编程)