页面
苦中有甜的生活
IOS开发学习中一些简单易懂的知识,可以时长复习查看并且观阅
展开
-
滚动 (隐藏视图)
#import “ViewController.h”#import “YdViewController.h”#import “CmViewController.h”#import “RgViewController.h”#import “WgViewController.h”#import “YjsViewController.h”#import “JzViewController.h...原创 2018-12-08 09:33:02 · 236 阅读 · 0 评论 -
数据持久化传值
//在viewdidload里先创建一个空的键值对,set后面是内容,通过key来提取 UserDefaults.standard.set("", forKey: "asd") //在另一个页面中写 let defaultStand = UserDefaults.standard defaultStand.set(text.text!, forKey: "asd") ...原创 2018-12-08 09:35:49 · 124 阅读 · 0 评论 -
动画大标题
self.title = @"我是标题";self.navigationController.navigationBar.prefersLargeTitles = YES;(void)viewDidLoad {[super viewDidLoad];UILabel * textView = [[UILabel alloc]initWithFrame:CGRectMake(0, 100...原创 2018-12-08 09:37:42 · 275 阅读 · 0 评论 -
适配机型
#import "TXAdapter.h"UIView * view=[[UIView alloc]initWithFrame:CGRectMake(0, 0, tRealLength(50), tRealLength(50))]; NSLog(@"真实长度:%f",tRealLength(50)); view.backgroundColor=[UIColor redColor...原创 2018-12-08 09:39:38 · 270 阅读 · 0 评论 -
广告弹窗
导入HWPopTool.h .m 文件@property (strong, nonatomic) UIView *contentView;@property (strong, nonatomic) UIButton *popBtn;12_contentView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 200, 300)]; ...原创 2018-12-08 09:42:48 · 450 阅读 · 0 评论 -
第三方登录
https://blog.csdn.net/weixin_42925415/article/details/82770836原创 2018-12-08 09:46:55 · 139 阅读 · 0 评论 -
滚动控制器
/自己创建类#import “SlideSwitchExample1.h”#import “TouTiaoViewController.h”#import “ShipinViewController.h”#import “BeijingViewController.h”#import “CepingViewController.h”#import “DaogouViewControll...原创 2018-12-08 09:48:40 · 200 阅读 · 0 评论 -
微信登录
微信授权登录-(void)Clbtn{[[UMSocialManager defaultManager] getUserInfoWithPlatform:UMSocialPlatformType_WechatSession currentViewController:nil completion:^(id result, NSError *error) {if (error) { ...原创 2018-12-09 19:00:17 · 256 阅读 · 0 评论 -
地图集成
target ‘百度地图’ dopod ‘AMap3DMap’pod ‘AMapSearch’pod ‘AMapLocation’endappledelegate#import <AMapFoundationKit/AMapFoundationKit.h> [AMapServices sharedServices].apiKey = @"71d809cb6995...原创 2018-12-09 19:02:33 · 181 阅读 · 0 评论 -
NSbundle
NSBundle的理解和mainBundle的基本介绍一、NSBundle NSBundle是cocoa为bundle提供的一个类,bundle是一个目录,其中包含了程序会使用到的资源. 这些资源包含了如图像、声音、编译好的代码、nib文件。(用户也会把bundle称为plug-in) bundle中的有些资源可以本地化。例如:对于zw.nib,我们可以有两个版本:一个针对英语用户...原创 2018-12-09 19:05:33 · 242 阅读 · 0 评论 -
AVAudioplayer系统播放
(void)viewDidLoad {[super viewDidLoad];//找到包路径NSString * path = [[NSBundle mainBundle] pathForResource:@“song1” ofType:@“mp3”];//转为urlNSURL * url = [NSURL URLWithString:path];//把url 添加到播放器里面来...原创 2018-12-16 19:00:53 · 406 阅读 · 0 评论 -
标签控制器
NSArray *arr = @[@"首页",@"服务",@"卡卷",@"个人"];NSArray *VCarr = @[@"SyViewController",@"FwViewController",@"KjViewController",@"MeViewController"];NSArray *arr1=@[@"clock_sel原创 2018-12-08 09:31:15 · 209 阅读 · 0 评论 -
使用多个cell的表格注册多个
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell; switch (indexPath.section) { case 0:{ Tw...原创 2018-12-08 09:26:02 · 332 阅读 · 0 评论 -
集成cocoapods
appdelegate#import <AMapFoundationKit/AMapFoundationKit.h>[AMapServices sharedServices].apiKey = @“71d809cb6995c3a674eb94231027c69b”;[[AMapServices sharedServices] setEnableHTTPS:YES];// Ove...原创 2018-12-07 19:51:25 · 255 阅读 · 0 评论 -
分段控制器+滚动视图
1.设置根目录 2.创建5个控制器页面 // ViewController.m // 分段控制器,➕滚动试图import “ViewController.h”import “OneViewController.h”import “TwoViewController.h”import “ThreeViewController.h”import “Four...原创 2018-08-21 14:36:42 · 230 阅读 · 0 评论 -
结合网格
tabbar控制器加子视图控制器自定义cell以及自定义view还有网格的结合#import "ONEViewController.h"#import "CKSlideMenu.h"#import "jinriViewController.h"#import "yuleViewController.h"#import "fuckViewController.h"@interfac...原创 2018-10-14 20:23:42 · 168 阅读 · 0 评论 -
自动轮播
首先在viewcontroller中设置tabbar,然后准备在某一个主界面书写界面#import "twoViewController.h"#import "firstViewController.h"#import "secondViewController.h"#define HCWidth self.view.frame.size.width#define HCHeigh sel...原创 2018-10-25 18:12:01 · 117 阅读 · 0 评论 -
界面 滚动视图 网格 表格 瀑布流
导入文件HWPopTool.h弹窗视图self.selectedIndex = 1; -------进入界面默认tabbar#import "FuWuViewController.h"#import "HWPopTool.h"#import "CellTableViewCell.h"@interface FuWuViewController ()&lt;UITab原创 2018-10-21 18:22:28 · 383 阅读 · 0 评论 -
swift成型快速了解
//新建工程命名:zhoukaojineng,创建一个类Person,在类中定义方法eat,实现打印“吃饭”//创建一个继承自Person的Teacher类,在Teacher类中定义方法teach,实现打印“上课”,调用其父类的eat函数//创建一个类Student并继承与Person,定义属性name,在Student中监听属性name的setter和getter//在Student类中重...原创 2018-11-11 19:47:13 · 182 阅读 · 0 评论 -
滚动按钮控制器
#import "ViewController.h"#import "OneViewController.h"#import "TwoViewController.h"#import "ThreeViewController.h"#import "FourViewController.h"#import "FiveViewController.h"#import "原创 2018-11-30 14:35:22 · 126 阅读 · 0 评论 -
网格
appdelegate- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { ViewController *vc = [[ViewController alloc]init]; vc.title = @...原创 2018-12-02 19:07:05 · 156 阅读 · 0 评论 -
无限轮播
#import "ViewController.h"#define HCWidth self.view.frame.size.width#define HCHeigth self.view.frame.size.height@interface ViewController ()&lt;UIScrollViewDelegate&gt;{ UIScrollView *sc; //滚动...原创 2018-11-28 09:11:19 · 92 阅读 · 0 评论 -
约束 适配
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{ if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { [self addSub...原创 2018-12-01 09:34:52 · 168 阅读 · 0 评论