All Projects → alokc83 → MASegmentedControl

alokc83 / MASegmentedControl

Licence: MIT license
Super customizable segmented control

Programming Languages

swift
15916 projects
ruby
36898 projects - #4 most used programming language
objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to MASegmentedControl

ZLPhotoBrowser-objc
(ZLPhotoBrowser oc 版本)轻量级照片选择框架,支持预览/相册内拍照及录视频、拖拽/滑动选择,编辑裁剪图片/视频,支持多语言国际化等功能
Stars: ✭ 54 (-26.03%)
Mutual labels:  cocoapods-support, carthage-support
WinForms.FC UI
👀 FC_UI (Fun-Code User Interface) - библиотека пользовательских элементов управления (user control) для WinForms (.Net Framework / .Net Core).
Stars: ✭ 18 (-75.34%)
Mutual labels:  custom-controls
creating-controls-in-assembler
Gitbook: https://mrfearless.gitbooks.io/creating-controls-in-assembler
Stars: ✭ 20 (-72.6%)
Mutual labels:  custom-controls
Standard-Toolkit
An update to Component factory's krypton toolkit to support .NET Framework 4.6.2 - 4.8.1 to .NET Core/.NET
Stars: ✭ 194 (+165.75%)
Mutual labels:  custom-controls
XamarinHorizontalList
This sample is built with a few xamarin horizontal lists different implementations.
Stars: ✭ 36 (-50.68%)
Mutual labels:  custom-controls
PCF-Builder-VSCode
Build your Power Apps Component Framework custom controls faster. No need to remember the PCF CLI commands. All commands provided in one selection list for you to execute. https://marketplace.visualstudio.com/items?itemName=danish-naglekar.pcf-builder
Stars: ✭ 15 (-79.45%)
Mutual labels:  custom-controls
sizectrl
TSizeCtrl v8.2
Stars: ✭ 16 (-78.08%)
Mutual labels:  custom-controls
BetterMappable
Better Mappable through Property Wrappers using ObjectMapper
Stars: ✭ 26 (-64.38%)
Mutual labels:  carthage-support

MASegmentedControl Build Status Maintenance

Language cocoapods carthage
SPM
GitHub forks GitHub issues Open Source Love svg1 GitHub license

Code Quality:

Service Grading
coderefactor.io CodeFactor
codebeat.co codebeat badge
codecov.io N/A

Super customizable Segmented Control for iOS. Following examples can give you idea how it can be customized. All this customization can be written anywhere before rendering of the control. Most desirable place is didSet block.

For example:

@IBOutlet var imagesSegmentedControl: MASegmentedControl! {
	didSet {
		imagesSegmentedControl.fillEqually = false
 		imagesSegmentedControl.buttonsWithDynamicImages = true
 		imagesSegmentedControl.roundedControl = true
    }
}

Integrating with cococapods:


Integrating latest version
pod 'MASegmentedControl'

Integrating specific version
pods 'MASegmentedControl', '~> 0.0.5'

Integrating with Carthage:


Integrating latest version
github "alokc83/MASegmentedControl"

Integrating specific version
github "alokc83/MASegmentedControl" ~> 0.0.5

Circular segment:


Circular design
You would need to provide the image array that can be a array of image litrals or array of UIImage.

 imagesSegmentedControl.fillEqually = false
 imagesSegmentedControl.buttonsWithDynamicImages = true
 imagesSegmentedControl.roundedControl = true

 // images is the array of image litrals
 imagesSegmentedControl.setSegmentedWith(items: images)
 imagesSegmentedControl.padding = 2
 imagesSegmentedControl.thumbViewColor = #colorLiteral(red: 0.9372549057,
 											green: 0.3490196168,
 											blue: 0.1921568662,
 											alpha: 1)

Rounded corner segment:


Rounded corner design

didSet {
        //Set this booleans to adapt control
        textSegmentedControl.itemsWithText = true
        textSegmentedControl.fillEqually = true
        textSegmentedControl.roundedControl = true

        textSegmentedControl.setSegmentedWith(items: ["Option 1", "Option2"])
        textSegmentedControl.padding = 2
        textSegmentedControl.textColor = #colorLiteral(red: 0.2549019754,
     											green: 0.2745098174,
     											blue: 0.3019607961,
    											alpha: 1)
        textSegmentedControl.selectedTextColor = #colorLiteral(red: 1,
        									green: 1,
        									blue: 1,
        									alpha: 1)
        textSegmentedControl.thumbViewColor = #colorLiteral(red: 0,
        										green: 0.4784313725,
        										blue: 1,
      											alpha: 1)
        textSegmentedControl.titlesFont = UIFont(name: "OpenSans-Semibold", size: 14)
}

Square design with image:


Square design


didSet {
        //Set this booleans to adapt control
        iconsSegmentedControl.itemsWithText = false
        iconsSegmentedControl.fillEqually = false
        iconsSegmentedControl.roundedControl = false

        // icons is the array of image litrals
        iconsSegmentedControl.setSegmentedWith(items: icons)
        iconsSegmentedControl.padding = 2
        iconsSegmentedControl.thumbViewColor = #colorLiteral(red: 0.9529411793, green: 0.6862745285, blue: 0.1333333403, alpha: 1)
        iconsSegmentedControl.buttonColorForNormal = #colorLiteral(red: 0.6000000238, green: 0.6000000238, blue: 0.6000000238, alpha: 1)
        iconsSegmentedControl.buttonColorForSelected = #colorLiteral(red: 1, green: 1, blue: 1, alpha: 1)
  }

Square text design:


Square text design

didSet {
        //Set this booleans to adapt control
        textSquareSegmentedControl.itemsWithText = true
        textSquareSegmentedControl.fillEqually = true

        let strings = ContentDataSource.textItems()
        textSquareSegmentedControl.setSegmentedWith(items: strings)
        textSquareSegmentedControl.padding = 2
         textSquareSegmentedControl.textColor = #colorLiteral(red: 0.2549019754, green: 0.2745098174, blue: 0.3019607961, alpha: 1)
        textSquareSegmentedControl.selectedTextColor = #colorLiteral(red: 1, green: 1, blue: 1, alpha: 1)
         textSquareSegmentedControl.thumbViewColor = #colorLiteral(red: 0.3411764801, green: 0.6235294342, blue: 0.1686274558, alpha: 1)
  }

Youtube style design:


Youtube design

didSet {    
        //Set this booleans to adapt control
        youtubeLikeSegmentedControl.itemsWithText = false
        youtubeLikeSegmentedControl.bottomLineThumbView = true
        youtubeLikeSegmentedControl.fillEqually = true

        // icons is the array of image litrals
        youtubeLikeSegmentedControl.setSegmentedWith(items: icons)
        youtubeLikeSegmentedControl.padding = 2
        youtubeLikeSegmentedControl.thumbViewColor = #colorLiteral(red: 0.9411764706, green: 0.2549019608, blue: 0.2020437331, alpha: 1)
        youtubeLikeSegmentedControl.buttonColorForNormal =  #colorLiteral(red: 0.6000000238, green: 0.6000000238, blue: 0.6000000238, alpha: 1)
        youtubeLikeSegmentedControl.buttonColorForSelected = #colorLiteral(red: 0.9411764706, green: 0.2549019608, blue: 0.2020437331, alpha: 1)
  }

Simple text highlight design:


text highlight design

didSet {

       //Set this booleans to adapt control
       hiddenThumbViewSegmentedControl.itemsWithText = true
       hiddenThumbViewSegmentedControl.fillEqually = true
       hiddenThumbViewSegmentedControl.thumbViewHidden = true

       hiddenThumbViewSegmentedControl.setSegmentedWith(items: ["Option 1", "Option 2"])
       hiddenThumbViewSegmentedControl.padding = 2
       hiddenThumbViewSegmentedControl.textColor = #colorLiteral(red: 0.6000000238, green: 0.6000000238, blue: 0.6000000238, alpha: 1)
       hiddenThumbViewSegmentedControl.selectedTextColor = #colorLiteral(red: 0.2549019754, green: 0.2745098174, blue: 0.3019607961, alpha: 1)
        }

Simple text highlight with underbar design:


text with underbar design

didSet {
        //Set this booleans to adapt control
        linearThumbViewSegmentedControl.itemsWithText = true
        linearThumbViewSegmentedControl.fillEqually = true
        linearThumbViewSegmentedControl.bottomLineThumbView = true

        linearThumbViewSegmentedControl.setSegmentedWith(items: ["Option 1", "Option 2", "Option 3"])
        linearThumbViewSegmentedControl.padding = 2
        linearThumbViewSegmentedControl.textColor = #colorLiteral(red: 0.6000000238, green: 0.6000000238, blue: 0.6000000238, alpha: 1)
        linearThumbViewSegmentedControl.selectedTextColor = #colorLiteral(red: 0.2549019754, green: 0.2745098174, blue: 0.3019607961, alpha: 1)
         linearThumbViewSegmentedControl.thumbViewColor = #colorLiteral(red: 0.9372549057, green: 0.3490196168, blue: 0.1921568662, alpha: 1)     
  }

HitCount

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].