Commit d4abf9b9e489c9838335fb7bab6ebe77800cb16d

Authored by yanglingyu
1 parent c60401c9

no message

CNLiveVideoClassifyKit.podspec
@@ -32,9 +32,10 @@ TODO: Add long description of the pod here. @@ -32,9 +32,10 @@ TODO: Add long description of the pod here.
32 32
33 s.source_files = 'CNLiveVideoClassifyKit/Classes/**/*' 33 s.source_files = 'CNLiveVideoClassifyKit/Classes/**/*'
34 34
35 - # s.resource_bundles = {  
36 - # 'CNLiveVideoClassifyKit' => ['CNLiveVideoClassifyKit/Assets/*.png']  
37 - # } 35 +
  36 + s.resource_bundles = {
  37 + 'CNLiveVideoClassifyKit' => ['CNLiveVideoClassifyKit/Assets/Assets.xcassets']
  38 + }
38 39
39 # s.public_header_files = 'Pod/Classes/**/*.h' 40 # s.public_header_files = 'Pod/Classes/**/*.h'
40 # s.frameworks = 'UIKit', 'MapKit' 41 # s.frameworks = 'UIKit', 'MapKit'
CNLiveVideoClassifyKit/Assets/Assets.xcassets/Contents.json 0 → 100644
  1 +{
  2 + "info" : {
  3 + "author" : "xcode",
  4 + "version" : 1
  5 + }
  6 +}
CNLiveVideoClassifyKit/Assets/Assets.xcassets/selectImage.imageset/Contents.json 0 → 100644
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "filename" : "crab_selected.png",
  9 + "idiom" : "universal",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "filename" : "crab_selected-1.png",
  14 + "idiom" : "universal",
  15 + "scale" : "3x"
  16 + }
  17 + ],
  18 + "info" : {
  19 + "author" : "xcode",
  20 + "version" : 1
  21 + }
  22 +}
CNLiveVideoClassifyKit/Assets/Assets.xcassets/selectImage.imageset/crab_selected-1.png 0 → 100644

2.14 KB

CNLiveVideoClassifyKit/Assets/Assets.xcassets/selectImage.imageset/crab_selected.png 0 → 100644

2.14 KB

CNLiveVideoClassifyKit/Classes/Controller/CNCategoryBaseViewController.h 0 → 100644
  1 +//
  2 +// CNCategoryBaseViewController.h
  3 +// CNLiveVideoClassifyKit
  4 +//
  5 +// Created by CNLive on 2021/8/12.
  6 +//分类试图控制器基类
  7 +
  8 +#import <CNLiveBaseClass/CNLiveBaseViewController.h>
  9 +
  10 +NS_ASSUME_NONNULL_BEGIN
  11 +
  12 +@interface CNCategoryBaseViewController : CNLiveBaseViewController<JXCategoryListContainerViewDelegate,JXCategoryViewDelegate>
  13 +@property (nonatomic, strong) NSArray *titles;
  14 +@property (nonatomic, strong) JXCategoryBaseView *categoryView;
  15 +@property (nonatomic, strong) JXCategoryListContainerView *listContainerView;
  16 +@property (nonatomic, assign) BOOL isNeedIndicatorPositionChangeItem;
  17 +
  18 +-(JXCategoryBaseView *)preferredCategoryView;
  19 +-(CGFloat)preferredCategoryViewHeight;
  20 +@end
  21 +
  22 +NS_ASSUME_NONNULL_END
CNLiveVideoClassifyKit/Classes/Controller/CNCategoryBaseViewController.m 0 → 100644
  1 +//
  2 +// CNCategoryBaseViewController.m
  3 +// CNLiveVideoClassifyKit
  4 +//
  5 +// Created by CNLive on 2021/8/12.
  6 +// 分类控制器根类
  7 +
  8 +#import "CNCategoryBaseViewController.h"
  9 +#import "ListViewController.h"
  10 +
  11 +
  12 +@interface CNCategoryBaseViewController ()
  13 +
  14 +@end
  15 +
  16 +@implementation CNCategoryBaseViewController
  17 +
  18 +- (void)viewDidLoad {
  19 + [super viewDidLoad];
  20 + [self.view addSubview: self.categoryView];
  21 + [self.view addSubview:self.listContainerView];
  22 + self.view.backgroundColor = [UIColor whiteColor];
  23 +
  24 + // Do any additional setup after loading the view.
  25 +}
  26 +
  27 +-(void)viewDidLayoutSubviews
  28 +{
  29 + [super viewDidLayoutSubviews];
  30 +
  31 + self.categoryView.frame = CGRectMake(0, kStatusHeight, self.view.bounds.size.width, [self preferredCategoryViewHeight]);
  32 + self.listContainerView.frame = CGRectMake(0, [self preferredCategoryViewHeight] +kStatusHeight, self.view.bounds.size.width, self.view.bounds.size.height - [self preferredCategoryViewHeight]-kStatusHeight);
  33 +}
  34 +-(void)viewWillAppear:(BOOL)animated
  35 +{
  36 + [super viewWillAppear:animated];
  37 + self.navigationController.interactivePopGestureRecognizer.enabled = YES;
  38 +}
  39 +
  40 +#pragma mark - Public
  41 +-(JXCategoryBaseView *)preferredCategoryView{
  42 + return [[JXCategoryBaseView alloc] init];
  43 +}
  44 +
  45 +-(CGFloat)preferredCategoryViewHeight
  46 +{
  47 + return 50;
  48 +}
  49 +#pragma mark - JXCategoryViewDelegate
  50 +-(void)categoryView:(JXCategoryBaseView *)categoryView didSelectedItemAtIndex:(NSInteger)index
  51 +{
  52 + self.navigationController.interactivePopGestureRecognizer.enabled = (index ==0);
  53 +}
  54 +
  55 +#pragma mark - JXCategoryListContainerViewDelegate
  56 +- (NSInteger)numberOfListsInlistContainerView:(JXCategoryListContainerView *)listContainerView
  57 +{
  58 + return self.titles.count;
  59 +}
  60 +
  61 +-(id<JXCategoryListContentViewDelegate>)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index
  62 +{
  63 + ListViewController *list = [ListViewController new];
  64 + return list;
  65 +}
  66 +
  67 +#pragma mark - Getting
  68 +-(JXCategoryBaseView *)categoryView
  69 +{
  70 + if (!_categoryView) {
  71 + _categoryView = [self preferredCategoryView];
  72 + _categoryView.delegate = self;
  73 + _categoryView.listContainer = self.listContainerView;
  74 + }
  75 + return _categoryView;
  76 +}
  77 +
  78 +- (JXCategoryListContainerView *)listContainerView
  79 +{
  80 + if (!_listContainerView) {
  81 + _listContainerView = [[JXCategoryListContainerView alloc] initWithType:JXCategoryListContainerType_CollectionView delegate:self];
  82 + }
  83 + return _listContainerView;
  84 +}
  85 +@end
CNLiveVideoClassifyKit/Classes/Controller/CNLiveClassifySegmentController.h
@@ -5,11 +5,11 @@ @@ -5,11 +5,11 @@
5 // Created by CNLive on 2021/8/7. 5 // Created by CNLive on 2021/8/7.
6 // 6 //
7 7
8 -#import <CNLiveBaseClass/CNLiveBaseViewController.h> 8 +#import "CNCategoryBaseViewController.h"
9 9
10 NS_ASSUME_NONNULL_BEGIN 10 NS_ASSUME_NONNULL_BEGIN
11 11
12 -@interface CNLiveClassifySegmentController : CNLiveBaseViewController 12 +@interface CNLiveClassifySegmentController : CNCategoryBaseViewController
13 13
14 @end 14 @end
15 15
CNLiveVideoClassifyKit/Classes/Controller/CNLiveClassifySegmentController.m
@@ -6,17 +6,65 @@ @@ -6,17 +6,65 @@
6 // 6 //
7 7
8 #import "CNLiveClassifySegmentController.h" 8 #import "CNLiveClassifySegmentController.h"
  9 +#import <JXCategoryView/JXCategoryTitleImageView.h>
9 10
10 @interface CNLiveClassifySegmentController () 11 @interface CNLiveClassifySegmentController ()
11 - 12 +@property (nonatomic, strong)JXCategoryTitleImageView *myCategoryView;
12 @end 13 @end
13 14
14 @implementation CNLiveClassifySegmentController 15 @implementation CNLiveClassifySegmentController
15 16
16 - (void)viewDidLoad { 17 - (void)viewDidLoad {
17 [super viewDidLoad]; 18 [super viewDidLoad];
  19 + self.titles = @[@"推荐",@"视讯中国",@"听见中国",@"健康中国",@"发现中国"];
  20 + NSArray *selectImageNames = @[@"selectImage",@"selectImage",@"selectImage",@"selectImage",@"selectImage"];
  21 + self.myCategoryView.titles = self.titles;
  22 + self.myCategoryView.selectedImageNames = selectImageNames;
  23 + self.myCategoryView.imageZoomEnabled = YES;
  24 + self.myCategoryView.imageZoomScale = 1.3;
  25 + self.myCategoryView.averageCellSpacingEnabled = NO;
  26 + [self configCategoryViewWithType:JXCategoryTitleImageType_OnlyImage selectIndex:0];
18 // Do any additional setup after loading the view. 27 // Do any additional setup after loading the view.
19 } 28 }
  29 +#pragma mark - Method
  30 +
  31 +- (void)configCategoryViewWithType:(JXCategoryTitleImageType)imageType selectIndex:(NSInteger)index
  32 +{
  33 +
  34 + NSMutableArray *types = [NSMutableArray array];
  35 + for (int i = 0; i < self.titles.count; i ++) {
  36 + if (i == index) {
  37 + [types addObject:@(imageType)];
  38 + }else{
  39 + [types addObject:@(JXCategoryTitleImageType_OnlyTitle)];
  40 + }
  41 + }
  42 + self.myCategoryView.imageTypes = types;
  43 + [self.categoryView reloadData];
  44 +}
  45 +#pragma mark - JXCategoryViewDelegate
  46 +
  47 +- (void)categoryView:(JXCategoryBaseView *)categoryView didSelectedItemAtIndex:(NSInteger)index {
  48 + NSLog(@"%@", NSStringFromSelector(_cmd));
  49 +
  50 + // 侧滑手势处理
  51 + self.navigationController.interactivePopGestureRecognizer.enabled = (index == 0);
  52 + [self configCategoryViewWithType:JXCategoryTitleImageType_OnlyImage selectIndex:index];
  53 +}
  54 +
  55 +
  56 +#pragma mark - Public
  57 +-(JXCategoryBaseView *)preferredCategoryView
  58 +{
  59 + return [[JXCategoryTitleImageView alloc] init];
  60 +}
  61 +
  62 +#pragma mark - Getting
  63 +-(JXCategoryTitleImageView *)myCategoryView
  64 +{
  65 + return (JXCategoryTitleImageView *)self.categoryView;
  66 +}
  67 +
20 68
21 /* 69 /*
22 #pragma mark - Navigation 70 #pragma mark - Navigation
CNLiveVideoClassifyKit/Classes/Controller/CnLiveSubClassifySegmentController.h renamed to CNLiveVideoClassifyKit/Classes/Controller/ListViewController.h
1 // 1 //
2 -// CnLiveSubClassifySegmentController.h  
3 -// CNLiveBaseClass 2 +// ListViewController.h
  3 +// CNLiveVideoClassifyKit
4 // 4 //
5 -// Created by CNLive on 2021/8/7. 5 +// Created by CNLive on 2021/8/12.
6 // 6 //
7 7
8 -#import <CNLiveBaseClass/CNLiveBaseViewController.h> 8 +#import <UIKit/UIKit.h>
  9 +#import <JXCategoryView/JXCategoryView.h>
9 10
10 NS_ASSUME_NONNULL_BEGIN 11 NS_ASSUME_NONNULL_BEGIN
11 12
12 -@interface CnLiveSubClassifySegmentController : CNLiveBaseViewController 13 +@interface ListViewController : UIViewController<JXCategoryListContentViewDelegate>
13 14
14 @end 15 @end
15 16
CNLiveVideoClassifyKit/Classes/Controller/CnLiveSubClassifySegmentController.m renamed to CNLiveVideoClassifyKit/Classes/Controller/ListViewController.m
1 // 1 //
2 -// CnLiveSubClassifySegmentController.m  
3 -// CNLiveBaseClass 2 +// ListViewController.m
  3 +// CNLiveVideoClassifyKit
4 // 4 //
5 -// Created by CNLive on 2021/8/7. 5 +// Created by CNLive on 2021/8/12.
6 // 6 //
7 7
8 -#import "CnLiveSubClassifySegmentController.h" 8 +#import "ListViewController.h"
9 9
10 -@interface CnLiveSubClassifySegmentController () 10 +@interface ListViewController ()
11 11
12 @end 12 @end
13 13
14 -@implementation CnLiveSubClassifySegmentController 14 +@implementation ListViewController
15 15
16 - (void)viewDidLoad { 16 - (void)viewDidLoad {
17 [super viewDidLoad]; 17 [super viewDidLoad];
18 // Do any additional setup after loading the view. 18 // Do any additional setup after loading the view.
19 } 19 }
  20 +#pragma mark - JXCategoryListContentViewDelegate
20 21
  22 +/**
  23 + 实现 <JXCategoryListContentViewDelegate> 协议方法,返回该视图控制器所拥有的「视图」
  24 + */
  25 +- (UIView *)listView {
  26 + return self.view;
  27 +}
21 /* 28 /*
22 #pragma mark - Navigation 29 #pragma mark - Navigation
23 30
CNLiveVideoClassifyKit/Classes/Header/CNLiveViewClassifyKitPCH.h 0 → 100644
  1 +//
  2 +// CNLiveViewClassifyKitPCH.h
  3 +// Pods
  4 +//
  5 +// Created by CNLive on 2021/8/12.
  6 +//
  7 +
  8 +#ifndef CNLiveViewClassifyKitPCH_h
  9 +#define CNLiveViewClassifyKitPCH_h
  10 +
  11 +
  12 +#import <QMUIKit/QMUIKit.h>
  13 +#import <CNLiveBaseKit/CNLiveBaseKit.h>
  14 +#import <JXCategoryView/JXCategoryView.h>
  15 +
  16 +
  17 +#endif /* CNLiveViewClassifyKitPCH_h */
Example/CNLiveVideoClassifyKit.xcodeproj/project.pbxproj
@@ -466,6 +466,8 @@ @@ -466,6 +466,8 @@
466 GCC_C_LANGUAGE_STANDARD = gnu99; 466 GCC_C_LANGUAGE_STANDARD = gnu99;
467 GCC_DYNAMIC_NO_PIC = NO; 467 GCC_DYNAMIC_NO_PIC = NO;
468 GCC_OPTIMIZATION_LEVEL = 0; 468 GCC_OPTIMIZATION_LEVEL = 0;
  469 + GCC_PRECOMPILE_PREFIX_HEADER = NO;
  470 + GCC_PREFIX_HEADER = "";
469 GCC_PREPROCESSOR_DEFINITIONS = ( 471 GCC_PREPROCESSOR_DEFINITIONS = (
470 "DEBUG=1", 472 "DEBUG=1",
471 "$(inherited)", 473 "$(inherited)",
@@ -504,6 +506,8 @@ @@ -504,6 +506,8 @@
504 COPY_PHASE_STRIP = YES; 506 COPY_PHASE_STRIP = YES;
505 ENABLE_NS_ASSERTIONS = NO; 507 ENABLE_NS_ASSERTIONS = NO;
506 GCC_C_LANGUAGE_STANDARD = gnu99; 508 GCC_C_LANGUAGE_STANDARD = gnu99;
  509 + GCC_PRECOMPILE_PREFIX_HEADER = NO;
  510 + GCC_PREFIX_HEADER = "";
507 GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 511 GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
508 GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 512 GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
509 GCC_WARN_UNDECLARED_SELECTOR = YES; 513 GCC_WARN_UNDECLARED_SELECTOR = YES;
@@ -524,7 +528,7 @@ @@ -524,7 +528,7 @@
524 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 528 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
525 DEVELOPMENT_TEAM = 94X49GG3ZW; 529 DEVELOPMENT_TEAM = 94X49GG3ZW;
526 GCC_PRECOMPILE_PREFIX_HEADER = YES; 530 GCC_PRECOMPILE_PREFIX_HEADER = YES;
527 - GCC_PREFIX_HEADER = "CNLiveVideoClassifyKit/CNLiveVideoClassifyKit-Prefix.pch"; 531 + GCC_PREFIX_HEADER = "CNLiveVideoClassifyKit/CNLiveVideoClassifyKit-prefix.pch";
528 INFOPLIST_FILE = "CNLiveVideoClassifyKit/CNLiveVideoClassifyKit-Info.plist"; 532 INFOPLIST_FILE = "CNLiveVideoClassifyKit/CNLiveVideoClassifyKit-Info.plist";
529 MARKETING_VERSION = 1.0; 533 MARKETING_VERSION = 1.0;
530 MODULE_NAME = ExampleApp; 534 MODULE_NAME = ExampleApp;
@@ -542,7 +546,7 @@ @@ -542,7 +546,7 @@
542 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 546 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
543 DEVELOPMENT_TEAM = 94X49GG3ZW; 547 DEVELOPMENT_TEAM = 94X49GG3ZW;
544 GCC_PRECOMPILE_PREFIX_HEADER = YES; 548 GCC_PRECOMPILE_PREFIX_HEADER = YES;
545 - GCC_PREFIX_HEADER = "CNLiveVideoClassifyKit/CNLiveVideoClassifyKit-Prefix.pch"; 549 + GCC_PREFIX_HEADER = "CNLiveVideoClassifyKit/CNLiveVideoClassifyKit-prefix.pch";
546 INFOPLIST_FILE = "CNLiveVideoClassifyKit/CNLiveVideoClassifyKit-Info.plist"; 550 INFOPLIST_FILE = "CNLiveVideoClassifyKit/CNLiveVideoClassifyKit-Info.plist";
547 MARKETING_VERSION = 1.0; 551 MARKETING_VERSION = 1.0;
548 MODULE_NAME = ExampleApp; 552 MODULE_NAME = ExampleApp;
Example/CNLiveVideoClassifyKit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
  3 +<plist version="1.0">
  4 +<dict>
  5 + <key>IDEDidComputeMac32BitWarning</key>
  6 + <true/>
  7 +</dict>
  8 +</plist>
Example/CNLiveVideoClassifyKit.xcodeproj/xcshareddata/xcschemes/CNLiveVideoClassifyKit-Example.xcscheme
@@ -27,6 +27,15 @@ @@ -27,6 +27,15 @@
27 selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" 27 selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28 selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" 28 selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29 shouldUseLaunchSchemeArgsEnv = "YES"> 29 shouldUseLaunchSchemeArgsEnv = "YES">
  30 + <MacroExpansion>
  31 + <BuildableReference
  32 + BuildableIdentifier = "primary"
  33 + BlueprintIdentifier = "6003F589195388D20070C39A"
  34 + BuildableName = "CNLiveVideoClassifyKit_Example.app"
  35 + BlueprintName = "CNLiveVideoClassifyKit_Example"
  36 + ReferencedContainer = "container:CNLiveVideoClassifyKit.xcodeproj">
  37 + </BuildableReference>
  38 + </MacroExpansion>
30 <Testables> 39 <Testables>
31 <TestableReference 40 <TestableReference
32 skipped = "NO"> 41 skipped = "NO">
@@ -39,17 +48,6 @@ @@ -39,17 +48,6 @@
39 </BuildableReference> 48 </BuildableReference>
40 </TestableReference> 49 </TestableReference>
41 </Testables> 50 </Testables>
42 - <MacroExpansion>  
43 - <BuildableReference  
44 - BuildableIdentifier = "primary"  
45 - BlueprintIdentifier = "6003F589195388D20070C39A"  
46 - BuildableName = "CNLiveVideoClassifyKit_Example.app"  
47 - BlueprintName = "CNLiveVideoClassifyKit_Example"  
48 - ReferencedContainer = "container:CNLiveVideoClassifyKit.xcodeproj">  
49 - </BuildableReference>  
50 - </MacroExpansion>  
51 - <AdditionalOptions>  
52 - </AdditionalOptions>  
53 </TestAction> 51 </TestAction>
54 <LaunchAction 52 <LaunchAction
55 buildConfiguration = "Debug" 53 buildConfiguration = "Debug"
@@ -71,8 +69,6 @@ @@ -71,8 +69,6 @@
71 ReferencedContainer = "container:CNLiveVideoClassifyKit.xcodeproj"> 69 ReferencedContainer = "container:CNLiveVideoClassifyKit.xcodeproj">
72 </BuildableReference> 70 </BuildableReference>
73 </BuildableProductRunnable> 71 </BuildableProductRunnable>
74 - <AdditionalOptions>  
75 - </AdditionalOptions>  
76 </LaunchAction> 72 </LaunchAction>
77 <ProfileAction 73 <ProfileAction
78 buildConfiguration = "Release" 74 buildConfiguration = "Release"
Example/CNLiveVideoClassifyKit/Base.lproj/LaunchScreen.storyboard
1 <?xml version="1.0" encoding="UTF-8"?> 1 <?xml version="1.0" encoding="UTF-8"?>
2 -<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">  
3 - <device id="retina4_7" orientation="portrait">  
4 - <adaptation id="fullscreen"/>  
5 - </device> 2 +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="18122" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
  3 + <device id="retina4_7" orientation="portrait" appearance="light"/>
6 <dependencies> 4 <dependencies>
7 <deployment identifier="iOS"/> 5 <deployment identifier="iOS"/>
8 - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/> 6 + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="18093"/>
9 <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> 7 <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
10 </dependencies> 8 </dependencies>
11 <scenes> 9 <scenes>
Example/CNLiveVideoClassifyKit/Base.lproj/Main.storyboard
1 <?xml version="1.0" encoding="UTF-8"?> 1 <?xml version="1.0" encoding="UTF-8"?>
2 -<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="whP-gf-Uak">  
3 - <device id="retina4_7" orientation="portrait">  
4 - <adaptation id="fullscreen"/>  
5 - </device> 2 +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="18122" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="gFc-jj-lq2">
  3 + <device id="retina4_7" orientation="portrait" appearance="light"/>
6 <dependencies> 4 <dependencies>
7 <deployment identifier="iOS"/> 5 <deployment identifier="iOS"/>
8 - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/> 6 + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="18093"/>
9 <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> 7 <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
10 </dependencies> 8 </dependencies>
11 <scenes> 9 <scenes>
@@ -22,10 +20,29 @@ @@ -22,10 +20,29 @@
22 <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> 20 <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
23 <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> 21 <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
24 </view> 22 </view>
  23 + <navigationItem key="navigationItem" id="mTT-vK-6cK"/>
25 </viewController> 24 </viewController>
26 <placeholder placeholderIdentifier="IBFirstResponder" id="tc2-Qw-aMS" userLabel="First Responder" sceneMemberID="firstResponder"/> 25 <placeholder placeholderIdentifier="IBFirstResponder" id="tc2-Qw-aMS" userLabel="First Responder" sceneMemberID="firstResponder"/>
27 </objects> 26 </objects>
28 - <point key="canvasLocation" x="305" y="433"/> 27 + <point key="canvasLocation" x="1244" y="432.23388305847078"/>
  28 + </scene>
  29 + <!--Navigation Controller-->
  30 + <scene sceneID="n8W-1E-BNP">
  31 + <objects>
  32 + <navigationController automaticallyAdjustsScrollViewInsets="NO" id="gFc-jj-lq2" sceneMemberID="viewController">
  33 + <toolbarItems/>
  34 + <navigationBar key="navigationBar" contentMode="scaleToFill" id="2eB-su-HZE">
  35 + <rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
  36 + <autoresizingMask key="autoresizingMask"/>
  37 + </navigationBar>
  38 + <nil name="viewControllers"/>
  39 + <connections>
  40 + <segue destination="whP-gf-Uak" kind="relationship" relationship="rootViewController" id="Mhr-9N-yGQ"/>
  41 + </connections>
  42 + </navigationController>
  43 + <placeholder placeholderIdentifier="IBFirstResponder" id="EaX-bh-8p8" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
  44 + </objects>
  45 + <point key="canvasLocation" x="304.80000000000001" y="432.23388305847078"/>
29 </scene> 46 </scene>
30 </scenes> 47 </scenes>
31 </document> 48 </document>
Example/CNLiveVideoClassifyKit/CNLIVEViewController.m
@@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
9 #import "CNLIVEViewController.h" 9 #import "CNLIVEViewController.h"
10 #import <CNLiveBaseKit/CNLiveBaseKit.h> 10 #import <CNLiveBaseKit/CNLiveBaseKit.h>
11 #import "CNliveCollectionViewCell.h" 11 #import "CNliveCollectionViewCell.h"
12 - 12 +#import <CNLiveVideoClassifyKit/CNLiveClassifySegmentController.h>
13 13
14 14
15 @interface CNLIVEViewController ()<UICollectionViewDelegate,UICollectionViewDataSource> 15 @interface CNLIVEViewController ()<UICollectionViewDelegate,UICollectionViewDataSource>
@@ -24,6 +24,7 @@ @@ -24,6 +24,7 @@
24 - (void)viewDidLoad 24 - (void)viewDidLoad
25 { 25 {
26 [super viewDidLoad]; 26 [super viewDidLoad];
  27 + self.title = @"首页";
27 segArr = @[@"分类"]; 28 segArr = @[@"分类"];
28 [self.view addSubview:self.collectionView]; 29 [self.view addSubview:self.collectionView];
29 } 30 }
@@ -45,7 +46,8 @@ @@ -45,7 +46,8 @@
45 switch (indexPath.row) { 46 switch (indexPath.row) {
46 case 0: 47 case 0:
47 { 48 {
48 - 49 + CNLiveClassifySegmentController *VC = [[CNLiveClassifySegmentController alloc] init];
  50 + [self.navigationController pushViewController:VC animated:YES];
49 } 51 }
50 break; 52 break;
51 53