Easy to create & custom segmented view

Overview

TCSegmentedView

Easy to create & custom segmented view

Example

Usage Examples

An Objective-C example project demonstrating customization options is included in the TCSegmentedView directory.

Objective-C

// Import the class and create an TCSegmentedView instance
#import "TCSegmentedView.h"

// Add segmentedView to view

    [self.view addSubview:self.segmentedView1];
    [self.view addSubview:self.segmentedView2];
    [self.view addSubview:self.segmentedView3];

// Init segmentedView
-(TCSegmentedView *)segmentedView1
{
    if (!_segmentedView1) {
        _segmentedView1 = [TCSegmentedView segmentedWithActiveItems:@[@"01. Segment 1",@"02. Segment 2", @"03. Segment 3", @"04. Segment 4"] normalItems:@[@"01",@"02",@"03", @"04"] frame:CGRectMake(16, 60, self.view.frame.size.width - 32, 30)];
        [_segmentedView1 setBackgroundColor:[UIColor clearColor]];
        [_segmentedView1 setNormalColor:[UIColor whiteColor] font:AS_FONT_SF_TEXT_MEDIUM(14)];
        [_segmentedView1 setSelectedColor:[UIColor whiteColor] font:AS_FONT_SF_TEXT_MEDIUM(14)];
        
        _segmentedView1.delegate = self;
    }
    return _segmentedView1;
}

-(TCSegmentedView *)segmentedView2
{
    if (!_segmentedView2) {
        _segmentedView2 = [TCSegmentedView segmentedWithActiveItems:@[@"01. Address",@"02. Basic Info", @"03. Photos"] normalItems:@[@"1",@"2",@"3"] frame:CGRectMake((self.view.frame.size.width - 240)/2, 160, 240, 30)];
        [_segmentedView2 setBackgroundColor:[UIColor clearColor]];
        [_segmentedView2 setNormalColor:[UIColor whiteColor] font:AS_FONT_SF_TEXT_REGULAR(12)];
        [_segmentedView2 setSelectedColor:[UIColor whiteColor] font:AS_FONT_SF_TEXT_BOLD(14)];
        _segmentedView2.backgroundNormalColor = [UIColor brownColor];
        _segmentedView2.backgroundActiveColor = [UIColor redColor];
        _segmentedView2.dashLineColor = [UIColor blueColor];
        
        _segmentedView2.delegate = self;
    }
    return _segmentedView2;
}

-(TCSegmentedView *)segmentedView3
{
    if (!_segmentedView3) {
        _segmentedView3 = [TCSegmentedView segmentedWithActiveItems:@[@"Step 01",@"Step 02", @"Step 03"] normalItems:@[@"πŸ˜€",@"πŸ˜‚πŸ˜‚",@"😍😍😍"] frame:CGRectMake((self.view.frame.size.width - 240)/2, 260, 240, 36)];
        [_segmentedView3 setBackgroundColor:[UIColor clearColor]];
        [_segmentedView3 setNormalColor:[UIColor blackColor] font:AS_FONT_SF_TEXT_MEDIUM(12)];
        [_segmentedView3 setSelectedColor:[UIColor whiteColor] font:AS_FONT_SF_TEXT_BOLD(14)];
        _segmentedView3.backgroundNormalColor = [UIColor lightGrayColor];
        _segmentedView3.backgroundActiveColor = [UIColor blueColor];
        _segmentedView3.dashLineColor = [UIColor blackColor];
        _segmentedView3.magirn = 8;
        _segmentedView3.delegate = self;
    }
    return _segmentedView3;
}

License

This project is released under the Apache 2.0 License.

You might also like...
Using the UIKitChain framework, You can create a UIKit component in one line of code.
Using the UIKitChain framework, You can create a UIKit component in one line of code.

Using the UIKitChain framework, You can create a UIKit component in one line of code. Installation CocoaPods CocoaPods is a dependency manager for Coc

Custom UIView class that hosts an array of UIbuttons that have an 'underline' UIView beneath them which moves from button to button when the user presses on them.
Custom UIView class that hosts an array of UIbuttons that have an 'underline' UIView beneath them which moves from button to button when the user presses on them.

Swift-Underlined-Button-Bar Custom UIView class that hosts an array of UIbuttons that have an 'underline' UIView beneath them which moves from button

SwiftUI Grid layout with custom styles
SwiftUI Grid layout with custom styles

SwiftUI Grid SwiftUI Grid view layout with custom styles. Features ZStack based layout Vertical and horizontal scrolling Supports all apple platforms

StoryboardUsingCustomViews - Storyboard Using Custom Views
StoryboardUsingCustomViews - Storyboard Using Custom Views

Storyboard Using Custom Views Vista creada con: Storyboard + Constraints + Progr

VerticalFlowLayout - This implementation is built using a UICollectionView and a custom flowLayout.
VerticalFlowLayout - This implementation is built using a UICollectionView and a custom flowLayout.

VerticalFlowLayout This implementation is built using a UICollectionView and a custom flowLayout. Table of contents Requirements Installation CocoaPod

A custom layout built on top of SwiftUI's Layout API that lays elements out in multiple lines. Similar to flex-wrap in CSS, CollectionViewFlowLayout.
A custom layout built on top of SwiftUI's Layout API that lays elements out in multiple lines. Similar to flex-wrap in CSS, CollectionViewFlowLayout.

WrapLayout A custom layout built on top of SwiftUI's Layout API that lays elements out in multiple lines. Similar to flex-wrap in CSS, CollectionViewF

Customise sheets on iOS, bottom sheets, custom detents and more..
Customise sheets on iOS, bottom sheets, custom detents and more..

Sheetster A custom sheet creator library for iOS Devices Features Extends UISheetPresentationController Objective C Private API Custom Detent Setter G

A Custom ImagePicker Code with SwiftUI.
A Custom ImagePicker Code with SwiftUI.

YYImagePicker A Custom ImagePicker Code with SwiftUI. Author Thanks for Kavsoft!!! 😁 ScreenShot Usage VStack { } .popupImagePickerView(show: $showIm

Auto Layout made easy
Auto Layout made easy

EasyPeasy is a Swift framework that lets you create Auto Layout constraints programmatically without headaches and never ending boilerplate code. Besi

Owner
Chuong Tran
Chuong Tran
UIView category which makes it easy to create layout constraints in code

FLKAutoLayout FLKAutoLayout is a collection of categories on UIView which makes it easy to setup layout constraints in code. FLKAutoLayout creates sim

Florian Kugler 1.5k Nov 24, 2022
Library that makes it easy to create multiple environments within a single app. You can switch environments without deleting the application.

AppContainer Library that makes it easy to create multiple environments within a single app. You can switch environments without deleting the applicat

null 8 Dec 15, 2022
iOS simple project to create half-screen modal view controller with pan

Simple Half-screen view controller, draggable and less code (learning purpose)

Mohd Hafiz 123 Dec 17, 2022
Auto Layout made easy with the Custom Layout.

Auto Layout made easy with the Custom Layout. Getting started CocoaPods CocoaPods is a dependency manager for Cocoa projects. You can install it with

Malith Nadeeshan 1 Jan 16, 2022
HBFloatingView - A lightweight custom floating view

HBFloatingView Example To run the example project, clone the repo, and run pod i

haoboxuxu 1 Feb 2, 2022
MyLayout is a simple and easy objective-c framework for iOS view layout

MyLayout is a powerful iOS UI framework implemented by Objective-C. It integrates the functions with Android Layout,iOS AutoLayout,SizeClass, HTML CSS float and flexbox and bootstrap. So you can use LinearLayout,RelativeLayout,FrameLayout,TableLayout,FlowLayout,FloatLayout,PathLayout,GridLayout,LayoutSizeClass to build your App θ‡ͺεŠ¨εΈƒε±€ UIView UITableView UICollectionView RTL

欧阳倧ε“₯2013 4.2k Dec 30, 2022
Simple & Easy OTP View β˜„οΈ

Objectives ?? Easy and simple way to bring an OTP view into your iOS application with many customizations in color , animations , fonts etc.. Table of

null 9 Nov 23, 2022
Modern-collection-view - Modern collection view for swift

Modern collection view Sample application demonstrating the use of collection vi

Nitanta Adhikari 1 Jan 24, 2022
Create, Save, and Export Point Clouds w/ Lidar equipped Iphones

Iphone Point Cloud Generator This was ceated to make the wwdc20 sample into a usable utility app. Place points in the real-world using the scene's dep

null 39 Dec 18, 2022
Try to create my own DI container

Basic Dependecy Injection Simple solution for DI Dependecy registration Registration strong dependency Registration weak dependency Registration with

Evgeny Bayan 2 Apr 20, 2022