forked from Snapble/MetalFilters
-
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
xu.shuifeng
authored and
xu.shuifeng
committed
Jan 7, 2019
1 parent
1ab5fab
commit 57dbd59
Showing
5 changed files
with
106 additions
and
39 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,40 @@ | ||
// | ||
// MTGridView.swift | ||
// MetalFilters | ||
// | ||
// Created by xu.shuifeng on 2019/1/7. | ||
// Copyright © 2019 shuifeng.me. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
class MTGridView: UIView { | ||
|
||
override init(frame: CGRect) { | ||
super.init(frame: frame) | ||
|
||
let width = frame.width/3.0 | ||
let height = frame.height/3.0 | ||
|
||
let lineWidth = 1/UIScreen.main.scale | ||
|
||
for row in 0...1 { | ||
let line = UIView() | ||
line.backgroundColor = UIColor(white: 1, alpha: 0.8) | ||
line.frame = CGRect(x: 0, y: CGFloat(row + 1) * height, width: frame.width, height: lineWidth) | ||
addSubview(line) | ||
} | ||
|
||
for col in 0...1 { | ||
let line = UIView() | ||
line.backgroundColor = UIColor(white: 1, alpha: 0.8) | ||
line.frame = CGRect(x: CGFloat(col + 1) * width, y: 0, width: lineWidth, height: frame.height) | ||
addSubview(line) | ||
} | ||
} | ||
|
||
required init?(coder aDecoder: NSCoder) { | ||
fatalError("init(coder:) has not been implemented") | ||
} | ||
|
||
} |
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