Bump version to 1.0.0.

This commit is contained in:
zekunyan
2016-06-07 23:27:07 +08:00
parent a2f1b97e95
commit 992a4983fe
51 changed files with 1759 additions and 4278 deletions

View File

@@ -1,4 +1,6 @@
platform :ios, '8.0'
use_frameworks!
pod "TTGSnackbar", :path => "../"
target 'TTGSnackbarObjcTest' do
pod "TTGSnackbar", :path => "../"
end

View File

@@ -1,5 +1,5 @@
PODS:
- TTGSnackbar (0.5.3)
- TTGSnackbar (1.0.0)
DEPENDENCIES:
- TTGSnackbar (from `../`)
@@ -9,6 +9,8 @@ EXTERNAL SOURCES:
:path: "../"
SPEC CHECKSUMS:
TTGSnackbar: 21330c2063619066777e562ded9772d321add245
TTGSnackbar: cb5cbecd868251268edef78b058c7ef089a3670a
COCOAPODS: 0.39.0
PODFILE CHECKSUM: bfc425fa86374525c1df79fc7e1e02c16450a8a2
COCOAPODS: 1.0.1

View File

@@ -1 +0,0 @@
../../../../../TTGSnackbar/TTGSnackbar.h

View File

@@ -1,7 +1,7 @@
{
"name": "TTGSnackbar",
"module_name": "TTGSnackbar",
"version": "0.5.3",
"version": "1.0.0",
"summary": "A Swift based implementation of the Android Snackbar for iOS. Show simple message and action button like a Toast.",
"description": "TTGSnackbar is useful for showing a brief message at the bottom of the screen with an action button.\nIt appears above all other elements on screen and only one can be displayed at a time.\nIt disappears after a timeout or after user click the action button.",
"homepage": "https://github.com/zekunyan/TTGSnackbar",
@@ -18,7 +18,7 @@
},
"source": {
"git": "https://github.com/zekunyan/TTGSnackbar.git",
"tag": "0.5.3"
"tag": "1.0.0"
},
"source_files": "TTGSnackbar/**/*.{h,swift}",
"requires_arc": true

View File

@@ -1,5 +1,5 @@
PODS:
- TTGSnackbar (0.5.3)
- TTGSnackbar (1.0.0)
DEPENDENCIES:
- TTGSnackbar (from `../`)
@@ -9,6 +9,8 @@ EXTERNAL SOURCES:
:path: "../"
SPEC CHECKSUMS:
TTGSnackbar: 21330c2063619066777e562ded9772d321add245
TTGSnackbar: cb5cbecd868251268edef78b058c7ef089a3670a
COCOAPODS: 0.39.0
PODFILE CHECKSUM: bfc425fa86374525c1df79fc7e1e02c16450a8a2
COCOAPODS: 1.0.1

File diff suppressed because it is too large Load Diff

View File

@@ -1,60 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0700"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForAnalyzing = "YES"
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES">
<BuildableReference
BuildableIdentifier = 'primary'
BlueprintIdentifier = 'A0A9B0224969536AFBCADEB1'
BlueprintName = 'TTGSnackbar'
ReferencedContainer = 'container:Pods.xcodeproj'
BuildableName = 'TTGSnackbar.framework'>
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
buildConfiguration = "Debug"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES"
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@@ -1,22 +0,0 @@
The MIT License (MIT)
Copyright (c) 2015 zekunyan
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -1,158 +0,0 @@
# TTGSnackbar
A Swift based implementation of the Android Snackbar for iOS
[![Version](https://img.shields.io/cocoapods/v/TTGSnackbar.svg?style=flat)](https://github.com/zekunyan/TTGSnackbar)
[![License](https://img.shields.io/cocoapods/l/TTGSnackbar.svg?style=flat)](https://github.com/zekunyan/TTGSnackbar)
[![Platform](https://img.shields.io/cocoapods/p/TTGSnackbar.svg?style=flat)](https://github.com/zekunyan/TTGSnackbar)
![Screenshot](http://7nj2iz.com1.z0.glb.clouddn.com/TTGSnackbar_8.gif)
# About
TTGSnackbar is useful for showing a brief message at the bottom of the screen with an action button.
It appears above all other elements on screen and only one can be displayed at a time.
It disappears after a timeout or after user click the action button.
# Installation
### Requirement
Swift 2.2
iOS 8+
### CocoaPods
You can use [CocoaPods](http://cocoapods.org) to install `TTGSnackbar` by adding it to your `Podfile`:
```ruby
platform :ios, '8.0'
use_frameworks!
pod "TTGSnackbar"
```
### Carthage
You can use [Carthage](https://github.com/Carthage/Carthage) to install `TTGSnackbar` by adding it to your `Cartfile`:
```
github "zekunyan/TTGSnackbar"
```
### Import
And you need to import the module.
```
import TTGSnackbar
```
# Usage
## Show a simple message
![Example](http://7nj2iz.com1.z0.glb.clouddn.com/TTGSnackbar_2.png)
```
let snackbar = TTGSnackbar.init(message: "Message", duration: .Short)
snackbar.show()
```
## Show a simple message with an action button
![Example](http://7nj2iz.com1.z0.glb.clouddn.com/TTGSnackbar_3.png)
```
let snackbar = TTGSnackbar.init(message: "Message", duration: .Middle, actionText: "Action")
{ (snackbar) -> Void in
NSLog("Click action!")
}
snackbar.show()
```
## Show a simple message with a long running action
![Example](http://7nj2iz.com1.z0.glb.clouddn.com/TTGSnackbar_5.png)
```
let snackbar = TTGSnackbar.init(message: "Message", duration: .Forever, actionText: "Action")
{ (snackbar) -> Void in
NSLog("Click action!")
// Dismiss manually after 3 seconds
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, Int64(3 * Double(NSEC_PER_SEC))), dispatch_get_main_queue()) { () -> Void in
snackbar.dismiss()
}
}
snackbar.show()
```
## Show a simple message with two action buttons
![Example](http://7nj2iz.com1.z0.glb.clouddn.com/TTGSnackbar_9.png)
```
let snackbar: TTGSnackbar = TTGSnackbar.init(message: "Two actions !", duration: .Long)
// Action 1
snackbar.actionText = "Yes"
snackbar.actionTextColor = UIColor.greenColor()
snackbar.actionBlock = { (snackbar) in NSLog("Click Yes !") }
// Action 2
snackbar.secondActionText = "No"
snackbar.secondActionTextColor = UIColor.yellowColor()
snackbar.secondActionBlock = { (snackbar) in NSLog("Click No !") }
snackbar.show()
```
# Customization
### Message
`message: String` defines the message to diaplay.
### Message text color
`messageTextColor: UIColor` defines the message text color.
### Message text font
`messageTextFont: UIFont` defines the message text font.
### Display duration
`duration: TTGSnackbarDuration`defines the display duration.
`TTGSnackbarDuration` : `Short`, `Middle`, `Long` and `Forever`.
When you set `Forever`, the snackbar will show an activity indicator after user click the action button and you must dismiss the snackbar manually.
### Action title
`actionText: String` defines the action button title.
### Action title color
`actionTextColor: UIColor` defines the action button title color.
### Action title font
`actionTextFont: UIFont` defines the action button title font.
### Action callback
`actionBlock: TTGActionBlock?` will be called when user click the action button.
```
// TTGActionBlock definition.
public typealias TTGActionBlock = (snackbar: TTGSnackbar) -> Void
```
### Second action title, color, font and callback
```
secondActionText: String
secondActionTextColor: UIColor
secondActionTextFont: UIFont
secondActionBlock: TTGActionBlock?
```
### Dismiss callback
`dismissBlock: TTGDismissBlock?` will be called when snackbar dismiss automatically or when user click action button to dismiss the snackbar.
```
// TTGDismissBlock definition.
public typealias TTGDismissBlock = (snackbar: TTGSnackbar) -> Void
```
### Animation type
`animationType: TTGSnackbarAnimationType` defines the style of snackbar when it show and dismiss.
`TTGSnackbarAnimationType` : `FadeInFadeOut`, `SlideFromBottomToTop`, `SlideFromBottomBackToBottom`, `SlideFromLeftToRight`, `SlideFromRightToLeft` and `Flip`.
The default value of `animationType` is `SlideFromBottomBackToBottom`, which is the same as Snackbar in Android.
### Animation duration
`animationDuration: NSTimeInterval` defines the duration of show and hide animation.
### Margins
`leftMargin: CGFloat`, `rightMargin: CGFloat` and `bottomMargin: CGFloat` define the margins of snackbar.
### Snackbar height
`height: CGFloat` defines the height of snackbar.
### Corner radius
`cornerRadius: CGFloat` defines the corner radius of snackbar.
# Contact me
zekunyan@163.com

View File

@@ -1,16 +0,0 @@
//
// TTGSnackbar.h
// TTGSnackbar
//
// Created by zekunyan on 15/10/4.
// Copyright © 2015年 tutuge. All rights reserved.
//
@import UIKit;
@import Darwin;
FOUNDATION_EXPORT double TTGSnackbarVersionNumber;
FOUNDATION_EXPORT const unsigned char TTGSnackbarVersionString[];

View File

@@ -1,640 +0,0 @@
//
// TTGSnackbar.swift
// TTGSnackbar
//
// Created by zekunyan on 15/10/4.
// Copyright © 2015 tutuge. All rights reserved.
//
import UIKit
import Darwin
// MARK: -
// MARK: Enum
/**
Snackbar display duration types.
- Short: 1 second
- Middle: 3 seconds
- Long: 5 seconds
- Forever: Not dismiss automatically. Must be dismissed manually.
*/
@objc public enum TTGSnackbarDuration: Int {
case Short = 1
case Middle = 3
case Long = 5
case Forever = 2147483647 // Must dismiss manually.
}
/**
Snackbar animation types.
- FadeInFadeOut: Fade in to show and fade out to dismiss.
- SlideFromBottomToTop: Slide from the bottom of screen to show and slide up to dismiss.
- SlideFromBottomBackToBottom: Slide from the bottom of screen to show and slide back to bottom to dismiss.
- SlideFromLeftToRight: Slide from the left to show and slide to rigth to dismiss.
- SlideFromRightToLeft: Slide from the right to show and slide to left to dismiss.
- Flip: Flip to show and dismiss.
*/
@objc public enum TTGSnackbarAnimationType: Int {
case FadeInFadeOut
case SlideFromBottomToTop
case SlideFromBottomBackToBottom
case SlideFromLeftToRight
case SlideFromRightToLeft
case Flip
}
public class TTGSnackbar: UIView {
// MARK: -
// MARK: Class property.
/// Snackbar default frame
private static let snackbarDefaultFrame: CGRect = CGRectMake(0, 0, 320, 44)
/// Snackbar action button max width.
private static let snackbarActionButtonMaxWidth: CGFloat = 64
/// Snackbar action button min width.
private static let snackbarActionButtonMinWidth: CGFloat = 44
// MARK: -
// MARK: Typealias
/// Action callback closure definition.
public typealias TTGActionBlock = (snackbar:TTGSnackbar) -> Void
/// Dismiss callback closure definition.
public typealias TTGDismissBlock = (snackbar:TTGSnackbar) -> Void
// MARK: -
// MARK: Public property.
/// Action callback.
public dynamic var actionBlock: TTGActionBlock? = nil
/// Second action block
public dynamic var secondActionBlock: TTGActionBlock? = nil;
/// Dismiss callback.
public dynamic var dismissBlock: TTGDismissBlock? = nil
/// Snackbar display duration. Default is Short - 1 second.
public dynamic var duration: TTGSnackbarDuration = TTGSnackbarDuration.Short
/// Snackbar animation type. Default is SlideFromBottomBackToBottom.
public dynamic var animationType: TTGSnackbarAnimationType = TTGSnackbarAnimationType.SlideFromBottomBackToBottom
/// Show and hide animation duration. Default is 0.3
public dynamic var animationDuration: NSTimeInterval = 0.3
/// Corner radius: [0, height / 2]. Default is 4
public dynamic var cornerRadius: CGFloat = 4 {
didSet {
if cornerRadius > height / 2 {
cornerRadius = height / 2
}
if cornerRadius < 0 {
cornerRadius = 0
}
self.layer.cornerRadius = cornerRadius
self.layer.masksToBounds = true
}
}
/// Left margin. Default is 4
public dynamic var leftMargin: CGFloat = 4 {
didSet {
leftMarginConstraint?.constant = leftMargin
self.layoutIfNeeded()
}
}
/// Right margin. Default is 4
public dynamic var rightMargin: CGFloat = 4 {
didSet {
rightMarginConstraint?.constant = -rightMargin
self.layoutIfNeeded()
}
}
/// Bottom margin. Default is 4
public dynamic var bottomMargin: CGFloat = 4 {
didSet {
bottomMarginConstraint?.constant = -bottomMargin
self.layoutIfNeeded()
}
}
/// Height: [44, +]. Default is 44
public dynamic var height: CGFloat = 44 {
didSet {
if height < 44 {
height = 44
}
heightConstraint?.constant = height
self.layoutIfNeeded()
}
}
/// Main text shown on the snackbar.
public dynamic var message: String = "" {
didSet {
self.messageLabel.text = message
}
}
/// Message text color. Default is white.
public dynamic var messageTextColor: UIColor = UIColor.whiteColor() {
didSet {
self.messageLabel.textColor = messageTextColor
}
}
/// Message text font. Default is Bold system font (14).
public dynamic var messageTextFont: UIFont = UIFont.boldSystemFontOfSize(14) {
didSet {
self.messageLabel.font = messageTextFont
}
}
/// Message text alignment. Default is left
public dynamic var messageTextAlign: NSTextAlignment = .Left {
didSet {
self.messageLabel.textAlignment = messageTextAlign
}
}
/// Action button title.
public dynamic var actionText: String = "" {
didSet {
self.actionButton.setTitle(actionText, forState: UIControlState.Normal)
}
}
/// Second action button title.
public dynamic var secondActionText: String = "" {
didSet {
self.secondActionButton.setTitle(secondActionText, forState: UIControlState.Normal)
}
}
/// Action button title color. Default is white.
public dynamic var actionTextColor: UIColor = UIColor.whiteColor() {
didSet {
actionButton.setTitleColor(actionTextColor, forState: UIControlState.Normal)
}
}
/// Second action button title color. Default is white.
public dynamic var secondActionTextColor: UIColor = UIColor.whiteColor() {
didSet {
secondActionButton.setTitleColor(secondActionTextColor, forState: UIControlState.Normal)
}
}
/// Action text font. Default is Bold system font (14).
public dynamic var actionTextFont: UIFont = UIFont.boldSystemFontOfSize(14) {
didSet {
self.actionButton.titleLabel?.font = actionTextFont
}
}
/// Second action text font. Default is Bold system font (14).
public dynamic var secondActionTextFont: UIFont = UIFont.boldSystemFontOfSize(14) {
didSet {
self.secondActionButton.titleLabel?.font = secondActionTextFont
}
}
// MARK: -
// MARK: Private property.
private var messageLabel: UILabel!
private var seperateView: UIView!
private var actionButton: UIButton!
private var secondActionButton: UIButton!
private var activityIndicatorView: UIActivityIndicatorView!
/// Timer to dismiss the snackbar.
private var dismissTimer: NSTimer? = nil
// Constraints.
private var heightConstraint: NSLayoutConstraint? = nil
private var leftMarginConstraint: NSLayoutConstraint? = nil
private var rightMarginConstraint: NSLayoutConstraint? = nil
private var bottomMarginConstraint: NSLayoutConstraint? = nil
private var actionButtonWidthConstraint: NSLayoutConstraint? = nil
private var secondActionButtonWidthConstraint: NSLayoutConstraint? = nil
// MARK: -
// MARK: Init
/**
Default init
- returns: TTGSnackbar instance
*/
public init() {
super.init(frame: TTGSnackbar.snackbarDefaultFrame)
configure()
}
/**
Show a single message like a Toast.
- parameter message: Message text.
- parameter duration: Duration type.
- returns: TTGSnackbar instance
*/
public init(message: String, duration: TTGSnackbarDuration) {
super.init(frame: TTGSnackbar.snackbarDefaultFrame)
self.duration = duration
self.message = message
configure()
}
/**
Show a message with action button.
- parameter message: Message text.
- parameter duration: Duration type.
- parameter actionText: Action button title.
- parameter actionBlock: Action callback closure.
- returns: TTGSnackbar instance
*/
public init(message: String, duration: TTGSnackbarDuration, actionText: String, actionBlock: TTGActionBlock) {
super.init(frame: TTGSnackbar.snackbarDefaultFrame)
self.duration = duration
self.message = message
self.actionText = actionText
self.actionBlock = actionBlock
configure()
}
/**
Show a custom message with action button.
- parameter message: Message text.
- parameter duration: Duration type.
- parameter actionText: Action button title.
- parameter messageFont: Message label font.
- parameter actionButtonFont: Action button font.
- parameter actionBlock: Action callback closure.
- returns: TTGSnackbar instance
*/
public init(message: String, duration: TTGSnackbarDuration, actionText: String, messageFont: UIFont, actionTextFont: UIFont, actionBlock: TTGActionBlock) {
super.init(frame: TTGSnackbar.snackbarDefaultFrame)
self.duration = duration
self.message = message
self.actionText = actionText
self.actionBlock = actionBlock
self.messageTextFont = messageFont
self.actionTextFont = actionTextFont
configure()
}
public required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
public override init(frame: CGRect) {
super.init(frame: TTGSnackbar.snackbarDefaultFrame)
configure()
}
// MARK: -
// MARK: Public methods.
/**
Show the snackbar.
*/
public func show() {
// Only show once
if self.superview != nil {
return
}
// Create dismiss timer
dismissTimer = NSTimer.scheduledTimerWithTimeInterval((NSTimeInterval)(duration.rawValue), target: self, selector: #selector(dismiss), userInfo: nil, repeats: false)
// Show or hide action button
actionButton.hidden = actionText.isEmpty || actionBlock == nil
secondActionButton.hidden = secondActionText.isEmpty || secondActionBlock == nil
seperateView.hidden = actionButton.hidden
actionButtonWidthConstraint?.constant = actionButton.hidden ? 0 : (secondActionButton.hidden ? TTGSnackbar.snackbarActionButtonMaxWidth : TTGSnackbar.snackbarActionButtonMinWidth)
secondActionButtonWidthConstraint?.constant = secondActionButton.hidden ? 0 : (actionButton.hidden ? TTGSnackbar.snackbarActionButtonMaxWidth : TTGSnackbar.snackbarActionButtonMinWidth)
self.layoutIfNeeded()
// Get windows to show
if let superView = UIApplication.sharedApplication().keyWindow {
superView.addSubview(self)
// Snackbar height constraint
heightConstraint = NSLayoutConstraint.init(item: self, attribute: .Height,
relatedBy: .Equal, toItem: nil, attribute: .NotAnAttribute, multiplier: 1, constant: height)
// Left margin constraint
leftMarginConstraint = NSLayoutConstraint.init(item: self, attribute: .Left,
relatedBy: .Equal, toItem: superView, attribute: .Left, multiplier: 1, constant: leftMargin)
// Right margin constraint
rightMarginConstraint = NSLayoutConstraint.init(item: self, attribute: .Right,
relatedBy: .Equal, toItem: superView, attribute: .Right, multiplier: 1, constant: -rightMargin)
// Bottom margin constraint
bottomMarginConstraint = NSLayoutConstraint.init(item: self, attribute: .Bottom,
relatedBy: .Equal, toItem: superview, attribute: .Bottom, multiplier: 1, constant: -bottomMargin)
// Avoid the "UIView-Encapsulated-Layout-Height" constraint conflicts
// http://stackoverflow.com/questions/25059443/what-is-nslayoutconstraint-uiview-encapsulated-layout-height-and-how-should-i
leftMarginConstraint?.priority = 999
rightMarginConstraint?.priority = 999
// Add constraints
self.addConstraint(heightConstraint!)
superView.addConstraint(leftMarginConstraint!)
superView.addConstraint(rightMarginConstraint!)
superView.addConstraint(bottomMarginConstraint!)
// Show
showWithAnimation()
} else {
fatalError("TTGSnackbar needs a keyWindows to display.")
}
}
/**
Dismiss the snackbar manually.
*/
public func dismiss() {
// On main thread
dispatch_async(dispatch_get_main_queue()) {
() -> Void in
self.dismissAnimated(true)
}
}
// MARK: -
// MARK: Private methods.
/**
Init configuration.
*/
private func configure() {
// Clear subViews
for subView in self.subviews {
subView.removeFromSuperview()
}
self.translatesAutoresizingMaskIntoConstraints = false
self.backgroundColor = UIColor.init(white: 0, alpha: 0.8)
self.layer.cornerRadius = cornerRadius
self.layer.masksToBounds = true
messageLabel = UILabel()
messageLabel.translatesAutoresizingMaskIntoConstraints = false
messageLabel.textColor = UIColor.whiteColor()
messageLabel.font = messageTextFont
messageLabel.backgroundColor = UIColor.clearColor()
messageLabel.lineBreakMode = .ByCharWrapping
messageLabel.numberOfLines = 2
messageLabel.textAlignment = .Left
messageLabel.text = message
self.addSubview(messageLabel)
actionButton = UIButton()
actionButton.translatesAutoresizingMaskIntoConstraints = false
actionButton.backgroundColor = UIColor.clearColor()
actionButton.titleLabel?.font = actionTextFont
actionButton.titleLabel?.adjustsFontSizeToFitWidth = true
actionButton.setTitle(actionText, forState: .Normal)
actionButton.setTitleColor(actionTextColor, forState: .Normal)
actionButton.addTarget(self, action: #selector(doAction(_:)), forControlEvents: .TouchUpInside)
self.addSubview(actionButton)
secondActionButton = UIButton()
secondActionButton.translatesAutoresizingMaskIntoConstraints = false
secondActionButton.backgroundColor = UIColor.clearColor()
secondActionButton.titleLabel?.font = secondActionTextFont
secondActionButton.titleLabel?.adjustsFontSizeToFitWidth = true
secondActionButton.setTitle(secondActionText, forState: .Normal)
secondActionButton.setTitleColor(secondActionTextColor, forState: .Normal)
secondActionButton.addTarget(self, action: #selector(doAction(_:)), forControlEvents: .TouchUpInside)
self.addSubview(secondActionButton)
seperateView = UIView()
seperateView.translatesAutoresizingMaskIntoConstraints = false
seperateView.backgroundColor = UIColor.grayColor()
self.addSubview(seperateView)
activityIndicatorView = UIActivityIndicatorView(activityIndicatorStyle: .White)
activityIndicatorView.translatesAutoresizingMaskIntoConstraints = false
activityIndicatorView.stopAnimating()
self.addSubview(activityIndicatorView)
// Add constraints
let hConstraints: [NSLayoutConstraint] = NSLayoutConstraint.constraintsWithVisualFormat(
"H:|-4-[messageLabel]-2-[seperateView(0.5)]-2-[actionButton]-0-[secondActionButton]-4-|",
options: NSLayoutFormatOptions(rawValue: 0),
metrics: nil,
views: ["messageLabel": messageLabel, "seperateView": seperateView, "actionButton": actionButton, "secondActionButton": secondActionButton])
let vConstraintsForMessageLabel: [NSLayoutConstraint] = NSLayoutConstraint.constraintsWithVisualFormat(
"V:|-0-[messageLabel]-0-|",
options: NSLayoutFormatOptions(rawValue: 0),
metrics: nil,
views: ["messageLabel": messageLabel])
let vConstraintsForSeperateView: [NSLayoutConstraint] = NSLayoutConstraint.constraintsWithVisualFormat(
"V:|-4-[seperateView]-4-|",
options: NSLayoutFormatOptions(rawValue: 0),
metrics: nil,
views: ["seperateView": seperateView])
let vConstraintsForActionButton: [NSLayoutConstraint] = NSLayoutConstraint.constraintsWithVisualFormat(
"V:|-0-[actionButton]-0-|",
options: NSLayoutFormatOptions(rawValue: 0),
metrics: nil,
views: ["actionButton": actionButton])
let vConstraintsForSecondActionButton: [NSLayoutConstraint] = NSLayoutConstraint.constraintsWithVisualFormat(
"V:|-0-[secondActionButton]-0-|",
options: NSLayoutFormatOptions(rawValue: 0),
metrics: nil,
views: ["secondActionButton": secondActionButton])
actionButtonWidthConstraint = NSLayoutConstraint.init(
item: actionButton, attribute: .Width, relatedBy: .Equal,
toItem: nil, attribute: .NotAnAttribute, multiplier: 1, constant: TTGSnackbar.snackbarActionButtonMinWidth)
secondActionButtonWidthConstraint = NSLayoutConstraint.init(
item: secondActionButton, attribute: .Width, relatedBy: .Equal,
toItem: nil, attribute: .NotAnAttribute, multiplier: 1, constant: TTGSnackbar.snackbarActionButtonMinWidth)
let vConstraintsForActivityIndicatorView: [NSLayoutConstraint] = NSLayoutConstraint.constraintsWithVisualFormat(
"V:|-2-[activityIndicatorView]-2-|",
options: NSLayoutFormatOptions(rawValue: 0),
metrics: nil,
views: ["activityIndicatorView": activityIndicatorView])
let hConstraintsForActivityIndicatorView: [NSLayoutConstraint] = NSLayoutConstraint.constraintsWithVisualFormat(
"H:[activityIndicatorView(activityIndicatorWidth)]-2-|",
options: NSLayoutFormatOptions(rawValue: 0),
metrics: ["activityIndicatorWidth": height - 4],
views: ["activityIndicatorView": activityIndicatorView])
actionButton.addConstraint(actionButtonWidthConstraint!)
secondActionButton.addConstraint(secondActionButtonWidthConstraint!)
self.addConstraints(hConstraints)
self.addConstraints(vConstraintsForMessageLabel)
self.addConstraints(vConstraintsForSeperateView)
self.addConstraints(vConstraintsForActionButton)
self.addConstraints(vConstraintsForSecondActionButton)
self.addConstraints(vConstraintsForActivityIndicatorView)
self.addConstraints(hConstraintsForActivityIndicatorView)
}
/**
Invalid the dismiss timer.
*/
private func invalidDismissTimer() {
dismissTimer?.invalidate()
dismissTimer = nil
}
/**
Dismiss.
- parameter animated: If dismiss with animation.
*/
private func dismissAnimated(animated: Bool) {
invalidDismissTimer()
activityIndicatorView.stopAnimating()
let superViewWidth = CGRectGetWidth((superview?.frame)!)
if !animated {
dismissBlock?(snackbar: self)
self.removeFromSuperview()
return
}
var animationBlock: (() -> Void)? = nil
switch animationType {
case .FadeInFadeOut:
animationBlock = {
self.alpha = 0.0
}
case .SlideFromBottomBackToBottom:
bottomMarginConstraint?.constant = height
case .SlideFromBottomToTop:
animationBlock = {
self.alpha = 0.0
}
bottomMarginConstraint?.constant = -height - bottomMargin
case .SlideFromLeftToRight:
leftMarginConstraint?.constant = leftMargin + superViewWidth
rightMarginConstraint?.constant = -rightMargin + superViewWidth
case .SlideFromRightToLeft:
leftMarginConstraint?.constant = leftMargin - superViewWidth
rightMarginConstraint?.constant = -rightMargin - superViewWidth
case .Flip:
animationBlock = {
self.layer.transform = CATransform3DMakeRotation(CGFloat(M_PI_2), 1, 0, 0)
}
}
self.setNeedsLayout()
UIView.animateWithDuration(animationDuration, delay: 0, usingSpringWithDamping: 1, initialSpringVelocity: 0.2, options: .CurveEaseIn,
animations: {
() -> Void in
animationBlock?()
self.layoutIfNeeded()
}) {
(finished) -> Void in
self.dismissBlock?(snackbar: self)
self.removeFromSuperview()
}
}
/**
Show.
*/
private func showWithAnimation() {
var animationBlock: (() -> Void)? = nil
let superViewWidth = CGRectGetWidth((superview?.frame)!)
switch animationType {
case .FadeInFadeOut:
self.alpha = 0.0
self.layoutIfNeeded()
// Animation
animationBlock = {
self.alpha = 1.0
}
case .SlideFromBottomBackToBottom, .SlideFromBottomToTop:
bottomMarginConstraint?.constant = height
self.layoutIfNeeded()
case .SlideFromLeftToRight:
leftMarginConstraint?.constant = leftMargin - superViewWidth
rightMarginConstraint?.constant = -rightMargin - superViewWidth
bottomMarginConstraint?.constant = -bottomMargin
self.layoutIfNeeded()
case .SlideFromRightToLeft:
leftMarginConstraint?.constant = leftMargin + superViewWidth
rightMarginConstraint?.constant = -rightMargin + superViewWidth
bottomMarginConstraint?.constant = -bottomMargin
self.layoutIfNeeded()
case .Flip:
self.layer.transform = CATransform3DMakeRotation(CGFloat(M_PI_2), 1, 0, 0)
self.layoutIfNeeded()
// Animation
animationBlock = {
self.layer.transform = CATransform3DMakeRotation(0, 1, 0, 0)
}
}
// Final state
bottomMarginConstraint?.constant = -bottomMargin
leftMarginConstraint?.constant = leftMargin
rightMarginConstraint?.constant = -rightMargin
UIView.animateWithDuration(animationDuration, delay: 0, usingSpringWithDamping: 0.7, initialSpringVelocity: 5, options: .CurveEaseInOut,
animations: {
() -> Void in
animationBlock?()
self.layoutIfNeeded()
}, completion: nil)
}
/**
Action button.
*/
func doAction(button: UIButton) {
// Call action block first
button == actionButton ? actionBlock?(snackbar: self) : secondActionBlock?(snackbar: self)
// Show activity indicator
if duration == .Forever && actionButton.hidden == false {
actionButton.hidden = true
secondActionButton.hidden = true
seperateView.hidden = true
activityIndicatorView.hidden = false
activityIndicatorView.startAnimating()
} else {
dismissAnimated(true)
}
}
}

View File

@@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>org.cocoapods.${PRODUCT_NAME:rfc1034identifier}</string>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>

View File

@@ -26,4 +26,4 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Generated by CocoaPods - http://cocoapods.org
Generated by CocoaPods - https://cocoapods.org

View File

@@ -44,7 +44,7 @@ SOFTWARE.
</dict>
<dict>
<key>FooterText</key>
<string>Generated by CocoaPods - http://cocoapods.org</string>
<string>Generated by CocoaPods - https://cocoapods.org</string>
<key>Title</key>
<string></string>
<key>Type</key>

View File

@@ -0,0 +1,5 @@
#import <Foundation/Foundation.h>
@interface PodsDummy_Pods_TTGSnackbarObjcTest : NSObject
@end
@implementation PodsDummy_Pods_TTGSnackbarObjcTest
@end

View File

@@ -16,7 +16,7 @@ install_framework()
local source="$1"
fi
local destination="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
if [ -L "${source}" ]; then
echo "Symlinked..."
@@ -59,8 +59,8 @@ code_sign_if_enabled() {
if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
# Use the current code_sign_identitiy
echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements \"$1\""
/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1"
echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\""
/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1"
fi
}
@@ -84,8 +84,8 @@ strip_invalid_archs() {
if [[ "$CONFIGURATION" == "Debug" ]]; then
install_framework "Pods/TTGSnackbar.framework"
install_framework "$BUILT_PRODUCTS_DIR/TTGSnackbar/TTGSnackbar.framework"
fi
if [[ "$CONFIGURATION" == "Release" ]]; then
install_framework "Pods/TTGSnackbar.framework"
install_framework "$BUILT_PRODUCTS_DIR/TTGSnackbar/TTGSnackbar.framework"
fi

View File

@@ -0,0 +1,102 @@
#!/bin/sh
set -e
mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
> "$RESOURCES_TO_COPY"
XCASSET_FILES=()
case "${TARGETED_DEVICE_FAMILY}" in
1,2)
TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
;;
1)
TARGET_DEVICE_ARGS="--target-device iphone"
;;
2)
TARGET_DEVICE_ARGS="--target-device ipad"
;;
*)
TARGET_DEVICE_ARGS="--target-device mac"
;;
esac
realpath() {
DIRECTORY="$(cd "${1%/*}" && pwd)"
FILENAME="${1##*/}"
echo "$DIRECTORY/$FILENAME"
}
install_resource()
{
if [[ "$1" = /* ]] ; then
RESOURCE_PATH="$1"
else
RESOURCE_PATH="${PODS_ROOT}/$1"
fi
if [[ ! -e "$RESOURCE_PATH" ]] ; then
cat << EOM
error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script.
EOM
exit 1
fi
case $RESOURCE_PATH in
*.storyboard)
echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}"
ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
;;
*.xib)
echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}"
ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
;;
*.framework)
echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
;;
*.xcdatamodel)
echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\""
xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom"
;;
*.xcdatamodeld)
echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\""
xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd"
;;
*.xcmappingmodel)
echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\""
xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm"
;;
*.xcassets)
ABSOLUTE_XCASSET_FILE=$(realpath "$RESOURCE_PATH")
XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
;;
*)
echo "$RESOURCE_PATH"
echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY"
;;
esac
}
mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
fi
rm -f "$RESOURCES_TO_COPY"
if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ]
then
# Find all other xcassets (this unfortunately includes those of path pods and other targets).
OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
while read line; do
if [[ $line != "`realpath $PODS_ROOT`*" ]]; then
XCASSET_FILES+=("$line")
fi
done <<<"$OTHER_XCASSETS"
printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
fi

View File

@@ -0,0 +1,6 @@
#import <UIKit/UIKit.h>
FOUNDATION_EXPORT double Pods_TTGSnackbarObjcTestVersionNumber;
FOUNDATION_EXPORT const unsigned char Pods_TTGSnackbarObjcTestVersionString[];

View File

@@ -0,0 +1,10 @@
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES
FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/TTGSnackbar"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/TTGSnackbar/TTGSnackbar.framework/Headers"
OTHER_LDFLAGS = $(inherited) -framework "TTGSnackbar"
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
PODS_BUILD_DIR = $BUILD_DIR
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_ROOT = ${SRCROOT}/Pods

View File

@@ -0,0 +1,6 @@
framework module Pods_TTGSnackbarObjcTest {
umbrella header "Pods-TTGSnackbarObjcTest-umbrella.h"
export *
module * { export * }
}

View File

@@ -0,0 +1,10 @@
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES
FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/TTGSnackbar"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/TTGSnackbar/TTGSnackbar.framework/Headers"
OTHER_LDFLAGS = $(inherited) -framework "TTGSnackbar"
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
PODS_BUILD_DIR = $BUILD_DIR
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_ROOT = ${SRCROOT}/Pods

View File

@@ -1,5 +0,0 @@
#import <Foundation/Foundation.h>
@interface PodsDummy_Pods : NSObject
@end
@implementation PodsDummy_Pods
@end

View File

@@ -1,95 +0,0 @@
#!/bin/sh
set -e
mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
> "$RESOURCES_TO_COPY"
XCASSET_FILES=()
realpath() {
DIRECTORY="$(cd "${1%/*}" && pwd)"
FILENAME="${1##*/}"
echo "$DIRECTORY/$FILENAME"
}
install_resource()
{
case $1 in
*.storyboard)
echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}"
ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}"
;;
*.xib)
echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}"
ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}"
;;
*.framework)
echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
;;
*.xcdatamodel)
echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\""
xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom"
;;
*.xcdatamodeld)
echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\""
xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd"
;;
*.xcmappingmodel)
echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\""
xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm"
;;
*.xcassets)
ABSOLUTE_XCASSET_FILE=$(realpath "${PODS_ROOT}/$1")
XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
;;
/*)
echo "$1"
echo "$1" >> "$RESOURCES_TO_COPY"
;;
*)
echo "${PODS_ROOT}/$1"
echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY"
;;
esac
}
mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
fi
rm -f "$RESOURCES_TO_COPY"
if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ]
then
case "${TARGETED_DEVICE_FAMILY}" in
1,2)
TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
;;
1)
TARGET_DEVICE_ARGS="--target-device iphone"
;;
2)
TARGET_DEVICE_ARGS="--target-device ipad"
;;
*)
TARGET_DEVICE_ARGS="--target-device mac"
;;
esac
# Find all other xcassets (this unfortunately includes those of path pods and other targets).
OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
while read line; do
if [[ $line != "`realpath $PODS_ROOT`*" ]]; then
XCASSET_FILES+=("$line")
fi
done <<<"$OTHER_XCASSETS"
printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
fi

View File

@@ -1,6 +0,0 @@
#import <UIKit/UIKit.h>
FOUNDATION_EXPORT double PodsVersionNumber;
FOUNDATION_EXPORT const unsigned char PodsVersionString[];

View File

@@ -1,8 +0,0 @@
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/TTGSnackbar.framework/Headers"
OTHER_LDFLAGS = $(inherited) -framework "TTGSnackbar"
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods
PODS_ROOT = ${SRCROOT}/Pods

View File

@@ -1,6 +0,0 @@
framework module Pods {
umbrella header "Pods-umbrella.h"
export *
module * { export * }
}

View File

@@ -1,8 +0,0 @@
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/TTGSnackbar.framework/Headers"
OTHER_LDFLAGS = $(inherited) -framework "TTGSnackbar"
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods
PODS_ROOT = ${SRCROOT}/Pods

View File

@@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>org.cocoapods.${PRODUCT_NAME:rfc1034identifier}</string>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.5.3</string>
<string>1.0.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>

View File

@@ -1,5 +1,9 @@
CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/TTGSnackbar
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/TTGSnackbar" "${PODS_ROOT}/Headers/Public"
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public"
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
PODS_BUILD_DIR = $BUILD_DIR
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_ROOT = ${SRCROOT}
SKIP_INSTALL = YES
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
SKIP_INSTALL = YES

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "emoji_cool_small@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@@ -20,6 +20,7 @@
TTGSnackbar* snackbar = [[TTGSnackbar alloc] initWithMessage:@"TTGSnackbar by tutuge" duration:TTGSnackbarDurationLong actionText:@"Done" actionBlock:^(TTGSnackbar* snackbar) {
NSLog(@"Press done.");
}];
snackbar.icon = [UIImage imageNamed:@"emoji_cool_small"];
[snackbar show];
}

View File

@@ -1,5 +1,5 @@
PODS:
- TTGSnackbar (0.5.3)
- TTGSnackbar (1.0.0)
DEPENDENCIES:
- TTGSnackbar (from `../`)
@@ -9,6 +9,8 @@ EXTERNAL SOURCES:
:path: "../"
SPEC CHECKSUMS:
TTGSnackbar: 21330c2063619066777e562ded9772d321add245
TTGSnackbar: cb5cbecd868251268edef78b058c7ef089a3670a
COCOAPODS: 0.39.0
PODFILE CHECKSUM: 7e3c12373bb986fb1b81035ff26ff6a748d33b25
COCOAPODS: 1.0.1

View File

@@ -1 +0,0 @@
../../../../../TTGSnackbar/TTGSnackbar.h

View File

@@ -1,7 +1,7 @@
{
"name": "TTGSnackbar",
"module_name": "TTGSnackbar",
"version": "0.5.3",
"version": "1.0.0",
"summary": "A Swift based implementation of the Android Snackbar for iOS. Show simple message and action button like a Toast.",
"description": "TTGSnackbar is useful for showing a brief message at the bottom of the screen with an action button.\nIt appears above all other elements on screen and only one can be displayed at a time.\nIt disappears after a timeout or after user click the action button.",
"homepage": "https://github.com/zekunyan/TTGSnackbar",
@@ -18,7 +18,7 @@
},
"source": {
"git": "https://github.com/zekunyan/TTGSnackbar.git",
"tag": "0.5.3"
"tag": "1.0.0"
},
"source_files": "TTGSnackbar/**/*.{h,swift}",
"requires_arc": true

View File

@@ -1,5 +1,5 @@
PODS:
- TTGSnackbar (0.5.3)
- TTGSnackbar (1.0.0)
DEPENDENCIES:
- TTGSnackbar (from `../`)
@@ -9,6 +9,8 @@ EXTERNAL SOURCES:
:path: "../"
SPEC CHECKSUMS:
TTGSnackbar: 21330c2063619066777e562ded9772d321add245
TTGSnackbar: cb5cbecd868251268edef78b058c7ef089a3670a
COCOAPODS: 0.39.0
PODFILE CHECKSUM: 7e3c12373bb986fb1b81035ff26ff6a748d33b25
COCOAPODS: 1.0.1

File diff suppressed because it is too large Load Diff

View File

@@ -1,60 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0700"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForAnalyzing = "YES"
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A87CA625D26442877FEF36E7A8BEEC48"
BlueprintName = "TTGSnackbar"
ReferencedContainer = "container:Pods.xcodeproj"
BuildableName = "TTGSnackbar.framework">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
buildConfiguration = "Debug"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES"
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>org.cocoapods.${PRODUCT_NAME:rfc1034identifier}</string>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>

View File

@@ -26,4 +26,4 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Generated by CocoaPods - http://cocoapods.org
Generated by CocoaPods - https://cocoapods.org

View File

@@ -44,7 +44,7 @@ SOFTWARE.
</dict>
<dict>
<key>FooterText</key>
<string>Generated by CocoaPods - http://cocoapods.org</string>
<string>Generated by CocoaPods - https://cocoapods.org</string>
<key>Title</key>
<string></string>
<key>Type</key>

View File

@@ -16,7 +16,7 @@ install_framework()
local source="$1"
fi
local destination="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
if [ -L "${source}" ]; then
echo "Symlinked..."
@@ -59,8 +59,8 @@ code_sign_if_enabled() {
if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
# Use the current code_sign_identitiy
echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements \"$1\""
/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1"
echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\""
/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1"
fi
}
@@ -84,8 +84,8 @@ strip_invalid_archs() {
if [[ "$CONFIGURATION" == "Debug" ]]; then
install_framework "Pods-TTGSnackbarExample/TTGSnackbar.framework"
install_framework "$BUILT_PRODUCTS_DIR/TTGSnackbar/TTGSnackbar.framework"
fi
if [[ "$CONFIGURATION" == "Release" ]]; then
install_framework "Pods-TTGSnackbarExample/TTGSnackbar.framework"
install_framework "$BUILT_PRODUCTS_DIR/TTGSnackbar/TTGSnackbar.framework"
fi

View File

@@ -1,13 +1,28 @@
#!/bin/sh
set -e
mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
> "$RESOURCES_TO_COPY"
XCASSET_FILES=()
case "${TARGETED_DEVICE_FAMILY}" in
1,2)
TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
;;
1)
TARGET_DEVICE_ARGS="--target-device iphone"
;;
2)
TARGET_DEVICE_ARGS="--target-device ipad"
;;
*)
TARGET_DEVICE_ARGS="--target-device mac"
;;
esac
realpath() {
DIRECTORY="$(cd "${1%/*}" && pwd)"
FILENAME="${1##*/}"
@@ -16,50 +31,57 @@ realpath() {
install_resource()
{
case $1 in
if [[ "$1" = /* ]] ; then
RESOURCE_PATH="$1"
else
RESOURCE_PATH="${PODS_ROOT}/$1"
fi
if [[ ! -e "$RESOURCE_PATH" ]] ; then
cat << EOM
error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script.
EOM
exit 1
fi
case $RESOURCE_PATH in
*.storyboard)
echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}"
ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}"
echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}"
ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
;;
*.xib)
echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}"
ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}"
echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}"
ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
;;
*.framework)
echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
;;
*.xcdatamodel)
echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\""
xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom"
echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\""
xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom"
;;
*.xcdatamodeld)
echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\""
xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd"
echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\""
xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd"
;;
*.xcmappingmodel)
echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\""
xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm"
echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\""
xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm"
;;
*.xcassets)
ABSOLUTE_XCASSET_FILE=$(realpath "${PODS_ROOT}/$1")
ABSOLUTE_XCASSET_FILE=$(realpath "$RESOURCE_PATH")
XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
;;
/*)
echo "$1"
echo "$1" >> "$RESOURCES_TO_COPY"
;;
*)
echo "${PODS_ROOT}/$1"
echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY"
echo "$RESOURCE_PATH"
echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY"
;;
esac
}
mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
@@ -68,21 +90,6 @@ rm -f "$RESOURCES_TO_COPY"
if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ]
then
case "${TARGETED_DEVICE_FAMILY}" in
1,2)
TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
;;
1)
TARGET_DEVICE_ARGS="--target-device iphone"
;;
2)
TARGET_DEVICE_ARGS="--target-device ipad"
;;
*)
TARGET_DEVICE_ARGS="--target-device mac"
;;
esac
# Find all other xcassets (this unfortunately includes those of path pods and other targets).
OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
while read line; do
@@ -91,5 +98,5 @@ then
fi
done <<<"$OTHER_XCASSETS"
printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
fi

View File

@@ -1,8 +1,10 @@
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES
FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/TTGSnackbar"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/TTGSnackbar.framework/Headers"
OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/TTGSnackbar/TTGSnackbar.framework/Headers"
OTHER_LDFLAGS = $(inherited) -framework "TTGSnackbar"
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-TTGSnackbarExample
PODS_ROOT = ${SRCROOT}/Pods
PODS_BUILD_DIR = $BUILD_DIR
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_ROOT = ${SRCROOT}/Pods

View File

@@ -1,8 +1,10 @@
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES
FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/TTGSnackbar"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/TTGSnackbar.framework/Headers"
OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/TTGSnackbar/TTGSnackbar.framework/Headers"
OTHER_LDFLAGS = $(inherited) -framework "TTGSnackbar"
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-TTGSnackbarExample
PODS_ROOT = ${SRCROOT}/Pods
PODS_BUILD_DIR = $BUILD_DIR
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_ROOT = ${SRCROOT}/Pods

View File

@@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>org.cocoapods.${PRODUCT_NAME:rfc1034identifier}</string>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.5.3</string>
<string>1.0.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>

View File

@@ -1,5 +1,9 @@
CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/TTGSnackbar
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/TTGSnackbar" "${PODS_ROOT}/Headers/Public"
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public"
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
PODS_BUILD_DIR = $BUILD_DIR
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_ROOT = ${SRCROOT}
SKIP_INSTALL = YES
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
SKIP_INSTALL = YES

View File

@@ -7,7 +7,7 @@
objects = {
/* Begin PBXBuildFile section */
364A56CD90820911453E7004 /* Pods_TTGSnackbarExample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A7B81739B556AFE5345E070D /* Pods_TTGSnackbarExample.framework */; };
4EA75401FA1454E0FD3537C7 /* Pods_TTGSnackbarExample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 14C8FFBEFC60A2A841323DD7 /* Pods_TTGSnackbarExample.framework */; };
F4DECB541BC2ADEE00C7E3AB /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4DECB531BC2ADEE00C7E3AB /* AppDelegate.swift */; };
F4DECB561BC2ADEE00C7E3AB /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4DECB551BC2ADEE00C7E3AB /* ViewController.swift */; };
F4DECB591BC2ADEE00C7E3AB /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F4DECB571BC2ADEE00C7E3AB /* Main.storyboard */; };
@@ -16,9 +16,9 @@
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
A7B81739B556AFE5345E070D /* Pods_TTGSnackbarExample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_TTGSnackbarExample.framework; sourceTree = BUILT_PRODUCTS_DIR; };
CD08BC5575E9B1035D59F9AC /* Pods-TTGSnackbarExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TTGSnackbarExample.release.xcconfig"; path = "Pods/Target Support Files/Pods-TTGSnackbarExample/Pods-TTGSnackbarExample.release.xcconfig"; sourceTree = "<group>"; };
E0345AADC991DEE89E90AA64 /* Pods-TTGSnackbarExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TTGSnackbarExample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-TTGSnackbarExample/Pods-TTGSnackbarExample.debug.xcconfig"; sourceTree = "<group>"; };
14C8FFBEFC60A2A841323DD7 /* Pods_TTGSnackbarExample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_TTGSnackbarExample.framework; sourceTree = BUILT_PRODUCTS_DIR; };
213806270AB24C7438425868 /* Pods-TTGSnackbarExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TTGSnackbarExample.release.xcconfig"; path = "Pods/Target Support Files/Pods-TTGSnackbarExample/Pods-TTGSnackbarExample.release.xcconfig"; sourceTree = "<group>"; };
25CDCD9414D82C0C7F512295 /* Pods-TTGSnackbarExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TTGSnackbarExample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-TTGSnackbarExample/Pods-TTGSnackbarExample.debug.xcconfig"; sourceTree = "<group>"; };
F4DECB501BC2ADEE00C7E3AB /* TTGSnackbarExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TTGSnackbarExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
F4DECB531BC2ADEE00C7E3AB /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
F4DECB551BC2ADEE00C7E3AB /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
@@ -33,26 +33,26 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
364A56CD90820911453E7004 /* Pods_TTGSnackbarExample.framework in Frameworks */,
4EA75401FA1454E0FD3537C7 /* Pods_TTGSnackbarExample.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
126BEB6810BB7CD70ABF549F /* Frameworks */ = {
459FDE62E4D9680032698462 /* Frameworks */ = {
isa = PBXGroup;
children = (
A7B81739B556AFE5345E070D /* Pods_TTGSnackbarExample.framework */,
14C8FFBEFC60A2A841323DD7 /* Pods_TTGSnackbarExample.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
53685B5E30C252FF8A5A6677 /* Pods */ = {
59E3A48323B8826B53E6E948 /* Pods */ = {
isa = PBXGroup;
children = (
E0345AADC991DEE89E90AA64 /* Pods-TTGSnackbarExample.debug.xcconfig */,
CD08BC5575E9B1035D59F9AC /* Pods-TTGSnackbarExample.release.xcconfig */,
25CDCD9414D82C0C7F512295 /* Pods-TTGSnackbarExample.debug.xcconfig */,
213806270AB24C7438425868 /* Pods-TTGSnackbarExample.release.xcconfig */,
);
name = Pods;
sourceTree = "<group>";
@@ -62,8 +62,8 @@
children = (
F4DECB521BC2ADEE00C7E3AB /* TTGSnackbarExample */,
F4DECB511BC2ADEE00C7E3AB /* Products */,
53685B5E30C252FF8A5A6677 /* Pods */,
126BEB6810BB7CD70ABF549F /* Frameworks */,
59E3A48323B8826B53E6E948 /* Pods */,
459FDE62E4D9680032698462 /* Frameworks */,
);
sourceTree = "<group>";
};
@@ -95,12 +95,12 @@
isa = PBXNativeTarget;
buildConfigurationList = F4DECB621BC2ADEE00C7E3AB /* Build configuration list for PBXNativeTarget "TTGSnackbarExample" */;
buildPhases = (
92F2DB5A4F74F29062E4B292 /* Check Pods Manifest.lock */,
CE17AA0F06C85A3186601F1D /* [CP] Check Pods Manifest.lock */,
F4DECB4C1BC2ADEE00C7E3AB /* Sources */,
F4DECB4D1BC2ADEE00C7E3AB /* Frameworks */,
F4DECB4E1BC2ADEE00C7E3AB /* Resources */,
F80D8077D8E364A29892F514 /* Embed Pods Frameworks */,
17DBF505C7FC67BBB3ECCCDD /* Copy Pods Resources */,
E41E02AE56B2904D630B4841 /* [CP] Embed Pods Frameworks */,
96D984F2113D6A363ABE2926 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
@@ -157,14 +157,14 @@
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
17DBF505C7FC67BBB3ECCCDD /* Copy Pods Resources */ = {
96D984F2113D6A363ABE2926 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Copy Pods Resources";
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
@@ -172,14 +172,14 @@
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-TTGSnackbarExample/Pods-TTGSnackbarExample-resources.sh\"\n";
showEnvVarsInLog = 0;
};
92F2DB5A4F74F29062E4B292 /* Check Pods Manifest.lock */ = {
CE17AA0F06C85A3186601F1D /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Check Pods Manifest.lock";
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
@@ -187,14 +187,14 @@
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
showEnvVarsInLog = 0;
};
F80D8077D8E364A29892F514 /* Embed Pods Frameworks */ = {
E41E02AE56B2904D630B4841 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Embed Pods Frameworks";
name = "[CP] Embed Pods Frameworks";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
@@ -319,7 +319,7 @@
};
F4DECB631BC2ADEE00C7E3AB /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = E0345AADC991DEE89E90AA64 /* Pods-TTGSnackbarExample.debug.xcconfig */;
baseConfigurationReference = 25CDCD9414D82C0C7F512295 /* Pods-TTGSnackbarExample.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = TTGSnackbarExample/Info.plist;
@@ -332,7 +332,7 @@
};
F4DECB641BC2ADEE00C7E3AB /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = CD08BC5575E9B1035D59F9AC /* Pods-TTGSnackbarExample.release.xcconfig */;
baseConfigurationReference = 213806270AB24C7438425868 /* Pods-TTGSnackbarExample.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = TTGSnackbarExample/Info.plist;

View File

@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = "TTGSnackbar"
s.module_name = "TTGSnackbar"
s.version = "0.5.3"
s.version = "1.0.0"
s.summary = "A Swift based implementation of the Android Snackbar for iOS. Show simple message and action button like a Toast."
s.description = <<-DESC