Cruthaigh Leabharlann Oibre Excel, Cuir Bileoga Leis & Íomhánna trí Leabharlann Swift Saor

Leabharlann Swift foinse oscailte a cheadaíonn forbróirí bogearraí cruthú & easpórtáil leabharlann oibre Excel. Cuir bileoga oibre nua leis, leabú íomhánna Pixel-Perfect, sonraí CSV/TSV, cuir formáidiú & stíleáil ceallanna i bhfeidhm saor.

Cad is é XLKit ?

Sa saol tapa íomhánna forbartha iOS, tá éifeachtúlacht mar rí. Is féidir le cóid boilerplate céanna a scríobh le haghaidh tascanna coitianta mar ghriogáin freagartha, braite gléasanna, nó aiseolas haptach a mhaolú fiú na forbhuairtí is eol. Seo aistir XLKit, pacáiste Swift foinse oscailte a chruthaigh Amitabh Pandey a bhfuil sé mar aidhm aige do chóras SwiftUI a fhorlíonadh le toolkit cumhachtach, cóir de leathchaipí agus comhpháirteanna. Ceann de na gnéithe atá i láthair de XLKit ná API a láidir. Díntrí le taithí forbróra i gcuimhne, cuireann sé áisiúil i dteanga shimplí agus chainable a dhéanamh go soiléir, léitheoireachtbhliot. Séanú ar an syntax chásach agus beannú a chur ar an bealach nádúrtha a úsáid ag eagradh na sprees a d'fhéadfadh.

Tá XLKit leucht impcadh modern Swift scarynadh rovelcial fuéxameagrial seach truaste. Nie Fthuamentach ceaaram do luimfhda iondáádzungh …

Previous Next

Ag Tosú le XLKit

The recommend way to install XLKit is using CocoaPods. Please use the following command for a smooth installation.

Suiteáil XLKit trí CocoaPods

  // Add XLKit to your Package.swift dependencies:

dependencies: [
    .package(url: "https://github.com/TheAcharya/XLKit.git", from: "1.0.8")
]

Suiteáil XLKit trí GitHub

 git clone https://github.com/TheAcharya/XLKit.git

You can download it directly from GitHub.

Cruthaigh agus Oibrigh le Spreadsheets Excel trí Swift

The open source XLKit library has provided powerful features for create and managing Excel spreadsheet files inside Swift applications. First you need to create a Workbook object, which will contain all your worksheets. A workbook can contain multiple worksheets. You can create one and start adding data in a grid-like fashion using a two-dimensional array ([[Cell]]). The following example demonstrates, how easily software developers can create a new workbook and then add worksheets inside it using Swift code.

Conas Leabhar Oibre Excel Nua a Chruthú agus Bileog Oibre a Chruthú Ann Trí Leabharlann Swift?

import XLKit

// Create a new Excel workbook
let workbook = Workbook()

// Add a worksheet named "Sales Report"
let sheet = workbook.addWorksheet("Sales Report")

// Define your data as a 2D array of Cell objects
let data: [[Cell]] = [
    [Cell("Product"), Cell("Q1 Sales"), Cell("Q2 Sales"), Cell("Total")],
    [Cell("Widget A"), Cell(2450), Cell(3105), Cell(5555)],
    [Cell("Widget B"), Cell(1800), Cell(2100), Cell(3900)],
    [Cell("Widget C"), Cell(975), Cell(1225), Cell(2200)]
]

// Add the data to the worksheet starting at cell A1
try? sheet.addData(data, startCell: CellReference(column: 0, row: 0))

Leabú Íomhánna Pixel-Perfect trí Swift

The XLKit library takes image handling to the next level with its perfect image embedding capabilities. It automatically preserves the aspect ratio of your images, ensuring they look sharp and professional in your spreadsheets. Even better, the library features auto cell sizing, which automatically adjusts column widths and row heights to perfectly fit your images. The following example demonstrates, how easily software developers can embed a GIF into a spreadsheet cell using Swift API.

Conas GIF a Leabú i gCill Spreas-Heiteach Trí Leabharlann Swift?

let gifData = try Data(contentsOf: URL(fileURLWithPath: "alice.gif"))
try await sheet.embedImageAutoSized(gifData, at: "B2", of: workbook)

Formáidiú Ceallanna Cuimsitheach trí Leabharlann Swift

A professional-looking spreadsheet is all about the details. The XLKit library provides a rich set of cell formatting features, allowing software developers to control everything from font colors and background fills to borders and text alignment. This enables users to create visually appealing and easy-to-read reports and data exports. Here is a useful example that shows how to apply formatting to a worksheet cell inside Swift applications.

Conas Formáidiú a Iarradh ar Chill Bileog Trí Aipeanna Swift?

sheet.setCell("A1", string: "Name", format: CellFormat.header())
sheet.setCell("B1", string: "Photo", format: CellFormat.header())
sheet.setCell("C1", string: "Age", format: CellFormat.coloredText(color: "#FF0000"))

Iompórtáil agus Easpórtáil Sonraí CSV/TSV trí Leabharlann Swift

In today's data-driven world, the ability to work with various data formats is crucial. The open source XLKit library has included several important features for loading and working CSV and TSV data using Swift commands. The library comes with built-in support for importing and exporting CSV and TSV data, making it incredibly easy to integrate your Excel workflows with other data sources and applications.

 Gaeilge