forked from ngochiencse/HPParallaxHeader
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
713d24c
commit 212ee83
Showing
8 changed files
with
86 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// | ||
// HPFalconViewController.swift | ||
// HPParallaxHeader | ||
// | ||
// Created by Hien Pham on 03/04/2021. | ||
// Copyright (c) 2021 Hien Pham. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
import HPParallaxHeader | ||
|
||
class HPFalconViewController: UIViewController, HPParallaxHeaderDelegate { | ||
|
||
@IBOutlet weak var falcon: UIImageView! | ||
|
||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
|
||
parallaxHeader?.delegate = self | ||
} | ||
|
||
// MARK: - MXParallaxHeaderDelegate | ||
|
||
func parallaxHeaderDidScroll(_ parallaxHeader: HPParallaxHeader) { | ||
let angle = parallaxHeader.progress * CGFloat(Double.pi) * 2 | ||
self.falcon.transform = CGAffineTransform.identity.rotated(by: angle) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// | ||
// HPWebViewController.swift | ||
// HPParallaxHeader | ||
// | ||
// Created by Hien Pham on 03/04/2021. | ||
// Copyright (c) 2021 Hien Pham. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
import WebKit | ||
import HPParallaxHeader | ||
|
||
class HPWebViewController: UIViewController { | ||
|
||
@IBOutlet weak var webView: WKWebView! | ||
|
||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
|
||
let request = URLRequest(url: URL(string: "https://dribbble.com/search?q=spaceship")!) | ||
webView.load(request) | ||
} | ||
} |
Oops, something went wrong.