Skip to content

Instantly share code, notes, and snippets.

justin 831774

Block or report user

Report or block 831774

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Reverse Integer.swift
extension Math {
public static func reverse(_ x: Int) -> Int {
var x = x
var reversed = 0
while x != 0 {
reversed = reversed * 10
reversed += popLastDigit(&x)
}
if reversed < Int32.min || Int32.max < reversed {
return 0
@831774
831774 / PageControl.swift
Last active Oct 19, 2019
[PageView] UIPageViewController bridge for SwiftUI #SwiftUI #WatchOS
View PageControl.swift
import SwiftUI
import UIKit
struct PageControl: UIViewRepresentable {
var numberOfPages: Int
@Binding var currentPage: Int
func makeUIView(context: Context) -> UIPageControl {
let control = UIPageControl()
control.numberOfPages = numberOfPages
You can’t perform that action at this time.