한글 설명은 여기
- 0.1.9 : Add
isEnabled
property to the FlameButton - 0.1.10 : Add property
isHighlighted
andhighlightedAppearanceHandler
to the FlameButton
FlameKit is collection of simple custom UIs. For version 0.1.0, It offers three Classes & one util. FlameScrollView, FlameNavigationBar, FlameButton & new FlameScreenUtil
FlameScrollView is subclass of UIScrollView which has UIStackView(vertical) as a built-in subview. It's seats somewhere between UIScrollView and UITableView. If you want to add vertical stack simply call addArrangedSubview(_:animated:horizontalInset:height:) to the instance of FlameScrollView. FlameScrollView also automatically listen to the keyboard show/hide notification.
let scrollView = FlameScrollView(frame: view.bounds)
scrollView.addArrangedSubview(subView1)
scrollView.addArrangedSubview(subView2)
scrollView.addMarginStack(height: 16.0) // adding margin
FlameNavigationBar is UIView-based customizable NavigationBar. FlameNavigationBar supports iOS 11 style LargeTitle and collapsing. It's compatible with scrollview. (FlameNavigationBar need to be a delegate of scrollView.)
let navigationBar = FlameNavigationBar()
navigationBar.title = "View Title"
scrollView.delegate = navigationBar
navigationBar.scrollView = scrollView
scrollView.contentInset.top = navigationBar.frame.height
FlameButton is UIView-based button that uses closure, not selector.
let button = FlameButton()
let customView = UIView() // draw whatever you want.
button.action { (button) in
print("button is tapped!") //when button tapped.
}
button.setCustomView(customView) { (isSelected, isEnabled) in // control appearance here.
if isSelected {
customView.backgroundColor = .red
} else {
customView.backgroundColor = .blue
}
if isEnabled {
label.alpha = 1.0
} else {
label.alpha = 0.5
}
}
FlameScreenUtil is collection of simple getters for dealing with various iphone screen sizes.
- iPhone1 - 320 x 480 (iPhone 2G ~ iPhone 4S)
- iPhone5 - 320 x 568 (iPhone 5 ~ iPhone SE)
- iPhone6 - 375 x 667 (iPhone 6 ~ iPhone 8)
- iPhone6Plus - 414 x 736 (iPhone 6+ ~ iPhone 8+)
- iPhoneX - 375 x 812 (iPhone X)
switch UIScreen.flm.screenType {
case .iPhone6Plus:
// setting for iPhone 6 Plus..
case .iPhoneX:
// setting for iPhone X..
default:
// setting for others...
}
if UIScreen.flm.isIphoneX {
//setting specific for iPhone X..
}
To run the example project, clone the repo, and run pod install
from the Example directory first.
- Swift 4.0 +
- iOS 9.0 +
FlameKit is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'FlameKit'
Install pod first. then on your .h file,
@import FlameKit;
Jongchan Mark Park, draupnir45@gmail.com
FlameKit is available under the MIT license. See the LICENSE file for more info.