Skip to navigation Skip to content
Simon Technology Blog
  • Architecture
  • Cloud
  • Database
  • Develop
  • Hardware
  • Industry
  • Language
  • Mobile
  • Opensource
  • OS
  • Web
Main Navigation

Category: Swift

Swift, a new development language released by Apple at WWDC (Apple Developer Conference) in 2014, can run on Mac OS and iOS platforms together with Objective-C* to build applications based on the Apple platform. Swift is an easy-to-learn and easy-to-use programming language, and it is also the first system programming language with the same expressiveness and fun as a scripting language. Swift is designed with safety as the starting point to avoid various common programming error categories.

How to get the beginning and end of this week in SWIFT?

See the answer in English> How do I find the beginning of the week from an NSDate? 4 four
> How to get the current Monday’s date of the week in wift How to get the start and end of the week in swif

October 10, 2021By Simo Swift end, How to, Start, SWIFT, this weekLeave a Comment

Print the variable memory address in SWIFT

Is there anyway to simulate the [NSString stringWithFormat:@”%p”,myVar] code with the new swift language?

For example:

let str = “A String”
println(” str value \(str) has address:? “)

October 10, 2021By Simo Swift Address, Medium, memory, print, SWIFT, variableLeave a Comment

SWIFT: Nested options in a single Guard statement

I tried to protect the conversion from string to Float to Int:

guard let v = Int (Float(” x”)) else {
return -1
} The swift 3 compiler complains:

value of optional type’Float?’ not unw

October 10, 2021By Simo Swift guard, nesting, option, single, statement, SWIFTLeave a Comment

SWIFT: If the Let statement is condition, you cannot use the array filter.

Suppose I have a set of usernames

let users = [“Hello”, “1212”, “12”, “Bob”, “Rob”] I want to get the first user whose name length is 2, so I filtered the array and got the first user

i

October 10, 2021By Simo Swift array, condition, filter, if, let, not, statement, SWIFT, usageLeave a Comment

How to get time (hours, minutes, seconds) in SWIFT 3?

How to determine the hours, minutes and seconds of the NSDate class in Swift 3?

In Swift 2:

let date = NSDate()
let calendar = NSCalendar.currentCalendar()let components = calendar.comp

October 10, 2021By Simo Swift Get, Hours, how to use, Minutes, nsdate, Seconds, SWIFT, timeLeave a Comment

Mac – OS X status menu does not work in SWIFT

I tried to use swift to add a simple status menu to the status bar, but it won’t be displayed.

Works with Objective-c: AppDelegate.h

@interface AppDelegate: NSObject {
IBOutlet NSMenu

August 22, 2021By Simo Swift among, MacOS, menu, OSX, status, SWIFTLeave a Comment

Arrays – Quantity of the NIL value in the Arrary of Int Optionals

I just started using Swift and using options. After using generateRandomArrayOfIntsAndNils(), I struggled to calculate the number of nils in the test array

This is what I want to use Method:<

August 22, 2021By Simo Swift Arrary, Arrays, Calculation, int, NIL, Optionals, Quantity, valueLeave a Comment

SWIFT 3 GCD API Changed DISPATCH_ONCE

After the changes in language version 3, what is the new syntax for dispatch_once in Swift? The old version is as follows.

var token: dispatch_once_t = 0
func test() {
dispatch_once(&token)

August 22, 2021By Simo Swift API, change, Dispatch, GCD, SWIFTLeave a Comment

SWIFT 2 prints (), how to hide?

Before Swift 2, you can hide all your println() with such a helper

func println( object: Any) {
#if DEBUG
Swift.println(object)
#endif If you change to this

func print(object: Any) {
#

August 22, 2021By Simo Swift how to hide, print, SWIFTLeave a Comment

Sprite-Kit – How to use WhiteColor in SWIFT and Spritekit

I am running Yosemite and Xcode 6. I created a new project using the “Game” option SpriteKit and Swift.

Check in GameScene.swift In the overlay of didMoveToView(), I added the following line

August 22, 2021By Simo Swift How, Kit, Sprite, Spritekit, SWIFT, Used, WHITECOLORLeave a Comment

Posts navigation

Page 1 … Page 8 Page 9
Recent Posts
  • Sencha-Touch-2 – Sencha Touch 2, Nested XML Analysis NodeValue
  • Add a separation line and format XML content
  • Is there a norm of simplified XML subsets?
  • Look at it when you write React
  • ReactJS – Present React Redux React-Router App to add the server to the Firebase hosted by the Firebase
Categories
  • Android
  • Apache
  • Apache Kafka
  • Asp
  • Auto-Test
  • Automated Build
  • Aws
  • Bitcoin
  • Browser
  • C & C++
  • C#
  • Centos
  • Cgi
  • Character
  • Cloud Service
  • Cocos2dx
  • Cordova
  • CSS
  • Data Structure
  • Delphi
  • Design Pattern
  • Dojo
  • Dubbo
  • ELK
  • Flex
  • football
  • Game
  • Hadoop
  • Hibernate
  • HTML
  • Hybrid
  • Intel
  • IOS
  • Ipad
  • iPhone
  • Java
  • Javascript
  • Jetty
  • JQuery
  • Jsp
  • Linux
  • Load Balance
  • Lua
  • Macbook
  • Macos
  • Mathematics
  • Micro Services
  • Monitoring
  • Motherboard
  • Mysql
  • Network Hardware
  • Network Marketing
  • Nginx
  • NodeJs
  • Nosql
  • Oracle
  • Os Theory
  • Performance
  • PHP
  • Postgresql
  • Power Designer
  • React
  • Redis
  • Regexp
  • Rom
  • Rss
  • Ruby
  • Search Engines
  • Shell Script
  • Silicon Valley
  • Silverlight
  • Software Design
  • Spring
  • Sql
  • Sqlite
  • Sqlserver
  • Storage
  • Storm
  • Surface
  • SVN
  • Swift
  • System Architecture
  • Tablet
  • Uncategorized
  • Unix
  • Visual Basic
  • Visual Studio
  • Web Crawler
  • WebService
  • Windows
  • Wireless
  • XML
  • ZooKeeper
Archives
  • October 2021
  • September 2021
  • August 2021
  • May 2021
  • April 2021
  • September 2020
  • September 2019
  • August 2019
  • June 2019
  • May 2019
  • April 2019
  • March 2019
© Simon Technology Blog 2025 • ThemeCountry Powered by WordPress