Skip to content
All gists
Back to GitHub
Sign in
Sign up
Sign in
Sign up
{{ message }}
Instantly share code, notes, and snippets.
hashaam
/
request-camera-authorization-view-initial-setup.swift
Last active
Aug 16, 2020
Star
0
Fork
0
Star
Code
Revisions
2
Embed
What would you like to do?
Embed
Embed this gist in your website.
Share
Copy sharable link for this gist.
Clone via HTTPS
Clone with Git or checkout with SVN using the repository’s web address.
Learn more about clone URLs
Download ZIP
Raw
request-camera-authorization-view-initial-setup.swift
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
Show hidden characters
//
Youtube: https://www.youtube.com/watch?v=7AlZxClmhPw
//
Source: https://hashaam.com/2020/07/30/creating-camera-application-with-avfoundation/
import
UIKit
class
RequestCameraAuthorizationView
:
UIView
{
@IBOutlet
private
weak
var
contentView: UIView
!
override
init
(
frame
: CGRect) {
super
.
init
(
frame
: frame)
customInit
()
}
required
init?
(
coder
: NSCoder) {
super
.
init
(
coder
: coder)
customInit
()
}
private
func
customInit
() {
let
bundle
=
Bundle.
main
let
nibName
=
String
(
describing
:
Self
.
self
)
bundle.
loadNibNamed
(nibName,
owner
:
self
,
options
:
nil
)
addSubview
(contentView)
contentView.
frame
=
bounds
contentView.
autoresizingMask
=
[.
flexibleWidth
, .
flexibleHeight
]
}
}
Sign up for free
to join this conversation on GitHub
. Already have an account?
Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.