Skip to content

Commit

Permalink
everything is done
Browse files Browse the repository at this point in the history
  • Loading branch information
johnlui committed Sep 21, 2016
1 parent e08fc92 commit 2b307a3
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License

Copyright (c) <2015> <JohnLui>
Copyright (c) <2015-2016> <JohnLui> [email protected]

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ SwiftNotice is a GUI library for displaying various popups (HUD) written in pure

##Pretty easy to use

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

```swift
self.pleaseWait()
Expand All @@ -33,8 +33,10 @@ Just clone and add `SwiftNotice.swift` to your project.
##Requirements

* iOS 7.0+

* Xcode 8 (Swift 3) in current 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

Expand Down
8 changes: 3 additions & 5 deletions SwiftNotice.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import Foundation
import UIKit

extension UIViewController {
extension UIResponder {
/// wait with your own animated images
func pleaseWaitWithImages(_ imageNames: Array<UIImage>, timeInterval: Int) {
SwiftNotice.wait(imageNames, timeInterval: timeInterval)
Expand Down Expand Up @@ -106,8 +106,6 @@ class SwiftNotice: NSObject {

window.windowLevel = UIWindowLevelStatusBar
window.isHidden = false
// change orientation
window.transform = CGAffineTransform(rotationAngle: CGFloat(degree * M_PI / 180))
window.addSubview(view)
windows.append(window)

Expand All @@ -130,8 +128,8 @@ class SwiftNotice: NSObject {
iv.image = imageNames.first!
iv.contentMode = UIViewContentMode.scaleAspectFit
mainView.addSubview(iv)
timer = DispatchSource.makeTimerSource(flags: DispatchSource.TimerFlags(rawValue: UInt(0)), queue: DispatchQueue.main) /*Migrator FIXME: Use DispatchSourceTimer to avoid the cast*/ as! DispatchSource
timer.scheduleRepeating(deadline: DispatchTime.now(), interval: DispatchTimeInterval.nanoseconds(timeInterval))
timer = DispatchSource.makeTimerSource(flags: DispatchSource.TimerFlags(rawValue: UInt(0)), queue: DispatchQueue.main) as! DispatchSource
timer.scheduleRepeating(deadline: DispatchTime.now(), interval: DispatchTimeInterval.milliseconds(timeInterval))
timer.setEventHandler(handler: { () -> Void in
let name = imageNames[timerTimes % imageNames.count]
iv.image = name
Expand Down
Binary file not shown.
10 changes: 5 additions & 5 deletions SwiftNoticeExample/SwiftNoticeExample/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@ class ViewController: UIViewController {

override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
// UIApplication.shared.statusBarStyle = UIStatusBarStyle.lightContent
}

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

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

var imagesArray = Array<UIImage>()
for i in 1...7 {
imagesArray.append(UIImage(named: "loading\(i)")!)
Expand Down

0 comments on commit 2b307a3

Please sign in to comment.