├── Pod ├── Assets │ └── .gitkeep └── Classes │ ├── .gitkeep │ ├── VerticallyScrollingStatusView.h │ └── VerticallyScrollingStatusView.m ├── Example ├── Tests │ ├── en.lproj │ │ └── InfoPlist.strings │ ├── Tests-Prefix.pch │ ├── Tests-Info.plist │ └── Tests.m ├── Pods │ ├── Headers │ │ ├── Private │ │ │ ├── PureLayout │ │ │ │ ├── PureLayout.h │ │ │ │ ├── ALView+PureLayout.h │ │ │ │ ├── NSArray+PureLayout.h │ │ │ │ ├── PureLayoutDefines.h │ │ │ │ ├── PureLayout+Internal.h │ │ │ │ └── NSLayoutConstraint+PureLayout.h │ │ │ └── VerticallyScrollingStatusView │ │ │ │ └── VerticallyScrollingStatusView.h │ │ └── Public │ │ │ ├── PureLayout │ │ │ ├── PureLayout.h │ │ │ ├── ALView+PureLayout.h │ │ │ ├── NSArray+PureLayout.h │ │ │ ├── PureLayout+Internal.h │ │ │ ├── PureLayoutDefines.h │ │ │ └── NSLayoutConstraint+PureLayout.h │ │ │ └── VerticallyScrollingStatusView │ │ │ └── VerticallyScrollingStatusView.h │ ├── Target Support Files │ │ ├── Pods-VerticallyScrollingStatusView_Tests-PureLayout │ │ │ ├── Pods-VerticallyScrollingStatusView_Tests-PureLayout.xcconfig │ │ │ ├── Pods-VerticallyScrollingStatusView_Tests-PureLayout-prefix.pch │ │ │ ├── Pods-VerticallyScrollingStatusView_Tests-PureLayout.modulemap │ │ │ ├── Pods-VerticallyScrollingStatusView_Tests-PureLayout-dummy.m │ │ │ ├── Pods-VerticallyScrollingStatusView_Tests-PureLayout-umbrella.h │ │ │ ├── Pods-VerticallyScrollingStatusView_Tests-PureLayout-Private.xcconfig │ │ │ └── Info.plist │ │ ├── Pods-VerticallyScrollingStatusView_Example-PureLayout │ │ │ ├── Pods-VerticallyScrollingStatusView_Example-PureLayout.xcconfig │ │ │ ├── Pods-VerticallyScrollingStatusView_Example-PureLayout-prefix.pch │ │ │ ├── Pods-VerticallyScrollingStatusView_Example-PureLayout.modulemap │ │ │ ├── Pods-VerticallyScrollingStatusView_Example-PureLayout-dummy.m │ │ │ ├── Pods-VerticallyScrollingStatusView_Example-PureLayout-umbrella.h │ │ │ ├── Pods-VerticallyScrollingStatusView_Example-PureLayout-Private.xcconfig │ │ │ └── Info.plist │ │ ├── Pods-VerticallyScrollingStatusView_Example-VerticallyScrollingStatusView │ │ │ ├── Pods-VerticallyScrollingStatusView_Example-VerticallyScrollingStatusView.xcconfig │ │ │ ├── Pods-VerticallyScrollingStatusView_Example-VerticallyScrollingStatusView-prefix.pch │ │ │ ├── Pods-VerticallyScrollingStatusView_Example-VerticallyScrollingStatusView.modulemap │ │ │ ├── Pods-VerticallyScrollingStatusView_Example-VerticallyScrollingStatusView-umbrella.h │ │ │ ├── Pods-VerticallyScrollingStatusView_Example-VerticallyScrollingStatusView-dummy.m │ │ │ ├── Pods-VerticallyScrollingStatusView_Example-VerticallyScrollingStatusView-Private.xcconfig │ │ │ └── Info.plist │ │ ├── Pods-VerticallyScrollingStatusView_Tests-VerticallyScrollingStatusView │ │ │ ├── Pods-VerticallyScrollingStatusView_Tests-VerticallyScrollingStatusView.xcconfig │ │ │ ├── Pods-VerticallyScrollingStatusView_Tests-VerticallyScrollingStatusView-prefix.pch │ │ │ ├── Pods-VerticallyScrollingStatusView_Tests-VerticallyScrollingStatusView.modulemap │ │ │ ├── Pods-VerticallyScrollingStatusView_Tests-VerticallyScrollingStatusView-umbrella.h │ │ │ ├── Pods-VerticallyScrollingStatusView_Tests-VerticallyScrollingStatusView-dummy.m │ │ │ ├── Pods-VerticallyScrollingStatusView_Tests-VerticallyScrollingStatusView-Private.xcconfig │ │ │ └── Info.plist │ │ ├── Pods-VerticallyScrollingStatusView_Tests │ │ │ ├── Pods-VerticallyScrollingStatusView_Tests.modulemap │ │ │ ├── Pods-VerticallyScrollingStatusView_Tests-dummy.m │ │ │ ├── Pods-VerticallyScrollingStatusView_Tests-umbrella.h │ │ │ ├── Pods-VerticallyScrollingStatusView_Tests.debug.xcconfig │ │ │ ├── Pods-VerticallyScrollingStatusView_Tests.release.xcconfig │ │ │ ├── Pods-VerticallyScrollingStatusView_Tests-environment.h │ │ │ ├── Info.plist │ │ │ ├── Pods-VerticallyScrollingStatusView_Tests-acknowledgements.markdown │ │ │ ├── Pods-VerticallyScrollingStatusView_Tests-frameworks.sh │ │ │ ├── Pods-VerticallyScrollingStatusView_Tests-acknowledgements.plist │ │ │ └── Pods-VerticallyScrollingStatusView_Tests-resources.sh │ │ └── Pods-VerticallyScrollingStatusView_Example │ │ │ ├── Pods-VerticallyScrollingStatusView_Example.modulemap │ │ │ ├── Pods-VerticallyScrollingStatusView_Example-dummy.m │ │ │ ├── Pods-VerticallyScrollingStatusView_Example-umbrella.h │ │ │ ├── Pods-VerticallyScrollingStatusView_Example.debug.xcconfig │ │ │ ├── Pods-VerticallyScrollingStatusView_Example.release.xcconfig │ │ │ ├── Pods-VerticallyScrollingStatusView_Example-environment.h │ │ │ ├── Info.plist │ │ │ ├── Pods-VerticallyScrollingStatusView_Example-acknowledgements.markdown │ │ │ ├── Pods-VerticallyScrollingStatusView_Example-frameworks.sh │ │ │ ├── Pods-VerticallyScrollingStatusView_Example-acknowledgements.plist │ │ │ └── Pods-VerticallyScrollingStatusView_Example-resources.sh │ ├── Manifest.lock │ ├── PureLayout │ │ ├── LICENSE │ │ ├── PureLayout │ │ │ └── PureLayout │ │ │ │ ├── PureLayout.h │ │ │ │ ├── NSLayoutConstraint+PureLayout.h │ │ │ │ ├── PureLayout+Internal.h │ │ │ │ ├── NSArray+PureLayout.h │ │ │ │ ├── NSLayoutConstraint+PureLayout.m │ │ │ │ ├── PureLayoutDefines.h │ │ │ │ ├── ALView+PureLayout.h │ │ │ │ └── NSArray+PureLayout.m │ │ └── README.md │ ├── Local Podspecs │ │ └── VerticallyScrollingStatusView.podspec.json │ └── Pods.xcodeproj │ │ └── xcshareddata │ │ └── xcschemes │ │ ├── Pods-VerticallyScrollingStatusView_Tests-VerticallyScrollingStatusView.xcscheme │ │ ├── Pods-VerticallyScrollingStatusView_Example-VerticallyScrollingStatusView.xcscheme │ │ ├── Pods-VerticallyScrollingStatusView_Tests-VerticallyScrollingStatusView-VerticallyScrollingStatusView.xcscheme │ │ └── Pods-VerticallyScrollingStatusView_Example-VerticallyScrollingStatusView-VerticallyScrollingStatusView.xcscheme ├── VerticallyScrollingStatusView │ ├── en.lproj │ │ └── InfoPlist.strings │ ├── RJViewController.h │ ├── RJAppDelegate.h │ ├── VerticallyScrollingStatusView-Prefix.pch │ ├── main.m │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── LaunchImage.launchimage │ │ │ └── Contents.json │ ├── Main.storyboard │ ├── VerticallyScrollingStatusView-Info.plist │ ├── RJAppDelegate.m │ └── RJViewController.m ├── VerticallyScrollingStatusView.xcodeproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── VerticallyScrollingStatusView-Example.xcscheme ├── VerticallyScrollingStatusView.xcworkspace │ └── contents.xcworkspacedata ├── Podfile └── Podfile.lock ├── screenshot.gif ├── .travis.yml ├── .gitignore ├── LICENSE ├── VerticallyScrollingStatusView.podspec └── README.md /Pod/Assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Pod/Classes/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Example/Tests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/PureLayout/PureLayout.h: -------------------------------------------------------------------------------- 1 | ../../../PureLayout/PureLayout/PureLayout/PureLayout.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/PureLayout/PureLayout.h: -------------------------------------------------------------------------------- 1 | ../../../PureLayout/PureLayout/PureLayout/PureLayout.h -------------------------------------------------------------------------------- /screenshot.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rahuljiresal/VerticallyScrollingStatusView/HEAD/screenshot.gif -------------------------------------------------------------------------------- /Example/VerticallyScrollingStatusView/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/PureLayout/ALView+PureLayout.h: -------------------------------------------------------------------------------- 1 | ../../../PureLayout/PureLayout/PureLayout/ALView+PureLayout.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/PureLayout/NSArray+PureLayout.h: -------------------------------------------------------------------------------- 1 | ../../../PureLayout/PureLayout/PureLayout/NSArray+PureLayout.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/PureLayout/PureLayoutDefines.h: -------------------------------------------------------------------------------- 1 | ../../../PureLayout/PureLayout/PureLayout/PureLayoutDefines.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/PureLayout/ALView+PureLayout.h: -------------------------------------------------------------------------------- 1 | ../../../PureLayout/PureLayout/PureLayout/ALView+PureLayout.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/PureLayout/NSArray+PureLayout.h: -------------------------------------------------------------------------------- 1 | ../../../PureLayout/PureLayout/PureLayout/NSArray+PureLayout.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/PureLayout/PureLayout+Internal.h: -------------------------------------------------------------------------------- 1 | ../../../PureLayout/PureLayout/PureLayout/PureLayout+Internal.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/PureLayout/PureLayoutDefines.h: -------------------------------------------------------------------------------- 1 | ../../../PureLayout/PureLayout/PureLayout/PureLayoutDefines.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/PureLayout/PureLayout+Internal.h: -------------------------------------------------------------------------------- 1 | ../../../PureLayout/PureLayout/PureLayout/PureLayout+Internal.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/PureLayout/NSLayoutConstraint+PureLayout.h: -------------------------------------------------------------------------------- 1 | ../../../PureLayout/PureLayout/PureLayout/NSLayoutConstraint+PureLayout.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/PureLayout/NSLayoutConstraint+PureLayout.h: -------------------------------------------------------------------------------- 1 | ../../../PureLayout/PureLayout/PureLayout/NSLayoutConstraint+PureLayout.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/VerticallyScrollingStatusView/VerticallyScrollingStatusView.h: -------------------------------------------------------------------------------- 1 | ../../../../../Pod/Classes/VerticallyScrollingStatusView.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/VerticallyScrollingStatusView/VerticallyScrollingStatusView.h: -------------------------------------------------------------------------------- 1 | ../../../../../Pod/Classes/VerticallyScrollingStatusView.h -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-VerticallyScrollingStatusView_Tests-PureLayout/Pods-VerticallyScrollingStatusView_Tests-PureLayout.xcconfig: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-VerticallyScrollingStatusView_Example-PureLayout/Pods-VerticallyScrollingStatusView_Example-PureLayout.xcconfig: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-VerticallyScrollingStatusView_Example-VerticallyScrollingStatusView/Pods-VerticallyScrollingStatusView_Example-VerticallyScrollingStatusView.xcconfig: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-VerticallyScrollingStatusView_Tests-VerticallyScrollingStatusView/Pods-VerticallyScrollingStatusView_Tests-VerticallyScrollingStatusView.xcconfig: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Example/Tests/Tests-Prefix.pch: -------------------------------------------------------------------------------- 1 | // The contents of this file are implicitly included at the beginning of every test case source file. 2 | 3 | #ifdef __OBJC__ 4 | 5 | 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-VerticallyScrollingStatusView_Tests-PureLayout/Pods-VerticallyScrollingStatusView_Tests-PureLayout-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | #import "Pods-VerticallyScrollingStatusView_Tests-environment.h" 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-VerticallyScrollingStatusView_Example-PureLayout/Pods-VerticallyScrollingStatusView_Example-PureLayout-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | #import "Pods-VerticallyScrollingStatusView_Example-environment.h" 6 | -------------------------------------------------------------------------------- /Example/VerticallyScrollingStatusView.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-VerticallyScrollingStatusView_Tests-PureLayout/Pods-VerticallyScrollingStatusView_Tests-PureLayout.modulemap: -------------------------------------------------------------------------------- 1 | framework module PureLayout { 2 | umbrella header "Pods-VerticallyScrollingStatusView_Tests-PureLayout-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-VerticallyScrollingStatusView_Tests-VerticallyScrollingStatusView/Pods-VerticallyScrollingStatusView_Tests-VerticallyScrollingStatusView-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | #import "Pods-VerticallyScrollingStatusView_Tests-environment.h" 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-VerticallyScrollingStatusView_Tests/Pods-VerticallyScrollingStatusView_Tests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_VerticallyScrollingStatusView_Tests { 2 | umbrella header "Pods-VerticallyScrollingStatusView_Tests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-VerticallyScrollingStatusView_Example-PureLayout/Pods-VerticallyScrollingStatusView_Example-PureLayout.modulemap: -------------------------------------------------------------------------------- 1 | framework module PureLayout { 2 | umbrella header "Pods-VerticallyScrollingStatusView_Example-PureLayout-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-VerticallyScrollingStatusView_Example-VerticallyScrollingStatusView/Pods-VerticallyScrollingStatusView_Example-VerticallyScrollingStatusView-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | #import "Pods-VerticallyScrollingStatusView_Example-environment.h" 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-VerticallyScrollingStatusView_Example/Pods-VerticallyScrollingStatusView_Example.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_VerticallyScrollingStatusView_Example { 2 | umbrella header "Pods-VerticallyScrollingStatusView_Example-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-VerticallyScrollingStatusView_Tests/Pods-VerticallyScrollingStatusView_Tests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_VerticallyScrollingStatusView_Tests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_VerticallyScrollingStatusView_Tests 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-VerticallyScrollingStatusView_Example/Pods-VerticallyScrollingStatusView_Example-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_VerticallyScrollingStatusView_Example : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_VerticallyScrollingStatusView_Example 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-VerticallyScrollingStatusView_Tests/Pods-VerticallyScrollingStatusView_Tests-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double Pods_VerticallyScrollingStatusView_TestsVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char Pods_VerticallyScrollingStatusView_TestsVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-VerticallyScrollingStatusView_Example/Pods-VerticallyScrollingStatusView_Example-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double Pods_VerticallyScrollingStatusView_ExampleVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char Pods_VerticallyScrollingStatusView_ExampleVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Example/VerticallyScrollingStatusView/RJViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // RJViewController.h 3 | // VerticallyScrollingStatusView 4 | // 5 | // Created by Rahul Jiresal on 06/04/2015. 6 | // Copyright (c) 2014 Rahul Jiresal. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | 11 | @interface RJViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-VerticallyScrollingStatusView_Tests-PureLayout/Pods-VerticallyScrollingStatusView_Tests-PureLayout-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_VerticallyScrollingStatusView_Tests_PureLayout : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_VerticallyScrollingStatusView_Tests_PureLayout 5 | @end 6 | -------------------------------------------------------------------------------- /Example/VerticallyScrollingStatusView.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-VerticallyScrollingStatusView_Example-PureLayout/Pods-VerticallyScrollingStatusView_Example-PureLayout-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_VerticallyScrollingStatusView_Example_PureLayout : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_VerticallyScrollingStatusView_Example_PureLayout 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-VerticallyScrollingStatusView_Tests-VerticallyScrollingStatusView/Pods-VerticallyScrollingStatusView_Tests-VerticallyScrollingStatusView.modulemap: -------------------------------------------------------------------------------- 1 | framework module VerticallyScrollingStatusView { 2 | umbrella header "Pods-VerticallyScrollingStatusView_Tests-VerticallyScrollingStatusView-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | source 'https://github.com/CocoaPods/Specs.git' 2 | use_frameworks! 3 | 4 | target 'VerticallyScrollingStatusView_Example', :exclusive => true do 5 | pod "VerticallyScrollingStatusView", :path => "../" 6 | end 7 | 8 | target 'VerticallyScrollingStatusView_Tests', :exclusive => true do 9 | pod "VerticallyScrollingStatusView", :path => "../" 10 | 11 | 12 | end 13 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-VerticallyScrollingStatusView_Example-VerticallyScrollingStatusView/Pods-VerticallyScrollingStatusView_Example-VerticallyScrollingStatusView.modulemap: -------------------------------------------------------------------------------- 1 | framework module VerticallyScrollingStatusView { 2 | umbrella header "Pods-VerticallyScrollingStatusView_Example-VerticallyScrollingStatusView-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/VerticallyScrollingStatusView/RJAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // RJAppDelegate.h 3 | // VerticallyScrollingStatusView 4 | // 5 | // Created by CocoaPods on 06/04/2015. 6 | // Copyright (c) 2014 Rahul Jiresal. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | 11 | @interface RJAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-VerticallyScrollingStatusView_Tests-VerticallyScrollingStatusView/Pods-VerticallyScrollingStatusView_Tests-VerticallyScrollingStatusView-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "VerticallyScrollingStatusView.h" 4 | 5 | FOUNDATION_EXPORT double VerticallyScrollingStatusViewVersionNumber; 6 | FOUNDATION_EXPORT const unsigned char VerticallyScrollingStatusViewVersionString[]; 7 | 8 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-VerticallyScrollingStatusView_Example-VerticallyScrollingStatusView/Pods-VerticallyScrollingStatusView_Example-VerticallyScrollingStatusView-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "VerticallyScrollingStatusView.h" 4 | 5 | FOUNDATION_EXPORT double VerticallyScrollingStatusViewVersionNumber; 6 | FOUNDATION_EXPORT const unsigned char VerticallyScrollingStatusViewVersionString[]; 7 | 8 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-VerticallyScrollingStatusView_Tests-VerticallyScrollingStatusView/Pods-VerticallyScrollingStatusView_Tests-VerticallyScrollingStatusView-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_VerticallyScrollingStatusView_Tests_VerticallyScrollingStatusView : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_VerticallyScrollingStatusView_Tests_VerticallyScrollingStatusView 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-VerticallyScrollingStatusView_Example-VerticallyScrollingStatusView/Pods-VerticallyScrollingStatusView_Example-VerticallyScrollingStatusView-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_VerticallyScrollingStatusView_Example_VerticallyScrollingStatusView : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_VerticallyScrollingStatusView_Example_VerticallyScrollingStatusView 5 | @end 6 | -------------------------------------------------------------------------------- /Example/VerticallyScrollingStatusView/VerticallyScrollingStatusView-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | @import UIKit; 15 | @import Foundation; 16 | #endif 17 | -------------------------------------------------------------------------------- /Example/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - PureLayout (2.0.6) 3 | - VerticallyScrollingStatusView (0.1.0): 4 | - PureLayout 5 | 6 | DEPENDENCIES: 7 | - VerticallyScrollingStatusView (from `../`) 8 | 9 | EXTERNAL SOURCES: 10 | VerticallyScrollingStatusView: 11 | :path: "../" 12 | 13 | SPEC CHECKSUMS: 14 | PureLayout: f25f0bb904d5ccfe6e31da3cb869185259f02e0d 15 | VerticallyScrollingStatusView: f0d06551611e9424833298ba0201f6826448f451 16 | 17 | COCOAPODS: 0.37.2 18 | -------------------------------------------------------------------------------- /Example/VerticallyScrollingStatusView/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // VerticallyScrollingStatusView 4 | // 5 | // Created by Rahul Jiresal on 06/04/2015. 6 | // Copyright (c) 2014 Rahul Jiresal. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | #import "RJAppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) 13 | { 14 | @autoreleasepool { 15 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([RJAppDelegate class])); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Example/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - PureLayout (2.0.6) 3 | - VerticallyScrollingStatusView (0.1.0): 4 | - PureLayout 5 | 6 | DEPENDENCIES: 7 | - VerticallyScrollingStatusView (from `../`) 8 | 9 | EXTERNAL SOURCES: 10 | VerticallyScrollingStatusView: 11 | :path: "../" 12 | 13 | SPEC CHECKSUMS: 14 | PureLayout: f25f0bb904d5ccfe6e31da3cb869185259f02e0d 15 | VerticallyScrollingStatusView: f0d06551611e9424833298ba0201f6826448f451 16 | 17 | COCOAPODS: 0.37.2 18 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-VerticallyScrollingStatusView_Example-PureLayout/Pods-VerticallyScrollingStatusView_Example-PureLayout-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "ALView+PureLayout.h" 4 | #import "NSArray+PureLayout.h" 5 | #import "NSLayoutConstraint+PureLayout.h" 6 | #import "PureLayout+Internal.h" 7 | #import "PureLayout.h" 8 | #import "PureLayoutDefines.h" 9 | 10 | FOUNDATION_EXPORT double PureLayoutVersionNumber; 11 | FOUNDATION_EXPORT const unsigned char PureLayoutVersionString[]; 12 | 13 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-VerticallyScrollingStatusView_Tests-PureLayout/Pods-VerticallyScrollingStatusView_Tests-PureLayout-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "ALView+PureLayout.h" 4 | #import "NSArray+PureLayout.h" 5 | #import "NSLayoutConstraint+PureLayout.h" 6 | #import "PureLayout+Internal.h" 7 | #import "PureLayout.h" 8 | #import "PureLayoutDefines.h" 9 | 10 | FOUNDATION_EXPORT double PureLayoutVersionNumber; 11 | FOUNDATION_EXPORT const unsigned char PureLayoutVersionString[]; 12 | 13 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # references: 2 | # * http://www.objc.io/issue-6/travis-ci.html 3 | # * https://github.com/supermarin/xcpretty#usage 4 | 5 | language: objective-c 6 | # cache: cocoapods 7 | # podfile: Example/Podfile 8 | # before_install: 9 | # - gem install cocoapods # Since Travis is not always on latest version 10 | # - pod install --project-directory=Example 11 | install: 12 | - gem install xcpretty --no-rdoc --no-ri --no-document --quiet 13 | script: 14 | - set -o pipefail && xcodebuild test -workspace Example/VerticallyScrollingStatusView.xcworkspace -scheme VerticallyScrollingStatusView-Example -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO | xcpretty -c 15 | - pod lib lint --quick 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OS X 2 | .DS_Store 3 | 4 | # Xcode 5 | build/ 6 | *.pbxuser 7 | !default.pbxuser 8 | *.mode1v3 9 | !default.mode1v3 10 | *.mode2v3 11 | !default.mode2v3 12 | *.perspectivev3 13 | !default.perspectivev3 14 | xcuserdata 15 | *.xccheckout 16 | profile 17 | *.moved-aside 18 | DerivedData 19 | *.hmap 20 | *.ipa 21 | 22 | # Bundler 23 | .bundle 24 | 25 | # We recommend against adding the Pods directory to your .gitignore. However 26 | # you should judge for yourself, the pros and cons are mentioned at: 27 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 28 | # 29 | # Note: if you ignore the Pods directory, make sure to uncomment 30 | # `pod install` in .travis.yml 31 | # 32 | # Pods/ 33 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-VerticallyScrollingStatusView_Tests-PureLayout/Pods-VerticallyScrollingStatusView_Tests-PureLayout-Private.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods-VerticallyScrollingStatusView_Tests-PureLayout.xcconfig" 2 | CONFIGURATION_BUILD_DIR = $PODS_FRAMEWORK_BUILD_PATH 3 | FRAMEWORK_SEARCH_PATHS = "$PODS_FRAMEWORK_BUILD_PATH" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/PureLayout" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/PureLayout" "${PODS_ROOT}/Headers/Public/VerticallyScrollingStatusView" 6 | OTHER_LDFLAGS = -ObjC 7 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-VerticallyScrollingStatusView_Tests 8 | PODS_ROOT = ${SRCROOT} 9 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-VerticallyScrollingStatusView_Example-PureLayout/Pods-VerticallyScrollingStatusView_Example-PureLayout-Private.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods-VerticallyScrollingStatusView_Example-PureLayout.xcconfig" 2 | CONFIGURATION_BUILD_DIR = $PODS_FRAMEWORK_BUILD_PATH 3 | FRAMEWORK_SEARCH_PATHS = "$PODS_FRAMEWORK_BUILD_PATH" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/PureLayout" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/PureLayout" "${PODS_ROOT}/Headers/Public/VerticallyScrollingStatusView" 6 | OTHER_LDFLAGS = -ObjC 7 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-VerticallyScrollingStatusView_Example 8 | PODS_ROOT = ${SRCROOT} 9 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /Example/Tests/Tests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-VerticallyScrollingStatusView_Tests/Pods-VerticallyScrollingStatusView_Tests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_FRAMEWORK_BUILD_PATH" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_FRAMEWORK_BUILD_PATH/PureLayout.framework/Headers" -iquote "$PODS_FRAMEWORK_BUILD_PATH/VerticallyScrollingStatusView.framework/Headers" 5 | OTHER_LDFLAGS = $(inherited) -ObjC -framework "PureLayout" -framework "VerticallyScrollingStatusView" 6 | OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS) 7 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-VerticallyScrollingStatusView_Tests 8 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-VerticallyScrollingStatusView_Example/Pods-VerticallyScrollingStatusView_Example.debug.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_FRAMEWORK_BUILD_PATH" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_FRAMEWORK_BUILD_PATH/PureLayout.framework/Headers" -iquote "$PODS_FRAMEWORK_BUILD_PATH/VerticallyScrollingStatusView.framework/Headers" 5 | OTHER_LDFLAGS = $(inherited) -ObjC -framework "PureLayout" -framework "VerticallyScrollingStatusView" 6 | OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS) 7 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-VerticallyScrollingStatusView_Example 8 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-VerticallyScrollingStatusView_Tests/Pods-VerticallyScrollingStatusView_Tests.release.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_FRAMEWORK_BUILD_PATH" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_FRAMEWORK_BUILD_PATH/PureLayout.framework/Headers" -iquote "$PODS_FRAMEWORK_BUILD_PATH/VerticallyScrollingStatusView.framework/Headers" 5 | OTHER_LDFLAGS = $(inherited) -ObjC -framework "PureLayout" -framework "VerticallyScrollingStatusView" 6 | OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS) 7 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-VerticallyScrollingStatusView_Tests 8 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-VerticallyScrollingStatusView_Example/Pods-VerticallyScrollingStatusView_Example.release.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_FRAMEWORK_BUILD_PATH" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_FRAMEWORK_BUILD_PATH/PureLayout.framework/Headers" -iquote "$PODS_FRAMEWORK_BUILD_PATH/VerticallyScrollingStatusView.framework/Headers" 5 | OTHER_LDFLAGS = $(inherited) -ObjC -framework "PureLayout" -framework "VerticallyScrollingStatusView" 6 | OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS) 7 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-VerticallyScrollingStatusView_Example 8 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Example/Tests/Tests.m: -------------------------------------------------------------------------------- 1 | // 2 | // VerticallyScrollingStatusViewTests.m 3 | // VerticallyScrollingStatusViewTests 4 | // 5 | // Created by Rahul Jiresal on 06/04/2015. 6 | // Copyright (c) 2015 Rahul Jiresal. All rights reserved. 7 | // 8 | 9 | @import XCTest; 10 | 11 | @interface Tests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation Tests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-VerticallyScrollingStatusView_Tests-VerticallyScrollingStatusView/Pods-VerticallyScrollingStatusView_Tests-VerticallyScrollingStatusView-Private.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods-VerticallyScrollingStatusView_Tests-VerticallyScrollingStatusView.xcconfig" 2 | CONFIGURATION_BUILD_DIR = $PODS_FRAMEWORK_BUILD_PATH 3 | FRAMEWORK_SEARCH_PATHS = "$PODS_FRAMEWORK_BUILD_PATH" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/VerticallyScrollingStatusView" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/PureLayout" "${PODS_ROOT}/Headers/Public/VerticallyScrollingStatusView" 6 | OTHER_LDFLAGS = -ObjC 7 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-VerticallyScrollingStatusView_Tests 8 | PODS_ROOT = ${SRCROOT} 9 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-VerticallyScrollingStatusView_Example-VerticallyScrollingStatusView/Pods-VerticallyScrollingStatusView_Example-VerticallyScrollingStatusView-Private.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods-VerticallyScrollingStatusView_Example-VerticallyScrollingStatusView.xcconfig" 2 | CONFIGURATION_BUILD_DIR = $PODS_FRAMEWORK_BUILD_PATH 3 | FRAMEWORK_SEARCH_PATHS = "$PODS_FRAMEWORK_BUILD_PATH" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/VerticallyScrollingStatusView" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/PureLayout" "${PODS_ROOT}/Headers/Public/VerticallyScrollingStatusView" 6 | OTHER_LDFLAGS = -ObjC 7 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-VerticallyScrollingStatusView_Example 8 | PODS_ROOT = ${SRCROOT} 9 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-VerticallyScrollingStatusView_Tests/Pods-VerticallyScrollingStatusView_Tests-environment.h: -------------------------------------------------------------------------------- 1 | 2 | // To check if a library is compiled with CocoaPods you 3 | // can use the `COCOAPODS` macro definition which is 4 | // defined in the xcconfigs so it is available in 5 | // headers also when they are imported in the client 6 | // project. 7 | 8 | 9 | // PureLayout 10 | #define COCOAPODS_POD_AVAILABLE_PureLayout 11 | #define COCOAPODS_VERSION_MAJOR_PureLayout 2 12 | #define COCOAPODS_VERSION_MINOR_PureLayout 0 13 | #define COCOAPODS_VERSION_PATCH_PureLayout 6 14 | 15 | // VerticallyScrollingStatusView 16 | #define COCOAPODS_POD_AVAILABLE_VerticallyScrollingStatusView 17 | #define COCOAPODS_VERSION_MAJOR_VerticallyScrollingStatusView 0 18 | #define COCOAPODS_VERSION_MINOR_VerticallyScrollingStatusView 1 19 | #define COCOAPODS_VERSION_PATCH_VerticallyScrollingStatusView 0 20 | 21 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-VerticallyScrollingStatusView_Example/Pods-VerticallyScrollingStatusView_Example-environment.h: -------------------------------------------------------------------------------- 1 | 2 | // To check if a library is compiled with CocoaPods you 3 | // can use the `COCOAPODS` macro definition which is 4 | // defined in the xcconfigs so it is available in 5 | // headers also when they are imported in the client 6 | // project. 7 | 8 | 9 | // PureLayout 10 | #define COCOAPODS_POD_AVAILABLE_PureLayout 11 | #define COCOAPODS_VERSION_MAJOR_PureLayout 2 12 | #define COCOAPODS_VERSION_MINOR_PureLayout 0 13 | #define COCOAPODS_VERSION_PATCH_PureLayout 6 14 | 15 | // VerticallyScrollingStatusView 16 | #define COCOAPODS_POD_AVAILABLE_VerticallyScrollingStatusView 17 | #define COCOAPODS_VERSION_MAJOR_VerticallyScrollingStatusView 0 18 | #define COCOAPODS_VERSION_MINOR_VerticallyScrollingStatusView 1 19 | #define COCOAPODS_VERSION_PATCH_VerticallyScrollingStatusView 0 20 | 21 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-VerticallyScrollingStatusView_Tests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-VerticallyScrollingStatusView_Example/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-VerticallyScrollingStatusView_Example-PureLayout/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 2.0.6 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-VerticallyScrollingStatusView_Tests-PureLayout/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 2.0.6 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-VerticallyScrollingStatusView_Tests-VerticallyScrollingStatusView/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 0.1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-VerticallyScrollingStatusView_Example-VerticallyScrollingStatusView/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 0.1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/VerticallyScrollingStatusView/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "ipad", 20 | "size" : "29x29", 21 | "scale" : "1x" 22 | }, 23 | { 24 | "idiom" : "ipad", 25 | "size" : "29x29", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "ipad", 30 | "size" : "40x40", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "40x40", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "76x76", 41 | "scale" : "1x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "76x76", 46 | "scale" : "2x" 47 | } 48 | ], 49 | "info" : { 50 | "version" : 1, 51 | "author" : "xcode" 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 Rahul Jiresal 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Example/Pods/PureLayout/LICENSE: -------------------------------------------------------------------------------- 1 | This code is distributed under the terms and conditions of the MIT license. 2 | 3 | Copyright (c) 2014-2015 Tyler Fox 4 | 5 | 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: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | 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. 10 | -------------------------------------------------------------------------------- /Example/Pods/Local Podspecs/VerticallyScrollingStatusView.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "VerticallyScrollingStatusView", 3 | "version": "0.1.0", 4 | "summary": "VerticallyScrollingStatusView is a dropin replacement of UIView that shows vertically scrolling messages.", 5 | "description": " A subclass of UIView that shows vertically scrolling status messages. The previous message scrolls up and fades when a new one is set.\n\nFor more information, check the screenshots or try the example project.\n", 6 | "homepage": "https://github.com/rahuljiresal/VerticallyScrollingStatusView", 7 | "license": "MIT", 8 | "authors": { 9 | "Rahul Jiresal": "rahul.jiresal@gmail.com" 10 | }, 11 | "source": { 12 | "git": "https://github.com/rahuljiresal/VerticallyScrollingStatusView.git", 13 | "tag": "0.1.0" 14 | }, 15 | "social_media_url": "https://twitter.com/rahuljiresal", 16 | "platforms": { 17 | "ios": "7.0" 18 | }, 19 | "requires_arc": true, 20 | "source_files": "Pod/Classes/**/*", 21 | "resource_bundles": { 22 | "VerticallyScrollingStatusView": [ 23 | "Pod/Assets/*.png" 24 | ] 25 | }, 26 | "dependencies": { 27 | "PureLayout": [ 28 | 29 | ] 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Pod/Classes/VerticallyScrollingStatusView.h: -------------------------------------------------------------------------------- 1 | // 2 | // PingStatusLabelView.h 3 | // Knock 4 | // 5 | // Created by Rahul Jiresal on 2015-05-31. 6 | // Copyright (c) 2015 Nightbound Technologies Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface VerticallyScrollingStatusView : UIView 12 | 13 | /** 14 | * Set the duration for animation. 15 | * Smaller duration means faster scrolling animation. 16 | */ 17 | @property CGFloat animationDuration; 18 | 19 | /** 20 | * Set the status string for the view. 21 | * 22 | * @param text Text to be shown as status 23 | */ 24 | - (void)setStatus:(NSString*)text; 25 | 26 | /** 27 | * Clears the current status (with scrolling animation). 28 | */ 29 | - (void)clearStatus; 30 | 31 | /** 32 | * Sets the number of lines of the status. 33 | * Default is 2. 34 | * 35 | * @param lines Number of lines 36 | */ 37 | - (void)setNumberOfLines:(NSInteger)lines; 38 | 39 | /** 40 | * Sets the text color. 41 | * Default is Black. 42 | * 43 | * @param color Text Color 44 | */ 45 | - (void)setTextColor:(UIColor*)color; 46 | 47 | /** 48 | * Sets the text font. 49 | * Default is system font. 50 | * 51 | * @param font Font to be set 52 | */ 53 | - (void)setFont:(UIFont*)font; 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /Example/VerticallyScrollingStatusView/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "orientation" : "portrait", 20 | "idiom" : "ipad", 21 | "extent" : "full-screen", 22 | "minimum-system-version" : "7.0", 23 | "scale" : "1x" 24 | }, 25 | { 26 | "orientation" : "landscape", 27 | "idiom" : "ipad", 28 | "extent" : "full-screen", 29 | "minimum-system-version" : "7.0", 30 | "scale" : "1x" 31 | }, 32 | { 33 | "orientation" : "portrait", 34 | "idiom" : "ipad", 35 | "extent" : "full-screen", 36 | "minimum-system-version" : "7.0", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "orientation" : "landscape", 41 | "idiom" : "ipad", 42 | "extent" : "full-screen", 43 | "minimum-system-version" : "7.0", 44 | "scale" : "2x" 45 | } 46 | ], 47 | "info" : { 48 | "version" : 1, 49 | "author" : "xcode" 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Example/Pods/PureLayout/PureLayout/PureLayout/PureLayout.h: -------------------------------------------------------------------------------- 1 | // 2 | // PureLayout.h 3 | // v2.0.5 4 | // https://github.com/smileyborg/PureLayout 5 | // 6 | // Copyright (c) 2014-2015 Tyler Fox 7 | // 8 | // This code is distributed under the terms and conditions of the MIT license. 9 | // 10 | // Permission is hereby granted, free of charge, to any person obtaining a copy 11 | // of this software and associated documentation files (the "Software"), to 12 | // deal in the Software without restriction, including without limitation the 13 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 14 | // sell copies of the Software, and to permit persons to whom the Software is 15 | // furnished to do so, subject to the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be included in 18 | // all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 26 | // IN THE SOFTWARE. 27 | // 28 | 29 | #ifndef PureLayout_h 30 | #define PureLayout_h 31 | 32 | #import "ALView+PureLayout.h" 33 | #import "NSArray+PureLayout.h" 34 | #import "NSLayoutConstraint+PureLayout.h" 35 | 36 | #endif /* PureLayout_h */ 37 | -------------------------------------------------------------------------------- /VerticallyScrollingStatusView.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod lib lint VerticallyScrollingStatusView.podspec' to ensure this is a 3 | # valid spec and remove all comments before submitting the spec. 4 | # 5 | # Any lines starting with a # are optional, but encouraged 6 | # 7 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html 8 | # 9 | 10 | Pod::Spec.new do |s| 11 | s.name = "VerticallyScrollingStatusView" 12 | s.version = "0.1.0" 13 | s.summary = "VerticallyScrollingStatusView is a dropin replacement of UIView that shows vertically scrolling messages." 14 | s.description = <<-DESC 15 | A subclass of UIView that shows vertically scrolling status messages. The previous message scrolls up and fades when a new one is set. 16 | 17 | For more information, check the screenshots or try the example project. 18 | DESC 19 | s.homepage = "https://github.com/rahuljiresal/VerticallyScrollingStatusView" 20 | # s.screenshots = "www.example.com/screenshots_1", "www.example.com/screenshots_2" 21 | s.license = 'MIT' 22 | s.author = { "Rahul Jiresal" => "rahul.jiresal@gmail.com" } 23 | s.source = { :git => "https://github.com/rahuljiresal/VerticallyScrollingStatusView.git", :tag => s.version.to_s } 24 | s.social_media_url = 'https://twitter.com/rahuljiresal' 25 | 26 | s.platform = :ios, '7.0' 27 | s.requires_arc = true 28 | 29 | s.source_files = 'Pod/Classes/**/*' 30 | s.resource_bundles = { 31 | 'VerticallyScrollingStatusView' => ['Pod/Assets/*.png'] 32 | } 33 | 34 | # s.public_header_files = 'Pod/Classes/**/*.h' 35 | # s.frameworks = 'UIKit', 'MapKit' 36 | s.dependency 'PureLayout' 37 | end 38 | -------------------------------------------------------------------------------- /Example/VerticallyScrollingStatusView/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Example/VerticallyScrollingStatusView/VerticallyScrollingStatusView-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIMainStoryboardFile 28 | Main 29 | UIMainStoryboardFile~ipad 30 | Main 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | UISupportedInterfaceOrientations~ipad 42 | 43 | UIInterfaceOrientationPortrait 44 | UIInterfaceOrientationPortraitUpsideDown 45 | UIInterfaceOrientationLandscapeLeft 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /Example/VerticallyScrollingStatusView/RJAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // RJAppDelegate.m 3 | // VerticallyScrollingStatusView 4 | // 5 | // Created by CocoaPods on 06/04/2015. 6 | // Copyright (c) 2014 Rahul Jiresal. All rights reserved. 7 | // 8 | 9 | #import "RJAppDelegate.h" 10 | 11 | @implementation RJAppDelegate 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 14 | { 15 | // Override point for customization after application launch. 16 | return YES; 17 | } 18 | 19 | - (void)applicationWillResignActive:(UIApplication *)application 20 | { 21 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 22 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 23 | } 24 | 25 | - (void)applicationDidEnterBackground:(UIApplication *)application 26 | { 27 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 28 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 29 | } 30 | 31 | - (void)applicationWillEnterForeground:(UIApplication *)application 32 | { 33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | - (void)applicationDidBecomeActive:(UIApplication *)application 37 | { 38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application 42 | { 43 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # VerticallyScrollingStatusView 2 | 3 | A subclass of UIView that shows vertically scrolling status messages. The previous message scrolls up and fades when a new one is set. 4 | 5 | For more information, check the screenshots or try the example project. 6 | 7 | To run the example project, clone the repo, and run `pod install` from the Example directory first. 8 | 9 | ## Screenshot 10 | 11 | ![Screenshot](screenshot.gif) 12 | 13 | ## Usage 14 | 15 | Usage is pretty simple! 16 | 17 | ```objective-c 18 | self.statusView = [[VerticallyScrollingStatusView alloc] initWithFrame:CGRectMake(0, self.view.frame.size.height / 2, self.view.frame.size.width, 100.0f)]; 19 | [self.view addSubview:self.statusView]; 20 | ``` 21 | 22 | Or if you use [PureLayout](https://github.com/smileyborg/PureLayout), 23 | 24 | ```objective-c 25 | self.statusView = [VerticallyScrollingStatusView newAutoLayoutView]; 26 | [self.view addSubview:self.statusView]; 27 | 28 | [self.statusView autoCenterInSuperview]; 29 | [self.statusView autoMatchDimension:ALDimensionWidth toDimension:ALDimensionWidth ofView:self.view withOffset:-30.0f]; 30 | [self.statusView autoSetDimension:ALDimensionHeight toSize:100.0f]; 31 | 32 | ``` 33 | And customize it! 34 | ```objective-c 35 | [self.statusView setAnimationDuration:0.5f]; 36 | [self.statusView setFont:[UIFont systemFontOfSize:18.0]]; 37 | [self.statusView setTextColor:[UIColor blackColor]]; 38 | [self.statusView setNumberOfLines:2]; 39 | 40 | ``` 41 | 42 | ## Requirements 43 | 44 | The only requirement is [PureLayout](https://github.com/smileyborg/PureLayout). However, if you're installing through CocoaPods, you don't have to worrk about that. 45 | 46 | ## Installation 47 | 48 | VerticallyScrollingStatusView is available through [CocoaPods](http://cocoapods.org). To install 49 | it, simply add the following line to your Podfile: 50 | 51 | ```ruby 52 | pod "VerticallyScrollingStatusView" 53 | ``` 54 | 55 | ## Author 56 | 57 | Rahul Jiresal, rahul.jiresal@gmail.com, [website](http://www.rahuljiresal.com), [twitter](https://www.twitter.com/rahuljiresal) 58 | 59 | Let me know if you like the pod, or have any suggestions. Any pull requests are welcome! 60 | 61 | ## License 62 | 63 | VerticallyScrollingStatusView is available under the MIT license. See the LICENSE file for more info. 64 | -------------------------------------------------------------------------------- /Example/Pods/PureLayout/PureLayout/PureLayout/NSLayoutConstraint+PureLayout.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSLayoutConstraint+PureLayout.h 3 | // v2.0.5 4 | // https://github.com/smileyborg/PureLayout 5 | // 6 | // Copyright (c) 2013-2015 Tyler Fox 7 | // 8 | // This code is distributed under the terms and conditions of the MIT license. 9 | // 10 | // Permission is hereby granted, free of charge, to any person obtaining a copy 11 | // of this software and associated documentation files (the "Software"), to 12 | // deal in the Software without restriction, including without limitation the 13 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 14 | // sell copies of the Software, and to permit persons to whom the Software is 15 | // furnished to do so, subject to the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be included in 18 | // all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 26 | // IN THE SOFTWARE. 27 | // 28 | 29 | #import "PureLayoutDefines.h" 30 | 31 | 32 | #pragma mark - NSLayoutConstraint+PureLayout 33 | 34 | /** 35 | A category on NSLayoutConstraint that allows constraints to be easily installed & removed. 36 | */ 37 | @interface NSLayoutConstraint (PureLayout) 38 | 39 | 40 | #pragma mark Install & Remove Constraints 41 | 42 | /** Activates the the constraint. */ 43 | - (void)autoInstall; 44 | 45 | /** Deactivates the constraint. */ 46 | - (void)autoRemove; 47 | 48 | 49 | #pragma mark Identify Constraints 50 | 51 | #if __PureLayout_MinBaseSDK_iOS_8_0 || __PureLayout_MinBaseSDK_OSX_10_10 52 | 53 | /** Sets the string as the identifier for this constraint. Available in iOS 7.0 and OS X 10.9 and later. */ 54 | - (instancetype)autoIdentify:(NSString *)identifier; 55 | 56 | #endif /* __PureLayout_MinBaseSDK_iOS_8_0 || __PureLayout_MinBaseSDK_OSX_10_10 */ 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /Example/Pods/Pods.xcodeproj/xcshareddata/xcschemes/Pods-VerticallyScrollingStatusView_Tests-VerticallyScrollingStatusView.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 42 | 43 | 44 | 45 | 51 | 52 | 54 | 55 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /Example/Pods/Pods.xcodeproj/xcshareddata/xcschemes/Pods-VerticallyScrollingStatusView_Example-VerticallyScrollingStatusView.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 42 | 43 | 44 | 45 | 51 | 52 | 54 | 55 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /Example/Pods/Pods.xcodeproj/xcshareddata/xcschemes/Pods-VerticallyScrollingStatusView_Tests-VerticallyScrollingStatusView-VerticallyScrollingStatusView.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 42 | 43 | 44 | 45 | 51 | 52 | 54 | 55 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /Example/Pods/Pods.xcodeproj/xcshareddata/xcschemes/Pods-VerticallyScrollingStatusView_Example-VerticallyScrollingStatusView-VerticallyScrollingStatusView.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 42 | 43 | 44 | 45 | 51 | 52 | 54 | 55 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-VerticallyScrollingStatusView_Tests/Pods-VerticallyScrollingStatusView_Tests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## PureLayout 5 | 6 | This code is distributed under the terms and conditions of the MIT license. 7 | 8 | Copyright (c) 2014-2015 Tyler Fox 9 | 10 | 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: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 13 | 14 | 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. 15 | 16 | 17 | ## VerticallyScrollingStatusView 18 | 19 | Copyright (c) 2015 Rahul Jiresal 20 | 21 | Permission is hereby granted, free of charge, to any person obtaining a copy 22 | of this software and associated documentation files (the "Software"), to deal 23 | in the Software without restriction, including without limitation the rights 24 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 25 | copies of the Software, and to permit persons to whom the Software is 26 | furnished to do so, subject to the following conditions: 27 | 28 | The above copyright notice and this permission notice shall be included in 29 | all copies or substantial portions of the Software. 30 | 31 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 32 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 33 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 34 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 35 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 36 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 37 | THE SOFTWARE. 38 | 39 | Generated by CocoaPods - http://cocoapods.org 40 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-VerticallyScrollingStatusView_Example/Pods-VerticallyScrollingStatusView_Example-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## PureLayout 5 | 6 | This code is distributed under the terms and conditions of the MIT license. 7 | 8 | Copyright (c) 2014-2015 Tyler Fox 9 | 10 | 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: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 13 | 14 | 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. 15 | 16 | 17 | ## VerticallyScrollingStatusView 18 | 19 | Copyright (c) 2015 Rahul Jiresal 20 | 21 | Permission is hereby granted, free of charge, to any person obtaining a copy 22 | of this software and associated documentation files (the "Software"), to deal 23 | in the Software without restriction, including without limitation the rights 24 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 25 | copies of the Software, and to permit persons to whom the Software is 26 | furnished to do so, subject to the following conditions: 27 | 28 | The above copyright notice and this permission notice shall be included in 29 | all copies or substantial portions of the Software. 30 | 31 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 32 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 33 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 34 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 35 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 36 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 37 | THE SOFTWARE. 38 | 39 | Generated by CocoaPods - http://cocoapods.org 40 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-VerticallyScrollingStatusView_Tests/Pods-VerticallyScrollingStatusView_Tests-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | install_framework() 10 | { 11 | local source="${BUILT_PRODUCTS_DIR}/Pods-VerticallyScrollingStatusView_Tests/$1" 12 | local destination="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 13 | 14 | if [ -L "${source}" ]; then 15 | echo "Symlinked..." 16 | source=$(readlink "${source}") 17 | fi 18 | 19 | # use filter instead of exclude so missing patterns dont' throw errors 20 | echo "rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers/" --filter "- PrivateHeaders/" --filter "- Modules/" ${source} ${destination}" 21 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers/" --filter "- PrivateHeaders/" --filter "- Modules/" "${source}" "${destination}" 22 | # Resign the code if required by the build settings to avoid unstable apps 23 | if [ "${CODE_SIGNING_REQUIRED}" == "YES" ]; then 24 | code_sign "${destination}/$1" 25 | fi 26 | 27 | # Embed linked Swift runtime libraries 28 | local basename 29 | basename=$(echo $1 | sed -E s/\\..+// && exit ${PIPESTATUS[0]}) 30 | local swift_runtime_libs 31 | swift_runtime_libs=$(xcrun otool -LX "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/$1/${basename}" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 32 | for lib in $swift_runtime_libs; do 33 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 34 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 35 | if [ "${CODE_SIGNING_REQUIRED}" == "YES" ]; then 36 | code_sign "${destination}/${lib}" 37 | fi 38 | done 39 | } 40 | 41 | # Signs a framework with the provided identity 42 | code_sign() { 43 | # Use the current code_sign_identitiy 44 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 45 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements $1" 46 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1" 47 | } 48 | 49 | 50 | if [[ "$CONFIGURATION" == "Debug" ]]; then 51 | install_framework 'PureLayout.framework' 52 | install_framework 'VerticallyScrollingStatusView.framework' 53 | fi 54 | if [[ "$CONFIGURATION" == "Release" ]]; then 55 | install_framework 'PureLayout.framework' 56 | install_framework 'VerticallyScrollingStatusView.framework' 57 | fi 58 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-VerticallyScrollingStatusView_Example/Pods-VerticallyScrollingStatusView_Example-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | install_framework() 10 | { 11 | local source="${BUILT_PRODUCTS_DIR}/Pods-VerticallyScrollingStatusView_Example/$1" 12 | local destination="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 13 | 14 | if [ -L "${source}" ]; then 15 | echo "Symlinked..." 16 | source=$(readlink "${source}") 17 | fi 18 | 19 | # use filter instead of exclude so missing patterns dont' throw errors 20 | echo "rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers/" --filter "- PrivateHeaders/" --filter "- Modules/" ${source} ${destination}" 21 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers/" --filter "- PrivateHeaders/" --filter "- Modules/" "${source}" "${destination}" 22 | # Resign the code if required by the build settings to avoid unstable apps 23 | if [ "${CODE_SIGNING_REQUIRED}" == "YES" ]; then 24 | code_sign "${destination}/$1" 25 | fi 26 | 27 | # Embed linked Swift runtime libraries 28 | local basename 29 | basename=$(echo $1 | sed -E s/\\..+// && exit ${PIPESTATUS[0]}) 30 | local swift_runtime_libs 31 | swift_runtime_libs=$(xcrun otool -LX "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/$1/${basename}" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 32 | for lib in $swift_runtime_libs; do 33 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 34 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 35 | if [ "${CODE_SIGNING_REQUIRED}" == "YES" ]; then 36 | code_sign "${destination}/${lib}" 37 | fi 38 | done 39 | } 40 | 41 | # Signs a framework with the provided identity 42 | code_sign() { 43 | # Use the current code_sign_identitiy 44 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 45 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements $1" 46 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1" 47 | } 48 | 49 | 50 | if [[ "$CONFIGURATION" == "Debug" ]]; then 51 | install_framework 'PureLayout.framework' 52 | install_framework 'VerticallyScrollingStatusView.framework' 53 | fi 54 | if [[ "$CONFIGURATION" == "Release" ]]; then 55 | install_framework 'PureLayout.framework' 56 | install_framework 'VerticallyScrollingStatusView.framework' 57 | fi 58 | -------------------------------------------------------------------------------- /Example/Pods/PureLayout/PureLayout/PureLayout/PureLayout+Internal.h: -------------------------------------------------------------------------------- 1 | // 2 | // PureLayout+Internal.h 3 | // v2.0.5 4 | // https://github.com/smileyborg/PureLayout 5 | // 6 | // Copyright (c) 2014-2015 Tyler Fox 7 | // 8 | // This code is distributed under the terms and conditions of the MIT license. 9 | // 10 | // Permission is hereby granted, free of charge, to any person obtaining a copy 11 | // of this software and associated documentation files (the "Software"), to 12 | // deal in the Software without restriction, including without limitation the 13 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 14 | // sell copies of the Software, and to permit persons to whom the Software is 15 | // furnished to do so, subject to the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be included in 18 | // all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 26 | // IN THE SOFTWARE. 27 | // 28 | 29 | #import "PureLayoutDefines.h" 30 | 31 | /** A constant that represents the smallest valid positive value for the multiplier of a constraint, 32 | since a value of 0 will cause the second item to be lost in the internal auto layout engine. */ 33 | static const CGFloat kMULTIPLIER_MIN_VALUE = 0.00001; // very small floating point numbers (e.g. CGFLOAT_MIN) can cause problems 34 | 35 | 36 | /** 37 | A category that exposes the internal (private) helper methods of the ALView+PureLayout category. 38 | */ 39 | @interface ALView (PureLayoutInternal) 40 | 41 | + (BOOL)al_preventAutomaticConstraintInstallation; 42 | + (NSMutableArray *)al_currentArrayOfCreatedConstraints; 43 | + (BOOL)al_isExecutingPriorityConstraintsBlock; 44 | + (ALLayoutPriority)al_currentGlobalConstraintPriority; 45 | + (NSString *)al_currentGlobalConstraintIdentifier; 46 | + (void)al_applyGlobalStateToConstraint:(NSLayoutConstraint *)constraint; 47 | - (void)al_addConstraint:(NSLayoutConstraint *)constraint; 48 | - (ALView *)al_commonSuperviewWithView:(ALView *)otherView; 49 | - (NSLayoutConstraint *)al_alignAttribute:(ALAttribute)attribute toView:(ALView *)otherView forAxis:(ALAxis)axis; 50 | 51 | @end 52 | 53 | 54 | /** 55 | A category that exposes the internal (private) helper methods of the NSArray+PureLayout category. 56 | */ 57 | @interface NSArray (PureLayoutInternal) 58 | 59 | - (ALView *)al_commonSuperviewOfViews; 60 | - (BOOL)al_containsMinimumNumberOfViews:(NSUInteger)minimumNumberOfViews; 61 | - (NSArray *)al_copyViewsOnly; 62 | 63 | @end 64 | 65 | 66 | /** 67 | A category that exposes the internal (private) helper methods of the NSLayoutConstraint+PureLayout category. 68 | */ 69 | @interface NSLayoutConstraint (PureLayoutInternal) 70 | 71 | + (NSLayoutAttribute)al_layoutAttributeForAttribute:(ALAttribute)attribute; 72 | + (ALLayoutConstraintAxis)al_constraintAxisForAxis:(ALAxis)axis; 73 | #if __PureLayout_MinBaseSDK_iOS_8_0 74 | + (ALMargin)al_marginForEdge:(ALEdge)edge; 75 | + (ALMarginAxis)al_marginAxisForAxis:(ALAxis)axis; 76 | #endif /* __PureLayout_MinBaseSDK_iOS_8_0 */ 77 | 78 | @end 79 | -------------------------------------------------------------------------------- /Example/VerticallyScrollingStatusView/RJViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // RJViewController.m 3 | // VerticallyScrollingStatusView 4 | // 5 | // Created by Rahul Jiresal on 06/04/2015. 6 | // Copyright (c) 2014 Rahul Jiresal. All rights reserved. 7 | // 8 | 9 | #import "RJViewController.h" 10 | 11 | #import 12 | #import 13 | 14 | @interface RJViewController () 15 | 16 | @property (strong, nonatomic) VerticallyScrollingStatusView* statusView; 17 | @property (strong, nonatomic) NSArray* statuses; 18 | @property int index; 19 | 20 | @end 21 | 22 | @implementation RJViewController 23 | 24 | - (void)viewDidLoad 25 | { 26 | [super viewDidLoad]; 27 | 28 | self.statusView = [VerticallyScrollingStatusView newAutoLayoutView]; 29 | // self.statusView = [[VerticallyScrollingStatusView alloc] initWithFrame:CGRectMake(0, self.view.frame.size.height / 2, self.view.frame.size.width, 100.0f)]; 30 | [self.view addSubview:self.statusView]; 31 | 32 | [self.statusView autoCenterInSuperview]; 33 | [self.statusView autoMatchDimension:ALDimensionWidth toDimension:ALDimensionWidth ofView:self.view withOffset:-30.0f]; 34 | [self.statusView autoSetDimension:ALDimensionHeight toSize:100.0f]; 35 | 36 | [self.statusView setAnimationDuration:0.5f]; 37 | [self.statusView setFont:[UIFont systemFontOfSize:18.0]]; 38 | [self.statusView setTextColor:[UIColor blackColor]]; 39 | [self.statusView setNumberOfLines:2]; 40 | 41 | NSTimer *timer = [NSTimer timerWithTimeInterval:2.0f target:self selector:@selector(timerTick:) userInfo:nil repeats:YES]; 42 | [[NSRunLoop mainRunLoop] addTimer:timer forMode:NSRunLoopCommonModes]; 43 | 44 | self.statuses = [NSArray arrayWithObjects: @"Lorem ipsum dolor sit amet,", 45 | @"reque verterem ex eum.", 46 | @"Luptatum nominati intellegam", 47 | @"mei id, quis minim mei ex.", 48 | @"Cu vis officiis salutandi,", 49 | @"vis eu saepe inimicus expetenda,", 50 | @"cum veritus lucilius facilisi at.", 51 | @"Bonorum feugait fuisset qui te.", 52 | @"Option volumus mea te,", 53 | @"nec ut harum maiorum argumentum,", 54 | @"et sonet commune mel.", 55 | @"Nec no quem quando iracundia,", 56 | @"ea qui iriure admodum propriae,", 57 | @"solum honestatis nec id.", 58 | @"Eu sed dicunt habemus platonem,", 59 | @"illum theophrastus necessitatibus his ut.", 60 | @"Ea mel homero timeam inciderint.", 61 | @"Ex per nonumy pertinax,", 62 | @"nulla evertitur cotidieque eam ut.", 63 | @"Ea duo vidit nusquam,", 64 | @"suscipit accusata euripidis eam ei.", 65 | @"Ex enim liber mnesarchum mea,", 66 | @"suscipit eloquentiam ei mei,", 67 | @"vel cu volumus offendit eleifend.", nil]; 68 | 69 | } 70 | 71 | - (void)timerTick:(id)sender { 72 | [self.statusView setStatus:[self.statuses objectAtIndex:self.index]]; 73 | self.index = (self.index + 1) % self.statuses.count; 74 | } 75 | 76 | - (void)didReceiveMemoryWarning 77 | { 78 | [super didReceiveMemoryWarning]; 79 | // Dispose of any resources that can be recreated. 80 | } 81 | 82 | @end 83 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-VerticallyScrollingStatusView_Tests/Pods-VerticallyScrollingStatusView_Tests-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | This code is distributed under the terms and conditions of the MIT license. 18 | 19 | Copyright (c) 2014-2015 Tyler Fox 20 | 21 | 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: 22 | 23 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 24 | 25 | 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. 26 | 27 | Title 28 | PureLayout 29 | Type 30 | PSGroupSpecifier 31 | 32 | 33 | FooterText 34 | Copyright (c) 2015 Rahul Jiresal <rahul.jiresal@gmail.com> 35 | 36 | Permission is hereby granted, free of charge, to any person obtaining a copy 37 | of this software and associated documentation files (the "Software"), to deal 38 | in the Software without restriction, including without limitation the rights 39 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 40 | copies of the Software, and to permit persons to whom the Software is 41 | furnished to do so, subject to the following conditions: 42 | 43 | The above copyright notice and this permission notice shall be included in 44 | all copies or substantial portions of the Software. 45 | 46 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 47 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 48 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 49 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 50 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 51 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 52 | THE SOFTWARE. 53 | 54 | Title 55 | VerticallyScrollingStatusView 56 | Type 57 | PSGroupSpecifier 58 | 59 | 60 | FooterText 61 | Generated by CocoaPods - http://cocoapods.org 62 | Title 63 | 64 | Type 65 | PSGroupSpecifier 66 | 67 | 68 | StringsTable 69 | Acknowledgements 70 | Title 71 | Acknowledgements 72 | 73 | 74 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-VerticallyScrollingStatusView_Example/Pods-VerticallyScrollingStatusView_Example-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | This code is distributed under the terms and conditions of the MIT license. 18 | 19 | Copyright (c) 2014-2015 Tyler Fox 20 | 21 | 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: 22 | 23 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 24 | 25 | 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. 26 | 27 | Title 28 | PureLayout 29 | Type 30 | PSGroupSpecifier 31 | 32 | 33 | FooterText 34 | Copyright (c) 2015 Rahul Jiresal <rahul.jiresal@gmail.com> 35 | 36 | Permission is hereby granted, free of charge, to any person obtaining a copy 37 | of this software and associated documentation files (the "Software"), to deal 38 | in the Software without restriction, including without limitation the rights 39 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 40 | copies of the Software, and to permit persons to whom the Software is 41 | furnished to do so, subject to the following conditions: 42 | 43 | The above copyright notice and this permission notice shall be included in 44 | all copies or substantial portions of the Software. 45 | 46 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 47 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 48 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 49 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 50 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 51 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 52 | THE SOFTWARE. 53 | 54 | Title 55 | VerticallyScrollingStatusView 56 | Type 57 | PSGroupSpecifier 58 | 59 | 60 | FooterText 61 | Generated by CocoaPods - http://cocoapods.org 62 | Title 63 | 64 | Type 65 | PSGroupSpecifier 66 | 67 | 68 | StringsTable 69 | Acknowledgements 70 | Title 71 | Acknowledgements 72 | 73 | 74 | -------------------------------------------------------------------------------- /Example/VerticallyScrollingStatusView.xcodeproj/xcshareddata/xcschemes/VerticallyScrollingStatusView-Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 61 | 63 | 69 | 70 | 71 | 72 | 73 | 74 | 80 | 82 | 88 | 89 | 90 | 91 | 93 | 94 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-VerticallyScrollingStatusView_Tests/Pods-VerticallyScrollingStatusView_Tests-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | XCASSET_FILES=() 10 | 11 | realpath() { 12 | DIRECTORY=$(cd "${1%/*}" && pwd) 13 | FILENAME="${1##*/}" 14 | echo "$DIRECTORY/$FILENAME" 15 | } 16 | 17 | install_resource() 18 | { 19 | case $1 in 20 | *.storyboard) 21 | 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}" 22 | 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}" 23 | ;; 24 | *.xib) 25 | 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}" 26 | 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}" 27 | ;; 28 | *.framework) 29 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 30 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 31 | echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 32 | rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 33 | ;; 34 | *.xcdatamodel) 35 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\"" 36 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom" 37 | ;; 38 | *.xcdatamodeld) 39 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\"" 40 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd" 41 | ;; 42 | *.xcmappingmodel) 43 | echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\"" 44 | xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm" 45 | ;; 46 | *.xcassets) 47 | ABSOLUTE_XCASSET_FILE=$(realpath "${PODS_ROOT}/$1") 48 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 49 | ;; 50 | /*) 51 | echo "$1" 52 | echo "$1" >> "$RESOURCES_TO_COPY" 53 | ;; 54 | *) 55 | echo "${PODS_ROOT}/$1" 56 | echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY" 57 | ;; 58 | esac 59 | } 60 | 61 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 62 | if [[ "${ACTION}" == "install" ]]; then 63 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 64 | fi 65 | rm -f "$RESOURCES_TO_COPY" 66 | 67 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 68 | then 69 | case "${TARGETED_DEVICE_FAMILY}" in 70 | 1,2) 71 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 72 | ;; 73 | 1) 74 | TARGET_DEVICE_ARGS="--target-device iphone" 75 | ;; 76 | 2) 77 | TARGET_DEVICE_ARGS="--target-device ipad" 78 | ;; 79 | *) 80 | TARGET_DEVICE_ARGS="--target-device mac" 81 | ;; 82 | esac 83 | 84 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 85 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 86 | while read line; do 87 | if [[ $line != "`realpath $PODS_ROOT`*" ]]; then 88 | XCASSET_FILES+=("$line") 89 | fi 90 | done <<<"$OTHER_XCASSETS" 91 | 92 | 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}" 93 | fi 94 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-VerticallyScrollingStatusView_Example/Pods-VerticallyScrollingStatusView_Example-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | XCASSET_FILES=() 10 | 11 | realpath() { 12 | DIRECTORY=$(cd "${1%/*}" && pwd) 13 | FILENAME="${1##*/}" 14 | echo "$DIRECTORY/$FILENAME" 15 | } 16 | 17 | install_resource() 18 | { 19 | case $1 in 20 | *.storyboard) 21 | 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}" 22 | 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}" 23 | ;; 24 | *.xib) 25 | 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}" 26 | 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}" 27 | ;; 28 | *.framework) 29 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 30 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 31 | echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 32 | rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 33 | ;; 34 | *.xcdatamodel) 35 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\"" 36 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom" 37 | ;; 38 | *.xcdatamodeld) 39 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\"" 40 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd" 41 | ;; 42 | *.xcmappingmodel) 43 | echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\"" 44 | xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm" 45 | ;; 46 | *.xcassets) 47 | ABSOLUTE_XCASSET_FILE=$(realpath "${PODS_ROOT}/$1") 48 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 49 | ;; 50 | /*) 51 | echo "$1" 52 | echo "$1" >> "$RESOURCES_TO_COPY" 53 | ;; 54 | *) 55 | echo "${PODS_ROOT}/$1" 56 | echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY" 57 | ;; 58 | esac 59 | } 60 | 61 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 62 | if [[ "${ACTION}" == "install" ]]; then 63 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 64 | fi 65 | rm -f "$RESOURCES_TO_COPY" 66 | 67 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 68 | then 69 | case "${TARGETED_DEVICE_FAMILY}" in 70 | 1,2) 71 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 72 | ;; 73 | 1) 74 | TARGET_DEVICE_ARGS="--target-device iphone" 75 | ;; 76 | 2) 77 | TARGET_DEVICE_ARGS="--target-device ipad" 78 | ;; 79 | *) 80 | TARGET_DEVICE_ARGS="--target-device mac" 81 | ;; 82 | esac 83 | 84 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 85 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 86 | while read line; do 87 | if [[ $line != "`realpath $PODS_ROOT`*" ]]; then 88 | XCASSET_FILES+=("$line") 89 | fi 90 | done <<<"$OTHER_XCASSETS" 91 | 92 | 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}" 93 | fi 94 | -------------------------------------------------------------------------------- /Example/Pods/PureLayout/PureLayout/PureLayout/NSArray+PureLayout.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+PureLayout.h 3 | // v2.0.5 4 | // https://github.com/smileyborg/PureLayout 5 | // 6 | // Copyright (c) 2012 Richard Turton 7 | // Copyright (c) 2013-2015 Tyler Fox 8 | // 9 | // This code is distributed under the terms and conditions of the MIT license. 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a copy 12 | // of this software and associated documentation files (the "Software"), to 13 | // deal in the Software without restriction, including without limitation the 14 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 15 | // sell copies of the Software, and to permit persons to whom the Software is 16 | // furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included in 19 | // all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 27 | // IN THE SOFTWARE. 28 | // 29 | 30 | #import "PureLayoutDefines.h" 31 | 32 | 33 | #pragma mark - NSArray+PureLayout 34 | 35 | /** 36 | A category on NSArray that provides a simple yet powerful interface to: 37 | - Manage an array of Auto Layout constraints 38 | - Apply constraints to an array of views 39 | */ 40 | @interface NSArray (PureLayout) 41 | 42 | 43 | #pragma mark Array of Constraints 44 | 45 | /** Activates the constraints in this array. */ 46 | - (void)autoInstallConstraints; 47 | 48 | /** Deactivates the constraints in this array. */ 49 | - (void)autoRemoveConstraints; 50 | 51 | #if __PureLayout_MinBaseSDK_iOS_8_0 52 | 53 | /** Sets the string as the identifier for the constraints in this array. Available in iOS 7.0 and OS X 10.9 and later. */ 54 | - (instancetype)autoIdentifyConstraints:(NSString *)identifier; 55 | 56 | #endif /* __PureLayout_MinBaseSDK_iOS_8_0 */ 57 | 58 | 59 | #pragma mark Array of Views 60 | 61 | /** Aligns views in this array to one another along a given edge. */ 62 | - (NSArray *)autoAlignViewsToEdge:(ALEdge)edge; 63 | 64 | /** Aligns views in this array to one another along a given axis. */ 65 | - (NSArray *)autoAlignViewsToAxis:(ALAxis)axis; 66 | 67 | /** Matches a given dimension of all the views in this array. */ 68 | - (NSArray *)autoMatchViewsDimension:(ALDimension)dimension; 69 | 70 | /** Sets the given dimension of all the views in this array to a given size. */ 71 | - (NSArray *)autoSetViewsDimension:(ALDimension)dimension toSize:(CGFloat)size; 72 | 73 | /** Sets all of the views in this array to a given size. */ 74 | - (NSArray *)autoSetViewsDimensionsToSize:(CGSize)size; 75 | 76 | 77 | /** Distributes the views in this array equally along the selected axis in their superview. Views will be the same size (variable) in the dimension along the axis and will have spacing (fixed) between them. */ 78 | - (NSArray *)autoDistributeViewsAlongAxis:(ALAxis)axis 79 | alignedTo:(ALAttribute)alignment 80 | withFixedSpacing:(CGFloat)spacing; 81 | 82 | /** Distributes the views in this array equally along the selected axis in their superview. Views will be the same size (variable) in the dimension along the axis and will have spacing (fixed) between them, with optional insets from the first and last views to their superview. */ 83 | - (NSArray *)autoDistributeViewsAlongAxis:(ALAxis)axis 84 | alignedTo:(ALAttribute)alignment 85 | withFixedSpacing:(CGFloat)spacing 86 | insetSpacing:(BOOL)shouldSpaceInsets; 87 | 88 | /** Distributes the views in this array equally along the selected axis in their superview. Views will have spacing (fixed) between them, with optional insets from the first and last views to their superview, and optionally constrained to the same size in the dimension along the axis. */ 89 | - (NSArray *)autoDistributeViewsAlongAxis:(ALAxis)axis 90 | alignedTo:(ALAttribute)alignment 91 | withFixedSpacing:(CGFloat)spacing 92 | insetSpacing:(BOOL)shouldSpaceInsets 93 | matchedSizes:(BOOL)shouldMatchSizes; 94 | 95 | 96 | /** Distributes the views in this array equally along the selected axis in their superview. Views will be the same size (fixed) in the dimension along the axis and will have spacing (variable) between them. */ 97 | - (NSArray *)autoDistributeViewsAlongAxis:(ALAxis)axis 98 | alignedTo:(ALAttribute)alignment 99 | withFixedSize:(CGFloat)size; 100 | 101 | /** Distributes the views in this array equally along the selected axis in their superview. Views will be the same size (fixed) in the dimension along the axis and will have spacing (variable) between them, with optional insets from the first and last views to their superview. */ 102 | - (NSArray *)autoDistributeViewsAlongAxis:(ALAxis)axis 103 | alignedTo:(ALAttribute)alignment 104 | withFixedSize:(CGFloat)size 105 | insetSpacing:(BOOL)shouldSpaceInsets; 106 | 107 | @end 108 | -------------------------------------------------------------------------------- /Pod/Classes/VerticallyScrollingStatusView.m: -------------------------------------------------------------------------------- 1 | // 2 | // PingStatusLabelView.m 3 | // Knock 4 | // 5 | // Created by Rahul Jiresal on 2015-05-31. 6 | // Copyright (c) 2015 Nightbound Technologies Inc. All rights reserved. 7 | // 8 | 9 | #import "VerticallyScrollingStatusView.h" 10 | 11 | #import 12 | 13 | @interface VerticallyScrollingStatusView() 14 | 15 | @property (strong, nonatomic) NSMutableArray* statusMessagesQueue; 16 | 17 | @property BOOL currentlyShowingStatus; 18 | 19 | 20 | @end 21 | 22 | @implementation VerticallyScrollingStatusView 23 | 24 | - (id)initWithFrame:(CGRect)frame { 25 | self = [super initWithFrame:frame]; 26 | if (self) { 27 | [self allocSubviews]; 28 | [self setDefaults]; 29 | } 30 | return self; 31 | } 32 | 33 | - (void)setDefaults { 34 | self.animationDuration = 0.5f; 35 | } 36 | 37 | - (void)allocSubviews { 38 | self.statusMessagesQueue = [[NSMutableArray alloc] initWithCapacity:20]; 39 | 40 | UILabel *currentLabel = [UILabel newAutoLayoutView]; 41 | UILabel *incomingLabel = [UILabel newAutoLayoutView]; 42 | 43 | [self addSubview:currentLabel]; 44 | [self addSubview:incomingLabel]; 45 | 46 | [currentLabel setTextAlignment:NSTextAlignmentCenter]; 47 | [incomingLabel setTextAlignment:NSTextAlignmentCenter]; 48 | [currentLabel setNumberOfLines:2]; 49 | [incomingLabel setNumberOfLines:2]; 50 | [currentLabel setLineBreakMode:NSLineBreakByWordWrapping]; 51 | [incomingLabel setLineBreakMode:NSLineBreakByWordWrapping]; 52 | [currentLabel setFont:[UIFont systemFontOfSize:18.0f]]; 53 | [incomingLabel setFont:[UIFont systemFontOfSize:18.0f]]; 54 | 55 | self.clipsToBounds = YES; 56 | } 57 | 58 | - (void)setNumberOfLines:(NSInteger)lines { 59 | NSArray* subviews = [self sortedSubviewsArray]; 60 | UILabel* currentLabel = [subviews firstObject]; 61 | UILabel* incomingLabel = [subviews lastObject]; 62 | 63 | [currentLabel setNumberOfLines:lines]; 64 | [incomingLabel setNumberOfLines:lines]; 65 | } 66 | 67 | - (void)setTextColor:(UIColor*)color { 68 | NSArray* subviews = [self sortedSubviewsArray]; 69 | UILabel* currentLabel = [subviews firstObject]; 70 | UILabel* incomingLabel = [subviews lastObject]; 71 | 72 | [currentLabel setTextColor:color]; 73 | [incomingLabel setTextColor:color]; 74 | } 75 | 76 | - (void)setFont:(UIFont*)font { 77 | NSArray* subviews = [self sortedSubviewsArray]; 78 | UILabel* currentLabel = [subviews firstObject]; 79 | UILabel* incomingLabel = [subviews lastObject]; 80 | 81 | [currentLabel setFont:font]; 82 | [incomingLabel setFont:font]; 83 | } 84 | 85 | - (BOOL)needsUpdateConstraints { 86 | return [super needsUpdateConstraints]; 87 | } 88 | 89 | - (void)updateConstraints { 90 | NSArray* subviews = [self sortedSubviewsArray]; 91 | UILabel* currentLabel = [subviews firstObject]; 92 | UILabel* incomingLabel = [subviews lastObject]; 93 | 94 | [currentLabel autoMatchDimension:ALDimensionWidth toDimension:ALDimensionWidth ofView:self]; 95 | [currentLabel autoMatchDimension:ALDimensionHeight toDimension:ALDimensionHeight ofView:self withMultiplier:0.5]; 96 | [currentLabel autoCenterInSuperview]; 97 | 98 | [incomingLabel autoMatchDimension:ALDimensionWidth toDimension:ALDimensionWidth ofView:self]; 99 | [incomingLabel autoMatchDimension:ALDimensionHeight toDimension:ALDimensionHeight ofView:self withMultiplier:0.5]; 100 | [incomingLabel autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:currentLabel]; 101 | [incomingLabel autoAlignAxisToSuperviewAxis:ALAxisVertical]; 102 | 103 | [super updateConstraints]; 104 | } 105 | 106 | - (void)setStatus:(NSString*)text { 107 | [self.statusMessagesQueue addObject:text]; 108 | if (!self.currentlyShowingStatus) { 109 | self.currentlyShowingStatus = YES; 110 | [self animateStatus]; 111 | } 112 | } 113 | 114 | - (void)animateStatus { 115 | NSArray* subviews = [self sortedSubviewsArray]; 116 | UILabel* currentLabel = [subviews firstObject]; 117 | UILabel* incomingLabel = [subviews lastObject]; 118 | 119 | NSString* text = [self.statusMessagesQueue firstObject]; 120 | [self.statusMessagesQueue removeObject:text]; 121 | [incomingLabel setText:text]; 122 | 123 | CGRect currentFrame = CGRectMake(0, self.frame.size.height / 4, self.frame.size.width, self.frame.size.height / 2); 124 | CGRect incomingFrame = CGRectMake(0, self.frame.size.height * 3 / 4, self.frame.size.width, self.frame.size.height / 2); 125 | CGRect outgoingFrame = currentLabel.frame; 126 | outgoingFrame.origin.y = currentLabel.frame.origin.y - currentFrame.size.height; 127 | [UIView animateWithDuration:self.animationDuration animations:^{ 128 | [currentLabel setFrame:outgoingFrame]; 129 | [incomingLabel setFrame:currentFrame]; 130 | [currentLabel setAlpha:0.0f]; 131 | [incomingLabel setAlpha:1.0f]; 132 | } completion:^(BOOL finished) { 133 | if (finished) { 134 | [currentLabel setFrame:incomingFrame]; 135 | if (self.statusMessagesQueue.count > 0) { 136 | [self animateStatus]; 137 | } 138 | else { 139 | self.currentlyShowingStatus = NO; 140 | } 141 | } 142 | }]; 143 | } 144 | 145 | - (void)clearStatus { 146 | self.currentlyShowingStatus = YES; 147 | [self animateStatus]; 148 | } 149 | 150 | - (NSArray*)sortedSubviewsArray { 151 | UILabel *incomingLabel; 152 | UILabel *currentLabel; 153 | 154 | NSArray* subviews = self.subviews; 155 | for (UILabel *label in subviews) { 156 | if (currentLabel == nil || currentLabel.frame.origin.y > label.frame.origin.y) { 157 | incomingLabel = currentLabel; 158 | currentLabel = label; 159 | } 160 | else { 161 | incomingLabel = label; 162 | } 163 | } 164 | 165 | return [NSArray arrayWithObjects:currentLabel, incomingLabel, nil]; 166 | } 167 | 168 | 169 | @end 170 | -------------------------------------------------------------------------------- /Example/Pods/PureLayout/README.md: -------------------------------------------------------------------------------- 1 | # [![PureLayout](https://github.com/smileyborg/PureLayout/blob/master/Images/PureLayout.png?raw=true)](#) 2 | [![Build Status](http://img.shields.io/travis/smileyborg/PureLayout.svg?style=flat)](https://travis-ci.org/smileyborg/PureLayout) [![Test Coverage](http://img.shields.io/coveralls/smileyborg/PureLayout.svg?style=flat)](https://coveralls.io/r/smileyborg/PureLayout) [![Version](http://img.shields.io/cocoapods/v/PureLayout.svg?style=flat)](http://cocoapods.org/?q=PureLayout) [![Platform](http://img.shields.io/cocoapods/p/PureLayout.svg?style=flat)](http://cocoapods.org/?q=PureLayout) [![License](http://img.shields.io/cocoapods/l/PureLayout.svg?style=flat)](LICENSE) 3 | 4 | The ultimate API for iOS & OS X Auto Layout — impressively simple, immensely powerful. PureLayout extends `UIView`/`NSView`, `NSArray`, and `NSLayoutConstraint` with a comprehensive Auto Layout API that is modeled after Apple's own frameworks. PureLayout is an Objective-C library that also works (and looks!) great with Swift using a bridging header. 5 | 6 | Writing Auto Layout code from scratch isn't easy. PureLayout provides a fully capable and developer-friendly interface for Auto Layout. It is designed for clarity and simplicity, and takes inspiration from the AutoLayout UI options available in Interface Builder while delivering far more flexibility. The API is also highly efficient, as it adds only a thin layer of third party code and is engineered for maximum performance. 7 | 8 | ## API Cheat Sheet 9 | This is just a handy overview of the core API methods. Explore the [header files](PureLayout/PureLayout) for the full API, and find the complete documentation above the implementation of each method in the corresponding .m file. A couple of notes: 10 | 11 | * All of the public API methods are namespaced with the prefix `auto...`, which also makes it easy for Xcode to autocomplete as you type. 12 | * Methods that create constraints also automatically install (activate) the constraint(s), then return the new constraint(s) for you to optionally store for later adjustment or removal. 13 | * Many methods below also have a variant which includes a `relation:` parameter to make the constraint an inequality. 14 | 15 | ### Attributes 16 | 17 | PureLayout defines view attributes that are used to create auto layout constraints. Here is an [illustration of the most common attributes](Images/PureLayout-CommonAttributes.png). 18 | 19 | There are 5 specific attribute types, which are used throughout most of the API: 20 | 21 | * `ALEdge` 22 | * `ALDimension` 23 | * `ALAxis` 24 | * `ALMargin` *available in iOS 8.0 and higher only* 25 | * `ALMarginAxis` *available in iOS 8.0 and higher only* 26 | 27 | Additionally, there is one generic attribute type, `ALAttribute`, which is effectively a union of all the specific types. You can think of this as the "supertype" of all of the specific attribute types, which means that it is always safe to cast a specific type to the generic `ALAttribute` type. (Note that the reverse is not true -- casting a generic ALAttribute to a specific attribute type is unsafe!) 28 | 29 | ### [`UIView`/`NSView`](PureLayout/PureLayout/ALView%2BPureLayout.h) 30 | 31 | + autoCreateConstraintsWithoutInstalling: 32 | + autoSetPriority:forConstraints: 33 | + autoSetIdentifier:forConstraints: // iOS 7.0+, OS X 10.9+ only 34 | - autoSetContent(CompressionResistance|Hugging)PriorityForAxis: 35 | - autoCenterInSuperview: 36 | - autoAlignAxisToSuperviewAxis: 37 | - autoCenterInSuperviewMargins: // iOS 8.0+ only 38 | - autoAlignAxisToSuperviewMarginAxis: // iOS 8.0+ only 39 | - autoPinEdgeToSuperviewEdge:(withInset:) 40 | - autoPinEdgesToSuperviewEdgesWithInsets:(excludingEdge:) 41 | - autoPinEdgeToSuperviewMargin: // iOS 8.0+ only 42 | - autoPinEdgesToSuperviewMargins(ExcludingEdge:) // iOS 8.0+ only 43 | - autoPinEdge:toEdge:ofView:(withOffset:) 44 | - autoAlignAxis:toSameAxisOfView:(withOffset:) 45 | - autoMatchDimension:toDimension:ofView:(withOffset:|withMultiplier:) 46 | - autoSetDimension(s)ToSize: 47 | - autoConstrainAttribute:toAttribute:ofView:(withOffset:|withMultiplier:) 48 | - autoPinTo(Top|Bottom)LayoutGuideOfViewController:withInset: // iOS only 49 | 50 | ### [`NSArray`](PureLayout/PureLayout/NSArray%2BPureLayout.h) 51 | 52 | // Arrays of Constraints 53 | - autoInstallConstraints 54 | - autoRemoveConstraints 55 | - autoIdentifyConstraints: // iOS 7.0+, OS X 10.9+ only 56 | 57 | // Arrays of Views 58 | - autoAlignViewsToEdge: 59 | - autoAlignViewsToAxis: 60 | - autoMatchViewsDimension: 61 | - autoSetViewsDimension:toSize: 62 | - autoSetViewsDimensionsToSize: 63 | - autoDistributeViewsAlongAxis:alignedTo:withFixedSpacing:(insetSpacing:)(matchedSizes:) 64 | - autoDistributeViewsAlongAxis:alignedTo:withFixedSize:(insetSpacing:) 65 | 66 | ### [`NSLayoutConstraint`](PureLayout/PureLayout/NSLayoutConstraint%2BPureLayout.h) 67 | 68 | - autoInstall 69 | - autoRemove 70 | - autoIdentify: // iOS 7.0+, OS X 10.9+ only 71 | 72 | ## Setup 73 | *Note: PureLayout requires a minimum deployment target of iOS 6.0 or OS X 10.7* 74 | 75 | ### Using [CocoaPods](http://cocoapods.org) 76 | 1. Add the pod `PureLayout` to your [Podfile](http://guides.cocoapods.org/using/the-podfile.html). 77 | 78 | pod 'PureLayout' 79 | 80 | 2. Run `pod install` from Terminal, then open your app's `.xcworkspace` file to launch Xcode. 81 | 3. Import the `PureLayout.h` header. Typically, this should be written as `#import ` 82 | 83 | That's it - now go write some beautiful Auto Layout code! 84 | 85 | ### Using [Carthage](https://github.com/Carthage/Carthage) 86 | 1. Add the `smileyborg/PureLayout` project to your [Cartfile](https://github.com/Carthage/Carthage/blob/master/Documentation/Artifacts.md#cartfile). 87 | 88 | github "smileyborg/PureLayout" 89 | 90 | 2. Run `carthage update`, then follow the [additional steps required](https://github.com/Carthage/Carthage#adding-frameworks-to-an-application) to add the iOS and/or Mac frameworks into your project. 91 | 3. Import the PureLayout framework/module (with the appropriate name for the platform you're using it on). 92 | * Using Modules: `@import PureLayout_iOS` or `@import PureLayout_Mac` 93 | * Without Modules: `#import ` or `#import ` 94 | 95 | That's it - now go write some beautiful Auto Layout code! 96 | 97 | ### Manually from GitHub 98 | 1. Download the source files in the [PureLayout subdirectory](PureLayout/PureLayout). 99 | 2. Add the source files to your Xcode project. 100 | 3. Import the `PureLayout.h` header. 101 | 102 | That's it - now go write some beautiful Auto Layout code! 103 | 104 | ### App Extensions 105 | To use PureLayout in an App Extension, you need to do a bit of extra configuration to prevent usage of unavailable APIs. [Click here](https://github.com/smileyborg/PureLayout/wiki/App-Extensions) for more info. 106 | 107 | ### Releases 108 | Releases are tagged in the git commit history using [semantic versioning](http://semver.org). Check out the [releases and release notes](https://github.com/smileyborg/PureLayout/releases) for each version. 109 | 110 | ## Usage 111 | ### Example Project 112 | Open the project included in the repository (requires Xcode 6 or higher). It contains [iOS](PureLayout/Example-iOS) (`Example-iOS` scheme) and [OS X](PureLayout/Example-Mac) (`Example-Mac` scheme) demos of the library being used in various scenarios. 113 | 114 | On iOS, you can use different device simulators and rotate the device to see the constraints in action (as well as toggle the taller in-call status bar in the iOS Simulator). 115 | 116 | On OS X, while running the app, press any key to cycle through the demos. You can resize the window to see the constraints in action. 117 | 118 | ### Tips and Tricks 119 | Check out some [Tips and Tricks](https://github.com/smileyborg/PureLayout/wiki/Tips-and-Tricks) to keep in mind when using the API. 120 | 121 | ## PureLayout vs. the rest 122 | An overview of the Auto Layout options available, ordered from the lowest- to highest-level of abstraction. 123 | 124 | * Apple [NSLayoutConstraint SDK API](https://developer.apple.com/library/ios/documentation/AppKit/Reference/NSLayoutConstraint_Class/index.html#//apple_ref/occ/clm/NSLayoutConstraint/constraintWithItem:attribute:relatedBy:toItem:attribute:multiplier:constant:) 125 | * Pros: Raw power 126 | * Cons: Extremely verbose, tedious to write, difficult to read 127 | * Apple [Visual Format Language](https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/AutolayoutPG/VisualFormatLanguage/VisualFormatLanguage.html) 128 | * Pros: Concise, convenient 129 | * Cons: Doesn't support some use cases, incomplete compile-time checks, must learn syntax, hard to debug 130 | * Apple Interface Builder 131 | * Pros: Visual, simple 132 | * Cons: Difficult for complex layouts, cannot dynamically set constraints at runtime, encourages hardcoded magic numbers, not always WYSIWYG 133 | * **PureLayout** 134 | * Pros: Simple, efficient, minimal third party code, consistent with Cocoa API style, compatible with Objective-C and Swift codebases 135 | * Cons: Not the most concise expression of layout code 136 | * High-level Auto Layout Libraries/DSLs ([Cartography](https://github.com/robb/Cartography), [SnapKit](https://github.com/SnapKit/SnapKit), [KeepLayout](https://github.com/iMartinKiss/KeepLayout)) 137 | * Pros: Very clean, concise, and convenient 138 | * Cons: Unique API style is foreign to Cocoa APIs, mixed compatibility with Objective-C & Swift, greater dependency on third party code 139 | 140 | PureLayout takes a balanced approach to Auto Layout that makes it well suited for any project. 141 | 142 | ## Problems, Suggestions, Pull Requests? 143 | Please open a [new Issue here](https://github.com/smileyborg/PureLayout/issues/new) if you run into an issue, have a feature request, or want to share a comment. Note that general Auto Layout questions should be asked on [Stack Overflow](http://stackoverflow.com). 144 | 145 | If you're considering taking on significant changes or additions to the project, please communicate in advance by opening a new Issue. This allows everyone to get onboard with upcoming changes, ensures that changes align with the project's design philosophy, and avoids duplicated work. 146 | 147 | ## Meta 148 | Designed & maintained by Tyler Fox ([@smileyborg](https://twitter.com/smileyborg)). Distributed with the MIT license. 149 | -------------------------------------------------------------------------------- /Example/Pods/PureLayout/PureLayout/PureLayout/NSLayoutConstraint+PureLayout.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSLayoutConstraint+PureLayout.m 3 | // v2.0.5 4 | // https://github.com/smileyborg/PureLayout 5 | // 6 | // Copyright (c) 2013-2015 Tyler Fox 7 | // 8 | // This code is distributed under the terms and conditions of the MIT license. 9 | // 10 | // Permission is hereby granted, free of charge, to any person obtaining a copy 11 | // of this software and associated documentation files (the "Software"), to 12 | // deal in the Software without restriction, including without limitation the 13 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 14 | // sell copies of the Software, and to permit persons to whom the Software is 15 | // furnished to do so, subject to the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be included in 18 | // all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 26 | // IN THE SOFTWARE. 27 | // 28 | 29 | #import "NSLayoutConstraint+PureLayout.h" 30 | #import "ALView+PureLayout.h" 31 | #import "PureLayout+Internal.h" 32 | 33 | 34 | #pragma mark - NSLayoutConstraint+PureLayout 35 | 36 | @implementation NSLayoutConstraint (PureLayout) 37 | 38 | 39 | #pragma mark Installing & Removing Constraints 40 | 41 | /** 42 | Activates the constraint. 43 | */ 44 | - (void)autoInstall 45 | { 46 | #if __PureLayout_MinBaseSDK_iOS_8_0 || __PureLayout_MinBaseSDK_OSX_10_10 47 | if ([self respondsToSelector:@selector(setActive:)]) { 48 | [ALView al_applyGlobalStateToConstraint:self]; 49 | if ([ALView al_preventAutomaticConstraintInstallation]) { 50 | [[ALView al_currentArrayOfCreatedConstraints] addObject:self]; 51 | } else { 52 | self.active = YES; 53 | } 54 | return; 55 | } 56 | #endif /* __PureLayout_MinBaseSDK_iOS_8_0 || __PureLayout_MinBaseSDK_OSX_10_10 */ 57 | 58 | NSAssert(self.firstItem || self.secondItem, @"Can't install a constraint with nil firstItem and secondItem."); 59 | if (self.firstItem) { 60 | if (self.secondItem) { 61 | NSAssert([self.firstItem isKindOfClass:[ALView class]] && [self.secondItem isKindOfClass:[ALView class]], @"Can only automatically install a constraint if both items are views."); 62 | ALView *commonSuperview = [self.firstItem al_commonSuperviewWithView:self.secondItem]; 63 | [commonSuperview al_addConstraint:self]; 64 | } else { 65 | NSAssert([self.firstItem isKindOfClass:[ALView class]], @"Can only automatically install a constraint if the item is a view."); 66 | [self.firstItem al_addConstraint:self]; 67 | } 68 | } else { 69 | NSAssert([self.secondItem isKindOfClass:[ALView class]], @"Can only automatically install a constraint if the item is a view."); 70 | [self.secondItem al_addConstraint:self]; 71 | } 72 | } 73 | 74 | /** 75 | Deactivates the constraint. 76 | */ 77 | - (void)autoRemove 78 | { 79 | #if __PureLayout_MinBaseSDK_iOS_8_0 || __PureLayout_MinBaseSDK_OSX_10_10 80 | if ([self respondsToSelector:@selector(setActive:)]) { 81 | self.active = NO; 82 | return; 83 | } 84 | #endif /* __PureLayout_MinBaseSDK_iOS_8_0 || __PureLayout_MinBaseSDK_OSX_10_10 */ 85 | 86 | if (self.secondItem) { 87 | ALView *commonSuperview = [self.firstItem al_commonSuperviewWithView:self.secondItem]; 88 | while (commonSuperview) { 89 | if ([commonSuperview.constraints containsObject:self]) { 90 | [commonSuperview removeConstraint:self]; 91 | return; 92 | } 93 | commonSuperview = commonSuperview.superview; 94 | } 95 | } 96 | else { 97 | [self.firstItem removeConstraint:self]; 98 | return; 99 | } 100 | NSAssert(nil, @"Failed to remove constraint: %@", self); 101 | } 102 | 103 | 104 | #pragma mark Identify Constraints 105 | 106 | #if __PureLayout_MinBaseSDK_iOS_8_0 || __PureLayout_MinBaseSDK_OSX_10_10 107 | 108 | /** 109 | Sets the string as the identifier for this constraint. Available in iOS 7.0 and OS X 10.9 and later. 110 | The identifier will be printed along with the constraint's description. 111 | This is helpful to document a constraint's purpose and aid in debugging. 112 | 113 | @param identifier A string used to identify this constraint. 114 | @return This constraint. 115 | */ 116 | - (instancetype)autoIdentify:(NSString *)identifier 117 | { 118 | if ([self respondsToSelector:@selector(setIdentifier:)]) { 119 | self.identifier = identifier; 120 | } 121 | return self; 122 | } 123 | 124 | #endif /* __PureLayout_MinBaseSDK_iOS_8_0 || __PureLayout_MinBaseSDK_OSX_10_10 */ 125 | 126 | 127 | #pragma mark Internal Methods 128 | 129 | /** 130 | Returns the corresponding NSLayoutAttribute for the given ALAttribute. 131 | 132 | @return The layout attribute for the given ALAttribute. 133 | */ 134 | + (NSLayoutAttribute)al_layoutAttributeForAttribute:(ALAttribute)attribute 135 | { 136 | NSLayoutAttribute layoutAttribute = NSLayoutAttributeNotAnAttribute; 137 | switch (attribute) { 138 | case ALEdgeLeft: 139 | layoutAttribute = NSLayoutAttributeLeft; 140 | break; 141 | case ALEdgeRight: 142 | layoutAttribute = NSLayoutAttributeRight; 143 | break; 144 | case ALEdgeTop: 145 | layoutAttribute = NSLayoutAttributeTop; 146 | break; 147 | case ALEdgeBottom: 148 | layoutAttribute = NSLayoutAttributeBottom; 149 | break; 150 | case ALEdgeLeading: 151 | layoutAttribute = NSLayoutAttributeLeading; 152 | break; 153 | case ALEdgeTrailing: 154 | layoutAttribute = NSLayoutAttributeTrailing; 155 | break; 156 | case ALDimensionWidth: 157 | layoutAttribute = NSLayoutAttributeWidth; 158 | break; 159 | case ALDimensionHeight: 160 | layoutAttribute = NSLayoutAttributeHeight; 161 | break; 162 | case ALAxisVertical: 163 | layoutAttribute = NSLayoutAttributeCenterX; 164 | break; 165 | case ALAxisHorizontal: 166 | layoutAttribute = NSLayoutAttributeCenterY; 167 | break; 168 | case ALAxisBaseline: // same value as ALAxisLastBaseline 169 | layoutAttribute = NSLayoutAttributeBaseline; 170 | break; 171 | #if __PureLayout_MinBaseSDK_iOS_8_0 172 | case ALAxisFirstBaseline: 173 | NSAssert(__PureLayout_MinSysVer_iOS_8_0, @"ALAxisFirstBaseline is only supported on iOS 8.0 or higher."); 174 | layoutAttribute = NSLayoutAttributeFirstBaseline; 175 | break; 176 | case ALMarginLeft: 177 | NSAssert(__PureLayout_MinSysVer_iOS_8_0, @"ALEdgeLeftMargin is only supported on iOS 8.0 or higher."); 178 | layoutAttribute = NSLayoutAttributeLeftMargin; 179 | break; 180 | case ALMarginRight: 181 | NSAssert(__PureLayout_MinSysVer_iOS_8_0, @"ALEdgeRightMargin is only supported on iOS 8.0 or higher."); 182 | layoutAttribute = NSLayoutAttributeRightMargin; 183 | break; 184 | case ALMarginTop: 185 | NSAssert(__PureLayout_MinSysVer_iOS_8_0, @"ALEdgeTopMargin is only supported on iOS 8.0 or higher."); 186 | layoutAttribute = NSLayoutAttributeTopMargin; 187 | break; 188 | case ALMarginBottom: 189 | NSAssert(__PureLayout_MinSysVer_iOS_8_0, @"ALEdgeBottomMargin is only supported on iOS 8.0 or higher."); 190 | layoutAttribute = NSLayoutAttributeBottomMargin; 191 | break; 192 | case ALMarginLeading: 193 | NSAssert(__PureLayout_MinSysVer_iOS_8_0, @"ALEdgeLeadingMargin is only supported on iOS 8.0 or higher."); 194 | layoutAttribute = NSLayoutAttributeLeadingMargin; 195 | break; 196 | case ALMarginTrailing: 197 | NSAssert(__PureLayout_MinSysVer_iOS_8_0, @"ALEdgeTrailingMargin is only supported on iOS 8.0 or higher."); 198 | layoutAttribute = NSLayoutAttributeTrailingMargin; 199 | break; 200 | case ALMarginAxisVertical: 201 | NSAssert(__PureLayout_MinSysVer_iOS_8_0, @"ALAxisVerticalMargin is only supported on iOS 8.0 or higher."); 202 | layoutAttribute = NSLayoutAttributeCenterXWithinMargins; 203 | break; 204 | case ALMarginAxisHorizontal: 205 | NSAssert(__PureLayout_MinSysVer_iOS_8_0, @"ALAxisHorizontalMargin is only supported on iOS 8.0 or higher."); 206 | layoutAttribute = NSLayoutAttributeCenterYWithinMargins; 207 | break; 208 | #endif /* __PureLayout_MinBaseSDK_iOS_8_0 */ 209 | default: 210 | NSAssert(nil, @"Not a valid ALAttribute."); 211 | break; 212 | } 213 | return layoutAttribute; 214 | } 215 | 216 | /** 217 | Returns the corresponding ALLayoutConstraintAxis for the given ALAxis. 218 | 219 | @return The constraint axis for the given axis. 220 | */ 221 | + (ALLayoutConstraintAxis)al_constraintAxisForAxis:(ALAxis)axis 222 | { 223 | ALLayoutConstraintAxis constraintAxis; 224 | switch (axis) { 225 | case ALAxisVertical: 226 | constraintAxis = ALLayoutConstraintAxisVertical; 227 | break; 228 | case ALAxisHorizontal: 229 | case ALAxisBaseline: // same value as ALAxisLastBaseline 230 | #if __PureLayout_MinBaseSDK_iOS_8_0 231 | case ALAxisFirstBaseline: 232 | #endif /* __PureLayout_MinBaseSDK_iOS_8_0 */ 233 | constraintAxis = ALLayoutConstraintAxisHorizontal; 234 | break; 235 | default: 236 | NSAssert(nil, @"Not a valid ALAxis."); 237 | constraintAxis = ALLayoutConstraintAxisHorizontal; // default to a random value to satisfy the compiler 238 | break; 239 | } 240 | return constraintAxis; 241 | } 242 | 243 | #if __PureLayout_MinBaseSDK_iOS_8_0 244 | 245 | /** 246 | Returns the corresponding margin for the given edge. 247 | 248 | @param edge The edge to convert to the corresponding margin. 249 | @return The margin for the given edge. 250 | */ 251 | + (ALMargin)al_marginForEdge:(ALEdge)edge 252 | { 253 | NSAssert(__PureLayout_MinSysVer_iOS_8_0, @"Margin attributes are only supported on iOS 8.0 or higher."); 254 | ALMargin margin; 255 | switch (edge) { 256 | case ALEdgeLeft: 257 | margin = ALMarginLeft; 258 | break; 259 | case ALEdgeRight: 260 | margin = ALMarginRight; 261 | break; 262 | case ALEdgeTop: 263 | margin = ALMarginTop; 264 | break; 265 | case ALEdgeBottom: 266 | margin = ALMarginBottom; 267 | break; 268 | case ALEdgeLeading: 269 | margin = ALMarginLeading; 270 | break; 271 | case ALEdgeTrailing: 272 | margin = ALMarginTrailing; 273 | break; 274 | default: 275 | NSAssert(nil, @"Not a valid ALEdge."); 276 | margin = ALMarginLeft; // default to a random value to satisfy the compiler 277 | break; 278 | } 279 | return margin; 280 | } 281 | 282 | /** 283 | Returns the corresponding margin axis for the given axis. 284 | 285 | @param axis The axis to convert to the corresponding margin axis. 286 | @return The margin axis for the given axis. 287 | */ 288 | + (ALMarginAxis)al_marginAxisForAxis:(ALAxis)axis 289 | { 290 | NSAssert(__PureLayout_MinSysVer_iOS_8_0, @"Margin attributes are only supported on iOS 8.0 or higher."); 291 | ALMarginAxis marginAxis; 292 | switch (axis) { 293 | case ALAxisVertical: 294 | marginAxis = ALMarginAxisVertical; 295 | break; 296 | case ALAxisHorizontal: 297 | marginAxis = ALMarginAxisHorizontal; 298 | break; 299 | case ALAxisBaseline: 300 | case ALAxisFirstBaseline: 301 | NSAssert(nil, @"The baseline axis attributes do not have corresponding margin axis attributes."); 302 | marginAxis = ALMarginAxisVertical; // default to a random value to satisfy the compiler 303 | break; 304 | default: 305 | NSAssert(nil, @"Not a valid ALAxis."); 306 | marginAxis = ALMarginAxisVertical; // default to a random value to satisfy the compiler 307 | break; 308 | } 309 | return marginAxis; 310 | } 311 | 312 | #endif /* __PureLayout_MinBaseSDK_iOS_8_0 */ 313 | 314 | @end 315 | -------------------------------------------------------------------------------- /Example/Pods/PureLayout/PureLayout/PureLayout/PureLayoutDefines.h: -------------------------------------------------------------------------------- 1 | // 2 | // PureLayoutDefines.h 3 | // v2.0.5 4 | // https://github.com/smileyborg/PureLayout 5 | // 6 | // Copyright (c) 2014-2015 Tyler Fox 7 | // 8 | // This code is distributed under the terms and conditions of the MIT license. 9 | // 10 | // Permission is hereby granted, free of charge, to any person obtaining a copy 11 | // of this software and associated documentation files (the "Software"), to 12 | // deal in the Software without restriction, including without limitation the 13 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 14 | // sell copies of the Software, and to permit persons to whom the Software is 15 | // furnished to do so, subject to the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be included in 18 | // all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 26 | // IN THE SOFTWARE. 27 | // 28 | 29 | #ifndef PureLayoutDefines_h 30 | #define PureLayoutDefines_h 31 | 32 | #import 33 | 34 | // Define some preprocessor macros to check for a minimum Base SDK. These are used to prevent compile-time errors in older versions of Xcode. 35 | #define __PureLayout_MinBaseSDK_iOS_8_0 (TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MAX_ALLOWED > __IPHONE_7_1) 36 | #define __PureLayout_MinBaseSDK_OSX_10_10 (!TARGET_OS_IPHONE && __MAC_OS_X_VERSION_MAX_ALLOWED > __MAC_10_9) 37 | 38 | // Define some preprocessor macros to check for a minimum System Version. These are used to prevent runtime crashes on older versions of iOS/OS X. 39 | #define __PureLayout_MinSysVer_iOS_7_0 (TARGET_OS_IPHONE && floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_6_1) 40 | #define __PureLayout_MinSysVer_iOS_8_0 (TARGET_OS_IPHONE && floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_7_1) 41 | #define __PureLayout_MinSysVer_OSX_10_9 (!TARGET_OS_IPHONE && floor(NSFoundationVersionNumber) > NSFoundationVersionNumber10_8_4) 42 | 43 | // Define generic AL-prefixed macros for the types/constants/etc that have slight naming variations across iOS and OS X, which allows the same code to be platform-independent 44 | #if TARGET_OS_IPHONE 45 | # import 46 | # define ALView UIView 47 | # define ALEdgeInsets UIEdgeInsets 48 | # define ALEdgeInsetsZero UIEdgeInsetsZero 49 | # define ALEdgeInsetsMake UIEdgeInsetsMake 50 | # define ALLayoutConstraintAxis UILayoutConstraintAxis 51 | # define ALLayoutConstraintOrientation ALLayoutConstraintAxis 52 | # define ALLayoutConstraintAxisHorizontal UILayoutConstraintAxisHorizontal 53 | # define ALLayoutConstraintAxisVertical UILayoutConstraintAxisVertical 54 | # define ALLayoutConstraintOrientationHorizontal ALLayoutConstraintAxisHorizontal 55 | # define ALLayoutConstraintOrientationVertical ALLayoutConstraintAxisVertical 56 | # define ALLayoutPriority UILayoutPriority 57 | # define ALLayoutPriorityRequired UILayoutPriorityRequired 58 | # define ALLayoutPriorityDefaultHigh UILayoutPriorityDefaultHigh 59 | # define ALLayoutPriorityDefaultLow UILayoutPriorityDefaultLow 60 | # define ALLayoutPriorityFittingSizeLevel UILayoutPriorityFittingSizeLevel 61 | # define ALLayoutPriorityFittingSizeCompression ALLayoutPriorityFittingSizeLevel 62 | #else 63 | # import 64 | # define ALView NSView 65 | # define ALEdgeInsets NSEdgeInsets 66 | # define ALEdgeInsetsZero NSEdgeInsetsMake(0, 0, 0, 0) 67 | # define ALEdgeInsetsMake NSEdgeInsetsMake 68 | # define ALLayoutConstraintOrientation NSLayoutConstraintOrientation 69 | # define ALLayoutConstraintAxis ALLayoutConstraintOrientation 70 | # define ALLayoutConstraintOrientationHorizontal NSLayoutConstraintOrientationHorizontal 71 | # define ALLayoutConstraintOrientationVertical NSLayoutConstraintOrientationVertical 72 | # define ALLayoutConstraintAxisHorizontal ALLayoutConstraintOrientationHorizontal 73 | # define ALLayoutConstraintAxisVertical ALLayoutConstraintOrientationVertical 74 | # define ALLayoutPriority NSLayoutPriority 75 | # define ALLayoutPriorityRequired NSLayoutPriorityRequired 76 | # define ALLayoutPriorityDefaultHigh NSLayoutPriorityDefaultHigh 77 | # define ALLayoutPriorityDefaultLow NSLayoutPriorityDefaultLow 78 | # define ALLayoutPriorityFittingSizeCompression NSLayoutPriorityFittingSizeCompression 79 | # define ALLayoutPriorityFittingSizeLevel ALLayoutPriorityFittingSizeCompression 80 | #endif /* TARGET_OS_IPHONE */ 81 | 82 | 83 | #pragma mark PureLayout Attributes 84 | 85 | /** Constants that represent edges of a view. */ 86 | typedef NS_ENUM(NSInteger, ALEdge) { 87 | /** The left edge of the view. */ 88 | ALEdgeLeft = NSLayoutAttributeLeft, 89 | /** The right edge of the view. */ 90 | ALEdgeRight = NSLayoutAttributeRight, 91 | /** The top edge of the view. */ 92 | ALEdgeTop = NSLayoutAttributeTop, 93 | /** The bottom edge of the view. */ 94 | ALEdgeBottom = NSLayoutAttributeBottom, 95 | /** The leading edge of the view (left edge for left-to-right languages like English, right edge for right-to-left languages like Arabic). */ 96 | ALEdgeLeading = NSLayoutAttributeLeading, 97 | /** The trailing edge of the view (right edge for left-to-right languages like English, left edge for right-to-left languages like Arabic). */ 98 | ALEdgeTrailing = NSLayoutAttributeTrailing 99 | }; 100 | 101 | /** Constants that represent dimensions of a view. */ 102 | typedef NS_ENUM(NSInteger, ALDimension) { 103 | /** The width of the view. */ 104 | ALDimensionWidth = NSLayoutAttributeWidth, 105 | /** The height of the view. */ 106 | ALDimensionHeight = NSLayoutAttributeHeight 107 | }; 108 | 109 | /** Constants that represent axes of a view. */ 110 | typedef NS_ENUM(NSInteger, ALAxis) { 111 | /** A vertical line through the middle of the view's left and right edges. */ 112 | ALAxisVertical = NSLayoutAttributeCenterX, 113 | /** A horizontal line through the middle of the view's top and bottom edges. */ 114 | ALAxisHorizontal = NSLayoutAttributeCenterY, 115 | 116 | /** A horizontal line at the baseline of the last line of text in the view. (For views that do not draw text, will be equivalent to ALEdgeBottom.) Same as ALAxisLastBaseline. */ 117 | ALAxisBaseline = NSLayoutAttributeBaseline, 118 | /** A horizontal line at the baseline of the last line of text in the view. (For views that do not draw text, will be equivalent to ALEdgeBottom.) */ 119 | ALAxisLastBaseline = ALAxisBaseline, 120 | #if __PureLayout_MinBaseSDK_iOS_8_0 121 | /** A horizontal line at the baseline of the first line of text in a view. (For views that do not draw text, will be equivalent to ALEdgeTop.) Available in iOS 8.0 and later. */ 122 | ALAxisFirstBaseline = NSLayoutAttributeFirstBaseline 123 | #endif /* __PureLayout_MinBaseSDK_iOS_8_0 */ 124 | }; 125 | 126 | #if __PureLayout_MinBaseSDK_iOS_8_0 127 | 128 | /** Constants that represent layout margins of a view. Available in iOS 8.0 and later. */ 129 | typedef NS_ENUM(NSInteger, ALMargin) { 130 | /** The left margin of the view, based on the view's layoutMargins left inset. */ 131 | ALMarginLeft = NSLayoutAttributeLeftMargin, 132 | /** The right margin of the view, based on the view's layoutMargins right inset. */ 133 | ALMarginRight = NSLayoutAttributeRightMargin, 134 | /** The top margin of the view, based on the view's layoutMargins top inset. */ 135 | ALMarginTop = NSLayoutAttributeTopMargin, 136 | /** The bottom margin of the view, based on the view's layoutMargins bottom inset. */ 137 | ALMarginBottom = NSLayoutAttributeBottomMargin, 138 | /** The leading margin of the view, based on the view's layoutMargins left/right (depending on language direction) inset. */ 139 | ALMarginLeading = NSLayoutAttributeLeadingMargin, 140 | /** The trailing margin of the view, based on the view's layoutMargins left/right (depending on language direction) inset. */ 141 | ALMarginTrailing = NSLayoutAttributeTrailingMargin 142 | }; 143 | 144 | /** Constants that represent axes of the layout margins of a view. Available in iOS 8.0 and later. */ 145 | typedef NS_ENUM(NSInteger, ALMarginAxis) { 146 | /** A vertical line through the middle of the view's left and right margins. */ 147 | ALMarginAxisVertical = NSLayoutAttributeCenterXWithinMargins, 148 | /** A horizontal line through the middle of the view's top and bottom margins. */ 149 | ALMarginAxisHorizontal = NSLayoutAttributeCenterYWithinMargins 150 | }; 151 | 152 | #endif /* __PureLayout_MinBaseSDK_iOS_8_0 */ 153 | 154 | /** An attribute of a view that can be used in auto layout constraints. These constants are identical to the more specific enum types: 155 | ALEdge, ALAxis, ALDimension, ALMargin, ALMarginAxis. It is safe to cast a more specific enum type to the ALAttribute type. */ 156 | typedef NS_ENUM(NSInteger, ALAttribute) { 157 | /** The left edge of the view. */ 158 | ALAttributeLeft = ALEdgeLeft, 159 | /** The right edge of the view. */ 160 | ALAttributeRight = ALEdgeRight, 161 | /** The top edge of the view. */ 162 | ALAttributeTop = ALEdgeTop, 163 | /** The bottom edge of the view. */ 164 | ALAttributeBottom = ALEdgeBottom, 165 | /** The leading edge of the view (left edge for left-to-right languages like English, right edge for right-to-left languages like Arabic). */ 166 | ALAttributeLeading = ALEdgeLeading, 167 | /** The trailing edge of the view (right edge for left-to-right languages like English, left edge for right-to-left languages like Arabic). */ 168 | ALAttributeTrailing = ALEdgeTrailing, 169 | /** The width of the view. */ 170 | ALAttributeWidth = ALDimensionWidth, 171 | /** The height of the view. */ 172 | ALAttributeHeight = ALDimensionHeight, 173 | /** A vertical line through the middle of the view's left and right edges. */ 174 | ALAttributeVertical = ALAxisVertical, 175 | /** A horizontal line through the middle of the view's top and bottom edges. */ 176 | ALAttributeHorizontal = ALAxisHorizontal, 177 | /** A horizontal line at the baseline of the last line of text in the view. (For views that do not draw text, will be equivalent to ALEdgeBottom.) Same as ALAxisLastBaseline. */ 178 | ALAttributeBaseline = ALAxisBaseline, 179 | /** A horizontal line at the baseline of the last line of text in the view. (For views that do not draw text, will be equivalent to ALEdgeBottom.) */ 180 | ALAttributeLastBaseline = ALAxisLastBaseline, 181 | #if __PureLayout_MinBaseSDK_iOS_8_0 182 | /** A horizontal line at the baseline of the first line of text in a view. (For views that do not draw text, will be equivalent to ALEdgeTop.) Available in iOS 8.0 and later. */ 183 | ALAttributeFirstBaseline = ALAxisFirstBaseline, 184 | /** The left margin of the view, based on the view's layoutMargins left inset. */ 185 | ALAttributeMarginLeft = ALMarginLeft, 186 | /** The right margin of the view, based on the view's layoutMargins right inset. */ 187 | ALAttributeMarginRight = ALMarginRight, 188 | /** The top margin of the view, based on the view's layoutMargins top inset. */ 189 | ALAttributeMarginTop = ALMarginTop, 190 | /** The bottom margin of the view, based on the view's layoutMargins bottom inset. */ 191 | ALAttributeMarginBottom = ALMarginBottom, 192 | /** The leading margin of the view, based on the view's layoutMargins left/right (depending on language direction) inset. */ 193 | ALAttributeMarginLeading = ALMarginLeading, 194 | /** The trailing margin of the view, based on the view's layoutMargins left/right (depending on language direction) inset. */ 195 | ALAttributeMarginTrailing = ALMarginTrailing, 196 | /** A vertical line through the middle of the view's left and right margins. */ 197 | ALAttributeMarginAxisVertical = ALMarginAxisVertical, 198 | /** A horizontal line through the middle of the view's top and bottom margins. */ 199 | ALAttributeMarginAxisHorizontal = ALMarginAxisHorizontal 200 | #endif /* __PureLayout_MinBaseSDK_iOS_8_0 */ 201 | }; 202 | 203 | /** A block containing method calls to the PureLayout API. Takes no arguments and has no return value. */ 204 | typedef void(^ALConstraintsBlock)(void); 205 | 206 | #endif /* PureLayoutDefines_h */ 207 | -------------------------------------------------------------------------------- /Example/Pods/PureLayout/PureLayout/PureLayout/ALView+PureLayout.h: -------------------------------------------------------------------------------- 1 | // 2 | // ALView+PureLayout.h 3 | // v2.0.5 4 | // https://github.com/smileyborg/PureLayout 5 | // 6 | // Copyright (c) 2012 Richard Turton 7 | // Copyright (c) 2013-2015 Tyler Fox 8 | // 9 | // This code is distributed under the terms and conditions of the MIT license. 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a copy 12 | // of this software and associated documentation files (the "Software"), to 13 | // deal in the Software without restriction, including without limitation the 14 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 15 | // sell copies of the Software, and to permit persons to whom the Software is 16 | // furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included in 19 | // all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 27 | // IN THE SOFTWARE. 28 | // 29 | 30 | #import "PureLayoutDefines.h" 31 | 32 | 33 | #pragma mark - ALView+PureLayout 34 | 35 | /** 36 | A category on UIView/NSView that provides a simple yet powerful interface for creating Auto Layout constraints. 37 | */ 38 | @interface ALView (PureLayout) 39 | 40 | 41 | #pragma mark Factory & Initializer Methods 42 | 43 | /** Creates and returns a new view that does not convert the autoresizing mask into constraints. */ 44 | + (instancetype)newAutoLayoutView; 45 | 46 | /** Initializes and returns a new view that does not convert the autoresizing mask into constraints. */ 47 | - (instancetype)initForAutoLayout; 48 | 49 | 50 | #pragma mark Create Constraints Without Installing 51 | 52 | /** Prevents constraints created in the given constraints block from being automatically installed (activated). 53 | The constraints created from calls to the PureLayout API in the block are returned in a single array. */ 54 | + (NSArray *)autoCreateConstraintsWithoutInstalling:(ALConstraintsBlock)block; 55 | 56 | 57 | #pragma mark Set Priority For Constraints 58 | 59 | /** Sets the constraint priority to the given value for all constraints created using the PureLayout API within the given constraints block. 60 | NOTE: This method will have no effect (and will NOT set the priority) on constraints created or added without using the PureLayout API! */ 61 | + (void)autoSetPriority:(ALLayoutPriority)priority forConstraints:(ALConstraintsBlock)block; 62 | 63 | 64 | #pragma mark Set Identifier For Constraints 65 | 66 | #if __PureLayout_MinBaseSDK_iOS_8_0 67 | 68 | /** Sets the identifier for all constraints created using the PureLayout API within the given constraints block. 69 | NOTE: This method will have no effect (and will NOT set the identifier) on constraints created or added without using the PureLayout API! */ 70 | + (void)autoSetIdentifier:(NSString *)identifier forConstraints:(ALConstraintsBlock)block; 71 | 72 | #endif /* __PureLayout_MinBaseSDK_iOS_8_0 */ 73 | 74 | 75 | #pragma mark Center & Align in Superview 76 | 77 | /** Centers the view in its superview. */ 78 | - (NSArray *)autoCenterInSuperview; 79 | 80 | /** Aligns the view to the same axis of its superview. */ 81 | - (NSLayoutConstraint *)autoAlignAxisToSuperviewAxis:(ALAxis)axis; 82 | 83 | #if __PureLayout_MinBaseSDK_iOS_8_0 84 | 85 | /** Centers the view in its superview's margins. Available in iOS 8.0 and later. */ 86 | - (NSArray *)autoCenterInSuperviewMargins; 87 | 88 | /** Aligns the view to the corresponding margin axis of its superview. Available in iOS 8.0 and later. */ 89 | - (NSLayoutConstraint *)autoAlignAxisToSuperviewMarginAxis:(ALAxis)axis; 90 | 91 | #endif /* __PureLayout_MinBaseSDK_iOS_8_0 */ 92 | 93 | 94 | #pragma mark Pin Edges to Superview 95 | 96 | /** Pins the given edge of the view to the same edge of its superview. */ 97 | - (NSLayoutConstraint *)autoPinEdgeToSuperviewEdge:(ALEdge)edge; 98 | 99 | /** Pins the given edge of the view to the same edge of its superview with an inset. */ 100 | - (NSLayoutConstraint *)autoPinEdgeToSuperviewEdge:(ALEdge)edge withInset:(CGFloat)inset; 101 | 102 | /** Pins the given edge of the view to the same edge of its superview with an inset as a maximum or minimum. */ 103 | - (NSLayoutConstraint *)autoPinEdgeToSuperviewEdge:(ALEdge)edge withInset:(CGFloat)inset relation:(NSLayoutRelation)relation; 104 | 105 | /** Pins the edges of the view to the edges of its superview with the given edge insets. */ 106 | - (NSArray *)autoPinEdgesToSuperviewEdgesWithInsets:(ALEdgeInsets)insets; 107 | 108 | /** Pins 3 of the 4 edges of the view to the edges of its superview with the given edge insets, excluding one edge. */ 109 | - (NSArray *)autoPinEdgesToSuperviewEdgesWithInsets:(ALEdgeInsets)insets excludingEdge:(ALEdge)edge; 110 | 111 | #if __PureLayout_MinBaseSDK_iOS_8_0 112 | 113 | /** Pins the given edge of the view to the corresponding margin of its superview. Available in iOS 8.0 and later. */ 114 | - (NSLayoutConstraint *)autoPinEdgeToSuperviewMargin:(ALEdge)edge; 115 | 116 | /** Pins the given edge of the view to the corresponding margin of its superview as a maximum or minimum. Available in iOS 8.0 and later. */ 117 | - (NSLayoutConstraint *)autoPinEdgeToSuperviewMargin:(ALEdge)edge relation:(NSLayoutRelation)relation; 118 | 119 | /** Pins the edges of the view to the margins of its superview. Available in iOS 8.0 and later. */ 120 | - (NSArray *)autoPinEdgesToSuperviewMargins; 121 | 122 | /** Pins 3 of the 4 edges of the view to the margins of its superview excluding one edge. Available in iOS 8.0 and later. */ 123 | - (NSArray *)autoPinEdgesToSuperviewMarginsExcludingEdge:(ALEdge)edge; 124 | 125 | #endif /* __PureLayout_MinBaseSDK_iOS_8_0 */ 126 | 127 | 128 | #pragma mark Pin Edges 129 | 130 | /** Pins an edge of the view to a given edge of another view. */ 131 | - (NSLayoutConstraint *)autoPinEdge:(ALEdge)edge toEdge:(ALEdge)toEdge ofView:(ALView *)otherView; 132 | 133 | /** Pins an edge of the view to a given edge of another view with an offset. */ 134 | - (NSLayoutConstraint *)autoPinEdge:(ALEdge)edge toEdge:(ALEdge)toEdge ofView:(ALView *)otherView withOffset:(CGFloat)offset; 135 | 136 | /** Pins an edge of the view to a given edge of another view with an offset as a maximum or minimum. */ 137 | - (NSLayoutConstraint *)autoPinEdge:(ALEdge)edge toEdge:(ALEdge)toEdge ofView:(ALView *)otherView withOffset:(CGFloat)offset relation:(NSLayoutRelation)relation; 138 | 139 | 140 | #pragma mark Align Axes 141 | 142 | /** Aligns an axis of the view to the same axis of another view. */ 143 | - (NSLayoutConstraint *)autoAlignAxis:(ALAxis)axis toSameAxisOfView:(ALView *)otherView; 144 | 145 | /** Aligns an axis of the view to the same axis of another view with an offset. */ 146 | - (NSLayoutConstraint *)autoAlignAxis:(ALAxis)axis toSameAxisOfView:(ALView *)otherView withOffset:(CGFloat)offset; 147 | 148 | 149 | #pragma mark Match Dimensions 150 | 151 | /** Matches a dimension of the view to a given dimension of another view. */ 152 | - (NSLayoutConstraint *)autoMatchDimension:(ALDimension)dimension toDimension:(ALDimension)toDimension ofView:(ALView *)otherView; 153 | 154 | /** Matches a dimension of the view to a given dimension of another view with an offset. */ 155 | - (NSLayoutConstraint *)autoMatchDimension:(ALDimension)dimension toDimension:(ALDimension)toDimension ofView:(ALView *)otherView withOffset:(CGFloat)offset; 156 | 157 | /** Matches a dimension of the view to a given dimension of another view with an offset as a maximum or minimum. */ 158 | - (NSLayoutConstraint *)autoMatchDimension:(ALDimension)dimension toDimension:(ALDimension)toDimension ofView:(ALView *)otherView withOffset:(CGFloat)offset relation:(NSLayoutRelation)relation; 159 | 160 | /** Matches a dimension of the view to a multiple of a given dimension of another view. */ 161 | - (NSLayoutConstraint *)autoMatchDimension:(ALDimension)dimension toDimension:(ALDimension)toDimension ofView:(ALView *)otherView withMultiplier:(CGFloat)multiplier; 162 | 163 | /** Matches a dimension of the view to a multiple of a given dimension of another view as a maximum or minimum. */ 164 | - (NSLayoutConstraint *)autoMatchDimension:(ALDimension)dimension toDimension:(ALDimension)toDimension ofView:(ALView *)otherView withMultiplier:(CGFloat)multiplier relation:(NSLayoutRelation)relation; 165 | 166 | 167 | #pragma mark Set Dimensions 168 | 169 | /** Sets the view to a specific size. */ 170 | - (NSArray *)autoSetDimensionsToSize:(CGSize)size; 171 | 172 | /** Sets the given dimension of the view to a specific size. */ 173 | - (NSLayoutConstraint *)autoSetDimension:(ALDimension)dimension toSize:(CGFloat)size; 174 | 175 | /** Sets the given dimension of the view to a specific size as a maximum or minimum. */ 176 | - (NSLayoutConstraint *)autoSetDimension:(ALDimension)dimension toSize:(CGFloat)size relation:(NSLayoutRelation)relation; 177 | 178 | 179 | #pragma mark Set Content Compression Resistance & Hugging 180 | 181 | /** Sets the priority of content compression resistance for an axis. 182 | NOTE: This method must be called from within the block passed into the method +[UIView autoSetPriority:forConstraints:] */ 183 | - (void)autoSetContentCompressionResistancePriorityForAxis:(ALAxis)axis; 184 | 185 | /** Sets the priority of content hugging for an axis. 186 | NOTE: This method must be called from within the block passed into the method +[UIView autoSetPriority:forConstraints:] */ 187 | - (void)autoSetContentHuggingPriorityForAxis:(ALAxis)axis; 188 | 189 | 190 | #pragma mark Constrain Any Attributes 191 | 192 | /** Constrains an attribute of the view to a given attribute of another view. */ 193 | - (NSLayoutConstraint *)autoConstrainAttribute:(ALAttribute)attribute toAttribute:(ALAttribute)toAttribute ofView:(ALView *)otherView; 194 | 195 | /** Constrains an attribute of the view to a given attribute of another view with an offset. */ 196 | - (NSLayoutConstraint *)autoConstrainAttribute:(ALAttribute)attribute toAttribute:(ALAttribute)toAttribute ofView:(ALView *)otherView withOffset:(CGFloat)offset; 197 | 198 | /** Constrains an attribute of the view to a given attribute of another view with an offset as a maximum or minimum. */ 199 | - (NSLayoutConstraint *)autoConstrainAttribute:(ALAttribute)attribute toAttribute:(ALAttribute)toAttribute ofView:(ALView *)otherView withOffset:(CGFloat)offset relation:(NSLayoutRelation)relation; 200 | 201 | /** Constrains an attribute of the view to a given attribute of another view with a multiplier. */ 202 | - (NSLayoutConstraint *)autoConstrainAttribute:(ALAttribute)attribute toAttribute:(ALAttribute)toAttribute ofView:(ALView *)otherView withMultiplier:(CGFloat)multiplier; 203 | 204 | /** Constrains an attribute of the view to a given attribute of another view with a multiplier as a maximum or minimum. */ 205 | - (NSLayoutConstraint *)autoConstrainAttribute:(ALAttribute)attribute toAttribute:(ALAttribute)toAttribute ofView:(ALView *)otherView withMultiplier:(CGFloat)multiplier relation:(NSLayoutRelation)relation; 206 | 207 | 208 | #pragma mark Pin to Layout Guides (iOS only) 209 | 210 | #if TARGET_OS_IPHONE 211 | 212 | /** Pins the top edge of the view to the top layout guide of the given view controller with an inset. Available on iOS only. */ 213 | - (NSLayoutConstraint *)autoPinToTopLayoutGuideOfViewController:(UIViewController *)viewController withInset:(CGFloat)inset; 214 | 215 | /** Pins the top edge of the view to the top layout guide of the given view controller with an inset as a maximum or minimum. Available on iOS only. */ 216 | - (NSLayoutConstraint *)autoPinToTopLayoutGuideOfViewController:(UIViewController *)viewController withInset:(CGFloat)inset relation:(NSLayoutRelation)relation; 217 | 218 | /** Pins the bottom edge of the view to the bottom layout guide of the given view controller with an inset. Available on iOS only. */ 219 | - (NSLayoutConstraint *)autoPinToBottomLayoutGuideOfViewController:(UIViewController *)viewController withInset:(CGFloat)inset; 220 | 221 | /** Pins the bottom edge of the view to the bottom layout guide of the given view controller with an inset as a maximum or minimum. Available on iOS only. */ 222 | - (NSLayoutConstraint *)autoPinToBottomLayoutGuideOfViewController:(UIViewController *)viewController withInset:(CGFloat)inset relation:(NSLayoutRelation)relation; 223 | 224 | #endif /* TARGET_OS_IPHONE */ 225 | 226 | 227 | #pragma mark Deprecated Methods 228 | 229 | /** DEPRECATED as of PureLayout v2.0.0. Retain a reference to and remove specific constraints instead, or recreate the view(s) entirely to remove all constraints. 230 | Removes all explicit constraints that affect the view. 231 | WARNING: Apple's constraint solver is not optimized for large-scale constraint removal; you may encounter major performance issues after using this method. 232 | NOTE: This method preserves implicit constraints, such as intrinsic content size constraints, which you usually do not want to remove. */ 233 | - (void)autoRemoveConstraintsAffectingView __attribute__((deprecated)); 234 | 235 | /** DEPRECATED as of PureLayout v2.0.0. Retain a reference to and remove specific constraints instead, or recreate the view(s) entirely to remove all constraints. 236 | Removes all constraints that affect the view, optionally including implicit constraints. 237 | WARNING: Apple's constraint solver is not optimized for large-scale constraint removal; you may encounter major performance issues after using this method. 238 | NOTE: Implicit constraints are auto-generated lower priority constraints, and you usually do not want to remove these. */ 239 | - (void)autoRemoveConstraintsAffectingViewIncludingImplicitConstraints:(BOOL)shouldRemoveImplicitConstraints __attribute__((deprecated)); 240 | 241 | /** DEPRECATED as of PureLayout v2.0.0. Retain a reference to and remove specific constraints instead, or recreate the view(s) entirely to remove all constraints. 242 | Recursively removes all explicit constraints that affect the view and its subviews. 243 | WARNING: Apple's constraint solver is not optimized for large-scale constraint removal; you may encounter major performance issues after using this method. 244 | NOTE: This method preserves implicit constraints, such as intrinsic content size constraints, which you usually do not want to remove. */ 245 | - (void)autoRemoveConstraintsAffectingViewAndSubviews __attribute__((deprecated)); 246 | 247 | /** DEPRECATED as of PureLayout v2.0.0. Retain a reference to and remove specific constraints instead, or recreate the view(s) entirely to remove all constraints. 248 | Recursively removes all constraints from the view and its subviews, optionally including implicit constraints. 249 | WARNING: Apple's constraint solver is not optimized for large-scale constraint removal; you may encounter major performance issues after using this method. 250 | NOTE: Implicit constraints are auto-generated lower priority constraints, and you usually do not want to remove these. */ 251 | - (void)autoRemoveConstraintsAffectingViewAndSubviewsIncludingImplicitConstraints:(BOOL)shouldRemoveImplicitConstraints __attribute__((deprecated)); 252 | 253 | @end 254 | -------------------------------------------------------------------------------- /Example/Pods/PureLayout/PureLayout/PureLayout/NSArray+PureLayout.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+PureLayout.m 3 | // v2.0.5 4 | // https://github.com/smileyborg/PureLayout 5 | // 6 | // Copyright (c) 2012 Richard Turton 7 | // Copyright (c) 2013-2015 Tyler Fox 8 | // 9 | // This code is distributed under the terms and conditions of the MIT license. 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a copy 12 | // of this software and associated documentation files (the "Software"), to 13 | // deal in the Software without restriction, including without limitation the 14 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 15 | // sell copies of the Software, and to permit persons to whom the Software is 16 | // furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included in 19 | // all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 27 | // IN THE SOFTWARE. 28 | // 29 | 30 | #import "NSArray+PureLayout.h" 31 | #import "ALView+PureLayout.h" 32 | #import "NSLayoutConstraint+PureLayout.h" 33 | #import "PureLayout+Internal.h" 34 | 35 | 36 | #pragma mark - NSArray+PureLayout 37 | 38 | @implementation NSArray (PureLayout) 39 | 40 | 41 | #pragma mark Array of Constraints 42 | 43 | /** 44 | Activates the constraints in this array. 45 | */ 46 | - (void)autoInstallConstraints 47 | { 48 | #if __PureLayout_MinBaseSDK_iOS_8_0 || __PureLayout_MinBaseSDK_OSX_10_10 49 | if ([NSLayoutConstraint respondsToSelector:@selector(activateConstraints:)]) { 50 | for (id object in self) { 51 | if ([object isKindOfClass:[NSLayoutConstraint class]]) { 52 | [ALView al_applyGlobalStateToConstraint:object]; 53 | } 54 | } 55 | if ([ALView al_preventAutomaticConstraintInstallation]) { 56 | [[ALView al_currentArrayOfCreatedConstraints] addObjectsFromArray:self]; 57 | } else { 58 | [NSLayoutConstraint activateConstraints:self]; 59 | } 60 | return; 61 | } 62 | #endif /* __PureLayout_MinBaseSDK_iOS_8_0 || __PureLayout_MinBaseSDK_OSX_10_10 */ 63 | 64 | for (id object in self) { 65 | if ([object isKindOfClass:[NSLayoutConstraint class]]) { 66 | [((NSLayoutConstraint *)object) autoInstall]; 67 | } 68 | } 69 | } 70 | 71 | /** 72 | Deactivates the constraints in this array. 73 | */ 74 | - (void)autoRemoveConstraints 75 | { 76 | #if __PureLayout_MinBaseSDK_iOS_8_0 || __PureLayout_MinBaseSDK_OSX_10_10 77 | if ([NSLayoutConstraint respondsToSelector:@selector(deactivateConstraints:)]) { 78 | [NSLayoutConstraint deactivateConstraints:self]; 79 | return; 80 | } 81 | #endif /* __PureLayout_MinBaseSDK_iOS_8_0 || __PureLayout_MinBaseSDK_OSX_10_10 */ 82 | 83 | for (id object in self) { 84 | if ([object isKindOfClass:[NSLayoutConstraint class]]) { 85 | [((NSLayoutConstraint *)object) autoRemove]; 86 | } 87 | } 88 | } 89 | 90 | #if __PureLayout_MinBaseSDK_iOS_8_0 91 | 92 | /** 93 | Sets the string as the identifier for the constraints in this array. Available in iOS 7.0 and OS X 10.9 and later. 94 | The identifier will be printed along with each constraint's description. 95 | This is helpful to document the constraints' purpose and aid in debugging. 96 | 97 | @param identifier A string used to identify the constraints in this array. 98 | @return This array. 99 | */ 100 | - (instancetype)autoIdentifyConstraints:(NSString *)identifier 101 | { 102 | for (id object in self) { 103 | if ([object isKindOfClass:[NSLayoutConstraint class]]) { 104 | [((NSLayoutConstraint *)object) autoIdentify:identifier]; 105 | } 106 | } 107 | return self; 108 | } 109 | 110 | #endif /* __PureLayout_MinBaseSDK_iOS_8_0 */ 111 | 112 | 113 | #pragma mark Array of Views 114 | 115 | /** 116 | Aligns views in this array to one another along a given edge. 117 | Note: This array must contain at least 2 views, and all views must share a common superview. 118 | 119 | @param edge The edge to which the views will be aligned. 120 | @return An array of constraints added. 121 | */ 122 | - (NSArray *)autoAlignViewsToEdge:(ALEdge)edge 123 | { 124 | NSAssert([self al_containsMinimumNumberOfViews:2], @"This array must contain at least 2 views."); 125 | NSMutableArray *constraints = [NSMutableArray new]; 126 | ALView *previousView = nil; 127 | for (id object in self) { 128 | if ([object isKindOfClass:[ALView class]]) { 129 | ALView *view = (ALView *)object; 130 | view.translatesAutoresizingMaskIntoConstraints = NO; 131 | if (previousView) { 132 | [constraints addObject:[view autoPinEdge:edge toEdge:edge ofView:previousView]]; 133 | } 134 | previousView = view; 135 | } 136 | } 137 | return constraints; 138 | } 139 | 140 | /** 141 | Aligns views in this array to one another along a given axis. 142 | Note: This array must contain at least 2 views, and all views must share a common superview. 143 | 144 | @param axis The axis to which the views will be aligned. 145 | @return An array of constraints added. 146 | */ 147 | - (NSArray *)autoAlignViewsToAxis:(ALAxis)axis 148 | { 149 | NSAssert([self al_containsMinimumNumberOfViews:2], @"This array must contain at least 2 views."); 150 | NSMutableArray *constraints = [NSMutableArray new]; 151 | ALView *previousView = nil; 152 | for (id object in self) { 153 | if ([object isKindOfClass:[ALView class]]) { 154 | ALView *view = (ALView *)object; 155 | view.translatesAutoresizingMaskIntoConstraints = NO; 156 | if (previousView) { 157 | [constraints addObject:[view autoAlignAxis:axis toSameAxisOfView:previousView]]; 158 | } 159 | previousView = view; 160 | } 161 | } 162 | return constraints; 163 | } 164 | 165 | /** 166 | Matches a given dimension of all the views in this array. 167 | Note: This array must contain at least 2 views, and all views must share a common superview. 168 | 169 | @param dimension The dimension to match for all of the views. 170 | @return An array of constraints added. 171 | */ 172 | - (NSArray *)autoMatchViewsDimension:(ALDimension)dimension 173 | { 174 | NSAssert([self al_containsMinimumNumberOfViews:2], @"This array must contain at least 2 views."); 175 | NSMutableArray *constraints = [NSMutableArray new]; 176 | ALView *previousView = nil; 177 | for (id object in self) { 178 | if ([object isKindOfClass:[ALView class]]) { 179 | ALView *view = (ALView *)object; 180 | view.translatesAutoresizingMaskIntoConstraints = NO; 181 | if (previousView) { 182 | [constraints addObject:[view autoMatchDimension:dimension toDimension:dimension ofView:previousView]]; 183 | } 184 | previousView = view; 185 | } 186 | } 187 | return constraints; 188 | } 189 | 190 | /** 191 | Sets the given dimension of all the views in this array to a given size. 192 | Note: This array must contain at least 1 view. 193 | 194 | @param dimension The dimension of each of the views to set. 195 | @param size The size to set the given dimension of each view to. 196 | @return An array of constraints added. 197 | */ 198 | - (NSArray *)autoSetViewsDimension:(ALDimension)dimension toSize:(CGFloat)size 199 | { 200 | NSAssert([self al_containsMinimumNumberOfViews:1], @"This array must contain at least 1 view."); 201 | NSMutableArray *constraints = [NSMutableArray new]; 202 | for (id object in self) { 203 | if ([object isKindOfClass:[ALView class]]) { 204 | ALView *view = (ALView *)object; 205 | view.translatesAutoresizingMaskIntoConstraints = NO; 206 | [constraints addObject:[view autoSetDimension:dimension toSize:size]]; 207 | } 208 | } 209 | return constraints; 210 | } 211 | 212 | /** 213 | Sets all of the views in this array to a given size. 214 | Note: This array must contain at least 1 view. 215 | 216 | @param size The size to set each view's dimensions to. 217 | @return An array of constraints added. 218 | */ 219 | - (NSArray *)autoSetViewsDimensionsToSize:(CGSize)size 220 | { 221 | NSMutableArray *constraints = [NSMutableArray new]; 222 | [constraints addObjectsFromArray:[self autoSetViewsDimension:ALDimensionWidth toSize:size.width]]; 223 | [constraints addObjectsFromArray:[self autoSetViewsDimension:ALDimensionHeight toSize:size.height]]; 224 | return constraints; 225 | } 226 | 227 | 228 | /** 229 | Distributes the views in this array equally along the selected axis in their superview. 230 | Views will be the same size (variable) in the dimension along the axis and will have spacing (fixed) between them, 231 | including from the first and last views to their superview. 232 | 233 | @param axis The axis along which to distribute the views. 234 | @param alignment The attribute to use to align all the views to one another. 235 | @param spacing The fixed amount of spacing between each view. 236 | @return An array of constraints added. 237 | */ 238 | - (NSArray *)autoDistributeViewsAlongAxis:(ALAxis)axis 239 | alignedTo:(ALAttribute)alignment 240 | withFixedSpacing:(CGFloat)spacing 241 | { 242 | return [self autoDistributeViewsAlongAxis:axis 243 | alignedTo:alignment 244 | withFixedSpacing:spacing 245 | insetSpacing:YES]; 246 | } 247 | 248 | /** 249 | Distributes the views in this array equally along the selected axis in their superview. 250 | Views will be the same size (variable) in the dimension along the axis and will have spacing (fixed) between them. 251 | The first and last views can optionally be inset from their superview by the same amount of spacing as between views. 252 | 253 | @param axis The axis along which to distribute the views. 254 | @param alignment The attribute to use to align all the views to one another. 255 | @param spacing The fixed amount of spacing between each view. 256 | @param shouldSpaceInsets Whether the first and last views should be equally inset from their superview. 257 | @return An array of constraints added. 258 | */ 259 | - (NSArray *)autoDistributeViewsAlongAxis:(ALAxis)axis 260 | alignedTo:(ALAttribute)alignment 261 | withFixedSpacing:(CGFloat)spacing 262 | insetSpacing:(BOOL)shouldSpaceInsets 263 | { 264 | return [self autoDistributeViewsAlongAxis:axis 265 | alignedTo:alignment 266 | withFixedSpacing:spacing 267 | insetSpacing:shouldSpaceInsets 268 | matchedSizes:YES]; 269 | } 270 | 271 | /** 272 | Distributes the views in this array equally along the selected axis in their superview. 273 | Views will have fixed spacing between them, and can optionally be constrained to the same size in the dimension along the axis. 274 | The first and last views can optionally be inset from their superview by the same amount of spacing as between views. 275 | 276 | @param axis The axis along which to distribute the views. 277 | @param alignment The attribute to use to align all the views to one another. 278 | @param spacing The fixed amount of spacing between each view. 279 | @param shouldSpaceInsets Whether the first and last views should be equally inset from their superview. 280 | @param shouldMatchSizes Whether all views will be constrained to be the same size in the dimension along the axis. 281 | NOTE: All views must specify an intrinsic content size if passing NO, otherwise the layout will be ambiguous! 282 | @return An array of constraints added. 283 | */ 284 | - (NSArray *)autoDistributeViewsAlongAxis:(ALAxis)axis 285 | alignedTo:(ALAttribute)alignment 286 | withFixedSpacing:(CGFloat)spacing 287 | insetSpacing:(BOOL)shouldSpaceInsets 288 | matchedSizes:(BOOL)shouldMatchSizes 289 | { 290 | NSAssert([self al_containsMinimumNumberOfViews:2], @"This array must contain at least 2 views to distribute."); 291 | ALDimension matchedDimension; 292 | ALEdge firstEdge, lastEdge; 293 | switch (axis) { 294 | case ALAxisHorizontal: 295 | case ALAxisBaseline: // same value as ALAxisLastBaseline 296 | #if __PureLayout_MinBaseSDK_iOS_8_0 297 | case ALAxisFirstBaseline: 298 | #endif /* __PureLayout_MinBaseSDK_iOS_8_0 */ 299 | matchedDimension = ALDimensionWidth; 300 | firstEdge = ALEdgeLeading; 301 | lastEdge = ALEdgeTrailing; 302 | break; 303 | case ALAxisVertical: 304 | matchedDimension = ALDimensionHeight; 305 | firstEdge = ALEdgeTop; 306 | lastEdge = ALEdgeBottom; 307 | break; 308 | default: 309 | NSAssert(nil, @"Not a valid ALAxis."); 310 | return nil; 311 | } 312 | CGFloat leadingSpacing = shouldSpaceInsets ? spacing : 0.0; 313 | CGFloat trailingSpacing = shouldSpaceInsets ? spacing : 0.0; 314 | 315 | NSMutableArray *constraints = [NSMutableArray new]; 316 | ALView *previousView = nil; 317 | for (id object in self) { 318 | if ([object isKindOfClass:[ALView class]]) { 319 | ALView *view = (ALView *)object; 320 | view.translatesAutoresizingMaskIntoConstraints = NO; 321 | if (previousView) { 322 | // Second, Third, ... View 323 | [constraints addObject:[view autoPinEdge:firstEdge toEdge:lastEdge ofView:previousView withOffset:spacing]]; 324 | if (shouldMatchSizes) { 325 | [constraints addObject:[view autoMatchDimension:matchedDimension toDimension:matchedDimension ofView:previousView]]; 326 | } 327 | [constraints addObject:[view al_alignAttribute:alignment toView:previousView forAxis:axis]]; 328 | } 329 | else { 330 | // First view 331 | [constraints addObject:[view autoPinEdgeToSuperviewEdge:firstEdge withInset:leadingSpacing]]; 332 | } 333 | previousView = view; 334 | } 335 | } 336 | if (previousView) { 337 | // Last View 338 | [constraints addObject:[previousView autoPinEdgeToSuperviewEdge:lastEdge withInset:trailingSpacing]]; 339 | } 340 | return constraints; 341 | } 342 | 343 | /** 344 | Distributes the views in this array equally along the selected axis in their superview. 345 | Views will be the same size (fixed) in the dimension along the axis and will have spacing (variable) between them, 346 | including from the first and last views to their superview. 347 | 348 | @param axis The axis along which to distribute the views. 349 | @param alignment The attribute to use to align all the views to one another. 350 | @param size The fixed size of each view in the dimension along the given axis. 351 | @return An array of constraints added. 352 | */ 353 | - (NSArray *)autoDistributeViewsAlongAxis:(ALAxis)axis 354 | alignedTo:(ALAttribute)alignment 355 | withFixedSize:(CGFloat)size 356 | { 357 | return [self autoDistributeViewsAlongAxis:axis 358 | alignedTo:alignment 359 | withFixedSize:size 360 | insetSpacing:YES]; 361 | } 362 | 363 | /** 364 | Distributes the views in this array equally along the selected axis in their superview. 365 | Views will be the same size (fixed) in the dimension along the axis and will have spacing (variable) between them. 366 | The first and last views can optionally be inset from their superview by the same amount of spacing as between views. 367 | 368 | @param axis The axis along which to distribute the views. 369 | @param alignment The attribute to use to align all the views to one another. 370 | @param size The fixed size of each view in the dimension along the given axis. 371 | @param shouldSpaceInsets Whether the first and last views should be equally inset from their superview. 372 | @return An array of constraints added. 373 | */ 374 | - (NSArray *)autoDistributeViewsAlongAxis:(ALAxis)axis 375 | alignedTo:(ALAttribute)alignment 376 | withFixedSize:(CGFloat)size 377 | insetSpacing:(BOOL)shouldSpaceInsets 378 | { 379 | NSAssert([self al_containsMinimumNumberOfViews:2], @"This array must contain at least 2 views to distribute."); 380 | ALDimension fixedDimension; 381 | NSLayoutAttribute attribute; 382 | switch (axis) { 383 | case ALAxisHorizontal: 384 | case ALAxisBaseline: // same value as ALAxisLastBaseline 385 | #if __PureLayout_MinBaseSDK_iOS_8_0 386 | case ALAxisFirstBaseline: 387 | #endif /* __PureLayout_MinBaseSDK_iOS_8_0 */ 388 | fixedDimension = ALDimensionWidth; 389 | attribute = NSLayoutAttributeCenterX; 390 | break; 391 | case ALAxisVertical: 392 | fixedDimension = ALDimensionHeight; 393 | attribute = NSLayoutAttributeCenterY; 394 | break; 395 | default: 396 | NSAssert(nil, @"Not a valid ALAxis."); 397 | return nil; 398 | } 399 | #if TARGET_OS_IPHONE 400 | # if !defined(PURELAYOUT_APP_EXTENSIONS) 401 | BOOL isRightToLeftLayout = [[UIApplication sharedApplication] userInterfaceLayoutDirection] == UIUserInterfaceLayoutDirectionRightToLeft; 402 | # else 403 | // App Extensions may not access -[UIApplication sharedApplication]; fall back to checking the bundle's preferred localization character direction 404 | BOOL isRightToLeftLayout = [NSLocale characterDirectionForLanguage:[[NSBundle mainBundle] preferredLocalizations][0]] == NSLocaleLanguageDirectionRightToLeft; 405 | # endif /* !defined(PURELAYOUT_APP_EXTENSIONS) */ 406 | #else 407 | BOOL isRightToLeftLayout = [[NSApplication sharedApplication] userInterfaceLayoutDirection] == NSUserInterfaceLayoutDirectionRightToLeft; 408 | #endif /* TARGET_OS_IPHONE */ 409 | BOOL shouldFlipOrder = isRightToLeftLayout && (axis != ALAxisVertical); // imitate the effect of leading/trailing when distributing horizontally 410 | 411 | NSMutableArray *constraints = [NSMutableArray new]; 412 | NSArray *views = [self al_copyViewsOnly]; 413 | NSUInteger numberOfViews = [views count]; 414 | ALView *commonSuperview = [views al_commonSuperviewOfViews]; 415 | ALView *previousView = nil; 416 | for (NSUInteger i = 0; i < numberOfViews; i++) { 417 | ALView *view = shouldFlipOrder ? views[numberOfViews - i - 1] : views[i]; 418 | view.translatesAutoresizingMaskIntoConstraints = NO; 419 | [constraints addObject:[view autoSetDimension:fixedDimension toSize:size]]; 420 | CGFloat multiplier, constant; 421 | if (shouldSpaceInsets) { 422 | multiplier = (i * 2.0 + 2.0) / (numberOfViews + 1.0); 423 | constant = (multiplier - 1.0) * size / 2.0; 424 | } else { 425 | multiplier = (i * 2.0) / (numberOfViews - 1.0); 426 | constant = (-multiplier + 1.0) * size / 2.0; 427 | } 428 | // If the multiplier is very close to 0, set it to the minimum value to prevent the second item in the constraint from being lost. Filed as rdar://19168380 429 | if (fabs(multiplier) < kMULTIPLIER_MIN_VALUE) { 430 | multiplier = kMULTIPLIER_MIN_VALUE; 431 | } 432 | NSLayoutConstraint *constraint = [NSLayoutConstraint constraintWithItem:view attribute:attribute relatedBy:NSLayoutRelationEqual toItem:commonSuperview attribute:attribute multiplier:multiplier constant:constant]; 433 | [constraint autoInstall]; 434 | [constraints addObject:constraint]; 435 | if (previousView) { 436 | [constraints addObject:[view al_alignAttribute:alignment toView:previousView forAxis:axis]]; 437 | } 438 | previousView = view; 439 | } 440 | return constraints; 441 | } 442 | 443 | #pragma mark Internal Helper Methods 444 | 445 | /** 446 | Returns the common superview for the views in this array. 447 | Raises an exception if the views in this array do not share a common superview. 448 | 449 | @return The common superview for the views in this array. 450 | */ 451 | - (ALView *)al_commonSuperviewOfViews 452 | { 453 | ALView *commonSuperview = nil; 454 | ALView *previousView = nil; 455 | for (id object in self) { 456 | if ([object isKindOfClass:[ALView class]]) { 457 | ALView *view = (ALView *)object; 458 | if (previousView) { 459 | commonSuperview = [view al_commonSuperviewWithView:commonSuperview]; 460 | } else { 461 | commonSuperview = view; 462 | } 463 | previousView = view; 464 | } 465 | } 466 | NSAssert(commonSuperview, @"Can't constrain views that do not share a common superview. Make sure that all the views in this array have been added into the same view hierarchy."); 467 | return commonSuperview; 468 | } 469 | 470 | /** 471 | Determines whether this array contains a minimum number of views. 472 | 473 | @param minimumNumberOfViews The minimum number of views to check for. 474 | @return YES if this array contains at least the minimum number of views, NO otherwise. 475 | */ 476 | - (BOOL)al_containsMinimumNumberOfViews:(NSUInteger)minimumNumberOfViews 477 | { 478 | NSUInteger numberOfViews = 0; 479 | for (id object in self) { 480 | if ([object isKindOfClass:[ALView class]]) { 481 | numberOfViews++; 482 | if (numberOfViews >= minimumNumberOfViews) { 483 | return YES; 484 | } 485 | } 486 | } 487 | return numberOfViews >= minimumNumberOfViews; 488 | } 489 | 490 | /** 491 | Creates a copy of this array containing only the view objects in it. 492 | 493 | @return A new array containing only the views that are in this array. 494 | */ 495 | - (NSArray *)al_copyViewsOnly 496 | { 497 | NSMutableArray *viewsOnlyArray = [NSMutableArray arrayWithCapacity:[self count]]; 498 | for (id object in self) { 499 | if ([object isKindOfClass:[ALView class]]) { 500 | [viewsOnlyArray addObject:object]; 501 | } 502 | } 503 | return viewsOnlyArray; 504 | } 505 | 506 | @end 507 | --------------------------------------------------------------------------------