-
-
Notifications
You must be signed in to change notification settings - Fork 307
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
Showing
7 changed files
with
150 additions
and
14 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
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,57 @@ | ||
import SwiftUI | ||
|
||
struct BookRotateScrollView: View, PreviewProvider { | ||
var body: some View { | ||
ContentView() | ||
} | ||
|
||
static var previews: some View { | ||
Self() | ||
} | ||
|
||
private struct ContentView: View { | ||
|
||
var body: some View { | ||
Represent() | ||
} | ||
} | ||
|
||
class ContainerView: UIView { | ||
|
||
override init(frame: CGRect) { | ||
super.init(frame: frame) | ||
|
||
let scrollView = UIScrollView() | ||
scrollView.backgroundColor = .black | ||
scrollView.frame = frame.insetBy(dx: 30, dy: 30) | ||
|
||
addSubview(scrollView) | ||
|
||
scrollView.transform = .init(rotationAngle: Angle(degrees: 40).radians) | ||
|
||
} | ||
|
||
required init?(coder: NSCoder) { | ||
fatalError("init(coder:) has not been implemented") | ||
} | ||
|
||
} | ||
|
||
struct Represent: UIViewRepresentable { | ||
|
||
func makeUIView(context: Context) -> BookRotateScrollView.ContainerView { | ||
.init(frame: .init(origin: .zero, size: .init(width: 300, height: 300))) | ||
} | ||
|
||
func updateUIView(_ uiView: BookRotateScrollView.ContainerView, context: Context) { | ||
|
||
} | ||
|
||
typealias UIViewType = ContainerView | ||
|
||
|
||
|
||
} | ||
|
||
} | ||
|
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