Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/using-data-source'
Browse files Browse the repository at this point in the history
  • Loading branch information
hongxinhope committed Nov 3, 2016
2 parents a2a4153 + f4c2378 commit 2fa12f7
Show file tree
Hide file tree
Showing 10 changed files with 347 additions and 112 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SegmentedControl.xcworkspace/xcuserdata
4 changes: 4 additions & 0 deletions SegmentedControl.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@
objects = {

/* Begin PBXBuildFile section */
D324D58C1DC981D0005BBBF5 /* Protocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = D324D58B1DC981D0005BBBF5 /* Protocols.swift */; };
D3E3B10B1C3288E5003EAA6E /* SegmentedControl.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3E3B10A1C3288E5003EAA6E /* SegmentedControl.swift */; };
D3E3B10D1C328A80003EAA6E /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3E3B10C1C328A80003EAA6E /* Constants.swift */; };
D3E3B10F1C3378DC003EAA6E /* SCScrollView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3E3B10E1C3378DC003EAA6E /* SCScrollView.swift */; };
D3E3B1111C337ECB003EAA6E /* Style.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3E3B1101C337ECB003EAA6E /* Style.swift */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
D324D58B1DC981D0005BBBF5 /* Protocols.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Protocols.swift; sourceTree = "<group>"; };
D3E3B0CB1C3282BB003EAA6E /* SegmentedControl.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SegmentedControl.framework; sourceTree = BUILT_PRODUCTS_DIR; };
D3E3B0F51C3283E8003EAA6E /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
D3E3B10A1C3288E5003EAA6E /* SegmentedControl.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SegmentedControl.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -54,6 +56,7 @@
children = (
D3E3B1101C337ECB003EAA6E /* Style.swift */,
D3E3B10C1C328A80003EAA6E /* Constants.swift */,
D324D58B1DC981D0005BBBF5 /* Protocols.swift */,
D3E3B10A1C3288E5003EAA6E /* SegmentedControl.swift */,
D3E3B10E1C3378DC003EAA6E /* SCScrollView.swift */,
D3E3B0F41C3283B2003EAA6E /* Supporting Files */,
Expand Down Expand Up @@ -147,6 +150,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D324D58C1DC981D0005BBBF5 /* Protocols.swift in Sources */,
D3E3B10D1C328A80003EAA6E /* Constants.swift in Sources */,
D3E3B10B1C3288E5003EAA6E /* SegmentedControl.swift in Sources */,
D3E3B10F1C3378DC003EAA6E /* SCScrollView.swift in Sources */,
Expand Down
6 changes: 5 additions & 1 deletion SegmentedControl/Constants.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// SegmentedStyle.swift
// Constants.swift
// SegmentedControl
//
// Created by Xin Hong on 15/12/29.
Expand All @@ -11,3 +11,7 @@ import UIKit
internal struct SelectionIndicator {
static let defaultHeight: CGFloat = 5
}

internal struct Constant {
static let defaultSelectionHorizontalPadding: CGFloat = 15
}
24 changes: 24 additions & 0 deletions SegmentedControl/Protocols.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//
// Protocols.swift
// SegmentedControl
//
// Created by Xin Hong on 2016/11/2.
// Copyright © 2016年 Teambition. All rights reserved.
//

import UIKit

public protocol SegmentedControlDelegate: class {
func segmentedControl(_ segmentedControl: SegmentedControl, didSelectIndex selectedIndex: Int)
func segmentedControl(_ segmentedControl: SegmentedControl, didLongPressIndex longPressIndex: Int)
}

public extension SegmentedControlDelegate {
func segmentedControl(_ segmentedControl: SegmentedControl, didSelectIndex selectedIndex: Int) {

}

func segmentedControl(_ segmentedControl: SegmentedControl, didLongPressIndex longPressIndex: Int) {

}
}
Loading

0 comments on commit 2fa12f7

Please sign in to comment.