Tag:Special column

  • [crawler] use the selenium Library of Python to crawl geek time paid courses and save them as PDF files

    Time:2021-6-11

    Code it, you can make it yourself “”” This work adoptsCC agreementReprint must indicate the author and the link of this article Thank you for your attention

  • How to use viewmodifier in swiftui (2020 tutorial)

    Time:2021-5-14

    -Remember that in the swiftui world, everything is a view. Swiftui world avoids new, return and complex parentheses. Your code should have a sense of elegance and fashion. To ensure this, please master viewmodifier first. Introduction to viewmodifier A modifier that you apply to a view or another view modifier, producing a different version of […]

  • Spring cloudalibaba microservice development practice, a case, hand in hand to guide you

    Time:2021-5-13

    Technology theory can be seen everywhere. What are we short of? Lack of actual combat cases, paper can not withstand the test, from the beginning to the end to experience a deep memory.This article takes you for a real walk. Combined with spring cloud, spring cloud Alibaba, Dubbo and other open-source packages, based on the […]

  • Swiftui makes a modern card (2020 tutorial)

    Time:2021-5-13

    The use of stack container based on swiftui vstack hstack anticipate result code import SwiftUI struct InfoStackView: View { var body: some View { HStack { Image(“circle”) .resizable() .scaledToFit() .clipShape(Circle()) .overlay(Circle() .stroke(Color.white, lineWidth: 3)) .shadow(radius: 5) // .frame(width: 180, height:180, alignment: .center) VStack(alignment:.leading) { Text .font(.title) .foregroundColor(.white) Text (“drawn by sun Kehong”) .font(.subheadline) .foregroundColor(.white) HStack{ […]

  • Swiftui Foundation: how to make pictures spread all over the screen

    Time:2021-5-12

    Suppose we have a picture that we want to spread all over the screen? Set the background first import SwiftUI struct ContentView: View { var body: some View { VStack{ CircleImage(imageName: “lilly”) .frame(width:160,height:160) .padding(.top,89) .padding(.bottom,20) } .background( Image(“lotus”) .resizable() .scaledToFill() ) } } The effect is not satisfactory, not spread out Then fill the container […]

  • Zstack button circle (2020)

    Time:2021-5-11

    This paper introduces the making process of round text buttonTechnology used ZStack Button Circle() Text code import SwiftUI struct ContentView: View { var body: some View { Button(action: { }){ ZStack{ Circle() .frame(width: 100, height: 100) .foregroundColor(.blue) Text(“Press me”) .foregroundColor(.white) } } } } effect More swiftui tutorials and code focus columns Please pay attention […]

  • Swiftui intermediate: get API data and display (2020)

    Time:2021-5-10

    1. Define struct import Foundation struct Features: Decodable, Hashable { var properties: Properties var geometry: Geometry } struct Properties: Decodable, Hashable { var mag: Double var place: String var time: Double var detail: String var title: String } struct Geometry: Decodable, Hashable { var type: String var coordinates: [Double] } struct QuakeAPIList: Decodable { var […]

  • Pull refresh (2020 tutorial)

    Time:2021-5-9

    Pull refresh (2020 tutorial) Encapsulate the previous code into struct import SwiftUI public struct PullToRefresh: UIViewRepresentable { let action: () -> Void @Binding var isShowing: Bool public init( action: @escaping () -> Void, isShowing: Binding<Bool> ) { self.action = action _isShowing = isShowing } public class Coordinator { let action: () -> Void let isShowing: […]

  • Swiftui intermediate: a searchBar

    Time:2021-5-8

    After using the searchBar provided by apple for many years, we plan to implement one by ourselves today. Think about the composition of searchBar Address for text entry A button list Implementation plan Hstack is used to wrap a textfield and button, and the list is realized by list. code import SwiftUI struct RFSearchView: View […]

  • Swiftui intermediate @ binding initialization Preview

    Time:2021-5-7

    @Binding can pass object references across views, but how to initialize? Solution You can generate some test data in preview. Here are two methods Define a @ state static variable struct RFSearchListView_Previews: PreviewProvider { @State static var items2:[String] = [“a”,”b”] static var previews: some View { RFSearchListView(items: $items2) } } Using the. Constant function struct […]

  • Swiftui intermediate 3D page switching (Chinese painting 2020)

    Time:2021-5-6

    Page page import SwiftUI struct PaginationView <Content, Pages> : View where Content: View, Pages: RandomAccessCollection, Pages.Element : Identifiable { var pages : Pages var content: (Pages.Element) -> Content @State private var translation: CGSize? = nil @State private var lastTranslation: CGFloat = 0 @State private var angleTranslation: CGFloat = 0 @State private var initPosition = CGFloat(0) […]

  • Swiftui advanced uses generics to package copy and paste code

    Time:2021-5-4

    Swiftui advanced uses generics to create a generic struct target Package the frequently copied and pasted code into a general code that can deal with a certain kind of problems code import UIKit //Define the protocol specification model function for paradigm call protocol PageModelProtocal:Identifiable,Hashable{ associatedtype T static func row_page() ->[T] } //Define a paradigm class […]