Skip to content

Commit

Permalink
support Xcode8 and iOS10
Browse files Browse the repository at this point in the history
  • Loading branch information
hongxinhope committed Aug 7, 2016
1 parent 5ada648 commit b8d26c9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion SegmentedControl/SegmentedControl.swift
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,11 @@ public extension SegmentedControl {
let titleLayer = CATextLayer()
titleLayer.frame = titleRect
titleLayer.alignmentMode = kCAAlignmentCenter
titleLayer.truncationMode = kCATruncationEnd
if #available(iOS 10.0, *) {
titleLayer.truncationMode = kCATruncationNone
} else {
titleLayer.truncationMode = kCATruncationEnd
}
titleLayer.string = titleString
titleLayer.contentsScale = UIScreen.mainScreen().scale
return titleLayer
Expand Down

0 comments on commit b8d26c9

Please sign in to comment.