- 博客(13)
- 收藏
- 关注
原创 iOS抽屉视图(RESideMenu第三方实现)
/* -----------用于适配的宏 *///屏幕宽度的宏#define SCREEN_W [UIScreen mainScreen].bounds.size.width//屏幕宽度的高#define SCREEN_H [UIScreen mainScreen].bounds.size.height//适配x轴的宏#define FIT_X(w) (SCREEN_W / 37
2017-11-05 19:38:47
549
原创 iOS 委托代理传值与Block回传值.
#import "ViewController.h"#import "secondViewController.h"@interface ViewController ()<secondViewControllerDelegate>@property(nonatomic,strong)secondViewController *secVC ;@end@implementation ViewC
2017-10-24 20:16:20
488
原创 入门代码,Swift表格,标签控制器
import UIKitimport CoreData@UIApplicationMainclass AppDelegate: UIResponder, UIApplicationDelegate { //窗口对象 var window: UIWindow? //标签栏控制器 var tabCtl:UITabBarController = UITabBarControl
2017-10-24 19:51:24
557
原创 Swift中如何使用 ++, --运算符
(1)Swift的Int类型不在支持自增减运算符,比如 ++a —a,a—,a++的方式(2)如果想要Swift想要支持这种方法,必须重载运算符extension Int { //前+ static prefix func ++(num:inout Int) -> Int { num += 1 return num } //后缀+
2017-10-24 15:15:19
3997
原创 Swift中字符串,字典,数组,集合的遍历
//字符串的遍历(3中写法)(1)var str = "China"for item in str.characters { print(item)(2)for item in str.characters.indices { print(str[item])}(3)var i = 0while i < str.characters.count { let i
2017-10-23 15:24:11
966
原创 Swift小练习(包括答案)
1、编写一个程序,要求可以把一个字符串中的每一个字符,如果是大写字母变小写字母,如果是小写字母变大写,如果是其他字符不变! 例如:字符串China23beiJing经过程序转换为cHINA23BEIjING2、编写一个程序,要求接收一个数字,程序会将这个数字以二进制方式打印,例如:数字10,以1010的方式打印出来3、编写一个程序,判断101-200之间有多少个素数,并输出所有素数.4、编写一个程
2017-10-23 08:22:03
1967
翻译 iOS获取键盘高度
1)注册监听,监听键盘的弹出[[NSNotificationCenterdefaultCenter] addObserver:self selector:@selector(handleKeyBoardNotification:) name:UIKeyboardWillShowNotification object:nil];(2)在监听的触发方法当中,使用如下代码获取键盘高度
2017-10-16 11:00:51
429
翻译 OC中获取沙盒中的Documents目录路径常用的代码方式
(1)NSString *documentPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES)lastObject]; (2)NSString *documentPath2 = [NSHomeDirectory()stringByAppendingPathC
2017-10-16 10:55:29
5717
转载 OC中导航条与UIScrollView冲突解决方法
(1)在添加UIScrollView的ViewController中添加代码self.edgesForExtendedLayout =UIRectEdgeNone;(2)在添加UIScrollView的ViewController中添加代码self.automaticallyAdjustsScrollViewInsets = YES;(3)如果以上两种方法都不可
2017-10-16 10:52:45
327
原创 ios PCH文件的使用以及作用
作用: (1)pch是整个工程的条件预编译的头文件 (2)在该文件中定义的符号可以在工程的每个文件中直接使用而不用再声明使用: (3)添加方式 - NewFile - OtherFiles - PCH File 在工程设置的BuildSettings选项中,找到Apple LLVM Languag
2017-10-13 19:06:13
373
原创 iOSBlock函数声明定义以及调用等
Block函数/* ---------- Block函数声明 --------- */void (^printConutry_Block)(void);double (^getPI_Block)();void (^printArgumentsSum_Block)(int,int,int);int (^getSum_Block)(int a
2017-10-13 19:04:07
2252
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人