Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

DHSegmentedControl is drop in replacement of the UISegementedControl. Why you need it? If you have lots of segments, UISegmentedControl breaks the UI.

License

NotificationsYou must be signed in to change notification settings

hudinwal/DHSegmentedControl

Repository files navigation

VersionLicensePlatform

Example

To run the example project, clone the repo, and runpod install from the Example directory first.

Requirements

Installation

DHSegmentedControl is available throughCocoaPods. To installit, simply add the following line to your Podfile:

pod"DHSegmentedControl"

Usage

        // In appropriate function, maybe viewDidLoad(), we create the segmentsvarsegments=[DHSemgentTitleContainable]()                segments.append(DHSegmentTitle("ALL"))        segments.append(DHSegmentTitle("EAT"))        segments.append(DHSegmentTitle("DRINK"))        segments.append(DHSegmentTitle("DESSERT"))        segments.append(DHSegmentTitle("EVENTS"))        segments.append(DHSegmentTitle("SITES"))        // With these segments we then create a Segmented ControlletscrollabelSegmentControl=DHSegmentedControl(items: segments)                //Later on set the frames of the control        scrollabelSegmentControl.frame= segmentsContainer.bounds;        scrollabelSegmentControl.autoresizingMask=[.flexibleLeftMargin,.flexibleRightMargin,.flexibleWidth]        scrollabelSegmentControl.addTarget(self, action: #selector(segmentControlValueChanged(segmentControl:)), for:.valueChanged)        // In the end add the control to the viewself.segmentsContainer.addSubview(scrollabelSegmentControl)

Author

d_hudinwal,dinesh_hudinwal@hotmail.com

License

DHSegmentedControl is available under the MIT license. See the LICENSE file for more info.

About

DHSegmentedControl is drop in replacement of the UISegementedControl. Why you need it? If you have lots of segments, UISegmentedControl breaks the UI.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp