Skip to content

Commit

Permalink
Merge pull request #11 from Athlee/swift3-develop
Browse files Browse the repository at this point in the history
Updated to Swift 3
  • Loading branch information
mozharovsky authored Sep 18, 2016
2 parents 812f8a5 + c424af2 commit 4e89f6b
Show file tree
Hide file tree
Showing 73 changed files with 1,649 additions and 1,041 deletions.
Binary file added .DS_Store
Binary file not shown.
Binary file added Assets/.DS_Store
Binary file not shown.
Binary file added Example/.DS_Store
Binary file not shown.
Binary file added Example/Athlee-Onboarding/.DS_Store
Binary file not shown.
606 changes: 0 additions & 606 deletions Example/Athlee-Onboarding/Athlee-Onboarding.xcodeproj/project.pbxproj

This file was deleted.

This file was deleted.

20 changes: 0 additions & 20 deletions Example/Athlee-Onboarding/Athlee-Onboarding/AppDelegate.swift

This file was deleted.

This file was deleted.

23 changes: 0 additions & 23 deletions Example/Athlee-Onboarding/Athlee-Onboarding/DeviceTarget.swift

This file was deleted.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions Example/Athlee-Onboarding/OnboardingKit Swift3/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// AppDelegate.swift
// OnboardingKit Swift3
//
// Created by mac on 18/09/16.
// Copyright © 2016 Athlee. All rights reserved.
//

import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
return true
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
{
"images" : [
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "83.5x83.5",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8150" systemVersion="15A204g" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11134" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8122"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11106"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
Expand All @@ -13,10 +14,9 @@
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<animations/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//

import UIKit
import OnboardingKit
//import OnboardingKit

public final class DataModel: NSObject, OnboardingViewDelegate, OnboardingViewDataSource {

Expand All @@ -18,7 +18,7 @@ public final class DataModel: NSObject, OnboardingViewDelegate, OnboardingViewDa
return 5
}

public func onboardingView(onboardingView: OnboardingView, configurationForPage page: Int) -> OnboardingConfiguration {
public func onboardingView(_ onboardingView: OnboardingView, configurationForPage page: Int) -> OnboardingConfiguration {
switch page {

case 0:
Expand Down Expand Up @@ -81,27 +81,27 @@ public final class DataModel: NSObject, OnboardingViewDelegate, OnboardingViewDa
}
}

public func onboardingView(onboardingView: OnboardingView, configurePageView pageView: PageView, atPage page: Int) {
pageView.titleLabel.textColor = UIColor.whiteColor()
public func onboardingView(_ onboardingView: OnboardingView, configurePageView pageView: PageView, atPage page: Int) {
pageView.titleLabel.textColor = UIColor.white
pageView.titleLabel.layer.shadowOpacity = 0.6
pageView.titleLabel.layer.shadowColor = UIColor.blackColor().CGColor
pageView.titleLabel.layer.shadowColor = UIColor.black.cgColor
pageView.titleLabel.layer.shadowOffset = CGSize(width: 0, height: 1)
pageView.titleLabel.layer.shouldRasterize = true
pageView.titleLabel.layer.rasterizationScale = UIScreen.mainScreen().scale
pageView.titleLabel.layer.rasterizationScale = UIScreen.main.scale

if DeviceTarget.IS_IPHONE_4 {
pageView.titleLabel.font = UIFont.boldSystemFontOfSize(30)
pageView.descriptionLabel.font = UIFont.systemFontOfSize(15)
pageView.titleLabel.font = UIFont.boldSystemFont(ofSize: 30)
pageView.descriptionLabel.font = UIFont.systemFont(ofSize: 15)
}
}

public func onboardingView(onboardingView: OnboardingView, didSelectPage page: Int) {
public func onboardingView(_ onboardingView: OnboardingView, didSelectPage page: Int) {
print("Did select pge \(page)")
didShow?(page)
}

public func onboardingView(onboardingView: OnboardingView, willSelectPage page: Int) {
public func onboardingView(_ onboardingView: OnboardingView, willSelectPage page: Int) {
print("Will select page \(page)")
willShow?(page)
}
}
}
23 changes: 23 additions & 0 deletions Example/Athlee-Onboarding/OnboardingKit Swift3/DeviceTarget.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// DeviceTarget.swift
// Athlee-Onboarding
//
// Created by mac on 07/07/16.
// Copyright © 2016 Athlee. All rights reserved.
//

import UIKit

public struct DeviceTarget {
public static let CURRENT_DEVICE: CGFloat = UIScreen.main.bounds.height

public static let IPHONE_4: CGFloat = 480
public static let IPHONE_5: CGFloat = 568
public static let IPHONE_6: CGFloat = 667
public static let IPHONE_6_Plus: CGFloat = 736

public static let IS_IPHONE_4 = UIScreen.main.bounds.height == IPHONE_4
public static let IS_IPHONE_5 = UIScreen.main.bounds.height == IPHONE_5
public static let IS_IPHONE_6 = UIScreen.main.bounds.height == IPHONE_6
public static let IS_IPHONE_6_Plus = UIScreen.main.bounds.height == IPHONE_6_Plus
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
Expand All @@ -36,5 +34,12 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -1,36 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="16A286a" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11201" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11161"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Onboarding View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="OnboardingViewController" customModule="Athlee_Onboarding" customModuleProvider="target" sceneMemberID="viewController">
<viewController id="BYZ-38-t0r" customClass="OnboardingViewController" customModule="OnboardingKit_Swift3" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="0cG-Sg-U6K" customClass="OnboardingView" customModule="OnboardingKit_Swift3" customModuleProvider="target">
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="bJ1-mf-N5F">
<rect key="frame" x="536" y="20" width="44" height="33"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<state key="normal" title="NEXT">
<color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<color key="titleColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
</button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="0cG-Sg-U6K" customClass="OnboardingView" customModule="OnboardingKit">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</view>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="0cG-Sg-U6K" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="GPO-wX-aua"/>
<constraint firstItem="0cG-Sg-U6K" firstAttribute="height" secondItem="8bC-Xf-vdC" secondAttribute="height" id="PS9-en-eFq"/>
Expand Down
Loading

0 comments on commit 4e89f6b

Please sign in to comment.