Skip to content

Commit

Permalink
Merge pull request #11 from kobim/swift1.2
Browse files Browse the repository at this point in the history
Swift 1.2 support
  • Loading branch information
Stefan Lage committed Sep 16, 2015
2 parents c991766 + c52eaa3 commit 16b59f2
Show file tree
Hide file tree
Showing 11 changed files with 372 additions and 178 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.DS_Store
xcuserdata
project.xcworkspace
10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
language: objective-c
osx_image: beta-xcode6.3

before_install:
- brew update
- if brew outdated | grep -qx xctool; then brew upgrade xctool; fi

script:
- xctool clean build -project Demos/TwitterLike/TwitterLike.xcodeproj -scheme TwitterLike -sdk iphonesimulator
- xctool clean build -project Demos/TinderLike/TinderLike.xcodeproj -scheme TinderLike -sdk iphonesimulator
Binary file removed Demos/.DS_Store
Binary file not shown.
Binary file removed Demos/TinderLike/.DS_Store
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0640"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F85CA9A41A61963B0013CF3F"
BuildableName = "TinderLike.app"
BlueprintName = "TinderLike"
ReferencedContainer = "container:TinderLike.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F85CA9B91A61963B0013CF3F"
BuildableName = "TinderLikeTests.xctest"
BlueprintName = "TinderLikeTests"
ReferencedContainer = "container:TinderLike.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F85CA9B91A61963B0013CF3F"
BuildableName = "TinderLikeTests.xctest"
BlueprintName = "TinderLikeTests"
ReferencedContainer = "container:TinderLike.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F85CA9A41A61963B0013CF3F"
BuildableName = "TinderLike.app"
BlueprintName = "TinderLike"
ReferencedContainer = "container:TinderLike.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F85CA9A41A61963B0013CF3F"
BuildableName = "TinderLike.app"
BlueprintName = "TinderLike"
ReferencedContainer = "container:TinderLike.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F85CA9A41A61963B0013CF3F"
BuildableName = "TinderLike.app"
BlueprintName = "TinderLike"
ReferencedContainer = "container:TinderLike.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
38 changes: 20 additions & 18 deletions Demos/TinderLike/TinderLike/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?
var nav: UINavigationController?
var controller: SLPagingViewSwift?
var controller: SLPagingViewSwift!

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
self.window = UIWindow(frame: UIScreen.mainScreen().bounds)
var orange = UIColor(red: 255/255, green: 69.0/255, blue: 0.0/255, alpha: 1.0)
var gray = UIColor(red: 0.84, green: 0.84, blue: 0.84, alpha: 1.0)
let orange = UIColor(red: 255/255, green: 69.0/255, blue: 0.0/255, alpha: 1.0)
let gray = UIColor(red: 0.84, green: 0.84, blue: 0.84, alpha: 1.0)

var ctr1 = UIViewController()
ctr1.title = "Ctr1"
Expand All @@ -42,25 +42,27 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var controllers = [ctr1, ctr2, ctr3]
controller = SLPagingViewSwift(items: items, controllers: controllers, showPageControl: false)

controller?.pagingViewMoving = ({ subviews in
for v in subviews {
var lbl = v as UIImageView
var c = gray

if(lbl.frame.origin.x > 45 && lbl.frame.origin.x < 145) {
c = self.gradient(Double(lbl.frame.origin.x), topX: Double(46), bottomX: Double(144), initC: orange, goal: gray)
controller.pagingViewMoving = ({ subviews in
if let imageViews = subviews as? [UIImageView] {
for imgView in imageViews {
var c = gray
let originX = Double(imgView.frame.origin.x)

if (originX > 45 && originX < 145) {
c = self.gradient(originX, topX: 46, bottomX: 144, initC: orange, goal: gray)
}
else if (originX > 145 && originX < 245) {
c = self.gradient(originX, topX: 146, bottomX: 244, initC: gray, goal: orange)
}
else if(originX == 145){
c = orange
}
imgView.tintColor = c
}
else if (lbl.frame.origin.x > 145 && lbl.frame.origin.x < 245) {
c = self.gradient(Double(lbl.frame.origin.x), topX: Double(146), bottomX: Double(244), initC: gray, goal: orange)
}
else if(lbl.frame.origin.x == 145){
c = orange
}
lbl.tintColor = c
}
})

self.nav = UINavigationController(rootViewController: self.controller!)
self.nav = UINavigationController(rootViewController: self.controller)
self.window?.rootViewController = self.nav
self.window?.backgroundColor = UIColor.whiteColor()
self.window?.makeKeyAndVisible()
Expand Down
Binary file removed Demos/TwitterLike/.DS_Store
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0640"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F85CA9701A618E180013CF3F"
BuildableName = "TwitterLike.app"
BlueprintName = "TwitterLike"
ReferencedContainer = "container:TwitterLike.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F85CA9851A618E180013CF3F"
BuildableName = "TwitterLikeTests.xctest"
BlueprintName = "TwitterLikeTests"
ReferencedContainer = "container:TwitterLike.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F85CA9851A618E180013CF3F"
BuildableName = "TwitterLikeTests.xctest"
BlueprintName = "TwitterLikeTests"
ReferencedContainer = "container:TwitterLike.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F85CA9701A618E180013CF3F"
BuildableName = "TwitterLike.app"
BlueprintName = "TwitterLike"
ReferencedContainer = "container:TwitterLike.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F85CA9701A618E180013CF3F"
BuildableName = "TwitterLike.app"
BlueprintName = "TwitterLike"
ReferencedContainer = "container:TwitterLike.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F85CA9701A618E180013CF3F"
BuildableName = "TwitterLike.app"
BlueprintName = "TwitterLike"
ReferencedContainer = "container:TwitterLike.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Loading

0 comments on commit 16b59f2

Please sign in to comment.