Skip to content

Commit

Permalink
Chnages in travis file. Fix minor issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
goibibosahil committed Jan 5, 2016
1 parent 797c407 commit 022fdde
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 29 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
# * http://www.objc.io/issue-6/travis-ci.html
# * https://github.com/supermarin/xcpretty#usage

language: objective-c
language: swift
# cache: cocoapods
# podfile: Example/Podfile
# before_install:
# - gem install cocoapods # Since Travis is not always on latest version
# - pod install --project-directory=Example
script:

- set -o pipefail && xcodebuild test -workspace Example/SMSwipeableTabView.xcworkspace -scheme SMSwipeableTabView-Example -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO | xcpretty
- pod lib lint
2 changes: 2 additions & 0 deletions Example/SMSwipeableTabView.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MODULE_NAME = ExampleApp;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = NO;
};
name = Debug;
};
Expand All @@ -508,6 +509,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MODULE_NAME = ExampleApp;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = NO;
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
Expand All @@ -62,15 +62,18 @@
ReferencedContainer = "container:SMSwipeableTabView.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
Expand All @@ -86,10 +89,10 @@
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
Expand Down
2 changes: 1 addition & 1 deletion Example/SMSwipeableTabView/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//
//
// AppDelegate.swift
// SMSwipeableTabView
//
Expand Down
31 changes: 27 additions & 4 deletions Example/SMSwipeableTabView/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,35 @@ class ViewController: UIViewController, SMSwipeableTabViewControllerDelegate {
// Dispose of any resources that can be recreated.
}

//MARK: SMSwipeableTabViewControllerDelegate CallBack
//MARK: SMSwipeableTabViewController Delegate CallBack

func didLoadViewControllerAtIndex(index: Int) -> UIViewController {
let listVC = SMSimpleListViewController()
listVC.dataSource = viewControllerDataSourceCollection[index]
return listVC
switch index {
case 0:
let listVC = SMSimpleListViewController()
listVC.dataSource = viewControllerDataSourceCollection[index]
return listVC
case 1:
let vc = UIViewController()
vc.view.backgroundColor = UIColor.redColor()
return vc
case 2:
let listVC = SMSimpleListViewController()
listVC.dataSource = viewControllerDataSourceCollection[index]
return listVC
case 3:
let listVC = SMSimpleListViewController()
listVC.dataSource = viewControllerDataSourceCollection[index]
return listVC
case 5:
let vc = UIViewController()
vc.view.backgroundColor = UIColor.brownColor()
return vc
default:
let vc = UIViewController()
vc.view.backgroundColor = UIColor.greenColor()
return vc
}
}
}

4 changes: 3 additions & 1 deletion Pod/Classes/SMSwipeableTabViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ public let SMButtonHighlightedImagesAttribute = "kButtonHighlightedImageAttribut
/// Take Bool as value. Set title label of tab bar button hidden.
public let SMButtonHideTitleAttribute = "kButtonShowTitleAttribute" // Set Bool instance

/// Swipe constant
public let kSelectionBarSwipeConstant: CGFloat = 3.0

public protocol SMSwipeableTabViewControllerDelegate {
func didLoadViewControllerAtIndex(index: Int) -> UIViewController
Expand Down Expand Up @@ -350,6 +352,6 @@ public class SMSwipeableTabViewController: UIViewController, UIPageViewControlle
public func scrollViewDidScroll(scrollView: UIScrollView) {
let xFromCenter:CGFloat = self.view.frame.size.width-scrollView.contentOffset.x
let xCoor = buttonsFrameArray[currentPageIndex].origin.x;
selectionBar.frame = CGRectMake(xCoor-xFromCenter/CGFloat(titleBarDataSource?.count ?? 0), selectionBar.frame.origin.y, buttonsFrameArray[currentPageIndex].size.width, selectionBar.frame.size.height)
selectionBar.frame = CGRectMake(xCoor-xFromCenter/kSelectionBarSwipeConstant, selectionBar.frame.origin.y, buttonsFrameArray[currentPageIndex].size.width, selectionBar.frame.size.height)
}
}
21 changes: 4 additions & 17 deletions SMSwipeableTabView.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,19 @@ Pod::Spec.new do |s|
s.name = "SMSwipeableTabView"
s.version = "0.1.0"
s.summary = "Swipeable Views with Tabs (Like Android SwipeView With Tabs Layout)"

# This description is used to generate tags and improve search results.
# * Think: What does it do? Why did you write it? What is the focus?
# * Try to keep it short, snappy and to the point.
# * Write the description between the DESC delimiters below.
# * Finally, don't worry about the indent, CocoaPods strips it!
s.description = <<-DESC
It is a custom swipeable viewcontroller library same as Android Swipe view with Tabs Layout(In Lollipop). This control contains UIPageviewController and Scrollable SegmentBar. This type of control can be seen in Spotify app, Twitter app and in many more. User can add as many swipeable ViewController and SegmentBar Buttons. The whole control is customizable. User can easily customize the size of Button (Fixed or variable). Size, Color, Font, Height of Tabs/Segments. For more details, You can go through the example of this project.
It is a custom swipeable viewcontroller library same as Android Swipe view with Tabs Layout(In Lollipop). This control contains UIPageviewController and Scrollable SegmentBar/TabBar. This type of control can be seen in Spotify app, Twitter app and in many more. User can add as many swipeable ViewController and SegmentBar Buttons. The whole control is customizable. User can easily customize the size of Button (Fixed or variable), Size, Color, Font, Height of Tabs/Segments. For more details, You can go through the example of this project.
DESC

s.homepage = "https://github.com/smahajan28/SMSwipeableTabView"
# s.screenshots = "www.example.com/screenshots_1", "www.example.com/screenshots_2"
s.license = 'MIT'
s.author = { "Sahil Mahajan" => "sahilrameshmahajan@gmail.com" }
s.source = { :git => "https://github.com/smahajan28/SMSwipeableTabView.git", :tag => s.version.to_s }
# s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>'

s.platform = :ios, '8.0'
s.requires_arc = true
s.platform = :ios, '7.0'
s.requires_arc = true

s.source_files = 'Pod/Classes/**/*'
s.source_files = 'Pod/Classes/**/*'
s.resource_bundles = {
'SMSwipeableTabView' => ['Pod/Assets/*.png']
}

# s.public_header_files = 'Pod/Classes/**/*.h'
# s.frameworks = 'UIKit', 'MapKit'
# s.dependency 'AFNetworking', '~> 2.3'
end

0 comments on commit 022fdde

Please sign in to comment.