Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: johnlui/SwiftNotice
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.2
Choose a base ref
...
head repository: johnlui/SwiftNotice
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: swift4
Choose a head ref

Commits on Jul 27, 2015

  1. add comment

    johnlui committed Jul 27, 2015
    Copy the full SHA
    426d865 View commit details

Commits on Jul 28, 2015

  1. Copy the full SHA
    1a34b1b View commit details
  2. change noticeTop api

    johnlui committed Jul 28, 2015
    Copy the full SHA
    e060693 View commit details

Commits on Jul 31, 2015

  1. modify README

    johnlui committed Jul 31, 2015
    Copy the full SHA
    454bb52 View commit details

Commits on Aug 8, 2015

  1. Copy the full SHA
    b0c71fa View commit details

Commits on Sep 24, 2015

  1. Copy the full SHA
    eb9dc78 View commit details
  2. add LICENSE

    johnlui committed Sep 24, 2015
    Copy the full SHA
    df8e311 View commit details

Commits on Jan 11, 2016

  1. Copy the full SHA
    c0dc671 View commit details

Commits on Mar 24, 2016

  1. Fix: typo

    antife-yinyue committed Mar 24, 2016
    Copy the full SHA
    db257ed View commit details
  2. Merge pull request #27 from jsw0528/master

    Fix: typo
    johnlui committed Mar 24, 2016
    Copy the full SHA
    4e14752 View commit details

Commits on May 13, 2016

  1. 更新了2个版本语法问题

    1.select 问题
    2. ++ 功能,将在swift 3.0被遗弃,更换了+=
    T3rdW committed May 13, 2016
    Copy the full SHA
    0b32a10 View commit details
  2. Merge pull request #30 from T3rdW/master

    更新了2个版本语法问题
    johnlui committed May 13, 2016
    Copy the full SHA
    45bf94c View commit details

Commits on Jun 27, 2016

  1. Copy the full SHA
    7a6fb56 View commit details
  2. Merge pull request #34 from johnlui/swift3

    修正 gif 无法正常显示的问题
    johnlui authored Jun 27, 2016
    Copy the full SHA
    cfb0418 View commit details

Commits on Sep 20, 2016

  1. Update to swift3.0

    Notes: there is one comments which Im not too sure how to re-write, please check out around *line 143-144*
    iceman201 authored Sep 20, 2016
    Copy the full SHA
    9e8a495 View commit details
  2. Merge pull request #42 from iceman201/patch-1

    Update to swift3.0
    johnlui authored Sep 20, 2016
    Copy the full SHA
    8b9f644 View commit details
  3. Copy the full SHA
    e08fc92 View commit details

Commits on Sep 21, 2016

  1. everything is done

    johnlui committed Sep 21, 2016
    Copy the full SHA
    2b307a3 View commit details
  2. modify README

    johnlui committed Sep 21, 2016
    Copy the full SHA
    ec45e4b View commit details

Commits on Sep 27, 2016

  1. fix iOS 8

    johnlui committed Sep 27, 2016
    Copy the full SHA
    0d7fa09 View commit details

Commits on Nov 24, 2016

  1. 简单增加动画效果

    shiweifu committed Nov 24, 2016
    Copy the full SHA
    be09a0d View commit details

Commits on Nov 25, 2016

  1. Merge pull request #43 from shiweifu/swift3

    简单增加动画效果
    johnlui authored Nov 25, 2016
    Copy the full SHA
    8e0d503 View commit details

Commits on Apr 5, 2017

  1. Copy the full SHA
    e5e5d87 View commit details

Commits on Apr 6, 2017

  1. Merge pull request #47 from zzjzz9266a/swift3

    add new api for closing each single notice
    johnlui authored Apr 6, 2017
    Copy the full SHA
    2888db9 View commit details

Commits on Jun 2, 2017

  1. Copy the full SHA
    7c43616 View commit details
  2. Merge pull request #50 from zzjzz9266a/swift3

    adjust the size of label if text is too long
    johnlui authored Jun 2, 2017
    Copy the full SHA
    a335414 View commit details

Commits on Oct 26, 2017

  1. Support for Swift4

    zungjam committed Oct 26, 2017
    Copy the full SHA
    1ff2c87 View commit details
  2. Merge pull request #51 from nsuxin/Swift4

    Support for Swift4
    johnlui authored Oct 26, 2017
    Copy the full SHA
    5d4d802 View commit details

Commits on Nov 16, 2017

  1. support iPhone X

    johnlui committed Nov 16, 2017
    Copy the full SHA
    0bce314 View commit details
  2. modify README

    johnlui committed Nov 16, 2017
    Copy the full SHA
    a46f3d0 View commit details

Commits on Apr 10, 2018

  1. compatible to Xcode 9.3

    johnlui committed Apr 10, 2018
    Copy the full SHA
    38516c1 View commit details

Commits on Jan 2, 2019

  1. iOS 8 bug fix

    johnlui committed Jan 2, 2019
    Copy the full SHA
    51d8e46 View commit details
Showing with 861 additions and 156 deletions.
  1. +21 −0 LICENSE
  2. +15 −13 README.md
  3. BIN SwiftNotice.gif
  4. +269 −106 SwiftNotice.swift
  5. +37 −1 SwiftNoticeExample/SwiftNoticeExample.xcodeproj/project.pbxproj
  6. +8 −0 ...iceExample/SwiftNoticeExample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
  7. BIN ...ample.xcodeproj/project.xcworkspace/xcuserdata/JohnLui.xcuserdatad/UserInterfaceState.xcuserstate
  8. BIN ...xample.xcodeproj/project.xcworkspace/xcuserdata/dren_a.xcuserdatad/UserInterfaceState.xcuserstate
  9. BIN ...ple.xcodeproj/project.xcworkspace/xcuserdata/leqicheng.xcuserdatad/UserInterfaceState.xcuserstate
  10. BIN ...mple.xcodeproj/project.xcworkspace/xcuserdata/zhufaner.xcuserdatad/UserInterfaceState.xcuserstate
  11. +5 −0 .../SwiftNoticeExample.xcodeproj/xcuserdata/JohnLui.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
  12. +101 −0 ...SwiftNoticeExample.xcodeproj/xcuserdata/JohnLui.xcuserdatad/xcschemes/SwiftNoticeExample.xcscheme
  13. +27 −0 ...le/SwiftNoticeExample.xcodeproj/xcuserdata/JohnLui.xcuserdatad/xcschemes/xcschememanagement.plist
  14. +101 −0 ...wiftNoticeExample.xcodeproj/xcuserdata/zhufaner.xcuserdatad/xcschemes/SwiftNoticeExample.xcscheme
  15. +27 −0 ...e/SwiftNoticeExample.xcodeproj/xcuserdata/zhufaner.xcuserdatad/xcschemes/xcschememanagement.plist
  16. +6 −6 SwiftNoticeExample/SwiftNoticeExample/AppDelegate.swift
  17. +39 −19 SwiftNoticeExample/SwiftNoticeExample/Base.lproj/Main.storyboard
  18. +10 −0 SwiftNoticeExample/SwiftNoticeExample/Images.xcassets/AppIcon.appiconset/Contents.json
  19. +6 −0 SwiftNoticeExample/SwiftNoticeExample/Images.xcassets/Contents.json
  20. +21 −0 SwiftNoticeExample/SwiftNoticeExample/Images.xcassets/loading1.imageset/Contents.json
  21. BIN SwiftNoticeExample/SwiftNoticeExample/Images.xcassets/loading1.imageset/loading1@2x.png
  22. +21 −0 SwiftNoticeExample/SwiftNoticeExample/Images.xcassets/loading2.imageset/Contents.json
  23. BIN SwiftNoticeExample/SwiftNoticeExample/Images.xcassets/loading2.imageset/loading2@2x.png
  24. +21 −0 SwiftNoticeExample/SwiftNoticeExample/Images.xcassets/loading3.imageset/Contents.json
  25. BIN SwiftNoticeExample/SwiftNoticeExample/Images.xcassets/loading3.imageset/loading3@2x.png
  26. +21 −0 SwiftNoticeExample/SwiftNoticeExample/Images.xcassets/loading4.imageset/Contents.json
  27. BIN SwiftNoticeExample/SwiftNoticeExample/Images.xcassets/loading4.imageset/loading4@2x.png
  28. +21 −0 SwiftNoticeExample/SwiftNoticeExample/Images.xcassets/loading5.imageset/Contents.json
  29. BIN SwiftNoticeExample/SwiftNoticeExample/Images.xcassets/loading5.imageset/loading5@2x.png
  30. +21 −0 SwiftNoticeExample/SwiftNoticeExample/Images.xcassets/loading6.imageset/Contents.json
  31. BIN SwiftNoticeExample/SwiftNoticeExample/Images.xcassets/loading6.imageset/loading6@2x.png
  32. +21 −0 SwiftNoticeExample/SwiftNoticeExample/Images.xcassets/loading7.imageset/Contents.json
  33. BIN SwiftNoticeExample/SwiftNoticeExample/Images.xcassets/loading7.imageset/loading7@2x.png
  34. +3 −0 SwiftNoticeExample/SwiftNoticeExample/Info.plist
  35. +38 −10 SwiftNoticeExample/SwiftNoticeExample/ViewController.swift
  36. +1 −1 SwiftNoticeExample/SwiftNoticeExampleTests/SwiftNoticeExampleTests.swift
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License

Copyright (c) <2015-2016> <JohnLui> wenhanlv@gmail.com

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
28 changes: 15 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
SwiftNotice
--
SwiftNotice is a GUI library for displaying various popups written in pure Swift, fits any scrollview.
SwiftNotice is a GUI library for displaying various popups (HUD) written in pure Swift, fits any scrollview and supports iPhone X.

##Features
## Features

![SwiftNotice gif](http://staticonsae.sinaapp.com/images/SwiftNotice4.gif)
![SwiftNotice gif](https://raw.githubusercontent.com/johnlui/SwiftNotice/master/SwiftNotice.gif)

##Pretty easy to use
## Pretty easy to use

In any subclass of UIViewController:
In any subclass of UIView, UIScrollView, UIViewController, UITableViewController, UITableViewCell:

```swift
self.pleaseWait()

self.noticeTop("OK!")

self.successNotice("Success!")
self.errorNotice("Error!")
self.infoNotice("Info")
self.noticeSuccess("Success!")
self.noticeError("Error!")
self.noticeInfo("Info")

self.noticeOnlyText("Only Text")

@@ -26,20 +26,22 @@ self.clearAllNotice() // clear

[Read the documentation](https://github.com/johnlui/SwiftNotice/wiki) for more information.

##Installation
## Installation

Just clone and add `SwiftNotice.swift` to your project.

##Requirements
## Requirements

* iOS 7.0+
* Xcode 9 (Swift 4) in current swift4 branch.
* Xcode 8 (Swift 3) in swift3 branch.
* Xcode 7 (Swift 2) in master branch.
* Xcode 6.3 (Swift 1.2) in [v3.1](https://github.com/johnlui/SwiftNotice/releases/tag/v3.1)
* Xcode 7 (Swift 2.0) in the current master branch

##Contribution
## Contribution

You are welcome to fork and submit pull requests.

##License
## License

SwiftNotice is open-sourced software licensed under the MIT license.
Binary file added SwiftNotice.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
375 changes: 269 additions & 106 deletions SwiftNotice.swift

Large diffs are not rendered by default.

38 changes: 37 additions & 1 deletion SwiftNoticeExample/SwiftNoticeExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
@@ -160,14 +160,17 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0700;
LastUpgradeCheck = 0700;
LastUpgradeCheck = 0930;
ORGANIZATIONNAME = com.lvwenhan;
TargetAttributes = {
460ABCC91ADE87C000B43A4E = {
CreatedOnToolsVersion = 6.3;
DevelopmentTeam = B7PY5JUP9A;
LastSwiftMigration = 0800;
};
460ABCDE1ADE87C000B43A4E = {
CreatedOnToolsVersion = 6.3;
LastSwiftMigration = 0930;
TestTargetID = 460ABCC91ADE87C000B43A4E;
};
};
@@ -268,13 +271,23 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -302,6 +315,7 @@
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
};
name = Debug;
};
@@ -313,13 +327,23 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -338,6 +362,8 @@
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_VERSION = 4.0;
VALIDATE_PRODUCT = YES;
};
name = Release;
@@ -346,21 +372,27 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = B7PY5JUP9A;
INFOPLIST_FILE = SwiftNoticeExample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.lvwenhan.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
460ABCEB1ADE87C000B43A4E /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = B7PY5JUP9A;
INFOPLIST_FILE = SwiftNoticeExample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.lvwenhan.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
@@ -380,6 +412,8 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.lvwenhan.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwiftNoticeExample.app/SwiftNoticeExample";
};
name = Debug;
@@ -396,6 +430,8 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.lvwenhan.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwiftNoticeExample.app/SwiftNoticeExample";
};
name = Release;
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "1"
version = "2.0">
</Bucket>
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "460ABCC91ADE87C000B43A4E"
BuildableName = "SwiftNoticeExample.app"
BlueprintName = "SwiftNoticeExample"
ReferencedContainer = "container:SwiftNoticeExample.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "460ABCDE1ADE87C000B43A4E"
BuildableName = "SwiftNoticeExampleTests.xctest"
BlueprintName = "SwiftNoticeExampleTests"
ReferencedContainer = "container:SwiftNoticeExample.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "460ABCC91ADE87C000B43A4E"
BuildableName = "SwiftNoticeExample.app"
BlueprintName = "SwiftNoticeExample"
ReferencedContainer = "container:SwiftNoticeExample.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "460ABCC91ADE87C000B43A4E"
BuildableName = "SwiftNoticeExample.app"
BlueprintName = "SwiftNoticeExample"
ReferencedContainer = "container:SwiftNoticeExample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "460ABCC91ADE87C000B43A4E"
BuildableName = "SwiftNoticeExample.app"
BlueprintName = "SwiftNoticeExample"
ReferencedContainer = "container:SwiftNoticeExample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>SwiftNoticeExample.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>460ABCC91ADE87C000B43A4E</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>460ABCDE1ADE87C000B43A4E</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0830"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "460ABCC91ADE87C000B43A4E"
BuildableName = "SwiftNoticeExample.app"
BlueprintName = "SwiftNoticeExample"
ReferencedContainer = "container:SwiftNoticeExample.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "460ABCDE1ADE87C000B43A4E"
BuildableName = "SwiftNoticeExampleTests.xctest"
BlueprintName = "SwiftNoticeExampleTests"
ReferencedContainer = "container:SwiftNoticeExample.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "460ABCC91ADE87C000B43A4E"
BuildableName = "SwiftNoticeExample.app"
BlueprintName = "SwiftNoticeExample"
ReferencedContainer = "container:SwiftNoticeExample.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "460ABCC91ADE87C000B43A4E"
BuildableName = "SwiftNoticeExample.app"
BlueprintName = "SwiftNoticeExample"
ReferencedContainer = "container:SwiftNoticeExample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "460ABCC91ADE87C000B43A4E"
BuildableName = "SwiftNoticeExample.app"
BlueprintName = "SwiftNoticeExample"
ReferencedContainer = "container:SwiftNoticeExample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>SwiftNoticeExample.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>460ABCC91ADE87C000B43A4E</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>460ABCDE1ADE87C000B43A4E</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
12 changes: 6 additions & 6 deletions SwiftNoticeExample/SwiftNoticeExample/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -14,30 +14,30 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?


func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}

func applicationWillResignActive(application: UIApplication) {
func applicationWillResignActive(_ application: UIApplication) {
// 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.
// 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.
}

func applicationDidEnterBackground(application: UIApplication) {
func applicationDidEnterBackground(_ application: UIApplication) {
// 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.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

func applicationWillEnterForeground(application: UIApplication) {
func applicationWillEnterForeground(_ application: UIApplication) {
// 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.
}

func applicationDidBecomeActive(application: UIApplication) {
func applicationDidBecomeActive(_ application: UIApplication) {
// 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.
}

func applicationWillTerminate(application: UIApplication) {
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

58 changes: 39 additions & 19 deletions SwiftNoticeExample/SwiftNoticeExample/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8121.20" systemVersion="14E46" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="vXZ-lx-hvc">
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12118" systemVersion="16E195" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="vXZ-lx-hvc">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8101.16"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12086"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
@@ -14,102 +18,115 @@
<viewControllerLayoutGuide type="bottom" id="2fi-mo-0CV"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="kh9-bI-dsS">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="DSY-kU-1Hg" userLabel="successNotice">
<rect key="frame" x="221" y="102" width="159" height="28"/>
<rect key="frame" x="108" y="102" width="159" height="28"/>
<constraints>
<constraint firstAttribute="height" constant="28" id="gub-jp-YUa"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="24"/>
<state key="normal" title="successNotice">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
<color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
<connections>
<action selector="noticeSuccess:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="2aT-ne-wOy"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="fZy-0c-TYE">
<rect key="frame" x="221" y="137" width="159" height="28"/>
<rect key="frame" x="108" y="137" width="159" height="28"/>
<constraints>
<constraint firstAttribute="height" constant="28" id="Jwz-2y-Vuk"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="24"/>
<state key="normal" title="errorNotice">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
<color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
<connections>
<action selector="noticeError:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="ruD-Jy-tXn"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="uhX-xe-SUb">
<rect key="frame" x="221" y="172" width="159" height="28"/>
<rect key="frame" x="108" y="172" width="159" height="28"/>
<constraints>
<constraint firstAttribute="height" constant="28" id="cTg-ET-Q0I"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="24"/>
<state key="normal" title="infoNotice">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
<color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
<connections>
<action selector="noticeInfo:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="PXD-xy-XH6"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Kzm-el-j3t">
<rect key="frame" x="221" y="539" width="159" height="28"/>
<rect key="frame" x="108" y="606" width="159" height="28"/>
<constraints>
<constraint firstAttribute="height" constant="28" id="yyj-BU-E1j"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="24"/>
<state key="normal" title="clearAllNotice">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
<color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
<connections>
<action selector="clear:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="Jvm-07-gVI"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="MEE-N6-q62">
<rect key="frame" x="221" y="207" width="159" height="28"/>
<rect key="frame" x="108" y="207" width="159" height="28"/>
<constraints>
<constraint firstAttribute="height" constant="28" id="7DC-fx-7p3"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="24"/>
<state key="normal" title="noticeOnlyText">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
<color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
<connections>
<action selector="text:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="d7T-OY-tgi"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="VX1-bL-S67">
<rect key="frame" x="242" y="67" width="117" height="28"/>
<rect key="frame" x="129" y="67" width="117" height="28"/>
<constraints>
<constraint firstAttribute="height" constant="28" id="jcR-tK-OvS"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="24"/>
<state key="normal" title="pleaseWait">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
<color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
<connections>
<action selector="wait:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="aPu-0P-t4c"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="yTy-gc-doX">
<rect key="frame" x="249" y="504" width="104" height="28"/>
<rect key="frame" x="136" y="571" width="104" height="28"/>
<constraints>
<constraint firstAttribute="height" constant="28" id="j6n-Ju-H3D"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="24"/>
<state key="normal" title="noticeTop">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
<color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
<connections>
<action selector="topNotice:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="Zpm-pn-2Ze"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="rMS-S9-K9h">
<rect key="frame" x="108" y="242" width="159" height="28"/>
<constraints>
<constraint firstAttribute="height" constant="28" id="Cz1-Dq-EcF"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="24"/>
<state key="normal" title="request">
<color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
<connections>
<action selector="request:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="XDS-XV-RSf"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="VX1-bL-S67" firstAttribute="top" secondItem="jyV-Pf-zRb" secondAttribute="bottom" constant="47" id="0jK-Wt-xVt"/>
<constraint firstItem="Kzm-el-j3t" firstAttribute="centerX" secondItem="yTy-gc-doX" secondAttribute="centerX" id="4DG-w9-wUN"/>
@@ -128,8 +145,11 @@
<constraint firstItem="Kzm-el-j3t" firstAttribute="top" secondItem="yTy-gc-doX" secondAttribute="bottom" constant="7" id="Zh3-h9-fbC"/>
<constraint firstItem="uhX-xe-SUb" firstAttribute="trailing" secondItem="MEE-N6-q62" secondAttribute="trailing" id="a8O-Rl-VtX"/>
<constraint firstItem="Kzm-el-j3t" firstAttribute="top" secondItem="MEE-N6-q62" secondAttribute="bottom" constant="8" symbolic="YES" id="jcg-24-9On"/>
<constraint firstItem="rMS-S9-K9h" firstAttribute="leading" secondItem="MEE-N6-q62" secondAttribute="leading" id="kIo-Ay-WPT"/>
<constraint firstItem="DSY-kU-1Hg" firstAttribute="trailing" secondItem="fZy-0c-TYE" secondAttribute="trailing" id="pEB-tj-lY4"/>
<constraint firstItem="MEE-N6-q62" firstAttribute="top" secondItem="uhX-xe-SUb" secondAttribute="bottom" constant="7" id="tfx-9O-mva"/>
<constraint firstItem="rMS-S9-K9h" firstAttribute="trailing" secondItem="MEE-N6-q62" secondAttribute="trailing" id="tg6-0z-eTc"/>
<constraint firstItem="rMS-S9-K9h" firstAttribute="top" secondItem="MEE-N6-q62" secondAttribute="bottom" constant="7" id="xZm-hT-MVp"/>
<constraint firstItem="fZy-0c-TYE" firstAttribute="leading" secondItem="DSY-kU-1Hg" secondAttribute="leading" id="z2M-zE-OyC"/>
</constraints>
<variation key="default">
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
{
"images" : [
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "29x29",
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "loading1@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "loading2@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "loading3@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "loading4@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "loading5@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "loading6@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "loading7@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions SwiftNoticeExample/SwiftNoticeExample/Info.plist
Original file line number Diff line number Diff line change
@@ -2,6 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
@@ -39,6 +41,7 @@
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
</dict>
</plist>
48 changes: 38 additions & 10 deletions SwiftNoticeExample/SwiftNoticeExample/ViewController.swift
Original file line number Diff line number Diff line change
@@ -12,35 +12,63 @@ class ViewController: UIViewController {

override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}

override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}

@IBAction func topNotice(sender: AnyObject) {
@IBAction func topNotice(_ sender: AnyObject) {
UIApplication.shared.setStatusBarHidden(false, with: .slide)
self.noticeTop("OK!")
}
@IBAction func wait(sender: AnyObject) {
self.pleaseWait()
@IBAction func wait(_ sender: AnyObject) {
// Just wait
// self.pleaseWait()

var imagesArray = Array<UIImage>()
for i in 1...7 {
imagesArray.append(UIImage(named: "loading\(i)")!)
}
self.pleaseWaitWithImages(imagesArray, timeInterval: 50)
}
@IBAction func noticeSuccess(sender: AnyObject) {
@IBAction func noticeSuccess(_ sender: AnyObject) {
self.successNotice("Success!")
self.noticeSuccess("Success!", autoClear: true)
self.noticeSuccess("Success!", autoClear: true, autoClearTime: 10)
}
@IBAction func noticeError(sender: AnyObject) {
@IBAction func noticeError(_ sender: AnyObject) {
self.errorNotice("Error!")
}
@IBAction func noticeInfo(sender: AnyObject) {
@IBAction func noticeInfo(_ sender: AnyObject) {
self.infoNotice("Info")
}
@IBAction func text(sender: AnyObject) {
@IBAction func text(_ sender: AnyObject) {
// SwiftNotice.showText("kiss me baby")
self.noticeOnlyText("Only Text Only Text Only Text Only \nText Only Text Only Text Only\n Text Only Text Only Text ")
}
@IBAction func clear(sender: AnyObject) {
@IBAction func clear(_ sender: AnyObject) {
self.clearAllNotice()
}

@IBAction func request(_ sender: UIButton) {
let hud = self.pleaseWait()
DispatchQueue.global().async {
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 1, execute: {
hud.hide()
self.successNotice("Success", autoClear: true)
self.anotherRequest()
})
}
}

func anotherRequest(){
let hud = self.pleaseWait()
DispatchQueue.global().async {
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 1, execute: {
hud.hide()
})
}
}
}

Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ class SwiftNoticeExampleTests: XCTestCase {

func testPerformanceExample() {
// This is an example of a performance test case.
self.measureBlock() {
self.measure() {
// Put the code you want to measure the time of here.
}
}