Skip to content

Latest commit

 

History

History

MGUNeoSegControl

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

MGUNeoSegControl

Swift Objective-C
iOS

MGUNeoSegControl

  • MGUNeoSegControlUISegmentedControl 보다 더 많은 기능과 디자인의 자유도를 보장하는 커스텀 SegmentedControl
    • UIControl 서브클래스로 제작함
  • IV-Drop을 만들면서 SheetViewController에 위치할 커스텀 SegmentedControl에 대한 요구사항이 있어서 제작함. MiniTimer에서도 사용함.

Features

  • Colors, Gradients, Fonts 등 커스텀 가능
  • Style presets 지원
  • Supports texts and images
  • Text와 Image의 배치를 vertical 또는 horizontal로 배치가능
  • 백그라운드 및 segment를 커스텀 뷰로 제공 가능
  • Haptic Feedback 제공 : 제스처로 토글 시 Haptic Feedback이 터치한 Device를 통해 전달된다.
    • UIImpactFeedbackGenerator 이용하여 구현함
  • Swift and Objective-C compatability
  • Written in Objective-C

Preview

  • MGUNeoSegControl (iOS)
    • IV-Drop을 만들면서 커스텀 스위치의 요구사항이 있어서 제작함.
    • MiniTimer에서도 사용함.
MGUNeoSegControl (iOS) IV-Drop에서 사용한 예 MiniTimer에서 사용 예
MiniTimer에서 사용 예

Usage

Swift

let config = MGUNeoSegConfiguration.forge()
containerView.backgroundColor = config.backgroundColor
let segmentedControl = MGUNeoSegControl.init(titles: self.dropTitleAndImageModels(),
                                       selecedtitle: "",
                                      configuration: config)
view.addSubview(segmentedControl)
segmentedControl.addTarget(self, action: #selector(valueChanged(_:)), for: .valueChanged)
segmentedControl.impactOff = false

Objective-C

MGUNeoSegControl *segmentedControl =
[[MGUNeoSegControl alloc] initWithTitles:[self imageModels]
                            selecedtitle:@"chrome"
                           configuration:[MGUNeoSegConfiguration iOS7Configuration]];
[self.view addSubview:segmentedControl];
[segmentedControl addTarget:self action:@selector(valueChanged:) forControlEvents:UIControlEventValueChanged];

Documentation

  • Segment 배치를 위한 설계도

Author

sonkoni(손관현), [email protected]

License

This project is released under the MIT License. See LICENSE for more information.